diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-08-09 05:59:44 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-08-09 19:07:22 +0200 |
commit | 286c27e805c4501451857abff19c23b3719146a3 (patch) | |
tree | bf0d544fe59674b76427830b18f9a44bcc341b5e /oox | |
parent | f394b313ad9eac459e4765a639410ebd9278351a (diff) |
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.
Change-Id: I1fb87a7eae4d9054fe19c203af4aeead7db35898
Reviewed-on: https://gerrit.libreoffice.org/40929
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/fragmenthandler2.cxx | 1 | ||||
-rw-r--r-- | oox/source/ppt/slidefragmenthandler.cxx | 1 | ||||
-rw-r--r-- | oox/source/vml/vmldrawing.cxx | 10 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx index 1e4c06ab1cf2..e07bd74bc6ab 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/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 3a967eea14ce..9d6fcf16aa99 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -139,6 +139,7 @@ SlideFragmentHandler::~SlideFragmentHandler() case PPT_TOKEN( control ): { ::oox::vml::ControlInfo aInfo; + aInfo.setShapeId( rAttribs.getInteger( XML_spid, 0 ) ); aInfo.maFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ); aInfo.maName = rAttribs.getXString( XML_name, OUString() ); mpSlidePersistPtr->getDrawing()->registerControl( aInfo ); diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx index 6cb8f4dc7ebe..85d6febc73c5 100644 --- a/oox/source/vml/vmldrawing.cxx +++ b/oox/source/vml/vmldrawing.cxx @@ -82,6 +82,11 @@ ControlInfo::ControlInfo() { } +void ControlInfo::setShapeId( sal_Int32 nShapeId ) +{ + maShapeId = lclGetShapeId(nShapeId); +} + Drawing::Drawing( XmlFilterBase& rFilter, const Reference< XDrawPage >& rxDrawPage, DrawingType eType ) : mrFilter( rFilter ), mxDrawPage( rxDrawPage ), @@ -124,9 +129,10 @@ void Drawing::registerOleObject( const OleObjectInfo& rOleObject ) void Drawing::registerControl( const ControlInfo& rControl ) { + OSL_ENSURE( !rControl.maShapeId.isEmpty(), "Drawing::registerControl - missing form control shape id" ); OSL_ENSURE( !rControl.maName.isEmpty(), "Drawing::registerControl - missing form control name" ); - OSL_ENSURE( maControls.count( rControl.maName ) == 0, "Drawing::registerControl - form control already registered" ); - maControls.insert( ControlInfoMap::value_type( rControl.maName, rControl ) ); + OSL_ENSURE( maControls.count( rControl.maShapeId ) == 0, "Drawing::registerControl - form control already registered" ); + maControls.insert( ControlInfoMap::value_type( rControl.maShapeId, rControl ) ); } void Drawing::finalizeFragmentImport() diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 29d1f71f8a4d..eed6154768a1 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -282,10 +282,12 @@ ShapeTypeContext::ShapeTypeContext( ContextHandler2Helper const & rParent, Shape { 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 |