summaryrefslogtreecommitdiffstats
path: root/unoxml/source/dom
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:28:02 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:58 +0100
commit6dea86213c495721790462a7037b0fafc6efa522 (patch)
tree67bb0fe226c6c8e74e5a640c910da89ff110d458 /unoxml/source/dom
parentloplugin:nullptr (automatic rewrite) (diff)
downloadcore-6dea86213c495721790462a7037b0fafc6efa522.tar.gz
core-6dea86213c495721790462a7037b0fafc6efa522.zip
loplugin:nullptr (automatic rewrite)
Change-Id: I4f9d6c93a0bdbba290277a41537ba2728d1ee4f5
Diffstat (limited to 'unoxml/source/dom')
-rw-r--r--unoxml/source/dom/attr.cxx22
-rw-r--r--unoxml/source/dom/attributesmap.cxx16
-rw-r--r--unoxml/source/dom/characterdata.cxx18
-rw-r--r--unoxml/source/dom/childlist.cxx14
-rw-r--r--unoxml/source/dom/document.cxx66
-rw-r--r--unoxml/source/dom/documentbuilder.cxx16
-rw-r--r--unoxml/source/dom/documenttype.cxx10
-rw-r--r--unoxml/source/dom/element.cxx76
-rw-r--r--unoxml/source/dom/elementlist.cxx10
-rw-r--r--unoxml/source/dom/elementlist.hxx4
-rw-r--r--unoxml/source/dom/entity.cxx6
-rw-r--r--unoxml/source/dom/entityreference.cxx2
-rw-r--r--unoxml/source/dom/node.cxx114
-rw-r--r--unoxml/source/dom/notation.cxx2
-rw-r--r--unoxml/source/dom/processinginstruction.cxx12
-rw-r--r--unoxml/source/dom/saxbuilder.cxx4
16 files changed, 196 insertions, 196 deletions
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index bf03d9ac5d87..d6ee2ef72b84 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -47,7 +47,7 @@ namespace DOM
xmlNsPtr CAttr::GetNamespace(xmlNodePtr const pNode)
{
if (!m_pNamespace.get()) {
- return 0;
+ return nullptr;
}
xmlChar const*const pUri(reinterpret_cast<xmlChar const*>(
m_pNamespace->first.getStr()));
@@ -102,7 +102,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return OUString();
}
OUString const aName(reinterpret_cast<char const *>(m_aAttrPtr->name),
@@ -119,11 +119,11 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
- return 0;
+ if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
+ return nullptr;
}
- if (0 == m_aAttrPtr->parent) {
- return 0;
+ if (nullptr == m_aAttrPtr->parent) {
+ return nullptr;
}
Reference< XElement > const xRet(
static_cast< XNode* >(GetOwnerDocument().GetCNode(
@@ -152,10 +152,10 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return OUString();
}
- if (0 == m_aAttrPtr->children) {
+ if (nullptr == m_aAttrPtr->children) {
return OUString();
}
char const*const pContent((m_aAttrPtr->children)
@@ -173,7 +173,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) {
+ if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return;
}
@@ -191,10 +191,10 @@ namespace DOM
m_aAttrPtr->children =
xmlStringGetNodeList(m_aAttrPtr->doc, buffer.get());
xmlNodePtr tmp = m_aAttrPtr->children;
- while (tmp != NULL) {
+ while (tmp != nullptr) {
tmp->parent = m_aNodePtr;
tmp->doc = m_aAttrPtr->doc;
- if (tmp->next == NULL)
+ if (tmp->next == nullptr)
m_aNodePtr->last = tmp;
tmp = tmp->next;
}
diff --git a/unoxml/source/dom/attributesmap.cxx b/unoxml/source/dom/attributesmap.cxx
index 3f2568899759..13be27c55ec1 100644
--- a/unoxml/source/dom/attributesmap.cxx
+++ b/unoxml/source/dom/attributesmap.cxx
@@ -45,10 +45,10 @@ namespace DOM
sal_Int32 count = 0;
xmlNodePtr pNode = m_pElement->GetNodePtr();
- if (pNode != NULL)
+ if (pNode != nullptr)
{
xmlAttrPtr cur = pNode->properties;
- while (cur != NULL)
+ while (cur != nullptr)
{
count++;
cur = cur->next;
@@ -67,12 +67,12 @@ namespace DOM
Reference< XNode > aNode;
xmlNodePtr pNode = m_pElement->GetNodePtr();
- if (pNode != NULL)
+ if (pNode != nullptr)
{
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr());
xmlAttrPtr cur = pNode->properties;
- while (cur != NULL)
+ while (cur != nullptr)
{
if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0)
{
@@ -98,7 +98,7 @@ namespace DOM
Reference< XNode > aNode;
xmlNodePtr pNode = m_pElement->GetNodePtr();
- if (pNode != NULL)
+ if (pNode != nullptr)
{
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr());
@@ -107,7 +107,7 @@ namespace DOM
reinterpret_cast<xmlChar const*>(o2.getStr());
xmlNsPtr const pNs = xmlSearchNsByHref(pNode->doc, pNode, xNs);
xmlAttrPtr cur = pNode->properties;
- while (cur != NULL && pNs != NULL)
+ while (cur != nullptr && pNs != nullptr)
{
if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0 &&
cur->ns == pNs)
@@ -132,11 +132,11 @@ namespace DOM
Reference< XNode > aNode;
xmlNodePtr pNode = m_pElement->GetNodePtr();
- if (pNode != NULL)
+ if (pNode != nullptr)
{
xmlAttrPtr cur = pNode->properties;
sal_Int32 count = 0;
- while (cur != NULL)
+ while (cur != nullptr)
{
if (count == index)
{
diff --git a/unoxml/source/dom/characterdata.cxx b/unoxml/source/dom/characterdata.cxx
index e1d7534edb21..0f1be2eec1f2 100644
--- a/unoxml/source/dom/characterdata.cxx
+++ b/unoxml/source/dom/characterdata.cxx
@@ -65,7 +65,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeAddContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(arg, RTL_TEXTENCODING_UTF8).getStr()));
@@ -84,7 +84,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
@@ -119,10 +119,10 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aData;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
OSL_ENSURE(m_aNodePtr->content, "character data node with NULL content, please inform lars.oppermann@sun.com!");
- if (m_aNodePtr->content != NULL)
+ if (m_aNodePtr->content != nullptr)
{
aData = OUString(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
}
@@ -139,7 +139,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
sal_Int32 length = 0;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
OUString aData(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
length = aData.getLength();
@@ -155,7 +155,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
@@ -190,7 +190,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
@@ -225,7 +225,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
OUString oldValue(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr()));
@@ -245,7 +245,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aStr;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
// get current data
std::shared_ptr<xmlChar const> const pContent(
diff --git a/unoxml/source/dom/childlist.cxx b/unoxml/source/dom/childlist.cxx
index e993d64fb2fd..d301d7aa9a59 100644
--- a/unoxml/source/dom/childlist.cxx
+++ b/unoxml/source/dom/childlist.cxx
@@ -44,13 +44,13 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
sal_Int32 length = 0;
- if (m_pNode != NULL)
+ if (m_pNode != nullptr)
{
xmlNodePtr cur = m_pNode->GetNodePtr();
- if (0 != cur) {
+ if (nullptr != cur) {
cur = cur->children;
}
- while (cur != NULL)
+ while (cur != nullptr)
{
length++;
cur = cur->next;
@@ -67,13 +67,13 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (m_pNode != NULL)
+ if (m_pNode != nullptr)
{
xmlNodePtr cur = m_pNode->GetNodePtr();
- if (0 != cur) {
+ if (nullptr != cur) {
cur = cur->children;
}
- while (cur != NULL)
+ while (cur != nullptr)
{
if (index-- == 0) {
return Reference< XNode >(
@@ -82,7 +82,7 @@ namespace DOM
cur = cur->next;
}
}
- return 0;
+ return nullptr;
}
}
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index f17910ba1268..f43d0846cc01 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -60,14 +60,14 @@ namespace DOM
{
// find the doc type
xmlNodePtr cur = i_pDocument->children;
- while (cur != NULL)
+ while (cur != nullptr)
{
if ((cur->type == XML_DOCUMENT_TYPE_NODE) ||
(cur->type == XML_DTD_NODE)) {
return cur;
}
}
- return 0;
+ return nullptr;
}
/// get the pointer to the root element node of the document
@@ -75,7 +75,7 @@ namespace DOM
{
// find the document element
xmlNodePtr cur = i_pDocument->children;
- while (cur != NULL)
+ while (cur != nullptr)
{
if (cur->type == XML_ELEMENT_NODE)
break;
@@ -162,8 +162,8 @@ namespace DOM
::rtl::Reference<CNode>
CDocument::GetCNode(xmlNodePtr const pNode, bool const bCreate)
{
- if (0 == pNode) {
- return 0;
+ if (nullptr == pNode) {
+ return nullptr;
}
//check whether there is already an instance for this node
nodemap_t::const_iterator const i = m_NodeMap.find(pNode);
@@ -178,7 +178,7 @@ namespace DOM
}
}
- if (!bCreate) { return 0; }
+ if (!bCreate) { return nullptr; }
// there is not yet an instance wrapping this node,
// create it and store it in the map
@@ -259,7 +259,7 @@ namespace DOM
break;
}
- if (pCNode != 0) {
+ if (pCNode != nullptr) {
bool const bInserted = m_NodeMap.insert(
nodemap_t::value_type(pNode,
::std::make_pair(WeakReference<XNode>(pCNode.get()),
@@ -268,7 +268,7 @@ namespace DOM
OSL_ASSERT(bInserted);
if (!bInserted) {
// if insertion failed, delete new instance and return null
- return 0;
+ return nullptr;
}
}
@@ -286,9 +286,9 @@ namespace DOM
{
i_xHandler->startDocument();
for (xmlNodePtr pChild = m_aNodePtr->children;
- pChild != 0; pChild = pChild->next) {
+ pChild != nullptr; pChild = pChild->next) {
::rtl::Reference<CNode> const pNode = GetCNode(pChild);
- OSL_ENSURE(pNode != 0, "CNode::get returned 0");
+ OSL_ENSURE(pNode != nullptr, "CNode::get returned 0");
pNode->saxify(i_xHandler);
}
i_xHandler->endDocument();
@@ -298,9 +298,9 @@ namespace DOM
{
rContext.mxDocHandler->startDocument();
for (xmlNodePtr pChild = m_aNodePtr->children;
- pChild != 0; pChild = pChild->next) {
+ pChild != nullptr; pChild = pChild->next) {
::rtl::Reference<CNode> const pNode = GetCNode(pChild);
- OSL_ENSURE(pNode != 0, "CNode::get returned 0");
+ OSL_ENSURE(pNode != nullptr, "CNode::get returned 0");
pNode->fastSaxify(rContext);
}
rContext.mxDocHandler->endDocument();
@@ -314,10 +314,10 @@ namespace DOM
return true;
case NodeType_ELEMENT_NODE:
// there may be only one!
- return 0 == lcl_getDocumentRootPtr(m_aDocPtr);
+ return nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
case NodeType_DOCUMENT_TYPE_NODE:
// there may be only one!
- return 0 == lcl_getDocumentType(m_aDocPtr);
+ return nullptr == lcl_getDocumentType(m_aDocPtr);
default:
return false;
}
@@ -397,8 +397,8 @@ namespace DOM
// setup libxml IO and write data to output stream
IOContext ioctx = {m_rOutputStream, false};
xmlOutputBufferPtr pOut = xmlOutputBufferCreateIO(
- writeCallback, closeCallback, &ioctx, NULL);
- xmlSaveFileTo(pOut, m_aNodePtr->doc, NULL);
+ writeCallback, closeCallback, &ioctx, nullptr);
+ xmlSaveFileTo(pOut, m_aNodePtr->doc, nullptr);
}
// call listeners
@@ -439,7 +439,7 @@ namespace DOM
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
- xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr, xName, NULL);
+ xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr, xName, nullptr);
::rtl::Reference< CAttr > const pCAttr(
dynamic_cast< CAttr* >(GetCNode(
reinterpret_cast<xmlNodePtr>(pAttr)).get()));
@@ -472,7 +472,7 @@ namespace DOM
}
oUri = OUStringToOString(ns, RTL_TEXTENCODING_UTF8);
xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr,
- reinterpret_cast<xmlChar const*>(oName.getStr()), 0);
+ reinterpret_cast<xmlChar const*>(oName.getStr()), nullptr);
::rtl::Reference< CAttr > const pCAttr(
dynamic_cast< CAttr* >(GetCNode(
reinterpret_cast<xmlNodePtr>(pAttr)).get()));
@@ -538,7 +538,7 @@ namespace DOM
OString o1 = OUStringToOString(tagName, RTL_TEXTENCODING_UTF8);
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
- xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
+ xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, nullptr, xName, nullptr);
Reference< XElement > const xRet(
static_cast< XNode* >(GetCNode(pNode).get()),
UNO_QUERY_THROW);
@@ -573,7 +573,7 @@ namespace DOM
// xmlNsPtr aNsPtr = xmlNewReconciledNs?
// xmlNsPtr aNsPtr = xmlNewGlobalNs?
- xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, NULL, xName, NULL);
+ xmlNodePtr const pNode = xmlNewDocNode(m_aDocPtr, nullptr, xName, nullptr);
xmlNsPtr const pNs = xmlNewNs(pNode, xUri, xPrefix);
xmlSetNs(pNode, pNs);
Reference< XElement > const xRet(
@@ -654,7 +654,7 @@ namespace DOM
::osl::MutexGuard const g(m_Mutex);
xmlNodePtr const pNode = lcl_getDocumentRootPtr(m_aDocPtr);
- if (!pNode) { return 0; }
+ if (!pNode) { return nullptr; }
Reference< XElement > const xRet(
static_cast< XNode* >(GetCNode(pNode).get()),
UNO_QUERY);
@@ -664,13 +664,13 @@ namespace DOM
static xmlNodePtr
lcl_search_element_by_id(const xmlNodePtr cur, const xmlChar* id)
{
- if (cur == NULL)
- return NULL;
+ if (cur == nullptr)
+ return nullptr;
// look in current node
if (cur->type == XML_ELEMENT_NODE)
{
xmlAttrPtr a = cur->properties;
- while (a != NULL)
+ while (a != nullptr)
{
if (a->atype == XML_ATTRIBUTE_ID) {
if (strcmp(reinterpret_cast<char*>(a->children->content), reinterpret_cast<char const *>(id)) == 0)
@@ -681,7 +681,7 @@ namespace DOM
}
// look in children
xmlNodePtr result = lcl_search_element_by_id(cur->children, id);
- if (result != NULL)
+ if (result != nullptr)
return result;
result = lcl_search_element_by_id(cur->next, id);
return result;
@@ -698,7 +698,7 @@ namespace DOM
OString o1 = OUStringToOString(elementId, RTL_TEXTENCODING_UTF8);
xmlChar const *xId = reinterpret_cast<xmlChar const *>(o1.getStr());
xmlNodePtr const pStart = lcl_getDocumentRootPtr(m_aDocPtr);
- if (!pStart) { return 0; }
+ if (!pStart) { return nullptr; }
xmlNodePtr const pNode = lcl_search_element_by_id(pStart, xId);
Reference< XElement > const xRet(
static_cast< XNode* >(GetCNode(pNode).get()),
@@ -962,12 +962,12 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- OSL_ASSERT(0 != m_aNodePtr);
- if (0 == m_aNodePtr) {
- return 0;
+ OSL_ASSERT(nullptr != m_aNodePtr);
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
xmlDocPtr const pClone(xmlCopyDoc(m_aDocPtr, (bDeep) ? 1 : 0));
- if (0 == pClone) { return 0; }
+ if (nullptr == pClone) { return nullptr; }
Reference< XNode > const xRet(
static_cast<CNode*>(CDocument::CreateCDocument(pClone).get()));
return xRet;
@@ -976,7 +976,7 @@ namespace DOM
Reference< XEvent > SAL_CALL CDocument::createEvent(const OUString& aType) throw (RuntimeException, std::exception)
{
// does not need mutex currently
- events::CEvent *pEvent = 0;
+ events::CEvent *pEvent = nullptr;
if ( aType == "DOMSubtreeModified" || aType == "DOMNodeInserted" || aType == "DOMNodeRemoved"
|| aType == "DOMNodeRemovedFromDocument" || aType == "DOMNodeInsertedIntoDocument" || aType == "DOMAttrModified"
|| aType == "DOMCharacterDataModified")
@@ -1008,7 +1008,7 @@ namespace DOM
// add new namespaces to root node
xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr);
- if (0 != pRoot) {
+ if (nullptr != pRoot) {
const beans::StringPair * pSeq = i_rNamespaces.getConstArray();
for (const beans::StringPair *pNsDef = pSeq;
pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) {
@@ -1037,7 +1037,7 @@ namespace DOM
// add new namespaces to root node
xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr);
- if (0 != pRoot) {
+ if (nullptr != pRoot) {
const beans::StringPair * pSeq = i_rNamespaces.getConstArray();
for (const beans::StringPair *pNsDef = pSeq;
pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) {
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 37d4de501c6d..b48344cf4130 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -106,7 +106,7 @@ namespace DOM
const char* CDocumentBuilder::aImplementationName = "com.sun.star.comp.xml.dom.DocumentBuilder";
const char* CDocumentBuilder::aSupportedServiceNames[] = {
"com.sun.star.xml.dom.DocumentBuilder",
- NULL
+ nullptr
};
OUString CDocumentBuilder::_getImplementationName()
@@ -116,7 +116,7 @@ namespace DOM
Sequence<OUString> CDocumentBuilder::_getSupportedServiceNames()
{
Sequence<OUString> 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]));
}
@@ -246,10 +246,10 @@ namespace DOM
CDocumentBuilder *builder = static_cast< CDocumentBuilder* >(ctxt->_private);
Reference< XEntityResolver > resolver = builder->getEntityResolver();
OUString sysid;
- if (systemId != 0)
+ if (systemId != nullptr)
sysid = OUString(reinterpret_cast<char const *>(systemId), strlen(reinterpret_cast<char const *>(systemId)), RTL_TEXTENCODING_UTF8);
OUString pubid;
- if (publicId != 0)
+ if (publicId != nullptr)
pubid = OUString(reinterpret_cast<char const *>(publicId), strlen(reinterpret_cast<char const *>(publicId)), RTL_TEXTENCODING_UTF8);
// resolve the entity
@@ -336,9 +336,9 @@ namespace DOM
c.close = false;
c.freeOnClose = false;
xmlDocPtr const pDoc = xmlCtxtReadIO(pContext.get(),
- xmlIO_read_func, xmlIO_close_func, &c, 0, 0, 0);
+ xmlIO_read_func, xmlIO_close_func, &c, nullptr, nullptr, 0);
- if (pDoc == 0) {
+ if (pDoc == nullptr) {
throwEx(pContext.get());
}
Reference< XDocument > const xRet(
@@ -360,8 +360,8 @@ namespace DOM
// xmlSetExternalEntityLoader(external_entity_loader);
OString oUri = OUStringToOString(sUri, RTL_TEXTENCODING_UTF8);
char *uri = const_cast<char*>(oUri.getStr());
- xmlDocPtr pDoc = xmlCtxtReadFile(pContext.get(), uri, 0, 0);
- if (pDoc == 0) {
+ xmlDocPtr pDoc = xmlCtxtReadFile(pContext.get(), uri, nullptr, 0);
+ if (pDoc == nullptr) {
throwEx(pContext.get());
}
Reference< XDocument > const xRet(
diff --git a/unoxml/source/dom/documenttype.cxx b/unoxml/source/dom/documenttype.cxx
index 73a0c3e96134..af63d89d79cb 100644
--- a/unoxml/source/dom/documenttype.cxx
+++ b/unoxml/source/dom/documenttype.cxx
@@ -50,7 +50,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
css::uno::Reference< XNamedNodeMap > aMap;
- if (m_aDtdPtr != NULL)
+ if (m_aDtdPtr != nullptr)
{
aMap.set(new CEntitiesMap(this));
}
@@ -76,7 +76,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aName;
- if (m_aDtdPtr != NULL)
+ if (m_aDtdPtr != nullptr)
{
aName = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->name)), RTL_TEXTENCODING_UTF8);
}
@@ -91,7 +91,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
css::uno::Reference< XNamedNodeMap > aMap;
- if (m_aDtdPtr != NULL)
+ if (m_aDtdPtr != nullptr)
{
aMap.set(new CNotationsMap(this));
}
@@ -106,7 +106,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aId;
- if (m_aDtdPtr != NULL)
+ if (m_aDtdPtr != nullptr)
{
aId = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->ExternalID)), RTL_TEXTENCODING_UTF8);
}
@@ -121,7 +121,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aId;
- if (m_aDtdPtr != NULL)
+ if (m_aDtdPtr != nullptr)
{
aId = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->SystemID)), RTL_TEXTENCODING_UTF8);
}
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx
index 48abfdd21649..6d40570a45e5 100644
--- a/unoxml/source/dom/element.cxx
+++ b/unoxml/source/dom/element.cxx
@@ -59,7 +59,7 @@ namespace DOM
new comphelper::AttributeList();
OUString type = "";
// add namespace definitions to attributes
- for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != 0; pNs = pNs->next) {
+ for (xmlNsPtr pNs = m_aNodePtr->nsDef; pNs != nullptr; pNs = pNs->next) {
const xmlChar *pPrefix = pNs->prefix ? pNs->prefix : reinterpret_cast<const xmlChar*>("");
OUString prefix(reinterpret_cast<const sal_Char*>(pPrefix),
strlen(reinterpret_cast<const char*>(pPrefix)),
@@ -74,10 +74,10 @@ namespace DOM
}
// add attributes
for (xmlAttrPtr pAttr = m_aNodePtr->properties;
- pAttr != 0; pAttr = pAttr->next) {
+ pAttr != nullptr; pAttr = pAttr->next) {
::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(
reinterpret_cast<xmlNodePtr>(pAttr));
- OSL_ENSURE(pNode != 0, "CNode::get returned 0");
+ OSL_ENSURE(pNode != nullptr, "CNode::get returned 0");
OUString prefix = pNode->getPrefix();
OUString name = (prefix.isEmpty())
? pNode->getLocalName()
@@ -93,10 +93,10 @@ namespace DOM
i_xHandler->startElement(name, xAttrList);
// recurse
for (xmlNodePtr pChild = m_aNodePtr->children;
- pChild != 0; pChild = pChild->next) {
+ pChild != nullptr; pChild = pChild->next) {
::rtl::Reference<CNode> const pNode(
GetOwnerDocument().GetCNode(pChild));
- OSL_ENSURE(pNode != 0, "CNode::get returned 0");
+ OSL_ENSURE(pNode != nullptr, "CNode::get returned 0");
pNode->saxify(i_xHandler);
}
i_xHandler->endElement(name);
@@ -111,10 +111,10 @@ namespace DOM
// add attributes
i_rContext.mxAttribList->clear();
for (xmlAttrPtr pAttr = m_aNodePtr->properties;
- pAttr != 0; pAttr = pAttr->next) {
+ pAttr != nullptr; pAttr = pAttr->next) {
::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(
reinterpret_cast<xmlNodePtr>(pAttr));
- OSL_ENSURE(pNode != 0, "CNode::get returned 0");
+ OSL_ENSURE(pNode != nullptr, "CNode::get returned 0");
const xmlChar* xName = pAttr->name;
sal_Int32 nAttributeToken=FastToken::DONTKNOW;
@@ -175,10 +175,10 @@ namespace DOM
// recurse
for (xmlNodePtr pChild = m_aNodePtr->children;
- pChild != 0; pChild = pChild->next) {
+ pChild != nullptr; pChild = pChild->next) {
::rtl::Reference<CNode> const pNode(
GetOwnerDocument().GetCNode(pChild));
- OSL_ENSURE(pNode != 0, "CNode::get returned 0");
+ OSL_ENSURE(pNode != nullptr, "CNode::get returned 0");
pNode->fastSaxify(i_rContext);
}
@@ -235,7 +235,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return OUString();
}
// search properties
@@ -258,15 +258,15 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar const*const pName =
reinterpret_cast<xmlChar const*>(o1.getStr());
xmlAttrPtr const pAttr = xmlHasProp(m_aNodePtr, pName);
- if (0 == pAttr) {
- return 0;
+ if (nullptr == pAttr) {
+ return nullptr;
}
Reference< XAttr > const xRet(
static_cast< XNode* >(GetOwnerDocument().GetCNode(
@@ -284,8 +284,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
xmlChar const*const pName =
@@ -294,8 +294,8 @@ namespace DOM
xmlChar const*const pNS =
reinterpret_cast<xmlChar const*>(o2.getStr());
xmlAttrPtr const pAttr = xmlHasNsProp(m_aNodePtr, pName, pNS);
- if (0 == pAttr) {
- return 0;
+ if (nullptr == pAttr) {
+ return nullptr;
}
Reference< XAttr > const xRet(
static_cast< XNode* >(GetOwnerDocument().GetCNode(
@@ -315,7 +315,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return OUString();
}
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
@@ -326,7 +326,7 @@ namespace DOM
reinterpret_cast<xmlChar const*>(o2.getStr());
std::shared_ptr<xmlChar const> const pValue(
xmlGetNsProp(m_aNodePtr, pName, pNS), xmlFree);
- if (0 == pValue) {
+ if (nullptr == pValue) {
return OUString();
}
OUString const ret(reinterpret_cast<sal_Char const*>(pValue.get()),
@@ -376,7 +376,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return OUString();
}
OUString const ret(reinterpret_cast<char const *>(m_aNodePtr->name),
@@ -396,7 +396,7 @@ namespace DOM
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
- return (m_aNodePtr != NULL && xmlHasProp(m_aNodePtr, xName) != NULL);
+ return (m_aNodePtr != nullptr && xmlHasProp(m_aNodePtr, xName) != nullptr);
}
/**
@@ -413,7 +413,7 @@ namespace DOM
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr());
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
xmlChar const *xNs = reinterpret_cast<xmlChar const *>(o2.getStr());
- return (m_aNodePtr != NULL && xmlHasNsProp(m_aNodePtr, xName, xNs) != NULL);
+ return (m_aNodePtr != nullptr && xmlHasNsProp(m_aNodePtr, xName, xNs) != nullptr);
}
/**
@@ -424,7 +424,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return;
}
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
@@ -449,7 +449,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return;
}
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
@@ -479,8 +479,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
::rtl::Reference<CNode> const pCNode(
@@ -538,7 +538,7 @@ namespace DOM
::osl::ClearableMutexGuard guard(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
throw RuntimeException();
}
@@ -557,9 +557,9 @@ namespace DOM
throw e;
}
- xmlAttrPtr res = NULL;
+ xmlAttrPtr res = nullptr;
xmlChar const*const pContent(
- (pAttr->children) ? pAttr->children->content : 0);
+ (pAttr->children) ? pAttr->children->content : nullptr);
if (bNS) {
xmlNsPtr const pNs( pCAttr->GetNamespace(m_aNodePtr) );
@@ -623,14 +623,14 @@ namespace DOM
OString o2 = OUStringToOString(value, RTL_TEXTENCODING_UTF8);
xmlChar const *xValue = reinterpret_cast<xmlChar const *>(o2.getStr());
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
throw RuntimeException();
}
OUString oldValue;
AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
std::shared_ptr<xmlChar const> const pOld(
xmlGetProp(m_aNodePtr, xName), xmlFree);
- if (pOld == 0) {
+ if (pOld == nullptr) {
aChangeType = AttrChangeType_ADDITION;
xmlNewProp(m_aNodePtr, xName, xValue);
} else {
@@ -667,8 +667,8 @@ namespace DOM
::osl::ClearableMutexGuard guard(m_rMutex);
OString o1, o2, o3, o4, o5;
- xmlChar const *xPrefix = NULL;
- xmlChar const *xLName = NULL;
+ xmlChar const *xPrefix = nullptr;
+ xmlChar const *xLName = nullptr;
o1 = OUStringToOString(qualifiedName, RTL_TEXTENCODING_UTF8);
xmlChar const *xQName = reinterpret_cast<xmlChar const *>(o1.getStr());
sal_Int32 idx = qualifiedName.indexOf(':');
@@ -691,14 +691,14 @@ namespace DOM
xmlChar const *xURI= reinterpret_cast<xmlChar const *>(o4.getStr());
xmlChar const *xValue = reinterpret_cast<xmlChar const *>(o5.getStr());
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
throw RuntimeException();
}
//find the right namespace
xmlNsPtr pNs = xmlSearchNs(m_aNodePtr->doc, m_aNodePtr, xPrefix);
// if no namespace found, create a new one
- if (pNs == NULL) {
+ if (pNs == nullptr) {
pNs = xmlNewNs(m_aNodePtr, xURI, xPrefix);
}
@@ -713,7 +713,7 @@ namespace DOM
AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
std::shared_ptr<xmlChar const> const pOld(
xmlGetNsProp(m_aNodePtr, xLName, pNs->href), xmlFree);
- if (pOld == 0) {
+ if (pOld == nullptr) {
aChangeType = AttrChangeType_ADDITION;
xmlNewNsProp(m_aNodePtr, pNs, xLName, xValue);
} else {
@@ -756,7 +756,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aName;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<const char*>(xName), strlen(reinterpret_cast<const char*>(xName)), RTL_TEXTENCODING_UTF8);
diff --git a/unoxml/source/dom/elementlist.cxx b/unoxml/source/dom/elementlist.cxx
index e67e5f46c14d..8867d38bbf43 100644
--- a/unoxml/source/dom/elementlist.cxx
+++ b/unoxml/source/dom/elementlist.cxx
@@ -87,7 +87,7 @@ namespace DOM
: m_pElement(pElement)
, m_rMutex(rMutex)
, m_pName(lcl_initXmlString(rName))
- , m_pURI((pURI) ? lcl_initXmlString(*pURI) : 0)
+ , m_pURI((pURI) ? lcl_initXmlString(*pURI) : nullptr)
, m_bRebuild(true)
{
}
@@ -134,7 +134,7 @@ namespace DOM
}
}
- while (pNode != NULL )
+ while (pNode != nullptr )
{
if (pNode->type == XML_ELEMENT_NODE &&
(strcmp(reinterpret_cast<char const *>(pNode->name), reinterpret_cast<char*>(m_pName.get())) == 0))
@@ -142,14 +142,14 @@ namespace DOM
if (!m_pURI) {
m_nodevector.push_back(pNode);
} else {
- if (pNode->ns != NULL && (0 ==
+ if (pNode->ns != nullptr && (0 ==
strcmp(reinterpret_cast<char const *>(pNode->ns->href), reinterpret_cast<char*>(m_pURI.get()))))
{
m_nodevector.push_back(pNode);
}
}
}
- if (pNode->children != NULL) buildlist(pNode->children, false);
+ if (pNode->children != nullptr) buildlist(pNode->children, false);
if (!start) pNode = pNode->next;
else break; // fold back
@@ -179,7 +179,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
- if (!m_pElement.is()) { return 0; }
+ if (!m_pElement.is()) { return nullptr; }
buildlist(m_pElement->GetNodePtr());
if (m_nodevector.size() <= static_cast<size_t>(index)) {
diff --git a/unoxml/source/dom/elementlist.hxx b/unoxml/source/dom/elementlist.hxx
index 7e4bf688dc6a..a95258373911 100644
--- a/unoxml/source/dom/elementlist.hxx
+++ b/unoxml/source/dom/elementlist.hxx
@@ -66,7 +66,7 @@ namespace DOM
public:
CElementListImpl(::rtl::Reference<CElement> const& pElement,
::osl::Mutex & rMutex,
- OUString const& rName, OUString const*const pURI = 0);
+ OUString const& rName, OUString const*const pURI = nullptr);
void registerListener(CElement & rElement);
@@ -96,7 +96,7 @@ namespace DOM
public:
CElementList(::rtl::Reference<CElement> const& pElement,
::osl::Mutex & rMutex,
- OUString const& rName, OUString const*const pURI = 0);
+ OUString const& rName, OUString const*const pURI = nullptr);
/**
The number of nodes in the list.
diff --git a/unoxml/source/dom/entity.cxx b/unoxml/source/dom/entity.cxx
index 269237e0642c..61d0420c60eb 100644
--- a/unoxml/source/dom/entity.cxx
+++ b/unoxml/source/dom/entity.cxx
@@ -70,7 +70,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aID;
- if(m_aEntityPtr != NULL)
+ if(m_aEntityPtr != nullptr)
{
aID = OUString(reinterpret_cast<char const *>(m_aEntityPtr->ExternalID), strlen(reinterpret_cast<char const *>(m_aEntityPtr->ExternalID)), RTL_TEXTENCODING_UTF8);
}
@@ -85,7 +85,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aID;
- if(m_aEntityPtr != NULL)
+ if(m_aEntityPtr != nullptr)
{
aID = OUString(reinterpret_cast<char const *>(m_aEntityPtr->SystemID), strlen(reinterpret_cast<char const *>(m_aEntityPtr->SystemID)), RTL_TEXTENCODING_UTF8);
}
@@ -96,7 +96,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aName;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
diff --git a/unoxml/source/dom/entityreference.cxx b/unoxml/source/dom/entityreference.cxx
index 6ef84b26cb99..ebe19dcdaeb1 100644
--- a/unoxml/source/dom/entityreference.cxx
+++ b/unoxml/source/dom/entityreference.cxx
@@ -54,7 +54,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aName;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index bf378c087044..c0c28e148c96 100644
--- a/unoxml/source/dom/node.cxx
+++ b/unoxml/source/dom/node.cxx
@@ -72,7 +72,7 @@ namespace DOM
void addNamespaces(Context& io_rContext, xmlNodePtr pNode)
{
// add node's namespaces to current context
- for (xmlNsPtr pNs = pNode->nsDef; pNs != 0; pNs = pNs->next) {
+ for (xmlNsPtr pNs = pNode->nsDef; pNs != nullptr; pNs = pNs->next) {
const xmlChar *pPrefix = pNs->prefix;
// prefix can be NULL when xmlns attribute is empty (xmlns="")
OString prefix(reinterpret_cast<const sal_Char*>(pPrefix),
@@ -140,7 +140,7 @@ namespace DOM
// keep containing document alive
// (but not if this is a document; that would create a leak!)
, m_xDocument( (m_aNodePtr->type != XML_DOCUMENT_NODE)
- ? &const_cast<CDocument&>(rDocument) : 0 )
+ ? &const_cast<CDocument&>(rDocument) : nullptr )
, m_rMutex(const_cast< ::osl::Mutex & >(rMutex))
{
OSL_ASSERT(m_aNodePtr);
@@ -149,14 +149,14 @@ namespace DOM
void CNode::invalidate()
{
//remove from list if this wrapper goes away
- if (m_aNodePtr != 0 && m_xDocument.is()) {
+ if (m_aNodePtr != nullptr && m_xDocument.is()) {
m_xDocument->RemoveCNode(m_aNodePtr, this);
}
// #i113663#: unlinked nodes will not be freed by xmlFreeDoc
if (m_bUnlinked) {
xmlFreeNode(m_aNodePtr);
}
- m_aNodePtr = 0;
+ m_aNodePtr = nullptr;
}
CNode::~CNode()
@@ -174,7 +174,7 @@ namespace DOM
CNode::GetImplementation(uno::Reference<uno::XInterface> const& xNode)
{
uno::Reference<lang::XUnoTunnel> const xUnoTunnel(xNode, UNO_QUERY);
- if (!xUnoTunnel.is()) { return 0; }
+ if (!xUnoTunnel.is()) { return nullptr; }
CNode *const pCNode( reinterpret_cast< CNode* >(
::sal::static_int_cast< sal_IntPtr >(
xUnoTunnel->getSomething(theCNodeUnoTunnelId::get().getSeq()))));
@@ -193,14 +193,14 @@ namespace DOM
{
// recursively exchange any references to oldNs with references to newNs
xmlNodePtr cur = aNode;
- while (cur != 0)
+ while (cur != nullptr)
{
if (cur->ns == oldNs)
cur->ns = newNs;
if (cur->type == XML_ELEMENT_NODE)
{
xmlAttrPtr curAttr = cur->properties;
- while(curAttr != 0)
+ while(curAttr != nullptr)
{
if (curAttr->ns == oldNs)
curAttr->ns = newNs;
@@ -217,35 +217,35 @@ namespace DOM
xmlNodePtr cur = aNode;
//handle attributes
- if (cur != NULL && cur->type == XML_ELEMENT_NODE)
+ if (cur != nullptr && cur->type == XML_ELEMENT_NODE)
{
xmlAttrPtr curAttr = cur->properties;
- while(curAttr != 0)
+ while(curAttr != nullptr)
{
- if (curAttr->ns != NULL)
+ if (curAttr->ns != nullptr)
{
xmlNsPtr ns = xmlSearchNs(cur->doc, aParent, curAttr->ns->prefix);
- if (ns != NULL)
+ if (ns != nullptr)
curAttr->ns = ns;
}
curAttr = curAttr->next;
}
}
- while (cur != NULL)
+ while (cur != nullptr)
{
nscleanup(cur->children, cur);
- if (cur->ns != NULL)
+ if (cur->ns != nullptr)
{
xmlNsPtr ns = xmlSearchNs(cur->doc, aParent, cur->ns->prefix);
- if (ns != NULL && ns != cur->ns && strcmp(reinterpret_cast<char const *>(ns->href), reinterpret_cast<char const *>(cur->ns->href))==0)
+ if (ns != nullptr && ns != cur->ns && strcmp(reinterpret_cast<char const *>(ns->href), reinterpret_cast<char const *>(cur->ns->href))==0)
{
xmlNsPtr curDef = cur->nsDef;
xmlNsPtr *refp = &(cur->nsDef); // insert point
- while (curDef != NULL)
+ while (curDef != nullptr)
{
ns = xmlSearchNs(cur->doc, aParent, curDef->prefix);
- if (ns != NULL && ns != curDef && strcmp(reinterpret_cast<char const *>(ns->href), reinterpret_cast<char const *>(curDef->href))==0)
+ if (ns != nullptr && ns != curDef && strcmp(reinterpret_cast<char const *>(ns->href), reinterpret_cast<char const *>(curDef->href))==0)
{
// reconnect ns pointers in sub-tree to newly found ns before
// removing redundant nsdecl to prevent dangling pointers.
@@ -291,7 +291,7 @@ namespace DOM
{
::osl::ClearableMutexGuard guard(m_rMutex);
- if (0 == m_aNodePtr) { return 0; }
+ if (nullptr == m_aNodePtr) { return nullptr; }
CNode *const pNewChild(CNode::GetImplementation(xNewChild));
if (!pNewChild) { throw RuntimeException(); }
@@ -311,7 +311,7 @@ namespace DOM
e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
throw e;
}
- if (cur->parent != NULL) {
+ if (cur->parent != nullptr) {
DOMException e;
e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
throw e;
@@ -323,7 +323,7 @@ namespace DOM
}
// check whether this is an attribute node; it needs special handling
- xmlNodePtr res = NULL;
+ xmlNodePtr res = nullptr;
if (cur->type == XML_ATTRIBUTE_NODE)
{
xmlChar const*const pChildren((cur->children)
@@ -352,7 +352,7 @@ namespace DOM
}
}
- if (!res) { return 0; }
+ if (!res) { return nullptr; }
// use custom ns cleanup instead of
// xmlReconciliateNs(m_aNodePtr->doc, m_aNodePtr);
@@ -361,7 +361,7 @@ namespace DOM
::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(res);
- if (!pNode.is()) { return 0; }
+ if (!pNode.is()) { return nullptr; }
// dispatch DOMNodeInserted event, target is the new node
// this node is the related node
@@ -393,12 +393,12 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
::rtl::Reference<CNode> const pNode = GetOwnerDocument().GetCNode(
xmlCopyNode(m_aNodePtr, (bDeep) ? 1 : 0));
- if (!pNode.is()) { return 0; }
+ if (!pNode.is()) { return nullptr; }
pNode->m_bUnlinked = true; // not linked yet
return pNode.get();
}
@@ -422,8 +422,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XNodeList > const xNodeList(new CChildList(this, m_rMutex));
return xNodeList;
@@ -437,8 +437,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XNode > const xNode(
GetOwnerDocument().GetCNode(m_aNodePtr->children).get());
@@ -453,8 +453,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XNode > const xNode(
GetOwnerDocument().GetCNode(xmlGetLastChild(m_aNodePtr)).get());
@@ -481,9 +481,9 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aURI;
- if (m_aNodePtr != NULL &&
+ if (m_aNodePtr != nullptr &&
(m_aNodePtr->type == XML_ELEMENT_NODE || m_aNodePtr->type == XML_ATTRIBUTE_NODE) &&
- m_aNodePtr->ns != NULL)
+ m_aNodePtr->ns != nullptr)
{
const xmlChar* xHref = m_aNodePtr->ns->href;
aURI = OUString(reinterpret_cast<char const *>(xHref), strlen(reinterpret_cast<char const *>(xHref)), RTL_TEXTENCODING_UTF8);
@@ -499,8 +499,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XNode > const xNode(
GetOwnerDocument().GetCNode(m_aNodePtr->next).get());
@@ -564,8 +564,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XDocument > const xDoc(& GetOwnerDocument());
return xDoc;
@@ -579,8 +579,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XNode > const xNode(
GetOwnerDocument().GetCNode(m_aNodePtr->parent).get());
@@ -596,12 +596,12 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aPrefix;
- if (m_aNodePtr != NULL &&
+ if (m_aNodePtr != nullptr &&
(m_aNodePtr->type == XML_ELEMENT_NODE || m_aNodePtr->type == XML_ATTRIBUTE_NODE) &&
- m_aNodePtr->ns != NULL)
+ m_aNodePtr->ns != nullptr)
{
const xmlChar* xPrefix = m_aNodePtr->ns->prefix;
- if( xPrefix != NULL )
+ if( xPrefix != nullptr )
aPrefix = OUString(reinterpret_cast<char const *>(xPrefix), strlen(reinterpret_cast<char const *>(xPrefix)), RTL_TEXTENCODING_UTF8);
}
return aPrefix;
@@ -616,8 +616,8 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
- return 0;
+ if (nullptr == m_aNodePtr) {
+ return nullptr;
}
Reference< XNode > const xNode(
GetOwnerDocument().GetCNode(m_aNodePtr->prev).get());
@@ -632,7 +632,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- return (m_aNodePtr != NULL && m_aNodePtr->properties != NULL);
+ return (m_aNodePtr != nullptr && m_aNodePtr->properties != nullptr);
}
/**
@@ -643,7 +643,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- return (m_aNodePtr != NULL && m_aNodePtr->children != NULL);
+ return (m_aNodePtr != nullptr && m_aNodePtr->children != nullptr);
}
/**
@@ -681,7 +681,7 @@ namespace DOM
throw e;
}
// already has parent
- if (pNewChild->parent != NULL)
+ if (pNewChild->parent != nullptr)
{
DOMException e;
e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
@@ -702,14 +702,14 @@ namespace DOM
xmlNodePtr cur = m_aNodePtr->children;
//search child before which to insert
- while (cur != NULL)
+ while (cur != nullptr)
{
if (cur == pRefChild) {
// insert before
pNewChild->next = cur;
pNewChild->prev = cur->prev;
cur->prev = pNewChild;
- if (pNewChild->prev != NULL) {
+ if (pNewChild->prev != nullptr) {
pNewChild->prev->next = pNewChild;
}
pNewChild->parent = cur->parent;
@@ -866,7 +866,7 @@ namespace DOM
throw e;
}
// already has parent
- if (pNew->parent != NULL) {
+ if (pNew->parent != nullptr) {
DOMException e;
e.Code = DOMExceptionType_HIERARCHY_REQUEST_ERR;
throw e;
@@ -897,16 +897,16 @@ namespace DOM
xmlNodePtr cur = m_aNodePtr->children;
//find old node in child list
- while (cur != NULL)
+ while (cur != nullptr)
{
if(cur == pOld)
{
// exchange nodes
pNew->prev = pOld->prev;
- if (pNew->prev != NULL)
+ if (pNew->prev != nullptr)
pNew->prev->next = pNew;
pNew->next = pOld->next;
- if (pNew->next != NULL)
+ if (pNew->next != nullptr)
pNew->next->prev = pNew;
pNew->parent = pOld->parent;
// coverity[var_deref_op] pNew->parent cannot be NULL here
@@ -914,9 +914,9 @@ namespace DOM
pNew->parent->children = pNew;
if(pNew->parent->last == pOld)
pNew->parent->last = pNew;
- pOld->next = NULL;
- pOld->prev = NULL;
- pOld->parent = NULL;
+ pOld->next = nullptr;
+ pOld->prev = nullptr;
+ pOld->parent = nullptr;
pOldNode->m_bUnlinked = true;
pNewNode->m_bUnlinked = false; // will be deleted by xmlFreeDoc
}
@@ -967,7 +967,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if ((0 == m_aNodePtr) ||
+ if ((nullptr == m_aNodePtr) ||
((m_aNodePtr->type != XML_ELEMENT_NODE) &&
(m_aNodePtr->type != XML_ATTRIBUTE_NODE)))
{
@@ -977,7 +977,7 @@ namespace DOM
}
OString o1 = OUStringToOString(prefix, RTL_TEXTENCODING_UTF8);
xmlChar const *pBuf = reinterpret_cast<xmlChar const *>(o1.getStr());
- if (m_aNodePtr != NULL && m_aNodePtr->ns != NULL)
+ if (m_aNodePtr != nullptr && m_aNodePtr->ns != nullptr)
{
xmlFree(const_cast<xmlChar *>(m_aNodePtr->ns->prefix));
m_aNodePtr->ns->prefix = xmlStrdup(pBuf);
diff --git a/unoxml/source/dom/notation.cxx b/unoxml/source/dom/notation.cxx
index fa9e1d74ee67..f64e31bca34b 100644
--- a/unoxml/source/dom/notation.cxx
+++ b/unoxml/source/dom/notation.cxx
@@ -59,7 +59,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex);
OUString aName;
- if (m_aNodePtr != NULL)
+ if (m_aNodePtr != nullptr)
{
const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
diff --git a/unoxml/source/dom/processinginstruction.cxx b/unoxml/source/dom/processinginstruction.cxx
index 79b2f1cdd157..1cda0809808f 100644
--- a/unoxml/source/dom/processinginstruction.cxx
+++ b/unoxml/source/dom/processinginstruction.cxx
@@ -54,13 +54,13 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return OUString();
}
char const*const pContent(
reinterpret_cast<char const*>(m_aNodePtr->content));
- if (0 == pContent) {
+ if (nullptr == pContent) {
return OUString();
}
OUString const ret(pContent, strlen(pContent), RTL_TEXTENCODING_UTF8);
@@ -75,13 +75,13 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return OUString();
}
char const*const pName(
reinterpret_cast<char const*>(m_aNodePtr->name));
- if (0 == pName) {
+ if (nullptr == pName) {
return OUString();
}
OUString const ret(pName, strlen(pName), RTL_TEXTENCODING_UTF8);
@@ -96,7 +96,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
throw RuntimeException();
}
@@ -113,7 +113,7 @@ namespace DOM
{
::osl::MutexGuard const g(m_rMutex);
- if (0 == m_aNodePtr) {
+ if (nullptr == m_aNodePtr) {
return OUString();
}
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx
index be04b5fae7db..786f3700b9f0 100644
--- a/unoxml/source/dom/saxbuilder.cxx
+++ b/unoxml/source/dom/saxbuilder.cxx
@@ -41,7 +41,7 @@ namespace DOM
const char* CSAXDocumentBuilder::aImplementationName = "com.sun.star.comp.xml.dom.SAXDocumentBuilder";
const char* CSAXDocumentBuilder::aSupportedServiceNames[] = {
"com.sun.star.xml.dom.SAXDocumentBuilder",
- NULL
+ nullptr
};
CSAXDocumentBuilder::CSAXDocumentBuilder(const Reference< XMultiServiceFactory >& mgr)
@@ -56,7 +56,7 @@ namespace DOM
Sequence<OUString> CSAXDocumentBuilder::_getSupportedServiceNames()
{
Sequence<OUString> 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]));
}