summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-06-28 13:29:23 +0300
committerJan Holesovsky <kendy@collabora.com>2021-07-19 16:48:56 +0200
commit888a71bc9253bd309d78b3affbed6fdd5ecd7bd8 (patch)
treefa03806b4b8daf014aee28671cb633d2763f2a86 /sd
parent7ec4a0872d16eb20d790eb8079ba538898fd2ff6 (diff)
tdf#59323 tdf#142228 pptx export: fix datetime footers backwards compatibility
Versions before 166671f4aa19deec47c10a220ae1d29fa57faa93 do not import the datetime field as expected if there's no text in the datetime field. To compensate that, added placeholder text "Date" inside them. Fixes regression from: 25ae0de974befb9c279936046056a850d77e0dca tdf#59323: pptx export: add support for slide footers Change-Id: I8e35102bc0bb9a2e540cfdd59fb0dc2a0b23f185 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118008 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 6a7035347f20..7d9a3f72cd49 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1708,6 +1708,10 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody(
bool bIsDateTimeFixed = false;
xPagePropSet->getPropertyValue("IsDateTimeFixed") >>= bIsDateTimeFixed;
+ // Ideally "Date" should be replaced with the formatted date text
+ // but since variable datetime overrides the text, this seems fine for now.
+ OUString aDateTimeText = "Date";
+
if(ePageType != LAYOUT && !bIsDateTimeFixed)
{
sal_Int32 nDateTimeFormat = 0;
@@ -1727,18 +1731,18 @@ ShapeExport& PowerPointShapeExport::WritePlaceholderReferenceTextBody(
{
OString aUUID(comphelper::xml::generateGUIDString());
mpFS->startElementNS(XML_a, XML_fld, XML_id, aUUID.getStr(), XML_type, aDateTimeType);
- mpFS->endElementNS(XML_a, XML_fld);
}
else
{
- OUString aDateTimeText;
xPagePropSet->getPropertyValue("DateTimeText") >>= aDateTimeText;
mpFS->startElementNS(XML_a, XML_r);
- mpFS->startElementNS(XML_a, XML_t);
- mpFS->writeEscaped(aDateTimeText);
- mpFS->endElementNS(XML_a, XML_t);
- mpFS->endElementNS(XML_a, XML_r);
}
+
+ mpFS->startElementNS(XML_a, XML_t);
+ mpFS->writeEscaped(aDateTimeText);
+ mpFS->endElementNS(XML_a, XML_t);
+
+ mpFS->endElementNS(XML_a, bIsDateTimeFixed ? XML_r : XML_fld);
break;
}
default: