sw/inc/fldbas.hxx                       |    2 ++
 sw/inc/fmtfld.hxx                       |    5 +++++
 sw/source/core/fields/ddefld.cxx        |   15 +++++++++++----
 sw/source/core/fields/ddetbl.cxx        |    4 ++++
 sw/source/core/fields/fldbas.cxx        |    5 +++++
 xmlsecurity/qa/unit/signing/signing.cxx |    8 ++++++--
 6 files changed, 33 insertions(+), 6 deletions(-)

New commits:
commit c4a6d96cfa427a1b8b443ea2664ec5b6ab964f18
Author:     Bjoern Michaelsen <bjoern.michael...@libreoffice.org>
AuthorDate: Sun Oct 24 23:17:24 2021 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Oct 26 09:12:25 2021 +0200

    tdf#138531: Also update DDE tables, not only fields
    
    Change-Id: I0cbf8ce355b460b2f7ea73c8fae653641c980979
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124129
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 98247b039baea4697e6c387025afcf6a2963c043)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124020

diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 847e9d2ef356..c13cff3e2a23 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -32,6 +32,7 @@
 class SwDoc;
 class SwField;
 class SwFormatField;
+class SwDDETable;
 class SwRootFrame;
 class SvNumberFormatter;
 class IDocumentRedlineAccess;
