summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-08-01 15:20:42 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-08-01 19:33:21 +0200
commit7669cbf594b6bc1cc2731f2da6a0d17a0e9954fe (patch)
treea6470d4e292998c0fc07ef64151c187f51302c14
parent297b109e220249bc81738144555c33bf22796bac (diff)
sal_uInt16 to sal_Int32
Change-Id: Ic2af80d2335875672fee5b61083b1f7f9703dac7
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx6
-rw-r--r--cui/source/dialogs/SpellDialog.cxx10
-rw-r--r--include/vcl/texteng.hxx10
-rw-r--r--vcl/source/edit/texteng.cxx19
-rw-r--r--vcl/source/edit/textview.cxx4
5 files changed, 23 insertions, 26 deletions
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index c694a0bf4ae0..be6a97629eca 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1324,14 +1324,12 @@ void Document::changeParagraphAttributes(
if ( rAttributeSet[i].Name == "CharColor" )
m_rEngine.SetAttrib(::TextAttribFontColor(
mapFontColor(rAttributeSet[i].Value)),
- nNumber, static_cast< ::sal_uInt16 >(nBegin),
- static_cast< ::sal_uInt16 >(nEnd));
+ nNumber, nBegin, nEnd);
// XXX numeric overflow (2x)
else if ( rAttributeSet[i].Name == "CharWeight" )
m_rEngine.SetAttrib(::TextAttribFontWeight(
mapFontWeight(rAttributeSet[i].Value)),
- nNumber, static_cast< ::sal_uInt16 >(nBegin),
- static_cast< ::sal_uInt16 >(nEnd));
+ nNumber, nBegin, nEnd);
// XXX numeric overflow (2x)
}
}
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index d3590ec7d83b..631ab8c473dc 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1555,7 +1555,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, css::uno:
if (bIgnoreCurrentError)
m_aIgnoreErrorsAt.insert( m_nErrorStart );
ExtTextEngine* pTextEngine = GetTextEngine();
- sal_uInt16 nTextLen = pTextEngine->GetTextLen(0);
+ const sal_Int32 nTextLen = pTextEngine->GetTextLen(0);
if(m_nErrorEnd >= nTextLen - 1)
return false;
//if it's not already modified the modified flag has to be reset at the end of the marking
@@ -1681,20 +1681,20 @@ void SentenceEditWindow_Impl::ChangeMarkedWord(const OUString& rNewWord, Languag
const TextCharAttrib* pLangAttrib =
pTextEngine->FindCharAttrib(
TextPaM(0, m_nErrorEnd), TEXTATTR_SPELL_LANGUAGE );
- sal_uInt16 nTextLen = pTextEngine->GetTextLen( 0 );
+ const sal_Int32 nTextLen = pTextEngine->GetTextLen( 0 );
if(pLangAttrib && !pLangAttrib->GetStart() && pLangAttrib->GetEnd() ==
nTextLen)
{
SpellLanguageAttrib aNewLangAttrib( static_cast<const SpellLanguageAttrib&>(pLangAttrib->GetAttr()).GetLanguage());
pTextEngine->RemoveAttrib(0, *pLangAttrib);
- pTextEngine->SetAttrib( aNewLangAttrib, 0, (sal_uInt16)(m_nErrorEnd + nDiffLen) , nTextLen );
+ pTextEngine->SetAttrib( aNewLangAttrib, 0, m_nErrorEnd + nDiffLen, nTextLen );
}
}
// undo expanded attributes!
if( pBackAttrib && pBackAttrib->GetStart() < m_nErrorStart && pBackAttrib->GetEnd() == m_nErrorEnd + nDiffLen)
{
boost::scoped_ptr<TextAttrib> pNewBackground(pBackAttrib->GetAttr().Clone());
- sal_uInt16 nStart = pBackAttrib->GetStart();
+ const sal_Int32 nStart = pBackAttrib->GetStart();
pTextEngine->RemoveAttrib(0, *pBackAttrib);
pTextEngine->SetAttrib(*pNewBackground, 0, nStart, m_nErrorStart);
}
@@ -1826,7 +1826,7 @@ svx::SpellPortions SentenceEditWindow_Impl::CreateSpellPortions( bool bSetIgnore
{
svx::SpellPortions aRet;
ExtTextEngine* pTextEngine = GetTextEngine();
- const sal_uInt16 nTextLen = pTextEngine->GetTextLen(0);
+ const sal_Int32 nTextLen = pTextEngine->GetTextLen(0);
if(nTextLen)
{
TextPaM aCursor(0, 0);
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
index f64227b4bd23..17e07456503d 100644
--- a/include/vcl/texteng.hxx
+++ b/include/vcl/texteng.hxx
@@ -151,7 +151,7 @@ protected:
TextPaM ImpInsertText( const TextSelection& rSel, const OUString& rText );
TextPaM ImpInsertParaBreak( const TextSelection& rTextSelection, bool bKeepEndingAttribs = true );
TextPaM ImpInsertParaBreak( const TextPaM& rPaM, bool bKeepEndingAttribs = true );
- void ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* pCurUndo = 0 );
+ void ImpRemoveChars( const TextPaM& rPaM, sal_Int32 nChars, SfxUndoAction* pCurUndo = 0 );
TextPaM ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight );
void ImpRemoveParagraph( sal_uLong nPara );
void ImpInitWritingDirections( sal_uLong nPara );
@@ -168,8 +168,8 @@ protected:
// broadcast or adjust selections
void ImpParagraphInserted( sal_uLong nPara );
void ImpParagraphRemoved( sal_uLong nPara );
- void ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars );
- void ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars );
+ void ImpCharsRemoved( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nChars );
+ void ImpCharsInserted( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nChars );
void ImpFormattingParagraph( sal_uLong nPara );
void ImpTextHeightChanged();
void ImpTextFormatted();
@@ -263,7 +263,7 @@ public:
sal_uLong GetParagraphCount() const;
OUString GetText( sal_uLong nParagraph ) const;
- sal_uInt16 GetTextLen( sal_uLong nParagraph ) const;
+ sal_Int32 GetTextLen( sal_uLong nParagraph ) const;
sal_uLong GetTextHeight( sal_uLong nParagraph ) const;
sal_uInt16 GetLineCount( sal_uLong nParagraph ) const;
@@ -303,7 +303,7 @@ public:
void RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, bool bIdleFormatAndUpdate );
void RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib );
void RemoveAttribs( sal_uLong nPara, bool bIdleFormatAndUpdate = true );
- void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, bool bIdleFormatAndUpdate = true );
+ void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate = true );
TxtAlign GetTextAlign() const { return meAlign; }
void SetTextAlign( TxtAlign eAlign );
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index f6ba3ba918f3..83929a0def85 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -296,7 +296,7 @@ sal_uLong TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel );
}
-sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const
+sal_Int32 TextEngine::GetTextLen( sal_uLong nPara ) const
{
return mpDoc->GetNodes()[ nPara ]->GetText().getLength();
}
@@ -480,7 +480,7 @@ void TextEngine::CursorMoved( sal_uLong nNode )
pNode->GetCharAttribs().DeleteEmptyAttribs();
}
-void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* )
+void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_Int32 nChars, SfxUndoAction* )
{
DBG_ASSERT( nChars, "ImpRemoveChars: 0 Chars?!" );
if ( IsUndoEnabled() && !IsInUndo() )
@@ -592,8 +592,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
}
else
{
- sal_uInt16 nChars;
- nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex();
+ const sal_Int32 nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex();
ImpRemoveChars( aStartPaM, nChars );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode );
DBG_ASSERT( pPortion, "ImpDeleteText(5): bad Index" );
@@ -2677,7 +2676,7 @@ void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib )
}
}
-void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, bool bIdleFormatAndUpdate )
+void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate )
{
// For now do not check if Attributes overlap!
@@ -2690,7 +2689,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16
TextNode* pNode = mpDoc->GetNodes()[ nPara ];
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- sal_Int32 nMax = pNode->GetText().getLength();
+ const sal_Int32 nMax = pNode->GetText().getLength();
if ( nStart > nMax )
nStart = nMax;
if ( nEnd > nMax )
@@ -2732,7 +2731,7 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const
rPaM.GetIndex() = 0xFFFF;
}
- sal_uInt16 nMaxIndex = GetTextLen( rPaM.GetPara() );
+ const sal_Int32 nMaxIndex = GetTextLen( rPaM.GetPara() );
if ( rPaM.GetIndex() > nMaxIndex )
rPaM.GetIndex() = nMaxIndex;
}
@@ -2790,7 +2789,7 @@ void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) );
}
-void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
+void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nChars )
{
if ( mpViews->size() > 1 )
{
@@ -2799,7 +2798,7 @@ void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 n
TextView* pView = (*mpViews)[ --nView ];
if ( pView != GetActiveView() )
{
- sal_uInt16 nEnd = nPos+nChars;
+ const sal_Int32 nEnd = nPos + nChars;
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2817,7 +2816,7 @@ void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 n
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
+void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_Int32 nPos, sal_Int32 nChars )
{
if ( mpViews->size() > 1 )
{
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 7f9da0e855e8..affa0c88e4c2 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -2034,7 +2034,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
TextSelection aPrevSel( mpImpl->maSelection );
aPrevSel.Justify();
sal_uLong nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
- sal_uInt16 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
+ const sal_Int32 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
bool bStarterOfDD = false;
for ( sal_uInt16 nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
@@ -2091,7 +2091,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
if ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
{
- sal_uInt16 nNewChars =
+ const sal_Int32 nNewChars =
mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen;
aPrevSel.GetStart().GetIndex() =