diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-25 11:21:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-26 13:51:46 +0100 |
commit | 3b0d29f1461c97c0c812a500b3414b9a50d694ff (patch) | |
tree | f29864f730ebc3d3ea31d0cc19481382e819e04f /dbaccess | |
parent | ec5e91d6c123bd52f312f96812c35ef03c91fcc6 (diff) |
tdf#126043 fetch the command properties just once
Change-Id: Iaf343e9858be36ca8772d9c12eee772d93b4c394
Reviewed-on: https://gerrit.libreoffice.org/83668
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/control/opendoccontrols.cxx | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 77638fa3f798..9e3f52215737 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -193,8 +193,10 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo m_aBorder->SetBorderStyle(WindowBorderStyle::MONO); m_aTBPreview->SetOutStyle(TOOLBOX_STYLE_FLAT); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:DBDisablePreview", + "com.sun.star.sdb.OfficeDatabaseDocument"); m_aTBPreview->InsertItem(SID_DB_APP_DISABLE_PREVIEW, - vcl::CommandInfoProvider::GetLabelForCommand(".uno:DBDisablePreview", "com.sun.star.sdb.OfficeDatabaseDocument"), + vcl::CommandInfoProvider::GetLabelForCommand(aProperties), ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWNONLY|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK); m_aTBPreview->SetHelpId(HID_APP_VIEW_PREVIEW_CB); m_aTBPreview->SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); @@ -974,7 +976,8 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce) break; } - OUString aCommandLabel = vcl::CommandInfoProvider::GetLabelForCommand(aCommand, "com.sun.star.sdb.OfficeDatabaseDocument"); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommand, "com.sun.star.sdb.OfficeDatabaseDocument"); + OUString aCommandLabel = vcl::CommandInfoProvider::GetLabelForCommand(aProperties); m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, stripTrailingDots(aCommandLabel)); Resize(); diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 85bba326a054..1a86e465b3c9 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -111,7 +111,8 @@ namespace dbaui m_sModule = OUString::createFromAscii( _pAsciiModuleName ); // our label should equal the UI text of the "Open" command - OUString sLabel(vcl::CommandInfoProvider::GetLabelForCommand(".uno:Open", m_sModule)); + auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:Open", m_sModule); + OUString sLabel(vcl::CommandInfoProvider::GetLabelForCommand(aProperties)); m_xControl->set_label(" " + sLabel.replaceAll("~", "")); // Place icon left of text and both centered in the button. |