officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |    2 +-
 sw/source/uibase/shells/textfld.cxx                               |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit d4ea357e3cf1328597716c701adc255ec8f70a2c
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Jul 18 20:49:50 2022 -0400
Commit:     Justin Luth <[email protected]>
CommitDate: Tue Jul 19 19:31:29 2022 +0200

    tdf#135794 sw: add no-headers to AllowCommentsInFootnotes
    
    DOCX also doesn't allow comments in headers / footers
    so add that situation to the existing option that
    was attempting to improve DOCX compatibility.
    
    By default, comments are still allowed in headers.
    
    Change-Id: I5f9ee59cc0292e41e57ba46fa7cf41ac691acabe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137210
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index aef3819d9237..db5c7b474ff8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -173,7 +173,7 @@
         <info>
             <!-- See tdf#86188 for rationale -->
             <desc>Specifies whether adding comments to footnotes etc. is 
allowed. These are allowed for ODF but not in OOXML and can result in invalid 
docx files being saved.</desc>
-            <label>Allow adding comments to footnotes and frames. Disable for 
better OOXML interoperability.</label>
+            <label>Allow adding comments to footnotes, headers and frames. 
Disable for better OOXML interoperability.</label>
         </info>
         <value>true</value>
       </prop>
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index b334e9b5ce95..2d1043d068f4 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -915,9 +915,11 @@ void SwTextShell::StateField( SfxItemSet &rSet )
                 {
                     rSet.DisableItem(nWhich);
                 }
-                // tdf#86188 Allow disabling comment insertion on 
footnote/endnote for better OOXML interoperability
+                // tdf#86188, tdf#135794: Allow disabling comment insertion
+                // on footnote/endnote/header/frames for better OOXML 
interoperability
                 else if 
(!officecfg::Office::Compatibility::View::AllowCommentsInFootnotes::get() &&
-                         (rSh.IsCursorInFootnote() || 
rSh.GetCurrFlyFrame(/*bCalcFrame=*/false)))
+                         (rSh.IsCursorInFootnote() || rSh.IsInHeaderFooter() ||
+                          rSh.GetCurrFlyFrame(/*bCalcFrame=*/false)))
                 {
                     rSet.DisableItem(nWhich);
                 }

Reply via email to