summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 11:06:18 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:12 +0200
commit0a9ef5a18e148c7a5c9a088e153a7873d1564841 (patch)
tree3c3bc21e7ee4f836a1d056695175e0b1a91eda26 /xmloff
parent7944301424aac0943e4ecc0410f495b210ad3b79 (diff)
convert OUString 0==compareToAscii to equalsAscii
Convert code like: 0 == aStr.compareToAscii("XXX") to aStr.equalsAscii("XXX") which is both clearer and faster. Change-Id: I2e906d7d38494db38eb292702fadb781b1251e07
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/ximpshap.cxx32
-rw-r--r--xmloff/source/forms/elementimport.cxx6
-rw-r--r--xmloff/source/forms/layerimport.cxx6
-rw-r--r--xmloff/source/style/xmlprmap.cxx2
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx2
-rw-r--r--xmloff/source/text/txtflde.cxx6
6 files changed, 27 insertions, 27 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index d75147c1e00a..427d1d8fc3b4 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -125,7 +125,7 @@ static bool ImpIsEmptyURL( const OUString& rURL )
// #i13140# Also compare against 'toplevel' URLs. which also
// result in empty filename strings.
- if( 0 == rURL.compareToAscii( "#./" ) )
+ if( rURL.equalsAscii( "#./" ) )
return true;
return false;
@@ -2942,7 +2942,7 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen
if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( aLocalName, XML_MIME_TYPE ) )
{
- if( 0 == xAttrList->getValueByIndex( n ).compareToAscii( "application/vnd.sun.star.media" ) )
+ if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) )
mbMedia = true;
// leave this loop
@@ -3089,49 +3089,49 @@ void SdXMLPluginShapeContext::EndElement()
{
const OUString& rName = maParams[ nParam ].Name;
- if( 0 == rName.compareToAscii( "Loop" ) )
+ if( rName.equalsAscii( "Loop" ) )
{
OUString aValueStr;
maParams[ nParam ].Value >>= aValueStr;
xProps->setPropertyValue("Loop",
- uno::makeAny( static_cast< sal_Bool >( 0 == aValueStr.compareToAscii( "true" ) ) ) );
+ uno::makeAny( static_cast< sal_Bool >( aValueStr.equalsAscii( "true" ) ) ) );
}
- else if( 0 == rName.compareToAscii( "Mute" ) )
+ else if( rName.equalsAscii( "Mute" ) )
{
OUString aValueStr;
maParams[ nParam ].Value >>= aValueStr;
xProps->setPropertyValue("Mute",
- uno::makeAny( static_cast< sal_Bool >( 0 == aValueStr.compareToAscii( "true" ) ) ) );
+ uno::makeAny( static_cast< sal_Bool >( aValueStr.equalsAscii( "true" ) ) ) );
}
- else if( 0 == rName.compareToAscii( "VolumeDB" ) )
+ else if( rName.equalsAscii( "VolumeDB" ) )
{
OUString aValueStr;
maParams[ nParam ].Value >>= aValueStr;
xProps->setPropertyValue("VolumeDB",
uno::makeAny( static_cast< sal_Int16 >( aValueStr.toInt32() ) ) );
}
- else if( 0 == rName.compareToAscii( "Zoom" ) )
+ else if( rName.equalsAscii( "Zoom" ) )
{
OUString aZoomStr;
media::ZoomLevel eZoomLevel;
maParams[ nParam ].Value >>= aZoomStr;
- if( 0 == aZoomStr.compareToAscii( "25%" ) )
+ if( aZoomStr.equalsAscii( "25%" ) )
eZoomLevel = media::ZoomLevel_ZOOM_1_TO_4;
- else if( 0 == aZoomStr.compareToAscii( "50%" ) )
+ else if( aZoomStr.equalsAscii( "50%" ) )
eZoomLevel = media::ZoomLevel_ZOOM_1_TO_2;
- else if( 0 == aZoomStr.compareToAscii( "100%" ) )
+ else if( aZoomStr.equalsAscii( "100%" ) )
eZoomLevel = media::ZoomLevel_ORIGINAL;
- else if( 0 == aZoomStr.compareToAscii( "200%" ) )
+ else if( aZoomStr.equalsAscii( "200%" ) )
eZoomLevel = media::ZoomLevel_ZOOM_2_TO_1;
- else if( 0 == aZoomStr.compareToAscii( "400%" ) )
+ else if( aZoomStr.equalsAscii( "400%" ) )
eZoomLevel = media::ZoomLevel_ZOOM_4_TO_1;
- else if( 0 == aZoomStr.compareToAscii( "fit" ) )
+ else if( aZoomStr.equalsAscii( "fit" ) )
eZoomLevel = media::ZoomLevel_FIT_TO_WINDOW;
- else if( 0 == aZoomStr.compareToAscii( "fixedfit" ) )
+ else if( aZoomStr.equalsAscii( "fixedfit" ) )
eZoomLevel = media::ZoomLevel_FIT_TO_WINDOW_FIXED_ASPECT;
- else if( 0 == aZoomStr.compareToAscii( "fullscreen" ) )
+ else if( aZoomStr.equalsAscii( "fullscreen" ) )
eZoomLevel = media::ZoomLevel_FULLSCREEN;
else
eZoomLevel = media::ZoomLevel_NOT_AVAILABLE;
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 834da3d6fdd8..afe1e72439ed 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -1286,8 +1286,8 @@ namespace xmloff
// * it's the image-data attribute
// * it's the target-location attribute, and we're dealign with an object which has the respective property
sal_Bool bMakeAbsolute =
- ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) )
- || ( ( 0 == _rLocalName.compareToAscii( s_pTargetLocationAttributeName ) )
+ _rLocalName.equalsAscii( s_pImageDataAttributeName )
+ || ( _rLocalName.equalsAscii( s_pTargetLocationAttributeName )
&& ( ( OControlElement::BUTTON == m_eElementType )
|| ( OControlElement::IMAGE == m_eElementType )
)
@@ -1300,7 +1300,7 @@ namespace xmloff
// only resolve image related url
// we don't want say form url targets to be resolved
// using ResolveGraphicObjectURL
- if ( 0 == _rLocalName.compareToAscii( s_pImageDataAttributeName ) )
+ if ( _rLocalName.equalsAscii( s_pImageDataAttributeName ) )
sAdjustedValue = m_rContext.getGlobalContext().ResolveGraphicObjectURL( _rValue, sal_False );
else
sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference( _rValue );
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index d115e5ba571a..6dcfff2935d4 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -103,7 +103,7 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
// properties not added because they're already present in another form
OSL_ENSURE(
- 0 == OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_LOCATION)).compareToAscii(
+ OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_TARGET_LOCATION)).equalsAscii(
OAttributeMetaData::getFormAttributeName(faAction)),
"OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (1)!");
// if this fails, we would have to add a translation from faAction->PROPERTY_TARGETURL
@@ -111,7 +111,7 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
// and CCA_TARGET_LOCATION and faAction should be represented by the same attribute
OSL_ENSURE(
- 0 == OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_NAME)).compareToAscii(
+ OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCA_NAME)).equalsAscii(
OAttributeMetaData::getFormAttributeName(faName)),
"OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (2)!");
// the same for faName, CCA_NAME and PROPERTY_NAME
@@ -484,7 +484,7 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP
const Reference< xml::sax::XAttributeList >&)
{
SvXMLImportContext* pContext = NULL;
- if ( 0 == _rLocalName.compareToAscii( "form" ) )
+ if ( _rLocalName.equalsAscii( "form" ) )
{
if ( m_xCurrentPageFormsSupp.is() )
pContext = new OFormImport(*this, *this, _nPrefix, _rLocalName, m_xCurrentPageFormsSupp->getForms() );
diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx
index 7ad12d57d1ab..b74e4f2b5292 100644
--- a/xmloff/source/style/xmlprmap.cxx
+++ b/xmloff/source/style/xmlprmap.cxx
@@ -183,7 +183,7 @@ sal_Int32 XMLPropertySetMapper::FindEntryIndex(
const XMLPropertySetMapperEntry_Impl& rEntry = aMapEntries[nIndex];
if( rEntry.nXMLNameSpace == nNameSpace &&
rEntry.sXMLAttributeName.equals( sXMLName ) &&
- 0 == rEntry.sAPIPropertyName.compareToAscii( sApiName ) )
+ rEntry.sAPIPropertyName.equalsAscii( sApiName ) )
return nIndex;
else
nIndex++;
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index a8edd774cf1b..686f771ab610 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1512,7 +1512,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext(
if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( aLocalName, XML_MIME_TYPE ) )
{
- if( 0 == xAttrList->getValueByIndex( n ).compareToAscii( "application/vnd.sun.star.media" ) )
+ if( xAttrList->getValueByIndex( n ).equalsAscii( "application/vnd.sun.star.media" ) )
bMedia = true;
// leave this loop
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index d1d485b366ab..18cea9fb8060 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1950,7 +1950,7 @@ void XMLTextFieldExport::ExportFieldDeclarations(
aAny >>= xPropSet;
// save interesting field masters
- if (0 == sFieldMasterType.compareToAscii(FIELD_SERVICE_SETEXP))
+ if (sFieldMasterType.equalsAscii(FIELD_SERVICE_SETEXP))
{
sal_Int32 nType = GetIntProperty(sPropertySubType, xPropSet);
@@ -1964,11 +1964,11 @@ void XMLTextFieldExport::ExportFieldDeclarations(
aVarName.push_back( sFieldMaster );
}
}
- else if (0 == sFieldMasterType.compareToAscii(FIELD_SERVICE_USER))
+ else if (sFieldMasterType.equalsAscii(FIELD_SERVICE_USER))
{
aUserName.push_back( sFieldMaster );
}
- else if (0 == sFieldMasterType.compareToAscii(FIELD_SERVICE_DDE))
+ else if (sFieldMasterType.equalsAscii(FIELD_SERVICE_DDE))
{
aDdeName.push_back( sFieldMaster );
}