diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-09-08 11:23:42 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-08 11:27:25 +0200 |
commit | 4036cf9ede88a41c16e2b77483e07c9e3d58399f (patch) | |
tree | dd0f14a5350432cf3c3c6d334f9312cfd845b825 /oox | |
parent | c88eae0866b943e7c664819fadbf4d2c4f0c55a8 (diff) |
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
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 4ab32f8972bc..545e444d9eff 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); |