sd/source/filter/eppt/pptx-epptooxml.cxx |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 888a71bc9253bd309d78b3affbed6fdd5ecd7bd8
Author:     Sarper Akdemir <sarper.akde...@collabora.com>
AuthorDate: Mon Jun 28 13:29:23 2021 +0300
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Mon Jul 19 16:48:56 2021 +0200

    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 <ke...@collabora.com>

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:
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to