From 1ca53fbe16203f72ef8311959f49da4defe265c1 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Thu, 13 Aug 2015 14:57:11 +0200 Subject: sal_uInt16 to sal_Int32 Change-Id: I920cf103a28132b0f8ed6748f9f743d1bf3db2d7 --- vcl/source/edit/textdat2.hxx | 20 ++++++++++---------- vcl/source/edit/textdata.cxx | 4 ++-- vcl/source/edit/texteng.cxx | 16 ++++++++-------- vcl/source/edit/textview.cxx | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'vcl') diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx index 499069103d6b..cf9372281621 100644 --- a/vcl/source/edit/textdat2.hxx +++ b/vcl/source/edit/textdat2.hxx @@ -96,8 +96,8 @@ struct TEWritingDirectionInfo class TextLine { private: - sal_uInt16 mnStart; - sal_uInt16 mnEnd; + sal_Int32 mnStart; + sal_Int32 mnEnd; sal_uInt16 mnStartPortion; sal_uInt16 mnEndPortion; @@ -113,16 +113,16 @@ public: mbInvalid = true; } - bool IsIn( sal_uInt16 nIndex, bool bInclEnd ) const + bool IsIn( sal_Int32 nIndex, bool bInclEnd ) const { return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); } - void SetStart( sal_uInt16 n ) { mnStart = n; } - sal_uInt16 GetStart() const { return mnStart; } - sal_uInt16& GetStart() { return mnStart; } + void SetStart( sal_Int32 n ) { mnStart = n; } + sal_Int32 GetStart() const { return mnStart; } + sal_Int32& GetStart() { return mnStart; } - void SetEnd( sal_uInt16 n ) { mnEnd = n; } - sal_uInt16 GetEnd() const { return mnEnd; } - sal_uInt16& GetEnd() { return mnEnd; } + void SetEnd( sal_Int32 n ) { mnEnd = n; } + sal_Int32 GetEnd() const { return mnEnd; } + sal_Int32& GetEnd() { return mnEnd; } void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; } sal_uInt16 GetStartPortion() const { return mnStartPortion; } @@ -132,7 +132,7 @@ public: sal_uInt16 GetEndPortion() const { return mnEndPortion; } sal_uInt16& GetEndPortion() { return mnEndPortion; } - sal_uInt16 GetLen() const { return mnEnd - mnStart; } + sal_Int32 GetLen() const { return mnEnd - mnStart; } bool IsInvalid() const { return mbInvalid; } bool IsValid() const { return !mbInvalid; } diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index 6e011432ca9a..6e24de93ee23 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -187,14 +187,14 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormat const TextLine& pLastFormatted = maLines[ nLastFormattedLine ]; const TextLine& pUnformatted = maLines[ nLastFormattedLine+1 ]; short nPortionDiff = pUnformatted.GetStartPortion() - pLastFormatted.GetEndPortion(); - short nTextDiff = pUnformatted.GetStart() - pLastFormatted.GetEnd(); + sal_Int32 nTextDiff = pUnformatted.GetStart() - pLastFormatted.GetEnd(); nTextDiff++; // LastFormatted.GetEnd() was inclusive => subtracted one too much! // The first unformatted one has to start exactly one portion past the last // formatted one. // If a portion got split in the changed row, nLastEnd could be > nNextStart! short nPDiff = sal::static_int_cast< short >(-( nPortionDiff-1 )); - short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 )); + const sal_Int32 nTDiff = -( nTextDiff-1 ); if ( nPDiff || nTDiff ) { for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 12f19fefc3f2..794cea47bfc4 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2212,7 +2212,7 @@ bool TextEngine::CreateLines( sal_uLong nPara ) size_t nDelFromLine = std::numeric_limits::max(); bool bLineBreak = false; - sal_uInt16 nIndex = pLine->GetStart(); + sal_Int32 nIndex = pLine->GetStart(); TextLine aSaveLine( *pLine ); vcl::Font aFont; @@ -2222,10 +2222,10 @@ bool TextEngine::CreateLines( sal_uLong nPara ) while ( nIndex < pNode->GetText().getLength() ) { bool bEOL = false; - sal_uInt16 nPortionStart = 0; - sal_uInt16 nPortionEnd = 0; + sal_Int32 nPortionStart = 0; + sal_Int32 nPortionEnd = 0; - sal_uInt16 nTmpPos = nIndex; + sal_Int32 nTmpPos = nIndex; sal_uInt16 nTmpPortion = pLine->GetStartPortion(); long nTmpWidth = mpDoc->GetLeftMargin(); // do not subtract margin; it is included in TmpWidth @@ -2270,7 +2270,7 @@ bool TextEngine::CreateLines( sal_uLong nPara ) pPortion->GetKind() = PORTIONKIND_TEXT; } - nTmpPos = nTmpPos + pPortion->GetLen(); + nTmpPos += pPortion->GetLen(); nPortionEnd = nTmpPos; nTmpPortion++; } @@ -2280,7 +2280,7 @@ bool TextEngine::CreateLines( sal_uLong nPara ) if ( nTmpWidth > nXWidth ) { nPortionEnd = nTmpPos; - nTmpPos = nTmpPos - pPortion->GetLen(); + nTmpPos -= pPortion->GetLen(); nPortionStart = nTmpPos; nTmpPortion--; bEOL = false; @@ -2359,8 +2359,8 @@ bool TextEngine::CreateLines( sal_uLong nPara ) } else { - sal_uInt16 nStart = pLine->GetStart(); - sal_uInt16 nEnd = pLine->GetEnd(); + const sal_Int32 nStart = pLine->GetStart(); + const sal_Int32 nEnd = pLine->GetEnd(); if ( nStart > nInvalidEnd ) { diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 6c650201e28d..8b8fca39ff85 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -1014,7 +1014,7 @@ void TextView::Command( const CommandEvent& rCEvt ) TextPaM aPaM( GetSelection().GetEnd() ); Rectangle aR1 = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM ); - sal_uInt16 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen; + sal_Int32 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen; if ( !mpImpl->mpTextEngine->IsFormatted() ) mpImpl->mpTextEngine->FormatDoc(); -- cgit