[Libreoffice-commits] libvisio.git: src/lib
David Tardon
dtardon at redhat.com
Thu Dec 4 23:54:05 PST 2014
src/lib/VSDParser.cpp | 14 +-------------
src/lib/VSDParser.h | 4 ----
2 files changed, 1 insertion(+), 17 deletions(-)
New commits:
commit 25a2ba5fc9551f736192c3cca092aad69a98db09
Author: David Tardon <dtardon at redhat.com>
Date: Fri Dec 5 08:50:10 2014 +0100
Revert "avoid infinite recursion when reading a broken file"
Streams can legitimately be read more than once. (In ideal world, we
would keep the parsed data and just reuse it if/when the same stream
pointer was encountered again, instead of parsing it repeatedly. There
is a room for future improvement there :-)
This reverts commit 770e649b1b30e2b43e62d00ed06b4ff33f8305e0.
diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
index 65702b4..388e84d 100644
--- a/src/lib/VSDParser.cpp
+++ b/src/lib/VSDParser.cpp
@@ -27,7 +27,7 @@ libvisio::VSDParser::VSDParser(librevenge::RVNGInputStream *input, librevenge::R
m_currentShapeLevel(0), m_currentShapeID(MINUS_ONE), m_extractStencils(false), m_colours(),
m_isBackgroundPage(false), m_isShapeStarted(false), m_shadowOffsetX(0.0), m_shadowOffsetY(0.0),
m_currentGeometryList(0), m_currentGeomListCount(0), m_fonts(), m_names(), m_namesMapMap(),
- m_currentPageName(), m_handledStreams()
+ m_currentPageName()
{}
libvisio::VSDParser::~VSDParser()
@@ -113,7 +113,6 @@ bool libvisio::VSDParser::parseMain()
Pointer trailerPointer;
readPointer(m_input, trailerPointer);
- m_handledStreams.insert(trailerPointer.Offset);
bool compressed = ((trailerPointer.Format & 2) == 2);
unsigned shift = 0;
if (compressed)
@@ -133,8 +132,6 @@ bool libvisio::VSDParser::parseMain()
return false;
_handleLevelChange(0);
- m_handledStreams.clear();
- m_handledStreams.insert(trailerPointer.Offset);
VSDStyles styles = stylesCollector.getStyleSheets();
@@ -232,15 +229,6 @@ void libvisio::VSDParser::handleStreams(librevenge::RVNGInputStream *input, unsi
if (ptr.Type == 0)
continue;
- std::set<unsigned>::iterator it = m_handledStreams.find(ptr.Offset);
- if (it != m_handledStreams.end())
- {
- VSD_DEBUG_MSG(("Stream at offset %d has already been handled. Skipping...\n", ptr.Offset));
- continue;
- }
-
- m_handledStreams.insert(it, ptr.Offset);
-
if (ptr.Type == VSD_FONTFACES)
FontFaces[i] = ptr;
else if (ptr.Type == VSD_NAME_LIST2)
diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h
index e8da164..2df8547 100644
--- a/src/lib/VSDParser.h
+++ b/src/lib/VSDParser.h
@@ -12,7 +12,6 @@
#include <stdio.h>
#include <iostream>
-#include <set>
#include <vector>
#include <stack>
#include <map>
@@ -168,9 +167,6 @@ protected:
std::map<unsigned, std::map<unsigned, VSDName> > m_namesMapMap;
VSDName m_currentPageName;
- // Sanity check, to avoid problems with broken files.
- std::set<unsigned> m_handledStreams;
-
private:
VSDParser();
VSDParser(const VSDParser &);
More information about the Libreoffice-commits
mailing list