[Libreoffice-commits] core.git: compilerplugins/clang dbaccess/source include/xmloff reportdesign/source sc/source starmath/source svx/source sw/source xmloff/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 2 16:39:51 UTC 2020


 compilerplugins/clang/sallogareas.cxx                           |   15 ++++++--
 dbaccess/source/filter/xml/xmlColumn.cxx                        |    2 -
 dbaccess/source/filter/xml/xmlComponent.cxx                     |    2 -
 dbaccess/source/filter/xml/xmlConnectionResource.cxx            |    2 -
 dbaccess/source/filter/xml/xmlDataSource.cxx                    |    2 -
 dbaccess/source/filter/xml/xmlDataSourceInfo.cxx                |    2 -
 dbaccess/source/filter/xml/xmlDataSourceSetting.cxx             |    2 -
 dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx             |    2 -
 dbaccess/source/filter/xml/xmlHierarchyCollection.cxx           |    2 -
 dbaccess/source/filter/xml/xmlLogin.cxx                         |    2 -
 dbaccess/source/filter/xml/xmlQuery.cxx                         |    2 -
 dbaccess/source/filter/xml/xmlServerDatabase.cxx                |    2 -
 dbaccess/source/filter/xml/xmlTable.cxx                         |    4 +-
 include/xmloff/xmlictxt.hxx                                     |    9 +++++
 reportdesign/source/filter/xml/xmlCell.cxx                      |    2 -
 reportdesign/source/filter/xml/xmlColumn.cxx                    |    2 -
 reportdesign/source/filter/xml/xmlComponent.cxx                 |    2 -
 reportdesign/source/filter/xml/xmlCondPrtExpr.cxx               |    2 -
 reportdesign/source/filter/xml/xmlControlProperty.cxx           |    2 -
 reportdesign/source/filter/xml/xmlFormatCondition.cxx           |    2 -
 reportdesign/source/filter/xml/xmlFormattedField.cxx            |    2 -
 reportdesign/source/filter/xml/xmlFunction.cxx                  |    2 -
 reportdesign/source/filter/xml/xmlGroup.cxx                     |    2 -
 reportdesign/source/filter/xml/xmlImage.cxx                     |    2 -
 reportdesign/source/filter/xml/xmlMasterFields.cxx              |    2 -
 reportdesign/source/filter/xml/xmlReport.cxx                    |    2 -
 reportdesign/source/filter/xml/xmlReportElement.cxx             |    2 -
 reportdesign/source/filter/xml/xmlSection.cxx                   |    2 -
 reportdesign/source/filter/xml/xmlTable.cxx                     |    2 -
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx            |    2 -
 sc/source/filter/xml/xmlstyli.cxx                               |    4 +-
 sc/source/filter/xml/xmltabi.cxx                                |    2 -
 starmath/source/mathmlimport.cxx                                |   14 +++----
 svx/source/xml/xmlxtimp.cxx                                     |    2 -
 sw/source/filter/xml/xmlbrsh.cxx                                |    4 +-
 sw/source/filter/xml/xmlfmt.cxx                                 |    4 +-
 sw/source/filter/xml/xmlitem.cxx                                |    2 -
 sw/source/uibase/config/StoredChapterNumbering.cxx              |    2 -
 xmloff/source/chart/SchXMLParagraphContext.cxx                  |    2 -
 xmloff/source/chart/XMLLabelSeparatorContext.cxx                |    2 -
 xmloff/source/chart/XMLSymbolImageContext.cxx                   |    4 +-
 xmloff/source/core/xmlictxt.cxx                                 |    5 ++
 xmloff/source/draw/XMLNumberStyles.cxx                          |    4 +-
 xmloff/source/draw/animimp.cxx                                  |    6 +--
 xmloff/source/draw/ximpbody.cxx                                 |    2 -
 xmloff/source/draw/ximppage.cxx                                 |    3 +
 xmloff/source/draw/ximpstyl.cxx                                 |   18 +++++-----
 xmloff/source/meta/xmlversion.cxx                               |    2 -
 xmloff/source/style/DashStyle.cxx                               |    2 -
 xmloff/source/style/GradientStyle.cxx                           |    2 -
 xmloff/source/style/HatchStyle.cxx                              |    2 -
 xmloff/source/style/ImageStyle.cxx                              |    2 -
 xmloff/source/style/MarkerStyle.cxx                             |    2 -
 xmloff/source/style/PageHeaderFooterContext.cxx                 |    2 -
 xmloff/source/style/TransGradientStyle.cxx                      |    2 -
 xmloff/source/style/XMLBackgroundImageContext.cxx               |    4 +-
 xmloff/source/style/XMLFontStylesContext.cxx                    |    6 +--
 xmloff/source/style/XMLFootnoteSeparatorImport.cxx              |    2 -
 xmloff/source/style/prstylei.cxx                                |    2 -
 xmloff/source/style/xmlnumfi.cxx                                |   12 +++---
 xmloff/source/style/xmlnumi.cxx                                 |   12 +++---
 xmloff/source/style/xmlprcon.cxx                                |    4 +-
 xmloff/source/style/xmltabi.cxx                                 |    4 +-
 xmloff/source/table/XMLTableImport.cxx                          |    4 +-
 xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx |    2 -
 xmloff/source/text/XMLSectionFootnoteConfigImport.cxx           |    2 -
 xmloff/source/text/XMLTextColumnsContext.cxx                    |    8 ++--
 xmloff/source/text/XMLTextMasterPageContext.cxx                 |    2 -
 xmloff/source/text/txtdropi.cxx                                 |    2 -
 xmloff/source/text/txtparai.cxx                                 |    2 -
 70 files changed, 134 insertions(+), 112 deletions(-)

