diff options
252 files changed, 644 insertions, 641 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index fa504e3f23b1..e419c428795a 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -929,7 +929,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) // nLinepPage is not correct if there's a line break sal_uInt16 nLinespPage = (sal_uInt16) (aPaperSz.Height()/nLineHeight); - sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pPrinter->GetTextWidth( 'X' ) ); + sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pPrinter->GetTextWidth(rtl::OUString('X')) ); sal_uLong nParas = GetEditEngine()->GetParagraphCount(); sal_uInt16 nPages = (sal_uInt16) (nParas/nLinespPage+1 ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 331399505b28..3e96c2268a1c 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -763,7 +763,7 @@ void EditorWindow::InitScrollBars() { pModulWindow->GetHScrollBar()->SetVisibleSize( aOutSz.Width() ); pModulWindow->GetHScrollBar()->SetPageSize( aOutSz.Width() * 8 / 10 ); - pModulWindow->GetHScrollBar()->SetLineSize( GetTextWidth( 'x' ) ); + pModulWindow->GetHScrollBar()->SetLineSize( GetTextWidth( rtl::OUString('x') ) ); pModulWindow->GetHScrollBar()->SetThumbPos( pEditView->GetStartDocPos().X() ); pModulWindow->GetHScrollBar()->Show(); } diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx index 052e2a3f4f75..97674a6e4081 100644 --- a/basctl/source/basicide/linenumberwindow.cxx +++ b/basctl/source/basicide/linenumberwindow.cxx @@ -38,7 +38,7 @@ LineNumberWindow::LineNumberWindow( Window* pParent, ModulWindow* pModulWin ) : m_nCurYOffset(0) { SetBackground(Wallpaper(GetSettings().GetStyleSettings().GetFieldColor())); - m_nBaseWidth = GetTextWidth(String('8')); + m_nBaseWidth = GetTextWidth(rtl::OUString('8')); m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2; } @@ -71,7 +71,7 @@ void LineNumberWindow::Paint( const Rectangle& ) // FIXME: it would be best if we could get notified of a font change // rather than doing that re-calculation at each Paint event - m_nBaseWidth = GetTextWidth(String('8')); + m_nBaseWidth = GetTextWidth(rtl::OUString('8')); // reserve enough for 3 sigit minimum, with a bit to spare for confort m_nWidth = m_nBaseWidth * 3 + m_nBaseWidth / 2; diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 8fa93f5458fb..5d25cd4d9bb6 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1810,10 +1810,12 @@ ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, String c } // add quoted arguments and do the call - String sCall( '[' ); - sCall += pMethod->GetName(); - sCall += sQuotedArgs; - sCall += ']'; + rtl::OUString sCall = rtl::OUStringBuffer(). + append('['). + append(pMethod->GetName()). + append(sQuotedArgs). + append(']'). + makeStringAndClear(); SbxVariable* pRet = pMethod->GetParent()->Execute( sCall ); if ( pRet && ( pRet != pMethod ) ) diff --git a/basic/source/comp/basiccharclass.cxx b/basic/source/comp/basiccharclass.cxx index eb11a39a00a7..bea29241caa7 100644 --- a/basic/source/comp/basiccharclass.cxx +++ b/basic/source/comp/basiccharclass.cxx @@ -110,9 +110,8 @@ bool BasicCharClass::isLetterUnicode( sal_Unicode c ) static CharClass* pCharClass = NULL; if( pCharClass == NULL ) pCharClass = new CharClass( Application::GetSettings().GetLocale() ); - String aStr( c ); // can we get pCharClass to accept a sal_Unicode instead of this waste? - return pCharClass->isLetter( aStr, 0 ); + return pCharClass->isLetter( rtl::OUString(c), 0 ); } bool BasicCharClass::isAlpha( sal_Unicode c, bool bCompatible ) diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 1acc7c98b3ea..9b3bbad15a2f 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -138,7 +138,7 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, sal_Bool bAsNewAlreadyParsed ) // #52709 DIM AS NEW for Uno with full-qualified name if( Peek() == DOT ) { - String aDotStr( '.' ); + rtl::OUString aDotStr( '.' ); while( Peek() == DOT ) { aCompleteName += aDotStr; diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 1af42ef2fadb..f958a88b30a8 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -722,7 +722,7 @@ void SbiParser::Implements() Next(); if( Peek() == DOT ) { - String aDotStr( '.' ); + rtl::OUString aDotStr( '.' ); while( Peek() == DOT ) { aImplementedIface += aDotStr; diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index bde97f023689..a0598d4ffb06 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -345,8 +345,8 @@ DataSourceTabPage::DataSourceTabPage( // set button text sal_Unicode cBlackUpPointingTriangle( 0x25b2 ); sal_Unicode cBlackDownPointingTriangle( 0x25bc ); - m_aBTN_UP.SetText( String( cBlackUpPointingTriangle )); - m_aBTN_DOWN.SetText( String( cBlackDownPointingTriangle )); + m_aBTN_UP.SetText( rtl::OUString( cBlackUpPointingTriangle )); + m_aBTN_DOWN.SetText( rtl::OUString( cBlackDownPointingTriangle )); // init controls m_aLB_ROLE.SetTabs( lcl_pRoleListBoxTabs, MAP_APPFONT ); diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 99c473b8ef5e..e38fc0f51d40 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -350,10 +350,10 @@ void SvxHyperlinkNewDocTp::DoApply () SfxStringItem aReferer( SID_REFERER, rtl::OUString("private:user") ); SfxStringItem aFrame( SID_TARGETNAME, rtl::OUString("_blank") ); - String aStrFlags ( sal_Unicode('S') ); + rtl::OUString aStrFlags('S'); if ( maRbtEditLater.IsChecked() ) { - aStrFlags += sal_Unicode('H'); + aStrFlags += rtl::OUString('H'); } SfxStringItem aFlags (SID_OPTIONS, aStrFlags); diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx index 064231c5f086..6d93cdec7201 100644 --- a/cui/source/dialogs/hyphen.cxx +++ b/cui/source/dialogs/hyphen.cxx @@ -326,8 +326,8 @@ String SvxHyphenWordDialog_Impl::EraseUnusableHyphens_Impl( // 1) remove all not usable hyphenation positions from the end of the string nPos = nIdx == STRING_NOTFOUND ? 0 : nIdx + 1; nPos1 = nPos; //save for later use in 2) below - const String aTmp( sal_Unicode( HYPH_POS_CHAR ) ); - const String aEmpty; + const rtl::OUString aTmp( sal_Unicode( HYPH_POS_CHAR ) ); + const rtl::OUString aEmpty; while (nPos != STRING_NOTFOUND) nPos = aTxt.SearchAndReplace( aTmp, aEmpty, nPos + 1 ); diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index d7ccde69cfcf..f731ef39b429 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -312,7 +312,7 @@ short SvInsertOleDlg::Execute() // object couldn't be created from file // global Resource from svtools (former so3 resource) String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) ); - aErr.SearchAndReplace( String( '%' ), aFileName ); + aErr.SearchAndReplace( rtl::OUString( '%' ), aFileName ); ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute(); } else @@ -320,7 +320,7 @@ short SvInsertOleDlg::Execute() // object couldn't be created // global Resource from svtools (former so3 resource) String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE ) ); - aErr.SearchAndReplace( String( '%' ), aServerName ); + aErr.SearchAndReplace( rtl::OUString( '%' ), aServerName ); ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute(); } } @@ -373,7 +373,7 @@ short SvInsertOleDlg::Execute() // object couldn't be created from file // global Resource from svtools (former so3 resource) String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_FROM_FILE ) ); - aErr.SearchAndReplace( String( '%' ), aFileName ); + aErr.SearchAndReplace( rtl::OUString( '%' ), aFileName ); ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute(); } } @@ -529,7 +529,7 @@ short SvInsertPlugInDialog::Execute() // PlugIn couldn't be created // global Resource from svtools (former so3 resource) String aErr( impl_getSvtResString( STR_ERROR_OBJNOCREATE_PLUGIN ) ); - aErr.SearchAndReplace( String( '%' ), aURL ); + aErr.SearchAndReplace( rtl::OUString('%'), aURL ); ErrorBox( this, WB_3DLOOK | WB_OK, aErr ).Execute(); } } diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index 5ab52fd32170..92ce9f4115d3 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -105,7 +105,7 @@ IMPL_LINK_NOARG(SvxMultiPathDialog, AddHdl_Impl) sal_uLong nPos = aRadioLB.GetEntryPos( sInsPath, 1 ); if ( 0xffffffff == nPos ) //See svtools/source/contnr/svtabbx.cxx SvTabListBox::GetEntryPos { - String sNewEntry( '\t' ); + rtl::OUString sNewEntry( '\t' ); sNewEntry += sInsPath; SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sNewEntry ); String* pData = new String( aURL ); @@ -293,7 +293,7 @@ void SvxMultiPathDialog::SetPath( const String& rPath ) if ( pImpl->bIsRadioButtonMode ) { - String sEntry( '\t' ); + rtl::OUString sEntry( '\t' ); sEntry += (bIsSystemPath ? sSystemPath : sPath); SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sEntry ); String* pURL = new String( sPath ); diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index a8ab0d1d25d4..859e83a88552 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -596,7 +596,7 @@ IMPL_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit *, pEdit ) rtl::OUString aValue = pEdit->GetText(); if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.toInt32() > USHRT_MAX ) - pEdit->SetText( '0' ); + pEdit->SetText( rtl::OUString('0') ); return 0; } diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 52b5c4b3fa62..f1238d8a401a 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -133,14 +133,15 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet }; m_aJavaList.SvxSimpleTable::SetTabs( aStaticTabs ); - String sHeader( '\t' ); - sHeader += String( CUI_RES( STR_HEADER_VENDOR ) ); - sHeader += '\t'; - sHeader += String( CUI_RES( STR_HEADER_VERSION ) ); - sHeader += '\t'; - sHeader += String( CUI_RES( STR_HEADER_FEATURES ) ); - sHeader += '\t'; - m_aJavaList.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT ); + rtl::OUStringBuffer sHeader; + sHeader.append('\t'); + sHeader.append(CUI_RESSTR(STR_HEADER_VENDOR)); + sHeader.append('\t'); + sHeader.append(CUI_RESSTR(STR_HEADER_VERSION)); + sHeader.append('\t'); + sHeader.append(CUI_RESSTR(STR_HEADER_FEATURES)); + sHeader.append('\t'); + m_aJavaList.InsertHeaderEntry( sHeader.makeStringAndClear(), HEADERBAR_APPEND, HIB_LEFT ); m_aJavaList.SetHelpId( HID_OPTIONS_JAVA_LIST ); @@ -476,14 +477,15 @@ void SvxJavaOptionsPage::LoadJREs() void SvxJavaOptionsPage::AddJRE( JavaInfo* _pInfo ) { - String sEntry( '\t' ); - sEntry += String( ::rtl::OUString( _pInfo->sVendor ) ); - sEntry += '\t'; - sEntry += String( ::rtl::OUString( _pInfo->sVersion ) ); - sEntry += '\t'; + rtl::OUStringBuffer sEntry; + sEntry.append('\t'); + sEntry.append(_pInfo->sVendor); + sEntry.append('\t'); + sEntry.append(_pInfo->sVersion); + sEntry.append('\t'); if ( ( _pInfo->nFeatures & JFW_FEATURE_ACCESSBRIDGE ) == JFW_FEATURE_ACCESSBRIDGE ) - sEntry += m_sAccessibilityText; - SvLBoxEntry* pEntry = m_aJavaList.InsertEntry( sEntry ); + sEntry.append(m_sAccessibilityText); + SvLBoxEntry* pEntry = m_aJavaList.InsertEntry(sEntry.makeStringAndClear()); INetURLObject aLocObj( ::rtl::OUString( _pInfo->sLocation ) ); String* pLocation = new String( aLocObj.getFSysPath( INetURLObject::FSYS_DETECT ) ); pEntry->SetUserData( pLocation ); diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 2643aa44be48..21721156b606 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/i18n/CollatorOptions.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <vcl/svapp.hxx> #include <sfx2/module.hxx> #include <sfx2/request.hxx> @@ -597,11 +598,11 @@ sal_Bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet& ) pOpt->bChgEnumNum = bCheck; bModified |= aBulletFont != pOpt->aBulletFont; pOpt->aBulletFont = aBulletFont; - bModified |= String(pOpt->cBullet) != sBulletChar; + bModified |= !comphelper::string::equals(sBulletChar, pOpt->cBullet); pOpt->cBullet = sBulletChar.GetChar(0); bModified |= aByInputBulletFont != pOpt->aByInputBulletFont; - bModified |= String(pOpt->cByInputBullet) != sByInputBulletChar; + bModified |= !comphelper::string::equals(sByInputBulletChar, pOpt->cByInputBullet); pOpt->aByInputBulletFont = aByInputBulletFont; pOpt->cByInputBullet = sByInputBulletChar.GetChar(0); diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 7e82b1cfdd1d..87044935b294 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -701,7 +701,7 @@ void SvxBackgroundTabPage::FillUserData() */ { - SetUserData( String( aBtnPreview.IsChecked() ? sal_Unicode('1') : sal_Unicode('0') ) ); + SetUserData( aBtnPreview.IsChecked() ? rtl::OUString('1') : rtl::OUString('0') ); } //------------------------------------------------------------------------ diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 98b00b6a95c9..55b1180fcae7 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -3576,7 +3576,7 @@ void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, sal_Bool bStart ) if ( !bFound ) { - nEntryPos = pBox->InsertEntry( String( cBracket ) ); + nEntryPos = pBox->InsertEntry( rtl::OUString(cBracket) ); pBox->SelectEntryPos( nEntryPos ); } } diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index e909c1706886..6008b63d72f3 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -2311,7 +2311,7 @@ sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev, aBulletColor.Invert(); aFont.SetColor(aBulletColor); pVDev->SetFont( aFont ); - String aText(sal_Unicode(rFmt.GetBulletChar())); + rtl::OUString aText(rFmt.GetBulletChar()); long nY = nYStart; nY -= ((aTmpSize.Height() - rSize.Height())/ 2); pVDev->DrawText( Point(nXStart, nY), aText ); @@ -2463,7 +2463,7 @@ void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ ) rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE ) { pVDev->SetFont(aStdFont); - String aText(' '); + rtl::OUString aText(' '); pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText); } diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index ecb0461cdf7c..58784d8afceb 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -463,7 +463,7 @@ void SvxTabulatorTabPage::SetFillAndTabType_Impl() pTypeBtn = &aDezTab; aDezChar.Enable(); aDezCharLabel.Enable(); - aDezChar.SetText( String( (sal_Unicode)aAktTab.GetDecimal() ) ); + aDezChar.SetText( rtl::OUString( (sal_Unicode)aAktTab.GetDecimal() ) ); } else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) pTypeBtn = &aCenterTab; @@ -486,7 +486,7 @@ void SvxTabulatorTabPage::SetFillAndTabType_Impl() { pFillBtn = &aFillSpecial; aFillChar.Enable(); - aFillChar.SetText( String( (sal_Unicode)aAktTab.GetFill() ) ); + aFillChar.SetText( rtl::OUString( (sal_Unicode)aAktTab.GetFill() ) ); } pFillBtn->Check(); } @@ -628,7 +628,7 @@ IMPL_LINK( SvxTabulatorTabPage, TabTypeCheckHdl_Impl, RadioButton *, pBox ) eAdj = SVX_TAB_ADJUST_DECIMAL; aDezChar.Enable(); aDezCharLabel.Enable(); - aDezChar.SetText( String( (sal_Unicode)aAktTab.GetDecimal() ) ); + aDezChar.SetText( rtl::OUString( (sal_Unicode)aAktTab.GetDecimal() ) ); } aAktTab.GetAdjustment() = eAdj; diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 0614c4721f51..9fd4d3a31798 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2205,9 +2205,9 @@ void OApplicationController::renameEntry() } catch(const ElementExistException& e) { - static ::rtl::OUString sStatus = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")); + rtl::OUString sStatus("S1000"); String sMsg = String( ModuleRes( STR_NAME_ALREADY_EXISTS ) ); - sMsg.SearchAndReplace('#',e.Message); + sMsg.SearchAndReplace(rtl::OUString('#'), e.Message); showError(SQLExceptionInfo(SQLException(sMsg, e.Context, sStatus, 0, Any()))); } catch(const Exception& ) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index b679e180fd4f..e50a64eb990f 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -1857,7 +1857,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const xProp->getPropertyValue(PROPERTY_COMMAND) >>= aName; String sObject(aName); - sTitle.SearchAndReplace('#',sObject); + sTitle.SearchAndReplace(rtl::OUString('#'), sObject); aReturn.sTitle = sTitle; aReturn.bEnabled = sal_True; } diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 2759864379de..b1423140c2bd 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -48,6 +48,7 @@ #include <connectivity/dbtools.hxx> #include <connectivity/dbconversion.hxx> #include <comphelper/numbers.hxx> +#include <comphelper/string.hxx> #include "UITools.hxx" #include <memory> #include "dbu_control.hrc" @@ -263,33 +264,26 @@ OFieldDescControl::~OFieldDescControl() //------------------------------------------------------------------------------ String OFieldDescControl::BoolStringPersistent(const String& rUIString) const { - static String aZero('0'); - static String aOne('1'); - if (rUIString == aNo) - return aZero; + return rtl::OUString('0'); if (rUIString == aYes) - return aOne; - return String(); + return rtl::OUString('1'); + return rtl::OUString(); } //------------------------------------------------------------------------------ String OFieldDescControl::BoolStringUI(const String& rPersistentString) const { - static String aZero('0'); - static String aOne('1'); - static String aNone(ModuleRes(STR_VALUE_NONE)); - // Older versions may store a language dependend string as a default if (rPersistentString.Equals(aYes) || rPersistentString.Equals(aNo)) return rPersistentString; - if (rPersistentString == aZero) + if (comphelper::string::equals(rPersistentString, '0')) return aNo; - if (rPersistentString == aOne) + if (comphelper::string::equals(rPersistentString, '1')) return aYes; - return aNone; + return ModuleRes(STR_VALUE_NONE).toString(); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index a04d977daf83..ab4b1505aac0 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -470,7 +470,7 @@ DBG_NAME(OTextConnectionHelper) else { sExtension = m_aETOwnExtension.GetText(); - if ( sExtension.GetToken(0,'.').Equals('*') ) + if ( comphelper::string::equals(sExtension.GetToken(0,'.'), '*') ) sExtension.Erase(0,2); } return sExtension; @@ -487,11 +487,11 @@ DBG_NAME(OTextConnectionHelper) return rBox.GetText().Copy(0); if ( !( &m_aTextSeparator == &rBox && nPos == (rBox.GetEntryCount()-1) ) ) - return String( + return rtl::OUString( static_cast< sal_Unicode >( rList.GetToken(((nPos*2)+1), nTok ).ToInt32())); // somewhat strange ... translates for instance an "32" into " " - return String(); + return rtl::OUString(); } //------------------------------------------------------------------------ @@ -503,11 +503,11 @@ DBG_NAME(OTextConnectionHelper) for( i=0 ; i<nCnt ; i+=2 ) { - String sTVal( + rtl::OUString sTVal( static_cast< sal_Unicode >( rList.GetToken( (i+1), nTok ).ToInt32())); - if( sTVal == rVal ) + if( sTVal.equals(rVal) ) { rBox.SetText( rList.GetToken( i, nTok ) ); break; diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 7c36e19528b1..d3ddfb7ac0e5 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -343,9 +343,9 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxBoolItem(DSID_SHOWDELETEDROWS, sal_False); *pCounter++ = new SfxBoolItem(DSID_ALLOWLONGTABLENAMES, sal_False); *pCounter++ = new SfxStringItem(DSID_JDBCDRIVERCLASS, rtl::OUString()); - *pCounter++ = new SfxStringItem(DSID_FIELDDELIMITER, ','); - *pCounter++ = new SfxStringItem(DSID_TEXTDELIMITER, '"'); - *pCounter++ = new SfxStringItem(DSID_DECIMALDELIMITER, '.'); + *pCounter++ = new SfxStringItem(DSID_FIELDDELIMITER, rtl::OUString(',')); + *pCounter++ = new SfxStringItem(DSID_TEXTDELIMITER, rtl::OUString('"')); + *pCounter++ = new SfxStringItem(DSID_DECIMALDELIMITER, rtl::OUString('.')); *pCounter++ = new SfxStringItem(DSID_THOUSANDSDELIMITER, rtl::OUString()); *pCounter++ = new SfxStringItem(DSID_TEXTFILEEXTENSION, rtl::OUString("txt")); *pCounter++ = new SfxBoolItem(DSID_TEXTFILEHEADER, sal_True); diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 9f0b4d997c69..120140063ef7 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -219,7 +219,7 @@ DBG_NAME(IndexFieldsControl) sal_Int32 nWidthAsc = GetTextWidth(m_sAscendingText) + GetSettings().GetStyleSettings().GetScrollBarSize(); sal_Int32 nWidthDesc = GetTextWidth(m_sDescendingText) + GetSettings().GetStyleSettings().GetScrollBarSize(); // maximum plus some additional space - return (nWidthAsc > nWidthDesc ? nWidthAsc : nWidthDesc) + GetTextWidth('0') * 2; + return (nWidthAsc > nWidthDesc ? nWidthAsc : nWidthDesc) + GetTextWidth(rtl::OUString('0')) * 2; } return EditBrowseBox::GetTotalCellWidth(_nRow, _nColId); } @@ -249,7 +249,7 @@ DBG_NAME(IndexFieldsControl) nOther = GetTextWidth(m_sDescendingText) + GetSettings().GetStyleSettings().GetScrollBarSize(); nSortOrderColumnWidth = nSortOrderColumnWidth > nOther ? nSortOrderColumnWidth : nOther; // (plus some additional space) - nSortOrderColumnWidth += GetTextWidth('0') * 2; + nSortOrderColumnWidth += GetTextWidth(rtl::OUString('0')) * 2; InsertDataColumn(COLUMN_ID_ORDER, sColumnName, nSortOrderColumnWidth, HIB_STDSTYLE, 1); m_pSortingCell = new ListBoxControl(&GetDataWindow()); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 7779a2d1451a..6e16280bbd99 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -208,8 +208,8 @@ sal_Bool OCopyTable::LeavePage() && m_pParent->m_aKeyName != m_pParent->createUniqueName(m_pParent->m_aKeyName) ) { String aInfoString( ModuleRes(STR_WIZ_PKEY_ALREADY_DEFINED) ); - aInfoString += String(' '); - aInfoString += String(m_pParent->m_aKeyName); + aInfoString += rtl::OUString(' '); + aInfoString += m_pParent->m_aKeyName; m_pParent->showError(aInfoString); return sal_False; } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index b7a07cf1781a..7c4ad6f91343 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -2329,7 +2329,7 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nCo sal_uInt16 nIdx = m_pOrderCell->GetSelectEntryPos(); if (nIdx == sal_uInt16(-1)) nIdx = 0; - return String(nIdx); + return rtl::OUString(nIdx); } default: return GetCellText(nCellIndex, nColId); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 231eef5cd72f..2bd52f703d24 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -1267,7 +1267,7 @@ String OTableEditorCtrl::GetCellText( long nRow, sal_uInt16 nColId ) const sal_uInt32 OTableEditorCtrl::GetTotalCellWidth(long nRow, sal_uInt16 nColId) { DBG_CHKTHIS(OTableEditorCtrl,NULL); - return GetTextWidth(GetCellText(nRow, nColId)) + 2 * GetTextWidth('0'); + return GetTextWidth(GetCellText(nRow, nColId)) + 2 * GetTextWidth(rtl::OUString('0')); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index 0794cd67b6cc..f3690eb29de1 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -74,7 +74,7 @@ void OTableRowView::Init() SetFont(aFont); // HandleColumn, fuer maximal fuenf Ziffern einrichten - InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth('0') * 4)/*, sal_True */); + InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth(rtl::OUString('0')) * 4)/*, sal_True */); BrowserMode nMode = BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL; diff --git a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx index 47ddc50d3daf..1844947bb412 100644 --- a/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textstrikeoutprimitive2d.cxx @@ -69,7 +69,7 @@ namespace drawinglayer Primitive2DSequence TextCharacterStrikeoutPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { // strikeout with character - const String aSingleCharString(getStrikeoutChar()); + const rtl::OUString aSingleCharString(getStrikeoutChar()); basegfx::B2DVector aScale, aTranslate; double fRotate, fShearX; 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; diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index e8b19fd7e257..5fefcf4a871d 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -437,8 +437,8 @@ namespace pcr String sErrorMessage; { ::svt::OLocalResourceAccess aStringAccess( PcrRes( RID_DLG_FORMLINKS ), RSC_MODALDIALOG ); - sErrorMessage = String( PcrRes( STR_ERROR_RETRIEVING_COLUMNS) ); - sErrorMessage.SearchAndReplace('#',sCommand); + sErrorMessage = PcrRes(STR_ERROR_RETRIEVING_COLUMNS).toString(); + sErrorMessage.SearchAndReplace(rtl::OUString('#'), sCommand); } SQLContext aContext; diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index dfc7edf05b93..0bff4ba87df7 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -563,7 +563,7 @@ void Writer::Impl_writeText( const Point& rPos, const String& rText, const sal_I if( nLen > 1 ) { - aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( (sal_uInt16) nLen - 1 ) ); + aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rtl::OUString(rText.GetChar((sal_uInt16) nLen - 1)) ); if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) ) { diff --git a/filter/source/flash/swfwriter2.cxx b/filter/source/flash/swfwriter2.cxx index 9377efc950ea..70a621e040c5 100644 --- a/filter/source/flash/swfwriter2.cxx +++ b/filter/source/flash/swfwriter2.cxx @@ -467,7 +467,7 @@ sal_uInt16 FlashFont::getGlyph( sal_uInt16 nChar, VirtualDevice* pVDev ) // let the virtual device convert the character to polygons PolyPolygon aPolyPoly; - pVDev->GetTextOutline( aPolyPoly, nChar ); + pVDev->GetTextOutline( aPolyPoly, rtl::OUString(nChar) ); maGlyphOffsets.push_back( _uInt16( maGlyphData.getOffset() ) ); diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 3d2ce16baf43..64ba6ed43def 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -1926,7 +1926,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) aPt2 = aPolyDummy.GetPoint( 0 ); } } - METChrStr( aPt2, String( aStr.GetChar( i ) ) ); + METChrStr( aPt2, rtl::OUString( aStr.GetChar( i ) ) ); } } else @@ -1980,7 +1980,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF ) aPt2 = aPolyDummy.GetPoint( 0 ); } } - METChrStr( aPt2, String( aStr.GetChar( i ) ) ); + METChrStr( aPt2, rtl::OUString( aStr.GetChar( i ) ) ); } delete[] pDXAry; diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx index 9db541c784dd..7646ed2da0b0 100644 --- a/filter/source/graphicfilter/epict/epict.cxx +++ b/filter/source/graphicfilter/epict/epict.cxx @@ -1357,7 +1357,7 @@ void PictWriter::WriteTextArray(Point & rPoint, const String& rString, const sal if ( i > 0 ) aPt.X() += pDXAry[ i - 1 ]; - WriteOpcode_Text( aPt, String( c ), bDelta ); + WriteOpcode_Text( aPt, rtl::OUString( c ), bDelta ); bDelta = sal_True; } } diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 8e2c2aa0b7c1..ec33629f69b5 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -2046,7 +2046,7 @@ void PSWriter::ImplWriteString( const rtl::OString& rString, VirtualDevice& rVDe { if ( i > 0 ) nx = pDXArry[ i - 1 ]; - ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( rString[i] ) ); + ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( rtl::OUString(rString[i]) ) ); ImplWriteDouble( nx ); ImplWriteLine( "(", PS_NONE ); ImplWriteCharacter( rString[i] ); diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index f6f9b158864f..999da176994b 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -447,7 +447,7 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() if( mbIsRangeChecked ) { aRet[ nLength - nElementAdded ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ); - aRet[ nLength - nElementAdded ].Value <<= OUString( msPageRange ); + aRet[ nLength - nElementAdded ].Value <<= msPageRange; nElementAdded--; } else if( mbSelectionIsChecked ) @@ -689,7 +689,7 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) if( maRbRange.IsChecked() ) { paParent->mbIsRangeChecked = sal_True; - paParent->msPageRange = String( maEdPages.GetText() ); //FIXME all right on other languages ? + paParent->msPageRange = maEdPages.GetText(); //FIXME all right on other languages ? } else if( maRbSelection.IsChecked() ) { diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 45747fd5c6d0..8c468b148e0e 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -141,7 +141,7 @@ protected: com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder > mxPreparedPasswords; sal_Bool mbIsRangeChecked; - String msPageRange; + rtl::OUString msPageRange; sal_Bool mbSelectionIsChecked; sal_Bool mbExportRelativeFsysLinks; diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index eef0e6f43832..3c2de0f124c2 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -281,7 +281,7 @@ void SVGFontExport::implEmbedGlyph( OutputDevice& rOut, const ::rtl::OUString& r mrExport.AddAttribute( XML_NAMESPACE_NONE, "unicode", rCellStr ); if( rCellStr[ 0 ] == nSpace && rCellStr.getLength() == 1 ) - aBoundRect = Rectangle( Point( 0, 0 ), Size( rOut.GetTextWidth( sal_Unicode( ' ' ) ), 0 ) ); + aBoundRect = Rectangle( Point( 0, 0 ), Size( rOut.GetTextWidth( rtl::OUString(' ') ), 0 ) ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", ::rtl::OUString::valueOf( aBoundRect.GetWidth() ) ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index a74e17522110..1e2a2c0197e6 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1195,7 +1195,7 @@ void SVGActionWriter::ImplWriteText( const Point& rPos, const String& rText, { if( nLen > 1 ) { - aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rText.GetChar( nLen - 1 ) ); + aNormSize.Width() = pDX[ nLen - 2 ] + mpVDev->GetTextWidth( rtl::OUString(rText.GetChar(nLen - 1)) ); if( nWidth && aNormSize.Width() && ( nWidth != aNormSize.Width() ) ) { diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index e2e30597def1..0a3d9afbe3f3 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -670,9 +670,9 @@ void FormulaCompiler::InitSymbolsEnglishXL() const // TODO: For now, just replace the separators to the Excel English // variants. Later, if we want to properly map Excel functions with Calc // functions, we'll need to do a little more work here. - mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocSep); - mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocArrayColSep); - mxSymbolsEnglishXL->putOpCode(sal_Unicode(';'), ocArrayRowSep); + mxSymbolsEnglishXL->putOpCode(rtl::OUString(','), ocSep); + mxSymbolsEnglishXL->putOpCode(rtl::OUString(','), ocArrayColSep); + mxSymbolsEnglishXL->putOpCode(rtl::OUString(';'), ocArrayRowSep); } // ----------------------------------------------------------------------------- @@ -1766,7 +1766,7 @@ void FormulaCompiler::AppendString( rtl::OUStringBuffer& rBuffer, const String & else { String aStr( rStr ); - aStr.SearchAndReplaceAll( '"', String( RTL_CONSTASCII_USTRINGPARAM( "\"\""))); + aStr.SearchAndReplaceAll( rtl::OUString('"'), rtl::OUString("\"\"") ); rBuffer.append(aStr); } rBuffer.append(sal_Unicode('"')); diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index b32f64d2cd89..26473c01f8cb 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -937,7 +937,7 @@ void FormulaDlg_Impl::ClearAllParas() } String FormulaDlg_Impl::RepairFormula(const String& aFormula) { - String aResult('='); + rtl::OUString aResult('='); try { UpdateTokenArray(aFormula); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 78f8fe8facfd..13540848252b 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -1128,7 +1128,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) && pThis->_pImp->_pCbAutoExtension // auto extension is enabled in general && pThis->_pImp->_pCbAutoExtension->IsChecked() // auto extension is really to be used && pThis->GetDefaultExt().Len() // there is a default extension - && pThis->GetDefaultExt() != '*' // the default extension is not "all" + && !comphelper::string::equals(pThis->GetDefaultExt(), '*') // the default extension is not "all" && !( FILEDLG_MODE_SAVE == pThis->_pImp->_eMode // we're saving a file && pThis->_pFileView->GetSelectionCount() // there is a selected file in the file view -> it will later on ) // (in SvtFileDialog::GetPathList) be taken as file to save to @@ -2568,7 +2568,7 @@ sal_Bool SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilt if ( nPathTokenPos == STRING_NOTFOUND ) { - String aDelim( + rtl::OUString aDelim( #if defined(WNT) '\\' #else diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index cc0efe8a51fb..0309f3aa97ba 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -316,10 +316,11 @@ void SvtExpFileDlg_Impl::SetStandardDir( const String& _rDir ) namespace { String lcl_DecoratedFilter( const String& _rOriginalFilter ) { - String aDecoratedFilter = '<'; - aDecoratedFilter += _rOriginalFilter; - aDecoratedFilter += '>'; - return aDecoratedFilter; + rtl::OUStringBuffer aDecoratedFilter; + aDecoratedFilter.append('<'); + aDecoratedFilter.append(_rOriginalFilter); + aDecoratedFilter.append('>'); + return aDecoratedFilter.makeStringAndClear(); } } #endif diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx index eb278b75beb5..d986f47ea1ba 100644 --- a/reportdesign/source/core/sdr/UndoActions.cxx +++ b/reportdesign/source/core/sdr/UndoActions.cxx @@ -401,9 +401,9 @@ void ORptUndoPropertyAction::setProperty(sal_Bool _bOld) rtl::OUString ORptUndoPropertyAction::GetComment() const { - String aStr(ModuleRes(RID_STR_UNDO_PROPERTY)); + String aStr(ModuleRes(RID_STR_UNDO_PROPERTY).toString()); - aStr.SearchAndReplace( '#', m_aPropertyName ); + aStr.SearchAndReplace(rtl::OUString('#'), m_aPropertyName); return aStr; } diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 91f122dc0ac6..9f3ce57bf259 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -300,7 +300,7 @@ ORptExport::ORptExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt1 m_xParaPropMapper = new OSpecialHanldeXMLExportPropertyMapper( xPropMapper); ::rtl::OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); - ::rtl::OUString aPrefix( String( 'P' ) ); + ::rtl::OUString aPrefix( 'P'); GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, m_xParaPropMapper, aPrefix ); diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 49c21d3803b2..1633f61ae79b 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -366,7 +366,7 @@ void OFieldExpressionControl::lateInit() aFont.SetWeight( WEIGHT_LIGHT ); SetFont(aFont); - InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth('0') * 4)/*, sal_True */); + InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth(rtl::OUString('0')) * 4)/*, sal_True */); InsertDataColumn( FIELD_EXPRESSION, String(ModuleRes(STR_RPT_EXPRESSION)), 100); m_pComboCell = new ComboBoxControl( &GetDataWindow() ); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index cadea38eafcf..5b6c0ad6c54c 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -195,8 +195,8 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& sExpression = sLabel; } - String sTitle = String(ModuleRes(_nResId)); - sTitle.SearchAndReplace('#',sExpression); + String sTitle = ModuleRes(_nResId).toString(); + sTitle.SearchAndReplace(rtl::OUString('#') ,sExpression); m_aStartMarker.setTitle(sTitle); m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); } diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 0c51238b9e0c..e2f2c55ba5e1 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -135,12 +135,13 @@ ScMergeAttr::~ScMergeAttr() String ScMergeAttr::GetValueText() const { - String aString( '(' ); - aString += String::CreateFromInt32( nColMerge ); - aString += ','; - aString += String::CreateFromInt32( nRowMerge ); - aString += ')'; - return aString; + rtl::OUStringBuffer aString; + aString.append('('); + aString.append(static_cast<sal_Int32>(nColMerge)); + aString.append(','); + aString.append(static_cast<sal_Int32>(nRowMerge)); + aString.append(')'); + return aString.makeStringAndClear(); } //------------------------------------------------------------------------ diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 011d2e0d63e3..08310e7fd6fb 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -822,7 +822,7 @@ void ScGlobal::AddQuotes( String& rString, sal_Unicode cQuote, bool bEscapeEmbed pQ[0] = pQ[1] = cQuote; pQ[2] = 0; rtl::OUString aQuotes( pQ ); - rString.SearchAndReplaceAll( cQuote, aQuotes); + rString.SearchAndReplaceAll( rtl::OUString(cQuote), aQuotes); } rString.Insert( cQuote, 0 ).Append( cQuote ); } @@ -838,7 +838,7 @@ void ScGlobal::EraseQuotes( String& rString, sal_Unicode cQuote, bool bUnescapeE pQ[0] = pQ[1] = cQuote; pQ[2] = 0; rtl::OUString aQuotes( pQ ); - rString.SearchAndReplaceAll( aQuotes, cQuote); + rString.SearchAndReplaceAll( aQuotes, rtl::OUString(cQuote)); } } } diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index 6fc2e4c570f9..e180538f767f 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -387,7 +387,7 @@ String ScGlobal::GetAbsDocName( const String& rFileName, String ScGlobal::GetDocTabName( const String& rFileName, const String& rTabName ) { - String aDocTab( '\'' ); + String aDocTab(rtl::OUString('\'')); aDocTab += rFileName; xub_StrLen nPos = 1; while( (nPos = aDocTab.Search( '\'', nPos )) diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 09ef436a390c..fcafa58bf884 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -94,7 +94,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi xub_StrLen nNum = 0; if ( p[nNum] == '-' ) nNum = nNeg = 1; - while ( p[nNum] && CharClass::isAsciiNumeric( p[nNum] ) ) + while ( p[nNum] && CharClass::isAsciiNumeric( rtl::OUString(p[nNum]) ) ) nNum++; sal_Unicode cNext = p[nNum]; // 0 if at the end @@ -103,7 +103,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi // #i5550# If there are numbers at the beginning and the end, // prefer the one at the beginning only if it's followed by a space. // Otherwise, use the number at the end, to enable things like IP addresses. - if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || !CharClass::isAsciiNumeric(cLast) ) ) + if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || !CharClass::isAsciiNumeric(rtl::OUString(cLast)) ) ) { // number at the beginning nVal = aValue.Copy( 0, nNum ).ToInt32(); // any number with a leading zero sets the minimum number of digits @@ -116,7 +116,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi { nNeg = 0; xub_StrLen nEnd = nNum = aValue.Len() - 1; - while ( nNum && CharClass::isAsciiNumeric( p[nNum] ) ) + while ( nNum && CharClass::isAsciiNumeric( rtl::OUString(p[nNum]) ) ) nNum--; if ( p[nNum] == '-' ) { diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 6a3aa146a32b..a9f6e43bf6f8 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2790,7 +2790,7 @@ bool ScCompiler::IsReference( const String& rName ) if ( ch1 == cDecSep ) return false; // Who was that imbecile introducing '.' as the sheet name separator!?! - if ( CharClass::isAsciiNumeric( ch1 ) ) + if ( CharClass::isAsciiNumeric( rtl::OUString(ch1) ) ) { // Numerical sheet name is valid. // But English 1.E2 or 1.E+2 is value 100, 1.E-2 is 0.01 @@ -3492,7 +3492,7 @@ void ScCompiler::AutoCorrectParsedSymbol() String aOld( aRef[j] ); String aStr2; const sal_Unicode* p = aRef[j].GetBuffer(); - while ( *p && CharClass::isAsciiNumeric( *p ) ) + while ( *p && CharClass::isAsciiNumeric( rtl::OUString(*p) ) ) aStr2 += *p++; aRef[j] = rtl::OUString( p ); aRef[j] += aStr2; @@ -3604,7 +3604,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) } else { - String aTmpStr( cSymbol[0] ); + rtl::OUString aTmpStr( cSymbol[0] ); bMayBeFuncName = ScGlobal::pCharClass->isLetter( aTmpStr, 0 ); bAsciiNonAlnum = false; } diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index eae3d241f68d..be6525300d5a 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -591,7 +591,7 @@ String lcl_GetCharStr( sal_Int32 nNo ) String lcl_GetNumStr( sal_Int32 nNo, SvxNumType eType ) { - String aTmpStr( '0' ); + String aTmpStr(rtl::OUString('0')); if( nNo ) { switch( eType ) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 58e3cbd99526..15c1c892935f 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2336,7 +2336,7 @@ void ScInterpreter::ScCell() // font color doesn't matter here pDok->GetDefPattern()->GetFont( aDefFont, SC_AUTOCOL_BLACK, pPrinter ); pPrinter->SetFont( aDefFont ); - long nZeroWidth = pPrinter->GetTextWidth( String( '0' ) ); + long nZeroWidth = pPrinter->GetTextWidth( rtl::OUString( '0' ) ); pPrinter->SetFont( aOldFont ); pPrinter->SetMapMode( aOldMode ); int nZeroCount = (int)(pDok->GetColWidth( aCellPos.Col(), aCellPos.Tab() ) / nZeroWidth); @@ -3007,11 +3007,10 @@ void ScInterpreter::ScPropper() const sal_Unicode* pUpr = aUpr.GetBuffer(); const sal_Unicode* pLwr = aLwr.GetBuffer(); *pStr = *pUpr; - String aTmpStr( 'x' ); xub_StrLen nPos = 1; while( nPos < nLen ) { - aTmpStr.SetChar( 0, pStr[nPos-1] ); + rtl::OUString aTmpStr( pStr[nPos-1] ); if ( !ScGlobal::pCharClass->isLetter( aTmpStr, 0 ) ) pStr[nPos] = pUpr[nPos]; else diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index d5ea624983c5..9888f5af4b14 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -1152,9 +1152,9 @@ void XclExpChFrLabelProps::Convert( const ScfPropertySet& rPropSet, bool bShowSe ::set_flag( maData.mnFlags, EXC_CHFRLABELPROPS_SHOWBUBBLE, bShowBubble ); // label value separator - rPropSet.GetStringProperty( maData.maSeparator, EXC_CHPROP_LABELSEPARATOR ); - if( maData.maSeparator.Len() == 0 ) - maData.maSeparator = String( sal_Unicode( ' ' ) ); + maData.maSeparator = rPropSet.GetStringProperty( EXC_CHPROP_LABELSEPARATOR ); + if( maData.maSeparator.isEmpty() ) + maData.maSeparator = rtl::OUString(' '); } void XclExpChFrLabelProps::WriteBody( XclExpStream& rStrm ) diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 101eb6a98504..bc7445b67062 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -1264,7 +1264,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) : String aToken( aString.GetToken( 0, '\n', nStringIx ) ); if( nToken > 0 ) { - mxString1->Append( '\0' ); + mxString1->Append(rtl::OUString(static_cast<sal_Unicode>('\0'))); sFormulaBuf.append( (sal_Unicode) ',' ); } mxString1->Append( aToken ); diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 62490f5e0e8e..b2a68d467265 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -564,7 +564,7 @@ void XclExpStringHelper::AppendString( XclExpString& rXclString, const XclExpRoo void XclExpStringHelper::AppendChar( XclExpString& rXclString, const XclExpRoot& rRoot, sal_Unicode cChar ) { if( rRoot.GetBiff() == EXC_BIFF8 ) - rXclString.Append( cChar ); + rXclString.Append( rtl::OUString(cChar) ); else rXclString.AppendByte( cChar, rRoot.GetTextEncoding() ); } @@ -863,7 +863,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico else { String aPortionText( mrEE.GetText( aSel ) ); - aPortionText.SearchAndReplaceAll( String( '&' ), String( RTL_CONSTASCII_USTRINGPARAM( "&&" ) ) ); + aPortionText.SearchAndReplaceAll( rtl::OUString('&'), rtl::OUString("&&") ); // #i17440# space between font height and numbers in text if( bFontHtChanged && aParaText.Len() && aPortionText.Len() ) { diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 882f8dcdbd14..e75f626aa670 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1333,14 +1333,14 @@ void XclExpExternSheetBase::WriteExtNameBuffer( XclExpStream& rStrm ) XclExpExternSheet::XclExpExternSheet( const XclExpRoot& rRoot, sal_Unicode cCode ) : XclExpExternSheetBase( rRoot, EXC_ID_EXTERNSHEET ) { - Init( String( cCode ) ); + Init( rtl::OUString(cCode) ); } XclExpExternSheet::XclExpExternSheet( const XclExpRoot& rRoot, const String& rTabName ) : XclExpExternSheetBase( rRoot, EXC_ID_EXTERNSHEET ) { // reference to own sheet: \03<sheetname> - Init( String( EXC_EXTSH_TABNAME ).Append( rTabName ) ); + Init(rtl::OUString(EXC_EXTSH_TABNAME) + rTabName); } void XclExpExternSheet::Save( XclExpStream& rStrm ) diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 63318655a360..01384ad3e387 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -1119,7 +1119,7 @@ void XclImpChText::ConvertDataLabel( ScfPropertySet& rPropSet, const XclChTypeIn // create API struct for label values, set API label separator cssc2::DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, bShowSymbol ); rPropSet.SetProperty( EXC_CHPROP_LABEL, aPointLabel ); - String aSep = mxLabelProps ? mxLabelProps->maSeparator : String( sal_Unicode( '\n' ) ); + String aSep = mxLabelProps ? mxLabelProps->maSeparator : rtl::OUString('\n'); if( aSep.Len() == 0 ) aSep = CREATE_STRING( "; " ); rPropSet.SetStringProperty( EXC_CHPROP_LABELSEPARATOR, aSep ); diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index a6bb268877df..424b91b2fc0c 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -358,7 +358,7 @@ void XclImpHyperlink::ConvertToValidTabName(String& rUrl) // the 1st character must be '#'. return; - String aNewUrl(sal_Unicode('#')), aTabName; + String aNewUrl(rtl::OUString('#')), aTabName; bool bInQuote = false; bool bQuoteTabName = false; diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 7b9846b1cd93..034a72738641 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -560,7 +560,7 @@ void XclImpHFConverter::InsertField( const SvxFieldItem& rFieldItem ) void XclImpHFConverter::InsertLineBreak() { ESelection& rSel = GetCurrSel(); - mrEE.QuickInsertText( String( '\n' ), ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); + mrEE.QuickInsertText( rtl::OUString('\n'), ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); ++rSel.nEndPara; rSel.nEndPos = 0; GetCurrInfo().mnHeight += GetCurrMaxLineHeight(); diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index a3168c652619..66b5e33993b2 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -225,7 +225,7 @@ void XclRoot::SetCharWidth( const XclFontData& rFontData ) aFont.SetCharSet( rFontData.GetFontEncoding() ); aFont.SetWeight( rFontData.GetScWeight() ); pPrinter->SetFont( aFont ); - mrData.mnCharWidth = pPrinter->GetTextWidth( String( '0' ) ); + mrData.mnCharWidth = pPrinter->GetTextWidth( rtl::OUString('0') ); } if( mrData.mnCharWidth <= 0 ) { diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx index 0e3d73f5a239..616365c73761 100644 --- a/sc/source/filter/ftools/fapihelper.cxx +++ b/sc/source/filter/ftools/fapihelper.cxx @@ -205,12 +205,11 @@ bool ScfPropertySet::GetBoolProperty( const ::rtl::OUString& rPropName ) const return GetAnyProperty( aAny, rPropName ) && ScUnoHelpFunctions::GetBoolFromAny( aAny ); } -bool ScfPropertySet::GetStringProperty( String& rValue, const OUString& rPropName ) const +OUString ScfPropertySet::GetStringProperty( const OUString& rPropName ) const { OUString aOUString; - bool bRet = GetProperty( aOUString, rPropName ); - rValue = aOUString; - return bRet; + GetProperty( aOUString, rPropName ); + return aOUString; } bool ScfPropertySet::GetColorProperty( Color& rColor, const ::rtl::OUString& rPropName ) const diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx index f34b9b1bd5d1..bf308addedc7 100644 --- a/sc/source/filter/inc/fapihelper.hxx +++ b/sc/source/filter/inc/fapihelper.hxx @@ -178,9 +178,8 @@ public: @return true = property contains true; false = property contains false or error occurred. */ bool GetBoolProperty( const ::rtl::OUString& rPropName ) const; - /** Gets the specified Boolean property from the property set. - @return true, if the passed Boolean variable could be filled with the property value. */ - bool GetStringProperty( String& rValue, const ::rtl::OUString& rPropName ) const; + /** Gets the specified Boolean property from the property set. */ + rtl::OUString GetStringProperty( const ::rtl::OUString& rPropName ) const; /** Gets the specified color property from the property set. @return true, if the passed color variable could be filled with the property value. */ diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 8b3cda92594f..14fbb1f98421 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -889,7 +889,7 @@ struct XclChObjectLink struct XclChFrLabelProps { - String maSeparator; /// Separator between label values. + rtl::OUString maSeparator; /// Separator between label values. sal_uInt16 mnFlags; /// Flags indicating which values to be displayed. explicit XclChFrLabelProps(); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 8ea50a312820..cbadad7940e0 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1325,11 +1325,12 @@ String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScAddress if ( pCell->GetCode()->GetCodeLen() <= 1 ) { // ==1: einzelner ist als Parameter immer Bereich // ==0: es waere vielleicht einer, wenn.. - String aBraced( '(' ); - aBraced += rFormula; - aBraced += ')'; + rtl::OUStringBuffer aBraced; + aBraced.append('('); + aBraced.append(rFormula); + aBraced.append(')'); delete pCell; - pCell = new ScFormulaCell( pDoc, rPos, aBraced ); + pCell = new ScFormulaCell( pDoc, rPos, aBraced.makeStringAndClear() ); } else bColRowName = false; @@ -2901,9 +2902,9 @@ void ScInputHandler::AddRefEntry() RemoveSelection(); if (pTableView) - pTableView->InsertText( cSep, false ); + pTableView->InsertText( rtl::OUString(cSep), false ); if (pTopView) - pTopView->InsertText( cSep, false ); + pTopView->InsertText( rtl::OUString(cSep), false ); DataChanged(); } @@ -3773,7 +3774,7 @@ bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine ) { xub_StrLen nLen = rDestEngine.GetTextLen( (sal_uInt16)0 ); ESelection aSel( 0,nLen, 1,0 ); - rDestEngine.QuickInsertText( ' ', aSel ); // Umbruch durch Space ersetzen + rDestEngine.QuickInsertText( rtl::OUString(' '), aSel ); // Umbruch durch Space ersetzen --nParCnt; } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index f857d8f39cb8..d819e0c733ab 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -519,7 +519,7 @@ void ScInputWindow::Select() if ( pScMod->IsEditMode() ) // nicht, wenn z.B. geschuetzt { aTextWindow.StartEditEngine(); - aTextWindow.SetTextString( '=' ); + aTextWindow.SetTextString(rtl::OUString('=')); EditView* pView = aTextWindow.GetEditView(); if (pView) diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 5d424abfc7d3..294ac6e64565 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2198,7 +2198,7 @@ IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo ) else { OSL_FAIL("unbekannter Feldbefehl"); - pInfo->SetRepresentation(String('?')); + pInfo->SetRepresentation(rtl::OUString('?')); } } diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 4465b2b39813..ff9182dd9e22 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -47,7 +47,7 @@ static const sal_Char pStrMrg[] = "MRG"; ScAsciiOptions::ScAsciiOptions() : bFixedLen ( false ), - aFieldSeps ( ';' ), + aFieldSeps ( rtl::OUString(';') ), bMergeFieldSeps ( false ), bQuotedFieldAsText(false), bDetectSpecialNumber(false), diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 5faa83dbf70a..5d99fb467e57 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -118,7 +118,7 @@ void ScCsvGrid::UpdateLayoutData() { DisableRepaint(); SetFont( maMonoFont ); - Execute( CSVCMD_SETCHARWIDTH, GetTextWidth( String( 'X' ) ) ); + Execute( CSVCMD_SETCHARWIDTH, GetTextWidth( rtl::OUString( 'X' ) ) ); Execute( CSVCMD_SETLINEHEIGHT, GetTextHeight() + 1 ); SetFont( maHeaderFont ); Execute( CSVCMD_SETHDRHEIGHT, GetTextHeight() + 1 ); @@ -132,7 +132,7 @@ void ScCsvGrid::UpdateOffsetX() sal_Int32 nDigits = 2; while( nLastLine /= 10 ) ++nDigits; nDigits = Max( nDigits, sal_Int32( 3 ) ); - Execute( CSVCMD_SETHDRWIDTH, GetTextWidth( String( '0' ) ) * nDigits ); + Execute( CSVCMD_SETHDRWIDTH, GetTextWidth( rtl::OUString( '0' ) ) * nDigits ); } void ScCsvGrid::ApplyLayout( const ScCsvLayoutData& rOldData ) diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 4717690f5df8..caa41153ff68 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -1119,7 +1119,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) if ( aStrEmpty.equals(aStrVal) || aStrNotEmpty.equals(aStrVal) ) { - pLbCond->SelectEntry( '=' ); + pLbCond->SelectEntry(rtl::OUString('=')); pLbCond->Disable(); } else diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index 62ff41a487f0..a661795385a0 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -596,7 +596,7 @@ IMPL_LINK( ScPivotFilterDlg, ValModifyHdl, ComboBox*, pEd ) if ( aStrEmpty.equals(aStrVal) || aStrNotEmpty.equals(aStrVal) ) { - pLb->SelectEntry( '=' ); + pLb->SelectEntry(rtl::OUString('=')); pLb->Disable(); } else diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx index e6952d952324..214138143135 100644 --- a/sc/source/ui/dbgui/scuiimoptdlg.cxx +++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx @@ -190,7 +190,7 @@ ScImportOptionsDlg::ScImportOptionsDlg( aStr = pFieldSepTab->GetDelimiter( nCode ); if ( !aStr.Len() ) - aEdFieldSep.SetText( String((sal_Unicode)nCode) ); + aEdFieldSep.SetText( rtl::OUString((sal_Unicode)nCode) ); else aEdFieldSep.SetText( aStr ); @@ -198,7 +198,7 @@ ScImportOptionsDlg::ScImportOptionsDlg( aStr = pTextSepTab->GetDelimiter( nCode ); if ( !aStr.Len() ) - aEdTextSep.SetText( String((sal_Unicode)nCode) ); + aEdTextSep.SetText( rtl::OUString((sal_Unicode)nCode) ); else aEdTextSep.SetText( aStr ); } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 153e17e76a62..99ff6d75bda8 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1161,8 +1161,8 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) // ISO8859-1/MS_1252 encoding, comma, double quotes aOptions.SetCharSet( RTL_TEXTENCODING_MS_1252 ); - aOptions.SetFieldSeps( (sal_Unicode) ',' ); - aOptions.SetTextSep( (sal_Unicode) '"' ); + aOptions.SetFieldSeps( rtl::OUString(',') ); + aOptions.SetTextSep( '"' ); } FltError eError = eERR_OK; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 392d855e0f35..e58782f1cc9a 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -741,11 +741,11 @@ void lcl_UnescapeSylk( String & rString, SylkVersion eVersion ) // Older versions quoted the string and doubled embedded quotes, but not // the semicolons, which was plain wrong. if (eVersion >= SYLK_OOO32) - rString.SearchAndReplaceAll( rtl::OUString(DOUBLE_SEMICOLON), ';' ); + rString.SearchAndReplaceAll( rtl::OUString(DOUBLE_SEMICOLON), rtl::OUString(';') ); else - rString.SearchAndReplaceAll( rtl::OUString(DOUBLE_DOUBLEQUOTE), '"' ); + rString.SearchAndReplaceAll( rtl::OUString(DOUBLE_DOUBLEQUOTE), rtl::OUString('"') ); - rString.SearchAndReplaceAll( rtl::OUString(SYLK_LF), _LF ); + rString.SearchAndReplaceAll( rtl::OUString(SYLK_LF), rtl::OUString(_LF) ); } static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p, @@ -1682,7 +1682,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) } } if( nCol < nEndCol ) - lcl_WriteSimpleString( rStrm, String(cSep) ); + lcl_WriteSimpleString( rStrm, rtl::OUString(cSep) ); } WriteUnicodeOrByteEndl( rStrm ); if( rStrm.GetError() != SVSTREAM_OK ) @@ -2009,7 +2009,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) case CELLTYPE_EDIT: hasstring: pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr ); - aCellStr.SearchAndReplaceAll( _LF, rtl::OUString(SYLK_LF) ); + aCellStr.SearchAndReplaceAll( rtl::OUString(_LF), rtl::OUString(SYLK_LF) ); aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" )); aBufStr += String::CreateFromInt32( c ); @@ -2093,7 +2093,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) } } } - lcl_WriteSimpleString( rStrm, String( 'E' ) ); + lcl_WriteSimpleString( rStrm, rtl::OUString( 'E' ) ); WriteUnicodeOrByteEndl( rStrm ); return rStrm.GetError() == SVSTREAM_OK; } diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 690745f23f5e..e5cdf92bfb43 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -177,12 +177,12 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, if ( !bEdit ) { - String aNewFormula = '='; + rtl::OUString aNewFormula('='); if ( aFormula.Len() > 0 && aFormula.GetChar(0) == '=' ) - aNewFormula=aFormula; + aNewFormula = aFormula; pScMod->InputReplaceSelection( aNewFormula ); - pScMod->InputSetSelection( 1, aNewFormula.Len()+1 ); + pScMod->InputSetSelection( 1, aNewFormula.getLength()+1 ); xub_StrLen PrivStart, PrivEnd; pScMod->InputGetSelection( PrivStart, PrivEnd); SetMeText(pScMod->InputGetFormulaStr(),PrivStart, PrivEnd,bMatrix,false,false); @@ -342,10 +342,11 @@ bool ScFormulaDlg::calculateValue( const String& rStrExp, String& rStrResult ) if ( pCell->GetCode()->GetCodeLen() <= 1 ) { // ==1: einzelner ist als Parameter immer Bereich // ==0: es waere vielleicht einer, wenn.. - String aBraced( '(' ); - aBraced += rStrExp; - aBraced += ')'; - pFCell.reset( new ScFormulaCell( pDoc, aCursorPos, aBraced ) ); + rtl::OUStringBuffer aBraced; + aBraced.append('('); + aBraced.append(rStrExp); + aBraced.append(')'); + pFCell.reset( new ScFormulaCell( pDoc, aCursorPos, aBraced.makeStringAndClear() ) ); } else bColRowName = false; diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 55e3817db368..65423c296c1e 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -435,7 +435,7 @@ ScConflictsDlg::ScConflictsDlg( Window* pParent, ScViewData* pViewData, ScDocume long nTabs[] = { 3, 10, 216, 266 }; maLbConflicts.SetTabs( nTabs ); - String aTab( sal_Unicode( '\t' ) ); + rtl::OUString aTab('\t'); String aHeader( maStrTitleConflict ); aHeader += aTab; aHeader += maStrTitleAuthor; diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index cd73cf841a02..90f3e28e08b2 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -101,13 +101,13 @@ void ScSolverOptionsString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, Font aFont( aOldFont ); aFont.SetWeight( WEIGHT_BOLD ); - String sTxt( ' ' ); + rtl::OUString sTxt( ' ' ); if ( mbIsDouble ) - sTxt += (String)rtl::math::doubleToUString( mfDoubleValue, + sTxt += rtl::math::doubleToUString( mfDoubleValue, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, ScGlobal::GetpLocaleData()->getNumDecimalSep()[0], true ); else - sTxt += String::CreateFromInt32( mnIntValue ); + sTxt += rtl::OUString::valueOf(mnIntValue); rDev.SetFont( aFont ); rDev.DrawText( aNewPos, sTxt ); diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index bbd195ac4849..6b2f9aa89396 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -169,7 +169,7 @@ void ColumnEdit::Down() void ColumnEdit::First() { nCol = 1; - SetText( 'A' ); + SetText(rtl::OUString('A')); } //------------------------------------------------------------------------ diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index 603a742afc0e..08b9e871b263 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -633,9 +633,9 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) aSel.nEndPos = aPageEntry.Len(); aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); ++aSel.nEndPos; - String aPageOfEntry = ' '; - aPageOfEntry += ScGlobal::GetRscString( STR_HF_OF ); - aPageOfEntry += ' '; + String aPageOfEntry = rtl::OUStringBuffer().append(' '). + append(ScGlobal::GetRscString( STR_HF_OF )).append(' '). + makeStringAndClear(); aWndCenter.GetEditEngine()->QuickInsertText(aPageOfEntry,ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageOfEntry.Len() ); aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 61435d4b1166..3bc6e4f80009 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -3909,7 +3909,7 @@ double getDefaultCharWidth( ScDocShell* pDocShell ) ::Font aDefFont; pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice ); pRefDevice->SetFont( aDefFont ); - long nCharWidth = pRefDevice->GetTextWidth( String( '0' ) ); // 1/100th mm + long nCharWidth = pRefDevice->GetTextWidth( rtl::OUString('0') ); // 1/100th mm return lcl_hmmToPoints( nCharWidth ); } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index ee6d5bd9a4a0..90e3dfe4482e 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -332,7 +332,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( pReqArgs!=NULL && pTabViewShell->SelectionEditable() ) { const SfxPoolItem* pItem; - String aFlags = 'A'; + String aFlags = rtl::OUString('A'); if( pReqArgs->HasItem( SID_DELETE, &pItem ) ) aFlags = ((const SfxStringItem*)pItem)->GetValue(); @@ -446,7 +446,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( pReqArgs!=NULL && pTabViewShell->SelectionEditable() ) { const SfxPoolItem* pItem; - String aFlags = 'A'; + String aFlags = rtl::OUString('A'); if( pReqArgs->HasItem( FID_FILL_TAB, &pItem ) ) aFlags = ((const SfxStringItem*)pItem)->GetValue(); @@ -1047,7 +1047,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if( ! rReq.IsAPI() ) { - String aCol = bColumns ? 'C' : 'R'; + rtl::OUString aCol = bColumns ? rtl::OUString('C') : rtl::OUString('R'); rReq.AppendItem( SfxStringItem( SID_OUTLINE_MAKE, aCol ) ); rReq.Done(); } @@ -1113,7 +1113,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if( ! rReq.IsAPI() ) { - String aCol = bColumns ? 'C' : 'R'; + rtl::OUString aCol = bColumns ? rtl::OUString('C') : rtl::OUString('R'); rReq.AppendItem( SfxStringItem( SID_OUTLINE_REMOVE, aCol ) ); rReq.Done(); } @@ -1210,7 +1210,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( pReqArgs!=NULL && pTabViewShell->SelectionEditable() ) { const SfxPoolItem* pItem; - String aFlags = 'A'; + String aFlags = rtl::OUString('A'); if( pReqArgs->HasItem( FID_INS_CELL_CONTENTS, &pItem ) ) aFlags = ((const SfxStringItem*)pItem)->GetValue(); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 51b2679a9a2f..66ac4881e427 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -155,7 +155,7 @@ void lcl_RemoveAttribs( EditView& rEditView ) void lclInsertCharacter( EditView* pTableView, EditView* pTopView, sal_Unicode cChar ) { - String aString( cChar ); + rtl::OUString aString( cChar ); if( pTableView ) pTableView->InsertText( aString ); if( pTopView ) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index c98b89e91cb1..1a6b9f9a4dc3 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4277,30 +4277,31 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos aSource.Format( aItem, SCA_VALID | SCA_TAB_3D, pSourceDoc ); // TODO: we could define ocQuote for " - const String aQuote( '"' ); + const rtl::OUString aQuote('"'); const String& sSep = ScCompiler::GetNativeSymbol( ocSep); - String aFormula( '=' ); - aFormula += ScCompiler::GetNativeSymbol( ocDde); - aFormula += ScCompiler::GetNativeSymbol( ocOpen); - aFormula += aQuote; - aFormula += aApp; - aFormula += aQuote; - aFormula += sSep; - aFormula += aQuote; - aFormula += aTopic; - aFormula += aQuote; - aFormula += sSep; - aFormula += aQuote; - aFormula += aItem; - aFormula += aQuote; - aFormula += ScCompiler::GetNativeSymbol( ocClose); + rtl::OUStringBuffer aFormula; + aFormula.append('='); + aFormula.append(ScCompiler::GetNativeSymbol(ocDde)); + aFormula.append(ScCompiler::GetNativeSymbol(ocOpen)); + aFormula.append(aQuote); + aFormula.append(aApp); + aFormula.append(aQuote); + aFormula.append(sSep); + aFormula.append(aQuote); + aFormula.append(aTopic); + aFormula.append(aQuote); + aFormula.append(sSep); + aFormula.append(aQuote); + aFormula.append(aItem); + aFormula.append(aQuote); + aFormula.append(ScCompiler::GetNativeSymbol(ocClose)); pView->DoneBlockMode(); pView->InitBlockMode( nDestPosX, nDestPosY, nThisTab ); pView->MarkCursor( nDestPosX + nSizeX - 1, nDestPosY + nSizeY - 1, nThisTab ); - pView->EnterMatrix( aFormula, ::formula::FormulaGrammar::GRAM_NATIVE ); + pView->EnterMatrix( aFormula.makeStringAndClear(), ::formula::FormulaGrammar::GRAM_NATIVE ); pView->MarkRange( aDest, false, false ); pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() ); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 0801604501b6..fd0c0755f00d 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -556,7 +556,7 @@ void ScDrawStringsVars::RepeatToFill( long colWidth ) if ( nPos == STRING_NOTFOUND || nPos >= aString.Len() ) return; - long charWidth = pOutput->pFmtDevice->GetTextWidth(String(nChar)); + long charWidth = pOutput->pFmtDevice->GetTextWidth(rtl::OUString(nChar)); if (bPixelToLogic) colWidth = pOutput->pRefDevice->PixelToLogic(Size(colWidth,0)).Width(); // Are there restrictions on the cell type we should filter out here ? @@ -716,7 +716,7 @@ long ScDrawStringsVars::GetMaxDigitWidth() for (sal_Char i = 0; i < 10; ++i) { sal_Char cDigit = cZero + i; - long n = pOutput->pFmtDevice->GetTextWidth(String(cDigit)); + long n = pOutput->pFmtDevice->GetTextWidth(rtl::OUString(cDigit)); nMaxDigitWidth = ::std::max(nMaxDigitWidth, n); } return nMaxDigitWidth; @@ -727,7 +727,7 @@ long ScDrawStringsVars::GetSignWidth() if (nSignWidth > 0) return nSignWidth; - nSignWidth = pOutput->pFmtDevice->GetTextWidth(String('-')); + nSignWidth = pOutput->pFmtDevice->GetTextWidth(rtl::OUString('-')); return nSignWidth; } @@ -746,7 +746,7 @@ long ScDrawStringsVars::GetExpWidth() if (nExpWidth > 0) return nExpWidth; - nExpWidth = pOutput->pFmtDevice->GetTextWidth(String('E')); + nExpWidth = pOutput->pFmtDevice->GetTextWidth(rtl::OUString('E')); return nExpWidth; } diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 071941b162b6..6b4309a6f3c7 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1774,35 +1774,30 @@ sal_Bool Complex::ParseString( const STRING& rStr, Complex& rCompl ) STRING Complex::GetString() const THROWDEF_RTE_IAE { - static const String aI( 'i' ); - static const String aJ( 'j' ); - static const String aPlus( '+' ); - static const String aMinus( '-' ); - CHK_FINITE(r); CHK_FINITE(i); - STRING aRet; + rtl::OUStringBuffer aRet; bool bHasImag = i != 0.0; bool bHasReal = !bHasImag || (r != 0.0); if( bHasReal ) - aRet = ::GetString( r ); + aRet.append(::GetString( r )); if( bHasImag ) { if( i == 1.0 ) { if( bHasReal ) - aRet += aPlus; + aRet.append('+'); } else if( i == -1.0 ) - aRet += aMinus; + aRet.append('-'); else - aRet += ::GetString( i, bHasReal ); - aRet += (c != 'j') ? aI : aJ; + aRet.append(::GetString( i, bHasReal )); + aRet.append((c != 'j') ? 'i' : 'j'); } - return aRet; + return aRet.makeStringAndClear(); } diff --git a/sd/source/core/anminfo.cxx b/sd/source/core/anminfo.cxx index 7e1e30fd1f9f..2cd0719ca6e3 100644 --- a/sd/source/core/anminfo.cxx +++ b/sd/source/core/anminfo.cxx @@ -108,7 +108,7 @@ void SdAnimationInfo::SetBookmark( const String& rBookmark ) { if( meClickAction == ::com::sun::star::presentation::ClickAction_BOOKMARK ) { - String sURL( '#' ); + String sURL = rtl::OUString('#'); sURL += rBookmark; SvxFieldItem aURLItem( SvxURLField( sURL, sURL ), EE_FEATURE_FIELD ); mrObject.SetMergedItem( aURLItem ); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index f423d3f2d1ec..e45999759126 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -334,7 +334,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_ if (aURL.Len() && (aURL.GetChar(0) == 35)) { - XubString aHashSlide('#'); + XubString aHashSlide = rtl::OUString('#'); aHashSlide += SD_RESSTR(STR_PAGE); if (aURL.CompareTo(aHashSlide, aHashSlide.Len()) == COMPARE_EQUAL) diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 90fdab461eed..64a17d154f7a 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -955,7 +955,7 @@ void SlideTransitionPane::openSoundFileDialog() else { String aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); - String aStr( sal_Unicode( '%' )); + rtl::OUString aStr('%'); aStrWarning.SearchAndReplace( aStr , aFile ); WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ); aWarningBox.SetModalInputMode (sal_True); diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 7e468ecb265b..5a07576c34de 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -863,7 +863,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(bPrintable) { // try to activate textedit mode for the selected object - SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode())); + SfxStringItem aInputString(SID_ATTR_CHAR, rtl::OUString(rKEvt.GetCharCode())); mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_CHAR, @@ -914,7 +914,7 @@ sal_Bool FuPoor::KeyInput(const KeyEvent& rKEvt) { mpView->UnMarkAll(); mpView->MarkObj(pCandidate, mpView->GetSdrPageView()); - SfxStringItem aInputString(SID_ATTR_CHAR, String(rKEvt.GetCharCode())); + SfxStringItem aInputString(SID_ATTR_CHAR, rtl::OUString(rKEvt.GetCharCode())); mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_ATTR_CHAR, diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index e9464787ded6..36be7f935710 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -1960,11 +1960,11 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: else { // direct API call on a specified object - String aCall( '[' ); - aCall += String(INetURLObject::decode(aMacro.Copy(6), INET_HEX_ESCAPE, - INetURLObject::DECODE_WITH_CHARSET)); - aCall += ']'; - pAppMgr->GetLib(0)->Execute( aCall ); + rtl::OUStringBuffer aCall; + aCall.append('[').append(INetURLObject::decode(aMacro.Copy(6), INET_HEX_ESCAPE, + INetURLObject::DECODE_WITH_CHARSET)); + aCall.append(']'); + pAppMgr->GetLib(0)->Execute(aCall.makeStringAndClear()); nErr = SbxBase::GetError(); } diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index a9f9be711dc1..18038dac690c 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -278,24 +278,22 @@ void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo) { sal_uInt16 nID = GetType(); - String aWinData( 'V' ); - aWinData += String::CreateFromInt32( nVersion ); - aWinData += ','; - aWinData += rInfo.bVisible ? 'V' : 'H'; - aWinData += ','; - aWinData += String::CreateFromInt32( rInfo.nFlags ); + rtl::OUStringBuffer aWinData; + aWinData.append('V').append(static_cast<sal_Int32>(nVersion)). + append(',').append(rInfo.bVisible ? 'V' : 'H').append(','). + append(static_cast<sal_Int32>(rInfo.nFlags)); if ( rInfo.aExtraString.Len() ) { - aWinData += ','; - aWinData += rInfo.aExtraString; + aWinData.append(','); + aWinData.append(rInfo.aExtraString); } SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nID ) ); aWinOpt.SetWindowState(rtl::OStringToOUString(rInfo.aWinState, RTL_TEXTENCODING_UTF8)); ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1); - aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Data") ); - aSeq[0].Value <<= ::rtl::OUString( aWinData ); + aSeq[0].Name = ::rtl::OUString("Data"); + aSeq[0].Value <<= aWinData.makeStringAndClear(); aWinOpt.SetUserData( aSeq ); // ... but save status at runtime! diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 184d400526c6..0e5e6978be65 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -3056,7 +3056,7 @@ IMPL_LINK_NOARG(SfxHelpWindow_Impl, OpenHdl) else { String aId; - String aAnchor = String('#'); + String aAnchor = rtl::OUString('#'); if ( comphelper::string::getTokenCount(aEntry, '#') == 2 ) { aId = aEntry.GetToken( 0, '#' ); diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index c02d750e9775..208875026df7 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -833,7 +833,7 @@ IMPL_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, String*, pString ) const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SFX_FILTER_IMPORT ); if (pFilter && !pFilter->GetWildcard().Matches( String() ) && !pFilter->GetWildcard().Matches(DEFINE_CONST_UNICODE("*.*")) && - !pFilter->GetWildcard().Matches('*') + !pFilter->GetWildcard().Matches(rtl::OUString('*')) ) { return sal_True; diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 811984fb33b4..2b9e2ba087a8 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -113,7 +113,7 @@ static const char DOCUMENT_SIGNATURE_MENU_CMD[] = "Signature"; String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes = sal_True, sal_Bool bSmartExtraBytes = sal_False ); String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartExtraBytes ) { - String aUnitStr = ' '; + String aUnitStr = rtl::OUString(' '); aUnitStr += SfxResId(STR_BYTES).toString(); sal_uIntPtr nSize1 = nSize; sal_uIntPtr nSize2 = nSize1; @@ -889,7 +889,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl) aPrintValFt.SetText( aEmpty ); const Time aTime( 0 ); aTimeLogValFt.SetText( aLocaleWrapper.getDuration( aTime ) ); - aDocNoValFt.SetText( '1' ); + aDocNoValFt.SetText(rtl::OUString('1')); bHandleDelete = sal_True; return 0; } @@ -1717,7 +1717,7 @@ void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt ) void CustomPropertiesDurationField::SetDuration( const util::Duration& rDuration ) { m_aDuration = rDuration; - String sText(rDuration.Negative ? '-' : '+'); + String sText(rDuration.Negative ? rtl::OUString('-') : rtl::OUString('+')); sText += m_pLine->m_sDurationFormat; sText.SearchAndReplace(rtl::OUString("%1"), String::CreateFromInt32( rDuration.Years ) ); sText.SearchAndReplace(rtl::OUString("%2"), String::CreateFromInt32( rDuration.Months ) ); diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 85f5fc03de9b..a865280c1017 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -306,11 +306,12 @@ SfxSplitWindow::~SfxSplitWindow() void SfxSplitWindow::SaveConfig_Impl() { // Save configuration - String aWinData('V'); - aWinData += String::CreateFromInt32( VERSION ); - aWinData += ','; - aWinData += String::CreateFromInt32( pEmptyWin->nState ); - aWinData += ','; + rtl::OUStringBuffer aWinData; + aWinData.append('V'); + aWinData.append(static_cast<sal_Int32>(VERSION)); + aWinData.append(','); + aWinData.append(static_cast<sal_Int32>(pEmptyWin->nState)); + aWinData.append(','); sal_uInt16 nCount = 0; sal_uInt16 n; @@ -321,7 +322,7 @@ void SfxSplitWindow::SaveConfig_Impl() nCount++; } - aWinData += String::CreateFromInt32( nCount ); + aWinData.append(static_cast<sal_Int32>(nCount)); for ( n=0; n<pDockArr->size(); n++ ) { @@ -329,15 +330,15 @@ void SfxSplitWindow::SaveConfig_Impl() if ( !pDock->bHide && !pDock->pWin ) continue; if ( pDock->bNewLine ) - aWinData += DEFINE_CONST_UNICODE(",0"); - aWinData += ','; - aWinData += String::CreateFromInt32( pDock->nType); + aWinData.append(",0"); + aWinData.append(','); + aWinData.append(static_cast<sal_Int32>(pDock->nType)); } String aWindowId = rtl::OUString("SplitWindow"); aWindowId += String::CreateFromInt32( (sal_Int32) GetAlign() ); SvtViewOptions aWinOpt( E_WINDOW, aWindowId ); - aWinOpt.SetUserItem( USERITEM_NAME, makeAny( OUString( aWinData ) ) ); + aWinOpt.SetUserItem( USERITEM_NAME, makeAny( aWinData.makeStringAndClear() ) ); } //------------------------------------------------------------------------- diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index aee34e984954..d3680ebac99e 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -404,14 +404,14 @@ void SfxDocTplService_Impl::init_Impl() // convert locale to string OUString aLang = maLocale.Language; - aLang += String( '-' ); + aLang += OUString( '-' ); aLang += maLocale.Country; // set maRootContent to the root of the templates hierarchy. Create the // entry if necessary maRootURL = OUString( TEMPLATE_ROOT_URL ); - maRootURL += String( '/' ); + maRootURL += OUString( '/' ); maRootURL += aLang; ::rtl::OUString aTemplVersPropName( TEMPLATE_VERSION ); diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 65967eed6c6f..f6c84109ade5 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -532,9 +532,9 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( String &rExtra = pAntiImplP->GetExtraData(); sal_Int32 nTokCount = comphelper::string::getTokenCount(rExtra, '|'); if( nTokCount > 0 && nFlags ) - MORE_BTN(SetState( rExtra.GetToken( 0, '|' ) == 'Y' )); + MORE_BTN(SetState(comphelper::string::equals(rExtra.GetToken( 0, '|'), 'Y'))); if( nTokCount > 1 && nFlags ) - aPreviewBtn.Check( rExtra.GetToken( 1 ,'|' ) == 'Y' ); + aPreviewBtn.Check(comphelper::string::equals(rExtra.GetToken( 1 ,'|'), 'Y')); aTemplateLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect)); aTemplateLb.SetDoubleClickHdl(LINK(this, SfxNewFileDialog_Impl, DoubleClick)); diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index ba04fe52b5a4..2b4508e891fa 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -472,9 +472,9 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i { aScript = rtl::OUString( MACRO_PRFIX ); if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarDesktop")) && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")) ) - aScript += String('.'); + aScript += rtl::OUString('.'); - aScript += String('/'); + aScript += rtl::OUString('/'); aScript += aMacroName; aScript += rtl::OUString( MACRO_POSTFIX ); } diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index f7b5115859b2..78167251c563 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -563,7 +563,7 @@ protected: { xub_Unicode cChar = GetToken().cMathChar; if ((xub_Unicode) '\0' != cChar) - SetText( cChar ); + SetText(rtl::OUString(cChar)); } public: @@ -640,7 +640,7 @@ public: SmErrorNode(SmParseError /*eError*/, const SmToken &rNodeToken) : SmMathSymbolNode(NERROR, rNodeToken) { - SetText((xub_Unicode) MS_ERROR); + SetText(rtl::OUString(MS_ERROR)); } virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 32967d0f0bf8..92c4ba424b20 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -904,7 +904,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) { eUnit = FUNIT_CUSTOM; nDigits = 0; - pMF->SetCustomUnitText( '%' ); + pMF->SetCustomUnitText(rtl::OUString('%')); } else { @@ -1519,7 +1519,7 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG pButton ) const SmSym *pSym = GetSymbol(); if (pSym) { - String aText ('%'); + String aText = rtl::OUString('%'); aText += pSym->GetName(); aText += (sal_Unicode)' '; diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index cd4575596641..2aa4b8213d8a 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -1246,7 +1246,7 @@ void SmDocShell::GetState(SfxItemSet &rSet) sal_Unicode cMod = ' '; if (IsModified()) cMod = '*'; - rSet.Put(SfxStringItem(SID_MODIFYSTATUS, String(cMod))); + rSet.Put(SfxStringItem(SID_MODIFYSTATUS, rtl::OUString(cMod))); } break; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 9132d772e4af..be17a9867ead 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2671,7 +2671,7 @@ SmMathSymbolNode::SmMathSymbolNode(const SmToken &rNodeToken) { xub_Unicode cChar = GetToken().cMathChar; if ((xub_Unicode) '\0' != cChar) - SetText( cChar ); + SetText(rtl::OUString(cChar)); } void SmMathSymbolNode::AdaptToX(const OutputDevice &rDev, sal_uLong nWidth) @@ -3087,7 +3087,7 @@ void SmBlankNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) nSpace = nNum * nDist; // ein SmRect mit Baseline und allem drum und dran besorgen - SmRect::operator = (SmRect(aTmpDev, &rFormat, XubString(xub_Unicode(' ')), + SmRect::operator = (SmRect(aTmpDev, &rFormat, rtl::OUString(' '), GetFont().GetBorderWidth())); // und dieses auf die gewuenschte Breite bringen diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index afa6a8ef5a0b..827ff16251d5 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -1025,7 +1025,7 @@ void SmParser::Align() if (CONVERT_40_TO_50 == GetConversion()) // encapsulate expression to be aligned in group braces // (here group-open brace) - { Insert('{', GetTokenIndex()); + { Insert(rtl::OUString('{'), GetTokenIndex()); bNeedGroupClose = true; // get first valid align statement in sequence @@ -1061,7 +1061,7 @@ void SmParser::Align() Expression(); if (bNeedGroupClose) - Insert('}', GetTokenIndex()); + Insert(rtl::OUString('}'), GetTokenIndex()); if (pSNode) { @@ -1551,7 +1551,7 @@ void SmParser::Term() else // encapsulate old 4.0 style parsing in braces { // insert opening brace - Insert('{', GetTokenIndex()); + Insert(rtl::OUString('{'), GetTokenIndex()); // // parse in 4.0 style @@ -1568,7 +1568,7 @@ void SmParser::Term() } // insert closing brace - Insert('}', GetTokenIndex()); + Insert(rtl::OUString('}'), GetTokenIndex()); SmStructureNode *pSNode = new SmExpressionNode(pFunc->GetToken()); pSNode->SetSubNodes(pFunc, lcl_popOrZero(m_aNodeStack)); diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 6d5c5454e9a7..0cb52c93509b 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -262,7 +262,7 @@ void SmSymbolManager::Load() SmLocalizedSymbolData aLocalizedData; const String aGreekSymbolSetName( aLocalizedData.GetUiSymbolSetName( OUString::createFromAscii( "Greek" ) )); const SymbolPtrVec_t aGreekSymbols( GetSymbolSet( aGreekSymbolSetName ) ); - String aSymbolSetName( (sal_Unicode) 'i' ); + String aSymbolSetName = rtl::OUString('i'); aSymbolSetName += aGreekSymbolSetName; size_t nSymbols = aGreekSymbols.size(); for (size_t i = 0; i < nSymbols; ++i) @@ -272,7 +272,7 @@ void SmSymbolManager::Load() Font aFont( rSym.GetFace() ); OSL_ENSURE( aFont.GetItalic() == ITALIC_NONE, "expected Font with ITALIC_NONE, failed." ); aFont.SetItalic( ITALIC_NORMAL ); - String aSymbolName( (sal_Unicode)'i' ); + String aSymbolName = rtl::OUString('i'); aSymbolName += rSym.GetName(); SmSym aSymbol( aSymbolName, aFont, rSym.GetCharacter(), aSymbolSetName, true /*bIsPredefined*/ ); @@ -289,7 +289,7 @@ void SmSymbolManager::Save() // prepare to skip symbols from iGreek on saving SmLocalizedSymbolData aLocalizedData; - String aSymbolSetName( (sal_Unicode) 'i' ); + String aSymbolSetName = rtl::OUString('i'); aSymbolSetName += aLocalizedData.GetUiSymbolSetName( OUString::createFromAscii( "Greek" )); SymbolPtrVec_t aTmp( GetSymbols() ); diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index e3f567b73f34..f1365b4470e1 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1060,7 +1060,7 @@ Size SmViewShell::GetTextLineSize(OutputDevice& rDevice, const String& rLine) if (nTabs > 0) { - long TabPos = rDevice.GetTextWidth('n') * 8; + long TabPos = rDevice.GetTextWidth(rtl::OUString('n')) * 8; aSize.Width() = 0; @@ -1152,7 +1152,7 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co if (nTabs > 0) { - long TabPos = rDevice.GetTextWidth('n') * 8; + long TabPos = rDevice.GetTextWidth(rtl::OUString('n')) * 8; for (sal_uInt16 i = 0; i < nTabs; i++) { diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 58c6c148d86d..83ac5f345a4e 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -982,9 +982,9 @@ bool ImpSvNumberInputScan::MayBeIso8601() { sal_Int32 n; if (nAnzNums >= 3 && nNums[2] < nAnzStrings && - sStrArray[nNums[0]+1] == '-' && // separator year-month + comphelper::string::equals(sStrArray[nNums[0]+1], '-') && // separator year-month (n = sStrArray[nNums[1]].ToInt32()) >= 1 && n <= 12 && // month - sStrArray[nNums[1]+1] == '-' && // separator month-day + comphelper::string::equals(sStrArray[nNums[1]+1], '-') && // separator month-day (n = sStrArray[nNums[2]].ToInt32()) >= 1 && n <= 31) // day // Year (nNums[0]) value not checked, may be anything, but // length (number of digits) is checked. @@ -1012,7 +1012,7 @@ bool ImpSvNumberInputScan::CanForceToIso8601( DateFormat eDateFormat ) break; } - if (pFormatter->GetDateSep() != '-') + if (!comphelper::string::equals(pFormatter->GetDateSep(), '-')) { nCanForceToIso8601 = 2; // date separator does not interfere break; diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 252ff7b46bba..a2291c678e31 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1988,10 +1988,11 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex( { // we need at least _some_ format rSeq.realloc(1); rSeq[0] = ::com::sun::star::i18n::NumberFormatCode(); - String aTmp( '0' ); - aTmp += GetNumDecimalSep(); - aTmp.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "############" ) ); - rSeq[0].Code = aTmp; + rSeq[0].Code = rtl::OUStringBuffer(). + append('0'). + append(GetNumDecimalSep()). + appendAscii(RTL_CONSTASCII_STRINGPARAM("############")). + makeStringAndClear(); } return 0; } @@ -3624,6 +3625,11 @@ void SvNumberFormatter::ImpInitCurrencyTable() sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr, const NfCurrencyEntry& rCurr, bool bBank ) const { + rtl::OUString aRed = rtl::OUStringBuffer(). + append('['). + append(pFormatScanner->GetRedString()). + append(']').makeStringAndClear(); + sal_uInt16 nDefault = 0; if ( bBank ) { @@ -3640,10 +3646,6 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr ::rtl::OUStringBuffer format2(aPositiveBank); format2.append(';'); - String aRed( '[' ); - aRed += pFormatScanner->GetRedString(); - aRed += ']'; - format2.append(aRed); format2.append(aNegativeBank); @@ -3658,10 +3660,6 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr String aPositive, aNegative, aPositiveNoDec, aNegativeNoDec, aPositiveDashed, aNegativeDashed; - String aRed( '[' ); - aRed += pFormatScanner->GetRedString(); - aRed += ']'; - rCurr.BuildPositiveFormatString( aPositive, false, *xLocaleData, 1 ); rCurr.BuildNegativeFormatString( aNegative, false, *xLocaleData, 1 ); ::rtl::OUStringBuffer format1; diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 5b207171115e..5f30f3c37177 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -3225,7 +3225,7 @@ bool SvNumberformat::ImpIsIso8601( const ImpSvNumFor& rNumFor ) break; case NF_SYMBOLTYPE_STRING: case NF_SYMBOLTYPE_DATESEP: - if (rNumFor.Info().sStrArray[i] == '-') + if (comphelper::string::equals(rNumFor.Info().sStrArray[i], '-')) { if (eState == eAtYear) eState = eAtSep1; @@ -4402,7 +4402,8 @@ bool SvNumberformat::IsNegativeInBracket() const return false; String *tmpStr = NumFor[1].Info().sStrArray; - return (tmpStr[0] == '(' && tmpStr[nAnz-1] == ')' ); + using comphelper::string::equals; + return (equals(tmpStr[0], '(') && equals(tmpStr[nAnz-1], ')')); } bool SvNumberformat::HasPositiveBracketPlaceholder() const diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx index b33ebd889d2a..0dcce2c0e2c0 100644 --- a/svtools/bmpmaker/bmp.cxx +++ b/svtools/bmpmaker/bmp.cxx @@ -93,13 +93,13 @@ sal_Bool BmpApp::GetCommandOption( const ::std::vector< String >& rArgs, const S for( int i = 0, nCount = rArgs.size(); ( i < nCount ) && !bRet; i++ ) { - String aTestStr( '-' ); + rtl::OUString aTestStr( '-' ); for( int n = 0; ( n < 2 ) && !bRet; n++ ) { aTestStr += rSwitch; - if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL ) + if( aTestStr.equalsIgnoreAsciiCase( rArgs[ i ] ) ) { bRet = sal_True; @@ -110,7 +110,7 @@ sal_Bool BmpApp::GetCommandOption( const ::std::vector< String >& rArgs, const S } if( 0 == n ) - aTestStr = '/'; + aTestStr = rtl::OUString('/'); } } @@ -125,13 +125,13 @@ sal_Bool BmpApp::GetCommandOptions( const ::std::vector< String >& rArgs, const for( int i = 0, nCount = rArgs.size(); ( i < nCount ); i++ ) { - String aTestStr( '-' ); + rtl::OUString aTestStr( '-' ); for( int n = 0; ( n < 2 ) && !bRet; n++ ) { aTestStr += rSwitch; - if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL ) + if( aTestStr.equalsIgnoreAsciiCase( rArgs[ i ] ) ) { if( i < ( nCount - 1 ) ) rParams.push_back( rArgs[ i + 1 ] ); @@ -142,7 +142,7 @@ sal_Bool BmpApp::GetCommandOptions( const ::std::vector< String >& rArgs, const } if( 0 == n ) - aTestStr = '/'; + aTestStr = rtl::OUString('/'); } } @@ -196,8 +196,8 @@ int BmpApp::Start( const ::std::vector< String >& rArgs ) memcpy( aLangInfo.maLangDir, aLangDir.getStr(), aLangDir.getLength() + 1 ); - GetCommandOption( rArgs, 'f', aOutputFileName ); - GetCommandOptions( rArgs, 'i', aInDirVector ); + GetCommandOption( rArgs, rtl::OUString('f'), aOutputFileName ); + GetCommandOptions( rArgs, rtl::OUString('i'), aInDirVector ); Create( aSrsName, aInDirVector, aOutName, aLangInfo ); } diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx index 4512cac56b0d..c04b83c7c6b4 100644 --- a/svtools/bmpmaker/bmpcore.cxx +++ b/svtools/bmpmaker/bmpcore.cxx @@ -311,11 +311,11 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs, else Message( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Could not generate " ) ).Append( aOutFile.GetFull() ), EXIT_COMMONERROR ); - Message( ' ' ); + Message( rtl::OUString(' ') ); } } else - Message( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: SOLARSRC environment variable not set!" ) ), EXIT_MISSING_SOLARSRC_ENV ); + Message( rtl::OUString("ERROR: SOLARSRC environment variable not set!"), EXIT_MISSING_SOLARSRC_ENV ); pSRS->Seek( nOldPos ); delete pCollectStm; diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 4fdf1e515275..a840ff4ba707 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -102,13 +102,13 @@ sal_Bool BmpSum::GetCommandOption( const ::std::vector< String >& rArgs, const S for( int i = 0, nCount = rArgs.size(); ( i < nCount ) && !bRet; i++ ) { - String aTestStr( '-' ); + rtl::OUString aTestStr( '-' ); for( int n = 0; ( n < 2 ) && !bRet; n++ ) { aTestStr += rSwitch; - if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL ) + if( aTestStr.equalsIgnoreAsciiCase( rArgs[ i ] ) ) { bRet = sal_True; @@ -119,7 +119,7 @@ sal_Bool BmpSum::GetCommandOption( const ::std::vector< String >& rArgs, const S } if( 0 == n ) - aTestStr = '/'; + aTestStr = rtl::OUString('/'); } } @@ -162,10 +162,10 @@ int BmpSum::Start( const ::std::vector< String >& rArgs ) { String aInFileList, aOutFileList, aOutPath; - if( GetCommandOption( rArgs, 'i', aInFileList ) && - GetCommandOption( rArgs, 'o', aOutFileList ) ) + if( GetCommandOption( rArgs, rtl::OUString('i'), aInFileList ) && + GetCommandOption( rArgs, rtl::OUString('o'), aOutFileList ) ) { - GetCommandOption( rArgs, 'p', aOutPath ); + GetCommandOption( rArgs, rtl::OUString('p'), aOutPath ); ProcessFileList( aInFileList, aOutFileList, aOutPath ); } else diff --git a/svtools/bmpmaker/g2g.cxx b/svtools/bmpmaker/g2g.cxx index 6773a0f5d3ac..ed0333f592c0 100644 --- a/svtools/bmpmaker/g2g.cxx +++ b/svtools/bmpmaker/g2g.cxx @@ -90,13 +90,13 @@ sal_Bool G2GApp::GetCommandOption( const ::std::vector< String >& rArgs, const S for( int i = 0, nCount = rArgs.size(); ( i < nCount ) && !bRet; i++ ) { - String aTestStr( '-' ); + rtl::OUString aTestStr( '-' ); for( int n = 0; ( n < 2 ) && !bRet; n++ ) { aTestStr += rSwitch; - if( aTestStr.CompareIgnoreCaseToAscii( rArgs[ i ] ) == COMPARE_EQUAL ) + if( aTestStr.equalsIgnoreAsciiCase( rArgs[ i ] ) ) { bRet = sal_True; @@ -107,7 +107,7 @@ sal_Bool G2GApp::GetCommandOption( const ::std::vector< String >& rArgs, const S } if( 0 == n ) - aTestStr = '/'; + aTestStr = rtl::OUString('/'); } } @@ -157,9 +157,9 @@ int G2GApp::Start( const ::std::vector< String >& rArgs ) aInFile = rArgs[ nCurCmd++ ]; aOutFile = rArgs[ nCurCmd++ ]; - GetCommandOption( rArgs, String( RTL_CONSTASCII_USTRINGPARAM( "format" ) ), aFilterStr ); - GetCommandOption( rArgs, String( RTL_CONSTASCII_USTRINGPARAM( "filterpath" ) ), aFilterPath ); - GetCommandOption( rArgs, '#', aTransColStr ); + GetCommandOption( rArgs, rtl::OUString("format"), aFilterStr ); + GetCommandOption( rArgs, rtl::OUString("filterpath"), aFilterPath ); + GetCommandOption( rArgs, rtl::OUString('#'), aTransColStr ); aFilter.SetFilterPath( aFilterPath ); diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index a1e0dbbc4325..07c6224a31c9 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -239,7 +239,7 @@ void BrowseBox::SetFont( const Font& rNewFont ) sal_uLong BrowseBox::GetDefaultColumnWidth( const String& _rText ) const { - return GetDataWindow().GetTextWidth( _rText ) + GetDataWindow().GetTextWidth( '0' ) * 4; + return GetDataWindow().GetTextWidth( _rText ) + GetDataWindow().GetTextWidth(rtl::OUString('0')) * 4; } //------------------------------------------------------------------- diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 4487a68c5776..7b3eb3c79939 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -672,7 +672,7 @@ OUString CreateExactSizeText( sal_Int64 nSize ) long nMega = 1024 * 1024; long nGiga = nMega * 1024; - String aUnitStr = ' '; + rtl::OUString aUnitStr(' '); if ( nSize < 10000 ) { @@ -1117,12 +1117,12 @@ void ViewTabListBox_Impl::DoQuickSearch( const xub_Unicode& rChar ) sal_uInt32 aLastPos = mnSearchIndex; sal_Bool bFound = sal_False; - maQuickSearchText += OUString( String( rChar ) ).toAsciiLowerCase(); + maQuickSearchText += OUString(rChar).toAsciiLowerCase(); bFound = mpParent->SearchNextEntry( mnSearchIndex, maQuickSearchText, sal_False ); if ( !bFound && ( aLastText.getLength() == 1 ) && - ( aLastText == OUString( String( rChar ) ) ) ) + ( aLastText == OUString(rChar) ) ) { mnSearchIndex = aLastPos + 1; maQuickSearchText = aLastText; diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index fe513db90113..7e6475e4571f 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -872,7 +872,7 @@ short SvTreeListBox::GetHeightOffset(const Font& /* rFont */, Size& aSizeLogic ) { DBG_CHKTHIS(SvTreeListBox,0); short nOffset = 0; - aSizeLogic = Size(GetTextWidth('X'), GetTextHeight()); + aSizeLogic = Size(GetTextWidth(rtl::OUString('X')), GetTextHeight()); if( GetEntryHeight() > aSizeLogic.Height() ) nOffset = ( GetEntryHeight() - (short)aSizeLogic.Height()) / 2; return nOffset; diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 47d455334c2c..ca70c0eb23c8 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1927,7 +1927,7 @@ void FontSizeBox::SetRelative( sal_Bool bNewRelative ) SetDecimalDigits( 0 ); SetMin( nRelMin ); SetMax( nRelMax ); - SetCustomUnitText( '%' ); + SetCustomUnitText(rtl::OUString('%')); SetUnit( FUNIT_CUSTOM ); Clear(); diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index 5785246090e0..2e1303865487 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -83,7 +83,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries ); aEntry = comphelper::string::stripStart(aEntry, ' '); aEntry.ToUpperAscii(); - UniString aCompare( cCharCode ); + UniString aCompare = rtl::OUString(cCharCode); aCompare.ToUpperAscii(); if ( aEntry.CompareTo( aCompare, 1 ) == COMPARE_EQUAL ) diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 3f3d1e3ccc00..49e559eb1b88 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -335,7 +335,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c ) static CharClass* pCharClass = NULL; if( pCharClass == NULL ) pCharClass = new CharClass( Application::GetSettings().GetLocale() ); - String aStr( c ); + rtl::OUString aStr( c ); bool bRet = pCharClass->isLetter( aStr, 0 ); return bRet; } diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index 9ea2dcd18d4d..efce793b44b0 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -766,7 +766,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { - TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c ); + TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, rtl::OUString(c) ); sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; InsertUndo( pNewUndo, bTryMerge ); } diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index b30bbfc1ecea..1b6254109d22 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -716,7 +716,7 @@ sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent ) { if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsShift() && !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() && - ImplCheckTextLen( 'x' ) ) + ImplCheckTextLen( rtl::OUString('x') ) ) { aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() ); bModified = sal_True; @@ -730,7 +730,7 @@ sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent ) // Shift-RETURN darf nicht geschluckt werden, weil dann keine // mehrzeilige Eingabe in Dialogen/Property-Editor moeglich. if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() && - !rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( 'x' ) ) + !rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( rtl::OUString('x') ) ) { mpImpl->mpTextEngine->UndoActionStart(); aCurSel = mpImpl->mpTextEngine->ImpInsertParaBreak( aCurSel ); @@ -765,7 +765,7 @@ sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent ) if ( TextEngine::IsSimpleCharInput( rKeyEvent ) ) { xub_Unicode nCharCode = rKeyEvent.GetCharCode(); - if ( !mpImpl->mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken... + if ( !mpImpl->mbReadOnly && ImplCheckTextLen( rtl::OUString(nCharCode) ) ) // sonst trotzdem das Zeichen schlucken... { aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), sal_True ); bModified = sal_True; diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx index 063f2cd64092..aebb2d5c6d8e 100644 --- a/svtools/source/filter/filter.cxx +++ b/svtools/source/filter/filter.cxx @@ -895,7 +895,7 @@ static String ImpCreateFullFilterPath( const String& rPath, const String& rFilte ::rtl::OUString aPathURL; ::osl::FileBase::getFileURLFromSystemPath( rPath, aPathURL ); - aPathURL += String( '/' ); + aPathURL += rtl::OUString( '/' ); ::rtl::OUString aSystemPath; ::osl::FileBase::getSystemPathFromFileURL( aPathURL, aSystemPath ); diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx index 3f59d6a3e014..3d77afd442b0 100644 --- a/svtools/source/filter/sgvtext.cxx +++ b/svtools/source/filter/sgvtext.cxx @@ -693,7 +693,7 @@ sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c) if (c==' ') { - ChrWidth=(sal_uInt16)rOut.GetTextWidth( String('A') ); + ChrWidth=(sal_uInt16)rOut.GetTextWidth( rtl::OUString('A') ); if (rOut.GetFont().GetPitch()!=PITCH_FIXED) { ChrWidth=MulDiv(ChrWidth,DefaultSpace,100); } diff --git a/svtools/source/filter/wmf/emfwr.cxx b/svtools/source/filter/wmf/emfwr.cxx index 25fab138c30a..0c998e1320d9 100644 --- a/svtools/source/filter/wmf/emfwr.cxx +++ b/svtools/source/filter/wmf/emfwr.cxx @@ -816,7 +816,7 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons if( nLen > 1 ) { - nNormWidth = pDX[ nLen - 2 ] + maVDev.GetTextWidth( rText.GetChar( nLen - 1 ) ); + nNormWidth = pDX[ nLen - 2 ] + maVDev.GetTextWidth( rtl::OUString(rText.GetChar( nLen - 1 )) ); if( nWidth && nNormWidth && ( nWidth != nNormWidth ) ) { diff --git a/svtools/source/filter/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx index bb672e884f07..3cc3ef9ee104 100644 --- a/svtools/source/filter/wmf/winmtf.cxx +++ b/svtools/source/filter/wmf/winmtf.cxx @@ -1553,7 +1553,7 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry if( pDXArry ) { sal_uInt32 nLen = rText.Len(); - nTextWidth = pVDev->GetTextWidth( rText.GetChar( (sal_uInt16)( nLen - 1 ) ) ); + nTextWidth = pVDev->GetTextWidth( rtl::OUString(rText.GetChar( (sal_uInt16)( nLen - 1 ) )) ); if( nLen > 1 ) nTextWidth += pDXArry[ nLen - 2 ]; } diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx index fce702114089..29cabefa5c40 100644 --- a/svx/source/core/extedit.cxx +++ b/svx/source/core/extedit.cxx @@ -111,7 +111,7 @@ void ExternalToolEdit::Edit( GraphicObject* pGraphicObject ) osl::FileBase::createTempFile(0, &pHandle, &tempFileBase); // Move it to a file name with image extension properly set - tempFileName = tempFileBase + rtl::OUString(String('.')) + rtl::OUString(fExtension); + tempFileName = tempFileBase + rtl::OUString('.') + rtl::OUString(fExtension); osl::File::move(tempFileBase, tempFileName); //Write Graphic to the Temp File diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 5d7775e90d9f..620ce3949da4 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -564,7 +564,7 @@ void SvxTPView::Resize() void SvxTPView::InsertWriterHeader() { - String aStrTab(sal_Unicode('\t')); + rtl::OUString aStrTab('\t'); String aString(aTitle1); aString+=aStrTab; aString+=aTitle3; @@ -578,7 +578,7 @@ void SvxTPView::InsertWriterHeader() void SvxTPView::InsertCalcHeader() { - String aStrTab(sal_Unicode('\t')); + rtl::OUString aStrTab('\t'); String aString(aTitle1); aString+=aStrTab; aString+=aTitle2; diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index c9137adb9e9b..247e199a1709 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -763,12 +763,12 @@ void SvxFontPrevWindow::Paint( const Rectangle& ) long nTextWidth = 0; if(pImpl->cStartBracket) { - String sBracket(pImpl->cStartBracket); + rtl::OUString sBracket(pImpl->cStartBracket); nStartBracketWidth = rFont.GetTxtSize( pPrinter, sBracket ).Width(); } if(pImpl->cEndBracket) { - String sBracket(pImpl->cEndBracket); + rtl::OUString sBracket(pImpl->cEndBracket); nEndBracketWidth = rFont.GetTxtSize( pPrinter, sBracket ).Width(); } nTextWidth = pImpl->CalcTextSize( this, pPrinter, aSmallFont ).Width(); @@ -785,7 +785,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& ) if(pImpl->cStartBracket) { - String sBracket(pImpl->cStartBracket); + rtl::OUString sBracket(pImpl->cStartBracket); rFont.DrawPrev( this, pPrinter, Point( _nX, nY - nOffset - 4), sBracket ); _nX += nStartBracketWidth; } @@ -799,7 +799,7 @@ void SvxFontPrevWindow::Paint( const Rectangle& ) if(pImpl->cEndBracket) { Point aTmpPoint( _nX + 1, nY - nOffset - 4); - String sBracket(pImpl->cEndBracket); + rtl::OUString sBracket(pImpl->cEndBracket); rFont.DrawPrev( this, pPrinter, aTmpPoint, sBracket ); } pImpl->aCJKFont.SetSize( aOldSize ); diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 7305b1664f0f..7eec077c837a 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -277,7 +277,7 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s String sText(rtl::OUString("ABC")); Point aMove(1, GetTextHeight()); sal_Unicode cArrow = 0x2193; - long nAWidth = GetTextWidth(String(sText.GetChar(0))); + long nAWidth = GetTextWidth(rtl::OUString(sText.GetChar(0))); switch(pImpl->nFrameDirection) { case FRMDIR_HORI_LEFT_TOP: @@ -307,7 +307,7 @@ void SvxPageWindow::DrawPage( const Point& rOrg, const sal_Bool bSecond, const s sText.Append(cArrow); for(sal_uInt16 i = 0; i < sText.Len(); i++) { - String sDraw(sText.GetChar(i)); + rtl::OUString sDraw(sText.GetChar(i)); long nHDiff = 0; long nCharWidth = GetTextWidth(sDraw); sal_Bool bHorizontal = 0 == aMove.Y(); diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx index 11fedaf94cfa..df3acee8de20 100644 --- a/svx/source/dialog/relfld.cxx +++ b/svx/source/dialog/relfld.cxx @@ -108,7 +108,7 @@ void SvxRelativeField::SetRelative( sal_Bool bNewRelative ) SetDecimalDigits( 0 ); SetMin( nRelMin ); SetMax( nRelMax ); - SetCustomUnitText( String( sal_Unicode( '%' ) ) ); + SetCustomUnitText( rtl::OUString('%') ); SetUnit( FUNIT_CUSTOM ); } else diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 9ad1db82b843..b578b858b333 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -873,9 +873,9 @@ void RubyPreview::Paint( const Rectangle& /* rRect */ ) long nSpace = ((nRightEnd - nLeftStart) - GetTextWidth(sOutputText)) / (nCount - 1); for(xub_StrLen i = 0; i < nCount; i++) { - sal_Unicode cChar = sOutputText.GetChar(i); - DrawText( Point( nLeftStart , nYOutput), cChar); - long nCharWidth = GetTextWidth(cChar); + rtl::OUString sChar(sOutputText.GetChar(i)); + DrawText( Point( nLeftStart , nYOutput), sChar); + long nCharWidth = GetTextWidth(sChar); nLeftStart += nCharWidth + nSpace; } break; diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index 3ffdc0113a66..7825c6f019fc 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -176,7 +176,7 @@ void SvxSwFrameExample::InitAllRects_Impl() { aFont.SetSize(Size(0, aParaPrtArea.GetHeight() / 2)); SetFont(aFont); - aAutoCharFrame.SetSize(Size(GetTextWidth('A'), GetTextHeight())); + aAutoCharFrame.SetSize(Size(GetTextWidth(rtl::OUString('A')), GetTextHeight())); aAutoCharFrame.SetPos(Point(aParaPrtArea.Left() + (aParaPrtArea.GetWidth() - aAutoCharFrame.GetWidth()) / 2, aParaPrtArea.Top() + (aParaPrtArea.GetHeight() - aAutoCharFrame.GetHeight()) / 2)); } @@ -674,7 +674,7 @@ void SvxSwFrameExample::Paint(const Rectangle&) aPara.Bottom() -= nDiff; } if (nAnchor == TextContentAnchorType_AT_CHARACTER && bIgnoreWrap) - DrawText(aAutoCharFrame, 'A'); + DrawText(aAutoCharFrame, rtl::OUString('A')); } else { diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 0ad52138a046..cdb9db5549c7 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -407,7 +407,7 @@ DbGridControl::NavigationBar::NavigationBar(Window* pParent, WinBits nStyle) m_aRecordText.SetText(XubString(SVX_RES(RID_STR_REC_TEXT))); m_aRecordOf.SetText(XubString(SVX_RES(RID_STR_REC_FROM_TEXT))); - m_aRecordCount.SetText('?'); + m_aRecordCount.SetText(rtl::OUString('?')); m_nDefaultWidth = ArrangeControls(); diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 33a3082a90ae..59affa5eaeea 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -447,7 +447,7 @@ Reference< XForm > FmFormPageImpl::getDefaultForm() { XubString aStr(SVX_RES(RID_STR_FORM)); XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); pModel->BegUndo(aUndoStr); } @@ -531,7 +531,7 @@ Reference< ::com::sun::star::form::XForm > FmFormPageImpl::findPlaceInFormCompo { XubString aStr(SVX_RES(RID_STR_FORM)); XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); pModel->BegUndo(aUndoStr); } diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index e59f6bd83700..f9d6a85f864a 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -1002,8 +1002,8 @@ void FmSearchEngine::SearchNextImpl() UniString aTmp(strSearchExpression); const rtl::OUString s_sStar("\\*"); const rtl::OUString s_sQuotation("\\?"); - aTmp.SearchAndReplaceAll('*', s_sStar); - aTmp.SearchAndReplaceAll('?', s_sQuotation); + aTmp.SearchAndReplaceAll(rtl::OUString('*'), s_sStar); + aTmp.SearchAndReplaceAll(rtl::OUString('?'), s_sQuotation); strSearchExpression = aTmp; switch (m_nPosition) diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index b951406a8336..b6fe4ca51b1a 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -1058,7 +1058,7 @@ rtl::OUString FmUndoPropertyAction::GetComment() const RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmUndoPropertyAction::GetComment" ); String aStr(static_STR_UNDO_PROPERTY); - aStr.SearchAndReplace( '#', aPropertyName ); + aStr.SearchAndReplace( rtl::OUString('#'), aPropertyName ); return aStr; } diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 73523525b3c0..4fea777be024 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3794,7 +3794,7 @@ sal_Bool SAL_CALL FormController::approveRowChange(const RowChangeEvent& _rEvent continue; String sMessage( SVX_RES( RID_ERR_FIELDREQUIRED ) ); - sMessage.SearchAndReplace( '#', rColInfo.sName ); + sMessage.SearchAndReplace( rtl::OUString('#'), rColInfo.sName ); // the control to focus Reference< XControl > xControl( rColInfo.xFirstControlWithInputRequired ); @@ -4057,7 +4057,7 @@ sal_Bool SAL_CALL FormController::confirmDelete(const RowChangeEvent& aEvent) th if ( nLength > 1 ) { sTitle = SVX_RESSTR( RID_STR_DELETECONFIRM_RECORDS ); - sTitle.SearchAndReplace( '#', String::CreateFromInt32( nLength ) ); + sTitle.SearchAndReplace( rtl::OUString('#'), rtl::OUString::valueOf(nLength) ); } else sTitle = SVX_RESSTR( RID_STR_DELETECONFIRM_RECORD ); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 47603125f0c1..da67a6146b36 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -459,7 +459,7 @@ namespace svxform { XubString aStr(SVX_RES(RID_STR_FORM)); XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); pFormModel->BegUndo(aUndoStr); // der Slot war nur verfuegbar, wenn es genau einen selektierten Eintrag gibt und dieser die Root @@ -472,7 +472,7 @@ namespace svxform { XubString aStr(SVX_RES(RID_STR_CONTROL)); XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); pFormModel->BegUndo(aUndoStr); // dieser Slot war guletig bei (genau) einem selektierten Formular @@ -1004,7 +1004,7 @@ namespace svxform { XubString aStr(SVX_RES(RID_STR_CONTROL)); XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); pFormModel->BegUndo(aUndoStr); } diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx index 1d7ca0fce7fa..01bf2243d338 100644 --- a/svx/source/form/navigatortreemodel.cxx +++ b/svx/source/form/navigatortreemodel.cxx @@ -316,7 +316,7 @@ namespace svxform if( bUndo ) { XubString aUndoStr(SVX_RES(RID_STR_UNDO_CONTAINER_INSERT)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); m_pFormModel->BegUndo(aUndoStr); } @@ -415,7 +415,7 @@ namespace svxform if( bUndo ) { XubString aUndoStr(SVX_RESSTR(RID_STR_UNDO_CONTAINER_REMOVE)); - aUndoStr.SearchAndReplace('#', aStr); + aUndoStr.SearchAndReplace(rtl::OUString('#'), aStr); m_pFormModel->BegUndo(aUndoStr); } } diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index 1b01121d1184..465901240b31 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -27,6 +27,7 @@ ************************************************************************/ #ifndef _SWTYPES_HXX #define _SWTYPES_HXX +#include <rtl/ustring.hxx> #include <tools/solar.h> #include <SwGetPoolIdFromName.hxx> @@ -89,7 +90,7 @@ const SwTwips lMinBorder = 1134; // Constant strings. SW_DLLPUBLIC extern UniString aEmptyStr; // "" -SW_DLLPUBLIC extern UniString aDotStr; // '.' +SW_DLLPUBLIC extern rtl::OUString aDotStr; // '.' // For inserting of captions (what and where to insert). // It's here because it is not big enough to justify its own hxx diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 59249ad57a92..0ae229aefcb8 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -662,7 +662,7 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary( // It's a word if the first character is an alpha-numeric character. bRet = GetAppCharClass().isLetterNumeric( - rText.getStr()[ rBound.startPos ] ); + rtl::OUString(rText[rBound.startPos]) ); } else { diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 0da4e0adb383..a2b039d862f1 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -158,7 +158,7 @@ void SwAccessiblePortionData::Special( case POR_POSTITS: case POR_FLYCNT: case POR_GRFNUM: - sDisplay = String(sal_Unicode(0xfffc)); + sDisplay = rtl::OUString(sal_Unicode(0xfffc)); break; case POR_NUMBER: diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx index c0d8608d516e..3ea3bddd7a02 100644 --- a/sw/source/core/bastyp/swtypes.cxx +++ b/sw/source/core/bastyp/swtypes.cxx @@ -56,8 +56,8 @@ using namespace com::sun::star; -String aEmptyStr; // constant string -String aDotStr('.'); // constant string +UniString aEmptyStr; // constant string +rtl::OUString aDotStr('.'); // constant string IMPL_FIXEDMEMPOOL_NEWDEL( SwAttrSet ) IMPL_FIXEDMEMPOOL_NEWDEL( SwStartNode ) diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 93b65233e1c3..3b1f76a486b2 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -88,12 +88,12 @@ namespace io_pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_UI_REPLACE, NULL); if( ( ch_start != aStartMark ) && ( aEndMark != CH_TXT_ATR_FORMELEMENT ) ) { - io_pDoc->InsertString(aStartPaM, aStartMark); + io_pDoc->InsertString(aStartPaM, rtl::OUString(aStartMark)); rStart.nContent--; } if ( aEndMark && ( ch_end != aEndMark ) ) { - io_pDoc->InsertString(aEndPaM, aEndMark); + io_pDoc->InsertString(aEndPaM, rtl::OUString(aEndMark)); rEnd.nContent++; } io_pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_UI_REPLACE, NULL); diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 8aa0a1b686a4..261e8378332d 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -673,7 +673,7 @@ String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam ) aStr = comphelper::string::remove(aStr, CH_TXTATR_BREAKWORD); aStr = comphelper::string::remove(aStr, CH_TXTATR_INWORD); xub_StrLen nStart = 0; - String sX( 'x' ); + rtl::OUString sX( 'x' ); if( pPam->Start()->nContent > 0 ) { aStr.Insert( sX, 0 ); diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 8e5db3d1a9b7..51d91efe1f44 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -922,7 +922,7 @@ IMPL_LINK(SwDoc, CalcFieldValueHdl, EditFieldInfo*, pInfo) else { OSL_FAIL("unknown field command"); - pInfo->SetRepresentation( String( '?' ) ); + pInfo->SetRepresentation( rtl::OUString( '?' ) ); } } diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 90f5e8c2ae38..fd7540337a0d 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -797,7 +797,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr ) // start behind the characters (to fix the attributes!) if( nStart < pNode->GetTxt().Len() ) rIdx++; - pNode->InsertText( c, rIdx, INS_EMPTYEXPAND ); + pNode->InsertText( rtl::OUString(c), rIdx, INS_EMPTYEXPAND ); if( nStart+1 < rIdx.GetIndex() ) { rIdx = nStart; diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 4d39e3473f9e..2a2b3d41155d 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -1713,7 +1713,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, size_t nSize = rBase.aTOXSources.size(); if (nSize > 0) { - String aInsStr( cNumRepl ); + String aInsStr = rtl::OUString(cNumRepl); for (size_t i = 1; i < nSize; ++i) { aInsStr.AppendAscii( sPageDeli ); @@ -1984,10 +1984,11 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, // collect starts end ends of main entry character style std::vector<sal_uInt16>* pCharStyleIdx = pMainEntryNums ? new std::vector<sal_uInt16> : 0; - String sSrchStr( cNumRepl ); - sSrchStr.AppendAscii( sPageDeli ) += cNumRepl; + rtl::OUString sSrchStr = rtl::OUStringBuffer().append(cNumRepl). + append(sPageDeli).append(cNumRepl).makeStringAndClear(); xub_StrLen nStartPos = pNd->GetTxt().Search( sSrchStr ); - ( sSrchStr = cNumRepl ) += cEndPageNum; + sSrchStr = rtl::OUStringBuffer().append(cNumRepl). + append(cEndPageNum).makeStringAndClear(); xub_StrLen nEndPos = pNd->GetTxt().Search( sSrchStr ); sal_uInt16 i; diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 12c59d7676cc..4d413a5742d6 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -690,7 +690,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); // Der LinkFileName koennte auch nur aus Separatoren bestehen - String sCompareString = sfx2::cTokenSeperator; + String sCompareString = rtl::OUString(sfx2::cTokenSeperator); sCompareString += sfx2::cTokenSeperator; const bool bUpdate = (!pSection->IsLinkType() && rNewData.IsLinkType()) diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index c55df61335ce..118eeb223d89 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1513,7 +1513,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) { // Inserting the seperator SwIndex aCntIdx( pDelPara->pLastNd, pDelPara->pLastNd->GetTxt().Len()); - pDelPara->pLastNd->InsertText( pDelPara->cCh, aCntIdx, + pDelPara->pLastNd->InsertText( rtl::OUString(pDelPara->cCh), aCntIdx, IDocumentContentOperations::INS_EMPTYEXPAND ); if( pDelPara->pUndo ) pDelPara->pUndo->AddBoxPos( *pDoc, nNdIdx, aDelRg.aEnd.GetIndex(), diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 4bec51891fe9..2abc9304ec2e 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1276,7 +1276,7 @@ void SwAutoFormat::DelMoreLinesBlanks( sal_Bool bWithLineBreaks ) DeleteSel( *pNxt ); if( !bHasBlnks ) { - pDoc->InsertString( *pNxt, sal_Unicode(' ') ); + pDoc->InsertString( *pNxt, rtl::OUString(' ') ); } } @@ -1335,7 +1335,7 @@ void SwAutoFormat::BuildIndent() IsSentenceAtEnd( *pNxtNd ); if( DeleteAktNxtPara( pNxtNd->GetTxt() )) { - pDoc->InsertString( aDelPam, sal_Unicode(' ') ); + pDoc->InsertString( aDelPam, rtl::OUString(' ') ); } if( bBreak ) break; @@ -1376,7 +1376,7 @@ void SwAutoFormat::BuildTextIndent() IsSentenceAtEnd( *pNxtNd ); if( DeleteAktNxtPara( pNxtNd->GetTxt() ) ) { - pDoc->InsertString( aDelPam, sal_Unicode(' ') ); + pDoc->InsertString( aDelPam, rtl::OUString(' ') ); } if( bBreak ) break; @@ -1412,7 +1412,7 @@ void SwAutoFormat::BuildText() IsSentenceAtEnd( *pNxtNd ); if( DeleteAktNxtPara( pNxtNd->GetTxt() ) ) { - pDoc->InsertString( aDelPam, sal_Unicode(' ') ); + pDoc->InsertString( aDelPam, rtl::OUString(' ') ); } if( bBreak ) break; @@ -1681,7 +1681,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) if( !aFlags.bSetNumRule ) { - String sChgStr( '\t' ); + String sChgStr = rtl::OUString('\t'); if( bChgBullet ) sChgStr.Insert( aFlags.cBullet, 0 ); pDoc->InsertString( aDelPam, sChgStr ); @@ -1725,7 +1725,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) IsSentenceAtEnd( *pNxtNd ); if( DeleteAktNxtPara( pNxtNd->GetTxt() ) ) { - pDoc->InsertString( aDelPam, sal_Unicode(' ') ); + pDoc->InsertString( aDelPam, rtl::OUString(' ') ); } if( bBreak ) break; @@ -1795,7 +1795,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) DeleteSel( aDelPam ); if( bInsTab ) { - pDoc->InsertString( aDelPam, sal_Unicode('\t') ); + pDoc->InsertString( aDelPam, rtl::OUString('\t') ); } } } @@ -1815,7 +1815,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) IsSentenceAtEnd( *pNxtNd ); if( DeleteAktNxtPara( pNxtNd->GetTxt() ) ) { - pDoc->InsertString( aDelPam, sal_Unicode(' ') ); + pDoc->InsertString( aDelPam, rtl::OUString(' ') ); } if( bBreak ) break; @@ -1946,7 +1946,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) aDelPam.DeleteMark(); if( bSetHardBlank ) { - pDoc->InsertString( aDelPam, CHAR_HARDBLANK ); + pDoc->InsertString( aDelPam, rtl::OUString(CHAR_HARDBLANK) ); ++nPos; } } @@ -2001,7 +2001,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) if( bSetHardBlank ) { aDelPam.GetPoint()->nContent = nPos; - pDoc->InsertString( aDelPam, CHAR_HARDBLANK ); + pDoc->InsertString( aDelPam, rtl::OUString(CHAR_HARDBLANK) ); aDelPam.GetPoint()->nContent = ++nPos; } } diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 7889328e405e..5a989841dca3 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -81,7 +81,7 @@ void SwEditShell::Insert( sal_Unicode c, sal_Bool bOnlyCurrCrsr ) StartAllAction(); FOREACHPAM_START(this) - const bool bSuccess = GetDoc()->InsertString(*PCURCRSR, c); + const bool bSuccess = GetDoc()->InsertString(*PCURCRSR, rtl::OUString(c)); OSL_ENSURE( bSuccess, "Doc->Insert() failed." ); (void) bSuccess; diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index e95f9676c701..a5e6f9fb6b92 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -661,7 +661,7 @@ void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos ) DelSoftHyph( *pCrsr ); pSttPos->nContent += nHyphPos; SwPaM aRg( *pSttPos ); - pDoc->InsertString( aRg, CHAR_SOFTHYPHEN ); + pDoc->InsertString( aRg, rtl::OUString(CHAR_SOFTHYPHEN) ); // Durch das Einfuegen des SoftHyphs ist ein Zeichen hinzugekommen //JP 18.07.95: warum, ist doch ein SwIndex, dieser wird doch mitverschoben !! // pSttPos->nContent++; diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index f09b5e01af95..fe8826a5b077 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> - +#include <comphelper/string.hxx> #include <svl/fstathelper.hxx> #include <svtools/txtcmp.hxx> @@ -340,7 +340,7 @@ void SwEditShell::ApplyAutoMark() //2. SfxMedium aMedium( sAutoMarkURL, STREAM_STD_READ ); SvStream& rStrm = *aMedium.GetInStream(); - const String sZero('0'); + const sal_Unicode cZero('0'); Push(); rtl_TextEncoding eChrSet = ::osl_getThreadTextEncoding(); @@ -402,8 +402,8 @@ void SwEditShell::ApplyAutoMark() String sWordOnly = sLine.GetToken(0, ';', nTokenPos); //3. - bCaseSensitive = sCase.Len() && sCase != sZero; - bWordOnly = sWordOnly.Len() && sWordOnly != sZero; + bCaseSensitive = sCase.Len() && !comphelper::string::equals(sCase, cZero); + bWordOnly = sWordOnly.Len() && !comphelper::string::equals(sWordOnly, cZero); // if (!bCaseSensitive) { diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 6d45a44df2cf..1c8f1e294a2b 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -836,7 +836,7 @@ String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd, // in die Externe Darstellung umwandeln. SwTableBox* pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(sTmp.ToInt64())); if( !rTbl.GetTabSortBoxes().Seek_Entry( pBox )) - return '?'; + return rtl::OUString('?'); sTmp = pBox->GetName(); } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 8df55373e57f..9310e47b8fa5 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1126,7 +1126,7 @@ String SwDocInfoField::Expand() const } else if( aAny >>= aDuration ) { - String sText(aDuration.Negative ? '-' : '+'); + String sText = aDuration.Negative ? rtl::OUString('-') : rtl::OUString('+'); sText += ViewShell::GetShellRes()->sDurationFormat; sText.SearchAndReplace(rtl::OUString("%1"), String::CreateFromInt32( aDuration.Years ) ); sText.SearchAndReplace(rtl::OUString("%2"), String::CreateFromInt32( aDuration.Months ) ); @@ -2425,9 +2425,8 @@ SwJumpEditField::SwJumpEditField( SwJumpEditFieldType* pTyp, sal_uInt32 nForm, String SwJumpEditField::Expand() const { - String sTmp( '<' ); - sTmp += sTxt; - return sTmp += '>'; + return rtl::OUStringBuffer().append('<'). + append(sTxt).append('>').makeStringAndClear(); } SwField* SwJumpEditField::Copy() const diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index 4657e0f8836b..03b66c47424e 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -71,8 +71,9 @@ void SwTblField::CalcField( SwTblCalcPara& rCalcPara ) SwTblField::SwTblField( SwTblFieldType* pInitType, const String& rFormel, sal_uInt16 nType, sal_uLong nFmt ) : SwValueField( pInitType, nFmt ), SwTableFormula( rFormel ), - sExpand( '0' ), nSubType(nType) + nSubType(nType) { + sExpand = rtl::OUString('0'); } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 57c0c97818b3..0c1d219696c4 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -2448,10 +2448,11 @@ sal_Bool SwFEShell::GetAutoSum( String& rFml ) const // possibly allow texts?? break; - String sTmp( '<' ); - sTmp += pCFrm->GetTabBox()->GetName(); - sTmp += '>'; - rFml.Insert( sTmp, nInsPos ); + rtl::OUStringBuffer sTmp; + sTmp.append('<'); + sTmp.append(pCFrm->GetTabBox()->GetName()); + sTmp.append('>'); + rFml.Insert( sTmp.makeStringAndClear(), nInsPos ); } if( nW ) { diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 73588909b1d8..5e3991dc853e 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -552,7 +552,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const // Don't show the paragraph mark for collapsed paragraphs, when they are hidden if ( EmptyHeight( ) > 1 ) { - const XubString aTmp( CH_PAR ); + const rtl::OUString aTmp( CH_PAR ); SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 ); aDrawInf.SetLeft( rRect.Left() ); aDrawInf.SetRight( rRect.Right() ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 3970f312c095..554ba0f83632 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -819,7 +819,7 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP } // check if char fits into rectangle - const XubString aTmp( cChar ); + const rtl::OUString aTmp( cChar ); aFontSize = rInf.GetTxtSize( aTmp ).SvLSize(); while ( aFontSize.Width() > nMaxWidth ) { diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index faf180439062..989b9f608105 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -684,7 +684,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa case CHAR_HARDBLANK: case CHAR_HARDHYPHEN: { - XubString sTmp( cChar ); + rtl::OUString sTmp( cChar ); SwDrawTextInfo aDrawInf( const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()), *pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311 nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); @@ -934,7 +934,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd else if ( cChar == CH_TAB ) { // tab receives width of one space - XubString sTmp( CH_BLANK ); + rtl::OUString sTmp( CH_BLANK ); SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 ); nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); nIdx++; @@ -943,7 +943,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ++nIdx; else if ( cChar == CHAR_HARDBLANK || cChar == CHAR_HARDHYPHEN ) { - XubString sTmp( cChar ); + rtl::OUString sTmp( cChar ); SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 ); nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); nIdx++; diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx index fe86048ab76a..3624ec042d0e 100644 --- a/sw/source/core/text/porexp.cxx +++ b/sw/source/core/text/porexp.cxx @@ -243,7 +243,7 @@ sal_Bool SwBlankPortion::GetExpTxt( const SwTxtSizeInfo&, XubString &rTxt ) cons void SwBlankPortion::HandlePortion( SwPortionHandler& rPH ) const { - String aString( cChar ); + rtl::OUString aString( cChar ); rPH.Special( GetLen(), aString, GetWhichPor() ); } diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 4f31d01a3d3b..4ef411dcbaaf 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -133,7 +133,7 @@ KSHORT SwFldPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() ) { if( !nViewWidth ) - pThis->nViewWidth = rInf.GetTxtSize( ' ' ).Width(); + pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); } else pThis->nViewWidth = 0; diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index b91048f44576..80ce9dc018c9 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -92,7 +92,7 @@ sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf ) && ' ' != rInf.GetChar( rInf.GetIdx() - 1 ) && ( !rInf.GetLast() || !rInf.GetLast()->IsBreakPortion() ) ) { - SetBlankWidth( rInf.GetTxtSize( ' ' ).Width() ); + SetBlankWidth( rInf.GetTxtSize(rtl::OUString(' ')).Width() ); SetLen( 1 ); } diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index 606ad4492033..6cd9dfcc8e84 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -112,7 +112,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const #endif if( 1 == GetLen() ) { - String aBullet( CH_BULLET ); + rtl::OUString aBullet( CH_BULLET ); SwPosSize aBulletSize( rInf.GetTxtSize( aBullet ) ); Point aPos( rInf.GetPos() ); aPos.X() += (Width()/2) - (aBulletSize.Width()/2); @@ -122,7 +122,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const aBulletPor.Width( aBulletSize.Width() ); aBulletPor.Height( aBulletSize.Height() ); aBulletPor.SetAscent( GetAscent() ); - aInf.DrawText( aBulletPor, aBullet.Len(), sal_True ); + aInf.DrawText( aBulletPor, aBullet.getLength(), sal_True ); } else { diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index ed072baba389..20b428a127da 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -328,14 +328,14 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate, sal_uInt8 nTmp = SW_SCRIPTS; if( pBracket->cPre > 255 ) { - String aTxt( pBracket->cPre ); + String aTxt = rtl::OUString(pBracket->cPre); nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 ); } pBracket->nPreScript = nTmp; nTmp = SW_SCRIPTS; if( pBracket->cPost > 255 ) { - String aTxt( pBracket->cPost ); + String aTxt = rtl::OUString(pBracket->cPost); nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 ); } pBracket->nPostScript = nTmp; @@ -428,7 +428,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi pBracket->nHeight = 0; if( pBracket->cPre ) { - String aStr( pBracket->cPre ); + rtl::OUString aStr( pBracket->cPre ); sal_uInt8 nActualScr = pTmpFnt->GetActual(); if( SW_SCRIPTS > pBracket->nPreScript ) pTmpFnt->SetActual( pBracket->nPreScript ); @@ -453,7 +453,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi pBracket->nPreWidth = 0; if( pBracket->cPost ) { - String aStr( pBracket->cPost ); + rtl::OUString aStr( pBracket->cPost ); if( SW_SCRIPTS > pBracket->nPostScript ) pTmpFnt->SetActual( pBracket->nPostScript ); SwFontSave aSave( rInf, pTmpFnt ); diff --git a/sw/source/core/text/porref.cxx b/sw/source/core/text/porref.cxx index 2f090b198b70..b8dbc14b1cb5 100644 --- a/sw/source/core/text/porref.cxx +++ b/sw/source/core/text/porref.cxx @@ -70,7 +70,7 @@ KSHORT SwIsoRefPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const !rInf.GetOpt().IsReadonly() && !rInf.GetOpt().IsPagePreview() ) { if( !nViewWidth ) - pThis->nViewWidth = rInf.GetTxtSize( ' ' ).Width(); + pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); } else pThis->nViewWidth = 0; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 26ba4ced124a..a89a37331dfd 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -79,7 +79,7 @@ void SwTmpEndPortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.OnWin() && rInf.GetOpt().IsParagraph() ) { SwDefFontSave aSave( rInf ); - const XubString aTmp( CH_PAR ); + const rtl::OUString aTmp( CH_PAR ); rInf.DrawText( aTmp, *this ); } } @@ -586,7 +586,7 @@ sal_Bool SwControlCharPortion::Format( SwTxtFormatInfo &rInf ) KSHORT SwControlCharPortion::GetViewWidth( const SwTxtSizeInfo& rInf ) const { if( !mnViewWidth ) - mnViewWidth = rInf.GetTxtSize( ' ' ).Width(); + mnViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); return mnViewWidth; } diff --git a/sw/source/core/text/portox.cxx b/sw/source/core/text/portox.cxx index 08fe3b80db29..df10d88f69d8 100644 --- a/sw/source/core/text/portox.cxx +++ b/sw/source/core/text/portox.cxx @@ -72,7 +72,7 @@ KSHORT SwIsoToxPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() ) { if( !nViewWidth ) - pThis->nViewWidth = rInf.GetTxtSize( ' ' ).Width(); + pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); } else pThis->nViewWidth = 0; diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 2654eaf58ebe..d51ece82b5e1 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -521,7 +521,7 @@ void SwTxtPortion::FormatEOL( SwTxtFormatInfo &rInf ) if( nHoleLen == GetLen() ) nBlankSize = Width(); else - nBlankSize = nHoleLen * rInf.GetTxtSize( ' ' ).Width(); + nBlankSize = nHoleLen * rInf.GetTxtSize(rtl::OUString(' ')).Width(); Width( Width() - nBlankSize ); rInf.X( rInf.X() - nBlankSize ); SetLen( GetLen() - nHoleLen ); @@ -728,7 +728,7 @@ void SwHolePortion::Paint( const SwTxtPaintInfo &rInf ) const // #i16816# tagged pdf support if( rInf.GetVsh() && rInf.GetVsh()->GetViewOptions()->IsPDFExport() ) { - const XubString aTxt( ' ' ); + const rtl::OUString aTxt( ' ' ); rInf.DrawText( aTxt, *this, 0, 1, false ); } } diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index efdca9281be0..66c601f62ee1 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -399,7 +399,7 @@ sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) void SwHyphPortion::HandlePortion( SwPortionHandler& rPH ) const { - String aString( '-' ); + rtl::OUString aString( '-' ); rPH.Special( GetLen(), aString, GetWhichPor() ); } @@ -467,7 +467,7 @@ KSHORT SwSoftHyphPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const { if( !nViewWidth ) ((SwSoftHyphPortion*)this)->nViewWidth - = rInf.GetTxtSize( '-' ).Width(); + = rInf.GetTxtSize(rtl::OUString('-')).Width(); } else ((SwSoftHyphPortion*)this)->nViewWidth = 0; @@ -626,7 +626,7 @@ sal_Bool SwSoftHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTx void SwSoftHyphPortion::HandlePortion( SwPortionHandler& rPH ) const { - const String aString( '-' ); + const rtl::OUString aString( '-' ); const sal_uInt16 nWhich = ! Width() ? POR_SOFTHYPH_COMP : GetWhichPor(); diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 8841e399fb04..137da97912ea 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -401,7 +401,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf ) static_cast<SwNumberPortion*>(rInf.GetLast())->GetFont(); pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) ); } - XubString aTmp( ' ' ); + rtl::OUString aTmp( ' ' ); SwTxtSizeInfo aInf( rInf, aTmp ); nMinimumTabWidth = aInf.GetTxtSize().Width(); } @@ -619,7 +619,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.GetFont()->IsPaintBlank() ) { // Tabs mit Fuellung - XubString aTxt( ' ' ); + UniString aTxt = rtl::OUString(' '); const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); // robust: if( nCharWidth ) @@ -634,7 +634,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const if( IsFilled() ) { // Tabs mit Fuellung - XubString aTxt( cFill ); + UniString aTxt = rtl::OUString(cFill); const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" ); // robust: diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index a78890e16084..6442bea1587a 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -655,8 +655,8 @@ sal_uInt8 lcl_WhichPunctuation( xub_Unicode cChar ) static sal_Bool lcl_IsMonoSpaceFont( const OutputDevice& rOut ) { - const String aStr1( xub_Unicode( 0x3008 ) ); - const String aStr2( xub_Unicode( 0x307C ) ); + const rtl::OUString aStr1( xub_Unicode( 0x3008 ) ); + const rtl::OUString aStr2( xub_Unicode( 0x307C ) ); const long nWidth1 = rOut.GetTextWidth( aStr1 ); const long nWidth2 = rOut.GetTextWidth( aStr2 ); return nWidth1 == nWidth2; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 88823b98f83c..fd419ef9d7f6 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1262,7 +1262,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) (const SfxPoolItem**)&pAnchor ); SwIndex aIdx( this, *pAttr->GetStart() ); - const sal_Unicode c = GetCharOfTxtAttr(*pAttr); + const rtl::OUString c(GetCharOfTxtAttr(*pAttr)); InsertText( c, aIdx, nInsertFlags ); nInsMode |= nsSetAttrMode::SETATTR_NOTXTATRCHR; @@ -1379,7 +1379,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // entstehen koennen und das Attribut im _SortArr_ am // Dokument nicht eingetrage wird. SwIndex aNdIdx( this, *pAttr->GetStart() ); - const sal_Unicode c = GetCharOfTxtAttr(*pAttr); + const rtl::OUString c(GetCharOfTxtAttr(*pAttr)); InsertText( c, aNdIdx, nInsertFlags ); nInsMode |= nsSetAttrMode::SETATTR_NOTXTATRCHR; } @@ -1439,7 +1439,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) if( !(nsSetAttrMode::SETATTR_NOTXTATRCHR & nInsMode) ) { SwIndex aIdx( this, *pAttr->GetStart() ); - InsertText( GetCharOfTxtAttr(*pAttr), aIdx, nInsertFlags ); + InsertText( rtl::OUString(GetCharOfTxtAttr(*pAttr)), aIdx, nInsertFlags ); // adjust end of hint to account for inserted CH_TXTATR xub_StrLen * const pEnd(pAttr->GetEnd()); diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 497ceb2bf967..26716a7cf79c 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -744,7 +744,7 @@ sal_Bool SwScanner::NextWord() if ( nWordType != i18n::WordType::WORD_COUNT ) { rCC.setLocale( pBreakIt->GetLocale( aCurrLang ) ); - if ( rCC.isLetterNumeric( aText[nBegin] ) ) + if ( rCC.isLetterNumeric(rtl::OUString(aText[nBegin])) ) break; } else diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 576456a6788e..1cfa0a792aaa 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -467,7 +467,7 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) sal_Unicode cDelChar = pDelTxtNd->GetTxt().GetChar( pStt->nContent.GetIndex() ); CharClass& rCC = GetAppCharClass(); if( ( CH_TXTATR_BREAKWORD == cDelChar || CH_TXTATR_INWORD == cDelChar ) || - rCC.isLetterNumeric( String( cDelChar ), 0 ) != + rCC.isLetterNumeric( rtl::OUString( cDelChar ), 0 ) != rCC.isLetterNumeric( *pSttStr, nUChrPos ) ) return sal_False; diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index b4aee5938d4b..28703e102367 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -392,7 +392,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, } else { - pTxtNd->InsertText( sal_Unicode(' '), aPos.nContent, + pTxtNd->InsertText( rtl::OUString(' '), aPos.nContent, IDocumentContentOperations::INS_NOHINTEXPAND ); } } diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 626ac4e475c3..03f50b6f00eb 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -136,7 +136,7 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd ) sal_Bool SwUndoInsert::CanGrouping( sal_Unicode cIns ) { if( !bIsAppend && bIsWordDelim == - !GetAppCharClass().isLetterNumeric( String( cIns )) ) + !GetAppCharClass().isLetterNumeric( rtl::OUString( cIns )) ) { nLen++; nCntnt++; diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index 944d45f27d4b..bba2d1e87c23 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -85,7 +85,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); pTxtNd->SetIgnoreDontExpand( sal_True ); - pTxtNd->InsertText( cIns, rPos.nContent, + pTxtNd->InsertText( rtl::OUString(cIns), rPos.nContent, IDocumentContentOperations::INS_EMPTYEXPAND ); aInsStr.Insert( cIns ); @@ -125,7 +125,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( String( cIns ), 0 ) != + rCC.isLetterNumeric( rtl::OUString( cIns ), 0 ) != rCC.isLetterNumeric( aInsStr, aInsStr.Len()-1 ) ) return sal_False; @@ -163,7 +163,7 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, sal_Bool bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand(); pDelTxtNd->SetIgnoreDontExpand( sal_True ); - pDelTxtNd->InsertText( cIns, rPos.nContent, + pDelTxtNd->InsertText( rtl::OUString(cIns), rPos.nContent, IDocumentContentOperations::INS_EMPTYEXPAND ); aInsStr.Insert( cIns ); @@ -208,7 +208,7 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext) if( aDelStr.Len() ) { - String aTmpStr( '1' ); + String aTmpStr = rtl::OUString('1'); sal_Unicode* pTmpStr = aTmpStr.GetBufferAccess(); sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); @@ -255,10 +255,10 @@ void SwUndoOverwrite::RepeatImpl(::sw::RepeatContext & rContext) { ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); - rDoc.Overwrite(*pAktPam, aInsStr.GetChar(0)); + rDoc.Overwrite(*pAktPam, rtl::OUString(aInsStr.GetChar(0))); } for( xub_StrLen n = 1; n < aInsStr.Len(); ++n ) - rDoc.Overwrite( *pAktPam, aInsStr.GetChar( n ) ); + rDoc.Overwrite( *pAktPam, rtl::OUString(aInsStr.GetChar(n)) ); } void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) @@ -288,7 +288,7 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) for( xub_StrLen n = 0; n < aInsStr.Len(); n++ ) { // do it individually, to keep the attributes! - pTxtNd->InsertText( aInsStr.GetChar( n ), rIdx, + pTxtNd->InsertText( rtl::OUString(aInsStr.GetChar(n)), rIdx, IDocumentContentOperations::INS_EMPTYEXPAND ); if( n < aDelStr.Len() ) { diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index a1c7d0eb23d2..b2447f4752d8 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -606,7 +606,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName, { SwSetExpFieldType aType(m_pDoc, sTypeName); if(sParam1.Len()) - aType.SetDelimiter( sParam1.GetChar(0)); + aType.SetDelimiter(rtl::OUString(sParam1.GetChar(0))); if(nParam1 > -1 && nParam1 < MAXLEVEL) aType.SetOutlineLvl(nParam1); pType2 = m_pDoc->InsertFldType(aType); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index b1fae476f182..5f22640bb63e 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1914,7 +1914,7 @@ void SwXDocumentIndexMark::Impl::InsertTOXMark( // deshalb hier ein Leerzeichen - ob das die ideale Loesung ist? if (!bMark && !rMark.GetAlternativeText().Len()) { - rMark.SetAlternativeText( String(' ') ); + rMark.SetAlternativeText( rtl::OUString(' ') ); } const bool bForceExpandHints( (!bMark && pTextCursor) diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index c61db3341706..f9cd4a0a4297 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -472,7 +472,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) } if (cIns) { - m_pImpl->m_pDoc->InsertString( aTmp, cIns, nInsertFlags ); + m_pImpl->m_pDoc->InsertString( aTmp, rtl::OUString(cIns), nInsertFlags ); } if (bAbsorb) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index d7beadca3c16..c8c504c2373c 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1799,7 +1799,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, else if( pTemplate ) pRefPageDesc = pTemplate->GetPageDescFromPool( nRefPoolId, false ); - String aSelector( '@' ); + String aSelector = rtl::OUString('@'); aSelector.AppendAscii( sCSS1_page ); if( bPseudo ) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 1fdf4cd2ea77..05d5adb88380 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1439,11 +1439,11 @@ void SwHTMLParser::NextToken( int nToken ) break; case HTML_NONBREAKSPACE: - pDoc->InsertString( *pPam, CHAR_HARDBLANK ); + pDoc->InsertString( *pPam, rtl::OUString(CHAR_HARDBLANK) ); break; case HTML_SOFTHYPH: - pDoc->InsertString( *pPam, CHAR_SOFTHYPHEN ); + pDoc->InsertString( *pPam, rtl::OUString(CHAR_SOFTHYPHEN) ); break; case HTML_LINEFEEDCHAR: @@ -1965,9 +1965,9 @@ void SwHTMLParser::NextToken( int nToken ) } else { - String aComment( '<' ); - (aComment += aToken) += '>'; - InsertComment( aComment ); + rtl::OUStringBuffer aComment; + aComment.append('<').append(aToken).append('>'); + InsertComment( aComment.makeStringAndClear() ); } } break; @@ -4934,7 +4934,7 @@ void SwHTMLParser::InsertSpacer() else { NewAttr( &aAttrTab.pKerning, SvxKerningItem( (short)nSize, RES_CHRATR_KERNING ) ); - String aTmp( ' ' ); + rtl::OUString aTmp( ' ' ); pDoc->InsertString( *pPam, aTmp ); EndAttr( aAttrTab.pKerning ); } @@ -5138,7 +5138,7 @@ void SwHTMLParser::InsertLineBreak() { // wenn kein CLEAR ausgefuehrt werden sollte oder konnte, wird // ein Zeilenumbruch eingef?gt - String sTmp( (sal_Unicode)0x0a ); // make the Mac happy :-) + rtl::OUString sTmp( (sal_Unicode)0x0a ); // make the Mac happy :-) pDoc->InsertString( *pPam, sTmp ); } else if( pPam->GetPoint()->nContent.GetIndex() ) diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index b7888b0b7046..fb96136cb575 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -581,10 +581,10 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr ) case 0: if( !bCharIns ) { - sal_Unicode nChar = (sal_Unicode)sParam.ToInt32(); - if( nChar ) + sal_Unicode cChar = (sal_Unicode)sParam.ToInt32(); + if( cChar ) { - pDoc->InsertString( *pPam, nChar ); + pDoc->InsertString( *pPam, rtl::OUString(cChar) ); bCharIns = sal_True; } } diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 81a7dd2a98c5..031a63e30583 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -3565,7 +3565,7 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc ) { pPam->GetPoint()->nContent--; nPos--; - aFtnNote.SetNumStr( pTxtNd->GetTxt().GetChar( nPos ) ); + aFtnNote.SetNumStr(rtl::OUString(pTxtNd->GetTxt().GetChar(nPos))); ((String&)pTxtNd->GetTxt()).SetChar( nPos, CH_TXTATR_INWORD ); bDelFirstChar = sal_True; } diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index b4d2e3fdc2a8..23ffe9a5a9ae 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -1074,7 +1074,7 @@ String SwFltShell::QuoteStr( const String& rIn ) SwFltShell& SwFltShell::operator << ( const sal_Unicode c ) { OSL_ENSURE( eSubMode != Style, "char insert while in style-mode"); - GetDoc().InsertString( *pPaM, c ); + GetDoc().InsertString( *pPaM, rtl::OUString(c) ); return *this; } diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx index 0a46f88ec661..b62e7845e669 100644 --- a/sw/source/filter/ww1/w1filter.cxx +++ b/sw/source/filter/ww1/w1filter.cxx @@ -844,7 +844,7 @@ oncemore: aStr.Erase(0, 1); if( !aFName.Len() ) break; - aFName.SearchAndReplaceAscii( "\\\\", String( '\\' )); + aFName.SearchAndReplaceAscii( "\\\\", rtl::OUString('\\') ); aFName = URIHelper::SmartRel2Abs( INetURLObject(rOut.GetBaseURL()), aFName ); diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index 0f733416bdf9..118ef9acf0c0 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -634,7 +634,7 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh, const Font& rFont = rFmt.GetBulletFont() ? *rFmt.GetBulletFont() : numfunc::GetDefBulletFont(); - String sNumStr = rFmt.GetBulletChar(); + String sNumStr = rtl::OUString(rFmt.GetBulletChar()); rtl_TextEncoding eChrSet = rFont.GetCharSet(); String sFontName = rFont.GetName(); diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 041f7184330c..3b4de1e1d61f 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -253,7 +253,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode ) bool bIsNotDuplicate = aRes.second; //.second is false when element already existed nPictureId = aRes.first->second; Set_UInt32(pDataAdr, nPictureId); - String sStorageName( '_' ); + String sStorageName = rtl::OUString('_'); sStorageName += String::CreateFromInt32( nPictureId ); SvStorageRef xOleStg = xObjStg->OpenSotStorage( sStorageName, STREAM_READWRITE| STREAM_SHARE_DENYALL ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 78ff6bef1c0c..f00e78470cf6 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2227,7 +2227,7 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect ) if( rStyles.Len() ) { xub_StrLen nPos = 0; - String sLvl( ',' ); + String sLvl = rtl::OUString(','); sLvl += String::CreateFromInt32( n + 1 ); do { String sStyle( rStyles.GetToken( 0, @@ -2685,7 +2685,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField ) case DI_CUSTOM: eFld = ww::eDOCPROPERTY; { - static String sQuotes('\"'); + rtl::OUString sQuotes('\"'); const SwDocInfoField * pDocInfoField = dynamic_cast<const SwDocInfoField *> (pFld); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 1c350b22490f..a85e4985fb45 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -945,11 +945,11 @@ OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(String &rString, WW8_CP nS InsertAttrsAsDrawingAttrs(nStartCp, nEndCp, eType); //Annotations typically begin with a (useless) 0x5 - if ((eType == MAN_AND) && mpDrawEditEngine->GetTextLen()) - { - ESelection aFirstChar(0, 0, 0, 1); - if (mpDrawEditEngine->GetText( aFirstChar ) == String(sal_Unicode(0x5))) - mpDrawEditEngine->QuickDelete(aFirstChar); + if ((eType == MAN_AND) && mpDrawEditEngine->GetTextLen()) + { + ESelection aFirstChar(0, 0, 0, 1); + if (comphelper::string::equals(mpDrawEditEngine->GetText( aFirstChar ), 0x5)) + mpDrawEditEngine->QuickDelete(aFirstChar); } EditTextObject* pTemporaryText = mpDrawEditEngine->CreateTextObject(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index d804eeeb7760..f813a10e0526 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2934,7 +2934,7 @@ bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, { for(sal_uInt16 nCh = 0; nCh < nEnd - rPos; ++nCh) { - rDoc.InsertString( *pPaM, cSymbol ); + rDoc.InsertString( *pPaM, rtl::OUString(cSymbol) ); } pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_FONT ); } @@ -3075,13 +3075,13 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) bRet = HandlePageBreakChar(); break; case 0x1e: // Non-breaking hyphen - rDoc.InsertString( *pPaM, CHAR_HARDHYPHEN ); + rDoc.InsertString( *pPaM, rtl::OUString(CHAR_HARDHYPHEN) ); break; case 0x1f: // Non-required hyphens - rDoc.InsertString( *pPaM, CHAR_SOFTHYPHEN ); + rDoc.InsertString( *pPaM, rtl::OUString(CHAR_SOFTHYPHEN) ); break; case 0xa0: // Non-breaking spaces - rDoc.InsertString( *pPaM, CHAR_HARDBLANK ); + rDoc.InsertString( *pPaM, rtl::OUString(CHAR_HARDBLANK) ); break; case 0x1: /* @@ -3567,7 +3567,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage, m_aExtraneousParas(rD), maInsertedTables(rD), maSectionNameGenerator(rD, rtl::OUString("WW")), - maGrfNameGenerator(bNewDoc,String('G')), + maGrfNameGenerator(bNewDoc, rtl::OUString('G')), maParaStyleMapper(rD), maCharStyleMapper(rD), maTxtNodesHavingFirstLineOfstSet(), // #i103711# diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 5e7f1aca5520..4a68b7bc5058 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -351,7 +351,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, long nX=0, nY=0; // nX, nY is graphic size bool bOleOk = true; - String aSrcStgName = '_'; + String aSrcStgName = rtl::OUString('_'); // ergibt Name "_4711" aSrcStgName += String::CreateFromInt32( nObjLocFc ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 1377713a4382..bffc2409c1a4 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -432,8 +432,8 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) void SwWW8ImplReader::ConvertFFileName( String& rName, const String& rOrg ) { rName = rOrg; - rName.SearchAndReplaceAllAscii( "\\\\", String( '\\' )); - rName.SearchAndReplaceAllAscii( "%20", String( ' ' )); + rName.SearchAndReplaceAllAscii( "\\\\", rtl::OUString( '\\' )); + rName.SearchAndReplaceAllAscii( "%20", rtl::OUString( ' ' )); // ggfs. anhaengende Anfuehrungszeichen entfernen if( rName.Len() && '"' == rName.GetChar( rName.Len()-1 )) @@ -762,7 +762,7 @@ sal_uInt16 SwWW8ImplReader::End_Field() if ( maFieldStack.back().mnObjLocFc > 0 ) { // Store the OLE object as an internal link - String sOleId = '_'; + String sOleId = rtl::OUString('_'); sOleId += String::CreateFromInt32( maFieldStack.back().mnObjLocFc ); SvStorageRef xSrc0 = pStg->OpenSotStorage(rtl::OUString(SL::aObjectPool)); @@ -2002,7 +2002,7 @@ eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, String& rStr ) NewAttr(aSz); } - rDoc.InsertString(*pPaM, cChar); + rDoc.InsertString(*pPaM, rtl::OUString(cChar)); if (nSize > 0) pCtrlStck->SetAttr(*pPaM->GetPoint(), RES_CHRATR_FONTSIZE); @@ -2265,7 +2265,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, String& rStr) aVText += aReadParam.GetResult(); if (bNewVText) { - bBracket = aVText.EqualsIgnoreCaseAscii('[', 1, 0) + bBracket = aVText.EqualsIgnoreCaseAscii(rtl::OUString('['), 1, 0) ? true : false; bNewVText = false; } @@ -2542,7 +2542,7 @@ void SwWW8ImplReader::Read_SubF_Combined( _ReadFieldParams& rReadParam) { String sCombinedCharacters; if ((-2 == rReadParam.SkipToNextToken()) && - rReadParam.GetResult().EqualsIgnoreCaseAscii('(', 1, 0)) + rReadParam.GetResult().EqualsIgnoreCaseAscii(rtl::OUString('('), 1, 0)) { for (int i=0;i<2;i++) { @@ -2552,8 +2552,8 @@ void SwWW8ImplReader::Read_SubF_Combined( _ReadFieldParams& rReadParam) if (-2 != rReadParam.SkipToNextToken()) break; String sF = rReadParam.GetResult(); - if ((('u' == cChar) && sF.EqualsIgnoreCaseAscii('p', 1, 0)) - || (('d' == cChar) && sF.EqualsIgnoreCaseAscii('o', 1, 0))) + if ((('u' == cChar) && sF.EqualsIgnoreCaseAscii(rtl::OUString('p'), 1, 0)) + || (('d' == cChar) && sF.EqualsIgnoreCaseAscii(rtl::OUString('o'), 1, 0))) { if (-2 == rReadParam.SkipToNextToken()) { @@ -2623,7 +2623,7 @@ void SwWW8ImplReader::Read_SubF_Ruby( _ReadFieldParams& rReadParam) if ('u' == nRet) { if (-2 == rReadParam.SkipToNextToken() && - (rReadParam.GetResult().EqualsIgnoreCaseAscii('p', 1, 0))) + (rReadParam.GetResult().EqualsIgnoreCaseAscii(rtl::OUString('p'), 1, 0))) { if (-2 == rReadParam.SkipToNextToken()) { diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 7ab5756ac084..60fdf2a70907 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -1156,7 +1156,7 @@ String lcl_GenerateFldTypeName(OUString sPrefix, SwTableNode* pTableNode) if (sPrefixStr.Len() == 0) { - sPrefixStr = String('_'); + sPrefixStr = rtl::OUString('_'); } // increase count until we find a name that is not yet taken diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index 66819aaa1ed5..55989b850ddb 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -375,10 +375,11 @@ void SwModule::InsertLab(SfxRequest& rReq, sal_Bool bLabel) { SwSectionData aSect(FILE_LINK_SECTION, pSh->GetUniqueSectionName()); - String sLinkName(sfx2::cTokenSeperator); - sLinkName += sfx2::cTokenSeperator; - sLinkName += rtl::OUString(MASTER_LABEL); - aSect.SetLinkFileName(sLinkName); + rtl::OUStringBuffer sLinkName; + sLinkName.append(sfx2::cTokenSeperator); + sLinkName.append(sfx2::cTokenSeperator); + sLinkName.append(MASTER_LABEL); + aSect.SetLinkFileName(sLinkName.makeStringAndClear()); aSect.SetProtectFlag(true); pSh->Insert(aDotStr); // Dummytext to allocate the Section pSh->SttDoc(); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 9f64bfae107e..0c4bec127673 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1066,7 +1066,7 @@ void SwDocShell::Execute(SfxRequest& rReq) EnableSetModified( sal_False ); WriterRef xWrt; // mba: looks as if relative URLs don't make sense here - ::GetRTFWriter( 'O', String(), xWrt ); + ::GetRTFWriter( rtl::OUString('O'), rtl::OUString(), xWrt ); SvMemoryStream *pStrm = new SvMemoryStream(); pStrm->SetBufferSize( 16348 ); SwWriter aWrt( *pStrm, *GetDoc() ); diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 344f684f3fde..8276247910f6 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -316,7 +316,7 @@ sal_uInt16 lcl_FindName(const SwPoolFmtList& rLst, SfxStyleFamily eFam, { if(!rLst.empty()) { - String sSrch( ' ' ); + String sSrch = rtl::OUString(' '); switch( eFam ) { case SFX_STYLE_FAMILY_CHAR: sSrch = cCHAR; break; @@ -361,7 +361,7 @@ sal_Bool FindPhyStyle( SwDoc& rDoc, const String& rName, SfxStyleFamily eFam ) void SwPoolFmtList::Append( char cChar, const String& rStr ) { - String aStr(cChar); + String aStr = rtl::OUString(cChar); aStr += rStr; for(std::vector<String>::const_iterator i = begin(); i != end(); ++i) if(*i == aStr) diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx index 4de3bca3d465..2910585b4df5 100644 --- a/sw/source/ui/cctrl/actctrl.cxx +++ b/sw/source/ui/cctrl/actctrl.cxx @@ -73,7 +73,7 @@ void NoSpaceEdit::KeyInput(const KeyEvent& rEvt) sal_Bool bCallParent = sal_True; if(rEvt.GetCharCode()) { - String sKey = rEvt.GetCharCode(); + rtl::OUString sKey(rEvt.GetCharCode()); if( STRING_NOTFOUND != sForbiddenChars.Search(sKey)) bCallParent = sal_False; } diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 8866bec1fd54..a6f479d78cfb 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -183,7 +183,7 @@ String GetDefaultString(sal_uInt16 nChars) { String aStr; for (sal_uInt16 i = 0; i < nChars; i++) - aStr += String((char) (i + 65)); + aStr += rtl::OUString((char) (i + 65)); return aStr; } diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 0647b8d30936..1eb5afd236fe 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -409,7 +409,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) uno::Sequence<PropertyValue> aInfo(4); PropertyValue* pInfo = aInfo.getArray(); pInfo[0].Name = C2U("FieldDelimiter"); - pInfo[0].Value <<= OUString(String('\t')); + pInfo[0].Value <<= OUString('\t'); pInfo[1].Name = C2U("StringDelimiter"); pInfo[1].Value <<= OUString('"'); pInfo[2].Name = C2U("Extension"); diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 27fc513a297b..16b70229199b 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -575,10 +575,9 @@ void SwNewDBMgr::ImportDBEntry(SwWrtShell* pSh) else { // column not found -> show error - String sInsert = '?'; - sInsert += sColumn; - sInsert += '?'; - pSh->Insert(sInsert); + rtl::OUStringBuffer sInsert; + sInsert.append('?').append(sColumn).append('?'); + pSh->Insert(sInsert.makeStringAndClear()); } sColumn = lcl_FindColumn(sFormatStr, nUsedPos, nSeparator); } diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 5fc7ba5ff11b..5cde4aacbe74 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -517,7 +517,7 @@ void SwRestrictedComboBox::KeyInput(const KeyEvent& rEvt) sal_Bool bCallParent = sal_True; if(rEvt.GetCharCode()) { - String sKey = rEvt.GetCharCode(); + rtl::OUString sKey(rEvt.GetCharCode()); if( STRING_NOTFOUND != sForbiddenChars.Search(sKey)) bCallParent = sal_False; } @@ -1452,7 +1452,7 @@ void AddressMultiLineEdit::SetText( const String& rStr ) if(sPara.Len() && sPara.GetChar(sPara.Len() - 1) != ' ') { TextPaM aPaM(nPara, sPara.Len()); - pTextEngine->ReplaceText(TextSelection( aPaM ), String(' ')); + pTextEngine->ReplaceText(TextSelection( aPaM ), rtl::OUString(' ')); } while(true) { @@ -1596,7 +1596,7 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove) { TextPaM aTemp(nPara - 1, pTextEngine->GetTextLen( nPara - 1 )); - pTextEngine->ReplaceText( aTemp, String('\n')); + pTextEngine->ReplaceText( aTemp, rtl::OUString('\n')); } InsertNewEntryAtPosition( sCurrentItem, nPara, nIndex ); diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx index c74912e5cd21..52b93da9dfa1 100644 --- a/sw/source/ui/dbui/mmconfigitem.cxx +++ b/sw/source/ui/dbui/mmconfigitem.cxx @@ -421,7 +421,7 @@ void lcl_ConvertFromNumbers(OUString& rBlock, const ResStringArray& rHeaders) //convert the numbers used for the configuration to strings used for UI to numbers //doesn't use ReplaceAll to prevent expansion of numbers inside of the headers String sBlock(rBlock); - sBlock.SearchAndReplaceAllAscii("\\n", '\n'); + sBlock.SearchAndReplaceAllAscii("\\n", rtl::OUString('\n')); SwAddressIterator aGreetingIter(sBlock); sBlock.Erase(); while(aGreetingIter.HasMore()) diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index d4e346c218f8..7a0242ef595c 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -807,7 +807,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) pTargetView->GetWrtShell().EndAction(); //then save it String sOutPath = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); - String sCounter('_'); + String sCounter = rtl::OUString('_'); sCounter += String::CreateFromInt32(nDoc); sOutPath.Insert(sCounter, sOutPath.Len() - sExtension.Len() - 1); diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx index 64b3f60bbb19..5a01247ef5b0 100644 --- a/sw/source/ui/dialog/regionsw.cxx +++ b/sw/source/ui/dialog/regionsw.cxx @@ -165,7 +165,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) if(aFile.Len() || aSub.Len()) { - String sLinkFileName(sfx2::cTokenSeperator); + String sLinkFileName = rtl::OUString(sfx2::cTokenSeperator); sLinkFileName += sfx2::cTokenSeperator; sLinkFileName.SetToken(0, sfx2::cTokenSeperator,aFile); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index f2d1f47325df..4fd5a68a6077 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -2321,7 +2321,7 @@ KEYINPUT_CHECKTABLE_INSDEL: else if(!rSh.HasReadonlySel()) { sal_Bool bIsNormalChar = GetAppCharClass().isLetterNumeric( - String( aCh ), 0 ); + rtl::OUString( aCh ), 0 ); if( bAppendSpace && bIsNormalChar && (aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() )) { diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 2ffd91801bb3..c6bb14fecb14 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -564,7 +564,7 @@ void SwSrcEditWindow::InitScrollBars() pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() ); pHScrollbar->SetVisibleSize( aOutSz.Width() ); pHScrollbar->SetPageSize( aOutSz.Width() * 8 / 10 ); - pHScrollbar->SetLineSize( pOutWin->GetTextWidth( 'x' ) ); + pHScrollbar->SetLineSize( pOutWin->GetTextWidth(rtl::OUString('x')) ); pHScrollbar->SetThumbPos( pTextView->GetStartDocPos().X() ); } diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 76b49be137cb..af84a36e55e1 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -263,16 +263,17 @@ IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) IMPL_LINK_NOARG(SwEnvPage, FieldHdl) { - String aStr ( '<' ); - aStr += aDatabaseLB.GetSelectEntry(); - aStr += '.'; - aStr += aTableLB.GetSelectEntry(); - aStr += '.'; - aStr += aTableLB.GetEntryData(aTableLB.GetSelectEntryPos()) == 0 ? '0' : '1'; - aStr += '.'; - aStr += aDBFieldLB.GetSelectEntry(); - aStr += '>'; - aAddrEdit.ReplaceSelected(aStr); + rtl::OUStringBuffer aStr; + aStr.append('<'); + aStr.append(aDatabaseLB.GetSelectEntry()); + aStr.append('.'); + aStr.append(aTableLB.GetSelectEntry()); + aStr.append('.'); + aStr.append(aTableLB.GetEntryData(aTableLB.GetSelectEntryPos()) == 0 ? '0' : '1'); + aStr.append('.'); + aStr.append(aDBFieldLB.GetSelectEntry()); + aStr.append('>'); + aAddrEdit.ReplaceSelected(aStr.makeStringAndClear()); Selection aSel = aAddrEdit.GetSelection(); aAddrEdit.GrabFocus(); aAddrEdit.SetSelection(aSel); diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 25ca092ed5b5..4f816436f46d 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -380,16 +380,17 @@ IMPL_LINK( SwLabPage, DatabaseHdl, ListBox *, pListBox ) IMPL_LINK_NOARG(SwLabPage, FieldHdl) { - String aStr ( '<' ); - aStr += aDatabaseLB.GetSelectEntry(); - aStr += '.'; - aStr += aTableLB.GetSelectEntry(); - aStr += '.'; - aStr += aTableLB.GetEntryData(aTableLB.GetSelectEntryPos()) == 0 ? '0' : '1'; - aStr += '.'; - aStr += aDBFieldLB.GetSelectEntry(); - aStr += '>'; - aWritingEdit.ReplaceSelected(aStr); + rtl::OUStringBuffer aStr; + aStr.append('<'); + aStr.append(aDatabaseLB.GetSelectEntry()); + aStr.append('.'); + aStr.append(aTableLB.GetSelectEntry()); + aStr.append('.'); + aStr.append(aTableLB.GetEntryData(aTableLB.GetSelectEntryPos()) == 0 ? '0' : '1'); + aStr.append('.'); + aStr.append(aDBFieldLB.GetSelectEntry()); + aStr.append('>'); + aWritingEdit.ReplaceSelected(aStr.makeStringAndClear()); Selection aSel = aWritingEdit.GetSelection(); aWritingEdit.GrabFocus(); aWritingEdit.SetSelection(aSel); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index a83adb2c7a6e..4c1094c27a0c 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -97,7 +97,7 @@ SwLabPreview::SwLabPreview( const SwLabFmtPage* pParent, const ResId& rResID ) : lPWidthWidth = GetTextWidth(aPWidthStr); lPHeightWidth = GetTextWidth(aPHeightStr); lXHeight = GetTextHeight(); - lXWidth = GetTextWidth('X'); + lXWidth = GetTextWidth(rtl::OUString('X')); // Scale factor float fx = (float)(lOutWPix - (2 * (lLeftWidth + 15))) / (float)lOutWPix; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index f7050da7e8a1..b277d888b3cb 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -693,7 +693,7 @@ bool SwMailMergeDlg::ExecQryShell() URIHelper::SmartRel2Abs( aAbs, aPathED.GetText(), URIHelper::GetMaybeFileHdl())); pModOpt->SetMailingPath(sPath); - String sDelim(INET_PATH_TOKEN); + String sDelim = rtl::OUString(INET_PATH_TOKEN); if (sPath.Len() >= sDelim.Len() && sPath.Copy(sPath.Len()-sDelim.Len()).CompareTo(sDelim) != COMPARE_EQUAL) diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 710fde8e92de..2d30341a09b4 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1271,7 +1271,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData ) if (nLevel != 0x7f && cSeparator == 0) cSeparator = '.'; - pTyp->SetDelimiter(cSeparator); + pTyp->SetDelimiter(rtl::OUString(cSeparator)); SwSetExpField* pExpFld = new SwSetExpField(pTyp, rData.sPar2, nFormatId); bExp = sal_True; pFld = pExpFld; diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 0cab6a9b8414..da07f5ff2292 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -186,7 +186,7 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str { aReq.AppendItem(SfxStringItem(FN_INSERT_FIELD, rPar1)); aReq.AppendItem(SfxStringItem - (FN_PARAM_3,String(cSeparator))); + (FN_PARAM_3, rtl::OUString(cSeparator))); aReq.AppendItem(SfxUInt16Item(FN_PARAM_FIELD_SUBTYPE, nSubType)); } aReq.AppendItem(SfxUInt16Item(FN_PARAM_FIELD_TYPE , nTypeId)); @@ -257,7 +257,7 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str { SwSetExpFieldType* pTyp = (SwSetExpFieldType*)pTmpFld->GetTyp(); pTyp->SetOutlineLvl( static_cast< sal_uInt8 >(nSubType & 0xff)); - pTyp->SetDelimiter(cSeparator); + pTyp->SetDelimiter(rtl::OUString(cSeparator)); nSubType = nsSwGetSetExpType::GSE_SEQ; } diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index c6477bbbce6f..e7e0ae701f43 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -1217,7 +1217,7 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& ) else { nSubType--; - String sSeparator(aSeparatorED.GetText().GetChar(0)); + String sSeparator = rtl::OUString(aSeparatorED.GetText().GetChar(0)); cSeparator = sSeparator.Len() ? sSeparator.GetChar(0) : ' '; } break; diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 039d2be03280..65ae8f3d7de5 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -909,7 +909,7 @@ void SwColumnPage::UpdateCols() void SwColumnPage::SetLabels( sal_uInt16 nVis ) { - String sLbl( '~' ); + rtl::OUString sLbl( '~' ); String sLbl2( String::CreateFromInt32( nVis + 1 )); String tmp1(sLbl2); diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index 535495ff3163..967c494dd705 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -537,14 +537,14 @@ void SwSequenceOptionDialog::Apply() sal_Bool bUpdate = sal_True; if( pFldType ) { - pFldType->SetDelimiter( cDelim ); + pFldType->SetDelimiter( rtl::OUString(cDelim) ); pFldType->SetOutlineLvl( nLvl ); } else if( aFldTypeName.Len() && nLvl < MAXLEVEL ) { // then we have to insert that SwSetExpFieldType aFldType( rSh.GetDoc(), aFldTypeName, nsSwGetSetExpType::GSE_SEQ ); - aFldType.SetDelimiter( cDelim ); + aFldType.SetDelimiter( rtl::OUString(cDelim) ); aFldType.SetOutlineLvl( nLvl ); rSh.InsertFldType( aFldType ); } @@ -582,7 +582,8 @@ long SwCaptionDialog::CategoryBox::PreNotify( NotifyEvent& rNEvt ) if(nTmpCode != KEY_BACKSPACE && nTmpCode != KEY_RETURN && nTmpCode != KEY_TAB && nTmpCode != KEY_ESCAPE) { - String sKey( pEvent->GetCharCode() ), sName( GetText() ); + rtl::OUString sKey( pEvent->GetCharCode() ); + String sName( GetText() ); Selection aSel( GetSelection() ); aSel.Justify(); if( aSel.Len() ) diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 942a7a44beca..4be8d2f34d03 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -451,7 +451,7 @@ SwTOXDescription& SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType) rSh.GetFldType(RES_AUTHORITY, aEmptyStr); if(pFType) { - String sBrackets(pFType->GetPrefix()); + String sBrackets = rtl::OUString(pFType->GetPrefix()); sBrackets += pFType->GetSuffix(); pDescArr[nIndex]->SetAuthBrackets(sBrackets); pDescArr[nIndex]->SetAuthSequence(pFType->IsSequence()); @@ -1810,7 +1810,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt ) { sal_uInt16 nLevel = static_cast< sal_uInt16 >(GetModel()->GetAbsPos(pEntry)); String sEntry = pParent->GetLevelHelp(++nLevel); - if('*' == sEntry) + if (comphelper::string::equals(sEntry, '*')) sEntry = GetEntryText(pEntry); if(sEntry.Len()) { @@ -1974,10 +1974,10 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(Window* pParent, const SfxItemSet& rAttrSet aSortDocPosRB.Check(); aFillCharCB.SetMaxTextLen(1); - aFillCharCB.InsertEntry(' '); - aFillCharCB.InsertEntry('.'); - aFillCharCB.InsertEntry('-'); - aFillCharCB.InsertEntry('_'); + aFillCharCB.InsertEntry(rtl::OUString(' ')); + aFillCharCB.InsertEntry(rtl::OUString('.')); + aFillCharCB.InsertEntry(rtl::OUString('-')); + aFillCharCB.InsertEntry(rtl::OUString('_')); aButtonPositions[0] = aEntryNoPB.GetPosPixel(); aButtonPositions[1] = aEntryPB.GetPosPixel(); @@ -2590,7 +2590,7 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken) { aTabPosMF.SetValue(aTabPosMF.Normalize(pToken->nTabStopPosition), FUNIT_TWIP); aAutoRightCB.Check(SVX_TAB_ADJUST_END == pToken->eTabAlign); - aFillCharCB.SetText(pToken->cTabFillChar); + aFillCharCB.SetText(rtl::OUString(pToken->cTabFillChar)); aTabPosFT.Enable(!aAutoRightCB.IsChecked()); aTabPosMF.Enable(!aAutoRightCB.IsChecked()); } @@ -4068,7 +4068,6 @@ void SwEntryBrowseBox::InitController( void SwEntryBrowseBox::ReadEntries(SvStream& rInStr) { AutoMarkEntry* pToInsert = 0; - const String sZero('0'); rtl_TextEncoding eTEnc = osl_getThreadTextEncoding(); while( !rInStr.GetError() && !rInStr.IsEof() ) { @@ -4095,10 +4094,10 @@ void SwEntryBrowseBox::ReadEntries(SvStream& rInStr) pToInsert->sSecKey = sLine.GetToken(0, ';', nSttPos ); String sStr = sLine.GetToken(0, ';', nSttPos ); - pToInsert->bCase = sStr.Len() && sStr != sZero; + pToInsert->bCase = sStr.Len() && !comphelper::string::equals(sStr, '0'); sStr = sLine.GetToken(0, ';', nSttPos ); - pToInsert->bWord = sStr.Len() && sStr != sZero; + pToInsert->bWord = sStr.Len() && !comphelper::string::equals(sStr, '0'); aEntryArr.push_back( pToInsert ); pToInsert = 0; @@ -4136,7 +4135,7 @@ void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr) AutoMarkEntry* pEntry = &aEntryArr[i]; if(pEntry->sComment.Len()) { - String sWrite('#'); + String sWrite = rtl::OUString('#'); sWrite += pEntry->sComment; rOutStr.WriteByteStringLine( sWrite, eTEnc ); } diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 0f2b3e773d95..5b20d5e8ec7d 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -249,7 +249,7 @@ long BookmarkCombo::PreNotify( NotifyEvent& rNEvt ) if( EVENT_KEYINPUT == rNEvt.GetType() && rNEvt.GetKeyEvent()->GetCharCode() ) { - String sKey( rNEvt.GetKeyEvent()->GetCharCode() ); + rtl::OUString sKey( rNEvt.GetKeyEvent()->GetCharCode() ); if(STRING_NOTFOUND != aForbiddenChars.Search(sKey)) nHandled = 1; } diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 2cbb826d9c55..376aab2abbd9 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -109,7 +109,7 @@ String lcl_GetValidShortCut( const String& rName ) while( rName.GetChar( nStart-1 ) == ' ' && nStart < nSz ) nStart++; - String aBuf( rName.GetChar( nStart-1 )); + String aBuf = rtl::OUString(rName.GetChar(nStart-1)); for( ; nStart < nSz; ++nStart ) { diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 41e00c591bad..cd32e693e8ee 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -888,7 +888,7 @@ sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev, aFont.SetSize(rSize); aFont.SetTransparent(sal_True); pVDev->SetFont( aFont ); - String aText(rFmt.GetBulletChar()); + rtl::OUString aText(rFmt.GetBulletChar()); pVDev->DrawText( Point(nXStart, nYStart), aText ); sal_uInt16 nRet = (sal_uInt16)pVDev->GetTextWidth(aText); @@ -1042,7 +1042,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE ) { pVDev->SetFont(aStdFont); - String aText(' '); + rtl::OUString aText(' '); pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText); } diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 59936afce4ae..7841c7085a8d 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -250,7 +250,7 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) : aDelimTabRB.Check(cDeli == '\t'); if(!aDelimTabRB.IsChecked()) { - aDelimEdt.SetText(cDeli); + aDelimEdt.SetText(rtl::OUString(cDeli)); aDelimFreeRB.Check(sal_True); DelimHdl(&aDelimFreeRB); } @@ -416,7 +416,7 @@ IMPL_LINK_NOARG(SwSortDlg, DelimCharHdl) { SFX_ITEMSET_ARG( pMap->GetOutputItemSet(), pItem, SfxInt32Item, SID_ATTR_CHAR, sal_False ); if ( pItem ) - aDelimEdt.SetText( sal_Unicode ( pItem->GetValue() ) ); + aDelimEdt.SetText( rtl::OUString(pItem->GetValue()) ); } delete pMap; diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index c59dab2a96eb..838089875998 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -232,7 +232,7 @@ void SwInputWindow::ShowWin() // Formel soll immer mit einem "=" beginnen, hier // also setzen - String sEdit( '=' ); + String sEdit = rtl::OUString('='); if( pMgr->GetCurFld() && TYP_FORMELFLD == pMgr->GetCurTypeId() ) { sEdit += pMgr->GetCurFldPar2(); @@ -476,7 +476,7 @@ IMPL_LINK( SwInputWindow, SelTblCellsNotify, SwWrtShell *, pCaller ) void SwInputWindow::SetFormula( const String& rFormula, sal_Bool bDelFlag ) { - String sEdit( '=' ); + String sEdit = rtl::OUString('='); if( rFormula.Len() ) { if( '=' == rFormula.GetChar( 0 ) ) @@ -567,9 +567,9 @@ void InputEdit::UpdateRange(const String& rBoxes, const sal_uInt16 nLen = aActText.Len(); if( !nLen ) { - String aStr(cOpen); - aStr += aBoxes; - aStr += cClose; + String aStr = rtl::OUStringBuffer(). + append(cOpen).append(aBoxes).append(cClose). + makeStringAndClear(); SetText(aStr); sal_uInt16 nPos = aStr.Search( cClose ); OSL_ENSURE(nPos < aStr.Len(), "delimiter not found"); @@ -619,12 +619,12 @@ void InputEdit::UpdateRange(const String& rBoxes, } else { - String aTmp( (char)cOpen ); - aTmp += aBoxes; - aTmp += (char)cClose; + rtl::OUString aTmp = rtl::OUStringBuffer(). + append(cOpen).append(aBoxes).append(cClose). + makeStringAndClear(); nPos = (sal_uInt16)aSelection.Min(); aActText.Insert( aTmp, nPos ); - nPos = nPos + aTmp.Len(); + nPos = nPos + aTmp.getLength(); } if( GetText() != aActText ) { diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 5f9e7d3f9d9d..5e56906a7160 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -348,7 +348,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - pOLV->InsertText( String(cIns)); + pOLV->InsertText( rtl::OUString(cIns)); rReq.Done(); break; } diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 8d63e469a5c3..c10d28f79cf9 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -859,7 +859,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if( SfxRequest::HasMacroRecorder(pViewFrame) ) { SfxRequest aReq( pViewFrame, nSlot); - aReq.AppendItem( SfxStringItem( FN_PARAM_1, String(cDelim) )); + aReq.AppendItem( SfxStringItem( FN_PARAM_1, rtl::OUString(cDelim) )); if(bToTable) { if(pTAFmt) diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index eb8751514dfa..82c6bee50660 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -428,7 +428,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - pOLV->InsertText( String(cIns)); + pOLV->InsertText( rtl::OUString(cIns)); rReq.Done(); } break; diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index d5eea66d6296..c6a55883f5d2 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -163,7 +163,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case FN_INSERT_SOFT_HYPHEN: if( CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( sal_True, 0 ) && CHAR_SOFTHYPHEN != rSh.SwCrsrShell::GetChar( sal_True, -1 )) - rSh.Insert( String( CHAR_SOFTHYPHEN ) ); + rSh.Insert( rtl::OUString( CHAR_SOFTHYPHEN ) ); break; case FN_INSERT_HARDHYPHEN: @@ -180,7 +180,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) ChgToEnEmDash | SetINetAttr | Autocorrect )) rSh.AutoCorrect( *pACorr, cIns ); else - rSh.Insert( String( cIns ) ); + rSh.Insert( rtl::OUString( cIns ) ); } break; case SID_INSERT_RLM : @@ -196,7 +196,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break; case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break; } - rSh.Insert( String( cIns ) ); + rSh.Insert( rtl::OUString( cIns ) ); } break; case FN_INSERT_BREAK: diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index 332591f99d9c..fa86fd27ae7b 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -168,7 +168,7 @@ SwConvertTableDlg::SwConvertTableDlg( SwView& rView, bool bToTable ) case 3: aOtherBtn.Check(); if(uOther) - aOtherEd.SetText(uOther); + aOtherEd.SetText(rtl::OUString(uOther)); break; } diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 234827ac7f93..411337c86e98 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -32,6 +32,7 @@ #endif #include <hintids.hxx> +#include <comphelper/string.hxx> #include <vcl/msgbox.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> @@ -919,7 +920,7 @@ IMPL_LINK( SwTableColumnPage, AutoClickHdl, CheckBox *, pBox ) } for( sal_uInt16 i = 0; (i < nNoOfVisibleCols ) && ( i < MET_FIELDS); i++ ) { - String sEntry('~'); + String sEntry = rtl::OUString('~'); String sIndex = String::CreateFromInt32( aValueTbl[i] + 1 ); sEntry += sIndex; pTextArr[i]->SetText( sEntry ); @@ -1446,7 +1447,7 @@ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet ) sal_uInt16 nPgNum = static_cast< sal_uInt16 >(aPageNoNF.GetValue()); if ( !pDesc || !pDesc->GetPageDesc() || ( pDesc->GetPageDesc() && ((pDesc->GetPageDesc()->GetName() != sPage) || - aPageNoNF.GetSavedValue() != (String)nPgNum))) + !comphelper::string::equals(aPageNoNF.GetSavedValue(), nPgNum)))) { SwFmtPageDesc aFmt( pShell->FindPageDescByName( sPage, sal_True ) ); aFmt.SetNumOffset(bState ? nPgNum : 0); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 0799925cbdc1..bcad2aee9471 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -705,7 +705,7 @@ sal_Int32 SwSrcView::PrintSource( // nLinepPage stimmt nicht, wenn Zeilen umgebrochen werden muessen... sal_uInt16 nLinespPage = (sal_uInt16) (aPaperSz.Height() / nLineHeight); - sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pOutDev->GetTextWidth( 'X' )); + sal_uInt16 nCharspLine = (sal_uInt16) (aPaperSz.Width() / pOutDev->GetTextWidth(rtl::OUString('X'))); sal_uInt16 nParas = static_cast< sal_uInt16 >( pTextEngine->GetParagraphCount() ); sal_uInt16 nPages = (sal_uInt16) (nParas / nLinespPage + 1 ); diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index bdcc408ea5e4..ba871a79fe7f 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -738,7 +738,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( aURLObj.SetSmartURL( aCurOutputURL ); String aPath = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); - String aDelim( INET_PATH_TOKEN ); + String aDelim = rtl::OUString(INET_PATH_TOKEN); if (aPath.Len() >= aDelim.Len() && aPath.Copy( aPath.Len()-aDelim.Len() ).CompareTo( aDelim ) != COMPARE_EQUAL) aPath += aDelim; diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 3f1028656c7c..d62ef84e32be 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3283,7 +3283,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName) if(!pxDoc) throw RuntimeException(); String sToCompare(rName); - String sSuffix('|'); + String sSuffix = rtl::OUString('|'); if(sToCompare == sTables) { sSuffix += rtl::OUString::createFromAscii(pMarkToTable); @@ -3498,7 +3498,7 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void) sal_uInt16 nOutlineCount = rOutlineNodes.Count(); aRet.realloc(nOutlineCount); OUString* pResArr = aRet.getArray(); - String sSuffix('|'); + String sSuffix = rtl::OUString('|'); sSuffix += rtl::OUString::createFromAscii(pMarkToOutline); const SwNumRule* pOutlRule = pDoc->GetOutlineNumRule(); for (sal_uInt16 i = 0; i < nOutlineCount; ++i) diff --git a/sw/source/ui/utlui/prcntfld.cxx b/sw/source/ui/utlui/prcntfld.cxx index 4bfc06b9fbd7..bf7c76e44d7c 100644 --- a/sw/source/ui/utlui/prcntfld.cxx +++ b/sw/source/ui/utlui/prcntfld.cxx @@ -43,7 +43,7 @@ PercentField::PercentField( Window* pWin, const ResId& rResId ) : nOldSpinSize = GetSpinSize(); nRefValue = DenormalizePercent(MetricField::GetMax(FUNIT_TWIP)); nOldDigits = GetDecimalDigits(); - SetCustomUnitText('%'); + SetCustomUnitText(rtl::OUString('%')); } void PercentField::SetRefValue(sal_Int64 nValue) diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 3934bd5c75d5..2de18edd448f 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -941,7 +941,7 @@ void SwWrtShell::InsertLineBreak() if( pACorr ) AutoCorrect( *pACorr, cIns ); else - SwWrtShell::Insert( String( cIns ) ); + SwWrtShell::Insert( rtl::OUString( cIns ) ); } } /*------------------------------------------------------------------------ diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index c5d83adea2a0..822d82246211 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -126,7 +126,7 @@ sal_Int16 VCLXFont::getCharWidth( sal_Unicode c ) throw(::com::sun::star::uno::R pOutDev->SetFont( maFont ); nRet = sal::static_int_cast< sal_Int16 >( - pOutDev->GetTextWidth( String(c) )); + pOutDev->GetTextWidth( rtl::OUString(c) )); pOutDev->SetFont( aOldFont ); } @@ -150,7 +150,7 @@ sal_Int16 VCLXFont::getCharWidth( sal_Unicode c ) throw(::com::sun::star::uno::R { aSeq.getArray()[n] = sal::static_int_cast< sal_Int16 >( pOutDev->GetTextWidth( - String(static_cast< sal_Unicode >(nFirst+n)) )); + rtl::OUString(static_cast< sal_Unicode >(nFirst+n)) )); } pOutDev->SetFont( aOldFont ); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index adeaf5ca6ddf..8c47e2c51555 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2880,7 +2880,7 @@ Size Edit::CalcSize( xub_StrLen nChars ) const { // width for N characters, independent from content. // works only correct for fixed fonts, average otherwise - Size aSz( GetTextWidth( XubString( 'x' ) ), GetTextHeight() ); + Size aSz( GetTextWidth( rtl::OUString('x') ), GetTextHeight() ); aSz.Width() *= nChars; aSz = CalcWindowSize( aSz ); return aSz; @@ -2892,7 +2892,7 @@ xub_StrLen Edit::GetMaxVisChars() const { const Window* pW = mpSubEdit ? mpSubEdit : this; long nOutWidth = pW->GetOutputSizePixel().Width(); - long nCharWidth = GetTextWidth( XubString( 'x' ) ); + long nCharWidth = GetTextWidth( rtl::OUString('x') ); return nCharWidth ? (xub_StrLen)(nOutWidth/nCharWidth) : 0; } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index d0bb734309a3..bf12e2d1c0b6 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1400,7 +1400,7 @@ Size ListBox::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const // Breite if ( nColumns ) - aSz.Width() = nColumns * GetTextWidth( XubString( 'X' ) ); + aSz.Width() = nColumns * GetTextWidth( rtl::OUString('X') ); else aSz.Width() = aMinSz.Width(); diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index acc466a323fe..f6d96be1f417 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -421,7 +421,7 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Uni xCharClass = vcl::unohelper::CreateCharacterClassification(); const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale(); - cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0]; + cCharCode = xCharClass->toUpper( rtl::OUString(cCharCode), 0, 1, rLocale )[0]; if ( i < nFormEnd ) pWindow = ImplGetNextWindow( pParent, i, i, sal_True ); @@ -434,7 +434,7 @@ static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Uni while ( nPos != STRING_NOTFOUND ) { cCompareChar = aStr.GetChar( nPos+1 ); - cCompareChar = xCharClass->toUpper( String(cCompareChar), 0, 1, rLocale )[0]; + cCompareChar = xCharClass->toUpper( rtl::OUString(cCompareChar), 0, 1, rLocale )[0]; if ( cCompareChar == cCharCode ) { // Bei Static-Controls auf das naechste Controlm weiterschalten diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 8f3e296fa567..ad1d867b3fd8 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -265,7 +265,7 @@ void MessBox::ImplPosControls() rtl::OUString aTabStr(" "); sal_uInt16 nIndex = 0; while ( nIndex != STRING_NOTFOUND ) - nIndex = aMessText.SearchAndReplace( '\t', aTabStr, nIndex ); + nIndex = aMessText.SearchAndReplace( rtl::OUString('\t'), aTabStr, nIndex ); // Wenn Fenster zu schmall, machen wir Dialog auch breiter if ( mpWindowImpl->mbFrame ) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 83a3491f3ede..9b2bcb708192 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1155,13 +1155,13 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl( XML_STYLE_FAMILY_TEXT_PARAGRAPH, GetXMLToken( XML_PARAGRAPH ), mxExpPropMapper.get(), - String( 'P' )); + rtl::OUString( 'P' )); // register text family also for shapes mrAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, GetXMLToken( XML_TEXT ), mxExpPropMapper.get(), - String( 'T' )); + rtl::OUString( 'T' )); } SchXMLExportHelper_Impl::~SchXMLExportHelper_Impl() diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index c4f93608ba15..896f2336f6ba 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <comphelper/string.hxx> #include <svl/svstdarr.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> @@ -1435,7 +1436,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt } break; case NF_SYMBOLTYPE_DEL: - if ( pElemStr && *pElemStr == XubString('@') ) + if ( pElemStr && comphelper::string::equals(*pElemStr, '@') ) { WriteTextContentElement_Impl(); bAnyContent = sal_True; |