desktop/qa/desktop_lib/test_desktop_lib.cxx   |    7 -
 sc/qa/unit/tiledrendering/tiledrendering.cxx  |   97 ++++++++++++--------------
 sd/qa/unit/tiledrendering/LOKitSearchTest.cxx |   15 ++--
 sd/qa/unit/tiledrendering/tiledrendering.cxx  |   79 ++++++++++-----------
 sd/qa/unit/uiimpress.cxx                      |    6 -
 sw/qa/extras/uiwriter/uiwriter6.cxx           |    1 
 sw/qa/extras/uiwriter/uiwriter8.cxx           |   15 +---
 7 files changed, 106 insertions(+), 114 deletions(-)

New commits:
commit 0259e87c95df275645ce6fe1f03669a0fb93b4fa
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Feb 21 15:37:42 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Mar 10 17:53:18 2023 +0000

    sw: simplify test a bit
    
    Change-Id: Ib565e304b1067a8bca04efa323bb8d1789b1cd0e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147406
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148642

diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index eb1e94c54efb..d40b33646bbd 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2359,18 +2359,15 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf136740)
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106)
 {
     createSwDoc("cross_reference_demo_bmk.odt");
-    SwWrtShell* pWrtShell = getSwDoc()->GetDocShell()->GetWrtShell();
-
-    utl::TempFileNamed tempDir(nullptr, true);
 
-    const auto aPropertyValues = comphelper::InitPropertySequence(
-        { { "FileName", css::uno::Any(tempDir.GetURL() + "/test.odm") } });
+    const auto aPropertyValues
+        = comphelper::InitPropertySequence({ { "FileName", 
css::uno::Any(maTempFile.GetURL()) } });
     dispatchCommand(mxComponent, ".uno:NewGlobalDoc", aPropertyValues);
+    Scheduler::ProcessEventsToIdle();
 
-    // new document now!
-    mxComponent.set(pWrtShell->GetDoc()->GetDocShell()->GetModel());
-    CPPUNIT_ASSERT(mxComponent.is());
+    mxComponent = loadFromDesktop(maTempFile.GetURL());
 
+    SwWrtShell* pWrtShell = getSwDoc()->GetDocShell()->GetWrtShell();
     SwDoc* const pMasterDoc(pWrtShell->GetDoc());
     CPPUNIT_ASSERT_EQUAL(
         size_t(2),
@@ -2423,8 +2420,6 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106)
         static_cast<SwGetRefField 
const*>(fields[5]->GetField())->IsRefToHeadingCrossRefBookmark());
     CPPUNIT_ASSERT_EQUAL(OUString("Chapter 2"),
                          static_cast<SwGetRefField 
const*>(fields[5]->GetField())->GetPar2());
-
-    tempDir.EnableKillingFile();
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf103612)
commit f9983707e7ac99a7f323689a450d2e7cd63c87bd
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Feb 21 12:38:38 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Mar 10 17:53:10 2023 +0000

    qa: use dispatchCommand from macroTest
    
    Change-Id: I135bdcf6b93a38d7ee746234462736b0868c9017
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147395
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148641

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index c8fe6e733008..5af044e67523 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -37,7 +37,6 @@
 #include <sfx2/lokhelper.hxx>
 #include <test/unoapi_test.hxx>
 #include <comphelper/lok.hxx>
-#include <comphelper/dispatchcommand.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <osl/conditn.hxx>
 #include <svl/srchitem.hxx>
@@ -606,7 +605,7 @@ void DesktopLOKTest::testSearchCalc()
         {"SearchItem.Backward", uno::Any(false)},
         {"SearchItem.Command", 
uno::Any(static_cast<sal_uInt16>(SvxSearchCmd::FIND_ALL))},
     }));
-    comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
 
     std::vector<OString> aSelections;
@@ -637,7 +636,7 @@ void DesktopLOKTest::testSearchAllNotificationsCalc()
         {"SearchItem.Backward", uno::Any(false)},
         {"SearchItem.Command", 
uno::Any(static_cast<sal_uInt16>(SvxSearchCmd::FIND_ALL))},
     }));
-    comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
 
     // This was 1, make sure that we get no notifications about selection 
changes during search.
@@ -769,7 +768,7 @@ void DesktopLOKTest::testPasteWriterJPEG()
     {
         {"AnchorType", 
uno::Any(static_cast<sal_uInt16>(text::TextContentAnchorType_AT_CHARACTER))},
     }));
-    comphelper::dispatchCommand(".uno:Paste", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:Paste", aPropertyValues);
     xShape.set(xDrawPage->getByIndex(0), uno::UNO_QUERY);
     // This was text::TextContentAnchorType_AS_CHARACTER, AnchorType argument 
was ignored.
     CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, 
xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>());
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 8ca176d8d6cb..fb8af68bdd7e 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -14,7 +14,6 @@
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/datatransfer/clipboard/SystemClipboard.hpp>
-#include <comphelper/dispatchcommand.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <osl/conditn.hxx>
@@ -306,7 +305,7 @@ void ScTiledRenderingTest::testRowColumnSelections()
             { "Row", uno::Any(sal_Int32(5 - 1)) },
             { "Modifier", uno::Any(sal_uInt16(0)) }
         }));
-    comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
     // Check if it is selected
     OString aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8");
@@ -316,7 +315,7 @@ void ScTiledRenderingTest::testRowColumnSelections()
     // Select the 10th row with shift modifier
     aArgs = comphelper::InitPropertySequence({ { "Row", 
uno::Any(static_cast<sal_Int32>(10 - 1)) },
                                                { "Modifier", 
uno::Any(KEY_SHIFT) } });
-    comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
     // Check if all the rows from 5th to 10th get selected
     aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8");
