diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2013-05-15 11:05:45 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2013-05-15 11:14:49 +0200 |
commit | 450cd772aa734cfcb989c8cedd3c0a454db74a34 (patch) | |
tree | 1a97945b24543b6e3e47ba5abc8c6e76fad61939 /include/xmloff/unointerfacetouniqueidentifiermapper.hxx | |
parent | Remove redundant doxygen doc strings. (diff) | |
download | core-450cd772aa734cfcb989c8cedd3c0a454db74a34.tar.gz core-450cd772aa734cfcb989c8cedd3c0a454db74a34.zip |
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 'include/xmloff/unointerfacetouniqueidentifiermapper.hxx')
-rw-r--r-- | include/xmloff/unointerfacetouniqueidentifiermapper.hxx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx index 6f154bf96c54..6ec370093346 100644 --- a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx +++ b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx @@ -24,7 +24,6 @@ #include "xmloff/dllapi.h" #include "sal/types.h" -#include <deque> #include <map> #include <rtl/ustring.hxx> #include <com/sun/star/uno/XInterface.hpp> @@ -32,12 +31,10 @@ namespace comphelper { -typedef ::std::map< OUString, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > IdMap_t; +typedef ::std::map< OUString, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > IdMap_t; class XMLOFF_DLLPUBLIC UnoInterfaceToUniqueIdentifierMapper { - typedef std::deque< rtl::OUString > Reserved_t; - public: UnoInterfaceToUniqueIdentifierMapper(); ~UnoInterfaceToUniqueIdentifierMapper(); @@ -54,16 +51,12 @@ public: */ bool registerReference( const OUString& rIdentifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface ); - /** reserves an identifier for later registration. - - @returns - false, if the identifier already exists - */ - bool reserveIdentifier( const rtl::OUString& rIdentifier ); + /** always registers the given uno object with the given identifier. - /** registers the given uno object with reserved identifier. - */ - bool registerReservedReference( const rtl::OUString& rIdentifier, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& rInterface ); + In contrast to registerReference(), this here overwrites any + earlier registration of the same identifier + */ + void registerReferenceAlways( const rtl::OUString& rIdentifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface ); /** @returns the identifier for the given uno object. If this uno object is not already @@ -80,12 +73,10 @@ public: private: bool findReference( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface, IdMap_t::const_iterator& rIter ) const; bool findIdentifier( const OUString& rIdentifier, IdMap_t::const_iterator& rIter ) const; - bool findReserved( const OUString& rIdentifier ) const; - bool findReserved( const OUString& rIdentifier, Reserved_t::const_iterator& rIter ) const; + void insertReference( const OUString& rIdentifier, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rInterface ); IdMap_t maEntries; sal_Int32 mnNextId; - Reserved_t maReserved; }; } |