sax/source/tools/fastserializer.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit c09561bb3d401b55c690b309cc44a4104d987f1a
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Nov 13 10:35:11 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Nov 14 06:54:28 2025 +0100

    improve debug message
    
    Change-Id: I7cb060833d20eba45894c10d32e54c118fea2b68
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193956
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/sax/source/tools/fastserializer.cxx 
b/sax/source/tools/fastserializer.cxx
index 5837fa3c0d6c..dcd170aece6d 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -21,6 +21,7 @@
 
 #include <com/sun/star/xml/sax/FastTokenHandler.hpp>
 #include <rtl/math.h>
+#include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
 #include <comphelper/processfactory.hxx>
 
@@ -466,8 +467,16 @@ namespace sax_fastparser {
 #ifdef DBG_UTIL
             // Well-formedness constraint: Unique Att Spec
             OString const nameId(getId(nToken));
-            SAL_WARN_IF(DebugAttributes.find(nameId) != DebugAttributes.end(), 
 "sax", "Duplicate attribute: " << nameId );
-            assert(DebugAttributes.find(nameId) == DebugAttributes.end());
+            if (DebugAttributes.find(nameId) != DebugAttributes.end())
+            {
+                OStringBuffer aValuesBuf;
+                for (size_t k = 0; k < j; k++)
+                    if (Tokens[k] == nToken)
+                        aValuesBuf.append(nameId + "=" + 
rAttrList.getFastAttributeValue(k));
+                aValuesBuf.append(" " + nameId + "=" + 
rAttrList.getFastAttributeValue(j));
+                SAL_WARN("sax", "Duplicate attribute, " << 
aValuesBuf.toString());
+                assert(false);
+            }
             DebugAttributes.insert(nameId);
 #endif
 

Reply via email to