Kaydet (Commit) c3007ce6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Probably better to set xEntry->nKey = XML_NAMESPACE_UNKNOWN here

...to match the local var nKey, than to rely on xEntry->nKey being initialized
to zero (which doesn't even match XML_NAMESPACE_UNKNOWN = USHRT_MAX) by

  new NameSpaceEntry()

Change-Id: I415418b7a1446172a5dfb910df0ce747ebc0da04
üst f100f58d
...@@ -284,7 +284,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName, ...@@ -284,7 +284,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
OUString *pNamespace, OUString *pNamespace,
bool bCache) const bool bCache) const
{ {
sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN; sal_uInt16 nKey;
NameSpaceHash::const_iterator it; NameSpaceHash::const_iterator it;
if (bCache) if (bCache)
...@@ -307,7 +307,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName, ...@@ -307,7 +307,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
} }
else else
{ {
rtl::Reference<NameSpaceEntry> xEntry(new NameSpaceEntry()); rtl::Reference<NameSpaceEntry> xEntry(new NameSpaceEntry);
sal_Int32 nColonPos = rAttrName.indexOf( ':' ); sal_Int32 nColonPos = rAttrName.indexOf( ':' );
if( -1L == nColonPos ) if( -1L == nColonPos )
...@@ -342,6 +342,8 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName, ...@@ -342,6 +342,8 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
else if( nColonPos == -1L ) else if( nColonPos == -1L )
// not found, and no namespace: 'namespace' none // not found, and no namespace: 'namespace' none
nKey = xEntry->nKey = XML_NAMESPACE_NONE; nKey = xEntry->nKey = XML_NAMESPACE_NONE;
else
nKey = xEntry->nKey = XML_NAMESPACE_UNKNOWN;
if (bCache) if (bCache)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment