[Libreoffice-commits] .: basctl/source basic/source drawinglayer/source editeng/source svl/inc svl/source svtools/source sw/source vcl/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 17:06:34 PDT 2012


 basctl/source/basicide/baside2.cxx                 |    9 ++-
 basic/source/runtime/methods.cxx                   |   24 +++++-----
 basic/source/runtime/step0.cxx                     |   28 ++++++------
 basic/source/runtime/step2.cxx                     |    8 ++-
 drawinglayer/source/processor2d/vclprocessor2d.cxx |    8 ++-
 editeng/source/editeng/impedit3.cxx                |    7 +--
 svl/inc/svl/zformat.hxx                            |   11 ++--
 svl/source/numbers/zformat.cxx                     |   49 +++++++++++----------
 svtools/source/control/fmtfield.cxx                |    7 +--
 sw/source/core/crsr/crstrvl.cxx                    |   20 +++-----
 sw/source/core/fields/authfld.cxx                  |    7 +--
 sw/source/core/text/porglue.cxx                    |    7 +--
 sw/source/filter/ww8/ww8graf.cxx                   |    8 +--
 sw/source/filter/ww8/ww8par2.cxx                   |    5 +-
 sw/source/ui/uiview/srcview.cxx                    |    7 +--
 vcl/source/control/edit.cxx                        |    6 +-
 xmloff/source/style/xmlnumfe.cxx                   |   10 ++--
 xmloff/source/style/xmlnumfi.cxx                   |    6 +-
 18 files changed, 119 insertions(+), 108 deletions(-)

New commits:
commit 4a11a47103fcbd7646234fc9565a409b8055507e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 30 00:00:51 2012 +0000

    trivial empty-init String::Fill -> comphelper::padToLength
    
    Change-Id: I6c41b8f4d3ad739eff545063bd1f8fe8f4fba65e

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 657182d..fa9d50e 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -37,6 +37,7 @@
 #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
 #include <sfx2/dinfdlg.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/docfile.hxx>
@@ -164,13 +165,13 @@ void lcl_ConvertTabsToSpaces( String& rLine )
             if ( rLine.GetChar( nPos ) == '\t' )
             {
                 // not 4 Blanks, but at 4 TabPos:
-                String aBlanker;
-                aBlanker.Fill( ( 4 - ( nPos % 4 ) ), ' ' );
+                rtl::OUStringBuffer aBlanker;
+                string::padToLength(aBlanker, ( 4 - ( nPos % 4 ) ), ' ');
                 rLine.Erase( nPos, 1 );
-                rLine.Insert( aBlanker, nPos );
+                rLine.Insert( aBlanker.makeStringAndClear(), nPos );
                 nMax = rLine.Len();
             }
-            nPos++;
+            ++nPos;
         }
     }
 }
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 054de26..8c510e4 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1138,7 +1138,7 @@ RTLFUNC(LTrim)
         StarBASIC::Error( SbERR_BAD_ARGUMENT );
     else
     {
-        rtl::OUString aStr(comphelper::string::stripStart(rPar.Get(1)->GetString(), ' '));
+        rtl::OUString aStr(string::stripStart(rPar.Get(1)->GetString(), ' '));
         rPar.Get(0)->PutString(aStr);
     }
 }
@@ -1387,7 +1387,7 @@ RTLFUNC(RTrim)
         StarBASIC::Error( SbERR_BAD_ARGUMENT );
     else
     {
-        rtl::OUString aStr(comphelper::string::stripEnd(rPar.Get(1)->GetString(), ' '));
+        rtl::OUString aStr(string::stripEnd(rPar.Get(1)->GetString(), ' '));
         rPar.Get(0)->PutString(aStr);
     }
 }
@@ -1420,9 +1420,9 @@ RTLFUNC(Space)
         StarBASIC::Error( SbERR_BAD_ARGUMENT );
     else
     {
-        String aStr;
-        aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() ));
-        rPar.Get(0)->PutString( aStr );
+        rtl::OUStringBuffer aBuf;
+        string::padToLength(aBuf, rPar.Get(1)->GetLong(), ' ');
+        rPar.Get(0)->PutString(aBuf.makeStringAndClear());
     }
 }
 
@@ -1435,9 +1435,9 @@ RTLFUNC(Spc)
         StarBASIC::Error( SbERR_BAD_ARGUMENT );
     else
     {
-        String aStr;
-        aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() ));
-        rPar.Get(0)->PutString( aStr );
+        rtl::OUStringBuffer aBuf;
+        string::padToLength(aBuf, rPar.Get(1)->GetLong(), ' ');
+        rPar.Get(0)->PutString(aBuf.makeStringAndClear());
     }
 }
 
@@ -1578,7 +1578,6 @@ RTLFUNC(String)
         StarBASIC::Error( SbERR_BAD_ARGUMENT );
     else
     {
-        String aStr;
         sal_Unicode aFiller;
         sal_Int32 lCount = rPar.Get(1)->GetLong();
         if( lCount < 0 || lCount > 0xffff )
@@ -1591,8 +1590,9 @@ RTLFUNC(String)
             const String& rStr = rPar.Get(2)->GetString();
             aFiller = rStr.GetBuffer()[0];
         }
-        aStr.Fill( nCount, aFiller );
-        rPar.Get(0)->PutString( aStr );
+        rtl::OUStringBuffer aBuf;
+        string::padToLength(aBuf, nCount, aFiller);
+        rPar.Get(0)->PutString(aBuf.makeStringAndClear());
     }
 }
 
@@ -2372,7 +2372,7 @@ String implSetupWildcard( const String& rFileParam, SbiRTLData* pRTLData )
 
     // Is there a pure file name left? Otherwise the path is
     // invalid anyway because it was not accepted by OSL before
-    if (comphelper::string::equals(aPureFileName, '*'))
+    if (string::equals(aPureFileName, '*'))
     {
         pRTLData->pWildCard = new WildCard( aPureFileName );
     }
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 05a2759..0b36197 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -721,19 +721,18 @@ void SbiRuntime::StepLSET()
 
         sal_uInt16 nVarStrLen = aRefVarString.Len();
         sal_uInt16 nValStrLen = aRefValString.Len();
-        String aNewStr;
+        rtl::OUStringBuffer aNewStr;
         if( nVarStrLen > nValStrLen )
         {
-            aRefVarString.Fill(nVarStrLen,' ');
-            aNewStr  = aRefValString.Copy( 0, nValStrLen );
-            aNewStr += aRefVarString.Copy( nValStrLen, nVarStrLen - nValStrLen );
+            aNewStr.append(aRefValString);
+            comphelper::string::padToLength(aNewStr, nVarStrLen, ' ');
         }
         else
         {
-            aNewStr = aRefValString.Copy( 0, nVarStrLen );
+            aNewStr.append(aRefValString.Copy(0, nVarStrLen));
         }
 
-        refVar->PutString( aNewStr );
+        refVar->PutString(aNewStr.makeStringAndClear());
         refVar->SetFlags( n );
     }
 }
@@ -753,16 +752,19 @@ void SbiRuntime::StepRSET()
         String aRefVarString = refVar->GetString();
         String aRefValString = refVal->GetString();
 
-        sal_uInt16 nPos = 0;
         sal_uInt16 nVarStrLen = aRefVarString.Len();
-        if( nVarStrLen > aRefValString.Len() )
+        sal_uInt16 nValStrLen = aRefValString.Len();
+        rtl::OUStringBuffer aNewStr;
+        if (nVarStrLen > nValStrLen)
+        {
+            comphelper::string::padToLength(aNewStr, nVarStrLen - nValStrLen, ' ');
+            aNewStr.append(aRefValString);
+        }
+        else
         {
-            aRefVarString.Fill(nVarStrLen,' ');
-            nPos = nVarStrLen - aRefValString.Len();
+            aNewStr.append(aRefValString.Copy(0, nVarStrLen));
         }
