summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-08-13 18:39:32 +0200
committerMichael Stahl <mstahl@redhat.com>2017-08-17 21:26:50 +0200
commitceb23063726a938caa691aa73a9dd9c773e35134 (patch)
tree21a9299652dafaf93019dcdf7b667931cf59afac /oox
parent6e8c6f08cfc34ab59ef359152725aeae940f2654 (diff)
tdf#111548: PPTX: ActiveX checkbox control appear as picture
Make ActiveX controls import working again (PPTX / XLSX) It used to work earlier, but there were an issue with the shape id and so controls were not find. Also in PPTX import the persistStorage attribute was handled only for parent controls and not for other kind of controls. Reviewed-on: https://gerrit.libreoffice.org/40751 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit c8e3633a352c2fda3aebb9781288a926e7a88c42) tdf#111548: Better fix for PPTX / XLSX import of ActiveX controls Follow up fix for: c8e3633a352c2fda3aebb9781288a926e7a88c42 Revert part of it and fix the real issue: shapid was messed up. Reviewed-on: https://gerrit.libreoffice.org/40929 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 286c27e805c4501451857abff19c23b3719146a3) Change-Id: I9784166b65407b79b6dfed8a38087b55b1b69835 Reviewed-on: https://gerrit.libreoffice.org/41117 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/fragmenthandler2.cxx1
-rw-r--r--oox/source/ole/axcontrolfragment.cxx19
-rw-r--r--oox/source/vml/vmlshapecontext.cxx4
3 files changed, 23 insertions, 1 deletions
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 4bd32f4e7a77..76ef5ec1e32c 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -77,6 +77,7 @@ bool FragmentHandler2::prepareMceContext( sal_Int32 nElement, const AttributeLis
"p14",
"p15",
"x12ac",
+ "v",
};
if (std::find(aSupportedNS.begin(), aSupportedNS.end(), aRequires) != aSupportedNS.end())
diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx
index 4a76adc9e2f6..b6503a7b0651 100644
--- a/oox/source/ole/axcontrolfragment.cxx
+++ b/oox/source/ole/axcontrolfragment.cxx
@@ -130,11 +130,30 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
Reference< XInputStream > xStrgStrm = getFilter().openInputStream( aFragmentPath );
if( xStrgStrm.is() )
{
+ // Try to import as a parent control
+ bool bImportedAsParent = false;
OleStorage aStorage( getFilter().getComponentContext(), xStrgStrm, false );
BinaryXInputStream aInStrm( aStorage.openInputStream( "f" ), true );
if( !aInStrm.isEof() )
+ {
if( AxContainerModelBase* pModel = dynamic_cast< AxContainerModelBase* >( mrControl.createModelFromGuid( aClassId ) ) )
+ {
pModel->importBinaryModel( aInStrm );
+ bImportedAsParent = true;
+ }
+ }
+ // Import it as a non-parent control
+ if(!bImportedAsParent)
+ {
+ BinaryXInputStream aInStrm2(aStorage.openInputStream("contents"), true);
+ if (!aInStrm2.isEof())
+ {
+ if (ControlModelBase* pModel = mrControl.createModelFromGuid(aClassId))
+ {
+ pModel->importBinaryModel(aInStrm2);
+ }
+ }
+ }
}
}
}
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 02cf06e51429..9311351601d5 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -282,10 +282,12 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper& rParent, ShapeType& r
{
mrTypeModel.maShapeName = rAttribs.getXString( XML_id, OUString() );
// get ShapeType and ShapeId from name for compatibility
- mrTypeModel.maShapeId = mrTypeModel.maShapeName;
static const OUString sShapeTypePrefix = "shapetype_";
if( mrTypeModel.maShapeName.startsWith( sShapeTypePrefix ) )
+ {
+ mrTypeModel.maShapeId = mrTypeModel.maShapeName;
mrTypeModel.moShapeType = mrTypeModel.maShapeName.copy(sShapeTypePrefix.getLength()).toInt32();
+ }
}
// coordinate system position/size, CSS style