sfx2/source/dialog/templdlg.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit bb844eb299b614c1fa56e140630db070cf709a02
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sun Mar 15 23:46:22 2020 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Tue Mar 31 19:57:21 2020 +0200

    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 <rayk...@gmail.com>

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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to