New commits:
commit 28be7b98070b7475cc675e76f075c941133cb790
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Mon Nov 2 15:37:28 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Nov 2 17:39:10 2020 +0100

    create common macro and method for logging unknown attributes
    
    instead of repeating the code everywhere
    
    Change-Id: Idb94054b392ed256e64259cdb17d1522bf3c52b1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105184
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index e0d6d160101f..bb256c6d7431 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -75,18 +75,23 @@ bool SalLogAreas::VisitCallExpr( const CallExpr* call )
     if( ignoreLocation( call ))
         return true;
     const FunctionDecl* func = call->getDirectCallee();
-    if( !func )
+    if( !func || !func->getIdentifier())
         return true;
 
-    if( !( func->getNumParams() == 5 && func->getIdentifier() != NULL
-          && ( func->getName() == "sal_detail_log" || func->getName() == "log" || func->getName() == "DbgUnhandledException")) )
+    auto name = func->getName();
+    if( !( name == "sal_detail_log" || name == "log" || name == "DbgUnhandledException" || name == "XMLOFF_WARN_UNKNOWN") )
         return true;
 
     auto tc = loplugin::DeclCheck(func);
     enum class LogCallKind { Sal, DbgUnhandledException};
     LogCallKind kind;
     int areaArgIndex;
-    if( tc.Function("sal_detail_log") || tc.Function("log").Namespace("detail").Namespace("sal").GlobalNamespace() )
+    if( tc.Function("XMLOFF_WARN_UNKNOWN") )
+        {
+        kind = LogCallKind::Sal; // fine
+        areaArgIndex = 0;
+        }
+    else if( tc.Function("sal_detail_log") || tc.Function("log").Namespace("detail").Namespace("sal").GlobalNamespace() )
         {
         kind = LogCallKind::Sal; // fine
         areaArgIndex = 1;
@@ -121,6 +126,8 @@ bool SalLogAreas::VisitCallExpr( const CallExpr* call )
     if( loplugin::DeclCheck(inFunction).Function("log").Namespace("detail").Namespace("sal").GlobalNamespace()
         || loplugin::DeclCheck(inFunction).Function("sal_detail_logFormat").GlobalNamespace() )
         return true; // These functions only forward to sal_detail_log, so ok.
+    if( loplugin::DeclCheck(inFunction).Function("XMLOFF_WARN_UNKNOWN").GlobalNamespace())
+        return true;
     if( call->getArg( areaArgIndex )->isNullPointerConstant( compiler.getASTContext(),
         Expr::NPC_ValueDependentIsNotNull ) != Expr::NPCK_NotNull )
         { // If the area argument is a null pointer, that is allowed only for SAL_DEBUG.
diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx
index 334c4fbfcbe4..9d8560cf1364 100644
--- a/dbaccess/source/filter/xml/xmlColumn.cxx
+++ b/dbaccess/source/filter/xml/xmlColumn.cxx
@@ -79,7 +79,7 @@ OXMLColumn::OXMLColumn( ODBFilter& rImport
                 m_sCellStyleName = sValue;
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " value=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN_ATTR("dbaccess", aIter.getToken(), aIter.toString());
         }
     }
 }
diff --git a/dbaccess/source/filter/xml/xmlComponent.cxx b/dbaccess/source/filter/xml/xmlComponent.cxx
index 5245c1c3423c..9d67ab95d197 100644
--- a/dbaccess/source/filter/xml/xmlComponent.cxx
+++ b/dbaccess/source/filter/xml/xmlComponent.cxx
@@ -66,7 +66,7 @@ OXMLComponent::OXMLComponent( ODBFilter& rImport
                 bAsTemplate = sValue == s_sTRUE;
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN_ATTR("dbaccess", aIter.getToken(), aIter.toString());
         }
     }
     if ( !(!sHREF.isEmpty() && !sName.isEmpty() && _xParentContainer.is()) )
diff --git a/dbaccess/source/filter/xml/xmlConnectionResource.cxx b/dbaccess/source/filter/xml/xmlConnectionResource.cxx
index 9f15cf74b81e..70f7fe210415 100644
--- a/dbaccess/source/filter/xml/xmlConnectionResource.cxx
+++ b/dbaccess/source/filter/xml/xmlConnectionResource.cxx
@@ -68,7 +68,7 @@ OXMLConnectionResource::OXMLConnectionResource( ODBFilter& rImport,
                 aProperty.Name = "Actuate";
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN_ATTR("dbaccess", aIter.getToken(), aIter.toString());
         }
         if ( !aProperty.Name.isEmpty() )
         {
diff --git a/dbaccess/source/filter/xml/xmlDataSource.cxx b/dbaccess/source/filter/xml/xmlDataSource.cxx
index 53095dfe0e2f..c179cb23ded9 100644
--- a/dbaccess/source/filter/xml/xmlDataSource.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSource.cxx
@@ -148,7 +148,7 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport,
                     aProperty.Name = "JavaDriverClassPath";
                     break;
                 default:
-                    SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                    XMLOFF_WARN_UNKNOWN_ATTR("dbaccess", aIter.getToken(), aIter.toString());
             }
             if ( !aProperty.Name.isEmpty() )
             {
diff --git a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
index 82ab36eb2c75..ec1a42d6e9af 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx
@@ -72,7 +72,7 @@ OXMLDataSourceInfo::OXMLDataSourceInfo( ODBFilter& rImport
                 bFoundCharset = true;
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
         }
         if ( !aProperty.Name.isEmpty() )
         {
diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
index 3b7e6d512dc9..f709757a5f7d 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
@@ -81,7 +81,7 @@ OXMLDataSourceSetting::OXMLDataSourceSetting( ODBFilter& rImport
                 m_aSetting.Name = sValue;
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN_ATTR("dbaccess", aIter.getToken(), aIter.toString());
         }
     }
 
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 2f952504a242..0ee1445a8699 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -78,7 +78,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
                     sFileTypeExtension = sValue;
                     break;
                 default:
-                    SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                    XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
             }
             if ( !aProperty.Name.isEmpty() )
             {
diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
index 182463181e56..b3ea220ab996 100644
--- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
+++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
@@ -56,7 +56,7 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport
                 sName = sValue;
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
         }
     }
     if ( sName.isEmpty() || !_xParentContainer.is() )
