summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-11 18:55:10 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-11 19:03:34 +0200
commite9261e8b413bc76ca2770df30495fec1979cfca1 (patch)
tree96c16aec13029be306ccf0834bd646bd588fec94 /oox
parent27fc4354497b406241108b7ef169f5d93e3dc259 (diff)
DOCX drawingML filter: handle TextAutoGrowHeight for shapes having textboxes
Change-Id: I0cdc7edf851915f7fbc772eb42edd6ec08b09025
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx9
-rw-r--r--oox/source/shape/WpsContext.cxx9
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: