astyle.options | 4 configure.ac | 34 +---- m4/ax_cxx_compile_stdcxx_11.m4 | 39 ------ src/lib/VDXParser.cpp | 70 ++++++------ src/lib/VSD5Parser.cpp | 4 src/lib/VSD6Parser.cpp | 2 src/lib/VSDCharacterList.cpp | 26 ++-- src/lib/VSDCharacterList.h | 12 +- src/lib/VSDCollector.h | 148 ++++++++++++------------- src/lib/VSDContentCollector.cpp | 140 ++++++++++++------------ src/lib/VSDContentCollector.h | 146 ++++++++++++------------- src/lib/VSDFieldList.cpp | 4 src/lib/VSDGeometryList.cpp | 226 +++++++++++++++++++-------------------- src/lib/VSDGeometryList.h | 68 +++++------ src/lib/VSDLayerList.cpp | 13 +- src/lib/VSDLayerList.h | 4 src/lib/VSDOutputElementList.cpp | 36 +++--- src/lib/VSDParagraphList.cpp | 34 ++--- src/lib/VSDParagraphList.h | 12 +- src/lib/VSDParser.cpp | 18 +-- src/lib/VSDStyles.h | 188 ++++++++++++++++---------------- src/lib/VSDStylesCollector.cpp | 156 +++++++++++++------------- src/lib/VSDStylesCollector.h | 146 ++++++++++++------------- src/lib/VSDTypes.h | 2 src/lib/VSDXMLParserBase.cpp | 218 ++++++++++++++++++------------------- src/lib/VSDXMLParserBase.h | 18 +-- src/lib/VSDXParser.cpp | 98 ++++++++-------- src/lib/VSDXTheme.cpp | 24 ++-- src/lib/VSDXTheme.h | 12 +- src/lib/libvisio_utils.h | 8 - src/test/Makefile.am | 6 - 31 files changed, 937 insertions(+), 979 deletions(-)
New commits: commit 0fbb9eb854b43101c0264cdab35fa41154030c3c Author: Fridrich Štrba <[email protected]> AuthorDate: Thu Sep 11 01:54:15 2025 +0200 Commit: Fridrich Štrba <[email protected]> CommitDate: Thu Sep 11 01:54:15 2025 +0200 boost/cstdint.hpp is not needed Change-Id: Ie48b911869e35320db7e3efa15669042f5cf0818 diff --git a/configure.ac b/configure.ac index 2b8fd32..52a247d 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,6 @@ AC_SUBST(ICU_LIBS) AC_CHECK_HEADERS( boost/algorithm/string.hpp \ - boost/cstdint.hpp \ boost/lexical_cast.hpp \ boost/phoenix.hpp \ boost/spirit/include/qi.hpp \ diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h index ebe5093..30581b0 100644 --- a/src/lib/libvisio_utils.h +++ b/src/lib/libvisio_utils.h @@ -16,8 +16,6 @@ #include <memory> -#include <boost/cstdint.hpp> - #include "VSDTypes.h" #define VSD_EPSILON 1E-6 commit 5c0008754c101daedf557e3c99c5ac2fdc9d0ad3 Author: Fridrich Štrba <[email protected]> AuthorDate: Thu Sep 11 01:49:25 2025 +0200 Commit: Fridrich Štrba <[email protected]> CommitDate: Thu Sep 11 01:49:25 2025 +0200 Fix distcheck errors Change-Id: Ifc61e65a7f421bae34be239469c6565e67cab42e diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 0052ab1..7729691 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -68,7 +68,11 @@ EXTRA_DIST = \ data/tdf76829-numeric-format.vsd \ data/tdf136564-WhiteTextBackground.vsdx \ data/tdf154379-DrawingUnits-type.vsd \ - data/tdf154379-QuickStyleFillMatrix.vsdx + data/tdf154379-QuickStyleFillMatrix.vsdx \ + data/Visio11PlanWithDimensions.vsd \ + data/Visio11TextFieldsWithAngle.vsd \ + data/Visio5PlanWithDimensions.vsd \ + data/Visio6PlanWithDimensions.vsd # ImportTest::testVsdMetadataTitleUtf8 checks formatted date string AM_TESTS_ENVIRONMENT = TZ=UTC; export TZ; commit 66f906ad55992e6dc91f7383497acf7838695237 Author: Fridrich Štrba <[email protected]> AuthorDate: Thu Sep 11 01:12:31 2025 +0200 Commit: Fridrich Štrba <[email protected]> CommitDate: Thu Sep 11 01:12:31 2025 +0200 boost::optional -> std::optional Change-Id: Ia8889e7fcd441f38ee25b0c7d96b9cf234281082 diff --git a/src/lib/VDXParser.cpp b/src/lib/VDXParser.cpp index e15e365..99aa28f 100644 --- a/src/lib/VDXParser.cpp +++ b/src/lib/VDXParser.cpp @@ -312,13 +312,13 @@ void libvisio::VDXParser::processXmlNode(xmlTextReaderPtr reader) void libvisio::VDXParser::readLine(xmlTextReaderPtr reader) { - boost::optional<double> strokeWidth; - boost::optional<Colour> colour; - boost::optional<unsigned char> linePattern; - boost::optional<unsigned char> startMarker; - boost::optional<unsigned char> endMarker; - boost::optional<unsigned char> lineCap; - boost::optional<double> rounding; + std::optional<double> strokeWidth; + std::optional<Colour> colour; + std::optional<unsigned char> linePattern; + std::optional<unsigned char> startMarker; + std::optional<unsigned char> endMarker; + std::optional<unsigned char> lineCap; + std::optional<double> rounding; auto level = (unsigned)getElementDepth(reader); int ret = 1; @@ -377,16 +377,16 @@ void libvisio::VDXParser::readLine(xmlTextReaderPtr reader) void libvisio::VDXParser::readFillAndShadow(xmlTextReaderPtr reader) { - boost::optional<Colour> fillColourFG; - boost::optional<double> fillFGTransparency; - boost::optional<Colour> fillColourBG; - boost::optional<double> fillBGTransparency; - boost::optional<unsigned char> fillPattern; - boost::optional<Colour> shadowColourFG; - boost::optional<Colour> shadowColourBG; - boost::optional<unsigned char> shadowPattern; - boost::optional<double> shadowOffsetX; - boost::optional<double> shadowOffsetY; + std::optional<Colour> fillColourFG; + std::optional<double> fillFGTransparency; + std::optional<Colour> fillColourBG; + std::optional<double> fillBGTransparency; + std::optional<unsigned char> fillPattern; + std::optional<Colour> shadowColourFG; + std::optional<Colour> shadowColourBG; + std::optional<unsigned char> shadowPattern; + std::optional<double> shadowOffsetX; + std::optional<double> shadowOffsetY; auto level = (unsigned)getElementDepth(reader); int ret = 1; @@ -487,7 +487,7 @@ void libvisio::VDXParser::readMisc(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); readTriggerId(m_shape.m_xform1d->beginId, reader); } break; @@ -495,7 +495,7 @@ void libvisio::VDXParser::readMisc(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); readTriggerId(m_shape.m_xform1d->endId, reader); } break; @@ -612,7 +612,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->pinX, reader); } break; @@ -620,7 +620,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->pinY, reader); } break; @@ -628,7 +628,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->width, reader); } break; @@ -636,7 +636,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->height, reader); } break; @@ -644,7 +644,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->pinLocX, reader); } break; @@ -652,7 +652,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->pinLocY, reader); } break; @@ -660,7 +660,7 @@ void libvisio::VDXParser::readTxtXForm(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_txtxform) - m_shape.m_txtxform = make_unique<XForm>(); + m_shape.m_txtxform = std::make_unique<XForm>(); ret = readDoubleData(m_shape.m_txtxform->angle, reader); } break; @@ -691,7 +691,7 @@ void libvisio::VDXParser::readXForm1D(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); ret = readDoubleData(m_shape.m_xform1d->beginX, reader); } break; @@ -699,7 +699,7 @@ void libvisio::VDXParser::readXForm1D(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); ret = readDoubleData(m_shape.m_xform1d->beginY, reader); } break; @@ -707,7 +707,7 @@ void libvisio::VDXParser::readXForm1D(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); ret = readDoubleData(m_shape.m_xform1d->endX, reader); } break; @@ -715,7 +715,7 @@ void libvisio::VDXParser::readXForm1D(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); ret = readDoubleData(m_shape.m_xform1d->endY, reader); } break; @@ -939,7 +939,7 @@ void libvisio::VDXParser::getBinaryData(xmlTextReaderPtr reader) if (data) { if (!m_shape.m_foreign) - m_shape.m_foreign = make_unique<ForeignData>(); + m_shape.m_foreign = std::make_unique<ForeignData>(); m_shape.m_foreign->data.clear(); m_shape.m_foreign->data.appendBase64Data(librevenge::RVNGString((const char *)data)); } @@ -966,7 +966,7 @@ void libvisio::VDXParser::readForeignInfo(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_foreign) - m_shape.m_foreign = make_unique<ForeignData>(); + m_shape.m_foreign = std::make_unique<ForeignData>(); ret = readDoubleData(m_shape.m_foreign->offsetX, reader); } break; @@ -974,7 +974,7 @@ void libvisio::VDXParser::readForeignInfo(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_foreign) - m_shape.m_foreign = make_unique<ForeignData>(); + m_shape.m_foreign = std::make_unique<ForeignData>(); ret = readDoubleData(m_shape.m_foreign->offsetY, reader); } break; @@ -982,7 +982,7 @@ void libvisio::VDXParser::readForeignInfo(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_foreign) - m_shape.m_foreign = make_unique<ForeignData>(); + m_shape.m_foreign = std::make_unique<ForeignData>(); ret = readDoubleData(m_shape.m_foreign->width, reader); } break; @@ -990,7 +990,7 @@ void libvisio::VDXParser::readForeignInfo(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) { if (!m_shape.m_foreign) - m_shape.m_foreign = make_unique<ForeignData>(); + m_shape.m_foreign = std::make_unique<ForeignData>(); ret = readDoubleData(m_shape.m_foreign->height, reader); } break; diff --git a/src/lib/VSD5Parser.cpp b/src/lib/VSD5Parser.cpp index e651d0d..e86a37b 100644 --- a/src/lib/VSD5Parser.cpp +++ b/src/lib/VSD5Parser.cpp @@ -407,7 +407,7 @@ void libvisio::VSD5Parser::readShape(librevenge::RVNGInputStream *input) if (tmpShape) { if (tmpShape->m_foreign) - m_shape.m_foreign = make_unique<ForeignData>(*(tmpShape->m_foreign)); + m_shape.m_foreign = std::make_unique<ForeignData>(*(tmpShape->m_foreign)); m_shape.m_text = tmpShape->m_text; m_shape.m_textFormat = tmpShape->m_textFormat; } @@ -499,7 +499,7 @@ void libvisio::VSD5Parser::readMisc(librevenge::RVNGInputStream *input) void libvisio::VSD5Parser::readXForm1D(librevenge::RVNGInputStream *input) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); input->seek(1, librevenge::RVNG_SEEK_CUR); m_shape.m_xform1d->beginX = readDouble(input); input->seek(1, librevenge::RVNG_SEEK_CUR); diff --git a/src/lib/VSD6Parser.cpp b/src/lib/VSD6Parser.cpp index 9f915d5..4c5de78 100644 --- a/src/lib/VSD6Parser.cpp +++ b/src/lib/VSD6Parser.cpp @@ -431,7 +431,7 @@ void libvisio::VSD6Parser::readMisc(librevenge::RVNGInputStream *input) if (0x40000073 == readU32(input)) { if (!m_shape.m_xform1d) - m_shape.m_xform1d = make_unique<XForm1D>(); + m_shape.m_xform1d = std::make_unique<XForm1D>(); if (m_shape.m_xform1d->beginId == MINUS_ONE) m_shape.m_xform1d->beginId = shapeId; else if (m_shape.m_xform1d->endId == MINUS_ONE) diff --git a/src/lib/VSDCharacterList.cpp b/src/lib/VSDCharacterList.cpp index b739f24..85560f1 100644 --- a/src/lib/VSDCharacterList.cpp +++ b/src/lib/VSDCharacterList.cpp @@ -30,12 +30,12 @@ public: class VSDCharIX : public VSDCharacterListElement { public: - VSDCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font, - const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, - const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, - const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, - const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) : VSDCharacterListElement(id, level), + VSDCharIX(unsigned id, unsigned level, unsigned charCount, const std::optional<VSDName> &font, + const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, + const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, + const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, + const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) : VSDCharacterListElement(id, level), m_style(charCount, font, fontColour, fontSize, bold, italic, underline, doubleunderline, strikeout, doublestrikeout, allcaps, initcaps, smallcaps, superscript, subscript, scaleWidth) {} VSDCharIX(unsigned id, unsigned level, const VSDOptionalCharStyle &style) : VSDCharacterListElement(id, level), m_style(style) {} @@ -105,17 +105,17 @@ libvisio::VSDCharacterList::~VSDCharacterList() } void libvisio::VSDCharacterList::addCharIX(unsigned id, unsigned level, unsigned charCount, - const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, - const boost::optional<bool> &bold, const boost::optional<bool> &italic, const boost::optional<bool> &underline, - const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, - const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, - const boost::optional<bool> &superscript, const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) + const std::optional<VSDName> &font, const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, + const std::optional<bool> &bold, const std::optional<bool> &italic, const std::optional<bool> &underline, + const std::optional<bool> &doubleunderline, const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, + const std::optional<bool> &allcaps, const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, + const std::optional<bool> &superscript, const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) { auto *tmpElement = dynamic_cast<VSDCharIX *>(m_elements[id].get()); if (!tmpElement) { - m_elements[id] = make_unique<VSDCharIX>(id, level, charCount, font, fontColour, fontSize, bold, italic, underline, doubleunderline, - strikeout, doublestrikeout, allcaps, initcaps, smallcaps, superscript, subscript, scaleWidth); + m_elements[id] = std::make_unique<VSDCharIX>(id, level, charCount, font, fontColour, fontSize, bold, italic, underline, doubleunderline, + strikeout, doublestrikeout, allcaps, initcaps, smallcaps, superscript, subscript, scaleWidth); } else tmpElement->m_style.override(VSDOptionalCharStyle(charCount, font, fontColour, fontSize, bold, italic, underline, diff --git a/src/lib/VSDCharacterList.h b/src/lib/VSDCharacterList.h index 555b9d6..cc9aa8b 100644 --- a/src/lib/VSDCharacterList.h +++ b/src/lib/VSDCharacterList.h @@ -29,12 +29,12 @@ public: VSDCharacterList(const VSDCharacterList &charList); ~VSDCharacterList(); VSDCharacterList &operator=(const VSDCharacterList &charList); - void addCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font, - const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, - const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, - const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, - const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth); + void addCharIX(unsigned id, unsigned level, unsigned charCount, const std::optional<VSDName> &font, + const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, + const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, + const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, + const std::optional<bool> &subscript, const std::optional<double> &scaleWidth); void addCharIX(unsigned id, unsigned level, const VSDOptionalCharStyle &style); unsigned getCharCount(unsigned id) const; void setCharCount(unsigned id, unsigned charCount); diff --git a/src/lib/VSDCollector.h b/src/lib/VSDCollector.h index 5d4b62f..a4673ee 100644 --- a/src/lib/VSDCollector.h +++ b/src/lib/VSDCollector.h @@ -11,7 +11,7 @@ #define VSDCOLLECTOR_H #include <vector> -#include <boost/optional.hpp> +#include <optional> #include "VSDParser.h" namespace libvisio @@ -29,19 +29,19 @@ public: virtual void collectOLEList(unsigned id, unsigned level) = 0; virtual void collectOLEData(unsigned id, unsigned level, const librevenge::RVNGBinaryData &oleData) = 0; virtual void collectEllipse(unsigned id, unsigned level, double cx, double cy, double xleft, double yleft, double xtop, double ytop) = 0; - virtual void collectLine(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern, - const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker, - const boost::optional<unsigned char> &lineCap, const boost::optional<double> &rounding, - const boost::optional<long> &qsLineColour, const boost::optional<long> &qsLineMatrix) = 0; - virtual void collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, const boost::optional<double> &shadowOffsetY, - const boost::optional<long> &qsFc, const boost::optional<long> &qsSc, const boost::optional<long> &qsLm) = 0; - virtual void collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc) = 0; + virtual void collectLine(unsigned level, const std::optional<double> &strokeWidth, const std::optional<Colour> &c, const std::optional<unsigned char> &linePattern, + const std::optional<unsigned char> &startMarker, const std::optional<unsigned char> &endMarker, + const std::optional<unsigned char> &lineCap, const std::optional<double> &rounding, + const std::optional<long> &qsLineColour, const std::optional<long> &qsLineMatrix) = 0; + virtual void collectFillAndShadow(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc, const std::optional<double> &shadowOffsetX, const std::optional<double> &shadowOffsetY, + const std::optional<long> &qsFc, const std::optional<long> &qsSc, const std::optional<long> &qsLm) = 0; + virtual void collectFillAndShadow(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc) = 0; virtual void collectGeometry(unsigned id, unsigned level, bool noFill, bool noLine, bool noShow) = 0; virtual void collectMoveTo(unsigned id, unsigned level, double x, double y) = 0; virtual void collectLineTo(unsigned id, unsigned level, double x, double y) = 0; @@ -76,35 +76,35 @@ public: virtual void collectUnhandledChunk(unsigned id, unsigned level) = 0; virtual void collectText(unsigned level, const librevenge::RVNGBinaryData &textStream, TextFormat format) = 0; - virtual void collectCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font, - const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, - const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, - const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, - const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) = 0; - virtual void collectDefaultCharStyle(unsigned charCount, const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour, - const boost::optional<double> &fontSize, const boost::optional<bool> &bold, const boost::optional<bool> &italic, - const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout, - const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps, - const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, const boost::optional<bool> &subscript, - const boost::optional<double> &scaleWidth) = 0; - virtual void collectParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst, - const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine, - const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) = 0; - virtual void collectDefaultParaStyle(unsigned charCount, const boost::optional<double> &indFirst, const boost::optional<double> &indLeft, - const boost::optional<double> &indRight, const boost::optional<double> &spLine, const boost::optional<double> &spBefore, - const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) = 0; - virtual void collectTextBlock(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin, - const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin, - const boost::optional<unsigned char> &verticalAlign, const boost::optional<bool> &isBgFilled, - const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop, - const boost::optional<unsigned char> &textDirection) = 0; + virtual void collectCharIX(unsigned id, unsigned level, unsigned charCount, const std::optional<VSDName> &font, + const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, + const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, + const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, + const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) = 0; + virtual void collectDefaultCharStyle(unsigned charCount, const std::optional<VSDName> &font, const std::optional<Colour> &fontColour, + const std::optional<double> &fontSize, const std::optional<bool> &bold, const std::optional<bool> &italic, + const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, const std::optional<bool> &strikeout, + const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, const std::optional<bool> &initcaps, + const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, const std::optional<bool> &subscript, + const std::optional<double> &scaleWidth) = 0; + virtual void collectParaIX(unsigned id, unsigned level, unsigned charCount, const std::optional<double> &indFirst, + const std::optional<double> &indLeft, const std::optional<double> &indRight, const std::optional<double> &spLine, + const std::optional<double> &spBefore, const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) = 0; + virtual void collectDefaultParaStyle(unsigned charCount, const std::optional<double> &indFirst, const std::optional<double> &indLeft, + const std::optional<double> &indRight, const std::optional<double> &spLine, const std::optional<double> &spBefore, + const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) = 0; + virtual void collectTextBlock(unsigned level, const std::optional<double> &leftMargin, const std::optional<double> &rightMargin, + const std::optional<double> &topMargin, const std::optional<double> &bottomMargin, + const std::optional<unsigned char> &verticalAlign, const std::optional<bool> &isBgFilled, + const std::optional<Colour> &bgColour, const std::optional<double> &defaultTabStop, + const std::optional<unsigned char> &textDirection) = 0; virtual void collectNameList(unsigned id, unsigned level) = 0; virtual void collectName(unsigned id, unsigned level, const librevenge::RVNGBinaryData &name, TextFormat format) = 0; virtual void collectPageSheet(unsigned id, unsigned level) = 0; @@ -115,37 +115,37 @@ public: // Style collectors virtual void collectStyleSheet(unsigned id, unsigned level,unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle) = 0; - virtual void collectLineStyle(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern, - const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker, - const boost::optional<unsigned char> &lineCap, const boost::optional<double> &rounding, - const boost::optional<long> &qsLineColour, const boost::optional<long> &qsLineMatrix) = 0; - virtual void collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, const boost::optional<double> &shadowOffsetY, - const boost::optional<long> &qsFillColour, const boost::optional<long> &qsShadowColour, - const boost::optional<long> &qsFillMatrix) = 0; - virtual void collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc) = 0; - virtual void collectCharIXStyle(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font, - const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, - const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, - const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, - const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) = 0; - virtual void collectParaIXStyle(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst, - const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine, - const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) = 0; - virtual void collectTextBlockStyle(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin, - const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin, - const boost::optional<unsigned char> &verticalAlign, const boost::optional<bool> &isBgFilled, - const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop, - const boost::optional<unsigned char> &textDirection) = 0; + virtual void collectLineStyle(unsigned level, const std::optional<double> &strokeWidth, const std::optional<Colour> &c, const std::optional<unsigned char> &linePattern, + const std::optional<unsigned char> &startMarker, const std::optional<unsigned char> &endMarker, + const std::optional<unsigned char> &lineCap, const std::optional<double> &rounding, + const std::optional<long> &qsLineColour, const std::optional<long> &qsLineMatrix) = 0; + virtual void collectFillStyle(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc, const std::optional<double> &shadowOffsetX, const std::optional<double> &shadowOffsetY, + const std::optional<long> &qsFillColour, const std::optional<long> &qsShadowColour, + const std::optional<long> &qsFillMatrix) = 0; + virtual void collectFillStyle(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc) = 0; + virtual void collectCharIXStyle(unsigned id, unsigned level, unsigned charCount, const std::optional<VSDName> &font, + const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, + const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, + const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, + const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) = 0; + virtual void collectParaIXStyle(unsigned id, unsigned level, unsigned charCount, const std::optional<double> &indFirst, + const std::optional<double> &indLeft, const std::optional<double> &indRight, const std::optional<double> &spLine, + const std::optional<double> &spBefore, const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) = 0; + virtual void collectTextBlockStyle(unsigned level, const std::optional<double> &leftMargin, const std::optional<double> &rightMargin, + const std::optional<double> &topMargin, const std::optional<double> &bottomMargin, + const std::optional<unsigned char> &verticalAlign, const std::optional<bool> &isBgFilled, + const std::optional<Colour> &bgColour, const std::optional<double> &defaultTabStop, + const std::optional<unsigned char> &textDirection) = 0; // Field list virtual void collectFieldList(unsigned id, unsigned level) = 0; diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index 90ae6df..482eae7 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -1677,29 +1677,29 @@ void libvisio::VSDContentCollector::collectRelQuadBezTo(unsigned /* id */, unsig m_currentLineGeometry.push_back(node); } -void libvisio::VSDContentCollector::collectLine(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern, - const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker, const boost::optional<unsigned char> &lineCap, - const boost::optional<double> &rounding, const boost::optional<long> &qsLineColour, const boost::optional<long> &qsLineMatrix) +void libvisio::VSDContentCollector::collectLine(unsigned level, const std::optional<double> &strokeWidth, const std::optional<Colour> &c, const std::optional<unsigned char> &linePattern, + const std::optional<unsigned char> &startMarker, const std::optional<unsigned char> &endMarker, const std::optional<unsigned char> &lineCap, + const std::optional<double> &rounding, const std::optional<long> &qsLineColour, const std::optional<long> &qsLineMatrix) { _handleLevelChange(level); m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding, qsLineColour, qsLineMatrix), m_documentTheme); } -void libvisio::VSDContentCollector::collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, const boost::optional<double> &fillBGTransparency, - const boost::optional<unsigned char> &shadowPattern, const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, - const boost::optional<double> &shadowOffsetY, const boost::optional<long> &qsFillColour, const boost::optional<long> &qsShadowColour, - const boost::optional<long> &qsFillMatrix) +void libvisio::VSDContentCollector::collectFillAndShadow(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, const std::optional<double> &fillBGTransparency, + const std::optional<unsigned char> &shadowPattern, const std::optional<Colour> &shfgc, const std::optional<double> &shadowOffsetX, + const std::optional<double> &shadowOffsetY, const std::optional<long> &qsFillColour, const std::optional<long> &qsShadowColour, + const std::optional<long> &qsFillMatrix) { _handleLevelChange(level); m_fillStyle.override(VSDOptionalFillStyle(colourFG, colourBG, fillPattern, fillFGTransparency, fillBGTransparency, shfgc, shadowPattern, shadowOffsetX, shadowOffsetY, qsFillColour, qsShadowColour, qsFillMatrix), m_documentTheme); } -void libvisio::VSDContentCollector::collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, - const boost::optional<unsigned char> &shadowPattern, const boost::optional<Colour> &shfgc) +void libvisio::VSDContentCollector::collectFillAndShadow(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, + const std::optional<unsigned char> &shadowPattern, const std::optional<Colour> &shfgc) { collectFillAndShadow(level, colourFG, colourBG, fillPattern, fillFGTransparency, fillBGTransparency, shadowPattern, shfgc, m_shadowOffsetX, m_shadowOffsetY, -1, -1, -1); } @@ -2765,12 +2765,12 @@ void libvisio::VSDContentCollector::collectText(unsigned level, const librevenge m_currentText = libvisio::VSDName(textStream, format); } -void libvisio::VSDContentCollector::collectParaIX(unsigned /* id */, unsigned level, unsigned charCount, const boost::optional<double> &indFirst, - const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine, - const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) +void libvisio::VSDContentCollector::collectParaIX(unsigned /* id */, unsigned level, unsigned charCount, const std::optional<double> &indFirst, + const std::optional<double> &indLeft, const std::optional<double> &indRight, const std::optional<double> &spLine, + const std::optional<double> &spBefore, const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) { _handleLevelChange(level); VSDParaStyle format(m_defaultParaStyle); @@ -2780,23 +2780,23 @@ void libvisio::VSDContentCollector::collectParaIX(unsigned /* id */, unsigned le m_paraFormats.push_back(format); } -void libvisio::VSDContentCollector::collectDefaultParaStyle(unsigned charCount, const boost::optional<double> &indFirst, - const boost::optional<double> &indLeft, const boost::optional<double> &indRight, - const boost::optional<double> &spLine, const boost::optional<double> &spBefore, - const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) +void libvisio::VSDContentCollector::collectDefaultParaStyle(unsigned charCount, const std::optional<double> &indFirst, + const std::optional<double> &indLeft, const std::optional<double> &indRight, + const std::optional<double> &spLine, const std::optional<double> &spBefore, + const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) { m_defaultParaStyle.override(VSDOptionalParaStyle(charCount, indFirst, indLeft, indRight, spLine, spBefore, spAfter, align, bullet, bulletStr, bulletFont, bulletFontSize, textPosAfterBullet, flags), m_documentTheme); } void libvisio::VSDContentCollector::collectCharIX(unsigned /* id */, unsigned level, unsigned charCount, - const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout, - const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, - const boost::optional<bool> &superscript, const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) + const std::optional<VSDName> &font, const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, const std::optional<bool> &strikeout, + const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, + const std::optional<bool> &superscript, const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) { _handleLevelChange(level); VSDCharStyle format(m_defaultCharStyle); @@ -2817,21 +2817,21 @@ void libvisio::VSDContentCollector::collectTabsDataList(unsigned level, const st } void libvisio::VSDContentCollector::collectDefaultCharStyle(unsigned charCount, - const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, - const boost::optional<bool> &bold, const boost::optional<bool> &italic, const boost::optional<bool> &underline, - const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout, - const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps, - const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, const boost::optional<bool> &subscript, - const boost::optional<double> &scaleWidth) + const std::optional<VSDName> &font, const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, + const std::optional<bool> &bold, const std::optional<bool> &italic, const std::optional<bool> &underline, + const std::optional<bool> &doubleunderline, const std::optional<bool> &strikeout, + const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, const std::optional<bool> &initcaps, + const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, const std::optional<bool> &subscript, + const std::optional<double> &scaleWidth) { m_defaultCharStyle.override(VSDOptionalCharStyle(charCount, font, fontColour, fontSize, bold, italic, underline, doubleunderline, strikeout, doublestrikeout, allcaps, initcaps, smallcaps, superscript, subscript, scaleWidth), m_documentTheme); } -void libvisio::VSDContentCollector::collectTextBlock(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin, - const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin, const boost::optional<unsigned char> &verticalAlign, - const boost::optional<bool> &isBgFilled, const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop, - const boost::optional<unsigned char> &textDirection) +void libvisio::VSDContentCollector::collectTextBlock(unsigned level, const std::optional<double> &leftMargin, const std::optional<double> &rightMargin, + const std::optional<double> &topMargin, const std::optional<double> &bottomMargin, const std::optional<unsigned char> &verticalAlign, + const std::optional<bool> &isBgFilled, const std::optional<Colour> &bgColour, const std::optional<double> &defaultTabStop, + const std::optional<unsigned char> &textDirection) { _handleLevelChange(level); m_textBlockStyle.override(VSDOptionalTextBlockStyle(leftMargin, rightMargin, topMargin, bottomMargin, verticalAlign, isBgFilled, bgColour, defaultTabStop, textDirection), m_documentTheme); @@ -2880,22 +2880,22 @@ void libvisio::VSDContentCollector::collectStyleSheet(unsigned id, unsigned leve m_styles.addTextStyleMaster(m_currentStyleSheet, textStyleParent); } -void libvisio::VSDContentCollector::collectLineStyle(unsigned /* level */, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, - const boost::optional<unsigned char> &linePattern, const boost::optional<unsigned char> &startMarker, - const boost::optional<unsigned char> &endMarker, const boost::optional<unsigned char> &lineCap, - const boost::optional<double> &rounding, const boost::optional<long> &qsLineColour, - const boost::optional<long> &qsLineMatrix) +void libvisio::VSDContentCollector::collectLineStyle(unsigned /* level */, const std::optional<double> &strokeWidth, const std::optional<Colour> &c, + const std::optional<unsigned char> &linePattern, const std::optional<unsigned char> &startMarker, + const std::optional<unsigned char> &endMarker, const std::optional<unsigned char> &lineCap, + const std::optional<double> &rounding, const std::optional<long> &qsLineColour, + const std::optional<long> &qsLineMatrix) { VSDOptionalLineStyle lineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding, qsLineColour, qsLineMatrix); m_styles.addLineStyle(m_currentStyleSheet, lineStyle); } -void libvisio::VSDContentCollector::collectFillStyle(unsigned /* level */, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, - const boost::optional<double> &shadowOffsetY, const boost::optional<long> &qsFillColour, - const boost::optional<long> &qsShadowColour, const boost::optional<long> &qsFillMatrix) +void libvisio::VSDContentCollector::collectFillStyle(unsigned /* level */, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc, const std::optional<double> &shadowOffsetX, + const std::optional<double> &shadowOffsetY, const std::optional<long> &qsFillColour, + const std::optional<long> &qsShadowColour, const std::optional<long> &qsFillMatrix) { VSDOptionalFillStyle fillStyle(colourFG, colourBG, fillPattern, fillFGTransparency, fillBGTransparency, shfgc, shadowPattern, shadowOffsetX, shadowOffsetY, qsFillColour, qsShadowColour, qsFillMatrix); @@ -2903,23 +2903,23 @@ void libvisio::VSDContentCollector::collectFillStyle(unsigned /* level */, const } -void libvisio::VSDContentCollector::collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc) +void libvisio::VSDContentCollector::collectFillStyle(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc) { collectFillStyle(level, colourFG, colourBG, fillPattern, fillFGTransparency, fillBGTransparency, shadowPattern, shfgc, m_shadowOffsetX, m_shadowOffsetY, -1, -1, -1); } void libvisio::VSDContentCollector::collectParaIXStyle(unsigned /* id */, unsigned /* level */, unsigned charCount, - const boost::optional<double> &indFirst, const boost::optional<double> &indLeft, - const boost::optional<double> &indRight, const boost::optional<double> &spLine, - const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, - const boost::optional<unsigned char> &align, const boost::optional<unsigned char> &bullet, - const boost::optional<VSDName> &bulletStr, const boost::optional<VSDName> &bulletFont, - const boost::optional<double> &bulletFontSize, const boost::optional<double> &textPosAfterBullet, - const boost::optional<unsigned> &flags) + const std::optional<double> &indFirst, const std::optional<double> &indLeft, + const std::optional<double> &indRight, const std::optional<double> &spLine, + const std::optional<double> &spBefore, const std::optional<double> &spAfter, + const std::optional<unsigned char> &align, const std::optional<unsigned char> &bullet, + const std::optional<VSDName> &bulletStr, const std::optional<VSDName> &bulletFont, + const std::optional<double> &bulletFontSize, const std::optional<double> &textPosAfterBullet, + const std::optional<unsigned> &flags) { VSDOptionalParaStyle paraStyle(charCount, indFirst, indLeft, indRight, spLine, spBefore, spAfter, align, bullet, bulletStr, bulletFont, bulletFontSize, textPosAfterBullet, flags); @@ -2928,21 +2928,21 @@ void libvisio::VSDContentCollector::collectParaIXStyle(unsigned /* id */, unsign void libvisio::VSDContentCollector::collectCharIXStyle(unsigned /* id */, unsigned /* level */, unsigned charCount, - const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, - const boost::optional<bool> &bold, const boost::optional<bool> &italic, const boost::optional<bool> &underline, - const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, - const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, - const boost::optional<bool> &superscript, const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) + const std::optional<VSDName> &font, const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, + const std::optional<bool> &bold, const std::optional<bool> &italic, const std::optional<bool> &underline, + const std::optional<bool> &doubleunderline, const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, + const std::optional<bool> &allcaps, const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, + const std::optional<bool> &superscript, const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) { VSDOptionalCharStyle charStyle(charCount, font, fontColour, fontSize, bold, italic, underline, doubleunderline, strikeout, doublestrikeout, allcaps, initcaps, smallcaps, superscript, subscript, scaleWidth); m_styles.addCharStyle(m_currentStyleSheet, charStyle); } -void libvisio::VSDContentCollector::collectTextBlockStyle(unsigned /* level */, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin, - const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin, const boost::optional<unsigned char> &verticalAlign, - const boost::optional<bool> &isBgFilled, const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop, - const boost::optional<unsigned char> &textDirection) +void libvisio::VSDContentCollector::collectTextBlockStyle(unsigned /* level */, const std::optional<double> &leftMargin, const std::optional<double> &rightMargin, + const std::optional<double> &topMargin, const std::optional<double> &bottomMargin, const std::optional<unsigned char> &verticalAlign, + const std::optional<bool> &isBgFilled, const std::optional<Colour> &bgColour, const std::optional<double> &defaultTabStop, + const std::optional<unsigned char> &textDirection) { VSDOptionalTextBlockStyle textBlockStyle(leftMargin, rightMargin, topMargin, bottomMargin, verticalAlign, isBgFilled, bgColour, defaultTabStop, textDirection); m_styles.addTextBlockStyle(m_currentStyleSheet, textBlockStyle); diff --git a/src/lib/VSDContentCollector.h b/src/lib/VSDContentCollector.h index fab81ad..a646b4d 100644 --- a/src/lib/VSDContentCollector.h +++ b/src/lib/VSDContentCollector.h @@ -45,19 +45,19 @@ public: void collectOLEList(unsigned id, unsigned level) override; void collectOLEData(unsigned id, unsigned level, const librevenge::RVNGBinaryData &oleData) override; void collectEllipse(unsigned id, unsigned level, double cx, double cy, double xleft, double yleft, double xtop, double ytop) override; - void collectLine(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern, - const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker, - const boost::optional<unsigned char> &lineCap, const boost::optional<double> &rounding, - const boost::optional<long> &qsLineColour, const boost::optional<long> &qsLineMatrix) override; - void collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, const boost::optional<double> &shadowOffsetY, - const boost::optional<long> &qsFc, const boost::optional<long> &qsSc, const boost::optional<long> &qsLm) override; - void collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc) override; + void collectLine(unsigned level, const std::optional<double> &strokeWidth, const std::optional<Colour> &c, const std::optional<unsigned char> &linePattern, + const std::optional<unsigned char> &startMarker, const std::optional<unsigned char> &endMarker, + const std::optional<unsigned char> &lineCap, const std::optional<double> &rounding, + const std::optional<long> &qsLineColour, const std::optional<long> &qsLineMatrix) override; + void collectFillAndShadow(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc, const std::optional<double> &shadowOffsetX, const std::optional<double> &shadowOffsetY, + const std::optional<long> &qsFc, const std::optional<long> &qsSc, const std::optional<long> &qsLm) override; + void collectFillAndShadow(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc) override; void collectGeometry(unsigned id, unsigned level, bool noFill, bool noLine, bool noShow) override; void collectMoveTo(unsigned id, unsigned level, double x, double y) override; void collectLineTo(unsigned id, unsigned level, double x, double y) override; @@ -93,35 +93,35 @@ public: void collectUnhandledChunk(unsigned id, unsigned level) override; void collectText(unsigned level, const librevenge::RVNGBinaryData &textStream, TextFormat format) override; - void collectCharIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font, - const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, - const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, - const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, - const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) override; - void collectDefaultCharStyle(unsigned charCount, const boost::optional<VSDName> &font, const boost::optional<Colour> &fontColour, - const boost::optional<double> &fontSize, const boost::optional<bool> &bold, const boost::optional<bool> &italic, - const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, const boost::optional<bool> &strikeout, - const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, const boost::optional<bool> &initcaps, - const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, const boost::optional<bool> &subscript, - const boost::optional<double> &scaleWidth) override; - void collectParaIX(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst, - const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine, - const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, const boost::optional<VSDName> &bulletFont, - const boost::optional<double> &bulletFontSize, const boost::optional<double> &textPosAfterBullet, - const boost::optional<unsigned> &flags) override; - void collectDefaultParaStyle(unsigned charCount, const boost::optional<double> &indFirst, const boost::optional<double> &indLeft, - const boost::optional<double> &indRight, const boost::optional<double> &spLine, const boost::optional<double> &spBefore, - const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) override; - void collectTextBlock(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin, - const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin, - const boost::optional<unsigned char> &verticalAlign, const boost::optional<bool> &isBgFilled, - const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop, - const boost::optional<unsigned char> &textDirection) override; + void collectCharIX(unsigned id, unsigned level, unsigned charCount, const std::optional<VSDName> &font, + const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, + const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, + const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, + const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) override; + void collectDefaultCharStyle(unsigned charCount, const std::optional<VSDName> &font, const std::optional<Colour> &fontColour, + const std::optional<double> &fontSize, const std::optional<bool> &bold, const std::optional<bool> &italic, + const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, const std::optional<bool> &strikeout, + const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, const std::optional<bool> &initcaps, + const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, const std::optional<bool> &subscript, + const std::optional<double> &scaleWidth) override; + void collectParaIX(unsigned id, unsigned level, unsigned charCount, const std::optional<double> &indFirst, + const std::optional<double> &indLeft, const std::optional<double> &indRight, const std::optional<double> &spLine, + const std::optional<double> &spBefore, const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, const std::optional<VSDName> &bulletFont, + const std::optional<double> &bulletFontSize, const std::optional<double> &textPosAfterBullet, + const std::optional<unsigned> &flags) override; + void collectDefaultParaStyle(unsigned charCount, const std::optional<double> &indFirst, const std::optional<double> &indLeft, + const std::optional<double> &indRight, const std::optional<double> &spLine, const std::optional<double> &spBefore, + const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) override; + void collectTextBlock(unsigned level, const std::optional<double> &leftMargin, const std::optional<double> &rightMargin, + const std::optional<double> &topMargin, const std::optional<double> &bottomMargin, + const std::optional<unsigned char> &verticalAlign, const std::optional<bool> &isBgFilled, + const std::optional<Colour> &bgColour, const std::optional<double> &defaultTabStop, + const std::optional<unsigned char> &textDirection) override; void collectNameList(unsigned id, unsigned level) override; void collectName(unsigned id, unsigned level, const librevenge::RVNGBinaryData &name, TextFormat format) override; void collectPageSheet(unsigned id, unsigned level) override; @@ -132,37 +132,37 @@ public: // Style collectors void collectStyleSheet(unsigned id, unsigned level, unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle) override; - void collectLineStyle(unsigned level, const boost::optional<double> &strokeWidth, const boost::optional<Colour> &c, const boost::optional<unsigned char> &linePattern, - const boost::optional<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker, - const boost::optional<unsigned char> &lineCap, const boost::optional<double> &rounding, - const boost::optional<long> &qsLineColour, const boost::optional<long> &qsLineMatrix) override; - void collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc, const boost::optional<double> &shadowOffsetX, const boost::optional<double> &shadowOffsetY, - const boost::optional<long> &qsFillColour, const boost::optional<long> &qsShadowColour, - const boost::optional<long> &qsFillMatrix) override; - void collectFillStyle(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, - const boost::optional<unsigned char> &fillPattern, const boost::optional<double> &fillFGTransparency, - const boost::optional<double> &fillBGTransparency, const boost::optional<unsigned char> &shadowPattern, - const boost::optional<Colour> &shfgc) override; - void collectCharIXStyle(unsigned id, unsigned level, unsigned charCount, const boost::optional<VSDName> &font, - const boost::optional<Colour> &fontColour, const boost::optional<double> &fontSize, const boost::optional<bool> &bold, - const boost::optional<bool> &italic, const boost::optional<bool> &underline, const boost::optional<bool> &doubleunderline, - const boost::optional<bool> &strikeout, const boost::optional<bool> &doublestrikeout, const boost::optional<bool> &allcaps, - const boost::optional<bool> &initcaps, const boost::optional<bool> &smallcaps, const boost::optional<bool> &superscript, - const boost::optional<bool> &subscript, const boost::optional<double> &scaleWidth) override; - void collectParaIXStyle(unsigned id, unsigned level, unsigned charCount, const boost::optional<double> &indFirst, - const boost::optional<double> &indLeft, const boost::optional<double> &indRight, const boost::optional<double> &spLine, - const boost::optional<double> &spBefore, const boost::optional<double> &spAfter, const boost::optional<unsigned char> &align, - const boost::optional<unsigned char> &bullet, const boost::optional<VSDName> &bulletStr, - const boost::optional<VSDName> &bulletFont, const boost::optional<double> &bulletFontSize, - const boost::optional<double> &textPosAfterBullet, const boost::optional<unsigned> &flags) override; - void collectTextBlockStyle(unsigned level, const boost::optional<double> &leftMargin, const boost::optional<double> &rightMargin, - const boost::optional<double> &topMargin, const boost::optional<double> &bottomMargin, - const boost::optional<unsigned char> &verticalAlign, const boost::optional<bool> &isBgFilled, - const boost::optional<Colour> &bgColour, const boost::optional<double> &defaultTabStop, - const boost::optional<unsigned char> &textDirection) override; + void collectLineStyle(unsigned level, const std::optional<double> &strokeWidth, const std::optional<Colour> &c, const std::optional<unsigned char> &linePattern, + const std::optional<unsigned char> &startMarker, const std::optional<unsigned char> &endMarker, + const std::optional<unsigned char> &lineCap, const std::optional<double> &rounding, + const std::optional<long> &qsLineColour, const std::optional<long> &qsLineMatrix) override; + void collectFillStyle(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc, const std::optional<double> &shadowOffsetX, const std::optional<double> &shadowOffsetY, + const std::optional<long> &qsFillColour, const std::optional<long> &qsShadowColour, + const std::optional<long> &qsFillMatrix) override; + void collectFillStyle(unsigned level, const std::optional<Colour> &colourFG, const std::optional<Colour> &colourBG, + const std::optional<unsigned char> &fillPattern, const std::optional<double> &fillFGTransparency, + const std::optional<double> &fillBGTransparency, const std::optional<unsigned char> &shadowPattern, + const std::optional<Colour> &shfgc) override; + void collectCharIXStyle(unsigned id, unsigned level, unsigned charCount, const std::optional<VSDName> &font, + const std::optional<Colour> &fontColour, const std::optional<double> &fontSize, const std::optional<bool> &bold, + const std::optional<bool> &italic, const std::optional<bool> &underline, const std::optional<bool> &doubleunderline, + const std::optional<bool> &strikeout, const std::optional<bool> &doublestrikeout, const std::optional<bool> &allcaps, + const std::optional<bool> &initcaps, const std::optional<bool> &smallcaps, const std::optional<bool> &superscript, + const std::optional<bool> &subscript, const std::optional<double> &scaleWidth) override; + void collectParaIXStyle(unsigned id, unsigned level, unsigned charCount, const std::optional<double> &indFirst, + const std::optional<double> &indLeft, const std::optional<double> &indRight, const std::optional<double> &spLine, + const std::optional<double> &spBefore, const std::optional<double> &spAfter, const std::optional<unsigned char> &align, + const std::optional<unsigned char> &bullet, const std::optional<VSDName> &bulletStr, + const std::optional<VSDName> &bulletFont, const std::optional<double> &bulletFontSize, + const std::optional<double> &textPosAfterBullet, const std::optional<unsigned> &flags) override; + void collectTextBlockStyle(unsigned level, const std::optional<double> &leftMargin, const std::optional<double> &rightMargin, + const std::optional<double> &topMargin, const std::optional<double> &bottomMargin, + const std::optional<unsigned char> &verticalAlign, const std::optional<bool> &isBgFilled, + const std::optional<Colour> &bgColour, const std::optional<double> &defaultTabStop, + const std::optional<unsigned char> &textDirection) override; void collectMetaData(const librevenge::RVNGPropertyList &metaData) override; diff --git a/src/lib/VSDFieldList.cpp b/src/lib/VSDFieldList.cpp index 00c11d2..993173f 100644 --- a/src/lib/VSDFieldList.cpp +++ b/src/lib/VSDFieldList.cpp @@ -551,13 +551,13 @@ void libvisio::VSDFieldList::addFieldList(unsigned id, unsigned level) void libvisio::VSDFieldList::addTextField(unsigned id, unsigned level, int nameId, int formatStringId) { if (m_elements.find(id) == m_elements.end()) - m_elements[id] = make_unique<VSDTextField>(id, level, nameId, formatStringId); + m_elements[id] = std::make_unique<VSDTextField>(id, level, nameId, formatStringId); } void libvisio::VSDFieldList::addNumericField(unsigned id, unsigned level, unsigned short format, unsigned short cellType, double number, int formatStringId) { if (m_elements.find(id) == m_elements.end()) - m_elements[id] = make_unique<VSDNumericField>(id, level, format, cellType, number, formatStringId); + m_elements[id] = std::make_unique<VSDNumericField>(id, level, format, cellType, number, formatStringId); } void libvisio::VSDFieldList::handle(VSDCollector *collector) const diff --git a/src/lib/VSDGeometryList.cpp b/src/lib/VSDGeometryList.cpp index a195136..1e9bb59 100644 --- a/src/lib/VSDGeometryList.cpp +++ b/src/lib/VSDGeometryList.cpp @@ -12,6 +12,8 @@ #include "VSDCollector.h" #include "libvisio_utils.h" +#include <optional> + namespace libvisio { @@ -19,10 +21,10 @@ namespace libvisio class VSDGeometry : public VSDGeometryListElement { public: - VSDGeometry(unsigned id, unsigned level, const boost::optional<bool> &noFill, - const boost::optional<bool> &noLine, const boost::optional<bool> &noShow) : - VSDGeometryListElement(id, level), m_noFill(get_optional_value_or(noFill, false)), - m_noLine(get_optional_value_or(noLine, false)), m_noShow(get_optional_value_or(noShow, false)) {} + VSDGeometry(unsigned id, unsigned level, const std::optional<bool> &noFill, + const std::optional<bool> &noLine, const std::optional<bool> &noShow) : + VSDGeometryListElement(id, level), m_noFill(noFill.value_or(false)), + m_noLine(noLine.value_or(false)), m_noShow(noShow.value_or(false)) {} ~VSDGeometry() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -44,8 +46,8 @@ public: class VSDMoveTo : public VSDGeometryListElement { public: - VSDMoveTo(unsigned id, unsigned level, const boost::optional<double> &x, const boost::optional<double> &y) : - VSDGeometryListElement(id, level), m_x(get_optional_value_or(x, 0.0)), m_y(get_optional_value_or(y, 0.0)) {} + VSDMoveTo(unsigned id, unsigned level, const std::optional<double> &x, const std::optional<double> &y) : + VSDGeometryListElement(id, level), m_x(x.value_or(0.0)), m_y(y.value_or(0.0)) {} ~VSDMoveTo() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -55,8 +57,8 @@ public: class VSDLineTo : public VSDGeometryListElement { public: - VSDLineTo(unsigned id, unsigned level, const boost::optional<double> &x, const boost::optional<double> &y) : - VSDGeometryListElement(id, level), m_x(get_optional_value_or(x, 0.0)), m_y(get_optional_value_or(y, 0.0)) {} + VSDLineTo(unsigned id, unsigned level, const std::optional<double> &x, const std::optional<double> &y) : + VSDGeometryListElement(id, level), m_x(x.value_or(0.0)), m_y(y.value_or(0.0)) {} ~VSDLineTo() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -66,8 +68,8 @@ public: class VSDArcTo : public VSDGeometryListElement { public: - VSDArcTo(unsigned id, unsigned level, const boost::optional<double> &x2, const boost::optional<double> &y2, const boost::optional<double> &bow) : - VSDGeometryListElement(id, level), m_x2(get_optional_value_or(x2, 0.0)), m_y2(get_optional_value_or(y2, 0.0)), m_bow(get_optional_value_or(bow, 0.0)) {} + VSDArcTo(unsigned id, unsigned level, const std::optional<double> &x2, const std::optional<double> &y2, const std::optional<double> &bow) : + VSDGeometryListElement(id, level), m_x2(x2.value_or(0.0)), m_y2(y2.value_or(0.0)), m_bow(bow.value_or(0.0)) {} ~VSDArcTo() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -77,12 +79,12 @@ public: class VSDEllipse : public VSDGeometryListElement { public: - VSDEllipse(unsigned id, unsigned level, const boost::optional<double> &cx, const boost::optional<double> &cy, - const boost::optional<double> &xleft, const boost::optional<double> &yleft, - const boost::optional<double> &xtop, const boost::optional<double> &ytop) : - VSDGeometryListElement(id, level), m_cx(get_optional_value_or(cx, 0.0)), m_cy(get_optional_value_or(cy, 0.0)), - m_xleft(get_optional_value_or(xleft, 0.0)), m_yleft(get_optional_value_or(yleft, 0.0)), m_xtop(get_optional_value_or(xtop, 0.0)), - m_ytop(get_optional_value_or(ytop, 0.0)) {} + VSDEllipse(unsigned id, unsigned level, const std::optional<double> &cx, const std::optional<double> &cy, + const std::optional<double> &xleft, const std::optional<double> &yleft, + const std::optional<double> &xtop, const std::optional<double> &ytop) : + VSDGeometryListElement(id, level), m_cx(cx.value_or(0.0)), m_cy(cy.value_or(0.0)), + m_xleft(xleft.value_or(0.0)), m_yleft(yleft.value_or(0.0)), m_xtop(xtop.value_or(0.0)), + m_ytop(ytop.value_or(0.0)) {} ~VSDEllipse() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -92,11 +94,11 @@ public: class VSDEllipticalArcTo : public VSDGeometryListElement { public: - VSDEllipticalArcTo(unsigned id, unsigned level, const boost::optional<double> &x3, const boost::optional<double> &y3, - const boost::optional<double> &x2, const boost::optional<double> &y2, - const boost::optional<double> &angle, const boost::optional<double> &ecc) : - VSDGeometryListElement(id, level), m_x3(get_optional_value_or(x3, 0.0)), m_y3(get_optional_value_or(y3, 0.0)), m_x2(get_optional_value_or(x2, 0.0)), - m_y2(get_optional_value_or(y2, 0.0)), m_angle(get_optional_value_or(angle, 0.0)), m_ecc(get_optional_value_or(ecc, 1.0)) {} + VSDEllipticalArcTo(unsigned id, unsigned level, const std::optional<double> &x3, const std::optional<double> &y3, + const std::optional<double> &x2, const std::optional<double> &y2, + const std::optional<double> &angle, const std::optional<double> &ecc) : + VSDGeometryListElement(id, level), m_x3(x3.value_or(0.0)), m_y3(y3.value_or(0.0)), m_x2(x2.value_or(0.0)), + m_y2(y2.value_or(0.0)), m_angle(angle.value_or(0.0)), m_ecc(ecc.value_or(1.0)) {} ~VSDEllipticalArcTo() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -139,11 +141,11 @@ public: class VSDNURBSTo3 : public VSDGeometryListElement { public: - VSDNURBSTo3(unsigned id, unsigned level, const boost::optional<double> &x2, const boost::optional<double> &y2, const boost::optional<double> &knot, - const boost::optional<double> &knotPrev, const boost::optional<double> &weight, const boost::optional<double> &weightPrev, - const boost::optional<NURBSData> &data) : - VSDGeometryListElement(id, level), m_data(get_optional_value_or(data, NURBSData())), m_x2(get_optional_value_or(x2, 0.0)), m_y2(get_optional_value_or(y2, 0.0)), - m_knot(get_optional_value_or(knot, 0.0)), m_knotPrev(get_optional_value_or(knotPrev, 0.0)), m_weight(get_optional_value_or(weight, 0.0)), m_weightPrev(get_optional_value_or(weightPrev, 0.0)) {} + VSDNURBSTo3(unsigned id, unsigned level, const std::optional<double> &x2, const std::optional<double> &y2, const std::optional<double> &knot, + const std::optional<double> &knotPrev, const std::optional<double> &weight, const std::optional<double> &weightPrev, + const std::optional<NURBSData> &data) : + VSDGeometryListElement(id, level), m_data(data.value_or(NURBSData())), m_x2(x2.value_or(0.0)), m_y2(y2.value_or(0.0)), + m_knot(knot.value_or(0.0)), m_knotPrev(knotPrev.value_or(0.0)), m_weight(weight.value_or(0.0)), m_weightPrev(weightPrev.value_or(0.0)) {} ~VSDNURBSTo3() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -185,9 +187,9 @@ public: class VSDPolylineTo3 : public VSDGeometryListElement { public: - VSDPolylineTo3(unsigned id, unsigned level, const boost::optional<double> &x, const boost::optional<double> &y, - const boost::optional<PolylineData> &data) : - VSDGeometryListElement(id, level), m_data(get_optional_value_or(data, PolylineData())), m_x(get_optional_value_or(x, 0.0)), m_y(get_optional_value_or(y, 0.0)) {} + VSDPolylineTo3(unsigned id, unsigned level, const std::optional<double> &x, const std::optional<double> &y, + const std::optional<PolylineData> &data) : + VSDGeometryListElement(id, level), m_data(data.value_or(PolylineData())), m_x(x.value_or(0.0)), m_y(y.value_or(0.0)) {} ~VSDPolylineTo3() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -199,11 +201,11 @@ public: class VSDSplineStart : public VSDGeometryListElement { public: - VSDSplineStart(unsigned id, unsigned level, const boost::optional<double> &x, const boost::optional<double> &y, - const boost::optional<double> &secondKnot, const boost::optional<double> &firstKnot, - const boost::optional<double> &lastKnot, const boost::optional<unsigned> °ree) : - VSDGeometryListElement(id, level), m_x(get_optional_value_or(x, 0.0)), m_y(get_optional_value_or(y, 0.0)), m_secondKnot(get_optional_value_or(secondKnot, 0.0)), - m_firstKnot(get_optional_value_or(firstKnot, 0.0)), m_lastKnot(get_optional_value_or(lastKnot, 0.0)), m_degree(get_optional_value_or(degree, 0)) {} + VSDSplineStart(unsigned id, unsigned level, const std::optional<double> &x, const std::optional<double> &y, + const std::optional<double> &secondKnot, const std::optional<double> &firstKnot, + const std::optional<double> &lastKnot, const std::optional<unsigned> °ree) : + VSDGeometryListElement(id, level), m_x(x.value_or(0.0)), m_y(y.value_or(0.0)), m_secondKnot(secondKnot.value_or(0.0)), + m_firstKnot(firstKnot.value_or(0.0)), m_lastKnot(lastKnot.value_or(0.0)), m_degree(degree.value_or(0)) {} ~VSDSplineStart() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -216,9 +218,9 @@ public: class VSDSplineKnot : public VSDGeometryListElement { public: - VSDSplineKnot(unsigned id, unsigned level, const boost::optional<double> &x, const boost::optional<double> &y, - const boost::optional<double> &knot) : - VSDGeometryListElement(id, level), m_x(get_optional_value_or(x, 0.0)), m_y(get_optional_value_or(y, 0.0)), m_knot(get_optional_value_or(knot, 0.0)) {} + VSDSplineKnot(unsigned id, unsigned level, const std::optional<double> &x, const std::optional<double> &y, + const std::optional<double> &knot) : + VSDGeometryListElement(id, level), m_x(x.value_or(0.0)), m_y(y.value_or(0.0)), m_knot(knot.value_or(0.0)) {} ~VSDSplineKnot() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -229,10 +231,9 @@ public: class VSDInfiniteLine : public VSDGeometryListElement { public: - VSDInfiniteLine(unsigned id, unsigned level, const boost::optional<double> &x1, const boost::optional<double> &y1, - const boost::optional<double> &x2, const boost::optional<double> &y2) : - VSDGeometryListElement(id, level), m_x1(get_optional_value_or(x1, 0.0)), m_y1(get_optional_value_or(y1, 0.0)), - m_x2(get_optional_value_or(x2, 0.0)), m_y2(get_optional_value_or(y2, 0.0)) {} + VSDInfiniteLine(unsigned id, unsigned level, const std::optional<double> &x1, const std::optional<double> &y1, + const std::optional<double> &x2, const std::optional<double> &y2) : + VSDGeometryListElement(id, level), m_x1(x1.value_or(0.0)), m_y1(y1.value_or(0.0)), m_x2(x2.value_or(0.0)), m_y2(y2.value_or(0.0)) {} ~VSDInfiniteLine() override {} void handle(VSDCollector *collector) const override; VSDGeometryListElement *clone() override; @@ -242,10 +243,9 @@ public: class VSDRelCubBezTo : public VSDGeometryListElement { public: - VSDRelCubBezTo(unsigned id, unsigned level, const boost::optional<double> &x, const boost::optional<double> &y, const boost::optional<double> &a, - const boost::optional<double> &b, const boost::optional<double> &c, const boost::optional<double> &d) : - VSDGeometryListElement(id, level), m_x(get_optional_value_or(x, 0.0)), m_y(get_optional_value_or(y, 0.0)), - m_a(get_optional_value_or(a, 0.0)), m_b(get_optional_value_or(b, 0.0)), m_c(get_optional_value_or(c, 0.0)), m_d(get_optional_value_or(d, 0.0)) {} + VSDRelCubBezTo(unsigned id, unsigned level, const std::optional<double> &x, const std::optional<double> &y, const std::optional<double> &a, -e ... etc. - the rest is truncated
