summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-19 15:13:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-20 10:08:05 +0200
commitf886d9cacba197cb92a75317fe7d24280dff6436 (patch)
tree8e95e9fc79121eb9d09a18022e253904a1ff184f /editeng
parent9a59220e82fa87d70db2735bed502846d0f9df05 (diff)
use tools::Long in editeng
Change-Id: Ib7014c353489461ad9489d9f3fefd59a32f8f877 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104524 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editdoc.hxx28
-rw-r--r--editeng/qa/items/borderline_test.cxx46
-rw-r--r--editeng/source/accessibility/AccessibleStringWrap.cxx2
-rw-r--r--editeng/source/editeng/editdoc.cxx12
-rw-r--r--editeng/source/editeng/editeng.cxx26
-rw-r--r--editeng/source/editeng/editobj2.hxx2
-rw-r--r--editeng/source/editeng/editundo.cxx8
-rw-r--r--editeng/source/editeng/editview.cxx12
-rw-r--r--editeng/source/editeng/eehtml.cxx2
-rw-r--r--editeng/source/editeng/eertfpar.cxx8
-rw-r--r--editeng/source/editeng/impedit.cxx60
-rw-r--r--editeng/source/editeng/impedit.hxx46
-rw-r--r--editeng/source/editeng/impedit2.cxx78
-rw-r--r--editeng/source/editeng/impedit3.cxx198
-rw-r--r--editeng/source/editeng/impedit4.cxx6
-rw-r--r--editeng/source/items/borderline.cxx14
-rw-r--r--editeng/source/items/frmitems.cxx64
-rw-r--r--editeng/source/items/itemtype.cxx4
-rw-r--r--editeng/source/items/numitem.cxx10
-rw-r--r--editeng/source/items/paperinf.cxx2
-rw-r--r--editeng/source/items/svxfont.cxx28
-rw-r--r--editeng/source/items/textitem.cxx16
-rw-r--r--editeng/source/misc/txtrange.cxx74
-rw-r--r--editeng/source/outliner/outleeng.cxx6
-rw-r--r--editeng/source/outliner/outleeng.hxx6
-rw-r--r--editeng/source/outliner/outliner.cxx14
-rw-r--r--editeng/source/outliner/outlvw.cxx6
-rw-r--r--editeng/source/rtf/rtfitem.cxx2
-rw-r--r--editeng/source/uno/unofored.cxx4
-rw-r--r--editeng/source/uno/unoforou.cxx4
30 files changed, 394 insertions, 394 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx
index f4ef714999e9..4b4f610772a5 100644
--- a/editeng/inc/editdoc.hxx
+++ b/editeng/inc/editdoc.hxx
@@ -350,10 +350,10 @@ namespace o3tl {
struct ExtraPortionInfo
{
- long nOrgWidth;
- long nWidthFullCompression;
+ tools::Long nOrgWidth;
+ tools::Long nWidthFullCompression;
- long nPortionOffsetX;
+ tools::Long nPortionOffsetX;
sal_uInt16 nMaxCompression100thPercent;
@@ -368,7 +368,7 @@ struct ExtraPortionInfo
ExtraPortionInfo();
~ExtraPortionInfo();
- void SaveOrgDXArray( const long* pDXArray, sal_Int32 nLen );
+ void SaveOrgDXArray( const tools::Long* pDXArray, sal_Int32 nLen );
};
@@ -461,8 +461,8 @@ public:
private:
CharPosArrayType aPositions;
- long nTxtWidth;
- long nStartPosX;
+ tools::Long nTxtWidth;
+ tools::Long nStartPosX;
sal_Int32 nStart; // could be replaced by nStartPortion
sal_Int32 nEnd; // could be replaced by nEndPortion
sal_Int32 nStartPortion;
@@ -504,8 +504,8 @@ public:
sal_uInt16 GetHeight() const { return nHeight; }
sal_uInt16 GetTxtHeight() const { return nTxtHeight; }
- void SetTextWidth( long n ) { nTxtWidth = n; }
- long GetTextWidth() const { return nTxtWidth; }
+ void SetTextWidth( tools::Long n ) { nTxtWidth = n; }
+ tools::Long GetTextWidth() const { return nTxtWidth; }
void SetMaxAscent( sal_uInt16 n ) { nMaxAscent = n; }
sal_uInt16 GetMaxAscent() const { return nMaxAscent; }
@@ -515,8 +515,8 @@ public:
sal_Int32 GetLen() const { return nEnd - nStart; }
- long GetStartPosX() const { return nStartPosX; }
- void SetStartPosX( long start );
+ tools::Long GetStartPosX() const { return nStartPosX; }
+ void SetStartPosX( tools::Long start );
Size CalcTextSize( ParaPortion& rParaPortion );
bool IsInvalid() const { return bInvalid; }
@@ -566,7 +566,7 @@ private:
EditLineList aLineList;
TextPortionList aTextPortionList;
ContentNode* pNode;
- long nHeight;
+ tools::Long nHeight;
ScriptTypePosInfos aScriptInfos;
WritingDirectionInfos aWritingDirectionInfos;
@@ -610,7 +610,7 @@ public:
bool IsEmpty() { return GetTextPortions().Count() == 1 && GetTextPortions()[0].GetLen() == 0; }
- long GetHeight() const { return ( bVisible ? nHeight : 0 ); }
+ tools::Long GetHeight() const { return ( bVisible ? nHeight : 0 ); }
sal_Int32 GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); }
void ResetHeight() { nHeight = 0; nFirstLineOffset = 0; }
@@ -638,8 +638,8 @@ public:
~ParaPortionList();
void Reset();
- long GetYOffset(const ParaPortion* pPPortion) const;
- sal_Int32 FindParagraph(long nYOffset) const;
+ tools::Long GetYOffset(const ParaPortion* pPPortion) const;
+ sal_Int32 FindParagraph(tools::Long nYOffset) const;
const ParaPortion* SafeGetObject(sal_Int32 nPos) const;
ParaPortion* SafeGetObject(sal_Int32 nPos);
diff --git a/editeng/qa/items/borderline_test.cxx b/editeng/qa/items/borderline_test.cxx
index a44c2927d4cb..0499c7087984 100644
--- a/editeng/qa/items/borderline_test.cxx
+++ b/editeng/qa/items/borderline_test.cxx
@@ -16,15 +16,15 @@
using namespace ::com::sun::star::table::BorderLineStyle;
-#define TEST_WIDTH long( 40 )
+#define TEST_WIDTH tools::Long( 40 )
-#define THINTHICKSG_IN_WIDTH long( 15 )
-#define THINTHICKSG_OUT_WIDTH long( 40 )
-#define THINTHICKSG_DIST_WIDTH long( 15 )
+#define THINTHICKSG_IN_WIDTH tools::Long( 15 )
+#define THINTHICKSG_OUT_WIDTH tools::Long( 40 )
+#define THINTHICKSG_DIST_WIDTH tools::Long( 15 )
-#define THINTHICKLG_IN_WIDTH long( 15 )
-#define THINTHICKLG_OUT_WIDTH long( 30 )
-#define THINTHICKLG_DIST_WIDTH long( 40 )
+#define THINTHICKLG_IN_WIDTH tools::Long( 15 )
+#define THINTHICKLG_OUT_WIDTH tools::Long( 30 )
+#define THINTHICKLG_DIST_WIDTH tools::Long( 40 )
using namespace editeng;
@@ -77,9 +77,9 @@ void BorderLineTest::testGuessWidthDouble()
SvxBorderLine line;
line.GuessLinesWidths( SvxBorderLineStyle::DOUBLE, TEST_WIDTH, TEST_WIDTH, TEST_WIDTH );
CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::DOUBLE, line.GetBorderLineStyle() );
- CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<long>(line.GetOutWidth()) );
- CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<long>(line.GetInWidth()) );
- CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<long>(line.GetDistance()) );
+ CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<tools::Long>(line.GetOutWidth()) );
+ CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<tools::Long>(line.GetInWidth()) );
+ CPPUNIT_ASSERT_EQUAL( TEST_WIDTH, static_cast<tools::Long>(line.GetDistance()) );
CPPUNIT_ASSERT_EQUAL( 3*TEST_WIDTH, line.GetWidth() );
}
@@ -89,10 +89,10 @@ void BorderLineTest::testGuessWidthNoMatch()
line.GuessLinesWidths( SvxBorderLineStyle::DOUBLE,
TEST_WIDTH + 1, TEST_WIDTH + 2, TEST_WIDTH + 3 );
CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::DOUBLE, line.GetBorderLineStyle() );
- CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+1, static_cast<long>(line.GetOutWidth()) );
- CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+2, static_cast<long>(line.GetInWidth()) );
- CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+3, static_cast<long>(line.GetDistance()));
- CPPUNIT_ASSERT_EQUAL( long( (3 * TEST_WIDTH) + 6 ), line.GetWidth() );
+ CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+1, static_cast<tools::Long>(line.GetOutWidth()) );
+ CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+2, static_cast<tools::Long>(line.GetInWidth()) );
+ CPPUNIT_ASSERT_EQUAL( TEST_WIDTH+3, static_cast<tools::Long>(line.GetDistance()));
+ CPPUNIT_ASSERT_EQUAL( tools::Long( (3 * TEST_WIDTH) + 6 ), line.GetWidth() );
}
void BorderLineTest::testGuessWidthThinthickSmallgap()
@@ -104,11 +104,11 @@ void BorderLineTest::testGuessWidthThinthickSmallgap()
THINTHICKSG_DIST_WIDTH );
CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::THINTHICK_SMALLGAP, line.GetBorderLineStyle() );
CPPUNIT_ASSERT_EQUAL( THINTHICKSG_OUT_WIDTH,
- static_cast<long>(line.GetOutWidth()) );
+ static_cast<tools::Long>(line.GetOutWidth()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKSG_IN_WIDTH,
- static_cast<long>(line.GetInWidth()) );
+ static_cast<tools::Long>(line.GetInWidth()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKSG_DIST_WIDTH,
- static_cast<long>(line.GetDistance()) );
+ static_cast<tools::Long>(line.GetDistance()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKSG_OUT_WIDTH + THINTHICKSG_IN_WIDTH
+ THINTHICKSG_DIST_WIDTH, line.GetWidth() );
}
@@ -122,11 +122,11 @@ void BorderLineTest::testGuessWidthThinthickLargegap()
THINTHICKLG_DIST_WIDTH );
CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::THINTHICK_LARGEGAP, line.GetBorderLineStyle() );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_OUT_WIDTH,
- static_cast<long>(line.GetOutWidth()) );
+ static_cast<tools::Long>(line.GetOutWidth()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_IN_WIDTH,
- static_cast<long>(line.GetInWidth()) );
+ static_cast<tools::Long>(line.GetInWidth()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_DIST_WIDTH,
- static_cast<long>(line.GetDistance()) );
+ static_cast<tools::Long>(line.GetDistance()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_OUT_WIDTH + THINTHICKLG_IN_WIDTH
+ THINTHICKLG_DIST_WIDTH, line.GetWidth() );
}
@@ -140,11 +140,11 @@ void BorderLineTest::testGuessWidthNostyleDouble()
THINTHICKLG_DIST_WIDTH );
CPPUNIT_ASSERT_EQUAL( SvxBorderLineStyle::THINTHICK_LARGEGAP, line.GetBorderLineStyle() );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_OUT_WIDTH,
- static_cast<long>(line.GetOutWidth()) );
+ static_cast<tools::Long>(line.GetOutWidth()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_IN_WIDTH,
- static_cast<long>(line.GetInWidth()) );
+ static_cast<tools::Long>(line.GetInWidth()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_DIST_WIDTH,
- static_cast<long>(line.GetDistance()) );
+ static_cast<tools::Long>(line.GetDistance()) );
CPPUNIT_ASSERT_EQUAL( THINTHICKLG_OUT_WIDTH + THINTHICKLG_IN_WIDTH
+ THINTHICKLG_DIST_WIDTH, line.GetWidth() );
}
diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx b/editeng/source/accessibility/AccessibleStringWrap.cxx
index ccc4546e04df..a2439705a7fd 100644
--- a/editeng/source/accessibility/AccessibleStringWrap.cxx
+++ b/editeng/source/accessibility/AccessibleStringWrap.cxx
@@ -54,7 +54,7 @@ void AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, tools::Rectangl
}
else
{
- long aXArray[2];
+ tools::Long aXArray[2];
mrDev.GetCaretPositions( maText, aXArray, nIndex, 1 );
rRect.SetLeft( 0 );
rRect.SetTop( 0 );
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 75b9ef827cb3..454fc460849a 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -493,7 +493,7 @@ ExtraPortionInfo::~ExtraPortionInfo()
{
}
-void ExtraPortionInfo::SaveOrgDXArray( const long* pDXArray, sal_Int32 nLen )
+void ExtraPortionInfo::SaveOrgDXArray( const tools::Long* pDXArray, sal_Int32 nLen )
{
if (pDXArray)
{
@@ -752,9 +752,9 @@ void ParaPortionList::Reset()
maPortions.clear();
}
-long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const
+tools::Long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const
{
- long nHeight = 0;
+ tools::Long nHeight = 0;
for (const auto & rPortion : maPortions)
{
const ParaPortion* pTmpPortion = rPortion.get();
@@ -766,9 +766,9 @@ long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const
return nHeight;
}
-sal_Int32 ParaPortionList::FindParagraph(long nYOffset) const
+sal_Int32 ParaPortionList::FindParagraph(tools::Long nYOffset) const
{
- long nY = 0;
+ tools::Long nY = 0;
for (size_t i = 0, n = maPortions.size(); i < n; ++i)
{
nY += maPortions[i]->GetHeight(); // should also be correct even in bVisible!
@@ -999,7 +999,7 @@ void EditLine::SetHeight( sal_uInt16 nH, sal_uInt16 nTxtH )
nTxtHeight = ( nTxtH ? nTxtH : nH );
}
-void EditLine::SetStartPosX( long start )
+void EditLine::SetStartPosX( tools::Long start )
{
if (start > 0)
nStartPosX = start;
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 03836af7b511..071f78947b2f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -261,8 +261,8 @@ void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect,
{
// Clip only if necessary...
if ( rStartDocPos.X() || rStartDocPos.Y() ||
- ( rOutRect.GetHeight() < static_cast<long>(GetTextHeight()) ) ||
- ( rOutRect.GetWidth() < static_cast<long>(CalcTextWidth()) ) )
+ ( rOutRect.GetHeight() < static_cast<tools::Long>(GetTextHeight()) ) ||
+ ( rOutRect.GetWidth() < static_cast<tools::Long>(CalcTextWidth()) ) )
{
// Some printer drivers cause problems if characters graze the
// ClipRegion, therefore rather add a pixel more ...
@@ -846,7 +846,7 @@ EditSelection EditEngine::SelectWord(
return pImpEditEngine->SelectWord(rCurSelection, nWordType);
}
-long EditEngine::GetXPos(
+tools::Long EditEngine::GetXPos(
const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart) const
{
return pImpEditEngine->GetXPos(pParaPortion, pLine, nIndex, bPreferPortionStart);
@@ -1030,10 +1030,10 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
sal_Int32 nParas = GetParagraphCount();
Point aPos;
Point aViewStart( pEditView->GetOutputArea().TopLeft() );
- long n20 = 40 * pImpEditEngine->nOnePixelInRef;
+ tools::Long n20 = 40 * pImpEditEngine->nOnePixelInRef;
for ( sal_Int32 n = 0; n < nParas; n++ )
{
- long nH = GetTextHeight( n );
+ tools::Long nH = GetTextHeight( n );
Point P1( aViewStart.X() + n20 + n20*(n%2), aViewStart.Y() + aPos.Y() );
Point P2( P1 );
P2.AdjustX(n20 );
@@ -1887,7 +1887,7 @@ void EditEngine::SetControlWord( EEControlBits nWord )
}
else
{
- long nY = 0;
+ tools::Long nY = 0;
sal_Int32 nNodes = pImpEditEngine->GetEditDoc().Count();
for ( sal_Int32 n = 0; n < nNodes; n++ )
{
@@ -1915,10 +1915,10 @@ EEControlBits EditEngine::GetControlWord() const
return pImpEditEngine->aStatus.GetControlWord();
}
-long EditEngine::GetFirstLineStartX( sal_Int32 nParagraph )
+tools::Long EditEngine::GetFirstLineStartX( sal_Int32 nParagraph )
{
- long nX = 0;
+ tools::Long nX = 0;
const ParaPortion* pPPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nParagraph );
if ( pPPortion )
{
@@ -2007,7 +2007,7 @@ bool EditEngine::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder )
// take unrotated positions for calculation here
Point aDocPos = GetDocPos( rPaperPos );
- if ( ( aDocPos.Y() > 0 ) && ( aDocPos.Y() < static_cast<long>(pImpEditEngine->GetTextHeight()) ) )
+ if ( ( aDocPos.Y() > 0 ) && ( aDocPos.Y() < static_cast<tools::Long>(pImpEditEngine->GetTextHeight()) ) )
{
EditPaM aPaM = pImpEditEngine->GetPaM( aDocPos, false );
if ( aPaM.GetNode() )
@@ -2377,7 +2377,7 @@ void EditEngine::CompleteOnlineSpelling()
}
}
-sal_Int32 EditEngine::FindParagraph( long nDocPosY )
+sal_Int32 EditEngine::FindParagraph( tools::Long nDocPosY )
{
return pImpEditEngine->GetParaPortions().FindParagraph( nDocPosY );
}
@@ -2447,14 +2447,14 @@ css::uno::Reference< css::datatransfer::XTransferable >
// ====================== Virtual Methods ========================
void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32,
- const long*, const SvxFont&, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/,
+ const tools::Long*, const SvxFont&, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/,
const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool,
const css::lang::Locale*, const Color&, const Color&)
{
}
-void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
+void EditEngine::DrawingTab( const Point& /*rStartPos*/, tools::Long /*nWidth*/,
const OUString& /*rChar*/, const SvxFont& /*rFont*/,
sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
@@ -2462,7 +2462,7 @@ void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
{
}
-void EditEngine::PaintingFirstLine( sal_Int32, const Point&, long, const Point&, short, OutputDevice* )
+void EditEngine::PaintingFirstLine( sal_Int32, const Point&, tools::Long, const Point&, short, OutputDevice* )
{
}
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index 41bbc5404e50..605571be46cf 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -82,7 +82,7 @@ inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) const
struct XParaPortion
{
- long nHeight;
+ tools::Long nHeight;
sal_uInt16 nFirstLineOffset;
EditLineList aLines;
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 5ab476c98698..714dd1b682ed 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -415,15 +415,15 @@ void EditUndoMoveParagraphs::Undo()
{
DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
Range aTmpRange( nParagraphs );
- long nTmpDest = aTmpRange.Min();
+ tools::Long nTmpDest = aTmpRange.Min();
- long nDiff = nDest - aTmpRange.Min();
+ tools::Long nDiff = nDest - aTmpRange.Min();
aTmpRange.Min() += nDiff;
aTmpRange.Max() += nDiff;
- if ( nParagraphs.Min() < static_cast<long>(nDest) )
+ if ( nParagraphs.Min() < static_cast<tools::Long>(nDest) )
{
- long nLen = aTmpRange.Len();
+ tools::Long nLen = aTmpRange.Len();
aTmpRange.Min() -= nLen;
aTmpRange.Max() -= nLen;
}
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 6b897a3bdb5c..f13a67870902 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -196,7 +196,7 @@ tools::Rectangle EditView::GetInvalidateRect() const
else
{
tools::Rectangle aRect( pImpEditView->aOutArea );
- long nMore = pImpEditView->GetWindow()->PixelToLogic( Size( pImpEditView->GetInvalidateMore(), 0 ) ).Width();
+ tools::Long nMore = pImpEditView->GetWindow()->PixelToLogic( Size( pImpEditView->GetInvalidateMore(), 0 ) ).Width();
aRect.AdjustLeft( -nMore );
aRect.AdjustRight(nMore );
aRect.AdjustTop( -nMore );
@@ -527,7 +527,7 @@ void EditView::HideCursor(bool bDeactivate)
}
}
-Pair EditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
+Pair EditView::Scroll( tools::Long ndX, tools::Long ndY, ScrollRangeCheck nRangeCheck )
{
return pImpEditView->Scroll( ndX, ndY, nRangeCheck );
}
@@ -670,12 +670,12 @@ void EditView::MoveParagraphs( Range aParagraphs, sal_Int32 nNewPos )
pImpEditView->pEditEngine->pImpEditEngine->UndoActionEnd();
}
-void EditView::MoveParagraphs( long nDiff )
+void EditView::MoveParagraphs( tools::Long nDiff )
{
ESelection aSel = GetSelection();
Range aRange( aSel.nStartPara, aSel.nEndPara );
aRange.Justify();
- long nDest = ( nDiff > 0 ? aRange.Max() : aRange.Min() ) + nDiff;
+ tools::Long nDest = ( nDiff > 0 ? aRange.Max() : aRange.Min() ) + nDiff;
if ( nDiff > 0 )
nDest++;
DBG_ASSERT( ( nDest >= 0 ) && ( nDest <= pImpEditView->pEditEngine->GetParagraphCount() ), "MoveParagraphs - wrong Parameters!" );
@@ -1429,7 +1429,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
while( *pWhich )
{
SvxFontHeightItem aFontHeightItem( static_cast<const SvxFontHeightItem&>(rSet.Get( *pWhich )) );
- long nHeight = aFontHeightItem.GetHeight();
+ tools::Long nHeight = aFontHeightItem.GetHeight();
const MapUnit eUnit = rSet.GetPool()->GetMetric( *pWhich );
nHeight = OutputDevice::LogicToLogic(nHeight * 10, eUnit, MapUnit::MapPoint);
@@ -1486,7 +1486,7 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
{
nHeight = OutputDevice::LogicToLogic( nHeight, MapUnit::MapPoint, eUnit ) / 10;
- if( nHeight != static_cast<long>(aFontHeightItem.GetHeight()) )
+ if( nHeight != static_cast<tools::Long>(aFontHeightItem.GetHeight()) )
{
aFontHeightItem.SetHeight( nHeight );
rSet.Put( aFontHeightItem.CloneSetWhich(*pWhich) );
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index ce5721787ef3..ea38d05d290d 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -602,7 +602,7 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
if ( ( eUnit != MapUnit::MapPixel ) && ( eUnit != MapUnit::MapSysFont ) &&
( eUnit != MapUnit::MapAppFont ) && ( eUnit != MapUnit::MapRelative ) )
{
- long nPoints = 10;
+ tools::Long nPoints = 10;
if ( nHLevel == 1 )
nPoints = 22;
else if ( nHLevel == 2 )
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index ea286d4a59ce..a05c3a3b9771 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -319,8 +319,8 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
if (SfxItemState::SET == rSet.GetAttrSet().GetItemState( aFntHeightIem, false, &pItem ))
{
sal_uInt32 nHeight = static_cast<const SvxFontHeightItem*>(pItem)->GetHeight();
- long nNewHeight;
- nNewHeight = OutputDevice::LogicToLogic( static_cast<long>(nHeight), gRTFMapUnit, eDestUnit );
+ tools::Long nNewHeight;
+ nNewHeight = OutputDevice::LogicToLogic( static_cast<tools::Long>(nHeight), gRTFMapUnit, eDestUnit );
SvxFontHeightItem aFntHeightItem( nNewHeight, 100, aFntHeightIem );
aFntHeightItem.SetProp(
@@ -334,8 +334,8 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
if( SfxItemState::SET == rSet.GetAttrSet().GetItemState( EE_CHAR_ESCAPEMENT, false, &pItem ))
{
// the correct one
- long nEsc = static_cast<const SvxEscapementItem*>(pItem)->GetEsc();
- long nEscFontHeight = 0;
+ tools::Long nEsc = static_cast<const SvxEscapementItem*>(pItem)->GetEsc();
+ tools::Long nEscFontHeight = 0;
if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) )
{
nEsc *= 10; //HalfPoints => Twips was embezzled in RTFITEM.CXX!
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index c879c5ff51c5..411a63766020 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -318,8 +318,8 @@ void ImpEditView::lokSelectionCallback(const std::unique_ptr<tools::PolyPolygon>
if (pParent && pParent->GetLOKWindowId() != 0)
{
- const long nX = pOutWin->GetOutOffXPixel() - pParent->GetOutOffXPixel();
- const long nY = pOutWin->GetOutOffYPixel() - pParent->GetOutOffYPixel();
+ const tools::Long nX = pOutWin->GetOutOffXPixel() - pParent->GetOutOffXPixel();
+ const tools::Long nY = pOutWin->GetOutOffYPixel() - pParent->GetOutOffYPixel();
std::vector<tools::Rectangle> aRectangles;
aRegion.GetRegionRectangles(aRectangles);
@@ -532,7 +532,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
if ( !pTmpPortion->IsVisible() || pTmpPortion->IsInvalid() )
continue;
- long nParaStart = pEditEngine->GetParaPortions().GetYOffset( pTmpPortion );
+ tools::Long nParaStart = pEditEngine->GetParaPortions().GetYOffset( pTmpPortion );
if ( ( nParaStart + pTmpPortion->GetHeight() ) < GetVisDocTop() )
continue;
if ( nParaStart > GetVisDocBottom() )
@@ -607,8 +607,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
DBG_ASSERT( nTmpEndIndex > nTmpStartIndex, "DrawSelectionXOR, Start >= End?" );
- long nX1 = pEditEngine->GetXPos(pTmpPortion, &rLine, nTmpStartIndex, true);
- long nX2 = pEditEngine->GetXPos(pTmpPortion, &rLine, nTmpEndIndex);
+ tools::Long nX1 = pEditEngine->GetXPos(pTmpPortion, &rLine, nTmpStartIndex, true);
+ tools::Long nX2 = pEditEngine->GetXPos(pTmpPortion, &rLine, nTmpEndIndex);
Point aPt1( std::min( nX1, nX2 ), aTopLeft.Y() );
Point aPt2( std::max( nX1, nX2 ), aBottomRight.Y() );
@@ -1089,7 +1089,7 @@ tools::Rectangle ImpEditView::ImplGetEditCursor(EditPaM& aPaM, GetCursorFlags nS
}
}
- long nMaxHeight = !IsVertical() ? aOutArea.GetHeight() : aOutArea.GetWidth();
+ tools::Long nMaxHeight = !IsVertical() ? aOutArea.GetHeight() : aOutArea.GetWidth();
if ( aEditCursor.GetHeight() > nMaxHeight )
{
aEditCursor.SetBottom( aEditCursor.Top() + nMaxHeight - 1 );
@@ -1173,13 +1173,13 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
{
// check if scrolling is necessary...
// if scrolling, then update () and Scroll ()!
- long nDocDiffX = 0;
- long nDocDiffY = 0;
+ tools::Long nDocDiffX = 0;
+ tools::Long nDocDiffY = 0;
tools::Rectangle aTmpVisArea( GetVisDocArea() );
// aTmpOutArea: if OutputArea > Paper width and
// Text > Paper width ( over large fields )
- long nMaxTextWidth = !IsVertical() ? pEditEngine->pImpEditEngine->GetPaperSize().Width() : pEditEngine->pImpEditEngine->GetPaperSize().Height();
+ tools::Long nMaxTextWidth = !IsVertical() ? pEditEngine->pImpEditEngine->GetPaperSize().Width() : pEditEngine->pImpEditEngine->GetPaperSize().Height();
if ( aTmpVisArea.GetWidth() > nMaxTextWidth )
aTmpVisArea.SetRight( aTmpVisArea.Left() + nMaxTextWidth );
@@ -1201,7 +1201,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
nDocDiffX += GetScrollDiffX();
else
{
- long n = nMaxTextWidth - aEditCursor.Right();
+ tools::Long n = nMaxTextWidth - aEditCursor.Right();
// If MapMode != RefMapMode then the EditCursor can go beyond
// the paper width!
nDocDiffX += ( n > 0 ? n : -n );
@@ -1212,7 +1212,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
// Scroll right, negative:
nDocDiffX = aEditCursor.Left() - aTmpVisArea.Left();
// Can it be a little more?
- if ( aEditCursor.Left() > ( - static_cast<long>(GetScrollDiffX()) ) )
+ if ( aEditCursor.Left() > ( - static_cast<tools::Long>(GetScrollDiffX()) ) )
nDocDiffX -= GetScrollDiffX();
else
nDocDiffX -= aEditCursor.Left();
@@ -1229,8 +1229,8 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
if ( nDocDiffX | nDocDiffY )
{
- long nDiffX = !IsVertical() ? nDocDiffX : (IsTopToBottom() ? -nDocDiffY : nDocDiffY);
- long nDiffY = !IsVertical() ? nDocDiffY : (IsTopToBottom() ? nDocDiffX : -nDocDiffX);
+ tools::Long nDiffX = !IsVertical() ? nDocDiffX : (IsTopToBottom() ? -nDocDiffY : nDocDiffY);
+ tools::Long nDiffY = !IsVertical() ? nDocDiffY : (IsTopToBottom() ? nDocDiffX : -nDocDiffX);
if ( nDiffX )
pEditEngine->GetInternalEditStatus().GetStatusWord() = pEditEngine->GetInternalEditStatus().GetStatusWord() | EditStatusFlags::HSCROLL;
@@ -1253,7 +1253,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
const OutputDevice& rOutDev = GetOutputDevice();
- long nOnePixel = rOutDev.PixelToLogic( Size( 1, 0 ) ).Width();
+ tools::Long nOnePixel = rOutDev.PixelToLogic( Size( 1, 0 ) ).Width();
if ( ( aEditCursor.Top() + nOnePixel >= GetVisDocTop() ) &&
( aEditCursor.Bottom() - nOnePixel <= GetVisDocBottom() ) &&
@@ -1268,7 +1268,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
aCursorSz.AdjustHeight( -1 );
if ( !aCursorSz.Width() || !aCursorSz.Height() )
{
- long nCursorSz = rOutDev.GetSettings().GetStyleSettings().GetCursorSize();
+ tools::Long nCursorSz = rOutDev.GetSettings().GetStyleSettings().GetCursorSize();
nCursorSz = rOutDev.PixelToLogic( Size( nCursorSz, 0 ) ).Width();
if ( !aCursorSz.Width() )
aCursorSz.setWidth( nCursorSz );
@@ -1444,7 +1444,7 @@ void ImpEditView::ScrollStateChange()
pCallbacks->EditViewScrollStateChange();
}
-Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
+Pair ImpEditView::Scroll( tools::Long ndX, tools::Long ndY, ScrollRangeCheck nRangeCheck )
{
DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not formatted!" );
if ( !ndX && !ndY )
@@ -1480,10 +1480,10 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
aNewVisArea.AdjustBottom( -ndX );
}
}
- if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Bottom() > static_cast<long>(pEditEngine->pImpEditEngine->GetTextHeight()) ) )
+ if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Bottom() > static_cast<tools::Long>(pEditEngine->pImpEditEngine->GetTextHeight()) ) )
{
// GetTextHeight still optimizing!
- long nDiff = pEditEngine->pImpEditEngine->GetTextHeight() - aNewVisArea.Bottom(); // negative
+ tools::Long nDiff = pEditEngine->pImpEditEngine->GetTextHeight() - aNewVisArea.Bottom(); // negative
aNewVisArea.Move( 0, nDiff ); // could end up in the negative area...
}
if ( aNewVisArea.Top() < 0 )
@@ -1508,24 +1508,24 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
aNewVisArea.AdjustRight(ndY );
}
}
- if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Right() > static_cast<long>(pEditEngine->pImpEditEngine->CalcTextWidth( false )) ) )
+ if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Right() > static_cast<tools::Long>(pEditEngine->pImpEditEngine->CalcTextWidth( false )) ) )
{
- long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( false ) - aNewVisArea.Right(); // negative
+ tools::Long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( false ) - aNewVisArea.Right(); // negative
aNewVisArea.Move( nDiff, 0 ); // could end up in the negative area...
}
if ( aNewVisArea.Left() < 0 )
aNewVisArea.Move( -aNewVisArea.Left(), 0 );
// The difference must be alignt on pixel (due to scroll!)
- long nDiffX = !IsVertical() ? ( GetVisDocLeft() - aNewVisArea.Left() ) : (IsTopToBottom() ? -( GetVisDocTop() - aNewVisArea.Top() ) : (GetVisDocTop() - aNewVisArea.Top()));
- long nDiffY = !IsVertical() ? ( GetVisDocTop() - aNewVisArea.Top() ) : (IsTopToBottom() ? (GetVisDocLeft() - aNewVisArea.Left()) : -(GetVisDocTop() - aNewVisArea.Top()));
+ tools::Long nDiffX = !IsVertical() ? ( GetVisDocLeft() - aNewVisArea.Left() ) : (IsTopToBottom() ? -( GetVisDocTop() - aNewVisArea.Top() ) : (GetVisDocTop() - aNewVisArea.Top()));
+ tools::Long nDiffY = !IsVertical() ? ( GetVisDocTop() - aNewVisArea.Top() ) : (IsTopToBottom() ? (GetVisDocLeft() - aNewVisArea.Left()) : -(GetVisDocTop() - aNewVisArea.Top()));
Size aDiffs( nDiffX, nDiffY );
aDiffs = rOutDev.LogicToPixel( aDiffs );
aDiffs = rOutDev.PixelToLogic( aDiffs );
- long nRealDiffX = aDiffs.Width();
- long nRealDiffY = aDiffs.Height();
+ tools::Long nRealDiffX = aDiffs.Width();
+ tools::Long nRealDiffY = aDiffs.Height();
if ( nRealDiffX || nRealDiffY )
@@ -1837,7 +1837,7 @@ bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara )
{
sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
tools::Rectangle aBulletArea = pEditEngine->GetBulletArea( nPara );
- long nY = pEditEngine->GetDocPosTopLeft( nPara ).Y();
+ tools::Long nY = pEditEngine->GetDocPosTopLeft( nPara ).Y();
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
nY += pParaPortion->GetFirstLineOffset();
if ( ( aDocPos.Y() > ( nY + aBulletArea.Top() ) ) &&
@@ -2462,8 +2462,8 @@ void ImpEditView::dragOver(const css::datatransfer::dnd::DropTargetDragEvent& rD
bool bAllowScroll = DoAutoScroll();
if ( bAllowScroll )
{
- long nScrollX = 0;
- long nScrollY = 0;
+ tools::Long nScrollX = 0;
+ tools::Long nScrollY = 0;
// Check if in the sensitive area
if ( ( (aMousePos.X()-pDragAndDropInfo->nSensibleRange) < GetOutputArea().Left() ) && ( ( aMousePos.X() + pDragAndDropInfo->nSensibleRange ) > GetOutputArea().Left() ) )
nScrollX = GetOutputArea().GetWidth() / SCRLRANGE;
@@ -2491,8 +2491,8 @@ void ImpEditView::dragOver(const css::datatransfer::dnd::DropTargetDragEvent& rD
ParaPortion* pPPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara );
if (pPPortion)
{
- long nDestParaStartY = pEditEngine->GetParaPortions().GetYOffset( pPPortion );
- long nRel = aDocPos.Y() - nDestParaStartY;
+ tools::Long nDestParaStartY = pEditEngine->GetParaPortions().GetYOffset( pPPortion );
+ tools::Long nRel = aDocPos.Y() - nDestParaStartY;
if ( nRel < ( pPPortion->GetHeight() / 2 ) )
{
pDragAndDropInfo->nOutlinerDropDest = nPara;
@@ -2526,7 +2526,7 @@ void ImpEditView::dragOver(const css::datatransfer::dnd::DropTargetDragEvent& rD
tools::Rectangle aEditCursor;
if ( pDragAndDropInfo->bOutlinerMode )
{
- long nDDYPos(0);
+ tools::Long nDDYPos(0);
if ( pDragAndDropInfo->nOutlinerDropDest < pEditEngine->GetEditDoc().Count() )
{
ParaPortion* pPPortion = pEditEngine->GetParaPortions().SafeGetObject( pDragAndDropInfo->nOutlinerDropDest );
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 91239dd0e1aa..a6ebf55c7ccc 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -222,10 +222,10 @@ public:
bool IsVertical() const;
bool IsTopToBottom() const;
- long GetVisDocLeft() const { return maVisDocStartPos.X(); }
- long GetVisDocTop() const { return maVisDocStartPos.Y(); }
- long GetVisDocRight() const { return maVisDocStartPos.X() + (!IsVertical() ? maOutArea.GetWidth() : maOutArea.GetHeight()); }
- long GetVisDocBottom() const { return maVisDocStartPos.Y() + (!IsVertical() ? maOutArea.GetHeight() : maOutArea.GetWidth()); }
+ tools::Long GetVisDocLeft() const { return maVisDocStartPos.X(); }
+ tools::Long GetVisDocTop() const { return maVisDocStartPos.Y(); }
+ tools::Long GetVisDocRight() const { return maVisDocStartPos.X() + (!IsVertical() ? maOutArea.GetWidth() : maOutArea.GetHeight()); }
+ tools::Long GetVisDocBottom() const { return maVisDocStartPos.Y() + (!IsVertical() ? maOutArea.GetHeight() : maOutArea.GetWidth()); }
tools::Rectangle GetVisDocArea() const;
Point GetWindowPos(const Point& rDocPos, MapUnit eDocPosUnit) const;
@@ -271,7 +271,7 @@ private:
css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > mxDnDListener;
- long nInvMore;
+ tools::Long nInvMore;
EVControlBits nControl;
sal_uInt32 nTravelXPos;
GetCursorFlags nExtraCursorFlags;
@@ -375,10 +375,10 @@ public:
void SetVisDocStartPos( const Point& rPos ) { aVisDocStartPos = rPos; }
- long GetVisDocLeft() const { return aVisDocStartPos.X(); }
- long GetVisDocTop() const { return aVisDocStartPos.Y(); }
- long GetVisDocRight() const { return aVisDocStartPos.X() + ( !IsVertical() ? aOutArea.GetWidth() : aOutArea.GetHeight() ); }
- long GetVisDocBottom() const { return aVisDocStartPos.Y() + ( !IsVertical() ? aOutArea.GetHeight() : aOutArea.GetWidth() ); }
+ tools::Long GetVisDocLeft() const { return aVisDocStartPos.X(); }
+ tools::Long GetVisDocTop() const { return aVisDocStartPos.Y(); }
+ tools::Long GetVisDocRight() const { return aVisDocStartPos.X() + ( !IsVertical() ? aOutArea.GetWidth() : aOutArea.GetHeight() ); }
+ tools::Long GetVisDocBottom() const { return aVisDocStartPos.Y() + ( !IsVertical() ? aOutArea.GetHeight() : aOutArea.GetWidth() ); }
tools::Rectangle GetVisDocArea() const;
const EditSelection& GetEditSelection() const { return aEditSelection; }
@@ -422,7 +422,7 @@ public:
tools::Rectangle GetEditCursor() const;
void ShowCursor( bool bGotoCursor, bool bForceVisCursor );
- Pair Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck = ScrollRangeCheck::NoNegative );
+ Pair Scroll( tools::Long ndX, tools::Long ndY, ScrollRangeCheck nRangeCheck = ScrollRangeCheck::NoNegative );
void SetInsertMode( bool bInsert );
bool IsInsertMode() const { return !( nControl & EVControlBits::OVERWRITE ); }
@@ -616,9 +616,9 @@ private:
EditPaM GetPaM( Point aDocPos, bool bSmart = true );
EditPaM GetPaM( ParaPortion* pPortion, Point aPos, bool bSmart );
- long GetXPos(const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false) const;
- long GetPortionXOffset(const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nTextPortion) const;
- sal_Int32 GetChar(const ParaPortion* pParaPortion, const EditLine* pLine, long nX, bool bSmart = true);
+ tools::Long GetXPos(const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false) const;
+ tools::Long GetPortionXOffset(const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nTextPortion) const;
+ sal_Int32 GetChar(const ParaPortion* pParaPortion, const EditLine* pLine, tools::Long nX, bool bSmart = true);
Range GetInvalidYOffsets( ParaPortion* pPortion );
Range GetLineXPosStartEnd( const ParaPortion* pParaPortion, const EditLine* pLine ) const;
@@ -644,8 +644,8 @@ private:
void RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics, SvxFont& rFont );
void CheckAutoPageSize();
- void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion const * pPortion, sal_Int32 nPortionStart, long nRemainingWidth, bool bCanHyphenate );
- void ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace );
+ void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion const * pPortion, sal_Int32 nPortionStart, tools::Long nRemainingWidth, bool bCanHyphenate );
+ void ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, tools::Long nRemainingSpace );
EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, bool bBackward = false );
EditPaM ImpDeleteSelection(const EditSelection& rCurSel);
EditPaM ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttribs = true );
@@ -700,8 +700,8 @@ private:
bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const;
bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos,
- long* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
- void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth );
+ tools::Long* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
+ void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, tools::Long nRemainingWidth );
void ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_Int32 nIndex );
LanguageType ImplCalcDigitLang(LanguageType eCurLang) const;
@@ -723,7 +723,7 @@ private:
sal_Int32 LogicToTwips( sal_Int32 n );
inline short GetXValue( short nXValue ) const;
- inline long GetXValue( long nXValue ) const;
+ inline tools::Long GetXValue( tools::Long nXValue ) const;
inline short GetYValue( short nYValue ) const;
inline sal_uInt16 GetYValue( sal_uInt16 nYValue ) const;
@@ -737,7 +737,7 @@ private:
void SetBackgroundColor( const Color& rColor ) { maBackgroundColor = rColor; }
const Color& GetBackgroundColor() const { return maBackgroundColor; }
- long CalcVertLineSpacing(Point& rStartPos) const;
+ tools::Long CalcVertLineSpacing(Point& rStartPos) const;
Color GetAutoColor() const;
void EnableAutoColor( bool b ) { bUseAutoColor = b; }
@@ -1234,11 +1234,11 @@ inline short ImpEditEngine::GetXValue( short nXValue ) const
if ( !aStatus.DoStretch() || ( nStretchX == 100 ) )
return nXValue;
- return static_cast<short>(static_cast<long>(nXValue)*nStretchX/100);
+ return static_cast<short>(static_cast<tools::Long>(nXValue)*nStretchX/100);
}
-inline long ImpEditEngine::GetXValue( long nXValue ) const
+inline tools::Long ImpEditEngine::GetXValue( tools::Long nXValue ) const
{
if ( !aStatus.DoStretch() || ( nStretchX == 100 ) )
return nXValue;
@@ -1251,7 +1251,7 @@ inline short ImpEditEngine::GetYValue( short nYValue ) const
if ( !aStatus.DoStretch() || ( nStretchY == 100 ) )
return nYValue;
- return static_cast<short>(static_cast<long>(nYValue)*nStretchY/100);
+ return static_cast<short>(static_cast<tools::Long>(nYValue)*nStretchY/100);
}
inline sal_uInt16 ImpEditEngine::GetYValue( sal_uInt16 nYValue ) const
@@ -1259,7 +1259,7 @@ inline sal_uInt16 ImpEditEngine::GetYValue( sal_uInt16 nYValue ) const
if ( !aStatus.DoStretch() || ( nStretchY == 100 ) )
return nYValue;
- return static_cast<sal_uInt16>(static_cast<long>(nYValue)*nStretchY/100);
+ return static_cast<sal_uInt16>(static_cast<tools::Long>(nYValue)*nStretchY/100);
}
inline PointerStyle ImpEditView::GetPointer()
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 471159845118..a490f3fa39e4 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1115,7 +1115,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView const * pEditView, const
bool bRTLPortion = rTextPortion.IsRightToLeft();
// -1: We are 'behind' the character
- long nVisPos = static_cast<long>(ubidi_getVisualIndex( pBidi, bWasBehind ? nPosInLine-1 : nPosInLine, &nError ));
+ tools::Long nVisPos = static_cast<tools::Long>(ubidi_getVisualIndex( pBidi, bWasBehind ? nPosInLine-1 : nPosInLine, &nError ));
if ( bVisualToLeft )
{
if ( !bWasBehind || bRTLPortion )
@@ -1230,7 +1230,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView const * pView )
sal_Int32 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() );
const EditLine& rLine = pPPortion->GetLines()[nLine];
- long nX;
+ tools::Long nX;
if ( pView->pImpEditView->nTravelXPos == TRAVEL_X_DONTKNOW )
{
nX = GetXPos( pPPortion, &rLine, rPaM.GetIndex() );
@@ -1273,7 +1273,7 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView const * pView )
OSL_ENSURE( pPPortion, "No matching portion found: CursorDown" );
sal_Int32 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() );
- long nX;
+ tools::Long nX;
if ( pView->pImpEditView->nTravelXPos == TRAVEL_X_DONTKNOW )
{
const EditLine& rLine = pPPortion->GetLines()[nLine];
@@ -1410,7 +1410,7 @@ EditPaM ImpEditEngine::PageDown( const EditPaM& rPaM, EditView const * pView )
Point aBottomRight = aRect.BottomRight();
aBottomRight.AdjustY(pView->GetVisArea().GetHeight() *9/10 );
aBottomRight.AdjustX(nOnePixelInRef );
- long nHeight = GetTextHeight();
+ tools::Long nHeight = GetTextHeight();
if ( aBottomRight.Y() > nHeight )
{
aBottomRight.setY( nHeight-2 );
@@ -1674,7 +1674,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
rTypes.back().nEndPos = nPos;
nScriptType = _xBI->getScriptType( aText, nPos );
- long nEndPos = _xBI->endOfScript( aText, nPos, nScriptType );
+ tools::Long nEndPos = _xBI->endOfScript( aText, nPos, nScriptType );
if ( ( nScriptType == i18n::ScriptType::WEAK ) || ( nScriptType == rTypes.back().nScriptType ) )
{
@@ -2096,9 +2096,9 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars )
EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 nNewPos )
{
aOldPositions.Justify();
- bool bValidAction = ( static_cast<long>(nNewPos) < aOldPositions.Min() ) || ( static_cast<long>(nNewPos) > aOldPositions.Max() );
+ bool bValidAction = ( static_cast<tools::Long>(nNewPos) < aOldPositions.Min() ) || ( static_cast<tools::Long>(nNewPos) > aOldPositions.Max() );
OSL_ENSURE( bValidAction, "Move in itself?" );
- OSL_ENSURE( aOldPositions.Max() <= static_cast<long>(GetParaPortions().Count()), "totally over it: MoveParagraphs" );
+ OSL_ENSURE( aOldPositions.Max() <= static_cast<tools::Long>(GetParaPortions().Count()), "totally over it: MoveParagraphs" );
EditSelection aSelection;
@@ -2152,7 +2152,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n
ParaPortion* pDestPortion = GetParaPortions().SafeGetObject( nNewPos );
ParaPortionList aTmpPortionList;
- for (long i = aOldPositions.Min(); i <= aOldPositions.Max(); i++ )
+ for (tools::Long i = aOldPositions.Min(); i <= aOldPositions.Max(); i++ )
{
// always aOldPositions.Min(), since Remove().
std::unique_ptr<ParaPortion> pTmpPortion = GetParaPortions().Release(aOldPositions.Min());
@@ -3032,7 +3032,7 @@ tools::Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, GetCursorFlags nF
OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: PaMtoEditCursor" );
tools::Rectangle aEditCursor;
- long nY = 0;
+ tools::Long nY = 0;
for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
{
ParaPortion* pPortion = GetParaPortions()[nPortion];
@@ -3058,13 +3058,13 @@ EditPaM ImpEditEngine::GetPaM( Point aDocPos, bool bSmart )
{
OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: GetPaM" );
- long nY = 0;
+ tools::Long nY = 0;
EditPaM aPaM;
sal_Int32 nPortion;
for ( nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
{
ParaPortion* pPortion = GetParaPortions()[nPortion];
- const long nTmpHeight = pPortion->GetHeight(); // should also be correct for !bVisible!
+ const tools::Long nTmpHeight = pPortion->GetHeight(); // should also be correct for !bVisible!
nY += nTmpHeight;
if ( nY > aDocPos.Y() )
{
@@ -3128,7 +3128,7 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 nPara, bool bIgnoreExtraSpace
if ( !IsFormatted() && !IsFormatting() )
FormatDoc();
- long nMaxWidth = 0;
+ tools::Long nMaxWidth = 0;
// Over all the paragraphs ...
@@ -3151,10 +3151,10 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 nPara, bool bIgnoreExtraSpace
// width, here not preferred. I general, it is best not leave it
// to StartPosX, also the right indents have to be taken into
// account!
- long nCurWidth = GetXValue( rLRItem.GetTextLeft() + nSpaceBeforeAndMinLabelWidth );
+ tools::Long nCurWidth = GetXValue( rLRItem.GetTextLeft() + nSpaceBeforeAndMinLabelWidth );
if ( nLine == 0 )
{
- long nFI = GetXValue( rLRItem.GetTextFirstLineOffset() );
+ tools::Long nFI = GetXValue( rLRItem.GetTextFirstLineOffset() );
nCurWidth -= nFI;
if ( pPortion->GetBulletX() > nCurWidth )
{
@@ -3696,7 +3696,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, bool bSmart
sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix )
? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
- long nY = pPortion->GetFirstLineOffset();
+ tools::Long nY = pPortion->GetFirstLineOffset();
OSL_ENSURE( pPortion->GetLines().Count(), "Empty ParaPortion in GetPaM!" );
@@ -3740,7 +3740,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, bool bSmart
}
sal_Int32 ImpEditEngine::GetChar(
- const ParaPortion* pParaPortion, const EditLine* pLine, long nXPos, bool bSmart)
+ const ParaPortion* pParaPortion, const EditLine* pLine, tools::Long nXPos, bool bSmart)
{
OSL_ENSURE( pLine, "No line received: GetChar" );
@@ -3752,8 +3752,8 @@ sal_Int32 ImpEditEngine::GetChar(
for ( sal_Int32 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
{
const TextPortion& rPortion = pParaPortion->GetTextPortions()[i];
- long nXLeft = GetPortionXOffset( pParaPortion, pLine, i );
- long nXRight = nXLeft + rPortion.GetSize().Width();
+ tools::Long nXLeft = GetPortionXOffset( pParaPortion, pLine, i );
+ tools::Long nXRight = nXLeft + rPortion.GetSize().Width();
if ( ( nXLeft <= nXPos ) && ( nXRight >= nXPos ) )
{
nChar = nCurIndex;
@@ -3766,8 +3766,8 @@ sal_Int32 ImpEditEngine::GetChar(
// ...but check on which side
if ( bSmart )
{
- long nLeftDiff = nXPos-nXLeft;
- long nRightDiff = nXRight-nXPos;
+ tools::Long nLeftDiff = nXPos-nXLeft;
+ tools::Long nRightDiff = nXRight-nXPos;
if ( nRightDiff < nLeftDiff )
nChar++;
}
@@ -3778,20 +3778,20 @@ sal_Int32 ImpEditEngine::GetChar(
sal_Int32 nOffset = -1;
sal_Int32 nTmpCurIndex = nChar - pLine->GetStart();
- long nXInPortion = nXPos - nXLeft;
+ tools::Long nXInPortion = nXPos - nXLeft;
if ( rPortion.IsRightToLeft() )
nXInPortion = nXRight - nXPos;
// Search in Array...
for ( sal_Int32 x = 0; x < nMax; x++ )
{
- long nTmpPosMax = pLine->GetCharPosArray()[nTmpCurIndex+x];
+ tools::Long nTmpPosMax = pLine->GetCharPosArray()[nTmpCurIndex+x];
if ( nTmpPosMax > nXInPortion )
{
// Check whether this or the previous...
- long nTmpPosMin = x ? pLine->GetCharPosArray()[nTmpCurIndex+x-1] : 0;
- long nDiffLeft = nXInPortion - nTmpPosMin;
- long nDiffRight = nTmpPosMax - nXInPortion;
+ tools::Long nTmpPosMin = x ? pLine->GetCharPosArray()[nTmpCurIndex+x-1] : 0;
+ tools::Long nDiffLeft = nXInPortion - nTmpPosMin;
+ tools::Long nDiffRight = nTmpPosMax - nXInPortion;
OSL_ENSURE( nDiffLeft >= 0, "DiffLeft negative" );
OSL_ENSURE( nDiffRight >= 0, "DiffRight negative" );
nOffset = ( bSmart && ( nDiffRight < nDiffLeft ) ) ? x+1 : x;
@@ -3800,7 +3800,7 @@ sal_Int32 ImpEditEngine::GetChar(
// Skip all 0-positions, cheaper than using XBreakIterator:
if ( nOffset < nMax )
{
- const long nX = pLine->GetCharPosArray()[nOffset];
+ const tools::Long nX = pLine->GetCharPosArray()[nOffset];
while ( ( (nOffset+1) < nMax ) && ( pLine->GetCharPosArray()[nOffset+1] == nX ) )
nOffset++;
}
@@ -3879,10 +3879,10 @@ Range ImpEditEngine::GetLineXPosStartEnd( const ParaPortion* pParaPortion, const
return aLineXPosStartEnd;
}
-long ImpEditEngine::GetPortionXOffset(
+tools::Long ImpEditEngine::GetPortionXOffset(
const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nTextPortion) const
{
- long nX = pLine->GetStartPosX();
+ tools::Long nX = pLine->GetStartPosX();
for ( sal_Int32 i = pLine->GetStartPortion(); i < nTextPortion; i++ )
{
@@ -3970,7 +3970,7 @@ long ImpEditEngine::GetPortionXOffset(
return nX;
}
-long ImpEditEngine::GetXPos(
+tools::Long ImpEditEngine::GetXPos(
const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart) const
{
OSL_ENSURE( pLine, "No line received: GetXPos" );
@@ -3990,11 +3990,11 @@ long ImpEditEngine::GetXPos(
const TextPortion& rPortion = pParaPortion->GetTextPortions()[nTextPortion];
- long nX = GetPortionXOffset( pParaPortion, pLine, nTextPortion );
+ tools::Long nX = GetPortionXOffset( pParaPortion, pLine, nTextPortion );
// calc text width, portion size may include CJK/CTL spacing...
// But the array might not be init yet, if using text ranger this method is called within CreateLines()...
- long nPortionTextWidth = rPortion.GetSize().Width();
+ tools::Long nPortionTextWidth = rPortion.GetSize().Width();
if ( ( rPortion.GetKind() == PortionKind::TEXT ) && rPortion.GetLen() && !GetTextRanger() )
nPortionTextWidth = pLine->GetCharPosArray()[nTextPortionStart + rPortion.GetLen() - 1 - pLine->GetStart()];
@@ -4042,7 +4042,7 @@ long ImpEditEngine::GetXPos(
}
// old code restored see #i112788 (which leaves #i74188 unfixed again)
- long nPosInPortion = pLine->GetCharPosArray()[nPos];
+ tools::Long nPosInPortion = pLine->GetCharPosArray()[nPos];
if ( !rPortion.IsRightToLeft() )
{
@@ -4062,7 +4062,7 @@ long ImpEditEngine::GetXPos(
if ( nType == AsianCompressionFlags::PunctuationRight && !pLine->GetCharPosArray().empty() )
{
sal_Int32 n = nIndex - nTextPortionStart;
- const long* pDXArray = pLine->GetCharPosArray().data()+( nTextPortionStart-pLine->GetStart() );
+ const tools::Long* 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() )
@@ -4214,7 +4214,7 @@ tools::Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32
- Selection...
*/
- long nY = pPortion->GetFirstLineOffset();
+ tools::Long nY = pPortion->GetFirstLineOffset();
const SvxLineSpacingItem& rLSItem = pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Fix )
@@ -4259,7 +4259,7 @@ tools::Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32
aEditCursor.SetBottom( nY-1 );
// Search within the line...
- long nX;
+ tools::Long nX;
if ( ( nIndex == pLine->GetStart() ) && ( nFlags & GetCursorFlags::StartOfLine ) )
{
@@ -4291,10 +4291,10 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz )
{
aPaperSize = rNewSz;
- long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0;
- long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF;
- long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0;
- long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF;
+ tools::Long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0;
+ tools::Long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF;
+ tools::Long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0;
+ tools::Long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF;
// Minimum/Maximum width:
if ( aPaperSize.Width() < nMinWidth )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 0d88eeba800d..23d00bb7dc1b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -91,8 +91,8 @@ struct TabInfo
SvxTabStop aTabStop;
sal_Int32 nTabPortion;
- long nStartPosX;
- long nTabPos;
+ tools::Long nStartPosX;
+ tools::Long nTabPos;
TabInfo()
: bValid(false)
@@ -118,8 +118,8 @@ Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin )
aTranslatedPos -= rOrigin;
// Rotation...
- aRotatedPos.setX( static_cast<long>( nCos*aTranslatedPos.X() + nSin*aTranslatedPos.Y() ) );
- aRotatedPos.setY( static_cast<long>(- ( nSin*aTranslatedPos.X() - nCos*aTranslatedPos.Y() )) );
+ aRotatedPos.setX( static_cast<tools::Long>( nCos*aTranslatedPos.X() + nSin*aTranslatedPos.Y() ) );
+ aRotatedPos.setY( static_cast<tools::Long>(- ( nSin*aTranslatedPos.X() - nCos*aTranslatedPos.Y() )) );
aTranslatedPos = aRotatedPos;
// Translation...
@@ -152,11 +152,11 @@ AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar )
}
static void lcl_DrawRedLines( OutputDevice* pOutDev,
- long nFontHeight,
+ tools::Long nFontHeight,
const Point& rPoint,
size_t nIndex,
size_t nMaxEnd,
- const long* pDXArray,
+ const tools::Long* pDXArray,
WrongList const * pWrongs,
short nOrientation,
const Point& rOrigin,
@@ -164,7 +164,7 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
bool bIsRightToLeft )
{
// But only if font is not too small...
- long nHeight = pOutDev->LogicToPixel(Size(0, nFontHeight)).Height();
+ tools::Long nHeight = pOutDev->LogicToPixel(Size(0, nFontHeight)).Height();
if (WRONG_SHOW_MIN >= nHeight)
return;
@@ -187,8 +187,8 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
{
// VCL doesn't know that the text is vertical, and is manipulating
// the positions a little bit in y direction...
- long nOnePixel = pOutDev->PixelToLogic(Size(0, 1)).Height();
- long nCorrect = 2 * nOnePixel;
+ tools::Long nOnePixel = pOutDev->PixelToLogic(Size(0, 1)).Height();
+ tools::Long nCorrect = 2 * nOnePixel;
aPoint1.AdjustY(-nCorrect);
aPoint1.AdjustX(-nCorrect);
}
@@ -244,8 +244,8 @@ static Point lcl_ImplCalcRotatedPos( Point rPos, Point rOrigin, double nSin, dou
Point aTranslatedPos( rPos);
aTranslatedPos -= rOrigin;
- aRotatedPos.setX( static_cast<long>( nCos*aTranslatedPos.X() + nSin*aTranslatedPos.Y() ) );
- aRotatedPos.setY( static_cast<long>(- ( nSin*aTranslatedPos.X() - nCos*aTranslatedPos.Y() )) );
+ aRotatedPos.setX( static_cast<tools::Long>( nCos*aTranslatedPos.X() + nSin*aTranslatedPos.Y() ) );
+ aRotatedPos.setY( static_cast<tools::Long>(- ( nSin*aTranslatedPos.X() - nCos*aTranslatedPos.Y() )) );
aTranslatedPos = aRotatedPos;
// Translation...
aTranslatedPos += rOrigin;
@@ -371,7 +371,7 @@ void ImpEditEngine::FormatDoc()
if ( GetStatus().DoOnlineSpelling() )
StartOnlineSpellTimer();
- long nY = 0;
+ tools::Long nY = 0;
bool bGrow = false;
// Here already, so that not always in CreateLines...
@@ -416,7 +416,7 @@ void ImpEditEngine::FormatDoc()
if ( aInvalidRect.IsEmpty() )
{
// For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()...
- long nWidth = std::max( long(1), ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
+ tools::Long nWidth = std::max( tools::Long(1), ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
Range aInvRange( GetInvalidYOffsets( pParaPortion ) );
aInvalidRect = tools::Rectangle( Point( 0, nY+aInvRange.Min() ),
Size( nWidth, aInvRange.Len() ) );
@@ -438,12 +438,12 @@ void ImpEditEngine::FormatDoc()
{
sal_uInt32 nNewHeightNTP;
sal_uInt32 nNewHeight = CalcTextHeight( &nNewHeightNTP );
- long nDiff = nNewHeight - nCurTextHeight;
+ tools::Long nDiff = nNewHeight - nCurTextHeight;
if ( nDiff )
aStatus.GetStatusWord() |= !IsVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED;
if ( nNewHeight < nCurTextHeight )
{
- aInvalidRect.SetBottom( static_cast<long>(std::max( nNewHeight, nCurTextHeight )) );
+ aInvalidRect.SetBottom( static_cast<tools::Long>(std::max( nNewHeight, nCurTextHeight )) );
if ( aInvalidRect.IsEmpty() )
{
aInvalidRect.SetTop( 0 );
@@ -775,10 +775,10 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
sal_Int32 nPortionStart = 0;
sal_Int32 nPortionEnd = 0;
- long nStartX = GetXValue( rLRItem.GetTextLeft() + nSpaceBeforeAndMinLabelWidth );
+ tools::Long nStartX = GetXValue( rLRItem.GetTextLeft() + nSpaceBeforeAndMinLabelWidth );
if ( nIndex == 0 )
{
- long nFI = GetXValue( rLRItem.GetTextFirstLineOffset() );
+ tools::Long nFI = GetXValue( rLRItem.GetTextFirstLineOffset() );
nStartX += nFI;
if ( !nLine && ( pParaPortion->GetBulletX() > nStartX ) )
@@ -787,7 +787,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
}
}
- long nMaxLineWidth;
+ tools::Long nMaxLineWidth;
if ( !IsVertical() )
nMaxLineWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : aPaperSize.Width();
else
@@ -815,18 +815,18 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
sal_Int32 nTmpPos = nIndex;
sal_Int32 nTmpPortion = pLine->GetStartPortion();
- long nTmpWidth = 0;
- long nXWidth = nMaxLineWidth;
+ tools::Long nTmpWidth = 0;
+ tools::Long nXWidth = nMaxLineWidth;
std::deque<long>* pTextRanges = nullptr;
- long nTextExtraYOffset = 0;
- long nTextXOffset = 0;
- long nTextLineHeight = 0;
+ tools::Long nTextExtraYOffset = 0;
+ tools::Long nTextXOffset = 0;
+ tools::Long nTextLineHeight = 0;
if ( GetTextRanger() )
{
GetTextRanger()->SetVertical( IsVertical() );
- long nTextY = nStartPosY + GetEditCursor( pParaPortion, pLine->GetStart() ).Top();
+ tools::Long nTextY = nStartPosY + GetEditCursor( pParaPortion, pLine->GetStart() ).Top();
if ( !bSameLineAgain )
{
SeekCursor( pNode, nTmpPos+1, aTmpFont );
@@ -850,27 +850,27 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
nXWidth = 0;
while ( !nXWidth )
{
- long nYOff = nTextY + nTextExtraYOffset;
- long nYDiff = nTextLineHeight;
+ tools::Long nYOff = nTextY + nTextExtraYOffset;
+ tools::Long nYDiff = nTextLineHeight;
if ( IsVertical() )
{
- long nMaxPolygonX = GetTextRanger()->GetBoundRect().Right();
+ tools::Long nMaxPolygonX = GetTextRanger()->GetBoundRect().Right();
nYOff = nMaxPolygonX-nYOff;
nYDiff = -nTextLineHeight;
}
pTextRanges = GetTextRanger()->GetTextRanges( Range( nYOff, nYOff + nYDiff ) );
DBG_ASSERT( pTextRanges, "GetTextRanges?!" );
- long nMaxRangeWidth = 0;
+ tools::Long nMaxRangeWidth = 0;
// Use the widest range...
// The widest range could be a bit confusing, so normally it
// is the first one. Best with gaps.
assert(pTextRanges->size() % 2 == 0 && "textranges are always in pairs");
if (!pTextRanges->empty())
{
- long nA = pTextRanges->at(0);
- long nB = pTextRanges->at(1);
+ tools::Long nA = pTextRanges->at(0);
+ tools::Long nB = pTextRanges->at(1);
DBG_ASSERT( nA <= nB, "TextRange distorted?" );
- long nW = nB - nA;
+ tools::Long nW = nB - nA;
if ( nW > nMaxRangeWidth )
{
nMaxRangeWidth = nW;
@@ -884,7 +884,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
// Try further down in the polygon.
// Below the polygon use the Paper Width.
- nTextExtraYOffset += std::max( static_cast<long>(nTextLineHeight / 10), long(1) );
+ nTextExtraYOffset += std::max( static_cast<tools::Long>(nTextLineHeight / 10), tools::Long(1) );
if ( ( nTextY + nTextExtraYOffset ) > GetTextRanger()->GetBoundRect().Bottom() )
{
nXWidth = !IsVertical() ? GetPaperSize().Width() : GetPaperSize().Height();
@@ -966,17 +966,17 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
case EE_FEATURE_TAB:
{
- long nOldTmpWidth = nTmpWidth;
+ tools::Long nOldTmpWidth = nTmpWidth;
// Search for Tab-Pos...
- long nCurPos = nTmpWidth+nStartX;
+ tools::Long nCurPos = nTmpWidth+nStartX;
// consider scaling
if ( aStatus.DoStretch() && ( nStretchX != 100 ) )
nCurPos = nCurPos*100/std::max(static_cast<sal_Int32>(nStretchX), static_cast<sal_Int32>(1));
short nAllSpaceBeforeText = static_cast< short >(rLRItem.GetTextLeft()/* + rLRItem.GetTextLeft()*/ + nSpaceBeforeAndMinLabelWidth);
aCurrentTab.aTabStop = pNode->GetContentAttribs().FindTabStop( nCurPos - nAllSpaceBeforeText /*rLRItem.GetTextLeft()*/, aEditDoc.GetDefTab() );
- aCurrentTab.nTabPos = GetXValue( static_cast<long>( aCurrentTab.aTabStop.GetTabPos() + nAllSpaceBeforeText /*rLRItem.GetTextLeft()*/ ) );
+ aCurrentTab.nTabPos = GetXValue( static_cast<tools::Long>( aCurrentTab.aTabStop.GetTabPos() + nAllSpaceBeforeText /*rLRItem.GetTextLeft()*/ ) );
aCurrentTab.bValid = false;
// Switch direction in R2L para...
@@ -1180,7 +1180,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// And now check for Compression:
if ( !bContinueLastPortion && nPortionLen && GetAsianCompressionMode() != CharCompressType::NONE )
{
- long* pDXArray = rArray.data() + nTmpPos - pLine->GetStart();
+ tools::Long* pDXArray = rArray.data() + nTmpPos - pLine->GetStart();
bCompressedChars |= ImplCalcAsianCompression(
pNode, pPortion, nTmpPos, pDXArray, 10000, false);
}
@@ -1199,7 +1199,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// No spacing within L2R/R2L nesting
if ( bAllow )
{
- long nExtraSpace = pPortion->GetSize().Height()/5;
+ tools::Long nExtraSpace = pPortion->GetSize().Height()/5;
nExtraSpace = GetXValue( nExtraSpace );
pPortion->GetSize().AdjustWidth(nExtraSpace );
nTmpWidth += nExtraSpace;
@@ -1209,13 +1209,13 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
if ( aCurrentTab.bValid && ( nTmpPortion != aCurrentTab.nTabPortion ) )
{
- long nWidthAfterTab = 0;
+ tools::Long nWidthAfterTab = 0;
for ( sal_Int32 n = aCurrentTab.nTabPortion+1; n <= nTmpPortion; n++ )
{
const TextPortion& rTP = pParaPortion->GetTextPortions()[n];
nWidthAfterTab += rTP.GetSize().Width();
}
- long nW = nWidthAfterTab; // Length before tab position
+ tools::Long nW = nWidthAfterTab; // Length before tab position
if ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Right )
{
}
@@ -1239,7 +1239,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
OSL_FAIL( "CreateLines: Tab not handled!" );
}
- long nMaxW = aCurrentTab.nTabPos - aCurrentTab.nStartPosX - nStartX;
+ tools::Long nMaxW = aCurrentTab.nTabPos - aCurrentTab.nStartPosX - nStartX;
if ( nW >= nMaxW )
{
nW = nMaxW;
@@ -1348,12 +1348,12 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
else if ( !bEOL && !bContinueLastPortion )
{
DBG_ASSERT( pPortion && ((nPortionEnd-nPortionStart) == pPortion->GetLen()), "However, another portion?!" );
- long nRemainingWidth = nMaxLineWidth - nTmpWidth;
+ tools::Long nRemainingWidth = nMaxLineWidth - nTmpWidth;
bool bCanHyphenate = ( aTmpFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL );
if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed )
{
// I need the manipulated DXArray for determining the break position...
- long* pDXArray = pLine->GetCharPosArray().data() + (nPortionStart - pLine->GetStart());
+ tools::Long* pDXArray = pLine->GetCharPosArray().data() + (nPortionStart - pLine->GetStart());
ImplCalcAsianCompression(
pNode, pPortion, nPortionStart, pDXArray, 10000, true);
}
@@ -1422,7 +1422,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
if ( nTxtHeight < nMinHeight )
{
// The Ascent has to be adjusted for the difference:
- long nDiff = nMinHeight - nTxtHeight;
+ tools::Long nDiff = nMinHeight - nTxtHeight;
pLine->SetMaxAscent( static_cast<sal_uInt16>(pLine->GetMaxAscent() + nDiff) );
pLine->SetHeight( nMinHeight, nTxtHeight );
}
@@ -1456,7 +1456,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
sal_uInt16 nTxtHeight = pLine->GetHeight();
sal_Int32 nPropTextHeight = nTxtHeight * rLSItem.GetPropLineSpace() / 100;
// The Ascent has to be adjusted for the difference:
- long nDiff = pLine->GetHeight() - nPropTextHeight;
+ tools::Long nDiff = pLine->GetHeight() - nPropTextHeight;
pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) );
pLine->SetHeight( static_cast<sal_uInt16>( nPropTextHeight ), nTxtHeight );
}
@@ -1470,7 +1470,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
// has to be used for the Alignment. If it does not fit or if it
// will change the paper width, it will be formatted again for
// Justification! = LEFT anyway.
- long nMaxLineWidthFix = ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() )
+ tools::Long nMaxLineWidthFix = ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() )
- GetXValue( rLRItem.GetRight() ) - nStartX;
if ( aTextSize.Width() < nMaxLineWidthFix )
nMaxLineWidth = nMaxLineWidthFix;
@@ -1478,7 +1478,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
if ( bCompressedChars )
{
- long nRemainingWidth = nMaxLineWidth - aTextSize.Width();
+ tools::Long nRemainingWidth = nMaxLineWidth - aTextSize.Width();
if ( nRemainingWidth > 0 )
{
ImplExpandCompressedPortions( pLine, pParaPortion, nRemainingWidth );
@@ -1490,10 +1490,10 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
// Width from HangingPunctuation was set to 0 in ImpBreakLine,
// check for rel width now, maybe create compression...
- long n = nMaxLineWidth - aTextSize.Width();
+ tools::Long n = nMaxLineWidth - aTextSize.Width();
TextPortion& rTP = pParaPortion->GetTextPortions()[pLine->GetEndPortion()];
sal_Int32 nPosInArray = pLine->GetEnd()-1-pLine->GetStart();
- long nNewValue = ( nPosInArray ? pLine->GetCharPosArray()[ nPosInArray-1 ] : 0 ) + n;
+ tools::Long nNewValue = ( nPosInArray ? pLine->GetCharPosArray()[ nPosInArray-1 ] : 0 ) + n;
pLine->GetCharPosArray()[ nPosInArray ] = nNewValue;
rTP.GetSize().AdjustWidth(n );
}
@@ -1503,7 +1503,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
case SvxAdjust::Center:
{
- long n = ( nMaxLineWidth - aTextSize.Width() ) / 2;
+ tools::Long n = ( nMaxLineWidth - aTextSize.Width() ) / 2;
n += nStartX; // Indentation is kept.
pLine->SetStartPosX( n );
}
@@ -1512,7 +1512,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
// For automatically wrapped lines, which has a blank at the end
// the blank must not be displayed!
- long n = nMaxLineWidth - aTextSize.Width();
+ tools::Long n = nMaxLineWidth - aTextSize.Width();
n += nStartX; // Indentation is kept.
pLine->SetStartPosX( n );
}
@@ -1520,7 +1520,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
case SvxAdjust::Block:
{
bool bDistLastLine = (GetJustifyMethod(nPara) == SvxCellJustifyMethod::Distribute);
- long nRemainingSpace = nMaxLineWidth - aTextSize.Width();
+ tools::Long nRemainingSpace = nMaxLineWidth - aTextSize.Width();
pLine->SetStartPosX( nStartX );
if ( nRemainingSpace > 0 && (!bEOC || bDistLastLine) )
ImpAdjustBlocks( pParaPortion, pLine, nRemainingSpace );
@@ -1684,7 +1684,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pParaPortion->GetNode(), &nSpaceBefore );
const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pParaPortion->GetNode() );
const SvxLineSpacingItem& rLSItem = pParaPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
- long nStartX = GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOffset() + nSpaceBefore );
+ tools::Long nStartX = GetXValue( rLRItem.GetTextLeft() + rLRItem.GetTextFirstLineOffset() + nSpaceBefore );
tools::Rectangle aBulletArea { Point(), Point() };
if ( bLineBreak )
@@ -1727,7 +1727,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
{
sal_Int32 nPara = GetParaPortions().GetPos( pParaPortion );
SvxAdjust eJustification = GetJustification( nPara );
- long nMaxLineWidth = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
+ tools::Long nMaxLineWidth = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
nMaxLineWidth -= GetXValue( rLRItem.GetRight() );
if ( nMaxLineWidth < 0 )
nMaxLineWidth = 1;
@@ -1748,7 +1748,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
if ( nTxtHeight < nMinHeight )
{
// The Ascent has to be adjusted for the difference:
- long nDiff = nMinHeight - nTxtHeight;
+ tools::Long nDiff = nMinHeight - nTxtHeight;
pTmpLine->SetMaxAscent( static_cast<sal_uInt16>(pTmpLine->GetMaxAscent() + nDiff) );
pTmpLine->SetHeight( nMinHeight, nTxtHeight );
}
@@ -1775,7 +1775,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
nH *= rLSItem.GetPropLineSpace();
nH /= 100;
// The Ascent has to be adjusted for the difference:
- long nDiff = pTmpLine->GetHeight() - nH;
+ tools::Long nDiff = pTmpLine->GetHeight() - nH;
if ( nDiff > pTmpLine->GetMaxAscent() )
nDiff = pTmpLine->GetMaxAscent();
pTmpLine->SetMaxAscent( static_cast<sal_uInt16>(pTmpLine->GetMaxAscent() - nDiff) );
@@ -1787,10 +1787,10 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
if ( !bLineBreak )
{
- long nMinHeight = aBulletArea.GetHeight();
- if ( nMinHeight > static_cast<long>(pTmpLine->GetHeight()) )
+ tools::Long nMinHeight = aBulletArea.GetHeight();
+ if ( nMinHeight > static_cast<tools::Long>(pTmpLine->GetHeight()) )
{
- long nDiff = nMinHeight - static_cast<long>(pTmpLine->GetHeight());
+ tools::Long nDiff = nMinHeight - static_cast<tools::Long>(pTmpLine->GetHeight());
// distribute nDiff upwards and downwards
pTmpLine->SetMaxAscent( static_cast<sal_uInt16>(pTmpLine->GetMaxAscent() + nDiff/2) );
pTmpLine->SetHeight( static_cast<sal_uInt16>(nMinHeight) );
@@ -1813,7 +1813,7 @@ bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion )
{
// CalcCharPositions( pParaPortion );
pParaPortion->SetValid();
- long nOldHeight = pParaPortion->GetHeight();
+ tools::Long nOldHeight = pParaPortion->GetHeight();
CalcHeight( pParaPortion );
DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "FinishCreateLines: No Text-Portion?" );
@@ -1821,7 +1821,7 @@ bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion )
return bRet;
}
-void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion const * pPortion, sal_Int32 nPortionStart, long nRemainingWidth, bool bCanHyphenate )
+void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion const * pPortion, sal_Int32 nPortionStart, tools::Long nRemainingWidth, bool bCanHyphenate )
{
ContentNode* const pNode = pParaPortion->GetNode();
@@ -2081,7 +2081,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te
pLine->SetEndPortion( nEndPortion );
}
-void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace )
+void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, tools::Long nRemainingSpace )
{
DBG_ASSERT( nRemainingSpace > 0, "AdjustBlocks: Somewhat too little..." );
DBG_ASSERT( pLine, "AdjustBlocks: Line ?!" );
@@ -2145,8 +2145,8 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine,
sal_Int32 nPortionStart, nPortion;
nPortion = pParaPortion->GetTextPortions().FindPortion( nLastChar+1, nPortionStart );
TextPortion& rLastPortion = pParaPortion->GetTextPortions()[ nPortion ];
- long nRealWidth = pLine->GetCharPosArray()[nLastChar-nFirstChar];
- long nBlankWidth = nRealWidth;
+ tools::Long nRealWidth = pLine->GetCharPosArray()[nLastChar-nFirstChar];
+ tools::Long nBlankWidth = nRealWidth;
if ( nLastChar > nPortionStart )
nBlankWidth -= pLine->GetCharPosArray()[nLastChar-nFirstChar-1];
// Possibly the blank has already been deducted in ImpBreakLine:
@@ -2162,10 +2162,10 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine,
}
size_t nGaps = aPositions.size();
- const long nMore4Everyone = nRemainingSpace / nGaps;
- long nSomeExtraSpace = nRemainingSpace - nMore4Everyone*nGaps;
+ const tools::Long nMore4Everyone = nRemainingSpace / nGaps;
+ tools::Long nSomeExtraSpace = nRemainingSpace - nMore4Everyone*nGaps;
- DBG_ASSERT( nSomeExtraSpace < static_cast<long>(nGaps), "AdjustBlocks: ExtraSpace too large" );
+ DBG_ASSERT( nSomeExtraSpace < static_cast<tools::Long>(nGaps), "AdjustBlocks: ExtraSpace too large" );
DBG_ASSERT( nSomeExtraSpace >= 0, "AdjustBlocks: ExtraSpace < 0 " );
// Correct the positions in the Array and the portion widths:
@@ -2797,7 +2797,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
aRealSz.setWidth( aRealSz.Width() / 100 );
// Also the Kerning: (long due to handle Interim results)
- long nKerning = rFont.GetFixKerning();
+ tools::Long nKerning = rFont.GetFixKerning();
/*
The consideration was: If negative kerning, but StretchX = 200
=> Do not double the kerning, thus pull the letters closer together
@@ -2940,13 +2940,13 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics
short nDiff = static_cast<short>(rFont.GetFontSize().Height()*rFont.GetEscapement()/100);
if ( rFont.GetEscapement() > 0 )
{
- nAscent = static_cast<sal_uInt16>(static_cast<long>(nAscent)*nPropr/100 + nDiff);
+ nAscent = static_cast<sal_uInt16>(static_cast<tools::Long>(nAscent)*nPropr/100 + nDiff);
if ( nAscent > rCurMetrics.nMaxAscent )
rCurMetrics.nMaxAscent = nAscent;
}
else // has to be < 0
{
- nDescent = static_cast<sal_uInt16>(static_cast<long>(nDescent)*nPropr/100 - nDiff);
+ nDescent = static_cast<sal_uInt16>(static_cast<tools::Long>(nDescent)*nPropr/100 - nDiff);
if ( nDescent > rCurMetrics.nMaxDescent )
rCurMetrics.nMaxDescent= nDescent;
}
@@ -2960,8 +2960,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( !IsFormatted() )
FormatDoc();
- long nFirstVisXPos = - pOutDev->GetMapMode().GetOrigin().X();
- long nFirstVisYPos = - pOutDev->GetMapMode().GetOrigin().Y();
+ tools::Long nFirstVisXPos = - pOutDev->GetMapMode().GetOrigin().X();
+ tools::Long nFirstVisYPos = - pOutDev->GetMapMode().GetOrigin().Y();
const EditLine* pLine = nullptr;
Point aTmpPos;
@@ -2988,7 +2988,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
GDIMetaFile* pMtf = pOutDev->GetConnectMetaFile();
const bool bMetafileValid( pMtf != nullptr );
- long nVertLineSpacing = CalcVertLineSpacing(aStartPos);
+ tools::Long nVertLineSpacing = CalcVertLineSpacing(aStartPos);
// Over all the paragraphs...
@@ -3005,7 +3005,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( pPDFExtOutDevData )
pPDFExtOutDevData->BeginStructureElement( vcl::PDFWriter::Paragraph );
- long nParaHeight = pPortion->GetHeight();
+ tools::Long nParaHeight = pPortion->GetHeight();
sal_Int32 nIndex = 0;
if ( pPortion->IsVisible() && (
( !IsVertical() && ( ( aStartPos.Y() + nParaHeight ) > aClipRect.Top() ) ) ||
@@ -3102,7 +3102,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
DBG_ASSERT( pPortion->GetTextPortions().Count(), "Line without Textportion in Paint!" );
const TextPortion& rTextPortion = pPortion->GetTextPortions()[nPortion];
- long nPortionXOffset = GetPortionXOffset( pPortion, pLine, nPortion );
+ tools::Long nPortionXOffset = GetPortionXOffset( pPortion, pLine, nPortion );
if ( !IsVertical() )
{
aTmpPos.setX( aStartPos.X() + nPortionXOffset );
@@ -3174,7 +3174,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
OUString aText;
sal_Int32 nTextStart = 0;
sal_Int32 nTextLen = 0;
- const long* pDXArray = nullptr;
+ const tools::Long* pDXArray = nullptr;
std::unique_ptr<long[]> pTmpDXArray;
if ( rTextPortion.GetKind() == PortionKind::TEXT )
@@ -3203,12 +3203,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( 0x200B == cChar || 0x2060 == cChar )
{
- long nHalfBlankWidth = aTmpFont.QuickGetTextSize( pOutDev, " ", 0, 1 ).Width() / 2;
+ tools::Long nHalfBlankWidth = aTmpFont.QuickGetTextSize( pOutDev, " ", 0, 1 ).Width() / 2;
- const long nAdvanceX = ( nTmpIdx == nTmpEnd ?
+ const tools::Long nAdvanceX = ( nTmpIdx == nTmpEnd ?
rTextPortion.GetSize().Width() :
pDXArray[ nTmpIdx - nTextStart ] ) - nHalfBlankWidth;
- const long nAdvanceY = -pLine->GetMaxAscent();
+ const tools::Long nAdvanceY = -pLine->GetMaxAscent();
Point aTopLeftRectPos( aTmpPos );
if ( !IsVertical() )
@@ -3273,7 +3273,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
const Size aSlashSize = aTmpFont.QuickGetTextSize( pOutDev, aSlash, 0, 1 );
Point aSlashPos( aTmpPos );
- const long nAddX = nHalfBlankWidth - aSlashSize.Width() / 2;
+ const tools::Long nAddX = nHalfBlankWidth - aSlashSize.Width() / 2;
if ( !IsVertical() )
{
aSlashPos.setX( aTopLeftRectPos.X() + nAddX );
@@ -3395,7 +3395,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
aTmpFont.QuickGetTextSize( GetRefDevice(), aText, 0, aText.getLength(), pTmpDXArray.get() );
}
- long nTxtWidth = rTextPortion.GetSize().Width();
+ tools::Long nTxtWidth = rTextPortion.GetSize().Width();
Point aOutPos( aTmpPos );
aRedLineTmpPos = aTmpPos;
@@ -3511,7 +3511,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
// In case of high/low do it yourself:
if ( aTmpFont.GetEscapement() )
{
- long nDiff = aTmpFont.GetFontSize().Height() * aTmpFont.GetEscapement() / 100L;
+ tools::Long nDiff = aTmpFont.GetFontSize().Height() * aTmpFont.GetEscapement() / 100L;
if ( !IsVertical() )
aOutPos.AdjustY( -nDiff );
else
@@ -3646,7 +3646,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
short _nEsc = aTmpFont.GetEscapement();
if( _nEsc )
{
- long nShift = (_nEsc * aTmpFont.GetFontSize().Height()) / 100L;
+ tools::Long nShift = (_nEsc * aTmpFont.GetFontSize().Height()) / 100L;
if( !IsVertical() )
aRedLineTmpPos.AdjustY( -nShift );
else
@@ -3698,7 +3698,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
aTmpFont.SetTransparent( false );
aTmpFont.SetEscapement( 0 );
aTmpFont.SetPhysFont( pOutDev );
- long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev,
+ tools::Long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev,
OUString(rTextPortion.GetExtraValue()), 0, 1 ).Width();
sal_Int32 nChars = 2;
if( nCharWidth )
@@ -3790,7 +3790,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( !aStatus.IsOutliner() )
{
const SvxULSpaceItem& rULItem = pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE );
- long nUL = GetYValue( rULItem.GetLower() );
+ tools::Long nUL = GetYValue( rULItem.GetLower() );
if ( !IsVertical() )
aStartPos.AdjustY(nUL );
else
@@ -3891,7 +3891,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const tools::Rectangle& rRect, Ou
// there)
if ( !IsVertical() && ( pView->GetOutputArea().GetWidth() > GetPaperSize().Width() ) )
{
- long nMaxX = pView->GetOutputArea().Left() + GetPaperSize().Width();
+ tools::Long nMaxX = pView->GetOutputArea().Left() + GetPaperSize().Width();
if ( aClipRect.Left() > nMaxX )
return;
if ( aClipRect.Right() > nMaxX )
@@ -4126,9 +4126,9 @@ const ParaPortion* ImpEditEngine::GetNextVisPortion( const ParaPortion* pCurPort
return pPortion;
}
-long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
+tools::Long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
{
- long nTotalOccupiedHeight = 0;
+ tools::Long nTotalOccupiedHeight = 0;
sal_Int32 nTotalLineCount = 0;
const ParaPortionList& rParaPortions = GetParaPortions();
sal_Int32 nParaCount = rParaPortions.Count();
@@ -4147,7 +4147,7 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
const SvxULSpaceItem& rULItem = pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE);
- long nUL = GetYValue( rULItem.GetLower() );
+ tools::Long nUL = GetYValue( rULItem.GetLower() );
const EditLineList& rLines = pPortion->GetLines();
sal_Int32 nLineCount = rLines.Count();
@@ -4162,7 +4162,7 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
}
}
- long nTotalSpace = IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
+ tools::Long nTotalSpace = IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
nTotalSpace -= nTotalOccupiedHeight;
if (nTotalSpace <= 0 || nTotalLineCount <= 1)
return 0;
@@ -4459,7 +4459,7 @@ Color ImpEditEngine::GetAutoColor() const
bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
TextPortion* pTextPortion, sal_Int32 nStartPos,
- long* pDXArray, sal_uInt16 n100thPercentFromMax,
+ tools::Long* pDXArray, sal_uInt16 n100thPercentFromMax,
bool bManipulateDXArray)
{
DBG_ASSERT( GetAsianCompressionMode() != CharCompressType::NONE, "ImplCalcAsianCompression - Why?" );
@@ -4473,7 +4473,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
if ( GetI18NScriptType( EditPaM( pNode, nStartPos+1 ) ) == i18n::ScriptType::ASIAN )
{
- long nNewPortionWidth = pTextPortion->GetSize().Width();
+ tools::Long nNewPortionWidth = pTextPortion->GetSize().Width();
sal_Int32 nPortionLen = pTextPortion->GetLen();
for ( sal_Int32 n = 0; n < nPortionLen; n++ )
{
@@ -4495,7 +4495,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
pTextPortion->GetExtraInfos()->nMaxCompression100thPercent = n100thPercentFromMax;
pTextPortion->GetExtraInfos()->nAsianCompressionTypes |= nType;
- long nOldCharWidth;
+ tools::Long nOldCharWidth;
if ( (n+1) < nPortionLen )
{
nOldCharWidth = pDXArray[n];
@@ -4509,7 +4509,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
}
nOldCharWidth -= ( n ? pDXArray[n-1] : 0 );
- long nCompress = 0;
+ tools::Long nCompress = 0;
if ( bCompressPunctuation )
{
@@ -4574,10 +4574,10 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
if ( pTextPortion->GetExtraInfos() && ( n100thPercentFromMax != 10000 ) )
{
// Maybe rounding errors in nNewPortionWidth, assure that width not bigger than expected
- long nShrink = pTextPortion->GetExtraInfos()->nOrgWidth - pTextPortion->GetExtraInfos()->nWidthFullCompression;
+ tools::Long nShrink = pTextPortion->GetExtraInfos()->nOrgWidth - pTextPortion->GetExtraInfos()->nWidthFullCompression;
nShrink *= n100thPercentFromMax;
nShrink /= 10000;
- long nNewWidth = pTextPortion->GetExtraInfos()->nOrgWidth - nShrink;
+ tools::Long nNewWidth = pTextPortion->GetExtraInfos()->nOrgWidth - nShrink;
if ( nNewWidth < pTextPortion->GetSize().Width() )
pTextPortion->GetSize().setWidth( nNewWidth );
}
@@ -4586,10 +4586,10 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
}
-void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth )
+void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, tools::Long nRemainingWidth )
{
bool bFoundCompressedPortion = false;
- long nCompressed = 0;
+ tools::Long nCompressed = 0;
std::vector<TextPortion*> aCompressedPortions;
sal_Int32 nPortion = pLine->GetEndPortion();
@@ -4608,7 +4608,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion*
if ( !bFoundCompressedPortion )
return;
- long nCompressPercent = 0;
+ tools::Long nCompressPercent = 0;
if ( nCompressed > nRemainingWidth )
{
nCompressPercent = nCompressed - nRemainingWidth;
@@ -4627,7 +4627,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!!!" );
- long* pDXArray = pLine->GetCharPosArray().data() + (nTxtPortionStart - pLine->GetStart());
+ tools::Long* 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/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 42525141c461..cdb2995acc43 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -923,7 +923,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
ContentNode* pNode = aEditDoc.GetObject( nPara );
SeekCursor( pNode, nPos, aFont );
MapMode aPntMode( MapUnit::MapPoint );
- long nFontHeight = GetRefDevice()->LogicToLogic(
+ tools::Long nFontHeight = GetRefDevice()->LogicToLogic(
aFont.GetFontSize(), &GetRefMapMode(), &aPntMode ).Height();
nFontHeight *=2; // Half Points
sal_uInt16 const nProp = static_cast<const SvxEscapementItem&>(rItem).GetProportionalHeight();
@@ -954,7 +954,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
rOutput.WriteCharPtr( "{\\*\\updnprop" ).WriteCharPtr( OString::number(
nProp100).getStr() ).WriteChar( '}' );
}
- long nUpDown = nFontHeight * std::abs( nEsc ) / 100;
+ tools::Long nUpDown = nFontHeight * std::abs( nEsc ) / 100;
if ( nEsc < 0 )
rOutput.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_DN );
else if ( nEsc > 0 )
@@ -1177,7 +1177,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject
bool bUsePortionInfo = false;
XParaPortionList* pPortionInfo = rTextObject.mpImpl->GetPortionInfo();
- if ( pPortionInfo && ( static_cast<long>(pPortionInfo->GetPaperWidth()) == aPaperSize.Width() )
+ if ( pPortionInfo && ( static_cast<tools::Long>(pPortionInfo->GetPaperWidth()) == aPaperSize.Width() )
&& ( pPortionInfo->GetRefMapMode() == GetRefDevice()->GetMapMode() )
&& ( pPortionInfo->GetStretchX() == nStretchX )
&& ( pPortionInfo->GetStretchY() == nStretchY ) )
diff --git a/editeng/source/items/borderline.cxx b/editeng/source/items/borderline.cxx
index 1239503fe560..6a33b4bbcfc5 100644
--- a/editeng/source/items/borderline.cxx
+++ b/editeng/source/items/borderline.cxx
@@ -94,7 +94,7 @@ Color SvxBorderLine::threeDMediumColor( Color aMain )
return lcl_compute3DColor( aMain, -42, -0, 42 );
}
-SvxBorderLine::SvxBorderLine( const Color *pCol, long nWidth,
+SvxBorderLine::SvxBorderLine( const Color *pCol, tools::Long nWidth,
SvxBorderLineStyle nStyle,
Color (*pColorOutFn)( Color ), Color (*pColorInFn)( Color ) )
: m_nWidth( nWidth )
@@ -407,7 +407,7 @@ BorderWidthImpl SvxBorderLine::getWidthImpl( SvxBorderLineStyle nStyle )
return aImpl;
}
-void SvxBorderLine::ScaleMetrics( long nMult, long nDiv )
+void SvxBorderLine::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
m_nMult = nMult;
m_nDiv = nDiv;
@@ -437,7 +437,7 @@ void SvxBorderLine::GuessLinesWidths( SvxBorderLineStyle nStyle, sal_uInt16 nOut
};
static size_t const len = SAL_N_ELEMENTS(aDoubleStyles);
- long nWidth = 0;
+ tools::Long nWidth = 0;
SvxBorderLineStyle nTestStyle(SvxBorderLineStyle::NONE);
for (size_t i = 0; i < len && nWidth == 0; ++i)
{
@@ -611,7 +611,7 @@ Color SvxBorderLine::GetColorGap( ) const
return aResult;
}
-void SvxBorderLine::SetWidth( long nWidth )
+void SvxBorderLine::SetWidth( tools::Long nWidth )
{
m_nWidth = nWidth;
}
@@ -652,15 +652,15 @@ OUString SvxBorderLine::GetValueString(MapUnit eSrcUnit,
else
{
OUString sMetric = EditResId(GetMetricId( eDestUnit ));
- aStr += GetMetricText( static_cast<long>(GetInWidth()), eSrcUnit, eDestUnit, pIntl );
+ aStr += GetMetricText( static_cast<tools::Long>(GetInWidth()), eSrcUnit, eDestUnit, pIntl );
if ( bMetricStr )
aStr += sMetric;
aStr += cpDelim +
- GetMetricText( static_cast<long>(GetOutWidth()), eSrcUnit, eDestUnit, pIntl );
+ GetMetricText( static_cast<tools::Long>(GetOutWidth()), eSrcUnit, eDestUnit, pIntl );
if ( bMetricStr )
aStr += sMetric;
aStr += cpDelim +
- GetMetricText( static_cast<long>(GetDistance()), eSrcUnit, eDestUnit, pIntl );
+ GetMetricText( static_cast<tools::Long>(GetDistance()), eSrcUnit, eDestUnit, pIntl );
if ( bMetricStr )
aStr += sMetric;
}
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 371621157b8e..e9f5a6df6d59 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -269,7 +269,7 @@ bool SvxSizeItem::GetPresentation
}
-void SvxSizeItem::ScaleMetrics( long nMult, long nDiv )
+void SvxSizeItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
m_aSize.setWidth( Scale( m_aSize.Width(), nMult, nDiv ) );
m_aSize.setHeight( Scale( m_aSize.Height(), nMult, nDiv ) );
@@ -300,8 +300,8 @@ SvxLRSpaceItem::SvxLRSpaceItem( const sal_uInt16 nId ) :
}
-SvxLRSpaceItem::SvxLRSpaceItem( const long nLeft, const long nRight,
- const long nTLeft, const short nOfset,
+SvxLRSpaceItem::SvxLRSpaceItem( const tools::Long nLeft, const tools::Long nRight,
+ const tools::Long nTLeft, const short nOfset,
const sal_uInt16 nId )
: SfxPoolItem( nId ),
@@ -514,7 +514,7 @@ bool SvxLRSpaceItem::GetPresentation
Application::GetSettings().GetUILanguageTag());
}
else
- rText += GetMetricText( static_cast<long>(nFirstLineOffset),
+ rText += GetMetricText( static_cast<tools::Long>(nFirstLineOffset),
eCoreUnit, ePresUnit, &rIntl );
rText += OUString(cpDelim);
if ( 100 != nRightMargin )
@@ -547,7 +547,7 @@ bool SvxLRSpaceItem::GetPresentation
Application::GetSettings().GetUILanguageTag());
else
{
- rText += GetMetricText( static_cast<long>(nFirstLineOffset),
+ rText += GetMetricText( static_cast<tools::Long>(nFirstLineOffset),
eCoreUnit, ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit));
}
@@ -571,7 +571,7 @@ bool SvxLRSpaceItem::GetPresentation
}
-void SvxLRSpaceItem::ScaleMetrics( long nMult, long nDiv )
+void SvxLRSpaceItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
nFirstLineOffset = static_cast<short>(Scale( nFirstLineOffset, nMult, nDiv ));
nTxtLeft = Scale( nTxtLeft, nMult, nDiv );
@@ -780,7 +780,7 @@ bool SvxULSpaceItem::GetPresentation
Application::GetSettings().GetUILanguageTag());
}
else
- rText = GetMetricText( static_cast<long>(nUpper), eCoreUnit, ePresUnit, &rIntl );
+ rText = GetMetricText( static_cast<tools::Long>(nUpper), eCoreUnit, ePresUnit, &rIntl );
rText += OUString(cpDelim);
if ( 100 != nPropLower )
{
@@ -788,7 +788,7 @@ bool SvxULSpaceItem::GetPresentation
Application::GetSettings().GetUILanguageTag());
}
else
- rText += GetMetricText( static_cast<long>(nLower), eCoreUnit, ePresUnit, &rIntl );
+ rText += GetMetricText( static_cast<tools::Long>(nLower), eCoreUnit, ePresUnit, &rIntl );
return true;
}
case SfxItemPresentation::Complete:
@@ -801,7 +801,7 @@ bool SvxULSpaceItem::GetPresentation
}
else
{
- rText += GetMetricText( static_cast<long>(nUpper), eCoreUnit, ePresUnit, &rIntl ) +
+ rText += GetMetricText( static_cast<tools::Long>(nUpper), eCoreUnit, ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit));
}
rText += cpDelim + EditResId(RID_SVXITEMS_ULSPACE_LOWER);
@@ -812,7 +812,7 @@ bool SvxULSpaceItem::GetPresentation
}
else
{
- rText += GetMetricText( static_cast<long>(nLower), eCoreUnit, ePresUnit, &rIntl ) +
+ rText += GetMetricText( static_cast<tools::Long>(nLower), eCoreUnit, ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit));
}
return true;
@@ -823,7 +823,7 @@ bool SvxULSpaceItem::GetPresentation
}
-void SvxULSpaceItem::ScaleMetrics( long nMult, long nDiv )
+void SvxULSpaceItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
nUpper = static_cast<sal_uInt16>(Scale( nUpper, nMult, nDiv ));
nLower = static_cast<sal_uInt16>(Scale( nLower, nMult, nDiv ));
@@ -1193,7 +1193,7 @@ bool SvxShadowItem::GetPresentation
pId = RID_SVXITEMS_TRANSPARENT_TRUE;
rText += EditResId(pId) +
cpDelim +
- GetMetricText( static_cast<long>(nWidth), eCoreUnit, ePresUnit, &rIntl ) +
+ GetMetricText( static_cast<tools::Long>(nWidth), eCoreUnit, ePresUnit, &rIntl ) +
cpDelim +
EditResId(RID_SVXITEMS_SHADOW[static_cast<int>(eLocation)]);
return true;
@@ -1209,7 +1209,7 @@ bool SvxShadowItem::GetPresentation
pId = RID_SVXITEMS_TRANSPARENT_TRUE;
rText += EditResId(pId) +
cpDelim +
- GetMetricText( static_cast<long>(nWidth), eCoreUnit, ePresUnit, &rIntl ) +
+ GetMetricText( static_cast<tools::Long>(nWidth), eCoreUnit, ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit)) +
cpDelim +
EditResId(RID_SVXITEMS_SHADOW[static_cast<int>(eLocation)]);
@@ -1221,7 +1221,7 @@ bool SvxShadowItem::GetPresentation
}
-void SvxShadowItem::ScaleMetrics( long nMult, long nDiv )
+void SvxShadowItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
nWidth = static_cast<sal_uInt16>(Scale( nWidth, nMult, nDiv ));
}
@@ -1628,7 +1628,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case LINE_WIDTH:
{
// Set the line width on all borders
- long nWidth(0);
+ tools::Long nWidth(0);
rVal >>= nWidth;
if( bConvert )
nWidth = convertMm100ToTwip( nWidth );
@@ -1761,17 +1761,17 @@ bool SvxBoxItem::GetPresentation
rText += pRight->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp;
}
}
- rText += GetMetricText( static_cast<long>(nTopDist), eCoreUnit, ePresUnit, &rIntl );
+ rText += GetMetricText( static_cast<tools::Long>(nTopDist), eCoreUnit, ePresUnit, &rIntl );
if( nTopDist != nBottomDist || nTopDist != nLeftDist ||
nTopDist != nRightDist )
{
rText += cpDelimTmp +
- GetMetricText( static_cast<long>(nBottomDist), eCoreUnit,
+ GetMetricText( static_cast<tools::Long>(nBottomDist), eCoreUnit,
ePresUnit, &rIntl ) +
cpDelimTmp +
- GetMetricText( static_cast<long>(nLeftDist), eCoreUnit, ePresUnit, &rIntl ) +
+ GetMetricText( static_cast<tools::Long>(nLeftDist), eCoreUnit, ePresUnit, &rIntl ) +
cpDelimTmp +
- GetMetricText( static_cast<long>(nRightDist), eCoreUnit,
+ GetMetricText( static_cast<tools::Long>(nRightDist), eCoreUnit,
ePresUnit, &rIntl );
}
return true;
@@ -1823,29 +1823,29 @@ bool SvxBoxItem::GetPresentation
if( nTopDist == nBottomDist && nTopDist == nLeftDist &&
nTopDist == nRightDist )
{
- rText += GetMetricText( static_cast<long>(nTopDist), eCoreUnit,
+ rText += GetMetricText( static_cast<tools::Long>(nTopDist), eCoreUnit,
ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit));
}
else
{
rText += EditResId(RID_SVXITEMS_BORDER_TOP) +
- GetMetricText( static_cast<long>(nTopDist), eCoreUnit,
+ GetMetricText( static_cast<tools::Long>(nTopDist), eCoreUnit,
ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit)) +
cpDelimTmp +
EditResId(RID_SVXITEMS_BORDER_BOTTOM) +
- GetMetricText( static_cast<long>(nBottomDist), eCoreUnit,
+ GetMetricText( static_cast<tools::Long>(nBottomDist), eCoreUnit,
ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit)) +
cpDelimTmp +
EditResId(RID_SVXITEMS_BORDER_LEFT) +
- GetMetricText( static_cast<long>(nLeftDist), eCoreUnit,
+ GetMetricText( static_cast<tools::Long>(nLeftDist), eCoreUnit,
ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit)) +
cpDelimTmp +
EditResId(RID_SVXITEMS_BORDER_RIGHT) +
- GetMetricText( static_cast<long>(nRightDist), eCoreUnit,
+ GetMetricText( static_cast<tools::Long>(nRightDist), eCoreUnit,
ePresUnit, &rIntl ) +
" " + EditResId(GetMetricId(ePresUnit));
}
@@ -1857,7 +1857,7 @@ bool SvxBoxItem::GetPresentation
}
-void SvxBoxItem::ScaleMetrics( long nMult, long nDiv )
+void SvxBoxItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
if ( pTop ) pTop->ScaleMetrics( nMult, nDiv );
if ( pBottom ) pBottom->ScaleMetrics( nMult, nDiv );
@@ -2159,7 +2159,7 @@ bool SvxBoxInfoItem::GetPresentation
}
-void SvxBoxInfoItem::ScaleMetrics( long nMult, long nDiv )
+void SvxBoxInfoItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
if ( pHori ) pHori->ScaleMetrics( nMult, nDiv );
if ( pVert ) pVert->ScaleMetrics( nMult, nDiv );
@@ -2472,10 +2472,10 @@ void BorderDistancesToWord(const SvxBoxItem& rBox, const WordPageMargins& rMargi
const SvxBorderLine* pLnR = rBox.GetLine(SvxBoxItemLine::RIGHT);
// We need to take border widths into account
- const long nWidthT = pLnT ? pLnT->GetScaledWidth() : 0;
- const long nWidthL = pLnL ? pLnL->GetScaledWidth() : 0;
- const long nWidthB = pLnB ? pLnB->GetScaledWidth() : 0;
- const long nWidthR = pLnR ? pLnR->GetScaledWidth() : 0;
+ const tools::Long nWidthT = pLnT ? pLnT->GetScaledWidth() : 0;
+ const tools::Long nWidthL = pLnL ? pLnL->GetScaledWidth() : 0;
+ const tools::Long nWidthB = pLnB ? pLnB->GetScaledWidth() : 0;
+ const tools::Long nWidthR = pLnR ? pLnR->GetScaledWidth() : 0;
// Resulting distances from text to borders
const sal_Int32 nT2BT = pLnT ? nT : 0;
@@ -2760,7 +2760,7 @@ bool SvxLineItem::GetPresentation
}
-void SvxLineItem::ScaleMetrics( long nMult, long nDiv )
+void SvxLineItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
if ( pLine ) pLine->ScaleMetrics( nMult, nDiv );
}
@@ -2882,7 +2882,7 @@ bool SvxBrushItem::isUsed() const
}
-static sal_Int8 lcl_PercentToTransparency(long nPercent)
+static sal_Int8 lcl_PercentToTransparency(tools::Long nPercent)
{
// 0xff must not be returned!
return sal_Int8(nPercent ? (50 + 0xfe * nPercent) / 100 : 0);
diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx
index 9b3996e79975..5cf463173063 100644
--- a/editeng/source/items/itemtype.cxx
+++ b/editeng/source/items/itemtype.cxx
@@ -29,7 +29,7 @@
#include <rtl/ustrbuf.hxx>
-OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper* pIntl )
+OUString GetMetricText( tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper* pIntl )
{
bool bNeg = false;
bool bShowAtLeastOneDecimalDigit = true;
@@ -108,7 +108,7 @@ OUString GetMetricText( long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const In
if ( bNeg )
sRet.append('-');
- long nDiff = 1000;
+ tools::Long nDiff = 1000;
for( int nDigits = 4; nDigits; --nDigits, nDiff /= 10 )
{
if ( nRet < nDiff )
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index bc10590f460f..cd22755e2a38 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -483,15 +483,15 @@ void SvxNumberFormat::SetLabelFollowedBy( const LabelFollowedBy eLabelFollowedBy
{
meLabelFollowedBy = eLabelFollowedBy;
}
-void SvxNumberFormat::SetListtabPos( const long nListtabPos )
+void SvxNumberFormat::SetListtabPos( const tools::Long nListtabPos )
{
mnListtabPos = nListtabPos;
}
-void SvxNumberFormat::SetFirstLineIndent( const long nFirstLineIndent )
+void SvxNumberFormat::SetFirstLineIndent( const tools::Long nFirstLineIndent )
{
mnFirstLineIndent = nFirstLineIndent;
}
-void SvxNumberFormat::SetIndentAt( const long nIndentAt )
+void SvxNumberFormat::SetIndentAt( const tools::Long nIndentAt )
{
mnIndentAt = nIndentAt;
}
@@ -598,11 +598,11 @@ SvxNumRule::SvxNumRule( SvxNumRuleFlags nFeatures,
SvxNumberFormat::LABEL_ALIGNMENT )
{
// first line indent of general numbering in inch: -0,25 inch
- const long cFirstLineIndent = -1440/4;
+ const tools::Long cFirstLineIndent = -1440/4;
// indent values of general numbering in inch:
// 0,5 0,75 1,0 1,25 1,5
// 1,75 2,0 2,25 2,5 2,75
- const long cIndentAt = 1440/4;
+ const tools::Long cIndentAt = 1440/4;
aFmts[i]->SetPositionAndSpaceMode( SvxNumberFormat::LABEL_ALIGNMENT );
aFmts[i]->SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmts[i]->SetListtabPos( cIndentAt * (i+2) );
diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx
index ebb5aecaf63f..e8646bc55377 100644
--- a/editeng/source/items/paperinf.cxx
+++ b/editeng/source/items/paperinf.cxx
@@ -91,7 +91,7 @@ Paper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit )
}
-long SvxPaperInfo::GetSloppyPaperDimension( long nSize )
+tools::Long SvxPaperInfo::GetSloppyPaperDimension( tools::Long nSize )
{
nSize = OutputDevice::LogicToLogic(nSize, MapUnit::MapTwip, MapUnit::Map100thMM);
nSize = PaperInfo::sloppyFitPageDimension(nSize);
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 234331b7a490..f5d0e2d79a26 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -89,11 +89,11 @@ void SvxFont::SetNonAutoEscapement(short nNewEsc, const OutputDevice* pOutDev)
void SvxFont::DrawArrow( OutputDevice &rOut, const tools::Rectangle& rRect,
const Size& rSize, const Color& rCol, bool bLeft )
{
- long nLeft = ( rRect.Left() + rRect.Right() - rSize.Width() )/ 2;
- long nRight = nLeft + rSize.Width();
- long nMid = ( rRect.Top() + rRect.Bottom() ) / 2;
- long nTop = nMid - rSize.Height() / 2;
- long nBottom = nTop + rSize.Height();
+ tools::Long nLeft = ( rRect.Left() + rRect.Right() - rSize.Width() )/ 2;
+ tools::Long nRight = nLeft + rSize.Width();
+ tools::Long nMid = ( rRect.Top() + rRect.Bottom() ) / 2;
+ tools::Long nTop = nMid - rSize.Height() / 2;
+ tools::Long nBottom = nTop + rSize.Height();
if( nLeft < rRect.Left() )
{
nLeft = rRect.Left();
@@ -403,7 +403,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt,
}
if( IsKern() && ( nLen > 1 ) )
- aTxtSize.AdjustWidth( ( nLen-1 ) * long( nKern ) );
+ aTxtSize.AdjustWidth( ( nLen-1 ) * tools::Long( nKern ) );
return aTxtSize;
}
@@ -424,7 +424,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut )
}
Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
- const sal_Int32 nIdx, const sal_Int32 nLen, long* pDXArray ) const
+ const sal_Int32 nIdx, const sal_Int32 nLen, tools::Long* pDXArray ) const
{
if ( !IsCaseMap() && !IsKern() )
return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ),
@@ -440,12 +440,12 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
if( IsKern() && ( nLen > 1 ) )
{
- aTxtSize.AdjustWidth( ( nLen-1 ) * long( nKern ) );
+ aTxtSize.AdjustWidth( ( nLen-1 ) * tools::Long( nKern ) );
if ( pDXArray )
{
for ( sal_Int32 i = 0; i < nLen; i++ )
- pDXArray[i] += ( (i+1) * long( nKern ) );
+ pDXArray[i] += ( (i+1) * tools::Long( nKern ) );
// The last one is a nKern too big:
pDXArray[nLen-1] -= nKern;
}
@@ -474,7 +474,7 @@ Size SvxFont::GetTextSize( const OutputDevice *pOut, const OUString &rTxt,
void SvxFont::QuickDrawText( OutputDevice *pOut,
const Point &rPos, const OUString &rTxt,
- const sal_Int32 nIdx, const sal_Int32 nLen, const long* pDXArray ) const
+ const sal_Int32 nIdx, const sal_Int32 nLen, const tools::Long* pDXArray ) const
{
// Font has to be selected in OutputDevice...
@@ -488,7 +488,7 @@ void SvxFont::QuickDrawText( OutputDevice *pOut,
if ( nEsc )
{
- long nDiff = GetFontSize().Height();
+ tools::Long nDiff = GetFontSize().Height();
nDiff *= nEsc;
nDiff /= 100;
@@ -655,7 +655,7 @@ void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const sal_Int32 _nIdx,
aPartSize.setHeight( pOut->GetTextHeight() );
}
aTxtSize.AdjustWidth(aPartSize.Width() );
- aTxtSize.AdjustWidth( _nLen * long( nKern ) );
+ aTxtSize.AdjustWidth( _nLen * tools::Long( nKern ) );
}
Size SvxFont::GetCapitalSize( const OutputDevice *pOut, const OUString &rTxt,
@@ -748,11 +748,11 @@ void SvxDoDrawCapital::Do( const OUString &_rTxt, const sal_Int32 _nIdx,
aPartSize.setWidth( pOut->GetTextWidth( _rTxt, _nIdx, _nLen ) );
aPartSize.setHeight( pOut->GetTextHeight() );
- long nWidth = aPartSize.Width();
+ tools::Long nWidth = aPartSize.Width();
if ( nKern )
{
aPos.AdjustX(nKern/2);
- if ( _nLen ) nWidth += (_nLen*long(nKern));
+ if ( _nLen ) nWidth += (_nLen*tools::Long(nKern));
}
pOut->DrawStretchText(aPos,nWidth-nKern,_rTxt,_nIdx,_nLen);
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index fdf0d0f6cf8e..8b856d6e7497 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -701,7 +701,7 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, M
short nTemp = static_cast<short>(nProp);
nDiff = nTemp * 20;
if(!bCoreInTwip)
- nDiff = static_cast<short>(convertTwipToMm100(static_cast<long>(nDiff)));
+ nDiff = static_cast<short>(convertTwipToMm100(static_cast<tools::Long>(nDiff)));
break;
}
case MapUnit::Map100thMM:
@@ -740,7 +740,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if( fPoint < 0. || fPoint > 10000. )
return false;
- nHeight = static_cast<long>( fPoint * 20.0 + 0.5 ); // Twips
+ nHeight = static_cast<tools::Long>( fPoint * 20.0 + 0.5 ); // Twips
if (!bConvert)
nHeight = convertTwipToMm100(nHeight); // Convert, if the item contains 1/100mm
@@ -765,7 +765,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(fPoint < 0. || fPoint > 10000.)
return false;
- nHeight = static_cast<long>( fPoint * 20.0 + 0.5 ); // Twips
+ nHeight = static_cast<tools::Long>( fPoint * 20.0 + 0.5 ); // Twips
if (!bConvert)
nHeight = convertTwipToMm100(nHeight); // Convert, if the item contains 1/100mm
}
@@ -823,7 +823,7 @@ bool SvxFontHeightItem::GetPresentation
}
else if( 100 == nProp )
{
- rText = GetMetricText( static_cast<long>(nHeight),
+ rText = GetMetricText( static_cast<tools::Long>(nHeight),
eCoreUnit, MapUnit::MapPoint, &rIntl ) +
" " + EditResId(GetMetricId(MapUnit::MapPoint));
}
@@ -833,7 +833,7 @@ bool SvxFontHeightItem::GetPresentation
}
-void SvxFontHeightItem::ScaleMetrics( long nMult, long nDiv )
+void SvxFontHeightItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
nHeight = static_cast<sal_uInt32>(Scale( nHeight, nMult, nDiv ));
}
@@ -1494,7 +1494,7 @@ SvxKerningItem* SvxKerningItem::Clone( SfxItemPool * ) const
return new SvxKerningItem( *this );
}
-void SvxKerningItem::ScaleMetrics( long nMult, long nDiv )
+void SvxKerningItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
{
SetValue( static_cast<sal_Int16>(Scale( GetValue(), nMult, nDiv )) );
}
@@ -1517,7 +1517,7 @@ bool SvxKerningItem::GetPresentation
switch ( ePres )
{
case SfxItemPresentation::Nameless:
- rText = GetMetricText( static_cast<long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) +
+ rText = GetMetricText( static_cast<tools::Long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) +
" " + EditResId(GetMetricId(MapUnit::MapPoint));
return true;
case SfxItemPresentation::Complete:
@@ -1532,7 +1532,7 @@ bool SvxKerningItem::GetPresentation
if (pId)
rText += EditResId(pId);
- rText += GetMetricText( static_cast<long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) +
+ rText += GetMetricText( static_cast<tools::Long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) +
" " + EditResId(GetMetricId(MapUnit::MapPoint));
return true;
}
diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index 925c218424c0..8ae51a790899 100644
--- a/editeng/source/misc/txtrange.cxx
+++ b/editeng/source/misc/txtrange.cxx
@@ -95,16 +95,16 @@ class SvxBoundArgs
std::vector<bool> aBoolArr;
std::deque<long>* pLongArr;
TextRanger *pTextRanger;
- long nMin;
- long nMax;
- long nTop;
- long nBottom;
- long nUpDiff;
- long nLowDiff;
- long nUpper;
- long nLower;
- long nStart;
- long nEnd;
+ tools::Long nMin;
+ tools::Long nMax;
+ tools::Long nTop;
+ tools::Long nBottom;
+ tools::Long nUpDiff;
+ tools::Long nLowDiff;
+ tools::Long nUpper;
+ tools::Long nLower;
+ tools::Long nStart;
+ tools::Long nEnd;
sal_uInt16 nCut;
sal_uInt16 nLast;
sal_uInt16 nNext;
@@ -116,22 +116,22 @@ class SvxBoundArgs
bool bConcat : 1;
bool bRotate : 1;
void NoteRange( bool bToggle );
- long Cut( long nY, const Point& rPt1, const Point& rPt2 );
+ tools::Long Cut( tools::Long nY, const Point& rPt1, const Point& rPt2 );
void Add();
- void NoteFarPoint_( long nPx, long nPyDiff, long nDiff );
- void NoteFarPoint( long nPx, long nPyDiff, long nDiff )
+ void NoteFarPoint_( tools::Long nPx, tools::Long nPyDiff, tools::Long nDiff );
+ void NoteFarPoint( tools::Long nPx, tools::Long nPyDiff, tools::Long nDiff )
{ if( nDiff ) NoteFarPoint_( nPx, nPyDiff, nDiff ); }
- long CalcMax( const Point& rPt1, const Point& rPt2, long nRange, long nFar );
+ tools::Long CalcMax( const Point& rPt1, const Point& rPt2, tools::Long nRange, tools::Long nFar );
void CheckCut( const Point& rLst, const Point& rNxt );
- long A( const Point& rP ) const { return bRotate ? rP.Y() : rP.X(); }
- long B( const Point& rP ) const { return bRotate ? rP.X() : rP.Y(); }
+ tools::Long A( const Point& rP ) const { return bRotate ? rP.Y() : rP.X(); }
+ tools::Long B( const Point& rP ) const { return bRotate ? rP.X() : rP.Y(); }
public:
SvxBoundArgs( TextRanger* pRanger, std::deque<long>* pLong, const Range& rRange );
- void NotePoint( const long nA ) { NoteMargin( nA - nStart, nA + nEnd ); }
- void NoteMargin( const long nL, const long nR )
+ void NotePoint( const tools::Long nA ) { NoteMargin( nA - nStart, nA + nEnd ); }
+ void NoteMargin( const tools::Long nL, const tools::Long nR )
{ if( nMin > nL ) nMin = nL; if( nMax < nR ) nMax = nR; }
sal_uInt16 Area( const Point& rPt );
- void NoteUpLow( long nA, const sal_uInt8 nArea );
+ void NoteUpLow( tools::Long nA, const sal_uInt8 nArea );
void Calc( const tools::PolyPolygon& rPoly );
void Concat( const tools::PolyPolygon* pPoly );
// inlines
@@ -180,8 +180,8 @@ SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, std::deque<long>* pLong,
pLongArr->clear();
}
-long SvxBoundArgs::CalcMax( const Point& rPt1, const Point& rPt2,
- long nRange, long nFarRange )
+tools::Long SvxBoundArgs::CalcMax( const Point& rPt1, const Point& rPt2,
+ tools::Long nRange, tools::Long nFarRange )
{
double nDa = Cut( nRange, rPt1, rPt2 ) - Cut( nFarRange, rPt1, rPt2 );
double nB;
@@ -202,7 +202,7 @@ long SvxBoundArgs::CalcMax( const Point& rPt1, const Point& rPt2,
else
bNote = nB < B(rPt1);
if( bNote )
- return( long( nB ) );
+ return( tools::Long( nB ) );
return 0;
}
@@ -215,7 +215,7 @@ void SvxBoundArgs::CheckCut( const Point& rLst, const Point& rNxt )
if( rLst.X() == rNxt.X() || rLst.Y() == rNxt.Y() )
return;
- long nYps;
+ tools::Long nYps;
if( nLowDiff && ( ( nCut & 1 ) || nLast == 1 || nNext == 1 ) )
{
nYps = CalcMax( rLst, rNxt, nBottom, nLower );
@@ -230,15 +230,15 @@ void SvxBoundArgs::CheckCut( const Point& rLst, const Point& rNxt )
}
}
-void SvxBoundArgs::NoteFarPoint_( long nPa, long nPbDiff, long nDiff )
+void SvxBoundArgs::NoteFarPoint_( tools::Long nPa, tools::Long nPbDiff, tools::Long nDiff )
{
- long nTmpA;
+ tools::Long nTmpA;
double nQuot = 2 * nDiff - nPbDiff;
nQuot *= nPbDiff;
nQuot = sqrt( nQuot );
nQuot /= nDiff;
- nTmpA = nPa - long( nStart * nQuot );
- nPbDiff = nPa + long( nEnd * nQuot );
+ nTmpA = nPa - tools::Long( nStart * nQuot );
+ nPbDiff = nPa + tools::Long( nEnd * nQuot );
NoteMargin( nTmpA, nPbDiff );
}
@@ -412,8 +412,8 @@ void SvxBoundArgs::Calc( const tools::PolyPolygon& rPoly )
{
if( bInner )
{
- long nTmpMin = nMin + 2 * nStart;
- long nTmpMax = nMax - 2 * nEnd;
+ tools::Long nTmpMin = nMin + 2 * nStart;
+ tools::Long nTmpMax = nMax - 2 * nEnd;
if( nTmpMin <= nTmpMax )
{
pLongArr->push_front(nTmpMax);
@@ -506,8 +506,8 @@ void SvxBoundArgs::Concat( const tools::PolyPolygon* pPoly )
pOld->insert( pOld->begin() + nIdx, pLongArr->begin() + i, pLongArr->end() );
break;
}
- long nLeft = (*pLongArr)[ i++ ];
- long nRight = (*pLongArr)[ i++ ];
+ tools::Long nLeft = (*pLongArr)[ i++ ];
+ tools::Long nRight = (*pLongArr)[ i++ ];
std::deque<long>::size_type nLeftPos = nIdx + 1;
while( nLeftPos < nOldCount && nLeft > (*pOld)[ nLeftPos ] )
nLeftPos += 2;
@@ -527,7 +527,7 @@ void SvxBoundArgs::Concat( const tools::PolyPolygon* pPoly )
}
else if( bSubtract ) // Subtract, if necessary separate
{
- const long nOld = (*pOld)[nLeftPos - 1];
+ const tools::Long nOld = (*pOld)[nLeftPos - 1];
if (nLeft > nOld)
{ // Now we split the left part...
if( nLeft - 1 > nOld )
@@ -571,7 +571,7 @@ void SvxBoundArgs::Concat( const tools::PolyPolygon* pPoly )
sal_uInt16 SvxBoundArgs::Area( const Point& rPt )
{
- long nB = B( rPt );
+ tools::Long nB = B( rPt );
if( nB >= nBottom )
{
if( nB >= nLower )
@@ -594,22 +594,22 @@ sal_uInt16 SvxBoundArgs::Area( const Point& rPt )
* one below the Y-Coordinate.
*************************************************************************/
-long SvxBoundArgs::Cut( long nB, const Point& rPt1, const Point& rPt2 )
+tools::Long SvxBoundArgs::Cut( tools::Long nB, const Point& rPt1, const Point& rPt2 )
{
if( pTextRanger->IsVertical() )
{
double nQuot = nB - rPt1.X();
nQuot /= ( rPt2.X() - rPt1.X() );
nQuot *= ( rPt2.Y() - rPt1.Y() );
- return long( rPt1.Y() + nQuot );
+ return tools::Long( rPt1.Y() + nQuot );
}
double nQuot = nB - rPt1.Y();
nQuot /= ( rPt2.Y() - rPt1.Y() );
nQuot *= ( rPt2.X() - rPt1.X() );
- return long( rPt1.X() + nQuot );
+ return tools::Long( rPt1.X() + nQuot );
}
-void SvxBoundArgs::NoteUpLow( long nA, const sal_uInt8 nArea )
+void SvxBoundArgs::NoteUpLow( tools::Long nA, const sal_uInt8 nArea )
{
if( nAct )
{
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 7358a7c6ad9d..645ecdb7fce2 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -38,7 +38,7 @@ OutlinerEditEng::~OutlinerEditEng()
{
}
-void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long /*nBaseLineY*/, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
+void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long /*nBaseLineY*/, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
{
if( GetControlWord() & EEControlBits::OUTLINER )
{
@@ -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,
- const long* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
+ const tools::Long* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -154,7 +154,7 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText
pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, false/*bEndOfBullet*/, pLocale, rOverlineColor, rTextLineColor);
}
-void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar,
+void OutlinerEditEng::DrawingTab( const Point& rStartPos, tools::Long nWidth, const OUString& rChar,
const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor)
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index bb911b711c5b..6830460204a0 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -37,14 +37,14 @@ public:
OutlinerEditEng( Outliner* pOwner, SfxItemPool* pPool );
virtual ~OutlinerEditEng() override;
- virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) override;
+ virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) override;
virtual void ParagraphInserted( sal_Int32 nNewParagraph ) override;
virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph ) override;
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, const long* pDXArray, const SvxFont& rFont,
+ sal_Int32 nTextLen, const tools::Long* pDXArray, const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
@@ -55,7 +55,7 @@ public:
const Color& rTextLineColor) override;
virtual void DrawingTab(
- const Point& rStartPos, long nWidth, const OUString& rChar,
+ const Point& rStartPos, tools::Long nWidth, const OUString& rChar,
const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
bool bEndOfLine,
bool bEndOfParagraph,
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 2fba66dc2d4e..411cc62a2158 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -956,8 +956,8 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
// Translation...
aTextPos -= rOrigin;
// Rotation...
- aRotatedPos.setX(static_cast<long>(nCos*aTextPos.X() + nSin*aTextPos.Y()) );
- aRotatedPos.setY(static_cast<long>(- (nSin*aTextPos.X() - nCos*aTextPos.Y())) );
+ aRotatedPos.setX(static_cast<tools::Long>(nCos*aTextPos.X() + nSin*aTextPos.Y()) );
+ aRotatedPos.setY(static_cast<tools::Long>(- (nSin*aTextPos.X() - nCos*aTextPos.Y())) );
aTextPos = aRotatedPos;
// Translation...
aTextPos += rOrigin;
@@ -1053,7 +1053,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
bStrippingPortions || nOrientation )
return;
- long nWidth = pOutDev->PixelToLogic( Size( 10, 0 ) ).Width();
+ tools::Long nWidth = pOutDev->PixelToLogic( Size( 10, 0 ) ).Width();
Point aStartPos, aEndPos;
if ( !bVertical )
@@ -1082,7 +1082,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
void Outliner::InvalidateBullet(sal_Int32 nPara)
{
- long nLineHeight = static_cast<long>(pEditEngine->GetLineHeight(nPara ));
+ tools::Long nLineHeight = static_cast<tools::Long>(pEditEngine->GetLineHeight(nPara ));
for (OutlinerView* pView : aViewList)
{
Point aPos( pView->pEditView->GetWindowPosTopLeft(nPara ) );
@@ -1519,7 +1519,7 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, boo
const SvxLRSpaceItem& rLR = pEditEngine->GetParaAttrib( nPara, bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE );
aTopLeft.setX( rLR.GetTextLeft() + rLR.GetTextFirstLineOffset() + nSpaceBefore );
- long nBulletWidth = std::max( static_cast<long>(-rLR.GetTextFirstLineOffset()), static_cast<long>((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) );
+ tools::Long nBulletWidth = std::max( static_cast<tools::Long>(-rLR.GetTextFirstLineOffset()), static_cast<tools::Long>((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) );
if ( nBulletWidth < aBulletSize.Width() ) // The Bullet creates its space
nBulletWidth = aBulletSize.Width();
@@ -1668,7 +1668,7 @@ void Outliner::StripPortions()
}
void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
- sal_Int32 nTextLen, const long* pDXArray,const SvxFont& rFont,
+ sal_Int32 nTextLen, const tools::Long* pDXArray,const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
@@ -1688,7 +1688,7 @@ void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_I
}
}
-void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, const SvxFont& rFont,
+void Outliner::DrawingTab( const Point& rStartPos, tools::Long nWidth, const OUString& rChar, const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor)
{
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 2bd7d8bb9172..525559720eac 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -566,7 +566,7 @@ void OutlinerView::Indent( short nDiff )
pOwner->UndoActionEnd();
}
-void OutlinerView::AdjustHeight( long nDY )
+void OutlinerView::AdjustHeight( tools::Long nDY )
{
pEditView->MoveParagraphs( nDY );
}
@@ -1270,7 +1270,7 @@ ESelection OutlinerView::GetSelection() const
}
-void OutlinerView::Scroll( long nHorzScroll, long nVertScroll )
+void OutlinerView::Scroll( tools::Long nHorzScroll, tools::Long nVertScroll )
{
pEditView->Scroll( nHorzScroll, nVertScroll );
}
@@ -1361,7 +1361,7 @@ void OutlinerView::Read( SvStream& rInput, EETextFormat eFormat, SvKeyValueItera
pEditView->Read( rInput, eFormat, pHTTPHeaderAttrs );
- long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount;
+ tools::Long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount;
sal_Int32 nChangesStart = aOldSel.nStartPara;
sal_Int32 nChangesEnd = nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara);
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index dab691d39f6c..790085b4031b 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1385,7 +1385,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet,
bool bContinue = true;
int nBorderTyp = 0;
- long nWidth = 1;
+ tools::Long nWidth = 1;
bool bDoubleWidth = false;
do {
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index bde2a75e26ab..de8cab5ef060 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -291,7 +291,7 @@ tools::Rectangle SvxEditEngineForwarder::GetCharBounds( sal_Int32 nPara, sal_Int
// don't rotate for vertical text.
Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() );
// swap width and height
- long tmp = aSize.Width();
+ tools::Long tmp = aSize.Width();
aSize.setWidth(aSize.Height());
aSize.setHeight(tmp);
bool bIsVertical( rEditEngine.IsVertical() );
@@ -375,7 +375,7 @@ bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPar
{
Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() );
// swap width and height
- long tmp = aSize.Width();
+ tools::Long tmp = aSize.Width();
aSize.setWidth(aSize.Height());
aSize.setHeight(tmp);
Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos,
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 32ee462bbbfc..144126d25e08 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -277,7 +277,7 @@ tools::Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32
// don't rotate for vertical text.
Size aSize( rOutliner.CalcTextSize() );
// swap width and height
- long tmp = aSize.Width();
+ tools::Long tmp = aSize.Width();
aSize.setWidth(aSize.Height());
aSize.setHeight(tmp);
bool bIsVertical( rOutliner.IsVertical() );
@@ -340,7 +340,7 @@ bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara,
{
Size aSize( rOutliner.CalcTextSize() );
// swap width and height
- long tmp = aSize.Width();
+ tools::Long tmp = aSize.Width();
aSize.setWidth(aSize.Height());
aSize.setHeight(tmp);
Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos,