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 6 files changed, 101 insertions(+), 104 deletions(-)
New commits: commit b767398f33f91f53f65ab2822ee667b59589e162 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Feb 21 12:38:38 2023 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Feb 21 13:14:40 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> diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 6be2de622b1d..9cd9e74a61ff 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 1434cfe80e95..0eef509ff7c3 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -16,7 +16,6 @@ #include <com/sun/star/frame/DispatchHelper.hpp> #include <com/sun/star/datatransfer/clipboard/LokClipboard.hpp> #include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp> -#include <comphelper/dispatchcommand.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> #include <comphelper/servicehelper.hxx> @@ -309,7 +308,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"); @@ -319,7 +318,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"); @@ -329,7 +328,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) @@ -341,7 +340,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) @@ -354,17 +353,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"); @@ -424,7 +423,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")); @@ -861,7 +860,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); @@ -888,7 +887,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); @@ -898,7 +897,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); @@ -908,7 +907,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); @@ -1084,7 +1083,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(")); } @@ -1097,14 +1096,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(); } @@ -1112,7 +1111,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(); } @@ -1125,13 +1124,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(); } @@ -1139,7 +1138,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(); @@ -1165,7 +1164,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); @@ -1178,7 +1177,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); } @@ -1203,7 +1202,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()); @@ -1220,7 +1219,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()); @@ -1250,7 +1249,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 @@ -1281,7 +1280,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 @@ -1303,7 +1302,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 @@ -1347,14 +1346,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()); @@ -1364,14 +1363,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()); @@ -1409,7 +1408,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()); @@ -1420,7 +1419,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()); @@ -1450,14 +1449,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); } @@ -1955,7 +1954,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()); @@ -1968,7 +1967,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()); @@ -2587,7 +2586,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) @@ -2600,7 +2599,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) @@ -2823,7 +2822,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); @@ -2858,7 +2857,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 @@ -2896,7 +2895,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 @@ -2913,12 +2912,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 @@ -2945,12 +2944,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 @@ -2990,7 +2989,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()); @@ -3054,14 +3053,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 f46090ef2c7e..dfa3ad547b3d 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 fc4a5fe231bb..2c261a99c562 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> @@ -73,6 +72,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) @@ -150,7 +150,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; @@ -161,7 +161,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 cdce0791cc2d..b2b1f9687d86 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>