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

New commits:
commit ea0d394a0dbca55cf5567f48c248c84b36f03eff
Author:     Sarper Akdemir <[email protected]>
AuthorDate: Mon Jun 28 13:29:23 2021 +0300
Commit:     Szymon Kłos <[email protected]>
CommitDate: Mon Oct 4 09:36:37 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/+/118009
    Reviewed-by: Jan Holesovsky <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117981
    Reviewed-by: Szymon Kłos <[email protected]>

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 31f3710817aa..89ccdee88a53 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1625,6 +1625,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;
@@ -1644,18 +1648,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:

Reply via email to