From aa5cccd33c3b55dd4664f2600e0cf50d931ca122 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 16 Oct 2013 09:35:22 +0200 Subject: convert sw/source/core/crsr/*.cxx from String to OUString Change-Id: I5fa7cc6ef54d0fed5752e422ab750f83a36d72ee --- sw/source/core/crsr/crsrsh.cxx | 4 ++-- sw/source/core/crsr/crstrvl.cxx | 4 ++-- sw/source/core/crsr/findtxt.cxx | 2 +- sw/source/core/crsr/swcrsr.cxx | 20 ++++++++++---------- sw/source/core/crsr/trvltbl.cxx | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 7fed2810ccd6..18ff56baab26 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -413,7 +413,7 @@ void SwCrsrShell::UpdateMarkedListLevel() if ( !pTxtNd->IsNumbered() ) { m_pCurCrsr->_SetInFrontOfLabel( false ); - MarkListLevel( String(), 0 ); + MarkListLevel( OUString(), 0 ); } else if ( m_pCurCrsr->IsInFrontOfLabel() ) { @@ -427,7 +427,7 @@ void SwCrsrShell::UpdateMarkedListLevel() } else { - MarkListLevel( String(), 0 ); + MarkListLevel( OUString(), 0 ); } } } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index cd3bcecc145e..a512e39867fa 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -2082,13 +2082,13 @@ bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext ) ? ( aPos < aCmpPos && aCurPos < aPos ) : ( aCmpPos < aPos && aPos < aCurPos )) { - String sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(), + OUString sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(), *rAttr.GetEnd() - *rAttr.GetStart() ) ); sTxt = comphelper::string::remove(sTxt, 0x0a); sTxt = comphelper::string::strip(sTxt, ' '); - if( sTxt.Len() ) + if( !sTxt.isEmpty() ) aCmpPos = aPos; } } diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index ca89a9eb0020..5a349d7b5ccc 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -655,7 +655,7 @@ OUString *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam ) if( pTxtNode && pTxtNode->IsTxtNode() && pTxtNode == pPam->GetCntntNode( sal_False ) ) { utl::TextSearch aSTxt( rSearchOpt ); - const String& rStr = static_cast(pTxtNode)->GetTxt(); + const OUString& rStr = static_cast(pTxtNode)->GetTxt(); sal_Int32 nStart = pPam->Start()->nContent.GetIndex(); sal_Int32 nEnd = pPam->End()->nContent.GetIndex(); SearchResult aResult; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index a397939f3972..2798089ef971 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1344,13 +1344,13 @@ sal_Bool SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, con return bRet; } -static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd ) +static OUString lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd ) { - String aRes; + OUString aRes; if (pTxtNd) { //mask deleted redlines - String sNodeText(pTxtNd->GetTxt()); + OUString sNodeText(pTxtNd->GetTxt()); const SwDoc& rDoc = *pTxtNd->GetDoc(); const bool nShowChg = IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() ); if ( nShowChg ) @@ -1367,8 +1367,8 @@ static String lcl_MaskDeletedRedlines( const SwTxtNode* pTxtNd ) xub_StrLen nStart, nEnd; pRed->CalcStartEnd( pTxtNd->GetIndex(), nStart, nEnd ); - while ( nStart < nEnd && nStart < sNodeText.Len() ) - sNodeText.SetChar( nStart++, CH_TXTATR_INWORD ); + while ( nStart < nEnd && nStart < sNodeText.getLength() ) + sNodeText = sNodeText.replaceAt( nStart++, 1, OUString(CH_TXTATR_INWORD) ); } } } @@ -1383,7 +1383,7 @@ sal_Bool SwCursor::GoSentence( SentenceMoveType eMoveType ) const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { - String sNodeText( lcl_MaskDeletedRedlines( pTxtNd ) ); + OUString sNodeText( lcl_MaskDeletedRedlines( pTxtNd ) ); SwCrsrSaveState aSave( *this ); xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); @@ -1407,8 +1407,8 @@ sal_Bool SwCursor::GoSentence( SentenceMoveType eMoveType ) sNodeText, nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); - while (nPtPos != (sal_uInt16) -1 && ++nPtPos < sNodeText.Len() - && sNodeText.GetChar(nPtPos)== ' ' /*isWhiteSpace( aTxt.GetChar(nPtPos)*/ ) + while (nPtPos != (sal_uInt16) -1 && ++nPtPos < sNodeText.getLength() + && sNodeText[nPtPos] == ' ' /*isWhiteSpace( aTxt.GetChar(nPtPos)*/ ) ; break; } @@ -1449,8 +1449,8 @@ sal_Bool SwCursor::ExpandToSentenceBorders() if (!HasMark()) SetMark(); - String sStartText( lcl_MaskDeletedRedlines( pStartNd ) ); - String sEndText( pStartNd == pEndNd? sStartText : lcl_MaskDeletedRedlines( pEndNd ) ); + OUString sStartText( lcl_MaskDeletedRedlines( pStartNd ) ); + OUString sEndText( pStartNd == pEndNd? sStartText : lcl_MaskDeletedRedlines( pEndNd ) ); SwCrsrSaveState aSave( *this ); xub_StrLen nStartPos = Start()->nContent.GetIndex(); diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index b23212e8891a..c9eb6c79d238 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -694,7 +694,7 @@ bool SwCrsrShell::IsTblComplexForChart() if( pTNd ) { // in a table; check if table or section is balanced - String sSel; + OUString sSel; if( m_pTblCrsr ) sSel = GetBoxNms(); bRet = pTNd->GetTable().IsTblComplexForChart( sSel ); -- cgit