summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/ximpshap.cxx
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2013-05-15 11:05:45 +0200
committerThorsten Behrens <tbehrens@suse.com>2013-05-15 11:14:49 +0200
commit450cd772aa734cfcb989c8cedd3c0a454db74a34 (patch)
tree1a97945b24543b6e3e47ba5abc8c6e76fad61939 /xmloff/source/draw/ximpshap.cxx
parent5134816d205fc9733a35bb6fd8a6a1a04ec8bc9e (diff)
Fix fdo#64512 Handle xml:id correctly on multi-image draw:frames
Fixes a regression from the pick-best-image from draw:frame in ODF, where before sometimes the XShape got deleted that the UnoInterfaceToUniqueIdentifierMapper::registerReference stored. For that, added a UnoInterfaceToUniqueIdentifierMapper::registerReferenceAlways function, which overwrites potentially existing earlier entries with the same identifier string. This fix was originally much more messy, but then dtardon committed 30b248dfe5bfb8a0649e36f22c943b3feb2f1385 which also fixes this here bug. Now only sneaking in slightly less involved interface map handling and a safeguard in ximpshap.cxx. Change-Id: I87501e43518a5fc2fee166c45a4e2f01718f5228
Diffstat (limited to 'xmloff/source/draw/ximpshap.cxx')
-rw-r--r--xmloff/source/draw/ximpshap.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 75dae5d23e74..eb7171b90723 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3455,9 +3455,6 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( sal_uInt16 nPref
if(getSupportsMultipleContents() && dynamic_cast< SdXMLGraphicObjectShapeContext* >(pContext))
{
- if ( !maShapeId.isEmpty() )
- GetImport().getInterfaceToIdentifierMapper().reserveIdentifier( maShapeId );
-
addContent(*mxImplContext);
}
}
@@ -3534,11 +3531,13 @@ void SdXMLFrameShapeContext::EndElement()
// solve if multiple image child contexts were imported
const SvXMLImportContext* const pSelectedContext(solveMultipleImages());
const SdXMLGraphicObjectShapeContext* pShapeContext( dynamic_cast<const SdXMLGraphicObjectShapeContext*>( pSelectedContext ) );
- if ( pShapeContext )
+ if ( pShapeContext && !maShapeId.isEmpty() )
{
+ // fdo#64512 and fdo#60075 - make sure *this* shape is
+ // registered for given ID
assert( mxImplContext.Is() );
const uno::Reference< uno::XInterface > xShape( pShapeContext->getShape() );
- GetImport().getInterfaceToIdentifierMapper().registerReservedReference( maShapeId, xShape );
+ GetImport().getInterfaceToIdentifierMapper().registerReferenceAlways( maShapeId, xShape );
}
if( !mxImplContext.Is() )