@@ -326,7 +325,7 @@ void ScTiledRenderingTest::testRowColumnSelections()
     // Select the 10th row with ctrl modifier
     aArgs = comphelper::InitPropertySequence({ { "Row", 
uno::Any(static_cast<sal_Int32>(13 - 1)) },
                                                { "Modifier", 
uno::Any(KEY_MOD1) } });
-    comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
     // When we copy this, we don't get anything useful, but we must not crash
     // (used to happen)
@@ -338,7 +337,7 @@ void ScTiledRenderingTest::testRowColumnSelections()
     // Select Column 5 with ctrl modifier
     aArgs = comphelper::InitPropertySequence({ { "Col", 
uno::Any(static_cast<sal_Int32>(5 - 1)) },
                                                { "Modifier", 
uno::Any(KEY_MOD1) } });
-    comphelper::dispatchCommand(".uno:SelectColumn", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs);
 
     // When we copy this, we don't get anything useful, but we must not crash
     // (used to happen)
@@ -351,17 +350,17 @@ void ScTiledRenderingTest::testRowColumnSelections()
     // First Deselect Row 13 because copy doesn't work for multiple selections
     aArgs = comphelper::InitPropertySequence({ { "Row", 
uno::Any(static_cast<sal_Int32>(13 - 1)) },
                                                { "Modifier", 
uno::Any(KEY_MOD1) } });
-    comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
     // Deselect row 10
     aArgs = comphelper::InitPropertySequence({ { "Row", 
uno::Any(static_cast<sal_Int32>(10 - 1)) },
                                                { "Modifier", 
uno::Any(KEY_MOD1) } });
-    comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
     // Click at row 6 holding shift
     aArgs = comphelper::InitPropertySequence({ { "Row", 
uno::Any(static_cast<sal_Int32>(6 - 1)) },
                                                { "Modifier", 
uno::Any(KEY_SHIFT) } });
-    comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
     //  only row 5 should remain selected
     aResult = 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8");
@@ -421,7 +420,7 @@ void ScTiledRenderingTest::testEmptyColumnSelection()
                 { "Col", uno::Any(sal_Int32(1000 - 1)) },
                 { "Modifier", uno::Any(sal_uInt16(0)) }
         }));
-    comphelper::dispatchCommand(".uno:SelectColumn", aArgs);
+    dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs);
 
     // should be an empty string
     CPPUNIT_ASSERT_EQUAL(OString(), 
apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), 
"text/plain;charset=utf-8"));
@@ -858,7 +857,7 @@ void ScTiledRenderingTest::testMoveShapeHandle()
             {"NewPosX", uno::Any(x+1)},
             {"NewPosY", uno::Any(y+1)}
         }));
-        comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+        dispatchCommand(mxComponent, ".uno:MoveShapeHandle", aPropertyValues);
         Scheduler::ProcessEventsToIdle();
         CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
         lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
@@ -885,7 +884,7 @@ void ScTiledRenderingTest::testColRowResize()
             { "ColumnWidth", uno::Any(sal_uInt16(4000)) }, // 4cm
             { "Column", uno::Any(sal_Int16(3)) }
         }));
-    comphelper::dispatchCommand(".uno:ColumnWidth", aArgs);
+    dispatchCommand(mxComponent, ".uno:ColumnWidth", aArgs);
 
     sal_uInt16 nWidth = o3tl::convert(rDoc.GetColWidth(static_cast<SCCOL>(2), 
static_cast<SCTAB>(0), false), o3tl::Length::twip, o3tl::Length::mm100);
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(4001), nWidth);
@@ -895,7 +894,7 @@ void ScTiledRenderingTest::testColRowResize()
             { "RowHeight", uno::Any(sal_uInt16(2000)) },
             { "Row", uno::Any(sal_Int16(5)) },
         }));
-    comphelper::dispatchCommand(".uno:RowHeight", aArgs2);
+    dispatchCommand(mxComponent, ".uno:RowHeight", aArgs2);
 
     sal_uInt16 nHeight = 
o3tl::convert(rDoc.GetRowHeight(static_cast<SCROW>(4), static_cast<SCTAB>(0), 
false), o3tl::Length::twip, o3tl::Length::mm100);
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(2000), nHeight);
@@ -905,7 +904,7 @@ void ScTiledRenderingTest::testUndoShells()
 {
     ScModelObj* pModelObj = createDoc("small.ods");
     // Clear the currently selected cell.
-    comphelper::dispatchCommand(".uno:ClearContents", {});
+    dispatchCommand(mxComponent, ".uno:ClearContents", {});
 
     auto pDocShell = dynamic_cast<ScDocShell*>(pModelObj->GetEmbeddedObject());
     CPPUNIT_ASSERT(pDocShell);
@@ -1081,7 +1080,7 @@ void ScTiledRenderingTest::testAutoSum()
     ViewCallback aView;
 
     uno::Sequence<beans::PropertyValue> aArgs;
-    comphelper::dispatchCommand(".uno:AutoSum", aArgs);
+    dispatchCommand(mxComponent, ".uno:AutoSum", aArgs);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView.m_sCellFormula.startsWith("=SUM("));
 }
@@ -1094,14 +1093,14 @@ void ScTiledRenderingTest::testHideColRow()
                 { "Col", uno::Any(sal_Int32(2 - 1)) },
                 { "Modifier", uno::Any(KEY_SHIFT) }
             }));
-        comphelper::dispatchCommand(".uno:SelectColumn", aArgs);
+        dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs);
 
         uno::Sequence<beans::PropertyValue> aArgs2( 
comphelper::InitPropertySequence({
                 { "Col", uno::Any(sal_Int32(3 - 1)) },
                 { "Modifier", uno::Any(sal_uInt16(0)) }
             }));
 
