diff options
-rw-r--r-- | sw/inc/node.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index af48d95d5ec2..6f1fa1bae68f 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -551,7 +551,7 @@ public: /** Method deletes all views of document for the node. The content frames are removed from the respective layout. */ - void DelFrames(SwRootFrame const* pLayout = nullptr); + void DelFrames(SwRootFrame const* pLayout = nullptr, bool bForce = false); /** Method creates all views of document for the previous node. The content frames created are put into the respective layout. */ diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 7865ae68e33f..524aef0d3d1e 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -1159,7 +1159,7 @@ void SwSectionNode::MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx) } } -void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/) +void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/, bool const bForce) { sal_uLong nStt = GetIndex()+1, nEnd = EndOfSectionIndex(); if( nStt >= nEnd ) @@ -1176,6 +1176,7 @@ void SwSectionNode::DelFrames(SwRootFrame const*const /*FIXME TODO*/) // If the Area is within a Fly or TableBox, we can only hide it if // there is more Content which has Frames. // Or else the Fly/TableBox Frame does not have a Lower! + if (!bForce) { SwNodeIndex aIdx( *this ); if( !SwNodes::GoPrevSection( &aIdx, true, false ) || diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 14a93715772e..5be7ba5cf9cf 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -636,7 +636,12 @@ bool SwNodes::MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, SwSectionNode* pSctNd = pSttNd->GetSectionNode(); if( bNewFrames && pSctNd ) - pSctNd->DelFrames(); + { // tdf#135056 skip over code in DelFrames() that moves + // SwNodeIndex around because in case of nested + // sections, m_pStartOfSection will point between + // undo nodes-array and doc nodes-array + pSctNd->DelFrames(nullptr, true); + } RemoveNode( aRg.aEnd.GetIndex(), 1, false ); // delete EndNode sal_uLong nSttPos = pSttNd->GetIndex(); |