summaryrefslogtreecommitdiff
path: root/external/libvisio
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2015-01-02 17:22:38 +0100
committerDavid Tardon <dtardon@redhat.com>2015-01-02 17:23:40 +0100
commit6d3826588ac66c77555cc1c66bd6c6a8426a659d (patch)
treeb411269958b86116975d06a51c77b083bd8e8877 /external/libvisio
parent4cf326dd43cb7a39deae02a475423b161cd589c4 (diff)
upload libvisio 0.1.1
Change-Id: I6587bd27d07ae39074d3c304614e3bc831afe8c8
Diffstat (limited to 'external/libvisio')
-rw-r--r--external/libvisio/UnpackedTarball_libvisio.mk6
-rw-r--r--external/libvisio/libvisio_quote.patch.111
-rw-r--r--external/libvisio/vsd-metadata.patch.1651
-rw-r--r--external/libvisio/vsdx-metadata.patch.1500
4 files changed, 0 insertions, 1168 deletions
diff --git a/external/libvisio/UnpackedTarball_libvisio.mk b/external/libvisio/UnpackedTarball_libvisio.mk
index dddf0b7ceeec..e4c0561f72f8 100644
--- a/external/libvisio/UnpackedTarball_libvisio.mk
+++ b/external/libvisio/UnpackedTarball_libvisio.mk
@@ -11,10 +11,4 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libvisio))
$(eval $(call gb_UnpackedTarball_set_tarball,libvisio,$(VISIO_TARBALL)))
-$(eval $(call gb_UnpackedTarball_add_patches,libvisio,\
- external/libvisio/libvisio_quote.patch.1 \
- external/libvisio/vsdx-metadata.patch.1 \
- external/libvisio/vsd-metadata.patch.1 \
-))
-
# vim: set noet sw=4 ts=4:
diff --git a/external/libvisio/libvisio_quote.patch.1 b/external/libvisio/libvisio_quote.patch.1
deleted file mode 100644
index ec3cc1ee817a..000000000000
--- a/external/libvisio/libvisio_quote.patch.1
+++ /dev/null
@@ -1,11 +0,0 @@
---- libvisio/src/lib/Makefile.in.orig 2014-06-01 22:54:30.212400000 +0200
-+++ libvisio/src/lib/Makefile.in 2014-06-01 22:54:34.112400000 +0200
-@@ -776,7 +776,7 @@
-
- $(top_builddir)/src/lib/tokenhash.h : $(top_builddir)/src/lib/tokens.gperf
- $(GPERF) --compare-strncmp -C -m 20 $(top_builddir)/src/lib/tokens.gperf \
-- | $(SED) -e "s/(char\*)0/(char\*)0, 0/g" > $(top_builddir)/src/lib/tokenhash.h
-+ | $(SED) -e 's/(char\*)0/(char\*)0, 0/g' > $(top_builddir)/src/lib/tokenhash.h
-
- $(top_builddir)/src/lib/tokens.gperf : $(top_srcdir)/src/lib/tokens.txt gentoken.pl
- perl $(top_srcdir)/src/lib/gentoken.pl $(top_srcdir)/src/lib/tokens.txt \
diff --git a/external/libvisio/vsd-metadata.patch.1 b/external/libvisio/vsd-metadata.patch.1
deleted file mode 100644
index 1704bad7c099..000000000000
--- a/external/libvisio/vsd-metadata.patch.1
+++ /dev/null
@@ -1,651 +0,0 @@
-commit a7f7ccbd4089965511dc59c3ae7869b360c8ca9f
-Author: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Tue Dec 2 17:05:23 2014 +0100
-
- Move _appendUCS4() to libvisio_utils
-
-diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
-index 822a5f4..083fd91 100644
---- a/src/lib/VSDContentCollector.cpp
-+++ b/src/lib/VSDContentCollector.cpp
-@@ -11,7 +11,6 @@
- #include <stack>
- #include <boost/spirit/include/classic.hpp>
- #include <unicode/ucnv.h>
--#include <unicode/utypes.h>
- #include <unicode/utf8.h>
-
- #include "VSDContentCollector.h"
-@@ -33,27 +32,6 @@ static unsigned bitmapId = 0;
-
- #define SURROGATE_VALUE(h,l) (((h) - 0xd800) * 0x400 + (l) - 0xdc00 + 0x10000)
-
--namespace
--{
--
--static void _appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character)
--{
-- // Convert carriage returns to new line characters
-- // Writerperfect/LibreOffice will replace them by <text:line-break>
-- if (ucs4Character == (UChar32) 0x0d || ucs4Character == (UChar32) 0x0e)
-- ucs4Character = (UChar32) '\n';
--
-- unsigned char outbuf[U8_MAX_LENGTH+1];
-- int i = 0;
-- U8_APPEND_UNSAFE(&outbuf[0], i, ucs4Character);
-- outbuf[i] = 0;
--
-- text.append((char *)outbuf);
--}
--
--} // anonymous namespace
--
--
- libvisio::VSDContentCollector::VSDContentCollector(
- librevenge::RVNGDrawingInterface *painter,
- std::vector<std::map<unsigned, XForm> > &groupXFormsSequence,
-@@ -2870,7 +2848,7 @@ void libvisio::VSDContentCollector::appendCharacters(librevenge::RVNGString &tex
- ucs4Character = 0x20;
- else
- ucs4Character = symbolmap[*iter - 0x20];
-- _appendUCS4(text, ucs4Character);
-+ appendUCS4(text, ucs4Character);
- }
- }
- else
-@@ -2934,7 +2912,7 @@ void libvisio::VSDContentCollector::appendCharacters(librevenge::RVNGString &tex
- if (0x1e == ucs4Character)
- _appendField(text);
- else
-- _appendUCS4(text, ucs4Character);
-+ appendUCS4(text, ucs4Character);
- }
- }
- }
-@@ -2960,7 +2938,7 @@ void libvisio::VSDContentCollector::appendCharacters(librevenge::RVNGString &tex
- if (0xfffc == ucs4Character)
- _appendField(text);
- else
-- _appendUCS4(text, ucs4Character);
-+ appendUCS4(text, ucs4Character);
- }
- }
- }
-diff --git a/src/lib/libvisio_utils.cpp b/src/lib/libvisio_utils.cpp
-index b137e24..e622417 100644
---- a/src/lib/libvisio_utils.cpp
-+++ b/src/lib/libvisio_utils.cpp
-@@ -107,6 +107,20 @@ const librevenge::RVNGString libvisio::getColourString(const Colour &c)
- return sColour;
- }
-
-+void libvisio::appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character)
-+{
-+ // Convert carriage returns to new line characters
-+ // Writerperfect/LibreOffice will replace them by <text:line-break>
-+ if (ucs4Character == (UChar32) 0x0d || ucs4Character == (UChar32) 0x0e)
-+ ucs4Character = (UChar32) '\n';
-+
-+ unsigned char outbuf[U8_MAX_LENGTH+1];
-+ int i = 0;
-+ U8_APPEND_UNSAFE(&outbuf[0], i, ucs4Character);
-+ outbuf[i] = 0;
-+
-+ text.append((char *)outbuf);
-+}
-
-
- /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
-diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h
-index 08ebb04..60be13f 100644
---- a/src/lib/libvisio_utils.h
-+++ b/src/lib/libvisio_utils.h
-@@ -47,6 +47,7 @@ typedef unsigned __int64 uint64_t;
-
- #include <librevenge/librevenge.h>
- #include <librevenge-stream/librevenge-stream.h>
-+#include <unicode/utypes.h>
-
- // debug message includes source file and line number
- //#define VERBOSE_DEBUG 1
-@@ -79,6 +80,8 @@ double readDouble(librevenge::RVNGInputStream *input);
-
- const librevenge::RVNGString getColourString(const Colour &c);
-
-+void appendUCS4(librevenge::RVNGString &text, UChar32 ucs4Character);
-+
- class EndOfStreamException
- {
- };
-commit 005b45ddf64a8320a0143336d431a016507d2085
-Author: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Tue Dec 2 17:01:35 2014 +0100
-
- fdo#86729 VSD: import metadata
-
- Only title as a start.
-
-diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
-index 955aac4..f4d86fa 100644
---- a/src/lib/Makefile.am
-+++ b/src/lib/Makefile.am
-@@ -39,6 +39,7 @@ libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_SOURCES = \
- VSDPages.cpp \
- VSDParagraphList.cpp \
- VSDParser.cpp \
-+ VSDMetaData.cpp \
- VSDShapeList.cpp \
- VSDStencils.cpp \
- VSDStyles.cpp \
-@@ -58,6 +59,7 @@ libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_SOURCES = \
- VSDPages.h \
- VSDParagraphList.h \
- VSDParser.h \
-+ VSDMetaData.h \
- VSDShapeList.h \
- VSDStencils.h \
- VSDStyles.h \
-diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
-index a51ac14..0f8dd91 100644
---- a/src/lib/Makefile.in
-+++ b/src/lib/Makefile.in
-@@ -131,10 +131,10 @@ am_libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_OBJECTS = \
- VSDInternalStream.lo VSDCharacterList.lo \
- VSDContentCollector.lo VSDFieldList.lo VSDGeometryList.lo \
- VSDOutputElementList.lo VSDPages.lo VSDParagraphList.lo \
-- VSDParser.lo VSDShapeList.lo VSDStencils.lo VSDStyles.lo \
-- VSDStylesCollector.lo VSDXMLHelper.lo VDXParser.lo \
-- VSDXMLParserBase.lo VSDXMLTokenMap.lo VSDXParser.lo \
-- VSDXTheme.lo VSDXMetaData.lo $(am__objects_1)
-+ VSDParser.lo VSDMetaData.lo VSDShapeList.lo VSDStencils.lo \
-+ VSDStyles.lo VSDStylesCollector.lo VSDXMLHelper.lo \
-+ VDXParser.lo VSDXMLParserBase.lo VSDXMLTokenMap.lo \
-+ VSDXParser.lo VSDXTheme.lo VSDXMetaData.lo $(am__objects_1)
- libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_OBJECTS = $(am_libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_OBJECTS)
- AM_V_lt = $(am__v_lt_@AM_V@)
- am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-@@ -400,6 +400,7 @@ libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_SOURCES = \
- VSDPages.cpp \
- VSDParagraphList.cpp \
- VSDParser.cpp \
-+ VSDMetaData.cpp \
- VSDShapeList.cpp \
- VSDStencils.cpp \
- VSDStyles.cpp \
-@@ -419,6 +420,7 @@ libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_SOURCES = \
- VSDPages.h \
- VSDParagraphList.h \
- VSDParser.h \
-+ VSDMetaData.h \
- VSDShapeList.h \
- VSDStencils.h \
- VSDStyles.h \
-@@ -539,6 +541,7 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDFieldList.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDGeometryList.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDInternalStream.Plo@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDMetaData.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDOutputElementList.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDPages.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDParagraphList.Plo@am__quote@
-diff --git a/src/lib/VSDMetaData.cpp b/src/lib/VSDMetaData.cpp
-new file mode 100644
-index 0000000..209cc34
---- /dev/null
-+++ b/src/lib/VSDMetaData.cpp
-@@ -0,0 +1,180 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/*
-+ * This file is part of the libvisio project.
-+ *
-+ * This Source Code Form is subject to the terms of the Mozilla Public
-+ * License, v. 2.0. If a copy of the MPL was not distributed with this
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+ */
-+
-+#include "VSDMetaData.h"
-+#include <unicode/ucnv.h>
-+
-+libvisio::VSDMetaData::VSDMetaData()
-+{
-+}
-+
-+libvisio::VSDMetaData::~VSDMetaData()
-+{
-+}
-+
-+bool libvisio::VSDMetaData::parse(librevenge::RVNGInputStream *input)
-+{
-+ if (!input)
-+ return false;
-+
-+ readPropertySetStream(input);
-+
-+ return true;
-+}
-+
-+void libvisio::VSDMetaData::readPropertySetStream(librevenge::RVNGInputStream *input)
-+{
-+ // ByteOrder
-+ input->seek(2, librevenge::RVNG_SEEK_CUR);
-+ // Version
-+ input->seek(2, librevenge::RVNG_SEEK_CUR);
-+ // SystemIdentifier
-+ input->seek(4, librevenge::RVNG_SEEK_CUR);
-+ // CLSID
-+ input->seek(16, librevenge::RVNG_SEEK_CUR);
-+ // NumPropertySets
-+ input->seek(4, librevenge::RVNG_SEEK_CUR);
-+ // FMTID0
-+ input->seek(16, librevenge::RVNG_SEEK_CUR);
-+ uint32_t offset0 = readU32(input);
-+ readPropertySet(input, offset0);
-+}
-+
-+void libvisio::VSDMetaData::readPropertySet(librevenge::RVNGInputStream *input, uint32_t offset)
-+{
-+ input->seek(offset, librevenge::RVNG_SEEK_SET);
-+
-+ // Size
-+ input->seek(4, librevenge::RVNG_SEEK_CUR);
-+ uint32_t numProperties = readU32(input);
-+ for (uint32_t i = 0; i < numProperties; ++i)
-+ readPropertyIdentifierAndOffset(input);
-+ for (uint32_t i = 0; i < numProperties; ++i)
-+ {
-+ if (i >= m_idsAndOffsets.size())
-+ break;
-+ readTypedPropertyValue(input, i, offset + m_idsAndOffsets[i].second);
-+ }
-+}
-+
-+#define CODEPAGE_PROPERTY_IDENTIFIER 0x00000001
-+
-+uint32_t libvisio::VSDMetaData::getCodePage()
-+{
-+ for (size_t i = 0; i < m_idsAndOffsets.size(); ++i)
-+ {
-+ if (m_idsAndOffsets[i].first == CODEPAGE_PROPERTY_IDENTIFIER)
-+ {
-+ if (i >= m_typedPropertyValues.size())
-+ break;
-+ return m_typedPropertyValues[i];
-+ }
-+ }
-+
-+ return 0;
-+}
-+
-+void libvisio::VSDMetaData::readPropertyIdentifierAndOffset(librevenge::RVNGInputStream *input)
-+{
-+ uint32_t propertyIdentifier = readU32(input);
-+ uint32_t offset = readU32(input);
-+ m_idsAndOffsets.push_back(std::make_pair(propertyIdentifier, offset));
-+}
-+
-+#define VT_I2 0x0002
-+#define VT_LPSTR 0x001E
-+
-+#define PIDSI_TITLE 0x00000002
-+
-+void libvisio::VSDMetaData::readTypedPropertyValue(librevenge::RVNGInputStream *input, uint32_t index, uint32_t offset)
-+{
-+ input->seek(offset, librevenge::RVNG_SEEK_SET);
-+ uint16_t type = readU16(input);
-+ // Padding
-+ input->seek(2, librevenge::RVNG_SEEK_CUR);
-+
-+ if (type == VT_I2)
-+ {
-+ uint16_t value = readU16(input);
-+ m_typedPropertyValues[index] = value;
-+ }
-+ else if (type == VT_LPSTR)
-+ {
-+ librevenge::RVNGString string = readCodePageString(input);
-+ if (!string.empty())
-+ {
-+ if (index >= m_idsAndOffsets.size())
-+ return;
-+
-+ switch (m_idsAndOffsets[index].first)
-+ {
-+ case PIDSI_TITLE:
-+ m_metaData.insert("dc:title", string);
-+ break;
-+ }
-+ }
-+ }
-+}
-+
-+librevenge::RVNGString libvisio::VSDMetaData::readCodePageString(librevenge::RVNGInputStream *input)
-+{
-+ uint32_t size = readU32(input);
-+
-+ std::vector<unsigned char> characters;
-+ for (uint32_t i = 0; i < size; ++i)
-+ characters.push_back(readU8(input));
-+
-+ uint32_t codepage = getCodePage();
-+ librevenge::RVNGString string;
-+
-+ if (codepage == 65001)
-+ {
-+ // http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130%28v=vs.85%29.aspx
-+ // says this is UTF-8.
-+ for (std::vector<unsigned char>::const_iterator i = characters.begin(); i != characters.end(); ++i)
-+ string.append((const char)*i);
-+ }
-+ else
-+ {
-+ UErrorCode status = U_ZERO_ERROR;
-+ UConverter *conv = 0;
-+
-+ switch (codepage)
-+ {
-+ case 1252:
-+ // http://msdn.microsoft.com/en-us/goglobal/bb964654
-+ conv = ucnv_open("windows-1252", &status);
-+ break;
-+ }
-+
-+ if (U_SUCCESS(status) && conv)
-+ {
-+ const char *src = (const char *)&characters[0];
-+ const char *srcLimit = (const char *)src + characters.size();
-+ while (src < srcLimit)
-+ {
-+ UChar32 ucs4Character = ucnv_getNextUChar(conv, &src, srcLimit, &status);
-+ if (U_SUCCESS(status) && U_IS_UNICODE_CHAR(ucs4Character))
-+ appendUCS4(string, ucs4Character);
-+ }
-+ }
-+
-+ if (conv)
-+ ucnv_close(conv);
-+ }
-+
-+ return string;
-+}
-+
-+const librevenge::RVNGPropertyList &libvisio::VSDMetaData::getMetaData()
-+{
-+ return m_metaData;
-+}
-+
-+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
-diff --git a/src/lib/VSDMetaData.h b/src/lib/VSDMetaData.h
-new file mode 100644
-index 0000000..c185894
---- /dev/null
-+++ b/src/lib/VSDMetaData.h
-@@ -0,0 +1,51 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/*
-+ * This file is part of the libvisio project.
-+ *
-+ * This Source Code Form is subject to the terms of the Mozilla Public
-+ * License, v. 2.0. If a copy of the MPL was not distributed with this
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+ */
-+
-+#ifndef __VSDMETADATA_H__
-+#define __VSDMETADATA_H__
-+
-+#include <vector>
-+#include <utility>
-+#include <map>
-+#include <librevenge-stream/librevenge-stream.h>
-+#include <librevenge/librevenge.h>
-+#include "libvisio_utils.h"
-+
-+namespace libvisio
-+{
-+
-+class VSDMetaData
-+{
-+public:
-+ VSDMetaData();
-+ ~VSDMetaData();
-+ bool parse(librevenge::RVNGInputStream *input);
-+ const librevenge::RVNGPropertyList &getMetaData();
-+
-+private:
-+ VSDMetaData(const VSDMetaData &);
-+ VSDMetaData &operator=(const VSDMetaData &);
-+
-+ void readPropertySetStream(librevenge::RVNGInputStream *input);
-+ void readPropertySet(librevenge::RVNGInputStream *input, uint32_t offset);
-+ void readPropertyIdentifierAndOffset(librevenge::RVNGInputStream *input);
-+ void readTypedPropertyValue(librevenge::RVNGInputStream *input, uint32_t index, uint32_t offset);
-+ librevenge::RVNGString readCodePageString(librevenge::RVNGInputStream *input);
-+
-+ uint32_t getCodePage();
-+
-+ std::vector< std::pair<uint32_t, uint32_t> > m_idsAndOffsets;
-+ std::map<uint16_t, uint16_t> m_typedPropertyValues;
-+ librevenge::RVNGPropertyList m_metaData;
-+};
-+
-+} // namespace libvisio
-+
-+#endif // __VSDMETADATA_H__
-+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
-diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
-index 1b8133f..9d6e175 100644
---- a/src/lib/VSDParser.cpp
-+++ b/src/lib/VSDParser.cpp
-@@ -19,9 +19,10 @@
- #include "VSDDocumentStructure.h"
- #include "VSDContentCollector.h"
- #include "VSDStylesCollector.h"
-+#include "VSDMetaData.h"
-
--libvisio::VSDParser::VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
-- : m_input(input), m_painter(painter), m_header(), m_collector(0), m_shapeList(), m_currentLevel(0),
-+libvisio::VSDParser::VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter, librevenge::RVNGInputStream *container)
-+ : m_input(input), m_painter(painter), m_container(container), m_header(), m_collector(0), m_shapeList(), m_currentLevel(0),
- m_stencils(), m_currentStencil(0), m_shape(), m_isStencilStarted(false), m_isInStyles(false),
- 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),
-@@ -136,6 +137,9 @@ bool libvisio::VSDParser::parseMain()
-
- VSDContentCollector contentCollector(m_painter, groupXFormsSequence, groupMembershipsSequence, documentPageShapeOrders, styles, m_stencils);
- m_collector = &contentCollector;
-+ if (m_container)
-+ parseMetaData();
-+
- VSD_DEBUG_MSG(("VSDParser::parseMain 2nd pass\n"));
- if (!parseDocument(&trailerStream, shift))
- return false;
-@@ -143,6 +147,25 @@ bool libvisio::VSDParser::parseMain()
- return true;
- }
-
-+bool libvisio::VSDParser::parseMetaData()
-+{
-+ if (!m_container)
-+ return false;
-+ m_container->seek(0, librevenge::RVNG_SEEK_SET);
-+ if (!m_container->isStructured())
-+ return false;
-+ librevenge::RVNGInputStream *stream = m_container->getSubStreamByName("\x05SummaryInformation");
-+ if (!stream)
-+ return false;
-+
-+ VSDMetaData metaData;
-+ metaData.parse(stream);
-+ m_collector->collectMetaData(metaData.getMetaData());
-+
-+ delete stream;
-+ return true;
-+}
-+
- bool libvisio::VSDParser::parseDocument(librevenge::RVNGInputStream *input, unsigned shift)
- {
- try
-diff --git a/src/lib/VSDParser.h b/src/lib/VSDParser.h
-index aabb0db..b2bba54 100644
---- a/src/lib/VSDParser.h
-+++ b/src/lib/VSDParser.h
-@@ -45,7 +45,7 @@ struct Pointer
- class VSDParser
- {
- public:
-- explicit VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
-+ explicit VSDParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter, librevenge::RVNGInputStream *container = 0);
- virtual ~VSDParser();
- bool parseMain();
- bool extractStencils();
-@@ -113,6 +113,8 @@ protected:
- // parser of one pass
- bool parseDocument(librevenge::RVNGInputStream *input, unsigned shift);
-
-+ bool parseMetaData();
-+
- // Stream handlers
- void handleStreams(librevenge::RVNGInputStream *input, unsigned ptrType, unsigned shift, unsigned level);
- void handleStream(const Pointer &ptr, unsigned idx, unsigned level);
-@@ -133,6 +135,7 @@ protected:
-
- librevenge::RVNGInputStream *m_input;
- librevenge::RVNGDrawingInterface *m_painter;
-+ librevenge::RVNGInputStream *m_container;
- ChunkHeader m_header;
- VSDCollector *m_collector;
- VSDShapeList m_shapeList;
-diff --git a/src/lib/VisioDocument.cpp b/src/lib/VisioDocument.cpp
-index be14b68..f834478 100644
---- a/src/lib/VisioDocument.cpp
-+++ b/src/lib/VisioDocument.cpp
-@@ -158,7 +158,7 @@ static bool parseBinaryVisioDocument(librevenge::RVNGInputStream *input, libreve
- parser = new libvisio::VSD6Parser(docStream, painter);
- break;
- case 11:
-- parser = new libvisio::VSDParser(docStream, painter);
-+ parser = new libvisio::VSDParser(docStream, painter, input);
- break;
- default:
- break;
-commit 2e467f4e487bd8fd8440057e1d79f89b2a966419
-Author: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Tue Dec 2 17:02:14 2014 +0100
-
- fdo#86664 VSD: import Creation/ModifiedTime
-
-diff --git a/src/lib/VSDMetaData.cpp b/src/lib/VSDMetaData.cpp
-index 209cc34..3fd5bf9 100644
---- a/src/lib/VSDMetaData.cpp
-+++ b/src/lib/VSDMetaData.cpp
-@@ -8,6 +8,7 @@
- */
-
- #include "VSDMetaData.h"
-+#include <cmath>
- #include <unicode/ucnv.h>
-
- libvisio::VSDMetaData::VSDMetaData()
-@@ -172,6 +173,58 @@ librevenge::RVNGString libvisio::VSDMetaData::readCodePageString(librevenge::RVN
- return string;
- }
-
-+bool libvisio::VSDMetaData::parseTimes(librevenge::RVNGInputStream *input)
-+{
-+ // Parse the header
-+ // HeaderSignature: 8 bytes
-+ // HeaderCLSID: 16 bytes
-+ // MinorVersion: 2 bytes
-+ // MajorVersion: 2 bytes
-+ // ByteOrder: 2 bytes
-+ input->seek(30, librevenge::RVNG_SEEK_CUR);
-+ uint16_t sectorShift = readU16(input);
-+ // MiniSectorShift: 2 bytes
-+ // Reserved: 6 bytes
-+ // NumDirectorySectors: 4 bytes
-+ // NumFATSectors: 4 bytes
-+ input->seek(16, librevenge::RVNG_SEEK_CUR);
-+ uint32_t firstDirSectorLocation = readU32(input);
-+
-+ // Seek to the Root Directory Entry
-+ size_t sectorSize = pow(2, sectorShift);
-+ input->seek((firstDirSectorLocation + 1) * sectorSize, librevenge::RVNG_SEEK_SET);
-+ // DirectoryEntryName: 64 bytes
-+ // DirectoryEntryNameLength: 2 bytes
-+ // ObjectType: 1 byte
-+ // ColorFlag: 1 byte
-+ // LeftSiblingID: 4 bytes
-+ // RightSiblingID: 4 bytes
-+ // ChildID: 4 bytes
-+ // CLSID: 16 bytes
-+ // StateBits: 4 bytes
-+ // CreationTime: 8 bytes
-+ input->seek(108, librevenge::RVNG_SEEK_CUR);
-+ uint64_t modifiedTime = readU64(input);
-+
-+ // modifiedTime is number of 100ns since Jan 1 1601
-+ static const uint64_t epoch = 11644473600;
-+ time_t sec = (modifiedTime / 10000000) - epoch;
-+ const struct tm *time = localtime(&sec);
-+ if (time)
-+ {
-+ static const int MAX_BUFFER = 1024;
-+ char buffer[MAX_BUFFER];
-+ strftime(&buffer[0], MAX_BUFFER-1, "%Y-%m-%dT%H:%M:%SZ", time);
-+ librevenge::RVNGString result;
-+ result.append(buffer);
-+ // Visio UI uses modifiedTime for both purposes.
-+ m_metaData.insert("meta:creation-date", result);
-+ m_metaData.insert("dc:date", result);
-+ return true;
-+ }
-+ return false;
-+}
-+
- const librevenge::RVNGPropertyList &libvisio::VSDMetaData::getMetaData()
- {
- return m_metaData;
-diff --git a/src/lib/VSDMetaData.h b/src/lib/VSDMetaData.h
-index c185894..581b0a2 100644
---- a/src/lib/VSDMetaData.h
-+++ b/src/lib/VSDMetaData.h
-@@ -26,6 +26,7 @@ public:
- VSDMetaData();
- ~VSDMetaData();
- bool parse(librevenge::RVNGInputStream *input);
-+ bool parseTimes(librevenge::RVNGInputStream *input);
- const librevenge::RVNGPropertyList &getMetaData();
-
- private:
-diff --git a/src/lib/VSDParser.cpp b/src/lib/VSDParser.cpp
-index 9d6e175..3af5bd0 100644
---- a/src/lib/VSDParser.cpp
-+++ b/src/lib/VSDParser.cpp
-@@ -160,6 +160,8 @@ bool libvisio::VSDParser::parseMetaData()
-
- VSDMetaData metaData;
- metaData.parse(stream);
-+ m_container->seek(0, librevenge::RVNG_SEEK_SET);
-+ metaData.parseTimes(m_container);
- m_collector->collectMetaData(metaData.getMetaData());
-
- delete stream;
-commit 89ccb97fedc69e4508581ddcd93c9ea6740855c1
-Author: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Tue Dec 2 18:50:16 2014 +0100
-
- error C3861: ´localtime´: identifier not found
-
- Change-Id: Ic0ccfc0b6cdd030772d09e7d235c63d440ba2f1b
-
-diff --git a/src/lib/VSDMetaData.cpp b/src/lib/VSDMetaData.cpp
-index 3fd5bf9..61f01a9 100644
---- a/src/lib/VSDMetaData.cpp
-+++ b/src/lib/VSDMetaData.cpp
-@@ -10,6 +10,7 @@
- #include "VSDMetaData.h"
- #include <cmath>
- #include <unicode/ucnv.h>
-+#include <ctime>
-
- libvisio::VSDMetaData::VSDMetaData()
- {
diff --git a/external/libvisio/vsdx-metadata.patch.1 b/external/libvisio/vsdx-metadata.patch.1
deleted file mode 100644
index f2bdedddf486..000000000000
--- a/external/libvisio/vsdx-metadata.patch.1
+++ /dev/null
@@ -1,500 +0,0 @@
-commit 1b1fd1b07728590c94694b4e8b1b00058ca02d52
-Author: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Tue Nov 25 09:49:05 2014 +0100
-
- fdo#86664 VSDX: import metadata
-
- Only title as a start.
-
- Change-Id: Id1b92992c75058f99b9c0c72d53c254110917ed7
- Reviewed-on: https://gerrit.libreoffice.org/13108
- Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
- Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-
-diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
-index 6080d31..955aac4 100644
---- a/src/lib/Makefile.am
-+++ b/src/lib/Makefile.am
-@@ -75,6 +75,8 @@ libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_SOURCES = \
- VSDXParser.h \
- VSDXTheme.cpp \
- VSDXTheme.h \
-+ VSDXMetaData.cpp \
-+ VSDXMetaData.h \
- $(generated_files)
-
-
-@@ -83,6 +85,7 @@ VSDXMLParserBase.lo : $(generated_files)
- VSDXMLTokenMap.lo : $(generated_files)
- VSDXParser.lo : $(generated_files)
- VSDXTheme.lo : $(generated_files)
-+VSDXMetaData.lo : $(generated_files)
-
- $(top_builddir)/src/lib/tokens.h : $(top_builddir)/src/lib/tokens.gperf
-
-diff --git a/src/lib/VSDCollector.h b/src/lib/VSDCollector.h
-index 26875f5..594fcf0 100644
---- a/src/lib/VSDCollector.h
-+++ b/src/lib/VSDCollector.h
-@@ -139,6 +139,9 @@ public:
- virtual void collectTextField(unsigned id, unsigned level, int nameId, int formatStringId) = 0;
- virtual void collectNumericField(unsigned id, unsigned level, unsigned short format, double number, int formatStringId) = 0;
-
-+ // Metadata
-+ virtual void collectMetaData(const librevenge::RVNGPropertyList &metaData) = 0;
-+
- // Temporary hack
- virtual void startPage(unsigned pageId) = 0;
- virtual void endPage() = 0;
-diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
-index 9de0d30..822a5f4 100644
---- a/src/lib/VSDContentCollector.cpp
-+++ b/src/lib/VSDContentCollector.cpp
-@@ -2730,6 +2730,11 @@ void libvisio::VSDContentCollector::_handleLevelChange(unsigned level)
- m_currentLevel = level;
- }
-
-+void libvisio::VSDContentCollector::collectMetaData(const librevenge::RVNGPropertyList &metaData)
-+{
-+ m_pages.setMetaData(metaData);
-+}
-+
- void libvisio::VSDContentCollector::startPage(unsigned pageId)
- {
- if (m_isShapeStarted)
-diff --git a/src/lib/VSDContentCollector.h b/src/lib/VSDContentCollector.h
-index 38c6f72..a7d148a 100644
---- a/src/lib/VSDContentCollector.h
-+++ b/src/lib/VSDContentCollector.h
-@@ -155,6 +155,8 @@ public:
- void collectStyleThemeReference(unsigned level, const boost::optional<long> &lineColour, const boost::optional<long> &fillColour,
- const boost::optional<long> &shadowColour, const boost::optional<long> &fontColour);
-
-+ virtual void collectMetaData(const librevenge::RVNGPropertyList &metaData);
-+
-
- // Field list
- void collectFieldList(unsigned id, unsigned level);
-diff --git a/src/lib/VSDPages.cpp b/src/lib/VSDPages.cpp
-index e4a7792..544123b 100644
---- a/src/lib/VSDPages.cpp
-+++ b/src/lib/VSDPages.cpp
-@@ -68,6 +68,11 @@ void libvisio::VSDPages::addBackgroundPage(const libvisio::VSDPage &page)
- m_backgroundPages[page.m_currentPageID] = page;
- }
-
-+void libvisio::VSDPages::setMetaData(const librevenge::RVNGPropertyList &metaData)
-+{
-+ m_metaData = metaData;
-+}
-+
- void libvisio::VSDPages::draw(librevenge::RVNGDrawingInterface *painter)
- {
- if (!painter)
-@@ -76,6 +81,7 @@ void libvisio::VSDPages::draw(librevenge::RVNGDrawingInterface *painter)
- return;
-
- painter->startDocument(librevenge::RVNGPropertyList());
-+ painter->setDocumentMetaData(m_metaData);
-
- for (unsigned i = 0; i < m_pages.size(); ++i)
- {
-diff --git a/src/lib/VSDPages.h b/src/lib/VSDPages.h
-index e87fd31..56358c2 100644
---- a/src/lib/VSDPages.h
-+++ b/src/lib/VSDPages.h
-@@ -39,10 +39,12 @@ public:
- void addPage(const VSDPage &page);
- void addBackgroundPage(const VSDPage &page);
- void draw(librevenge::RVNGDrawingInterface *painter);
-+ void setMetaData(const librevenge::RVNGPropertyList &metaData);
- private:
- void _drawWithBackground(librevenge::RVNGDrawingInterface *painter, const VSDPage &page);
- std::vector<VSDPage> m_pages;
- std::map<unsigned, VSDPage> m_backgroundPages;
-+ librevenge::RVNGPropertyList m_metaData;
- };
-
-
-diff --git a/src/lib/VSDStylesCollector.h b/src/lib/VSDStylesCollector.h
-index 38c9082..22f73a1 100644
---- a/src/lib/VSDStylesCollector.h
-+++ b/src/lib/VSDStylesCollector.h
-@@ -152,6 +152,8 @@ public:
- void collectTextField(unsigned id, unsigned level, int nameId, int formatStringId);
- void collectNumericField(unsigned id, unsigned level, unsigned short format, double number, int formatStringId);
-
-+ virtual void collectMetaData(const librevenge::RVNGPropertyList &) { }
-+
- // Temporary hack
- void startPage(unsigned pageID);
- void endPage();
-diff --git a/src/lib/VSDXMetaData.cpp b/src/lib/VSDXMetaData.cpp
-new file mode 100644
-index 0000000..3cbd61d
---- /dev/null
-+++ b/src/lib/VSDXMetaData.cpp
-@@ -0,0 +1,113 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/*
-+ * This file is part of the libvisio project.
-+ *
-+ * This Source Code Form is subject to the terms of the Mozilla Public
-+ * License, v. 2.0. If a copy of the MPL was not distributed with this
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+ */
-+
-+#include "VSDXMetaData.h"
-+#include "VSDXMLTokenMap.h"
-+#include "libvisio_utils.h"
-+
-+libvisio::VSDXMetaData::VSDXMetaData()
-+{
-+}
-+
-+libvisio::VSDXMetaData::~VSDXMetaData()
-+{
-+}
-+
-+void libvisio::VSDXMetaData::readTitle(xmlTextReaderPtr reader)
-+{
-+ int ret = 1;
-+ int tokenId = XML_TOKEN_INVALID;
-+ int tokenType = -1;
-+ librevenge::RVNGString title;
-+ do
-+ {
-+ ret = xmlTextReaderRead(reader);
-+ tokenId = getElementToken(reader);
-+ tokenType = xmlTextReaderNodeType(reader);
-+ if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_TEXT)
-+ title.append((const char *)xmlTextReaderConstValue(reader));
-+ }
-+ while ((XML_DC_TITLE != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
-+ m_metaData.insert("dc:title", title);
-+}
-+
-+void libvisio::VSDXMetaData::readCoreProperties(xmlTextReaderPtr reader)
-+{
-+ int ret = 1;
-+ int tokenId = XML_TOKEN_INVALID;
-+ int tokenType = -1;
-+ do
-+ {
-+ ret = xmlTextReaderRead(reader);
-+ tokenId = getElementToken(reader);
-+ if (XML_TOKEN_INVALID == tokenId)
-+ {
-+ VSD_DEBUG_MSG(("VSDXMetaData::readCoreProperties: unknown token %s\n", xmlTextReaderConstName(reader)));
-+ }
-+ tokenType = xmlTextReaderNodeType(reader);
-+ switch (tokenId)
-+ {
-+ case XML_DC_TITLE:
-+ if (tokenType == XML_READER_TYPE_ELEMENT)
-+ readTitle(reader);
-+ break;
-+ default:
-+ break;
-+ }
-+ }
-+ while ((XML_CP_COREPROPERTIES != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
-+}
-+
-+bool libvisio::VSDXMetaData::parse(librevenge::RVNGInputStream *input)
-+{
-+ if (!input)
-+ return false;
-+
-+ xmlTextReaderPtr reader = xmlReaderForStream(input, 0, 0, XML_PARSE_NOBLANKS|XML_PARSE_NOENT|XML_PARSE_NONET);
-+ if (!reader)
-+ return false;
-+
-+ try
-+ {
-+ int ret = xmlTextReaderRead(reader);
-+ while (1 == ret)
-+ {
-+ int tokenId = getElementToken(reader);
-+ switch (tokenId)
-+ {
-+ case XML_CP_COREPROPERTIES:
-+ readCoreProperties(reader);
-+ break;
-+ default:
-+ break;
-+
-+ }
-+ ret = xmlTextReaderRead(reader);
-+ }
-+ }
-+ catch (...)
-+ {
-+ xmlFreeTextReader(reader);
-+ return false;
-+ }
-+ xmlFreeTextReader(reader);
-+ return true;
-+}
-+
-+int libvisio::VSDXMetaData::getElementToken(xmlTextReaderPtr reader)
-+{
-+ return VSDXMLTokenMap::getTokenId(xmlTextReaderConstName(reader));
-+}
-+
-+const librevenge::RVNGPropertyList &libvisio::VSDXMetaData::getMetaData()
-+{
-+ return m_metaData;
-+}
-+
-+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
-diff --git a/src/lib/VSDXMetaData.h b/src/lib/VSDXMetaData.h
-new file mode 100644
-index 0000000..15d22c1
---- /dev/null
-+++ b/src/lib/VSDXMetaData.h
-@@ -0,0 +1,41 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/*
-+ * This file is part of the libvisio project.
-+ *
-+ * This Source Code Form is subject to the terms of the Mozilla Public
-+ * License, v. 2.0. If a copy of the MPL was not distributed with this
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+ */
-+
-+#ifndef __VSDXMETADATA_H__
-+#define __VSDXMETADATA_H__
-+
-+#include <librevenge-stream/librevenge-stream.h>
-+#include "VSDXMLHelper.h"
-+
-+namespace libvisio
-+{
-+
-+class VSDXMetaData
-+{
-+public:
-+ VSDXMetaData();
-+ ~VSDXMetaData();
-+ bool parse(librevenge::RVNGInputStream *input);
-+ const librevenge::RVNGPropertyList &getMetaData();
-+
-+private:
-+ VSDXMetaData(const VSDXMetaData &);
-+ VSDXMetaData &operator=(const VSDXMetaData &);
-+
-+ int getElementToken(xmlTextReaderPtr reader);
-+ void readCoreProperties(xmlTextReaderPtr reader);
-+ void readTitle(xmlTextReaderPtr reader);
-+
-+ librevenge::RVNGPropertyList m_metaData;
-+};
-+
-+} // namespace libvisio
-+
-+#endif // __VSDXMETADATA_H__
-+/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
-diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp
-index 21e2d2c..4f676b0 100644
---- a/src/lib/VSDXParser.cpp
-+++ b/src/lib/VSDXParser.cpp
-@@ -18,6 +18,7 @@
- #include "VSDStylesCollector.h"
- #include "VSDXMLHelper.h"
- #include "VSDXMLTokenMap.h"
-+#include "VSDXMetaData.h"
-
- namespace
- {
-@@ -92,6 +93,10 @@ bool libvisio::VSDXParser::parseMain()
-
- VSDContentCollector contentCollector(m_painter, groupXFormsSequence, groupMembershipsSequence, documentPageShapeOrders, styles, m_stencils);
- m_collector = &contentCollector;
-+ const libvisio::VSDXRelationship *metaDataRel = rootRels.getRelationshipByType("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
-+ if (metaDataRel)
-+ parseMetaData(m_input, metaDataRel->getTarget().c_str());
-+
- if (!parseDocument(m_input, rel->getTarget().c_str()))
- return false;
-
-@@ -275,6 +280,25 @@ bool libvisio::VSDXParser::parseTheme(librevenge::RVNGInputStream *input, const
- return true;
- }
-
-+bool libvisio::VSDXParser::parseMetaData(librevenge::RVNGInputStream *input, const char *name)
-+{
-+ if (!input)
-+ return false;
-+ input->seek(0, librevenge::RVNG_SEEK_SET);
-+ if (!input->isStructured())
-+ return false;
-+ librevenge::RVNGInputStream *stream = input->getSubStreamByName(name);
-+ if (!stream)
-+ return false;
-+
-+ VSDXMetaData metaData;
-+ metaData.parse(stream);
-+ m_collector->collectMetaData(metaData.getMetaData());
-+
-+ delete stream;
-+ return true;
-+}
-+
- void libvisio::VSDXParser::processXmlDocument(librevenge::RVNGInputStream *input, VSDXRelationships &rels)
- {
- if (!input)
-diff --git a/src/lib/VSDXParser.h b/src/lib/VSDXParser.h
-index 75119bc..8566403 100644
---- a/src/lib/VSDXParser.h
-+++ b/src/lib/VSDXParser.h
-@@ -54,6 +54,7 @@ private:
- bool parsePages(librevenge::RVNGInputStream *input, const char *name);
- bool parsePage(librevenge::RVNGInputStream *input, const char *name);
- bool parseTheme(librevenge::RVNGInputStream *input, const char *name);
-+ bool parseMetaData(librevenge::RVNGInputStream *input, const char *name);
- void processXmlDocument(librevenge::RVNGInputStream *input, VSDXRelationships &rels);
- void processXmlNode(xmlTextReaderPtr reader);
-
-diff --git a/src/lib/tokens.txt b/src/lib/tokens.txt
-index 4421b59..0392862 100644
---- a/src/lib/tokens.txt
-+++ b/src/lib/tokens.txt
-@@ -221,3 +221,5 @@ Width
- X
- XForm
- Y
-+cp:coreProperties
-+dc:title
-
-commit caf5129b16458493d7b67baf922b92fcc40ee1d0
-Author: Miklos Vajna <vmiklos@collabora.co.uk>
-Date: Tue Nov 25 12:08:53 2014 +0100
-
- fdo#86664 VSDX: import <dcterms:created> and <dcterms:modified>
-
- Change-Id: I7ff5f87729419853146d941903f88f9277106b27
-
-diff --git a/src/lib/VSDXMetaData.cpp b/src/lib/VSDXMetaData.cpp
-index 3cbd61d..19c9709 100644
---- a/src/lib/VSDXMetaData.cpp
-+++ b/src/lib/VSDXMetaData.cpp
-@@ -37,6 +37,42 @@ void libvisio::VSDXMetaData::readTitle(xmlTextReaderPtr reader)
- m_metaData.insert("dc:title", title);
- }
-
-+void libvisio::VSDXMetaData::readCreated(xmlTextReaderPtr reader)
-+{
-+ int ret = 1;
-+ int tokenId = XML_TOKEN_INVALID;
-+ int tokenType = -1;
-+ librevenge::RVNGString created;
-+ do
-+ {
-+ ret = xmlTextReaderRead(reader);
-+ tokenId = getElementToken(reader);
-+ tokenType = xmlTextReaderNodeType(reader);
-+ if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_TEXT)
-+ created.append((const char *)xmlTextReaderConstValue(reader));
-+ }
-+ while ((XML_DCTERMS_CREATED != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
-+ m_metaData.insert("meta:creation-date", created);
-+}
-+
-+void libvisio::VSDXMetaData::readModified(xmlTextReaderPtr reader)
-+{
-+ int ret = 1;
-+ int tokenId = XML_TOKEN_INVALID;
-+ int tokenType = -1;
-+ librevenge::RVNGString modified;
-+ do
-+ {
-+ ret = xmlTextReaderRead(reader);
-+ tokenId = getElementToken(reader);
-+ tokenType = xmlTextReaderNodeType(reader);
-+ if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_TEXT)
-+ modified.append((const char *)xmlTextReaderConstValue(reader));
-+ }
-+ while ((XML_DCTERMS_MODIFIED != tokenId || XML_READER_TYPE_END_ELEMENT != tokenType) && 1 == ret);
-+ m_metaData.insert("dc:date", modified);
-+}
-+
- void libvisio::VSDXMetaData::readCoreProperties(xmlTextReaderPtr reader)
- {
- int ret = 1;
-@@ -57,6 +93,14 @@ void libvisio::VSDXMetaData::readCoreProperties(xmlTextReaderPtr reader)
- if (tokenType == XML_READER_TYPE_ELEMENT)
- readTitle(reader);
- break;
-+ case XML_DCTERMS_CREATED:
-+ if (tokenType == XML_READER_TYPE_ELEMENT)
-+ readCreated(reader);
-+ break;
-+ case XML_DCTERMS_MODIFIED:
-+ if (tokenType == XML_READER_TYPE_ELEMENT)
-+ readModified(reader);
-+ break;
- default:
- break;
- }
-diff --git a/src/lib/VSDXMetaData.h b/src/lib/VSDXMetaData.h
-index 15d22c1..5ef98b8 100644
---- a/src/lib/VSDXMetaData.h
-+++ b/src/lib/VSDXMetaData.h
-@@ -31,6 +31,8 @@ private:
- int getElementToken(xmlTextReaderPtr reader);
- void readCoreProperties(xmlTextReaderPtr reader);
- void readTitle(xmlTextReaderPtr reader);
-+ void readCreated(xmlTextReaderPtr reader);
-+ void readModified(xmlTextReaderPtr reader);
-
- librevenge::RVNGPropertyList m_metaData;
- };
-diff --git a/src/lib/tokens.txt b/src/lib/tokens.txt
-index 0392862..d832604 100644
---- a/src/lib/tokens.txt
-+++ b/src/lib/tokens.txt
-@@ -223,3 +223,5 @@ XForm
- Y
- cp:coreProperties
- dc:title
-+dcterms:created
-+dcterms:modified
-diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
-index 1881b7d..a51ac14 100644
---- a/src/lib/Makefile.in
-+++ b/src/lib/Makefile.in
-@@ -134,7 +134,7 @@ am_libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_OBJECTS = \
- VSDParser.lo VSDShapeList.lo VSDStencils.lo VSDStyles.lo \
- VSDStylesCollector.lo VSDXMLHelper.lo VDXParser.lo \
- VSDXMLParserBase.lo VSDXMLTokenMap.lo VSDXParser.lo \
-- VSDXTheme.lo $(am__objects_1)
-+ VSDXTheme.lo VSDXMetaData.lo $(am__objects_1)
- libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_OBJECTS = $(am_libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_OBJECTS)
- AM_V_lt = $(am__v_lt_@AM_V@)
- am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-@@ -436,6 +436,8 @@ libvisio_@VSD_MAJOR_VERSION@_@VSD_MINOR_VERSION@_la_SOURCES = \
- VSDXParser.h \
- VSDXTheme.cpp \
- VSDXTheme.h \
-+ VSDXMetaData.cpp \
-+ VSDXMetaData.h \
- $(generated_files)
-
- EXTRA_DIST = \
-@@ -548,6 +550,7 @@ distclean-compile:
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDXMLHelper.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDXMLParserBase.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDXMLTokenMap.Plo@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDXMetaData.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDXParser.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VSDXTheme.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VisioDocument.Plo@am__quote@
-@@ -771,6 +774,7 @@ VSDXMLParserBase.lo : $(generated_files)
- VSDXMLTokenMap.lo : $(generated_files)
- VSDXParser.lo : $(generated_files)
- VSDXTheme.lo : $(generated_files)
-+VSDXMetaData.lo : $(generated_files)
-
- $(top_builddir)/src/lib/tokens.h : $(top_builddir)/src/lib/tokens.gperf
-