summaryrefslogtreecommitdiff
path: root/unoxml
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 /unoxml
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 'unoxml')
-rw-r--r--unoxml/source/events/eventdispatcher.cxx32
-rw-r--r--unoxml/source/service/services.cxx8
2 files changed, 20 insertions, 20 deletions
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx
index 665815b686d3..16c98f663817 100644
--- a/unoxml/source/events/eventdispatcher.cxx
+++ b/unoxml/source/events/eventdispatcher.cxx
@@ -111,13 +111,13 @@ namespace DOM { namespace events {
CEvent *pEvent = 0; // pointer to internal event representation
OUString const aType = i_xEvent->getType();
- if (aType.compareToAscii("DOMSubtreeModified") == 0||
- aType.compareToAscii("DOMNodeInserted") == 0||
- aType.compareToAscii("DOMNodeRemoved") == 0||
- aType.compareToAscii("DOMNodeRemovedFromDocument") == 0||
- aType.compareToAscii("DOMNodeInsertedIntoDocument") == 0||
- aType.compareToAscii("DOMAttrModified") == 0||
- aType.compareToAscii("DOMCharacterDataModified") == 0)
+ if (aType.equalsAscii("DOMSubtreeModified") ||
+ aType.equalsAscii("DOMNodeInserted") ||
+ aType.equalsAscii("DOMNodeRemoved") ||
+ aType.equalsAscii("DOMNodeRemovedFromDocument") ||
+ aType.equalsAscii("DOMNodeInsertedIntoDocument") ||
+ aType.equalsAscii("DOMAttrModified") ||
+ aType.equalsAscii("DOMCharacterDataModified") )
{
Reference< XMutationEvent > const aMEvent(i_xEvent,
UNO_QUERY_THROW);
@@ -132,9 +132,9 @@ namespace DOM { namespace events {
aMEvent->getAttrChange());
pEvent = pMEvent;
} else if ( // UIEvent
- aType.compareToAscii("DOMFocusIn") == 0||
- aType.compareToAscii("DOMFocusOut") == 0||
- aType.compareToAscii("DOMActivate") == 0)
+ aType.equalsAscii("DOMFocusIn") ||
+ aType.equalsAscii("DOMFocusOut") ||
+ aType.equalsAscii("DOMActivate") )
{
Reference< XUIEvent > const aUIEvent(i_xEvent, UNO_QUERY_THROW);
CUIEvent* pUIEvent = new CUIEvent;
@@ -143,12 +143,12 @@ namespace DOM { namespace events {
aUIEvent->getView(), aUIEvent->getDetail());
pEvent = pUIEvent;
} else if ( // MouseEvent
- aType.compareToAscii("click") == 0||
- aType.compareToAscii("mousedown") == 0||
- aType.compareToAscii("mouseup") == 0||
- aType.compareToAscii("mouseover") == 0||
- aType.compareToAscii("mousemove") == 0||
- aType.compareToAscii("mouseout") == 0)
+ aType.equalsAscii("click") ||
+ aType.equalsAscii("mousedown") ||
+ aType.equalsAscii("mouseup") ||
+ aType.equalsAscii("mouseover") ||
+ aType.equalsAscii("mousemove") ||
+ aType.equalsAscii("mouseout") )
{
Reference< XMouseEvent > const aMouseEvent(i_xEvent,
UNO_QUERY_THROW);
diff --git a/unoxml/source/service/services.cxx b/unoxml/source/service/services.cxx
index bc60fa5bc7bc..8978309bc734 100644
--- a/unoxml/source/service/services.cxx
+++ b/unoxml/source/service/services.cxx
@@ -54,28 +54,28 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL unoxml_component_getFactory(const sal_Char *
Reference< XMultiServiceFactory > xServiceManager(
reinterpret_cast< XMultiServiceFactory* >(pServiceManager));
- if (CDocumentBuilder::_getImplementationName().compareToAscii( pImplementationName ) == 0 )
+ if (CDocumentBuilder::_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = Reference< XSingleServiceFactory >(
cppu::createOneInstanceFactory(
xServiceManager, CDocumentBuilder::_getImplementationName(),
CDocumentBuilder::_getInstance, CDocumentBuilder::_getSupportedServiceNames()));
}
- else if (CSAXDocumentBuilder::_getImplementationName().compareToAscii( pImplementationName ) == 0 )
+ else if (CSAXDocumentBuilder::_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = Reference< XSingleServiceFactory >(
cppu::createSingleFactory(
xServiceManager, CSAXDocumentBuilder::_getImplementationName(),
CSAXDocumentBuilder::_getInstance, CSAXDocumentBuilder::_getSupportedServiceNames()));
}
- else if (CXPathAPI::_getImplementationName().compareToAscii( pImplementationName ) == 0 )
+ else if (CXPathAPI::_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = Reference< XSingleServiceFactory >(
cppu::createSingleFactory(
xServiceManager, CXPathAPI::_getImplementationName(),
CXPathAPI::_getInstance, CXPathAPI::_getSupportedServiceNames()));
}
- else if (CTestListener::_getImplementationName().compareToAscii( pImplementationName ) == 0 )
+ else if (CTestListener::_getImplementationName().equalsAscii( pImplementationName ) )
{
xFactory = Reference< XSingleServiceFactory >(
cppu::createSingleFactory(