summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app
diff options
context:
space:
mode:
authorJakub Trzebiatowski <ubap.dev@gmail.com>2016-08-02 16:44:10 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-03 08:43:29 +0000
commit8c80a56ea979eccc39cc748c35e4fd9d33e837dc (patch)
treeef57ddc161405584ca16c7f6c1a7e0f8cfcc9947 /sw/source/uibase/app
parente5359520ddbef00c0b1930fd6c1685b2df943349 (diff)
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 <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r--sw/source/uibase/app/docstyle.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index f99b5eabdf90..22deb3216786 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;