sw/qa/extras/uiwriter/uiwriter8.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 9bf320792bee4cce9f3a45049f1df95d3f9dfa0d Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Feb 23 10:59:44 2023 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Mar 17 08:43:07 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/+/149040 Tested-by: Miklos Vajna <vmik...@collabora.com> Reviewed-by: Miklos Vajna <vmik...@collabora.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) {