diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2020-08-26 14:26:56 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2020-08-27 21:27:34 +0200 |
commit | e9fc3f69cf3c677db5fc5203e95e9d21528dc888 (patch) | |
tree | e8d628bd4703e3c799d4a48af9089bbb3961ec0c /framework | |
parent | e538c63c0d55b581332f4146dab26e26eb611dce (diff) |
Don't pass ResourceURL unconditionally
In case !m_bResourceURL, this is not only unnecessary but
likely incorrect, as it's a dispatch command name, not a
UI resource URL. This helps avoid "The given URL is not
valid: .uno:SaveAsMenu" warning when clicking the toolbar
save button dropdown.
This also reverts 1cbbf63b7670a3d85a5a29df6124467e954cc7e9
("Always prefer Value over ResourceURL"), which no longer
needed.
Change-Id: Ic09c5893988c75c9f5dabb9eb5e2d557fc7fcbcf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101475
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uielement/popuptoolbarcontroller.cxx | 7 | ||||
-rw-r--r-- | framework/source/uielement/resourcemenucontroller.cxx | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index 8c91779a8518..fe0ed307e76d 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -242,8 +242,7 @@ void PopupMenuToolbarController::createPopupMenuController() css::uno::Sequence<css::uno::Any> aArgs { css::uno::makeAny(comphelper::makePropertyValue("Frame", m_xFrame)), css::uno::makeAny(comphelper::makePropertyValue("ModuleIdentifier", m_sModuleName)), - css::uno::makeAny(comphelper::makePropertyValue("InToolbar", true)), - css::uno::makeAny(comphelper::makePropertyValue("ResourceURL", m_aPopupCommand)) + css::uno::makeAny(comphelper::makePropertyValue("InToolbar", true)) }; try @@ -255,6 +254,10 @@ void PopupMenuToolbarController::createPopupMenuController() if (m_bResourceURL) { + sal_Int32 nAppendIndex = aArgs.getLength(); + aArgs.realloc(nAppendIndex + 1); + aArgs[nAppendIndex] <<= comphelper::makePropertyValue("ResourceURL", m_aPopupCommand); + m_xPopupMenuController.set( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "com.sun.star.comp.framework.ResourceMenuController", aArgs, m_xContext), css::uno::UNO_QUERY_THROW ); } diff --git a/framework/source/uielement/resourcemenucontroller.cxx b/framework/source/uielement/resourcemenucontroller.cxx index 60a7af1aefba..ea2ff5b6dbf0 100644 --- a/framework/source/uielement/resourcemenucontroller.cxx +++ b/framework/source/uielement/resourcemenucontroller.cxx @@ -94,10 +94,7 @@ ResourceMenuController::ResourceMenuController( const css::uno::Reference< css:: m_aMenuURL = "private:resource/popupmenu/" + aMenuName; } else if ( aPropValue.Name == "ResourceURL" ) - { - if ( m_aMenuURL.isEmpty() ) - aPropValue.Value >>= m_aMenuURL; - } + aPropValue.Value >>= m_aMenuURL; else if ( aPropValue.Name == "Frame" ) aPropValue.Value >>= m_xFrame; else if ( aPropValue.Name == "ModuleIdentifier" ) |