[Libreoffice-commits] core.git: framework/source

Maxim Monastirsky momonasmon at gmail.com
Mon Nov 30 14:59:00 PST 2015


 framework/source/uielement/saveasmenucontroller.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 5a3b930b30149fbcaac246726a0f547527161429
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Tue Dec 1 00:48:55 2015 +0200

    Save Remote File isn't supported in all modules
    
    so don't add it there to the save dropdown.
    
    Change-Id: Iee604cc15616080266f7192ac451f04830ba1bb8

diff --git a/framework/source/uielement/saveasmenucontroller.cxx b/framework/source/uielement/saveasmenucontroller.cxx
index 2f42146..5c9a934 100644
--- a/framework/source/uielement/saveasmenucontroller.cxx
+++ b/framework/source/uielement/saveasmenucontroller.cxx
@@ -83,7 +83,19 @@ void SaveAsMenuController::impl_setPopupMenu()
     if ( pVCLPopupMenu )
     {
         pVCLPopupMenu->InsertItem( ".uno:SaveAs", m_xFrame );
-        pVCLPopupMenu->InsertItem( ".uno:SaveAsRemote", m_xFrame );
+
+        // Add Save Remote File command only where it's supported.
+        css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider( m_xFrame, css::uno::UNO_QUERY );
+        if ( xDispatchProvider.is() )
+        {
+            css::util::URL aTargetURL;
+            aTargetURL.Complete = ".uno:SaveAsRemote";
+            m_xURLTransformer->parseStrict( aTargetURL );
+
+            css::uno::Reference< css::frame::XDispatch > xDispatch( xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ) );
+            if ( xDispatch.is() )
+                pVCLPopupMenu->InsertItem( aTargetURL.Complete, m_xFrame );
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list