[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sfx2/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 7 14:48:20 UTC 2020


 sfx2/source/dialog/templdlg.cxx |   23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 2d5ea18732c6cc34d82575ae15d2c495da94375b
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Sun Mar 15 23:46:22 2020 -0800
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Tue Apr 7 16:47:48 2020 +0200

    tdf#131190 Make custom page styles deletable again in Calc
    
     This is a combination of 2 commits.
    
    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
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90547
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>
    (cherry picked from commit bb844eb299b614c1fa56e140630db070cf709a02)
    
    tdf#131190 Make custom page styles deletable again in Calc
    
    Return the ability to delete custom page styles in Calc. This was lost
    in commit 30c9bc76d0718f0c01d34f81845d88413645b42c
    
    ae402cc048fde7ffd3ca2696c08d5e54cc30d1be
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91672
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <erack at redhat.com>
    
    Change-Id: I18936585cfbe45e0254beb882adc8709781f57e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91404
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 55d8a0f7d515..1714f65dbe00 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2011,8 +2011,27 @@ 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()))
-            bEnableDelete = true;
+        if (pStyle && pStyle->IsUserDefined())
+        {
+            if (pStyle->HasClearParentSupport() || !pStyle->IsUsed())
+            {
+                bEnableDelete = true;
+            }
+            else if (pStyle->GetFamily() == SfxStyleFamily::Page)
+            {
+                // Hack to allow Calc page styles to be deleted,
+                // remove when IsUsed is fixed for Calc page styles.
+                SfxViewFrame* pFrame = GetObjectShell()->GetFrame();
+                if (pFrame)
+                {
+                    uno::Reference<frame::XFrame > xFrame = pFrame->GetFrame().GetFrameInterface();
+                    if (vcl::CommandInfoProvider::GetModuleIdentifier(xFrame) == "com.sun.star.sheet.SpreadsheetDocument")
+                    {
+                        bEnableDelete = true;
+                    }
+                }
+            }
+        }
     }
     EnableDel(bEnableDelete);
 }


More information about the Libreoffice-commits mailing list