summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/dialog/templdlg.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index b4c8f4393e8d..4710cd2c2aec 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1948,6 +1948,7 @@ void SfxCommonTemplateDialog_Impl::ShowHdl()
void SfxCommonTemplateDialog_Impl::EnableDelete()
{
+ bool bEnableDelete(false);
if(IsInitialized() && HasSelectedStyle())
{
OSL_ENSURE(pStyleSheetPool, "No StyleSheetPool");
@@ -1963,19 +1964,10 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
pStyleSheetPool->Find(aTemplName,eFam, pTreeBox->IsVisible()? SfxStyleSearchBits::All : nFilter);
OSL_ENSURE(pStyle, "Style not found");
- if(pStyle && pStyle->IsUserDefined())
- {
- EnableDel(true);
- }
- else
- {
- EnableDel(false);
- }
- }
- else
- {
- EnableDel(false);
+ if (pStyle && pStyle->IsUserDefined() && (pStyle->HasParentSupport() || !pStyle->IsUsed()))
+ bEnableDelete = true;
}
+ EnableDel(bEnableDelete);
}
IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, TreeListApplyHdl, SvTreeListBox *, bool )