diff --git a/dbaccess/source/filter/xml/xmlLogin.cxx b/dbaccess/source/filter/xml/xmlLogin.cxx
index c74d98be7ddd..a30988098595 100644
--- a/dbaccess/source/filter/xml/xmlLogin.cxx
+++ b/dbaccess/source/filter/xml/xmlLogin.cxx
@@ -94,7 +94,7 @@ OXMLLogin::OXMLLogin( ODBFilter& rImport,
                     }
                     break;
                 default:
-                    SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                    XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
             }
         }
         catch(const Exception&)
diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx
index 7ab4940da9d2..6a141eb6aa3f 100644
--- a/dbaccess/source/filter/xml/xmlQuery.cxx
+++ b/dbaccess/source/filter/xml/xmlQuery.cxx
@@ -54,7 +54,7 @@ OXMLQuery::OXMLQuery( ODBFilter& rImport
                 m_bEscapeProcessing = sValue == "true";
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
         }
     }
 }
diff --git a/dbaccess/source/filter/xml/xmlServerDatabase.cxx b/dbaccess/source/filter/xml/xmlServerDatabase.cxx
index 87ff119b5a79..590db077437b 100644
--- a/dbaccess/source/filter/xml/xmlServerDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlServerDatabase.cxx
@@ -64,7 +64,7 @@ OXMLServerDatabase::OXMLServerDatabase( ODBFilter& rImport,
                     sDatabaseName = sValue;
                     break;
                 default:
-                    SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                    XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
             }
         }
     }
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index 9477f13faf54..697f88a7f607 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -74,7 +74,7 @@ OXMLTable::OXMLTable( ODBFilter& _rImport
                 m_bApplyOrder = sValue == "true";
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
         }
     }
     uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
@@ -217,7 +217,7 @@ void OXMLTable::fillAttributes(const uno::Reference< XFastAttributeList > & _xAt
                 _rsTableName = sValue;
                 break;
             default:
-                SAL_WARN("dbaccess", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("dbaccess", aIter);
         }
     }
 }
diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
index 7753a00f3c68..03dd3121ba5c 100644
--- a/include/xmloff/xmlictxt.hxx
+++ b/include/xmloff/xmlictxt.hxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <rtl/ustring.hxx>
 #include <xmloff/namespacemap.hxx>
+#include <sax/fastattribs.hxx>
 #include <memory>
 
 namespace com::sun::star::xml::sax { class XAttributeList; }
@@ -131,6 +132,14 @@ public:
     virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) final override;
 };
 
+void XMLOFF_DLLPUBLIC XMLOFF_WARN_UNKNOWN(const char *area, sax_fastparser::FastAttributeList::FastAttributeIter const & rIter);
+
+#define XMLOFF_WARN_UNKNOWN_ATTR(area, token, value) \
+    SAL_WARN(area, "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(token) << "=" << value);
+
+#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token) \
+    SAL_WARN(area, "unknown element " << SvXMLImport::getPrefixAndNameFromToken(token));
+
 #endif // INCLUDED_XMLOFF_XMLICTXT_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx
index 39edf6f48815..d83621317f26 100644
--- a/reportdesign/source/filter/xml/xmlCell.cxx
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -75,7 +75,7 @@ OXMLCell::OXMLCell( ORptFilter& rImport
                 m_pContainer->setRowSpanned(sValue.toInt32());
                 break;
             default:
-                SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                 break;
         }
     }
diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx
index 0271084ea5cd..053535868bb1 100644
--- a/reportdesign/source/filter/xml/xmlColumn.cxx
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -63,7 +63,7 @@ OXMLRowColumn::OXMLRowColumn( ORptFilter& rImport
                 fillStyle(sValue);
                 break;
             default:
-                SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                 break;
         }
     }
diff --git a/reportdesign/source/filter/xml/xmlComponent.cxx b/reportdesign/source/filter/xml/xmlComponent.cxx
index 503537d38e28..184ed5d6558f 100644
--- a/reportdesign/source/filter/xml/xmlComponent.cxx
+++ b/reportdesign/source/filter/xml/xmlComponent.cxx
@@ -51,7 +51,7 @@ OXMLComponent::OXMLComponent( ORptFilter& _rImport
                     m_xComponent->setName(sValue);
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
             }
         }
         catch(const Exception&)
diff --git a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
index c0557a82de59..ba803f15e619 100644
--- a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
+++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
@@ -50,7 +50,7 @@ OXMLCondPrtExpr::OXMLCondPrtExpr( ORptFilter& _rImport
                     m_xComponent->setPropertyValue(PROPERTY_CONDITIONALPRINTEXPRESSION,uno::makeAny(ORptFilter::convertFormula(sValue)));
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
 
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx
index 8af7508269aa..c66453c14f9d 100644
--- a/reportdesign/source/filter/xml/xmlControlProperty.cxx
+++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx
@@ -98,7 +98,7 @@ OXMLControlProperty::OXMLControlProperty( ORptFilter& rImport
                 m_aSetting.Name = sValue;
                 break;
             default:
-                SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                 break;
         }
     }