-        comphelper::dispatchCommand(".uno:SelectColumn", aArgs2);
+        dispatchCommand(mxComponent, ".uno:SelectColumn", aArgs2);
         Scheduler::ProcessEventsToIdle();
     }
 
@@ -1109,7 +1108,7 @@ void ScTiledRenderingTest::testHideColRow()
     SCROW nOldCurY = ScDocShell::GetViewData()->GetCurY();
     {
         uno::Sequence<beans::PropertyValue> aArgs;
-        comphelper::dispatchCommand(".uno:HideColumn", aArgs);
+        dispatchCommand(mxComponent, ".uno:HideColumn", aArgs);
         Scheduler::ProcessEventsToIdle();
     }
 
@@ -1122,13 +1121,13 @@ void ScTiledRenderingTest::testHideColRow()
                 { "Row", uno::Any(sal_Int32(6 - 1)) },
                 { "Modifier", uno::Any(KEY_SHIFT) }
             }));
-        comphelper::dispatchCommand(".uno:SelectRow", aArgs);
+        dispatchCommand(mxComponent, ".uno:SelectRow", aArgs);
 
         uno::Sequence<beans::PropertyValue> aArgs2( 
comphelper::InitPropertySequence({
                 { "Row", uno::Any(sal_Int32(7 - 1)) },
                 { "Modifier", uno::Any(sal_uInt16(0)) }
             }));
-        comphelper::dispatchCommand(".uno:SelectRow", aArgs2);
+        dispatchCommand(mxComponent, ".uno:SelectRow", aArgs2);
         Scheduler::ProcessEventsToIdle();
     }
 
@@ -1136,7 +1135,7 @@ void ScTiledRenderingTest::testHideColRow()
     nOldCurY = ScDocShell::GetViewData()->GetCurY();
     {
         uno::Sequence<beans::PropertyValue> aArgs;
-        comphelper::dispatchCommand(".uno:HideRow", aArgs);
+        dispatchCommand(mxComponent, ".uno:HideRow", aArgs);
         Scheduler::ProcessEventsToIdle();
     }
     nNewCurX = ScDocShell::GetViewData()->GetCurX();
@@ -1162,7 +1161,7 @@ void 
ScTiledRenderingTest::testInvalidateOnCopyPasteCells()
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT | KEY_SHIFT);
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | KEY_SHIFT);
     Scheduler::ProcessEventsToIdle();
-    comphelper::dispatchCommand(".uno:Copy", aArgs);
+    dispatchCommand(mxComponent, ".uno:Copy", aArgs);
 
     // move to destination cell
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_DOWN);
@@ -1175,7 +1174,7 @@ void 
ScTiledRenderingTest::testInvalidateOnCopyPasteCells()
 
     // paste cells
     aView.m_bInvalidateTiles = false;
-    comphelper::dispatchCommand(".uno:Paste", aArgs);
+    dispatchCommand(mxComponent, ".uno:Paste", aArgs);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
 }
@@ -1200,7 +1199,7 @@ void ScTiledRenderingTest::testInvalidateOnInserRowCol()
     // insert row
     aView.m_bInvalidateTiles = false;
     aView.m_aInvalidations.clear();
-    comphelper::dispatchCommand(".uno:InsertRows", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertRows", aArgs);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
     CPPUNIT_ASSERT_EQUAL(size_t(2), aView.m_aInvalidations.size());
@@ -1217,7 +1216,7 @@ void ScTiledRenderingTest::testInvalidateOnInserRowCol()
     // insert column
     aView.m_bInvalidateTiles = false;
     aView.m_aInvalidations.clear();
-    comphelper::dispatchCommand(".uno:InsertColumns", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertColumns", aArgs);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
     CPPUNIT_ASSERT_EQUAL(size_t(2), aView.m_aInvalidations.size());
@@ -1247,7 +1246,7 @@ void ScTiledRenderingTest::testCommentCallback()
             {"Text", uno::Any(OUString("Comment"))},
             {"Author", uno::Any(OUString("LOK User1"))},
         }));
-        comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+        dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
         Scheduler::ProcessEventsToIdle();
 
         // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
@@ -1278,7 +1277,7 @@ void ScTiledRenderingTest::testCommentCallback()
             {"Text", uno::Any(OUString("Edited comment"))},
             {"Author", uno::Any(OUString("LOK User2"))},
         });
-        comphelper::dispatchCommand(".uno:EditAnnotation", aArgs);
+        dispatchCommand(mxComponent, ".uno:EditAnnotation", aArgs);
         Scheduler::ProcessEventsToIdle();
 
         // We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' 
action
@@ -1300,7 +1299,7 @@ void ScTiledRenderingTest::testCommentCallback()
         {
             {"Id", uno::Any(OUString::createFromAscii(aCommentId.c_str()))}
         });
-        comphelper::dispatchCommand(".uno:DeleteNote", aArgs);
+        dispatchCommand(mxComponent, ".uno:DeleteNote", aArgs);
         Scheduler::ProcessEventsToIdle();
 
         // We received a LOK_CALLBACK_COMMENT callback with comment 'Remove' 
action
@@ -1344,14 +1343,14 @@ void ScTiledRenderingTest::testUndoLimiting()
 
     // try to execute undo in view #2
     SfxLokHelper::setView(nView2);
-    comphelper::dispatchCommand(".uno:Undo", {});
+    dispatchCommand(mxComponent, ".uno:Undo", {});
     Scheduler::ProcessEventsToIdle();
     // check that undo has not been executed on view #2
     CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
 
     // try to execute undo in view #1
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:Undo", {});
+    dispatchCommand(mxComponent, ".uno:Undo", {});
     Scheduler::ProcessEventsToIdle();
     // check that undo has been executed on view #1
     CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
