summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx18
-rw-r--r--sal/inc/rtl/string.hxx24
2 files changed, 33 insertions, 9 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 065aae480cce..32456e445106 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -516,8 +516,8 @@ namespace cppcanvas
++io_rCurrActionIndex;
if( pCurrAct->GetType() == META_COMMENT_ACTION &&
- static_cast<MetaCommentAction*>(pCurrAct)->GetComment().CompareIgnoreCaseToAscii(
- pCommentString ) == COMPARE_EQUAL )
+ static_cast<MetaCommentAction*>(pCurrAct)->GetComment().equalsIgnoreAsciiCaseAscii(
+ pCommentString) )
{
// requested comment found, done
return;
@@ -551,8 +551,8 @@ namespace cppcanvas
}
if( pCurrAct->GetType() == META_COMMENT_ACTION &&
- static_cast<MetaCommentAction*>(pCurrAct)->GetComment().CompareIgnoreCaseToAscii(
- pCommentString ) == COMPARE_EQUAL )
+ static_cast<MetaCommentAction*>(pCurrAct)->GetComment().equalsIgnoreAsciiCaseAscii(
+ pCommentString) )
{
// delimiting end comment found, done
bRet = false; // not yet found
@@ -1686,7 +1686,7 @@ namespace cppcanvas
MetaCommentAction* pAct = static_cast<MetaCommentAction*>(pCurrAct);
// Handle gradients
- if ( pAct->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL )
+ if (pAct->GetComment().equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")))
{
MetaGradientExAction* pGradAction = NULL;
bool bDone( false );
@@ -1702,7 +1702,7 @@ namespace cppcanvas
// skip broken-down rendering, output gradient when sequence is ended
case META_COMMENT_ACTION:
- if( static_cast<MetaCommentAction*>(pCurrAct)->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL )
+ if( static_cast<MetaCommentAction*>(pCurrAct)->GetComment().equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) )
{
bDone = true;
@@ -1723,7 +1723,7 @@ namespace cppcanvas
// XPATHSTROKE_SEQ_BEGIN comment
// Handle drawing layer fills
- else if( pAct->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) )
+ else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) )
{
const sal_uInt8* pData = pAct->GetData();
if ( pData )
@@ -1839,7 +1839,7 @@ namespace cppcanvas
}
}
// Handle drawing layer fills
- else if( pAct->GetComment().Equals( "EMF_PLUS" ) ) {
+ else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS")) ) {
static int count = -1, limit = 0x7fffffff;
if (count == -1) {
count = 0;
@@ -1852,7 +1852,7 @@ namespace cppcanvas
if (count < limit)
processEMFPlus( pAct, rFactoryParms, getState( rStates ), rCanvas );
count ++;
- } else if( pAct->GetComment().Equals( "EMF_PLUS_HEADER_INFO" ) ) {
+ } else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS_HEADER_INFO")) ) {
EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer - header info, size: %u\n", (unsigned int)pAct->GetDataSize ()));
SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ);
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 7555464c4674..23fee9d7674e 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -407,6 +407,30 @@ public:
Since this method is optimized for performance, the ASCII character
values are not converted in any way. The caller has to make sure that
all ASCII characters are in the allowed range between 0 and
+ 127. The ASCII string must be NULL-terminated.
+ This function can't be used for language specific comparison.
+
+ @param asciiStr the 8-Bit ASCII character string to be compared.
+ @return sal_True if the strings are equal;
+ sal_False, otherwise.
+ */
+ sal_Bool equalsIgnoreAsciiCaseAscii( const sal_Char * asciiStr ) const SAL_THROW(())
+ {
+ return rtl_str_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
+ asciiStr, rtl_str_getLength(asciiStr) ) == 0;
+ }
+
+ /**
+ Perform a ASCII lowercase comparison of two strings.
+
+ The result is true if and only if second string
+ represents the same sequence of characters as the first string,
+ ignoring the case.
+ Character values between 65 and 90 (ASCII A-Z) are interpreted as
+ values between 97 and 122 (ASCII a-z).
+ Since this method is optimized for performance, the ASCII character
+ values are not converted in any way. The caller has to make sure that
+ all ASCII characters are in the allowed range between 0 and
127. The ASCII string must be greater or equal in length as asciiStrLength.
This function can't be used for language specific comparison.