sw/source/uibase/app/docstyle.cxx |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit 8c80a56ea979eccc39cc748c35e4fd9d33e837dc
Author: Jakub Trzebiatowski <ubap....@gmail.com>
Date:   Tue Aug 2 16:44:10 2016 +0200

    GSoC Writer Table Styles; Table styles panel; Delete table style
    
    + Enabled delete from context menu of Table style tab in Styles and 
Formatting panel
    
    Change-Id: I23523169e0427eb14571102e30fa693b5777af76
    Reviewed-on: https://gerrit.libreoffice.org/27797
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index f99b5ea..22deb32 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2468,6 +2468,25 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* 
pStyle)
         }
         break;
 
+    case SfxStyleFamily::Table:
+        {
+            const SwTableAutoFormat* pFormat = lcl_FindTableStyle(rDoc, sName);
+            if (pFormat)
+            {
+                size_t nTableCount = rDoc.GetTableFrameFormatCount(true);
+                for (size_t i=0; i < nTableCount; ++i)
+                {
+                    SwFrameFormat* pFrameFormat = &rDoc.GetTableFrameFormat(i, 
true);
+                    SwTable* pTable = SwTable::FindTable(pFrameFormat);
+                    if (pTable->GetTableStyleName() == pFormat->GetName())
+                        pTable->SetTableStyleName("");
+                }
+
+                rDoc.GetTableStyles().EraseAutoFormat(pFormat->GetName());
+            }
+        }
+        break;
+
     default:
         OSL_ENSURE(false, "unknown style family");
         bBroadcast = false;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to