summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-10-28 22:37:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-11-01 09:27:22 +0000
commit489272ce9e0d655a833fa7add2ed8cfb87349edb (patch)
treede5e22f9e22b800af4cf4995572c926c196aedb7 /vcl
parent9dc14818d588c13d7cea9814c8227a438c7a30de (diff)
add and use an OString::equalsIgnoreAsciiCaseAsciiL equivalent to OUString one
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/metaact.hxx8
-rw-r--r--vcl/source/gdi/gdimtf.cxx18
-rw-r--r--vcl/source/gdi/metaact.cxx17
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx8
4 files changed, 27 insertions, 24 deletions
diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx
index 87bc75fab2a0..64800fd6d0c8 100644
--- a/vcl/inc/vcl/metaact.hxx
+++ b/vcl/inc/vcl/metaact.hxx
@@ -1489,10 +1489,10 @@ class VCL_DLLPUBLIC MetaCommentAction : public MetaAction
{
private:
- ByteString maComment;
+ rtl::OString maComment;
sal_Int32 mnValue;
sal_uInt32 mnDataSize;
- sal_uInt8* mpData;
+ sal_uInt8* mpData;
SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize );
virtual sal_Bool Compare( const MetaAction& ) const;
@@ -1503,7 +1503,7 @@ protected:
public:
MetaCommentAction( sal_Int32 nValue = 0L );
MetaCommentAction( const MetaCommentAction& rAct );
- MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL );
+ MetaCommentAction( const rtl::OString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL );
MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize );
virtual void Move( long nHorzMove, long nVertMove );
@@ -1514,7 +1514,7 @@ public:
virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData );
virtual void Read( SvStream& rIStm, ImplMetaReadData* pData );
- const ByteString& GetComment() const { return maComment; }
+ const rtl::OString& GetComment() const { return maComment; }
sal_Int32 GetValue() const { return mnValue; }
sal_uInt32 GetDataSize() const { return mnDataSize; }
const sal_uInt8* GetData() const { return mpData; }
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index fffde0472b75..7ab555db7880 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -556,7 +556,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
{
MetaCommentAction* pCommentAct = static_cast<MetaCommentAction*>(pAction);
if( pAction->GetType() == META_COMMENT_ACTION &&
- pCommentAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") )
+ pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("DELEGATE_PLUGGABLE_RENDERER")) )
{
ImplDelegate2PluggableRenderer(pCommentAct, pOut);
}
@@ -658,7 +658,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut )
{
- OSL_ASSERT( pAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") );
+ OSL_ASSERT( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("DELEGATE_PLUGGABLE_RENDERER")) );
// read payload - string of service name, followed by raw render input
const sal_uInt8* pData = pAct->GetData();
@@ -1534,7 +1534,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_COMMENT_ACTION ):
{
MetaCommentAction* pCommentAct = (MetaCommentAction*) pAction;
- if( pCommentAct->GetComment().Equals( "XGRAD_SEQ_BEGIN" ) )
+ if( pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) )
{
int nBeginComments( 1 );
pAction = NextAction();
@@ -1555,7 +1555,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
else if( META_COMMENT_ACTION == nType)
{
MetaCommentAction* pAct = (MetaCommentAction*) pAction;
- if( pAct->GetComment().Equals( "XGRAD_SEQ_END" ) )
+ if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) )
{
// handle nested blocks
--nBeginComments;
@@ -1564,7 +1564,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
if( !nBeginComments )
break;
}
- else if( pAct->GetComment().Equals( "XGRAD_SEQ_BEGIN" ) )
+ else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) )
{
// handle nested blocks
++nBeginComments;
@@ -1577,8 +1577,8 @@ void GDIMetaFile::Rotate( long nAngle10 )
}
else
{
- sal_Bool bPathStroke = pCommentAct->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" );
- if ( bPathStroke || pCommentAct->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ sal_Bool bPathStroke = pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN"));
+ if ( bPathStroke || pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) )
{
if ( pCommentAct->GetDataSize() )
{
@@ -1608,8 +1608,8 @@ void GDIMetaFile::Rotate( long nAngle10 )
}
}
}
- else if ( pCommentAct->GetComment().Equals( "XPATHSTROKE_SEQ_END" )
- || pCommentAct->GetComment().Equals( "XPATHFILL_SEQ_END" ) )
+ else if ( pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END"))
+ || pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")) )
{
pAction->Execute( &aMapVDev );
pAction->Duplicate();
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 99e56ece49ad..03c5390e6f36 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -4019,7 +4019,7 @@ MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) :
// ------------------------------------------------------------------------
-MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
+MetaCommentAction::MetaCommentAction( const rtl::OString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) :
MetaAction ( META_COMMENT_ACTION ),
maComment ( rComment ),
mnValue ( nValue )
@@ -4086,8 +4086,8 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
{
if ( mnDataSize && mpData )
{
- sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" );
- if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ sal_Bool bPathStroke = maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN"));
+ if ( bPathStroke || maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) )
{
SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
SvMemoryStream aDest;
@@ -4129,8 +4129,8 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
{
if ( mnDataSize && mpData )
{
- sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" );
- if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ sal_Bool bPathStroke = maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN"));
+ if ( bPathStroke || maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) )
{
SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
SvMemoryStream aDest;
@@ -4156,7 +4156,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
}
delete[] mpData;
ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
- } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
+ } else if( maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS_HEADER_INFO")) ){
SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
SvMemoryStream aDest;
@@ -4213,7 +4213,10 @@ void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- rIStm >> maComment >> mnValue >> mnDataSize;
+ ByteString sTmp;
+ rIStm >> sTmp;
+ maComment = sTmp;
+ rIStm >> mnValue >> mnDataSize;
if( mpData )
delete[] mpData;
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index f7a1ad5bcb56..50ae86268e0c 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -523,7 +523,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
const MetaCommentAction* pA = (const MetaCommentAction*) pAction;
String aSkipComment;
- if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
+ if( pA->GetComment().equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")))
{
const MetaGradientExAction* pGradAction = NULL;
sal_Bool bDone = sal_False;
@@ -535,7 +535,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
if( pAction->GetType() == META_GRADIENTEX_ACTION )
pGradAction = (const MetaGradientExAction*) pAction;
else if( ( pAction->GetType() == META_COMMENT_ACTION ) &&
- ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) )
+ ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END"))) )
{
bDone = sal_True;
}
@@ -559,7 +559,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
sal_Bool bSkipSequence = sal_False;
rtl::OString sSeqEnd;
- if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) )
+ if( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")) )
{
sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END"));
SvtGraphicStroke aStroke;
@@ -644,7 +644,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
}
}
}
- else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ else if ( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) )
{
sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END"));
SvtGraphicFill aFill;