[Libreoffice-commits] core.git: sd/source

Sarper Akdemir (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 19 14:49:31 UTC 2021


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

New commits:
commit 888a71bc9253bd309d78b3affbed6fdd5ecd7bd8
Author:     Sarper Akdemir <sarper.akdemir at collabora.com>
AuthorDate: Mon Jun 28 13:29:23 2021 +0300
Commit:     Jan Holesovsky <kendy at 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 <kendy at 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:


More information about the Libreoffice-commits mailing list