summaryrefslogtreecommitdiff
path: root/unoxml/source/events
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/source/events
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/source/events')
-rw-r--r--unoxml/source/events/eventdispatcher.cxx32
1 files changed, 16 insertions, 16 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);