summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorAdam Seskunas <adamseskunas@gmail.com>2024-08-17 08:44:19 -0700
committerXisco Fauli <xiscofauli@libreoffice.org>2024-08-27 23:23:56 +0200
commitccb05fabe67cd378ecd4637a3e81a52c50cfe087 (patch)
tree6155498df7e50213ee15660bf8687394345ee686 /sw/qa/extras
parent385c4c3fca2dc7201626b66d616fbc8511d7a101 (diff)
tdf#127048 Add Unit test
Change-Id: Ideace5650c71fc55adc56437914573fa5b3413f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171977 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/ww8import/data/tdf127048.docbin0 -> 16896 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/tdf127048.doc b/sw/qa/extras/ww8import/data/tdf127048.doc
new file mode 100644
index 000000000000..57facd8c194b
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/tdf127048.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index ef0491586c2b..ec920162b9ca 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -300,6 +300,18 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf160301)
CPPUNIT_ASSERT_EQUAL(u"User Field FullName = Jeff Smith"_ustr, xField->getPresentation(true));
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf127048)
+{
+ // Use loadComponentFromURL so MacrosTest::loadFromDesktop is not called.
+ // Otherwise it sets MacroExecutionMode to ALWAYS_EXECUTE_NO_WARN
+ mxComponent = mxDesktop->loadComponentFromURL(createFileURL(u"tdf127048.doc"), u"_default"_ustr, 0, {});
+
+ SfxBaseModel* pModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pModel);
+ SfxObjectShell* pShell = pModel->GetObjectShell();
+ CPPUNIT_ASSERT_EQUAL(false, pShell->GetMacroCallsSeenWhileLoading());
+}
+
// tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT
} // end of anonymous namespace