sw/CppunitTest_sw_odfexport2.mk | 1 + sw/qa/extras/odfexport/data/tdf122452.doc |binary sw/qa/extras/odfexport/odfexport2.cxx | 16 ++++++++++++++++ 3 files changed, 17 insertions(+)
New commits: commit 11fa654dab2b7e35d724c804e1a11a1d72dde88e Author: Adam Seskunas <[email protected]> AuthorDate: Sat Jul 27 12:56:28 2024 -0700 Commit: Hossein <[email protected]> CommitDate: Tue Aug 6 13:23:52 2024 +0200 tdf#122452 - Add Unit Test Change-Id: Ifce16dd9ec093c515e61f65b58e0414b1a157a5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171126 Reviewed-by: Hossein <[email protected]> Tested-by: Jenkins diff --git a/sw/CppunitTest_sw_odfexport2.mk b/sw/CppunitTest_sw_odfexport2.mk index 43a35b404559..9d5dc86145a4 100644 --- a/sw/CppunitTest_sw_odfexport2.mk +++ b/sw/CppunitTest_sw_odfexport2.mk @@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_set_include,sw_odfexport2,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/inc \ + -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/qa/extras/odfexport/data/tdf122452.doc b/sw/qa/extras/odfexport/data/tdf122452.doc new file mode 100644 index 000000000000..9fd823130d38 Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf122452.doc differ diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index debea006f068..f9205f752054 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -35,6 +35,8 @@ #include <comphelper/sequenceashashmap.hxx> #include <editeng/unolingu.hxx> #include <officecfg/Office/Common.hxx> +#include <wrtsh.hxx> +#include <rootfrm.hxx> #include <unoprnms.hxx> #include <unotxdoc.hxx> #include <docsh.hxx> @@ -1714,6 +1716,20 @@ CPPUNIT_TEST_FIXTURE(Test, testMidnightRedlineDatetime) u"2001-01-01T00:00:00"_ustr); } +CPPUNIT_TEST_FIXTURE(Test, testTdf122452) +{ + // FIXME: Error: element "text:insertion" was found where no element may occur + skipValidation(); + loadAndReload("tdf122452.doc"); + SwDoc* pDoc = getSwDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + + // Without the fix in place this fails with: + // Expected: 1 + // Actual: 0 + CPPUNIT_ASSERT_EQUAL_MESSAGE("Redlines should be Hidden", true, pWrtShell->GetLayout()->IsHideRedlines()); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT();
