summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2020-10-16 16:46:52 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-10-17 17:06:12 +0200
commit5dda71e33e8d7e5b6433b7c3b48115c6738a177f (patch)
tree9c62553f0eb25ac6dcdd4bae87abd5dd7abd8b81 /oox
parentae6069c073365d8b5162a42b2618f077c7738caf (diff)
tdf#133377 OOXML Fix storage of date in Custom Properties
During exporting documents into OOXML formats (docx, xlsx, pptx), if custom properties have Date format, the day and year were switched. This commit fixes that. Change-Id: Id497602eb3354de78bfd52bf5ef61d32aafd957d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104450 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104463
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index e0e1933a39a1..3521a521ee81 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -826,11 +826,13 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie
util::DateTime aDateTime;
if ( rProp.Value >>= num )
{
+ // i4 - 4-byte signed integer
+ // r8 - 8-byte real number
writeElement( pAppProps, FSNS( XML_vt, XML_i4 ), num );
}
else if ( rProp.Value >>= aDate )
{
- aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Year, aDate.Month, aDate.Day, true );
+ aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Day, aDate.Month, aDate.Year, true );
writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime);
}
else if ( rProp.Value >>= aDuration )