diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 9 | ||||
-rw-r--r-- | oox/source/shape/WpsContext.cxx | 9 |
2 files changed, 15 insertions, 3 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 6340b6e9c051..f7fcf4365b2f 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1751,7 +1751,7 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.TextShape")) pWrap = "square"; } - mpFS->singleElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr, + mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr, XML_wrap, pWrap, XML_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( nLeft ) ) : NULL, XML_rIns, (nRight != DEFLRINS) ? IS( MM100toEMU( nRight ) ) : NULL, @@ -1761,6 +1761,13 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b XML_anchorCtr, bHorizontalCenter ? "1" : NULL, XML_vert, sWritingMode, FSEND ); + if (GetDocumentType() == DOCUMENT_DOCX) + { + sal_Bool bTextAutoGrowHeight = sal_False; + GET(bTextAutoGrowHeight, TextAutoGrowHeight); + mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit), FSEND); + } + mpFS->endElementNS((nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr); } Reference< XEnumerationAccess > access( xXText, UNO_QUERY ); diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 0163a506c69b..63a5f7cb2480 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -114,8 +114,13 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken // is a child context of bodyPr, so the shape is already sent: we need // to alter the XShape directly. uno::Reference<beans::XPropertySet> xPropertySet(mxShape, uno::UNO_QUERY); - if (xPropertySet.is() && xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - xPropertySet->setPropertyValue("FrameIsAutomaticHeight", uno::makeAny(getBaseToken(nElementToken) == XML_spAutoFit)); + if (xPropertySet.is()) + { + if (xServiceInfo->supportsService("com.sun.star.text.TextFrame")) + xPropertySet->setPropertyValue("FrameIsAutomaticHeight", uno::makeAny(getBaseToken(nElementToken) == XML_spAutoFit)); + else + xPropertySet->setPropertyValue("TextAutoGrowHeight", uno::makeAny(getBaseToken(nElementToken) == XML_spAutoFit)); + } } break; case XML_txbx: |