-        aRefVarString  = aRefVarString.Copy( 0, nPos );
-        aRefVarString += aRefValString.Copy( 0, nVarStrLen - nPos );
-        refVar->PutString(aRefVarString);
+        refVar->PutString(aNewStr.makeStringAndClear());
 
         refVar->SetFlags( n );
     }
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index ad151a7..5c70c6e 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -30,6 +30,8 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/uno/Any.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
+#include <rtl/ustrbuf.hxx>
 
 using namespace com::sun::star::uno;
 using namespace com::sun::star::container;
@@ -1090,9 +1092,9 @@ void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, sal_uInt3
     if( bFixedString )
     {
         sal_uInt16 nCount = static_cast<sal_uInt16>( nOp2 >> 17 );      // len = all bits above 0x10000
-        String aStr;
-        aStr.Fill( nCount, 0 );
-        pVar->PutString( aStr );
+        rtl::OUStringBuffer aBuf;
+        comphelper::string::padToLength(aBuf, nCount, 0);
+        pVar->PutString(aBuf.makeStringAndClear());
     }
 
     bool bVarToDim = ((nOp2 & SBX_TYPE_VAR_TO_DIM_FLAG) != 0);
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index a04742f..b82235b 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -26,6 +26,7 @@
  *
  ************************************************************************/
 
+#include <comphelper/string.hxx>
 #include <drawinglayer/processor2d/vclprocessor2d.hxx>
 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
@@ -54,6 +55,7 @@
 #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
 #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
 #include <tools/diagnose_ex.h>
+#include <rtl/ustrbuf.hxx>
 #include <vcl/metric.hxx>
 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
 #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
@@ -270,9 +272,9 @@ namespace drawinglayer
                         if ( nWidth )
                             nChars = nWidthToFill / nWidth;
 
-                        String aFilled;
-                        aFilled.Fill( (sal_uInt16)nChars, aText.GetChar( 0 ) );
-                        aText = aFilled;
+                        rtl::OUStringBuffer aFilled;
+                        comphelper::string::padToLength(aFilled, (sal_uInt16)nChars, aText.GetChar(0));
+                        aText = aFilled.makeStringAndClear();
                         nPos = 0;
                         nLen = nChars;
                     }
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 854c4da..8f20f76 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3487,7 +3487,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
                                     aTmpFont.SetPhysFont( pOutDev );
                                     long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev,
                                         rtl::OUString(pTextPortion->GetExtraValue()), 0, 1, NULL ).Width();
-                                    long nChars = 2;
+                                    sal_Int32 nChars = 2;
                                     if( nCharWidth )
                                         nChars = pTextPortion->GetSize().Width() / nCharWidth;
                                     if ( nChars < 2 )
@@ -3495,8 +3495,9 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
                                     else if ( nChars == 2 )
                                         nChars = 3; // looks better
 
-                                    String aText;
-                                    aText.Fill( (sal_uInt16)nChars, pTextPortion->GetExtraValue() );
+                                    rtl::OUStringBuffer aBuf;
+                                    comphelper::string::padToLength(aBuf, nChars, pTextPortion->GetExtraValue());
+                                    String aText(aBuf.makeStringAndClear());
                                     aTmpFont.QuickDrawText( pOutDev, aTmpPos, aText, 0, aText.Len(), NULL );
                                     pOutDev->DrawStretchText( aTmpPos, pTextPortion->GetSize().Width(), aText );
 
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index 015cf97..8687ae9 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -648,13 +648,12 @@ private:
     }
 
     // transliterate according to NativeNumber
-    SVL_DLLPRIVATE void ImpTransliterateImpl( String& rStr, const SvNumberNatNum& rNum ) const;
+    SVL_DLLPRIVATE OUString impTransliterateImpl(const OUString& rStr, const SvNumberNatNum& rNum) const;
 
