summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-08-15 08:23:58 -0430
committerBosdonnat Cedric <cedric.bosdonnat@free.fr>2012-08-20 04:10:52 +0000
commitf681ec232ece0ca46c2ab1b6b5e4670d553cfb3a (patch)
tree262927db4ae58d33a98b14d04a16197449b7c6aa /sfx2
parent82c46f1877c65042ac976312267c14bf0e5847f4 (diff)
Disable opening a template while in save mode.
Change-Id: If63cc2f6e2c46a54fd6f380f4f218c10427befe3 Reviewed-on: https://gerrit.libreoffice.org/432 Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/templatedlg.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index b6a705d606f7..34e5713e27f2 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -659,21 +659,24 @@ IMPL_LINK(SfxTemplateManagerDlg, DefaultTemplateMenuSelectHdl, Menu*, pMenu)
IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem)
{
- uno::Sequence< PropertyValue > aArgs(1);
- aArgs[0].Name = "AsTemplate";
- aArgs[0].Value <<= sal_True;
+ if (!mbIsSaveMode)
+ {
+ uno::Sequence< PropertyValue > aArgs(1);
+ aArgs[0].Name = "AsTemplate";
+ aArgs[0].Value <<= sal_True;
- TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
+ TemplateViewItem *pTemplateItem = static_cast<TemplateViewItem*>(pItem);
- try
- {
- mxDesktop->loadComponentFromURL(pTemplateItem->getPath(),rtl::OUString("_default"), 0, aArgs );
- }
- catch( const uno::Exception& )
- {
- }
+ try
+ {
+ mxDesktop->loadComponentFromURL(pTemplateItem->getPath(),rtl::OUString("_default"), 0, aArgs );
+ }
+ catch( const uno::Exception& )
+ {
+ }
- Close();
+ Close();
+ }
return 0;
}