[Libreoffice-commits] libvisio.git: 2 commits - src/lib src/test
Miklos Vajna
vmiklos at collabora.co.uk
Sun Dec 28 02:53:50 PST 2014
src/lib/VSDMetaData.cpp | 4 ++++
src/lib/VSDXMetaData.cpp | 22 ++++++++++------------
src/test/importtest.cpp | 1 +
3 files changed, 15 insertions(+), 12 deletions(-)
New commits:
commit 443227148dcbf4314369e1941e910f3b64290315
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Dec 28 11:51:43 2014 +0100
VSDXMetaData: check token type at a single place
Change-Id: I0318d619a71b0785e2752a363a68f4db0b3acc0e
diff --git a/src/lib/VSDXMetaData.cpp b/src/lib/VSDXMetaData.cpp
index 72435bb..1ce1dcd 100644
--- a/src/lib/VSDXMetaData.cpp
+++ b/src/lib/VSDXMetaData.cpp
@@ -52,31 +52,29 @@ void libvisio::VSDXMetaData::readCoreProperties(xmlTextReaderPtr reader)
VSD_DEBUG_MSG(("VSDXMetaData::readCoreProperties: unknown token %s\n", xmlTextReaderConstName(reader)));
}
tokenType = xmlTextReaderNodeType(reader);
+
+ if (tokenType != XML_READER_TYPE_ELEMENT)
+ continue;
+
switch (tokenId)
{
case XML_DC_TITLE:
- if (tokenType == XML_READER_TYPE_ELEMENT)
- m_metaData.insert("dc:title", readString(reader, XML_DC_TITLE));
+ m_metaData.insert("dc:title", readString(reader, XML_DC_TITLE));
break;
case XML_DC_SUBJECT:
- if (tokenType == XML_READER_TYPE_ELEMENT)
- m_metaData.insert("dc:subject", readString(reader, XML_DC_SUBJECT));
+ m_metaData.insert("dc:subject", readString(reader, XML_DC_SUBJECT));
break;
case XML_DC_CREATOR:
- if (tokenType == XML_READER_TYPE_ELEMENT)
- m_metaData.insert("meta:initial-creator", readString(reader, XML_DC_CREATOR));
+ m_metaData.insert("meta:initial-creator", readString(reader, XML_DC_CREATOR));
break;
case XML_DCTERMS_CREATED:
- if (tokenType == XML_READER_TYPE_ELEMENT)
- m_metaData.insert("meta:creation-date", readString(reader, XML_DCTERMS_CREATED));
+ m_metaData.insert("meta:creation-date", readString(reader, XML_DCTERMS_CREATED));
break;
case XML_DCTERMS_MODIFIED:
- if (tokenType == XML_READER_TYPE_ELEMENT)
- m_metaData.insert("dc:date", readString(reader, XML_DCTERMS_MODIFIED));
+ m_metaData.insert("dc:date", readString(reader, XML_DCTERMS_MODIFIED));
break;
case XML_CP_KEYWORDS:
- if (tokenType == XML_READER_TYPE_ELEMENT)
- m_metaData.insert("meta:keyword", readString(reader, XML_CP_KEYWORDS));
+ m_metaData.insert("meta:keyword", readString(reader, XML_CP_KEYWORDS));
default:
break;
}
commit 70e2cbc27a37d84c10e60438ed143a0cd391c796
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Sun Dec 28 11:51:38 2014 +0100
VSD: import keywords
Change-Id: I1896afdcbec2cb3177f053558b2a6668529bd85e
diff --git a/src/lib/VSDMetaData.cpp b/src/lib/VSDMetaData.cpp
index f1026fc..44e6f62 100644
--- a/src/lib/VSDMetaData.cpp
+++ b/src/lib/VSDMetaData.cpp
@@ -96,6 +96,7 @@ void libvisio::VSDMetaData::readPropertyIdentifierAndOffset(librevenge::RVNGInpu
#define PIDSI_TITLE 0x00000002
#define PIDSI_SUBJECT 0x00000003
#define PIDSI_AUTHOR 0x00000004
+#define PIDSI_KEYWORDS 0x00000005
void libvisio::VSDMetaData::readTypedPropertyValue(librevenge::RVNGInputStream *input, uint32_t index, uint32_t offset)
{
@@ -128,6 +129,9 @@ void libvisio::VSDMetaData::readTypedPropertyValue(librevenge::RVNGInputStream *
case PIDSI_AUTHOR:
m_metaData.insert("meta:initial-creator", string);
break;
+ case PIDSI_KEYWORDS:
+ m_metaData.insert("meta:keyword", string);
+ break;
}
}
}
diff --git a/src/test/importtest.cpp b/src/test/importtest.cpp
index 274a36f..7aa8336 100644
--- a/src/test/importtest.cpp
+++ b/src/test/importtest.cpp
@@ -156,6 +156,7 @@ void ImportTest::testVsdMetadataTitleMs1252()
assertXPath(m_doc, "/document/setDocumentMetaData", "subject", "mysubject");
assertXPath(m_doc, "/document/setDocumentMetaData", "initial-creator", "vmiklos creator");
+ assertXPath(m_doc, "/document/setDocumentMetaData", "keyword", "mytag");
}
void ImportTest::testVsdMetadataTitleUtf8()
More information about the Libreoffice-commits
mailing list