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 /dbaccess | |
parent | e8dff0479e568c6d8de517782ac22ba987f81da1 (diff) |
move the one single use of EnableMenuStrings to its call site
Change-Id: Ie5087f564c024cae526757ed1445c97113e8a68e
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 14 |
1 files changed, 11 insertions, 3 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>()); } |