From e1386e32a85eb5c6b4294a8ca3e4461b92707fc3 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 18 Jun 2014 01:20:41 +0200 Subject: DocxSdrExport::writeDMLAndVMLDrawing: fix handling of inline VML shapes In general Writer supports having objects inside a TextFrame, Word does not. It turns out that Word allows having certain shapes inside other shapes, as long as they are VML-only. So do that for now: if we receive a shape when we're already inside a shape, then just export it as VML, not the usual drawingml+VML pair. Also, blacklist one more VML shape type, where the shape text is already exported inside , so no dedicated is needed. Change-Id: I5786bd6827eae9756e7c179bb2ef5a5741a91878 --- oox/source/export/vmlexport.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'oox') diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index ad24db2fa5e0..490bc7b6df87 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -971,6 +971,18 @@ bool lcl_isTextBox(const SdrObject* pSdrObject) return false; } +bool lcl_hasTextBoxContent(sal_uInt32 nShapeType) +{ + switch (nShapeType) + { + case ESCHER_ShpInst_TextPlainText: + case ESCHER_ShpInst_TextSlantUp: + return false; + default: + return true; + } +} + OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) { OUString aResult; @@ -1126,7 +1138,7 @@ sal_Int32 VMLExport::StartShape() // now check if we have some editeng text (not associated textbox) and we have a text exporter registered const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject); - if (pTxtObj && m_pTextExport && m_nShapeType != ESCHER_ShpInst_TextPlainText && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject)) + if (pTxtObj && m_pTextExport && lcl_hasTextBoxContent(m_nShapeType) && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject)) { const OutlinerParaObject* pParaObj = 0; bool bOwnParaObj = false; -- cgit v1.2.3