[Libreoffice-commits] core.git: formula/source framework/source linguistic/source linguistic/workben lotuswordpro/source padmin/source reportdesign/source sc/source

Ricardo Montania ricardo at linuxafundo.com.br
Wed May 15 06:58:43 PDT 2013


 formula/source/ui/dlg/formula.cxx                          |   18 ++---
 framework/source/uielement/langselectionmenucontroller.cxx |   24 +++----
 linguistic/source/misc2.cxx                                |    9 --
 linguistic/workben/sspellimp.cxx                           |    6 -
 lotuswordpro/source/filter/lwptblformula.cxx               |   42 ++++---------
 padmin/source/adddlg.cxx                                   |    8 +-
 padmin/source/cmddlg.cxx                                   |    5 -
 padmin/source/padialog.cxx                                 |   13 +---
 padmin/source/prtsetup.cxx                                 |    4 -
 reportdesign/source/ui/dlg/AddField.cxx                    |    5 -
 sc/source/core/data/stlpool.cxx                            |   20 +++---
 11 files changed, 61 insertions(+), 93 deletions(-)

New commits:
commit 8a9448aabcee0171b0dc3b0401600de09455fb10
Author: Ricardo Montania <ricardo at linuxafundo.com.br>
Date:   Mon May 13 16:14:52 2013 -0300

    String.AppendAscii Drop
    
    Signed-off-by: Luboš Luňák <l.lunak at suse.cz>
    https://gerrit.libreoffice.org/#/c/3892/
    
    Change-Id: I12175a81f0a74546b5e00633176f204b9a3fb35c

diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 51bb4e4..4891bd1 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -823,11 +823,10 @@ void FormulaDlg_Impl::FillControls(sal_Bool &rbNext, sal_Bool &rbPrev)
     //  2. Page or Edit: show selected function
 
     xub_StrLen nFStart     = pData->GetFStart();
-    String aFormula        = m_pHelper->getCurrentFormula();
+    OUString aFormula      = OUString(m_pHelper->getCurrentFormula()) + " )";
     xub_StrLen nNextFStart = nFStart;
     xub_StrLen nNextFEnd   = 0;
 
-    aFormula.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " )" ));
     DeleteArgs();
     const IFunctionDescription* pOldFuncDesc = pFuncDesc;
     sal_Bool bTestFlag = sal_False;
@@ -1035,8 +1034,7 @@ IMPL_LINK_NOARG(FormulaDlg_Impl, DblClkHdl)
     const IFunctionDescription* pDesc = pFuncPage->GetFuncDesc(nFunc);
     m_pHelper->insertEntryToLRUList(pDesc);
 
-    String aFuncName = pFuncPage->GetSelFunctionName();
-    aFuncName.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "()" ));
+    OUString aFuncName = OUString( pFuncPage->GetSelFunctionName() ) + "()";
     m_pHelper->setCurrentFormula(aFuncName);
     pMEdit->ReplaceSelected(aFuncName);
 
@@ -1428,16 +1426,14 @@ void FormulaDlg_Impl::RefInputStartAfter( RefEdit* /*pEdit*/, RefButton* /*pButt
 
     if( pTheRefEdit )
     {
-        String aStr = aTitle2;
-        aStr += ' ';
-        aStr += aFtEditName.GetText();
-        aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "( " ) );
+        OUString aStr = OUString(aTitle2) + " " + aFtEditName.GetText() + "( ";
+
         if( pParaWin->GetActiveLine() > 0 )
-            aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "...; " ) );
+            aStr += "...; ";
         aStr += pParaWin->GetActiveArgName();
         if( pParaWin->GetActiveLine() + 1 < nArgs )
-            aStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "; ..." ));
-        aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " )" ) );
+            aStr += "; ...";
+        aStr += " )";
 
         m_pParent->SetText( MnemonicGenerator::EraseAllMnemonicChars( aStr ) );
     }
diff --git a/framework/source/uielement/langselectionmenucontroller.cxx b/framework/source/uielement/langselectionmenucontroller.cxx
index 28a67b9..5bcbbf3 100644
--- a/framework/source/uielement/langselectionmenucontroller.cxx
+++ b/framework/source/uielement/langselectionmenucontroller.cxx
@@ -207,23 +207,23 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
     if ( pVCLPopupMenu )
         pPopupMenu = (PopupMenu *)pVCLPopupMenu->GetMenu();
 
-    String aCmd;
-    String aCmd_Dialog;
-    String aCmd_Language;
+    OUString aCmd;
+    OUString aCmd_Dialog;
+    OUString aCmd_Language;
     if( eMode == MODE_SetLanguageSelectionMenu )
     {
-        aCmd_Dialog.AppendAscii(".uno:FontDialog?Language:string=*");
-        aCmd_Language.AppendAscii(".uno:LanguageStatus?Language:string=Current_");
+        aCmd_Dialog += ".uno:FontDialog?Language:string=*";
+        aCmd_Language += ".uno:LanguageStatus?Language:string=Current_";
     }
     else if ( eMode == MODE_SetLanguageParagraphMenu )
     {
-        aCmd_Dialog.AppendAscii(".uno:FontDialogForParagraph");
-        aCmd_Language.AppendAscii(".uno:LanguageStatus?Language:string=Paragraph_");
+        aCmd_Dialog += ".uno:FontDialogForParagraph";
+        aCmd_Language += ".uno:LanguageStatus?Language:string=Paragraph_";
     }
     else if ( eMode == MODE_SetLanguageAllTextMenu )
     {
-        aCmd_Dialog.AppendAscii(".uno:LanguageStatus?Language:string=*");
-        aCmd_Language.AppendAscii(".uno:LanguageStatus?Language:string=Default_");
+        aCmd_Dialog += ".uno:LanguageStatus?Language:string=*";
+        aCmd_Language += ".uno:LanguageStatus?Language:string=Default_";
     }
 
     SvtLanguageTable    aLanguageTable;
@@ -264,15 +264,13 @@ void LanguageSelectionMenuController::fillPopupMenu( Reference< css::awt::XPopup
     // entry for LANGUAGE_NONE
     ++nItemId;
     pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_LANGSTATUS_NONE )) );
-    aCmd=aCmd_Language;
-    aCmd.AppendAscii("LANGUAGE_NONE");
+    aCmd = aCmd_Language + "LANGUAGE_NONE";
     pPopupMenu->SetItemCommand( nItemId, aCmd );
 
     // entry for 'Reset to default language'
     ++nItemId;
     pPopupMenu->InsertItem( nItemId, String(FwlResId( STR_RESET_TO_DEFAULT_LANGUAGE )) );
-    aCmd=aCmd_Language;
-    aCmd.AppendAscii("RESET_LANGUAGES");
+    aCmd = aCmd_Language + "RESET_LANGUAGES";
     pPopupMenu->SetItemCommand( nItemId, aCmd );
 
     // entry for opening the Format/Character dialog
diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx
index d3ed550..eab239d 100644
--- a/linguistic/source/misc2.cxx
+++ b/linguistic/source/misc2.cxx
@@ -73,12 +73,9 @@ static uno::Sequence< OUString > GetMultiPaths_Impl(
     uno::Reference< uno::XComponentContext >  xContext( comphelper::getProcessComponentContext() );
     try
     {
-        String aInternal( rPathPrefix );
-        String aUser( rPathPrefix );
-        String aWriteable( rPathPrefix );
-        aInternal .AppendAscii( "_internal" );
-        aUser     .AppendAscii( "_user" );
-        aWriteable.AppendAscii( "_writable" );
+        OUString aInternal( rPathPrefix + "_internal" );
+        OUString aUser( rPathPrefix + "_user" );
+        OUString aWriteable( rPathPrefix + "_writable" );
 
         uno::Reference< util::XPathSettings > xPathSettings =
             util::PathSettings::create( xContext );
diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx
index 91a18a3..775c2fa 100644
--- a/linguistic/workben/sspellimp.cxx
+++ b/linguistic/workben/sspellimp.cxx
@@ -450,9 +450,9 @@ sal_Bool SAL_CALL SpellChecker_writeInfo(
 {
     try
     {
-        String aImpl( '/' );
-        aImpl += SpellChecker::getImplementationName_Static().getStr();
-        aImpl.AppendAscii( "/UNO/SERVICES" );
+        OUString aImpl( "/" + SpellChecker::getImplementationName_Static().getStr() +
+            "/UNO/SERVICES" );
+
         Reference< registry::XRegistryKey > xNewKey =
                 pRegistryKey->createKey( aImpl );
         Sequence< OUString > aServices =
diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx
index a9988bc..0b69d05 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -485,12 +485,7 @@ LwpFormulaCellAddr::LwpFormulaCellAddr(sal_Int16 aCol, sal_Int16 aRow)
 */
 OUString LwpFormulaCellAddr::ToString(LwpTableLayout* pCellsMap)
 {
-    String aCellAddr;
-    aCellAddr.AppendAscii("<");//<
-
-    aCellAddr += LwpFormulaTools::GetCellAddr(m_aRow,m_aCol,pCellsMap);
-
-    aCellAddr.AppendAscii(">");//>
+    OUString aCellAddr = "<" + LwpFormulaTools::GetCellAddr(m_aRow,m_aCol,pCellsMap) + ">";
     return aCellAddr;
 }
 
@@ -521,14 +516,9 @@ LwpFormulaCellRangeAddr::LwpFormulaCellRangeAddr(sal_Int16 aStartCol,
 */
 OUString LwpFormulaCellRangeAddr::ToString(LwpTableLayout* pCellsMap)
 {
-    String aCellAddr;
-    aCellAddr.AppendAscii("<");//<
-
-    aCellAddr += LwpFormulaTools::GetCellAddr(m_aStartRow,m_aStartCol,pCellsMap);
-    aCellAddr.AppendAscii(":");
-    aCellAddr += LwpFormulaTools::GetCellAddr(m_aEndRow,m_aEndCol,pCellsMap);
-
-    aCellAddr.AppendAscii(">");//>
+    OUString aCellAddr = "<"
+        + LwpFormulaTools::GetCellAddr(m_aStartRow,m_aStartCol,pCellsMap) + ":"
+        + LwpFormulaTools::GetCellAddr(m_aEndRow,m_aEndCol,pCellsMap) + ">";
 
     return aCellAddr;
 }
@@ -602,24 +592,21 @@ String LwpFormulaFunc::ToArgString(LwpTableLayout* pCellsMap)
 */
 OUString LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
 {
-    String aFormula;
+    OUString aFormula;
 
-    String aFuncName = LwpFormulaTools::GetName(m_nTokenType);
-    aFormula += aFuncName;
-    aFormula.AppendAscii(" ");//Append a blank space
+    OUString aFuncName = LwpFormulaTools::GetName(m_nTokenType) + " ";
 
     //Append args
     vector<LwpFormulaArg*>::iterator aItr;
     for (aItr=m_aArgs.begin();aItr!=m_aArgs.end();++aItr)
     {
-        aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
-        aFormula.AppendAscii("|");//separator
+        aFormula += (*aItr)->ToArgString(pCellsMap) + "|"; //separator
     }
 
     //erase the last "|"
     if (!m_aArgs.empty())
     {
-        aFormula.Erase(aFormula.Len()-1,1);
+        aFormula.replaceAt(aFormula.getLength()-1,1,"");
     }
     else
     {
@@ -638,22 +625,19 @@ OUString LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
 */
 OUString LwpFormulaOp::ToString(LwpTableLayout* pCellsMap)
 {
-    String aFormula;
+    OUString aFormula;
     if (2==m_aArgs.size())
     {
         vector<LwpFormulaArg*>::iterator aItr = m_aArgs.end();
         --aItr;
-        aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
 
-        aFormula.AppendAscii(" ");
+        aFormula += (*aItr)->ToArgString(pCellsMap) + " ";
+        OUString aFuncName = LwpFormulaTools::GetName(m_nTokenType);
 
-        String aFuncName = LwpFormulaTools::GetName(m_nTokenType);
-        aFormula.Append(aFuncName);
-
-        aFormula.AppendAscii(" ");
+        aFormula += aFuncName + " ";
 
         --aItr;
-        aFormula.Append( (*aItr)->ToArgString(pCellsMap) );
+        aFormula += (*aItr)->ToArgString(pCellsMap);
     }
     else
     {
diff --git a/padmin/source/adddlg.cxx b/padmin/source/adddlg.cxx
index 4adb755..bb3487a 100644
--- a/padmin/source/adddlg.cxx
+++ b/padmin/source/adddlg.cxx
@@ -274,10 +274,10 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
                     FindFiles( aPPDDir, aFiles, OUString(  "PS;PPD;PS.GZ;PPD.GZ"  ), true );
                     for( file = aFiles.begin(); file != aFiles.end(); ++file )
                     {
-                        String aFile( aPPDDir );
-                        if( aFile.GetChar( aFile.Len() ) != '/' )
-                            aFile.AppendAscii( "/" );
-                        aFile.Append( *file );
+                        OUString aFile( aPPDDir );
+                        if( !aFile.endsWith( "/" ) )
+                            aFile += "/";
+                        aFile += *file;
 
                         int nPos = file->SearchBackward( '.' );
                         if( file->Copy( 0, nPos ) == String( aPPD ) )
diff --git a/padmin/source/cmddlg.cxx b/padmin/source/cmddlg.cxx
index c9b21ed..bbbbdc7 100644
--- a/padmin/source/cmddlg.cxx
+++ b/padmin/source/cmddlg.cxx
@@ -529,9 +529,8 @@ void RTSCommandPage::UpdateCommands()
 
 void RTSCommandPage::ConnectCommand()
 {
-    String aString( m_aConnectedTo.GetText().getToken( 0, ':' ) );
-    aString.AppendAscii( ": " );
-    aString += m_aCommandsCB.GetText();
+    OUString aString = ( m_aConnectedTo.GetText().getToken( 0, ':' ) )
+        + ": " + m_aCommandsCB.GetText();
 
     m_aConnectedTo.SetText( aString );
 }
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index c6adfc9..fe61848 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -254,10 +254,9 @@ void PADialog::UpdateText()
     if( !aDev.isEmpty() )
     {
         const PrinterInfo& rInfo = m_rPIManager.getPrinterInfo( aDev );
-        String aDriver( rInfo.m_aPrinterName );
-        aDriver.AppendAscii( " (" );
-        aDriver += String( rInfo.m_aDriverName );
-        aDriver.Append( ')' );
+
+        OUString aDriver = rInfo.m_aPrinterName + " (" + rInfo.m_aDriverName + ")";
+
         m_aDriver.SetText( aDriver );
         m_aCommand.SetText( rInfo.m_aCommand );
         m_aComment.SetText( rInfo.m_aComment );
@@ -707,12 +706,10 @@ void PADialog::UpdateDevice()
         if( bAutoQueue )
             continue;
 
-        String aEntry( *it );
+        OUString aEntry( *it );
         if( *it == m_rPIManager.getDefaultPrinter() )
         {
-            aEntry.AppendAscii( " (" );
-            aEntry += m_aDefPrt;
-            aEntry.AppendAscii( ")" );
+            aEntry += " (" + OUString( m_aDefPrt ) + ")";
         }
         int nPos =
             m_aDevicesLB.InsertEntry( aEntry,
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 53d09ce..d9d87cf 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -708,9 +708,7 @@ void RTSFontSubstPage::update()
     for( it = m_pParent->m_aJobData.m_aFontSubstitutes.begin();
          it != m_pParent->m_aJobData.m_aFontSubstitutes.end(); ++it )
     {
-        String aEntry( it->first );
-        aEntry.AppendAscii( " -> " );
-        aEntry.Append( String( it->second ) );
+        OUString aEntry = it->first + " -> " + it->second;
         m_aSubstitutionsBox.InsertEntry( aEntry );
     }
 }
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
index 54ff5c2..d849d01 100644
--- a/reportdesign/source/ui/dlg/AddField.cxx
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -320,7 +320,7 @@ void OAddFieldWindow::Update()
             m_aActions.EnableItem(m_aActions.GetItemId(j),sal_False);
         }
 
-        String aTitle(ModuleRes(RID_STR_FIELDSELECTION));
+        OUString aTitle(ModuleRes(RID_STR_FIELDSELECTION));
         SetText(aTitle);
         if ( m_xRowSet.is() )
         {
@@ -357,8 +357,7 @@ void OAddFieldWindow::Update()
             lcl_addToList( *m_pListBox, aParamNames );
 
             // set title
-            aTitle.AppendAscii(" ");
-            aTitle += m_aCommandName.getStr();
+            aTitle += " " + OUString( m_aCommandName.getStr() );
             SetText( aTitle );
             if ( !m_aCommandName.isEmpty() )
             {
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index 99f14d6..c008123 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -241,8 +241,8 @@ void ScStyleSheetPool::CreateStandardStyles()
 
     Color           aColBlack   ( COL_BLACK );
     Color           aColGrey    ( COL_LIGHTGRAY );
-    String          aStr;
-    xub_StrLen      nStrLen;
+    OUString        aStr;
+    sal_Int32       nStrLen;
     String          aHelpFile;//XXX JN welcher Text???
     SfxItemSet*     pSet            = NULL;
     SfxItemSet*     pHFSet          = NULL;
@@ -388,9 +388,9 @@ void ScStyleSheetPool::CreateStandardStyles()
     // Fusszeile:
     // [leer][Seite \SEITE\][leer]
     //----------------------------------------
-    aStr = SCSTR( STR_PAGE ); aStr += ' ';
+    aStr = SCSTR( STR_PAGE ) + " ";
     pEdEngine->SetText( aStr );
-    nStrLen = aStr.Len();
+    nStrLen = aStr.getLength();
     pEdEngine->QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(0,nStrLen,0,nStrLen) );
     pTxtObj = pEdEngine->CreateTextObject();
     pFooterItem->SetLeftArea  ( *pEmptyTxtObj );
@@ -437,7 +437,7 @@ void ScStyleSheetPool::CreateStandardStyles()
     // Kopfzeile:
     // [\TABELLE\ (\DATEI\)][leer][\DATUM\, \ZEIT\]
     //----------------------------------------
-    aStr = OUString(" ()");
+    aStr = " ()";
     pEdEngine->SetText( aStr );
     pEdEngine->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(0,2,0,2) );
     pEdEngine->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection() );
@@ -445,7 +445,7 @@ void ScStyleSheetPool::CreateStandardStyles()
     pHeaderItem->SetLeftArea( *pTxtObj );
     pHeaderItem->SetCenterArea( *pEmptyTxtObj );
     DELETEZ( pTxtObj );
-    aStr = OUString(", ");
+    aStr = ", ";
     pEdEngine->SetText( aStr );
     pEdEngine->QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD), ESelection(0,2,0,2) );
     pEdEngine->QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SVXDATETYPE_VAR), EE_FEATURE_FIELD),
@@ -459,10 +459,10 @@ void ScStyleSheetPool::CreateStandardStyles()
     // Fusszeile:
     // [leer][Seite: \SEITE\ / \SEITEN\][leer]
     //----------------------------------------
-    aStr = SCSTR( STR_PAGE ); aStr += ' ';
-    nStrLen = aStr.Len();
-    aStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" / "));
-    xub_StrLen nStrLen2 = aStr.Len();
+    aStr = SCSTR( STR_PAGE ) + " ";
+    nStrLen = aStr.getLength();
+    aStr += " / ";
+    sal_Int32 nStrLen2 = aStr.getLength();
     pEdEngine->SetText( aStr );
     pEdEngine->QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(0,nStrLen2,0,nStrLen2) );
     pEdEngine->QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(0,nStrLen,0,nStrLen) );


More information about the Libreoffice-commits mailing list