summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-10-30 11:03:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-30 15:43:23 +0200
commitbc413e15fae3672f580894a3cd7b077d533d8e6c (patch)
tree0e6306258a5f0086354f4972bd9eeb628672bfab /editeng
parent70db0942c3f63bed8c2ff517e80c06cef9b52267 (diff)
tools::Long->sal_Int32 in the DX arrays
Change-Id: I36ddc11b39763dc77086591fe9bb756195b4294f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124459 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editdoc.hxx18
-rw-r--r--editeng/source/editeng/editdoc.cxx8
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx18
-rw-r--r--editeng/source/items/svxfont.cxx4
-rw-r--r--editeng/source/outliner/outleeng.cxx2
-rw-r--r--editeng/source/outliner/outleeng.hxx2
-rw-r--r--editeng/source/outliner/outliner.cxx4
10 files changed, 31 insertions, 31 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx
index 7d9af8e7d616..4fdff5b2a378 100644
--- a/editeng/inc/editdoc.hxx
+++ b/editeng/inc/editdoc.hxx
@@ -362,14 +362,14 @@ struct ExtraPortionInfo
bool bFirstCharIsRightPunktuation;
bool bCompressed;
- std::unique_ptr<tools::Long[]> pOrgDXArray;
+ std::unique_ptr<sal_Int32[]> pOrgDXArray;
std::vector< sal_Int32 > lineBreaksList;
ExtraPortionInfo();
~ExtraPortionInfo();
- void SaveOrgDXArray( const tools::Long* pDXArray, sal_Int32 nLen );
+ void SaveOrgDXArray( const sal_Int32* pDXArray, sal_Int32 nLen );
};
@@ -460,12 +460,12 @@ class ParaPortion;
class EditLine
{
public:
- typedef std::vector<tools::Long> CharPosArrayType;
+ typedef std::vector<sal_Int32> CharPosArrayType;
private:
CharPosArrayType aPositions;
- tools::Long nTxtWidth;
- tools::Long nStartPosX;
+ sal_Int32 nTxtWidth;
+ sal_Int32 nStartPosX;
sal_Int32 nStart; // could be replaced by nStartPortion
sal_Int32 nEnd; // could be replaced by nEndPortion
sal_Int32 nStartPortion;
@@ -505,8 +505,8 @@ public:
sal_uInt16 GetHeight() const { return nHeight; }
sal_uInt16 GetTxtHeight() const { return nTxtHeight; }
- void SetTextWidth( tools::Long n ) { nTxtWidth = n; }
- tools::Long GetTextWidth() const { return nTxtWidth; }
+ void SetTextWidth( sal_Int32 n ) { nTxtWidth = n; }
+ sal_Int32 GetTextWidth() const { return nTxtWidth; }
void SetMaxAscent( sal_uInt16 n ) { nMaxAscent = n; }
sal_uInt16 GetMaxAscent() const { return nMaxAscent; }
@@ -516,8 +516,8 @@ public:
sal_Int32 GetLen() const { return nEnd - nStart; }
- tools::Long GetStartPosX() const { return nStartPosX; }
- void SetStartPosX( tools::Long start );
+ sal_Int32 GetStartPosX() const { return nStartPosX; }
+ void SetStartPosX( sal_Int32 start );
Size CalcTextSize( ParaPortion& rParaPortion );
bool IsInvalid() const { return bInvalid; }
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 4539b3cd44dc..f2fef724e696 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -490,12 +490,12 @@ ExtraPortionInfo::~ExtraPortionInfo()
{
}
-void ExtraPortionInfo::SaveOrgDXArray( const tools::Long* pDXArray, sal_Int32 nLen )
+void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_Int32 nLen )
{
if (pDXArray)
{
- pOrgDXArray.reset(new tools::Long[nLen]);
- memcpy( pOrgDXArray.get(), pDXArray, nLen * sizeof(tools::Long) );
+ pOrgDXArray.reset(new sal_Int32[nLen]);
+ memcpy( pOrgDXArray.get(), pDXArray, nLen * sizeof(sal_Int32) );
}
else
pOrgDXArray.reset();
@@ -979,7 +979,7 @@ void EditLine::SetHeight( sal_uInt16 nH, sal_uInt16 nTxtH )
nTxtHeight = ( nTxtH ? nTxtH : nH );
}
-void EditLine::SetStartPosX( tools::Long start )
+void EditLine::SetStartPosX( sal_Int32 start )
{
if (start > 0)
nStartPosX = start;
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 5301de9513e0..ae30e651b594 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2464,7 +2464,7 @@ css::uno::Reference< css::datatransfer::XTransferable >
// ====================== Virtual Methods ========================
void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32,
- o3tl::span<const tools::Long>, const SvxFont&, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/,
+ o3tl::span<const sal_Int32>, const SvxFont&, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/,
const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool,
const css::lang::Locale*, const Color&, const Color&)
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index c93a8a78f746..7e22687aba7c 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -706,7 +706,7 @@ private:
bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const;
bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos,
- tools::Long* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
+ sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, tools::Long nRemainingWidth );
void ImplInitLayoutMode(OutputDevice& rOutDev, sal_Int32 nPara, sal_Int32 nIndex);
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index c54405b3c30f..3eacc677e00a 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4197,7 +4197,7 @@ tools::Long ImpEditEngine::GetXPos(
if ( nType == AsianCompressionFlags::PunctuationRight && !pLine->GetCharPosArray().empty() )
{
sal_Int32 n = nIndex - nTextPortionStart;
- const tools::Long* pDXArray = pLine->GetCharPosArray().data()+( nTextPortionStart-pLine->GetStart() );
+ const sal_Int32* pDXArray = pLine->GetCharPosArray().data()+( nTextPortionStart-pLine->GetStart() );
sal_Int32 nCharWidth = ( ( (n+1) < rPortion.GetLen() ) ? pDXArray[n] : rPortion.GetSize().Width() )
- ( n ? pDXArray[n-1] : 0 );
if ( (n+1) < rPortion.GetLen() )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 98736f11cb85..59d0d4d583c1 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -156,7 +156,7 @@ static void lcl_DrawRedLines( OutputDevice& rOutDev,
const Point& rPoint,
size_t nIndex,
size_t nMaxEnd,
- o3tl::span<const tools::Long> pDXArray,
+ o3tl::span<const sal_Int32> pDXArray,
WrongList const * pWrongs,
Degree10 nOrientation,
const Point& rOrigin,
@@ -753,7 +753,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
ImplInitLayoutMode(*GetRefDevice(), nPara, nIndex);
- std::vector<tools::Long> aBuf( pNode->Len() );
+ std::vector<sal_Int32> aBuf( pNode->Len() );
bool bSameLineAgain = false; // For TextRanger, if the height changes.
TabInfo aCurrentTab;
@@ -1040,7 +1040,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
OUString aFieldValue = static_cast<const EditCharAttribField*>(pNextFeature)->GetFieldValue();
// get size, but also DXArray to allow length information in line breaking below
- std::vector<tools::Long> aTmpDXArray;
+ std::vector<sal_Int32> aTmpDXArray;
pPortion->GetSize() = aTmpFont.QuickGetTextSize(GetRefDevice(), aFieldValue, 0, aFieldValue.getLength(), &aTmpDXArray);
// So no scrolling for oversized fields
@@ -1171,7 +1171,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// And now check for Compression:
if ( !bContinueLastPortion && nPortionLen && GetAsianCompressionMode() != CharCompressType::NONE )
{
- tools::Long* pDXArray = rArray.data() + nTmpPos - pLine->GetStart();
+ sal_Int32* pDXArray = rArray.data() + nTmpPos - pLine->GetStart();
bCompressedChars |= ImplCalcAsianCompression(
pNode, pPortion, nTmpPos, pDXArray, 10000, false);
}
@@ -1344,7 +1344,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed )
{
// I need the manipulated DXArray for determining the break position...
- tools::Long* pDXArray = pLine->GetCharPosArray().data() + (nPortionStart - pLine->GetStart());
+ sal_Int32* pDXArray = pLine->GetCharPosArray().data() + (nPortionStart - pLine->GetStart());
ImplCalcAsianCompression(
pNode, pPortion, nPortionStart, pDXArray, 10000, true);
}
@@ -3258,8 +3258,8 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po
OUString aText;
sal_Int32 nTextStart = 0;
sal_Int32 nTextLen = 0;
- o3tl::span<const tools::Long> pDXArray;
- std::vector<tools::Long> aTmpDXArray;
+ o3tl::span<const sal_Int32> pDXArray;
+ std::vector<sal_Int32> aTmpDXArray;
if ( rTextPortion.GetKind() == PortionKind::TEXT )
{
@@ -4419,7 +4419,7 @@ Color ImpEditEngine::GetAutoColor() const
bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
TextPortion* pTextPortion, sal_Int32 nStartPos,
- tools::Long* pDXArray, sal_uInt16 n100thPercentFromMax,
+ sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax,
bool bManipulateDXArray)
{
DBG_ASSERT( GetAsianCompressionMode() != CharCompressType::NONE, "ImplCalcAsianCompression - Why?" );
@@ -4587,7 +4587,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion*
sal_Int32 nTxtPortion = pParaPortion->GetTextPortions().GetPos( pTP );
sal_Int32 nTxtPortionStart = pParaPortion->GetTextPortions().GetStartPos( nTxtPortion );
DBG_ASSERT( nTxtPortionStart >= pLine->GetStart(), "Portion doesn't belong to the line!!!" );
- tools::Long* pDXArray = pLine->GetCharPosArray().data() + (nTxtPortionStart - pLine->GetStart());
+ sal_Int32* pDXArray = pLine->GetCharPosArray().data() + (nTxtPortionStart - pLine->GetStart());
if ( pTP->GetExtraInfos()->pOrgDXArray )
memcpy( pDXArray, pTP->GetExtraInfos()->pOrgDXArray.get(), (pTP->GetLen()-1)*sizeof(sal_Int32) );
ImplCalcAsianCompression( pParaPortion->GetNode(), pTP, nTxtPortionStart, pDXArray, static_cast<sal_uInt16>(nCompressPercent), true );
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index e5b6a6df4fbf..d4370e9b00de 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -452,7 +452,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut )
}
Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
- const sal_Int32 nIdx, const sal_Int32 nLen, std::vector<tools::Long>* pDXArray ) const
+ const sal_Int32 nIdx, const sal_Int32 nLen, std::vector<sal_Int32>* pDXArray ) const
{
if ( !IsCaseMap() && !IsKern() )
return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ),
@@ -500,7 +500,7 @@ Size SvxFont::GetTextSize(const OutputDevice& rOut, const OUString &rTxt,
void SvxFont::QuickDrawText( OutputDevice *pOut,
const Point &rPos, const OUString &rTxt,
- const sal_Int32 nIdx, const sal_Int32 nLen, o3tl::span<const tools::Long> pDXArray ) const
+ const sal_Int32 nIdx, const sal_Int32 nLen, o3tl::span<const sal_Int32> pDXArray ) const
{
// Font has to be selected in OutputDevice...
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index ed0099d2ac1a..e4fc414ad8e3 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -141,7 +141,7 @@ OUString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const
}
void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen,
- o3tl::span<const tools::Long> pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
+ o3tl::span<const sal_Int32> pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index ecc14d61a75c..963e74582ec0 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -44,7 +44,7 @@ public:
virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph ) override;
virtual void DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
- sal_Int32 nTextLen, o3tl::span<const tools::Long> pDXArray, const SvxFont& rFont,
+ sal_Int32 nTextLen, o3tl::span<const sal_Int32> pDXArray, const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 48d02130135a..c5ee16f7760c 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -967,7 +967,7 @@ void Outliner::PaintBullet(sal_Int32 nPara, const Point& rStartPos, const Point&
if(bStrippingPortions)
{
const vcl::Font& aSvxFont(rOutDev.GetFont());
- std::vector<tools::Long> aBuf;
+ std::vector<sal_Int32> aBuf;
rOutDev.GetTextArray( pPara->GetText(), &aBuf );
if(bSymbol)
@@ -1653,7 +1653,7 @@ void Outliner::StripPortions()
}
void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
- sal_Int32 nTextLen, o3tl::span<const tools::Long> pDXArray,const SvxFont& rFont,
+ sal_Int32 nTextLen, o3tl::span<const sal_Int32> pDXArray,const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,