summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-10-10 11:26:04 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-11-15 15:09:58 +0100
commit971b3c93ac2aca3ffc1ac3bd44cf17a5e03e688d (patch)
tree658a6fafde16a4edad2424e95e1b41dfbdc36748
parent89969e671eb481f39fb408aa1f45dd7f1bd6eef0 (diff)
sw_redlinehide_3: minimally convert laycache.cxx
Just fix the TextFrameIndex / GetTextNode usages. This does not make the layout cache actually work if IsHideRedlines is enabled, hence the layout cache remains disabled in that case. Change-Id: I9aa1fb490c3dd4fd26165f2e60513ec267857d78
-rw-r--r--sw/source/core/layout/laycache.cxx13
-rw-r--r--sw/source/core/layout/layhelp.hxx1
2 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 2e6ffcc7e315..014a9fc82ecb 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -201,7 +201,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
nNdIdx -= nStartOfContent;
aIo.GetStream().WriteUInt32( nNdIdx );
if( bFollow )
- aIo.GetStream().WriteUInt32( static_cast<SwTextFrame*>(pTmp)->GetOfst() );
+ aIo.GetStream().WriteUInt32( sal_Int32(static_cast<SwTextFrame*>(pTmp)->GetOfst()) );
aIo.CloseFlagRec();
/* Close Paragraph Record */
aIo.CloseRec();
@@ -357,8 +357,9 @@ bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
if( pImpl->GetBreakIndex( nIndex ) != nNdIdx ||
SW_LAYCACHE_IO_REC_PARA !=
pImpl->GetBreakType( nIndex ) ||
- ( bFollow ? static_cast<const SwTextFrame*>(pTmp)->GetOfst()
- : COMPLETE_STRING ) != pImpl->GetBreakOfst( nIndex ) )
+ (bFollow
+ ? sal_Int32(static_cast<const SwTextFrame*>(pTmp)->GetOfst())
+ : COMPLETE_STRING) != pImpl->GetBreakOfst(nIndex))
{
return false;
}
@@ -799,7 +800,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
sal_uInt16 nRepeat( 0 );
if( !bLongTab && mrpFrame->IsTextFrame() &&
SW_LAYCACHE_IO_REC_PARA == nType &&
- nOfst < static_cast<SwTextFrame*>(mrpFrame)->GetTextNode()->GetText().getLength())
+ nOfst < static_cast<SwTextFrame*>(mrpFrame)->GetText().getLength())
bSplit = true;
else if( mrpFrame->IsTabFrame() && nRowCount < nOfst &&
( bLongTab || SW_LAYCACHE_IO_REC_TABLE == nType ) )
@@ -873,8 +874,8 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
{
SwTextFrame *const pNew = static_cast<SwTextFrame*>(
static_cast<SwTextFrame*>(mrpFrame)
- ->GetTextNode()->MakeFrame(mrpFrame));
- pNew->ManipOfst( nOfst );
+ ->GetTextNodeFirst()->MakeFrame(mrpFrame));
+ pNew->ManipOfst( TextFrameIndex(nOfst) );
pNew->SetFollow( static_cast<SwTextFrame*>(mrpFrame)->GetFollow() );
static_cast<SwTextFrame*>(mrpFrame)->SetFollow( pNew );
mrpFrame = pNew;
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index f4201ccb09b5..87b832321d98 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -53,6 +53,7 @@ typedef std::vector<SwFlyCache> SwPageFlyCache;
class SwLayCacheImpl
{
std::vector<sal_uLong> mIndices;
+ /// either a textframe character offset, or a row index inside a table
std::deque<sal_Int32> aOffset;
std::vector<sal_uInt16> aType;
SwPageFlyCache m_FlyCache;