diff options
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/autofit.docx | bin | 0 -> 13763 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/autofit.docx b/sw/qa/extras/ooxmlexport/data/autofit.docx Binary files differnew file mode 100755 index 000000000000..8932edfc7ba9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/autofit.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index dc8726c1f9cd..fc7079a709ab 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2225,6 +2225,12 @@ DECLARE_OOXMLEXPORT_TEST(testGroupshapePicture, "groupshape-picture.docx") CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GraphicObjectShape"), xShapeDescriptor->getShapeType()); } +DECLARE_OOXMLEXPORT_TEST(testAutofit, "autofit.docx") +{ + CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<sal_Bool>(getShape(1), "FrameIsAutomaticHeight"))); + CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(2), "FrameIsAutomaticHeight"))); +} + DECLARE_OOXMLEXPORT_TEST(testTrackChangesDeletedParagraphMark, "testTrackChangesDeletedParagraphMark.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0aa7e3601155..38a05c8c2c35 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -488,7 +488,11 @@ void DocxAttributeOutput::WriteDMLTextFrame(sw::Frame* pParentFrame) m_pSerializer->endElementNS( XML_wps, XML_txbx ); XFastAttributeListRef xBodyPrAttrList(m_pBodyPrAttrList); m_pBodyPrAttrList = NULL; - m_pSerializer->singleElementNS( XML_wps, XML_bodyPr, xBodyPrAttrList ); + m_pSerializer->startElementNS( XML_wps, XML_bodyPr, xBodyPrAttrList ); + // AutoSize of the Text Frame. + const SwFmtFrmSize& rSize = rFrmFmt.GetFrmSize(); + m_pSerializer->singleElementNS(XML_a, (rSize.GetHeightSizeType() == ATT_VAR_SIZE ? XML_spAutoFit : XML_noAutofit), FSEND); + m_pSerializer->endElementNS( XML_wps, XML_bodyPr ); m_pSerializer->endElementNS(XML_wps, XML_wsp); m_pSerializer->endElementNS(XML_a, XML_graphicData); |