sc/qa/unit/tiledrendering/data/shape-textbox.ods |binary sc/qa/unit/tiledrendering/tiledrendering.cxx | 28 +++++++++++++++++++++++ 2 files changed, 28 insertions(+)
New commits: commit a47667c2a29272ef5ac9b9c21bd9d066bc3d547d Author: Gökay Şatır <[email protected]> AuthorDate: Tue Jun 17 12:38:50 2025 +0300 Commit: Gökay ŞATIR <[email protected]> CommitDate: Thu Jun 19 14:36:46 2025 +0200 Online Calc: TextBox shape resizing test. Add a unit test for the feature. This unit test doesn't pass without the previous revert. Signed-off-by: Gökay Şatır <[email protected]> Change-Id: I30abe745f2a28a50bb59e2393c7c60119e3b3533 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186604 Reviewed-by: Balazs Varga <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Gökay ŞATIR <[email protected]> diff --git a/sc/qa/unit/tiledrendering/data/shape-textbox.ods b/sc/qa/unit/tiledrendering/data/shape-textbox.ods new file mode 100644 index 000000000000..0904f44f8455 Binary files /dev/null and b/sc/qa/unit/tiledrendering/data/shape-textbox.ods differ diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index e4966adc2f4a..a99bd60e5a36 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -359,6 +359,34 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testMoveShapeHandle) } } +CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testMoveShapeHandleTextBox) +{ + ScModelObj* pModelObj = createDoc("shape-textbox.ods"); + ScTestViewCallback aView1; + pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, /*x=*/ 1,/*y=*/ 1,/*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0); + pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, /*x=*/ 1, /*y=*/ 1, /*count=*/ 1, /*buttons=*/ 1, /*modifier=*/0); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty()); + { + sal_uInt32 id, x, y; + lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y); + sal_uInt32 oldX = x; + sal_uInt32 oldY = y; + uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( + { + {"HandleNum", uno::Any(id)}, + {"NewPosX", uno::Any(x+1)}, + {"NewPosY", uno::Any(y+1)} + })); + dispatchCommand(mxComponent, u".uno:MoveShapeHandle"_ustr, aPropertyValues); + CPPUNIT_ASSERT(!aView1.m_ShapeSelection.isEmpty()); + lcl_extractHandleParameters(aView1.m_ShapeSelection, id, x ,y); + CPPUNIT_ASSERT_EQUAL(x-1, oldX); + CPPUNIT_ASSERT_EQUAL(y-1, oldY); + } +} + CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testColRowResize) { ScModelObj* pModelObj = createDoc("sort-range.ods");
