diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-01 18:59:39 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-06-08 21:51:34 +0200 |
commit | f282a61be87004e6ddc3e1d00cb1812b1c1fd5cf (patch) | |
tree | 2db7f96e61fa9ac9fb7a9dae038c8f08cc0b4faf /sw | |
parent | 81ca9efb65c3de0c2dde929ffa9d7a5c439e712c (diff) |
sw_redlinehide: trivial GetNode() conversion in fields
Change-Id: I69e438575e76f67701d951dfeab0fd7fdda0e66f
Diffstat (limited to 'sw')
-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 { |