summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-03-15 11:47:49 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-15 16:46:00 +0100
commit12d719d9dfe72f376ae0997977f44310031a45d2 (patch)
tree3d255f67c42af333302a0859b01e7b051573b770 /sc
parent2e5055ed463ef987105b32eda5e0454b0a9dc7f3 (diff)
tdf#136113: sc_uicalc: Add unittest
Change-Id: Iddc82cf41269e15b5d8afcb203b9ff6ae006a87a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112492 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/uicalc/data/tdf136113.xlsxbin0 -> 5741 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx28
2 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf136113.xlsx b/sc/qa/unit/uicalc/data/tdf136113.xlsx
new file mode 100644
index 000000000000..a811e91b9330
--- /dev/null
+++ b/sc/qa/unit/uicalc/data/tdf136113.xlsx
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index d0d3c03181ef..c6e421569395 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1070,6 +1070,34 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138428)
CPPUNIT_ASSERT_MESSAGE("There should be a note on B1", pDoc->HasNote(ScAddress(1, 0, 0)));
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf136113)
+{
+ ScModelObj* pModelObj = createDoc("tdf136113.xlsx");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
+ SdrPage* pPage = pDrawLayer->GetPage(0);
+ SdrObject* pObj = pPage->GetObj(0);
+
+ CPPUNIT_ASSERT_EQUAL(tools::Long(18159), pObj->GetSnapRect().Left());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(1709), pObj->GetSnapRect().Top());
+
+ lcl_SelectObjectByName(u"Arrow");
+
+ // Move the shape up
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::UP);
+ pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::UP);
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(tools::Long(18159), pObj->GetSnapRect().Left());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(1609), pObj->GetSnapRect().Top());
+
+ // Without the fix in place, this test would have failed here
+ ScDocShell* pDocSh = ScDocShell::GetViewData()->GetDocShell();
+ CPPUNIT_ASSERT(pDocSh->IsModified());
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf130614)
{
ScModelObj* pModelObj = createDoc("tdf130614.ods");