From 4a11a47103fcbd7646234fc9565a409b8055507e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 30 Oct 2012 00:00:51 +0000 Subject: trivial empty-init String::Fill -> comphelper::padToLength Change-Id: I6c41b8f4d3ad739eff545063bd1f8fe8f4fba65e --- 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(-) diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 657182d10420..fa9d50ea7de4 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -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 054de265eb46..8c510e4eb1b0 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 05a2759af4ef..0b361973f91d 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 ad151a72b07d..5c70c6e2e3d0 100644 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -30,6 +30,8 @@ #include #include #include +#include +#include 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( 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 a04742fe67ed..b82235b28882 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include #include #include #include @@ -54,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -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 854c4da9c941..8f20f76e4be2 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 015cf9711c8f..8687ae9db8ea 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 b57db8aa994f..8846707ea0f8 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 acaaa1e95433..3d543e28ac41 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -44,6 +44,7 @@ #include #include #include +#include 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 94a2924522ba..deda8d95f12a 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 311e59e930b4..bb488fa25221 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -27,7 +27,7 @@ ************************************************************************/ #include - +#include #include #include #include @@ -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 a9360c5096b1..80659b00bb27 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 - #include "porglue.hxx" #include "inftxt.hxx" #include "porlay.hxx" // SwParaPortion, SetFull #include "porfly.hxx" // SwParaPortion, SetFull +#include /************************************************************************* * 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 26b1483f387e..ab53845a0a68 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( - 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 83db83e8b71e..824771ab1b9e 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 aad2acff97c4..9f0e4e61ba3b 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -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 f5a5f41bfb1d..2f3b44014762 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 aef97f500b51..d2c1782890fa 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 fb126139fa8e..db08434b6e7a 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; } -- cgit