summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-06-26 15:01:05 +0200
committerAndras Timar <andras.timar@collabora.com>2018-09-12 09:43:32 +0200
commita29b9286896e4e236041a86bf2bbad1bc6d95ca9 (patch)
treef86ee6b848f79e97943016b982d25e9bf114bd21 /sc
parent3d6ae0441a8eee97e0e5eeff491245055680b829 (diff)
tdf#107690 DOCX, XLSX and PPTX unit tests for "Open as read-only"
ie. OOXML export/import of "_MarkAsFinal" MSO document property. Reviewed-on: https://gerrit.libreoffice.org/56475 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit bbdb6cb8ed0d77eeb2e413b38f29d2084bd8257b) Change-Id: I01f0702d5467e78eb93ce8dce8ba25874839c3e3
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/open-as-read-only.xlsxbin0 -> 5211 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx14
2 files changed, 12 insertions, 2 deletions
diff --git a/sc/qa/unit/data/xlsx/open-as-read-only.xlsx b/sc/qa/unit/data/xlsx/open-as-read-only.xlsx
new file mode 100644
index 000000000000..e871a95d3997
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/open-as-read-only.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index b872e3bfb570..a071b12b7493 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -207,7 +207,7 @@ public:
void testHiddenRepeatedRowsODS();
void testHyperlinkTargetFrameODS();
-
+ void testOpenDocumentAsReadOnly();
void testTdf118990();
CPPUNIT_TEST_SUITE(ScExportTest);
@@ -316,7 +316,7 @@ public:
CPPUNIT_TEST(testHiddenRepeatedRowsODS);
CPPUNIT_TEST(testHyperlinkTargetFrameODS);
-
+ CPPUNIT_TEST(testOpenDocumentAsReadOnly);
CPPUNIT_TEST(testTdf118990);
CPPUNIT_TEST_SUITE_END();
@@ -4047,6 +4047,16 @@ void ScExportTest::testHyperlinkTargetFrameODS()
CPPUNIT_ASSERT_EQUAL(OUString("_blank"), aTargetFrameExport);
}
+void ScExportTest::testOpenDocumentAsReadOnly()
+{
+ ScDocShellRef xDocSh = loadDoc("open-as-read-only.", FORMAT_XLSX);
+ CPPUNIT_ASSERT(xDocSh->IsSecurityOptOpenReadOnly());
+ ScDocShellRef xDocSh2 = saveAndReload(xDocSh.get(), FORMAT_XLSX);
+ CPPUNIT_ASSERT(xDocSh2->IsSecurityOptOpenReadOnly());
+ xDocSh->DoClose();
+ xDocSh2->DoClose();
+}
+
void ScExportTest::testTdf118990()
{
ScDocShellRef xDocSh = loadDoc("tdf118990.", FORMAT_XLSX);