diff options
author | Kurt Zenker <kz@openoffice.org> | 2005-01-14 10:59:08 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2005-01-14 10:59:08 +0000 |
commit | 77056086aa4881cb274714674fe156456bbc2ac0 (patch) | |
tree | 60e8cd30539171600b9b1005111fa80a5bb0eee2 /xmloff | |
parent | 20f7165c82f1d3efb4cdc855e3f1e56e64aef55f (diff) |
INTEGRATION: CWS impress25 (1.2.16); FILE MERGED
2004/12/10 16:36:02 cl 1.2.16.1: #i38662# create id's with an 'id' prefix so they are valid rng ids
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx index 15fd9dcd55d0..ba4cc036ceca 100644 --- a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx +++ b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx @@ -26,7 +26,9 @@ const OUString& UnoInterfaceToUniqueIdentifierMapper::registerReference( const R } else { - return (*maEntries.insert( IdMap_t::value_type( OUString::valueOf( mnNextId++ ), rInterface ) ).first).first; + OUString aId( RTL_CONSTASCII_USTRINGPARAM( "id" ) ); + aId += OUString::valueOf( mnNextId++ ); + return (*maEntries.insert( IdMap_t::value_type( aId, rInterface ) ).first).first; } } @@ -54,7 +56,13 @@ bool UnoInterfaceToUniqueIdentifierMapper::registerReference( const OUString& rI const sal_Unicode *p = rIdentifier.getStr(); sal_Int32 nLength = rIdentifier.getLength(); - // see if the identifier is a pure integer value + // see if the identifier is 'id' followed by a pure integer value + if( nLength < 2 || p[0] != 'i' || p[1] != 'd' ) + return true; + + nLength -= 2; + p += 2; + while(nLength--) { if( (*p < '0') || (*p > '9') ) @@ -66,7 +74,7 @@ bool UnoInterfaceToUniqueIdentifierMapper::registerReference( const OUString& rI // the identifier is a pure integer value // so we make sure we will never generate // an integer value like this one - sal_Int32 nId = rIdentifier.toInt32(); + sal_Int32 nId = rIdentifier.copy(2).toInt32(); if( mnNextId <= nId ) mnNextId = nId + 1; |