diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-12 13:40:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-13 11:20:23 +0100 |
commit | 6191fa0847ac5b27083efe1a8c6cd84d080a638c (patch) | |
tree | b107ce00125d0d204e5c32f6c472e70c73182bb2 | |
parent | 2e16eaf31c7a4849110020aebd5fbc97a1ab3e99 (diff) |
reduce use of UniString ctor from null-terminated unicodearray
Change-Id: I98361309ada084d8f78517ce88f210d785f59cc0
39 files changed, 93 insertions, 105 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index af93adee99af..5aecb53318de 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -480,12 +480,9 @@ String SbiImage::GetString( short nId ) const } } else - { - String aStr( pStr ); - return aStr; - } + return rtl::OUString(pStr); } - return String(); + return rtl::OUString(); } const SbxObject* SbiImage::FindType (String aTypeName) const diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index 7fe4f6777641..b8912983aaca 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -153,7 +153,7 @@ static SbxVariable* Operand { // A number could be scanned in directly! sal_uInt16 nLen; - if( !refVar->Scan( XubString( p ), &nLen ) ) + if( !refVar->Scan( rtl::OUString( p ), &nLen ) ) refVar.Clear(); else p += nLen; diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index b7f61ed89ba5..f47f697840a3 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -504,11 +504,11 @@ String OFlatTable::getEntry() } xDir->beforeFirst(); // move back to before first record } - catch(Exception&) + catch(const Exception&) { OSL_ASSERT(0); } - return sURL.getStr(); + return sURL; } // ------------------------------------------------------------------------- void OFlatTable::refreshColumns() diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 8dc87a9af6ff..3a8b0757968a 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -535,7 +535,7 @@ SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, ::rtl::OUString languag // must be a neater way to deal with the strings than as above // append the language to the dialog title String winTitle( GetText() ); - winTitle.SearchAndReplace( String::CreateFromAscii( "%MACROLANG" ), language.pData->buffer ); + winTitle.SearchAndReplace( String::CreateFromAscii( "%MACROLANG" ), m_sLanguage ); SetText( winTitle ); aScriptsBox.SetSelectHdl( LINK( this, SvxScriptOrgDialog, ScriptSelectHdl ) ); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 9db7af8bbba6..9ceb555d3328 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 } ::rtl::OUString aName; xProp->getPropertyValue(PROPERTY_COMMAND) >>= aName; - String sObject(aName.getStr()); + String sObject(aName); sTitle.SearchAndReplace('#',sObject); aReturn.sTitle = sTitle; @@ -2873,7 +2873,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven SvLBoxEntry* pContainer = getEntryFromContainer(xNames); if ( pContainer ) { // a query or table has been removed - String aName = ::comphelper::getString(_rEvent.Accessor).getStr(); + String aName = ::comphelper::getString(_rEvent.Accessor); if ( isCurrentlyDisplayedChanged( aName, pContainer) ) { // the element displayed currently has been replaced @@ -2924,7 +2924,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve SvLBoxEntry* pContainer = getEntryFromContainer(xNames); if ( pContainer ) { // a table or query as been replaced - String aName = ::comphelper::getString(_rEvent.Accessor).getStr(); + String aName = ::comphelper::getString(_rEvent.Accessor); if ( isCurrentlyDisplayedChanged( aName, pContainer) ) { // the element displayed currently has been replaced diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index e7a876f1e3d8..0ebb5076d8fd 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -971,7 +971,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet { ::rtl::OUString sValue; _rValue >>= sValue; - _rSet.Put(SfxStringItem(_nId, sValue.getStr())); + _rSet.Put(SfxStringItem(_nId, sValue)); } else { OSL_FAIL( diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 9f73597d6a2a..4d860ac7c525 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -350,7 +350,6 @@ void ODbaseIndexDialog::Init() ::std::vector< String > aUsedIndexes; - String aExt; const ::rtl::OUString *pBegin = aFolderContent.getConstArray(); const ::rtl::OUString *pEnd = pBegin + aFolderContent.getLength(); aURL.SetSmartProtocol(INET_PROT_FILE); @@ -359,12 +358,12 @@ void ODbaseIndexDialog::Init() rtl::OUString aName; ::utl::LocalFileHelper::ConvertURLToPhysicalName(pBegin->getStr(),aName); aURL.SetSmartURL(aName); - aExt = aURL.getExtension(); - if(aExt == aIndexExt.getStr()) + rtl::OUString aExt = aURL.getExtension(); + if (aExt == aIndexExt) { m_aFreeIndexList.push_back( OTableIndex(aURL.getName()) ); } - else if(aExt == aTableExt.getStr()) + else if (aExt == aTableExt) { m_aTableInfoList.push_back( OTableInfo(aURL.getName()) ); OTableInfo& rTabInfo = m_aTableInfoList.back(); diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index d5803492992a..666dd9fc37a0 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -231,7 +231,7 @@ DBG_NAME(OParameterDialog) LocalResourceAccess aDummy(DLG_PARAMETERS, RSC_MODALDIALOG); sMessage = String(ModuleRes(STR_COULD_NOT_CONVERT_PARAM)); } - sMessage.SearchAndReplaceAll(String::CreateFromAscii("$name$"), sName.getStr()); + sMessage.SearchAndReplaceAll(String::CreateFromAscii("$name$"), sName); ErrorBox(NULL, WB_OK, sMessage).Execute(); m_aParam.GrabFocus(); return 1L; diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 51bbed99513c..7d4e0e00ce22 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -485,7 +485,7 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const PropertyValue& _rItem,sal_Boo DBG_CHKTHIS(DlgFilterCrit,NULL); ::rtl::OUString aCondition; _rItem.Value >>= aCondition; - String aStr = aCondition.getStr(); + String aStr = aCondition; ::Replace_SQL_PlaceHolder(aStr); aStr = comphelper::string::stripEnd(aStr, ' '); diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index f426a31a833e..dfc31075d270 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -746,7 +746,7 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t ) FormulaToken* FormulaTokenArray::AddString( const sal_Unicode* pStr ) { - return AddString( String( pStr ) ); + return AddString( rtl::OUString( pStr ) ); } FormulaToken* FormulaTokenArray::AddString( const String& rStr ) @@ -761,7 +761,7 @@ FormulaToken* FormulaTokenArray::AddDouble( double fVal ) FormulaToken* FormulaTokenArray::AddExternal( const sal_Unicode* pStr ) { - return AddExternal( String( pStr ) ); + return AddExternal( rtl::OUString( pStr ) ); } FormulaToken* FormulaTokenArray::AddExternal( const String& rStr, diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index 1ea9f8a0387c..635281cfa9ef 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -813,7 +813,7 @@ void ScGlobal::AddQuotes( String& rString, sal_Unicode cQuote, bool bEscapeEmbed sal_Unicode pQ[3]; pQ[0] = pQ[1] = cQuote; pQ[2] = 0; - String aQuotes( pQ ); + rtl::OUString aQuotes( pQ ); rString.SearchAndReplaceAll( cQuote, aQuotes); } rString.Insert( cQuote, 0 ).Append( cQuote ); @@ -829,7 +829,7 @@ void ScGlobal::EraseQuotes( String& rString, sal_Unicode cQuote, bool bUnescapeE sal_Unicode pQ[3]; pQ[0] = pQ[1] = cQuote; pQ[2] = 0; - String aQuotes( pQ ); + rtl::OUString aQuotes( pQ ); rString.SearchAndReplaceAll( aQuotes, cQuote); } } diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index aeab79e00111..72a30e92cfe8 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1071,8 +1071,8 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd } else { - String aTmp( p ); - long n = aTmp.ToInt32() - 1; + rtl::OUString aTmp( p ); + long n = aTmp.toInt32() - 1; while (CharClass::isAsciiDigit( *p )) p++; if( n < 0 || n > MAXROW ) diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx index 41fbe7782185..f32234c6fba8 100644 --- a/sc/source/core/tool/cellkeytranslator.cxx +++ b/sc/source/core/tool/cellkeytranslator.cxx @@ -234,7 +234,7 @@ void ScCellKeywordTranslator::addToMap(const String& rKey, const sal_Char* pName void ScCellKeywordTranslator::addToMap(const TransItem* pItems, const Locale& rLocale) { for (sal_uInt16 i = 0; pItems[i].from != NULL; ++i) - addToMap(String(pItems[i].from), pItems[i].to, rLocale, pItems[i].func); + addToMap(rtl::OUString(pItems[i].from), pItems[i].to, rLocale, pItems[i].func); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index a1bc598cda48..7833786b6c17 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3494,7 +3494,7 @@ void ScCompiler::AutoCorrectParsedSymbol() const sal_Unicode* p = aRef[j].GetBuffer(); while ( *p && CharClass::isAsciiNumeric( *p ) ) aStr2 += *p++; - aRef[j] = String( p ); + aRef[j] = rtl::OUString( p ); aRef[j] += aStr2; if ( bColons || aRef[j] != aOld ) { @@ -3561,7 +3561,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) // Short cut for references when reading ODF to speedup things. if (mnPredetectedReference) { - String aStr( cSymbol); + rtl::OUString aStr( cSymbol); if (!IsPredetectedReference( aStr) && !IsExternalNamedRange( aStr)) { /* TODO: it would be nice to generate a #REF! error here, which @@ -3571,7 +3571,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) * information if not ODFF (in that case it was already handled). * */ ScRawToken aToken; - aToken.SetString( aStr.GetBuffer() ); + aToken.SetString( aStr.getStr() ); aToken.NewOpCode( ocBad ); pRawToken = aToken.Clone(); } @@ -3625,7 +3625,7 @@ bool ScCompiler::NextNewToken( bool bInArray ) do { mbRewind = false; - const String aOrg( cSymbol ); + const rtl::OUString aOrg( cSymbol ); if (bAsciiNonAlnum) { diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index a6d169315926..c914daf788d2 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1898,7 +1898,7 @@ void ScInterpreter::PushStringBuffer( const sal_Unicode* pString ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::PushStringBuffer" ); if ( pString ) - PushString( String( pString ) ); + PushString( rtl::OUString(pString) ); else PushString( EMPTY_STRING ); } diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b29e48d95acb..800d952de96d 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -364,9 +364,9 @@ FormulaToken* ScRawToken::CreateToken() const return new FormulaDoubleToken( nValue ); case svString : if (eOp == ocPush) - return new FormulaStringToken( String( cStr ) ); + return new FormulaStringToken( rtl::OUString( cStr ) ); else - return new FormulaStringOpToken( eOp, String( cStr ) ); + return new FormulaStringOpToken( eOp, rtl::OUString( cStr ) ); case svSingleRef : if (eOp == ocPush) return new ScSingleRefToken( aRef.Ref1 ); @@ -384,23 +384,23 @@ FormulaToken* ScRawToken::CreateToken() const return new FormulaIndexToken( eOp, name.nIndex, name.bGlobal); case svExternalSingleRef: { - String aTabName(extref.cTabName); + rtl::OUString aTabName(extref.cTabName); return new ScExternalSingleRefToken(extref.nFileId, aTabName, extref.aRef.Ref1); } case svExternalDoubleRef: { - String aTabName(extref.cTabName); + rtl::OUString aTabName(extref.cTabName); return new ScExternalDoubleRefToken(extref.nFileId, aTabName, extref.aRef); } case svExternalName: { - String aName(extname.cName); + rtl::OUString aName(extname.cName); return new ScExternalNameToken( extname.nFileId, aName ); } case svJump : return new FormulaJumpToken( eOp, (short*) nJump ); case svExternal : - return new FormulaExternalToken( eOp, sbyte.cByte, String( cStr+1 ) ); + return new FormulaExternalToken( eOp, sbyte.cByte, rtl::OUString( cStr+1 ) ); case svFAP : return new FormulaFAPToken( eOp, sbyte.cByte, NULL ); case svMissing : diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 1ffae6a1cb40..7496db78ab8d 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -70,7 +70,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, sal_Bool bSyntErrWarn = false; sal_Bool bOverflowWarn = false; - String& rData = aDifParser.aData; + rtl::OUString aData = aDifParser.aData; sal_Bool bData = false; rIn.Seek( 0 ); @@ -83,7 +83,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, aPrgrsBar.Progress(); - bData = rData.Len() > 0; + bData = !aData.isEmpty(); switch( eTopic ) { @@ -92,7 +92,7 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, if( aDifParser.nVector != 0 || aDifParser.nVal != 1 ) bSyntErrWarn = sal_True; if( bData ) - pDoc->RenameTab( nBaseTab, rData ); + pDoc->RenameTab( nBaseTab, aData ); } break; case T_VECTORS: @@ -164,14 +164,14 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, if( ValidCol(nColCnt) && ValidRow(nRowCnt) ) { ScBaseCell* pCell; - if( DifParser::IsV( rData.GetBuffer() ) ) + if( DifParser::IsV( aData.getStr() ) ) { pCell = new ScValueCell( aDifParser.fVal ); if( !bPlain ) aAttrCache.SetNumFormat( nColCnt, nRowCnt, aDifParser.nNumFormat ); } - else if( rData == pKeyTRUE || rData == pKeyFALSE ) + else if( aData == pKeyTRUE || aData == pKeyFALSE ) { pCell = new ScValueCell( aDifParser.fVal ); if( bPlain ) @@ -180,12 +180,12 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, aAttrCache.SetNumFormat( nColCnt, nRowCnt, aDifParser.nNumFormat ); } - else if( rData == pKeyNA || rData == pKeyERROR ) - pCell = new ScStringCell( rData ); + else if( aData == pKeyNA || aData == pKeyERROR ) + pCell = new ScStringCell( aData ); else { String aTmp( RTL_CONSTASCII_USTRINGPARAM( "#IND: " )); - aTmp += rData; + aTmp += aData; aTmp += sal_Unicode('?'); pCell = new ScStringCell( aTmp ); } @@ -203,10 +203,10 @@ FltError ScFormatFilterPluginImpl::ScImportDif( SvStream& rIn, ScDocument* pDoc, if( ValidCol(nColCnt) && ValidRow(nRowCnt) ) { - if( rData.Len() > 0 ) + if (!aData.isEmpty()) { pDoc->PutCell( nColCnt, nRowCnt, nBaseTab, - ScBaseCell::CreateTextCell( rData, pDoc ), true ); + ScBaseCell::CreateTextCell( aData, pDoc ), true ); } } else @@ -434,7 +434,7 @@ DATASET DifParser::GetNumberDataset( const sal_Unicode* pPossibleNumericData ) else { // ...und zur Strafe mit'm Numberformatter... OSL_ENSURE( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" ); - String aTestVal( pPossibleNumericData ); + rtl::OUString aTestVal( pPossibleNumericData ); sal_uInt32 nFormat = 0; double fTmpVal; if( pNumFormatter->IsNumberFormat( aTestVal, nFormat, fTmpVal ) ) diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 6021704c7012..101eb6a98504 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -375,7 +375,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU { // #n382718# (and #n261623#) Convert smb notation to '\\' aFileName = aUrlObj.GetMainURL( INetURLObject::NO_DECODE ); - aFileName = String( aFileName.GetBuffer() + 4 ); // skip the 'smb:' part + aFileName = rtl::OUString( aFileName.GetBuffer() + 4 ); // skip the 'smb:' part aFileName.SearchAndReplaceAll( '/', '\\' ); } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index c7eaf379a1cc..73015c3ddab8 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1751,16 +1751,16 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) switch( ch ) { case 'X': - nCol = static_cast<SCCOL>(String( p ).ToInt32()) + nStartCol - 1; + nCol = static_cast<SCCOL>(rtl::OUString(p).toInt32()) + nStartCol - 1; break; case 'Y': - nRow = String( p ).ToInt32() + nStartRow - 1; + nRow = rtl::OUString(p).toInt32() + nStartRow - 1; break; case 'C': - nRefCol = static_cast<SCCOL>(String( p ).ToInt32()) + nStartCol - 1; + nRefCol = static_cast<SCCOL>(rtl::OUString(p).toInt32()) + nStartCol - 1; break; case 'R': - nRefRow = String( p ).ToInt32() + nStartRow - 1; + nRefRow = rtl::OUString(p).toInt32() + nStartRow - 1; break; case 'K': { @@ -1871,10 +1871,10 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) switch( ch ) { case 'X': - nCol = static_cast<SCCOL>(String( p ).ToInt32()) + nStartCol - 1; + nCol = static_cast<SCCOL>(rtl::OUString(p).toInt32()) + nStartCol - 1; break; case 'Y': - nRow = String( p ).ToInt32() + nStartRow - 1; + nRow = rtl::OUString(p).toInt32() + nStartRow - 1; break; case 'P' : if ( bData ) @@ -1913,16 +1913,11 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { if ( bData && *p == ';' && *(p+1) == 'P' ) { - String aCode( p+2 ); + rtl::OUString aCode( p+2 ); // unescape doubled semicolons - xub_StrLen nPos = 0; - String aSemicolon( RTL_CONSTASCII_USTRINGPARAM(";;")); - while ( (nPos = aCode.Search( aSemicolon, nPos )) != STRING_NOTFOUND ) - aCode.Erase( nPos++, 1 ); + aCode = aCode.replaceAll(";;", ";"); // get rid of Xcl escape characters - nPos = 0; - while ( (nPos = aCode.Search( sal_Unicode(0x1b), nPos )) != STRING_NOTFOUND ) - aCode.Erase( nPos, 1 ); + aCode = aCode.replaceAll(rtl::OUString(static_cast<sal_Unicode>(0x1b)), rtl::OUString()); xub_StrLen nCheckPos; short nType; sal_uInt32 nKey; diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index b3c48f2c622f..8e685064faad 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -330,7 +330,7 @@ void SfxPickList::ExecuteEntry( sal_uInt32 nIndex ) sal_uInt16 nPos=aFilter.Search('|'); if( nPos != STRING_NOTFOUND ) { - String aOptions(aFilter.Copy( nPos ).GetBuffer()+1); + rtl::OUString aOptions(aFilter.Copy(nPos).GetBuffer()+1); aFilter.Erase( nPos ); aReq.AppendItem( SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions)); } diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 570a1aa21f2e..674b7038439f 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -227,7 +227,7 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri String sPath; sal_Unicode aPathBuffer[nMaxPathSize]; if ( SystemPath::GetUserTemplateLocation( aPathBuffer, nMaxPathSize )) - sPath = String( aPathBuffer ); + sPath = rtl::OUString( aPathBuffer ); ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, sURL ); ::rtl::OUString aUserTemplateURL( sURL ); diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 6a8cf4676b89..5e768b4fa359 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -361,7 +361,7 @@ String SfxOleStringHelper::ImplLoadString16( SvStream& rStrm ) const rStrm.SeekRel( 2 ); // create string from character array aBuffer.push_back( 0 ); - aValue = String( &aBuffer.front() ); + aValue = rtl::OUString( &aBuffer.front() ); } return aValue; } diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx index 9f3f70b020ae..d657893d51ea 100644 --- a/svtools/source/dialogs/insdlg.cxx +++ b/svtools/source/dialogs/insdlg.cxx @@ -193,7 +193,7 @@ void SvObjectServerList::FillInsertObjects() { if( !Get( aClassName ) ) // noch nicht eingetragen - aObjectServerList.push_back( SvObjectServer( aClassName, String( aUIName.getStr() ) ) ); + aObjectServerList.push_back( SvObjectServer( aClassName, aUIName ) ); } } } diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx index fca8fc477956..8dd65023fda9 100644 --- a/svtools/source/edit/svmedit.cxx +++ b/svtools/source/edit/svmedit.cxx @@ -315,12 +315,12 @@ void ImpSvMEdit::ImpSetScrollBarRanges() void ImpSvMEdit::ImpInitScrollBars() { - static const sal_Unicode sampleText[] = { 'x', '\0' }; + static const sal_Unicode sampleChar = { 'x' }; if ( mpHScrollBar || mpVScrollBar ) { ImpSetScrollBarRanges(); Size aCharBox; - aCharBox.Width() = mpTextWindow->GetTextWidth( sampleText ); + aCharBox.Width() = mpTextWindow->GetTextWidth( rtl::OUString(sampleChar) ); aCharBox.Height() = mpTextWindow->GetTextHeight(); Size aOutSz = mpTextWindow->GetOutputSizePixel(); if ( mpHScrollBar ) @@ -673,11 +673,11 @@ Size ImpSvMEdit::CalcMinimumSize() const Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const { - static const sal_Unicode sampleText[] = { 'X', '\0' }; + static const sal_Unicode sampleChar = 'X'; Size aSz; Size aCharSz; - aCharSz.Width() = mpTextWindow->GetTextWidth( sampleText ); + aCharSz.Width() = mpTextWindow->GetTextWidth( rtl::OUString(sampleChar) ); aCharSz.Height() = mpTextWindow->GetTextHeight(); if ( nLines ) @@ -700,9 +700,9 @@ Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const { - static const sal_Unicode sampleText[] = { 'x', '\0' }; + static const sal_Unicode sampleChar = { 'x' }; Size aOutSz = mpTextWindow->GetOutputSizePixel(); - Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() ); + Size aCharSz( mpTextWindow->GetTextWidth( rtl::OUString(sampleChar) ), mpTextWindow->GetTextHeight() ); rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width()); rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height()); } diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx index b81d973aa9c7..cadb5e2cea98 100644 --- a/svtools/source/filter/wmf/enhwmf.cxx +++ b/svtools/source/filter/wmf/enhwmf.cxx @@ -1095,7 +1095,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF() *pWMF >> nChar; lfFaceName[ i ] = nChar; } - aLogFont.alfFaceName = UniString( lfFaceName ); + aLogFont.alfFaceName = rtl::OUString( lfFaceName ); pOut->CreateObject( nIndex, GDI_FONT, new WinMtfFontStyle( aLogFont ) ); } } diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index e4755c45bf32..ddf5f46f8305 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -999,7 +999,7 @@ void FmSearchEngine::SearchNextImpl() if (!m_bWildcard) { // da natuerlich in allen anderen Faellen auch * und ? im Suchstring erlaubt sind, aber nicht als WildCards zaehlen // sollen, muss ich normieren - UniString aTmp(strSearchExpression.getStr()); + UniString aTmp(strSearchExpression); static const UniString s_sStar = UniString::CreateFromAscii("\\*"); static const UniString s_sQuotation = UniString::CreateFromAscii("\\?"); aTmp.SearchAndReplaceAll('*', s_sStar); diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 40ff5d7663de..ce04e49a3417 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -315,7 +315,7 @@ sal_uLong SwASCIIParser::ReadChars() if( pStt >= pEnd ) { if( pLastStt != pStt ) - InsertText( String( pLastStt )); + InsertText( rtl::OUString( pLastStt )); // Read a new block sal_uLong lGCount; @@ -438,7 +438,7 @@ sal_uLong SwASCIIParser::ReadChars() *pStt++ = 0; if( nLineLen ) { - InsertText( String( pLastStt )); + InsertText( rtl::OUString( pLastStt )); } pDoc->SplitNode( *pPam->GetPoint(), false ); pDoc->InsertPoolItem( *pPam, SvxFmtBreakItem( @@ -472,7 +472,7 @@ sal_uLong SwASCIIParser::ReadChars() { sal_Unicode c = *pStt; *pStt = 0; - InsertText( String( pLastStt )); + InsertText( rtl::OUString( pLastStt )); pDoc->SplitNode( *pPam->GetPoint(), false ); pLastStt = pStt; nLineLen = 0; @@ -484,7 +484,7 @@ sal_uLong SwASCIIParser::ReadChars() else if( bSplitNode ) { // We found a CR/LF, thus save the text - InsertText( String( pLastStt )); + InsertText( rtl::OUString( pLastStt )); pDoc->SplitNode( *pPam->GetPoint(), false ); pLastStt = pStt; nLineLen = 0; diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 18672182ed51..1d400a877ca3 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -773,7 +773,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue( break; case MID_GRAPHIC_FILTER: - pBrush->SetGraphicFilter( rValue.getStr() ); + pBrush->SetGraphicFilter( rValue ); bOk = sal_True; break; } diff --git a/sw/source/ui/docvw/extedit.cxx b/sw/source/ui/docvw/extedit.cxx index 98dc6aa495d6..8b70262e2568 100644 --- a/sw/source/ui/docvw/extedit.cxx +++ b/sw/source/ui/docvw/extedit.cxx @@ -122,7 +122,7 @@ void EditWithExternalTool(GraphicObject *pGraphicObject, SwWrtShell *rSh) GraphicFilter& rGF = GraphicFilter::GetGraphicFilter(); sal_uInt16 nFilter(rGF.GetExportFormatNumber(fExt)); String aFilter(rGF.GetExportFormatShortName(nFilter)); - String sPath(tempFileName.getStr()); + String sPath(tempFileName); // Write the Graphic to the file now XOutBitmap::WriteGraphic(pGraphic, sPath, aFilter, diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 58107894d93b..b40562d83702 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -2665,7 +2665,7 @@ sal_uInt16 VCLXMultiPage::insertTab( TabPage* pPage, rtl::OUString& sTitle ) { TabControl *pTabControl = getTabControl(); sal_uInt16 id = sal::static_int_cast< sal_uInt16 >( mTabId++ ); - pTabControl->InsertPage( id, sTitle.getStr(), TAB_APPEND ); + pTabControl->InsertPage( id, sTitle, TAB_APPEND ); pTabControl->SetTabPage( id, pPage ); return id; } @@ -2711,15 +2711,15 @@ void SAL_CALL VCLXMultiPage::setTabProps( sal_Int32 ID, const uno::Sequence< bea if ( pTabControl->GetTabPage( sal::static_int_cast< sal_uInt16 >( ID ) ) == NULL ) throw lang::IndexOutOfBoundsException(); - for ( int i = 0; i < Properties.getLength(); i++ ) + for (sal_Int32 i = 0; i < Properties.getLength(); ++i) { const rtl::OUString &name = Properties[i].Name; const uno::Any &value = Properties[i].Value; - if ( name == rtl::OUString( "Title" ) ) + if (name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Title"))) { rtl::OUString title = value.get<rtl::OUString>(); - pTabControl->SetPageText( sal::static_int_cast< sal_uInt16 >( ID ), title.getStr() ); + pTabControl->SetPageText( sal::static_int_cast< sal_uInt16 >( ID ), title ); } } } diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index cd11d8071a78..03a27614c223 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -296,15 +296,15 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale ) String aFallBackJapaneseLocalized( RTL_CONSTASCII_USTRINGPARAM( "MS UI Gothic;" ) ); aFallBackJapaneseLocalized += String( RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_JAPANESE1 ) ); - aFallBackJapaneseLocalized += String( aMSPGothic ); + aFallBackJapaneseLocalized += OUString( aMSPGothic ); aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); - aFallBackJapaneseLocalized += String( aMSGothic ); + aFallBackJapaneseLocalized += OUString( aMSGothic ); aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); - aFallBackJapaneseLocalized += String( aTLPGothic ); + aFallBackJapaneseLocalized += OUString( aTLPGothic ); aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); - aFallBackJapaneseLocalized += String( aLXGothic ); + aFallBackJapaneseLocalized += OUString( aLXGothic ); aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); - aFallBackJapaneseLocalized += String( aKochiGothic ); + aFallBackJapaneseLocalized += OUString( aKochiGothic ); aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); aFallBackJapaneseLocalized += String(RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_JAPANESE2 ) ); static const OUString aFallBackJapanese( aFallBackJapaneseLocalized ); @@ -318,9 +318,9 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale ) // we need localized names for korean fonts static sal_Unicode const aSunGulim[] = { 0xC36C, 0xAD74, 0xB9BC, 0 }; static sal_Unicode const aBaekmukGulim[] = { 0xBC31, 0xBC35, 0xAD74, 0xB9BC, 0 }; - String aFallBackKoreanLocalized( aSunGulim ); + rtl::OUString aFallBackKoreanLocalized( aSunGulim ); aFallBackKoreanLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); - aFallBackKoreanLocalized += String( aBaekmukGulim ); + aFallBackKoreanLocalized += rtl::OUString( aBaekmukGulim ); aFallBackKoreanLocalized += String(RTL_CONSTASCII_USTRINGPARAM( ";" ) ); aFallBackKoreanLocalized += String(RTL_CONSTASCII_USTRINGPARAM( FALLBACKFONT_UI_SANS_KOREAN ) ); static const OUString aFallBackKorean( aFallBackKoreanLocalized ); diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index cca8040c5bf6..ed5aa94ad81b 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -419,7 +419,7 @@ void GetEnglishSearchFontName( String& rName ) // translate normalized localized name to its normalized English ASCII name if( bNeedTranslation ) { - typedef boost::unordered_map<const String, const char*,FontNameHash> FontNameDictionary; + typedef boost::unordered_map<const rtl::OUString, const char*, FontNameHash> FontNameDictionary; static FontNameDictionary aDictionary( SAL_N_ELEMENTS(aImplLocalizedNamesList) ); // the font name dictionary needs to be intialized once if( aDictionary.empty() ) diff --git a/vcl/inc/vcl/font.hxx b/vcl/inc/vcl/font.hxx index 8ca4ba5bbb87..1197d1fd0af9 100644 --- a/vcl/inc/vcl/font.hxx +++ b/vcl/inc/vcl/font.hxx @@ -70,7 +70,7 @@ public: void SetAlign( FontAlign ); FontAlign GetAlign() const; - void SetName( const String& rFamilyName ); + void SetName( const rtl::OUString& rFamilyName ); const String& GetName() const; void SetStyleName( const String& rStyleName ); const String& GetStyleName() const; diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index a80c4c7e3bdc..ca625fbf20ca 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -376,7 +376,7 @@ void Font::SetAlign( FontAlign eAlign ) // ----------------------------------------------------------------------- -void Font::SetName( const String& rFamilyName ) +void Font::SetName( const rtl::OUString& rFamilyName ) { DBG_CHKTHIS( Font, NULL ); diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index e26907b153c7..627cd7d1d778 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -1673,10 +1673,10 @@ Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference ) MetaTextLineAction* pAct = (MetaTextLineAction*) pAction; // measure a test string to get ascend and descent right static const sal_Unicode pStr[] = { 0xc4, 0x67, 0 }; - String aStr( pStr ); + rtl::OUString aStr( pStr ); Rectangle aRect; - aMapVDev.GetTextBoundRect( aRect, aStr, 0, 0, aStr.Len(), 0, NULL ); + aMapVDev.GetTextBoundRect( aRect, aStr, 0, 0, aStr.getLength(), 0, NULL ); Point aPt( pAct->GetStartPoint() ); aRect.Move( aPt.X(), aPt.Y() ); aRect.Right() = aRect.Left() + pAct->GetWidth(); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9c1e6bb34d17..72201bab2fa1 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2350,7 +2350,7 @@ public: const PDFWriterImpl::BuiltinFont&, long nPixelPerEM, int nOrientation ); - void SetText( const String& rText ) { maOrigText = rText; } + void SetText( const rtl::OUString& rText ) { maOrigText = rText; } virtual bool LayoutText( ImplLayoutArgs& ); virtual void InitFont() const; virtual void DrawText( SalGraphics& ) const; diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index 0515fab7b6b7..452cc6835c13 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -167,8 +167,7 @@ String GetCommandLineToken( int nToken, const String& rLine ) *pLeap = 0; - String aRet( pBuffer ); - return aRet; + return rtl::OUString(pBuffer); } rtl::OString GetCommandLineToken(int nToken, const rtl::OString& rLine) @@ -324,8 +323,7 @@ String WhitespaceToSpace( const String& rLine, sal_Bool bProtect ) if( *pLeap == ' ' ) *pLeap = 0; - String aRet( *pBuffer == ' ' ? pBuffer+1 : pBuffer ); - return aRet; + return rtl::OUString(*pBuffer == ' ' ? pBuffer+1 : pBuffer); } rtl::OString WhitespaceToSpace(const rtl::OString& rLine, sal_Bool bProtect) diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 6c4b6a284a13..002995339f50 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -606,7 +606,7 @@ void I18NStatus::setStatusText( const String& rText ) else pBuffer[i] = pCopy[i]; } - String aText( pBuffer ); + rtl::OUString aText( pBuffer ); m_pStatusWindow->setText( aText ); m_pStatusWindow->setPosition( m_pParent ); diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 2802c6fbe639..9c825de52115 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1070,8 +1070,7 @@ void SvXMLNumFmtElementContext::EndElement() { case XML_TOK_STYLE_TEXT: if ( rParent.HasLongDoW() && - rParent.GetLocaleData().getLongDateDayOfWeekSep() == - String( aContent.getStr() ) ) + aContent.toString().equals(rParent.GetLocaleData().getLongDateDayOfWeekSep()) ) { // skip separator constant after long day of week // (NF_KEY_NNNN contains the separator) |