diff options
-rw-r--r-- | framework/source/uielement/saveasmenucontroller.cxx | 14 |
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 ); + } } } |