@@ -1361,14 +1360,14 @@ void ScTiledRenderingTest::testUndoLimiting()
 
     // try to execute redo in view #2
     SfxLokHelper::setView(nView2);
-    comphelper::dispatchCommand(".uno:Redo", {});
+    dispatchCommand(mxComponent, ".uno:Redo", {});
     Scheduler::ProcessEventsToIdle();
     // check that redo has not been executed on view #2
     CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetRedoActionCount());
 
     // try to execute redo in view #1
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:Redo", {});
+    dispatchCommand(mxComponent, ".uno:Redo", {});
     Scheduler::ProcessEventsToIdle();
     // check that redo has been executed on view #1
     CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetRedoActionCount());
@@ -1406,7 +1405,7 @@ void ScTiledRenderingTest::testUndoRepairDispatch()
 
     // try to execute undo in view #2
     SfxLokHelper::setView(nView2);
-    comphelper::dispatchCommand(".uno:Undo", {});
+    dispatchCommand(mxComponent, ".uno:Undo", {});
     Scheduler::ProcessEventsToIdle();
     // check that undo has not been executed on view #2
     CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
@@ -1417,7 +1416,7 @@ void ScTiledRenderingTest::testUndoRepairDispatch()
     {
         {"Repair", uno::Any(true)}
     }));
-    comphelper::dispatchCommand(".uno:Undo", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:Undo", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
     // check that undo has been executed on view #2 in repair mode
     CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
@@ -1447,14 +1446,14 @@ void 
ScTiledRenderingTest::testInsertGraphicInvalidations()
     uno::Sequence<beans::PropertyValue> aArgs( 
comphelper::InitPropertySequence({
             { "FileName", uno::Any(createFileURL(u"smile.png")) }
         }));
-    comphelper::dispatchCommand(".uno:InsertGraphic", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertGraphic", aArgs);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
 
     // undo image insertion in view and see if both views are invalidated
     aView.m_bInvalidateTiles = false;
     uno::Sequence<beans::PropertyValue> aArgs2;
-    comphelper::dispatchCommand(".uno:Undo", aArgs2);
+    dispatchCommand(mxComponent, ".uno:Undo", aArgs2);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
 }
@@ -1952,7 +1951,7 @@ void 
ScTiledRenderingTest::testInsertDeletePageInvalidation()
             { "Name", uno::Any(OUString("")) },
             { "Index", uno::Any(sal_Int32(1)) }
         }));
-    comphelper::dispatchCommand(".uno:Insert", aArgs);
+    dispatchCommand(mxComponent, ".uno:Insert", aArgs);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
     CPPUNIT_ASSERT_EQUAL(size_t(6), aView1.m_aInvalidations.size());
@@ -1965,7 +1964,7 @@ void 
ScTiledRenderingTest::testInsertDeletePageInvalidation()
     uno::Sequence<beans::PropertyValue> aArgs2( 
comphelper::InitPropertySequence({
             { "Index", uno::Any(sal_Int32(1)) }
         }));
-    comphelper::dispatchCommand(".uno:Remove", aArgs2);
+    dispatchCommand(mxComponent, ".uno:Remove", aArgs2);
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
     CPPUNIT_ASSERT_EQUAL(size_t(5), aView1.m_aInvalidations.size());
@@ -2543,7 +2542,7 @@ void ScTiledRenderingTest::testSortAscendingDescending()
 
     // sort ascending
     uno::Sequence<beans::PropertyValue> aArgs;
-    comphelper::dispatchCommand(".uno:SortAscending", aArgs);
+    dispatchCommand(mxComponent, ".uno:SortAscending", aArgs);
 
     // check it's sorted
     for (SCROW r = 0; r < 6; ++r)
@@ -2556,7 +2555,7 @@ void ScTiledRenderingTest::testSortAscendingDescending()
 
     aView.m_sInvalidateSheetGeometry = "";
     // sort descending
-    comphelper::dispatchCommand(".uno:SortDescending", aArgs);
+    dispatchCommand(mxComponent, ".uno:SortDescending", aArgs);
 
     // check it's sorted
     for (SCROW r = 0; r < 6; ++r)
@@ -2779,7 +2778,7 @@ void ScTiledRenderingTest::testSheetViewDataCrash()
             { "Name",  uno::Any(OUString("NewSheet")) },
             { "Index", uno::Any(sal_Int32(2)) }
         }));
-    comphelper::dispatchCommand(".uno:Insert", aArgs);
+    dispatchCommand(mxComponent, ".uno:Insert", aArgs);
     Scheduler::ProcessEventsToIdle();
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::PAGEDOWN | 
KEY_MOD1);
     pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | 
KEY_MOD1);
@@ -2814,7 +2813,7 @@ void ScTiledRenderingTest::testTextBoxInsert()
         comphelper::InitPropertySequence({
             { "CreateDirectly",  uno::Any(true) }
         }));
-    comphelper::dispatchCommand(".uno:DrawText", aArgs);
+    dispatchCommand(mxComponent, ".uno:DrawText", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // check if we have textbox selected
@@ -2852,7 +2851,7 @@ void ScTiledRenderingTest::testCommentCellCopyPaste()
             {"Text", uno::Any(OUString("LOK Comment Cell B2"))},
             {"Author", uno::Any(OUString("LOK Client"))},
         }));
-        comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+        dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
         Scheduler::ProcessEventsToIdle();
 
         // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
