officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 4 - vcl/source/helper/commandinfoprovider.cxx | 22 +++------- vcl/source/window/menu.cxx | 17 +++++++ 3 files changed, 26 insertions(+), 17 deletions(-)
New commits: commit fe7c8e4ec1990f33d325d3fcabdce30ef4f74465 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Thu Feb 23 22:20:18 2017 +0200 Closing popup menu should close the parent toolbox ... if that toolbox is in popup mode (e.g. shapes toolbar dropdowns, or the toolbar overflow floater). Same behavior was introduced for non menu based dropdowns in 81d4fbc0daa54889ccb09e6a3fadff9c70d99448 ("tdf#42029 Use a floating toolbar to show clipped items"), and is similar to what we had already in ToolBox::Select, i.e. when the user made a selection, the floating windows should close. This must be done before executing the menu selection handler, because such handler might execute stuff synchronously (e.g. MenuBarManager::Select), and if it will open a modal dialog, the floating toolbox will stay visible after the dialog shows. Change-Id: Ie93e71fa4dea80ba444aebccacf6adb926a39224 diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 48055ff..e76662b 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -113,6 +113,20 @@ static void ImplSetMenuItemData( MenuItemData* pData ) pData->eType = MenuItemType::STRINGIMAGE; } +namespace { + +void ImplClosePopupToolBox( const VclPtr<vcl::Window>& pWin ) +{ + if ( pWin->GetType() == WindowType::TOOLBOX && ImplGetDockingManager()->IsInPopupMode( pWin ) ) + { + ImplDockingWindowWrapper* pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( pWin ); + if ( pWrapper && pWrapper->GetFloatingWindow() ) + pWrapper->GetFloatingWindow()->EndPopupMode( FloatWinPopupEndFlags::CloseAll ); + } +} + +} + Menu::Menu() : mpFirstDel(nullptr), pItemList(new MenuItemList), @@ -3022,6 +3036,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangl pWin->doShutdown(); pWindow->doLazyDelete(); pWindow = nullptr; + ImplClosePopupToolBox(pW); ImplFlushPendingSelect(); return nSelectedId; } @@ -3082,7 +3097,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangl pWin->doShutdown(); pWindow->doLazyDelete(); pWindow = nullptr; - + ImplClosePopupToolBox(pW); ImplFlushPendingSelect(); } commit 6dc453db7ad693cd960170c35245929ea539ba15 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Thu Feb 23 09:52:46 2017 +0200 Adapt insert image label for the context menu ... after commit fde6bbe41d3d8e13b6d3dc3f18e5ddcd10cfe5f0 ("right click to insert image"), added .uno:InsertGraphic to the slide's context menu. Change-Id: Ib801899c17cc4f765f46fd4b8884e6b57b455f6d diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 0b860f7..d9733de 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -3549,8 +3549,8 @@ <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">~Image...</value> </prop> - <prop oor:name="TooltipLabel" oor:type="xs:string"> - <value xml:lang="en-US">Insert Image</value> + <prop oor:name="PopupLabel" oor:type="xs:string"> + <value xml:lang="en-US">Insert Image...</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> commit 89c05973ff57eea1bc6c9cdc9e7dc13796e7d339 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Thu Feb 23 09:43:24 2017 +0200 Remove the intermediate xModel variables And make sure to check for a nullptr xController in GetBitmapForCommand. Change-Id: Ib62bc06d0708847cfec54a71209cf68a4c32a50d diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 755d41f..931900a 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -85,18 +85,14 @@ Reference<ui::XAcceleratorConfiguration> const GetDocumentAcceleratorConfigurati Reference<frame::XController> xController = rxFrame->getController(); if (xController.is()) { - Reference<frame::XModel> xModel (xController->getModel()); - if (xModel.is()) + Reference<ui::XUIConfigurationManagerSupplier> xSupplier(xController->getModel(), UNO_QUERY); + if (xSupplier.is()) { - Reference<ui::XUIConfigurationManagerSupplier> xSupplier (xModel, UNO_QUERY); - if (xSupplier.is()) + Reference<ui::XUIConfigurationManager> xConfigurationManager( + xSupplier->getUIConfigurationManager()); + if (xConfigurationManager.is()) { - Reference<ui::XUIConfigurationManager> xConfigurationManager( - xSupplier->getUIConfigurationManager()); - if (xConfigurationManager.is()) - { - return xConfigurationManager->getShortCutManager(); - } + return xConfigurationManager->getShortCutManager(); } } } @@ -314,10 +310,8 @@ BitmapEx GetBitmapForCommand(const OUString& rsCommandName, try { - Reference<frame::XController> xController(rxFrame->getController()); - Reference<frame::XModel> xModel(xController->getModel()); - - Reference<ui::XUIConfigurationManagerSupplier> xSupplier(xModel, UNO_QUERY); + Reference<frame::XController> xController(rxFrame->getController(), UNO_SET_THROW); + Reference<ui::XUIConfigurationManagerSupplier> xSupplier(xController->getModel(), UNO_QUERY); if (xSupplier.is()) { Reference<ui::XUIConfigurationManager> xDocUICfgMgr(xSupplier->getUIConfigurationManager()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits