summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-01-20 11:16:24 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-20 12:15:29 +0100
commit2d4f0a7d0dd3da34d054ff444e69b10ef015e260 (patch)
tree4564992bbfb8386d5059c8f12be009905a54778d /oox
parent243ce7d73acc070194ecf5bb9f97b8a7cbf87ecd (diff)
drawingML export: fix TextShape width for DOCX
Change-Id: Ibaf29ed746076fa6ec0bad013cac26debdb2b165
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/drawingml.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 6c03b22fa541..2a7d11a9435b 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1396,8 +1396,19 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
}
if (bBodyPr)
+ {
+ const char* pWrap = bHasWrap && !bWrap ? "none" : NULL;
+ if (GetDocumentType() == DOCUMENT_DOCX)
+ {
+ // In case of DOCX, if we want to have the same effect as
+ // TextShape's automatic word wrapping, then we need to set
+ // wrapping to square.
+ uno::Reference<lang::XServiceInfo> xServiceInfo(rXIface, uno::UNO_QUERY);
+ if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.TextShape"))
+ pWrap = "square";
+ }
mpFS->singleElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr,
- XML_wrap, bHasWrap && !bWrap ? "none" : NULL,
+ XML_wrap, pWrap,
XML_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( nLeft ) ) : NULL,
XML_rIns, (nRight != DEFLRINS) ? IS( MM100toEMU( nRight ) ) : NULL,
XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( nTop ) ) : NULL,
@@ -1406,6 +1417,7 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
XML_anchorCtr, bHorizontalCenter ? "1" : NULL,
XML_vert, sWritingMode,
FSEND );
+ }
Reference< XEnumerationAccess > access( xXText, UNO_QUERY );
if( !access.is() || !bText )