From ad067c367fbca9eb7a0f5c8adbe6be243950569e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 8 Aug 2018 16:13:58 +0200 Subject: sw_redlinehide_2: fix ordering of SplitNode usage of ContentIdxStore The problem is that now the ctor of SwTextFrame will check the redline positions, but the call to MakeFramesForAdjacentContentNode() happens before the call to ContentIdxStore::Restore() that updates the SwPositions of the redlines, hence they point to the wrong node. Try to fix this by not calling Restore directly but pass in a closure to SwTextNode::SplitContentNode() so that it can call ContentIdxStore::Restore() before frames are created and redline positions are checked. Also remove the useless SwContentNode::SplitContentNode() - only the SwTextNode override actually did anything. Change-Id: I2088fd124d04cf354f4f0f691a50ff5217d778d7 --- sw/inc/ndgrf.hxx | 1 - sw/inc/ndole.hxx | 2 -- sw/inc/ndtxt.hxx | 4 +++- sw/inc/node.hxx | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index e82061421aa6..0a6c67a65481 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -80,7 +80,6 @@ public: const Graphic& GetGrf(bool bWait = false) const; const GraphicObject& GetGrfObj(bool bWait = false) const; const GraphicObject* GetReplacementGrfObj() const; - virtual SwContentNode *SplitContentNode( const SwPosition & ) override; /// isolated only way to set GraphicObject to allow more actions when doing so void SetGraphic(const Graphic& rGraphic); diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx index 4f6f4596736d..93139c986526 100644 --- a/sw/inc/ndole.hxx +++ b/sw/inc/ndole.hxx @@ -111,8 +111,6 @@ public: SwOLEObj& GetOLEObj() { return maOLEObj; } virtual ~SwOLENode() override; - virtual SwContentNode *SplitContentNode( const SwPosition & ) override; - /// Is in ndcopy.cxx. virtual SwContentNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const override; diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index c9e1f2b334ae..98f1af0de448 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -34,6 +34,7 @@ #include #include #include +#include class SfxHint; class SwNumRule; @@ -347,7 +348,8 @@ public: /// Virtual methods from ContentNode. virtual SwContentFrame *MakeFrame( SwFrame* ) override; - virtual SwContentNode *SplitContentNode( const SwPosition & ) override; + SwTextNode * SplitContentNode(const SwPosition &, + std::function const* pContentIndexRestore); virtual SwContentNode *JoinNext() override; void JoinPrev(); diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 298143e91b57..44e075cda09a 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -382,8 +382,6 @@ public: pSib is another SwFrame of the same layout (e.g. the SwRootFrame itself, a sibling, the parent) */ virtual SwContentFrame *MakeFrame( SwFrame* pSib ) = 0; - virtual SwContentNode *SplitContentNode(const SwPosition & ) = 0; - virtual SwContentNode *JoinNext(); /** Is it possible to join two nodes? In pIdx the second position can be returned. */ -- cgit