diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-08-28 19:15:25 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-08-28 22:42:25 +0200 |
commit | dada5958c1a5565e9d7e098c75c90f60e575ab62 (patch) | |
tree | 713795eb984d8e495ae42b2877d7bb19d3a46174 | |
parent | 97cd8e4d64632bb65445cb2f395b1385a0a2a13b (diff) |
Follow up changes related to DOCX form control export
These lines are expected to be called only for DOCX format.
AnchorType is a Writer specific attribute so it can be used
to decide on the file format.
Change-Id: Ie92f1ff801fac09cb9f658e523244ffc928690f2
Reviewed-on: https://gerrit.libreoffice.org/41655
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r-- | filter/source/msfilter/eschesdo.cxx | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index 5ed8d3892125..d203e7827c5b 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -420,28 +420,26 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, } else if ( rObj.GetType() == "drawing.Control" ) { - mpEscherEx->OpenContainer( ESCHER_SpContainer ); - bool bInline = false; const Reference< XPropertySet > xPropSet(rObj.mXPropSet, UNO_QUERY); - if(xPropSet.is()) + const Reference<XPropertySetInfo> xPropInfo = xPropSet.is() ? xPropSet->getPropertySetInfo() : Reference<XPropertySetInfo>(); + // This code is expected to be called only for DOCX format. + if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType") && bOOxmlExport) { - const Reference<XPropertySetInfo> xPropInfo = xPropSet->getPropertySetInfo(); - if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType")) + text::TextContentAnchorType eAnchorType; + xPropSet->getPropertyValue("AnchorType") >>= eAnchorType; + bool bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER; + mpEscherEx->OpenContainer( ESCHER_SpContainer ); + if(bInline) { - text::TextContentAnchorType eAnchorType; - xPropSet->getPropertyValue("AnchorType") >>= eAnchorType; - bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER; + ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR ); + } + else + { + ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR ); } - } - - if(bInline) - { - ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR ); } else - { - ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR ); - } + break; } else if ( rObj.GetType() == "drawing.Connector" ) { |