sw/qa/extras/uiwriter/uiwriter8.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit e5ee1a4653e508a943d5c458143f7ac85dbb1cd2 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Feb 23 10:59:44 2023 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Mar 16 20:18:39 2023 +0000 CppunitTest_sw_uiwriter8: fix sometimes failing testTdf133490 This usually passes, but if I have an other build ongoing, then sometimes fails with: equality assertion failed - Expected: -139 - Actual : 1528 Fix this by doing a sync UNO call instead of async dispatch of an UNO command. Now this test passed for me 10 times in a row under load. Change-Id: I4f81d036c0edd3ec9467cd483238a1f32876dc50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147506 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148984 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 6043e2d606df..be886297a4e8 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -18,6 +18,7 @@ #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/text/XTextViewCursorSupplier.hpp> #include <com/sun/star/text/XPageCursor.hpp> +#include <com/sun/star/view/XSelectionSupplier.hpp> #include <comphelper/propertysequence.hxx> #include <boost/property_tree/json_parser.hpp> #include <frameformats.hxx> @@ -1807,8 +1808,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133490) aPos[1] = xShape2->getPosition(); //select shape 2 and move it to the right - dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {}); - dispatchCommand(mxComponent, ".uno:JumpToNextFrame", {}); + SwXTextDocument* pXTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + uno::Reference<view::XSelectionSupplier> xSelectionSupplier( + pXTextDocument->getCurrentController(), uno::UNO_QUERY); + xSelectionSupplier->select(uno::Any(getShape(2))); for (sal_Int32 i = 0; i < 5; ++i) {