summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-05-18 18:45:04 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 21:51:30 +0200
commiteabf8c9d7cd4f1fe7422c140ed6c9ae21f9737a3 (patch)
treed9ca68688c41df6a7ee366cce3f9166ce491e854
parent06c8b802eacc637f3f152f191f6312482d160eb8 (diff)
sw_redlinehide: trivial conversions in doc.cxx,doctxm.cxx
Change-Id: Ic8737c8d06ca7d43241b39f4ad60d78eedcb42bb
-rw-r--r--sw/source/core/doc/doc.cxx3
-rw-r--r--sw/source/core/doc/doctxm.cxx5
2 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 68a33ab447bf..19ca7d3a3244 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -518,10 +518,11 @@ sal_uInt16 PostItField_::GetPageNo(
//Probably only once. For the page number we don't select a random one,
//but the PostIt's first occurrence in the selected area.
rVirtPgNo = 0;
- const sal_Int32 nPos = GetContent();
SwIterator<SwTextFrame,SwTextNode> aIter( GetTextField()->GetTextNode() );
for( SwTextFrame* pFrame = aIter.First(); pFrame; pFrame = aIter.Next() )
{
+ TextFrameIndex const nPos = pFrame->MapModelToView(
+ &GetTextField()->GetTextNode(), GetContent());
if( pFrame->GetOfst() > nPos ||
(pFrame->HasFollow() && pFrame->GetFollow()->GetOfst() <= nPos) )
continue;
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 04184d15723d..889e3027bf30 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1588,8 +1588,11 @@ void SwTOXBaseSection::UpdatePageNum()
{
// find the right one
SwTextFrame* pNext;
+ TextFrameIndex const nPos(static_cast<SwTextFrame*>(pFrame)
+ ->MapModelToView(static_cast<SwTextNode const*>(rTOXSource.pNd),
+ rTOXSource.nPos));
while( nullptr != ( pNext = static_cast<SwTextFrame*>(pFrame->GetFollow()) )
- && rTOXSource.nPos >= pNext->GetOfst() )
+ && nPos >= pNext->GetOfst())
pFrame = pNext;
}