diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-01 18:59:39 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-12 18:55:19 +0200 |
commit | 1ab75a61ff0d8c9a329b58cc7de08d7b46b91f62 (patch) | |
tree | 20fcb6e5341d6a7406f9e0589587403195d50de4 | |
parent | sw_redlinehide: trivial GetNode() conversion in draw/ (diff) | |
download | core-1ab75a61ff0d8c9a329b58cc7de08d7b46b91f62.tar.gz core-1ab75a61ff0d8c9a329b58cc7de08d7b46b91f62.zip |
sw_redlinehide: trivial GetNode() conversion in fields
Change-Id: I69e438575e76f67701d951dfeab0fd7fdda0e66f
-rw-r--r-- | sw/source/core/fields/expfld.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 6ac0df0f4a47..1b3637526a3d 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -42,6 +42,7 @@ #include <layfrm.hxx> #include <pagefrm.hxx> #include <cntfrm.hxx> +#include <txtfrm.hxx> #include <rootfrm.hxx> #include <tabfrm.hxx> #include <flyfrm.hxx> @@ -151,9 +152,8 @@ SwTextNode* GetFirstTextNode( const SwDoc& rDoc, SwPosition& rPos, } else if ( !pCFrame->isFrameAreaDefinitionValid() ) { - pTextNode = const_cast<SwTextNode*>(static_cast<const SwTextNode*>(pCFrame->GetNode())); - rPos.nNode = *pTextNode; - rPos.nContent.Assign( pTextNode, 0 ); + assert(pCFrame->IsTextFrame()); + rPos = static_cast<SwTextFrame const*>(pCFrame)->MapViewToModelPos(TextFrameIndex(0)); } else { @@ -240,9 +240,11 @@ const SwTextNode* GetBodyTextNode( const SwDoc& rDoc, SwPosition& rPos, if( pContentFrame ) { - pTextNode = pContentFrame->GetNode()->GetTextNode(); - rPos.nNode = *pTextNode; - const_cast<SwTextNode*>(pTextNode)->MakeEndIndex( &rPos.nContent ); + assert(pContentFrame->IsTextFrame()); + SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(pContentFrame)); + rPos = pFrame->MapViewToModelPos(TextFrameIndex(pFrame->GetText().getLength())); + pTextNode = rPos.nNode.GetNode().GetTextNode(); + assert(pTextNode); } else { |