diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-20 12:56:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-21 11:36:05 +0200 |
commit | 3c230d608b766e573eeca66e203114b262478230 (patch) | |
tree | 8b750d82df7a5517d4f16486510c6dd6b1f9bf03 /include | |
parent | 13ae66c0eb0ab03ac4a43c52dd2359fbaa7f5867 (diff) |
rhbz#1870501 crash on reexport of odg
where SdrObjects in a list have no navigation position set
a regression from
450cd772aa734cfcb989c8cedd3c0a454db74a34
Fix fdo#64512 Handle xml:id correctly on multi-image draw:frames
this just reverts that and adds the test case that crashed
Change-Id: I1a49dab9578699c42fe845e8ec42de40159dec3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101074
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/xmloff/unointerfacetouniqueidentifiermapper.hxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx index a78713f85d13..332005e720ac 100644 --- a/include/xmloff/unointerfacetouniqueidentifiermapper.hxx +++ b/include/xmloff/unointerfacetouniqueidentifiermapper.hxx @@ -24,6 +24,7 @@ #include <xmloff/dllapi.h> #include <sal/types.h> +#include <deque> #include <map> #include <rtl/ustring.hxx> #include <com/sun/star/uno/XInterface.hpp> @@ -35,6 +36,8 @@ typedef ::std::map< OUString, css::uno::Reference< css::uno::XInterface > > IdMa class XMLOFF_DLLPUBLIC UnoInterfaceToUniqueIdentifierMapper { + typedef std::deque< OUString > Reserved_t; + public: UnoInterfaceToUniqueIdentifierMapper(); @@ -50,12 +53,16 @@ public: */ bool registerReference( const OUString& rIdentifier, const css::uno::Reference< css::uno::XInterface >& rInterface ); - /** always registers the given uno object with the given identifier. + /** reserves an identifier for later registration. - In contrast to registerReference(), this here overwrites any - earlier registration of the same identifier - */ - void registerReferenceAlways( const OUString& rIdentifier, const css::uno::Reference< css::uno::XInterface >& rInterface ); + @returns + false, if the identifier already exists + */ + bool reserveIdentifier( const OUString& rIdentifier ); + + /** registers the given uno object with reserved identifier. + */ + bool registerReservedReference( const OUString& rIdentifier, const css::uno::Reference< css::uno::XInterface >& rInterface ); /** @returns the identifier for the given uno object. If this uno object is not already @@ -72,10 +79,12 @@ public: private: bool findReference( const css::uno::Reference< css::uno::XInterface >& rInterface, IdMap_t::const_iterator& rIter ) const; bool findIdentifier( const OUString& rIdentifier, IdMap_t::const_iterator& rIter ) const; - void insertReference( const OUString& rIdentifier, const css::uno::Reference< css::uno::XInterface >& rInterface ); + bool findReserved( const OUString& rIdentifier ) const; + bool findReserved( const OUString& rIdentifier, Reserved_t::const_iterator& rIter ) const; IdMap_t maEntries; sal_uInt32 mnNextId; + Reserved_t maReserved; }; } |