summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2012-07-26 15:19:01 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-07-26 15:19:01 +0200
commit6c3dbc359f03eebe5f81d90a2f77cad295b14fe6 (patch)
tree3ad90584a149c9ba58c82e989e1a3f28823412ed
parent5b0560d780f8575376d89f6282d620eec9255a8c (diff)
Fixing fdo#50990
-rw-r--r--src/lib/VSDXParser.cpp14
-rw-r--r--src/lib/VSDXParser.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp
index 2db718f..66b172d 100644
--- a/src/lib/VSDXParser.cpp
+++ b/src/lib/VSDXParser.cpp
@@ -46,7 +46,8 @@ libvisio::VSDXParser::VSDXParser(WPXInputStream *input, libwpg::WPGPaintInterfac
m_geomListVector(), m_fieldList(), m_charList(new VSDXCharacterList()),
m_paraList(new VSDXParagraphList()), m_charListVector(), m_paraListVector(),
m_shapeList(), m_currentLevel(0), m_stencils(), m_currentStencil(0),
- m_stencilShape(), m_isStencilStarted(false), m_isInStyles(false), m_currentShapeLevel(0)
+ m_stencilShape(), m_isStencilStarted(false), m_isInStyles(false), m_currentShapeLevel(0),
+ m_currentShapeID((unsigned)-1)
{}
libvisio::VSDXParser::~VSDXParser()
@@ -213,6 +214,12 @@ void libvisio::VSDXParser::handleStream(const Pointer &ptr, unsigned idx, unsign
m_currentStencil = 0;
return;
#endif
+ case VSD_SHAPE_GROUP:
+ case VSD_SHAPE_GUIDE:
+ case VSD_SHAPE_SHAPE:
+ case VSD_SHAPE_FOREIGN:
+ m_currentShapeID = idx;
+ break;
default:
break;
}
@@ -984,6 +991,8 @@ void libvisio::VSDXParser::readPageProps(WPXInputStream *input)
void libvisio::VSDXParser::readShape(WPXInputStream *input)
{
+ if (m_header.id != (unsigned)-1)
+ m_currentShapeID = m_header.id;
m_currentShapeLevel = m_header.level;
input->seek(0x12, WPX_SEEK_CUR);
unsigned masterPage = readU32(input);
@@ -1003,7 +1012,8 @@ void libvisio::VSDXParser::readShape(WPXInputStream *input)
m_stencilShape.m_textStyleId = textStyle;
}
else
- m_collector->collectShape(m_header.id, m_header.level, masterPage, masterShape, lineStyle, fillStyle, textStyle);
+ m_collector->collectShape(m_currentShapeID, m_header.level, masterPage, masterShape, lineStyle, fillStyle, textStyle);
+ m_currentShapeID = (unsigned)-1;
}
void libvisio::VSDXParser::readNURBSTo(WPXInputStream *input)
diff --git a/src/lib/VSDXParser.h b/src/lib/VSDXParser.h
index 4093950..a863448 100644
--- a/src/lib/VSDXParser.h
+++ b/src/lib/VSDXParser.h
@@ -154,6 +154,7 @@ protected:
bool m_isStencilStarted;
bool m_isInStyles;
unsigned m_currentShapeLevel;
+ unsigned m_currentShapeID;
private:
VSDXParser();