diff --git a/reportdesign/source/filter/xml/xmlFormatCondition.cxx b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
index ac4e384958ee..716f0550c2ae 100644
--- a/reportdesign/source/filter/xml/xmlFormatCondition.cxx
+++ b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
@@ -60,7 +60,7 @@ OXMLFormatCondition::OXMLFormatCondition( ORptFilter& rImport,
                     m_sStyleName = sValue;
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlFormattedField.cxx b/reportdesign/source/filter/xml/xmlFormattedField.cxx
index 911ac23c683d..8ef64ff62423 100644
--- a/reportdesign/source/filter/xml/xmlFormattedField.cxx
+++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx
@@ -53,7 +53,7 @@ OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport
                     _xComponent->setDataField("rpt:PageNumber()");
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlFunction.cxx b/reportdesign/source/filter/xml/xmlFunction.cxx
index 13f5745156d9..bc08b77d37f1 100644
--- a/reportdesign/source/filter/xml/xmlFunction.cxx
+++ b/reportdesign/source/filter/xml/xmlFunction.cxx
@@ -70,7 +70,7 @@ OXMLFunction::OXMLFunction( ORptFilter& _rImport
                     m_xFunction->setDeepTraversing(sValue == s_sTRUE);
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index 7cdc9e8fe740..951e9391427d 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -158,7 +158,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
                     m_xGroup->setKeepTogether(lcl_getKeepTogetherOption(sValue));
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlImage.cxx b/reportdesign/source/filter/xml/xmlImage.cxx
index bb3f5c61d278..fe4d9395232f 100644
--- a/reportdesign/source/filter/xml/xmlImage.cxx
+++ b/reportdesign/source/filter/xml/xmlImage.cxx
@@ -83,7 +83,7 @@ OXMLImage::OXMLImage( ORptFilter& rImport,
                     _xComponent->setDataField(ORptFilter::convertFormula(sValue));
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlMasterFields.cxx b/reportdesign/source/filter/xml/xmlMasterFields.cxx
index a6676d5fb7ac..64cb935db286 100644
--- a/reportdesign/source/filter/xml/xmlMasterFields.cxx
+++ b/reportdesign/source/filter/xml/xmlMasterFields.cxx
@@ -53,7 +53,7 @@ OXMLMasterFields::OXMLMasterFields( ORptFilter& rImport,
                 sDetailField = sValue;
                 break;
             default:
-                SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                 break;
         }
     }
diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx
index c1dd1dcca681..a60b42133f69 100644
--- a/reportdesign/source/filter/xml/xmlReport.cxx
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -87,7 +87,7 @@ OXMLReport::OXMLReport( ORptFilter& rImport,
                     m_xReportDefinition->setName(sValue);
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlReportElement.cxx b/reportdesign/source/filter/xml/xmlReportElement.cxx
index 726304d4e71e..b71901927cd3 100644
--- a/reportdesign/source/filter/xml/xmlReportElement.cxx
+++ b/reportdesign/source/filter/xml/xmlReportElement.cxx
@@ -60,7 +60,7 @@ OXMLReportElement::OXMLReportElement( ORptFilter& rImport,
                     m_xComponent->setPrintRepeatedValues(sValue == s_sTRUE);
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx
index e7ef44234af2..a32b6ecf97d7 100644
--- a/reportdesign/source/filter/xml/xmlSection.cxx
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -73,7 +73,7 @@ OXMLSection::OXMLSection( ORptFilter& rImport,
                     m_xSection->setRepeatSection(sValue == s_sTRUE );
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
             }
         }
     }
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index 301c32541958..3a882dc7c37f 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -99,7 +99,7 @@ OXMLTable::OXMLTable( ORptFilter& rImport
                     m_sStyleName = sValue;
                     break;
                 default:
-                    SAL_WARN("reportdesign", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << sValue);
+                    XMLOFF_WARN_UNKNOWN("reportdesign", aIter);
                     break;
             }
         }
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index 1e04f85cbf53..a728b6427a70 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -59,7 +59,7 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport,
         if( aIter.getToken() == XML_ELEMENT(STYLE, XML_DISPLAY) )
             bDisplay = IsXMLToken(aIter.toString(), XML_TRUE);
         else
-            SAL_WARN("sc", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+            XMLOFF_WARN_UNKNOWN("sc", aIter);
     }
     if( bLeft )
     {
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index 3a6df40abfe7..29d97922ca31 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -312,7 +312,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableCellPropsConte
             if ( aIter.getToken() == XML_ELEMENT(XLINK, XML_HREF) )
                 sURL = aIter.toString();
             else
-                SAL_WARN("sc", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("sc", aIter);
         }
         if ( !sURL.isEmpty() )
         {
@@ -363,7 +363,7 @@ ScXMLMapContext::ScXMLMapContext(SvXMLImport& rImport, sal_Int32 /*nElement*/,
                 msBaseCell = sValue;
                 break;
             default:
-                SAL_WARN("sc", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("sc", aIter);
         }
     }
 }
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index 3784b9d54455..535336dc0ce8 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -462,7 +462,7 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext(
                 bDeleteRows = IsXMLToken(aIter, XML_TRUE);
                 break;
             default:
-                SAL_WARN("sc", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(nToken) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("sc", aIter);
             }
         }
     }
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 675081ef574e..6700afaa02de 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -625,7 +625,7 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
                 bMvFound = true;
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 break;
         }
     }
