diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-15 10:14:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-15 13:26:08 +0000 |
commit | 2e5ec4f5b6cf295c64598c4284f01814d218c489 (patch) | |
tree | 703704f70f86cc24bdc043ff8d16570bb3cb2f59 | |
parent | ba27366f3d6bc6b209ecd5c5cb79a9ee5315316a (diff) |
Related: #i17171# big xub_Strlen -> sal_Int32 changes
Change-Id: I31bce794c95062abfa1171c13cf565498688b5f3
74 files changed, 329 insertions, 361 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 053e6476912e..27b910eeb11f 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -234,35 +234,35 @@ public: private: OUString & m_rText; LanguageType m_eLang; - virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) + virtual sal_Bool Delete( sal_Int32 nStt, sal_Int32 nEnd ) { //fprintf(stderr, "TestAutoCorrDoc::Delete\n"); m_rText = m_rText.replaceAt(nStt, nEnd-nStt, ""); return true; } - virtual sal_Bool Insert( xub_StrLen nPos, const OUString& rTxt ) + virtual sal_Bool Insert( sal_Int32 nPos, const OUString& rTxt ) { //fprintf(stderr, "TestAutoCorrDoc::Insert\n"); m_rText = m_rText.replaceAt(nPos, 0, rTxt); return true; } - virtual sal_Bool Replace( xub_StrLen nPos, const OUString& rTxt ) + virtual sal_Bool Replace( sal_Int32 nPos, const OUString& rTxt ) { //fprintf(stderr, "TestAutoCorrDoc::Replace\n"); return ReplaceRange( nPos, rTxt.getLength(), rTxt ); } - virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const OUString& rTxt ) + virtual sal_Bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ) { //fprintf(stderr, "TestAutoCorrDoc::ReplaceRange %d %d %s\n", nPos, nLen, OUStringToOString(rTxt, RTL_TEXTENCODING_UTF8).getStr()); m_rText = m_rText.replaceAt(nPos, nLen, rTxt); return true; } - virtual sal_Bool SetAttr( xub_StrLen, xub_StrLen, sal_uInt16, SfxPoolItem& ) + virtual sal_Bool SetAttr( sal_Int32, sal_Int32, sal_uInt16, SfxPoolItem& ) { //fprintf(stderr, "TestAutoCorrDoc::SetAttr\n"); return true; } - virtual sal_Bool SetINetAttr( xub_StrLen, xub_StrLen, const OUString& ) + virtual sal_Bool SetINetAttr( sal_Int32, sal_Int32, const OUString& ) { //fprintf(stderr, "TestAutoCorrDoc::SetINetAttr\n"); return true; diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index b860af517aef..b05d481cc690 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -593,7 +593,7 @@ EdtAutoCorrDoc::~EdtAutoCorrDoc() mpEditEngine->UndoActionEnd( EDITUNDO_INSERT ); } -sal_Bool EdtAutoCorrDoc::Delete( sal_uInt16 nStt, sal_uInt16 nEnd ) +sal_Bool EdtAutoCorrDoc::Delete(sal_Int32 nStt, sal_Int32 nEnd) { EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) ); mpEditEngine->DeleteSelection(aSel); @@ -604,7 +604,7 @@ sal_Bool EdtAutoCorrDoc::Delete( sal_uInt16 nStt, sal_uInt16 nEnd ) return true; } -sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const OUString& rTxt ) +sal_Bool EdtAutoCorrDoc::Insert(sal_Int32 nPos, const OUString& rTxt) { EditSelection aSel = EditPaM( pCurNode, nPos ); mpEditEngine->InsertText(aSel, rTxt); @@ -619,12 +619,12 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const OUString& rTxt ) return true; } -sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const OUString& rTxt ) +sal_Bool EdtAutoCorrDoc::Replace(sal_Int32 nPos, const OUString& rTxt) { return ReplaceRange( nPos, rTxt.getLength(), rTxt ); } -sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const OUString& rTxt ) +sal_Bool EdtAutoCorrDoc::ReplaceRange(sal_Int32 nPos, sal_Int32 nSourceLength, const OUString& rTxt) { // Actually a Replace introduce => corresponds to UNDO sal_uInt16 nEnd = nPos+nSourceLength; @@ -647,8 +647,8 @@ sal_Bool EdtAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength return true; } -sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, - sal_uInt16 nSlotId, SfxPoolItem& rItem ) +sal_Bool EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd, + sal_uInt16 nSlotId, SfxPoolItem& rItem) { SfxItemPool* pPool = &mpEditEngine->GetEditDoc().GetItemPool(); while ( pPool->GetSecondaryPool() && @@ -673,8 +673,8 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, return true; } -sal_Bool EdtAutoCorrDoc::SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, - const OUString& rURL ) +sal_Bool EdtAutoCorrDoc::SetINetAttr(sal_Int32 nStt, sal_Int32 nEnd, + const OUString& rURL) { // Turn the Text into a command field ... EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) ); @@ -764,7 +764,7 @@ bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, return bRet; } -LanguageType EdtAutoCorrDoc::GetLanguage( sal_uInt16 nPos, sal_Bool ) const +LanguageType EdtAutoCorrDoc::GetLanguage( sal_Int32 nPos, sal_Bool ) const { return mpEditEngine->GetLanguage( EditPaM( pCurNode, nPos+1 ) ); } diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index 21d18bbafac9..4951e791b49e 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -139,20 +139,20 @@ public: EdtAutoCorrDoc(EditEngine* pE, ContentNode* pCurNode, sal_uInt16 nCrsr, sal_Unicode cIns); ~EdtAutoCorrDoc(); - virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd ); - virtual sal_Bool Insert( sal_uInt16 nPos, const OUString& rTxt ); - virtual sal_Bool Replace( sal_uInt16 nPos, const OUString& rTxt ); - virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const OUString& rTxt ); + virtual sal_Bool Delete( sal_Int32 nStt, sal_Int32 nEnd ); + virtual sal_Bool Insert( sal_Int32 nPos, const OUString& rTxt ); + virtual sal_Bool Replace( sal_Int32 nPos, const OUString& rTxt ); + virtual sal_Bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ); - virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); - virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const OUString& rURL ); + virtual sal_Bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); + virtual sal_Bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ); virtual OUString GetPrevPara( sal_Bool bAtNormalPos ); virtual bool ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, SvxAutoCorrect& rACorrect, OUString* pPara ); - virtual LanguageType GetLanguage( sal_uInt16 nPos, sal_Bool bPrevPara = sal_False ) const; + virtual LanguageType GetLanguage( sal_Int32 nPos, sal_Bool bPrevPara = sal_False ) const; sal_uInt16 GetCursor() const { return nCursor; } diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index a961b2ee0992..3f119d16e245 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -113,7 +113,7 @@ static inline bool IsUpperLetter( sal_Int32 nCharType ) } bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const OUString& rTxt, - xub_StrLen nStt, xub_StrLen nEnd ) + sal_Int32 nStt, sal_Int32 nEnd ) { for( ; nStt < nEnd; ++nStt ) { @@ -141,7 +141,7 @@ bool lcl_IsUnsupportedUnicodeChar( CharClass& rCC, const OUString& rTxt, } static sal_Bool lcl_IsSymbolChar( CharClass& rCC, const OUString& rTxt, - xub_StrLen nStt, xub_StrLen nEnd ) + sal_Int32 nStt, sal_Int32 nEnd ) { for( ; nStt < nEnd; ++nStt ) { @@ -173,12 +173,12 @@ SvxAutoCorrDoc::~SvxAutoCorrDoc() // - FnCptlSttSntnc // after the exchange of characters. Then the words, if necessary, can be inserted // into the exception list. -void SvxAutoCorrDoc::SaveCpltSttWord( sal_uLong, xub_StrLen, const OUString&, +void SvxAutoCorrDoc::SaveCpltSttWord( sal_uLong, sal_Int32, const OUString&, sal_Unicode ) { } -LanguageType SvxAutoCorrDoc::GetLanguage( xub_StrLen , sal_Bool ) const +LanguageType SvxAutoCorrDoc::GetLanguage( sal_Int32, sal_Bool ) const { return LANGUAGE_SYSTEM; } @@ -341,7 +341,7 @@ void SvxAutoCorrect::SetAutoCorrFlag( long nFlag, sal_Bool bOn ) // Two capital letters at the beginning of word? sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { sal_Bool bRet = sal_False; @@ -359,14 +359,14 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const OUString& rTx // Is the word a compounded word separated by delimiters? // If so, keep track of all delimiters so each constituent // word can be checked for two initial capital letters. - std::deque<xub_StrLen> aDelimiters; + std::deque<sal_Int32> aDelimiters; // Always check for two capitals at the beginning // of the entire word, so start at nSttPos. aDelimiters.push_back(nSttPos); // Find all compound word delimiters - for (xub_StrLen n = nSttPos; n < nEndPos; ++n) + for (sal_Int32 n = nSttPos; n < nEndPos; ++n) { if (IsAutoCorrectChar(rTxt[ n ])) { @@ -431,7 +431,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const OUString& rTx sal_Bool SvxAutoCorrect::FnChgOrdinalNumber( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { // 1st, 2nd, 3rd, 4 - 0th @@ -449,10 +449,10 @@ sal_Bool SvxAutoCorrect::FnChgOrdinalNumber( // Get the last number in the string to check - xub_StrLen nNumEnd = nEndPos; + sal_Int32 nNumEnd = nEndPos; bool foundEnd = false; bool validNumber = true; - xub_StrLen i = nEndPos; + sal_Int32 i = nEndPos; while ( i > nSttPos ) { @@ -502,7 +502,7 @@ sal_Bool SvxAutoCorrect::FnChgOrdinalNumber( sal_Bool SvxAutoCorrect::FnChgToEnEmDash( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { sal_Bool bRet = sal_False; @@ -520,7 +520,7 @@ sal_Bool SvxAutoCorrect::FnChgToEnEmDash( if( ' ' == rTxt[ nSttPos-1 ] && '-' == rTxt[ nSttPos+1 ]) { - xub_StrLen n; + sal_Int32 n; for( n = nSttPos+2; n < nEndPos && lcl_IsInAsciiArr( sImplSttSkipChars,(cCh = rTxt[ n ])); ++n ) @@ -547,7 +547,7 @@ sal_Bool SvxAutoCorrect::FnChgToEnEmDash( ' ' == rTxt[ nSttPos-1 ] && '-' == rTxt[ nSttPos-2 ]) { - xub_StrLen n, nLen = 1, nTmpPos = nSttPos - 2; + sal_Int32 n, nLen = 1, nTmpPos = nSttPos - 2; if( '-' == ( cCh = rTxt[ nTmpPos-1 ]) ) { --nTmpPos; @@ -606,7 +606,7 @@ sal_Bool SvxAutoCorrect::FnChgToEnEmDash( sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen, xub_StrLen nEndPos, + sal_Int32, sal_Int32 nEndPos, LanguageType eLang ) { bool bRet = false; @@ -627,7 +627,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( if ( bIsSpecial ) { // Get the last word delimiter position - xub_StrLen nSttWdPos = nEndPos; + sal_Int32 nSttWdPos = nEndPos; bool bWasWordDelim = false; while( nSttWdPos && !(bWasWordDelim = IsWordDelim( rTxt[ --nSttWdPos ]))) ; @@ -651,7 +651,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( if ( ( chars.indexOf( cPrevChar ) == -1 ) && cPrevChar != '\t' ) { // Remove any previous normal space - xub_StrLen nPos = nEndPos - 1; + sal_Int32 nPos = nEndPos - 1; while ( cPrevChar == ' ' || cPrevChar == cNonBreakingSpace ) { if ( nPos == 0 ) break; @@ -691,16 +691,11 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( sal_Bool SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { - sal_Int32 nStart(nSttPos); - sal_Int32 nEnd(nEndPos); - - OUString sURL( URIHelper::FindFirstURLInText( rTxt, nStart, nEnd, + OUString sURL( URIHelper::FindFirstURLInText( rTxt, nSttPos, nEndPos, GetCharClass( eLang ) )); - nSttPos = (xub_StrLen)nStart; - nEndPos = (xub_StrLen)nEnd; sal_Bool bRet = !sURL.isEmpty(); if( bRet ) // also Attribut setzen: rDoc.SetINetAttr( nSttPos, nEndPos, sURL ); @@ -709,7 +704,7 @@ sal_Bool SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, const OUString& rT sal_Bool SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen, xub_StrLen nEndPos, + sal_Int32 , sal_Int32 nEndPos, LanguageType eLang ) { // Condition: @@ -724,7 +719,7 @@ sal_Bool SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const OUString --nEndPos; sal_Bool bAlphaNum = sal_False; - xub_StrLen nPos = nEndPos; + sal_Int32 nPos = nEndPos; sal_Int32 nFndPos = -1; CharClass& rCC = GetCharClass( eLang ); @@ -783,7 +778,7 @@ sal_Bool SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const OUString sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, const OUString& rTxt, sal_Bool bNormalPos, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { @@ -800,25 +795,19 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, sal_Bool bAtStart = sal_False; do { --pStr; - if( rCC.isLetter( - aText, sal::static_int_cast< xub_StrLen >( pStr - pStart ) ) ) + if (rCC.isLetter(aText, pStr - pStart)) { if( !pWordStt ) pDelim = pStr+1; pWordStt = pStr; } - else if( pWordStt && - !rCC.isDigit( - aText, - sal::static_int_cast< xub_StrLen >( pStr - pStart ) ) ) + else if (pWordStt && !rCC.isDigit(aText, pStr - pStart)) { if( lcl_IsInAsciiArr( sImplWordChars, *pStr ) && pWordStt - 1 == pStr && // Installation at beginning of paragraph. Replaced < by <= (#i38971#) (sal_IntPtr)(pStart + 1) <= (sal_IntPtr)pStr && - rCC.isLetter( - aText, - sal::static_int_cast< xub_StrLen >( pStr-1 - pStart ) ) ) + rCC.isLetter(aText, pStr-1 - pStart)) pWordStt = --pStr; else break; @@ -829,13 +818,10 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, return sal_False; // no character to be replaced - if (rCC.isDigit( aText, sal::static_int_cast< xub_StrLen >( pStr - pStart ) )) + if (rCC.isDigit(aText, pStr - pStart)) return sal_False; // already ok - if (IsUpperLetter( - rCC.getCharacterType( - aText, - sal::static_int_cast< xub_StrLen >( pWordStt - pStart ) ) ) ) + if (IsUpperLetter(rCC.getCharacterType(aText, pWordStt - pStart))) return sal_False; // already ok //See if the text is the start of a protocol string, e.g. have text of @@ -880,7 +866,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, OUString sChar( *pWordStt ); sChar = rCC.titlecase(sChar); //see fdo#56740 return !comphelper::string::equals(sChar, *pWordStt) && - rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar ); + rDoc.ReplaceRange( pWordStt - pStart, 1, sChar ); } aText = aPrevPara; @@ -964,24 +950,18 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( 2 > ( pStr - pStart ) ) return sal_False; - if( !rCC.isLetterNumeric( - aText, sal::static_int_cast< xub_StrLen >( pStr-- - pStart ) ) ) + if (!rCC.isLetterNumeric(aText, pStr-- - pStart)) { sal_Bool bValid = sal_False, bAlphaFnd = sal_False; const sal_Unicode* pTmpStr = pStr; while( !bValid ) { - if( rCC.isDigit( - aText, - sal::static_int_cast< xub_StrLen >( pTmpStr - pStart ) ) ) + if( rCC.isDigit( aText, pTmpStr - pStart ) ) { bValid = sal_True; pStr = pTmpStr - 1; } - else if( rCC.isLetter( - aText, - sal::static_int_cast< xub_StrLen >( - pTmpStr - pStart ) ) ) + else if( rCC.isLetter( aText, pTmpStr - pStart ) ) { if( bAlphaFnd ) { @@ -1009,9 +989,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, // Search for the beginning of the word while( !IsWordDelim( *pStr )) { - if( bNumericOnly && - rCC.isLetter( - aText, sal::static_int_cast< xub_StrLen >( pStr - pStart ) ) ) + if( bNumericOnly && rCC.isLetter( aText, pStr - pStart ) ) bNumericOnly = sal_False; if( pStart == pStr ) @@ -1060,7 +1038,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, // Ok, then replace sal_Unicode cSave = *pWordStt; - nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.getStr() ); + nSttPos = pWordStt - rTxt.getStr(); OUString sChar( cSave ); sChar = rCC.titlecase(sChar); //see fdo#56740 sal_Bool bRet = sChar[0] != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ); @@ -1073,7 +1051,7 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang ) { if (nEndPos - nSttPos < 2) @@ -1145,7 +1123,7 @@ sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode cInsChar, sal_Bool bSttQuote, return cRet; } -void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, +void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos, sal_Unicode cInsChar, sal_Bool bSttQuote, sal_Bool bIns ) { @@ -1187,7 +1165,7 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, rDoc.Replace( nInsPos, sChg ); } -OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, +OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos, sal_Unicode cInsChar, sal_Bool bSttQuote ) { LanguageType eLang = rDoc.GetLanguage( nInsPos, sal_False ); @@ -1218,7 +1196,7 @@ OUString SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, sal_uLong SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nInsPos, sal_Unicode cChar, + sal_Int32 nInsPos, sal_Unicode cChar, sal_Bool bInsert, Window* pFrameWin ) { sal_uLong nRet = 0; @@ -1368,7 +1346,7 @@ SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, nRet = Autocorrect; if( !aPara.isEmpty() ) { - xub_StrLen nEnd = nCapLttrPos; + sal_Int32 nEnd = nCapLttrPos; while( nEnd < aPara.getLength() && !IsWordDelim( aPara[ nEnd ])) ++nEnd; @@ -1513,13 +1491,13 @@ sal_Bool SvxAutoCorrect::AddWrtSttException( const OUString& rNew, } sal_Bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, - const OUString& rTxt, xub_StrLen nPos, + const OUString& rTxt, sal_Int32 nPos, OUString& rWord ) const { if( !nPos ) return sal_False; - xub_StrLen nEnde = nPos; + sal_Int32 nEnde = nPos; // it must be followed by a blank or tab! if( ( nPos < rTxt.getLength() && @@ -1532,7 +1510,7 @@ sal_Bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, // Found a Paragraph-start or a Blank, search for the word shortcut in // auto. - xub_StrLen nCapLttrPos = nPos+1; // on the 1st Character + sal_Int32 nCapLttrPos = nPos+1; // on the 1st Character if( !nPos && !IsWordDelim( rTxt[ 0 ])) --nCapLttrPos; // Beginning of pargraph and no Blank! @@ -2761,13 +2739,13 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p sal_Int32 nEndPos) const { const OUString& rChk = pFnd->GetShort(); - xub_StrLen left_wildcard = ( rChk[0] == C_ASTERISK ) ? 1 : 0; // "*word" pattern? - xub_StrLen nSttWdPos = nEndPos; + sal_Int32 left_wildcard = ( rChk[0] == C_ASTERISK ) ? 1 : 0; // "*word" pattern? + sal_Int32 nSttWdPos = nEndPos; if( nEndPos >= rChk.getLength() - left_wildcard) { bool bWasWordDelim = false; - xub_StrLen nCalcStt = nEndPos - rChk.getLength() + left_wildcard; + sal_Int32 nCalcStt = nEndPos - rChk.getLength() + left_wildcard; if( ( !nCalcStt || nCalcStt == rStt || left_wildcard || ( nCalcStt < rStt && IsWordDelim( rTxt[ nCalcStt - 1 ] ))) ) diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx index 2e3d5b3f1e62..ce43b6267151 100644 --- a/include/editeng/svxacorr.hxx +++ b/include/editeng/svxacorr.hxx @@ -85,15 +85,15 @@ public: SvxAutoCorrDoc() {} virtual ~SvxAutoCorrDoc(); - virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ) = 0; - virtual sal_Bool Insert( xub_StrLen nPos, const OUString& rTxt ) = 0; - virtual sal_Bool Replace( xub_StrLen nPos, const OUString& rTxt ) = 0; - virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const OUString& rTxt ) = 0; + virtual sal_Bool Delete( sal_Int32 nStt, sal_Int32 nEnd ) = 0; + virtual sal_Bool Insert( sal_Int32 nPos, const OUString& rTxt ) = 0; + virtual sal_Bool Replace( sal_Int32 nPos, const OUString& rTxt ) = 0; + virtual sal_Bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ) = 0; - virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId, + virtual sal_Bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ) = 0; - virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const OUString& rURL ) = 0; + virtual sal_Bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) = 0; // Return the text of a previous paragraph. // If no paragraph exits or just an empty one, then return an empty string. @@ -110,12 +110,12 @@ public: // - FnCptlSttWrd // - FnCptlSttSntnc // As an option, the words can then be inserted into the exception lists. - virtual void SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos, + virtual void SaveCpltSttWord( sal_uLong nFlag, sal_Int32 nPos, const OUString& rExceptWord, sal_Unicode cChar ); // which language at the position? - virtual LanguageType GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara = sal_False ) const; + virtual LanguageType GetLanguage( sal_Int32 nPos, sal_Bool bPrevPara = sal_False ) const; }; @@ -292,12 +292,12 @@ public: // to the actual SwTxtNode/EditNode string because it inserts the character // in rDoc and expects that to side-effect rTxt sal_uLong DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nPos, sal_Unicode cInsChar, sal_Bool bInsert, Window* pFrameWin = NULL ); + sal_Int32 nPos, sal_Unicode cInsChar, sal_Bool bInsert, Window* pFrameWin = NULL ); // Return for the autotext expansion the previous word, // AutoCorrect - corresponding algorithm sal_Bool GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, const OUString& rTxt, - xub_StrLen nPos, OUString& rWord ) const; + sal_Int32 nPos, OUString& rWord ) const; // Search for or or the words in the replacement table. // rText - check in this text the words of the list @@ -321,9 +321,9 @@ public: void SetStartDoubleQuote( const sal_Unicode cStart ) { cStartDQuote = cStart; } void SetEndDoubleQuote( const sal_Unicode cEnd ) { cEndDQuote = cEnd; } - OUString GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, + OUString GetQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos, sal_Unicode cInsChar, sal_Bool bSttQuote ); - void InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, + void InsertQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos, sal_Unicode cInsChar, sal_Bool bSttQuote, sal_Bool bIns ); // Query/Set the name of the AutoCorrect file @@ -394,28 +394,28 @@ public: // Methods for the auto-correction sal_Bool FnCptlSttWrd( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); sal_Bool FnChgOrdinalNumber( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); sal_Bool FnChgToEnEmDash( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); sal_Bool FnAddNonBrkSpace( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); sal_Bool FnSetINetAttr( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); sal_Bool FnChgWeightUnderl( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); sal_Bool FnCptlSttSntnc( SvxAutoCorrDoc&, const OUString&, sal_Bool bNormalPos, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM); bool FnCorrectCapsLock( SvxAutoCorrDoc&, const OUString&, - xub_StrLen nSttPos, xub_StrLen nEndPos, + sal_Int32 nSttPos, sal_Int32 nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); bool HasRunNext() { return bRunNext; } diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index 271266fdd1de..4256155c9431 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -143,7 +143,7 @@ class IDocumentMarkAccess */ virtual void correctMarksAbsolute(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset) =0; + const sal_Int32 nOffset) =0; /** Corrects marks (relative) This method uses the previous position of the mark in the paragraph as offset @@ -161,7 +161,7 @@ class IDocumentMarkAccess */ virtual void correctMarksRelative(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset) =0; + const sal_Int32 nOffset) =0; /** Deletes marks in a range diff --git a/sw/inc/SwUndoField.hxx b/sw/inc/SwUndoField.hxx index 6a1d318acb99..91e56ce4de83 100644 --- a/sw/inc/SwUndoField.hxx +++ b/sw/inc/SwUndoField.hxx @@ -31,7 +31,7 @@ class SwMsgPoolItem; class SwUndoField : public SwUndo { sal_uLong nNodeIndex; - xub_StrLen nOffset; + sal_Int32 nOffset; protected: SwDoc * pDoc; diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index cfb409f7e041..4bcbf35262ca 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -286,7 +286,7 @@ protected: // set all PaMs in OldNode to NewPos + Offset void PaMCorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, - const xub_StrLen nOffset = 0 ); + const sal_Int32 nOffset = 0 ); bool _SelTblRowOrCol( bool bRow, bool bRowSimple = false ); @@ -690,7 +690,7 @@ public: // get the nth character from the start or end of the current selection sal_Unicode GetChar( sal_Bool bEnd = sal_True, long nOffset = 0 ); - sal_Bool ExtendSelection( sal_Bool bEnd = sal_True, xub_StrLen nCount = 1 ); + sal_Bool ExtendSelection( sal_Bool bEnd = sal_True, sal_Int32 nCount = 1 ); // Place only the visible cursor at the given position in the document. // Return FALSE if SPoint was corrected by layout. @@ -717,8 +717,8 @@ public: bool CrsrInsideInputFld() const; bool PosInsideInputFld( const SwPosition& rPos ) const; bool DocPtInsideInputFld( const Point& rDocPt ) const; - xub_StrLen StartOfInputFldAtPos( const SwPosition& rPos ) const; - xub_StrLen EndOfInputFldAtPos( const SwPosition& rPos ) const; + sal_Int32 StartOfInputFldAtPos( const SwPosition& rPos ) const; + sal_Int32 EndOfInputFldAtPos( const SwPosition& rPos ) const; // Return number of cursors in ring (The flag indicates whether // only cursors containing selections are requested). @@ -799,8 +799,8 @@ public: bool GotoINetAttr( const SwTxtINetFmt& rAttr ); const SwFmtINetFmt* FindINetAttr( const OUString& rName ) const; - sal_Bool SelectTxt( const xub_StrLen nStart, - const xub_StrLen nEnd ); + sal_Bool SelectTxt( const sal_Int32 nStart, + const sal_Int32 nEnd ); sal_Bool CheckTblBoxCntnt( const SwPosition* pPos = 0 ); void SaveTblBoxCntnt( const SwPosition* pPos = 0 ); diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 4f2bea99bf0f..025668d7053a 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -867,7 +867,7 @@ public: virtual bool InsertString(const SwPaM &rRg, const OUString&, const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ); virtual bool UpdateParRsid( SwTxtNode *pTxtNode, sal_uInt32 nVal = 0 ); - virtual bool UpdateRsid( const SwPaM &rRg, xub_StrLen nLen ); + virtual bool UpdateRsid( const SwPaM &rRg, sal_Int32 nLen ); virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*); virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet, @@ -1470,7 +1470,7 @@ public: void CorrAbs( const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset = 0, + const sal_Int32 nOffset = 0, sal_Bool bMoveCrsr = sal_False ); /// Set everything in the range of [rStartNode, rEndNode] to rNewPos. @@ -1490,7 +1490,7 @@ public: void CorrRel( const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset = 0, + const sal_Int32 nOffset = 0, sal_Bool bMoveCrsr = sal_False ); /// Query / set rules for Outline. diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index 5f3ffc009197..5db74a35d1a0 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -85,27 +85,27 @@ public: class SwDelChr: public SwMsgPoolItem { public: - xub_StrLen nPos; + sal_Int32 nPos; - SwDelChr( xub_StrLen nP ); + SwDelChr( sal_Int32 nP ); }; class SwDelTxt: public SwMsgPoolItem { public: - xub_StrLen nStart; - xub_StrLen nLen; + sal_Int32 nStart; + sal_Int32 nLen; - SwDelTxt( xub_StrLen nS, xub_StrLen nL ); + SwDelTxt( sal_Int32 nS, sal_Int32 nL ); }; class SwUpdateAttr: public SwMsgPoolItem { public: - xub_StrLen nStart; - xub_StrLen nEnd; + sal_Int32 nStart; + sal_Int32 nEnd; sal_uInt16 nWhichAttr; - SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, sal_uInt16 nW ); + SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW ); }; diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 1acbf88320e4..1c50d6d5f1d1 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -449,7 +449,7 @@ public: void CreateBookmarkTbl(); // Search alle Bookmarks in the range and return it in the Array. sal_uInt16 GetBookmarks( const SwCntntNode& rNd, - xub_StrLen nStt, xub_StrLen nEnd, + sal_Int32 nStt, sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr ); // Create new PaM at position. diff --git a/sw/inc/txtannotationfld.hxx b/sw/inc/txtannotationfld.hxx index a134a9e6752c..5dc18ecd303c 100755 --- a/sw/inc/txtannotationfld.hxx +++ b/sw/inc/txtannotationfld.hxx @@ -30,7 +30,7 @@ class SwTxtAnnotationFld : public SwTxtFld public: SwTxtAnnotationFld( SwFmtFld & rAttr, - xub_StrLen const nStart, + sal_Int32 const nStart, bool const bInClipboard ); virtual ~SwTxtAnnotationFld(); diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index 9539397b35c2..2c879250d2fb 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -38,7 +38,7 @@ class SwTxtCharFmt : public SwTxtAttrEnd sal_uInt16 m_nSortNumber; public: - SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + SwTxtCharFmt( SwFmtCharFmt& rAttr, sal_Int32 nStart, sal_Int32 nEnd ); virtual ~SwTxtCharFmt( ); // Passed from SwFmtCharFmt (no derivation from SwClient!). @@ -59,7 +59,7 @@ class SwTxtAttrNesting : public SwTxtAttrEnd { protected: SwTxtAttrNesting( SfxPoolItem & i_rAttr, - const xub_StrLen i_nStart, const xub_StrLen i_nEnd ); + const sal_Int32 i_nStart, const sal_Int32 i_nEnd ); virtual ~SwTxtAttrNesting(); }; @@ -67,14 +67,14 @@ class SwTxtMeta : public SwTxtAttrNesting { private: SwTxtMeta( SwFmtMeta & i_rAttr, - const xub_StrLen i_nStart, const xub_StrLen i_nEnd ); + const sal_Int32 i_nStart, const sal_Int32 i_nEnd ); public: static SwTxtMeta * CreateTxtMeta( ::sw::MetaFieldManager & i_rTargetDocManager, SwTxtNode *const i_pTargetTxtNode, SwFmtMeta & i_rAttr, - xub_StrLen const i_nStart, xub_StrLen const i_nEnd, + sal_Int32 const i_nStart, sal_Int32 const i_nEnd, bool const i_bIsCopy); virtual ~SwTxtMeta(); @@ -91,7 +91,7 @@ class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: - SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + SwTxtRuby( SwFmtRuby& rAttr, sal_Int32 nStart, sal_Int32 nEnd ); virtual ~SwTxtRuby(); TYPEINFO(); diff --git a/sw/inc/txtflcnt.hxx b/sw/inc/txtflcnt.hxx index 70d8edfee672..cd1f73dd8fc5 100644 --- a/sw/inc/txtflcnt.hxx +++ b/sw/inc/txtflcnt.hxx @@ -34,7 +34,7 @@ class SwTxtFlyCnt : public SwTxtAttr SwFlyInCntFrm *_GetFlyFrm( const SwFrm *pCurrFrm ); public: - SwTxtFlyCnt( SwFmtFlyCnt& rAttr, xub_StrLen nStart ); + SwTxtFlyCnt( SwFmtFlyCnt& rAttr, sal_Int32 nStart ); // Sets anchor in pFmt and void SetAnchor( const SwTxtNode *pNode ); diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx index 35eb042d6af6..b5e60d979b4a 100644 --- a/sw/inc/txtftn.hxx +++ b/sw/inc/txtftn.hxx @@ -38,7 +38,7 @@ class SW_DLLPUBLIC SwTxtFtn : public SwTxtAttr sal_uInt16 m_nSeqNo; public: - SwTxtFtn( SwFmtFtn& rAttr, xub_StrLen nStart ); + SwTxtFtn( SwFmtFtn& rAttr, sal_Int32 nStart ); virtual ~SwTxtFtn(); inline SwNodeIndex *GetStartNode() const { return m_pStartNode; } diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index 44cc5605594e..f2d78460584f 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -38,7 +38,7 @@ protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: - SwTxtINetFmt( SwFmtINetFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + SwTxtINetFmt( SwFmtINetFmt& rAttr, sal_Int32 nStart, sal_Int32 nEnd ); virtual ~SwTxtINetFmt(); TYPEINFO(); diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx index bb28086ce0b9..b3aae158315f 100644 --- a/sw/source/core/attr/hints.cxx +++ b/sw/source/core/attr/hints.cxx @@ -34,17 +34,17 @@ SwInsTxt::SwInsTxt( sal_Int32 nP, sal_Int32 nL ) { } -SwDelChr::SwDelChr( xub_StrLen nP ) +SwDelChr::SwDelChr( sal_Int32 nP ) : SwMsgPoolItem( RES_DEL_CHR ), nPos( nP ) { } -SwDelTxt::SwDelTxt( xub_StrLen nS, xub_StrLen nL ) +SwDelTxt::SwDelTxt( sal_Int32 nS, sal_Int32 nL ) : SwMsgPoolItem( RES_DEL_TXT ), nStart( nS ), nLen( nL ) { } -SwUpdateAttr::SwUpdateAttr( xub_StrLen nS, xub_StrLen nE, sal_uInt16 nW ) +SwUpdateAttr::SwUpdateAttr( sal_Int32 nS, sal_Int32 nE, sal_uInt16 nW ) : SwMsgPoolItem( RES_UPDATE_ATTR ), nStart( nS ), nEnd( nE ), nWhichAttr( nW ) { } diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index b550bfbfb0b3..6fdc483f072a 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -489,7 +489,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins ) sal_uInt16 nOld_ListPor = nListPor; SwSbxValue nOld_LastLeft = nLastLeft; SwSbxValue nOld_NumberValue = nNumberValue; - xub_StrLen nOld_CommandPos = nCommandPos; + sal_Int32 nOld_CommandPos = nCommandPos; SwCalcOper eOld_CurrOper = eCurrOper; SwCalcOper eOld_CurrListOper = eCurrListOper; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 1a29632b31a4..f6988d8159d2 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2288,7 +2288,7 @@ sal_Unicode SwCrsrShell::GetChar( sal_Bool bEnd, long nOffset ) @param bEnd Start counting from the end? From start otherwise. @param nCount Number of characters. */ -sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, xub_StrLen nCount ) +sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, sal_Int32 nCount ) { if( !m_pCurCrsr->HasMark() || IsTableMode() ) return sal_False; // no selection diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 724b5ceaa250..4e4be9d55539 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -818,7 +818,7 @@ SwField* SwCrsrShell::GetFieldAtCrsr( if ( pTxtFld != NULL && pCrsr->Start()->nNode == pCrsr->End()->nNode ) { - const xub_StrLen nTxtFldLength = + const sal_Int32 nTxtFldLength = pTxtFld->End() != NULL ? *(pTxtFld->End()) - *(pTxtFld->GetStart()) : 1; @@ -890,7 +890,7 @@ bool SwCrsrShell::DocPtInsideInputFld( const Point& rDocPt ) const } -xub_StrLen SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const +sal_Int32 SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const { const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true )); if ( pTxtInputFld == NULL ) @@ -902,7 +902,7 @@ xub_StrLen SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const } -xub_StrLen SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const +sal_Int32 SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const { const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true )); if ( pTxtInputFld == NULL ) @@ -1730,8 +1730,8 @@ bool SwContentAtPos::IsInRTLText()const } -sal_Bool SwCrsrShell::SelectTxt( const xub_StrLen nStart, - const xub_StrLen nEnd ) +sal_Bool SwCrsrShell::SelectTxt( const sal_Int32 nStart, + const sal_Int32 nEnd ) { SET_CURR_SHELL( this ); sal_Bool bRet = sal_False; diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index d39deb05643c..3393fb409530 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -86,7 +86,7 @@ int CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 ) } const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos, - xub_StrLen nCntntPos ) + sal_Int32 nCntntPos ) { while( rPos < rHtsArr.Count() ) { @@ -99,7 +99,7 @@ const SwTxtAttr* GetFrwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos, } const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos, - xub_StrLen nCntntPos ) + sal_Int32 nCntntPos ) { while( rPos > 0 ) { diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index f6d5ed42d98a..6cf17f9f2854 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -180,9 +180,9 @@ lcl_CleanStr(const SwTxtNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd, } // skip all non SwPostIts inside the array -xub_StrLen GetPostIt(xub_StrLen aCount,const SwpHints *pHts) +sal_Int32 GetPostIt(sal_Int32 aCount,const SwpHints *pHts) { - xub_StrLen aIndex = 0; + sal_Int32 aIndex = 0; while (aCount) { for (sal_Int32 i = 0; i < pHts->Count(); i++ ) @@ -253,8 +253,8 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te const SwpHints *pHts = ((SwTxtNode*)pNode)->GetpSwpHints(); // count PostItFields by looping over all fields - xub_StrLen aNumberPostits = 0; - xub_StrLen aIgnore = 0; + sal_Int32 aNumberPostits = 0; + sal_Int32 aIgnore = 0; if (pHts && bSearchInNotes) { if (!bSrchForward) @@ -289,7 +289,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te SwViewShell *const pWrtShell = (pDocShell) ? (SwViewShell*)(pDocShell->GetWrtShell()) : 0; SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : 0; - xub_StrLen aStart = 0; + sal_Int32 aStart = 0; // do we need to finish a note? if (pPostItMgr && pPostItMgr->HasActiveSidebarWin()) { @@ -462,8 +462,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, (rSTxt.*fnMove->fnSearch)( sCleanStr, &nProxyStart, &nProxyEnd, 0 ) && !(bZeroMatch = (nProxyStart == nProxyEnd))) { - nStart = (xub_StrLen)nProxyStart; - nEnd = (xub_StrLen)nProxyEnd; + nStart = nProxyStart; + nEnd = nProxyEnd; // set section correctly *GetPoint() = *pPam->GetPoint(); SetMark(); diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index 9b55a849115a..68dc6c7e7e17 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -162,7 +162,7 @@ sal_Bool SwCrsrShell::GotoFtnAnchor() return bRet; } -inline sal_Bool CmpLE( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt ) +inline sal_Bool CmpLE( const SwTxtFtn& rFtn, sal_uLong nNd, sal_Int32 nCnt ) { const sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() <= nCnt ); diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 22d816550d23..cc362b2ff2e9 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -84,7 +84,7 @@ class SwAutoCompleteString #endif SwDocPtrVector aSourceDocs; public: - SwAutoCompleteString(const OUString& rStr, xub_StrLen nPos, xub_StrLen nLen); + SwAutoCompleteString(const OUString& rStr, sal_Int32 nPos, sal_Int32 nLen); ~SwAutoCompleteString(); void AddDocument(const SwDoc& rDoc); @@ -176,7 +176,7 @@ void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc) } SwAutoCompleteString::SwAutoCompleteString( - const OUString& rStr, xub_StrLen const nPos, xub_StrLen const nLen) + const OUString& rStr, sal_Int32 const nPos, sal_Int32 const nLen) : editeng::IAutoCompleteString(rStr.copy(nPos, nLen)) { #if OSL_DEBUG_LEVEL > 0 diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 224fae12e496..dac5379af9bb 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -536,7 +536,7 @@ namespace sw { namespace mark void MarkManager::correctMarksAbsolute( const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset) + const sal_Int32 nOffset) { const SwNode* const pOldNode = &rOldNode.GetNode(); SwPosition aNewPos(rNewPos); @@ -576,7 +576,7 @@ namespace sw { namespace mark } - void MarkManager::correctMarksRelative(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const xub_StrLen nOffset) + void MarkManager::correctMarksRelative(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const sal_Int32 nOffset) { const SwNode* const pOldNode = &rOldNode.GetNode(); SwPosition aNewPos(rNewPos); diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 03aa3b386fdd..c40205d0176f 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -176,7 +176,7 @@ void PaMCorrAbs( const SwPaM& rRange, void SwDoc::CorrAbs(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset, + const sal_Int32 nOffset, sal_Bool bMoveCrsr) { SwCntntNode *const pCntntNode( rOldNode.GetNode().GetCntntNode() ); @@ -298,7 +298,7 @@ void PaMCorrRel( const SwNodeIndex &rOldNode, void SwDoc::CorrRel(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, - const xub_StrLen nOffset, + const sal_Int32 nOffset, sal_Bool bMoveCrsr) { getIDocumentMarkAccess()->correctMarksRelative(rOldNode, rNewPos, nOffset); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 321a36682ab5..f8c6e83305ec 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -61,8 +61,8 @@ using namespace ::com::sun::star::uno; -extern bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, - const SwTxtNode& rBehindNd, sal_uInt16 nSttPos ); +extern bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos, + const SwTxtNode& rBehindNd, sal_Int32 nSttPos ); /** Insert field types * diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index e8cc62021f73..8040a843565f 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1114,7 +1114,7 @@ bool SwDoc::InsertItemSet ( const SwPaM &rRg, const SfxItemSet &rSet, } /// Set the rsid of the next nLen symbols of rRg to the current session number -bool SwDoc::UpdateRsid( const SwPaM &rRg, const xub_StrLen nLen ) +bool SwDoc::UpdateRsid( const SwPaM &rRg, const sal_Int32 nLen ) { SwTxtNode *pTxtNode = rRg.GetPoint()->nNode.GetNode().GetTxtNode(); if (!pTxtNode) diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 4bf22c5a8250..415977a14bf0 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -112,7 +112,7 @@ void SwAutoCorrDoc::DeleteSel( SwPaM& rDelPam ) } } -sal_Bool SwAutoCorrDoc::Delete( xub_StrLen nStt, xub_StrLen nEnd ) +sal_Bool SwAutoCorrDoc::Delete( sal_Int32 nStt, sal_Int32 nEnd ) { const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; SwPaM aSel( rNd, nStt, rNd, nEnd ); @@ -123,7 +123,7 @@ sal_Bool SwAutoCorrDoc::Delete( xub_StrLen nStt, xub_StrLen nEnd ) return sal_True; } -sal_Bool SwAutoCorrDoc::Insert( xub_StrLen nPos, const OUString& rTxt ) +sal_Bool SwAutoCorrDoc::Insert( sal_Int32 nPos, const OUString& rTxt ) { SwPaM aPam( rCrsr.GetPoint()->nNode.GetNode(), nPos ); rEditSh.GetDoc()->InsertString( aPam, rTxt ); @@ -139,12 +139,12 @@ sal_Bool SwAutoCorrDoc::Insert( xub_StrLen nPos, const OUString& rTxt ) return sal_True; } -sal_Bool SwAutoCorrDoc::Replace( xub_StrLen nPos, const OUString& rTxt ) +sal_Bool SwAutoCorrDoc::Replace( sal_Int32 nPos, const OUString& rTxt ) { return ReplaceRange( nPos, rTxt.getLength(), rTxt ); } -sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, const OUString& rTxt ) +sal_Bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const OUString& rTxt ) { SwPaM* pPam = &rCrsr; if( pPam->GetPoint()->nContent.GetIndex() != nPos ) @@ -227,7 +227,7 @@ sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, return sal_True; } -sal_Bool SwAutoCorrDoc::SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId, +sal_Bool SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& rItem ) { const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; @@ -250,7 +250,7 @@ sal_Bool SwAutoCorrDoc::SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nS return 0 != nWhich; } -sal_Bool SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const OUString& rURL ) +sal_Bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ) { const SwNodeIndex& rNd = rCrsr.GetPoint()->nNode; SwPaM aPam( rNd, nStt, rNd, nEnd ); @@ -400,7 +400,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, // - FnCptlSttSntnc // after the exchange of characters. Then the words, if necessary, can be inserted // into the exception list. -void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos, +void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, sal_Int32 nPos, const OUString& rExceptWord, sal_Unicode cChar ) { @@ -410,7 +410,7 @@ void SwAutoCorrDoc::SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos, nNode, nPos, rExceptWord, cChar, eLang )); } -LanguageType SwAutoCorrDoc::GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara ) const +LanguageType SwAutoCorrDoc::GetLanguage( sal_Int32 nPos, sal_Bool bPrevPara ) const { LanguageType eRet = LANGUAGE_SYSTEM; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 920a3891d8bc..a2e1f0c916e0 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -20,7 +20,6 @@ #include <ctype.h> #include <hintids.hxx> -#include <tools/string.hxx> #include <unotools/charclass.hxx> #include <vcl/msgbox.hxx> @@ -170,8 +169,8 @@ class SwAutoFormat OUString DelLeadingBlanks(const OUString& rStr) const; OUString& DelTrailingBlanks( OUString& rStr ) const; - xub_StrLen GetLeadingBlanks( const OUString& rStr ) const; - xub_StrLen GetTrailingBlanks( const OUString& rStr ) const; + sal_Int32 GetLeadingBlanks( const OUString& rStr ) const; + sal_Int32 GetTrailingBlanks( const OUString& rStr ) const; bool IsFirstCharCapital( const SwTxtNode& rNd ) const; sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, sal_Int32& rPos, @@ -200,7 +199,7 @@ class SwAutoFormat /// delete the previous paragraph void DelPrevPara(); /// execute AutoCorrect on current TextNode - void AutoCorrect( xub_StrLen nSttPos = 0 ); + void AutoCorrect( sal_Int32 nSttPos = 0 ); bool CanJoin( const SwTxtNode* pTxtNd ) const { @@ -208,7 +207,7 @@ class SwAutoFormat !IsEmptyLine( *pTxtNd ) && !IsNoAlphaLine( *pTxtNd) && !IsEnumericChar( *pTxtNd ) && - ((STRING_MAXLEN - 50 - pTxtNd->GetTxt().getLength()) > + ((COMPLETE_STRING - 50 - pTxtNd->GetTxt().getLength()) > pAktTxtNd->GetTxt().getLength()) && !HasBreakAttr( *pTxtNd ); } @@ -502,7 +501,7 @@ sal_Bool SwAutoFormat::IsNoAlphaLine( const SwTxtNode& rNd ) const if( rStr.isEmpty() ) return sal_False; // or better: determine via number of AlphaNum and !AlphaNum characters - xub_StrLen nANChar = 0, nBlnk = 0; + sal_Int32 nANChar = 0, nBlnk = 0; CharClass& rCC = GetCharClass( rNd.GetSwAttrSet().GetLanguage().GetLanguage() ); for( sal_Int32 n = 0, nEnd = rStr.getLength(); n < nEnd; ++n ) @@ -514,7 +513,7 @@ sal_Bool SwAutoFormat::IsNoAlphaLine( const SwTxtNode& rNd ) const // If there are 75% of non-alphanumeric characters, then sal_True sal_uLong nLen = rStr.getLength() - nBlnk; nLen = ( nLen * 3 ) / 4; // long overflow, if the strlen > sal_uInt16 - return xub_StrLen(nLen) < (rStr.getLength() - nANChar - nBlnk); + return sal_Int32(nLen) < (rStr.getLength() - nANChar - nBlnk); } bool SwAutoFormat::DoUnderline() @@ -524,7 +523,7 @@ bool SwAutoFormat::DoUnderline() OUString const& rTxt(pAktTxtNd->GetTxt()); int eState = 0; - xub_StrLen nCnt = 0; + sal_Int32 nCnt = 0; while (nCnt < rTxt.getLength()) { int eTmp = 0; @@ -604,8 +603,8 @@ bool SwAutoFormat::DoTable() return false; const OUString& rTmp = pAktTxtNd->GetTxt(); - xub_StrLen nSttPlus = GetLeadingBlanks( rTmp ); - xub_StrLen nEndPlus = GetTrailingBlanks( rTmp ); + sal_Int32 nSttPlus = GetLeadingBlanks( rTmp ); + sal_Int32 nEndPlus = GetTrailingBlanks( rTmp ); sal_Unicode cChar; if( 2 > nEndPlus - nSttPlus || @@ -615,7 +614,7 @@ bool SwAutoFormat::DoTable() SwTxtFrmInfo aInfo( pAktTxtFrm ); - xub_StrLen n = nSttPlus; + sal_Int32 n = nSttPlus; std::vector<sal_uInt16> aPosArr; while (n < rTmp.getLength()) @@ -688,7 +687,7 @@ OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) const OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const { - xub_StrLen nL = rStr.getLength(), n = nL; + sal_Int32 nL = rStr.getLength(), n = nL; if( !nL ) return rStr; @@ -699,19 +698,19 @@ OUString& SwAutoFormat::DelTrailingBlanks( OUString& rStr ) const return rStr; } -xub_StrLen SwAutoFormat::GetLeadingBlanks( const OUString& rStr ) const +sal_Int32 SwAutoFormat::GetLeadingBlanks( const OUString& rStr ) const { - xub_StrLen nL; - xub_StrLen n; + sal_Int32 nL; + sal_Int32 n; for( nL = rStr.getLength(), n = 0; n < nL && IsSpace( rStr[ n ] ); ++n ) ; return n; } -xub_StrLen SwAutoFormat::GetTrailingBlanks( const OUString& rStr ) const +sal_Int32 SwAutoFormat::GetTrailingBlanks( const OUString& rStr ) const { - xub_StrLen nL = rStr.getLength(), n = nL; + sal_Int32 nL = rStr.getLength(), n = nL; if( !nL ) return 0; @@ -1394,7 +1393,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) DeleteCurrentParagraph( true, true ); bool bChgBullet = false, bChgEnum = false; - xub_StrLen nAutoCorrPos = 0; + sal_Int32 nAutoCorrPos = 0; // if numbering is set, get the current one SwNumRule aRule( pDoc->GetUniqueNumRuleName(), @@ -1706,7 +1705,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) bInsTab = false; } - xub_StrLen nSpaceStt = nSpacePos; + sal_Int32 nSpaceStt = nSpacePos; while (nSpaceStt && IsSpace(rStr[--nSpaceStt])) ; ++nSpaceStt; @@ -1794,7 +1793,7 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl ) } /// Start autocorrection for the current TextNode -void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) +void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) { SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get().GetAutoCorrect(); long aSvxFlags = pATst->GetFlags( ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 70a756fab7c3..589acf1a3213 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -492,7 +492,7 @@ OUString SwEditShell::GetDropTxt( const sal_uInt16 nChars ) const SwTxtNode* pTxtNd = pCrsr->GetNode( !pCrsr->HasMark() )->GetTxtNode(); if( pTxtNd ) { - xub_StrLen nDropLen = pTxtNd->GetDropLen( nChars ); + sal_Int32 nDropLen = pTxtNd->GetDropLen( nChars ); if( nDropLen ) aTxt = pTxtNd->GetTxt().copy(0, nDropLen); } @@ -540,14 +540,14 @@ OUString SwEditShell::Calculate() sal_Unicode ch; bool bValidFlds = false; - xub_StrLen nPos = 0; + sal_Int32 nPos = 0; while( nPos < aStr.getLength() ) { ch = aStr[ nPos++ ]; if( rCC.isLetter( aStr, nPos-1 ) || ch == '_' ) { - xub_StrLen nTmpStt = nPos-1; + sal_Int32 nTmpStt = nPos-1; while( nPos < aStr.getLength() && 0 != ( ch = aStr[ nPos++ ]) && (rCC.isLetterNumeric( aStr, nPos - 1 ) || @@ -884,7 +884,7 @@ sal_uInt16 SwEditShell::GetLineCount( sal_Bool bActPos ) { if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTxtFrm() ) { - xub_StrLen nActPos = bActPos && aStart == rPtIdx ? + sal_Int32 nActPos = bActPos && aStart == rPtIdx ? pPam->GetPoint()->nContent.GetIndex() : USHRT_MAX; nRet = nRet + ((SwTxtFrm*)pCntFrm)->GetLineCount( nActPos ); } @@ -1025,9 +1025,9 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) ShowCrsr(); const sal_Int32 nDiff = nNewCrsrPos - rPos.nContent.GetIndex(); if( 0 > nDiff ) - Left( (xub_StrLen)-nDiff, CRSR_SKIP_CHARS ); + Left( (sal_Int32)-nDiff, CRSR_SKIP_CHARS ); else if( 0 < nDiff ) - Right( (xub_StrLen)nDiff, CRSR_SKIP_CHARS ); + Right( (sal_Int32)nDiff, CRSR_SKIP_CHARS ); SetOverwriteCrsr( rData.IsCursorOverwrite() ); diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 508c37f812a9..2974c7be88a5 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -90,8 +90,8 @@ static void lcl_GetLayTree( const SwFrm* pFrm, std::vector<const SwFrm*>& rArr ) } } -bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, - const SwTxtNode& rBehindNd, sal_uInt16 nSttPos ) +bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos, + const SwTxtNode& rBehindNd, sal_Int32 nSttPos ) { const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False), *pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False); @@ -108,7 +108,7 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, ::lcl_GetLayTree( pFrm, aRefArr ); ::lcl_GetLayTree( pMyFrm, aArr ); - sal_uInt16 nRefCnt = aRefArr.size() - 1, nCnt = aArr.size() - 1; + size_t nRefCnt = aRefArr.size() - 1, nCnt = aArr.size() - 1; sal_Bool bVert = sal_False; sal_Bool bR2L = sal_False; diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 8d9383138152..fc4ee3e4f7bb 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -54,8 +54,8 @@ namespace sw { virtual void repositionMark(::sw::mark::IMark* io_pMark, const SwPaM& rPaM); virtual bool renameMark(::sw::mark::IMark* io_pMark, const OUString& rNewName); - virtual void correctMarksAbsolute(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const xub_StrLen nOffset); - virtual void correctMarksRelative(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const xub_StrLen nOffset); + virtual void correctMarksAbsolute(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const sal_Int32 nOffset); + virtual void correctMarksRelative(const SwNodeIndex& rOldNode, const SwPosition& rNewPos, const sal_Int32 nOffset); virtual void deleteMarks(const SwNodeIndex& rStt, const SwNodeIndex& rEnd, ::std::vector< ::sw::mark::SaveBookmark>* pSaveBkmk, const SwIndex* pSttIdx, const SwIndex* pEndIdx); diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx index 84e6a6507342..e2336e9860d2 100644 --- a/sw/source/core/inc/UndoAttribute.hxx +++ b/sw/source/core/inc/UndoAttribute.hxx @@ -156,7 +156,7 @@ class SwUndoFmtResetAttr : public SwUndo class SwUndoDontExpandFmt : public SwUndo { const sal_uLong m_nNodeIndex; - const xub_StrLen m_nContentIndex; + const sal_Int32 m_nContentIndex; public: SwUndoDontExpandFmt( const SwPosition& rPos ); diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx index 787d93a5c952..997b589a9e18 100644 --- a/sw/source/core/inc/UndoInsert.hxx +++ b/sw/source/core/inc/UndoInsert.hxx @@ -38,7 +38,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt OUString *pTxt, *pUndoTxt; SwRedlineData* pRedlData; sal_uLong nNode; - xub_StrLen nCntnt, nLen; + sal_Int32 nCntnt, nLen; sal_Bool bIsWordDelim : 1; sal_Bool bIsAppend : 1; sal_Bool m_bWithRsid : 1; @@ -55,7 +55,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt OUString * GetTxtFromDoc() const; public: - SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen, + SwUndoInsert( const SwNodeIndex& rNode, sal_Int32 nCntnt, sal_Int32 nLen, const IDocumentContentOperations::InsertFlags nInsertFlags, sal_Bool bWDelim = sal_True ); SwUndoInsert( const SwNodeIndex& rNode ); diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx index e43b4f62cf03..91f9c1aa0bc3 100644 --- a/sw/source/core/inc/UndoOverwrite.hxx +++ b/sw/source/core/inc/UndoOverwrite.hxx @@ -36,7 +36,7 @@ class SwUndoOverwrite: public SwUndo, private SwUndoSaveCntnt OUString aDelStr, aInsStr; SwRedlineSaveDatas* pRedlSaveData; sal_uLong nSttNode; - xub_StrLen nSttCntnt; + sal_Int32 nSttCntnt; sal_Bool bInsChar : 1; // no Overwrite, but Insert sal_Bool bGroup : 1; // TRUE: is already grouped; evaluated in CanGrouping() @@ -83,7 +83,7 @@ public: virtual void RedoImpl( ::sw::UndoRedoContext & ); virtual void RepeatImpl( ::sw::RepeatContext & ); - void AddChanges( SwTxtNode& rTNd, xub_StrLen nStart, xub_StrLen nLen, + void AddChanges( SwTxtNode& rTNd, sal_Int32 nStart, sal_Int32 nLen, ::com::sun::star::uno::Sequence <sal_Int32>& rOffsets ); sal_Bool HasData() const { return aChanges.size() > 0; } }; diff --git a/sw/source/core/inc/UndoRedline.hxx b/sw/source/core/inc/UndoRedline.hxx index 3db2a764cfde..946e41078e9f 100644 --- a/sw/source/core/inc/UndoRedline.hxx +++ b/sw/source/core/inc/UndoRedline.hxx @@ -66,14 +66,14 @@ public: // SwUndoTblCpyTbl needs this information: long NodeDiff() const { return nSttNode - nEndNode; } - xub_StrLen ContentStart() const { return nSttCntnt; } + sal_Int32 ContentStart() const { return nSttCntnt; } }; class SwUndoRedlineSort : public SwUndoRedline { SwSortOptions* pOpt; sal_uLong nSaveEndNode, nOffset; - xub_StrLen nSaveEndCntnt; + sal_Int32 nSaveEndCntnt; virtual void UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); virtual void RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam); diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx index c0224995cf2a..9a0f84e5f40e 100644 --- a/sw/source/core/inc/acorrect.hxx +++ b/sw/source/core/inc/acorrect.hxx @@ -57,15 +57,15 @@ public: SwAutoCorrDoc( SwEditShell& rEditShell, SwPaM& rPam, sal_Unicode cIns = 0 ); ~SwAutoCorrDoc(); - virtual sal_Bool Delete( xub_StrLen nStt, xub_StrLen nEnd ); - virtual sal_Bool Insert( xub_StrLen nPos, const OUString& rTxt ); - virtual sal_Bool Replace( xub_StrLen nPos, const OUString& rTxt ); - virtual sal_Bool ReplaceRange( xub_StrLen nPos, xub_StrLen nLen, const OUString& rTxt ); + virtual sal_Bool Delete( sal_Int32 nStt, sal_Int32 nEnd ); + virtual sal_Bool Insert( sal_Int32 nPos, const OUString& rTxt ); + virtual sal_Bool Replace( sal_Int32 nPos, const OUString& rTxt ); + virtual sal_Bool ReplaceRange( sal_Int32 nPos, sal_Int32 nLen, const OUString& rTxt ); - virtual sal_Bool SetAttr( xub_StrLen nStt, xub_StrLen nEnd, sal_uInt16 nSlotId, + virtual sal_Bool SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); - virtual sal_Bool SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const OUString& rURL ); + virtual sal_Bool SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& rURL ); // return text of a previous paragraph // If it does not exist or if there is nothing before, return blank. @@ -82,9 +82,9 @@ public: // - FnCptlSttWrd and // - FnCptlSttSntnc. // Afterwards the words can be added into exception list if needed. - virtual void SaveCpltSttWord( sal_uLong nFlag, xub_StrLen nPos, + virtual void SaveCpltSttWord( sal_uLong nFlag, sal_Int32 nPos, const OUString& rExceptWord, sal_Unicode cChar ); - virtual LanguageType GetLanguage( xub_StrLen nPos, sal_Bool bPrevPara ) const; + virtual LanguageType GetLanguage( sal_Int32 nPos, sal_Bool bPrevPara ) const; }; class SwAutoCorrExceptWord diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx index f922e8557242..cee98d607c84 100644 --- a/sw/source/core/inc/docfld.hxx +++ b/sw/source/core/inc/docfld.hxx @@ -95,7 +95,7 @@ public: { return FLYFRAME == eSetGetExpFldType ? CNTNT.pFlyFmt : 0; } sal_uLong GetNode() const { return nNode; } - xub_StrLen GetCntnt() const { return nCntnt; } + sal_Int32 GetCntnt() const { return nCntnt; } const void* GetPointer() const { return CNTNT.pTxtFld; } void GetPos( SwPosition& rPos ) const; diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx index b1e6b90b8504..0d4db6f469d0 100644 --- a/sw/source/core/inc/pamtyp.hxx +++ b/sw/source/core/inc/pamtyp.hxx @@ -41,8 +41,8 @@ bool GoInCntnt( SwPaM&, SwMoveFn); bool GoInCntntCells( SwPaM&, SwMoveFn); bool GoInCntntSkipHidden( SwPaM&, SwMoveFn); bool GoInCntntCellsSkipHidden( SwPaM&, SwMoveFn); -const SwTxtAttr* GetFrwrdTxtHint( const SwpHints&, sal_uInt16&, xub_StrLen ); -const SwTxtAttr* GetBkwrdTxtHint( const SwpHints&, sal_uInt16&, xub_StrLen ); +const SwTxtAttr* GetFrwrdTxtHint( const SwpHints&, sal_uInt16&, sal_Int32 ); +const SwTxtAttr* GetBkwrdTxtHint( const SwpHints&, sal_uInt16&, sal_Int32 ); sal_Bool GoNext(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode ); sal_Bool GoPrevious(SwNode* pNd, SwIndex * pIdx, sal_uInt16 nMode ); @@ -66,7 +66,7 @@ typedef SwCntntNode* (*GoNds)( SwNodeIndex*, sal_Bool ); typedef void (*GoDoc)( SwPosition* ); typedef void (*GoSection)( SwPosition* ); typedef bool (SwPosition:: *CmpOp)( const SwPosition& ) const; -typedef const SwTxtAttr* (*GetHint)( const SwpHints&, sal_uInt16&, xub_StrLen ); +typedef const SwTxtAttr* (*GetHint)( const SwpHints&, sal_uInt16&, sal_Int32 ); typedef bool (utl::TextSearch:: *SearchTxt)( const OUString&, sal_Int32*, sal_Int32*, ::com::sun::star::util::SearchResult* ); typedef void (SwNodes:: *MvSection)( SwNodeIndex * ) const; diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx index 53d90bdd5f22..3021f1bbd703 100644 --- a/sw/source/core/inc/txmsrt.hxx +++ b/sw/source/core/inc/txmsrt.hxx @@ -46,10 +46,10 @@ enum TOXSortType struct SwTOXSource { const SwCntntNode* pNd; - xub_StrLen nPos; + sal_Int32 nPos; sal_Bool bMainEntry; - SwTOXSource( const SwCntntNode* pNode, xub_StrLen n, sal_Bool bMain ) + SwTOXSource( const SwCntntNode* pNode, sal_Int32 n, sal_Bool bMain ) : pNd(pNode), nPos(n), bMainEntry(bMain) { } @@ -114,7 +114,7 @@ public: OUString GetFollowingText( sal_Bool bMorePages ) const; - OUString ToUpper( const OUString& rStr, xub_StrLen nPos ) const; + OUString ToUpper( const OUString& rStr, sal_Int32 nPos ) const; inline sal_Bool IsNumeric( const OUString& rStr ) const; }; @@ -130,7 +130,7 @@ struct SwTOXSortTabBase const SwTxtTOXMark* pTxtMark; const SwTOXInternational* pTOXIntl; sal_uLong nPos; - xub_StrLen nCntPos; + sal_Int32 nCntPos; sal_uInt16 nType; static sal_uInt16 nOpt; diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx index fcff17c64e24..f8e5aa551bbb 100644 --- a/sw/source/core/inc/unometa.hxx +++ b/sw/source/core/inc/unometa.hxx @@ -104,7 +104,7 @@ public: /// init params with position of the attribute content (w/out CH_TXTATR) bool SetContentRange( - SwTxtNode *& rpNode, xub_StrLen & rStart, xub_StrLen & rEnd) const; + SwTxtNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd) const; ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > GetParentText() const; diff --git a/sw/source/core/inc/unoparaframeenum.hxx b/sw/source/core/inc/unoparaframeenum.hxx index cfa3694eafd6..ad3ff745906c 100644 --- a/sw/source/core/inc/unoparaframeenum.hxx +++ b/sw/source/core/inc/unoparaframeenum.hxx @@ -41,11 +41,11 @@ class SwFrmFmt; struct FrameDependSortListEntry { - xub_StrLen nIndex; + sal_Int32 nIndex; sal_uInt32 nOrder; ::boost::shared_ptr<SwDepend> pFrameDepend; - FrameDependSortListEntry (xub_StrLen const i_nIndex, + FrameDependSortListEntry (sal_Int32 const i_nIndex, sal_uInt32 const i_nOrder, SwDepend * const i_pDepend) : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { } }; diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 334e96945994..bccf60b79627 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1206,7 +1206,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos ) if( LONG_MAX != nNewY ) { aVert.SetVertOrient( text::VertOrientation::NONE ); - xub_StrLen nOfs = + sal_Int32 nOfs = pFmt->GetAnchor().GetCntntAnchor()->nContent.GetIndex(); OSL_ENSURE( GetAnchorFrm()->IsTxtFrm(), "TxtFrm expected" ); pAutoFrm = (SwTxtFrm*)GetAnchorFrm(); @@ -1262,7 +1262,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos ) { if( !pAutoFrm ) { - xub_StrLen nOfs = pFmt->GetAnchor().GetCntntAnchor() + sal_Int32 nOfs = pFmt->GetAnchor().GetCntntAnchor() ->nContent.GetIndex(); OSL_ENSURE( GetAnchorFrm()->IsTxtFrm(), "TxtFrm expected"); pAutoFrm = (SwTxtFrm*)GetAnchorFrm(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 8ea602fee809..af9904188a52 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1131,7 +1131,7 @@ sal_Bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage, SwCntntNode *pCNd = (SwCntntNode*)pCnt->GetNode(); pPam->GetPoint()->nNode = *pCNd; - xub_StrLen nIdx; + sal_Int32 nIdx; if( fnPosPage == GetFirstSub ) nIdx = ((SwTxtFrm*)pCnt)->GetOfst(); else diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 462576aa49b4..bfb4c2752865 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1448,7 +1448,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements() case POR_FLD : { // check field type: - const xub_StrLen nIdx = static_cast<const SwFldPortion*>(pPor)->IsFollow() ? + const sal_Int32 nIdx = static_cast<const SwFldPortion*>(pPor)->IsFollow() ? rInf.GetIdx() - 1 : rInf.GetIdx(); const SwTxtAttr* pHint = mpPorInfo->mrTxtPainter.GetAttr( nIdx ); diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx index 696f34348ca6..af16121ee3c8 100644 --- a/sw/source/core/text/itrpaint.cxx +++ b/sw/source/core/text/itrpaint.cxx @@ -318,7 +318,7 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip, SeekAndChgBefore( GetInfo() ); else if ( pPor->IsQuoVadisPortion() ) { - xub_StrLen nOffset = GetInfo().GetIdx(); + sal_Int32 nOffset = GetInfo().GetIdx(); SeekStartAndChg( GetInfo(), sal_True ); if( GetRedln() && pCurr->HasRedline() ) GetRedln()->Seek( *pFnt, nOffset, 0 ); @@ -538,8 +538,8 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor, if( bUnder ) { - xub_StrLen nSt = *pTxtAttr->GetStart(); - xub_StrLen nEnd = *pTxtAttr->GetEnd(); + sal_Int32 nSt = *pTxtAttr->GetStart(); + sal_Int32 nEnd = *pTxtAttr->GetEnd(); if( nEnd > nSt ) { Range aTmp( nSt, nEnd - 1 ); @@ -552,7 +552,7 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor, } MSHORT i; - xub_StrLen nIndx = GetInfo().GetIdx(); + sal_Int32 nIndx = GetInfo().GetIdx(); long nUnderStart = 0; long nUnderEnd = 0; MSHORT nCnt = (MSHORT)aUnderMulti.GetRangeCount(); @@ -590,7 +590,7 @@ void SwTxtPainter::CheckSpecialUnderline( const SwLinePortion* pPor, SwAttrIter aIter( *(SwTxtNode*)GetInfo().GetTxtFrm()->GetTxtNode(), rScriptInfo ); - xub_StrLen nTmpIdx = nIndx; + sal_Int32 nTmpIdx = nIndx; sal_uLong nSumWidth = 0; sal_uLong nSumHeight = 0; sal_uLong nBold = 0; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 1d59791ec141..88b644b52e25 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -872,7 +872,6 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) { SAL_WARN_IF( i18n::ScriptType::WEAK == nScript, "sw.core", "Inserting WEAK into SwScriptInfo structure" ); - SAL_WARN_IF( STRING_LEN == nChg, "sw.core", "65K? Strange length of script section" ); sal_Int32 nSearchStt = nChg; nChg = g_pBreakIt->GetBreakIter()->endOfScript( rTxt, nSearchStt, nScript ); diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx index 667f13d6eb0c..bc61fd5806e7 100644 --- a/sw/source/core/text/porlay.hxx +++ b/sw/source/core/text/porlay.hxx @@ -20,7 +20,6 @@ #define INCLUDED_SW_SOURCE_CORE_TEXT_PORLAY_HXX #include <tools/fract.hxx> -#include <tools/string.hxx> #include <scriptinfo.hxx> #include "swrect.hxx" diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 2fa2835d160f..2c25bd470335 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -330,11 +330,11 @@ SwTxtFormatter::TryNewNoLengthPortion(SwTxtFormatInfo & rInfo) { if (pHints) { - const xub_StrLen nIdx(rInfo.GetIdx()); + const sal_Int32 nIdx(rInfo.GetIdx()); while (m_nHintEndIndex < pHints->GetEndCount()) { SwTxtAttr & rHint( *pHints->GetEnd(m_nHintEndIndex) ); - xub_StrLen const nEnd( *rHint.GetAnyEnd() ); + sal_Int32 const nEnd( *rHint.GetAnyEnd() ); if (nEnd > nIdx) { break; diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index accee9b4a976..1f079c5519a3 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -141,7 +141,7 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf ) if( !GetNext() && !rInf.GetTxtFly()->IsOn() && !pFrm->GetFollow() ) return bRet; - xub_StrLen nWrdStart = nStart; + sal_Int32 nWrdStart = nStart; // Wir muessen die alte Zeile erhalten. Ein Beispiel: // Das Attribut fuer Trennung wurde nicht gesetzt, @@ -222,8 +222,8 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf ) // Start() hangelt sich zum End() rHyphInf.nWordStart = nWrdStart; - xub_StrLen nLen = 0; - const xub_StrLen nEnd = nWrdStart; + sal_Int32 nLen = 0; + const sal_Int32 nEnd = nWrdStart; // Wir suchen vorwaerts Reference< XHyphenatedWord > xHyphWord; @@ -231,8 +231,8 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf ) Boundary aBound = g_pBreakIt->GetBreakIter()->getWordBoundary( rInf.GetTxt(), nWrdStart, g_pBreakIt->GetLocale( rInf.GetFont()->GetLanguage() ), WordType::DICTIONARY_WORD, sal_True ); - nWrdStart = static_cast<xub_StrLen>(aBound.startPos); - nLen = static_cast<xub_StrLen>(aBound.endPos - nWrdStart); + nWrdStart = static_cast<sal_Int32>(aBound.startPos); + nLen = static_cast<sal_Int32>(aBound.endPos - nWrdStart); bRet = 0 != nLen; if( bRet ) { @@ -282,7 +282,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) return sal_False; SwHyphPortion *pHyphPor; - xub_StrLen nPorEnd; + sal_Int32 nPorEnd; SwTxtSizeInfo aInf( rInf ); // first case: hyphenated word has alternative spelling @@ -294,7 +294,7 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) OUString aAltTxt = aAltSpell.aReplacement; nPorEnd = aAltSpell.nChangedPos + rGuess.BreakStart() - rGuess.FieldDiff(); - xub_StrLen nTmpLen = 0; + sal_Int32 nTmpLen = 0; // soft hyphen at alternative spelling position? if( rInf.GetTxt()[ rInf.GetSoftHyphPos() ] == CHAR_SOFTHYPHEN ) @@ -564,7 +564,7 @@ void SwSoftHyphPortion::FormatEOL( SwTxtFormatInfo &rInf ) // 5964: alte Werte muessen wieder zurueckgesetzt werden. const SwTwips nOldX = rInf.X(); - const xub_StrLen nOldIdx = rInf.GetIdx(); + const sal_Int32 nOldIdx = rInf.GetIdx(); rInf.X( rInf.X() - PrtWidth() ); rInf.SetIdx( rInf.GetIdx() - GetLen() ); const sal_Bool bFull = SwHyphPortion::Format( rInf ); diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 2cee143bb54b..b32a30155065 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -43,8 +43,8 @@ #include <comcore.hrc> #include <numrule.hxx> -extern bool IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos, - const SwTxtNode& rBehindNd, xub_StrLen nSttPos ); +extern bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos, + const SwTxtNode& rBehindNd, sal_Int32 nSttPos ); using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -100,7 +100,7 @@ SwTOXInternational::~SwTOXInternational() delete pIndexWrapper; } -OUString SwTOXInternational::ToUpper( const OUString& rStr, xub_StrLen nPos ) const +OUString SwTOXInternational::ToUpper( const OUString& rStr, sal_Int32 nPos ) const { return pCharClass->uppercase( rStr, nPos, 1 ); } @@ -147,7 +147,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd, if( pNd ) { - xub_StrLen n = 0; + sal_Int32 n = 0; if( pTxtMark ) n = *pTxtMark->GetStart(); SwTOXSource aTmp( pNd, n, diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index d24a505a28d4..e1477f157969 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -491,9 +491,9 @@ void SwTxtInputFld::UpdateFieldContent() OSL_ENSURE( (*End()) - (*GetStart()) >= 2, "<SwTxtInputFld::UpdateFieldContent()> - Are CH_TXT_ATR_INPUTFIELDSTART and/or CH_TXT_ATR_INPUTFIELDEND missing?" ); // skip CH_TXT_ATR_INPUTFIELDSTART character - const xub_StrLen nIdx = (*GetStart()) + 1; + const sal_Int32 nIdx = (*GetStart()) + 1; // skip CH_TXT_ATR_INPUTFIELDEND character - const xub_StrLen nLen = static_cast<xub_StrLen>(std::max<sal_Int32>( 0, ( (*End()) - 1 - nIdx ) )); + const sal_Int32 nLen = static_cast<sal_Int32>(std::max<sal_Int32>( 0, ( (*End()) - 1 - nIdx ) )); const OUString aNewFieldContent = GetTxtNode().GetExpandTxt( nIdx, nLen ); const SwInputField* pInputFld = dynamic_cast<const SwInputField*>(GetFmtFld().GetField()); @@ -530,7 +530,7 @@ void SwTxtInputFld::UpdateTextNodeContent( const OUString& rNewContent ) // text annotation field SwTxtAnnotationFld::SwTxtAnnotationFld( SwFmtFld & rAttr, - xub_StrLen const nStart, + sal_Int32 const nStart, bool const bInClipboard ) : SwTxtFld( rAttr, nStart, bInClipboard ) { diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index 0655d059d43d..1ee3f8f7d304 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -55,7 +55,7 @@ SfxPoolItem* SwFmtFlyCnt::Clone( SfxItemPool* ) const return new SwFmtFlyCnt( pFmt ); } -SwTxtFlyCnt::SwTxtFlyCnt( SwFmtFlyCnt& rAttr, xub_StrLen nStartPos ) +SwTxtFlyCnt::SwTxtFlyCnt( SwFmtFlyCnt& rAttr, sal_Int32 nStartPos ) : SwTxtAttr( rAttr, nStartPos ) { rAttr.pTxtAttr = this; diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index d3040217ff8c..a3408bd3dce7 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -238,7 +238,7 @@ OUString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrings ) con * class SwTxt/FmtFnt *************************************************************************/ -SwTxtFtn::SwTxtFtn( SwFmtFtn& rAttr, xub_StrLen nStartPos ) +SwTxtFtn::SwTxtFtn( SwFmtFtn& rAttr, sal_Int32 nStartPos ) : SwTxtAttr( rAttr, nStartPos ) , m_pStartNode( 0 ) , m_pTxtNode( 0 ) diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 998c5923fb74..0a2c4c529d71 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -44,7 +44,7 @@ TYPEINIT1(SwTxtRuby,SwClient); *************************************************************************/ SwTxtCharFmt::SwTxtCharFmt( SwFmtCharFmt& rAttr, - xub_StrLen nStt, xub_StrLen nEnde ) + sal_Int32 nStt, sal_Int32 nEnde ) : SwTxtAttrEnd( rAttr, nStt, nEnde ) , m_pTxtNode( 0 ) , m_nSortNumber( 0 ) @@ -89,7 +89,7 @@ bool SwTxtCharFmt::GetInfo( SfxPoolItem& rInfo ) const *************************************************************************/ SwTxtAttrNesting::SwTxtAttrNesting( SfxPoolItem & i_rAttr, - const xub_StrLen i_nStart, const xub_StrLen i_nEnd ) + const sal_Int32 i_nStart, const sal_Int32 i_nEnd ) : SwTxtAttrEnd( i_rAttr, i_nStart, i_nEnd ) { SetDontExpand( true ); // never expand this attribute @@ -110,7 +110,7 @@ SwTxtAttrNesting::~SwTxtAttrNesting() *************************************************************************/ SwTxtINetFmt::SwTxtINetFmt( SwFmtINetFmt& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) + sal_Int32 nStart, sal_Int32 nEnd ) : SwTxtAttrNesting( rAttr, nStart, nEnd ) , SwClient( 0 ) , m_pTxtNode( 0 ) @@ -212,7 +212,7 @@ sal_Bool SwTxtINetFmt::IsProtect( ) const *************************************************************************/ SwTxtRuby::SwTxtRuby( SwFmtRuby& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) + sal_Int32 nStart, sal_Int32 nEnd ) : SwTxtAttrNesting( rAttr, nStart, nEnd ) , SwClient( 0 ) , m_pTxtNode( 0 ) @@ -302,8 +302,8 @@ SwTxtMeta::CreateTxtMeta( ::sw::MetaFieldManager & i_rTargetDocManager, SwTxtNode *const i_pTargetTxtNode, SwFmtMeta & i_rAttr, - xub_StrLen const i_nStart, - xub_StrLen const i_nEnd, + sal_Int32 const i_nStart, + sal_Int32 const i_nEnd, bool const i_bIsCopy) { if (COPY == i_bIsCopy) @@ -316,7 +316,7 @@ SwTxtMeta::CreateTxtMeta( } SwTxtMeta::SwTxtMeta( SwFmtMeta & i_rAttr, - const xub_StrLen i_nStart, const xub_StrLen i_nEnd ) + const sal_Int32 i_nStart, const sal_Int32 i_nEnd ) : SwTxtAttrNesting( i_rAttr, i_nStart, i_nEnd ) { i_rAttr.SetTxtAttr( this ); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 0aa4ea2e8141..51266c1238f0 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -473,7 +473,7 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) SwTxtNode * pDelTxtNd = pStt->nNode.GetNode().GetTxtNode(); if( !pDelTxtNd ) return sal_False; - xub_StrLen nUChrPos = bBackSp ? 0 : pSttStr->getLength()-1; + sal_Int32 nUChrPos = bBackSp ? 0 : pSttStr->getLength()-1; sal_Unicode cDelChar = pDelTxtNd->GetTxt()[ pStt->nContent.GetIndex() ]; CharClass& rCC = GetAppCharClass(); if( ( CH_TXTATR_BREAKWORD == cDelChar || CH_TXTATR_INWORD == cDelChar ) || @@ -618,7 +618,7 @@ OUString DenoteSpecialCharacters(const OUString & rStr) if (!rStr.isEmpty()) { bool bStart = false; - xub_StrLen nStart = 0; + sal_Int32 nStart = 0; sal_Unicode cLast = 0; for( sal_Int32 i = 0; i < rStr.getLength(); i++) diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 864af5cfd4e9..258bed3ca831 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -107,8 +107,8 @@ void SwUndoInsert::Init(const SwNodeIndex & rNd) } // #111827# -SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd, xub_StrLen nCnt, - xub_StrLen nL, +SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd, sal_Int32 nCnt, + sal_Int32 nL, const IDocumentContentOperations::InsertFlags nInsertFlags, sal_Bool bWDelim ) : SwUndo(UNDO_TYPING), pTxt( 0 ), pRedlData( 0 ), @@ -494,7 +494,7 @@ class SwUndoReplace::Impl OUString m_sOld; OUString m_sIns; sal_uLong m_nSttNd, m_nEndNd, m_nOffset; - xub_StrLen m_nSttCnt, m_nEndCnt, m_nSetPos, m_nSelEnd; + sal_Int32 m_nSttCnt, m_nEndCnt, m_nSetPos, m_nSelEnd; bool m_bSplitNext : 1; bool m_bRegExp : 1; // metadata references for paragraph and following para (if m_bSplitNext) diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index 5ab65728658f..364813215923 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -326,9 +326,9 @@ struct _UndoTransliterate_Data SwHistory* pHistory; Sequence< sal_Int32 >* pOffsets; sal_uLong nNdIdx; - xub_StrLen nStart, nLen; + sal_Int32 nStart, nLen; - _UndoTransliterate_Data( sal_uLong nNd, xub_StrLen nStt, xub_StrLen nStrLen, const OUString& rTxt ) + _UndoTransliterate_Data( sal_uLong nNd, sal_Int32 nStt, sal_Int32 nStrLen, const OUString& rTxt ) : sText( rTxt ), pHistory( 0 ), pOffsets( 0 ), nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen ) {} @@ -382,12 +382,12 @@ void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam) } void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd, - xub_StrLen nStart, xub_StrLen nLen, + sal_Int32 nStart, sal_Int32 nLen, uno::Sequence <sal_Int32>& rOffsets ) { long nOffsLen = rOffsets.getLength(); _UndoTransliterate_Data* pNew = new _UndoTransliterate_Data( - rTNd.GetIndex(), nStart, (xub_StrLen)nOffsLen, + rTNd.GetIndex(), nStart, (sal_Int32)nOffsLen, rTNd.GetTxt().copy(nStart, nLen)); aChanges.push_back( pNew ); diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 0d2254005e00..76f64befafc3 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -876,7 +876,7 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex) { if(0 <= nIndex && GetDoc()->GetTblFrmFmtCount(true) > nIndex) { - SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt( static_cast< xub_StrLen >(nIndex), true); + SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(nIndex, true); uno::Reference< XTextTable > xTbl = SwXTextTables::GetObject(rFmt); aRet.setValue( &xTbl, ::getCppuType((uno::Reference< XTextTable>*)0)); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 8d9a2003dc02..cb90da131095 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -794,7 +794,7 @@ void SwXTextCursor::DeleteAndInsert(const OUString& rText, // Start/EndAction SwDoc* pDoc = pUnoCrsr->GetDoc(); UnoActionContext aAction(pDoc); - const xub_StrLen nTxtLen = rText.getLength(); + const sal_Int32 nTxtLen = rText.getLength(); pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL); SwCursor * pCurrent = pUnoCrsr; do @@ -834,8 +834,8 @@ lcl_ForceIntoMeta(SwPaM & rCursor, if (!pXMeta) throw uno::RuntimeException(); SwTxtNode * pTxtNode; - xub_StrLen nStart; - xub_StrLen nEnd; + sal_Int32 nStart; + sal_Int32 nEnd; const bool bSuccess( pXMeta->SetContentRange(pTxtNode, nStart, nEnd) ); OSL_ENSURE(bSuccess, "no pam?"); if (!bSuccess) @@ -878,8 +878,8 @@ bool SwXTextCursor::IsAtEndOfMeta() const if (pCursor && pXMeta) { SwTxtNode * pTxtNode; - xub_StrLen nStart; - xub_StrLen nEnd; + sal_Int32 nStart; + sal_Int32 nEnd; const bool bSuccess( pXMeta->SetContentRange(pTxtNode, nStart, nEnd) ); OSL_ENSURE(bSuccess, "no pam?"); diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index eb75da8da86d..7a46dd0ac1bb 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -213,7 +213,7 @@ namespace { } - xub_StrLen getIndex () + sal_Int32 getIndex () { return maPosition.nContent.GetIndex(); } @@ -385,7 +385,7 @@ throw( container::NoSuchElementException, lang::WrappedTargetException, return any; } -typedef ::std::deque< xub_StrLen > FieldMarks_t; +typedef ::std::deque< sal_Int32 > FieldMarks_t; static void lcl_FillFieldMarkArray(FieldMarks_t & rFieldMarks, SwUnoCrsr const & rUnoCrsr, @@ -688,7 +688,7 @@ lcl_ExportHints( SwpHints * const pHints, const sal_Int32 i_nStartPos, const sal_Int32 i_nEndPos, - const xub_StrLen nCurrentIndex, + const sal_Int32 nCurrentIndex, const bool bRightMoveForbidden, bool & o_rbCursorMoved, sal_Int32 & o_rNextAttrPosition ) @@ -982,7 +982,7 @@ lcl_ExportHints( } static void lcl_MoveCursor( SwUnoCrsr * const pUnoCrsr, - const xub_StrLen nCurrentIndex, + const sal_Int32 nCurrentIndex, const sal_Int32 nNextFrameIndex, const sal_Int32 nNextPortionIndex, const sal_Int32 nNextAttrIndex, @@ -1148,7 +1148,7 @@ static sal_Int32 lcl_ExportFrames( Reference<XText> const & i_xParent, SwUnoCrsr * const i_pUnoCrsr, FrameDependSortList_t & i_rFrames, - xub_StrLen const i_nCurrentIndex) + sal_Int32 const i_nCurrentIndex) { // find first Frame in (sorted) i_rFrames at current position while (i_rFrames.size() && (i_rFrames.front().nIndex == i_nCurrentIndex)) @@ -1214,7 +1214,7 @@ static void lcl_CreatePortions( (i_nStartPos <= pUnoCrsr->Start()->nNode.GetNode().GetTxtNode()-> GetTxt().getLength()), "Incorrect start position" ); // ??? should this be i_nStartPos - current position ? - pUnoCrsr->Right(static_cast<xub_StrLen>(i_nStartPos), + pUnoCrsr->Right(static_cast<sal_Int32>(i_nStartPos), CRSR_SKIP_CHARS, sal_False, sal_False); } diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 75337dd0ba5e..d40a8c281df7 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -359,8 +359,8 @@ void SAL_CALL SwXReferenceMark::dispose() throw (uno::RuntimeException) &m_pImpl->m_pDoc->GetNodes())) { SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode(); - const xub_StrLen nStt = *pTxtMark->GetStart(); - const xub_StrLen nEnd = pTxtMark->End() + const sal_Int32 nStt = *pTxtMark->GetStart(); + const sal_Int32 nEnd = pTxtMark->End() ? *pTxtMark->End() : nStt + 1; @@ -432,8 +432,8 @@ throw (uno::RuntimeException) &m_pImpl->m_pDoc->GetNodes())) { SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode(); - const xub_StrLen nStt = *pTxtMark->GetStart(); - const xub_StrLen nEnd = pTxtMark->End() + const sal_Int32 nStt = *pTxtMark->GetStart(); + const sal_Int32 nEnd = pTxtMark->End() ? *pTxtMark->End() : nStt + 1; @@ -612,8 +612,8 @@ throw (uno::RuntimeException) if (IsValid()) { SwTxtNode * pTxtNode; - xub_StrLen nMetaStart; - xub_StrLen nMetaEnd; + sal_Int32 nMetaStart; + sal_Int32 nMetaEnd; const bool bSuccess( m_rMeta.SetContentRange(pTxtNode, nMetaStart, nMetaEnd) ); if (bSuccess) @@ -798,7 +798,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta, SAL_WNODEPRECATED_DECLARATIONS_POP bool SwXMeta::SetContentRange( - SwTxtNode *& rpNode, xub_StrLen & rStart, xub_StrLen & rEnd ) const + SwTxtNode *& rpNode, sal_Int32 & rStart, sal_Int32 & rEnd ) const { ::sw::Meta const * const pMeta( m_pImpl->GetMeta() ); if (pMeta) @@ -823,8 +823,8 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) throw (lang::IllegalArgumentException, uno::RuntimeException) { SwTxtNode * pTxtNode; - xub_StrLen nMetaStart; - xub_StrLen nMetaEnd; + sal_Int32 nMetaStart; + sal_Int32 nMetaEnd; const bool bSuccess( SetContentRange(pTxtNode, nMetaStart, nMetaEnd) ); OSL_ENSURE(bSuccess, "no pam?"); if (!bSuccess) @@ -963,8 +963,8 @@ SwXMeta::dispose() throw (uno::RuntimeException) else if (!m_pImpl->m_bIsDisposed) { SwTxtNode * pTxtNode; - xub_StrLen nMetaStart; - xub_StrLen nMetaEnd; + sal_Int32 nMetaStart; + sal_Int32 nMetaEnd; const bool bSuccess(SetContentRange(pTxtNode, nMetaStart, nMetaEnd)); OSL_ENSURE(bSuccess, "no pam?"); if (bSuccess) @@ -1093,8 +1093,8 @@ SwXMeta::getAnchor() throw (uno::RuntimeException) } SwTxtNode * pTxtNode; - xub_StrLen nMetaStart; - xub_StrLen nMetaEnd; + sal_Int32 nMetaStart; + sal_Int32 nMetaEnd; const bool bSuccess(SetContentRange(pTxtNode, nMetaStart, nMetaEnd)); OSL_ENSURE(bSuccess, "no pam?"); if (!bSuccess) @@ -1206,8 +1206,8 @@ SwXMeta::getParent() throw (uno::RuntimeException) { SolarMutexGuard g; SwTxtNode * pTxtNode; - xub_StrLen nMetaStart; - xub_StrLen nMetaEnd; + sal_Int32 nMetaStart; + sal_Int32 nMetaEnd; bool const bSuccess( SetContentRange(pTxtNode, nMetaStart, nMetaEnd) ); OSL_ENSURE(bSuccess, "no pam?"); if (!bSuccess) { throw lang::DisposedException(); } @@ -1260,8 +1260,8 @@ SwXMeta::createEnumeration() throw (uno::RuntimeException) } SwTxtNode * pTxtNode; - xub_StrLen nMetaStart; - xub_StrLen nMetaEnd; + sal_Int32 nMetaStart; + sal_Int32 nMetaEnd; const bool bSuccess(SetContentRange(pTxtNode, nMetaStart, nMetaEnd)); OSL_ENSURE(bSuccess, "no pam?"); if (!bSuccess) diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 92af2f9401cb..e78e6d0c06b7 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -37,7 +37,6 @@ #include <editeng/frmdiritem.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> -#include <tools/string.hxx> #include <fmtpdsc.hxx> #include <fmtanchr.hxx> #include <fmtornt.hxx> @@ -1734,14 +1733,8 @@ sal_Bool SwHTMLParser::FileDownload( const OUString& rURL, aStream << *pStream; aStream.Seek( STREAM_SEEK_TO_END ); - OSL_ENSURE( aStream.Tell() < STRING_MAXLEN, - "File zu lang fuer einen String, Ende abgeschnitten" ); - xub_StrLen nLen = aStream.Tell() < STRING_MAXLEN - ? (xub_StrLen)aStream.Tell() - : STRING_MAXLEN; - - rStr = OUString( (const sal_Char *)aStream.GetData(), nLen - , GetSrcEncoding() ); + rStr = OUString((const sal_Char *)aStream.GetData(), aStream.Tell(), + GetSrcEncoding()); } diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index 64b8480ebb91..4c07230b79df 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -358,7 +358,7 @@ void SwHTMLWriter::CollectFlyFrms() } } -sal_Bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, xub_StrLen nCntntIdx, sal_uInt8 nPos, +sal_Bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, sal_Int32 nCntntIdx, sal_uInt8 nPos, HTMLOutContext *pContext ) { sal_Bool bFlysLeft = sal_False; // Noch Flys an aktueller Node-Position da? diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 82e739820d70..6e03137d1615 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -277,7 +277,7 @@ void SwHTMLWriter::OutForm( sal_Bool bTag_On, const SwStartNode *pStartNd ) uno::Reference< container::XIndexContainer > xCurrentFormComps;// die aktuelle Form in der Tabelle const SwStartNode *pCurrentStNd = 0; // und der Start-Node eines Ctrls - xub_StrLen nCurrentCtrls = 0; // und die in ihr gefundenen Controls + sal_Int32 nCurrentCtrls = 0; // und die in ihr gefundenen Controls sal_uInt32 nEndIdx = pStartNd->EndOfSectionIndex(); for( ; i < aHTMLControls.size() && aHTMLControls[i]->nNdIdx <= nEndIdx; i++ ) diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index fdf628dd3cda..4ba16d2f3215 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -2938,9 +2938,9 @@ SwStartNode *SwHTMLParser::InsertTempTableCaptionSection() } -xub_StrLen SwHTMLParser::StripTrailingLF() +sal_Int32 SwHTMLParser::StripTrailingLF() { - xub_StrLen nStripped = 0; + sal_Int32 nStripped = 0; const sal_Int32 nLen = pPam->GetPoint()->nContent.GetIndex(); if( nLen ) @@ -3133,7 +3133,7 @@ class _CellSaveStruct : public _SectionSaveStruct sal_uInt32 nNumFmt; sal_uInt16 nRowSpan, nColSpan, nWidth, nHeight; - xub_StrLen nNoBreakEndCntntPos; // Zeichen-Index eines </NOBR> + sal_Int32 nNoBreakEndCntntPos; // Zeichen-Index eines </NOBR> SvxAdjust eAdjust; sal_Int16 eVertOri; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index fee5ef19bd70..cedd1b73f052 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2088,7 +2088,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu { // Ein harter Zeilen-Umbruch am Ende muss immer entfernt werden. // Einen zweiten ersetzen wir durch einen Absatz-Abstand. - xub_StrLen nLFStripped = StripTrailingLF(); + sal_Int32 nLFStripped = StripTrailingLF(); if( (AM_NOSPACE==eMode || AM_SOFTNOSPACE==eMode) && nLFStripped > 1 ) eMode = AM_SPACE; @@ -2161,7 +2161,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu pAttr->GetSttPara() == rEndIdx && pAttr->GetSttCnt() == 0; - xub_StrLen nStt = pAttr->nSttCntnt; + sal_Int32 nStt = pAttr->nSttCntnt; sal_Bool bScript = sal_False, bFont = sal_False; sal_uInt16 nScriptItem; sal_Bool bInsert = sal_True; @@ -2202,7 +2202,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu nStt = nScriptEnd; nScriptTxt = g_pBreakIt->GetBreakIter()->getScriptType( rText, nStt ); - nScriptEnd = (xub_StrLen)g_pBreakIt->GetBreakIter() + nScriptEnd = g_pBreakIt->GetBreakIter() ->endOfScript( rText, nStt, nScriptTxt ); } bInsert = nScriptItem == nScriptTxt; @@ -2285,7 +2285,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu // If it is equal to the style, or in fact the paragarph's value // for that hint, the hint is removed. Otherwise it's end position // is remembered. - xub_StrLen aEndPos[15] = + sal_Int32 aEndPos[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; SwpHints& rHints = pTxtNd->GetSwpHints(); for( sal_uInt16 i=0; i < nCntAttr; i++ ) @@ -2341,7 +2341,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu } if( nIdx != -1 ) { - xub_StrLen nStt = *pHt->GetStart(); + sal_Int32 nStt = *pHt->GetStart(); if( nStt >= aEndPos[nIdx] ) { sal_Bool bFont = (nIdx % 5) == 0; @@ -3091,7 +3091,7 @@ void SwHTMLParser::EndAttr( _HTMLAttr* pAttr, _HTMLAttr **ppDepAttr, pAttr->nSttCntnt = nScriptEnd; nScriptTxt = g_pBreakIt->GetBreakIter()->getScriptType( rText, nScriptEnd ); - nScriptEnd = (xub_StrLen)g_pBreakIt->GetBreakIter() + nScriptEnd = g_pBreakIt->GetBreakIter() ->endOfScript( rText, nScriptEnd, nScriptTxt ); } bInsert = nScriptItem == nScriptTxt; @@ -5484,7 +5484,7 @@ _HTMLAttr::_HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem, } _HTMLAttr::_HTMLAttr( const _HTMLAttr &rAttr, const SwNodeIndex &rEndPara, - sal_uInt16 nEndCnt, _HTMLAttr **ppHd ) : + sal_Int32 nEndCnt, _HTMLAttr **ppHd ) : nSttPara( rAttr.nSttPara ), nEndPara( rEndPara ), nSttCntnt( rAttr.nSttCntnt ), @@ -5505,7 +5505,7 @@ _HTMLAttr::~_HTMLAttr() delete pItem; } -_HTMLAttr *_HTMLAttr::Clone( const SwNodeIndex& rEndPara, sal_uInt16 nEndCnt ) const +_HTMLAttr *_HTMLAttr::Clone(const SwNodeIndex& rEndPara, sal_Int32 nEndCnt) const { // das Attribut mit der alten Start-Position neu anlegen _HTMLAttr *pNew = new _HTMLAttr( *this, rEndPara, nEndCnt, ppHead ); @@ -5516,8 +5516,8 @@ _HTMLAttr *_HTMLAttr::Clone( const SwNodeIndex& rEndPara, sal_uInt16 nEndCnt ) c return pNew; } -void _HTMLAttr::Reset( const SwNodeIndex& rSttPara, sal_uInt16 nSttCnt, - _HTMLAttr **ppHd ) +void _HTMLAttr::Reset(const SwNodeIndex& rSttPara, sal_Int32 nSttCnt, + _HTMLAttr **ppHd) { // den Anfang (und das Ende) neu setzen nSttPara = rSttPara; diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index fedc3afd80b9..0552155cdb92 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -72,7 +72,7 @@ class _HTMLAttr friend class _CellSaveStruct; SwNodeIndex nSttPara, nEndPara; - xub_StrLen nSttCntnt, nEndCntnt; + sal_Int32 nSttCntnt, nEndCntnt; sal_Bool bInsAtStart : 1; sal_Bool bLikePara : 1; // Attribut ueber dem gesamten Absatz setzen sal_Bool bValid : 1; // ist das Attribut gueltig? @@ -87,14 +87,14 @@ class _HTMLAttr _HTMLAttr **pHd=0 ); _HTMLAttr( const _HTMLAttr &rAttr, const SwNodeIndex &rEndPara, - xub_StrLen nEndCnt, _HTMLAttr **pHd ); + sal_Int32 nEndCnt, _HTMLAttr **pHd ); public: ~_HTMLAttr(); - _HTMLAttr *Clone( const SwNodeIndex& rEndPara, xub_StrLen nEndCnt ) const; - void Reset( const SwNodeIndex& rSttPara, xub_StrLen nSttCnt, + _HTMLAttr *Clone( const SwNodeIndex& rEndPara, sal_Int32 nEndCnt ) const; + void Reset( const SwNodeIndex& rSttPara, sal_Int32 nSttCnt, _HTMLAttr **pHd ); inline void SetStart( const SwPosition& rPos ); @@ -104,8 +104,8 @@ public: const SwNodeIndex& GetSttPara() const { return nSttPara; } const SwNodeIndex& GetEndPara() const { return nEndPara; } - xub_StrLen GetSttCnt() const { return nSttCntnt; } - xub_StrLen GetEndCnt() const { return nEndCntnt; } + sal_Int32 GetSttCnt() const { return nSttCntnt; } + sal_Int32 GetEndCnt() const { return nEndCntnt; } sal_Bool IsLikePara() const { return bLikePara; } void SetLikePara( sal_Bool bPara=sal_True ) { bLikePara = bPara; } @@ -381,7 +381,7 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient _HTMLAttrTable aAttrTab; // "offene" Attribute _HTMLAttrContexts aContexts;// der aktuelle Attribut/Token-Kontext SwHTMLFrmFmts aMoveFlyFrms;// Fly-Frames, the anchor is moved - std::deque<xub_StrLen> aMoveFlyCnts;// and the Content-Positions + std::deque<sal_Int32> aMoveFlyCnts;// and the Content-Positions SwApplet_Impl *pAppletImpl; // das aktuelle Applet @@ -867,7 +867,7 @@ private: SwNodeIndex *GetFootEndNoteSection( const OUString& rName ); void DeleteFootEndNoteImpl(); - xub_StrLen StripTrailingLF(); + sal_Int32 StripTrailingLF(); // Remove empty paragraph at the PaM position void StripTrailingPara(); diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 796dbe0aa29f..e3ff3c7f08ea 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -862,13 +862,13 @@ sal_uInt16 SwHTMLWriter::OutHeaderAttrs() sal_uInt16 nAttrs = 0; sal_uInt16 nCntAttr = pTxtNd->GetSwpHints().Count(); - xub_StrLen nOldPos = 0; + sal_Int32 nOldPos = 0; for( sal_uInt16 i=0; i<nCntAttr; i++ ) { const SwTxtAttr *pHt = pTxtNd->GetSwpHints()[i]; if( !pHt->End() ) { - xub_StrLen nPos = *pHt->GetStart(); + sal_Int32 nPos = *pHt->GetStart(); if( nPos-nOldPos > 1 || ( pHt->Which() != RES_TXTATR_FIELD && pHt->Which() != RES_TXTATR_ANNOTATION ) ) diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index d62e210c13c7..95bd99dbc66c 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -187,7 +187,7 @@ struct HTMLControl // die Form, zu der das Control gehoert ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > xFormComps; sal_uLong nNdIdx; // der Node, in dem es verankert ist - xub_StrLen nCount; // wie viele Controls sind in dem Node + sal_Int32 nCount; // wie viele Controls sind in dem Node HTMLControl( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > & rForm, sal_uInt32 nIdx ); @@ -327,7 +327,7 @@ public: sal_uInt16 nDfltTopMargin; // die defaults, der nicht geschrieben sal_uInt16 nDfltBottomMargin; // werden muessen (aus der Vorlage) sal_uInt16 nIndentLvl; // wie weit ist eingerueckt? - xub_StrLen nWhishLineLen; // wie lang darf eine Zeile werden? + sal_Int32 nWhishLineLen; // wie lang darf eine Zeile werden? sal_uInt16 nDefListLvl; // welcher DL-Level existiert gerade sal_Int32 nDefListMargin; // Wie weit wird in DL eingerueckt sal_uInt16 nHeaderFooterSpace; @@ -406,7 +406,7 @@ public: void OutHyperlinkHRefValue( const OUString& rURL ); // gebe die evt. an der akt. Position stehenden FlyFrame aus. - sal_Bool OutFlyFrm( sal_uLong nNdIdx, xub_StrLen nCntntIdx, + sal_Bool OutFlyFrm( sal_uLong nNdIdx, sal_Int32 nCntntIdx, sal_uInt8 nPos, HTMLOutContext *pContext = 0 ); void OutFrmFmt( sal_uInt8 nType, const SwFrmFmt& rFmt, const SdrObject *pSdrObj ); @@ -477,7 +477,7 @@ public: void DecIndentLevel() { if ( nIndentLvl ) nIndentLvl--; } OString GetIndentString(sal_uInt16 nIncLvl = 0); - xub_StrLen GetLineLen() { return (xub_StrLen)(Strm().Tell()-nLastLFPos); } + sal_Int32 GetLineLen() { return (sal_Int32)(Strm().Tell()-nLastLFPos); } void OutNewLine( sal_Bool bCheck=sal_False ); // fuer HTMLSaveData diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index d05364c01c87..eece35d3da4e 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -392,8 +392,8 @@ void Writer::CreateBookmarkTbl() // search alle Bookmarks in the range and return it in the Array -sal_uInt16 Writer::GetBookmarks(const SwCntntNode& rNd, xub_StrLen nStt, - xub_StrLen nEnd, std::vector< const ::sw::mark::IMark* >& rArr) +sal_uInt16 Writer::GetBookmarks(const SwCntntNode& rNd, sal_Int32 nStt, + sal_Int32 nEnd, std::vector< const ::sw::mark::IMark* >& rArr) { OSL_ENSURE( rArr.empty(), "there are still entries available" ); @@ -412,7 +412,7 @@ sal_uInt16 Writer::GetBookmarks(const SwCntntNode& rNd, xub_StrLen nStt, for( SwBookmarkNodeTable::const_iterator it = aIterPair.first; it != aIterPair.second; ++it ) { const ::sw::mark::IMark& rBkmk = *(it->second); - xub_StrLen nCntnt; + sal_Int32 nCntnt; if( rBkmk.GetMarkPos().nNode == nNd && (nCntnt = rBkmk.GetMarkPos().nContent.GetIndex() ) >= nStt && nCntnt < nEnd ) diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 7df0858b5c16..038bb02afa11 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -81,8 +81,8 @@ class SwDropCapsPict : public Control { sal_uLong textWidth; ///< Physical width of this segment. sal_uInt16 scriptType; ///< Script type (e.g. Latin, Asian, Complex) - xub_StrLen changePos; ///< Character position where the script changes. - _ScriptInfo(sal_uLong txtWidth, sal_uInt16 scrptType, xub_StrLen position) + sal_Int32 changePos; ///< Character position where the script changes. + _ScriptInfo(sal_uLong txtWidth, sal_uInt16 scrptType, sal_Int32 position) : textWidth(txtWidth), scriptType(scrptType), changePos(position) {} bool operator<(_ScriptInfo other) { return changePos < other.changePos; } }; @@ -99,8 +99,8 @@ class SwDropCapsPict : public Control inline void InitPrinter( void ); void _InitPrinter( void ); void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich ); - void GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType); - bool GetNextScriptSegment(size_t &nIdx, xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType); + void GetFirstScriptSegment(sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType); + bool GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType); public: @@ -216,7 +216,7 @@ SwDropCapsPict::~SwDropCapsPict() /// @param[out] start The character position of the start of the segment. /// @param[out] end The character position of the end of the segment. /// @param[out] scriptType The script type (Latin, Asian, Complex etc.) -void SwDropCapsPict::GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType) +void SwDropCapsPict::GetFirstScriptSegment(sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType) { start = 0; if( maScriptChanges.empty() ) @@ -237,7 +237,7 @@ void SwDropCapsPict::GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, s /// @param[in,out] end The character position of the end of the segment. /// @param[out] scriptType The script type (Latin, Asian, Complex etc.) /// @returns True if there was a next segment, false if not. -bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType) +bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType) { if (maScriptChanges.empty() || nIdx >= maScriptChanges.size() - 1 || end >= maText.getLength()) return false; @@ -396,8 +396,8 @@ void SwDropCapsPict::DrawPrev( const Point& rPt ) Font aOldFont = mpPrinter->GetFont(); sal_uInt16 nScript; size_t nIdx = 0; - xub_StrLen nStart; - xub_StrLen nEnd; + sal_Int32 nStart; + sal_Int32 nEnd; GetFirstScriptSegment(nStart, nEnd, nScript); do { @@ -430,7 +430,7 @@ void SwDropCapsPict::CheckScript( void ) sal_uInt16 nChg = 0; if( css::i18n::ScriptType::WEAK == nScript ) { - nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); + nChg = (sal_Int32)xBreak->endOfScript( maText, nChg, nScript ); if( nChg < maText.getLength() ) nScript = xBreak->getScriptType( maText, nChg ); else @@ -439,7 +439,7 @@ void SwDropCapsPict::CheckScript( void ) do { - nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); + nChg = (sal_Int32)xBreak->endOfScript( maText, nChg, nScript ); maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) ); if( nChg < maText.getLength() ) @@ -455,8 +455,8 @@ Size SwDropCapsPict::CalcTextSize( void ) sal_uInt16 nScript; size_t nIdx = 0; - xub_StrLen nStart; - xub_StrLen nEnd; + sal_Int32 nStart; + sal_Int32 nEnd; GetFirstScriptSegment(nStart, nEnd, nScript); long nTxtWidth = 0; long nCJKHeight = 0; diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index d3055a297f95..06b3fcbafc5d 100644 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -576,8 +576,8 @@ namespace SwLangHelper aText = rEditEngine->GetText(aDocSelection); if (!aText.isEmpty()) { - xub_StrLen nStt = 0; - xub_StrLen nEnd = aDocSelection.nEndPos; + sal_Int32 nStt = 0; + sal_Int32 nEnd = aDocSelection.nEndPos; // at most 100 chars to the left... nStt = nEnd > 100 ? nEnd - 100 : 0; // ... and 100 to the right of the cursor position |