From c0cc02e2934aeb12dda44818955e5964496c186a Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Thu, 17 Aug 2017 21:47:22 +0200 Subject: tdf#50097: DOCX: export form controls as MSO ActiveX controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use the same structure for export what MSO uses ** Position and size information are exported as VML shape properties ** Different handling of inline and floating controls (pict or object) ** Do some changes on VML shape export to match how MSO exports these controls ** Write out activeX.xml and activeX.bin to store control properties ** Use persistStorage storage type defined in activeX.xml * Drop grabbaging of activex.XML and activeX.bin * Cleanup control related test code Change-Id: I38bb2b2ffd2676c5459b61ec2549c31348bab41c Signed-off-by: Tamás Zolnai Reviewed-on: https://gerrit.libreoffice.org/41256 Tested-by: Jenkins --- filter/source/msfilter/eschesdo.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'filter') diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index c89469405c68..1348c38bfe7e 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -419,7 +420,24 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, } else if ( rObj.GetType() == "drawing.Control" ) { - break; + mpEscherEx->OpenContainer( ESCHER_SpContainer ); + bool bInline = false; + const Reference< XPropertySet > xPropSet(rObj.mXPropSet, UNO_QUERY); + if(xPropSet.is()) + { + text::TextContentAnchorType eAnchorType; + xPropSet->getPropertyValue("AnchorType") >>= eAnchorType; + bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER; + } + + if(bInline) + { + ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR ); + } + else + { + ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR ); + } } else if ( rObj.GetType() == "drawing.Connector" ) { -- cgit