Kaydet (Commit) fd0a49bd authored tarafından Miklos Vajna's avatar Miklos Vajna

Fix validation problems pointed out by CppunitTest_sd_export_tests

Regression from e8bdd388
(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
üst 24a01292
...@@ -713,6 +713,10 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP ...@@ -713,6 +713,10 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP
{ {
if ( !aprop[n].Name.isEmpty() ) 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 ); OString aName = OUStringToOString( aprop[n].Name, RTL_TEXTENCODING_ASCII_US );
// pid starts from 2 not from 1 as MS supports pid from 2 // pid starts from 2 not from 1 as MS supports pid from 2
OString pid = OUStringToOString( OUString::number(n + 2), RTL_TEXTENCODING_ASCII_US ); OString pid = OUStringToOString( OUString::number(n + 2), RTL_TEXTENCODING_ASCII_US );
......
...@@ -56,7 +56,7 @@ FileFormat aFileFormats[] = ...@@ -56,7 +56,7 @@ FileFormat aFileFormats[] =
{ {
{ "odp", "impress8", "impress8", "", ODP_FORMAT_TYPE }, { "odp", "impress8", "impress8", "", ODP_FORMAT_TYPE },
{ "ppt", "MS PowerPoint 97", "Microsoft PowerPoint 97/2000/XP/2003", "sdfilt", PPT_FORMAT_TYPE }, { "ppt", "MS PowerPoint 97", "Microsoft PowerPoint 97/2000/XP/2003", "sdfilt", PPT_FORMAT_TYPE },
{ "pptx", "Impress MS PowerPoint 2007 XML", "MS PowerPoint 2007 XML", "", PPTX_FORMAT_TYPE }, { "pptx", "Impress Office Open XML", "Office Open XML Presentation", "", PPTX_FORMAT_TYPE },
{ "html", "graphic_HTML", "graphic_HTML", "", HTML_FORMAT_TYPE }, { "html", "graphic_HTML", "graphic_HTML", "", HTML_FORMAT_TYPE },
{ 0, 0, 0, 0, 0 } { 0, 0, 0, 0, 0 }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment