Kaydet (Commit) 5d353ff6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: I31e61fc91dff70f32143d84ccf308f2bbc9c740e
üst 01b49802
......@@ -68,7 +68,7 @@ void test_init_impl(bool bAssertOnDialog, bool bNeedUCB,
// Make GraphicConverter work, normally done in desktop::Desktop::Main()
Application::SetFilterHdl(
LINK(0, test::BootstrapFixture, ImplInitFilterHdl));
LINK(nullptr, test::BootstrapFixture, ImplInitFilterHdl));
if (bNeedUCB)
{
......
......@@ -38,8 +38,8 @@ struct tolerance
}
tolerance()
: elementName(NULL)
, attribName(NULL)
: elementName(nullptr)
, attribName(nullptr)
, relative(false)
, value(0.0)
{
......@@ -156,8 +156,8 @@ void XMLDiff::loadToleranceFile(xmlDocPtr xmlToleranceFile)
return;
}
#endif
xmlNodePtr child = NULL;
for (child = root->children; child != NULL; child = child->next)
xmlNodePtr child = nullptr;
for (child = root->children; child != nullptr; child = child->next)
{
// assume a valid xml file
if(child->type != XML_ELEMENT_NODE)
......@@ -196,7 +196,7 @@ bool checkForEmptyChildren(xmlNodePtr node)
if(!node)
return true;
for(; node != NULL; node = node->next)
for(; node != nullptr; node = node->next)
{
if (node->type == XML_ELEMENT_NODE)
return false;
......@@ -225,9 +225,9 @@ bool XMLDiff::compareElements(xmlNode* node1, xmlNode* node2)
#endif
// compare children
xmlNode* child2 = NULL;
xmlNode* child1 = NULL;
for(child1 = node1->children, child2 = node2->children; child1 != NULL && child2 != NULL; child1 = child1->next, child2 = child2->next)
xmlNode* child2 = nullptr;
xmlNode* child1 = nullptr;
for(child1 = node1->children, child2 = node2->children; child1 != nullptr && child2 != nullptr; child1 = child1->next, child2 = child2->next)
{
if (child1->type == XML_ELEMENT_NODE)
{
......@@ -290,9 +290,9 @@ bool compareValuesWithTolerance(double val1, double val2, double tolerance, bool
bool XMLDiff::compareAttributes(xmlNodePtr node1, xmlNodePtr node2)
{
xmlAttrPtr attr1 = NULL;
xmlAttrPtr attr2 = NULL;
for(attr1 = node1->properties, attr2 = node2->properties; attr1 != NULL && attr2 != NULL; attr1 = attr1->next, attr2 = attr2->next)
xmlAttrPtr attr1 = nullptr;
xmlAttrPtr attr2 = nullptr;
for(attr1 = node1->properties, attr2 = node2->properties; attr1 != nullptr && attr2 != nullptr; attr1 = attr1->next, attr2 = attr2->next)
{
#if USE_CPPUNIT
cppunitAssertEqual(attr1->name, attr2->name);
......
......@@ -30,7 +30,7 @@ htmlDocPtr HtmlTestTools::parseHtmlStream(SvStream* pStream)
std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[nSize + 1]);
pStream->Read(pBuffer.get(), nSize);
pBuffer[nSize] = 0;
return htmlParseDoc(reinterpret_cast<xmlChar*>(pBuffer.get()), NULL);
return htmlParseDoc(reinterpret_cast<xmlChar*>(pBuffer.get()), nullptr);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -81,7 +81,7 @@ IMPL_STATIC_LINK_NOARG_TYPED(Protector, deinitHook, LinkParamNone*, void)
}
css::uno::Reference<css::lang::XComponent>(
context, css::uno::UNO_QUERY_THROW)->dispose();
comphelper::setProcessServiceFactory(0);
comphelper::setProcessServiceFactory(nullptr);
}
}
......
......@@ -139,7 +139,7 @@ void XmlTestTools::assertXPathNoAttribute(xmlDocPtr pXmlDoc, const OString& rXPa
1, xmlXPathNodeSetGetLength(pXmlNodes));
xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("In <" + OString(pXmlDoc->name) + ">, XPath '" + rXPath + "' unexpected '" + rAttribute + "' attribute").getStr(),
static_cast<xmlChar*>(0), xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr())));
static_cast<xmlChar*>(nullptr), xmlGetProp(pXmlNode, BAD_CAST(rAttribute.getStr())));
xmlXPathFreeObject(pXmlObj);
}
......
......@@ -41,7 +41,7 @@ int lclCloseCallback(void* pContext)
XmlWriter::XmlWriter(SvStream* pStream) :
mpStream(pStream),
mpWriter(NULL)
mpWriter(nullptr)
{}
XmlWriter::~XmlWriter()
......@@ -49,12 +49,12 @@ XmlWriter::~XmlWriter()
void XmlWriter::startDocument()
{
if (mpWriter == NULL && mpStream != NULL)
if (mpWriter == nullptr && mpStream != nullptr)
{
xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO(lclWriteCallback, lclCloseCallback, mpStream, NULL);
xmlOutputBufferPtr xmlOutBuffer = xmlOutputBufferCreateIO(lclWriteCallback, lclCloseCallback, mpStream, nullptr);
mpWriter = xmlNewTextWriter(xmlOutBuffer);
xmlTextWriterSetIndent(mpWriter, 1);
xmlTextWriterStartDocument(mpWriter, NULL, "UTF-8", NULL);
xmlTextWriterStartDocument(mpWriter, nullptr, "UTF-8", nullptr);
}
}
......@@ -62,7 +62,7 @@ void XmlWriter::endDocument()
{
xmlTextWriterEndDocument(mpWriter);
xmlFreeTextWriter(mpWriter);
mpWriter = NULL;
mpWriter = nullptr;
}
void XmlWriter::element(const OString& name)
......
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