@@ -761,7 +761,7 @@ void SmXMLTokenAttrHelper::RetrieveAttrs(const uno::Reference<xml::sax::XFastAtt
                 mbMvFound = true;
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 break;
         }
     }
@@ -1071,7 +1071,7 @@ void SmXMLFencedContext_Impl::startFastElement(sal_Int32 /*nElement*/, const uno
                 cEnd = sValue[0];
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 /*Go to superclass*/
                 break;
         }
@@ -1216,7 +1216,7 @@ void SmXMLAnnotationContext_Impl::startFastElement(sal_Int32 /*nElement*/, const
                 bIsStarMath= sValue == "StarMath 5.0";
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 break;
         }
     }
@@ -1429,7 +1429,7 @@ void SmXMLOperatorContext_Impl::startFastElement(sal_Int32 /*nElement*/, const u
                 bIsStretchy = sValue == GetXMLToken(XML_TRUE);
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 break;
         }
     }
@@ -1496,7 +1496,7 @@ void SmXMLSpaceContext_Impl::startFastElement(sal_Int32 /*nElement*/,
                     SAL_WARN("starmath", "ignore mspace's width: " << sValue);
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 break;
         }
     }
@@ -2511,7 +2511,7 @@ void SmXMLActionContext_Impl::startFastElement(sal_Int32 /*nElement*/, const uno
                 }
                 break;
             default:
-                SAL_WARN("starmath", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("starmath", aIter);
                 break;
         }
     }
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx
index 4fc35c289993..25da3328fc15 100644
--- a/svx/source/xml/xmlxtimp.cxx
+++ b/svx/source/xml/xmlxtimp.cxx
@@ -209,7 +209,7 @@ void SvxXMLTableImportContext::importColor( const uno::Reference< XFastAttribute
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx
index 8ecce1f1fc78..092d3c91c03b 100644
--- a/sw/source/filter/xml/xmlbrsh.cxx
+++ b/sw/source/filter/xml/xmlbrsh.cxx
@@ -99,7 +99,7 @@ void SwXMLBrushItemImportContext::ProcessAttrs(
                 *pItem, sValue, MID_GRAPHIC_FILTER, rUnitConv );
             break;
         default:
-            SAL_WARN("sw", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("sw", aIter);
         }
     }
 
@@ -118,7 +118,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SwXMLBrushItemImportCo
                 return new XMLBase64ImportContext(GetImport(), m_xBase64Stream);
         }
     }
-    SAL_WARN("sw", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("sw", nElement);
     return nullptr;
 }
 
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 446b5fd13aa3..80d808aeeaec 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -247,7 +247,7 @@ SwXMLConditionContext_Impl::SwXMLConditionContext_Impl(
                 sApplyStyle = sValue;
                 break;
             default:
-                SAL_WARN("sw", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("sw", aIter);
         }
     }
 }
@@ -613,7 +613,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SwXMLItemSetStyleConte
             return pTextStyle->createFastChildContext( nElement, xAttrList );
         }
         default:
-            SAL_WARN("sw", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+            XMLOFF_WARN_UNKNOWN_ELEMENT("sw", nElement);
     }
 
     return nullptr;
diff --git a/sw/source/filter/xml/xmlitem.cxx b/sw/source/filter/xml/xmlitem.cxx
index bfc287a45109..899c0b6bb1ad 100644
--- a/sw/source/filter/xml/xmlitem.cxx
+++ b/sw/source/filter/xml/xmlitem.cxx
@@ -63,7 +63,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SwXMLItemSetContext::c
         return createFastChildContext( nElement, xAttrList, *pEntry ).get();
     }
     else
-        SAL_WARN("sw", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("sw", nElement);
     return nullptr;
 }
 
diff --git a/sw/source/uibase/config/StoredChapterNumbering.cxx b/sw/source/uibase/config/StoredChapterNumbering.cxx
index 07d72b222521..eb97b1cbcee9 100644
--- a/sw/source/uibase/config/StoredChapterNumbering.cxx
+++ b/sw/source/uibase/config/StoredChapterNumbering.cxx
@@ -290,7 +290,7 @@ public:
                     SAL_WARN("xmloff", "unknown value for style:family=" << aIter.toString());
             }
             else
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
 
         if (nFamily != XmlStyleFamily::DATA_STYLE && !name.isEmpty() && !displayName.isEmpty())
         {
diff --git a/xmloff/source/chart/SchXMLParagraphContext.cxx b/xmloff/source/chart/SchXMLParagraphContext.cxx
index 95f484888d08..75c8be5e4764 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.cxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.cxx
@@ -80,7 +80,7 @@ void SchXMLParagraphContext::startFastElement(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
diff --git a/xmloff/source/chart/XMLLabelSeparatorContext.cxx b/xmloff/source/chart/XMLLabelSeparatorContext.cxx
index 11c3710d9d10..1d05bfca1cfb 100644
--- a/xmloff/source/chart/XMLLabelSeparatorContext.cxx
+++ b/xmloff/source/chart/XMLLabelSeparatorContext.cxx
@@ -48,7 +48,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLLabelSeparatorConte
     {
         return new SchXMLParagraphContext( GetImport(), m_aSeparator );
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/chart/XMLSymbolImageContext.cxx b/xmloff/source/chart/XMLSymbolImageContext.cxx
index 9475abaaf947..536392d9d892 100644
--- a/xmloff/source/chart/XMLSymbolImageContext.cxx
+++ b/xmloff/source/chart/XMLSymbolImageContext.cxx
@@ -75,7 +75,7 @@ void XMLSymbolImageContext::startFastElement(
                 // it is always assumed 'actuate=onLoad', 'type=simple', 'show=embed'
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -93,7 +93,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLSymbolImageContext:
                 return new XMLBase64ImportContext( GetImport(), mxBase64Stream );
         }
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/core/xmlictxt.cxx b/xmloff/source/core/xmlictxt.cxx
index a0b22219b29e..69fce5c5208a 100644
--- a/xmloff/source/core/xmlictxt.cxx
+++ b/xmloff/source/core/xmlictxt.cxx
@@ -147,4 +147,9 @@ css::uno::Sequence< sal_Int8 > SAL_CALL SvXMLImportContext::getImplementationId(
     return css::uno::Sequence<sal_Int8>();
 }
 
+void XMLOFF_WARN_UNKNOWN(const char *area, sax_fastparser::FastAttributeList::FastAttributeIter const & rIter)
+{
+    SAL_WARN(area, "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(rIter.getToken()) << " value=" << rIter.toString());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx
index 2894b0a04616..1696fc038ac8 100644
--- a/xmloff/source/draw/XMLNumberStyles.cxx
+++ b/xmloff/source/draw/XMLNumberStyles.cxx
@@ -545,7 +545,7 @@ SdXMLNumberFormatMemberImportContext::SdXMLNumberFormatMemberImportContext(
                 mbTextual = IsXMLToken( sValue, XML_TRUE );
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
@@ -595,7 +595,7 @@ SdXMLNumberFormatImportContext::SdXMLNumberFormatImportContext( SdXMLImport& rIm
         if( aIter.getToken() == XML_ELEMENT(NUMBER, XML_AUTOMATIC_ORDER) )
                 mbAutomatic = IsXMLToken( sValue, XML_TRUE );
         else
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
     }
 }
 
diff --git a/xmloff/source/draw/animimp.cxx b/xmloff/source/draw/animimp.cxx
index 47417bcc27a1..89cf45a37540 100644
--- a/xmloff/source/draw/animimp.cxx
+++ b/xmloff/source/draw/animimp.cxx
@@ -405,7 +405,7 @@ XMLAnimationsSoundContext::XMLAnimationsSoundContext( SvXMLImport& rImport, sal_
                 pParent->mbPlayFull = IsXMLToken( sValue, XML_TRUE );
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -443,7 +443,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport,
             meKind = XMLE_PLAY;
             break;
         default:
-            SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+            XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
             // unknown action, overread
             return;
     }
@@ -480,7 +480,7 @@ XMLAnimationsEffectContext::XMLAnimationsEffectContext( SvXMLImport& rImport,
                 maPathShapeId = sValue;
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx
index ac2015982a19..1fb556828199 100644
--- a/xmloff/source/draw/ximpbody.cxx
+++ b/xmloff/source/draw/ximpbody.cxx
@@ -339,7 +339,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLBodyContext::crea
             break;
         }
         default:
-            SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+            XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     }
     return nullptr;
 }
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 6b987c42d417..96265c78bb9f 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -134,7 +134,8 @@ DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, const Refere
             }
             break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);        }
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
+        }
     }
 
     mxAnnotation->setPosition( aPosition );
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index f875ba196e65..10720869eaa3 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -106,7 +106,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLDrawingPageProper
                 rProperties.push_back( aPropState );
             }
             else
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
         break;
     }
@@ -348,7 +348,7 @@ SdXMLPageMasterStyleContext::SdXMLPageMasterStyleContext(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -380,7 +380,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLPageMasterContext
         return mxPageMasterStyle.get();
     }
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
 
     return nullptr;
 }
@@ -413,7 +413,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLPresentationPageL
         maList.push_back(xLclContext);
     }
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
 
     return xContext.get();
 }
@@ -664,7 +664,7 @@ SdXMLPresentationPlaceholderContext::SdXMLPresentationPlaceholderContext(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -730,7 +730,7 @@ SdXMLMasterPageContext::SdXMLMasterPageContext(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
@@ -882,7 +882,7 @@ SvXMLStyleContext* SdXMLStylesContext::CreateStyleChildContext(
         case XML_ELEMENT(STYLE, XML_STYLE):
             break; // ignore
         default:
-            SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+            XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     }
 
     // call base class
@@ -1397,7 +1397,7 @@ SdXMLHeaderFooterDeclContext::SdXMLHeaderFooterDeclContext(SvXMLImport& rImport,
         }
         else
         {
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -1425,7 +1425,7 @@ void SdXMLHeaderFooterDeclContext::endFastElement(sal_Int32 nToken)
     }
     else
     {
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nToken));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nToken);
     }
 }
 
diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx
index 7ae17f80c130..76fe43b5d2fb 100644
--- a/xmloff/source/meta/xmlversion.cxx
+++ b/xmloff/source/meta/xmlversion.cxx
@@ -186,7 +186,7 @@ XMLVersionContext::XMLVersionContext( XMLVersionListImport& rImport,
             break;
         }
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
             break;
         }
     }
diff --git a/xmloff/source/style/DashStyle.cxx b/xmloff/source/style/DashStyle.cxx
index 59bcc14d2b6b..f2303dc2273e 100644
--- a/xmloff/source/style/DashStyle.cxx
+++ b/xmloff/source/style/DashStyle.cxx
@@ -175,7 +175,7 @@ void XMLDashStyleImport::importXML(
             }
             break;
         default:
-            SAL_WARN("xmloff.style", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aStrValue);
+            XMLOFF_WARN_UNKNOWN("xmloff.style", aIter);
         }
     }
 
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx
index 46567e5f8c11..47349c515ea1 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -155,7 +155,7 @@ void XMLGradientStyleImport::importXML(
             break;
 
         default:
-            SAL_WARN("xmloff.style", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aStrValue);
+            XMLOFF_WARN_UNKNOWN("xmloff.style", aIter);
         }
     }
 
