summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2020-03-15 23:46:22 -0800
committerJim Raykowski <raykowj@gmail.com>2020-03-31 19:57:21 +0200
commitbb844eb299b614c1fa56e140630db070cf709a02 (patch)
treeb495cee277becfdf09a3631668c9d499dffc5f9c /sfx2/source
parent437d30fa8e7daaf12990cf9672614e630e915ba5 (diff)
tdf#131190 Make custom page styles deletable again in Calc
Here is a patch to return the ability to delete custom page styles in Calc. This was lost in commit 30c9bc76d0718f0c01d34f81845d88413645b42c Change-Id: I18936585cfbe45e0254beb882adc8709781f57e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90547 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
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);