diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf123621.docx | bin | 0 -> 14753 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/layout/anchoreddrawobject.cxx | 12 |
4 files changed, 22 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123621.docx b/sw/qa/extras/ooxmlexport/data/tdf123621.docx Binary files differnew file mode 100644 index 000000000000..471b6ef71e95 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123621.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index f209ed442175..87a5223ccd2b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -236,7 +236,7 @@ DECLARE_OOXMLEXPORT_TEST(testMceNested, "mce-nested.docx") // Vertical position of the shape was incorrect due to incorrect nested mce handling. uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); // positionV's posOffset from the bugdoc, was 0. - CPPUNIT_ASSERT(6985 <= getProperty<sal_Int32>(xShape, "VertOrientPosition")); + CPPUNIT_ASSERT(6879 <= getProperty<sal_Int32>(xShape, "VertOrientPosition")); // This was -1 (default), make sure the background color is set. CPPUNIT_ASSERT_EQUAL(sal_Int32(0x4f81bd), getProperty<sal_Int32>(xShape, "FillColor")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 1950b8349697..1fd8ad4a7d84 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -30,6 +30,17 @@ protected: } }; +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf123621, "tdf123621.docx") +{ + xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPathContent(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor" + "/wp:positionV/wp:posOffset", "1080135"); +} + + DECLARE_OOXMLEXPORT_TEST(testTdf133334_followPgStyle, "tdf133334_followPgStyle.odt") { CPPUNIT_ASSERT_EQUAL(2, getPages()); diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 2cbe4bab0f3b..a908300b0e0c 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -34,6 +34,7 @@ #include <viewimp.hxx> #include <textboxhelper.hxx> #include <unomid.h> +#include <svx/svdoashp.hxx> using namespace ::com::sun::star; @@ -681,8 +682,15 @@ SwRect SwAnchoredDrawObject::GetObjBoundRect() const nTargetWidth = nWidth * (*GetDrawObj( )->GetRelativeWidth()); } - long nTargetHeight = aCurrObjRect.GetHeight( ); - if ( GetDrawObj( )->GetRelativeHeight( ) ) + bool bCheck = GetDrawObj()->GetRelativeHeight(); + if (bCheck) + { + auto pObjCustomShape = dynamic_cast<const SdrObjCustomShape*>(GetDrawObj()); + bCheck = !pObjCustomShape || !pObjCustomShape->IsAutoGrowHeight(); + } + + long nTargetHeight = aCurrObjRect.GetHeight(); + if (bCheck) { long nHeight = 0; if (GetDrawObj()->GetRelativeHeightRelation() == text::RelOrientation::FRAME) |