summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-11-19 08:41:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-11-19 09:32:15 +0100
commit88e0b283c26dea873442017229c5b7fe2c862494 (patch)
tree696bbd5e599c3848aadd7cef523ff02fdb0126c0 /xmloff
parent0098563895f6a4024b400582d1bf93cb4435ceed (diff)
disable spurious SAL_WARN
in the FastParser case, those name/prefix fields in context are not initialised, so don't warn for that case Change-Id: I485dd1b86d81ea2b6f03fa6a8ecf5fb23d46a8e1 Reviewed-on: https://gerrit.libreoffice.org/83153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlimp.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 0b9c8eb2b8af..51a1ef9b2c0d 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -778,11 +778,14 @@ rName
#ifdef DBG_UTIL
// Non product only: check if endElement call matches startELement call.
- OUString aLocalName;
- sal_uInt16 nPrefix =
- mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
- SAL_WARN_IF( xContext->GetPrefix() != nPrefix, "xmloff.core", "SvXMLImport::endElement: popped context has wrong prefix" );
- SAL_WARN_IF( xContext->GetLocalName() != aLocalName, "xmloff.core", "SvXMLImport::endElement: popped context has wrong lname" );
+ if (!xContext->GetLocalName().isEmpty()) // prefix+localname are only valid in the non-FastParser case
+ {
+ OUString aLocalName;
+ sal_uInt16 nPrefix =
+ mpNamespaceMap->GetKeyByAttrName( rName, &aLocalName );
+ SAL_WARN_IF( xContext->GetPrefix() != nPrefix, "xmloff.core", "SvXMLImport::endElement: popped context has wrong prefix" );
+ SAL_WARN_IF( xContext->GetLocalName() != aLocalName, "xmloff.core", "SvXMLImport::endElement: popped context has wrong lname" );
+ }
#endif
// Call a EndElement at the current context.