[Libreoffice-commits] core.git: sfx2/source
Caolán McNamara
caolanm at redhat.com
Tue Apr 4 13:35:51 UTC 2017
sfx2/source/dialog/templdlg.cxx | 34 ++++++----------------------------
1 file changed, 6 insertions(+), 28 deletions(-)
New commits:
commit 1931b5b01c6fdaa204d26ec4b9675dad16373cf2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Apr 4 14:35:04 2017 +0100
can simplify now
Change-Id: I234e630f3af1acfa39900464abd7e06efc47a671
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index a99ac5523908..b17d524d9976 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2175,36 +2175,14 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanel
, m_aActionTbL(VclPtrInstance<DropToolBox_Impl>(pDlgWindow, this))
, m_aActionTbR(VclPtrInstance<ToolBox>(pDlgWindow))
{
- try
- {
- uno::Reference< container::XNameAccess > xNameAccess(
- frame::theUICommandDescription::get(
- ::comphelper::getProcessComponentContext()) );
- uno::Reference< container::XNameAccess > xUICommands;
- OUString sTextDoc("com.sun.star.text.TextDocument");
- if (xNameAccess->hasByName(sTextDoc))
- {
- uno::Any a = xNameAccess->getByName(sTextDoc);
- a >>= xUICommands;
- }
- if (xUICommands.is())
- {
- uno::Any aCommand = xUICommands->getByName(".uno:StyleApply");
- m_aActionTbR->InsertItem(SID_STYLE_WATERCAN, Image(BitmapEx(SfxResId(RID_SFXBMP_WATERCAN))), SfxResId(STR_STYLE_FILL_FORMAT_MODE).toString());
- m_aActionTbR->SetHelpId(SID_STYLE_WATERCAN, HID_TEMPLDLG_WATERCAN);
+ m_aActionTbR->InsertItem(SID_STYLE_WATERCAN, Image(BitmapEx(SfxResId(RID_SFXBMP_WATERCAN))), SfxResId(STR_STYLE_FILL_FORMAT_MODE).toString());
+ m_aActionTbR->SetHelpId(SID_STYLE_WATERCAN, HID_TEMPLDLG_WATERCAN);
- aCommand = xUICommands->getByName(".uno:StyleNewByExample");
- m_aActionTbR->InsertItem(SID_STYLE_NEW_BY_EXAMPLE, Image(BitmapEx(SfxResId(RID_SFXBMP_NEW_BY_EXAMPLE))), SfxResId(STR_STYLE_NEW_STYLE_FROM_SELECTION).toString());
- m_aActionTbR->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE);
+ m_aActionTbR->InsertItem(SID_STYLE_NEW_BY_EXAMPLE, Image(BitmapEx(SfxResId(RID_SFXBMP_NEW_BY_EXAMPLE))), SfxResId(STR_STYLE_NEW_STYLE_FROM_SELECTION).toString());
+ m_aActionTbR->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE);
- aCommand = xUICommands->getByName(".uno:StyleUpdateByExample");
- m_aActionTbR->InsertItem(SID_STYLE_UPDATE_BY_EXAMPLE, Image(BitmapEx(SfxResId(RID_SFXBMP_UPDATE_BY_EXAMPLE))), SfxResId(STR_STYLE_UPDATE_STYLE).toString());
- m_aActionTbR->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE);
- }
- }
- catch (const uno::Exception&)
- {
- }
+ m_aActionTbR->InsertItem(SID_STYLE_UPDATE_BY_EXAMPLE, Image(BitmapEx(SfxResId(RID_SFXBMP_UPDATE_BY_EXAMPLE))), SfxResId(STR_STYLE_UPDATE_STYLE).toString());
+ m_aActionTbR->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE);
Initialize();
}
More information about the Libreoffice-commits
mailing list