summaryrefslogtreecommitdiff
path: root/vcl/source/edit
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-08-15 12:54:57 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-08-16 09:10:19 +0200
commit866e287adee448c1c8b431c6c084d3fe3283649d (patch)
tree53864635bcb2832c92834678a66b7090f1181147 /vcl/source/edit
parenta00c47afd4cf379ce2b22f3c33bb7975a5a6366a (diff)
sal_uLong to sal_uInt32 as TextPaM paragraph number
Applied also to related functions. Also fix a couple of minor issues while at it. Change-Id: I615094d047c87a0f4854054e720492d3ab25c575
Diffstat (limited to 'vcl/source/edit')
-rw-r--r--vcl/source/edit/textdat2.hxx8
-rw-r--r--vcl/source/edit/textdata.cxx6
-rw-r--r--vcl/source/edit/textdoc.cxx21
-rw-r--r--vcl/source/edit/textdoc.hxx2
-rw-r--r--vcl/source/edit/texteng.cxx134
-rw-r--r--vcl/source/edit/textund2.hxx12
-rw-r--r--vcl/source/edit/textundo.cxx10
-rw-r--r--vcl/source/edit/textview.cxx18
-rw-r--r--vcl/source/edit/vclmedit.cxx9
-rw-r--r--vcl/source/edit/xtextedt.cxx16
10 files changed, 116 insertions, 120 deletions
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx
index 6e57f9005d7e..f7d4fcea0ab2 100644
--- a/vcl/source/edit/textdat2.hxx
+++ b/vcl/source/edit/textdat2.hxx
@@ -216,10 +216,10 @@ public:
TEParaPortions() : mvData() {}
~TEParaPortions();
- size_t Count() const { return mvData.size(); }
- TEParaPortion* GetObject( size_t nIndex ) { return mvData[nIndex]; }
- void Insert( TEParaPortion* pObject, size_t nPos ) { mvData.insert( mvData.begin()+nPos, pObject ); }
- void Remove( size_t nPos ) { mvData.erase( mvData.begin()+nPos ); }
+ sal_uInt32 Count() const { return static_cast<sal_uInt32>(mvData.size()); }
+ TEParaPortion* GetObject( sal_uInt32 nIndex ) { return mvData[nIndex]; }
+ void Insert( TEParaPortion* pObject, sal_uInt32 nPos ) { mvData.insert( mvData.begin()+nPos, pObject ); }
+ void Remove( sal_uInt32 nPos ) { mvData.erase( mvData.begin()+nPos ); }
};
class TextSelFunctionSet: public FunctionSet
diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index fe95af59c754..19adc7d4cfca 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -260,14 +260,12 @@ void IdleFormatter::ForceTimeout()
}
}
-TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uInt32 Id ) : SfxSimpleHint( Id ), mnValue(0)
{
- mnValue = 0;
}
-TextHint::TextHint( sal_uLong Id, sal_uLong nValue ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uInt32 Id, sal_uLong nValue ) : SfxSimpleHint( Id ), mnValue(nValue)
{
- mnValue = nValue;
}
TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const OUString& rOldTextAfterStartPos )
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index f3d2cd19f9d0..d13c5f91a12d 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -422,18 +422,18 @@ void TextDoc::Clear()
void TextDoc::DestroyTextNodes()
{
- for ( sal_uLong nNode = 0; nNode < maTextNodes.size(); nNode++ )
- delete maTextNodes[ nNode ];
+ for ( auto pNode : maTextNodes )
+ delete pNode;
maTextNodes.clear();
}
OUString TextDoc::GetText( const sal_Unicode* pSep ) const
{
- sal_uLong nNodes = maTextNodes.size();
+ sal_uInt32 nNodes = static_cast<sal_uInt32>(maTextNodes.size());
OUString aASCIIText;
- sal_uLong nLastNode = nNodes-1;
- for ( sal_uLong nNode = 0; nNode < nNodes; nNode++ )
+ const sal_uInt32 nLastNode = nNodes-1;
+ for ( sal_uInt32 nNode = 0; nNode < nNodes; ++nNode )
{
TextNode* pNode = maTextNodes[ nNode ];
OUString aTmp( pNode->GetText() );
@@ -445,7 +445,7 @@ OUString TextDoc::GetText( const sal_Unicode* pSep ) const
return aASCIIText;
}
-OUString TextDoc::GetText( sal_uLong nPara ) const
+OUString TextDoc::GetText( sal_uInt32 nPara ) const
{
OUString aText;
@@ -459,18 +459,18 @@ OUString TextDoc::GetText( sal_uLong nPara ) const
sal_uLong TextDoc::GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel ) const
{
sal_uLong nLen = 0;
- sal_uLong nNodes = maTextNodes.size();
+ sal_uInt32 nNodes = static_cast<sal_uInt32>(maTextNodes.size());
if ( nNodes )
{
- sal_uLong nStartNode = 0;
- sal_uLong nEndNode = nNodes-1;
+ sal_uInt32 nStartNode = 0;
+ sal_uInt32 nEndNode = nNodes-1;
if ( pSel )
{
nStartNode = pSel->GetStart().GetPara();
nEndNode = pSel->GetEnd().GetPara();
}
- for ( sal_uLong nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_uInt32 nNode = nStartNode; nNode <= nEndNode; ++nNode )
{
TextNode* pNode = maTextNodes[ nNode ];
@@ -520,6 +520,7 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, bool bKeepEndingAttribs )
TextNode* pNode = maTextNodes[ rPaM.GetPara() ];
TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs );
+ DBG_ASSERT( maTextNodes.size()<SAL_MAX_UINT32, "InsertParaBreak: more than 4Gi paragraphs!" );
maTextNodes.insert( maTextNodes.begin() + rPaM.GetPara() + 1, pNew );
TextPaM aPaM( rPaM.GetPara()+1, 0 );
diff --git a/vcl/source/edit/textdoc.hxx b/vcl/source/edit/textdoc.hxx
index 1efecf9fb425..25095b1d096b 100644
--- a/vcl/source/edit/textdoc.hxx
+++ b/vcl/source/edit/textdoc.hxx
@@ -115,7 +115,7 @@ public:
sal_uLong GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
OUString GetText( const sal_Unicode* pSep ) const;
- OUString GetText( sal_uLong nPara ) const;
+ OUString GetText( sal_uInt32 nPara ) const;
void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; }
sal_uInt16 GetLeftMargin() const { return mnLeftMargin; }
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index f964d16cd7bd..ef5455cd2983 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -261,9 +261,9 @@ OUString TextEngine::GetText( LineEnd aSeparator ) const
OUString TextEngine::GetTextLines( LineEnd aSeparator ) const
{
OUString aText;
- sal_uLong nParas = mpTEParaPortions->Count();
+ const sal_uInt32 nParas = mpTEParaPortions->Count();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( sal_uLong nP = 0; nP < nParas; nP++ )
+ for ( sal_uInt32 nP = 0; nP < nParas; ++nP )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP );
@@ -279,7 +279,7 @@ OUString TextEngine::GetTextLines( LineEnd aSeparator ) const
return aText;
}
-OUString TextEngine::GetText( sal_uLong nPara ) const
+OUString TextEngine::GetText( sal_uInt32 nPara ) const
{
return mpDoc->GetText( nPara );
}
@@ -297,7 +297,7 @@ sal_uLong TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel );
}
-sal_Int32 TextEngine::GetTextLen( sal_uLong nPara ) const
+sal_Int32 TextEngine::GetTextLen( const sal_uInt32 nPara ) const
{
return mpDoc->GetNodes()[ nPara ]->GetText().getLength();
}
@@ -386,7 +386,7 @@ void TextEngine::ImpInitDoc()
mpDoc->GetNodes().insert( mpDoc->GetNodes().begin(), pNode );
TEParaPortion* pIniPortion = new TEParaPortion( pNode );
- mpTEParaPortions->Insert( pIniPortion, (sal_uLong)0 );
+ mpTEParaPortions->Insert( pIniPortion, 0 );
mbFormatted = false;
@@ -404,10 +404,10 @@ OUString TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) co
TextSelection aSel( rSel );
aSel.Justify();
- sal_uLong nStartPara = aSel.GetStart().GetPara();
- sal_uLong nEndPara = aSel.GetEnd().GetPara();
+ const sal_uInt32 nStartPara = aSel.GetStart().GetPara();
+ const sal_uInt32 nEndPara = aSel.GetEnd().GetPara();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( sal_uLong nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
+ for ( sal_uInt32 nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; ++nNode )
{
TextNode* pNode = mpDoc->GetNodes()[ nNode ];
@@ -429,8 +429,7 @@ void TextEngine::ImpRemoveText()
{
ImpInitDoc();
- TextPaM aStartPaM( 0, 0 );
- TextSelection aEmptySel( aStartPaM, aStartPaM );
+ const TextSelection aEmptySel;
for ( size_t nView = 0; nView < mpViews->size(); nView++ )
{
TextView* pView = (*mpViews)[ nView ];
@@ -447,10 +446,9 @@ void TextEngine::SetText( const OUString& rText )
// the manually inserted text cannot be reversed by the user
EnableUndo( false );
- TextPaM aStartPaM( 0, 0 );
- TextSelection aEmptySel( aStartPaM, aStartPaM );
+ const TextSelection aEmptySel;
- TextPaM aPaM = aStartPaM;
+ TextPaM aPaM;
if ( !rText.isEmpty() )
aPaM = ImpInsertText( aEmptySel, rText );
@@ -473,7 +471,7 @@ void TextEngine::SetText( const OUString& rText )
DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "SetText: Undo!" );
}
-void TextEngine::CursorMoved( sal_uLong nNode )
+void TextEngine::CursorMoved( sal_uInt32 nNode )
{
// delete empty attribute; but only if paragraph is not empty!
TextNode* pNode = mpDoc->GetNodes()[ nNode ];
@@ -508,7 +506,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_Int32 nChars, SfxUndoA
ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars );
}
-TextPaM TextEngine::ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight )
+TextPaM TextEngine::ImpConnectParagraphs( sal_uInt32 nLeft, sal_uInt32 nRight )
{
DBG_ASSERT( nLeft != nRight, "ImpConnectParagraphs: connect the very same paragraph ?" );
@@ -552,11 +550,11 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "ImpDeleteText(1): bad Index" );
DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "ImpDeleteText(2): bad Index" );
- sal_uLong nStartNode = aStartPaM.GetPara();
- sal_uLong nEndNode = aEndPaM.GetPara();
+ const sal_uInt32 nStartNode = aStartPaM.GetPara();
+ sal_uInt32 nEndNode = aEndPaM.GetPara();
// remove all Nodes inbetween
- for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ )
+ for ( sal_uInt32 z = nStartNode+1; z < nEndNode; ++z )
{
// always nStartNode+1, because of Remove()!
ImpRemoveParagraph( nStartNode+1 );
@@ -605,7 +603,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
return aStartPaM;
}
-void TextEngine::ImpRemoveParagraph( sal_uLong nPara )
+void TextEngine::ImpRemoveParagraph( sal_uInt32 nPara )
{
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
std::unique_ptr<TEParaPortion> xPortion(mpTEParaPortions->GetObject( nPara ));
@@ -863,7 +861,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, bool bSpecial )
}
else
{
- for ( sal_uLong nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
+ for ( sal_uInt32 nPortion = 0; nPortion < rPaM.GetPara(); ++nPortion )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion);
nY += pPortion->GetLines().size() * mnCharHeight;
@@ -929,7 +927,7 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, bool bSpecial, bool bP
return aEditCursor;
}
-long TextEngine::ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart )
+long TextEngine::ImpGetXPos( sal_uInt32 nPara, TextLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart )
{
DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "ImpGetXPos: Bad parameters!" );
@@ -1031,7 +1029,7 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt1
bool TextEngine::HasAttrib( sal_uInt16 nWhich ) const
{
bool bAttr = false;
- for ( sal_uLong n = mpDoc->GetNodes().size(); --n && !bAttr; )
+ for ( auto n = mpDoc->GetNodes().size(); --n && !bAttr; )
{
TextNode* pNode = mpDoc->GetNodes()[ n ];
bAttr = pNode->GetCharAttribs().HasAttrib( nWhich );
@@ -1044,7 +1042,7 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, bool bSmart )
DBG_ASSERT( GetUpdateMode(), "GetPaM: GetUpdateMode()" );
long nY = 0;
- for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uInt32 nPortion = 0; nPortion < mpTEParaPortions->Count(); ++nPortion )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
long nTmpHeight = pPortion->GetLines().size() * mnCharHeight;
@@ -1062,12 +1060,12 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, bool bSmart )
}
// not found - go to last visible
- sal_uLong nLastNode = mpDoc->GetNodes().size() - 1;
+ const sal_uInt32 nLastNode = static_cast<sal_uInt32>(mpDoc->GetNodes().size() - 1);
TextNode* pLast = mpDoc->GetNodes()[ nLastNode ];
return TextPaM( nLastNode, pLast->GetText().getLength() );
}
-sal_Int32 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, bool bSmart )
+sal_Int32 TextEngine::ImpFindIndex( sal_uInt32 nPortion, const Point& rPosInPara, bool bSmart )
{
DBG_ASSERT( IsFormatted(), "GetPaM: Not formatted" );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
@@ -1102,7 +1100,7 @@ sal_Int32 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara,
return nCurIndex;
}
-sal_Int32 TextEngine::GetCharPos( sal_uLong nPortion, sal_uInt16 nLine, long nXPos, bool )
+sal_Int32 TextEngine::GetCharPos( sal_uInt32 nPortion, sal_uInt16 nLine, long nXPos, bool )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
@@ -1151,7 +1149,7 @@ sal_uLong TextEngine::GetTextHeight() const
return mnCurTextHeight;
}
-sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const
+sal_uLong TextEngine::GetTextHeight( sal_uInt32 nParagraph ) const
{
DBG_ASSERT( GetUpdateMode(), "GetTextHeight: GetUpdateMode()" );
@@ -1161,7 +1159,7 @@ sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const
return CalcParaHeight( nParagraph );
}
-sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara )
+sal_uLong TextEngine::CalcTextWidth( sal_uInt32 nPara )
{
sal_uLong nParaWidth = 0;
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
@@ -1188,7 +1186,7 @@ sal_uLong TextEngine::CalcTextWidth()
if ( mnCurTextWidth == 0xFFFFFFFF )
{
mnCurTextWidth = 0;
- for ( sal_uLong nPara = mpTEParaPortions->Count(); nPara; )
+ for ( sal_uInt32 nPara = mpTEParaPortions->Count(); nPara; )
{
sal_uLong nParaWidth = CalcTextWidth( --nPara );
if ( nParaWidth > mnCurTextWidth )
@@ -1203,12 +1201,12 @@ sal_uLong TextEngine::CalcTextHeight()
DBG_ASSERT( GetUpdateMode(), "CalcTextHeight: GetUpdateMode()" );
sal_uLong nY = 0;
- for ( sal_uLong nPortion = mpTEParaPortions->Count(); nPortion; )
+ for ( auto nPortion = mpTEParaPortions->Count(); nPortion; )
nY += CalcParaHeight( --nPortion );
return nY;
}
-sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara, sal_Int32 nPortionStart, sal_Int32 nLen, const vcl::Font* pFont )
+sal_uLong TextEngine::CalcTextWidth( sal_uInt32 nPara, sal_Int32 nPortionStart, sal_Int32 nLen, const vcl::Font* pFont )
{
#ifdef DBG_UTIL
// within the text there must not be a Portion change (attribute/tab)!
@@ -1241,7 +1239,7 @@ sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara, sal_Int32 nPortionStart, s
return nWidth;
}
-sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const
+sal_uInt16 TextEngine::GetLineCount( sal_uInt32 nParagraph ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1252,7 +1250,7 @@ sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const
return 0;
}
-sal_Int32 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const
+sal_Int32 TextEngine::GetLineLen( sal_uInt32 nParagraph, sal_uInt16 nLine ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1265,7 +1263,7 @@ sal_Int32 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const
return 0;
}
-sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const
+sal_uLong TextEngine::CalcParaHeight( sal_uInt32 nParagraph ) const
{
sal_uLong nHeight = 0;
@@ -1277,7 +1275,7 @@ sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const
return nHeight;
}
-Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion )
+Range TextEngine::GetInvalidYOffsets( sal_uInt32 nPortion )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
sal_uInt16 nLines = pTEParaPortion->GetLines().size();
@@ -1354,7 +1352,7 @@ void TextEngine::ResetUndo()
mpUndoManager->Clear();
}
-void TextEngine::InsertContent( TextNode* pNode, sal_uLong nPara )
+void TextEngine::InsertContent( TextNode* pNode, sal_uInt32 nPara )
{
DBG_ASSERT( pNode, "InsertContent: NULL-Pointer!" );
DBG_ASSERT( IsInUndo(), "InsertContent: only in Undo()!" );
@@ -1364,7 +1362,7 @@ void TextEngine::InsertContent( TextNode* pNode, sal_uLong nPara )
ImpParagraphInserted( nPara );
}
-TextPaM TextEngine::SplitContent( sal_uLong nNode, sal_Int32 nSepPos )
+TextPaM TextEngine::SplitContent( sal_uInt32 nNode, sal_Int32 nSepPos )
{
#ifdef DBG_UTIL
TextNode* pNode = mpDoc->GetNodes()[ nNode ];
@@ -1376,13 +1374,13 @@ TextPaM TextEngine::SplitContent( sal_uLong nNode, sal_Int32 nSepPos )
return ImpInsertParaBreak( aPaM );
}
-TextPaM TextEngine::ConnectContents( sal_uLong nLeftNode )
+TextPaM TextEngine::ConnectContents( sal_uInt32 nLeftNode )
{
DBG_ASSERT( IsInUndo(), "ConnectContent: only in Undo()!" );
return ImpConnectParagraphs( nLeftNode, nLeftNode+1 );
}
-void TextEngine::SeekCursor( sal_uLong nPara, sal_Int32 nPos, vcl::Font& rFont, OutputDevice* pOutDev )
+void TextEngine::SeekCursor( sal_uInt32 nPara, sal_Int32 nPos, vcl::Font& rFont, OutputDevice* pOutDev )
{
rFont = maFont;
if ( pOutDev )
@@ -1520,7 +1518,7 @@ void TextEngine::CheckIdleFormatter()
void TextEngine::FormatFullDoc()
{
- for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uInt32 nPortion = 0; nPortion < mpTEParaPortions->Count(); ++nPortion )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
sal_Int32 nLen = pTEParaPortion->GetNode()->GetText().getLength();
@@ -1542,7 +1540,7 @@ void TextEngine::FormatDoc()
bool bGrow = false;
maInvalidRect = Rectangle(); // clear
- for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uInt32 nPara = 0; nPara < mpTEParaPortions->Count(); ++nPara )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
if ( pTEParaPortion->IsInvalid() )
@@ -1620,7 +1618,7 @@ void TextEngine::FormatDoc()
ImpTextFormatted();
}
-void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara )
+void TextEngine::CreateAndInsertEmptyLine( sal_uInt32 nPara )
{
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
@@ -1652,7 +1650,7 @@ void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara )
}
}
-void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*, sal_Int32 nPortionStart, long nRemainingWidth )
+void TextEngine::ImpBreakLine( sal_uInt32 nPara, TextLine* pLine, TETextPortion*, sal_Int32 nPortionStart, long nRemainingWidth )
{
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
@@ -1702,7 +1700,7 @@ void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*,
pLine->SetEndPortion( nEndPortion );
}
-sal_uInt16 TextEngine::SplitTextPortion( sal_uLong nPara, sal_Int32 nPos )
+sal_uInt16 TextEngine::SplitTextPortion( sal_uInt32 nPara, sal_Int32 nPos )
{
// the Portion at nPos is being split, unless there is already a switch at nPos
@@ -1738,7 +1736,7 @@ sal_uInt16 TextEngine::SplitTextPortion( sal_uLong nPara, sal_Int32 nPos )
return nSplitPortion;
}
-void TextEngine::CreateTextPortions( sal_uLong nPara, sal_Int32 nStartPos )
+void TextEngine::CreateTextPortions( sal_uInt32 nPara, sal_Int32 nStartPos )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
TextNode* pNode = pTEParaPortion->GetNode();
@@ -1831,7 +1829,7 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_Int32 nStartPos )
OSL_ENSURE(pTEParaPortion->GetTextPortions().size(), "CreateTextPortions: No Portions?!");
}
-void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_Int32 nStartPos, sal_Int32 nNewChars )
+void TextEngine::RecalcTextPortion( sal_uInt32 nPara, sal_Int32 nStartPos, sal_Int32 nNewChars )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
OSL_ENSURE(pTEParaPortion->GetTextPortions().size(), "RecalcTextPortion: no Portions!");
@@ -1942,7 +1940,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
// for all paragraphs
- for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uInt32 nPara = 0; nPara < mpTEParaPortions->Count(); ++nPara )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
// in case while typing Idle-Formatting, asynchronous Paint
@@ -2120,7 +2118,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
-bool TextEngine::CreateLines( sal_uLong nPara )
+bool TextEngine::CreateLines( sal_uInt32 nPara )
{
// bool: changing Height of Paragraph Yes/No - true/false
@@ -2467,7 +2465,7 @@ bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = *pSel;
else
{
- sal_uLong nParas = mpDoc->GetNodes().size();
+ sal_uInt32 nParas = static_cast<sal_uInt32>(mpDoc->GetNodes().size());
TextNode* pNode = mpDoc->GetNodes()[ nParas - 1 ];
aSel = TextPaM( nParas-1 , pNode->GetText().getLength() );
}
@@ -2508,7 +2506,7 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML
aSel = *pSel;
else
{
- sal_uLong nParas = mpDoc->GetNodes().size();
+ sal_uInt32 nParas = static_cast<sal_uInt32>(mpDoc->GetNodes().size());
TextNode* pNode = mpDoc->GetNodes()[ nParas - 1 ];
aSel.GetStart() = TextPaM( 0, 0 );
aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().getLength() );
@@ -2520,7 +2518,7 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML
rOutput.WriteLine( "<BODY>" );
}
- for ( sal_uLong nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
+ for ( sal_uInt32 nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); ++nPara )
{
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
@@ -2587,7 +2585,7 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML
return rOutput.GetError() == 0;
}
-void TextEngine::RemoveAttribs( sal_uLong nPara, bool bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uInt32 nPara, bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().size() )
{
@@ -2608,7 +2606,7 @@ void TextEngine::RemoveAttribs( sal_uLong nPara, bool bIdleFormatAndUpdate )
}
}
}
-void TextEngine::RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, bool bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uInt32 nPara, sal_uInt16 nWhich, bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().size() )
{
@@ -2632,7 +2630,7 @@ void TextEngine::RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, bool bIdleFo
}
}
}
-void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib )
+void TextEngine::RemoveAttrib( sal_uInt32 nPara, const TextCharAttrib& rAttrib )
{
if ( nPara < mpDoc->GetNodes().size() )
{
@@ -2657,7 +2655,7 @@ void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib )
}
}
-void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate )
+void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate )
{
// For now do not check if Attributes overlap!
@@ -2705,10 +2703,10 @@ void TextEngine::ValidateSelection( TextSelection& rSel ) const
void TextEngine::ValidatePaM( TextPaM& rPaM ) const
{
- sal_uLong nMaxPara = mpDoc->GetNodes().size() - 1;
- if ( rPaM.GetPara() > nMaxPara )
+ const sal_uInt32 nParas = static_cast<sal_uInt32>(mpDoc->GetNodes().size());
+ if ( rPaM.GetPara() >= nParas )
{
- rPaM.GetPara() = nMaxPara;
+ rPaM.GetPara() = nParas ? nParas-1 : 0;
rPaM.GetIndex() = 0xFFFF;
}
@@ -2719,7 +2717,7 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const
// adjust State & Selection
-void TextEngine::ImpParagraphInserted( sal_uLong nPara )
+void TextEngine::ImpParagraphInserted( sal_uInt32 nPara )
{
// No adjustment needed for the active View;
// but for all passive Views the Selection needs adjusting.
@@ -2742,7 +2740,7 @@ void TextEngine::ImpParagraphInserted( sal_uLong nPara )
Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) );
}
-void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
+void TextEngine::ImpParagraphRemoved( sal_uInt32 nPara )
{
if ( mpViews->size() > 1 )
{
@@ -2751,7 +2749,7 @@ void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
TextView* pView = (*mpViews)[ --nView ];
if ( pView != GetActiveView() )
{
- sal_uLong nParas = mpDoc->GetNodes().size();
+ const sal_uInt32 nParas = static_cast<sal_uInt32>(mpDoc->GetNodes().size());
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2770,7 +2768,7 @@ void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) );
}
-void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nChars )
+void TextEngine::ImpCharsRemoved( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32 nChars )
{
if ( mpViews->size() > 1 )
{
@@ -2797,7 +2795,7 @@ void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nCh
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nChars )
+void TextEngine::ImpCharsInserted( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32 nChars )
{
if ( mpViews->size() > 1 )
{
@@ -2821,7 +2819,7 @@ void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nC
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpFormattingParagraph( sal_uLong nPara )
+void TextEngine::ImpFormattingParagraph( sal_uInt32 nPara )
{
Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) );
}
@@ -2889,7 +2887,7 @@ void TextEngine::SetRightToLeft( bool bR2L )
}
}
-void TextEngine::ImpInitWritingDirections( sal_uLong nPara )
+void TextEngine::ImpInitWritingDirections( sal_uInt32 nPara )
{
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
std::vector<TEWritingDirectionInfo>& rInfos = pParaPortion->GetWritingDirectionInfos();
@@ -2931,7 +2929,7 @@ void TextEngine::ImpInitWritingDirections( sal_uLong nPara )
}
-sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uLong nPara, sal_Int32 nPos, sal_Int32* pStart, sal_Int32* pEnd )
+sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uInt32 nPara, sal_Int32 nPos, sal_Int32* pStart, sal_Int32* pEnd )
{
sal_uInt8 nRightToLeft = 0;
@@ -2959,7 +2957,7 @@ sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uLong nPara, sal_Int32 nPos, sal_In
return nRightToLeft;
}
-long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion )
+long TextEngine::ImpGetPortionXOffset( sal_uInt32 nPara, TextLine* pLine, sal_uInt16 nTextPortion )
{
long nX = pLine->GetStartX();
@@ -3053,7 +3051,7 @@ TxtAlign TextEngine::ImpGetAlign() const
return eAlign;
}
-long TextEngine::ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_Int32 nIndex, sal_Int32 nIndex2 )
+long TextEngine::ImpGetOutputOffset( sal_uInt32 nPara, TextLine* pLine, sal_Int32 nIndex, sal_Int32 nIndex2 )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
diff --git a/vcl/source/edit/textund2.hxx b/vcl/source/edit/textund2.hxx
index fc33c27da396..3b8a10465589 100644
--- a/vcl/source/edit/textund2.hxx
+++ b/vcl/source/edit/textund2.hxx
@@ -26,12 +26,12 @@ class TextUndoDelPara : public TextUndo
{
private:
bool mbDelObject;
- sal_uLong mnPara;
+ sal_uInt32 mnPara;
TextNode* mpNode; // points at the valid not-destroyed object
public:
TYPEINFO_OVERRIDE();
- TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
+ TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uInt32 nPara );
virtual ~TextUndoDelPara();
virtual void Undo() SAL_OVERRIDE;
@@ -43,12 +43,12 @@ public:
class TextUndoConnectParas : public TextUndo
{
private:
- sal_uLong mnPara;
+ sal_uInt32 mnPara;
sal_Int32 mnSepPos;
public:
TYPEINFO_OVERRIDE();
- TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_Int32 nSepPos );
+ TextUndoConnectParas( TextEngine* pTextEngine, sal_uInt32 nPara, sal_Int32 nSepPos );
virtual ~TextUndoConnectParas();
virtual void Undo() SAL_OVERRIDE;
@@ -60,12 +60,12 @@ public:
class TextUndoSplitPara : public TextUndo
{
private:
- sal_uLong mnPara;
+ sal_uInt32 mnPara;
sal_Int32 mnSepPos;
public:
TYPEINFO_OVERRIDE();
- TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_Int32 nSepPos );
+ TextUndoSplitPara( TextEngine* pTextEngine, sal_uInt32 nPara, sal_Int32 nSepPos );
virtual ~TextUndoSplitPara();
virtual void Undo() SAL_OVERRIDE;
diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx
index 41391ac4bd86..d47ff8f67ca8 100644
--- a/vcl/source/edit/textundo.cxx
+++ b/vcl/source/edit/textundo.cxx
@@ -142,7 +142,7 @@ void TextUndo::SetSelection( const TextSelection& rSel )
GetView()->ImpSetSelection( rSel );
}
-TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara )
+TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uInt32 nPara )
: TextUndo( pTextEngine )
{
mpNode = pNode;
@@ -182,8 +182,8 @@ void TextUndoDelPara::Redo()
mbDelObject = true; // belongs again to the Undo
- sal_uLong nParas = GetDoc()->GetNodes().size();
- sal_uLong n = mnPara < nParas ? mnPara : (nParas-1);
+ const sal_uInt32 nParas = static_cast<sal_uInt32>(GetDoc()->GetNodes().size());
+ const sal_uInt32 n = mnPara < nParas ? mnPara : nParas-1;
TextNode* pN = GetDoc()->GetNodes()[ n ];
TextPaM aPaM( n, pN->GetText().getLength() );
SetSelection( aPaM );
@@ -194,7 +194,7 @@ OUString TextUndoDelPara::GetComment () const
return ResId(STR_TEXTUNDO_DELPARA, *ImplGetResMgr());
}
-TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_Int32 nPos )
+TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uInt32 nPara, sal_Int32 nPos )
: TextUndo( pTextEngine )
{
mnPara = nPara;
@@ -222,7 +222,7 @@ OUString TextUndoConnectParas::GetComment () const
return ResId(STR_TEXTUNDO_CONNECTPARAS, *ImplGetResMgr()).toString();
}
-TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_Int32 nPos )
+TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uInt32 nPara, sal_Int32 nPos )
: TextUndo( pTextEngine )
{
mnPara = nPara;
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index fb28c7d2a8e8..c526ffe5759f 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -401,9 +401,9 @@ void TextView::ImpHighlight( const TextSelection& rSel )
Rectangle aVisArea( mpImpl->maStartDocPos, mpImpl->mpWindow->GetOutputSizePixel() );
long nY = 0;
- sal_uLong nStartPara = aSel.GetStart().GetPara();
- sal_uLong nEndPara = aSel.GetEnd().GetPara();
- for ( sal_uLong nPara = 0; nPara <= nEndPara; nPara++ )
+ const sal_uInt32 nStartPara = aSel.GetStart().GetPara();
+ const sal_uInt32 nEndPara = aSel.GetEnd().GetPara();
+ for ( sal_uInt32 nPara = 0; nPara <= nEndPara; ++nPara )
{
long nParaHeight = (long)mpImpl->mpTextEngine->CalcParaHeight( nPara );
if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) )
@@ -685,11 +685,11 @@ bool TextView::KeyInput( const KeyEvent& rKeyEvent )
//expand selection to include all protected content - if there is any
const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(mpImpl->maSelection.GetStart().GetPara(),
- mpImpl->maSelection.GetStart().GetIndex()),
+ mpImpl->maSelection.GetStart().GetIndex()),
TEXTATTR_PROTECTED );
const TextCharAttrib* pEndAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(mpImpl->maSelection.GetEnd().GetPara(),
- mpImpl->maSelection.GetEnd().GetIndex()),
+ mpImpl->maSelection.GetEnd().GetIndex()),
TEXTATTR_PROTECTED );
if(pStartAttr && pStartAttr->GetStart() < mpImpl->maSelection.GetStart().GetIndex())
{
@@ -1634,7 +1634,7 @@ TextPaM TextView::CursorStartOfDoc()
TextPaM TextView::CursorEndOfDoc()
{
- sal_uLong nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().size() - 1;
+ const sal_uInt32 nNode = static_cast<sal_uInt32>(mpImpl->mpTextEngine->mpDoc->GetNodes().size() - 1);
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes()[ nNode ];
TextPaM aPaM( nNode, pNode->GetText().getLength() );
return aPaM;
@@ -1854,9 +1854,9 @@ bool TextView::IsInSelection( const TextPaM& rPaM )
TextSelection aSel = mpImpl->maSelection;
aSel.Justify();
- sal_uLong nStartNode = aSel.GetStart().GetPara();
- sal_uLong nEndNode = aSel.GetEnd().GetPara();
- sal_uLong nCurNode = rPaM.GetPara();
+ const sal_uInt32 nStartNode = aSel.GetStart().GetPara();
+ const sal_uInt32 nEndNode = aSel.GetEnd().GetPara();
+ const sal_uInt32 nCurNode = rPaM.GetPara();
if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
return true;
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index f4b87780f1f8..6e18ae4883e1 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -580,8 +580,8 @@ void ImpVclMEdit::SetSelection( const Selection& rSelection )
long nEnd = std::max( aNewSelection.Min(), aNewSelection.Max() );
TextSelection aTextSel;
- sal_uLong nPara = 0;
- sal_uInt16 nChar = 0;
+ sal_uInt32 nPara = 0;
+ sal_Int32 nChar = 0;
sal_uInt16 x = 0;
while ( x <= nEnd )
{
@@ -611,8 +611,7 @@ const Selection& ImpVclMEdit::GetSelection() const
ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
// paragraphs before
- sal_uLong n;
- for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ )
+ for ( sal_uInt32 n = 0; n < aTextSel.GetStart().GetPara(); ++n )
{
maSelection.Min() += pExtTextEngine->GetTextLen( n );
maSelection.Min()++;
@@ -622,7 +621,7 @@ const Selection& ImpVclMEdit::GetSelection() const
maSelection.Max() = maSelection.Min();
maSelection.Min() += aTextSel.GetStart().GetIndex();
- for ( n = aTextSel.GetStart().GetPara(); n < aTextSel.GetEnd().GetPara(); n++ )
+ for ( sal_uInt32 n = aTextSel.GetStart().GetPara(); n < aTextSel.GetEnd().GetPara(); ++n )
{
maSelection.Max() += pExtTextEngine->GetTextLen( n );
maSelection.Max()++;
diff --git a/vcl/source/edit/xtextedt.cxx b/vcl/source/edit/xtextedt.cxx
index 222cbe4ff00a..8abe3438f06b 100644
--- a/vcl/source/edit/xtextedt.cxx
+++ b/vcl/source/edit/xtextedt.cxx
@@ -38,8 +38,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
{
TextSelection aSel( rCursor );
const sal_Int32 nPos = rCursor.GetIndex();
- sal_uLong nPara = rCursor.GetPara();
- sal_uLong nParas = GetParagraphCount();
+ sal_uInt32 nPara = rCursor.GetPara();
+ const sal_uInt32 nParas = GetParagraphCount();
if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) )
{
sal_Int32 nMatchIndex = maGroupChars.indexOf( GetText( rCursor.GetPara() )[ nPos ] );
@@ -147,21 +147,21 @@ bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
}
bool bFound = false;
- sal_uLong nStartNode, nEndNode;
+ sal_uInt32 nEndNode;
if ( bSearchInSelection )
nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara();
else
nEndNode = bForward ? (GetParagraphCount()-1) : 0;
- nStartNode = aStartPaM.GetPara();
+ const sal_uInt32 nStartNode = aStartPaM.GetPara();
util::SearchOptions aOptions( rSearchOptions );
aOptions.Locale = Application::GetSettings().GetLanguageTag().getLocale();
utl::TextSearch aSearcher( rSearchOptions );
// iterate over the paragraphs
- for ( sal_uLong nNode = nStartNode;
+ for ( sal_uInt32 nNode = nStartNode;
bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
bForward ? nNode++ : nNode-- )
{
@@ -339,14 +339,14 @@ bool ExtTextView::ImpIndentBlock( bool bRight )
HideSelection();
GetTextEngine()->UndoActionStart();
- sal_uLong nStartPara = aSel.GetStart().GetPara();
- sal_uLong nEndPara = aSel.GetEnd().GetPara();
+ const sal_uInt32 nStartPara = aSel.GetStart().GetPara();
+ sal_uInt32 nEndPara = aSel.GetEnd().GetPara();
if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() )
{
nEndPara--; // do not indent
}
- for ( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for ( sal_uInt32 nPara = nStartPara; nPara <= nEndPara; ++nPara )
{
if ( bRight )
{