diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-28 20:14:10 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2015-12-28 20:14:10 +0100 |
commit | c006852738bc5ffa6cffd125e980b5cdd9ade7ba (patch) | |
tree | 2b06e676b6dc4442712febb20e9db8045c35d449 | |
parent | bd9f4c565f7af41b0e32f399430e3e20bb1c8797 (diff) |
Extract part of the path generation to be able to add rounding in next steps
Change-Id: I6ce348c7b14ff324f106be9ab615dbfae546a178
-rw-r--r-- | src/lib/VSDContentCollector.cpp | 13 | ||||
-rw-r--r-- | src/lib/VSDContentCollector.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index 8365984..1a34b51 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -267,8 +267,7 @@ void libvisio::VSDContentCollector::_flushCurrentPath() if (!tmpPath.empty()) { librevenge::RVNGPropertyListVector path; - for (unsigned i = 0; i < tmpPath.size(); ++i) - path.append(tmpPath[i]); + _convertToPath(tmpPath, path, m_lineStyle.rounding); m_shapeOutputDrawing->addStyle(fillPathProps); librevenge::RVNGPropertyList propList; propList.insert("svg:d", path); @@ -351,8 +350,7 @@ void libvisio::VSDContentCollector::_flushCurrentPath() if (!tmpPath.empty()) { librevenge::RVNGPropertyListVector path; - for (unsigned i = 0; i < tmpPath.size(); ++i) - path.append(tmpPath[i]); + _convertToPath(tmpPath, path, m_lineStyle.rounding); m_shapeOutputDrawing->addStyle(linePathProps); librevenge::RVNGPropertyList propList; propList.insert("svg:d", path); @@ -363,6 +361,13 @@ void libvisio::VSDContentCollector::_flushCurrentPath() m_currentLineGeometry.clear(); } +void libvisio::VSDContentCollector::_convertToPath(const std::vector<librevenge::RVNGPropertyList> &segmentVector, + librevenge::RVNGPropertyListVector &path, double /* rounding */) +{ + for (unsigned i = 0; i < segmentVector.size(); ++i) + path.append(segmentVector[i]); +} + void libvisio::VSDContentCollector::_flushText() { /* Do not output empty text objects. */ diff --git a/src/lib/VSDContentCollector.h b/src/lib/VSDContentCollector.h index 3497681..ca7a73e 100644 --- a/src/lib/VSDContentCollector.h +++ b/src/lib/VSDContentCollector.h @@ -229,6 +229,8 @@ private: void _fillParagraphProperties(librevenge::RVNGPropertyList &propList, const VSDParaStyle &style); void _fillTabSet(librevenge::RVNGPropertyList &propList, const VSDTabSet &tabSet); void _fillCharProperties(librevenge::RVNGPropertyList &propList, const VSDCharStyle &style); + void _convertToPath(const std::vector<librevenge::RVNGPropertyList> &segmentVector, + librevenge::RVNGPropertyListVector &path, double rounding); bool m_isPageStarted; double m_pageWidth; |