Kaydet (Commit) 6dea8621 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: I4f9d6c93a0bdbba290277a41537ba2728d1ee4f5
üst cf7dc8bc
...@@ -47,7 +47,7 @@ namespace DOM ...@@ -47,7 +47,7 @@ namespace DOM
xmlNsPtr CAttr::GetNamespace(xmlNodePtr const pNode) xmlNsPtr CAttr::GetNamespace(xmlNodePtr const pNode)
{ {
if (!m_pNamespace.get()) { if (!m_pNamespace.get()) {
return 0; return nullptr;
} }
xmlChar const*const pUri(reinterpret_cast<xmlChar const*>( xmlChar const*const pUri(reinterpret_cast<xmlChar const*>(
m_pNamespace->first.getStr())); m_pNamespace->first.getStr()));
...@@ -102,7 +102,7 @@ namespace DOM ...@@ -102,7 +102,7 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) { if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return OUString(); return OUString();
} }
OUString const aName(reinterpret_cast<char const *>(m_aAttrPtr->name), OUString const aName(reinterpret_cast<char const *>(m_aAttrPtr->name),
...@@ -119,11 +119,11 @@ namespace DOM ...@@ -119,11 +119,11 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) { if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return 0; return nullptr;
} }
if (0 == m_aAttrPtr->parent) { if (nullptr == m_aAttrPtr->parent) {
return 0; return nullptr;
} }
Reference< XElement > const xRet( Reference< XElement > const xRet(
static_cast< XNode* >(GetOwnerDocument().GetCNode( static_cast< XNode* >(GetOwnerDocument().GetCNode(
...@@ -152,10 +152,10 @@ namespace DOM ...@@ -152,10 +152,10 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) { if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return OUString(); return OUString();
} }
if (0 == m_aAttrPtr->children) { if (nullptr == m_aAttrPtr->children) {
return OUString(); return OUString();
} }
char const*const pContent((m_aAttrPtr->children) char const*const pContent((m_aAttrPtr->children)
...@@ -173,7 +173,7 @@ namespace DOM ...@@ -173,7 +173,7 @@ namespace DOM
{ {
::osl::ClearableMutexGuard guard(m_rMutex); ::osl::ClearableMutexGuard guard(m_rMutex);
if ((0 == m_aNodePtr) || (0 == m_aAttrPtr)) { if ((nullptr == m_aNodePtr) || (nullptr == m_aAttrPtr)) {
return; return;
} }
...@@ -191,10 +191,10 @@ namespace DOM ...@@ -191,10 +191,10 @@ namespace DOM
m_aAttrPtr->children = m_aAttrPtr->children =
xmlStringGetNodeList(m_aAttrPtr->doc, buffer.get()); xmlStringGetNodeList(m_aAttrPtr->doc, buffer.get());
xmlNodePtr tmp = m_aAttrPtr->children; xmlNodePtr tmp = m_aAttrPtr->children;
while (tmp != NULL) { while (tmp != nullptr) {
tmp->parent = m_aNodePtr; tmp->parent = m_aNodePtr;
tmp->doc = m_aAttrPtr->doc; tmp->doc = m_aAttrPtr->doc;
if (tmp->next == NULL) if (tmp->next == nullptr)
m_aNodePtr->last = tmp; m_aNodePtr->last = tmp;
tmp = tmp->next; tmp = tmp->next;
} }
......
...@@ -45,10 +45,10 @@ namespace DOM ...@@ -45,10 +45,10 @@ namespace DOM
sal_Int32 count = 0; sal_Int32 count = 0;
xmlNodePtr pNode = m_pElement->GetNodePtr(); xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL) if (pNode != nullptr)
{ {
xmlAttrPtr cur = pNode->properties; xmlAttrPtr cur = pNode->properties;
while (cur != NULL) while (cur != nullptr)
{ {
count++; count++;
cur = cur->next; cur = cur->next;
...@@ -67,12 +67,12 @@ namespace DOM ...@@ -67,12 +67,12 @@ namespace DOM
Reference< XNode > aNode; Reference< XNode > aNode;
xmlNodePtr pNode = m_pElement->GetNodePtr(); xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL) if (pNode != nullptr)
{ {
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8); OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr()); xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr());
xmlAttrPtr cur = pNode->properties; xmlAttrPtr cur = pNode->properties;
while (cur != NULL) while (cur != nullptr)
{ {
if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0) if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0)
{ {
...@@ -98,7 +98,7 @@ namespace DOM ...@@ -98,7 +98,7 @@ namespace DOM
Reference< XNode > aNode; Reference< XNode > aNode;
xmlNodePtr pNode = m_pElement->GetNodePtr(); xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL) if (pNode != nullptr)
{ {
OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8); OString o1 = OUStringToOString(localName, RTL_TEXTENCODING_UTF8);
xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr()); xmlChar const * xName = reinterpret_cast<xmlChar const *>(o1.getStr());
...@@ -107,7 +107,7 @@ namespace DOM ...@@ -107,7 +107,7 @@ namespace DOM
reinterpret_cast<xmlChar const*>(o2.getStr()); reinterpret_cast<xmlChar const*>(o2.getStr());
xmlNsPtr const pNs = xmlSearchNsByHref(pNode->doc, pNode, xNs); xmlNsPtr const pNs = xmlSearchNsByHref(pNode->doc, pNode, xNs);
xmlAttrPtr cur = pNode->properties; 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 && if( strcmp(reinterpret_cast<char const *>(xName), reinterpret_cast<char const *>(cur->name)) == 0 &&
cur->ns == pNs) cur->ns == pNs)
...@@ -132,11 +132,11 @@ namespace DOM ...@@ -132,11 +132,11 @@ namespace DOM
Reference< XNode > aNode; Reference< XNode > aNode;
xmlNodePtr pNode = m_pElement->GetNodePtr(); xmlNodePtr pNode = m_pElement->GetNodePtr();
if (pNode != NULL) if (pNode != nullptr)
{ {
xmlAttrPtr cur = pNode->properties; xmlAttrPtr cur = pNode->properties;
sal_Int32 count = 0; sal_Int32 count = 0;
while (cur != NULL) while (cur != nullptr)
{ {
if (count == index) if (count == index)
{ {
......
...@@ -65,7 +65,7 @@ namespace DOM ...@@ -65,7 +65,7 @@ namespace DOM
{ {
::osl::ClearableMutexGuard guard(m_rMutex); ::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); 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())); xmlNodeAddContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(arg, RTL_TEXTENCODING_UTF8).getStr()));
...@@ -84,7 +84,7 @@ namespace DOM ...@@ -84,7 +84,7 @@ namespace DOM
{ {
::osl::ClearableMutexGuard guard(m_rMutex); ::osl::ClearableMutexGuard guard(m_rMutex);
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
// get current data // get current data
std::shared_ptr<xmlChar const> const pContent( std::shared_ptr<xmlChar const> const pContent(
...@@ -119,10 +119,10 @@ namespace DOM ...@@ -119,10 +119,10 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aData; 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!"); 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); aData = OUString(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
} }
...@@ -139,7 +139,7 @@ namespace DOM ...@@ -139,7 +139,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
sal_Int32 length = 0; 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); OUString aData(reinterpret_cast<char*>(m_aNodePtr->content), strlen(reinterpret_cast<char*>(m_aNodePtr->content)), RTL_TEXTENCODING_UTF8);
length = aData.getLength(); length = aData.getLength();
...@@ -155,7 +155,7 @@ namespace DOM ...@@ -155,7 +155,7 @@ namespace DOM
{ {
::osl::ClearableMutexGuard guard(m_rMutex); ::osl::ClearableMutexGuard guard(m_rMutex);
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
// get current data // get current data
std::shared_ptr<xmlChar const> const pContent( std::shared_ptr<xmlChar const> const pContent(
...@@ -190,7 +190,7 @@ namespace DOM ...@@ -190,7 +190,7 @@ namespace DOM
{ {
::osl::ClearableMutexGuard guard(m_rMutex); ::osl::ClearableMutexGuard guard(m_rMutex);
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
// get current data // get current data
std::shared_ptr<xmlChar const> const pContent( std::shared_ptr<xmlChar const> const pContent(
...@@ -225,7 +225,7 @@ namespace DOM ...@@ -225,7 +225,7 @@ namespace DOM
{ {
::osl::ClearableMutexGuard guard(m_rMutex); ::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); 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())); xmlNodeSetContent(m_aNodePtr, reinterpret_cast<const xmlChar*>(OUStringToOString(data, RTL_TEXTENCODING_UTF8).getStr()));
...@@ -245,7 +245,7 @@ namespace DOM ...@@ -245,7 +245,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aStr; OUString aStr;
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
// get current data // get current data
std::shared_ptr<xmlChar const> const pContent( std::shared_ptr<xmlChar const> const pContent(
......
...@@ -44,13 +44,13 @@ namespace DOM ...@@ -44,13 +44,13 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
sal_Int32 length = 0; sal_Int32 length = 0;
if (m_pNode != NULL) if (m_pNode != nullptr)
{ {
xmlNodePtr cur = m_pNode->GetNodePtr(); xmlNodePtr cur = m_pNode->GetNodePtr();
if (0 != cur) { if (nullptr != cur) {
cur = cur->children; cur = cur->children;
} }
while (cur != NULL) while (cur != nullptr)
{ {
length++; length++;
cur = cur->next; cur = cur->next;
...@@ -67,13 +67,13 @@ namespace DOM ...@@ -67,13 +67,13 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (m_pNode != NULL) if (m_pNode != nullptr)
{ {
xmlNodePtr cur = m_pNode->GetNodePtr(); xmlNodePtr cur = m_pNode->GetNodePtr();
if (0 != cur) { if (nullptr != cur) {
cur = cur->children; cur = cur->children;
} }
while (cur != NULL) while (cur != nullptr)
{ {
if (index-- == 0) { if (index-- == 0) {
return Reference< XNode >( return Reference< XNode >(
...@@ -82,7 +82,7 @@ namespace DOM ...@@ -82,7 +82,7 @@ namespace DOM
cur = cur->next; cur = cur->next;
} }
} }
return 0; return nullptr;
} }
} }
......
...@@ -60,14 +60,14 @@ namespace DOM ...@@ -60,14 +60,14 @@ namespace DOM
{ {
// find the doc type // find the doc type
xmlNodePtr cur = i_pDocument->children; xmlNodePtr cur = i_pDocument->children;
while (cur != NULL) while (cur != nullptr)
{ {
if ((cur->type == XML_DOCUMENT_TYPE_NODE) || if ((cur->type == XML_DOCUMENT_TYPE_NODE) ||
(cur->type == XML_DTD_NODE)) { (cur->type == XML_DTD_NODE)) {
return cur; return cur;
} }
} }
return 0; return nullptr;
} }
/// get the pointer to the root element node of the document /// get the pointer to the root element node of the document
...@@ -75,7 +75,7 @@ namespace DOM ...@@ -75,7 +75,7 @@ namespace DOM
{ {
// find the document element // find the document element
xmlNodePtr cur = i_pDocument->children; xmlNodePtr cur = i_pDocument->children;
while (cur != NULL) while (cur != nullptr)
{ {
if (cur->type == XML_ELEMENT_NODE) if (cur->type == XML_ELEMENT_NODE)
break; break;
...@@ -162,8 +162,8 @@ namespace DOM ...@@ -162,8 +162,8 @@ namespace DOM
::rtl::Reference<CNode> ::rtl::Reference<CNode>
CDocument::GetCNode(xmlNodePtr const pNode, bool const bCreate) CDocument::GetCNode(xmlNodePtr const pNode, bool const bCreate)
{ {
if (0 == pNode) { if (nullptr == pNode) {
return 0; return nullptr;
} }
//check whether there is already an instance for this node //check whether there is already an instance for this node
nodemap_t::const_iterator const i = m_NodeMap.find(pNode); nodemap_t::const_iterator const i = m_NodeMap.find(pNode);
...@@ -178,7 +178,7 @@ namespace DOM ...@@ -178,7 +178,7 @@ namespace DOM
} }
} }
if (!bCreate) { return 0; } if (!bCreate) { return nullptr; }
// there is not yet an instance wrapping this node, // there is not yet an instance wrapping this node,
// create it and store it in the map // create it and store it in the map
...@@ -259,7 +259,7 @@ namespace DOM ...@@ -259,7 +259,7 @@ namespace DOM
break; break;
} }
if (pCNode != 0) { if (pCNode != nullptr) {
bool const bInserted = m_NodeMap.insert( bool const bInserted = m_NodeMap.insert(
nodemap_t::value_type(pNode, nodemap_t::value_type(pNode,
::std::make_pair(WeakReference<XNode>(pCNode.get()), ::std::make_pair(WeakReference<XNode>(pCNode.get()),
...@@ -268,7 +268,7 @@ namespace DOM ...@@ -268,7 +268,7 @@ namespace DOM
OSL_ASSERT(bInserted); OSL_ASSERT(bInserted);
if (!bInserted) { if (!bInserted) {
// if insertion failed, delete new instance and return null // if insertion failed, delete new instance and return null
return 0; return nullptr;
} }
} }
...@@ -286,9 +286,9 @@ namespace DOM ...@@ -286,9 +286,9 @@ namespace DOM
{ {
i_xHandler->startDocument(); i_xHandler->startDocument();
for (xmlNodePtr pChild = m_aNodePtr->children; for (xmlNodePtr pChild = m_aNodePtr->children;
pChild != 0; pChild = pChild->next) { pChild != nullptr; pChild = pChild->next) {
::rtl::Reference<CNode> const pNode = GetCNode(pChild); ::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); pNode->saxify(i_xHandler);
} }
i_xHandler->endDocument(); i_xHandler->endDocument();
...@@ -298,9 +298,9 @@ namespace DOM ...@@ -298,9 +298,9 @@ namespace DOM
{ {
rContext.mxDocHandler->startDocument(); rContext.mxDocHandler->startDocument();
for (xmlNodePtr pChild = m_aNodePtr->children; for (xmlNodePtr pChild = m_aNodePtr->children;
pChild != 0; pChild = pChild->next) { pChild != nullptr; pChild = pChild->next) {
::rtl::Reference<CNode> const pNode = GetCNode(pChild); ::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); pNode->fastSaxify(rContext);
} }
rContext.mxDocHandler->endDocument(); rContext.mxDocHandler->endDocument();
...@@ -314,10 +314,10 @@ namespace DOM ...@@ -314,10 +314,10 @@ namespace DOM
return true; return true;
case NodeType_ELEMENT_NODE: case NodeType_ELEMENT_NODE:
// there may be only one! // there may be only one!
return 0 == lcl_getDocumentRootPtr(m_aDocPtr); return nullptr == lcl_getDocumentRootPtr(m_aDocPtr);
case NodeType_DOCUMENT_TYPE_NODE: case NodeType_DOCUMENT_TYPE_NODE:
// there may be only one! // there may be only one!
return 0 == lcl_getDocumentType(m_aDocPtr); return nullptr == lcl_getDocumentType(m_aDocPtr);
default: default:
return false; return false;
} }
...@@ -397,8 +397,8 @@ namespace DOM ...@@ -397,8 +397,8 @@ namespace DOM
// setup libxml IO and write data to output stream // setup libxml IO and write data to output stream
IOContext ioctx = {m_rOutputStream, false}; IOContext ioctx = {m_rOutputStream, false};
xmlOutputBufferPtr pOut = xmlOutputBufferCreateIO( xmlOutputBufferPtr pOut = xmlOutputBufferCreateIO(
writeCallback, closeCallback, &ioctx, NULL); writeCallback, closeCallback, &ioctx, nullptr);
xmlSaveFileTo(pOut, m_aNodePtr->doc, NULL); xmlSaveFileTo(pOut, m_aNodePtr->doc, nullptr);
} }
// call listeners // call listeners
...@@ -439,7 +439,7 @@ namespace DOM ...@@ -439,7 +439,7 @@ namespace DOM
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8); OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr()); 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( ::rtl::Reference< CAttr > const pCAttr(
dynamic_cast< CAttr* >(GetCNode( dynamic_cast< CAttr* >(GetCNode(
reinterpret_cast<xmlNodePtr>(pAttr)).get())); reinterpret_cast<xmlNodePtr>(pAttr)).get()));
...@@ -472,7 +472,7 @@ namespace DOM ...@@ -472,7 +472,7 @@ namespace DOM
} }
oUri = OUStringToOString(ns, RTL_TEXTENCODING_UTF8); oUri = OUStringToOString(ns, RTL_TEXTENCODING_UTF8);
xmlAttrPtr const pAttr = xmlNewDocProp(m_aDocPtr, 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( ::rtl::Reference< CAttr > const pCAttr(
dynamic_cast< CAttr* >(GetCNode( dynamic_cast< CAttr* >(GetCNode(
reinterpret_cast<xmlNodePtr>(pAttr)).get())); reinterpret_cast<xmlNodePtr>(pAttr)).get()));
...@@ -538,7 +538,7 @@ namespace DOM ...@@ -538,7 +538,7 @@ namespace DOM
OString o1 = OUStringToOString(tagName, RTL_TEXTENCODING_UTF8); OString o1 = OUStringToOString(tagName, RTL_TEXTENCODING_UTF8);
xmlChar const *xName = reinterpret_cast<xmlChar const *>(o1.getStr()); 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( Reference< XElement > const xRet(
static_cast< XNode* >(GetCNode(pNode).get()), static_cast< XNode* >(GetCNode(pNode).get()),
UNO_QUERY_THROW); UNO_QUERY_THROW);
...@@ -573,7 +573,7 @@ namespace DOM ...@@ -573,7 +573,7 @@ namespace DOM
// xmlNsPtr aNsPtr = xmlNewReconciledNs? // xmlNsPtr aNsPtr = xmlNewReconciledNs?
// xmlNsPtr aNsPtr = xmlNewGlobalNs? // 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); xmlNsPtr const pNs = xmlNewNs(pNode, xUri, xPrefix);
xmlSetNs(pNode, pNs); xmlSetNs(pNode, pNs);
Reference< XElement > const xRet( Reference< XElement > const xRet(
...@@ -654,7 +654,7 @@ namespace DOM ...@@ -654,7 +654,7 @@ namespace DOM
::osl::MutexGuard const g(m_Mutex); ::osl::MutexGuard const g(m_Mutex);
xmlNodePtr const pNode = lcl_getDocumentRootPtr(m_aDocPtr); xmlNodePtr const pNode = lcl_getDocumentRootPtr(m_aDocPtr);
if (!pNode) { return 0; } if (!pNode) { return nullptr; }
Reference< XElement > const xRet( Reference< XElement > const xRet(
static_cast< XNode* >(GetCNode(pNode).get()), static_cast< XNode* >(GetCNode(pNode).get()),
UNO_QUERY); UNO_QUERY);
...@@ -664,13 +664,13 @@ namespace DOM ...@@ -664,13 +664,13 @@ namespace DOM
static xmlNodePtr static xmlNodePtr
lcl_search_element_by_id(const xmlNodePtr cur, const xmlChar* id) lcl_search_element_by_id(const xmlNodePtr cur, const xmlChar* id)
{ {
if (cur == NULL) if (cur == nullptr)
return NULL; return nullptr;
// look in current node // look in current node
if (cur->type == XML_ELEMENT_NODE) if (cur->type == XML_ELEMENT_NODE)
{ {
xmlAttrPtr a = cur->properties; xmlAttrPtr a = cur->properties;
while (a != NULL) while (a != nullptr)
{ {
if (a->atype == XML_ATTRIBUTE_ID) { if (a->atype == XML_ATTRIBUTE_ID) {
if (strcmp(reinterpret_cast<char*>(a->children->content), reinterpret_cast<char const *>(id)) == 0) if (strcmp(reinterpret_cast<char*>(a->children->content), reinterpret_cast<char const *>(id)) == 0)
...@@ -681,7 +681,7 @@ namespace DOM ...@@ -681,7 +681,7 @@ namespace DOM
} }
// look in children // look in children
xmlNodePtr result = lcl_search_element_by_id(cur->children, id); xmlNodePtr result = lcl_search_element_by_id(cur->children, id);
if (result != NULL) if (result != nullptr)
return result; return result;
result = lcl_search_element_by_id(cur->next, id); result = lcl_search_element_by_id(cur->next, id);
return result; return result;
...@@ -698,7 +698,7 @@ namespace DOM ...@@ -698,7 +698,7 @@ namespace DOM
OString o1 = OUStringToOString(elementId, RTL_TEXTENCODING_UTF8); OString o1 = OUStringToOString(elementId, RTL_TEXTENCODING_UTF8);
xmlChar const *xId = reinterpret_cast<xmlChar const *>(o1.getStr()); xmlChar const *xId = reinterpret_cast<xmlChar const *>(o1.getStr());
xmlNodePtr const pStart = lcl_getDocumentRootPtr(m_aDocPtr); 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); xmlNodePtr const pNode = lcl_search_element_by_id(pStart, xId);
Reference< XElement > const xRet( Reference< XElement > const xRet(
static_cast< XNode* >(GetCNode(pNode).get()), static_cast< XNode* >(GetCNode(pNode).get()),
...@@ -962,12 +962,12 @@ namespace DOM ...@@ -962,12 +962,12 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OSL_ASSERT(0 != m_aNodePtr); OSL_ASSERT(nullptr != m_aNodePtr);
if (0 == m_aNodePtr) { if (nullptr == m_aNodePtr) {
return 0; return nullptr;
} }
xmlDocPtr const pClone(xmlCopyDoc(m_aDocPtr, (bDeep) ? 1 : 0)); xmlDocPtr const pClone(xmlCopyDoc(m_aDocPtr, (bDeep) ? 1 : 0));
if (0 == pClone) { return 0; } if (nullptr == pClone) { return nullptr; }
Reference< XNode > const xRet( Reference< XNode > const xRet(
static_cast<CNode*>(CDocument::CreateCDocument(pClone).get())); static_cast<CNode*>(CDocument::CreateCDocument(pClone).get()));
return xRet; return xRet;
...@@ -976,7 +976,7 @@ namespace DOM ...@@ -976,7 +976,7 @@ namespace DOM
Reference< XEvent > SAL_CALL CDocument::createEvent(const OUString& aType) throw (RuntimeException, std::exception) Reference< XEvent > SAL_CALL CDocument::createEvent(const OUString& aType) throw (RuntimeException, std::exception)
{ {
// does not need mutex currently // does not need mutex currently
events::CEvent *pEvent = 0; events::CEvent *pEvent = nullptr;
if ( aType == "DOMSubtreeModified" || aType == "DOMNodeInserted" || aType == "DOMNodeRemoved" if ( aType == "DOMSubtreeModified" || aType == "DOMNodeInserted" || aType == "DOMNodeRemoved"
|| aType == "DOMNodeRemovedFromDocument" || aType == "DOMNodeInsertedIntoDocument" || aType == "DOMAttrModified" || aType == "DOMNodeRemovedFromDocument" || aType == "DOMNodeInsertedIntoDocument" || aType == "DOMAttrModified"
|| aType == "DOMCharacterDataModified") || aType == "DOMCharacterDataModified")
...@@ -1008,7 +1008,7 @@ namespace DOM ...@@ -1008,7 +1008,7 @@ namespace DOM
// add new namespaces to root node // add new namespaces to root node
xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr); xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr);
if (0 != pRoot) { if (nullptr != pRoot) {
const beans::StringPair * pSeq = i_rNamespaces.getConstArray(); const beans::StringPair * pSeq = i_rNamespaces.getConstArray();
for (const beans::StringPair *pNsDef = pSeq; for (const beans::StringPair *pNsDef = pSeq;
pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) { pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) {
...@@ -1037,7 +1037,7 @@ namespace DOM ...@@ -1037,7 +1037,7 @@ namespace DOM
// add new namespaces to root node // add new namespaces to root node
xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr); xmlNodePtr const pRoot = lcl_getDocumentRootPtr(m_aDocPtr);
if (0 != pRoot) { if (nullptr != pRoot) {
const beans::StringPair * pSeq = i_rNamespaces.getConstArray(); const beans::StringPair * pSeq = i_rNamespaces.getConstArray();
for (const beans::StringPair *pNsDef = pSeq; for (const beans::StringPair *pNsDef = pSeq;
pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) { pNsDef < pSeq + i_rNamespaces.getLength(); ++pNsDef) {
......
...@@ -106,7 +106,7 @@ namespace DOM ...@@ -106,7 +106,7 @@ namespace DOM
const char* CDocumentBuilder::aImplementationName = "com.sun.star.comp.xml.dom.DocumentBuilder"; const char* CDocumentBuilder::aImplementationName = "com.sun.star.comp.xml.dom.DocumentBuilder";
const char* CDocumentBuilder::aSupportedServiceNames[] = { const char* CDocumentBuilder::aSupportedServiceNames[] = {
"com.sun.star.xml.dom.DocumentBuilder", "com.sun.star.xml.dom.DocumentBuilder",
NULL nullptr
}; };
OUString CDocumentBuilder::_getImplementationName() OUString CDocumentBuilder::_getImplementationName()
...@@ -116,7 +116,7 @@ namespace DOM ...@@ -116,7 +116,7 @@ namespace DOM
Sequence<OUString> CDocumentBuilder::_getSupportedServiceNames() Sequence<OUString> CDocumentBuilder::_getSupportedServiceNames()
{ {
Sequence<OUString> aSequence; Sequence<OUString> aSequence;
for (int i=0; aSupportedServiceNames[i]!=NULL; i++) { for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) {
aSequence.realloc(i+1); aSequence.realloc(i+1);
aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i])); aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i]));
} }
...@@ -246,10 +246,10 @@ namespace DOM ...@@ -246,10 +246,10 @@ namespace DOM
CDocumentBuilder *builder = static_cast< CDocumentBuilder* >(ctxt->_private); CDocumentBuilder *builder = static_cast< CDocumentBuilder* >(ctxt->_private);
Reference< XEntityResolver > resolver = builder->getEntityResolver(); Reference< XEntityResolver > resolver = builder->getEntityResolver();
OUString sysid; OUString sysid;
if (systemId != 0) if (systemId != nullptr)
sysid = OUString(reinterpret_cast<char const *>(systemId), strlen(reinterpret_cast<char const *>(systemId)), RTL_TEXTENCODING_UTF8); sysid = OUString(reinterpret_cast<char const *>(systemId), strlen(reinterpret_cast<char const *>(systemId)), RTL_TEXTENCODING_UTF8);
OUString pubid; OUString pubid;
if (publicId != 0) if (publicId != nullptr)
pubid = OUString(reinterpret_cast<char const *>(publicId), strlen(reinterpret_cast<char const *>(publicId)), RTL_TEXTENCODING_UTF8); pubid = OUString(reinterpret_cast<char const *>(publicId), strlen(reinterpret_cast<char const *>(publicId)), RTL_TEXTENCODING_UTF8);
// resolve the entity // resolve the entity
...@@ -336,9 +336,9 @@ namespace DOM ...@@ -336,9 +336,9 @@ namespace DOM
c.close = false; c.close = false;
c.freeOnClose = false; c.freeOnClose = false;
xmlDocPtr const pDoc = xmlCtxtReadIO(pContext.get(), 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()); throwEx(pContext.get());
} }
Reference< XDocument > const xRet( Reference< XDocument > const xRet(
...@@ -360,8 +360,8 @@ namespace DOM ...@@ -360,8 +360,8 @@ namespace DOM
// xmlSetExternalEntityLoader(external_entity_loader); // xmlSetExternalEntityLoader(external_entity_loader);
OString oUri = OUStringToOString(sUri, RTL_TEXTENCODING_UTF8); OString oUri = OUStringToOString(sUri, RTL_TEXTENCODING_UTF8);
char *uri = const_cast<char*>(oUri.getStr()); char *uri = const_cast<char*>(oUri.getStr());
xmlDocPtr pDoc = xmlCtxtReadFile(pContext.get(), uri, 0, 0); xmlDocPtr pDoc = xmlCtxtReadFile(pContext.get(), uri, nullptr, 0);
if (pDoc == 0) { if (pDoc == nullptr) {
throwEx(pContext.get()); throwEx(pContext.get());
} }
Reference< XDocument > const xRet( Reference< XDocument > const xRet(
......
...@@ -50,7 +50,7 @@ namespace DOM ...@@ -50,7 +50,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
css::uno::Reference< XNamedNodeMap > aMap; css::uno::Reference< XNamedNodeMap > aMap;
if (m_aDtdPtr != NULL) if (m_aDtdPtr != nullptr)
{ {
aMap.set(new CEntitiesMap(this)); aMap.set(new CEntitiesMap(this));
} }
...@@ -76,7 +76,7 @@ namespace DOM ...@@ -76,7 +76,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aName; 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); 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 ...@@ -91,7 +91,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
css::uno::Reference< XNamedNodeMap > aMap; css::uno::Reference< XNamedNodeMap > aMap;
if (m_aDtdPtr != NULL) if (m_aDtdPtr != nullptr)
{ {
aMap.set(new CNotationsMap(this)); aMap.set(new CNotationsMap(this));
} }
...@@ -106,7 +106,7 @@ namespace DOM ...@@ -106,7 +106,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aId; 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); 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 ...@@ -121,7 +121,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aId; 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); aId = OUString(reinterpret_cast<char const *>(m_aDtdPtr->name), strlen(reinterpret_cast<char const *>(m_aDtdPtr->SystemID)), RTL_TEXTENCODING_UTF8);
} }
......
This diff is collapsed.
...@@ -87,7 +87,7 @@ namespace DOM ...@@ -87,7 +87,7 @@ namespace DOM
: m_pElement(pElement) : m_pElement(pElement)
, m_rMutex(rMutex) , m_rMutex(rMutex)
, m_pName(lcl_initXmlString(rName)) , m_pName(lcl_initXmlString(rName))
, m_pURI((pURI) ? lcl_initXmlString(*pURI) : 0) , m_pURI((pURI) ? lcl_initXmlString(*pURI) : nullptr)
, m_bRebuild(true) , m_bRebuild(true)
{ {
} }
...@@ -134,7 +134,7 @@ namespace DOM ...@@ -134,7 +134,7 @@ namespace DOM
} }
} }
while (pNode != NULL ) while (pNode != nullptr )
{ {
if (pNode->type == XML_ELEMENT_NODE && if (pNode->type == XML_ELEMENT_NODE &&
(strcmp(reinterpret_cast<char const *>(pNode->name), reinterpret_cast<char*>(m_pName.get())) == 0)) (strcmp(reinterpret_cast<char const *>(pNode->name), reinterpret_cast<char*>(m_pName.get())) == 0))
...@@ -142,14 +142,14 @@ namespace DOM ...@@ -142,14 +142,14 @@ namespace DOM
if (!m_pURI) { if (!m_pURI) {
m_nodevector.push_back(pNode); m_nodevector.push_back(pNode);
} else { } 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())))) strcmp(reinterpret_cast<char const *>(pNode->ns->href), reinterpret_cast<char*>(m_pURI.get()))))
{ {
m_nodevector.push_back(pNode); 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; if (!start) pNode = pNode->next;
else break; // fold back else break; // fold back
...@@ -179,7 +179,7 @@ namespace DOM ...@@ -179,7 +179,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (!m_pElement.is()) { return 0; } if (!m_pElement.is()) { return nullptr; }
buildlist(m_pElement->GetNodePtr()); buildlist(m_pElement->GetNodePtr());
if (m_nodevector.size() <= static_cast<size_t>(index)) { if (m_nodevector.size() <= static_cast<size_t>(index)) {
......
...@@ -66,7 +66,7 @@ namespace DOM ...@@ -66,7 +66,7 @@ namespace DOM
public: public:
CElementListImpl(::rtl::Reference<CElement> const& pElement, CElementListImpl(::rtl::Reference<CElement> const& pElement,
::osl::Mutex & rMutex, ::osl::Mutex & rMutex,
OUString const& rName, OUString const*const pURI = 0); OUString const& rName, OUString const*const pURI = nullptr);
void registerListener(CElement & rElement); void registerListener(CElement & rElement);
...@@ -96,7 +96,7 @@ namespace DOM ...@@ -96,7 +96,7 @@ namespace DOM
public: public:
CElementList(::rtl::Reference<CElement> const& pElement, CElementList(::rtl::Reference<CElement> const& pElement,
::osl::Mutex & rMutex, ::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. The number of nodes in the list.
......
...@@ -70,7 +70,7 @@ namespace DOM ...@@ -70,7 +70,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aID; 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); 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 ...@@ -85,7 +85,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aID; 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); 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 ...@@ -96,7 +96,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aName; OUString aName;
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
const xmlChar* xName = m_aNodePtr->name; const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8); aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
......
...@@ -54,7 +54,7 @@ namespace DOM ...@@ -54,7 +54,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aName; OUString aName;
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
const xmlChar* xName = m_aNodePtr->name; const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8); aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
......
This diff is collapsed.
...@@ -59,7 +59,7 @@ namespace DOM ...@@ -59,7 +59,7 @@ namespace DOM
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
OUString aName; OUString aName;
if (m_aNodePtr != NULL) if (m_aNodePtr != nullptr)
{ {
const xmlChar* xName = m_aNodePtr->name; const xmlChar* xName = m_aNodePtr->name;
aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8); aName = OUString(reinterpret_cast<char const *>(xName), strlen(reinterpret_cast<char const *>(xName)), RTL_TEXTENCODING_UTF8);
......
...@@ -54,13 +54,13 @@ namespace DOM ...@@ -54,13 +54,13 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (0 == m_aNodePtr) { if (nullptr == m_aNodePtr) {
return OUString(); return OUString();
} }
char const*const pContent( char const*const pContent(
reinterpret_cast<char const*>(m_aNodePtr->content)); reinterpret_cast<char const*>(m_aNodePtr->content));
if (0 == pContent) { if (nullptr == pContent) {
return OUString(); return OUString();
} }
OUString const ret(pContent, strlen(pContent), RTL_TEXTENCODING_UTF8); OUString const ret(pContent, strlen(pContent), RTL_TEXTENCODING_UTF8);
...@@ -75,13 +75,13 @@ namespace DOM ...@@ -75,13 +75,13 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (0 == m_aNodePtr) { if (nullptr == m_aNodePtr) {
return OUString(); return OUString();
} }
char const*const pName( char const*const pName(
reinterpret_cast<char const*>(m_aNodePtr->name)); reinterpret_cast<char const*>(m_aNodePtr->name));
if (0 == pName) { if (nullptr == pName) {
return OUString(); return OUString();
} }
OUString const ret(pName, strlen(pName), RTL_TEXTENCODING_UTF8); OUString const ret(pName, strlen(pName), RTL_TEXTENCODING_UTF8);
...@@ -96,7 +96,7 @@ namespace DOM ...@@ -96,7 +96,7 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (0 == m_aNodePtr) { if (nullptr == m_aNodePtr) {
throw RuntimeException(); throw RuntimeException();
} }
...@@ -113,7 +113,7 @@ namespace DOM ...@@ -113,7 +113,7 @@ namespace DOM
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (0 == m_aNodePtr) { if (nullptr == m_aNodePtr) {
return OUString(); return OUString();
} }
......
...@@ -41,7 +41,7 @@ namespace DOM ...@@ -41,7 +41,7 @@ namespace DOM
const char* CSAXDocumentBuilder::aImplementationName = "com.sun.star.comp.xml.dom.SAXDocumentBuilder"; const char* CSAXDocumentBuilder::aImplementationName = "com.sun.star.comp.xml.dom.SAXDocumentBuilder";
const char* CSAXDocumentBuilder::aSupportedServiceNames[] = { const char* CSAXDocumentBuilder::aSupportedServiceNames[] = {
"com.sun.star.xml.dom.SAXDocumentBuilder", "com.sun.star.xml.dom.SAXDocumentBuilder",
NULL nullptr
}; };
CSAXDocumentBuilder::CSAXDocumentBuilder(const Reference< XMultiServiceFactory >& mgr) CSAXDocumentBuilder::CSAXDocumentBuilder(const Reference< XMultiServiceFactory >& mgr)
...@@ -56,7 +56,7 @@ namespace DOM ...@@ -56,7 +56,7 @@ namespace DOM
Sequence<OUString> CSAXDocumentBuilder::_getSupportedServiceNames() Sequence<OUString> CSAXDocumentBuilder::_getSupportedServiceNames()
{ {
Sequence<OUString> aSequence; Sequence<OUString> aSequence;
for (int i=0; aSupportedServiceNames[i]!=NULL; i++) { for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) {
aSequence.realloc(i+1); aSequence.realloc(i+1);
aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i])); aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i]));
} }
......
...@@ -40,7 +40,7 @@ namespace DOM { namespace events { ...@@ -40,7 +40,7 @@ namespace DOM { namespace events {
? (& m_CaptureListeners) : (& m_TargetListeners); ? (& m_CaptureListeners) : (& m_TargetListeners);
// get the multimap for the specified type // get the multimap for the specified type
ListenerMap *pMap = 0; ListenerMap *pMap = nullptr;
TypeListenerMap::const_iterator tIter = pTMap->find(aType); TypeListenerMap::const_iterator tIter = pTMap->find(aType);
if (tIter == pTMap->end()) { if (tIter == pTMap->end()) {
// the map has to be created // the map has to be created
...@@ -49,7 +49,7 @@ namespace DOM { namespace events { ...@@ -49,7 +49,7 @@ namespace DOM { namespace events {
} else { } else {
pMap = tIter->second; pMap = tIter->second;
} }
if (pMap !=0) if (pMap !=nullptr)
pMap->insert(ListenerMap::value_type(pNode, aListener)); pMap->insert(ListenerMap::value_type(pNode, aListener));
} }
...@@ -113,7 +113,7 @@ namespace DOM { namespace events { ...@@ -113,7 +113,7 @@ namespace DOM { namespace events {
xmlNodePtr const pNode, Reference<XNode> const& xNode, xmlNodePtr const pNode, Reference<XNode> const& xNode,
Reference< XEvent > const& i_xEvent) const Reference< XEvent > const& i_xEvent) const
{ {
CEvent *pEvent = 0; // pointer to internal event representation CEvent *pEvent = nullptr; // pointer to internal event representation
OUString const aType = i_xEvent->getType(); OUString const aType = i_xEvent->getType();
if (aType == "DOMSubtreeModified" || if (aType == "DOMSubtreeModified" ||
...@@ -192,7 +192,7 @@ namespace DOM { namespace events { ...@@ -192,7 +192,7 @@ namespace DOM { namespace events {
::osl::MutexGuard g(rMutex); ::osl::MutexGuard g(rMutex);
xmlNodePtr cur = pNode; xmlNodePtr cur = pNode;
while (cur != NULL) while (cur != nullptr)
{ {
Reference< XEventTarget > const xRef( Reference< XEventTarget > const xRef(
rDocument.GetCNode(cur).get()); rDocument.GetCNode(cur).get());
......
...@@ -100,8 +100,8 @@ const char s_nsODF [] = ...@@ -100,8 +100,8 @@ const char s_nsODF [] =
void SAL_CALL CURI::initFromConstant(const sal_Int16 i_Constant) void SAL_CALL CURI::initFromConstant(const sal_Int16 i_Constant)
{ {
const char *ns(0); const char *ns(nullptr);
const char *ln(0); const char *ln(nullptr);
switch (i_Constant) switch (i_Constant)
{ {
case css::rdf::URIs::XSD_NCNAME: case css::rdf::URIs::XSD_NCNAME:
......
...@@ -34,20 +34,20 @@ static ::cppu::ImplementationEntry const entries[] = { ...@@ -34,20 +34,20 @@ static ::cppu::ImplementationEntry const entries[] = {
{ &comp_CBlankNode::_create, { &comp_CBlankNode::_create,
&comp_CBlankNode::_getImplementationName, &comp_CBlankNode::_getImplementationName,
&comp_CBlankNode::_getSupportedServiceNames, &comp_CBlankNode::_getSupportedServiceNames,
&::cppu::createSingleComponentFactory, 0, 0 }, &::cppu::createSingleComponentFactory, nullptr, 0 },
{ &comp_CURI::_create, { &comp_CURI::_create,
&comp_CURI::_getImplementationName, &comp_CURI::_getImplementationName,
&comp_CURI::_getSupportedServiceNames, &comp_CURI::_getSupportedServiceNames,
&::cppu::createSingleComponentFactory, 0, 0 }, &::cppu::createSingleComponentFactory, nullptr, 0 },
{ &comp_CLiteral::_create, { &comp_CLiteral::_create,
&comp_CLiteral::_getImplementationName, &comp_CLiteral::_getImplementationName,
&comp_CLiteral::_getSupportedServiceNames, &comp_CLiteral::_getSupportedServiceNames,
&::cppu::createSingleComponentFactory, 0, 0 }, &::cppu::createSingleComponentFactory, nullptr, 0 },
{ &comp_librdf_Repository::_create, { &comp_librdf_Repository::_create,
&comp_librdf_Repository::_getImplementationName, &comp_librdf_Repository::_getImplementationName,
&comp_librdf_Repository::_getSupportedServiceNames, &comp_librdf_Repository::_getSupportedServiceNames,
&::cppu::createSingleComponentFactory, 0, 0 }, &::cppu::createSingleComponentFactory, nullptr, 0 },
{ 0, 0, 0, 0, 0, 0 } { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
}; };
SAL_DLLPUBLIC_EXPORT void * SAL_CALL unordf_component_getFactory( SAL_DLLPUBLIC_EXPORT void * SAL_CALL unordf_component_getFactory(
......
...@@ -44,7 +44,7 @@ extern "C" ...@@ -44,7 +44,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT void* SAL_CALL unoxml_component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/) SAL_DLLPUBLIC_EXPORT void* SAL_CALL unoxml_component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void * /*pRegistryKey*/)
{ {
void* pReturn = NULL ; void* pReturn = nullptr ;
if ( pImplementationName && pServiceManager ) if ( pImplementationName && pServiceManager )
{ {
// Define variables which are used in following macros. // Define variables which are used in following macros.
......
...@@ -32,9 +32,9 @@ namespace XPath ...@@ -32,9 +32,9 @@ namespace XPath
std::shared_ptr<xmlXPathObject> const& rxpathObj) std::shared_ptr<xmlXPathObject> const& rxpathObj)
: m_pDocument(pDocument) : m_pDocument(pDocument)
, m_rMutex(rMutex) , m_rMutex(rMutex)
, m_pNodeSet(0) , m_pNodeSet(nullptr)
{ {
if (rxpathObj != 0 && rxpathObj->type == XPATH_NODESET) if (rxpathObj != nullptr && rxpathObj->type == XPATH_NODESET)
{ {
m_pNodeSet = rxpathObj->nodesetval; m_pNodeSet = rxpathObj->nodesetval;
m_pXPathObj = rxpathObj; m_pXPathObj = rxpathObj;
...@@ -49,7 +49,7 @@ namespace XPath ...@@ -49,7 +49,7 @@ namespace XPath
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
sal_Int32 value = 0; sal_Int32 value = 0;
if (m_pNodeSet != NULL) if (m_pNodeSet != nullptr)
value = xmlXPathNodeSetGetLength(m_pNodeSet); value = xmlXPathNodeSetGetLength(m_pNodeSet);
return value; return value;
} }
...@@ -62,8 +62,8 @@ namespace XPath ...@@ -62,8 +62,8 @@ namespace XPath
{ {
::osl::MutexGuard const g(m_rMutex); ::osl::MutexGuard const g(m_rMutex);
if (0 == m_pNodeSet) { if (nullptr == m_pNodeSet) {
return 0; return nullptr;
} }
xmlNodePtr const pNode = xmlXPathNodeSetItem(m_pNodeSet, index); xmlNodePtr const pNode = xmlXPathNodeSetItem(m_pNodeSet, index);
Reference< XNode > const xNode(m_pDocument->GetCNode(pNode).get()); Reference< XNode > const xNode(m_pDocument->GetCNode(pNode).get());
......
...@@ -60,7 +60,7 @@ namespace XPath ...@@ -60,7 +60,7 @@ namespace XPath
const char* CXPathAPI::aImplementationName = "com.sun.star.comp.xml.xpath.XPathAPI"; const char* CXPathAPI::aImplementationName = "com.sun.star.comp.xml.xpath.XPathAPI";
const char* CXPathAPI::aSupportedServiceNames[] = { const char* CXPathAPI::aSupportedServiceNames[] = {
"com.sun.star.xml.xpath.XPathAPI", "com.sun.star.xml.xpath.XPathAPI",
NULL nullptr
}; };
OUString CXPathAPI::_getImplementationName() OUString CXPathAPI::_getImplementationName()
...@@ -71,7 +71,7 @@ namespace XPath ...@@ -71,7 +71,7 @@ namespace XPath
Sequence<OUString> CXPathAPI::_getSupportedServiceNames() Sequence<OUString> CXPathAPI::_getSupportedServiceNames()
{ {
Sequence<OUString> aSequence; Sequence<OUString> aSequence;
for (int i=0; aSupportedServiceNames[i]!=NULL; i++) { for (int i=0; aSupportedServiceNames[i]!=nullptr; i++) {
aSequence.realloc(i+1); aSequence.realloc(i+1);
aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i])); aSequence[i]=(OUString::createFromAscii(aSupportedServiceNames[i]));
} }
...@@ -147,9 +147,9 @@ namespace XPath ...@@ -147,9 +147,9 @@ namespace XPath
::osl::MutexGuard const g(pCNode->GetOwnerDocument().GetMutex()); ::osl::MutexGuard const g(pCNode->GetOwnerDocument().GetMutex());
xmlNodePtr pNode = pCNode->GetNodePtr(); xmlNodePtr pNode = pCNode->GetNodePtr();
while (pNode != 0) { while (pNode != nullptr) {
xmlNsPtr curDef = pNode->nsDef; xmlNsPtr curDef = pNode->nsDef;
while (curDef != 0) { while (curDef != nullptr) {
const xmlChar* xHref = curDef->href; const xmlChar* xHref = curDef->href;
OUString aURI(reinterpret_cast<char const *>(xHref), strlen(reinterpret_cast<char const *>(xHref)), RTL_TEXTENCODING_UTF8); OUString aURI(reinterpret_cast<char const *>(xHref), strlen(reinterpret_cast<char const *>(xHref)), RTL_TEXTENCODING_UTF8);
const xmlChar* xPre = curDef->prefix; const xmlChar* xPre = curDef->prefix;
...@@ -358,13 +358,13 @@ namespace XPath ...@@ -358,13 +358,13 @@ namespace XPath
/* Create xpath evaluation context */ /* Create xpath evaluation context */
std::shared_ptr<xmlXPathContext> const xpathCtx( std::shared_ptr<xmlXPathContext> const xpathCtx(
xmlXPathNewContext(pDoc), xmlXPathFreeContext); xmlXPathNewContext(pDoc), xmlXPathFreeContext);
if (xpathCtx == 0) { throw XPathException(); } if (xpathCtx == nullptr) { throw XPathException(); }
// set context node // set context node
xpathCtx->node = pNode; xpathCtx->node = pNode;
// error handling // error handling
xpathCtx->error = structured_error_func; xpathCtx->error = structured_error_func;
xmlSetGenericErrorFunc(NULL, generic_error_func); xmlSetGenericErrorFunc(nullptr, generic_error_func);
// register namespaces and extension // register namespaces and extension
lcl_registerNamespaces(xpathCtx.get(), nsmap); lcl_registerNamespaces(xpathCtx.get(), nsmap);
...@@ -375,8 +375,8 @@ namespace XPath ...@@ -375,8 +375,8 @@ namespace XPath
xmlChar const *xStr = reinterpret_cast<xmlChar const *>(o1.getStr()); xmlChar const *xStr = reinterpret_cast<xmlChar const *>(o1.getStr());
std::shared_ptr<xmlXPathObject> const xpathObj( std::shared_ptr<xmlXPathObject> const xpathObj(
xmlXPathEval(xStr, xpathCtx.get()), xmlXPathFreeObject); xmlXPathEval(xStr, xpathCtx.get()), xmlXPathFreeObject);
xmlSetGenericErrorFunc(NULL, NULL); xmlSetGenericErrorFunc(nullptr, nullptr);
if (0 == xpathObj) { if (nullptr == xpathObj) {
// OSL_ENSURE(xpathCtx->lastError == NULL, xpathCtx->lastError->message); // OSL_ENSURE(xpathCtx->lastError == NULL, xpathCtx->lastError->message);
throw XPathException(); throw XPathException();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment