[Libreoffice-commits] core.git: sfx2/source

Akshay Deep akshaydeepiitr at gmail.com
Thu Jun 9 06:22:43 UTC 2016


 sfx2/source/control/templateabstractview.cxx |    1 +
 sfx2/source/doc/templatedlg.cxx              |    5 +++++
 2 files changed, 6 insertions(+)

New commits:
commit 4599858e21925f2f5febed8eebf4f5bd0fa97163
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date:   Thu Jun 9 08:07:27 2016 +0530

    Hide Default Template icon when resetting default using toolbox menu
    
    Change-Id: I7a3e7c9413edbdfb74e0415dd7e203d65201eb08
    Reviewed-on: https://gerrit.libreoffice.org/26081
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Akshay Deep <akshaydeepiitr at gmail.com>

diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 5d95c37..e19621d 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -274,6 +274,7 @@ void TemplateAbstractView::RemoveDefaultTemplateIcon(const OUString& rPath)
         if(pViewItem->getPath().match(rPath))
         {
             pViewItem->showDefaultIcon(false);
+            Invalidate();
             return;
         }
     }
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 41a8740..9a6335a 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -628,6 +628,11 @@ IMPL_LINK_TYPED(SfxTemplateManagerDlg, DefaultTemplateMenuSelectHdl, Menu*, pMen
     sal_uInt16 nId = pMenu->GetCurItemId();
 
     OUString aServiceName = SfxObjectShell::GetServiceNameFromFactory( mpTemplateDefaultMenu->GetItemCommand(nId));
+
+    OUString sPrevDefault = SfxObjectFactory::GetStandardTemplate( aServiceName );
+    if(!sPrevDefault.isEmpty())
+        mpLocalView->RemoveDefaultTemplateIcon(sPrevDefault);
+
     SfxObjectFactory::SetStandardTemplate( aServiceName, OUString() );
 
     createDefaultTemplateMenu();


More information about the Libreoffice-commits mailing list