diff --git a/xmloff/source/style/HatchStyle.cxx b/xmloff/source/style/HatchStyle.cxx
index 61a51fbd7c02..45f0059f0023 100644
--- a/xmloff/source/style/HatchStyle.cxx
+++ b/xmloff/source/style/HatchStyle.cxx
@@ -122,7 +122,7 @@ void XMLHatchStyleImport::importXML(
                 break;
             }
             default:
-                SAL_WARN("xmloff.style", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aStrValue);
+                XMLOFF_WARN_UNKNOWN("xmloff.style", aIter);
         }
     }
 
diff --git a/xmloff/source/style/ImageStyle.cxx b/xmloff/source/style/ImageStyle.cxx
index b9be2e5318d0..59b4095c24e2 100644
--- a/xmloff/source/style/ImageStyle.cxx
+++ b/xmloff/source/style/ImageStyle.cxx
@@ -129,7 +129,7 @@ bool XMLImageStyle::importXML(uno::Reference<xml::sax::XFastAttributeList> const
                 // ignore
                 break;
             default:
-                SAL_WARN("xmloff.style", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aStrValue);
+                XMLOFF_WARN_UNKNOWN("xmloff.style", aIter);
         }
     }
 
diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx
index ac19851fb3d6..181699026d8f 100644
--- a/xmloff/source/style/MarkerStyle.cxx
+++ b/xmloff/source/style/MarkerStyle.cxx
@@ -84,7 +84,7 @@ void XMLMarkerStyleImport::importXML(
                 bHasPathData = true;
                 break;
             default:
-                SAL_WARN("xmloff.style", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aStrValue);
+                XMLOFF_WARN_UNKNOWN("xmloff.style", aIter);
         }
     }
 
diff --git a/xmloff/source/style/PageHeaderFooterContext.cxx b/xmloff/source/style/PageHeaderFooterContext.cxx
index 231ce63b1269..3c9e0993b559 100644
--- a/xmloff/source/style/PageHeaderFooterContext.cxx
+++ b/xmloff/source/style/PageHeaderFooterContext.cxx
@@ -63,7 +63,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > PageHeaderFooterContex
                                            rMap,  nStartIndex, nEndIndex, aType);
     }
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
 
     return nullptr;
 }
diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx
index 811dc2e0ea0b..2acd54ad7bdb 100644
--- a/xmloff/source/style/TransGradientStyle.cxx
+++ b/xmloff/source/style/TransGradientStyle.cxx
@@ -168,7 +168,7 @@ void XMLTransGradientStyleImport::importXML(
             break;
 
         default:
-            SAL_WARN("xmloff.style", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aStrValue);
+            XMLOFF_WARN_UNKNOWN("xmloff.style", aIter);
         }
     }
 
diff --git a/xmloff/source/style/XMLBackgroundImageContext.cxx b/xmloff/source/style/XMLBackgroundImageContext.cxx
index 8d546a2b7135..fc5293b831da 100644
--- a/xmloff/source/style/XMLBackgroundImageContext.cxx
+++ b/xmloff/source/style/XMLBackgroundImageContext.cxx
@@ -311,7 +311,7 @@ void XMLBackgroundImageContext::ProcessAttrs(
             }
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
@@ -353,7 +353,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLBackgroundImageCont
                 return new XMLBase64ImportContext( GetImport(), m_xBase64Stream );
         }
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index c98bbc212e4c..bdd86c93bd73 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -181,7 +181,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLFontStyleContextFon
         nElement == XML_ELEMENT(SVG_COMPAT, XML_FONT_FACE_SRC) )
         return new XMLFontStyleContextFontFaceSrc( GetImport(), *this );
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
@@ -224,7 +224,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLFontStyleContextFon
     if( nElement == XML_ELEMENT(SVG, XML_FONT_FACE_URI) ||
         nElement == XML_ELEMENT(SVG_COMPAT, XML_FONT_FACE_URI) )
         return new XMLFontStyleContextFontFaceUri( GetImport(), font );
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
@@ -253,7 +253,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLFontStyleContextFon
         }
     }
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
index b3a790302acd..f2b776510e6c 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
@@ -159,7 +159,7 @@ void XMLFootnoteSeparatorImport::startFastElement(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sAttrValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index 2d2ef1b4b047..5ed852e98e48 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -216,7 +216,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLPropStyleContext::c
                                                     maProperties,
                                                     xImpPrMap );
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index f02d8964c2d3..a7f9f1822cca 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -396,7 +396,7 @@ SvXMLNumFmtMapContext::SvXMLNumFmtMapContext( SvXMLImport& rImport,
                 sName = sValue;
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -429,7 +429,7 @@ SvXMLNumFmtPropContext::SvXMLNumFmtPropContext( SvXMLImport& rImport,
                 bColSet = ::sax::Converter::convertColor( m_nColor, sValue );
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -463,7 +463,7 @@ SvXMLNumFmtEmbeddedTextContext::SvXMLNumFmtEmbeddedTextContext( SvXMLImport& rIm
                 nTextPosition = nAttrVal;
         }
         else
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
     }
 }
 
@@ -772,7 +772,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
                 sCalendar = sValue;
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
     if ( aNumInfo.nMinDecimalDigits == -1)
