diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx index ddc3289bb112..46dee451bae1 100644 --- a/sw/source/core/inc/UndoAttribute.hxx +++ b/sw/source/core/inc/UndoAttribute.hxx @@ -226,12 +226,12 @@ class SwUndoChangeFootNote : public SwUndo, private SwUndRng SAL_WNODEPRECATED_DECLARATIONS_PUSH const ::std::auto_ptr m_pHistory; SAL_WNODEPRECATED_DECLARATIONS_POP - const String m_Text; + const OUString m_Text; const sal_uInt16 m_nNumber; const bool m_bEndNote; public: - SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt, + SwUndoChangeFootNote( const SwPaM& rRange, const OUString& rTxt, sal_uInt16 nNum, bool bIsEndNote ); virtual ~SwUndoChangeFootNote(); diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index 67d2e78f44fc..fd9c201c26ed 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -108,7 +108,7 @@ private: class SwUndoFmtColl : public SwUndo, private SwUndRng { - String aFmtName; + OUString aFmtName; SwHistory* pHistory; SwFmtColl* pFmtColl; // for correct and @@ -213,8 +213,8 @@ const int nUndoStringLength = 20; @return the shortened string */ -String -ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr); +OUString +ShortenString(const OUString & rStr, xub_StrLen nLength, const OUString & rFillStr); /** Denotes special characters in a string. @@ -233,7 +233,7 @@ ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr); @return the denoted string */ -String DenoteSpecialCharacters(const String & rStr); +OUString DenoteSpecialCharacters(const OUString & rStr); #endif // SW_UNDOCORE_HXX diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx index 3cec55373a8d..39b20f0a40c1 100644 --- a/sw/source/core/inc/UndoDelete.hxx +++ b/sw/source/core/inc/UndoDelete.hxx @@ -37,13 +37,13 @@ class SwUndoDelete , private SwUndoSaveCntnt { SwNodeIndex* pMvStt; // Position of Nodes in UndoNodes-Array - String *pSttStr, *pEndStr; + OUString *pSttStr, *pEndStr; SwRedlineData* pRedlData; SwRedlineSaveDatas* pRedlSaveData; ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; - String sTableName; + OUString sTableName; sal_uLong nNode; sal_uLong nNdDiff; // difference of Nodes before/after Delete @@ -92,7 +92,7 @@ public: void SetPgBrkFlags( sal_Bool bPageBreak, sal_Bool bPageDesc ) { bResetPgDesc = bPageDesc; bResetPgBrk = bPageBreak; } - void SetTableName(const String & rName); + void SetTableName(const OUString & rName); // SwUndoTblCpyTbl needs this information: sal_Bool IsDelFullPara() const { return bDelFullPara; } diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx index 04b594938fcd..a235a992aa42 100644 --- a/sw/source/core/inc/UndoInsert.hxx +++ b/sw/source/core/inc/UndoInsert.hxx @@ -35,7 +35,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt { /// start of Content in UndoNodes for Redo ::boost::scoped_ptr m_pUndoNodeIndex; - String *pTxt, *pUndoTxt; + OUString *pTxt, *pUndoTxt; SwRedlineData* pRedlData; sal_uLong nNode; xub_StrLen nCntnt, nLen; @@ -52,7 +52,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt SwDoc * pDoc; void Init(const SwNodeIndex & rNode); - String * GetTxtFromDoc() const; + OUString * GetTxtFromDoc() const; public: SwUndoInsert( const SwNodeIndex& rNode, xub_StrLen nCntnt, xub_StrLen nLen, @@ -162,11 +162,11 @@ class SwUndoInsertLabel : public SwUndo } NODE; }; - String sText; + OUString sText; // #i39983# the separator is drawn with a character style - String sSeparator; - String sNumberSeparator; - String sCharacterStyle; + OUString sSeparator; + OUString sNumberSeparator; + OUString sCharacterStyle; // #i26791# - re-store of drawing object position no longer needed sal_uInt16 nFldId; SwLabelType eType; @@ -176,12 +176,12 @@ class SwUndoInsertLabel : public SwUndo sal_Bool bCpyBrd :1; public: - SwUndoInsertLabel( const SwLabelType eTyp, const String &rText, + SwUndoInsertLabel( const SwLabelType eTyp, const OUString &rText, // #i39983# the separator is drawn with a character style - const String& rSeparator, - const String& rNumberSeparator, //#i61007# order of captions + const OUString& rSeparator, + const OUString& rNumberSeparator, //#i61007# order of captions const sal_Bool bBefore, const sal_uInt16 nId, - const String& rCharacterStyle, + const OUString& rCharacterStyle, const sal_Bool bCpyBrd ); virtual ~SwUndoInsertLabel(); diff --git a/sw/source/core/inc/UndoNumbering.hxx b/sw/source/core/inc/UndoNumbering.hxx index f54996bef69b..5dd6b72a2848 100644 --- a/sw/source/core/inc/UndoNumbering.hxx +++ b/sw/source/core/inc/UndoNumbering.hxx @@ -33,7 +33,7 @@ class SwUndoInsNum : public SwUndo, private SwUndRng SwHistory* pHistory; sal_uLong nSttSet; SwNumRule* pOldNumRule; - String sReplaceRule; + OUString sReplaceRule; sal_uInt16 nLRSavePos; public: @@ -41,7 +41,7 @@ public: SwUndoInsNum( const SwNumRule& rOldRule, const SwNumRule& rNewRule, SwUndoId nUndoId = UNDO_INSFMTATTR ); SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule, - const String& rReplaceRule ); + const OUString& rReplaceRule ); virtual ~SwUndoInsNum(); diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx index 54365d104e65..c21857bd5cc8 100644 --- a/sw/source/core/inc/UndoOverwrite.hxx +++ b/sw/source/core/inc/UndoOverwrite.hxx @@ -33,7 +33,7 @@ namespace utl { class SwUndoOverwrite: public SwUndo, private SwUndoSaveCntnt { - String aDelStr, aInsStr; + OUString aDelStr, aInsStr; SwRedlineSaveDatas* pRedlSaveData; sal_uLong nSttNode; xub_StrLen nSttCntnt; diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx index 501ff59968ae..0e5490ce8d0b 100644 --- a/sw/source/core/inc/UndoSort.hxx +++ b/sw/source/core/inc/UndoSort.hxx @@ -37,14 +37,14 @@ struct SwSortUndoElement sal_uLong nSource, nTarget; } TXT; struct { - String *pSource, *pTarget; + OUString *pSource, *pTarget; } TBL; } SORT_TXT_TBL; - SwSortUndoElement( const String& aS, const String& aT ) + SwSortUndoElement( const OUString& aS, const OUString& aT ) { - SORT_TXT_TBL.TBL.pSource = new String( aS ); - SORT_TXT_TBL.TBL.pTarget = new String( aT ); + SORT_TXT_TBL.TBL.pSource = new OUString( aS ); + SORT_TXT_TBL.TBL.pTarget = new OUString( aT ); } SwSortUndoElement( sal_uLong nS, sal_uLong nT ) { @@ -77,7 +77,7 @@ public: virtual void RedoImpl( ::sw::UndoRedoContext & ); virtual void RepeatImpl( ::sw::RepeatContext & ); - void Insert( const String& rOrgPos, const String& rNewPos ); + void Insert( const OUString& rOrgPos, const OUString& rNewPos ); void Insert( sal_uLong nOrgPos, sal_uLong nNewPos ); }; diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx index 61a8d271fdb0..2788d83d3095 100644 --- a/sw/source/core/inc/UndoTable.hxx +++ b/sw/source/core/inc/UndoTable.hxx @@ -49,7 +49,7 @@ class SwTableSortBoxes; class SwUndoInsTbl : public SwUndo { - String sTblNm; + OUString sTblNm; SwInsertTableOptions aInsTblOpts; SwDDEFieldType* pDDEFldType; std::vector *pColWidth; @@ -63,7 +63,7 @@ public: SwUndoInsTbl( const SwPosition&, sal_uInt16 nCols, sal_uInt16 nRows, sal_uInt16 eAdjust, const SwInsertTableOptions& rInsTblOpts, const SwTableAutoFmt* pTAFmt, const std::vector *pColArr, - const String & rName); + const OUString & rName); virtual ~SwUndoInsTbl(); @@ -76,7 +76,7 @@ public: class SwUndoTxtToTbl : public SwUndo, public SwUndRng { - String sTblNm; + OUString sTblNm; SwInsertTableOptions aInsTblOpts; std::vector* pDelBoxes; SwTableAutoFmt* pAutoFmt; @@ -102,7 +102,7 @@ public: class SwUndoTblToTxt : public SwUndo { - String sTblNm; + OUString sTblNm; SwDDEFieldType* pDDEFldType; _SaveTable* pTblSave; SwTblToTxtSaves* pBoxSaves; @@ -248,7 +248,7 @@ class SwUndoTblNumFmt : public SwUndo { SfxItemSet *pBoxSet; SwHistory* pHistory; - String aStr, aNewFml; + OUString aStr, aNewFml; sal_uLong nFmtIdx, nNewFmtIdx; double fNum, fNewNum; @@ -342,7 +342,7 @@ public: class SwUndoMergeTbl : public SwUndo { - String aName; + OUString aName; sal_uLong nTblNode; _SaveTable* pSavTbl, *pSavHdl; SwHistory* pHistory; diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 8a194d009b57..365c871d756c 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -1052,7 +1052,7 @@ void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext) } SwUndoChangeFootNote::SwUndoChangeFootNote( - const SwPaM& rRange, const String& rTxt, + const SwPaM& rRange, const OUString& rTxt, sal_uInt16 nNum, bool bIsEndNote ) : SwUndo( UNDO_CHGFTN ), SwUndRng( rRange ) , m_pHistory( new SwHistory() ) diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 766ed61c72f1..ce0988c28842 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -361,13 +361,13 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd // delete now also the text (all attribute changes are added to // UNDO history) - pSttStr = new String( pSttTxtNd->GetTxt().copy(nSttCntnt, nLen)); + pSttStr = new OUString( pSttTxtNd->GetTxt().copy(nSttCntnt, nLen)); pSttTxtNd->EraseText( pStt->nContent, nLen ); if( pSttTxtNd->GetpSwpHints() ) pSttTxtNd->GetpSwpHints()->DeRegister(); // METADATA: store - bool emptied( pSttStr->Len() && !pSttTxtNd->Len() ); + bool emptied( !pSttStr->isEmpty() && !pSttTxtNd->Len() ); if (!bOneNode || emptied) // merging may overwrite xmlids... { m_pMetadataUndoStart = (emptied) @@ -396,14 +396,14 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd // delete now also the text (all attribute changes are added to // UNDO history) - pEndStr = new String( pEndTxtNd->GetTxt().copy( 0, + pEndStr = new OUString( pEndTxtNd->GetTxt().copy( 0, pEnd->nContent.GetIndex() )); pEndTxtNd->EraseText( aEndIdx, pEnd->nContent.GetIndex() ); if( pEndTxtNd->GetpSwpHints() ) pEndTxtNd->GetpSwpHints()->DeRegister(); // METADATA: store - bool emptied( pEndStr->Len() && !pEndTxtNd->Len() ); + bool emptied = !pEndStr->isEmpty() && !pEndTxtNd->Len(); m_pMetadataUndoEnd = (emptied) ? pEndTxtNd->CreateUndoForDelete() @@ -420,7 +420,7 @@ sal_Bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) { // Is Undo greater than one Node (that is Start and EndString)? - if( pSttStr ? !pSttStr->Len() || pEndStr : sal_True ) + if( pSttStr ? pSttStr->isEmpty() || pEndStr : sal_True ) return sal_False; // only the deletion of single char's can be condensed @@ -456,7 +456,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->Len()-1; + xub_StrLen 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 ) || @@ -487,7 +487,7 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) nEndCntnt++; // Delete: attach char at the end nUChrPos++; } - pSttStr->Insert( cDelChar, nUChrPos ); + (*pSttStr) = pSttStr->replaceAt( nUChrPos, 0, OUString(cDelChar) ); pDelTxtNd->EraseText( pStt->nContent, 1 ); bGroup = sal_True; @@ -595,21 +595,21 @@ static String lcl_DenotedPortion(String rStr, xub_StrLen nStart, return aResult; } -String DenoteSpecialCharacters(const String & rStr) +OUString DenoteSpecialCharacters(const OUString & rStr) { - String aResult; + OUString aResult; - if (rStr.Len() > 0) + if (!rStr.isEmpty()) { bool bStart = false; xub_StrLen nStart = 0; sal_Unicode cLast = 0; - for (xub_StrLen i = 0; i < rStr.Len(); i++) + for (xub_StrLen i = 0; i < rStr.getLength(); i++) { - if (lcl_IsSpecialCharacter(rStr.GetChar(i))) + if (lcl_IsSpecialCharacter(rStr[i])) { - if (cLast != rStr.GetChar(i)) + if (cLast != rStr[i]) bStart = true; } @@ -627,10 +627,10 @@ String DenoteSpecialCharacters(const String & rStr) bStart = false; } - cLast = rStr.GetChar(i); + cLast = rStr[i]; } - aResult += lcl_DenotedPortion(rStr, nStart, rStr.Len()); + aResult += lcl_DenotedPortion(rStr, nStart, rStr.getLength()); } else aResult = SwRewriter::GetPlaceHolder(UndoArg2); @@ -644,7 +644,7 @@ SwRewriter SwUndoDelete::GetRewriter() const if (nNode != 0) { - if (sTableName.Len() > 0) + if (!sTableName.isEmpty()) { SwRewriter aRewriter; @@ -662,14 +662,14 @@ SwRewriter SwUndoDelete::GetRewriter() const { String aStr; - if (pSttStr != NULL && pEndStr != NULL && pSttStr->Len() == 0 && - pEndStr->Len() == 0) + if (pSttStr != NULL && pEndStr != NULL && pSttStr->isEmpty() && + pEndStr->isEmpty()) { aStr = SW_RESSTR(STR_PARAGRAPH_UNDO); } else { - String * pStr = NULL; + OUString * pStr = NULL; if (pSttStr != NULL) pStr = pSttStr; else if (pEndStr != NULL) @@ -788,7 +788,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) { OUString const ins( pTxtNd->InsertText(*pEndStr, aPos.nContent, IDocumentContentOperations::INS_NOHINTEXPAND) ); - assert(ins.getLength() == pEndStr->Len()); // must succeed + assert(ins.getLength() == pEndStr->getLength()); // must succeed (void) ins; // METADATA: restore pTxtNd->RestoreMetadata(m_pMetadataUndoEnd); @@ -883,7 +883,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) aPos.nContent.Assign( pTxtNd, nSttCntnt ); OUString const ins( pTxtNd->InsertText(*pSttStr, aPos.nContent, IDocumentContentOperations::INS_NOHINTEXPAND) ); - assert(ins.getLength() == pSttStr->Len()); // must succeed + assert(ins.getLength() == pSttStr->getLength()); // must succeed (void) ins; // METADATA: restore pTxtNd->RestoreMetadata(m_pMetadataUndoStart); @@ -1074,7 +1074,7 @@ void SwUndoDelete::RepeatImpl(::sw::RepeatContext & rContext) } -void SwUndoDelete::SetTableName(const String & rName) +void SwUndoDelete::SetTableName(const OUString & rName) { sTableName = rName; } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 19ddb0975478..510fff184b6a 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1093,17 +1093,17 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr, } // #111827# -String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr) +OUString ShortenString(const OUString & rStr, xub_StrLen nLength, const OUString & rFillStr) { - assert(nLength - rFillStr.Len() >= 2); + assert(nLength - rFillStr.getLength() >= 2); - String aResult; + OUString aResult; - if (rStr.Len() <= nLength) + if (rStr.getLength() <= nLength) aResult = rStr; else { - long nTmpLength = nLength - rFillStr.Len(); + long nTmpLength = nLength - rFillStr.getLength(); if ( nTmpLength < 2 ) nTmpLength = 2; @@ -1112,9 +1112,9 @@ String ShortenString(const String & rStr, xub_StrLen nLength, const String & rFi const xub_StrLen nFrontLen = nLength - nLength / 2; const xub_StrLen nBackLen = nLength - nFrontLen; - aResult += rStr.Copy(0, nFrontLen); + aResult += rStr.copy(0, nFrontLen); aResult += rFillStr; - aResult += rStr.Copy(rStr.Len() - nBackLen, nBackLen); + aResult += rStr.copy(rStr.getLength() - nBackLen, nBackLen); } return aResult; diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 3f3a00e83ad2..bc533af108fd 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -62,9 +62,9 @@ using namespace ::com::sun::star; // INSERT -String * SwUndoInsert::GetTxtFromDoc() const +OUString * SwUndoInsert::GetTxtFromDoc() const { - String * pResult = NULL; + OUString * pResult = NULL; SwNodeIndex aNd( pDoc->GetNodes(), nNode); SwCntntNode* pCNd = aNd.GetNode().GetCntntNode(); @@ -85,7 +85,7 @@ String * SwUndoInsert::GetTxtFromDoc() const nStart = 0; } - pResult = new String(sTxt.copy(nStart, nLength)); + pResult = new OUString(sTxt.copy(nStart, nLength)); } return pResult; @@ -145,7 +145,7 @@ sal_Bool SwUndoInsert::CanGrouping( sal_Unicode cIns ) nCntnt++; if (pUndoTxt) - pUndoTxt->Insert(cIns); + (*pUndoTxt) += OUString(cIns); return sal_True; } @@ -262,7 +262,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) aPaM.GetMark()->nContent.GetIndex()); } RemoveIdxFromRange( aPaM, sal_False ); - pTxt = new String( pTxtNode->GetTxt().copy(nCntnt-nLen, nLen) ); + pTxt = new OUString( pTxtNode->GetTxt().copy(nCntnt-nLen, nLen) ); pTxtNode->EraseText( aPaM.GetPoint()->nContent, nLen ); // Undo deletes fieldmarks in two step: first the end then the start position. @@ -364,7 +364,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) OUString const ins( pTxtNode->InsertText( *pTxt, pPam->GetMark()->nContent, m_nInsertFlags) ); - assert(ins.getLength() == pTxt->Len()); // must succeed + assert(ins.getLength() == pTxt->getLength()); // must succeed DELETEZ( pTxt ); if (m_bWithRsid) // re-insert RSID { @@ -478,7 +478,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) SwRewriter SwUndoInsert::GetRewriter() const { SwRewriter aResult; - String * pStr = NULL; + OUString * pStr = NULL; bool bDone = false; if (pTxt) @@ -897,12 +897,12 @@ void SwUndoReRead::SaveGraphicData( const SwGrfNode& rGrfNd ) SwUndoInsertLabel::SwUndoInsertLabel( const SwLabelType eTyp, - const String &rTxt, - const String& rSeparator, - const String& rNumberSeparator, + const OUString &rTxt, + const OUString& rSeparator, + const OUString& rNumberSeparator, const sal_Bool bBef, const sal_uInt16 nInitId, - const String& rCharacterStyle, + const OUString& rCharacterStyle, const sal_Bool bCpyBorder ) : SwUndo( UNDO_INSERTLABEL ), sText( rTxt ), diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx index 32fe562ba425..21a7caf6dc9c 100644 --- a/sw/source/core/undo/unnum.cxx +++ b/sw/source/core/undo/unnum.cxx @@ -45,7 +45,7 @@ SwUndoInsNum::SwUndoInsNum( const SwPaM& rPam, const SwNumRule& rRule ) } SwUndoInsNum::SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule, - const String& rReplaceRule ) + const OUString& rReplaceRule ) : SwUndo( UNDO_INSNUM ), aNumRule( rRule ), pHistory( 0 ), nSttSet( ULONG_MAX ), pOldNumRule( 0 ), @@ -117,7 +117,7 @@ void SwUndoInsNum::RedoImpl(::sw::UndoRedoContext & rContext) else if( pHistory ) { SwPaM & rPam( AddUndoRedoPaM(rContext) ); - if( sReplaceRule.Len() ) + if( !sReplaceRule.isEmpty() ) { rDoc.ReplaceNumRule(*rPam.GetPoint(), sReplaceRule, aNumRule.GetName() ); @@ -141,7 +141,7 @@ void SwUndoInsNum::RepeatImpl(::sw::RepeatContext & rContext) SwDoc & rDoc(rContext.GetDoc()); if( nSttNode ) { - if( !sReplaceRule.Len() ) + if( sReplaceRule.isEmpty() ) { // #i42921# - adapt to changed signature rDoc.SetNumRule(rContext.GetRepeatPaM(), aNumRule, false); diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index 6a2fc8acc197..2c06cd4777d6 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -63,7 +63,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, xub_StrLen nTxtNdLen = pTxtNd->GetTxt().getLength(); if( nSttCntnt < nTxtNdLen ) // no pure insert? { - aDelStr.Insert( pTxtNd->GetTxt()[nSttCntnt] ); + aDelStr += OUString( pTxtNd->GetTxt()[nSttCntnt] ); if( !pHistory ) pHistory = new SwHistory; SwRegHistory aRHst( *pTxtNd, pHistory ); @@ -78,7 +78,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, pTxtNd->InsertText( OUString(cIns), rPos.nContent, IDocumentContentOperations::INS_EMPTYEXPAND ); - aInsStr.Insert( cIns ); + aInsStr += OUString( cIns ); if( !bInsChar ) { @@ -101,15 +101,15 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, // What is with only inserted characters? // Only deletion of single chars can be combined. - if( rPos.nNode != nSttNode || !aInsStr.Len() || - ( !bGroup && aInsStr.Len() != 1 )) + if( rPos.nNode != nSttNode || aInsStr.isEmpty() || + ( !bGroup && aInsStr.getLength() != 1 )) return sal_False; // Is the node a TextNode at all? SwTxtNode * pDelTxtNd = rPos.nNode.GetNode().GetTxtNode(); if( !pDelTxtNd || (pDelTxtNd->GetTxt().getLength() != rPos.nContent.GetIndex() && - rPos.nContent.GetIndex() != ( nSttCntnt + aInsStr.Len() ))) + rPos.nContent.GetIndex() != ( nSttCntnt + aInsStr.getLength() ))) return sal_False; CharClass& rCC = GetAppCharClass(); @@ -117,7 +117,7 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, // ask the char that should be inserted if (( CH_TXTATR_BREAKWORD == cIns || CH_TXTATR_INWORD == cIns ) || rCC.isLetterNumeric( OUString( cIns ), 0 ) != - rCC.isLetterNumeric( aInsStr, aInsStr.Len()-1 ) ) + rCC.isLetterNumeric( aInsStr, aInsStr.getLength()-1 ) ) return sal_False; { @@ -144,7 +144,7 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, { if (rPos.nContent.GetIndex() < pDelTxtNd->GetTxt().getLength()) { - aDelStr.Insert(pDelTxtNd->GetTxt()[rPos.nContent.GetIndex()]); + aDelStr += OUString( pDelTxtNd->GetTxt()[rPos.nContent.GetIndex()] ); rPos.nContent++; } else @@ -158,7 +158,7 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, IDocumentContentOperations::INS_EMPTYEXPAND) ); assert(ins.getLength() == 1); // check in SwDoc::Overwrite => cannot fail (void) ins; - aInsStr.Insert( cIns ); + aInsStr += OUString( cIns ); if( !bInsChar ) { @@ -186,29 +186,29 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext) SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord(); if( pACEWord ) { - if( 1 == aInsStr.Len() && 1 == aDelStr.Len() ) - pACEWord->CheckChar( *pAktPam->GetPoint(), aDelStr.GetChar( 0 ) ); + if( 1 == aInsStr.getLength() && 1 == aDelStr.getLength() ) + pACEWord->CheckChar( *pAktPam->GetPoint(), aDelStr[0] ); pDoc->SetAutoCorrExceptWord( 0 ); } // If there was not only a overwrite but also an insert, delete the surplus - if( aInsStr.Len() > aDelStr.Len() ) + if( aInsStr.getLength() > aDelStr.getLength() ) { - rIdx += aDelStr.Len(); - pTxtNd->EraseText( rIdx, aInsStr.Len() - aDelStr.Len() ); + rIdx += aDelStr.getLength(); + pTxtNd->EraseText( rIdx, aInsStr.getLength() - aDelStr.getLength() ); rIdx = nSttCntnt; } - if( aDelStr.Len() ) + if( !aDelStr.isEmpty() ) { bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); pTxtNd->SetIgnoreDontExpand( true ); ++rIdx; - for( xub_StrLen n = 0; n < aDelStr.Len(); n++ ) + for( xub_StrLen n = 0; n < aDelStr.getLength(); n++ ) { // do it individually, to keep the attributes! - OUString aTmpStr(aDelStr.GetChar(n)); + OUString aTmpStr(aDelStr[n]); OUString const ins( pTxtNd->InsertText(aTmpStr, rIdx) ); assert(ins.getLength() == 1); // cannot fail (void) ins; @@ -240,17 +240,17 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoOverwrite::RepeatImpl(::sw::RepeatContext & rContext) { SwPaM *const pAktPam = & rContext.GetRepeatPaM(); - if( !aInsStr.Len() || pAktPam->HasMark() ) + if( aInsStr.isEmpty() || pAktPam->HasMark() ) return; SwDoc & rDoc = rContext.GetDoc(); { ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); - rDoc.Overwrite(*pAktPam, OUString(aInsStr.GetChar(0))); + rDoc.Overwrite(*pAktPam, OUString(aInsStr[0])); } - for( xub_StrLen n = 1; n < aInsStr.Len(); ++n ) - rDoc.Overwrite( *pAktPam, OUString(aInsStr.GetChar(n)) ); + for( xub_StrLen n = 1; n < aInsStr.getLength(); ++n ) + rDoc.Overwrite( *pAktPam, OUString(aInsStr[n]) ); } void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) @@ -268,28 +268,28 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) { rIdx.Assign( pTxtNd, nSttCntnt ); pAktPam->SetMark(); - pAktPam->GetMark()->nContent += aInsStr.Len(); + pAktPam->GetMark()->nContent += aInsStr.getLength(); pDoc->DeleteRedline( *pAktPam, false, USHRT_MAX ); pAktPam->DeleteMark(); } - rIdx.Assign( pTxtNd, aDelStr.Len() ? nSttCntnt+1 : nSttCntnt ); + rIdx.Assign( pTxtNd, !aDelStr.isEmpty() ? nSttCntnt+1 : nSttCntnt ); bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); pTxtNd->SetIgnoreDontExpand( true ); - for( xub_StrLen n = 0; n < aInsStr.Len(); n++ ) + for( xub_StrLen n = 0; n < aInsStr.getLength(); n++ ) { // do it individually, to keep the attributes! OUString const ins( - pTxtNd->InsertText( OUString(aInsStr.GetChar(n)), rIdx, + pTxtNd->InsertText( OUString(aInsStr[n]), rIdx, IDocumentContentOperations::INS_EMPTYEXPAND) ); assert(ins.getLength() == 1); // cannot fail (void) ins; - if( n < aDelStr.Len() ) + if( n < aDelStr.getLength() ) { rIdx -= 2; pTxtNd->EraseText( rIdx, 1 ); - rIdx += n+1 < aDelStr.Len() ? 2 : 1; + rIdx += n+1 < aDelStr.getLength() ? 2 : 1; } } pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index 59634e2c2ed9..d99e2feac04f 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -245,7 +245,7 @@ void SwUndoSort::RepeatImpl(::sw::RepeatContext & rContext) } } -void SwUndoSort::Insert( const String& rOrgPos, const String& rNewPos) +void SwUndoSort::Insert( const OUString& rOrgPos, const OUString& rNewPos) { SwSortUndoElement* pEle = new SwSortUndoElement(rOrgPos, rNewPos); aSortList.push_back( pEle ); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 4ed6fa724a0e..f15e6290532c 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -224,7 +224,7 @@ SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 n sal_uInt16 nAdj, const SwInsertTableOptions& rInsTblOpts, const SwTableAutoFmt* pTAFmt, const std::vector *pColArr, - const String & rName) + const OUString & rName) : SwUndo( UNDO_INSTABLE ), aInsTblOpts( rInsTblOpts ), pDDEFldType( 0 ), pColWidth( 0 ), pRedlData( 0 ), pAutoFmt( 0 ), nSttNode( rPos.nNode.GetIndex() ), nRows( nRw ), nCols( nCl ), nAdjust( nAdj ) @@ -2220,7 +2220,7 @@ void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext) if( pTxtNd->HasSwAttrSet() ) pTxtNd->ResetAllAttr(); - if( pTxtNd->GetpSwpHints() && aStr.Len() ) + if( pTxtNd->GetpSwpHints() && !aStr.isEmpty() ) pTxtNd->ClearSwpHintsArr( true ); // ChgTextToNum(..) only acts when the strings are different. We need to do @@ -2230,7 +2230,7 @@ void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext) rDoc.DeleteRedline( *( pBox->GetSttNd() ), false, USHRT_MAX ); SwIndex aIdx( pTxtNd, 0 ); - if( aStr.Len() ) + if( !aStr.isEmpty() ) { pTxtNd->EraseText( aIdx ); pTxtNd->InsertText( aStr, aIdx,