summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 14:39:55 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:13 +0200
commitfcd1637d5101b9142e6808edfb77b01122857901 (patch)
tree5fd09f97de80cf2a9481bd55a798015db35f1d0c /xmloff
parentef90021abe3735fba57145598fd7c3d359d2718e (diff)
convert OUString compareToAscii == 0 to equalsAscii
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx2
-rw-r--r--xmloff/source/core/DocumentSettingsContext.cxx6
-rw-r--r--xmloff/source/draw/XMLNumberStyles.cxx2
-rw-r--r--xmloff/source/draw/animationexport.cxx2
-rw-r--r--xmloff/source/style/xmlnumfi.cxx4
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx16
6 files changed, 16 insertions, 16 deletions
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index cf3f3771fbe3..c6c5652aeac1 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -2737,7 +2737,7 @@ void SchXMLExportHelper_Impl::exportSeries(
if( xLabelSeq.is()) {
OUString aRange = xLabelSeq->getSourceRangeRepresentation();
- if ( nSeriesIdx == 0 && aRange.compareToAscii("label 1") == 0)
+ if ( nSeriesIdx == 0 && aRange.equalsAscii("label 1"))
modifyLabelRange = true;
if (modifyLabelRange)
aRange = "label " + OUString::number(aRange.copy( OUString("label").getLength()).toInt32() - 1);
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index c676bc99ff31..160322316784 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -381,7 +381,7 @@ void XMLDocumentSettingsContext::EndElement()
bool bFound(false);
while((i >= 0) && !bFound)
{
- if (aSeqViewProps[i].Name.compareToAscii("Views") == 0)
+ if (aSeqViewProps[i].Name.equalsAscii("Views"))
{
bFound = true;
uno::Reference<container::XIndexAccess> xIndexAccess;
@@ -409,13 +409,13 @@ void XMLDocumentSettingsContext::EndElement()
{
OUString sProp( aSeqConfigProps[i].Name );
- if ( sProp.compareToAscii("PrinterName") == 0 )
+ if ( sProp.equalsAscii("PrinterName") )
{
OUString sEmpty;
aSeqConfigProps[i].Value = uno::makeAny( sEmpty );
nFound++;
}
- else if ( sProp.compareToAscii("PrinterSetup") == 0 )
+ else if ( sProp.equalsAscii("PrinterSetup") )
{
uno::Sequence< sal_Int8 > aEmpty;
aSeqConfigProps[i].Value = uno::makeAny( aEmpty );
diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx
index 97c2af92598f..373f7975c5a3 100644
--- a/xmloff/source/draw/XMLNumberStyles.cxx
+++ b/xmloff/source/draw/XMLNumberStyles.cxx
@@ -627,7 +627,7 @@ void SdXMLNumberFormatImportContext::add( OUString& rNumberStyle, sal_Bool bLong
(pStyleMember->mbTextual == bTextual) &&
(pStyleMember->mbDecimal02 == bDecimal02) &&
( ( (pStyleMember->mpText == NULL) && (rText.isEmpty()) ) ||
- ( pStyleMember->mpText && (rText.compareToAscii( pStyleMember->mpText ) == 0 )) ) ) )
+ ( pStyleMember->mpText && (rText.equalsAscii( pStyleMember->mpText ) ) ) ) ) )
{
mnElements[mnIndex++] = nIndex + 1;
return;
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 2672ad72f5ac..dc67d3f566ba 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1140,7 +1140,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat
const struct ImplAttributeNameConversion* p = getAnimationAttributeNamesConversionList();
while( p->mpAPIName )
{
- if( sTemp.compareToAscii( p->mpAPIName ) == 0 )
+ if( sTemp.equalsAscii( p->mpAPIName ) )
{
sTemp = GetXMLToken( p->meXMLToken );
eAttributeName = p->meXMLToken;
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 99a7ecc7df3a..76fae7c8cb2e 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1883,7 +1883,7 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType
bAutomatic = sal_True;
}
}
- else if ( nLang == LANGUAGE_SYSTEM && aSymbol.compareToAscii("CCC") == 0 )
+ else if ( nLang == LANGUAGE_SYSTEM && aSymbol.equalsAscii("CCC") )
{
// "CCC" is used for automatic long symbol
bAutomatic = sal_True;
@@ -2055,7 +2055,7 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex )
//! collect all conditions first and adjust default to >=0, >0 or <0 depending on count
//! allow blanks in conditions
- if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond.compareToAscii( ">=0" ) == 0 )
+ if ( aConditions.isEmpty() && aMyConditions.size() == 1 && sRealCond.equalsAscii( ">=0" ) )
bDefaultCond = sal_True;
if ( nType == XML_TOK_STYLES_TEXT_STYLE && nIndex == 2 )
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 6b538f00fbe6..85a807617f3a 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -131,13 +131,13 @@ static const char *lcl_getFormFieldmarkName(OUString &name)
{
static const char sCheckbox[]=ODF_FORMCHECKBOX;
static const char sFormDropDown[]=ODF_FORMDROPDOWN;
- if (name.compareToAscii("msoffice.field.FORMCHECKBOX")==0 ||
- name.compareToAscii("ecma.office-open-xml.field.FORMCHECKBOX")==0)
+ if (name.equalsAscii("msoffice.field.FORMCHECKBOX") ||
+ name.equalsAscii("ecma.office-open-xml.field.FORMCHECKBOX") )
return sCheckbox;
- else if (name.compareToAscii(ODF_FORMCHECKBOX)==0)
+ else if (name.equalsAscii(ODF_FORMCHECKBOX) )
return sCheckbox;
- if (name.compareToAscii(ODF_FORMDROPDOWN)==0 ||
- name.compareToAscii("ecma.office-open-xml.field.FORMDROPDOWN")==0)
+ if (name.equalsAscii(ODF_FORMDROPDOWN) ||
+ name.equalsAscii("ecma.office-open-xml.field.FORMDROPDOWN") )
return sFormDropDown;
else
return NULL;
@@ -146,10 +146,10 @@ static const char *lcl_getFormFieldmarkName(OUString &name)
static OUString lcl_getFieldmarkName(OUString &name)
{
static const char sFormtext[]=ODF_FORMTEXT;
- if (name.compareToAscii("msoffice.field.FORMTEXT")==0 ||
- name.compareToAscii("ecma.office-open-xml.field.FORMTEXT")==0)
+ if (name.equalsAscii("msoffice.field.FORMTEXT") ||
+ name.equalsAscii("ecma.office-open-xml.field.FORMTEXT") )
return OUString::createFromAscii(sFormtext);
- else if (name.compareToAscii(ODF_FORMTEXT)==0)
+ else if (name.equalsAscii(ODF_FORMTEXT) )
return OUString::createFromAscii(sFormtext);
else
return name;