[Libreoffice-commits] .: sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Aug 19 21:11:21 PDT 2012


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

New commits:
commit f681ec232ece0ca46c2ab1b6b5e4670d553cfb3a
Author: Rafael Dominguez <venccsralph at 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.bosdonnat at free.fr>
    Tested-by: Bosdonnat Cedric <cedric.bosdonnat at 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;
 }


More information about the Libreoffice-commits mailing list