give SwParaPortion a const GetDelta() and non-const SetDelta()

instead of two GetDeltas() one of which is non-const and returning a
reference that can be used to modify the delta

no logic change intended

Change-Id: Ia5788bfffd169a589eb9b9b141b60575ab165391
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132953
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2022-04-13 10:32:21 +01:00
parent 064f4fe82c
commit e8c2ae74ea
3 changed files with 10 additions and 9 deletions

View File

@@ -214,7 +214,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
if( pPara )
{
pPara->GetReformat() = SwCharRange();
pPara->GetDelta() = 0;
pPara->SetDelta(0);
}
}
@@ -312,7 +312,7 @@ bool SwTextFrame::CalcFollow(TextFrameIndex const nTextOfst)
if( pPara )
{
pPara->GetReformat() = SwCharRange();
pPara->GetDelta() = 0;
pPara->SetDelta(0);
}
}
@@ -775,7 +775,7 @@ void SwTextFrame::SetOffset_(TextFrameIndex const nNewOfst)
SwCharRange &rReformat = pPara->GetReformat();
rReformat.Start() = TextFrameIndex(0);
rReformat.Len() = TextFrameIndex(GetText().getLength());
pPara->GetDelta() = sal_Int32(rReformat.Len());
pPara->SetDelta(sal_Int32(rReformat.Len()));
}
InvalidateSize();
}
@@ -1059,7 +1059,7 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine,
// are valid now
pPara->GetReformat() = SwCharRange();
bool bDelta = pPara->GetDelta() != 0;
pPara->GetDelta() = 0;
pPara->SetDelta(0);
if( rLine.IsStop() )
{
@@ -1300,7 +1300,8 @@ bool SwTextFrame::FormatLine( SwTextFormatter &rLine, const bool bPrev )
}
// Calculating the good ol' nDelta
pPara->GetDelta() -= sal_Int32(pNew->GetLen()) - sal_Int32(nOldLen);
const sal_Int32 nDiff = sal_Int32(pNew->GetLen()) - sal_Int32(nOldLen);
pPara->SetDelta(pPara->GetDelta() - nDiff);
// Stop!
if( rLine.IsStop() )
@@ -2077,7 +2078,7 @@ bool SwTextFrame::FormatQuick( bool bForceQuickFormat )
// Delete reformat
pPara->GetReformat() = SwCharRange();
pPara->GetDelta() = 0;
pPara->SetDelta(0);
return true;
}

View File

@@ -286,8 +286,8 @@ public:
const SwRepaint& GetRepaint() const { return m_aRepaint; }
SwCharRange& GetReformat() { return m_aReformat; }
const SwCharRange& GetReformat() const { return m_aReformat; }
tools::Long& GetDelta() { return m_nDelta; }
const tools::Long& GetDelta() const { return m_nDelta; }
void SetDelta(tools::Long nDelta) { m_nDelta = nDelta; }
tools::Long GetDelta() const { return m_nDelta; }
SwScriptInfo& GetScriptInfo() { return m_aScriptInfo; }
const SwScriptInfo& GetScriptInfo() const { return m_aScriptInfo; }

View File

@@ -1710,7 +1710,7 @@ void SwTextFrame::InvalidateRange_( const SwCharRange &aRange, const tools::Long
// linelengths are being added, that's why it's negative
// if chars have been added and positive, if chars have
// deleted
pPara->GetDelta() += nD;
pPara->SetDelta(pPara->GetDelta() + nD);
bInv = true;
}
SwCharRange &rReformat = pPara->GetReformat();