From e13a3d566ecc34a46e037aca1b2d70e58501e422 Mon Sep 17 00:00:00 2001 From: Jean-Noël Rouvignac Date: Sun, 20 Jan 2013 10:51:58 +0100 Subject: fdo#38838 Some removal/replacement of the String/UniString with OUString MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also used the new OUString::number(...) methods. Change-Id: I3174c43d56d1ae359901bb8a13fe0096f2c74808 Reviewed-on: https://gerrit.libreoffice.org/1766 Reviewed-by: Luboš Luňák Tested-by: Luboš Luňák --- basctl/source/basicide/baside2.cxx | 43 ++-- basctl/source/basicide/baside2b.cxx | 47 ++-- basctl/source/basicide/brkdlg.cxx | 11 +- basctl/source/basicide/moduldl2.cxx | 11 +- connectivity/source/drivers/dbase/DTable.cxx | 64 +++--- connectivity/source/drivers/flat/ETable.cxx | 19 +- cui/source/dialogs/cuifmsearch.cxx | 16 +- cui/source/dialogs/cuigaldlg.cxx | 15 +- cui/source/dialogs/cuihyperdlg.cxx | 2 +- cui/source/dialogs/iconcdlg.cxx | 8 +- cui/source/dialogs/insdlg.cxx | 84 ++++--- cui/source/dialogs/scriptdlg.cxx | 248 ++++++++++----------- cui/source/dialogs/thesdlg.cxx | 5 +- cui/source/inc/scriptdlg.hxx | 2 +- cui/source/options/cfgchart.cxx | 35 ++- cui/source/options/cfgchart.hxx | 4 +- cui/source/options/connpooloptions.cxx | 4 +- cui/source/options/dbregister.cxx | 5 +- cui/source/options/fontsubs.cxx | 12 +- cui/source/options/optcolor.cxx | 2 +- cui/source/options/optgdlg.cxx | 54 +++-- cui/source/options/optinet2.cxx | 18 +- cui/source/options/optpath.cxx | 3 +- cui/source/options/optsave.cxx | 15 +- cui/source/options/treeopt.cxx | 4 +- filter/source/msfilter/msdffimp.cxx | 23 +- filter/source/pdf/impdialog.cxx | 3 +- formula/source/ui/dlg/parawin.cxx | 8 +- reportdesign/source/ui/dlg/Condition.cxx | 4 +- reportdesign/source/ui/report/DesignView.cxx | 4 +- reportdesign/source/ui/report/ReportController.cxx | 6 +- 31 files changed, 368 insertions(+), 411 deletions(-) diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index c6c354508435..4dcc13a9e1bd 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -149,25 +149,27 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage, pPrinter->SetLineColor( aOldLineColor ); } -void lcl_ConvertTabsToSpaces( String& rLine ) +void lcl_ConvertTabsToSpaces( OUString& rLine ) { - if ( rLine.Len() ) + if ( !rLine.isEmpty() ) { - sal_uInt16 nPos = 0; - sal_uInt16 nMax = rLine.Len(); + OUStringBuffer aResult( rLine ); + sal_Int32 nPos = 0; + sal_Int32 nMax = aResult.getLength(); while ( nPos < nMax ) { - if ( rLine.GetChar( nPos ) == '\t' ) + if ( aResult[nPos] == '\t' ) { // not 4 Blanks, but at 4 TabPos: - rtl::OUStringBuffer aBlanker; + OUStringBuffer aBlanker; string::padToLength(aBlanker, ( 4 - ( nPos % 4 ) ), ' '); - rLine.Erase( nPos, 1 ); - rLine.Insert( aBlanker.makeStringAndClear(), nPos ); - nMax = rLine.Len(); + aResult.remove( nPos, 1 ); + aResult.insert( nPos, aBlanker.makeStringAndClear() ); + nMax = aResult.getLength(); } ++nPos; } + rLine = aResult.makeStringAndClear(); } } @@ -756,7 +758,6 @@ long ModulWindow::BasicBreakHdl( StarBASIC* pBasic ) void ModulWindow::BasicAddWatch() { DBG_CHKTHIS( ModulWindow, 0 ); - String aWatchStr; AssertValidEditEngine(); bool bAdd = true; if ( !GetEditView()->HasSelection() ) @@ -903,7 +904,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) pPrinter->SetFont( aFont ); pPrinter->SetMapMode( MAP_100TH_MM ); - String aTitle( CreateQualifiedName() ); + OUString aTitle( CreateQualifiedName() ); sal_uInt16 nLineHeight = (sal_uInt16) pPrinter->GetTextHeight(); // etwas mehr. sal_uInt16 nParaSpace = 10; @@ -924,12 +925,12 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) Point aPos( Print::nLeftMargin, Print::nTopMargin ); for ( sal_uLong nPara = 0; nPara < nParas; nPara++ ) { - String aLine( GetEditEngine()->GetText( nPara ) ); + OUString aLine( GetEditEngine()->GetText( nPara ) ); lcl_ConvertTabsToSpaces( aLine ); - sal_uInt16 nLines = aLine.Len()/nCharspLine+1; + sal_uInt16 nLines = aLine.getLength()/nCharspLine+1; for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { - String aTmpLine( aLine, nLine*nCharspLine, nCharspLine ); + OUString aTmpLine = aLine.copy(nLine*nCharspLine, nCharspLine ); aPos.Y() += nLineHeight; if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) ) { @@ -1154,13 +1155,13 @@ void ModulWindow::GetState( SfxItemSet &rSet ) if ( pView ) { TextSelection aSel = pView->GetSelection(); - String aPos( IDEResId( RID_STR_LINE ) ); - aPos += ' '; - aPos += String::CreateFromInt32( aSel.GetEnd().GetPara()+1 ); - aPos += String( ", " ); - aPos += String( IDEResId( RID_STR_COLUMN ) ); - aPos += ' '; - aPos += String::CreateFromInt32( aSel.GetEnd().GetIndex()+1 ); + OUString aPos = OUString( IDEResId( RID_STR_LINE ) ) + + " " + + OUString::number(aSel.GetEnd().GetPara()+1) + + ", " + + OUString( IDEResId( RID_STR_COLUMN ) ) + + " " + + OUString::number(aSel.GetEnd().GetIndex()+1); SfxStringItem aItem( SID_BASICIDE_STAT_POS, aPos ); rSet.Put( aItem ); } diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index ffa93e407a2a..bbb7baf17b4e 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -106,7 +106,7 @@ OUString getTextEngineText (ExtTextEngine& rEngine) void setTextEngineText (ExtTextEngine& rEngine, OUString const& aStr) { - rEngine.SetText(String()); + rEngine.SetText(OUString()); OString aUTF8Str = OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 ); SvMemoryStream aMemStream( (void*)aUTF8Str.getStr(), aUTF8Str.getLength(), STREAM_READ | STREAM_SEEK_TO_BEGIN ); @@ -1549,20 +1549,19 @@ void StackWindow::UpdateCalls() SbxError eOld = SbxBase::GetError(); aTreeListBox.SetSelectionMode( SINGLE_SELECTION ); - sal_uInt16 nScope = 0; + sal_Int32 nScope = 0; SbMethod* pMethod = StarBASIC::GetActiveMethod( nScope ); while ( pMethod ) { - String aEntry( String::CreateFromInt32(nScope )); - if ( aEntry.Len() < 2 ) - aEntry.Insert( ' ', 0 ); - aEntry += OUString( ": " ); - aEntry += pMethod->GetName(); + OUString aEntry( OUString::number(nScope )); + if ( aEntry.getLength() < 2 ) + aEntry = " " + aEntry; + aEntry += ": " + pMethod->GetName(); SbxArray* pParams = pMethod->GetParameters(); SbxInfo* pInfo = pMethod->GetInfo(); if ( pParams ) { - aEntry += '('; + aEntry += "("; // 0 is the sub's name... for ( sal_uInt16 nParam = 1; nParam < pParams->Count(); nParam++ ) { @@ -1580,11 +1579,11 @@ void StackWindow::UpdateCalls() aEntry += pParam->aName; } } - aEntry += '='; + aEntry += "="; SbxDataType eType = pVar->GetType(); if( eType & SbxARRAY ) { - aEntry += OUString( "..." ); + aEntry += "..." ; } else if( eType != SbxOBJECT ) { @@ -1592,10 +1591,10 @@ void StackWindow::UpdateCalls() } if ( nParam < ( pParams->Count() - 1 ) ) { - aEntry += OUString( ", " ); + aEntry += ", "; } } - aEntry += ')'; + aEntry += ")"; } aTreeListBox.InsertEntry( aEntry, 0, false, LIST_APPEND ); nScope++; @@ -1814,23 +1813,21 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent ) // Copy data and create name - String aIndexStr = OUString( "(" ); + OUString aIndexStr = "("; pChildItem->mpArrayParentItem = pItem; pChildItem->nDimLevel = nThisLevel; pChildItem->nDimCount = pItem->nDimCount; pChildItem->vIndices.resize(pChildItem->nDimCount); - sal_uInt16 j; + sal_Int32 j; for( j = 0 ; j < nParentLevel ; j++ ) { short n = pChildItem->vIndices[j] = pItem->vIndices[j]; - aIndexStr += String::CreateFromInt32( n ); - aIndexStr += OUString( "," ); + aIndexStr += OUString::number( n ) + ","; } pChildItem->vIndices[nParentLevel] = sal::static_int_cast( i ); - aIndexStr += String::CreateFromInt32( i ); - aIndexStr += OUString( ")" ); + aIndexStr += OUString::number( i ) + ")"; - String aDisplayName; + OUString aDisplayName; WatchItem* pArrayRootItem = pChildItem->GetRootItem(); if( pArrayRootItem && pArrayRootItem->mpArrayParentItem ) aDisplayName = pItem->maDisplayName; @@ -1981,7 +1978,7 @@ void implCollapseModifiedObjectEntry( SvTreeListEntry* pParent, WatchTreeListBox String implCreateTypeStringForDimArray( WatchItem* pItem, SbxDataType eType ) { - String aRetStr = getBasicTypeName( eType ); + OUString aRetStr = getBasicTypeName( eType ); SbxDimArray* pArray = pItem->mpArray; if( !pArray ) @@ -1992,18 +1989,16 @@ String implCreateTypeStringForDimArray( WatchItem* pItem, SbxDataType eType ) int nDims = pItem->nDimCount; if( nDimLevel < nDims ) { - aRetStr += '('; + aRetStr += "("; for( int i = nDimLevel ; i < nDims ; i++ ) { short nMin, nMax; pArray->GetDim( sal::static_int_cast( i+1 ), nMin, nMax ); - aRetStr += String::CreateFromInt32( nMin ); - aRetStr += OUString( " to " ); - aRetStr += String::CreateFromInt32( nMax ); + aRetStr += OUString::number(nMin) + " to " + OUString::number(nMax); if( i < nDims - 1 ) - aRetStr += OUString( ", " ); + aRetStr += ", "; } - aRetStr += ')'; + aRetStr += ")"; } } return aRetStr; diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx index 6f424ce8c9b3..bb32586a1525 100644 --- a/basctl/source/basicide/brkdlg.cxx +++ b/basctl/source/basicide/brkdlg.cxx @@ -82,8 +82,7 @@ BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList for ( size_t i = 0, n = m_aModifiedBreakPointList.size(); i < n; ++i ) { BreakPoint* pBrk = m_aModifiedBreakPointList.at( i ); - OUString aEntryStr( "# " ); - aEntryStr += String::CreateFromInt32( pBrk->nLine ); + OUString aEntryStr( "# " + OUString::number(pBrk->nLine) ); aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND ); } aComboBox.SetUpdateMode(true); @@ -111,8 +110,7 @@ BreakPointDialog::BreakPointDialog( Window* pParent, BreakPointList& rBrkPntList void BreakPointDialog::SetCurrentBreakPoint( BreakPoint* pBrk ) { - String aStr( "# " ); - aStr += String::CreateFromInt32( pBrk->nLine ); + OUString aStr( "# " + OUString::number(pBrk->nLine) ); aComboBox.SetText( aStr ); UpdateFields( pBrk ); } @@ -191,7 +189,7 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton ) else if ( pButton == &aNewButton ) { // keep checkbox in mind! - String aText( aComboBox.GetText() ); + OUString aText( aComboBox.GetText() ); size_t nLine; bool bValid = lcl_ParseText( aText, nLine ); if ( bValid ) @@ -200,8 +198,7 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton ) pBrk->bEnabled = aCheckBox.IsChecked(); pBrk->nStopAfter = (size_t) aNumericField.GetValue(); m_aModifiedBreakPointList.InsertSorted( pBrk ); - OUString aEntryStr( "# " ); - aEntryStr += String::CreateFromInt32( pBrk->nLine ); + OUString aEntryStr( "# " + OUString::number(pBrk->nLine) ); aComboBox.InsertEntry( aEntryStr, COMBOBOX_APPEND ); if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->Execute( SID_BASICIDE_BRKPNTSCHANGED ); diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 68b459ea14b5..4437f64a7021 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1566,15 +1566,14 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument, return; // create library name - String aLibName; - String aLibStdName( String( "Library" ) ); + OUString aLibName; + OUString aLibStdName( "Library" ); //String aLibStdName( IDEResId( RID_STR_STDLIBNAME ) ); bool bValid = false; - sal_uInt16 i = 1; + sal_Int32 i = 1; while ( !bValid ) { - aLibName = aLibStdName; - aLibName += String::CreateFromInt32( i ); + aLibName = aLibStdName + OUString::number( i ); if ( !rDocument.hasLibrary( E_SCRIPTS, aLibName ) && !rDocument.hasLibrary( E_DIALOGS, aLibName ) ) bValid = true; i++; @@ -1588,7 +1587,7 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument, if (aNewDlg.GetObjectName().Len()) aLibName = aNewDlg.GetObjectName(); - if ( aLibName.Len() > 30 ) + if ( aLibName.getLength() > 30 ) { ErrorBox( pWin, WB_OK | WB_DEF_OK, String( IDEResId( RID_STR_LIBNAMETOLONG ) ) ).Execute(); } diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 7ee5ed5beaaf..5c7785e47560 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -350,13 +350,13 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ); { case 'C': eType = DataType::VARCHAR; - aTypeName = ::rtl::OUString("VARCHAR"); + aTypeName = "VARCHAR"; break; case 'F': - aTypeName = ::rtl::OUString("DECIMAL"); + aTypeName = "DECIMAL"; case 'N': if ( aDBFColumn.db_typ == 'N' ) - aTypeName = ::rtl::OUString("NUMERIC"); + aTypeName = "NUMERIC"; eType = DataType::DECIMAL; // for numeric fields two characters more are written, than the precision of the column description predescribes, @@ -366,40 +366,40 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ); break; case 'L': eType = DataType::BIT; - aTypeName = ::rtl::OUString("BOOLEAN"); + aTypeName = "BOOLEAN"; break; case 'Y': bIsCurrency = sal_True; eType = DataType::DOUBLE; - aTypeName = ::rtl::OUString("DOUBLE"); + aTypeName = "DOUBLE"; break; case 'D': eType = DataType::DATE; - aTypeName = ::rtl::OUString("DATE"); + aTypeName = "DATE"; break; case 'T': eType = DataType::TIMESTAMP; - aTypeName = ::rtl::OUString("TIMESTAMP"); + aTypeName = "TIMESTAMP"; break; case 'I': eType = DataType::INTEGER; - aTypeName = ::rtl::OUString("INTEGER"); + aTypeName = "INTEGER"; break; case 'M': if ( bFoxPro && ( aDBFColumn.db_frei2[0] & 0x04 ) == 0x04 ) { eType = DataType::LONGVARBINARY; - aTypeName = ::rtl::OUString("LONGVARBINARY"); + aTypeName = "LONGVARBINARY"; } else { - aTypeName = ::rtl::OUString("LONGVARCHAR"); + aTypeName = "LONGVARCHAR"; eType = DataType::LONGVARCHAR; } nPrecision = 2147483647; break; case 'P': - aTypeName = ::rtl::OUString("LONGVARBINARY"); + aTypeName = "LONGVARBINARY"; eType = DataType::LONGVARBINARY; nPrecision = 2147483647; break; @@ -407,12 +407,12 @@ OSL_TRACE("column type: %c",aDBFColumn.db_typ); case 'B': if ( m_aHeader.db_typ == VisualFoxPro || m_aHeader.db_typ == VisualFoxProAuto ) { - aTypeName = ::rtl::OUString("DOUBLE"); + aTypeName = "DOUBLE"; eType = DataType::DOUBLE; } else { - aTypeName = ::rtl::OUString("LONGVARBINARY"); + aTypeName = "LONGVARBINARY"; eType = DataType::LONGVARBINARY; nPrecision = 2147483647; } @@ -513,9 +513,9 @@ void ODbaseTable::construct() // nyi: Ugly for Unix and Mac! if ( m_aHeader.db_typ == FoxProMemo || VisualFoxPro == m_aHeader.db_typ || VisualFoxProAuto == m_aHeader.db_typ ) // foxpro uses another extension - aURL.SetExtension(rtl::OUString("fpt")); + aURL.SetExtension("fpt"); else - aURL.SetExtension(rtl::OUString("dbt")); + aURL.SetExtension("dbt"); // If the memo file isn't found, the data will be displayed anyhow. // However, updates can't be done @@ -679,7 +679,7 @@ void ODbaseTable::refreshIndexes() INetURLObject aURL; aURL.SetURL(getEntry(m_pConnection,m_Name)); - aURL.setExtension(rtl::OUString("inf")); + aURL.setExtension("inf"); Config aInfFile(aURL.getFSysPath(INetURLObject::FSYS_DETECT)); aInfFile.SetGroup(dBASE_III_GROUP); sal_uInt16 nKeyCnt = aInfFile.GetKeyCount(); @@ -1042,7 +1042,7 @@ sal_Bool ODbaseTable::CreateImpl() { ::rtl::OUString aIdent = m_pConnection->getContent()->getIdentifier()->getContentIdentifier(); if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) ) - aIdent += ::rtl::OUString("/"); + aIdent += "/"; aIdent += m_Name; aName = aIdent.getStr(); } @@ -1081,7 +1081,7 @@ sal_Bool ODbaseTable::CreateImpl() try { Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference(), comphelper::getProcessComponentContext()); - aContent.executeCommand( rtl::OUString("delete"),bool2any( sal_True ) ); + aContent.executeCommand( "delete",bool2any( sal_True ) ); } catch(const Exception&) // an exception is thrown when no file exists { @@ -1092,7 +1092,7 @@ sal_Bool ODbaseTable::CreateImpl() if (bMemoFile) { String aExt = aURL.getExtension(); - aURL.setExtension(rtl::OUString("dbt")); // extension for memo file + aURL.setExtension("dbt"); // extension for memo file Content aMemo1Content(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference(), comphelper::getProcessComponentContext()); sal_Bool bMemoAlreadyExists = sal_False; @@ -1109,7 +1109,7 @@ sal_Bool ODbaseTable::CreateImpl() try { Content aMemoContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference(), comphelper::getProcessComponentContext()); - aMemoContent.executeCommand( rtl::OUString("delete"),bool2any( sal_True ) ); + aMemoContent.executeCommand( "delete",bool2any( sal_True ) ); } catch(const Exception&) { @@ -1125,7 +1125,7 @@ sal_Bool ODbaseTable::CreateImpl() { aURL.setExtension(aExt); // kill dbf file Content aMemoContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference(), comphelper::getProcessComponentContext()); - aMemoContent.executeCommand( rtl::OUString("delete"),bool2any( sal_True ) ); + aMemoContent.executeCommand( "delete",bool2any( sal_True ) ); return sal_False; } m_aHeader.db_typ = dBaseIIIMemo; @@ -1437,7 +1437,7 @@ sal_Bool ODbaseTable::Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMem { if (_bHasMemoFields) { // delete the memo fields - aURL.setExtension(rtl::OUString("dbt")); + aURL.setExtension("dbt"); bDropped = ::utl::UCBContentHelper::Kill(aURL.GetMainURL(INetURLObject::NO_DECODE)); } @@ -1457,13 +1457,13 @@ sal_Bool ODbaseTable::Drop_Static(const ::rtl::OUString& _sUrl,sal_Bool _bHasMem { } } - aURL.setExtension(rtl::OUString("inf")); + aURL.setExtension("inf"); // as the inf file does not necessarily exist, we aren't allowed to use UCBContentHelper::Kill try { ::ucbhelper::Content aDeleteContent( aURL.GetMainURL( INetURLObject::NO_DECODE ), Reference< XCommandEnvironment >(), comphelper::getProcessComponentContext() ); - aDeleteContent.executeCommand( ::rtl::OUString("delete"), makeAny( sal_Bool( sal_True ) ) ); + aDeleteContent.executeCommand( "delete", makeAny( sal_Bool( sal_True ) ) ); } catch(const Exception&) { @@ -1929,8 +1929,8 @@ sal_Bool ODbaseTable::UpdateBuffer(OValueRefVector& rRow, OValueRefRow pOrgRow, xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aColName; ::std::list< ::std::pair > aStringToSubstitutes; aStringToSubstitutes.push_back(::std::pair("$columnname$", aColName)); - aStringToSubstitutes.push_back(::std::pair("$precision$", String::CreateFromInt32(nLen))); - aStringToSubstitutes.push_back(::std::pair("$scale$", String::CreateFromInt32(nScale))); + aStringToSubstitutes.push_back(::std::pair("$precision$", OUString::number(nLen))); + aStringToSubstitutes.push_back(::std::pair("$scale$", OUString::number(nScale))); aStringToSubstitutes.push_back(::std::pair("$value$", ::rtl::OStringToOUString(aDefaultValue,RTL_TEXTENCODING_UTF8))); const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( @@ -2162,7 +2162,7 @@ void SAL_CALL ODbaseTable::alterColumnByIndex( sal_Int32 index, const Reference< checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); if(index < 0 || index >= m_pColumns->getCount()) - throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),*this); + throw IndexOutOfBoundsException(OUString::number(index),*this); Reference xOldColumn; m_pColumns->getByIndex(index) >>= xOldColumn; @@ -2175,7 +2175,7 @@ void ODbaseTable::alterColumn(sal_Int32 index, { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::alterColumn" ); if(index < 0 || index >= m_pColumns->getCount()) - throw IndexOutOfBoundsException(::rtl::OUString::valueOf(index),*this); + throw IndexOutOfBoundsException(OUString::number(index),*this); ODbaseTable* pNewTable = NULL; try @@ -2327,11 +2327,11 @@ namespace Content aContent(aURL.GetMainURL(INetURLObject::NO_DECODE),Reference(), comphelper::getProcessComponentContext()); Sequence< PropertyValue > aProps( 1 ); - aProps[0].Name = ::rtl::OUString("Title"); + aProps[0].Name = "Title"; aProps[0].Handle = -1; // n/a aProps[0].Value = makeAny( ::rtl::OUString(sNewName) ); Sequence< Any > aValues; - aContent.executeCommand( rtl::OUString("setPropertyValues"),makeAny(aProps) ) >>= aValues; + aContent.executeCommand( "setPropertyValues",makeAny(aProps) ) >>= aValues; if(aValues.getLength() && aValues[0].hasValue()) throw Exception(); } @@ -2469,7 +2469,7 @@ void ODbaseTable::dropColumn(sal_Int32 _nPos) xHold = pNewTable = NULL; const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( STR_COLUMN_NOT_DROP, - "$position$", ::rtl::OUString::valueOf(_nPos) + "$position$", OUString::number(_nPos) ) ); ::dbtools::throwGenericSQLException( sError, *this ); } @@ -2492,7 +2492,7 @@ String ODbaseTable::createTempFile() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbase", "Ocke.Janssen@sun.com", "ODbaseTable::createTempFile" ); ::rtl::OUString aIdent = m_pConnection->getContent()->getIdentifier()->getContentIdentifier(); if ( aIdent.lastIndexOf('/') != (aIdent.getLength()-1) ) - aIdent += ::rtl::OUString("/"); + aIdent += "/"; String sTempName(aIdent); String sExt; sExt.AssignAscii("."); diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 6f13d6d222a8..781a49eca7fb 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -115,9 +115,10 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) // read description const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter(); const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter(); - String aColumnName; + OUString aColumnName; ::comphelper::UStringMixEqual aCase(bCase); - ::std::vector aColumnNames,m_aTypeNames; + ::std::vector aColumnNames; + ::std::vector m_aTypeNames; m_aTypeNames.resize(nFieldCount); const sal_Int32 nMaxRowsToScan = pConnection->getMaxRowsToScan(); sal_Int32 nRowCount = 0; @@ -133,17 +134,15 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) if ( bHasHeaderLine ) { aColumnName = aHeaderLine.GetTokenSpecial(nStartPosHeaderLine,m_cFieldDelimiter,m_cStringDelimiter); - if ( !aColumnName.Len() ) + if ( !aColumnName.getLength() ) { - aColumnName = 'C'; - aColumnName += String::CreateFromInt32(i+1); + aColumnName = "C" + OUString::number(i+1); } } else { // no column name so ... - aColumnName = 'C'; - aColumnName += String::CreateFromInt32(i+1); + aColumnName = "C" + OUString::number(i+1); } aColumnNames.push_back(aColumnName); } @@ -156,12 +155,12 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) for (xub_StrLen i = 0; i < nFieldCount; i++) { // check if the columname already exists - String aAlias(aColumnNames[i]); + OUString aAlias(aColumnNames[i]); OSQLColumns::Vector::const_iterator aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase); sal_Int32 nExprCnt = 0; while(aFind != m_aColumns->get().end()) { - (aAlias = aColumnNames[i]) += String::CreateFromInt32(++nExprCnt); + aAlias = aColumnNames[i] + OUString::number(++nExprCnt); aFind = connectivity::find(m_aColumns->get().begin(),m_aColumns->get().end(),aAlias,aCase); } @@ -705,7 +704,7 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal // #99178# OJ if ( DataType::DECIMAL == nType || DataType::NUMERIC == nType ) - *(_rRow->get())[i] = ::rtl::OUString::valueOf(nVal); + *(_rRow->get())[i] = OUString::number(nVal); else *(_rRow->get())[i] = nVal; } break; diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx index 9d0fc46d0ab0..500f412bd5df 100644 --- a/cui/source/dialogs/cuifmsearch.cxx +++ b/cui/source/dialogs/cuifmsearch.cxx @@ -78,7 +78,7 @@ void FmSearchDialog::initCommon( const Reference< XResultSet >& _rxCursor ) } // some initial record texts - m_ftRecord.SetText( String::CreateFromInt32( _rxCursor->getRow() ) ); + m_ftRecord.SetText( OUString::number(_rxCursor->getRow()) ); m_pbClose.SetHelpText(String()); } @@ -474,7 +474,7 @@ IMPL_LINK(FmSearchDialog, OnCheckBoxToggled, CheckBox*, pBox) // direction -> pass on and reset the checkbox-text for StartOver else if (pBox == &m_cbBackwards) { - m_cbStartOver.SetText( String( CUI_RES( bChecked ? RID_STR_FROM_BOTTOM : RID_STR_FROM_TOP ) ) ); + m_cbStartOver.SetText( OUString( CUI_RES( bChecked ? RID_STR_FROM_BOTTOM : RID_STR_FROM_TOP ) ) ); m_pSearchEngine->SetDirection(!bChecked); } // similarity-search or regular expression @@ -590,7 +590,7 @@ void FmSearchDialog::InitContext(sal_Int16 nContext) m_pSearchEngine->SwitchToContext(fmscContext.xCursor, fmscContext.strUsedFields, fmscContext.arrFields, m_rbAllFields.IsChecked() ? -1 : 0); - m_ftRecord.SetText(String::CreateFromInt32(fmscContext.xCursor->getRow())); + m_ftRecord.SetText(OUString::number(fmscContext.xCursor->getRow())); } //------------------------------------------------------------------------ @@ -626,7 +626,7 @@ void FmSearchDialog::EnableSearchUI(sal_Bool bEnable) } // the search button has two functions -> adjust its text accordingly - String sButtonText( bEnable ? m_sSearch : m_sCancel ); + OUString sButtonText( bEnable ? m_sSearch : m_sCancel ); m_pbSearchAgain.SetText( sButtonText ); if (m_pSearchEngine->GetSearchMode() != SM_BRUTE) @@ -760,12 +760,12 @@ IMPL_LINK(FmSearchDialog, OnSearchProgress, FmSearchProgress*, pProgress) case FmSearchProgress::STATE_PROGRESS: if (pProgress->bOverflow) { - String sHint( CUI_RES( m_cbBackwards.IsChecked() ? RID_STR_OVERFLOW_BACKWARD : RID_STR_OVERFLOW_FORWARD ) ); + OUString sHint( CUI_RES( m_cbBackwards.IsChecked() ? RID_STR_OVERFLOW_BACKWARD : RID_STR_OVERFLOW_FORWARD ) ); m_ftHint.SetText( sHint ); m_ftHint.Invalidate(); } - m_ftRecord.SetText(String::CreateFromInt32(1 + pProgress->nCurrentRecord)); + m_ftRecord.SetText(OUString::number(1 + pProgress->nCurrentRecord)); m_ftRecord.Invalidate(); break; @@ -773,7 +773,7 @@ IMPL_LINK(FmSearchDialog, OnSearchProgress, FmSearchProgress*, pProgress) m_ftHint.SetText(CUI_RESSTR(RID_STR_SEARCH_COUNTING)); m_ftHint.Invalidate(); - m_ftRecord.SetText(String::CreateFromInt32(pProgress->nCurrentRecord)); + m_ftRecord.SetText(OUString::number(pProgress->nCurrentRecord)); m_ftRecord.Invalidate(); break; @@ -804,7 +804,7 @@ IMPL_LINK(FmSearchDialog, OnSearchProgress, FmSearchProgress*, pProgress) break; } - m_ftRecord.SetText(String::CreateFromInt32(1 + pProgress->nCurrentRecord)); + m_ftRecord.SetText(OUString::number(1 + pProgress->nCurrentRecord)); return 0L; } diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index d443b5e2c3b1..a683467eef6f 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -669,10 +669,10 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) pData = _pData; GalleryTheme* pThm = pData->pTheme; - String aOutStr( String::CreateFromInt32( pThm->GetObjectCount() ) ); + OUString aOutStr( OUString::number(pThm->GetObjectCount()) ); String aObjStr( CUI_RES( RID_SVXSTR_GALLERYPROPS_OBJECT ) ); - String aAccess; - String aType( SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) ); + OUString aAccess; + OUString aType( SVX_RES( RID_SVXSTR_GALLERYPROPS_GALTHEME ) ); sal_Bool bReadOnly = pThm->IsReadOnly(); aEdtMSName.SetHelpId( HID_GALLERY_EDIT_MSNAME ); @@ -685,7 +685,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) aEdtMSName.Enable(); if( pThm->IsReadOnly() ) - aType += String( CUI_RES( RID_SVXSTR_GALLERY_READONLY ) ); + aType += CUI_RES( RID_SVXSTR_GALLERY_READONLY ); aFtMSShowType.SetText( aType ); aFtMSShowPath.SetText( pThm->GetSdgURL().GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ); @@ -696,8 +696,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) else aObjStr = aObjStr.GetToken( 1 ); - aOutStr += ' '; - aOutStr += aObjStr; + aOutStr += " " + aObjStr; aFtMSShowContent.SetText( aOutStr ); @@ -706,9 +705,7 @@ void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData ) const LocaleDataWrapper& aLocaleData = aSysLocale.GetLocaleData(); // ChangeDate/Time - aAccess = aLocaleData.getDate( pData->aThemeChangeDate ); - aAccess += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) ); - aAccess += aLocaleData.getTime( pData->aThemeChangeTime ); + aAccess = aLocaleData.getDate( pData->aThemeChangeDate ) + ", " + aLocaleData.getTime( pData->aThemeChangeTime ); aFtMSShowChangeDate.SetText( aAccess ); // set image diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index 3f3a3407884b..2911204fbbb2 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -144,7 +144,7 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings) SvxHpLinkDlg::~SvxHpLinkDlg () { // delete config item, so the base class (IconChoiceDialog) can not load it on the next start - SvtViewOptions aViewOpt( E_TABDIALOG, String::CreateFromInt32( SID_HYPERLINK_DIALOG ) ); + SvtViewOptions aViewOpt( E_TABDIALOG, OUString::number(SID_HYPERLINK_DIALOG) ); aViewOpt.Delete(); delete mpItemSet; diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index 522ae5013763..8c6feb08d268 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -253,7 +253,7 @@ IconChoiceDialog ::~IconChoiceDialog () { // save configuration at INI-Manager // and remove pages - SvtViewOptions aTabDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) ); + SvtViewOptions aTabDlgOpt( E_TABDIALOG, OUString::number(nResId) ); aTabDlgOpt.SetWindowState(::rtl::OStringToOUString(GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)), RTL_TEXTENCODING_ASCII_US)); aTabDlgOpt.SetPageID( mnCurrentPageId ); @@ -267,7 +267,7 @@ IconChoiceDialog ::~IconChoiceDialog () String aPageData(pData->pPage->GetUserData()); if ( aPageData.Len() ) { - SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) ); + SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number(pData->nId) ); SetViewOptUserItem( aTabPageOpt, aPageData ); } @@ -736,7 +736,7 @@ void IconChoiceDialog::ActivatePageImpl () else pData->pPage = (pData->fnCreatePage)( this, *CreateInputItemSet( mnCurrentPageId ) ); - SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pData->nId ) ); + SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number(pData->nId) ); pData->pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) ); SetPosSizePages ( pData->nId ); @@ -998,7 +998,7 @@ void IconChoiceDialog::Start_Impl() nActPage = mnCurrentPageId; // configuration existing? - SvtViewOptions aTabDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) ); + SvtViewOptions aTabDlgOpt( E_TABDIALOG, OUString::number(nResId) ); if ( aTabDlgOpt.Exists() ) { diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 54495d50e50a..a0be598a5f43 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -65,7 +65,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui::dialogs; -using ::rtl::OUString; static String impl_getSvtResString( sal_uInt32 nId ) @@ -86,7 +85,7 @@ sal_Bool InsertObjectDialog_Impl::IsCreateNew() const return sal_False; } -uno::Reference< io::XInputStream > InsertObjectDialog_Impl::GetIconIfIconified( ::rtl::OUString* /*pGraphicMediaType*/ ) +uno::Reference< io::XInputStream > InsertObjectDialog_Impl::GetIconIfIconified( OUString* /*pGraphicMediaType*/ ) { return uno::Reference< io::XInputStream >(); } @@ -116,7 +115,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl) Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); if( xFactory.is() ) { - Reference< XFilePicker > xFilePicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ), UNO_QUERY ); + Reference< XFilePicker > xFilePicker( xFactory->createInstance( "com.sun.star.ui.dialogs.FilePicker" ), UNO_QUERY ); DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" ); Reference< XInitialization > xInit( xFilePicker, UNO_QUERY ); @@ -132,7 +131,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl) { xFilterMgr->appendFilter( OUString(), - OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) + OUString( "*.*" ) ); } catch( IllegalArgumentException& ) @@ -222,7 +221,7 @@ short SvInsertOleDlg::Execute() rBox.InsertEntry( (*m_pServers)[i].GetHumanName() ); rBox.SetUpdateMode( sal_True ); SelectDefault(); - ::rtl::OUString aName; + OUString aName; DBG_ASSERT( m_xStorage.is(), "No storage!"); if ( m_xStorage.is() && ( nRet = Dialog::Execute() ) == RET_OK ) @@ -243,7 +242,7 @@ short SvInsertOleDlg::Execute() { uno::Reference < embed::XInsertObjectDialog > xDialogCreator( ::comphelper::getProcessServiceFactory()->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.MSOLEObjectSystemCreator")) ), + "com.sun.star.embed.MSOLEObjectSystemCreator" ), uno::UNO_QUERY ); if ( xDialogCreator.is() ) @@ -319,14 +318,14 @@ short SvInsertOleDlg::Execute() { // create MediaDescriptor for file to create object from uno::Sequence < beans::PropertyValue > aMedium( 2 ); - aMedium[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); - aMedium[0].Value <<= ::rtl::OUString( aFileName ); + aMedium[0].Name = "URL"; + aMedium[0].Value <<= OUString( aFileName ); uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); uno::Reference< task::XInteractionHandler2 > xInteraction( task::InteractionHandler::createWithParent(xContext, 0) ); - aMedium[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) ); + aMedium[1].Name = "InteractionHandler"; aMedium[1].Value <<= xInteraction; // create object from media descriptor @@ -351,7 +350,7 @@ short SvInsertOleDlg::Execute() return nRet; } -uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( ::rtl::OUString* pGraphicMediaType ) +uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( OUString* pGraphicMediaType ) { if ( m_aIconMetaFile.getLength() ) { @@ -373,7 +372,7 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl) Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); if( xFactory.is() ) { - Reference< XFilePicker > xFilePicker( xFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ) ), UNO_QUERY ); + Reference< XFilePicker > xFilePicker( xFactory->createInstance( "com.sun.star.ui.dialogs.FilePicker" ), UNO_QUERY ); DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" ); Reference< XInitialization > xInit( xFilePicker, UNO_QUERY ); @@ -466,7 +465,7 @@ short SvInsertPlugInDialog::Execute() if ( !aURL.Len() || m_pURL->SetSmartURL( aURL ) ) { // create a plugin object - ::rtl::OUString aName; + OUString aName; SvGlobalName aClassId( SO3_PLUGIN_CLASSID ); m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName ); } @@ -480,11 +479,11 @@ short SvInsertPlugInDialog::Execute() uno::Reference < beans::XPropertySet > xSet( m_xObj->getComponent(), uno::UNO_QUERY ); if ( xSet.is() ) { - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginURL") ), - makeAny( ::rtl::OUString( m_pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) ); + xSet->setPropertyValue( "PluginURL", + makeAny( OUString( m_pURL->GetMainURL( INetURLObject::NO_DECODE ) ) ) ); uno::Sequence< beans::PropertyValue > aCommandSequence; Plugin_ImplFillCommandSequence( m_aCommands, aCommandSequence ); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands") ), makeAny( aCommandSequence ) ); + xSet->setPropertyValue( "PluginCommands", makeAny( aCommandSequence ) ); } } else @@ -559,51 +558,51 @@ short SfxInsertFloatingFrameDialog::Execute() if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) m_xObj->changeState( embed::EmbedStates::RUNNING ); xSet = uno::Reference < beans::XPropertySet >( m_xObj->getComponent(), uno::UNO_QUERY ); - ::rtl::OUString aStr; - uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL") ) ); + OUString aStr; + uno::Any aAny = xSet->getPropertyValue( "FrameURL" ); if ( aAny >>= aStr ) m_pEDURL->SetText( aStr ); - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName") ) ); + aAny = xSet->getPropertyValue( "FrameName" ); if ( aAny >>= aStr ) m_pEDName->SetText( aStr ); sal_Int32 nSize = SIZE_NOT_SET; - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth") ) ); + aAny = xSet->getPropertyValue( "FrameMarginWidth" ); aAny >>= nSize; if ( nSize == SIZE_NOT_SET ) { m_pCBMarginWidthDefault->Check( sal_True ); - m_pNMMarginWidth->SetText( String::CreateFromInt32( DEFAULT_MARGIN_WIDTH ) ); + m_pNMMarginWidth->SetText( OUString::number(DEFAULT_MARGIN_WIDTH) ); m_pFTMarginWidth->Enable( sal_False ); m_pNMMarginWidth->Enable( sal_False ); } else - m_pNMMarginWidth->SetText( String::CreateFromInt32( nSize ) ); + m_pNMMarginWidth->SetText( OUString::number( nSize ) ); - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight") ) ); + aAny = xSet->getPropertyValue( "FrameMarginHeight" ); aAny >>= nSize; if ( nSize == SIZE_NOT_SET ) { m_pCBMarginHeightDefault->Check( sal_True ); - m_pNMMarginHeight->SetText( String::CreateFromInt32( DEFAULT_MARGIN_HEIGHT ) ); + m_pNMMarginHeight->SetText( OUString::number(DEFAULT_MARGIN_HEIGHT) ); m_pFTMarginHeight->Enable( sal_False ); m_pNMMarginHeight->Enable( sal_False ); } else - m_pNMMarginHeight->SetText( String::CreateFromInt32( nSize ) ); + m_pNMMarginHeight->SetText( OUString::number( nSize ) ); sal_Bool bScrollOn = sal_False; sal_Bool bScrollOff = sal_False; sal_Bool bScrollAuto = sal_False; sal_Bool bSet = sal_False; - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll") ) ); + aAny = xSet->getPropertyValue( "FrameIsAutoScroll" ); aAny >>= bSet; if ( !bSet ) { - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode") ) ); + aAny = xSet->getPropertyValue( "FrameIsScrollingMode" ); aAny >>= bSet; bScrollOn = bSet; bScrollOff = !bSet; @@ -616,11 +615,11 @@ short SfxInsertFloatingFrameDialog::Execute() m_pRBScrollingAuto->Check( bScrollAuto ); bSet = sal_False; - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoBorder") ) ); + aAny = xSet->getPropertyValue( "FrameIsAutoBorder" ); aAny >>= bSet; if ( !bSet ) { - aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder") ) ); + aAny = xSet->getPropertyValue( "FrameIsBorder" ); aAny >>= bSet; m_pRBFrameBorderOn->Check( bSet ); m_pRBFrameBorderOff->Check( !bSet ); @@ -642,7 +641,7 @@ short SfxInsertFloatingFrameDialog::Execute() if ( bOK && ( nRet = Dialog::Execute() ) == RET_OK ) { - ::rtl::OUString aURL; + OUString aURL; if ( !m_pEDURL->GetText().isEmpty() ) { // URL can be a valid and absolute URL or a system file name @@ -655,7 +654,7 @@ short SfxInsertFloatingFrameDialog::Execute() if ( !m_xObj.is() && !aURL.isEmpty() ) { // create the object - ::rtl::OUString aName; + OUString aName; SvGlobalName aClassId( SO3_IFRAME_CLASSID ); m_xObj = aCnt.CreateEmbeddedObject( aClassId.GetByteSequence(), aName ); if ( m_xObj->getCurrentState() == embed::EmbedStates::LOADED ) @@ -671,7 +670,7 @@ short SfxInsertFloatingFrameDialog::Execute() if ( bIPActive ) m_xObj->changeState( embed::EmbedStates::RUNNING ); - ::rtl::OUString aName = m_pEDName->GetText(); + OUString aName = m_pEDName->GetText(); ScrollingMode eScroll = ScrollingNo; if ( m_pRBScrollingOn->IsChecked() ) eScroll = ScrollingYes; @@ -694,24 +693,19 @@ short SfxInsertFloatingFrameDialog::Execute() else lMarginHeight = SIZE_NOT_SET; - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL") ), makeAny( aURL ) ); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName") ), makeAny( aName ) ); + xSet->setPropertyValue( "FrameURL", makeAny( aURL ) ); + xSet->setPropertyValue( "FrameName", makeAny( aName ) ); if ( eScroll == ScrollingAuto ) - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsAutoScroll") ), - makeAny( sal_True ) ); + xSet->setPropertyValue( "FrameIsAutoScroll", makeAny( sal_True ) ); else - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsScrollingMode") ), - makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) ); + xSet->setPropertyValue( "FrameIsScrollingMode", makeAny( (sal_Bool) ( eScroll == ScrollingYes) ) ); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameIsBorder") ), - makeAny( bHasBorder ) ); + xSet->setPropertyValue( "FrameIsBorder", makeAny( bHasBorder ) ); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginWidth") ), - makeAny( sal_Int32( lMarginWidth ) ) ); + xSet->setPropertyValue( "FrameMarginWidth", makeAny( sal_Int32( lMarginWidth ) ) ); - xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameMarginHeight") ), - makeAny( sal_Int32( lMarginHeight ) ) ); + xSet->setPropertyValue( "FrameMarginHeight", makeAny( sal_Int32( lMarginHeight ) ) ); if ( bIPActive ) m_xObj->changeState( embed::EmbedStates::INPLACE_ACTIVE ); @@ -733,7 +727,7 @@ IMPL_STATIC_LINK( SfxInsertFloatingFrameDialog, CheckHdl, CheckBox*, pCB ) if ( pCB == pThis->m_pCBMarginWidthDefault ) { if ( pCB->IsChecked() ) - pThis->m_pNMMarginWidth->SetText( String::CreateFromInt32( DEFAULT_MARGIN_WIDTH ) ); + pThis->m_pNMMarginWidth->SetText( OUString::number(DEFAULT_MARGIN_WIDTH) ); pThis->m_pFTMarginWidth->Enable( !pCB->IsChecked() ); pThis->m_pNMMarginWidth->Enable( !pCB->IsChecked() ); } @@ -741,7 +735,7 @@ IMPL_STATIC_LINK( SfxInsertFloatingFrameDialog, CheckHdl, CheckBox*, pCB ) if ( pCB == pThis->m_pCBMarginHeightDefault ) { if ( pCB->IsChecked() ) - pThis->m_pNMMarginHeight->SetText( String::CreateFromInt32( DEFAULT_MARGIN_HEIGHT ) ); + pThis->m_pNMMarginHeight->SetText( OUString::number(DEFAULT_MARGIN_HEIGHT) ); pThis->m_pFTMarginHeight->Enable( !pCB->IsChecked() ); pThis->m_pNMMarginHeight->Enable( !pCB->IsChecked() ); } diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 959f3a1379c0..33a17f60ef22 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -151,7 +151,7 @@ void SFTreeListBox::deleteAllTree() } } -void SFTreeListBox::Init( const ::rtl::OUString& language ) +void SFTreeListBox::Init( const OUString& language ) { SetUpdateMode( sal_False ); @@ -163,10 +163,10 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) Sequence< Reference< browse::XBrowseNode > > children; - ::rtl::OUString userStr( RTL_CONSTASCII_USTRINGPARAM("user") ); - ::rtl::OUString shareStr( RTL_CONSTASCII_USTRINGPARAM("share") ); + OUString userStr("user"); + OUString shareStr("share"); - ::rtl::OUString singleton( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.script.browse.theBrowseNodeFactory" ) ); + OUString singleton("/singletons/com.sun.star.script.browse.theBrowseNodeFactory"); try { @@ -184,7 +184,7 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) catch( Exception& e ) { OSL_TRACE("Exception getting root browse node from factory: %s", - ::rtl::OUStringToOString( + OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).pData->buffer ); // TODO exception handling } @@ -193,8 +193,8 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) for ( sal_Int32 n = 0; n < children.getLength(); n++ ) { bool app = false; - ::rtl::OUString uiName = children[ n ]->getName(); - ::rtl::OUString factoryURL; + OUString uiName = children[ n ]->getName(); + OUString factoryURL; if ( uiName.equals( userStr ) || uiName.equals( shareStr ) ) { app = true; @@ -218,7 +218,7 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) // get the long name of the document: Sequence moduleDescr; try{ - ::rtl::OUString appModule = xModuleManager->identify( xDocumentModel ); + OUString appModule = xModuleManager->identify( xDocumentModel ); xModuleManager->getByName(appModule) >>= moduleDescr; } catch(const uno::Exception&) {} @@ -236,7 +236,7 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) } } - ::rtl::OUString lang( language ); + OUString lang( language ); Reference< browse::XBrowseNode > langEntries = getLangNodeFromRootNode( children[ n ], lang ); @@ -250,7 +250,7 @@ void SFTreeListBox::Init( const ::rtl::OUString& language ) } Reference< XInterface > -SFTreeListBox::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OUString& docName ) +SFTreeListBox::getDocumentModel( Reference< XComponentContext >& xCtx, OUString& docName ) { Reference< XInterface > xModel; Reference< frame::XDesktop2 > desktop = frame::Desktop::create(xCtx); @@ -265,7 +265,7 @@ SFTreeListBox::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OU components->nextElement(), UNO_QUERY ); if ( model.is() ) { - ::rtl::OUString sTdocUrl = ::comphelper::DocumentInfo::getDocumentTitle( model ); + OUString sTdocUrl = ::comphelper::DocumentInfo::getDocumentTitle( model ); if( sTdocUrl.equals( docName ) ) { xModel = model; @@ -277,7 +277,7 @@ SFTreeListBox::getDocumentModel( Reference< XComponentContext >& xCtx, ::rtl::OU } Reference< browse::XBrowseNode > -SFTreeListBox::getLangNodeFromRootNode( Reference< browse::XBrowseNode >& rootNode, ::rtl::OUString& language ) +SFTreeListBox::getLangNodeFromRootNode( Reference< browse::XBrowseNode >& rootNode, OUString& language ) { Reference< browse::XBrowseNode > langNode; @@ -321,7 +321,7 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference< for ( sal_Int32 n = 0; n < children.getLength(); n++ ) { - ::rtl::OUString name( children[ n ]->getName() ); + OUString name( children[ n ]->getName() ); if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT) { SAL_WNODEPRECATED_DECLARATIONS_PUSH @@ -353,7 +353,7 @@ void SFTreeListBox::ExpandAllTrees() SAL_WNODEPRECATED_DECLARATIONS_PUSH SvTreeListEntry * SFTreeListBox::insertEntry( String const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, - bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData, ::rtl::OUString factoryURL ) + bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData, OUString factoryURL ) { SvTreeListEntry * p; if( nBitmap == RID_CUIIMG_DOC && !factoryURL.isEmpty() ) @@ -488,7 +488,7 @@ CuiInputDialog::~CuiInputDialog() // ---------------------------------------------------------------------------- // ScriptOrgDialog ------------------------------------------------------------ // ---------------------------------------------------------------------------- -SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, ::rtl::OUString language ) +SvxScriptOrgDialog::SvxScriptOrgDialog( Window* pParent, OUString language ) : SfxModalDialog(pParent, "ScriptOrganizerDialog", "cui/ui/scriptorganizer.ui") , m_sLanguage(language) , m_delErrStr(CUI_RESSTR(RID_SVXSTR_DELFAILED)) @@ -511,7 +511,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( rtl::OUString( "%MACROLANG" ), m_sLanguage ); + winTitle.SearchAndReplace( OUString( "%MACROLANG" ), m_sLanguage ); SetText( winTitle ); m_pScriptsBox->SetSelectHdl( LINK( this, SvxScriptOrgDialog, ScriptSelectHdl ) ); @@ -589,7 +589,7 @@ void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node ) return; } - ::rtl::OUString sName("Editable") ; + OUString sName("Editable") ; if ( getBoolProperty( xProps, sName ) ) { @@ -600,7 +600,7 @@ void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node ) m_pEditButton->Disable(); } - sName = rtl::OUString("Deletable") ; + sName = OUString("Deletable") ; if ( getBoolProperty( xProps, sName ) ) { @@ -611,7 +611,7 @@ void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node ) m_pDelButton->Disable(); } - sName = rtl::OUString("Creatable") ; + sName = OUString("Creatable") ; if ( getBoolProperty( xProps, sName ) ) { @@ -622,7 +622,7 @@ void SvxScriptOrgDialog::CheckButtons( Reference< browse::XBrowseNode >& node ) m_pCreateButton->Disable(); } - sName = rtl::OUString("Renamable") ; + sName = OUString("Renamable") ; if ( getBoolProperty( xProps, sName ) ) { @@ -708,7 +708,7 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton ) if ( pButton == m_pRunButton ) { - ::rtl::OUString tmpString; + OUString tmpString; Reference< beans::XPropertySet > xProp( node, UNO_QUERY ); Reference< provider::XScriptProvider > mspNode; if( !xProp.is() ) @@ -739,7 +739,7 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton ) mspNode.set( mspUserData->GetNode() , UNO_QUERY ); pParent = m_pScriptsBox->GetParent( pParent ); } - xProp->getPropertyValue( rtl::OUString("URI" ) ) >>= tmpString; + xProp->getPropertyValue( OUString("URI" ) ) >>= tmpString; const String scriptURL( tmpString ); if ( mspNode.is() ) @@ -792,11 +792,11 @@ IMPL_LINK( SvxScriptOrgDialog, ButtonHdl, Button *, pButton ) try { // ISSUE need code to run script here - xInv->invoke( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Editable" ) ), args, outIndex, outArgs ); + xInv->invoke( "Editable", args, outIndex, outArgs ); } catch( Exception& e ) { - OSL_TRACE("Caught exception trying to invoke %s", ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); + OSL_TRACE("Caught exception trying to invoke %s", OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } } @@ -858,16 +858,16 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) if ( xInv.is() ) { - ::rtl::OUString aNewName; - ::rtl::OUString aNewStdName; + OUString aNewName; + OUString aNewStdName; sal_uInt16 nMode = INPUTMODE_NEWLIB; if( m_pScriptsBox->GetModel()->GetDepth( pEntry ) == 0 ) { - aNewStdName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Library") ) ; + aNewStdName = "Library" ; } else { - aNewStdName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Macro") ) ; + aNewStdName = "Macro" ; nMode = INPUTMODE_NEWMACRO; } //do we need L10N for this? ie somethng like: @@ -881,8 +881,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) { if( node->hasChildNodes() == sal_False ) { - aNewName = aNewStdName; - aNewName += String::CreateFromInt32( i ); + aNewName = aNewStdName + OUString::number(i); bValid = sal_True; } else @@ -895,15 +894,14 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) // ignore, will continue on with empty sequence } - ::rtl::OUString extn; + OUString extn; while ( !bValid ) { - aNewName = aNewStdName; - aNewName += String::CreateFromInt32( i ); + aNewName = aNewStdName + OUString::number(i); sal_Bool bFound = sal_False; if(childNodes.getLength() > 0 ) { - ::rtl::OUString nodeName = childNodes[0]->getName(); + OUString nodeName = childNodes[0]->getName(); sal_Int32 extnPos = nodeName.lastIndexOf( '.' ); if(extnPos>0) extn = nodeName.copy(extnPos); @@ -935,7 +933,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) { if ( xNewDlg->Execute() && xNewDlg->GetObjectName().Len() ) { - ::rtl::OUString aUserSuppliedName = xNewDlg->GetObjectName(); + OUString aUserSuppliedName = xNewDlg->GetObjectName(); bValid = sal_True; for( sal_Int32 index = 0; index < childNodes.getLength(); index++ ) { @@ -973,7 +971,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) try { Any aResult; - aResult = xInv->invoke( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Creatable") ), args, outIndex, outArgs ); + aResult = xInv->invoke( "Creatable", args, outIndex, outArgs ); Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY ); aChildNode = newNode; @@ -981,7 +979,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) catch( Exception& e ) { OSL_TRACE("Caught exception trying to Create %s", - ::rtl::OUStringToOString( + OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } } @@ -991,7 +989,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) SvTreeListEntry* pNewEntry = NULL; - ::rtl::OUString name( aChildName ); + OUString name( aChildName ); Reference xDocumentModel = getModel( pEntry ); // ISSUE do we need to remove all entries for parent @@ -1032,7 +1030,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) else { //ISSUE L10N & message from exception? - String aError( m_createErrStr ); + OUString aError( m_createErrStr ); ErrorBox aErrorBox( static_cast(this), WB_OK | RET_OK, aError ); aErrorBox.SetText( m_createErrTitleStr ); aErrorBox.Execute(); @@ -1048,9 +1046,9 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) if ( xInv.is() ) { - ::rtl::OUString aNewName = node->getName(); + OUString aNewName = node->getName(); sal_Int32 extnPos = aNewName.lastIndexOf( '.' ); - ::rtl::OUString extn; + OUString extn; if(extnPos>0) { extn = aNewName.copy(extnPos); @@ -1068,7 +1066,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) { if ( xNewDlg->Execute() && xNewDlg->GetObjectName().Len() ) { - ::rtl::OUString aUserSuppliedName = xNewDlg->GetObjectName(); + OUString aUserSuppliedName = xNewDlg->GetObjectName(); bValid = sal_True; if( bValid ) aNewName = aUserSuppliedName; @@ -1088,7 +1086,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) try { Any aResult; - aResult = xInv->invoke( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Renamable") ), args, outIndex, outArgs ); + aResult = xInv->invoke( "Renamable", args, outIndex, outArgs ); Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY ); aChildNode = newNode; @@ -1096,7 +1094,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry ) catch( Exception& e ) { OSL_TRACE("Caught exception trying to Rename %s", - ::rtl::OUStringToOString( + OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } } @@ -1121,8 +1119,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry ) sal_Bool result = sal_False; Reference< browse::XBrowseNode > node = getBrowseNode( pEntry ); // ISSUE L10N string & can we centre list? - String aQuery( m_delQueryStr ); - aQuery.Append( getListOfChildren( node, 0 ) ); + OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 ); QueryBox aQueryBox( static_cast(this), WB_YES_NO | WB_DEF_YES, aQuery ); aQueryBox.SetText( m_delQueryTitleStr ); if ( aQueryBox.Execute() == RET_NO ) @@ -1139,13 +1136,13 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry ) try { Any aResult; - aResult = xInv->invoke( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Deletable") ), args, outIndex, outArgs ); + aResult = xInv->invoke( "Deletable", args, outIndex, outArgs ); aResult >>= result; // or do we just assume true if no exception ? } catch( Exception& e ) { OSL_TRACE("Caught exception trying to delete %s", - ::rtl::OUStringToOString( + OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer ); } } @@ -1166,7 +1163,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry ) } sal_Bool SvxScriptOrgDialog::getBoolProperty( Reference< beans::XPropertySet >& xProps, - ::rtl::OUString& propName ) + OUString& propName ) { sal_Bool result = false; try @@ -1182,15 +1179,14 @@ sal_Bool SvxScriptOrgDialog::getBoolProperty( Reference< beans::XPropertySet >& return result; } -String SvxScriptOrgDialog::getListOfChildren( Reference< browse::XBrowseNode > node, int depth ) +OUString SvxScriptOrgDialog::getListOfChildren( Reference< browse::XBrowseNode > node, int depth ) { - String result; - result.Append( rtl::OUString( "\n" ) ); + OUString result = "\n"; for( int i=0;i<=depth;i++ ) { - result.Append( rtl::OUString( "\t" ) ); + result += "\t"; } - result.Append( String( node->getName() ) ); + result += node->getName(); try { @@ -1200,7 +1196,7 @@ String SvxScriptOrgDialog::getListOfChildren( Reference< browse::XBrowseNode > n = node->getChildNodes(); for ( sal_Int32 n = 0; n < children.getLength(); n++ ) { - result.Append( getListOfChildren( children[ n ] , depth+1 ) ); + result += getListOfChildren( children[ n ] , depth+1 ); } } } @@ -1216,18 +1212,18 @@ Selection_hash SvxScriptOrgDialog::m_lastSelection; void SvxScriptOrgDialog::StoreCurrentSelection() { - String aDescription; + OUString aDescription; if ( m_pScriptsBox->IsSelected( m_pScriptsBox->GetHdlEntry() ) ) { SvTreeListEntry* pEntry = m_pScriptsBox->GetHdlEntry(); while( pEntry ) { - aDescription.Insert( m_pScriptsBox->GetEntryText( pEntry ), 0 ); + aDescription = m_pScriptsBox->GetEntryText( pEntry ) + aDescription; pEntry = m_pScriptsBox->GetParent( pEntry ); if ( pEntry ) - aDescription.Insert( ';', 0 ); + aDescription = ";" + aDescription; } - ::rtl::OUString sDesc( aDescription ); + OUString sDesc( aDescription ); m_lastSelection[ m_sLanguage ] = sDesc; } } @@ -1259,10 +1255,10 @@ void SvxScriptOrgDialog::RestorePreviousSelection() m_pScriptsBox->SetCurEntry( pEntry ); } -::rtl::OUString ReplaceString( - const ::rtl::OUString& source, - const ::rtl::OUString& token, - const ::rtl::OUString& value ) +OUString ReplaceString( + const OUString& source, + const OUString& token, + const OUString& value ) { sal_Int32 pos = source.indexOf( token ); @@ -1276,53 +1272,50 @@ void SvxScriptOrgDialog::RestorePreviousSelection() } } -::rtl::OUString FormatErrorString( - const ::rtl::OUString& unformatted, - const ::rtl::OUString& language, - const ::rtl::OUString& script, - const ::rtl::OUString& line, - const ::rtl::OUString& type, - const ::rtl::OUString& message ) +OUString FormatErrorString( + const OUString& unformatted, + const OUString& language, + const OUString& script, + const OUString& line, + const OUString& type, + const OUString& message ) { - ::rtl::OUString result = unformatted.copy( 0 ); + OUString result = unformatted.copy( 0 ); - result = ReplaceString( - result, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%LANGUAGENAME") ), language ); - result = ReplaceString( - result, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%SCRIPTNAME") ), script ); - result = ReplaceString( - result, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%LINENUMBER") ), line ); + result = ReplaceString(result, "%LANGUAGENAME", language ); + result = ReplaceString(result, "%SCRIPTNAME", script ); + result = ReplaceString(result, "%LINENUMBER", line ); if ( !type.isEmpty() ) { - result += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\n") ); - result += ::rtl::OUString(String(CUI_RES(RID_SVXSTR_ERROR_TYPE_LABEL))); - result += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ") ); - result += type; + result += "\n\n" + + OUString(CUI_RES(RID_SVXSTR_ERROR_TYPE_LABEL)) + + " " + + type; } if ( !message.isEmpty() ) { - result += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\n") ); - result += ::rtl::OUString(String(CUI_RES(RID_SVXSTR_ERROR_MESSAGE_LABEL))); - result += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ") ); - result += message; + result += "\n\n" + + OUString(CUI_RES(RID_SVXSTR_ERROR_MESSAGE_LABEL)) + + " " + + message; } return result; } -::rtl::OUString GetErrorMessage( +OUString GetErrorMessage( const provider::ScriptErrorRaisedException& eScriptError ) { - ::rtl::OUString unformatted = String( CUI_RES( RID_SVXSTR_ERROR_AT_LINE ) ); + OUString unformatted = CUI_RES( RID_SVXSTR_ERROR_AT_LINE ); - ::rtl::OUString unknown( RTL_CONSTASCII_USTRINGPARAM("UNKNOWN") ); - ::rtl::OUString language = unknown; - ::rtl::OUString script = unknown; - ::rtl::OUString line = unknown; - ::rtl::OUString type = ::rtl::OUString(); - ::rtl::OUString message = eScriptError.Message; + OUString unknown("UNKNOWN"); + OUString language = unknown; + OUString script = unknown; + OUString line = unknown; + OUString type = OUString(); + OUString message = eScriptError.Message; if ( !eScriptError.language.isEmpty() ) { @@ -1340,32 +1333,29 @@ void SvxScriptOrgDialog::RestorePreviousSelection() } if ( eScriptError.lineNum != -1 ) { - line = ::rtl::OUString::valueOf( eScriptError.lineNum ); - unformatted = String( - CUI_RES( RID_SVXSTR_ERROR_AT_LINE ) ); + line = OUString::valueOf( eScriptError.lineNum ); + unformatted = CUI_RES( RID_SVXSTR_ERROR_AT_LINE ); } else { - unformatted = String( - CUI_RES( RID_SVXSTR_ERROR_RUNNING ) ); + unformatted = CUI_RES( RID_SVXSTR_ERROR_RUNNING ); } return FormatErrorString( unformatted, language, script, line, type, message ); } -::rtl::OUString GetErrorMessage( +OUString GetErrorMessage( const provider::ScriptExceptionRaisedException& eScriptException ) { - ::rtl::OUString unformatted = - String( CUI_RES( RID_SVXSTR_EXCEPTION_AT_LINE ) ); + OUString unformatted = CUI_RES( RID_SVXSTR_EXCEPTION_AT_LINE ); - ::rtl::OUString unknown( RTL_CONSTASCII_USTRINGPARAM("UNKNOWN") ); - ::rtl::OUString language = unknown; - ::rtl::OUString script = unknown; - ::rtl::OUString line = unknown; - ::rtl::OUString type = unknown; - ::rtl::OUString message = eScriptException.Message; + OUString unknown("UNKNOWN"); + OUString language = unknown; + OUString script = unknown; + OUString line = unknown; + OUString type = unknown; + OUString message = eScriptException.Message; if ( !eScriptException.language.isEmpty() ) { @@ -1383,14 +1373,12 @@ void SvxScriptOrgDialog::RestorePreviousSelection() if ( eScriptException.lineNum != -1 ) { - line = ::rtl::OUString::valueOf( eScriptException.lineNum ); - unformatted = String( - CUI_RES( RID_SVXSTR_EXCEPTION_AT_LINE ) ); + line = OUString::valueOf( eScriptException.lineNum ); + unformatted = CUI_RES( RID_SVXSTR_EXCEPTION_AT_LINE ); } else { - unformatted = String( - CUI_RES( RID_SVXSTR_EXCEPTION_RUNNING ) ); + unformatted = CUI_RES( RID_SVXSTR_EXCEPTION_RUNNING ); } if ( !eScriptException.exceptionType.isEmpty() ) @@ -1402,17 +1390,16 @@ void SvxScriptOrgDialog::RestorePreviousSelection() unformatted, language, script, line, type, message ); } -::rtl::OUString GetErrorMessage( +OUString GetErrorMessage( const provider::ScriptFrameworkErrorException& sError ) { - ::rtl::OUString unformatted = String( - CUI_RES( RID_SVXSTR_FRAMEWORK_ERROR_RUNNING ) ); + OUString unformatted = CUI_RES( RID_SVXSTR_FRAMEWORK_ERROR_RUNNING ); - ::rtl::OUString language( RTL_CONSTASCII_USTRINGPARAM("UNKNOWN") ); + OUString language("UNKNOWN"); - ::rtl::OUString script( RTL_CONSTASCII_USTRINGPARAM("UNKNOWN") ); + OUString script("UNKNOWN"); - ::rtl::OUString message; + OUString message; if ( !sError.scriptName.isEmpty() ) { @@ -1424,10 +1411,9 @@ void SvxScriptOrgDialog::RestorePreviousSelection() } if ( sError.errorType == provider::ScriptFrameworkErrorType::NOTSUPPORTED ) { - message = String( + message = OUString( CUI_RES( RID_SVXSTR_ERROR_LANG_NOT_SUPPORTED ) ); - message = ReplaceString( - message, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%LANGUAGENAME") ), language ); + message = ReplaceString(message, "%LANGUAGENAME", language ); } else @@ -1435,28 +1421,28 @@ void SvxScriptOrgDialog::RestorePreviousSelection() message = sError.Message; } return FormatErrorString( - unformatted, language, script, ::rtl::OUString(), ::rtl::OUString(), message ); + unformatted, language, script, OUString(), OUString(), message ); } -::rtl::OUString GetErrorMessage( const RuntimeException& re ) +OUString GetErrorMessage( const RuntimeException& re ) { Type t = ::getCppuType( &re ); - ::rtl::OUString message = t.getTypeName(); + OUString message = t.getTypeName(); message += re.Message; return message; } -::rtl::OUString GetErrorMessage( const Exception& e ) +OUString GetErrorMessage( const Exception& e ) { Type t = ::getCppuType( &e ); - ::rtl::OUString message = t.getTypeName(); + OUString message = t.getTypeName(); message += e.Message; return message; } -::rtl::OUString GetErrorMessage( const com::sun::star::uno::Any& aException ) +OUString GetErrorMessage( const com::sun::star::uno::Any& aException ) { if ( aException.getValueType() == ::getCppuType( (const reflection::InvocationTargetException* ) NULL ) ) @@ -1525,14 +1511,14 @@ short SvxScriptErrorDialog::Execute() // SvxScriptErrorDialog may be deleted before ShowDialog is called Application::PostUserEvent( LINK( this, SvxScriptErrorDialog, ShowDialog ), - new rtl::OUString( m_sMessage ) ); + new OUString( m_sMessage ) ); return 0; } -IMPL_LINK( SvxScriptErrorDialog, ShowDialog, ::rtl::OUString*, pMessage ) +IMPL_LINK( SvxScriptErrorDialog, ShowDialog, OUString*, pMessage ) { - ::rtl::OUString message; + OUString message; if ( pMessage && !pMessage->isEmpty() ) { @@ -1540,7 +1526,7 @@ IMPL_LINK( SvxScriptErrorDialog, ShowDialog, ::rtl::OUString*, pMessage ) } else { - message = String( CUI_RES( RID_SVXSTR_ERROR_TITLE ) ); + message = OUString( CUI_RES( RID_SVXSTR_ERROR_TITLE ) ); } MessBox* pBox = new WarningBox( NULL, WB_OK, message ); diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 8480b2398aae..6e04e19076ea 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -214,11 +214,10 @@ AlternativesExtraData * ThesaurusAlternativesCtrl::GetExtraData( SvTreeListEntry * ThesaurusAlternativesCtrl::AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ) { SvTreeListEntry* pEntry = new SvTreeListEntry; - String aText; + OUString aText; if (bIsHeader && nVal >= 0) { - aText = String::CreateFromInt32( nVal ); - aText += rtl::OUString(". "); + aText = OUString::number( nVal ) + ". "; } pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column aText += rText; diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx index 6364dbb06428..cacf1b56c948 100644 --- a/cui/source/inc/scriptdlg.hxx +++ b/cui/source/inc/scriptdlg.hxx @@ -174,7 +174,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::script::browse::XBrowseNode > getBrowseNode( SvTreeListEntry* pEntry ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getModel( SvTreeListEntry* pEntry ); - String getListOfChildren( ::com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node, int depth ); + OUString getListOfChildren( ::com::sun::star::uno::Reference< com::sun::star::script::browse::XBrowseNode > node, int depth ); void StoreCurrentSelection(); void RestorePreviousSelection(); diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 4f0139974f35..0f79ebfbdd40 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -124,16 +124,16 @@ void SvxChartColorTable::useDefault() String SvxChartColorTable::getDefaultName( size_t _nIndex ) { - String aName; + OUString aName; - if (sDefaultNamePrefix.Len() == 0) + if (sDefaultNamePrefix.getLength() == 0) { - String aResName( CUI_RES( RID_SVXSTR_DIAGRAM_ROW ) ); - xub_StrLen nPos = aResName.SearchAscii( "$(ROW)" ); - if( nPos != STRING_NOTFOUND ) + OUString aResName( CUI_RES( RID_SVXSTR_DIAGRAM_ROW ) ); + sal_Int32 nPos = aResName.indexOf( "$(ROW)" ); + if( nPos != -1 ) { - sDefaultNamePrefix = String( aResName, 0, nPos ); - sDefaultNamePostfix = String( aResName, nPos + sizeof( "$(ROW)" ) - 1, STRING_LEN ); + sDefaultNamePrefix = aResName.copy( 0, nPos ); + sDefaultNamePostfix = aResName.copy( nPos + sizeof( "$(ROW)" ) - 1 ); } else { @@ -141,9 +141,7 @@ String SvxChartColorTable::getDefaultName( size_t _nIndex ) } } - aName = sDefaultNamePrefix; - aName.Append( String::CreateFromInt32 ( _nIndex + 1 ) ); - aName.Append( sDefaultNamePostfix ); + aName = sDefaultNamePrefix + OUString::number(_nIndex + 1) + sDefaultNamePostfix; nNextElementNumber++; return aName; @@ -218,13 +216,14 @@ sal_Bool SvxChartOptions::RetrieveOptions() Color aCol; // create strings for entry names - String aResName( CUI_RES( RID_SVXSTR_DIAGRAM_ROW ) ); - String aPrefix, aPostfix, aName; - xub_StrLen nPos = aResName.SearchAscii( "$(ROW)" ); - if( nPos != STRING_NOTFOUND ) + OUString aResName( CUI_RES( RID_SVXSTR_DIAGRAM_ROW ) ); + OUString aPrefix, aPostfix, aName; + sal_Int32 nPos = aResName.indexOf( "$(ROW)" ); + if( nPos != -1 ) { - aPrefix = String( aResName, 0, nPos ); - aPostfix = String( aResName, nPos + sizeof( "$(ROW)" ) - 1, STRING_LEN ); + aPrefix = aResName.copy( 0, nPos ); + sal_Int32 idx = nPos + sizeof( "$(ROW)" ) - 1; + aPostfix = aResName.copy( idx, aResName.getLength()-idx ); } else aPrefix = aResName; @@ -234,9 +233,7 @@ sal_Bool SvxChartOptions::RetrieveOptions() { aCol.SetColor( (static_cast< ColorData >(aColorSeq[ i ] ))); - aName = aPrefix; - aName.Append( String::CreateFromInt32( i + 1 )); - aName.Append( aPostfix ); + aName = aPrefix + OUString::number(i + 1) + aPostfix; maDefColors.append( XColorEntry( aCol, aName )); } diff --git a/cui/source/options/cfgchart.hxx b/cui/source/options/cfgchart.hxx index d3f995ef9b01..1319702a5d46 100644 --- a/cui/source/options/cfgchart.hxx +++ b/cui/source/options/cfgchart.hxx @@ -36,8 +36,8 @@ class SvxChartColorTable private: ::std::vector< XColorEntry > m_aColorEntries; int nNextElementNumber; - String sDefaultNamePrefix; - String sDefaultNamePostfix; + OUString sDefaultNamePrefix; + OUString sDefaultNamePostfix; public: SvxChartColorTable(); diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 56b094ccde7e..381a8f4fda9b 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -225,7 +225,7 @@ namespace offapp break; case 3: if (_rPos->bEnabled) - sReturn = String::CreateFromInt32(_rPos->nTimeoutSeconds); + sReturn = OUString::number(_rPos->nTimeoutSeconds); break; default: OSL_FAIL("DriverListControl::implGetCellText: invalid column id!"); @@ -440,7 +440,7 @@ namespace offapp m_aDriver.SetText(pDriverPos->sName); m_aDriverPoolingEnabled.Check(pDriverPos->bEnabled); - m_aTimeout.SetText(String::CreateFromInt32(pDriverPos->nTimeoutSeconds)); + m_aTimeout.SetText(OUString::number(pDriverPos->nTimeoutSeconds)); OnEnabledDisabled(&m_aDriverPoolingEnabled); } diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index aa500b45a96c..d6ccf4f36e04 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -266,11 +266,10 @@ void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet ) void DbRegistrationOptionsPage::FillUserData() { - String aUserData = String::CreateFromInt32( pHeaderBar->GetItemSize( ITEMID_TYPE ) ); - aUserData += ';'; + OUString aUserData = OUString::number( pHeaderBar->GetItemSize( ITEMID_TYPE ) ) + ";"; HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE ); sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); - aUserData += (bUp ? '1' : '0'); + aUserData += (bUp ? OUString("1") : OUString("0")); SetUserData( aUserData ); } // ----------------------------------------------------------------------- diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 1ce2e89c4281..c15f1578af75 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -135,15 +135,15 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent, sal_uInt16 nHeight; for(nHeight = 6; nHeight <= 16; nHeight++) - aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight)); + aFontHeightLB.InsertEntry(OUString::number(nHeight)); for(nHeight = 18; nHeight <= 28; nHeight+= 2) - aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight)); + aFontHeightLB.InsertEntry(OUString::number(nHeight)); for(nHeight = 32; nHeight <= 48; nHeight+= 4) - aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight)); + aFontHeightLB.InsertEntry(OUString::number(nHeight)); for(nHeight = 54; nHeight <= 72; nHeight+= 6) - aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight)); + aFontHeightLB.InsertEntry(OUString::number(nHeight)); for(nHeight = 80; nHeight <= 96; nHeight+= 8) - aFontHeightLB.InsertEntry(String::CreateFromInt32(nHeight)); + aFontHeightLB.InsertEntry(OUString::number(nHeight)); } SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(String& rFont1, String& rFont2) @@ -262,7 +262,7 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet& ) else aFontNameLB.SelectEntryPos(0); aFontHeightLB.SelectEntry( - String::CreateFromInt32( + OUString::number( officecfg::Office::Common::Font::SourceViewFont::FontHeight:: get())); aNonPropFontsOnlyCB.SaveValue(); diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index cc217e40b0d1..632ac9eb9b82 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -1402,7 +1402,7 @@ IMPL_LINK(SvxColorOptionsTabPage, CheckNameHdl_Impl, AbstractSvxNameDialog*, pDi void SvxColorOptionsTabPage::FillUserData() { - SetUserData(String::CreateFromInt32(pColorConfigCT->GetScrollPosition())); + SetUserData(OUString::number(pColorConfigCT->GetScrollPosition())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 9bbfab856e90..cca9402c5ded 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -407,19 +407,19 @@ IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd ) { (void)pEd; - String aOutput( aStrDateInfo ); - String aStr( aYearValueField.GetText() ); - String sSep( SvtSysLocale().GetLocaleData().getNumThousandSep() ); - xub_StrLen nIndex = 0; - while ((nIndex = aStr.Search( sSep, nIndex)) != STRING_NOTFOUND) - aStr.Erase( nIndex, sSep.Len()); - long nNum = aStr.ToInt32(); - if ( aStr.Len() != 4 || nNum < aYearValueField.GetMin() || nNum > aYearValueField.GetMax() ) - aOutput.AppendAscii("????"); + OUString aOutput( aStrDateInfo ); + OUString aStr( aYearValueField.GetText() ); + OUString sSep( SvtSysLocale().GetLocaleData().getNumThousandSep() ); + sal_Int32 nIndex = 0; + while ((nIndex = aStr.indexOf( sSep, nIndex)) != -1) + aStr = aStr.replaceAt( nIndex, sSep.getLength(), ""); + sal_Int32 nNum = aStr.toInt32(); + if ( aStr.getLength() != 4 || nNum < aYearValueField.GetMin() || nNum > aYearValueField.GetMax() ) + aOutput += "????"; else { nNum += 99; - aOutput += String::CreateFromInt32( nNum ); + aOutput += OUString::number( nNum ); } aToYearFT.SetText( aOutput ); return 0; @@ -430,7 +430,7 @@ IMPL_LINK( OfaMiscTabPage, TwoFigureHdl, NumericField*, pEd ) IMPL_LINK( OfaMiscTabPage, TwoFigureConfigHdl, NumericField*, pEd ) { sal_Int64 nNum = aYearValueField.GetValue(); - rtl::OUString aOutput(rtl::OUString::valueOf(nNum)); + rtl::OUString aOutput(rtl::OUString::number(nNum)); aYearValueField.SetText(aOutput); aYearValueField.SetSelection( Selection( 0, aOutput.getLength() ) ); TwoFigureHdl( pEd ); @@ -1185,11 +1185,11 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe // initialize user interface language selection SvtLanguageTable* pLanguageTable = new SvtLanguageTable; - const String aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) ); + const OUString aStr( pLanguageTable->GetString( LANGUAGE_SYSTEM ) ); - String aUILang(aStr); - aUILang += rtl::OUString(" - "); - aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguageTag().getLanguageType(), true ); + OUString aUILang = aStr + + " - " + + pLanguageTable->GetString( Application::GetSettings().GetUILanguageTag().getLanguageType(), true ); aUserInterfaceLB.InsertEntry(aUILang); aUserInterfaceLB.SetEntryData(0, 0); @@ -1214,7 +1214,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe if (aLang != LANGUAGE_DONTKNOW) { //sal_uInt16 p = aUserInterfaceLB.InsertLanguage(aLang); - String aLangStr( pLanguageTable->GetString( aLang, true ) ); + OUString aLangStr( pLanguageTable->GetString( aLang, true ) ); sal_uInt16 p = aUserInterfaceLB.InsertEntry(aLangStr); aUserInterfaceLB.SetEntryData(p, (void*)(i+1)); } @@ -1261,23 +1261,21 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe const NfCurrencyTable& rCurrTab = SvNumberFormatter::GetTheCurrencyTable(); const NfCurrencyEntry& rCurr = SvNumberFormatter::GetCurrencyEntry( LANGUAGE_SYSTEM ); // insert SYSTEM entry - String aDefaultCurr(aStr); - aDefaultCurr += rtl::OUString(" - "); - aDefaultCurr += rCurr.GetBankSymbol(); + OUString aDefaultCurr = aStr + " - " + rCurr.GetBankSymbol(); aCurrencyLB.InsertEntry( aDefaultCurr ); // all currencies - String aTwoSpace( RTL_CONSTASCII_USTRINGPARAM( " " ) ); + OUString aTwoSpace( " " ); sal_uInt16 nCurrCount = rCurrTab.size(); // first entry is SYSTEM, skip it for ( sal_uInt16 j=1; j < nCurrCount; ++j ) { const NfCurrencyEntry* pCurr = &rCurrTab[j]; - String aStr_( pCurr->GetBankSymbol() ); - aStr_ += aTwoSpace; - aStr_ += pCurr->GetSymbol(); - aStr_ = ApplyLreOrRleEmbedding( aStr_ ); - aStr_ += aTwoSpace; - aStr_ += ApplyLreOrRleEmbedding( pLanguageTable->GetString( pCurr->GetLanguage() ) ); + OUString aStr_ = pCurr->GetBankSymbol() + + aTwoSpace + + pCurr->GetSymbol(); + aStr_ = ApplyLreOrRleEmbedding( aStr_ ) + + aTwoSpace + + ApplyLreOrRleEmbedding( pLanguageTable->GetString( pCurr->GetLanguage() ) ); sal_uInt16 nPos = aCurrencyLB.InsertEntry( aStr_ ); aCurrencyLB.SetEntryData( nPos, (void*) pCurr ); } @@ -1840,8 +1838,8 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, SvxLanguageBox*, pBox ) LocaleDataWrapper aLocaleWrapper( aLanguageTag ); // update the decimal separator key of the related CheckBox - String sTempLabel(sDecimalSeparatorLabel); - sTempLabel.SearchAndReplaceAscii("%1", aLocaleWrapper.getNumDecimalSep() ); + OUString sTempLabel(sDecimalSeparatorLabel); + sTempLabel = sTempLabel.replaceFirst("%1", aLocaleWrapper.getNumDecimalSep() ); aDecimalSeparatorCB.SetText(sTempLabel); // update the date acceptance patterns diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 37a4c63d0e7f..9bccdd0ddd55 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -241,7 +241,7 @@ void SvxProxyTabPage::ReadConfigData_Impl() if( xNameAccess->getByName(aHttpPortPN) >>= nIntValue ) { - aHttpPortED.SetText( String::CreateFromInt32( nIntValue )); + aHttpPortED.SetText( OUString::number( nIntValue )); } if( xNameAccess->getByName(aHttpsProxyPN) >>= aStringValue ) @@ -251,7 +251,7 @@ void SvxProxyTabPage::ReadConfigData_Impl() if( xNameAccess->getByName(aHttpsPortPN) >>= nIntValue ) { - aHttpsPortED.SetText( String::CreateFromInt32( nIntValue )); + aHttpsPortED.SetText( OUString::number( nIntValue )); } if( xNameAccess->getByName(aFtpProxyPN) >>= aStringValue ) @@ -261,7 +261,7 @@ void SvxProxyTabPage::ReadConfigData_Impl() if( xNameAccess->getByName(aFtpPortPN) >>= nIntValue ) { - aFtpPortED.SetText( String::CreateFromInt32( nIntValue )); + aFtpPortED.SetText( OUString::number( nIntValue )); } if( xNameAccess->getByName(aNoProxyDescPN) >>= aStringValue ) @@ -300,7 +300,7 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() if( xPropertyState->getPropertyDefault(aHttpPortPN) >>= nIntValue ) { - aHttpPortED.SetText( String::CreateFromInt32( nIntValue )); + aHttpPortED.SetText( OUString::number( nIntValue )); } if( xPropertyState->getPropertyDefault(aHttpsProxyPN) >>= aStringValue ) @@ -310,7 +310,7 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() if( xPropertyState->getPropertyDefault(aHttpsPortPN) >>= nIntValue ) { - aHttpsPortED.SetText( String::CreateFromInt32( nIntValue )); + aHttpsPortED.SetText( OUString::number( nIntValue )); } if( xPropertyState->getPropertyDefault(aFtpProxyPN) >>= aStringValue ) @@ -320,7 +320,7 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() if( xPropertyState->getPropertyDefault(aFtpPortPN) >>= nIntValue ) { - aFtpPortED.SetText( String::CreateFromInt32( nIntValue )); + aFtpPortED.SetText( OUString::number( nIntValue )); } if( xPropertyState->getPropertyDefault(aNoProxyDescPN) >>= aStringValue ) @@ -609,11 +609,11 @@ void SvxScriptExecListBox::RequestHelp( const HelpEvent& rHEvt ) } else // if not, nothing happens. return; - String aHelpText; + OUString aHelpText; if( nPos <= nTop+nCount-1 ) // if find the matching entry, get its content. aHelpText = GetEntry(nPos); - if( aHelpText.Len() && GetTextWidth(aHelpText)GetItemSize( ITEMID_TYPE ) ); - aUserData += ';'; + String aUserData = OUString::number( pHeaderBar->GetItemSize( ITEMID_TYPE ) ) + ";"; HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE ); sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); aUserData += bUp ? '1' : '0'; diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 394ece1bd0eb..14d3a193dbcd 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -423,12 +423,12 @@ void SfxSaveTabPage::Reset( const SfxItemSet& ) { long nData = (long) aDocTypeLB.GetEntryData(n); OUString sCommand; - sCommand = "matchByDocumentService=%1:iflags="; - sCommand += String::CreateFromInt32(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT); - sCommand += ":eflags="; - sCommand += String::CreateFromInt32(SFX_FILTER_NOTINFILEDLG); - sCommand += ":default_first"; - String sReplace; + sCommand = "matchByDocumentService=%1:iflags=" + + OUString::number(SFX_FILTER_IMPORT|SFX_FILTER_EXPORT) + + ":eflags=" + + OUString::number(SFX_FILTER_NOTINFILEDLG) + + ":default_first"; + OUString sReplace; switch(nData) { case APP_WRITER : sReplace = "com.sun.star.text.TextDocument"; break; @@ -440,8 +440,7 @@ void SfxSaveTabPage::Reset( const SfxItemSet& ) case APP_MATH : sReplace = "com.sun.star.formula.FormulaProperties";break; default: OSL_FAIL("illegal user data"); } - String sTmp(sCommand); - sTmp.SearchAndReplaceAscii("%1", sReplace); + OUString sTmp = sCommand.replaceFirst("%1", sReplace); sCommand = sTmp; Reference< XEnumeration > xList = xQuery->createSubSetEnumerationByQuery(sCommand); SequenceAsVector< OUString > lList; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 30cffee230f2..78646f103902 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -553,7 +553,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog() String aPageData(pPageInfo->m_pPage->GetUserData()); if ( aPageData.Len() ) { - SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pPageInfo->m_nPageId ) ); + SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) ); SetViewOptUserItem( aTabPageOpt, aPageData ); } delete pPageInfo->m_pPage; @@ -1071,7 +1071,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created"); if ( pPageInfo->m_pPage ) { - SvtViewOptions aTabPageOpt( E_TABPAGE, String::CreateFromInt32( pPageInfo->m_nPageId ) ); + SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) ); pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) ); Point aPagePos( aSeparatorFL.GetPosPixel().X(), aTreeLB.GetPosPixel().Y()); diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 17c55e2c4415..6ad64ebf3c7e 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -269,8 +269,8 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const { if ( IsProperty( i ) ) { - OString aString("Prop_adjustValue" + OString::valueOf((static_cast( ( i - DFF_Prop_adjustValue ) + 1 ) )) + - ":" + OString::valueOf(static_cast(GetPropertyValue(i)))); + OString aString("Prop_adjustValue" + OString::number( ( i - DFF_Prop_adjustValue ) + 1 ) + + ":" + OString::number(GetPropertyValue(i)) ); pOut->WriteLine(aString); } } @@ -288,7 +288,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const { pOut->WriteLine( "" ); OStringBuffer aDesc("Property:" + OString::number(i) + - " Size:" + OString::valueOf(nLen)); + " Size:" + OString::number(nLen)); pOut->WriteLine(aDesc.makeStringAndClear()); sal_Int16 nNumElem, nNumElemMem, nNumSize; rIn >> nNumElem >> nNumElemMem >> nNumSize; @@ -332,7 +332,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const else { OString aString("Property" + OString::number(i) + - ":" + OString::valueOf(static_cast(GetPropertyValue(i)))); + ":" + OString::number(GetPropertyValue(i))); pOut->WriteLine(aString); } } @@ -6126,16 +6126,15 @@ sal_Bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, // extract graphics from ole storage into "dbggfxNNN.*" static sal_Int32 nGrfCount; - String aFileName( "dbggfx" ); - aFileName.Append( String::CreateFromInt32( nGrfCount++ ) ); + OUString aFileName = "dbggfx" + OUString::number( nGrfCount++ ); switch( nInst &~ 1 ) { - case 0x216 : aFileName.Append( ".wmf" ); break; - case 0x3d4 : aFileName.Append( ".emf" ); break; - case 0x542 : aFileName.Append( ".pct" ); break; - case 0x46a : aFileName.Append( ".jpg" ); break; - case 0x6e0 : aFileName.Append( ".png" ); break; - case 0x7a8 : aFileName.Append( ".bmp" ); break; + case 0x216 : aFileName += ".wmf"; break; + case 0x3d4 : aFileName += ".emf"; break; + case 0x542 : aFileName += ".pct"; break; + case 0x46a : aFileName += ".jpg"; break; + case 0x6e0 : aFileName += ".png"; break; + case 0x7a8 : aFileName += ".bmp"; break; } rtl::OUString aURLStr; diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 8713b6703c77..43890deae91a 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -585,8 +585,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent maCbReduceImageResolution.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleReduceImageResolutionHdl ) ); const sal_Bool bReduceImageResolution = paParent->mbReduceImageResolution; maCbReduceImageResolution.Check( bReduceImageResolution ); - String aStrRes( String::CreateFromInt32( paParent->mnMaxImageResolution ) ); - aStrRes.Append( String( RTL_CONSTASCII_USTRINGPARAM( " DPI" ) ) ); + OUString aStrRes = OUString::number( paParent->mnMaxImageResolution ) + " DPI"; maCoReduceImageResolution.SetText( aStrRes ); maCoReduceImageResolution.Enable( bReduceImageResolution ); maCbWatermark.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleWatermarkHdl ) ); diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 23d8ec862420..004dcf01f5db 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -119,7 +119,7 @@ void ParaWin::UpdateArgDesc( sal_uInt16 nArg ) aArgDesc = pFuncDesc->getParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); if ( nArg >= nFix ) - aArgName += String::CreateFromInt32(nArg-nFix+1); + aArgName += OUString::number( nArg-nFix+1 ); aArgName += ' '; aArgName += (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; @@ -137,7 +137,7 @@ void ParaWin::UpdateArgDesc( sal_uInt16 nArg ) aArgDesc = pFuncDesc->getParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); if ( nArg >= nFix ) - aArgName += String::CreateFromInt32((nArg-nFix)/2 + 1); + aArgName += OUString::number( (nArg-nFix)/2 + 1 ); aArgName += ' '; aArgName += (nArg > (nFix+1) || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; @@ -173,7 +173,7 @@ void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) if ( nArg >= nFix ) { String aArgName( pFuncDesc->getParameterName(nRealArg) ); - aArgName += String::CreateFromInt32(nArg-nFix+1); + aArgName += OUString::number(nArg-nFix+1); SetArgName( i, aArgName ); } else @@ -195,7 +195,7 @@ void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) if ( nArg >= nFix ) { String aArgName( pFuncDesc->getParameterName(nRealArg) ); - aArgName += String::CreateFromInt32((nArg-nFix)/2 + 1); + aArgName += OUString::number( (nArg-nFix)/2 + 1 ); SetArgName( i, aArgName ); } else diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index ed0944ac4668..6e5a30947a1b 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -702,8 +702,8 @@ void Condition::fillFormatCondition(const uno::Reference< report::XFormatConditi void Condition::setConditionIndex( size_t _nCondIndex, size_t _nCondCount ) { m_nCondIndex = _nCondIndex; - String sHeader( ModuleRes( STR_NUMBERED_CONDITION ) ); - sHeader.SearchAndReplaceAscii( "$number$", String::CreateFromInt32( _nCondIndex + 1 ) ); + OUString sHeader( ModuleRes( STR_NUMBERED_CONDITION ) ); + sHeader = sHeader.replaceFirst( "$number$", OUString::number( _nCondIndex + 1) ); m_aHeader.SetText( sHeader ); m_aMoveUp.Enable( _nCondIndex > 0 ); diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index fe4c5cd19279..c60bd113567f 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -157,7 +157,7 @@ ODesignView::~ODesignView() } if ( m_pReportExplorer ) { - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_NAVIGATOR ) ); + SvtViewOptions aDlgOpt( E_WINDOW, OUString::number( RID_NAVIGATOR) ); aDlgOpt.SetWindowState(::rtl::OStringToOUString(m_pReportExplorer->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US)); notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); SAL_WNODEPRECATED_DECLARATIONS_PUSH @@ -508,7 +508,7 @@ void ODesignView::toggleReportExplorer() { OReportController& rReportController = getController(); m_pReportExplorer = new ONavigator(this,rReportController); - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_NAVIGATOR ) ); + SvtViewOptions aDlgOpt( E_WINDOW, OUString::number( RID_NAVIGATOR) ); if ( aDlgOpt.Exists() ) m_pReportExplorer->SetWindowState(rtl::OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US)); m_pReportExplorer->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl)); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index e8ab953af5a2..79fb2890483f 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -342,7 +342,7 @@ void OReportController::disposing() } if ( m_pGroupsFloater ) { - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_GROUPS_SORTING ) ); + SvtViewOptions aDlgOpt( E_WINDOW, OUString::number( RID_GROUPS_SORTING ) ); aDlgOpt.SetWindowState(::rtl::OStringToOUString(m_pGroupsFloater->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US)); SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr aTemp(m_pGroupsFloater); @@ -2546,7 +2546,7 @@ void OReportController::openSortingAndGroupingDialog() if ( !m_pGroupsFloater ) { m_pGroupsFloater = new OGroupsSortingDialog(getView(),!isEditable(),this); - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_GROUPS_SORTING ) ); + SvtViewOptions aDlgOpt( E_WINDOW, OUString::number( RID_GROUPS_SORTING) ); if ( aDlgOpt.Exists() ) m_pGroupsFloater->SetWindowState(::rtl::OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US)); m_pGroupsFloater->AddEventListener(LINK(this,OReportController,EventLstHdl)); @@ -2752,7 +2752,7 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept ::std::vector::iterator aEnd = aCollapsedPositions.end(); for (sal_Int32 i = 1; aIter != aEnd ; ++aIter,++pCollapsedIter,++i) { - pCollapsedIter->Name = PROPERTY_SECTION + ::rtl::OUString::valueOf(i); + pCollapsedIter->Name = PROPERTY_SECTION + OUString::number(i); pCollapsedIter->Value <<= static_cast(*aIter); } -- cgit