summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/dialog/templdlg.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 5d09b4b2d119..5389cd906044 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2060,7 +2060,12 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
pStyleSheetPool->Find(aTemplName,eFam, pTreeBox->IsVisible()? SfxStyleSearchBits::All : nFilter);
OSL_ENSURE(pStyle, "Style not found");
- if (pStyle && pStyle->IsUserDefined() && (pStyle->HasParentSupport() || !pStyle->IsUsed()))
+ // bIsCalcPageStyle is a hack to allow Calc page styles to be deleted
+ // remove when IsUsed is fixed for Calc page style
+ uno::Reference<frame::XFrame > xFrame = GetObjectShell()->GetFrame()->GetFrame().GetFrameInterface();
+ bool bIsCalcPageStyle = (vcl::CommandInfoProvider::GetModuleIdentifier(xFrame) == "com.sun.star.sheet.SpreadsheetDocument") &&
+ (pStyle->GetFamily() == SfxStyleFamily::Page);
+ if (pStyle && pStyle->IsUserDefined() && (bIsCalcPageStyle || pStyle->HasParentSupport() || !pStyle->IsUsed()))
bEnableDelete = true;
}
EnableDel(bEnableDelete);