sw/qa/extras/uiwriter/uiwriter8.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit b352c9a79ce12daf8e38246993bc821944779b0a
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Thu Feb 23 10:59:44 2023 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Feb 23 13:44:05 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

diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index c9d8384fec5b..6f659480a96c 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>
@@ -1883,8 +1884,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)
     {

Reply via email to