sfx2/source/doc/templatedlg.cxx |   27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

New commits:
commit f681ec232ece0ca46c2ab1b6b5e4670d553cfb3a
Author: Rafael Dominguez <venccsra...@gmail.com>
Date:   Wed Aug 15 08:23:58 2012 -0430

    Disable opening a template while in save mode.
    
    Change-Id: If63cc2f6e2c46a54fd6f380f4f218c10427befe3
    Reviewed-on: https://gerrit.libreoffice.org/432
    Reviewed-by: Bosdonnat Cedric <cedric.bosdon...@free.fr>
    Tested-by: Bosdonnat Cedric <cedric.bosdon...@free.fr>

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index b6a705d..34e5713 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;
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to