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 19:39:38 +0200
commit91582427dbeccd35bd147ce1a5818f1e15709f13 (patch)
tree15d536b68f6b3c690d6fb088349d78bd69aa906d
parentf58e7753643b30acd252c996760e9597a7228f1b (diff)
Save Remote File isn't supported in all modules
so don't add it there to the save dropdown. Change-Id: Iee604cc15616080266f7192ac451f04830ba1bb8 (cherry picked from commit 5a3b930b30149fbcaac246726a0f547527161429)
-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 1d8936e15175..55123716a841 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 );
+ }
}
}