Kaydet (Commit) 0d5644bb authored tarafından Caolán McNamara's avatar Caolán McNamara

UniString::Fill -> OUStringBuffer::padToLength

none of these strings starts out before "Fill" longer than the size they are
asked to be filled to so there are no trailing unfilled bits to consider

all of which means that we can get rid of UniString::Fill now

Change-Id: I8da21e9787017da9243a2c1d7118d3fbcca2a7fb
üst 2be58938
......@@ -23,6 +23,7 @@
#endif
#include "scitems.hxx"
#include <comphelper/string.hxx>
#include <svx/algitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
......@@ -138,9 +139,9 @@ static String lcl_ValueString( sal_Int32 nValue, sal_uInt16 nMinDigits )
String aStr = String::CreateFromInt32( Abs( nValue ) );
if ( aStr.Len() < nMinDigits )
{
String aZero;
aZero.Fill( nMinDigits - aStr.Len(), '0' );
aStr.Insert( aZero, 0 );
OUStringBuffer aZero;
comphelper::string::padToLength(aZero, nMinDigits - aStr.Len(), '0');
aStr.Insert(aZero.makeStringAndClear(), 0);
}
// nMinDigits doesn't include the '-' sign -> add after inserting zeros
if ( nValue < 0 )
......
......@@ -71,7 +71,9 @@ sal_Bool SwGluePortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt )
if( GetLen() && rInf.OnWin() &&
rInf.GetOpt().IsBlank() && rInf.IsNoSymbol() )
{
rTxt.Fill( GetLen(), CH_BULLET );
OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, GetLen(), CH_BULLET);
rTxt = aBuf.makeStringAndClear();
return sal_True;
}
return sal_False;
......@@ -88,7 +90,7 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const
if( rInf.GetFont()->IsPaintBlank() )
{
rtl::OUStringBuffer aBuf;
OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, GetFixWidth() / GetLen(), ' ');
String aTxt(aBuf.makeStringAndClear());
SwTxtPaintInfo aInf( rInf, aTxt );
......
......@@ -18,6 +18,7 @@
*/
#include <boost/scoped_ptr.hpp>
#include <comphelper/string.hxx>
#include <tools/solar.h>
#include <vcl/vclenum.hxx>
#include <vcl/font.hxx>
......@@ -687,8 +688,10 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFmt &rNum, WW8_ANLV &rAV,
if( bListSymbol )
{
//cBulletChar benutzen, damit auf dem MAC richtig gemappt wird
sTxt.Fill( SVBT8ToByte( rAV.cbTextBefore )
+ SVBT8ToByte( rAV.cbTextAfter ), cBulletChar );
OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, SVBT8ToByte(rAV.cbTextBefore)
+ SVBT8ToByte(rAV.cbTextAfter), cBulletChar);
sTxt = aBuf.makeStringAndClear();
}
}
}
......
......@@ -227,8 +227,6 @@ public:
UniString& Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
UniString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
UniString& Fill( xub_StrLen nCount, sal_Unicode cFillChar = ' ' );
UniString& ToLowerAscii();
UniString& ToUpperAscii();
......
......@@ -237,36 +237,6 @@ StringCompare STRING::CompareIgnoreCaseToAscii( const STRING& rStr,
return COMPARE_GREATER;
}
STRING& STRING::Fill( xub_StrLen nCount, STRCODE cFillChar )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
if ( !nCount )
return *this;
// extend string if fill length is larger
if ( nCount > mpData->mnLen )
{
// allocate string of new length
STRINGDATA* pNewData = ImplAllocData( nCount );
STRING_RELEASE((STRING_TYPE *)mpData);
mpData = pNewData;
}
else
ImplCopyData();
STRCODE* pStr = mpData->maStr;
do
{
*pStr = cFillChar;
++pStr,
--nCount;
}
while ( nCount );
return *this;
}
STRCODE* STRING::GetBufferAccess()
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment