summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-08-23 16:21:29 +0200
committerAndras Timar <andras.timar@collabora.com>2017-08-25 15:10:57 +0200
commit8170245a9d9b9aeff913e0b3477fc2a9d508af80 (patch)
tree25dd7bbbf1421fb01bcd8e3105c302fdde1bbcc2 /writerfilter
parent813cb3dabe38c5920f26f6c3ce0b32ae19393886 (diff)
tdf#91384: DOCX: import ActiveX controls
Reviewed-on: https://gerrit.libreoffice.org/40930 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 4a764319cbad4e2589cc105145ac27defbf49ff6) Change-Id: Iebf2ff65fcec3231acfc962fb2f1abc2ed2dc67a Avoid warning in OleHandler Related to ActiveX controls. Change-Id: Ief7ee67ca8e4f086a1d5e0400d0eaf3ebc8cdaaf Reviewed-on: https://gerrit.libreoffice.org/40934 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 368b583b992f2e9cad46c2362c9529a07c36d7a9) Reviewed-on: https://gerrit.libreoffice.org/41483 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/OLEHandler.cxx7
-rw-r--r--writerfilter/source/ooxml/model.xml24
2 files changed, 7 insertions, 24 deletions
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index 6dbe0aae2f87..22dcac179034 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -105,6 +106,12 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
{
uno::Reference< drawing::XShape > xTempShape;
rVal.getAny() >>= xTempShape;
+
+ // Control shape is handled on a different code path
+ uno::Reference< lang::XServiceInfo > xSInfo( xTempShape, uno::UNO_QUERY_THROW );
+ if(xSInfo->supportsService("com.sun.star.drawing.ControlShape"))
+ break;
+
if( xTempShape.is() )
{
m_xShape.set( xTempShape );
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 4eb98b86c6bf..453f15570451 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -12455,17 +12455,6 @@
<ref name="CT_PPrChange"/>
</element>
</define>
- <define name="CT_Control">
- <attribute name="name">
- <data type="string"/>
- </attribute>
- <attribute name="shapeid">
- <data type="string"/>
- </attribute>
- <attribute name="r:id">
- <ref name="ST_String"/>
- </attribute>
- </define>
<define name="CT_Background">
<ref name="CT_PictureBase"/>
<attribute name="color">
@@ -12496,9 +12485,6 @@
</define>
<define name="CT_Object">
<ref name="CT_PictureBase"/>
- <element name="control">
- <ref name="CT_Control"/>
- </element>
<attribute name="dxaOrig">
<data type="string"/>
</attribute>
@@ -12511,9 +12497,6 @@
<element name="movie">
<ref name="CT_Rel"/>
</element>
- <element name="control">
- <ref name="CT_Control"/>
- </element>
</define>
<define name="CT_Drawing">
<choice>
@@ -17514,11 +17497,6 @@
<element name="sectPr" tokenid="ooxml:CT_PPr_sectPr"/>
<element name="pPrChange" tokenid="ooxml:CT_PPr_pPrChange"/>
</resource>
- <resource name="CT_Control" resource="Properties">
- <attribute name="name" tokenid="ooxml:CT_Control_name"/>
- <attribute name="shapeid" tokenid="ooxml:CT_Control_shapeid"/>
- <attribute name="r:id" tokenid="ooxml:CT_Control_r_id"/>
- </resource>
<resource name="CT_Background" resource="Properties">
<attribute name="color" tokenid="ooxml:CT_Background_color"/>
<attribute name="themeColor" tokenid="ooxml:CT_Background_themeColor"/>
@@ -17531,7 +17509,6 @@
</resource>
<resource name="CT_PictureBase" resource="Properties"/>
<resource name="CT_Object" resource="Shape">
- <element name="control" tokenid="ooxml:CT_Object_control"/>
<attribute name="dxaOrig" tokenid="ooxml:CT_Object_dxaOrig"/>
<attribute name="dyaOrig" tokenid="ooxml:CT_Object_dyaOrig"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
@@ -17539,7 +17516,6 @@
</resource>
<resource name="CT_Picture" resource="Shape">
<element name="movie" tokenid="ooxml:CT_Picture_movie"/>
- <element name="control" tokenid="ooxml:CT_Picture_control"/>
<action name="end" action="sendPropertiesWithId" sendtokenid="ooxml:object"/>
<action name="end" action="clearProps"/>
</resource>