@@ -2869,12 +2868,12 @@ void ScTiledRenderingTest::testCommentCellCopyPaste()
 
         // Single cell(with comment) copy paste test
         {
-            comphelper::dispatchCommand(".uno:Copy", aCopyPasteArgs);
+            dispatchCommand(mxComponent, ".uno:Copy", aCopyPasteArgs);
             Scheduler::ProcessEventsToIdle();
 
             pTabViewShell->SetCursor(1, 49);
             Scheduler::ProcessEventsToIdle();
-            comphelper::dispatchCommand(".uno:Paste", aCopyPasteArgs); // 
Paste to cell B50
+            dispatchCommand(mxComponent, ".uno:Paste", aCopyPasteArgs); // 
Paste to cell B50
             Scheduler::ProcessEventsToIdle();
 
             // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
@@ -2901,12 +2900,12 @@ void ScTiledRenderingTest::testCommentCellCopyPaste()
             pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_RIGHT | 
KEY_SHIFT);
             Scheduler::ProcessEventsToIdle();
 
-            comphelper::dispatchCommand(".uno:Copy", aCopyPasteArgs);
+            dispatchCommand(mxComponent, ".uno:Copy", aCopyPasteArgs);
             Scheduler::ProcessEventsToIdle();
 
             pTabViewShell->SetCursor(3, 49);
             Scheduler::ProcessEventsToIdle();
-            comphelper::dispatchCommand(".uno:Paste", aCopyPasteArgs); // 
Paste to cell D50
+            dispatchCommand(mxComponent, ".uno:Paste", aCopyPasteArgs); // 
Paste to cell D50
             Scheduler::ProcessEventsToIdle();
 
             // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' 
action
@@ -2946,7 +2945,7 @@ void ScTiledRenderingTest::testInvalidEntrySave()
         false /* bInEdit */, false /* bCommit */); // Type "7/8" in A8
 
     uno::Sequence<beans::PropertyValue> aArgs;
-    comphelper::dispatchCommand(".uno:Save", aArgs);
+    dispatchCommand(mxComponent, ".uno:Save", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     CPPUNIT_ASSERT_MESSAGE("Should not be marked modified after save", 
!pDocSh->IsModified());
@@ -3010,14 +3009,14 @@ void ScTiledRenderingTest::testUndoReordering()
 
     // try to execute undo in view #1
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:Undo", {});
+    dispatchCommand(mxComponent, ".uno:Undo", {});
     Scheduler::ProcessEventsToIdle();
     // check that undo has been executed on view #1
     CPPUNIT_ASSERT_EQUAL(std::size_t(1), pUndoManager->GetUndoActionCount());
 
     // try to execute undo in view #2
     SfxLokHelper::setView(nView2);
-    comphelper::dispatchCommand(".uno:Undo", {});
+    dispatchCommand(mxComponent, ".uno:Undo", {});
     Scheduler::ProcessEventsToIdle();
     // check that undo has been executed on view #2
     CPPUNIT_ASSERT_EQUAL(std::size_t(0), pUndoManager->GetUndoActionCount());
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx 
b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 5e578218c659..f3beb12b3ce1 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -12,7 +12,6 @@
 
 #include <test/helper/transferable.hxx>
 
-#include <comphelper/dispatchcommand.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <comphelper/lok.hxx>
 #include <svl/srchitem.hxx>
@@ -80,6 +79,8 @@ private:
     SdXImpressDocument* createDoc(const char* pName,
                                   const uno::Sequence<beans::PropertyValue>& 
rArguments
                                   = uno::Sequence<beans::PropertyValue>());
+    void lcl_search(const OUString& rKey, bool bFindAll = false, bool 
bBackwards = false);
+    void lcl_replace(const OUString& rKey, const OUString& rReplace, bool bAll 
= false);
 
     std::unique_ptr<CallbackRecorder> mpCallbackRecorder;
 };
@@ -118,9 +119,7 @@ LOKitSearchTest::createDoc(const char* pName, const 
uno::Sequence<beans::Propert
     return pImpressDocument;
 }
 
-namespace
-{
-void lcl_search(const OUString& rKey, bool bFindAll = false, bool bBackwards = 
false)
+void LOKitSearchTest::lcl_search(const OUString& rKey, bool bFindAll, bool 
bBackwards)
 {
     Scheduler::ProcessEventsToIdle();
     SvxSearchCmd eSearch = bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND;
@@ -131,11 +130,11 @@ void lcl_search(const OUString& rKey, bool bFindAll = 
false, bool bBackwards = f
         { "SearchItem.Command", uno::Any(sal_uInt16(eSearch)) },
     }));
 
-    comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
 }
 
-void lcl_replace(const OUString& rKey, const OUString& rReplace, bool bAll = 
false)
+void LOKitSearchTest::lcl_replace(const OUString& rKey, const OUString& 
rReplace, bool bAll)
 {
     Scheduler::ProcessEventsToIdle();
 
@@ -147,10 +146,12 @@ void lcl_replace(const OUString& rKey, const OUString& 
rReplace, bool bAll = fal
         { "SearchItem.Command", uno::Any(sal_uInt16(eSearch)) },
     }));
 
-    comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
 }
 
+namespace
+{
 SdrObject* lclGetSelectedObject(sd::ViewShell* pViewShell)
 {
     SdrView* pSdrView = pViewShell->GetView();
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 36ead01c3fb4..67f81fa7be04 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -15,7 +15,6 @@
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <sal/log.hxx>
 #include <sfx2/lokhelper.hxx>
-#include <comphelper/dispatchcommand.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <comphelper/string.hxx>
@@ -573,7 +572,7 @@ void SdTiledRenderingTest::testUndoShells()
         {"AttributePageSize.Width", uno::Any(static_cast<sal_Int32>(10000))},
         {"AttributePageSize.Height", uno::Any(static_cast<sal_Int32>(10000))},
     }));