-    void ImpTransliterate( String& rStr, const SvNumberNatNum& rNum ) const
-        {
-            if ( rNum.IsComplete() )
-                ImpTransliterateImpl( rStr, rNum );
-        }
+    OUString impTransliterate(const OUString& rStr, const SvNumberNatNum& rNum) const
+    {
+        return rNum.IsComplete() ? impTransliterateImpl(rStr, rNum) : rStr;
+    }
 
 #endif // _ZFORMAT_CXX
 
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index b57db8a..8846707 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1973,7 +1973,7 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, String& rOutStr
         comphelper::string::getTokenCount(rOutString, '0') == rOutString.Len())
         rOutString = comphelper::string::stripStart(rOutString, '-');            // nicht -0
 
-    ImpTransliterate( rOutString, NumFor[0].GetNatNum() );
+    rOutString = impTransliterate(rOutString, NumFor[0].GetNatNum());
 }
 
 void SvNumberformat::ImpGetOutputInputLine(double fNumber, String& OutString)
@@ -2564,7 +2564,7 @@ bool SvNumberformat::GetOutputString(double fNumber,
                     char aBuf[100];
                     sprintf( aBuf, "%.f", fNum );   // simple rounded integer (#100211# - checked)
                     sStr.AssignAscii( aBuf );
-                    ImpTransliterate( sStr, NumFor[nIx].GetNatNum() );
+                    sStr = impTransliterate(sStr, NumFor[nIx].GetNatNum());
                 }
                 if (rInfo.nCntPre > 0 && nFrac == 0)
                 {
@@ -2779,11 +2779,11 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber,
         if (aBuf.getLength() < rInfo.nCntPost)
             padToLength(aBuf, rInfo.nCntPost, '0');
         sSecStr = aBuf.makeStringAndClear();
-        ImpTransliterate( sSecStr, NumFor[nIx].GetNatNum() );
+        sSecStr = impTransliterate(sSecStr, NumFor[nIx].GetNatNum());
         nCntPost = sSecStr.Len();
     }
     else
-        ImpTransliterate( sSecStr, NumFor[nIx].GetNatNum() );
+        sSecStr = impTransliterate(sSecStr, NumFor[nIx].GetNatNum());
 
     xub_StrLen nSecPos = 0;                 // Zum Ziffernweisen
                                             // abarbeiten
@@ -3374,13 +3374,14 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
                         CalendarDisplayCode::LONG_YEAR, nNatNum );
                 if (aYear.Len() < 4)
                 {
+                    using namespace comphelper::string;
                     // Ensure that year consists of at least 4 digits, so it
                     // can be distinguished from 2 digits display and edited
                     // without suddenly being hit by the 2-digit year magic.
-                    String aZero;
-                    aZero.Fill( 4 - aYear.Len(), sal_Unicode('0'));
-                    ImpTransliterate( aZero, NumFor[nIx].GetNatNum());
-                    aYear.Insert( aZero, 0);
+                    OUStringBuffer aBuf;
+                    padToLength(aBuf, 4 - aYear.Len(), sal_Unicode('0'));
+                    OUString aZero = impTransliterate(aBuf.makeStringAndClear(), NumFor[nIx].GetNatNum());
+                    aYear.Insert(aZero, 0);
                 }
                 OutString += aYear;
                 if ( bOtherCalendar )
@@ -3498,11 +3499,11 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
         if (aBuf.getLength() < rInfo.nCntPost)
             padToLength(aBuf, rInfo.nCntPost, '0');
         sSecStr = aBuf.makeStringAndClear();
-        ImpTransliterate( sSecStr, NumFor[nIx].GetNatNum() );
+        sSecStr = impTransliterate(sSecStr, NumFor[nIx].GetNatNum());
         nCntPost = sSecStr.Len();
     }
     else
-        ImpTransliterate( sSecStr, NumFor[nIx].GetNatNum() );
+        sSecStr = impTransliterate(sSecStr, NumFor[nIx].GetNatNum());
 
     xub_StrLen nSecPos = 0;                     // Zum Ziffernweisen
                                             // abarbeiten
