diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-23 13:53:47 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-23 16:02:34 +0000 |
commit | 9937d7cdde7de5ec7588c79f92a7508a3893c31e (patch) | |
tree | a756d35d6388b31fbd2e431e35ff582372c575a2 /sw/qa/uibase/uiview/uiview.cxx | |
parent | cacd5a0cd263dbf072d5ad36dc651ad1e7df5826 (diff) |
SwModelTestBase: add selectShape helper
See discussion in https://gerrit.libreoffice.org/c/core/+/147506
Change-Id: If3f3b471d5053dbc1bf34383e64e9672d026aaae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147515
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uibase/uiview/uiview.cxx')
-rw-r--r-- | sw/qa/uibase/uiview/uiview.cxx | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index 10b5eaa6eeee..5a0f1db584e2 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -261,14 +261,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testSwitchBetweenImages) pInterceptor->m_nDisabled = 0; // When selecting the first image: - uno::Reference<text::XTextGraphicObjectsSupplier> xGraphicObjectsSupplier(mxComponent, - uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xGraphicObjects( - xGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY); - pInterceptor->m_xSelectionSupplier->select(xGraphicObjects->getByIndex(0)); - Scheduler::ProcessEventsToIdle(); - SwView* pView = pDoc->GetDocShell()->GetView(); - pView->StopShellTimer(); + selectShape(1); // Then make sure the UNO command is disabled: CPPUNIT_ASSERT_EQUAL(0, pInterceptor->m_nEnabled); @@ -279,9 +272,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testSwitchBetweenImages) pInterceptor->m_nDisabled = 0; // When selecting the second image: - pInterceptor->m_xSelectionSupplier->select(xGraphicObjects->getByIndex(1)); - Scheduler::ProcessEventsToIdle(); - pView->StopShellTimer(); + selectShape(2); // Then make sure the UNO command is enabled: CPPUNIT_ASSERT_GREATEREQUAL(1, pInterceptor->m_nEnabled); @@ -292,9 +283,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testSwitchBetweenImages) pInterceptor->m_nDisabled = 0; // When selecting the first image, again (this time not changing the selection type): - pInterceptor->m_xSelectionSupplier->select(xGraphicObjects->getByIndex(0)); - Scheduler::ProcessEventsToIdle(); - pView->StopShellTimer(); + selectShape(1); // Then make sure the UNO command is disabled: CPPUNIT_ASSERT_EQUAL(0, pInterceptor->m_nEnabled); |