diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-18 01:20:41 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-18 02:02:51 +0200 |
commit | e1386e32a85eb5c6b4294a8ca3e4461b92707fc3 (patch) | |
tree | 811a7f1e7b1e210ab86488524b4e07df1d71ee09 /oox | |
parent | b779dc1364af3082fa92070222a1946cb0c6e9b0 (diff) |
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 <v:textpath>, so no dedicated <v:textbox> is needed.
Change-Id: I5786bd6827eae9756e7c179bb2ef5a5741a91878
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
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; |