summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-11-29 08:22:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-30 07:01:43 +0100
commit1932a549b239be7a7555453516190d3e2846593b (patch)
tree632fed72e92452e6b15a1df84783385946e76b46 /sw
parentf86f7f6e156ce0befccebff5c6a4eff8bd80d2a5 (diff)
use more SwTwips in CalcSpacing
Change-Id: Ic7409c2993014f97531f3d77533cf7a82712707a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160122 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itrcrsr.cxx4
-rw-r--r--sw/source/core/text/porlin.cxx4
-rw-r--r--sw/source/core/text/porlin.hxx2
-rw-r--r--sw/source/core/text/pormulti.cxx6
-rw-r--r--sw/source/core/text/pormulti.hxx6
-rw-r--r--sw/source/core/text/portxt.cxx2
-rw-r--r--sw/source/core/text/portxt.hxx2
7 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 1770361c19de..4ae582d7df59 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1371,7 +1371,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con
if ( pPor->InSpaceGrp() && nSpaceAdd )
{
const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nCurrStart );
- nWidth = nWidth + sal_Int16( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
+ nWidth = nWidth + pPor->CalcSpacing( nSpaceAdd, GetInfo() );
}
if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) ||
( pPor->IsMultiPortion() && static_cast<SwMultiPortion*>(pPor)->HasTabulator() )
@@ -1415,7 +1415,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con
if ( pPor->InSpaceGrp() && nSpaceAdd )
{
const_cast<SwTextSizeInfo&>(GetInfo()).SetIdx( nCurrStart );
- nWidth = nWidth + sal_Int16( pPor->CalcSpacing( nSpaceAdd, GetInfo() ) );
+ nWidth = nWidth + pPor->CalcSpacing( nSpaceAdd, GetInfo() );
}
if( ( pPor->InFixMargGrp() && ! pPor->IsMarginPortion() ) ||
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 6d0992f1abf6..31010a1e776e 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -89,7 +89,7 @@ void SwLinePortion::PrePaint( const SwTextPaintInfo& rInf,
sal_uInt16 nLastWidth = pLast->Width();
if ( pLast->InSpaceGrp() && rInf.GetSpaceAdd() )
- nLastWidth = nLastWidth + o3tl::narrowing<sal_uInt16>(pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf ));
+ nLastWidth = nLastWidth + pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf );
sal_uInt16 nPos;
SwTextPaintInfo aInf( rInf );
@@ -306,7 +306,7 @@ void SwLinePortion::Move(SwTextPaintInfo & rInf) const
rInf.SetIdx( rInf.GetIdx() + GetLen() );
}
-tools::Long SwLinePortion::CalcSpacing( tools::Long , const SwTextSizeInfo & ) const
+SwTwips SwLinePortion::CalcSpacing( tools::Long , const SwTextSizeInfo & ) const
{
return 0;
}
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 8a43d1cde6e9..50ee3ed159c1 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -169,7 +169,7 @@ public:
virtual sal_uInt16 GetViewWidth( const SwTextSizeInfo &rInf ) const;
// for text- and multi-portions
- virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const;
+ virtual SwTwips CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const;
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 4e7268698efc..7771ab9b5e8f 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -120,7 +120,7 @@ void SwMultiPortion::CalcSize( SwTextFormatter& rLine, SwTextFormatInfo &rInf )
SetAscent( nTmp );
}
-tools::Long SwMultiPortion::CalcSpacing( tools::Long , const SwTextSizeInfo & ) const
+SwTwips SwMultiPortion::CalcSpacing( tools::Long , const SwTextSizeInfo & ) const
{
return 0;
}
@@ -219,7 +219,7 @@ SwBidiPortion::SwBidiPortion(TextFrameIndex const nEnd, sal_uInt8 nLv)
SetDirection( DIR_LEFT2RIGHT );
}
-tools::Long SwBidiPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo& rInf ) const
+SwTwips SwBidiPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo& rInf ) const
{
return HasTabulator() ? 0 : sal_Int32(GetSpaceCnt(rInf)) * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
@@ -505,7 +505,7 @@ void SwDoubleLinePortion::CalcBlanks( SwTextFormatInfo &rInf )
rInf.SetIdx( nStart );
}
-tools::Long SwDoubleLinePortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo & ) const
+SwTwips SwDoubleLinePortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo & ) const
{
return HasTabulator() ? 0 : sal_Int32(GetSpaceCnt()) * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index 00389e796c7a..e5a3da2b329c 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -136,7 +136,7 @@ public:
void ActualizeTabulator();
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
- virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual SwTwips CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
virtual bool ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const;
// Summarize the internal lines to calculate the (external) size
@@ -183,7 +183,7 @@ public:
TextFrameIndex GetSmallerSpaceCnt() const
{ return ( m_nLineDiff < 0 ) ? m_nBlank1 : m_nBlank2; }
- virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual SwTwips CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
virtual bool ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const override;
};
@@ -227,7 +227,7 @@ public:
// Get number of blanks for justified alignment
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf) const;
// Calculates extra spacing based on number of blanks
- virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual SwTwips CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
// Manipulate the spacing array at pCurr
virtual bool ChgSpaceAdd( SwLineLayout* pCurr, tools::Long nSpaceAdd ) const override;
};
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index ff6d40cd4d95..9631fc232dc3 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -611,7 +611,7 @@ TextFrameIndex SwTextPortion::GetSpaceCnt(const SwTextSizeInfo &rInf,
return nCnt;
}
-tools::Long SwTextPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const
+SwTwips SwTextPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const
{
TextFrameIndex nCnt(0);
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index a30f6f0e53b1..c826395272e1 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -38,7 +38,7 @@ public:
virtual TextFrameIndex GetModelPositionForViewPoint(sal_uInt16 nOfst) const override;
virtual SwPosSize GetTextSize( const SwTextSizeInfo &rInfo ) const override;
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
- virtual tools::Long CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
+ virtual SwTwips CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo &rInf ) const override;
// Counts the spaces for justified paragraph
TextFrameIndex GetSpaceCnt(const SwTextSizeInfo &rInf, TextFrameIndex& rCnt) const;