summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-25 11:21:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-26 16:46:55 +0100
commitb509d72a79a8c64d03ea8f91c69c58a24e0b2dc7 (patch)
tree97770ab005aac451b4c34a1fae562a3d579adb1f /dbaccess
parentea31d3cc8566eeb9d3dbf55b385d8c619daaddf9 (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> Reviewed-on: https://gerrit.libreoffice.org/83763
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx7
-rw-r--r--dbaccess/source/ui/control/opendoccontrols.cxx3
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.