[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 15 15:46:39 UTC 2021
sc/qa/unit/uicalc/data/tdf136113.xlsx |binary
sc/qa/unit/uicalc/uicalc.cxx | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
New commits:
commit 12d719d9dfe72f376ae0997977f44310031a45d2
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Mar 15 11:47:49 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Mar 15 16:46:00 2021 +0100
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 at libreoffice.org>
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
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf136113.xlsx 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");
More information about the Libreoffice-commits
mailing list