diff options
-rw-r--r-- | src/conv/raw/vsd2raw.cpp | 2 | ||||
-rw-r--r-- | src/conv/raw/vss2raw.cpp | 2 | ||||
-rw-r--r-- | src/conv/svg/vsd2xhtml.cpp | 2 | ||||
-rw-r--r-- | src/conv/svg/vss2xhtml.cpp | 2 | ||||
-rw-r--r-- | src/conv/text/vsd2text.cpp | 2 | ||||
-rw-r--r-- | src/conv/text/vss2text.cpp | 2 | ||||
-rw-r--r-- | src/lib/VDXParser.cpp | 6 | ||||
-rw-r--r-- | src/lib/VSD5Parser.cpp | 2 | ||||
-rw-r--r-- | src/lib/VSDContentCollector.cpp | 16 | ||||
-rw-r--r-- | src/lib/VSDContentCollector.h | 4 | ||||
-rw-r--r-- | src/lib/VSDFieldList.cpp | 2 | ||||
-rw-r--r-- | src/lib/VSDGeometryList.cpp | 2 | ||||
-rw-r--r-- | src/lib/VSDInternalStream.cpp | 4 | ||||
-rw-r--r-- | src/lib/VSDInternalStream.h | 6 | ||||
-rw-r--r-- | src/lib/VSDLayerList.cpp | 6 | ||||
-rw-r--r-- | src/lib/VSDMetaData.cpp | 2 | ||||
-rw-r--r-- | src/lib/VSDParser.cpp | 14 | ||||
-rw-r--r-- | src/lib/VSDParser.h | 2 | ||||
-rw-r--r-- | src/lib/VSDStencils.cpp | 32 | ||||
-rw-r--r-- | src/lib/VSDXMLHelper.cpp | 10 | ||||
-rw-r--r-- | src/lib/VSDXMLParserBase.cpp | 8 | ||||
-rw-r--r-- | src/lib/VSDXMetaData.cpp | 2 | ||||
-rw-r--r-- | src/lib/VSDXParser.cpp | 12 | ||||
-rw-r--r-- | src/lib/VSDXTheme.cpp | 2 | ||||
-rw-r--r-- | src/lib/VisioDocument.cpp | 2 | ||||
-rw-r--r-- | src/lib/libvisio_xml.h | 2 |
26 files changed, 74 insertions, 74 deletions
diff --git a/src/conv/raw/vsd2raw.cpp b/src/conv/raw/vsd2raw.cpp index b9ffde9..ce15260 100644 --- a/src/conv/raw/vsd2raw.cpp +++ b/src/conv/raw/vsd2raw.cpp @@ -54,7 +54,7 @@ int printVersion() int main(int argc, char *argv[]) { bool printIndentLevel = false; - char *file = 0; + char *file = nullptr; if (argc < 2) return printUsage(); diff --git a/src/conv/raw/vss2raw.cpp b/src/conv/raw/vss2raw.cpp index 4af8e3c..8f1b311 100644 --- a/src/conv/raw/vss2raw.cpp +++ b/src/conv/raw/vss2raw.cpp @@ -54,7 +54,7 @@ int printVersion() int main(int argc, char *argv[]) { bool printIndentLevel = false; - char *file = 0; + char *file = nullptr; if (argc < 2) return printUsage(); diff --git a/src/conv/svg/vsd2xhtml.cpp b/src/conv/svg/vsd2xhtml.cpp index cc91c85..7801eee 100644 --- a/src/conv/svg/vsd2xhtml.cpp +++ b/src/conv/svg/vsd2xhtml.cpp @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) if (argc < 2) return printUsage(); - char *file = 0; + char *file = nullptr; for (int i = 1; i < argc; i++) { diff --git a/src/conv/svg/vss2xhtml.cpp b/src/conv/svg/vss2xhtml.cpp index f466988..edfeea5 100644 --- a/src/conv/svg/vss2xhtml.cpp +++ b/src/conv/svg/vss2xhtml.cpp @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) if (argc < 2) return printUsage(); - char *file = 0; + char *file = nullptr; for (int i = 1; i < argc; i++) { diff --git a/src/conv/text/vsd2text.cpp b/src/conv/text/vsd2text.cpp index e5fe090..1d9d5fb 100644 --- a/src/conv/text/vsd2text.cpp +++ b/src/conv/text/vsd2text.cpp @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) if (argc < 2) return printUsage(); - char *file = 0; + char *file = nullptr; for (int i = 1; i < argc; i++) { diff --git a/src/conv/text/vss2text.cpp b/src/conv/text/vss2text.cpp index dd8148e..f1e80f9 100644 --- a/src/conv/text/vss2text.cpp +++ b/src/conv/text/vss2text.cpp @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) if (argc < 2) return printUsage(); - char *file = 0; + char *file = nullptr; for (int i = 1; i < argc; i++) { diff --git a/src/lib/VDXParser.cpp b/src/lib/VDXParser.cpp index 2a3304b..ef6f7c6 100644 --- a/src/lib/VDXParser.cpp +++ b/src/lib/VDXParser.cpp @@ -75,7 +75,7 @@ bool libvisio::VDXParser::processXmlDocument(librevenge::RVNGInputStream *input) return false; const std::shared_ptr<xmlTextReader> reader( - xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), + xmlReaderForStream(input, nullptr, nullptr, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), xmlFreeTextReader); if (!reader) return false; @@ -920,7 +920,7 @@ xmlChar *libvisio::VDXParser::readStringData(xmlTextReaderPtr reader) return stringValue; } } - return 0; + return nullptr; } int libvisio::VDXParser::getElementToken(xmlTextReaderPtr reader) @@ -1032,7 +1032,7 @@ void libvisio::VDXParser::readTabs(xmlTextReaderPtr reader) } while ((XML_TABS != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret && (!m_watcher || !m_watcher->isError())); } - m_currentTabSet = 0; + m_currentTabSet = nullptr; } void libvisio::VDXParser::readTab(xmlTextReaderPtr reader) diff --git a/src/lib/VSD5Parser.cpp b/src/lib/VSD5Parser.cpp index fd5b298..c3f80fd 100644 --- a/src/lib/VSD5Parser.cpp +++ b/src/lib/VSD5Parser.cpp @@ -373,7 +373,7 @@ void libvisio::VSD5Parser::readStyleSheet(librevenge::RVNGInputStream *input) void libvisio::VSD5Parser::readShape(librevenge::RVNGInputStream *input) { m_currentGeomListCount = 0; - m_currentGeometryList = 0; + m_currentGeometryList = nullptr; m_isShapeStarted = true; m_shapeList.clear(); if (m_header.id != MINUS_ONE) diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index b3a5ffc..8163ce8 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -129,24 +129,24 @@ libvisio::VSDContentCollector::VSDContentCollector( m_painter(painter), m_isPageStarted(false), m_pageWidth(0.0), m_pageHeight(0.0), m_shadowOffsetX(0.0), m_shadowOffsetY(0.0), m_scale(1.0), m_x(0.0), m_y(0.0), m_originalX(0.0), m_originalY(0.0), m_xform(), m_txtxform(), m_misc(), - m_currentFillGeometry(), m_currentLineGeometry(), m_groupXForms(groupXFormsSequence.empty() ? 0 : &groupXFormsSequence[0]), + m_currentFillGeometry(), m_currentLineGeometry(), m_groupXForms(groupXFormsSequence.empty() ? nullptr : &groupXFormsSequence[0]), m_currentForeignData(), m_currentOLEData(), m_currentForeignProps(), m_currentShapeId(0), m_foreignType((unsigned)-1), m_foreignFormat(0), m_foreignOffsetX(0.0), m_foreignOffsetY(0.0), m_foreignWidth(0.0), m_foreignHeight(0.0), m_noLine(false), m_noFill(false), m_noShow(false), m_fonts(), m_currentLevel(0), m_isShapeStarted(false), m_groupXFormsSequence(groupXFormsSequence), m_groupMembershipsSequence(groupMembershipsSequence), m_groupMemberships(m_groupMembershipsSequence.begin()), - m_currentPageNumber(0), m_shapeOutputDrawing(0), m_shapeOutputText(0), + m_currentPageNumber(0), m_shapeOutputDrawing(nullptr), m_shapeOutputText(nullptr), m_pageOutputDrawing(), m_pageOutputText(), m_documentPageShapeOrders(documentPageShapeOrders), m_pageShapeOrder(m_documentPageShapeOrders.begin()), m_isFirstGeometry(true), m_NURBSData(), m_polylineData(), m_currentText(), m_names(), m_stencilNames(), m_fields(), m_stencilFields(), m_fieldIndex(0), m_charFormats(), m_paraFormats(), m_lineStyle(), m_fillStyle(), m_textBlockStyle(), m_defaultCharStyle(), m_defaultParaStyle(), m_currentStyleSheet(0), m_styles(styles), - m_stencils(stencils), m_stencilShape(0), m_isStencilStarted(false), m_currentGeometryCount(0), + m_stencils(stencils), m_stencilShape(nullptr), m_isStencilStarted(false), m_currentGeometryCount(0), m_backgroundPageID(MINUS_ONE), m_currentPageID(0), m_currentPage(), m_pages(), m_layerList(), m_splineControlPoints(), m_splineKnotVector(), m_splineX(0.0), m_splineY(0.0), m_splineLastKnot(0.0), m_splineDegree(0), m_splineLevel(0), m_currentShapeLevel(0), - m_isBackgroundPage(false), m_currentLayerList(), m_currentLayerMem(), m_tabSets(), m_documentTheme(0) + m_isBackgroundPage(false), m_currentLayerList(), m_currentLayerMem(), m_tabSets(), m_documentTheme(nullptr) { } @@ -2205,7 +2205,7 @@ void libvisio::VSDContentCollector::collectNURBSTo(unsigned id, unsigned level, // Get stencil geometry so as to find stencil NURBS data ID std::map<unsigned, VSDGeometryList>::const_iterator cstiter = m_stencilShape->m_geometries.find(m_currentGeometryCount-1); - VSDGeometryListElement *element = 0; + VSDGeometryListElement *element = nullptr; if (cstiter == m_stencilShape->m_geometries.end()) { _handleLevelChange(level); @@ -2285,7 +2285,7 @@ void libvisio::VSDContentCollector::collectPolylineTo(unsigned id, unsigned leve // Get stencil geometry so as to find stencil polyline data ID std::map<unsigned, VSDGeometryList>::const_iterator cstiter = m_stencilShape->m_geometries.find(m_currentGeometryCount-1); - VSDGeometryListElement *element = 0; + VSDGeometryListElement *element = nullptr; if (cstiter == m_stencilShape->m_geometries.end()) { _handleLevelChange(level); @@ -3511,7 +3511,7 @@ void libvisio::VSDContentCollector::startPage(unsigned pageId) m_y = 0; m_currentPageNumber++; if (m_groupXFormsSequence.size() >= m_currentPageNumber) - m_groupXForms = m_groupXFormsSequence.size() > m_currentPageNumber-1 ? &m_groupXFormsSequence[m_currentPageNumber-1] : 0; + m_groupXForms = m_groupXFormsSequence.size() > m_currentPageNumber-1 ? &m_groupXFormsSequence[m_currentPageNumber-1] : nullptr; if (m_groupMembershipsSequence.size() >= m_currentPageNumber) m_groupMemberships = m_groupMembershipsSequence.begin() + (m_currentPageNumber-1); if (m_documentPageShapeOrders.size() >= m_currentPageNumber) @@ -3631,7 +3631,7 @@ void libvisio::VSDContentCollector::appendCharacters(librevenge::RVNGString &tex else { UErrorCode status = U_ZERO_ERROR; - UConverter *conv = NULL; + UConverter *conv = nullptr; switch (format) { case VSD_TEXT_JAPANESE: diff --git a/src/lib/VSDContentCollector.h b/src/lib/VSDContentCollector.h index 3d24f1d..1252afe 100644 --- a/src/lib/VSDContentCollector.h +++ b/src/lib/VSDContentCollector.h @@ -184,8 +184,8 @@ private: void applyXForm(double &x, double &y, const XForm &xform); - void transformPoint(double &x, double &y, XForm *txtxform = 0); - void transformAngle(double &angle, XForm *txtxform = 0); + void transformPoint(double &x, double &y, XForm *txtxform = nullptr); + void transformAngle(double &angle, XForm *txtxform = nullptr); void transformFlips(bool &flipX, bool &flipY); double _NURBSBasis(unsigned knot, unsigned degree, double point, const std::vector<double> &knotVector); diff --git a/src/lib/VSDFieldList.cpp b/src/lib/VSDFieldList.cpp index 2f470a5..bf11537 100644 --- a/src/lib/VSDFieldList.cpp +++ b/src/lib/VSDFieldList.cpp @@ -266,6 +266,6 @@ libvisio::VSDFieldListElement *libvisio::VSDFieldList::getElement(unsigned index if (iter != m_elements.end()) return iter->second; else - return 0; + return nullptr; } /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/VSDGeometryList.cpp b/src/lib/VSDGeometryList.cpp index 25f3d9d..764273e 100644 --- a/src/lib/VSDGeometryList.cpp +++ b/src/lib/VSDGeometryList.cpp @@ -971,7 +971,7 @@ libvisio::VSDGeometryListElement *libvisio::VSDGeometryList::getElement(unsigned if (iter != m_elements.end()) return iter->second; else - return 0; + return nullptr; } void libvisio::VSDGeometryList::clearElement(unsigned id) diff --git a/src/lib/VSDInternalStream.cpp b/src/lib/VSDInternalStream.cpp index 1873eac..0fdcba3 100644 --- a/src/lib/VSDInternalStream.cpp +++ b/src/lib/VSDInternalStream.cpp @@ -80,7 +80,7 @@ const unsigned char *VSDInternalStream::read(unsigned long numBytes, unsigned lo numBytesRead = 0; if (numBytes == 0) - return 0; + return nullptr; int numBytesToRead; @@ -92,7 +92,7 @@ const unsigned char *VSDInternalStream::read(unsigned long numBytes, unsigned lo numBytesRead = numBytesToRead; // about as paranoid as we can be.. if (numBytesToRead == 0) - return 0; + return nullptr; long oldOffset = m_offset; m_offset += numBytesToRead; diff --git a/src/lib/VSDInternalStream.h b/src/lib/VSDInternalStream.h index 773315b..16b1e6e 100644 --- a/src/lib/VSDInternalStream.h +++ b/src/lib/VSDInternalStream.h @@ -31,7 +31,7 @@ public: } const char *subStreamName(unsigned) override { - return 0; + return nullptr; } bool existsSubStream(const char *) override { @@ -39,11 +39,11 @@ public: } librevenge::RVNGInputStream *getSubStreamByName(const char *) override { - return 0; + return nullptr; } librevenge::RVNGInputStream *getSubStreamById(unsigned) override { - return 0; + return nullptr; } const unsigned char *read(unsigned long numBytes, unsigned long &numBytesRead) override; int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override; diff --git a/src/lib/VSDLayerList.cpp b/src/lib/VSDLayerList.cpp index d858e4e..2ab7f8a 100644 --- a/src/lib/VSDLayerList.cpp +++ b/src/lib/VSDLayerList.cpp @@ -75,16 +75,16 @@ const libvisio::Colour *libvisio::VSDLayerList::getColour(const std::vector<unsi std::map<unsigned, libvisio::VSDLayer>::const_iterator iterMap = m_elements.find(*iter); // It is enough that one layer does not override colour and the original colour is used if (iterMap == m_elements.end() || !iterMap->second.m_colour) - return 0; + return nullptr; // This means we are reading the first layer and it overrides colour else if (iterColour == m_elements.end()) iterColour = iterMap; // If two layers override colour to two different values, the original colour is used else if (!iterColour->second.m_colour || iterColour->second.m_colour.get() != iterMap->second.m_colour.get()) - return 0; + return nullptr; } if (iterColour == m_elements.end()) - return 0; + return nullptr; return iterColour->second.m_colour.get_ptr(); } diff --git a/src/lib/VSDMetaData.cpp b/src/lib/VSDMetaData.cpp index 1b5bb88..358a6ef 100644 --- a/src/lib/VSDMetaData.cpp +++ b/src/lib/VSDMetaData.cpp @@ -259,7 +259,7 @@ librevenge::RVNGString libvisio::VSDMetaData::readCodePageString(librevenge::RVN else { UErrorCode status = U_ZERO_ERROR; - UConverter *conv = 0; + UConverter *conv = nullptr; switch (codepage) { diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp index aae8cb6..cc7484c 100644 --- a/src/lib/VSDParser.cpp +++ b/src/lib/VSDParser.cpp @@ -35,11 +35,11 @@ void sanitizeListLength(uint32_t &length, const std::size_t elem, librevenge::RV } libvisio::VSDParser::VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter, librevenge::RVNGInputStream *container) - : m_input(input), m_painter(painter), m_container(container), m_header(), m_collector(0), m_shapeList(), m_currentLevel(0), - m_stencils(), m_currentStencil(0), m_shape(), m_isStencilStarted(false), m_isInStyles(false), + : m_input(input), m_painter(painter), m_container(container), m_header(), m_collector(nullptr), m_shapeList(), m_currentLevel(0), + m_stencils(), m_currentStencil(nullptr), m_shape(), m_isStencilStarted(false), m_isInStyles(false), m_currentShapeLevel(0), m_currentShapeID(MINUS_ONE), m_currentLayerListLevel(0), m_extractStencils(false), m_colours(), m_isBackgroundPage(false), m_isShapeStarted(false), m_shadowOffsetX(0.0), m_shadowOffsetY(0.0), - m_currentGeometryList(0), m_currentGeomListCount(0), m_fonts(), m_names(), m_namesMapMap(), + m_currentGeometryList(nullptr), m_currentGeomListCount(0), m_fonts(), m_names(), m_namesMapMap(), m_currentPageName(), m_currentTabSet() {} @@ -414,7 +414,7 @@ void libvisio::VSDParser::handleStream(const Pointer &ptr, unsigned idx, unsigne else if (m_currentStencil) { m_stencils.addStencil(idx, *m_currentStencil); - m_currentStencil = 0; + m_currentStencil = nullptr; } break; case VSD_SHAPE_GROUP: @@ -731,7 +731,7 @@ void libvisio::VSDParser::_handleLevelChange(unsigned level) if (!m_shape.m_geometries.empty() && m_currentGeometryList && m_currentGeometryList->empty()) { m_shape.m_geometries.erase(--m_currentGeomListCount); - m_currentGeometryList = 0; + m_currentGeometryList = nullptr; } m_collector->collectShapesOrder(0, m_currentShapeLevel+2, m_shapeList.getShapesOrder()); m_shapeList.clear(); @@ -743,7 +743,7 @@ void libvisio::VSDParser::_handleLevelChange(unsigned level) { _flushShape(); m_shape.clear(); - m_currentGeometryList = 0; + m_currentGeometryList = nullptr; } m_isShapeStarted = false; m_currentShapeLevel = 0; @@ -1313,7 +1313,7 @@ void libvisio::VSDParser::readShape(librevenge::RVNGInputStream *input) } m_shape.clear(); - m_currentGeometryList = 0; + m_currentGeometryList = nullptr; const VSDShape *tmpShape = m_stencils.getStencilShape(masterPage, masterShape); if (tmpShape) { diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h index e275a97..be8515b 100644 --- a/src/lib/VSDParser.h +++ b/src/lib/VSDParser.h @@ -47,7 +47,7 @@ struct Pointer class VSDParser { public: - explicit VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter, librevenge::RVNGInputStream *container = 0); + explicit VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter, librevenge::RVNGInputStream *container = nullptr); virtual ~VSDParser(); bool parseMain(); bool extractStencils(); diff --git a/src/lib/VSDStencils.cpp b/src/lib/VSDStencils.cpp index 1808240..a9d5bbd 100644 --- a/src/lib/VSDStencils.cpp +++ b/src/lib/VSDStencils.cpp @@ -11,26 +11,26 @@ #include "libvisio_utils.h" libvisio::VSDShape::VSDShape() - : m_geometries(), m_shapeList(), m_fields(), m_foreign(0), m_parent(0), m_masterPage(MINUS_ONE), + : m_geometries(), m_shapeList(), m_fields(), m_foreign(nullptr), m_parent(0), m_masterPage(MINUS_ONE), m_masterShape(MINUS_ONE), m_shapeId(MINUS_ONE), m_lineStyleId(MINUS_ONE), m_fillStyleId(MINUS_ONE), m_textStyleId(MINUS_ONE), m_lineStyle(), m_fillStyle(), m_textBlockStyle(), m_charStyle(), m_charList(), m_paraStyle(), m_paraList(), m_tabSets(), m_text(), m_names(), - m_textFormat(libvisio::VSD_TEXT_UTF16), m_nurbsData(), m_polylineData(), m_xform(), m_txtxform(0), - m_xform1d(0), m_misc(), m_layerMem() + m_textFormat(libvisio::VSD_TEXT_UTF16), m_nurbsData(), m_polylineData(), m_xform(), m_txtxform(nullptr), + m_xform1d(nullptr), m_misc(), m_layerMem() { } libvisio::VSDShape::VSDShape(const libvisio::VSDShape &shape) : m_geometries(shape.m_geometries), m_shapeList(shape.m_shapeList), m_fields(shape.m_fields), - m_foreign(shape.m_foreign ? new ForeignData(*(shape.m_foreign)) : 0), m_parent(shape.m_parent), + m_foreign(shape.m_foreign ? new ForeignData(*(shape.m_foreign)) : nullptr), m_parent(shape.m_parent), m_masterPage(shape.m_masterPage), m_masterShape(shape.m_masterShape), m_shapeId(shape.m_shapeId), m_lineStyleId(shape.m_lineStyleId), m_fillStyleId(shape.m_fillStyleId), m_textStyleId(shape.m_textStyleId), m_lineStyle(shape.m_lineStyle), m_fillStyle(shape.m_fillStyle), m_textBlockStyle(shape.m_textBlockStyle), m_charStyle(shape.m_charStyle), m_charList(shape.m_charList), m_paraStyle(shape.m_paraStyle), m_paraList(shape.m_paraList), m_tabSets(shape.m_tabSets), m_text(shape.m_text), m_names(shape.m_names), m_textFormat(shape.m_textFormat), m_nurbsData(shape.m_nurbsData), m_polylineData(shape.m_polylineData), - m_xform(shape.m_xform), m_txtxform(shape.m_txtxform ? new XForm(*(shape.m_txtxform)) : 0), - m_xform1d(shape.m_xform1d ? new XForm1D(*(shape.m_xform1d)) : 0), m_misc(shape.m_misc), + m_xform(shape.m_xform), m_txtxform(shape.m_txtxform ? new XForm(*(shape.m_txtxform)) : nullptr), + m_xform1d(shape.m_xform1d ? new XForm1D(*(shape.m_xform1d)) : nullptr), m_misc(shape.m_misc), m_layerMem(shape.m_layerMem) { } @@ -49,7 +49,7 @@ libvisio::VSDShape &libvisio::VSDShape::operator=(const libvisio::VSDShape &shap m_fields = shape.m_fields; if (m_foreign) delete m_foreign; - m_foreign = shape.m_foreign ? new ForeignData(*(shape.m_foreign)) : 0; + m_foreign = shape.m_foreign ? new ForeignData(*(shape.m_foreign)) : nullptr; m_parent = shape.m_parent; m_masterPage = shape.m_masterPage; m_masterShape = shape.m_masterShape; @@ -73,10 +73,10 @@ libvisio::VSDShape &libvisio::VSDShape::operator=(const libvisio::VSDShape &shap m_xform = shape.m_xform; if (m_txtxform) delete m_txtxform; - m_txtxform = shape.m_txtxform ? new XForm(*(shape.m_txtxform)) : 0; + m_txtxform = shape.m_txtxform ? new XForm(*(shape.m_txtxform)) : nullptr; if (m_xform1d) delete m_xform1d; - m_xform1d = shape.m_xform1d ? new XForm1D(*(shape.m_xform1d)) : 0; + m_xform1d = shape.m_xform1d ? new XForm1D(*(shape.m_xform1d)) : nullptr; m_misc = shape.m_misc; m_layerMem = shape.m_layerMem; } @@ -87,13 +87,13 @@ void libvisio::VSDShape::clear() { if (m_foreign) delete m_foreign; - m_foreign = 0; + m_foreign = nullptr; if (m_txtxform) delete m_txtxform; - m_txtxform = 0; + m_txtxform = nullptr; if (m_xform1d) delete m_xform1d; - m_xform1d = 0; + m_xform1d = nullptr; m_geometries.clear(); m_shapeList.clear(); @@ -167,7 +167,7 @@ const libvisio::VSDShape *libvisio::VSDStencil::getStencilShape(unsigned id) con if (iter != m_shapes.end()) return &(iter->second); else - return 0; + return nullptr; } @@ -192,16 +192,16 @@ const libvisio::VSDStencil *libvisio::VSDStencils::getStencil(unsigned idx) cons if (iter != m_stencils.end()) return &(iter->second); else - return 0; + return nullptr; } const libvisio::VSDShape *libvisio::VSDStencils::getStencilShape(unsigned pageId, unsigned shapeId) const { if (MINUS_ONE == pageId) - return 0; + return nullptr; const libvisio::VSDStencil *tmpStencil = getStencil(pageId); if (!tmpStencil) - return 0; + return nullptr; if (MINUS_ONE == shapeId) shapeId = tmpStencil->m_firstShapeId; return tmpStencil->getStencilShape(shapeId); diff --git a/src/lib/VSDXMLHelper.cpp b/src/lib/VSDXMLHelper.cpp index bacc2c6..cddef07 100644 --- a/src/lib/VSDXMLHelper.cpp +++ b/src/lib/VSDXMLHelper.cpp @@ -95,7 +95,7 @@ libvisio::VSDXRelationships::VSDXRelationships(librevenge::RVNGInputStream *inpu if (input) { const std::shared_ptr<xmlTextReader> reader( - xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), + xmlReaderForStream(input, nullptr, nullptr, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), xmlFreeTextReader); if (reader) { @@ -151,21 +151,21 @@ void libvisio::VSDXRelationships::rebaseTargets(const char *baseDir) const libvisio::VSDXRelationship *libvisio::VSDXRelationships::getRelationshipByType(const char *type) const { if (!type) - return 0; + return nullptr; std::map<std::string, libvisio::VSDXRelationship>::const_iterator iter = m_relsByType.find(type); if (iter != m_relsByType.end()) return &(iter->second); - return 0; + return nullptr; } const libvisio::VSDXRelationship *libvisio::VSDXRelationships::getRelationshipById(const char *id) const { if (!id) - return 0; + return nullptr; std::map<std::string, libvisio::VSDXRelationship>::const_iterator iter = m_relsById.find(id); if (iter != m_relsById.end()) return &(iter->second); - return 0; + return nullptr; } /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ diff --git a/src/lib/VSDXMLParserBase.cpp b/src/lib/VSDXMLParserBase.cpp index 482a2ff..35f26e4 100644 --- a/src/lib/VSDXMLParserBase.cpp +++ b/src/lib/VSDXMLParserBase.cpp @@ -31,9 +31,9 @@ libvisio::VSDXMLParserBase::VSDXMLParserBase() m_extractStencils(false), m_isInStyles(false), m_currentLevel(0), m_currentShapeLevel(0), m_colours(), m_fieldList(), m_shapeList(), m_currentBinaryData(), m_shapeStack(), m_shapeLevelStack(), - m_isShapeStarted(false), m_isPageStarted(false), m_currentGeometryList(0), - m_currentGeometryListIndex(MINUS_ONE), m_fonts(), m_currentTabSet(0), - m_watcher(0) + m_isShapeStarted(false), m_isPageStarted(false), m_currentGeometryList(nullptr), + m_currentGeometryListIndex(MINUS_ONE), m_fonts(), m_currentTabSet(nullptr), + m_watcher(nullptr) { initColours(); } @@ -64,7 +64,7 @@ void libvisio::VSDXMLParserBase::readGeometry(xmlTextReaderPtr reader) { m_currentGeometryList->clear(); m_shape.m_geometries.erase(ix); - m_currentGeometryList = 0; + m_currentGeometryList = nullptr; } } return; diff --git a/src/lib/VSDXMetaData.cpp b/src/lib/VSDXMetaData.cpp index 003b37d..6d3826b 100644 --- a/src/lib/VSDXMetaData.cpp +++ b/src/lib/VSDXMetaData.cpp @@ -120,7 +120,7 @@ bool libvisio::VSDXMetaData::parse(librevenge::RVNGInputStream *input) XMLErrorWatcher watcher; const std::shared_ptr<xmlTextReader> reader( - xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET, &watcher), + xmlReaderForStream(input, nullptr, nullptr, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET, &watcher), xmlFreeTextReader); if (!reader) return false; diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp index 13fd050..2c1694f 100644 --- a/src/lib/VSDXParser.cpp +++ b/src/lib/VSDXParser.cpp @@ -52,7 +52,7 @@ libvisio::VSDXParser::VSDXParser(librevenge::RVNGInputStream *input, librevenge: m_input(input), m_painter(painter), m_currentDepth(0), - m_rels(0), + m_rels(nullptr), m_currentTheme() { } @@ -131,7 +131,7 @@ bool libvisio::VSDXParser::parseDocument(librevenge::RVNGInputStream *input, con if (!parseTheme(input, rel->getTarget().c_str())) { VSD_DEBUG_MSG(("Could not parse theme\n")); - m_collector->collectDocumentTheme(0); + m_collector->collectDocumentTheme(nullptr); } else m_collector->collectDocumentTheme(&m_currentTheme); @@ -304,7 +304,7 @@ void libvisio::VSDXParser::processXmlDocument(librevenge::RVNGInputStream *input XMLErrorWatcher watcher; const std::shared_ptr<xmlTextReader> reader( - xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET, &watcher), + xmlReaderForStream(input, nullptr, nullptr, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET, &watcher), xmlFreeTextReader); if (!reader) return; @@ -558,7 +558,7 @@ xmlChar *libvisio::VSDXParser::readStringData(xmlTextReaderPtr reader) VSD_DEBUG_MSG(("VSDXParser::readStringData stringValue %s\n", (const char *)stringValue)); return stringValue; } - return 0; + return nullptr; } int libvisio::VSDXParser::getElementToken(xmlTextReaderPtr reader) @@ -567,7 +567,7 @@ int libvisio::VSDXParser::getElementToken(xmlTextReaderPtr reader) if (XML_READER_TYPE_END_ELEMENT == xmlTextReaderNodeType(reader)) return tokenId; - xmlChar *stringValue = 0; + xmlChar *stringValue = nullptr; switch (tokenId) { @@ -1426,7 +1426,7 @@ void libvisio::VSDXParser::readTabRow(xmlTextReaderPtr reader) } while ((XML_ROW != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret && (!m_watcher || !m_watcher->isError())); } - m_currentTabSet = 0; + m_currentTabSet = nullptr; } void libvisio::VSDXParser::readCharacter(xmlTextReaderPtr reader) diff --git a/src/lib/VSDXTheme.cpp b/src/lib/VSDXTheme.cpp index ccfb2ac..da69059 100644 --- a/src/lib/VSDXTheme.cpp +++ b/src/lib/VSDXTheme.cpp @@ -84,7 +84,7 @@ bool libvisio::VSDXTheme::parse(librevenge::RVNGInputStream *input) return false; const shared_ptr<xmlTextReader> reader( - xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET), + xmlReaderForStream(input, nullptr, nullptr, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET), xmlFreeTextReader); if (!reader) return false; diff --git a/src/lib/VisioDocument.cpp b/src/lib/VisioDocument.cpp index 9d6fec8..50ebc72 100644 --- a/src/lib/VisioDocument.cpp +++ b/src/lib/VisioDocument.cpp @@ -163,7 +163,7 @@ static bool isXmlVisioDocument(librevenge::RVNGInputStream *input) try { input->seek(0, librevenge::RVNG_SEEK_SET); const std::shared_ptr<xmlTextReader> reader( - libvisio::xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), + libvisio::xmlReaderForStream(input, nullptr, nullptr, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET|XML_PARSE_RECOVER), xmlFreeTextReader); if (!reader) return false; diff --git a/src/lib/libvisio_xml.h b/src/lib/libvisio_xml.h index 5875a73..2739742 100644 --- a/src/lib/libvisio_xml.h +++ b/src/lib/libvisio_xml.h @@ -44,7 +44,7 @@ xmlTextReaderPtr xmlReaderForStream(librevenge::RVNGInputStream *input, const char *URL, const char *encoding, int options, - XMLErrorWatcher *watcher = 0); + XMLErrorWatcher *watcher = nullptr); Colour xmlStringToColour(const xmlChar *s); Colour xmlStringToColour(const std::shared_ptr<xmlChar> &s); |