[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/qa sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri May 21 04:23:30 UTC 2021


 sw/qa/core/txtnode/data/title-field-invalidate.fodt |    4 +++-
 sw/source/core/txtnode/atrfld.cxx                   |   14 +++++++++++---
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 50d58a15b548044e637b22c290ea52b4741a775a
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed May 19 10:24:32 2021 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri May 21 06:22:59 2021 +0200

    sw: fix not needed invalidation of custom field on each keypress
    
    And do the same for modification fields (e.g. modification date) and
    subject fields as well. In all cases the layout already reacts to the
    doc model change via normal notifications, no need to force anything.
    (Confirmed with manual testing.)
    
    This builds on top of commit 0a32630d11ebdb8b8218faa066c72582ef2f300d
    (sw: fix not needed invalidation of title field on each keypress,
    2021-05-18).
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115784
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 1dcd3f1b9fc0d888e047e854a20e9ab2e0afd544)
    
    Change-Id: I8015b33a6680d75cd5b6446eb9275bb018ea7613
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115875
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sw/qa/core/txtnode/data/title-field-invalidate.fodt b/sw/qa/core/txtnode/data/title-field-invalidate.fodt
index e47129538fa9..e7d07cab7b63 100644
--- a/sw/qa/core/txtnode/data/title-field-invalidate.fodt
+++ b/sw/qa/core/txtnode/data/title-field-invalidate.fodt
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <office:document xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:mimetype="application/vnd.oasis.opendocument.text">
   <office:meta>
+    <dc:subject>mysubject</dc:subject>
     <dc:title>mytitle</dc:title>
+    <meta:user-defined meta:name="Version" meta:value-type="string">1.1</meta:user-defined>
   </office:meta>
   <office:automatic-styles>
     <style:page-layout style:name="pm1">
@@ -11,7 +13,7 @@
   <office:master-styles>
     <style:master-page style:name="Standard" style:display-name="Standard" style:page-layout-name="pm1" style:next-style-name="Standard">
       <style:footer>
-        <text:p><text:title>mytitle</text:title></text:p>
+        <text:p><text:subject>mysubject</text:subject> <text:title>mytitle</text:title> <text:user-defined text:name="Version">1.1</text:user-defined> <text:modification-date>May 18, 2021</text:modification-date></text:p>
       </style:footer>
     </style:master-page>
   </office:master-styles>
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index d5f76f7ce4bd..ffb7aed2c5e0 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -317,16 +317,24 @@ void SwFormatField::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
     bool bForceNotify = (pOld == nullptr) && (pNew == nullptr);
     if (bForceNotify)
     {
-        // Force notify was added for conditional text fields, at least the title fields needs
+        // Force notify was added for conditional text fields, at least the below fields need
         // no forced notify.
         const SwField* pField = mpTextField->GetFormatField().GetField();
         const SwFieldIds nWhich = pField->GetTyp()->Which();
         if (nWhich == SwFieldIds::DocInfo)
         {
             auto pDocInfoField = static_cast<const SwDocInfoField*>(pField);
-            if (pDocInfoField->GetSubType() == nsSwDocInfoSubType::DI_TITLE)
+            sal_uInt16 nSubType = pDocInfoField->GetSubType();
+            // Do not consider extended SubTypes.
+            nSubType &= 0xff;
+            switch (nSubType)
             {
-                bForceNotify = false;
+                case nsSwDocInfoSubType::DI_TITLE:
+                case nsSwDocInfoSubType::DI_THEMA:
+                case nsSwDocInfoSubType::DI_CHANGE:
+                case nsSwDocInfoSubType::DI_CUSTOM:
+                    bForceNotify = false;
+                    break;
             }
         }
     }


More information about the Libreoffice-commits mailing list