@@ -3710,13 +3711,14 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
                         CalendarDisplayCode::LONG_YEAR, nNatNum );
                 if (aYear.Len() < 4)
                 {
+                    using namespace comphelper::string;
                     // Ensure that year consists of at least 4 digits, so it
                     // can be distinguished from 2 digits display and edited
                     // without suddenly being hit by the 2-digit year magic.
-                    String aZero;
-                    aZero.Fill( 4 - aYear.Len(), sal_Unicode('0'));
-                    ImpTransliterate( aZero, NumFor[nIx].GetNatNum());
-                    aYear.Insert( aZero, 0);
+                    OUStringBuffer aBuf;
+                    padToLength(aBuf, 4 - aYear.Len(), sal_Unicode('0'));
+                    OUString aZero = impTransliterate(aBuf.makeStringAndClear(), NumFor[nIx].GetNatNum());
+                    aYear.Insert(aZero, 0);
                 }
                 OutString += aYear;
                 if ( bOtherCalendar )
@@ -3963,8 +3965,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber,
     }
     if (bSign)
         sStr.Insert('-',0);
-    ImpTransliterate( sStr, NumFor[nIx].GetNatNum() );
-    OutString = sStr;
+    OutString = impTransliterate(sStr, NumFor[nIx].GetNatNum());
     return bRes;
 }
 
@@ -4727,7 +4728,7 @@ OUString SvNumberformat::GetMappedFormatstring(
 String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum,
         sal_Int32 nVal, sal_uInt16 nMinDigits ) const
 {
-    String aStr;
+    OUString aStr;
     if ( nMinDigits )
     {
         if ( nMinDigits == 2 )
@@ -4749,23 +4750,25 @@ String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum,
                 aStr = aValStr;
             else
             {
-                aStr.Fill( nMinDigits - aValStr.Len(), '0' );
-                aStr += aValStr;
+                using namespace comphelper::string;
+                OUStringBuffer aBuf;
+                padToLength(aBuf, nMinDigits - aValStr.Len(), '0' );
+                aBuf.append(aValStr);
+                aStr = aBuf.makeStringAndClear();
             }
         }
     }
     else
         aStr = rtl::OUString::valueOf( nVal );
-    ImpTransliterate( aStr, rNum );
-    return aStr;
+    return impTransliterate(aStr, rNum);
 }
 
