framework/source/uielement/popuptoolbarcontroller.cxx |    7 +++++--
 framework/source/uielement/resourcemenucontroller.cxx |    5 +----
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e9fc3f69cf3c677db5fc5203e95e9d21528dc888
Author:     Maxim Monastirsky <momonas...@gmail.com>
AuthorDate: Wed Aug 26 14:26:56 2020 +0300
Commit:     Maxim Monastirsky <momonas...@gmail.com>
CommitDate: Thu Aug 27 21:27:34 2020 +0200

    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 <momonas...@gmail.com>

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" )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to