sw/qa/extras/ww8import/data/tdf127048.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 12 ++++++++++++ 2 files changed, 12 insertions(+)
New commits: commit ccb05fabe67cd378ecd4637a3e81a52c50cfe087 Author: Adam Seskunas <[email protected]> AuthorDate: Sat Aug 17 08:44:19 2024 -0700 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Aug 27 23:23:56 2024 +0200 tdf#127048 Add Unit test Change-Id: Ideace5650c71fc55adc56437914573fa5b3413f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171977 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins 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 Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf127048.doc 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