@@ -281,6 +282,7 @@ public:
     void GatherNodeIndex(std::vector<sal_uLong>& rvNodeIndex);
     void GatherRefFields(std::vector<SwGetRefField*>& rvRFields, const 
sal_uInt16 nTyp);
     void GatherFields(std::vector<SwFormatField*>& rvFormatFields, bool 
bCollectOnlyInDocNodes=true) const;
+    void GatherDdeTables(std::vector<SwDDETable*>& rvTables) const;
 };
 
 /** Base class of all fields.
diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx
index f65f7d437464..4c0b3c58b11e 100644
--- a/sw/inc/fmtfld.hxx
+++ b/sw/inc/fmtfld.hxx
@@ -33,6 +33,7 @@ class SwField;
 class SwTextField;
 class SwView;
 class SwFieldType;
+class SwDDETable;
 class SwFormatField;
 class IDocumentRedlineAccess;
 namespace com::sun::star::text { class XTextField; }
@@ -72,6 +73,10 @@ namespace sw {
         std::vector<SwFormatField*>& m_rvFields;
         GatherFieldsHint(std::vector<SwFormatField*>& rvFields, bool 
bCollectOnlyInDocNodes = true) : 
m_bCollectOnlyInDocNodes(bCollectOnlyInDocNodes), m_rvFields(rvFields) {};
     };
+    struct GatherDdeTablesHint final : SfxHint {
+        std::vector<SwDDETable*>& m_rvTables;
+        GatherDdeTablesHint(std::vector<SwDDETable*>& rvTables) : 
m_rvTables(rvTables) {};
+    };
 }
 
 
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 9c4ba9c762cb..fb417375df5f 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -32,6 +32,7 @@
 #include <editsh.hxx>
 #include <fmtfld.hxx>
 #include <ddefld.hxx>
+#include <swddetbl.hxx>
 #include <swbaslnk.hxx>
 #include <unofldmid.h>
 #include <hints.hxx>
@@ -102,7 +103,7 @@ public:
     OSL_ENSURE(m_rFieldType.GetDoc(), "no pDoc");
 
     // no dependencies left?
-    if (m_rFieldType.HasWriterListeners() && !m_rFieldType.IsModifyLocked() && 
!ChkNoDataFlag())
+    if (!m_rFieldType.IsModifyLocked() && !ChkNoDataFlag())
     {
         SwViewShell* pSh = 
m_rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell();
         SwEditShell* pESh = m_rFieldType.GetDoc()->GetEditShell();
@@ -112,8 +113,11 @@ public:
         m_rFieldType.LockModify();
 
         std::vector<SwFormatField*> vFields;
+        std::vector<SwDDETable*> vTables;
         m_rFieldType.GatherFields(vFields, false);
-        if(vFields.size())
+        m_rFieldType.GatherDdeTables(vTables);
+        const bool bDoAction = vFields.size() || vTables.size();
+        if(bDoAction)
         {
             if(pESh)
                 pESh->StartAllAction();
@@ -121,16 +125,19 @@ public:
                 pSh->StartAction();
         }
 
+        // DDE fields attribute in the text
         for(auto pFormatField: vFields)
         {
-            // a DDE table or a DDE field attribute in the text
             if(pFormatField->GetTextField())
                 pFormatField->UpdateTextNode( nullptr, &aUpdateDDE );
         }
+        // a DDE tables in the text
+        for(auto pTable: vTables)
+            pTable->ChangeContent();
 
         m_rFieldType.UnlockModify();
 
-        if(vFields.size())
+        if(bDoAction)
         {
             if(pESh)
                 pESh->EndAllAction();
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index 53f6c2c3f7e7..7954e18f5d4c 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -25,6 +25,7 @@
 #include <ndtxt.hxx>
 #include <swtable.hxx>
 #include <swddetbl.hxx>
+#include <fmtfld.hxx>
 #include <ddefld.hxx>
 #include <ndindex.hxx>
 #include <fldupde.hxx>
@@ -116,6 +117,9 @@ void SwDDETable::SwClientNotify( const SwModify& rModify, 
const SfxHint& rHint )
                 pInRangeHint->m_nSttNd < pTableNd->EndOfSectionIndex() &&
                 pInRangeHint->m_nEndNd > pTableNd->GetIndex() )
             pInRangeHint->m_rIsInRange = true;
+    } else if (const auto pGatherDdeTablesHint = dynamic_cast<const 
sw::GatherDdeTablesHint*>(&rHint))
+    {
+        pGatherDdeTablesHint->m_rvTables.push_back(this);
     }
     else if (auto pModifyChangedHint = dynamic_cast<const 
sw::ModifyChangedHint*>(&rHint))
     {
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index b1220181df54..cbc73b27bcfb 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -207,6 +207,11 @@ void 
SwFieldType::GatherFields(std::vector<SwFormatField*>& rvFields, bool bColl
     CallSwClientNotify(sw::GatherFieldsHint(rvFields, bCollectOnlyInDocNodes));
 }
 
+void SwFieldType::GatherDdeTables(std::vector<SwDDETable*>& rvTables) const
+{
+    CallSwClientNotify(sw::GatherDdeTablesHint(rvTables));
+}
+
 void SwFieldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const
 {
     xmlTextWriterStartElement(pWriter, BAD_CAST("SwFieldTypes"));
commit 3f42324e7914b5e28f8a3cdbc9fd07720f14f550
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Wed Oct 20 11:56:54 2021 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Oct 26 09:12:18 2021 +0200

    Run testODFX509CertificateChain first because otherwise it fails on my Mac
    
    Sure, it would be better to figure out why it fails.
    
    Change-Id: I4c9e8aa0a9a3cd421de08ec9c9ea2dcb1a242ab1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123875
    Tested-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    (cherry picked from commit fd7f17ca580888044050fbf25df65354ba12d4ca)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124023
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index c5c323e246af..9695a84af3bf 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -542,7 +542,11 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testODFUnsignedTimestamp)
     CPPUNIT_ASSERT_EQUAL(sal_Int32(18183742), infos[0].SignatureTime);
 }
 
-CPPUNIT_TEST_FIXTURE(SigningTest, testODFX509CertificateChain)
+// FIXME: For some unknown reason, this test fails on tml's Mac unless it is 
the only or the first
+// test that is run in this CppunitTest program. The CPPUNIT_TEST_FIXTUREs are 
run in dictionary
+// order so use a name for this that makes it the first one to run.
+
+CPPUNIT_TEST_FIXTURE(SigningTest, aaa_testODFX509CertificateChain)
 {
     createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY)
               + "signed_with_x509certificate_chain.odt");

Reply via email to