@@ -838,7 +838,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLNumFmtElementCont
         return new SvXMLNumFmtEmbeddedTextContext( GetImport(), nElement, *this, xAttrList );
     }
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
@@ -1201,7 +1201,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport,
                 aNatNumAttr.Style = sValue;
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index a0325c5abc9a..4650f4e1c422 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -337,7 +337,7 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl(
             }
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -363,7 +363,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLListLevelStyleCo
                 return new XMLBase64ImportContext( GetImport(), xBase64Stream );
         }
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
@@ -689,7 +689,7 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
             }
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
@@ -832,7 +832,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLListLevelStyleAt
                                                              xAttrList,
                                                              rListLevel );
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
@@ -893,7 +893,7 @@ SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAli
                 rLLevel.SetIndentAt( nVal );
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
     rLLevel.SetLabelFollowedBy( eLabelFollowedBy );
@@ -946,7 +946,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLListStyleContext
 
         return xLevelStyle.get();
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/style/xmlprcon.cxx b/xmloff/source/style/xmlprcon.cxx
index 119e5bb86c17..cb0a6eca9e2f 100644
--- a/xmloff/source/style/xmlprcon.cxx
+++ b/xmloff/source/style/xmlprcon.cxx
@@ -67,7 +67,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLPropertySetContex
         XMLPropertyState aProp( nEntryIndex );
         return createFastChildContext( nElement, xAttrList, mrProperties, aProp );
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
@@ -81,7 +81,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvXMLPropertySetContex
     ::std::vector< XMLPropertyState > &/*rProperties*/,
     const XMLPropertyState& /*rProp*/ )
 {
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx
index a841402fed03..5cee4ae99234 100644
--- a/xmloff/source/style/xmltabi.cxx
+++ b/xmloff/source/style/xmltabi.cxx
@@ -134,7 +134,7 @@ SvxXMLTabStopContext_Impl::SvxXMLTabStopContext_Impl(
                 cTextFillChar = sValue[0];
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
@@ -170,7 +170,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLTabStopImportCon
         return xTabStopContext.get();
     }
     else
-        SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+        XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
 
     return nullptr;
 }
diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx
index 0498ae89a37f..b12f0d677318 100644
--- a/xmloff/source/table/XMLTableImport.cxx
+++ b/xmloff/source/table/XMLTableImport.cxx
@@ -799,7 +799,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableTemplateContex
                         maTableTemplate[pElements->msStyleName] = aIter.toString();
                         break;
                     default:
-                        SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                        XMLOFF_WARN_UNKNOWN("xmloff", aIter);
                 }
             }
         }
@@ -821,7 +821,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTableTemplateContex
                         maTableTemplate[pElements->msStyleName] = aIter.toString();
                         break;
                     default:
-                        SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                        XMLOFF_WARN_UNKNOWN("xmloff", aIter);
                 }
             }
         }
diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
index 81d9f32af949..6b1b7e5d37bf 100644
--- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
+++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx
@@ -157,7 +157,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLIndexBibliographyCo
                     break;
                 }
                 default:
-                    SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                    XMLOFF_WARN_UNKNOWN("xmloff", aIter);
                     break;
             }
         }
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
index 4849e46a4b81..26e8af646d37 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigImport.cxx
@@ -122,7 +122,7 @@ void XMLSectionFootnoteConfigImport::startFastElement(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sAttrValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
diff --git a/xmloff/source/text/XMLTextColumnsContext.cxx b/xmloff/source/text/XMLTextColumnsContext.cxx
index 6c5bc01077d3..0f42c9ff8de8 100644
--- a/xmloff/source/text/XMLTextColumnsContext.cxx
+++ b/xmloff/source/text/XMLTextColumnsContext.cxx
@@ -137,7 +137,7 @@ XMLTextColumnContext_Impl::XMLTextColumnContext_Impl(
                 aColumn.RightMargin = nVal;
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
             break;
         }
     }
@@ -205,7 +205,7 @@ XMLTextColumnSepContext_Impl::XMLTextColumnSepContext_Impl(
                                              pXML_Sep_Style_Enum );
             break;
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -247,7 +247,7 @@ XMLTextColumnsContext::XMLTextColumnsContext(
                 break;
             }
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 }
@@ -276,7 +276,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextColumnsContext:
 
         return mxColumnSep.get();
     }
-    SAL_WARN("xmloff", "unknown element " << SvXMLImport::getPrefixAndNameFromToken(nElement));
+    XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
     return nullptr;
 }
 
diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx
index 5803ec5790a8..a94b431cc009 100644
--- a/xmloff/source/text/XMLTextMasterPageContext.cxx
+++ b/xmloff/source/text/XMLTextMasterPageContext.cxx
@@ -103,7 +103,7 @@ XMLTextMasterPageContext::XMLTextMasterPageContext( SvXMLImport& rImport,
                 m_sDrawingPageStyle = aValue;
                 break;
             default:
-                SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << aIter.toString());
+                XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
diff --git a/xmloff/source/text/txtdropi.cxx b/xmloff/source/text/txtdropi.cxx
index cf67eb8fcbc4..cd1d4701ca5d 100644
--- a/xmloff/source/text/txtdropi.cxx
+++ b/xmloff/source/text/txtdropi.cxx
@@ -104,7 +104,7 @@ void XMLTextDropCapImportContext::ProcessAttrs(
             break;
 
         default:
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << "=" << sValue);
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
         }
     }
 
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 0ba8d3f36230..d56ef2791f73 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -170,7 +170,7 @@ XMLCharContext::XMLCharContext(
             }
         }
         else
-            SAL_WARN("xmloff", "unknown attribute " << SvXMLImport::getPrefixAndNameFromToken(aIter.getToken()) << " = " << aIter.toString());
+            XMLOFF_WARN_UNKNOWN("xmloff", aIter);
     }
 }
 


More information about the Libreoffice-commits mailing list