[Libreoffice-commits] core.git: oox/source
Stephan Bergmann
sbergman at redhat.com
Mon Sep 8 02:27:52 PDT 2014
oox/source/core/xmlfilterbase.cxx | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
New commits:
commit 4036cf9ede88a41c16e2b77483e07c9e3d58399f
Author: Stephan Bergmann <sbergman at 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);
More information about the Libreoffice-commits
mailing list