Problem description: Steps to reproduce: 1. RUN the macro code lines.... 2. .... 3. .... Current behavior:no Window is visible Expected behavior: visible empty Window Operating System: Windows XP Version: 4.0.0.2 rc Last worked in: 3.6.4.3 release
the code below was confirmed to work still for Fedora and Linux but not for Windows sinds 4.0 "oWindow.setVisible(True)" is failing Sub Main oDoc = ThisComponent oParentFrame = oDoc.CurrentController.Frame oPeer = oParentFrame.ContainerWindow oToolkit = oPeer.Toolkit oWindow = CreateNewWindow(oToolkit,oPeer,150,150,200,200) oFrame = CreateUnoService("com.sun.star.frame.Frame") oFrame.initialize(oWindow) oFrame.setCreator(oParentFrame) oFrame.setName("NewFrame") oFrame.Title = "New Frame" oParentFrame.getFrames().append(oFrame) oWindow.setVisible(True) End Sub Function CreateNewWindow( _ oToolkit,oParent,nX,nY,nWidth,nHeight) As Object aRect = CreateUnoStruct("com.sun.star.awt.Rectangle") With aRect .X = nX .Y = nY .Width = nWidth .Height = nHeight End With aWinDesc = CreateUnoStruct("com.sun.star.awt.WindowDescriptor") With aWinDesc .Type = com.sun.star.awt.WindowClass.TOP .WindowServiceName = "dialog" .ParentIndex = -1 .Bounds = aRect .Parent = oParent .WindowAttributes = _ com.sun.star.awt.WindowAttribute.MOVEABLE + _ com.sun.star.awt.WindowAttribute.CLOSEABLE End With CreateNewWindow = oToolkit.createWindow(aWinDesc) End Function
Thanks for reporting this I was able to confirm it. The Basic Macro seems to work correctly on 3.6.5.2 (see attached screenshot). I get no reaction at all on 4.0.0.2. Tested on W8 Pro 32 bit, Libreoffice Version 4.0.0.2 .0.2 (Build ID: 5991f37846fc3763493029c4958b57282c2597e). I am initially classifying this as minor / medium - requires users not to use some features as per following flow.. https://wiki.documentfoundation.org/images/0/06/Prioritizing_Bugs_Flowchart.jpg
interesting, it seems that the position and size seem to be corrupted/changed, it is possible though workaround the problem bet resetting again the window possize like oWindow.setVisible(True) flags = com.sun.star.awt.PosSize.POSSIZE oWindow.setPosSize( 150,150,200,200, flags) don't know why this doesn't happen on linux ( maybe it actually does but just not as badly ) or even when the size/pos is changed. I will try to find out, I will take this bug for a while and see if I can get further, if not I will push back to the list
Yeah, it happens under Linux too that the embedded rectangle struct inside the WindowDescriptor struct is passed through uno with zeroed out values, its just that the linux-specific code applies a default size to the dialog them
so, nearly there, I just need to pimp up the basic tests to try and catch any other 'funnies' with this. Ironically this was caused by a change to basic to make it do what you would 'expect' when modifying nested basic structs ( that themselves contain a struct )... the patch nastily made basic internally think that such modifications worked as expected but unfortunately when the basic object was exposed to the outside world ( e.g. over uno ) it turns out in fact it hadn't been modified as expected. Worse even looking at the object in the watch window and it looked like the nested struct was populated ( reminds me that's another thing to check ) see bug #47263 ( and the associated guilt commit http://cgit.freedesktop.org/libreoffice/core/commit/?id=1720641bf36306fc296635925e571556ced8a302 ) for more details
Noel Power committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6865445a5ec90b49c5fde58531def4b9a64f26e8 fix basic access to nested uno structures fdo#60117 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
review requested also for 4-0 branch, please see https://gerrit.libreoffice.org/#/c/2099/
Noel Power committed a patch related to this issue. It has been pushed to "libreoffice-4-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a8de73a911c03b518abffcaeba871672159d2ce4&h=libreoffice-4-0 fix basic access to nested uno structures fdo#60117 It will be available in LibreOffice 4.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
*** Bug 60878 has been marked as a duplicate of this bug. ***