[Libreoffice-commits] .: filter/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Jul 20 02:04:32 PDT 2011
filter/source/graphicfilter/epgm/epgm.cxx | 9 +++------
filter/source/graphicfilter/eppm/eppm.cxx | 9 +++------
filter/source/graphicfilter/eps/eps.cxx | 24 ++++++++++--------------
3 files changed, 16 insertions(+), 26 deletions(-)
New commits:
commit 2322b1370cdfa6dcece27fe36a42169bd25d2d44
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 19 22:05:27 2011 +0100
ByteString::CreateFromInt32->rtl::OString::valueOf
diff --git a/filter/source/graphicfilter/epgm/epgm.cxx b/filter/source/graphicfilter/epgm/epgm.cxx
index 9b412c1..3b8bd44 100644
--- a/filter/source/graphicfilter/epgm/epgm.cxx
+++ b/filter/source/graphicfilter/epgm/epgm.cxx
@@ -213,13 +213,10 @@ void PGMWriter::ImplWriteBody()
// ------------------------------------------------------------------------
// eine Dezimalzahl im ASCII format wird in den Stream geschrieben
-void PGMWriter::ImplWriteNumber( sal_Int32 nNumber )
+void PGMWriter::ImplWriteNumber(sal_Int32 nNumber)
{
- const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
-
- for( sal_Int16 n = 0UL, nLen = aNum.Len(); n < nLen; n++ )
- m_rOStm << aNum.GetChar( n );
-
+ const rtl::OString aNum(rtl::OString::valueOf(nNumber));
+ m_rOStm << aNum.getStr();
}
// ------------------------------------------------------------------------
diff --git a/filter/source/graphicfilter/eppm/eppm.cxx b/filter/source/graphicfilter/eppm/eppm.cxx
index eab45ce..bf934c9 100644
--- a/filter/source/graphicfilter/eppm/eppm.cxx
+++ b/filter/source/graphicfilter/eppm/eppm.cxx
@@ -221,13 +221,10 @@ void PPMWriter::ImplWriteBody()
// ------------------------------------------------------------------------
// eine Dezimalzahl im ASCII format wird in den Stream geschrieben
-void PPMWriter::ImplWriteNumber( sal_Int32 nNumber )
+void PPMWriter::ImplWriteNumber(sal_Int32 nNumber)
{
- const ByteString aNum( ByteString::CreateFromInt32( nNumber ) );
-
- for( sal_Int16 n = 0, nLen = aNum.Len(); n < nLen; n++ )
- m_rOStm << aNum.GetChar( n );
-
+ const rtl::OString aNum(rtl::OString::valueOf(nNumber));
+ m_rOStm << aNum.getStr();
}
// ------------------------------------------------------------------------
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index e10b09b..f8ffcd9 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -2466,28 +2466,24 @@ void PSWriter::ImplWriteLong(sal_Int32 nNumber, sal_uLong nMode)
void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode )
{
- sal_Int32 nLength;
-
sal_Int32 nPTemp = (sal_Int32)fNumber;
sal_Int32 nATemp = labs( (sal_Int32)( ( fNumber - nPTemp ) * 100000 ) );
if ( !nPTemp && nATemp && ( fNumber < 0.0 ) )
*mpPS << (sal_Char)'-';
- ByteString aNumber1( ByteString::CreateFromInt32( nPTemp ) );
- nLength = aNumber1.Len();
- mnCursorPos += nLength;
- for ( sal_Int32 n = 0; n < nLength; n++ )
- *mpPS << aNumber1.GetChar( (sal_uInt16)n );
+ const rtl::OString aNumber1(rtl::OString::valueOf(nPTemp));
+ *mpPS << aNumber1.getStr();
+ mnCursorPos += aNumber1.getLength();
if ( nATemp )
{
int zCount = 0;
*mpPS << (sal_uInt8)'.';
mnCursorPos++;
- const ByteString aNumber2( ByteString::CreateFromInt32( nATemp ) );
+ const rtl::OString aNumber2(rtl::OString::valueOf(nATemp));
- sal_Int16 n, nLen = aNumber2.Len();
+ sal_Int16 n, nLen = aNumber2.getLength();
if ( nLen < 8 )
{
mnCursorPos += 6 - nLen;
@@ -2499,9 +2495,9 @@ void PSWriter::ImplWriteDouble( double fNumber, sal_uLong nMode )
mnCursorPos += nLen;
for ( n = 0; n < nLen; n++ )
{
- *mpPS << aNumber2.GetChar( n );
+ *mpPS << aNumber2[n];
zCount--;
- if ( aNumber2.GetChar( n ) != '0' )
+ if ( aNumber2[n] != '0' )
zCount = 0;
}
if ( zCount )
@@ -2522,8 +2518,8 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode
nNumber = -nNumber;
mnCursorPos++;
}
- const ByteString aScaleFactor( ByteString::CreateFromInt32( nNumber ) );
- sal_uLong nLen = aScaleFactor.Len();
+ const rtl::OString aScaleFactor(rtl::OString::valueOf(nNumber));
+ sal_uLong nLen = aScaleFactor.getLength();
long nStSize = ( nCount + 1 ) - nLen;
if ( nStSize >= 1 )
{
@@ -2547,7 +2543,7 @@ void PSWriter::ImplWriteF( sal_Int32 nNumber, sal_uLong nCount, sal_uLong nMode
*mpPS << (sal_uInt8)'.';
mnCursorPos++;
}
- *mpPS << aScaleFactor.GetChar( n );
+ *mpPS << aScaleFactor[n];
}
ImplExecMode( nMode );
}
More information about the Libreoffice-commits
mailing list