oox/source/core/xmlfilterbase.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
New commits: commit 4036cf9ede88a41c16e2b77483e07c9e3d58399f Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Sep 8 11:23:42 2014 +0200 Presumably, all numeric values shall be written as i4 ...in 47c5454ea67632278d69a1ddfe97d74f5cc4449f "fdo#83428: Custom Properties dropped while exporting to docx," not just ones of UNO type double. At least, that fixes CppunitTest_sc_subsequent_export_test's testPivotTableTwoDataFieldsXLSX to not write a "DocSecurity" <property> without content (and thus fail validation). Change-Id: I2d764e65ec2af61139c6564f644d27aa9a00bd7d diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 4ab32f8..545e444 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -731,13 +731,6 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aValue ); } break; - case TypeClass_DOUBLE: - { - double val; - val = * reinterpret_cast< const double * >( ( aprop[n].Value ).getValue() ); - writeElement( pAppProps, FSNS( XML_vt, XML_i4 ), val ); - } - break; case TypeClass_BOOLEAN: { bool val ; @@ -747,10 +740,15 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP break; default: { + double num; util::Date aDate; util::Duration aDuration; util::DateTime aDateTime; - if ( ( aprop[n].Value ) >>= aDate ) + if ( ( aprop[n].Value ) >>= num ) + { + writeElement( pAppProps, FSNS( XML_vt, XML_i4 ), num ); + } + else if ( ( aprop[n].Value ) >>= aDate ) { aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Year, aDate.Month, aDate.Day, true ); writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits