From 6dea86213c495721790462a7037b0fafc6efa522 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:28:02 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: I4f9d6c93a0bdbba290277a41537ba2728d1ee4f5 --- unoxml/source/xpath/xpathapi.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'unoxml/source/xpath/xpathapi.cxx') diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx index fca018cfd60a..937ac4f9af47 100644 --- a/unoxml/source/xpath/xpathapi.cxx +++ b/unoxml/source/xpath/xpathapi.cxx @@ -60,7 +60,7 @@ namespace XPath const char* CXPathAPI::aImplementationName = "com.sun.star.comp.xml.xpath.XPathAPI"; const char* CXPathAPI::aSupportedServiceNames[] = { "com.sun.star.xml.xpath.XPathAPI", - NULL + nullptr }; OUString CXPathAPI::_getImplementationName() @@ -71,7 +71,7 @@ namespace XPath Sequence CXPathAPI::_getSupportedServiceNames() { Sequence aSequence; - for (int i=0; aSupportedServiceNames[i]!=NULL; i++) { + for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) { aSequence.realloc(i+1); aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i])); } @@ -147,9 +147,9 @@ namespace XPath ::osl::MutexGuard const g(pCNode->GetOwnerDocument().GetMutex()); xmlNodePtr pNode = pCNode->GetNodePtr(); - while (pNode != 0) { + while (pNode != nullptr) { xmlNsPtr curDef = pNode->nsDef; - while (curDef != 0) { + while (curDef != nullptr) { const xmlChar* xHref = curDef->href; OUString aURI(reinterpret_cast(xHref), strlen(reinterpret_cast(xHref)), RTL_TEXTENCODING_UTF8); const xmlChar* xPre = curDef->prefix; @@ -358,13 +358,13 @@ namespace XPath /* Create xpath evaluation context */ std::shared_ptr const xpathCtx( xmlXPathNewContext(pDoc), xmlXPathFreeContext); - if (xpathCtx == 0) { throw XPathException(); } + if (xpathCtx == nullptr) { throw XPathException(); } // set context node xpathCtx->node = pNode; // error handling xpathCtx->error = structured_error_func; - xmlSetGenericErrorFunc(NULL, generic_error_func); + xmlSetGenericErrorFunc(nullptr, generic_error_func); // register namespaces and extension lcl_registerNamespaces(xpathCtx.get(), nsmap); @@ -375,8 +375,8 @@ namespace XPath xmlChar const *xStr = reinterpret_cast(o1.getStr()); std::shared_ptr const xpathObj( xmlXPathEval(xStr, xpathCtx.get()), xmlXPathFreeObject); - xmlSetGenericErrorFunc(NULL, NULL); - if (0 == xpathObj) { + xmlSetGenericErrorFunc(nullptr, nullptr); + if (nullptr == xpathObj) { // OSL_ENSURE(xpathCtx->lastError == NULL, xpathCtx->lastError->message); throw XPathException(); } -- cgit