summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-03-10 19:18:41 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-03-19 12:20:54 +0100
commitbc898e2c2784e36ad4d4cdf6d962e39069d2c82d (patch)
treeca53c5c2d4104f867423a9d13bcf434c6a087038 /sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
parent34ea5c21a752364caef9727850ef34943ad5c752 (diff)
writerfilter: DocProtect_enforcement defaults to false
If enforcement is not specified, then it defaults to off. "If this attribute is omitted, then document protection settings shall not be enforced by applications." Since we cannot guarantee that NS_ooxml::LN_CT_DocProtect_enforcement will be called, handle checking the various protection statuses after the import has finished. The unit test previously had an explicit enforcement="0". Removing that was the only change I made. This patch was inspired by a code-review of LO 6.4's tdf#106843 and preparation for tdf#120852. Change-Id: I702f5173fd796eb8bda1ea610411f8297d8889b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90302 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlexport/ooxmlexport7.cxx')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index a7f4b5e4eacf..d7c6d3ca64be 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -793,6 +793,11 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFdo80894, "TextFrameRotation.docx")
// Rotation value was not roundtripped for textframe.
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:xfrm",
"rot","16200000");
+
+ // w:enforcement defaults to off if not explicitly specified, so DocProtect forms should not be enabled.
+ uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("No protected sections", sal_Int32(0), xSections->getCount());
}
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testfdo80895, "fdo80895.docx")