-void SvNumberformat::ImpTransliterateImpl( String& rStr,
+OUString SvNumberformat::impTransliterateImpl(const OUString& rStr,
         const SvNumberNatNum& rNum ) const
 {
     com::sun::star::lang::Locale aLocale(
             MsLangId::convertLanguageToLocale( rNum.GetLang() ) );
-    rStr = GetFormatter().GetNatNum()->getNativeNumberString( rStr,
+    return GetFormatter().GetNatNum()->getNativeNumberString( rStr,
             aLocale, rNum.GetNatNum() );
 }
 
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index acaaa1e..3d543e2 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -44,6 +44,7 @@
 #include <unotools/syslocale.hxx>
 #include <map>
 #include <rtl/math.hxx>
+#include <rtl/ustrbuf.hxx>
 
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::util;
@@ -1253,9 +1254,9 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
     {
         sNewFormat += aLocaleInfo.getNumDecimalSep();
 
-        XubString sTemp;
-        sTemp.Fill(nDigits, '0');
-        sNewFormat += sTemp;
+        rtl::OUStringBuffer sTemp;
+        comphelper::string::padToLength(sTemp, nDigits, '0');
+        sNewFormat += sTemp.makeStringAndClear();
     }
 
     if (getPrependCurrSym())
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 94a2924..deda8d9 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1797,19 +1797,13 @@ sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
             case FILL_TAB:
             case FILL_SPACE:
                 {
-                    String sInsert;
-                    if( aFPos.nTabCnt )
-                        sInsert.Fill( aFPos.nTabCnt, '\t' );
-                    if( aFPos.nSpaceCnt )
-                    {
-                        String sSpace;
-                        sSpace.Fill( aFPos.nSpaceCnt );
-                        sInsert += sSpace;
-                    }
-                    if( sInsert.Len() )
-                    {
-                        GetDoc()->InsertString( *pCurCrsr, sInsert );
-                    }
+                    rtl::OUStringBuffer sInsert;
+                    if (aFPos.nTabCnt)
+                        comphelper::string::padToLength(sInsert, aFPos.nTabCnt, '\t');
+                    if (aFPos.nSpaceCnt)
+                        comphelper::string::padToLength(sInsert, sInsert.getLength() + aFPos.nSpaceCnt, ' ');
+                    if (sInsert.getLength())
+                        GetDoc()->InsertString( *pCurCrsr, sInsert.makeStringAndClear());
                 }
                 // no break - still need to set orientation
             case FILL_MARGIN:
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 311e59e..bb488fa 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -27,7 +27,7 @@
  ************************************************************************/
 
 #include <hintids.hxx>
-
+#include <comphelper/string.hxx>
 #include <editeng/unolingu.hxx>
 #include <editeng/langitem.hxx>
 #include <swtypes.hxx>
@@ -675,8 +675,9 @@ bool    SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
     if(!(rAny >>= aParam))
         return false;
 
-    String sToSet;
-    sToSet.Fill(AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER);
+    rtl::OUStringBuffer sBuf;
+    comphelper::string::padToLength(sBuf, AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER);
+    String sToSet(sBuf.makeStringAndClear());
     const PropertyValue* pParam = aParam.getConstArray();
     for(sal_Int32 i = 0; i < aParam.getLength(); i++)
     {
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index a9360c5..80659b0 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -30,11 +30,11 @@
 #include "paratr.hxx"   // pTabStop, ADJ*
 #include "viewopt.hxx"  // SwViewOptions
 #include <SwPortionHandler.hxx>
-
 #include "porglue.hxx"
 #include "inftxt.hxx"
 #include "porlay.hxx"   // SwParaPortion, SetFull
 #include "porfly.hxx"   // SwParaPortion, SetFull
+#include <comphelper/string.hxx>
 
 /*************************************************************************
  *                      class SwGluePortion
@@ -97,8 +97,9 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const
 
     if( rInf.GetFont()->IsPaintBlank() )
     {
-        XubString aTxt;
-        aTxt.Fill( GetFixWidth() / GetLen(), ' ' );
+        rtl::OUStringBuffer aBuf;
+        comphelper::string::padToLength(aBuf, GetFixWidth() / GetLen(), ' ');
+        String aTxt(aBuf.makeStringAndClear());
         SwTxtPaintInfo aInf( rInf, aTxt );
         aInf.DrawText( *this, aTxt.Len(), sal_True );
     }
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 26b1483..ab53845 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -678,10 +678,10 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp,
                     if (bSymbol == false && bDoingSymbol)
                     {
                         bDoingSymbol = false;
-                        String sTemp;
-                        sTemp.Fill(writer_cast<xub_StrLen>(
-                            nTxtStart - nStartReplace), cReplaceSymbol);
-                        mpDrawEditEngine->QuickInsertText(sTemp,
+                        rtl::OUStringBuffer sTemp;
+                        comphelper::string::padToLength(sTemp,
+                            nTxtStart - nStartReplace, cReplaceSymbol);
+                        mpDrawEditEngine->QuickInsertText(sTemp.makeStringAndClear(),
                             GetESelection(nStartReplace - nStartCp,
                             nTxtStart - nStartCp ) );
                     }
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 83db83e..824771a 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -687,16 +687,19 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFmt &rNum, WW8_ANLV &rAV,
     if( bOutline )
     {                             // Gliederung
         if( !rNum.GetIncludeUpperLevels()           // es sind  <= 1 Nummern anzuzeigen
-            || rNum.GetNumberingType() == SVX_NUM_NUMBER_NONE ){    // oder dieser Level hat keine
+            || rNum.GetNumberingType() == SVX_NUM_NUMBER_NONE )    // oder dieser Level hat keine
+        {
                                                 // eigenen Ziffern
             bInsert = true;                     // -> dann uebernehme Zeichen
 
             // replace by simple Bullet ?
             if( bListSymbol )
+            {
                 //cBulletChar benutzen, damit auf dem MAC richtig gemappt wird
                 sTxt.Fill(  SVBT8ToByte( rAV.cbTextBefore )
                           + SVBT8ToByte( rAV.cbTextAfter  ), cBulletChar );
             }
+        }
     }
     else
     {                                       // Nummerierung / Aufzaehlung
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index aad2acf..9f0e4e6 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/util/SearchFlags.hpp>
 #include <com/sun/star/i18n/TransliterationModules.hpp>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <comphelper/string.hxx>
 #include <unotools/tempfile.hxx>
 #include <tools/urlobj.hxx>
 #include <vcl/print.hxx>
@@ -205,10 +206,10 @@ static void lcl_ConvertTabsToSpaces( String& rLine )
             if ( rLine.GetChar(nPos) == '\t' )
             {
                 // Nicht 4 Blanks, sondern an 4er TabPos:
-                String aBlanker;
-                aBlanker.Fill( ( 4 - ( nPos % 4 ) ), ' ' );
+                rtl::OUStringBuffer aBlanker;
+                comphelper::string::padToLength(aBlanker, ( 4 - ( nPos % 4 ) ), ' ');
                 rLine.Erase( nPos, 1 );
-                rLine.Insert( aBlanker, nPos );
+                rLine.Insert(aBlanker.makeStringAndClear(), nPos);
                 nMax = rLine.Len();
             }
             nPos++; // Nicht optimal, falls Tab, aber auch nicht verkehrt...
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index f5a5f41..2f3b440 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -520,14 +520,14 @@ XubString Edit::ImplGetText() const
 {
     if ( mcEchoChar || (GetStyle() & WB_PASSWORD) )
     {
-        XubString   aText;
         sal_Unicode cEchoChar;
         if ( mcEchoChar )
             cEchoChar = mcEchoChar;
         else
             cEchoChar = '*';
-        aText.Fill( maText.Len(), cEchoChar );
-        return aText;
+        rtl::OUStringBuffer aText;
+        comphelper::string::padToLength(aText, maText.Len(), cEchoChar);
+        return aText.makeStringAndClear();
     }
     else
         return maText;
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index aef97f5..d2c1782 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1396,12 +1396,12 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
                                     //  string for decimal replacement
                                     //  has to be taken from nPrecision
                                     //  (positive number even for automatic decimals)
-                                    String sDashStr;
-                                    if ( bDecDashes && nPrecision > 0 )
-                                        sDashStr.Fill( nPrecision, '-' );
+                                    OUStringBuffer sDashStr;
+                                    if (bDecDashes && nPrecision > 0)
+                                        comphelper::string::padToLength(sDashStr, nPrecision, '-');
 
-                                    WriteNumberElement_Impl( nDecimals, nInteger, sDashStr, bVarDecimals,
-                                                        bThousand, nTrailingThousands, aEmbeddedEntries );
+                                    WriteNumberElement_Impl(nDecimals, nInteger, sDashStr.makeStringAndClear(),
+                                        bVarDecimals, bThousand, nTrailingThousands, aEmbeddedEntries);
                                     bAnyContent = sal_True;
                                 }
                                 break;
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index fb12613..db08434 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1795,9 +1795,9 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
             //  (there always has to be a digit before the leftmost embedded text)
 
             xub_StrLen nAddCount = (xub_StrLen)nLastFormatPos + 1 - nZeroPos;
-            String aDigitStr;
-            aDigitStr.Fill( nAddCount, (sal_Unicode)'#' );
-            aNumStr.Insert( aDigitStr, 0 );
+            OUStringBuffer aDigitStr;
+            comphelper::string::padToLength(aDigitStr, nAddCount, (sal_Unicode)'#');
+            aNumStr.Insert(aDigitStr.makeStringAndClear(), 0);
             nZeroPos = nZeroPos + nAddCount;
         }
 


More information about the Libreoffice-commits mailing list