-    comphelper::dispatchCommand(".uno:AttributePageSize", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:AttributePageSize", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
 
     // Assert that view shell ID tracking works for SdUndoAction subclasses.
@@ -656,7 +655,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
     // Insert slides
     m_aDocumentSizeCondition.reset();
     for (unsigned it = 1; it <= 10; it++)
-        comphelper::dispatchCommand(".uno:InsertPage", aArgs);
+        dispatchCommand(mxComponent, ".uno:InsertPage", aArgs);
 
     osl::Condition::Result aResult = 
m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
     CPPUNIT_ASSERT_EQUAL(osl::Condition::result_ok, aResult);
@@ -673,7 +672,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
     // Delete slides
     m_aDocumentSizeCondition.reset();
     for (unsigned it = 1; it <= 10; it++)
-        comphelper::dispatchCommand(".uno:DeletePage", aArgs);
+        dispatchCommand(mxComponent, ".uno:DeletePage", aArgs);
 
     aResult = m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
     CPPUNIT_ASSERT_EQUAL(osl::Condition::result_ok, aResult);
@@ -689,7 +688,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
     // Undo deleted slides
     m_aDocumentSizeCondition.reset();
     for (unsigned it = 1; it <= 10; it++)
-        comphelper::dispatchCommand(".uno:Undo", aArgs);
+        dispatchCommand(mxComponent, ".uno:Undo", aArgs);
 
     aResult = m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
     CPPUNIT_ASSERT_EQUAL(osl::Condition::result_ok, aResult);
@@ -705,7 +704,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
     // Redo deleted slides
     m_aDocumentSizeCondition.reset();
     for (unsigned it = 1; it <= 10; it++)
-        comphelper::dispatchCommand(".uno:Redo", aArgs);
+        dispatchCommand(mxComponent, ".uno:Redo", aArgs);
 
     aResult = m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
     CPPUNIT_ASSERT_EQUAL(osl::Condition::result_ok, aResult);
@@ -732,7 +731,7 @@ void SdTiledRenderingTest::testInsertTable()
         { "Columns", uno::Any(sal_Int32(5)) }
     }));
 
-    comphelper::dispatchCommand(".uno:InsertTable", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertTable", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // get the table
@@ -758,7 +757,7 @@ void SdTiledRenderingTest::testDeleteTable()
         { "Columns", uno::Any(sal_Int32(5)) }
     }));
 
-    comphelper::dispatchCommand(".uno:InsertTable", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertTable", aArgs);
     Scheduler::ProcessEventsToIdle();
     sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
     SdrView* pSdrView = pViewShell->GetView();
@@ -1491,7 +1490,7 @@ void SdTiledRenderingTest::testTdf102223()
 
     // cut contents of cell
     uno::Sequence<beans::PropertyValue> aArgs;
-    comphelper::dispatchCommand(".uno:Cut", aArgs);
+    dispatchCommand(mxComponent, ".uno:Cut", aArgs);
 
     pView->SdrEndTextEdit(false);
     pView->SdrBeginTextEdit(pTableObject);
@@ -1607,7 +1606,7 @@ void SdTiledRenderingTest::testTdf103083()
     SvxNumberFormat aNumFmt(pNumFmt->GetNumRule().GetLevel(2));
 
     // cut contents of bullet item
-    comphelper::dispatchCommand(".uno:Cut", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:Cut", 
uno::Sequence<beans::PropertyValue>());
 
     CPPUNIT_ASSERT(pView->GetTextEditObject());
     EditView& rEditView2 = pView->GetTextEditOutlinerView()->GetEditView();
@@ -1615,7 +1614,7 @@ void SdTiledRenderingTest::testTdf103083()
     CPPUNIT_ASSERT_EQUAL(OUString(), rEditView2.GetSelected());
 
     // paste contents of bullet item
-    comphelper::dispatchCommand(".uno:Paste", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:Paste", 
uno::Sequence<beans::PropertyValue>());
 
     // send an ESC key to trigger the commit of the edit to the main model
     pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::ESCAPE);
@@ -1662,7 +1661,7 @@ void SdTiledRenderingTest::testTdf104405()
 
     // trigger the clone-formatting/paintbrush command to copy formatting 
contents of cell
     uno::Sequence aArgs{ comphelper::makePropertyValue("PersistentCopy", true) 
};
-    comphelper::dispatchCommand(".uno:FormatPaintbrush", aArgs);
+    dispatchCommand(mxComponent, ".uno:FormatPaintbrush", aArgs);
 
     Scheduler::ProcessEventsToIdle();
 
@@ -1755,7 +1754,7 @@ void SdTiledRenderingTest::testTdf105502()
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), aLastCell.mnRow);
 
     // Grow font size for the selection.
-    comphelper::dispatchCommand(".uno:Grow", {});
+    dispatchCommand(mxComponent, ".uno:Grow", {});
     Scheduler::ProcessEventsToIdle();
 
     // Assert that the selected A1 has now a larger font than the unselected
@@ -1805,7 +1804,7 @@ void SdTiledRenderingTest::testCommentCallbacks()
     {
         {"Text", uno::Any(OUString("Comment"))},
     });
-    comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // We received a LOK_CALLBACK_COMMENT callback with comment 'Add' action
@@ -1830,7 +1829,7 @@ void SdTiledRenderingTest::testCommentCallbacks()
         {"Id", uno::Any(OUString::number(nComment1))},
         {"Text", uno::Any(OUString("Reply to comment"))},
     });
-    comphelper::dispatchCommand(".uno:ReplyToAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:ReplyToAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' action
@@ -1855,7 +1854,7 @@ void SdTiledRenderingTest::testCommentCallbacks()
         {"Id", uno::Any(OUString::number(nComment1))},
         {"Text", uno::Any(OUString("Edited comment"))},
     });
-    comphelper::dispatchCommand(".uno:EditAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:EditAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // We received a LOK_CALLBACK_COMMENT callback with comment 'Modify' action
@@ -1873,7 +1872,7 @@ void SdTiledRenderingTest::testCommentCallbacks()
     {
         {"Id", uno::Any(OUString::number(nComment1))},
     });
