summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/VSDContentCollector.cpp12
-rw-r--r--src/lib/VSDContentCollector.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index 1e59e86..d6f03ba 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -53,7 +53,7 @@ libvisio::VSDContentCollector::VSDContentCollector(
m_currentPageNumber(0), m_shapeOutputDrawing(0), m_shapeOutputText(0),
m_pageOutputDrawing(), m_pageOutputText(), m_documentPageShapeOrders(documentPageShapeOrders),
m_pageShapeOrder(m_documentPageShapeOrders.begin()), m_isFirstGeometry(true), m_NURBSData(), m_polylineData(),
- m_textStream(), m_names(), m_stencilNames(), m_fields(), m_stencilFields(), m_fieldIndex(0),
+ m_textStream(), m_currentText(), m_names(), m_stencilNames(), m_fields(), m_stencilFields(), m_fieldIndex(0),
m_textFormat(VSD_TEXT_ANSI), m_charFormats(), m_paraFormats(), m_lineStyle(), m_fillStyle(), m_textBlockStyle(),
m_themeReference(), m_defaultCharStyle(), m_defaultParaStyle(), m_currentStyleSheet(0), m_styles(styles),
m_stencils(stencils), m_stencilShape(0), m_isStencilStarted(false), m_currentGeometryCount(0),
@@ -2097,9 +2097,6 @@ void libvisio::VSDContentCollector::collectShape(unsigned id, unsigned level, un
_handleForeignData(m_stencilShape->m_foreign->data);
}
- // m_textStream = m_stencilShape->m_text;
- // m_textFormat = m_stencilShape->m_textFormat;
-
for (std::map< unsigned, VSDName>::const_iterator iterData = m_stencilShape->m_names.begin(); iterData != m_stencilShape->m_names.end(); ++iterData)
{
librevenge::RVNGString nameString;
@@ -2206,6 +2203,13 @@ void libvisio::VSDContentCollector::collectText(unsigned level, const librevenge
m_textStream = textStream;
m_textFormat = format;
+ m_currentText.clear();
+ if (!m_textStream.empty())
+ {
+ std::vector<unsigned char> tmpBuffer(textStream.size());
+ memcpy(&tmpBuffer[0], textStream.getDataBuffer(), textStream.size());
+ appendCharacters(m_currentText, tmpBuffer, format);
+ }
}
void libvisio::VSDContentCollector::collectParaIX(unsigned /* id */ , unsigned level, unsigned charCount, const boost::optional<double> &indFirst,
diff --git a/src/lib/VSDContentCollector.h b/src/lib/VSDContentCollector.h
index 67decfb..d9a7796 100644
--- a/src/lib/VSDContentCollector.h
+++ b/src/lib/VSDContentCollector.h
@@ -273,6 +273,7 @@ private:
std::map<unsigned, NURBSData> m_NURBSData;
std::map<unsigned, PolylineData> m_polylineData;
librevenge::RVNGBinaryData m_textStream;
+ librevenge::RVNGString m_currentText;
std::map<unsigned, librevenge::RVNGString> m_names, m_stencilNames;
std::vector<librevenge::RVNGString> m_fields;
VSDFieldList m_stencilFields;