diff options
author | David Tardon <dtardon@redhat.com> | 2015-07-14 18:39:28 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-07-14 18:42:59 +0200 |
commit | c2eb5794e865efa74fbf1c6be8ed9fadae137d85 (patch) | |
tree | 7a4da91b601d255ee64c3be09bbfad7cc5ccf6d8 /src/lib | |
parent | 5e0cf3b1972fa26d28209a828933d2a6f95b49b1 (diff) |
ignore errors when parsing metadata
Change-Id: I5780e7c95655766eb821045de70ed426eaa35be0
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/VSDParser.cpp | 15 | ||||
-rw-r--r-- | src/lib/VSDParser.h | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp index 5da88c7..9e75485 100644 --- a/src/lib/VSDParser.cpp +++ b/src/lib/VSDParser.cpp @@ -147,20 +147,18 @@ bool libvisio::VSDParser::parseMain() return true; } -bool libvisio::VSDParser::parseMetaData() +void libvisio::VSDParser::parseMetaData() try { if (!m_container) - return false; + return; m_container->seek(0, librevenge::RVNG_SEEK_SET); if (!m_container->isStructured()) - return false; - bool result = false; + return; VSDMetaData metaData; librevenge::RVNGInputStream *sumaryInfo = m_container->getSubStreamByName("\x05SummaryInformation"); if (sumaryInfo) { - result = true; metaData.parse(sumaryInfo); delete sumaryInfo; } @@ -168,7 +166,6 @@ bool libvisio::VSDParser::parseMetaData() librevenge::RVNGInputStream *docSumaryInfo = m_container->getSubStreamByName("\005DocumentSummaryInformation"); if (docSumaryInfo) { - result = true; metaData.parse(docSumaryInfo); delete docSumaryInfo; } @@ -176,8 +173,10 @@ bool libvisio::VSDParser::parseMetaData() m_container->seek(0, librevenge::RVNG_SEEK_SET); metaData.parseTimes(m_container); m_collector->collectMetaData(metaData.getMetaData()); - - return result; +} +catch (...) +{ + // Ignore any exceptions in metadata. They are not important enough to stop parsing. } bool libvisio::VSDParser::parseDocument(librevenge::RVNGInputStream *input, unsigned shift) diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h index 2df8547..b42c57d 100644 --- a/src/lib/VSDParser.h +++ b/src/lib/VSDParser.h @@ -114,7 +114,7 @@ protected: // parser of one pass bool parseDocument(librevenge::RVNGInputStream *input, unsigned shift); - bool parseMetaData(); + void parseMetaData(); // Stream handlers void handleStreams(librevenge::RVNGInputStream *input, unsigned ptrType, unsigned shift, unsigned level); |