diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-07-04 23:58:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-07-09 12:16:56 +0100 |
commit | 104261010aa5ccbb7df4a82a3a3cafcfb0591fa7 (patch) | |
tree | b8db79d2707ff5925ad01dba8a41bd8ab6d66847 /editeng | |
parent | 1a1e953ee33c213dc8b88dd96a69ca9fc5e42d50 (diff) |
some UniString->rtl::OUString
Change-Id: Ie69b30094da25df23a36baca2c7723d6a41f48c3
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 13 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 2 | ||||
-rw-r--r-- | editeng/source/items/svxfont.cxx | 7 | ||||
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 49 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unotext.cxx | 4 |
9 files changed, 45 insertions, 42 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 59f45249218a..b4a08e55fea7 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2261,7 +2261,7 @@ EditPaM EditDoc::InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ) { DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertFeature" ); - aPaM.GetNode()->Insert( CH_FEATURE, aPaM.GetIndex() ); + aPaM.GetNode()->Insert( rtl::OUString(CH_FEATURE), aPaM.GetIndex() ); aPaM.GetNode()->ExpandAttribs( aPaM.GetIndex(), 1, GetItemPool() ); // Create a feature-attribute for the feature... diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 58d0f7a4f21a..d3fb0c3dfb27 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2724,7 +2724,7 @@ Rectangle EditEngine::GetBulletArea( sal_uInt16 ) XubString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_uInt16, sal_uInt16, Color*&, Color*& ) { DBG_CHKTHIS( EditEngine, 0 ); - return ' '; + return rtl::OUString(' '); } void EditEngine::FieldClicked( const SvxFieldItem&, sal_uInt16, sal_uInt16 ) diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index be1e766ad721..32eadcd5361d 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2672,12 +2672,12 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { - EditUndoInsertChars* pNewUndo = new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), c); + EditUndoInsertChars* pNewUndo = new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), rtl::OUString(c)); sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; InsertUndo( pNewUndo, bTryMerge ); } - aEditDoc.InsertText( (const EditPaM&)aPaM, c ); + aEditDoc.InsertText( (const EditPaM&)aPaM, rtl::OUString(c) ); ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); OSL_ENSURE( pPortion, "Blind Portion in InsertText" ); pPortion->MarkInvalid( aPaM.GetIndex(), 1 ); @@ -2954,7 +2954,7 @@ EditPaM ImpEditEngine::InsertParaBreak( EditSelection aCurSel ) if ( aPrevParaText.GetChar(n) == '\t' ) aPaM = ImpInsertFeature( aPaM, SfxVoidItem( EE_FEATURE_TAB ) ); else - aPaM = ImpInsertText( aPaM, aPrevParaText.GetChar(n) ); + aPaM = ImpInsertText( aPaM, rtl::OUString(aPrevParaText.GetChar(n)) ); n++; } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 504d7740c329..a0aedb12f051 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1961,7 +1961,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te // A portion for inserting the separator ... TextPortion* pHyphPortion = new TextPortion( 0 ); pHyphPortion->GetKind() = PORTIONKIND_HYPHENATOR; - String aHyphText( CH_HYPH ); + String aHyphText(rtl::OUString(CH_HYPH)); if ( cAlternateReplChar ) { TextPortion* pPrev = pParaPortion->GetTextPortions()[nEndPortion]; @@ -1976,7 +1976,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te else if ( cAlternateExtraChar ) { pHyphPortion->SetExtraValue( cAlternateExtraChar ); - aHyphText.Insert( cAlternateExtraChar, 0 ); + aHyphText.Insert( rtl::OUString(cAlternateExtraChar), 0 ); } // Determine the width of the Hyph-Portion: @@ -3042,7 +3042,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if ( 0x200B == cChar || 0x2060 == cChar ) { - const String aBlank( ' ' ); + const rtl::OUString aBlank( ' ' ); long nHalfBlankWidth = aTmpFont.QuickGetTextSize( pOutDev, aBlank, 0, 1, 0 ).Width() / 2; const long nAdvanceX = ( nTmpIdx == nTmpEnd ? @@ -3087,7 +3087,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if ( 0x200B == cChar ) { - const String aSlash( '/' ); + const rtl::OUString aSlash( '/' ); const short nOldEscapement = aTmpFont.GetEscapement(); const sal_uInt8 nOldPropr = aTmpFont.GetPropr(); @@ -3490,7 +3490,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta aTmpFont.SetTransparent( sal_False ); aTmpFont.SetEscapement( 0 ); aTmpFont.SetPhysFont( pOutDev ); - long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev, pTextPortion->GetExtraValue(), 0, 1, NULL ).Width(); + long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev, + rtl::OUString(pTextPortion->GetExtraValue()), 0, 1, NULL ).Width(); long nChars = 2; if( nCharWidth ) nChars = pTextPortion->GetSize().Width() / nCharWidth; @@ -3516,7 +3517,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta // StripPortions() data callback GetEditEnginePtr()->DrawingTab( aTmpPos, pTextPortion->GetSize().Width(), - pTextPortion->GetExtraValue(), + rtl::OUString(pTextPortion->GetExtraValue()), aTmpFont, n, nIndex, pTextPortion->GetRightToLeft(), bEndOfLine, bEndOfParagraph, aOverlineColor, aTextLineColor); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 8eb912f2fad5..127186060bdc 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -3039,7 +3039,7 @@ short ImpEditEngine::ReplaceTextOnly( else { DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." ); - GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), rNewText.GetChar(n) ); + GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), rtl::OUString(rNewText.GetChar(n)) ); } nDiffs = sal::static_int_cast< short >(nDiffs + nDiff); diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 4319cd6949bc..ae8c99d13f7a 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <comphelper/string.hxx> #include <vcl/outdev.hxx> #include <vcl/print.hxx> #include <tools/poly.hxx> @@ -148,7 +149,7 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const { if( bBlank ) { - String aTemp( aTxt.GetChar( i ) ); + rtl::OUString aTemp(aTxt.GetChar(i)); aTemp = aCharClass.uppercase( aTemp ); aTxt.Replace( i, 1, aTemp ); } @@ -281,7 +282,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const sal_uInt32 nCharacterType = aCharClass.getCharacterType( aCharString, 0 ); if ( ( nCharacterType & ::com::sun::star::i18n::KCharacterType::UPPER ) ) break; - if ( CH_BLANK == aCharString ) + if ( comphelper::string::equals(aCharString, CH_BLANK) ) break; if( ++nPos < nTxtLen ) aCharString = rTxt.GetChar( nPos + nIdx ); @@ -306,7 +307,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const nOldPos = nPos; } // Now the blanks are<processed - while( nPos < nTxtLen && CH_BLANK == aCharString && ++nPos < nTxtLen ) + while( nPos < nTxtLen && comphelper::string::equals(aCharString, CH_BLANK) && ++nPos < nTxtLen ) aCharString = rTxt.GetChar( nPos + nIdx ); if( nOldPos != nPos ) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 7003f31a6f42..66b817ee3638 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -45,11 +45,12 @@ #include <unotools/localedatawrapper.hxx> #include <unotools/transliterationwrapper.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <comphelper/processfactory.hxx> #include <com/sun/star/io/XActiveDataSource.hpp> +#include <comphelper/processfactory.hxx> +#include <comphelper/storagehelper.hxx> +#include <comphelper/string.hxx> #include <editeng/editids.hrc> #include <sot/storage.hxx> -#include <comphelper/storagehelper.hxx> #include <editeng/udlnitem.hxx> #include <editeng/wghtitem.hxx> #include <editeng/escpitem.hxx> @@ -433,9 +434,9 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, if(xSpellAlt.is()) { sal_Unicode cSave = rTxt.GetChar( nSttPos ); - String sChar( cSave ); + rtl::OUString sChar( cSave ); sChar = rCC.lowercase( sChar ); - if( sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar )) + if( sChar[0] != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar )) { if( SaveWordWrdSttLst & nFlags ) rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave ); @@ -552,17 +553,17 @@ sal_Bool SvxAutoCorrect::FnChgToEnEmDash( ; // found: " --[<AnySttChars>][A-z0-9] - if( rCC.isLetterNumeric( cCh ) ) + if( rCC.isLetterNumeric( rtl::OUString(cCh) ) ) { for( n = nSttPos-1; n && lcl_IsInAsciiArr( sImplEndSkipChars,(cCh = rTxt.GetChar( --n ))); ) ; // found: "[A-z0-9][<AnyEndChars>] --[<AnySttChars>][A-z0-9] - if( rCC.isLetterNumeric( cCh )) + if( rCC.isLetterNumeric( rtl::OUString(cCh) )) { rDoc.Delete( nSttPos, nSttPos + 2 ); - rDoc.Insert( nSttPos, bAlwaysUseEmDash ? cEmDash : cEnDash ); + rDoc.Insert( nSttPos, bAlwaysUseEmDash ? rtl::OUString(cEmDash) : rtl::OUString(cEnDash) ); bRet = sal_True; } } @@ -587,17 +588,17 @@ sal_Bool SvxAutoCorrect::FnChgToEnEmDash( ; // found: " - [<AnySttChars>][A-z0-9] - if( rCC.isLetterNumeric( cCh ) ) + if( rCC.isLetterNumeric( rtl::OUString(cCh) ) ) { cCh = ' '; for( n = nTmpPos-1; n && lcl_IsInAsciiArr( sImplEndSkipChars,(cCh = rTxt.GetChar( --n ))); ) ; // found: "[A-z0-9][<AnyEndChars>] - [<AnySttChars>][A-z0-9] - if( rCC.isLetterNumeric( cCh )) + if( rCC.isLetterNumeric( rtl::OUString(cCh) )) { rDoc.Delete( nTmpPos, nTmpPos + nLen ); - rDoc.Insert( nTmpPos, bAlwaysUseEmDash ? cEmDash : cEnDash ); + rDoc.Insert( nTmpPos, bAlwaysUseEmDash ? rtl::OUString(cEmDash) : rtl::OUString(cEnDash) ); bRet = sal_True; } } @@ -621,7 +622,7 @@ sal_Bool SvxAutoCorrect::FnChgToEnEmDash( { nSttPos = nSttPos + nFndPos; rDoc.Delete( nSttPos, nSttPos + 2 ); - rDoc.Insert( nSttPos, (bEnDash ? cEnDash : cEmDash) ); + rDoc.Insert( nSttPos, (bEnDash ? rtl::OUString(cEnDash) : rtl::OUString(cEmDash)) ); bRet = sal_True; } } @@ -690,7 +691,7 @@ sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( // Add the non-breaking space at the end pos if ( bHasSpace ) - rDoc.Insert( nPos, CHAR_HARDBLANK ); + rDoc.Insert( nPos, rtl::OUString(CHAR_HARDBLANK) ); bRunNext = true; bRet = true; } @@ -881,9 +882,9 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( !pPrevPara ) { // valid separator -> replace - String sChar( *pWordStt ); + rtl::OUString sChar( *pWordStt ); sChar = rCC.uppercase( sChar ); - return sChar != *pWordStt && + return !comphelper::string::equals(sChar, *pWordStt) && rDoc.ReplaceRange( xub_StrLen( pWordStt - pStart ), 1, sChar ); } @@ -1056,9 +1057,9 @@ sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, // Ok, then replace sal_Unicode cSave = *pWordStt; nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() ); - String sChar( cSave ); + rtl::OUString sChar( cSave ); sChar = rCC.uppercase( sChar ); - sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ); + sal_Bool bRet = sChar[0] != cSave && rDoc.ReplaceRange( nSttPos, 1, sChar ); // Parahaps someone wants to have the word if( bRet && SaveWordCplSttLst & nFlags ) @@ -1096,7 +1097,7 @@ bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const String& rTxt if ( IsUpperLetter(rCC.getCharacterType(rTxt, i)) ) // Another uppercase letter. Convert it. - aConverted.Append( rCC.lowercase(String(rTxt.GetChar(i))) ); + aConverted.Append(rCC.lowercase(rtl::OUString(rTxt.GetChar(i)))); else // This is not an alphabetic letter. Leave it as-is. aConverted.Append(rTxt.GetChar(i)); @@ -1147,13 +1148,13 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, LanguageType eLang = rDoc.GetLanguage( nInsPos, sal_False ); sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang ); - String sChg( cInsChar ); + rtl::OUString sChg( cInsChar ); if( bIns ) rDoc.Insert( nInsPos, sChg ); else rDoc.Replace( nInsPos, sChg ); - sChg = cRet; + sChg = rtl::OUString(cRet); if( '\"' == cInsChar ) { @@ -1167,7 +1168,7 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, case LANGUAGE_FRENCH_SWISS: case LANGUAGE_FRENCH_LUXEMBOURG: { - String s( static_cast< sal_Unicode >(0xA0) ); + rtl::OUString s( static_cast< sal_Unicode >(0xA0) ); // UNICODE code for no break space if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s )) { @@ -1188,7 +1189,7 @@ String SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, LanguageType eLang = rDoc.GetLanguage( nInsPos, sal_False ); sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang ); - String sRet( cRet ); + String sRet = rtl::OUString(cRet); if( '\"' == cInsChar ) { @@ -1250,9 +1251,9 @@ sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, } if( bInsert ) - rDoc.Insert( nInsPos, cChar ); + rDoc.Insert( nInsPos, rtl::OUString(cChar) ); else - rDoc.Replace( nInsPos, cChar ); + rDoc.Replace( nInsPos, rtl::OUString(cChar) ); // Hardspaces autocorrection if ( IsAutoCorrFlag( AddNonBrkSpace ) ) @@ -1846,7 +1847,7 @@ sal_Bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang, static sal_Bool lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) { - String sAbk( '~' ); + String sAbk(rtl::OUString('~')); sal_uInt16 nPos; pList->Seek_Entry( &sAbk, &nPos ); if( nPos < pList->Count() ) diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 7247c63faeec..5e209a3a6aaa 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -666,7 +666,7 @@ XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara { DBG_CHKTHIS(Outliner,0); if ( !aCalcFieldValueHdl.IsSet() ) - return String( ' ' ); + return rtl::OUString( ' ' ); EditFieldInfo aFldInfo( this, rField, nPara, nPos ); // The FldColor is preset with COL_LIGHTGRAY. diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 59bf016d2004..bbe42e00f01c 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1721,7 +1721,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text { case text::ControlCharacter::PARAGRAPH_BREAK: { - const String aText( (sal_Unicode)13 ); // '\r' does not work on Mac + const rtl::OUString aText( (sal_Unicode)13 ); // '\r' does not work on Mac insertString( xRange, aText, bAbsorb ); return; @@ -1772,7 +1772,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text aRange.nEndPos = aRange.nStartPos; pRange->SetSelection( aRange ); - const String aText( (sal_Unicode)13 ); // '\r' geht auf'm Mac nicht + const rtl::OUString aText( (sal_Unicode)13 ); // '\r' geht auf'm Mac nicht pRange->setString( aText ); aRange.nStartPos = 0; |