src/lib/VDXParser.cpp | 9 +++++++-- src/lib/VSD5Parser.cpp | 8 +++++--- src/lib/VSDCollector.h | 4 ++-- src/lib/VSDContentCollector.cpp | 22 +++++++++++++--------- src/lib/VSDContentCollector.h | 4 ++-- src/lib/VSDParser.cpp | 10 ++++++---- src/lib/VSDStyles.h | 21 +++++++++++++-------- src/lib/VSDStylesCollector.cpp | 28 +++++++++++++++++----------- src/lib/VSDStylesCollector.h | 4 ++-- src/lib/VSDXMLParserBase.cpp | 2 +- src/lib/VSDXParser.cpp | 9 +++++++-- src/lib/tokens.txt | 1 + 12 files changed, 76 insertions(+), 46 deletions(-)
New commits: commit 7b04394d01b5dfa227b213e0efac55dfd8d77c9d Author: Fridrich Å trba <[email protected]> Date: Tue Dec 15 07:59:06 2015 +0100 Read rounding in line properties Change-Id: Ib08f7625f7a41d7f37e8abce60a94b87bc742ecf diff --git a/src/lib/VDXParser.cpp b/src/lib/VDXParser.cpp index b2da904..d09aff1 100644 --- a/src/lib/VDXParser.cpp +++ b/src/lib/VDXParser.cpp @@ -316,6 +316,7 @@ void libvisio::VDXParser::readLine(xmlTextReaderPtr reader) boost::optional<unsigned char> startMarker; boost::optional<unsigned char> endMarker; boost::optional<unsigned char> lineCap; + boost::optional<double> rounding; unsigned level = (unsigned)getElementDepth(reader); int ret = 1; @@ -344,6 +345,10 @@ void libvisio::VDXParser::readLine(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) ret = readByteData(linePattern, reader); break; + case XML_ROUNDING: + if (XML_READER_TYPE_ELEMENT == tokenType) + ret = readDoubleData(rounding, reader); + break; case XML_BEGINARROW: if (XML_READER_TYPE_ELEMENT == tokenType) ret = readByteData(startMarker, reader); @@ -363,9 +368,9 @@ void libvisio::VDXParser::readLine(xmlTextReaderPtr reader) while ((XML_LINE != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret && (!m_watcher || !m_watcher->isError())); if (m_isInStyles) - m_collector->collectLineStyle(level, strokeWidth, colour, linePattern, startMarker, endMarker, lineCap); + m_collector->collectLineStyle(level, strokeWidth, colour, linePattern, startMarker, endMarker, lineCap, rounding); else - m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, colour, linePattern, startMarker, endMarker, lineCap)); + m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, colour, linePattern, startMarker, endMarker, lineCap, rounding)); } void libvisio::VDXParser::readFillAndShadow(xmlTextReaderPtr reader) diff --git a/src/lib/VSD5Parser.cpp b/src/lib/VSD5Parser.cpp index 7120c79..7a014be 100644 --- a/src/lib/VSD5Parser.cpp +++ b/src/lib/VSD5Parser.cpp @@ -199,15 +199,17 @@ void libvisio::VSD5Parser::readLine(librevenge::RVNGInputStream *input) unsigned char colourIndex = readU8(input); Colour c = _colourFromIndex(colourIndex); unsigned char linePattern = readU8(input); - input->seek(10, librevenge::RVNG_SEEK_CUR); + input->seek(1, librevenge::RVNG_SEEK_CUR); + double rounding = readDouble(input); + input->seek(1, librevenge::RVNG_SEEK_CUR); unsigned char startMarker = readU8(input); unsigned char endMarker = readU8(input); unsigned char lineCap = readU8(input); if (m_isInStyles) - m_collector->collectLineStyle(m_header.level, strokeWidth, c, linePattern, startMarker, endMarker, lineCap); + m_collector->collectLineStyle(m_header.level, strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding); else - m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap)); + m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding)); } void libvisio::VSD5Parser::readCharIX(librevenge::RVNGInputStream *input) diff --git a/src/lib/VSDCollector.h b/src/lib/VSDCollector.h index 35034f9..81914b6 100644 --- a/src/lib/VSDCollector.h +++ b/src/lib/VSDCollector.h @@ -30,7 +30,7 @@ public: 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) = 0; + const boost::optional<unsigned char> &lineCap, const boost::optional<double> &rounding) = 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, @@ -109,7 +109,7 @@ public: 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) = 0; + const boost::optional<unsigned char> &lineCap, const boost::optional<double> &rounding) = 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, diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index a1ef3ff..abf57bf 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -1026,10 +1026,11 @@ void libvisio::VSDContentCollector::collectRelQuadBezTo(unsigned /* id */, unsig } 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<unsigned char> &startMarker, const boost::optional<unsigned char> &endMarker, const boost::optional<unsigned char> &lineCap, + const boost::optional<double> &rounding) { _handleLevelChange(level); - m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap)); + m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding)); } void libvisio::VSDContentCollector::collectFillAndShadow(unsigned level, const boost::optional<Colour> &colourFG, const boost::optional<Colour> &colourBG, @@ -2183,16 +2184,18 @@ void libvisio::VSDContentCollector::collectStyleSheet(unsigned id, unsigned leve } 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<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) { - VSDOptionalLineStyle lineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap); + VSDOptionalLineStyle lineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding); 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<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) { VSDOptionalFillStyle fillStyle(colourFG, colourBG, fillPattern, fillFGTransparency, fillBGTransparency, shfgc, shadowPattern, shadowOffsetX, shadowOffsetY); @@ -2201,8 +2204,9 @@ 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) + 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) { collectFillStyle(level, colourFG, colourBG, fillPattern, fillFGTransparency, fillBGTransparency, shadowPattern, shfgc, m_shadowOffsetX, m_shadowOffsetY); } diff --git a/src/lib/VSDContentCollector.h b/src/lib/VSDContentCollector.h index 4b920f8..cb4a636 100644 --- a/src/lib/VSDContentCollector.h +++ b/src/lib/VSDContentCollector.h @@ -49,7 +49,7 @@ public: void collectEllipse(unsigned id, unsigned level, double cx, double cy, double xleft, double yleft, double xtop, double ytop); 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<unsigned char> &lineCap, const boost::optional<double> &rounding); 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, @@ -129,7 +129,7 @@ public: void collectStyleSheet(unsigned id, unsigned level, unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle); 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<unsigned char> &lineCap, const boost::optional<double> &rounding); 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, diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp index 74e9bc0..d3e6a0b 100644 --- a/src/lib/VSDParser.cpp +++ b/src/lib/VSDParser.cpp @@ -623,7 +623,7 @@ void libvisio::VSDParser::_flushShape() m_collector->collectTxtXForm(m_currentShapeLevel+2, *(m_shape.m_txtxform)); m_collector->collectLine(m_currentShapeLevel+2, m_shape.m_lineStyle.width, m_shape.m_lineStyle.colour, m_shape.m_lineStyle.pattern, - m_shape.m_lineStyle.startMarker, m_shape.m_lineStyle.endMarker, m_shape.m_lineStyle.cap); + m_shape.m_lineStyle.startMarker, m_shape.m_lineStyle.endMarker, m_shape.m_lineStyle.cap, m_shape.m_lineStyle.rounding); m_collector->collectFillAndShadow(m_currentShapeLevel+2, m_shape.m_fillStyle.fgColour, m_shape.m_fillStyle.bgColour, m_shape.m_fillStyle.pattern, m_shape.m_fillStyle.fgTransparency, m_shape.m_fillStyle.bgTransparency, m_shape.m_fillStyle.shadowPattern, @@ -827,15 +827,17 @@ void libvisio::VSDParser::readLine(librevenge::RVNGInputStream *input) c.b = readU8(input); c.a = readU8(input); unsigned char linePattern = readU8(input); - input->seek(10, librevenge::RVNG_SEEK_CUR); + input->seek(1, librevenge::RVNG_SEEK_CUR); + double rounding = readDouble(input); + input->seek(1, librevenge::RVNG_SEEK_CUR); unsigned char startMarker = readU8(input); unsigned char endMarker = readU8(input); unsigned char lineCap = readU8(input); if (m_isInStyles) - m_collector->collectLineStyle(m_header.level, strokeWidth, c, linePattern, startMarker, endMarker, lineCap); + m_collector->collectLineStyle(m_header.level, strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding); else - m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap)); + m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, c, linePattern, startMarker, endMarker, lineCap, rounding)); } void libvisio::VSDParser::readTextBlock(librevenge::RVNGInputStream *input) diff --git a/src/lib/VSDStyles.h b/src/lib/VSDStyles.h index 0d6519a..456577a 100644 --- a/src/lib/VSDStyles.h +++ b/src/lib/VSDStyles.h @@ -70,14 +70,15 @@ struct VSDThemeReference struct VSDOptionalLineStyle { VSDOptionalLineStyle() : - width(), colour(), pattern(), startMarker(), endMarker(), cap() {} + width(), colour(), pattern(), startMarker(), endMarker(), cap(), rounding() {} VSDOptionalLineStyle(const boost::optional<double> &w, const boost::optional<Colour> &col, const boost::optional<unsigned char> &p, const boost::optional<unsigned char> &sm, - const boost::optional<unsigned char> &em, const boost::optional<unsigned char> &c) : - width(w), colour(col), pattern(p), startMarker(sm), endMarker(em), cap(c) {} + const boost::optional<unsigned char> &em, const boost::optional<unsigned char> &c, + const boost::optional<double> &r) : + width(w), colour(col), pattern(p), startMarker(sm), endMarker(em), cap(c), rounding(r) {} VSDOptionalLineStyle(const VSDOptionalLineStyle &style) : width(style.width), colour(style.colour), pattern(style.pattern), startMarker(style.startMarker), - endMarker(style.endMarker), cap(style.cap) {} + endMarker(style.endMarker), cap(style.cap), rounding(style.rounding) {} ~VSDOptionalLineStyle() {} void override(const VSDOptionalLineStyle &style) { @@ -87,6 +88,7 @@ struct VSDOptionalLineStyle ASSIGN_OPTIONAL(style.startMarker, startMarker); ASSIGN_OPTIONAL(style.endMarker, endMarker); ASSIGN_OPTIONAL(style.cap, cap); + ASSIGN_OPTIONAL(style.rounding, rounding); } boost::optional<double> width; @@ -95,18 +97,19 @@ struct VSDOptionalLineStyle boost::optional<unsigned char> startMarker; boost::optional<unsigned char> endMarker; boost::optional<unsigned char> cap; + boost::optional<double> rounding; }; struct VSDLineStyle { VSDLineStyle() : - width(0.01), colour(), pattern(1), startMarker(0), endMarker(0), cap(0) {} + width(0.01), colour(), pattern(1), startMarker(0), endMarker(0), cap(0), rounding(0.0) {} VSDLineStyle(double w, Colour col, unsigned char p, unsigned char sm, - unsigned char em, unsigned char c) : - width(w), colour(col), pattern(p), startMarker(sm), endMarker(em), cap(c) {} + unsigned char em, unsigned char c, double r) : + width(w), colour(col), pattern(p), startMarker(sm), endMarker(em), cap(c), rounding(r) {} VSDLineStyle(const VSDLineStyle &style) : width(style.width), colour(style.colour), pattern(style.pattern), startMarker(style.startMarker), - endMarker(style.endMarker), cap(style.cap) {} + endMarker(style.endMarker), cap(style.cap), rounding(style.rounding) {} ~VSDLineStyle() {} void override(const VSDOptionalLineStyle &style) { @@ -116,6 +119,7 @@ struct VSDLineStyle ASSIGN_OPTIONAL(style.startMarker, startMarker); ASSIGN_OPTIONAL(style.endMarker, endMarker); ASSIGN_OPTIONAL(style.cap, cap); + ASSIGN_OPTIONAL(style.rounding, rounding); } double width; @@ -124,6 +128,7 @@ struct VSDLineStyle unsigned char startMarker; unsigned char endMarker; unsigned char cap; + double rounding; }; struct VSDOptionalFillStyle diff --git a/src/lib/VSDStylesCollector.cpp b/src/lib/VSDStylesCollector.cpp index 25f4029..0fefbb7 100644 --- a/src/lib/VSDStylesCollector.cpp +++ b/src/lib/VSDStylesCollector.cpp @@ -55,7 +55,7 @@ void libvisio::VSDStylesCollector::collectEllipse(unsigned /* id */, unsigned le void libvisio::VSDStylesCollector::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<unsigned char> & /* lineCap */, const boost::optional<double> & /* rounding */) { _handleLevelChange(level); } @@ -328,32 +328,38 @@ void libvisio::VSDStylesCollector::collectStyleSheet(unsigned /* id */, unsigned } void libvisio::VSDStylesCollector::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<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 */) { _handleLevelChange(level); } void libvisio::VSDStylesCollector::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<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 */) { _handleLevelChange(level); } void libvisio::VSDStylesCollector::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<unsigned char> & /* fillPattern */, const boost::optional<double> & /* fillFGTransparency */, + const boost::optional<double> & /* fillBGTransparency */, const boost::optional<unsigned char> & /* shadowPattern */, + const boost::optional<Colour> & /* shfgc */) { _handleLevelChange(level); } void libvisio::VSDStylesCollector::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<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 */) { _handleLevelChange(level); } diff --git a/src/lib/VSDStylesCollector.h b/src/lib/VSDStylesCollector.h index caa6eb7..65304fc 100644 --- a/src/lib/VSDStylesCollector.h +++ b/src/lib/VSDStylesCollector.h @@ -41,7 +41,7 @@ public: void collectEllipse(unsigned id, unsigned level, double cx, double cy, double xleft, double yleft, double xtop, double ytop); 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<unsigned char> &lineCap, const boost::optional<double> &rounding); 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, @@ -122,7 +122,7 @@ public: void collectStyleSheet(unsigned id, unsigned level,unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle); 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<unsigned char> &lineCap, const boost::optional<double> &rounding); 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, diff --git a/src/lib/VSDXMLParserBase.cpp b/src/lib/VSDXMLParserBase.cpp index f2ca3b6..89e09d4 100644 --- a/src/lib/VSDXMLParserBase.cpp +++ b/src/lib/VSDXMLParserBase.cpp @@ -1688,7 +1688,7 @@ void libvisio::VSDXMLParserBase::_flushShape() m_collector->collectTxtXForm(m_currentShapeLevel+2, *(m_shape.m_txtxform)); m_collector->collectLine(m_currentShapeLevel+2, m_shape.m_lineStyle.width, m_shape.m_lineStyle.colour, m_shape.m_lineStyle.pattern, - m_shape.m_lineStyle.startMarker, m_shape.m_lineStyle.endMarker, m_shape.m_lineStyle.cap); + m_shape.m_lineStyle.startMarker, m_shape.m_lineStyle.endMarker, m_shape.m_lineStyle.cap, m_shape.m_lineStyle.rounding); m_collector->collectFillAndShadow(m_currentShapeLevel+2, m_shape.m_fillStyle.fgColour, m_shape.m_fillStyle.bgColour, m_shape.m_fillStyle.pattern, m_shape.m_fillStyle.fgTransparency, m_shape.m_fillStyle.bgTransparency, m_shape.m_fillStyle.shadowPattern, diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp index 37351b9..1bdd33f 100644 --- a/src/lib/VSDXParser.cpp +++ b/src/lib/VSDXParser.cpp @@ -709,6 +709,7 @@ void libvisio::VSDXParser::readStyleProperties(xmlTextReaderPtr reader) boost::optional<double> strokeWidth; boost::optional<Colour> strokeColour; boost::optional<unsigned char> linePattern; + boost::optional<double> rounding; boost::optional<unsigned char> startMarker; boost::optional<unsigned char> endMarker; boost::optional<unsigned char> lineCap; @@ -763,6 +764,10 @@ void libvisio::VSDXParser::readStyleProperties(xmlTextReaderPtr reader) if (XML_READER_TYPE_ELEMENT == tokenType) ret = readByteData(linePattern, reader); break; + case XML_ROUNDING: + if (XML_READER_TYPE_ELEMENT == tokenType) + ret = readDoubleData(rounding, reader); + break; case XML_BEGINARROW: if (XML_READER_TYPE_ELEMENT == tokenType) ret = readByteData(startMarker, reader); @@ -909,7 +914,7 @@ void libvisio::VSDXParser::readStyleProperties(xmlTextReaderPtr reader) if (m_isInStyles) { - m_collector->collectLineStyle(level, strokeWidth, strokeColour, linePattern, startMarker, endMarker, lineCap); + m_collector->collectLineStyle(level, strokeWidth, strokeColour, linePattern, startMarker, endMarker, lineCap, rounding); m_collector->collectFillStyle(level, fillColourFG, fillColourBG, fillPattern, fillFGTransparency, fillBGTransparency, shadowPattern, shadowColourFG, shadowOffsetX, shadowOffsetY); m_collector->collectTextBlockStyle(level, leftMargin, rightMargin, topMargin, bottomMargin, @@ -917,7 +922,7 @@ void libvisio::VSDXParser::readStyleProperties(xmlTextReaderPtr reader) } else { - m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, strokeColour, linePattern, startMarker, endMarker, lineCap)); + m_shape.m_lineStyle.override(VSDOptionalLineStyle(strokeWidth, strokeColour, linePattern, startMarker, endMarker, lineCap, rounding)); m_shape.m_fillStyle.override(VSDOptionalFillStyle(fillColourFG, fillColourBG, fillPattern, fillFGTransparency, fillBGTransparency, shadowColourFG, shadowPattern, shadowOffsetX, shadowOffsetY)); m_shape.m_textBlockStyle.override(VSDOptionalTextBlockStyle(leftMargin, rightMargin, topMargin, bottomMargin, verticalAlign, !!bgClrId, bgColour, diff --git a/src/lib/tokens.txt b/src/lib/tokens.txt index 0d62b4b..0fc8b5a 100644 --- a/src/lib/tokens.txt +++ b/src/lib/tokens.txt @@ -158,6 +158,7 @@ RelMoveTo RelQuadBezTo ResizeMode RightMargin +Rounding Row Section Shape
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
