summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-25 21:06:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-25 21:19:09 +0200
commitfd0a49bdd7cf7979d18feff003d1b5fbe53fdc14 (patch)
tree6dc65aa83324cc4476751ac260329b8c802552a6 /oox/source
parent24a0129274ebfd41b4a2e81ec7cb5be238b9cf78 (diff)
Fix validation problems pointed out by CppunitTest_sd_export_tests
Regression from e8bdd38882522591723097c028ca7a6927ee70c4 (fdo#83751-FILESAVE:Custom Properties dropped while exporting to .pptx, 2014-09-11), there were two problems here: 1) Using the wrong filter when the output is expected to be suitable for validation. 2) Writing empty custom property values, which is not valid. Change-Id: Ic18c789c53bd40cc8aa07385cb5fd0d5c7ada6ab
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index bf82eefbf779..001c9dbbd32e 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -713,6 +713,10 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP
{
if ( !aprop[n].Name.isEmpty() )
{
+ // Ignore empty string property as well.
+ if (aprop[n].Value.has<OUString>() && aprop[n].Value.get<OUString>().isEmpty())
+ continue;
+
OString aName = OUStringToOString( aprop[n].Name, RTL_TEXTENCODING_ASCII_US );
// pid starts from 2 not from 1 as MS supports pid from 2
OString pid = OUStringToOString( OUString::number(n + 2), RTL_TEXTENCODING_ASCII_US );