summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/docnode/ndtbl.cxx37
1 files changed, 36 insertions, 1 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 71874cd24a0d..62ae90129297 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -880,6 +880,35 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts,
return &rNdTable;
}
+static void lcl_RemoveBreaksTable(SwTableNode & rNode, SwTableFormat *const pTableFormat)
+{
+ // delete old layout frames, new ones need to be created...
+ rNode.DelFrames(nullptr);
+
+ // remove PageBreaks/PageDesc/ColBreak
+ SwFrameFormat & rFormat(*rNode.GetTable().GetFrameFormat());
+
+ const SfxPoolItem* pItem;
+ if (SfxItemState::SET == rFormat.GetItemState(RES_BREAK, false, &pItem))
+ {
+ if (pTableFormat)
+ {
+ pTableFormat->SetFormatAttr(*pItem);
+ }
+ rFormat.ResetFormatAttr(RES_BREAK);
+ }
+
+ if (SfxItemState::SET == rFormat.GetItemState(RES_PAGEDESC, false, &pItem)
+ && static_cast<SwFormatPageDesc const*>(pItem)->GetPageDesc())
+ {
+ if (pTableFormat)
+ {
+ pTableFormat->SetFormatAttr(*pItem);
+ }
+ rFormat.ResetFormatAttr(RES_PAGEDESC);
+ }
+}
+
static void lcl_RemoveBreaks(SwContentNode & rNode, SwTableFormat *const pTableFormat)
{
// delete old layout frames, new ones need to be created...
@@ -1387,7 +1416,13 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
for( nLines = 0; aNodeIndex <= rTableNodes.rbegin()->rbegin()->aEnd; ++aNodeIndex,++nLines )
{
SwNode& rNode = aNodeIndex.GetNode();
- if( rNode.IsContentNode() )
+ assert(!rNode.IsSectionNode()); // not possible in writerfilter import
+ if (rNode.IsTableNode())
+ {
+ lcl_RemoveBreaksTable(static_cast<SwTableNode&>(rNode),
+ (0 == nLines) ? pTableFormat : nullptr);
+ }
+ else if (rNode.IsContentNode())
{
lcl_RemoveBreaks(static_cast<SwContentNode&>(rNode),
(0 == nLines) ? pTableFormat : nullptr);