-    comphelper::dispatchCommand(".uno:DeleteAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:DeleteAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // We received a LOK_CALLBACK_COMMENT callback with comment 'Remove' action
@@ -1905,7 +1904,7 @@ void SdTiledRenderingTest::testCommentChangeImpress()
     {
         {"Text", uno::Any(OUString("Comment"))},
     });
-    comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     CPPUNIT_ASSERT_EQUAL(std::string("Add"), 
aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -1923,7 +1922,7 @@ void SdTiledRenderingTest::testCommentChangeImpress()
         {"PositionX", uno::Any(sal_Int32(10))},
         {"PositionY", uno::Any(sal_Int32(20))}
     });
-    comphelper::dispatchCommand(".uno:EditAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:EditAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     CPPUNIT_ASSERT_EQUAL(std::string("Modify"), 
aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -1953,7 +1952,7 @@ void SdTiledRenderingTest::testCommentChangeDraw()
     {
         {"Text", uno::Any(OUString("Comment"))},
     });
-    comphelper::dispatchCommand(".uno:InsertAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     CPPUNIT_ASSERT_EQUAL(std::string("Add"), 
aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -1971,7 +1970,7 @@ void SdTiledRenderingTest::testCommentChangeDraw()
         {"PositionX", uno::Any(sal_Int32(10))},
         {"PositionY", uno::Any(sal_Int32(20))}
     });
-    comphelper::dispatchCommand(".uno:EditAnnotation", aArgs);
+    dispatchCommand(mxComponent, ".uno:EditAnnotation", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     CPPUNIT_ASSERT_EQUAL(std::string("Modify"), 
aView1.m_aCommentCallbackResult.get<std::string>("action"));
@@ -2004,7 +2003,7 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage()
 
     // Insert slide in 1st view
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:InsertPage", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertPage", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // See if the current slide number changed in 2nd view too
@@ -2013,7 +2012,7 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage()
 
     // Delete the page in 1st view now
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:DeletePage", aArgs);
+    dispatchCommand(mxComponent, ".uno:DeletePage", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // See if current slide number changed in 2nd view too
@@ -2067,7 +2066,7 @@ void 
SdTiledRenderingTest::testMultiViewInsertDeletePage2()
 
     // Insert slide in 1st view
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:InsertPage", aArgs);
+    dispatchCommand(mxComponent, ".uno:InsertPage", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // See if the current slide number changed in 2nd view too
@@ -2076,7 +2075,7 @@ void 
SdTiledRenderingTest::testMultiViewInsertDeletePage2()
 
     // Delete the page in 1st view now
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:DeletePage", aArgs);
+    dispatchCommand(mxComponent, ".uno:DeletePage", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // See if current slide number changed in 2nd view too
@@ -2251,7 +2250,7 @@ void SdTiledRenderingTest::testLanguageAllText()
     uno::Sequence<beans::PropertyValue> aArgs = 
comphelper::InitPropertySequence({
         { "Language", uno::Any(OUString("Default_English (USA)")) },
     });
-    comphelper::dispatchCommand(".uno:LanguageStatus", aArgs);
+    dispatchCommand(mxComponent, ".uno:LanguageStatus", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // Assert that the shape text language was changed.
@@ -2344,7 +2343,7 @@ void SdTiledRenderingTest::testTdf115783()
     uno::Sequence<beans::PropertyValue> aArgs = 
comphelper::InitPropertySequence({
         { "FontHeight.Height", uno::Any(static_cast<float>(12)) },
     });
-    comphelper::dispatchCommand(".uno:FontHeight", aArgs);
+    dispatchCommand(mxComponent, ".uno:FontHeight", aArgs);
     Scheduler::ProcessEventsToIdle();
 
     // Create a text selection on the B1 cell.
@@ -2357,11 +2356,11 @@ void SdTiledRenderingTest::testTdf115783()
 
     // Copy selection, paste at the start of the cell.
     aArgs = {};
-    comphelper::dispatchCommand(".uno:Copy", aArgs);
+    dispatchCommand(mxComponent, ".uno:Copy", aArgs);
     Scheduler::ProcessEventsToIdle();
     rEditView.SetSelection(ESelection(0, 0, 0, 0));
     aArgs = {};
-    comphelper::dispatchCommand(".uno:Paste", aArgs);
+    dispatchCommand(mxComponent, ".uno:Paste", aArgs);
     Scheduler::ProcessEventsToIdle();
     pView->SdrEndTextEdit();
 
@@ -2421,7 +2420,7 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
     Scheduler::ProcessEventsToIdle();
 
     // Copy some text
-    comphelper::dispatchCommand(".uno:Copy", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:Copy", 
uno::Sequence<beans::PropertyValue>());
     Scheduler::ProcessEventsToIdle();
 
     pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::ESCAPE);
@@ -2429,7 +2428,7 @@ void SdTiledRenderingTest::testPasteTextOnSlide()
     Scheduler::ProcessEventsToIdle();
 
     // Paste onto the slide
-    comphelper::dispatchCommand(".uno:Paste", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:Paste", 
uno::Sequence<beans::PropertyValue>());
     Scheduler::ProcessEventsToIdle();
 
     pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 
awt::Key::ESCAPE);
@@ -2528,7 +2527,7 @@ void SdTiledRenderingTest::testCutSelectionChange()
     CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(1), m_aSelection.size());
 
     // Cut the selected text
-    comphelper::dispatchCommand(".uno:Cut", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:Cut", 
uno::Sequence<beans::PropertyValue>());
     Scheduler::ProcessEventsToIdle();
 
     // Selection is removed
@@ -2558,7 +2557,7 @@ void SdTiledRenderingTest::testRegenerateDiagram()
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), 
pActualPage->GetObj(0)->GetSubList()->GetObjCount());
 
     // regenerate diagram
