Kaydet (Commit) 2d4f0a7d authored tarafından Miklos Vajna's avatar Miklos Vajna

drawingML export: fix TextShape width for DOCX

Change-Id: Ibaf29ed746076fa6ec0bad013cac26debdb2b165
üst 243ce7d7
...@@ -1396,8 +1396,19 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b ...@@ -1396,8 +1396,19 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
} }
if (bBodyPr) 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, 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_lIns, (nLeft != DEFLRINS) ? IS( MM100toEMU( nLeft ) ) : NULL,
XML_rIns, (nRight != DEFLRINS) ? IS( MM100toEMU( nRight ) ) : NULL, XML_rIns, (nRight != DEFLRINS) ? IS( MM100toEMU( nRight ) ) : NULL,
XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( nTop ) ) : NULL, XML_tIns, (nTop != DEFTBINS) ? IS( MM100toEMU( nTop ) ) : NULL,
...@@ -1406,6 +1417,7 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b ...@@ -1406,6 +1417,7 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
XML_anchorCtr, bHorizontalCenter ? "1" : NULL, XML_anchorCtr, bHorizontalCenter ? "1" : NULL,
XML_vert, sWritingMode, XML_vert, sWritingMode,
FSEND ); FSEND );
}
Reference< XEnumerationAccess > access( xXText, UNO_QUERY ); Reference< XEnumerationAccess > access( xXText, UNO_QUERY );
if( !access.is() || !bText ) if( !access.is() || !bText )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment