vcl/source/window/menu.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 25da92004038c03c0feedf373e8038e7ee3e0c37
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Jul 21 11:33:02 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Jul 21 17:10:09 2022 +0200

    Make JunitTest_toolkit_unoapi_1 succeed again on macOS
    
    ...after afc828b9833b7a612369e95606ba56d41ef2c369 "VCL expect correct frame 
size
    for native menubars" caused it to fail with
    
    [...]
    > checking: 
[toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleComponent] 
is iface: [com.sun.star.accessibility.XAccessibleComponent] testcode: 
[ifc.accessibility._XAccessibleComponent]
    > LOG> Execute: containsPoint()
    > LOG> Upper bound of box containsPoint no component points - FAILED
    > LOG> Lower bound of box containsPoint no component points - FAILED
    > LOG> Left bound of box containsPoint no component points - FAILED
    > LOG> Right bound of box containsPoint no component points - FAILED
    > LOG> Outer upper and lower bounds contain no component points - OK
    > LOG> Outer left and right bounds contain no component points - OK
    > Method containsPoint() finished with state FAILED
    > LOG> containsPoint(): COMPLETED.FAILED
    [...]
    > LOG> Execute: getBounds()
    > LOG> Bounds = (0,0),(0,0)
    > Method getBounds() finished with state FAILED
    > LOG> getBounds(): COMPLETED.FAILED
    [...]
    > LOG> Execute: getSize()
    > LOG> starting required method: getBounds()
    > LOG> ! Required method getBounds() failed
    > LOG> getSize(): COMPLETED.FAILED
    [...]
    > ***** State for 
toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleComponent 
******
    > 
[toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleComponent::containsPoint()]
 is testcode: [containsPoint()] - COMPLETED.FAILED
    > 
[toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleComponent::getBounds()]
 is testcode: [getBounds()] - COMPLETED.FAILED
    > 
[toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleComponent::getSize()]
 is testcode: [getSize()] - COMPLETED.FAILED
    
    > Whole interface: COMPLETED.FAILED
    > 
**************************************************************************************************
    [...]
    > ***** State for toolkit.AccessibleMenu ******
    > 
[toolkit.AccessibleMenu::com::sun::star::accessibility::XAccessibleComponent] 
is testcode: [ifc.accessibility._XAccessibleComponent] - COMPLETED.FAILED
    
    > Whole component: COMPLETED.FAILED
    > *********************************************
    [...]
    
    I have no idea whether that test legitimately started to fail, or is itself
    bogus, and (if the former) whether adding back the call to ImplCalcSize in
    MenuBar::ImplCreate is the best way to fix this.
    
    Change-Id: I8b575c66c57a698c59ccab01698df5355d4553bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136996
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 811d4ea360fb..cb110281ee66 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2453,6 +2453,11 @@ VclPtr<vcl::Window> MenuBar::ImplCreate(vcl::Window* 
pParent, vcl::Window* pWind
     pMenu->pStartedFrom = nullptr;
     pMenu->pWindow = pMenuBarWindow;
     pMenuBarWindow->SetMenu(pMenu);
+    if (pMenuBarWindow) {
+        // This is needed at least on macOS to make the 
JunitTest_toolkit_unoapi_1
+        // toolkit.AccessibleMenu test pass:
+        pMenu->ImplCalcSize(pMenuBarWindow);
+    }
 
     return pMenuBarWindow;
 }

Reply via email to