summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-12-01 00:48:55 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2015-12-01 00:56:40 +0200
commit5a3b930b30149fbcaac246726a0f547527161429 (patch)
treecbbd26ad902376f932c992435f57514ee0236501
parente7c78e67292ad93c6a4a0772d8b06a0e6e7d26c8 (diff)
Save Remote File isn't supported in all modules
so don't add it there to the save dropdown. Change-Id: Iee604cc15616080266f7192ac451f04830ba1bb8
-rw-r--r--framework/source/uielement/saveasmenucontroller.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/framework/source/uielement/saveasmenucontroller.cxx b/framework/source/uielement/saveasmenucontroller.cxx
index 2f4214618805..5c9a93404b1c 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 );
+ }
}
}