summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-11-19 08:41:37 +0200
committerMichael Meeks <michael.meeks@collabora.com>2020-06-16 11:20:16 +0200
commitb89ba9d0d0090ce50079e2ae8bc6f9ec3386b283 (patch)
treedbfc7e9c8781581f545a298166cf5b68726c53e5 /xmloff
parent2db82d345145b0e568e1d0ac141849ef4246533f (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96433 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlimp.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 2c809d1112cb..fc0b407da3f2 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -778,12 +778,15 @@ 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 '"
- << aLocalName << "' expected. '" << xContext->GetLocalName() << "' with impl " << getImplementationName() );
+ 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 '"
+ << aLocalName << "' expected. '" << xContext->GetLocalName() << "' with impl " << getImplementationName() );
+ }
#endif
// Call a EndElement at the current context.