summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelemen Gábor <kelemeng@ubuntu.com>2019-10-15 13:34:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-10-18 08:41:35 +0200
commit2fca4bcfda927c6e63f67f70a3331d2d748e65ca (patch)
treeb08533146cc908d76453e40e18ae267946315c8f
parentcdeff4f1b4021c5fca55743e119a70fa2bd52b91 (diff)
tdf#86188 Compatibility setting enabling comments to footnotes
For better OOXML interoperability allow disabling the insertion of comments to footnotes/endnotes. It is not possible to add comments to footnotes/endnotes in Word so no wonder Writer generates invalid XML if one tries to save comments added to footnotes as DOCX. Prevent that by adding a centrally manageably key for disabling the menu item if the cursor is in a footnote/endnote. In OOXML-heavy environments sysadmins should be able to disable this and thus hide the footgun from users. Default setting is true so it means no change compared to current feature set. Change-Id: I2f799cb3f77a47fc14fa60b55fc5689a2710aff7 Reviewed-on: https://gerrit.libreoffice.org/80829 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs8
-rw-r--r--sw/source/uibase/shells/textfld.cxx6
2 files changed, 14 insertions, 0 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index 5d781baf6b64..1712a85a30cc 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -163,6 +163,14 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="AllowCommentsInFootnotes" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <!-- See tdf#86188 for rationale -->
+ <desc>Specifies whether adding comments to footnotes is allowed. This is allowed for ODF but not in OOXML and can result in invalid docx files being saved.</desc>
+ <label>Allow adding comments to footnotes. Disable for better OOXML interperability.</label>
+ </info>
+ <value>true</value>
+ </prop>
</group>
</component>
</oor:component-schema>
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index d5c4e6b73154..ea78347f73a9 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -81,6 +81,7 @@
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <IMark.hxx>
+#include <officecfg/Office/Compatibility.hxx>
using namespace nsSwDocInfoSubType;
@@ -904,6 +905,11 @@ void SwTextShell::StateField( SfxItemSet &rSet )
{
rSet.DisableItem(nWhich);
}
+ // tdf#86188 Allow disabling comment insertion on footnote/endnote for better OOXML interoperability
+ else if ( rSh.IsCursorInFootnote() && !officecfg::Office::Compatibility::View::AllowCommentsInFootnotes::get() )
+ {
+ rSet.DisableItem(nWhich);
+ }
}
break;