-    comphelper::dispatchCommand(".uno:RegenerateDiagram", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:RegenerateDiagram", 
uno::Sequence<beans::PropertyValue>());
     Scheduler::ProcessEventsToIdle();
 
     // diagram content (child shape count) should be the same as in the 
beginning
@@ -2575,7 +2574,7 @@ void 
SdTiledRenderingTest::testInsertDeletePageInvalidation()
     // Insert slide
     aView1.m_bTilesInvalidated = false;
     aView1.m_aInvalidations.clear();
-    comphelper::dispatchCommand(".uno:InsertPage", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:InsertPage", 
uno::Sequence<beans::PropertyValue>());
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
     CPPUNIT_ASSERT_EQUAL(9, pXImpressDocument->getParts());
@@ -2584,7 +2583,7 @@ void 
SdTiledRenderingTest::testInsertDeletePageInvalidation()
     // Delete slide
     aView1.m_bTilesInvalidated = false;
     aView1.m_aInvalidations.clear();
-    comphelper::dispatchCommand(".uno:DeletePage", 
uno::Sequence<beans::PropertyValue>());
+    dispatchCommand(mxComponent, ".uno:DeletePage", 
uno::Sequence<beans::PropertyValue>());
     Scheduler::ProcessEventsToIdle();
     CPPUNIT_ASSERT(aView1.m_bTilesInvalidated);
     CPPUNIT_ASSERT_EQUAL(8, pXImpressDocument->getParts());
@@ -2633,7 +2632,7 @@ void SdTiledRenderingTest::testSlideDuplicateUndo()
 
     // Duplicate the first slide on view 1 and undo it.
     SfxLokHelper::setView(nView1);
-    comphelper::dispatchCommand(".uno:DuplicatePage", {});
+    dispatchCommand(mxComponent, ".uno:DuplicatePage", {});
     Scheduler::ProcessEventsToIdle();
     pXImpressDocument->setPart(0, /*bAllowChangeFocus=*/false);
     pXImpressDocument->setPart(1, /*bAllowChangeFocus=*/false);
@@ -2699,7 +2698,7 @@ void SdTiledRenderingTest::testMoveShapeHandle()
             {"NewPosX", uno::Any(x+1)},
             {"NewPosY", uno::Any(y+1)}
         }));
-        comphelper::dispatchCommand(".uno:MoveShapeHandle", aPropertyValues);
+        dispatchCommand(mxComponent, ".uno:MoveShapeHandle", aPropertyValues);
         Scheduler::ProcessEventsToIdle();
         CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty());
         lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y);
@@ -2723,13 +2722,13 @@ void SdTiledRenderingTest::testPasteUndo()
     EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView();
     ESelection aWordSelection(0, 0, 0, 1); // "w" of "world"
     rEditView.SetSelection(aWordSelection);
-    comphelper::dispatchCommand(".uno:Cut", {});
+    dispatchCommand(mxComponent, ".uno:Cut", {});
     Scheduler::ProcessEventsToIdle();
 
     // When undoing a paste:
-    comphelper::dispatchCommand(".uno:Paste", {});
+    dispatchCommand(mxComponent, ".uno:Paste", {});
     Scheduler::ProcessEventsToIdle();
-    comphelper::dispatchCommand(".uno:Undo", {});
+    dispatchCommand(mxComponent, ".uno:Undo", {});
     Scheduler::ProcessEventsToIdle();
 
     // Then make sure the cursor position is still at the beginning:
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 13f072cf2488..f85c977ee514 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -21,7 +21,6 @@
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/view/XSelectionSupplier.hpp>
 
-#include <comphelper/dispatchcommand.hxx>
 #include <comphelper/propertysequence.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/request.hxx>
@@ -71,6 +70,7 @@ public:
     void typeKey(SdXImpressDocument* rImpressDocument, const sal_uInt16 nKey);
     void insertStringToObject(sal_uInt16 nObj, const std::u16string_view& 
rStr, bool bUseEscape);
     sd::slidesorter::SlideSorterViewShell* getSlideSorterViewShell();
+    void lcl_search(const OUString& rKey, bool bFindAll = false, bool 
bBackwards = false);
 };
 
 void SdUiImpressTest::checkCurrentPageNumber(sal_uInt16 nNum)
@@ -148,7 +148,7 @@ sd::slidesorter::SlideSorterViewShell* 
SdUiImpressTest::getSlideSorterViewShell(
     return pSSVS;
 }
 
-static void lcl_search(const OUString& rKey, bool bFindAll = false, bool 
bBackwards = false)
+void SdUiImpressTest::lcl_search(const OUString& rKey, bool bFindAll, bool 
bBackwards)
 {
     Scheduler::ProcessEventsToIdle();
     SvxSearchCmd eSearch = bFindAll ? SvxSearchCmd::FIND_ALL : 
SvxSearchCmd::FIND;
@@ -159,7 +159,7 @@ static void lcl_search(const OUString& rKey, bool bFindAll 
= false, bool bBackwa
         { "SearchItem.Command", uno::Any(sal_uInt16(eSearch)) },
     }));
 
-    comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues);
+    dispatchCommand(mxComponent, ".uno:ExecuteSearch", aPropertyValues);
     Scheduler::ProcessEventsToIdle();
 }
 
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index a3cda9eca08f..8aa7d156c660 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -31,7 +31,6 @@
 
 #include <svl/stritem.hxx>
 #include <sfx2/viewfrm.hxx>
-#include <comphelper/dispatchcommand.hxx>
 #include <sfx2/dispatch.hxx>
 #include <cmdid.h>
 #include <tools/json_writer.hxx>

Reply via email to