diff options
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 8 | ||||
-rw-r--r-- | include/vcl/txtattr.hxx | 50 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmaddressblockpage.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textdoc.cxx | 4 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 12 |
5 files changed, 38 insertions, 38 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 35203006c06f..d3590ec7d83b 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1473,8 +1473,8 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if(pErrorAttrLeft) { boost::scoped_ptr<TextAttrib> pNewError(pErrorAttrLeft->GetAttr().Clone()); - sal_uInt16 nStart = pErrorAttrLeft->GetStart(); - sal_uInt16 nEnd = pErrorAttrLeft->GetEnd(); + const sal_Int32 nStart = pErrorAttrLeft->GetStart(); + sal_Int32 nEnd = pErrorAttrLeft->GetEnd(); pTextEngine->RemoveAttrib( 0, *pErrorAttrLeft ); SetAttrib( *pNewError, 0, nStart, ++nEnd ); //only active errors move the mark @@ -1508,8 +1508,8 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if(pBackAttrLeft) { boost::scoped_ptr<TextAttrib> pNewBack(pBackAttrLeft->GetAttr().Clone()); - sal_uInt16 _nStart = pBackAttrLeft->GetStart(); - sal_uInt16 _nEnd = pBackAttrLeft->GetEnd(); + const sal_Int32 _nStart = pBackAttrLeft->GetStart(); + const sal_Int32 _nEnd = pBackAttrLeft->GetEnd(); pTextEngine->RemoveAttrib( 0, *pBackAttrLeft ); SetAttrib( *pNewBack, 0, _nStart, _nEnd - nAddedChars); } diff --git a/include/vcl/txtattr.hxx b/include/vcl/txtattr.hxx index 825f2ae54fe6..f82f52443fb4 100644 --- a/include/vcl/txtattr.hxx +++ b/include/vcl/txtattr.hxx @@ -139,14 +139,14 @@ class TextCharAttrib { private: TextAttrib* mpAttr; - sal_uInt16 mnStart; - sal_uInt16 mnEnd; + sal_Int32 mnStart; + sal_Int32 mnEnd; protected: public: - TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); + TextCharAttrib( const TextAttrib& rAttr, sal_Int32 nStart, sal_Int32 nEnd ); TextCharAttrib( const TextCharAttrib& rTextCharAttrib ); ~TextCharAttrib(); @@ -154,64 +154,64 @@ public: sal_uInt16 Which() const { return mpAttr->Which(); } - sal_uInt16 GetStart() const { return mnStart; } - sal_uInt16& GetStart() { return mnStart; } + sal_Int32 GetStart() const { return mnStart; } + sal_Int32& GetStart() { return mnStart; } - sal_uInt16 GetEnd() const { return mnEnd; } - sal_uInt16& GetEnd() { return mnEnd; } + sal_Int32 GetEnd() const { return mnEnd; } + sal_Int32& GetEnd() { return mnEnd; } - inline sal_uInt16 GetLen() const; + inline sal_Int32 GetLen() const; - inline void MoveForward( sal_uInt16 nDiff ); - inline void MoveBackward( sal_uInt16 nDiff ); + inline void MoveForward( sal_Int32 nDiff ); + inline void MoveBackward( sal_Int32 nDiff ); - inline void Expand( sal_uInt16 nDiff ); - inline void Collaps( sal_uInt16 nDiff ); + inline void Expand( sal_Int32 nDiff ); + inline void Collaps( sal_Int32 nDiff ); - inline bool IsIn( sal_uInt16 nIndex ); - inline bool IsInside( sal_uInt16 nIndex ); + inline bool IsIn( sal_Int32 nIndex ); + inline bool IsInside( sal_Int32 nIndex ); inline bool IsEmpty() const; }; -inline sal_uInt16 TextCharAttrib::GetLen() const +inline sal_Int32 TextCharAttrib::GetLen() const { DBG_ASSERT( mnEnd >= mnStart, "TextCharAttrib: nEnd < nStart!" ); return mnEnd-mnStart; } -inline void TextCharAttrib::MoveForward( sal_uInt16 nDiff ) +inline void TextCharAttrib::MoveForward( sal_Int32 nDiff ) { - DBG_ASSERT( ((long)mnEnd + nDiff) <= 0xFFFF, "TextCharAttrib: MoveForward?!" ); + DBG_ASSERT( nDiff <= SAL_MAX_INT32-mnEnd, "TextCharAttrib: MoveForward?!" ); mnStart = mnStart + nDiff; mnEnd = mnEnd + nDiff; } -inline void TextCharAttrib::MoveBackward( sal_uInt16 nDiff ) +inline void TextCharAttrib::MoveBackward( sal_Int32 nDiff ) { - DBG_ASSERT( ((long)mnStart - nDiff) >= 0, "TextCharAttrib: MoveBackward?!" ); + DBG_ASSERT( mnStart >= nDiff, "TextCharAttrib: MoveBackward?!" ); mnStart = mnStart - nDiff; mnEnd = mnEnd - nDiff; } -inline void TextCharAttrib::Expand( sal_uInt16 nDiff ) +inline void TextCharAttrib::Expand( sal_Int32 nDiff ) { - DBG_ASSERT( ( ((long)mnEnd + nDiff) <= (long)0xFFFF ), "TextCharAttrib: Expand?!" ); + DBG_ASSERT( nDiff <= SAL_MAX_INT32-mnEnd, "TextCharAttrib: Expand?!" ); mnEnd = mnEnd + nDiff; } -inline void TextCharAttrib::Collaps( sal_uInt16 nDiff ) +inline void TextCharAttrib::Collaps( sal_Int32 nDiff ) { - DBG_ASSERT( (long)mnEnd - nDiff >= (long)mnStart, "TextCharAttrib: Collaps?!" ); + DBG_ASSERT( mnEnd-mnStart >= nDiff, "TextCharAttrib: Collaps?!" ); mnEnd = mnEnd - nDiff; } -inline bool TextCharAttrib::IsIn( sal_uInt16 nIndex ) +inline bool TextCharAttrib::IsIn( sal_Int32 nIndex ) { return ( ( mnStart <= nIndex ) && ( mnEnd >= nIndex ) ); } -inline bool TextCharAttrib::IsInside( sal_uInt16 nIndex ) +inline bool TextCharAttrib::IsInside( sal_Int32 nIndex ) { return ( ( mnStart < nIndex ) && ( mnEnd > nIndex ) ); } diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 8773982b9a30..9b0b28414baa 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1506,7 +1506,7 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove) { //current item has been found sal_uLong nPara = rSelection.GetStart().GetPara(); - sal_uInt16 nIndex = pBeginAttrib->GetStart(); + sal_Int32 nIndex = pBeginAttrib->GetStart(); TextSelection aEntrySel(TextPaM( nPara, pBeginAttrib->GetStart()), TextPaM(nPara, pBeginAttrib->GetEnd())); const OUString sCurrentItem = pTextEngine->GetText(aEntrySel); pTextEngine->RemoveAttrib( nPara, *pBeginAttrib ); diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx index fe8d4857d737..a19202c20052 100644 --- a/vcl/source/edit/textdoc.cxx +++ b/vcl/source/edit/textdoc.cxx @@ -28,7 +28,7 @@ static bool CompareStart( const TextCharAttrib& pFirst, const TextCharAttrib& pS return pFirst.GetStart() < pSecond.GetStart(); } -TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) +TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_Int32 nStart, sal_Int32 nEnd ) { mpAttr = rAttr.Clone(); mnStart = nStart, @@ -67,7 +67,7 @@ void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib ) if ( pAttrib->IsEmpty() ) mbHasEmptyAttribs = true; - const sal_uInt16 nStart = pAttrib->GetStart(); // maybe better for Comp.Opt. + const sal_Int32 nStart = pAttrib->GetStart(); // maybe better for Comp.Opt. bool bInserted = false; for (TextCharAttribs::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it) { diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 6c907c09309c..f6ba3ba918f3 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1747,8 +1747,8 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos ) TextNode* pNode = pTEParaPortion->GetNode(); DBG_ASSERT( !pNode->GetText().isEmpty(), "CreateTextPortions: should not be used for empty paragraphs!" ); - std::set<sal_uInt16> aPositions; - std::set<sal_uInt16>::iterator aPositionsIt; + std::set<sal_Int32> aPositions; + std::set<sal_Int32>::iterator aPositionsIt; aPositions.insert(0); sal_uInt16 nAttribs = pNode->GetCharAttribs().Count(); @@ -1824,7 +1824,7 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos ) if ( aPositionsIt != aPositions.end() ) { - std::set<sal_uInt16>::iterator nextIt = aPositionsIt; + std::set<sal_Int32>::iterator nextIt = aPositionsIt; for ( ++nextIt; nextIt != aPositions.end(); ++aPositionsIt, ++nextIt ) { TETextPortion* pNew = new TETextPortion( *nextIt - *aPositionsIt ); @@ -2565,8 +2565,8 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML } else { - sal_uInt16 nTmpStart = nStartPos; - sal_uInt16 nTmpEnd = nEndPos; + sal_Int32 nTmpStart = nStartPos; + sal_Int32 nTmpEnd = nEndPos; do { const TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos ); @@ -2577,7 +2577,7 @@ bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, bool bHTML if ( pAttr ) { - nTmpEnd = std::min( pAttr->GetEnd(), (sal_uInt16) nEndPos ); + nTmpEnd = std::min( pAttr->GetEnd(), nEndPos ); // e.g. <A HREF="http://www.mopo.de/">Morgenpost</A> aText.append( "<A HREF=\"" ); |