summaryrefslogtreecommitdiffstats
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
commit8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59 (patch)
treeca2b0cc4fba88107f5f6e740285184a061011866 /sc/qa/unit
parentAdding debian version 4:24.2.3-2. (diff)
downloadlibreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.tar.xz
libreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.odsbin0 -> 16799 bytes
-rw-r--r--sc/qa/unit/scshapetest.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.ods b/sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.ods
new file mode 100644
index 0000000000..5ba746ad7b
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf160329_sortWithHiddenRows.ods
Binary files differ
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index c5b4b098c8..2e9ed6281c 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -66,6 +66,14 @@ static SdrObject* lcl_getSdrObjectWithAssert(ScDocument& rDoc, sal_uInt16 nObjNu
return pObj;
}
+static SdrObject* lcl_getSdrObjectbyName(ScDocument& rDoc, std::u16string_view rName)
+{
+ ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
+ const SdrPage* pPage = pDrawLayer->GetPage(0);
+ SdrObject* pObj = pPage->GetObjByName(rName);
+ return pObj;
+}
+
CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf144242_OpenBezier_noSwapWH)
{
// Shapes, which have rotation incorporated in their points, got erroneously width-height
@@ -1299,6 +1307,35 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160369_groupshape)
CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aOrigRect, aAfterRect, 1);
}
+CPPUNIT_TEST_FIXTURE(ScShapeTest, testTdf160329_sortWithHiddenRows)
+{
+ // Load a document, which has images anchored to cell and rows hidden
+ createScDoc("ods/tdf160329_sortWithHiddenRows.ods");
+ ScDocument* pDoc = getScDoc();
+
+ // Sort the rows
+ uno::Sequence<beans::PropertyValue> aArgs1
+ = { comphelper::makePropertyValue("DbName", u"myRange"_ustr) };
+ dispatchCommand(mxComponent, ".uno:SelectDB", aArgs1);
+ uno::Sequence<beans::PropertyValue> aArgs2
+ = { comphelper::makePropertyValue("ByRows", true),
+ comphelper::makePropertyValue("HasHeader", true),
+ comphelper::makePropertyValue("Col1", sal_Int32(1)),
+ comphelper::makePropertyValue("Ascending1", false),
+ comphelper::makePropertyValue("IncludeImages", true) };
+ dispatchCommand(mxComponent, ".uno:DataSort", aArgs2);
+
+ // Make sure objects are on correct position
+ SdrObject* pObj = lcl_getSdrObjectbyName(*pDoc, std::u16string_view(u"ImageD"));
+ Point aPos = pObj->GetSnapRect().TopLeft();
+ // The position was (3000|2899) without fix.
+ CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(3000, 5898), aPos, 1);
+ pObj = lcl_getSdrObjectbyName(*pDoc, std::u16string_view(u"ImageE"));
+ aPos = pObj->GetSnapRect().TopLeft();
+ // The position was (2600|2499) without fix.
+ CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(2600, 4399), aPos, 1);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */