oox/source/drawingml/shape.cxx |    3 +++
 sd/qa/unit/import-tests2.cxx   |    6 ++++++
 2 files changed, 9 insertions(+)

New commits:
commit 63fe278b92395752eacd67a17e3ba5de1b650f7e
Author:     Karthik Godha <[email protected]>
AuthorDate: Thu Dec 4 20:38:04 2025 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon Dec 15 16:40:49 2025 +0100

    tdf#169548: PPTX import of autoresize shapes
    
    If there is a mismatch b/w manually calculated and auto-generated
    sizes always use the larger one.
    
    Change-Id: I41e3b98d55990d2fa3f210e44af14ae8ccfc1d30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195011
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit a9e5ec6d283866b9ed6e4e78f1f2d7e4d8e4603d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195647
    Tested-by: Michael Stahl <[email protected]>

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 8967f616c958..afc9f603dfe6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -2380,6 +2380,9 @@ Reference< XShape > const & Shape::createAndInsert(
                 if (!aOrigSize.IsEmpty() && (std::abs(aOrigSize.GetHeight() - 
aAutoSize.GetHeight()) > 1 ||
                     std::abs(aOrigSize.GetWidth() - aAutoSize.GetWidth()) > 1))
                 {
+                    if (aAutoSize.GetHeight() > aOrigSize.GetHeight())
+                        aOrigSize.setHeight(aAutoSize.GetHeight());
+
                     pShape->NbcSetLogicRect(aOrigSize, false);
                 }
             }
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 779999b09ada..236339c073fa 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -2229,6 +2229,12 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, testTdf169524)
     sal_Int32 nLeftMargin;
     xParagraph->getPropertyValue(u"ParaLeftMargin"_ustr) >>= nLeftMargin;
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nLeftMargin);
+
+    // Test tdf#169548 (uses the same test file)
+    uno::Reference<drawing::XShape> xRect(getShapeFromPage(0, 0), 
uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xRect.is());
+    sal_Int32 nHeight = xRect->getSize().Height;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(18073), nHeight);
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();

Reply via email to