summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-20 11:20:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-20 11:20:41 +0100
commitc3007ce68018f02d618797f4558b7b803f786d0b (patch)
treee569b140a83cdf52a418a42929bf570da3103aeb
parentf100f58dfbd3d0b61ce35cd12a7afe70440425b2 (diff)
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
-rw-r--r--xmloff/source/core/nmspmap.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index 8f6cb4801aca..3acc39b2a9d5 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -284,7 +284,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
OUString *pNamespace,
bool bCache) const
{
- sal_uInt16 nKey = XML_NAMESPACE_UNKNOWN;
+ sal_uInt16 nKey;
NameSpaceHash::const_iterator it;
if (bCache)
@@ -307,7 +307,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
}
else
{
- rtl::Reference<NameSpaceEntry> xEntry(new NameSpaceEntry());
+ rtl::Reference<NameSpaceEntry> xEntry(new NameSpaceEntry);
sal_Int32 nColonPos = rAttrName.indexOf( ':' );
if( -1L == nColonPos )
@@ -342,6 +342,8 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
else if( nColonPos == -1L )
// not found, and no namespace: 'namespace' none
nKey = xEntry->nKey = XML_NAMESPACE_NONE;
+ else
+ nKey = xEntry->nKey = XML_NAMESPACE_UNKNOWN;
if (bCache)
{