diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-15 10:19:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-15 10:19:21 +0100 |
commit | 3c262bacf2bff175014ac56d11fd3d209bec8a43 (patch) | |
tree | 965735a05bfcf4fd0dc9918d95736306a0b594df /unoxml | |
parent | 9ce073bc170f6956938cfb25fd5e5b1ad118df83 (diff) |
unoxml: Use appropriate OUString functions on string constants
Change-Id: If4467034e026409dc9d6f0b5ffcafcf98ff8778e
Diffstat (limited to 'unoxml')
-rw-r--r-- | unoxml/source/events/eventdispatcher.cxx | 32 | ||||
-rw-r--r-- | unoxml/source/rdf/librdf_repository.cxx | 12 |
2 files changed, 21 insertions, 23 deletions
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx index aa698e1846a5..ae53ae2809d6 100644 --- a/unoxml/source/events/eventdispatcher.cxx +++ b/unoxml/source/events/eventdispatcher.cxx @@ -116,13 +116,13 @@ namespace DOM { namespace events { CEvent *pEvent = 0; // pointer to internal event representation OUString const aType = i_xEvent->getType(); - if (aType.equalsAscii("DOMSubtreeModified") || - aType.equalsAscii("DOMNodeInserted") || - aType.equalsAscii("DOMNodeRemoved") || - aType.equalsAscii("DOMNodeRemovedFromDocument") || - aType.equalsAscii("DOMNodeInsertedIntoDocument") || - aType.equalsAscii("DOMAttrModified") || - aType.equalsAscii("DOMCharacterDataModified") ) + if (aType == "DOMSubtreeModified" || + aType == "DOMNodeInserted" || + aType == "DOMNodeRemoved" || + aType == "DOMNodeRemovedFromDocument" || + aType == "DOMNodeInsertedIntoDocument" || + aType == "DOMAttrModified" || + aType == "DOMCharacterDataModified" ) { Reference< XMutationEvent > const aMEvent(i_xEvent, UNO_QUERY_THROW); @@ -137,9 +137,9 @@ namespace DOM { namespace events { aMEvent->getAttrChange()); pEvent = pMEvent; } else if ( // UIEvent - aType.equalsAscii("DOMFocusIn") || - aType.equalsAscii("DOMFocusOut") || - aType.equalsAscii("DOMActivate") ) + aType == "DOMFocusIn" || + aType == "DOMFocusOut" || + aType == "DOMActivate" ) { Reference< XUIEvent > const aUIEvent(i_xEvent, UNO_QUERY_THROW); CUIEvent* pUIEvent = new CUIEvent; @@ -148,12 +148,12 @@ namespace DOM { namespace events { aUIEvent->getView(), aUIEvent->getDetail()); pEvent = pUIEvent; } else if ( // MouseEvent - aType.equalsAscii("click") || - aType.equalsAscii("mousedown") || - aType.equalsAscii("mouseup") || - aType.equalsAscii("mouseover") || - aType.equalsAscii("mousemove") || - aType.equalsAscii("mouseout") ) + aType == "click" || + aType == "mousedown" || + aType == "mouseup" || + aType == "mouseover" || + aType == "mousemove" || + aType == "mouseout" ) { Reference< XMouseEvent > const aMouseEvent(i_xEvent, UNO_QUERY_THROW); diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index fdd5d8a29782..f768f7944471 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -969,7 +969,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, throw lang::IllegalArgumentException( "librdf_Repository::importGraph: graph name is null", *this, 2); } - if (i_xGraphName->getStringValue().matchAsciiL(s_nsOOo, sizeof(s_nsOOo)-1)) + if (i_xGraphName->getStringValue().startsWith(s_nsOOo)) { throw lang::IllegalArgumentException( "librdf_Repository::importGraph: URI is reserved", *this, 0); @@ -1291,7 +1291,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, } const OUString contextU( i_xGraphName->getStringValue() ); - if (contextU.matchAsciiL(s_nsOOo, sizeof(s_nsOOo)-1)) + if (contextU.startsWith(s_nsOOo)) { throw lang::IllegalArgumentException( "librdf_Repository::createGraph: URI is reserved", *this, 0); @@ -1560,7 +1560,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, "ensureMetadataReference did not", *this); } OUString const sXmlId(mdref.First + "#" + mdref.Second); - OUString const sContext(OUString::createFromAscii(s_nsOOo) + sXmlId); + OUString const sContext(s_nsOOo + sXmlId); OUString const content( (i_rRDFaContent.isEmpty()) ? xTextRange->getString() : i_rRDFaContent ); @@ -1637,8 +1637,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, return; // nothing to do... } - OUString const sXmlId( - OUString::createFromAscii(s_nsOOo) + mdref.First + "#" + mdref.Second); + OUString const sXmlId(s_nsOOo + mdref.First + "#" + mdref.Second); clearGraph_NoLock(sXmlId, true); } @@ -1660,8 +1659,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException, OUString const sXmlId(mdref.First + "#" + mdref.Second); uno::Reference<rdf::XURI> xXmlId; try { - xXmlId.set( rdf::URI::create(m_xContext, - OUString::createFromAscii(s_nsOOo) + sXmlId), + xXmlId.set( rdf::URI::create(m_xContext, s_nsOOo + sXmlId), uno::UNO_QUERY_THROW); } catch (const lang::IllegalArgumentException & iae) { throw lang::WrappedTargetRuntimeException( |