svx/qa/unit/data/tdf161724.pptx |binary
 svx/qa/unit/svdraw.cxx          |   19 +++++++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit 8ffcd108d6eb233130e7c740bea235b923a4883f
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Sep 5 20:32:29 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Sep 6 09:44:38 2024 +0200

    tdf#161724: svx_unit: Add unittest
    
    Change-Id: Ie7d2707faa1aaec8e946efe1e8e4a826bf3ea091
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172928
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/svx/qa/unit/data/tdf161724.pptx b/svx/qa/unit/data/tdf161724.pptx
new file mode 100644
index 000000000000..06b863a13ddd
Binary files /dev/null and b/svx/qa/unit/data/tdf161724.pptx differ
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index ac124794a171..47aa740bc8b1 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -790,6 +790,25 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testContourTextCJK)
     // Second line
     assertXPathDoubleValue(pXmlDoc, "(//textsimpleportion)[3]"_ostr, "x"_ostr, 
12489.0, 300.0);
 }
+
+CPPUNIT_TEST_FIXTURE(SvdrawTest, testTdf161724)
+{
+    loadFromFile(u"tdf161724.pptx");
+
+    SdrPage* pSdrPage = getFirstDrawPageWithAssert();
+    xmlDocUniquePtr pXmlDoc = lcl_dumpAndParseFirstObjectWithAssert(pSdrPage);
+
+    sal_Int16 nBmpPosX = getXPath(pXmlDoc, "//bitmap"_ostr, 
"xy13"_ostr).toInt32();
+    sal_Int16 nBmpPosY = getXPath(pXmlDoc, "//bitmap"_ostr, 
"xy23"_ostr).toInt32();
+    sal_Int16 nBmpWidth = getXPath(pXmlDoc, "//bitmap"_ostr, 
"xy11"_ostr).toInt32();
+    sal_Int16 nBmpHeight = getXPath(pXmlDoc, "//bitmap"_ostr, 
"xy22"_ostr).toInt32();
+
+    // Without the fix in place, all these values would have been completely 
different
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(0), nBmpPosX);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(6356), nBmpPosY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(9901), nBmpWidth);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(12693), nBmpHeight);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to