diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-30 11:30:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-30 15:47:20 +0100 |
commit | 33a49289dfdba94c92dfd466635c4c663e916848 (patch) | |
tree | b2ff25a773c7420f698c29712699d9d242a97266 | |
parent | e8dff0479e568c6d8de517782ac22ba987f81da1 (diff) |
move the one single use of EnableMenuStrings to its call site
Change-Id: Ie5087f564c024cae526757ed1445c97113e8a68e
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 14 | ||||
-rw-r--r-- | include/vcl/toolbox.hxx | 3 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 1 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 7 |
4 files changed, 12 insertions, 13 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 4c1a541f9e84..fb4564f203e6 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/ucb/XCommandProcessor.hpp> #include <com/sun/star/ucb/Command.hpp> #include <com/sun/star/util/XCloseable.hpp> +#include <comphelper/string.hxx> #include <toolkit/helper/vclunohelper.hxx> #include "AppView.hxx" #include "dbaccess_helpid.hrc" @@ -197,7 +198,6 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo m_aTBPreview->InsertItem(SID_DB_APP_DISABLE_PREVIEW,m_aMenu->GetItemText(SID_DB_APP_DISABLE_PREVIEW),ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWN|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK); m_aTBPreview->SetHelpId(HID_APP_VIEW_PREVIEW_CB); m_aTBPreview->SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); - m_aTBPreview->EnableMenuStrings(); m_aTBPreview->Enable(); m_aPreview->SetHelpId(HID_APP_VIEW_PREVIEW_1); @@ -957,6 +957,14 @@ bool OAppDetailPageHelper::isPreviewEnabled() return m_ePreviewMode != E_PREVIEWNONE; } +namespace +{ + OUString stripTrailingDots(const OUString& rStr) + { + return comphelper::string::stripEnd(rStr, '.'); + } +} + void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce) { if ( m_ePreviewMode != _eMode || _bForce ) @@ -983,7 +991,7 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce) } m_aMenu->CheckItem(nSelectedAction); - m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, m_aMenu->GetItemText(nSelectedAction)); + m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, stripTrailingDots(m_aMenu->GetItemText(nSelectedAction))); Resize(); // simulate a selectionChanged event at the controller, to force the preview to be updated @@ -1168,7 +1176,7 @@ IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, void) m_aTBPreview->SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false); if ( nSelectedAction ) { - m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, aMenu->GetItemText(nSelectedAction)); + m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, stripTrailingDots(aMenu->GetItemText(nSelectedAction))); Resize(); getBorderWin().getView()->getAppController().executeChecked(nSelectedAction,Sequence<PropertyValue>()); } diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index cc3704c77946..0ce31f36f1e5 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -136,7 +136,6 @@ private: mbCustomize:1, mbCustomizeMode:1, mbDragging:1, - mbMenuStrings:1, mbIsShift:1, mbIsKeyEvent:1, mbChangingHighlight:1, @@ -452,8 +451,6 @@ public: // read configuration to determine locking behaviour static bool AlwaysLocked(); - void EnableMenuStrings( bool bEnable = true ) { mbMenuStrings = bEnable; } - void SetOutStyle( sal_uInt16 nNewStyle ); sal_uInt16 GetOutStyle() const { return mnOutStyle; } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 3cb978abb14d..7327a5eee2b9 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1373,7 +1373,6 @@ void ToolBox::ImplInitToolBoxData() mbCustomize = false; mbCustomizeMode = false; mbDragging = false; - mbMenuStrings = false; mbIsShift = false; mbIsKeyEvent = false; mbChangingHighlight = false; diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 7a93e507f185..3b0cd6101ae2 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -20,7 +20,6 @@ #include "sal/config.h" #include <comphelper/processfactory.hxx> -#include <comphelper/string.hxx> #include <tools/debug.hxx> #include <tools/rc.h> @@ -338,11 +337,7 @@ bool ImplToolItem::IsItemHidden() const const OUString ToolBox::ImplConvertMenuString( const OUString& rStr ) { - OUString aCvtStr( rStr ); - if ( mbMenuStrings ) - aCvtStr = comphelper::string::stripEnd(aCvtStr, '.'); - aCvtStr = MnemonicGenerator::EraseAllMnemonicChars( aCvtStr ); - return aCvtStr; + return MnemonicGenerator::EraseAllMnemonicChars(rStr); } void ToolBox::ImplInvalidate( bool bNewCalc, bool bFullPaint ) |