From 13cb088a2d8902822e3eb5607ba4cac81ad4d2f2 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 13 Feb 2013 14:35:40 +0000 Subject: sdremote: hide TCP/IP server selection dialog menu item Now shown only in experimental mode (ie. when TCP/IP is enabled) to reduce user-confusion. Said dialog is not needed for bluetooth. --- sd/source/ui/view/drviews7.cxx | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index f2d69be4ad98..f077d30fa589 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,6 @@ #include #include - #include #include #include @@ -996,15 +996,25 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) rSet.DisableItem(SID_ZOOM_PREV); } - bool bDisableSdremoteForGood = false; + if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REMOTE_DLG ) ) + { + + bool bDisableSdremoteForGood = false; #ifndef ENABLE_SDREMOTE - bDisableSdremoteForGood = true; + bDisableSdremoteForGood = true; #endif - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if ( bDisableSdremoteForGood || ( xContext.is() && !officecfg::Office::Impress::Misc::Start::EnableSdremote::get( xContext ) ) ) - { - rSet.ClearItem(SID_REMOTE_DLG); - rSet.DisableItem(SID_REMOTE_DLG); + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + if ( xContext.is() ) + bDisableSdremoteForGood |= ! ( officecfg::Office::Common::Misc::ExperimentalMode::get( xContext ) && + + officecfg::Office::Impress::Misc::Start::EnableSdremote::get( xContext ) ); + + // This dialog is only useful for TCP/IP remote control + // which is unusual, under-tested and a security issue. + if ( bDisableSdremoteForGood ) + { + rSet.Put(SfxVisibilityItem(SID_REMOTE_DLG, false)); + } } // EditText aktiv -- cgit