Kaydet (Commit) 4036cf9e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Presumably, all numeric values shall be written as i4

...in 47c5454e "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
üst c88eae08
...@@ -731,13 +731,6 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP ...@@ -731,13 +731,6 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP
writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aValue ); writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aValue );
} }
break; 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: case TypeClass_BOOLEAN:
{ {
bool val ; bool val ;
...@@ -747,10 +740,15 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP ...@@ -747,10 +740,15 @@ writeCustomProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xP
break; break;
default: default:
{ {
double num;
util::Date aDate; util::Date aDate;
util::Duration aDuration; util::Duration aDuration;
util::DateTime aDateTime; 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 ); aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Year, aDate.Month, aDate.Day, true );
writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime); writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime);
......
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