summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-06-09 08:07:27 +0530
committerAkshay Deep <akshaydeepiitr@gmail.com>2016-06-09 06:31:41 +0000
commit75e8a542f6515a364ea178fe26d6105a4e10cdcc (patch)
treee4842d29b40a0bd4bfcfb9db37c5937ffdd0ce52 /sfx2
parentcf60f871a91f2ea373f4e10ab3992ecd98b0535d (diff)
Hide Default Template icon when resetting default using toolbox menu
Change-Id: I7a3e7c9413edbdfb74e0415dd7e203d65201eb08 Reviewed-on: https://gerrit.libreoffice.org/26081 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Akshay Deep <akshaydeepiitr@gmail.com> (cherry picked from commit 4599858e21925f2f5febed8eebf4f5bd0fa97163) Reviewed-on: https://gerrit.libreoffice.org/26083 Tested-by: Akshay Deep <akshaydeepiitr@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/templateabstractview.cxx1
-rw-r--r--sfx2/source/doc/templatedlg.cxx5
2 files changed, 6 insertions, 0 deletions
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index df34797c0176..6d74a62c8b50 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -297,6 +297,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 ad4683a1e581..24a18f3efe77 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();