summaryrefslogtreecommitdiff
path: root/src/lib/VSDXContentCollector.cpp
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-01-09 16:03:46 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-01-09 16:56:13 +0100
commit0d59f0f3715f78426bd50dc44feac6f59d674b89 (patch)
tree1bfb688385b5b1b4277a5bec46eb8062c8a61d41 /src/lib/VSDXContentCollector.cpp
parentf7e27cc9cd1942095e288c887bc0735bad822e94 (diff)
Close the path only if it is really a closed path
Diffstat (limited to 'src/lib/VSDXContentCollector.cpp')
-rw-r--r--src/lib/VSDXContentCollector.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp
index 960a1c2..371e860 100644
--- a/src/lib/VSDXContentCollector.cpp
+++ b/src/lib/VSDXContentCollector.cpp
@@ -466,6 +466,7 @@ void libvisio::VSDXContentCollector::_flushCurrentPath()
double x = 0;
double y = 0;
bool firstPoint = true;
+ bool wasMove = false;
for (unsigned i = 0; i < m_currentGeometry.size(); i++)
{
@@ -476,10 +477,11 @@ void libvisio::VSDXContentCollector::_flushCurrentPath()
startX = x;
startY = y;
firstPoint = false;
+ wasMove = true;
}
else if (m_currentGeometry[i]["libwpg:path-action"]->getStr() == "M")
{
- if (((startX == x && startY == y) || (m_styleProps["draw:fill"] && m_styleProps["draw:fill"]->getStr() != "none")) && path.count())
+ if ((startX == x && startY == y) && path.count() && !wasMove)
{
WPXPropertyList closedPath;
closedPath.insert("libwpg:path-action", "Z");
@@ -489,15 +491,17 @@ void libvisio::VSDXContentCollector::_flushCurrentPath()
y = m_currentGeometry[i]["svg:y"]->getDouble();
startX = x;
startY = y;
+ wasMove = true;
}
else
{
x = m_currentGeometry[i]["svg:x"]->getDouble();
y = m_currentGeometry[i]["svg:y"]->getDouble();
+ wasMove = false;
}
path.append(m_currentGeometry[i]);
}
- if (((startX == x && startY == y) || (m_styleProps["draw:fill"] && m_styleProps["draw:fill"]->getStr() != "none")) && path.count())
+ if ((startX == x && startY == y) && path.count() && !wasMove)
{
WPXPropertyList closedPath;
closedPath.insert("libwpg:path-action", "Z");