summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-10-30 21:43:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-01 09:27:25 +0000
commitace697180bf5eafee062209eef0abab455349160 (patch)
tree0b0cd3de64f07b041b08910895d5c21001fc04d1 /filter
parent4d01a82f370b695b585d59393a461643c1b17001 (diff)
ByteString->rtl::OString
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/eos2met/eos2met.cxx15
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx30
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx2
3 files changed, 24 insertions, 23 deletions
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index 8d874303b56f..fffe2ebb4ebe 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -492,11 +492,12 @@ void METWriter::WriteChrSets()
*pMET << (sal_uInt8)0x03 << (sal_uInt8)0x52;
*pMET << (sal_uInt8)0x24 << (sal_uInt8)0x02 << (sal_uInt8)0x08 << (sal_uInt8)0x00;
- ByteString n(pCS->aName, gsl_getSystemTextEncoding());
+ rtl::OString n(rtl::OUStringToOString(pCS->aName,
+ osl_getThreadTextEncoding()));
for (i=0; i<32; i++)
{
if ( i == 0 || c != 0 )
- c = n.GetChar( i );
+ c = n[i];
*pMET << c;
}
}
@@ -1384,14 +1385,14 @@ void METWriter::METPartialArcAtCurPos(Point aCenter, double fMultiplier,
void METWriter::METChrStr( Point aPt, String aUniStr )
{
- sal_uInt16 nLen,i;
- ByteString aStr( aUniStr, gsl_getSystemTextEncoding() );
- nLen = aStr.Len();
+ rtl::OString aStr(rtl::OUStringToOString(aUniStr,
+ osl_getThreadTextEncoding()));
+ sal_uInt16 nLen = aStr.getLength();
WillWriteOrder( 11 + nLen );
*pMET << (sal_uInt8)0xc3 << (sal_uInt8)( 9 + nLen );
WritePoint(aPt);
- for ( i = 0; i < nLen; i++ )
- *pMET << aStr.GetChar( i );
+ for (sal_uInt16 i = 0; i < nLen; ++i)
+ *pMET << aStr[i];
*pMET << (sal_uInt8)0;
}
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index a7e03e69edde..369c50fdedaf 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -225,7 +225,7 @@ private:
void ImplText( const String& rUniString, const Point& rPos, const sal_Int32* pDXArry, sal_Int32 nWidth, VirtualDevice& rVDev );
void ImplSetAttrForText( const Point & rPoint );
void ImplWriteCharacter( sal_Char );
- void ImplWriteString( const ByteString&, VirtualDevice& rVDev, const sal_Int32* pDXArry = NULL, sal_Bool bStretch = sal_False );
+ void ImplWriteString( const rtl::OString&, VirtualDevice& rVDev, const sal_Int32* pDXArry = NULL, sal_Bool bStretch = sal_False );
void ImplDefineFont( const char*, const char* );
void ImplClosePathDraw( sal_uLong nMode = PS_RET );
@@ -1274,11 +1274,11 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
{
SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ );
sal_Bool bSkipSequence = sal_False;
- ByteString sSeqEnd;
+ rtl::OString sSeqEnd;
if( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM( "XPATHSTROKE_SEQ_BEGIN" )) )
{
- sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" );
+ sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END"));
SvtGraphicStroke aStroke;
aMemStm >> aStroke;
@@ -1314,7 +1314,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
}
else if (pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")))
{
- sSeqEnd = ByteString( "XPATHFILL_SEQ_END" );
+ sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END"));
SvtGraphicFill aFill;
aMemStm >> aFill;
switch( aFill.getFillType() )
@@ -1425,8 +1425,8 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
pMA = rMtf.GetAction( nCurAction );
if ( pMA->GetType() == META_COMMENT_ACTION )
{
- ByteString sComment( ((MetaCommentAction*)pMA)->GetComment() );
- if ( sComment.Equals( sSeqEnd ) )
+ rtl::OString sComment( ((MetaCommentAction*)pMA)->GetComment() );
+ if ( sComment.equals( sSeqEnd ) )
break;
}
}
@@ -2042,32 +2042,31 @@ void PSWriter::ImplWriteCharacter( sal_Char nChar )
//---------------------------------------------------------------------------------
-void PSWriter::ImplWriteString( const ByteString& rString, VirtualDevice& rVDev, const sal_Int32* pDXArry, sal_Bool bStretch )
+void PSWriter::ImplWriteString( const rtl::OString& rString, VirtualDevice& rVDev, const sal_Int32* pDXArry, sal_Bool bStretch )
{
- sal_uInt16 nLen = rString.Len();
+ sal_Int32 nLen = rString.getLength();
if ( nLen )
{
- sal_uInt16 i;
if ( pDXArry )
{
double nx = 0;
- for( i = 0; i < nLen; i++ )
+ for (sal_Int32 i = 0; i < nLen; ++i)
{
if ( i > 0 )
nx = pDXArry[ i - 1 ];
- ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( rString.GetChar( i ) ) );
+ ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( rString[i] ) );
ImplWriteDouble( nx );
ImplWriteLine( "(", PS_NONE );
- ImplWriteCharacter( rString.GetChar( i ) );
+ ImplWriteCharacter( rString[i] );
ImplWriteLine( ") bs" );
}
}
else
{
ImplWriteByte( '(', PS_NONE );
- for ( i = 0; i < nLen; i++ )
- ImplWriteCharacter( rString.GetChar( i ) );
+ for (sal_Int32 i = 0; i < nLen; ++i)
+ ImplWriteCharacter( rString[i] );
ImplWriteLine( ") sw" );
}
}
@@ -2128,7 +2127,8 @@ void PSWriter::ImplText( const String& rUniString, const Point& rPos, const sal_
if ( mnTextMode == 2 ) // forcing output one complete text packet, by
pDXArry = NULL; // ignoring the kerning array
ImplSetAttrForText( rPos );
- ByteString aStr( rUniString, maFont.GetCharSet() );
+ rtl::OString aStr(rtl::OUStringToOString(rUniString,
+ maFont.GetCharSet()));
ImplWriteString( aStr, rVDev, pDXArry, nWidth != 0 );
if ( maFont.GetOrientation() )
ImplWriteLine( "gr" );
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 4ecb41590997..9a1e6e59fcd7 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -380,7 +380,7 @@ static bool RenderAsPNG(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 nOrigPos, sal_uInt32 nPSSize,
sal_uInt32 nPosWMF, sal_uInt32 nSizeWMF, sal_uInt32 nPosTIFF, sal_uInt32 nSizeTIFF )
{
- ByteString aComment( (const sal_Char*)"EPSReplacementGraphic" );
+ rtl::OString aComment(RTL_CONSTASCII_STRINGPARAM("EPSReplacementGraphic"));
if ( nSizeWMF || nSizeTIFF )
{
SvMemoryStream aReplacement( nSizeWMF + nSizeTIFF + 28 );