[Libreoffice-commits] core.git: xmloff/source

Noel Grandin noelgrandin at gmail.com
Fri Jun 17 06:40:11 UTC 2016


 xmloff/source/core/DomBuilderContext.cxx              |   28 +++++++-------
 xmloff/source/core/DomExport.cxx                      |    2 -
 xmloff/source/core/SettingsExportHelper.cxx           |    2 -
 xmloff/source/core/SvXMLAttrCollection.cxx            |    2 -
 xmloff/source/core/xmluconv.cxx                       |    4 +-
 xmloff/source/draw/XMLNumberStyles.cxx                |    8 ++--
 xmloff/source/draw/XMLShapeStyleContext.cxx           |    6 +--
 xmloff/source/draw/animationexport.cxx                |    2 -
 xmloff/source/draw/animexp.cxx                        |    2 -
 xmloff/source/draw/eventimp.cxx                       |    2 -
 xmloff/source/draw/layerimp.cxx                       |    8 ++--
 xmloff/source/draw/sdxmlexp.cxx                       |    2 -
 xmloff/source/draw/shapeexport.cxx                    |   22 +++++------
 xmloff/source/draw/shapeimport.cxx                    |    8 ++--
 xmloff/source/draw/ximpbody.cxx                       |    2 -
 xmloff/source/draw/ximpshap.cxx                       |    4 +-
 xmloff/source/draw/ximpstyl.cxx                       |    4 +-
 xmloff/source/forms/eventexport.cxx                   |    2 -
 xmloff/source/forms/layerexport.cxx                   |    2 -
 xmloff/source/style/MultiPropertySetHelper.cxx        |    6 +--
 xmloff/source/style/XMLFootnoteSeparatorImport.cxx    |    2 -
 xmloff/source/style/XMLPageExport.cxx                 |    8 ++--
 xmloff/source/style/backhdl.cxx                       |    2 -
 xmloff/source/style/prhdlfac.cxx                      |    2 -
 xmloff/source/style/prstylei.cxx                      |    6 +--
 xmloff/source/style/xmlnume.cxx                       |   14 +++----
 xmloff/source/style/xmlnumfe.cxx                      |    6 +--
 xmloff/source/style/xmlnumfi.cxx                      |    6 +--
 xmloff/source/style/xmlnumi.cxx                       |   12 +++---
 xmloff/source/table/XMLTableExport.cxx                |    2 -
 xmloff/source/text/XMLIndexTabStopEntryContext.cxx    |    2 -
 xmloff/source/text/XMLIndexTemplateContext.cxx        |    4 +-
 xmloff/source/text/XMLRedlineExport.cxx               |    2 -
 xmloff/source/text/XMLSectionFootnoteConfigExport.cxx |    4 +-
 xmloff/source/text/XMLTextFrameContext.cxx            |    2 -
 xmloff/source/text/XMLTextListAutoStylePool.cxx       |    2 -
 xmloff/source/text/XMLTextListBlockContext.cxx        |    2 -
 xmloff/source/text/XMLTextMasterPageExport.cxx        |    2 -
 xmloff/source/text/XMLTextNumRuleInfo.cxx             |    4 +-
 xmloff/source/text/txtexppr.cxx                       |    6 +--
 xmloff/source/text/txtflde.cxx                        |   16 ++++----
 xmloff/source/text/txtftne.cxx                        |    2 -
 xmloff/source/text/txtimp.cxx                         |    2 -
 xmloff/source/text/txtparae.cxx                       |   36 +++++++++---------
 xmloff/source/text/txtprmap.cxx                       |    2 -
 xmloff/source/text/txtstyli.cxx                       |    4 +-
 xmloff/source/xforms/SchemaRestrictionContext.cxx     |    8 ++--
 xmloff/source/xforms/TokenContext.cxx                 |    4 +-
 xmloff/source/xforms/XFormsBindContext.cxx            |    6 +--
 xmloff/source/xforms/XFormsInstanceContext.cxx        |    4 +-
 xmloff/source/xforms/XFormsSubmissionContext.cxx      |    4 +-
 xmloff/source/xforms/xformsapi.cxx                    |    4 +-
 xmloff/source/xforms/xformsexport.cxx                 |    2 -
 53 files changed, 151 insertions(+), 151 deletions(-)

New commits:
commit e6c004dd9f24c32f5e7468182a5e8d42293ec7b6
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun Jun 12 11:39:15 2016 +0200

    convert DBG_ASSERT in xmloff
    
    Change-Id: I2f4bbbef451026fc34638e17fa29b6db2c14d850
    Reviewed-on: https://gerrit.libreoffice.org/26191
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/xmloff/source/core/DomBuilderContext.cxx b/xmloff/source/core/DomBuilderContext.cxx
index 13d5278..4a83518 100644
--- a/xmloff/source/core/DomBuilderContext.cxx
+++ b/xmloff/source/core/DomBuilderContext.cxx
@@ -67,9 +67,9 @@ DomBuilderContext::DomBuilderContext( SvXMLImport& rImport,
     mxNode( lcl_createElement( rImport, nPrefix, rLocalName,
                                lcl_createDomInstance() ) )
 {
-    DBG_ASSERT( mxNode.is(), "empty XNode not allowed" );
-    DBG_ASSERT( Reference<XElement>( mxNode, UNO_QUERY ).is(), "need element" );
-    DBG_ASSERT( mxNode->getNodeType() == NodeType_ELEMENT_NODE, "need element" );
+    SAL_WARN_IF( !mxNode.is(), "xmloff", "empty XNode not allowed" );
+    SAL_WARN_IF( !Reference<XElement>( mxNode, UNO_QUERY ).is(), "xmloff", "need element" );
+    SAL_WARN_IF( mxNode->getNodeType() != NodeType_ELEMENT_NODE, "xmloff", "need element" );
 }
 
 DomBuilderContext::DomBuilderContext( SvXMLImport& rImport,
@@ -79,9 +79,9 @@ DomBuilderContext::DomBuilderContext( SvXMLImport& rImport,
     SvXMLImportContext( rImport, nPrefix, rLocalName ),
     mxNode( lcl_createElement( rImport, nPrefix, rLocalName, xParent ) )
 {
-    DBG_ASSERT( mxNode.is(), "empty XNode not allowed" );
-    DBG_ASSERT( Reference<XElement>( mxNode, UNO_QUERY ).is(), "need element" );
-    DBG_ASSERT( mxNode->getNodeType() == NodeType_ELEMENT_NODE, "need element" );
+    SAL_WARN_IF( !mxNode.is(), "xmloff", "empty XNode not allowed" );
+    SAL_WARN_IF( !Reference<XElement>( mxNode, UNO_QUERY ).is(), "xmloff", "need element" );
+    SAL_WARN_IF( mxNode->getNodeType() != NodeType_ELEMENT_NODE, "xmloff", "need element" );
 }
 
 DomBuilderContext::~DomBuilderContext()
@@ -90,7 +90,7 @@ DomBuilderContext::~DomBuilderContext()
 
 Reference<XDocument> DomBuilderContext::getTree()
 {
-    DBG_ASSERT( mxNode.is(), "empty XNode not allowed" );
+    SAL_WARN_IF( !mxNode.is(), "xmloff", "empty XNode not allowed" );
     return mxNode->getOwnerDocument();
 }
 
@@ -107,8 +107,8 @@ SvXMLImportContext* DomBuilderContext::CreateChildContext(
 void DomBuilderContext::StartElement(
     const Reference<XAttributeList>& xAttrList )
 {
-    DBG_ASSERT( mxNode.is(), "empty XNode not allowed" );
-    DBG_ASSERT( mxNode->getOwnerDocument().is(), "XNode must have XDocument" );
+    SAL_WARN_IF( !mxNode.is(), "xmloff", "empty XNode not allowed" );
+    SAL_WARN_IF( !mxNode->getOwnerDocument().is(), "xmloff", "XNode must have XDocument" );
 
     // add attribute nodes to new node
     sal_Int16 nAttributeCount = xAttrList->getLength();
@@ -161,7 +161,7 @@ void DomBuilderContext::EndElement()
 
 void DomBuilderContext::Characters( const OUString& rCharacters )
 {
-    DBG_ASSERT( mxNode.is(), "empty XNode not allowed" );
+    SAL_WARN_IF( !mxNode.is(), "xmloff", "empty XNode not allowed" );
 
     // TODO: I assume adjacent text nodes should be joined, to preserve
     // processinf model? (I.e., if the SAX parser breaks a string into 2
@@ -181,7 +181,7 @@ void DomBuilderContext::Characters( const OUString& rCharacters )
 static Reference<XNode> lcl_createDomInstance()
 {
     Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
-    DBG_ASSERT( xContext.is(), "can't get service factory" );
+    SAL_WARN_IF( !xContext.is(), "xmloff", "can't get service factory" );
 
     Reference<XDocumentBuilder> xBuilder( DocumentBuilder::create(xContext) );
 
@@ -193,10 +193,10 @@ static Reference<XNode> lcl_createElement( SvXMLImport& rImport,
                                     const OUString& rLocalName,
                                     const Reference<XNode>& xParent)
 {
-    DBG_ASSERT( xParent.is(), "need parent node" );
+    SAL_WARN_IF( !xParent.is(), "xmloff", "need parent node" );
 
     Reference<XDocument> xDocument = xParent->getOwnerDocument();
-    DBG_ASSERT( xDocument.is(), "no XDocument found!" );
+    SAL_WARN_IF( !xDocument.is(), "xmloff", "no XDocument found!" );
 
     // TODO: come up with proper way of handling namespaces; re-creating the
     // namespace from the key is NOT a good idea, and will not work for
@@ -229,7 +229,7 @@ static Reference<XNode> lcl_createElement( SvXMLImport& rImport,
             rImport.GetNamespaceMap().GetQNameByKey( nPrefix, rLocalName ) );
         break;
     }
-    DBG_ASSERT( xElement.is(), "can't create element" );
+    SAL_WARN_IF( !xElement.is(), "xmloff", "can't create element" );
 
     // add new element to parent and return
     xParent->appendChild( xElement );
diff --git a/xmloff/source/core/DomExport.cxx b/xmloff/source/core/DomExport.cxx
index 7fa61dc..8f323b5 100644
--- a/xmloff/source/core/DomExport.cxx
+++ b/xmloff/source/core/DomExport.cxx
@@ -151,7 +151,7 @@ DomExport::DomExport( SvXMLExport& rExport ) :
 
 DomExport::~DomExport()
 {
-    DBG_ASSERT( maNamespaces.size() == 1, "namespace missing" );
+    SAL_WARN_IF( maNamespaces.size() != 1, "xmloff", "namespace missing" );
     maNamespaces.clear();
 }
 
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index a9be307..a678f95f 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -425,7 +425,7 @@ void XMLSettingsExportHelper::exportForbiddenCharacters(
     rAny >>= xForbChars;
     rAny >>= xLocales;
 
-    DBG_ASSERT( xForbChars.is() && xLocales.is(),"XMLSettingsExportHelper::exportForbiddenCharacters: got illegal forbidden characters!" );
+    SAL_WARN_IF( !(xForbChars.is() && xLocales.is()), "xmloff","XMLSettingsExportHelper::exportForbiddenCharacters: got illegal forbidden characters!" );
 
     if( !xForbChars.is() || !xLocales.is() )
         return;
diff --git a/xmloff/source/core/SvXMLAttrCollection.cxx b/xmloff/source/core/SvXMLAttrCollection.cxx
index 8f1ad5c..34abfbb 100644
--- a/xmloff/source/core/SvXMLAttrCollection.cxx
+++ b/xmloff/source/core/SvXMLAttrCollection.cxx
@@ -159,7 +159,7 @@ sal_uInt16 SvXMLAttrCollection::GetNextNamespaceIndex( sal_uInt16 nIdx ) const
 
 sal_uInt16 SvXMLAttrCollection::GetPrefixPos( size_t i ) const
 {
-//  DBG_ASSERT( i >= 0 && i < aAttrs.size(),
+//  SAL_WARN_IF( i < 0 || i >= aAttrs.size()), "xmloff",
 //              "SvXMLAttrCollection::GetPrefixPos: illegal index" );
     return aAttrs[i].getPrefixPos();
 }
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index f2b1f22..1f2fe24 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -657,7 +657,7 @@ void SvXMLUnitConverter::convertNumFormat( OUStringBuffer& rBuffer,
     case NumberingType::CHAR_SPECIAL:
     case NumberingType::PAGE_DESCRIPTOR:
     case NumberingType::BITMAP:
-        DBG_ASSERT( eFormat != XML_TOKEN_INVALID, "invalid number format" );
+        SAL_WARN_IF( eFormat == XML_TOKEN_INVALID, "xmloff", "invalid number format" );
         break;
     default:
         break;
@@ -697,7 +697,7 @@ void SvXMLUnitConverter::convertNumLetterSync( OUStringBuffer& rBuffer,
     case NumberingType::CHAR_SPECIAL:
     case NumberingType::PAGE_DESCRIPTOR:
     case NumberingType::BITMAP:
-        DBG_ASSERT( eSync != XML_TOKEN_INVALID, "invalid number format" );
+        SAL_WARN_IF( eSync == XML_TOKEN_INVALID, "xmloff", "invalid number format" );
         break;
     }
     if( eSync != XML_TOKEN_INVALID )
diff --git a/xmloff/source/draw/XMLNumberStyles.cxx b/xmloff/source/draw/XMLNumberStyles.cxx
index 9608699..b6b71d3 100644
--- a/xmloff/source/draw/XMLNumberStyles.cxx
+++ b/xmloff/source/draw/XMLNumberStyles.cxx
@@ -379,7 +379,7 @@ static void SdXMLExportStyle( SdXMLExport& rExport, const SdXMLFixedDataStyle* p
 
 void SdXMLNumberStylesExporter::exportTimeStyle( SdXMLExport& rExport, sal_Int32 nStyle )
 {
-    DBG_ASSERT( (nStyle >= 0) && (nStyle < SdXMLTimeFormatCount), "Unknown time style!" );
+    SAL_WARN_IF( (nStyle < 0) || (nStyle >= SdXMLTimeFormatCount), "xmloff", "Unknown time style!" );
     if( (nStyle >= 0) && (nStyle < SdXMLTimeFormatCount) )
         SdXMLExportStyle( rExport, aSdXMLFixedTimeFormats[ nStyle ] );
 }
@@ -394,7 +394,7 @@ void SdXMLNumberStylesExporter::exportDateStyle( SdXMLExport& rExport, sal_Int32
         if( nDateStyle > 1 )
             nDateStyle -= 2;
 
-        DBG_ASSERT( (nDateStyle >= 0) && (nDateStyle < SdXMLDateFormatCount), "unknown date style!" );
+        SAL_WARN_IF( (nDateStyle < 0) || (nDateStyle >= SdXMLDateFormatCount), "xmloff", "unknown date style!" );
 
         int nTimeStyle = (nStyle >> 4) & 0x0f;
         bool bHasTime = nTimeStyle != 0;
@@ -402,7 +402,7 @@ void SdXMLNumberStylesExporter::exportDateStyle( SdXMLExport& rExport, sal_Int32
         if( nTimeStyle > 1 )
             nTimeStyle -= 2;
 
-        DBG_ASSERT( (nTimeStyle >= 0) && (nTimeStyle < SdXMLTimeFormatCount), "Unknown time style!" );
+        SAL_WARN_IF( (nTimeStyle < 0) || (nTimeStyle >= SdXMLTimeFormatCount), "xmloff", "Unknown time style!" );
 
         if( (nDateStyle >= 0) && (nDateStyle < SdXMLDateFormatCount) && (nTimeStyle >= 0) && (nTimeStyle < SdXMLTimeFormatCount) )
         {
@@ -425,7 +425,7 @@ void SdXMLNumberStylesExporter::exportDateStyle( SdXMLExport& rExport, sal_Int32
     }
     else
     {
-        DBG_ASSERT( (nStyle >= 0) && (nStyle < SdXMLDateFormatCount), "unknown date style!" );
+        SAL_WARN_IF( (nStyle < 0) || (nStyle >= SdXMLDateFormatCount), "xmloff", "unknown date style!" );
         if( (nStyle >= 0) && (nStyle < SdXMLDateFormatCount) )
             SdXMLExportStyle( rExport, aSdXMLFixedDateFormats[ nStyle ] );
     }
diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx
index cfe68c9..9941adc 100644
--- a/xmloff/source/draw/XMLShapeStyleContext.cxx
+++ b/xmloff/source/draw/XMLShapeStyleContext.cxx
@@ -151,7 +151,7 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet
         if( (property == end) && ( !m_sListStyleName.isEmpty() ) )
         {
             sal_Int32 nIndex = rMapper->FindEntryIndex( CTF_SD_NUMBERINGRULES_NAME );
-            DBG_ASSERT( -1 != nIndex, "can't find numbering rules property entry, can't set numbering rule!" );
+            SAL_WARN_IF( -1 == nIndex, "xmloff", "can't find numbering rules property entry, can't set numbering rule!" );
 
             XMLPropertyState aNewState( nIndex );
             rProperties.push_back( aNewState );
@@ -170,7 +170,7 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet
 
             const SvxXMLListStyleContext *pListStyle = GetImport().GetTextImport()->FindAutoListStyle( m_sListStyleName );
 
-            DBG_ASSERT( pListStyle, "list-style not found for shape style" );
+            SAL_WARN_IF( !pListStyle, "xmloff", "list-style not found for shape style" );
             if( pListStyle )
             {
                 uno::Reference< container::XIndexReplace > xNumRule( SvxXMLListStyleContext::CreateNumRule( GetImport().GetModel() ) );
@@ -212,7 +212,7 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet
 
     rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
         GetStyles()->GetImportPropertyMapper( GetFamily() );
-    DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
+    SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
     if( xImpPrMap.is() )
         xImpPrMap->FillPropertySet( GetProperties(), rPropSet, aContextIDs );
 
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 7c5f29f1..9dcfa58 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1609,7 +1609,7 @@ void AnimationsExporterImpl::convertTarget( OUStringBuffer& sTmp, const Any& rTa
         }
     }
 
-    DBG_ASSERT( xRef.is(), "xmloff::AnimationsExporterImpl::convertTarget(), invalid target type!" );
+    SAL_WARN_IF( !xRef.is(), "xmloff", "xmloff::AnimationsExporterImpl::convertTarget(), invalid target type!" );
     if( xRef.is() )
     {
         const OUString& rIdentifier = mrExport.getInterfaceToIdentifierMapper().getIdentifier(xRef);
diff --git a/xmloff/source/draw/animexp.cxx b/xmloff/source/draw/animexp.cxx
index 638d6fd..3517cef 100644
--- a/xmloff/source/draw/animexp.cxx
+++ b/xmloff/source/draw/animexp.cxx
@@ -440,7 +440,7 @@ void XMLAnimationsExporter::exportAnimations( SvXMLExport& rExport )
         {
             XMLEffectHint& rEffect = *aIter;
 
-            DBG_ASSERT( rEffect.mxShape.is(), "shape id creation failed for animation effect?" );
+            SAL_WARN_IF( !rEffect.mxShape.is(), "xmloff", "shape id creation failed for animation effect?" );
 
             rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_SHAPE_ID, rExport.getInterfaceToIdentifierMapper().getIdentifier( rEffect.mxShape ) );
 
diff --git a/xmloff/source/draw/eventimp.cxx b/xmloff/source/draw/eventimp.cxx
index 21c0085..a4dbc2f 100644
--- a/xmloff/source/draw/eventimp.cxx
+++ b/xmloff/source/draw/eventimp.cxx
@@ -285,7 +285,7 @@ void SdXMLEventContext::EndElement()
             break;
 
         Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
-        DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
+        SAL_WARN_IF( !xEvents.is(), "xmloff", "XEventsSupplier::getEvents() returned NULL" );
         if( !xEvents.is() )
             break;
 
diff --git a/xmloff/source/draw/layerimp.cxx b/xmloff/source/draw/layerimp.cxx
index e707945..cc29145 100644
--- a/xmloff/source/draw/layerimp.cxx
+++ b/xmloff/source/draw/layerimp.cxx
@@ -108,7 +108,7 @@ SvXMLImportContext * SdXMLLayerContext::CreateChildContext( sal_uInt16 nPrefix,
 
 void SdXMLLayerContext::EndElement()
 {
-    DBG_ASSERT( !msName.isEmpty(), "xmloff::SdXMLLayerContext::EndElement(), draw:layer element without draw:name!" );
+    SAL_WARN_IF( msName.isEmpty(), "xmloff", "xmloff::SdXMLLayerContext::EndElement(), draw:layer element without draw:name!" );
     if( !msName.isEmpty() ) try
     {
         Reference< XPropertySet > xLayer;
@@ -116,14 +116,14 @@ void SdXMLLayerContext::EndElement()
         if( mxLayerManager->hasByName( msName ) )
         {
             mxLayerManager->getByName( msName ) >>= xLayer;
-            DBG_ASSERT( xLayer.is(), "xmloff::SdXMLLayerContext::EndElement(), failed to get existing XLayer!" );
+            SAL_WARN_IF( !xLayer.is(), "xmloff", "xmloff::SdXMLLayerContext::EndElement(), failed to get existing XLayer!" );
         }
         else
         {
             Reference< XLayerManager > xLayerManager( mxLayerManager, UNO_QUERY );
             if( xLayerManager.is() )
                 xLayer.set( xLayerManager->insertNewByIndex( xLayerManager->getCount() ), UNO_QUERY );
-            DBG_ASSERT( xLayer.is(), "xmloff::SdXMLLayerContext::EndElement(), failed to create new XLayer!" );
+            SAL_WARN_IF( !xLayer.is(), "xmloff", "xmloff::SdXMLLayerContext::EndElement(), failed to create new XLayer!" );
 
             if( xLayer.is() )
                 xLayer->setPropertyValue("Name", Any( msName ) );
@@ -147,7 +147,7 @@ SdXMLLayerSetContext::SdXMLLayerSetContext( SvXMLImport& rImport, sal_uInt16 nPr
 : SvXMLImportContext(rImport, nPrfx, rLocalName)
 {
     Reference< XLayerSupplier > xLayerSupplier( rImport.GetModel(), UNO_QUERY );
-    DBG_ASSERT( xLayerSupplier.is(), "xmloff::SdXMLLayerSetContext::SdXMLLayerSetContext(), XModel is not supporting XLayerSupplier!" );
+    SAL_WARN_IF( !xLayerSupplier.is(), "xmloff", "xmloff::SdXMLLayerSetContext::SdXMLLayerSetContext(), XModel is not supporting XLayerSupplier!" );
     if( xLayerSupplier.is() )
         mxLayerManager = xLayerSupplier->getLayerManager();
 }
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index f9f9d52..1a1726b 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2070,7 +2070,7 @@ void SdXMLExport::exportPresentationSettings()
                 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, *pShowNames );
 
                 xShows->getByName( *pShowNames ) >>= xShow;
-                DBG_ASSERT( xShow.is(), "invalid custom show!" );
+                SAL_WARN_IF( !xShow.is(), "xmloff", "invalid custom show!" );
                 if( !xShow.is() )
                     continue;
 
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index aea951b..0bb3955 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -338,7 +338,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap
             {
                 // get family ID
                 uno::Reference< beans::XPropertySet > xStylePropSet(xStyle, uno::UNO_QUERY);
-                DBG_ASSERT( xStylePropSet.is(), "style without a XPropertySet?" );
+                SAL_WARN_IF( !xStylePropSet.is(), "xmloff", "style without a XPropertySet?" );
                 try
                 {
                     if(xStylePropSet.is())
@@ -637,7 +637,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape
     if( xChild.is() )
     {
         uno::Reference< drawing::XShapes > xParent( xChild->getParent(), uno::UNO_QUERY );
-        DBG_ASSERT( xParent.is() && xParent.get() == (*maCurrentShapesIter).first.get(), "XMLShapeExport::exportShape(): Wrong call to XMLShapeExport::seekShapes()" );
+        SAL_WARN_IF( !xParent.is() && xParent.get() == (*maCurrentShapesIter).first.get(), "xmloff", "XMLShapeExport::exportShape(): Wrong call to XMLShapeExport::seekShapes()" );
     }
 
     // first compute the shapes type
@@ -1004,10 +1004,10 @@ void XMLShapeExport::seekShapes( const uno::Reference< drawing::XShapes >& xShap
 
             maCurrentShapesIter = maShapesInfos.find( xShapes );
 
-            DBG_ASSERT( maCurrentShapesIter != maShapesInfos.end(), "XMLShapeExport::seekShapes(): insert into stl::map failed" );
+            SAL_WARN_IF( maCurrentShapesIter == maShapesInfos.end(), "xmloff", "XMLShapeExport::seekShapes(): insert into stl::map failed" );
         }
 
-        DBG_ASSERT( (*maCurrentShapesIter).second.size() == (ShapesInfos::size_type)xShapes->getCount(), "XMLShapeExport::seekShapes(): XShapes size varied between calls" );
+        SAL_WARN_IF( (*maCurrentShapesIter).second.size() != (ShapesInfos::size_type)xShapes->getCount(), "xmloff", "XMLShapeExport::seekShapes(): XShapes size varied between calls" );
 
     }
     else
@@ -1527,7 +1527,7 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
         return;
 
     uno::Reference< container::XNameAccess > xEvents( xEventsSupplier->getEvents(), uno::UNO_QUERY );
-    DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
+    SAL_WARN_IF( !xEvents.is(), "xmloff", "XEventsSupplier::getEvents() returned NULL" );
     if( !xEvents.is() )
         return;
 
@@ -2401,11 +2401,11 @@ void XMLShapeExport::ImpExportControlShape(
     }
 
     uno::Reference< drawing::XControlShape > xControl( xShape, uno::UNO_QUERY );
-    DBG_ASSERT( xControl.is(), "Control shape is not supporting XControlShape" );
+    SAL_WARN_IF( !xControl.is(), "xmloff", "Control shape is not supporting XControlShape" );
     if( xControl.is() )
     {
         uno::Reference< beans::XPropertySet > xControlModel( xControl->getControl(), uno::UNO_QUERY );
-        DBG_ASSERT( xControlModel.is(), "Control shape has not XControlModel" );
+        SAL_WARN_IF( !xControlModel.is(), "xmloff", "Control shape has not XControlModel" );
         if( xControlModel.is() )
         {
             mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_CONTROL, mrExport.GetFormExport()->getControlId( xControlModel ) );
@@ -2735,7 +2735,7 @@ void XMLShapeExport::ImpExportOLE2Shape(
     uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
     uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
 
-    DBG_ASSERT( xPropSet.is() && xNamed.is(), "ole shape is not implementing needed interfaces");
+    SAL_WARN_IF( !xPropSet.is() || !xNamed.is(), "xmloff", "ole shape is not implementing needed interfaces");
     if(xPropSet.is() && xNamed.is())
     {
         // Transformation
@@ -2839,7 +2839,7 @@ void XMLShapeExport::ImpExportOLE2Shape(
                     // embedded XML
                     uno::Reference< lang::XComponent > xComp;
                     xPropSet->getPropertyValue("Model") >>= xComp;
-                    DBG_ASSERT( xComp.is(), "no xModel for own OLE format" );
+                    SAL_WARN_IF( !xComp.is(), "xmloff", "no xModel for own OLE format" );
                     mrExport.ExportEmbeddedOwnObject( xComp );
                 }
                 else
@@ -3409,7 +3409,7 @@ void XMLShapeExport::ImpExport3DSceneShape( const uno::Reference< drawing::XShap
     if(xShapes.is() && xShapes->getCount())
     {
         uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY );
-        DBG_ASSERT( xPropSet.is(), "XMLShapeExport::ImpExport3DSceneShape can't export a scene without a propertyset" );
+        SAL_WARN_IF( !xPropSet.is(), "xmloff", "XMLShapeExport::ImpExport3DSceneShape can't export a scene without a propertyset" );
         if( xPropSet.is() )
         {
             // Transformation
@@ -4874,7 +4874,7 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape
     uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY);
     uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY);
 
-    DBG_ASSERT( xPropSet.is() && xNamed.is(), "xmloff::XMLShapeExport::ImpExportTableShape(), tabe shape is not implementing needed interfaces");
+    SAL_WARN_IF( !xPropSet.is() || !xNamed.is(), "xmloff", "xmloff::XMLShapeExport::ImpExportTableShape(), table shape is not implementing needed interfaces");
     if(xPropSet.is() && xNamed.is()) try
     {
         // Transformation
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index 3932638..b2614a1 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -162,7 +162,7 @@ XMLShapeImportHelper::XMLShapeImportHelper(
 
 XMLShapeImportHelper::~XMLShapeImportHelper()
 {
-    DBG_ASSERT( mpImpl->maConnections.empty(), "XMLShapeImportHelper::restoreConnections() was not called!" );
+    SAL_WARN_IF( !mpImpl->maConnections.empty(), "xmloff", "XMLShapeImportHelper::restoreConnections() was not called!" );
 
     // cleanup factory, decrease refcount. Should lead to destruction.
     mpSdPropHdlFactory.clear();
@@ -782,7 +782,7 @@ void ShapeSortContext::moveShape( sal_Int32 nSourcePos, sal_Int32 nDestPos )
         {
             if( rHint.nIs < nSourcePos )
             {
-                DBG_ASSERT( rHint.nIs >= nDestPos, "shape sorting failed" );
+                SAL_WARN_IF( rHint.nIs < nDestPos, "xmloff", "shape sorting failed" );
                 rHint.nIs++;
             }
         }
@@ -862,7 +862,7 @@ void XMLShapeImportHelper::pushGroupForSorting( uno::Reference< drawing::XShapes
 
 void XMLShapeImportHelper::popGroupAndSort()
 {
-    DBG_ASSERT( mpImpl->mpSortContext, "No context to sort!" );
+    SAL_WARN_IF( !mpImpl->mpSortContext, "xmloff", "No context to sort!" );
     if( mpImpl->mpSortContext == nullptr )
         return;
 
@@ -1060,7 +1060,7 @@ void XMLShapeImportHelper::startPage( css::uno::Reference< css::drawing::XShapes
 /** this method must be calling after the last shape is imported for the given page */
 void XMLShapeImportHelper::endPage( css::uno::Reference< css::drawing::XShapes >& rShapes )
 {
-    DBG_ASSERT( mpPageContext && (mpPageContext->mxShapes == rShapes), "wrong call to endPage(), no startPage called or wrong page" );
+    SAL_WARN_IF( !mpPageContext || (mpPageContext->mxShapes != rShapes), "xmloff", "wrong call to endPage(), no startPage called or wrong page" );
     if( nullptr == mpPageContext )
         return;
 
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx
index 7bd66b6..4de8a87 100644
--- a/xmloff/source/draw/ximpbody.cxx
+++ b/xmloff/source/draw/ximpbody.cxx
@@ -178,7 +178,7 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport,
                 }
             }
 
-            DBG_ASSERT( bDone, "xmloff::SdXMLDrawPageContext::SdXMLDrawPageContext(), could not find a slide master!" );
+            SAL_WARN_IF( !bDone, "xmloff", "xmloff::SdXMLDrawPageContext::SdXMLDrawPageContext(), could not find a slide master!" );
         }
     }
 
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index cde2c157..91750f6 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1785,7 +1785,7 @@ void SdXMLControlShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
     AddShape("com.sun.star.drawing.ControlShape");
     if( mxShape.is() )
     {
-        DBG_ASSERT( !maFormId.isEmpty(), "draw:control without a form:id attribute!" );
+        SAL_WARN_IF( !!maFormId.isEmpty(), "xmloff", "draw:control without a form:id attribute!" );
         if( !maFormId.isEmpty() )
         {
             if( GetImport().IsFormsSupported() )
@@ -2825,7 +2825,7 @@ SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext(
 
                 uno::Reference< lang::XComponent > xComp;
                 xPropSet->getPropertyValue("Model") >>= xComp;
-                DBG_ASSERT( xComp.is(), "no xModel for own OLE format" );
+                SAL_WARN_IF( !xComp.is(), "xmloff", "no xModel for own OLE format" );
                 pEContext->SetComponent( xComp );
             }
         }
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 2158b8f..890ea69 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -260,7 +260,7 @@ void SdXMLDrawingPageStyleContext::FillPropertySet(
 
     rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
         GetStyles()->GetImportPropertyMapper( GetFamily() );
-    DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
+    SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
     if( xImpPrMap.is() )
         xImpPrMap->FillPropertySet( GetProperties(), rPropSet, aContextIDs );
 
@@ -1334,7 +1334,7 @@ void SdXMLStylesContext::ImpSetGraphicStyles( uno::Reference< container::XNameAc
                     {
                         rtl::Reference < XMLPropertySetMapper > xPrMap;
                         rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap = GetImportPropertyMapper( nFamily );
-                        DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
+                        SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
                         if( xImpPrMap.is() )
                             xPrMap = xImpPrMap->getPropertySetMapper();
                         if( xPrMap.is() )
diff --git a/xmloff/source/forms/eventexport.cxx b/xmloff/source/forms/eventexport.cxx
index 57b995c..fb35f1c 100644
--- a/xmloff/source/forms/eventexport.cxx
+++ b/xmloff/source/forms/eventexport.cxx
@@ -55,7 +55,7 @@ namespace xmloff
             if (pEvents->ScriptType == EVENT_STARBASIC)
             {   // for StarBasic, the library name is part of the ScriptCode
                 sal_Int32 nPrefixLen = sLocalMacroName.indexOf( ':' );
-                DBG_ASSERT( 0 <= nPrefixLen, "OEventDescriptorMapper::OEventDescriptorMapper: invalid script code prefix!" );
+                SAL_WARN_IF( 0 > nPrefixLen, "xmloff", "OEventDescriptorMapper::OEventDescriptorMapper: invalid script code prefix!" );
                 if ( 0 <= nPrefixLen )
                 {
                     // the export handler for StarBasic expects "StarOffice", not "application" for application modules ...
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index 3a27f9d..b0f0048 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -290,7 +290,7 @@ namespace xmloff
     bool OFormLayerXMLExport_Impl::pageContainsForms( const Reference< XDrawPage >& _rxDrawPage )
     {
         Reference< XFormsSupplier2 > xFormsSupp( _rxDrawPage, UNO_QUERY );
-        DBG_ASSERT( xFormsSupp.is(), "OFormLayerXMLExport_Impl::pageContainsForms: no XFormsSupplier2!" );
+        SAL_WARN_IF( !xFormsSupp.is(), "xmloff", "OFormLayerXMLExport_Impl::pageContainsForms: no XFormsSupplier2!" );
         return xFormsSupp.is() && xFormsSupp->hasForms();
     }
 
diff --git a/xmloff/source/style/MultiPropertySetHelper.cxx b/xmloff/source/style/MultiPropertySetHelper.cxx
index bf56be5..a7f3d59 100644
--- a/xmloff/source/style/MultiPropertySetHelper.cxx
+++ b/xmloff/source/style/MultiPropertySetHelper.cxx
@@ -64,7 +64,7 @@ MultiPropertySetHelper::~MultiPropertySetHelper()
 void MultiPropertySetHelper::hasProperties(
     const Reference<XPropertySetInfo> & rInfo )
 {
-    DBG_ASSERT( rInfo.is(), "I'd really like an XPropertySetInfo here." );
+    SAL_WARN_IF( !rInfo.is(), "xmloff", "I'd really like an XPropertySetInfo here." );
 
     // allocate sequence index
     if ( nullptr == pSequenceIndex )
@@ -107,7 +107,7 @@ bool MultiPropertySetHelper::checkedProperties()
 void MultiPropertySetHelper::getValues(
     const Reference<XMultiPropertySet> & rMultiPropertySet )
 {
-    DBG_ASSERT( rMultiPropertySet.is(), "We need an XMultiPropertySet." );
+    SAL_WARN_IF( !rMultiPropertySet.is(), "xmloff", "We need an XMultiPropertySet." );
 
     aValues = rMultiPropertySet->getPropertyValues( aPropertySequence );
     pValues = aValues.getConstArray();
@@ -116,7 +116,7 @@ void MultiPropertySetHelper::getValues(
 void MultiPropertySetHelper::getValues(
     const Reference<XPropertySet> & rPropertySet )
 {
-    DBG_ASSERT( rPropertySet.is(), "We need an XPropertySet." );
+    SAL_WARN_IF( !rPropertySet.is(), "xmloff", "We need an XPropertySet." );
 
     // re-alloc aValues (if necessary) and fill with values from XPropertySet
     sal_Int16 nSupportedPropertiesCount =
diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
index df2b277..86ee524 100644
--- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
+++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx
@@ -189,7 +189,7 @@ void XMLFootnoteSeparatorImport::StartElement(
     XMLPropertyState aLineTextDistance( nIndex, uno::Any(nLineTextDistance));
     rProperties.push_back(aLineTextDistance);
 
-    DBG_ASSERT( rMapper->FindEntryIndex(CTF_PM_FTN_LINE_WEIGHT) == nPropIndex,
+    SAL_WARN_IF( rMapper->FindEntryIndex(CTF_PM_FTN_LINE_WEIGHT) != nPropIndex, "xmloff",
                 "Received wrong property map index!" );
     XMLPropertyState aLineWeight( nPropIndex, uno::Any(nLineWeight) );
     rProperties.push_back(aLineWeight);
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index 0eee937..1328735 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -60,7 +60,7 @@ void XMLPageExport::collectPageMasterAutoStyle(
         const Reference < XPropertySet > & rPropSet,
         OUString& rPageMasterName )
 {
-    DBG_ASSERT( xPageMasterPropSetMapper.is(), "page master family/XMLPageMasterPropSetMapper not found" );
+    SAL_WARN_IF( !xPageMasterPropSetMapper.is(), "xmloff", "page master family/XMLPageMasterPropSetMapper not found" );
     if( xPageMasterPropSetMapper.is() )
     {
         ::std::vector<XMLPropertyState> aPropStates = xPageMasterExportPropMapper->Filter( rPropSet );
@@ -168,12 +168,12 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) :
 
     Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(),
                                                        UNO_QUERY );
-    DBG_ASSERT( xFamiliesSupp.is(),
+    SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff",
                 "No XStyleFamiliesSupplier from XModel for export!" );
     if( xFamiliesSupp.is() )
     {
         Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
-        DBG_ASSERT( xFamiliesSupp.is(),
+        SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff",
                     "getStyleFamilies() from XModel failed for export!" );
         if( xFamilies.is() )
         {
@@ -183,7 +183,7 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) :
             {
                 xPageStyles.set(xFamilies->getByName( aPageStyleName ),uno::UNO_QUERY);
 
-                DBG_ASSERT( xPageStyles.is(),
+                SAL_WARN_IF( !xPageStyles.is(), "xmloff",
                             "Page Styles not found for export!" );
             }
         }
diff --git a/xmloff/source/style/backhdl.cxx b/xmloff/source/style/backhdl.cxx
index 3d38bd7..b6dde63 100644
--- a/xmloff/source/style/backhdl.cxx
+++ b/xmloff/source/style/backhdl.cxx
@@ -247,7 +247,7 @@ void XMLBackGraphicPositionPropHdl::MergeXMLVertPos( style::GraphicLocation& ePo
 
 void XMLBackGraphicPositionPropHdl::MergeXMLHoriPos( style::GraphicLocation& ePos, style::GraphicLocation eHori )
 {
-    DBG_ASSERT( style::GraphicLocation_LEFT_MIDDLE==eHori || style::GraphicLocation_MIDDLE_MIDDLE==eHori || style::GraphicLocation_RIGHT_MIDDLE==eHori,
+    SAL_WARN_IF( !(style::GraphicLocation_LEFT_MIDDLE==eHori || style::GraphicLocation_MIDDLE_MIDDLE==eHori || style::GraphicLocation_RIGHT_MIDDLE==eHori), "xmloff",
                 "lcl_frmitems_MergeXMLHoriPos: vertical pos must be middle" );
 
     switch( ePos )
diff --git a/xmloff/source/style/prhdlfac.cxx b/xmloff/source/style/prhdlfac.cxx
index 991ae88..8e703e3 100644
--- a/xmloff/source/style/prhdlfac.cxx
+++ b/xmloff/source/style/prhdlfac.cxx
@@ -117,7 +117,7 @@ XMLPropertyHandlerFactory::~XMLPropertyHandlerFactory()
 // Interface
 const XMLPropertyHandler* XMLPropertyHandlerFactory::GetPropertyHandler( sal_Int32 nType ) const
 {
-    DBG_ASSERT( (nType & ~((sal_uInt32)MID_FLAG_MASK)) == 0,
+    SAL_WARN_IF( (nType & ~((sal_uInt32)MID_FLAG_MASK)) != 0, "xmloff",
                 "GetPropertyHandler called with flags in type" );
     return GetBasicHandler( nType );
 }
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index 8d63fdc..5c1b63b 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -62,7 +62,7 @@ void XMLPropStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
 {
     if( XML_NAMESPACE_STYLE == nPrefixKey && IsXMLToken( rLocalName, XML_FAMILY ) )
     {
-        DBG_ASSERT( GetFamily() == static_cast<SvXMLStylesContext *>(&mxStyles)->GetFamily( rValue ), "unexpected style family" );
+        SAL_WARN_IF( GetFamily() != static_cast<SvXMLStylesContext *>(&mxStyles)->GetFamily( rValue ), "xmloff", "unexpected style family" );
     }
     else
     {
@@ -220,7 +220,7 @@ void XMLPropStyleContext::FillPropertySet(
     rtl::Reference < SvXMLImportPropertyMapper > xImpPrMap =
         static_cast<SvXMLStylesContext *>(&mxStyles)->GetImportPropertyMapper(
                                                                 GetFamily() );
-    DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" );
+    SAL_WARN_IF( !xImpPrMap.is(), "xmloff", "There is the import prop mapper" );
     if( xImpPrMap.is() )
         xImpPrMap->FillPropertySet( maProperties, rPropSet );
 }
@@ -443,7 +443,7 @@ void XMLPropStyleContext::Finish( bool bOverwrite )
         // The families container must exist
         Reference < XNameContainer > xFamilies =
             static_cast<SvXMLStylesContext *>(&mxStyles)->GetStylesContainer( GetFamily() );
-        DBG_ASSERT( xFamilies.is(), "Families lost" );
+        SAL_WARN_IF( !xFamilies.is(), "xmloff", "Families lost" );
         if( !xFamilies.is() )
             return;
 
diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx
index abd982f..a52c403 100644
--- a/xmloff/source/style/xmlnume.cxx
+++ b/xmloff/source/style/xmlnume.cxx
@@ -239,7 +239,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
     if( bOutline && (NumberingType::CHAR_SPECIAL == eType ||
                      NumberingType::BITMAP == eType) )
     {
-        DBG_ASSERT( !bOutline,
+        SAL_WARN_IF( bOutline, "xmloff",
            "SvxXMLNumRuleExport::exportLevelStyle: invalid style for outline" );
         return;
     }
@@ -315,7 +315,7 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel,
         }
         else
         {
-            DBG_ASSERT( !xBitmap.is(),
+            SAL_WARN_IF( xBitmap.is(), "xmloff",
                         "embedded images are not supported by now" );
         }
     }
@@ -728,12 +728,12 @@ void SvxXMLNumRuleExport::exportOutline()
 {
     Reference< XChapterNumberingSupplier > xCNSupplier( GetExport().GetModel(),
                                                         UNO_QUERY );
-    DBG_ASSERT( xCNSupplier.is(), "no chapter numbering supplier" );
+    SAL_WARN_IF( !xCNSupplier.is(), "xmloff", "no chapter numbering supplier" );
 
     if( xCNSupplier.is() )
     {
         Reference< XIndexReplace > xNumRule( xCNSupplier->getChapterNumberingRules() );
-        DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
+        SAL_WARN_IF( !xNumRule.is(), "xmloff", "no chapter numbering rules" );
 
         if( xNumRule.is() )
         {
@@ -793,11 +793,11 @@ void SvxXMLNumRuleExport::exportStyles( bool bUsed,
         exportOutline();
 
     Reference< XStyleFamiliesSupplier > xFamiliesSupp( GetExport().GetModel(), UNO_QUERY );
-    DBG_ASSERT( xFamiliesSupp.is(), "No XStyleFamiliesSupplier from XModel for export!" );
+    SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff", "No XStyleFamiliesSupplier from XModel for export!" );
     if( xFamiliesSupp.is() )
     {
         Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
-        DBG_ASSERT( xFamiliesSupp.is(), "getStyleFamilies() from XModel failed for export!" );
+        SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff", "getStyleFamilies() from XModel failed for export!" );
 
         if( xFamilies.is() )
         {
@@ -808,7 +808,7 @@ void SvxXMLNumRuleExport::exportStyles( bool bUsed,
             {
                 xFamilies->getByName( aNumberStyleName ) >>= xStyles;
 
-                DBG_ASSERT( xStyles.is(), "Style not found for export!" );
+                SAL_WARN_IF( !xStyles.is(), "xmloff", "Style not found for export!" );
 
                 if( xStyles.is() )
                 {
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 78bd915..3fd0d5c 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1096,7 +1096,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
             eType = XML_BOOLEAN_STYLE;
             break;
     }
-    DBG_ASSERT( eType != XML_TOKEN_INVALID, "unknown format type" );
+    SAL_WARN_IF( eType == XML_TOKEN_INVALID, "xmloff", "unknown format type" );
 
     OUString sAttrValue;
     bool bUserDef = ( rFormat.GetType() & css::util::NumberFormat::DEFINED );
@@ -1867,7 +1867,7 @@ OUString SvXMLNumFmtExport::GetStyleName( sal_uInt32 nKey )
 
 void SvXMLNumFmtExport::SetUsed( sal_uInt32 nKey )
 {
-    DBG_ASSERT( pFormatter != nullptr, "missing formatter" );
+    SAL_WARN_IF( pFormatter == nullptr, "xmloff", "missing formatter" );
     if( !pFormatter )
         return;
 
@@ -1903,7 +1903,7 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey )
     const SvNumberformat* pFormat = lcl_GetFormat( pFormatter, nKey );
     if( pFormat != nullptr )
     {
-        DBG_ASSERT( pFormatter != nullptr, "format without formatter?" );
+        SAL_WARN_IF( pFormatter == nullptr, "xmloff", "format without formatter?" );
 
         sal_Int32 nErrorPos;
         short nType = pFormat->GetType();
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 42ef1d4..7e9c501 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -363,7 +363,7 @@ SvXMLNumImpData::SvXMLNumImpData(
     pLocaleData(nullptr),
     m_xContext(rxContext)
 {
-    DBG_ASSERT( rxContext.is(), "got no service manager" );
+    SAL_WARN_IF( !rxContext.is(), "xmloff", "got no service manager" );
 }
 
 SvXMLNumImpData::~SvXMLNumImpData()
@@ -2245,7 +2245,7 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper(
     const uno::Reference<util::XNumberFormatsSupplier>& rSupp,
     const uno::Reference<uno::XComponentContext>& rxContext )
 {
-    DBG_ASSERT( rxContext.is(), "got no service manager" );
+    SAL_WARN_IF( !rxContext.is(), "xmloff", "got no service manager" );
 
     SvNumberFormatter* pFormatter = nullptr;
     SvNumberFormatsSupplierObj* pObj =
@@ -2260,7 +2260,7 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper(
     SvNumberFormatter* pNumberFormatter,
     const uno::Reference<uno::XComponentContext>& rxContext )
 {
-    DBG_ASSERT( rxContext.is(), "got no service manager" );
+    SAL_WARN_IF( !rxContext.is(), "xmloff", "got no service manager" );
 
     pData = new SvXMLNumImpData( pNumberFormatter, rxContext );
 }
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 5d24e0e..5feafab 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -582,7 +582,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties()
             pProps[nPos++].Value <<= m_nColor;
         }
 
-        DBG_ASSERT( nPos == nCount, "array under/overflow" );
+        SAL_WARN_IF( nPos != nCount, "xmloff", "array under/overflow" );
     }
 
     return aPropSeq;
@@ -1162,7 +1162,7 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite )
         {
             Reference< XMultiServiceFactory > xFactory( GetImport().GetModel(),
                                                         UNO_QUERY );
-            DBG_ASSERT( xFactory.is(), "no factory" );
+            SAL_WARN_IF( !xFactory.is(), "xmloff", "no factory" );
             if( !xFactory.is() )
                 return;
 
@@ -1213,8 +1213,8 @@ void SvxXMLListStyleContext::CreateAndInsertLate( bool bOverwrite )
 
 void SvxXMLListStyleContext::CreateAndInsertAuto() const
 {
-    DBG_ASSERT( !bOutline, "Outlines cannot be inserted here" );
-    DBG_ASSERT( !xNumRules.is(), "Numbering Rule is existing already" );
+    SAL_WARN_IF( bOutline, "xmloff", "Outlines cannot be inserted here" );
+    SAL_WARN_IF( xNumRules.is(), "xmloff", "Numbering Rule is existing already" );
 
     const OUString& rName = GetName();
     if( bOutline || xNumRules.is() || rName.isEmpty() )
@@ -1236,7 +1236,7 @@ Reference < XIndexReplace > SvxXMLListStyleContext::CreateNumRule(
     Reference<XIndexReplace> xNumRule;
 
     Reference< XMultiServiceFactory > xFactory( rModel, UNO_QUERY );
-    DBG_ASSERT( xFactory.is(), "no factory" );
+    SAL_WARN_IF( !xFactory.is(), "xmloff", "no factory" );
     if( !xFactory.is() )
         return xNumRule;
 
@@ -1245,7 +1245,7 @@ Reference < XIndexReplace > SvxXMLListStyleContext::CreateNumRule(
         return xNumRule;
 
     xNumRule.set( xIfc, UNO_QUERY );
-    DBG_ASSERT( xNumRule.is(), "go no numbering rule" );
+    SAL_WARN_IF( !xNumRule.is(), "xmloff", "go no numbering rule" );
 
     return xNumRule;
 }
diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx
index 1389f1e..913c40c 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -415,7 +415,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates )
             nRowSpan = xMerge->getRowSpan();
             nColSpan = xMerge->getColumnSpan();
         }
-        DBG_ASSERT( (nRowSpan >= 1) && (nColSpan >= 1), "xmloff::XMLTableExport::ExportCell(), illegal row or col span < 1?" );
+        SAL_WARN_IF( (nRowSpan < 1) || (nColSpan < 1), "xmloff", "xmloff::XMLTableExport::ExportCell(), illegal row or col span < 1?" );
     }
     catch (const Exception&)
     {
diff --git a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
index 1822fd2..b0f0334 100644
--- a/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
+++ b/xmloff/source/text/XMLIndexTabStopEntryContext.cxx
@@ -154,7 +154,7 @@ void XMLIndexTabStopEntryContext::FillPropertyValues(
     nNextEntry++;
 
     // check whether we really filled all elements of the sequence
-    DBG_ASSERT( nNextEntry == rValues.getLength(),
+    SAL_WARN_IF( nNextEntry != rValues.getLength(), "xmloff",
                 "length incorrectly precumputed!" );
 }
 
diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx
index a60109e..669d5be 100644
--- a/xmloff/source/text/XMLIndexTemplateContext.cxx
+++ b/xmloff/source/text/XMLIndexTemplateContext.cxx
@@ -104,8 +104,8 @@ XMLIndexTemplateContext::XMLIndexTemplateContext(
     DBG_ASSERT( ((XML_TOKEN_INVALID != eLevelAttrName) &&  (nullptr != pLevelNameMap))
                 || ((XML_TOKEN_INVALID == eLevelAttrName) &&  (nullptr == pLevelNameMap)),
                 "need both, attribute name and value map, or neither" );
-    DBG_ASSERT( nullptr != pOutlineLevelStylePropMap, "need property name map" );
-    DBG_ASSERT( nullptr != pAllowedTokenTypes, "need allowed tokens map" );
+    SAL_WARN_IF( nullptr == pOutlineLevelStylePropMap, "xmloff", "need property name map" );
+    SAL_WARN_IF( nullptr == pAllowedTokenTypes, "xmloff", "need allowed tokens map" );
 
     // no map for outline-level? then use 1
     if (nullptr == pLevelNameMap)
diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx
index 0806958..8a5a062 100644
--- a/xmloff/source/text/XMLRedlineExport.cxx
+++ b/xmloff/source/text/XMLRedlineExport.cxx
@@ -592,7 +592,7 @@ void XMLRedlineExport::ExportStartOrEndRedline(
 
     if( bIdOK )
     {
-        DBG_ASSERT( !sId.isEmpty(), "Redlines must have IDs" );
+        SAL_WARN_IF( sId.isEmpty(), "xmloff", "Redlines must have IDs" );
 
         // TODO: use GetRedlineID or eliminate that function
         OUStringBuffer sBuffer(sChangePrefix);
diff --git a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
index 2248f61..4d2e3b2 100644
--- a/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
+++ b/xmloff/source/text/XMLSectionFootnoteConfigExport.cxx
@@ -89,7 +89,7 @@ void XMLSectionFootnoteConfigExport::exportXML(
                     rState.maValue >>= sNumSuffix;
                     break;
                 case CTF_SECTION_FOOTNOTE_END:
-                    DBG_ASSERT( i == nIdx,
+                    SAL_WARN_IF( i != nIdx, "xmloff",
                                 "received wrong property state index" );
                     rState.maValue >>= bEnd;
                     break;
@@ -118,7 +118,7 @@ void XMLSectionFootnoteConfigExport::exportXML(
                     rState.maValue >>= sNumSuffix;
                     break;
                 case CTF_SECTION_ENDNOTE_END:
-                    DBG_ASSERT( i == nIdx,
+                    SAL_WARN_IF( i != nIdx, "xmloff",
                                 "received wrong property state index" );
                     rState.maValue >>= bEnd;
                     break;
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index d0cc7c1..c304bfb 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -547,7 +547,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
                     case XML_TEXT_FRAME_GRAPHIC: sServiceName = sGraphicServiceName; break;
                 }
                 Reference<XInterface> xIfc = xFactory->createInstance( sServiceName );
-                DBG_ASSERT( xIfc.is(), "couldn't create frame" );
+                SAL_WARN_IF( !xIfc.is(), "xmloff", "couldn't create frame" );
                 if( xIfc.is() )
                     xPropSet.set( xIfc, UNO_QUERY );
             }
diff --git a/xmloff/source/text/XMLTextListAutoStylePool.cxx b/xmloff/source/text/XMLTextListAutoStylePool.cxx
index 617e209..10f5e6d 100644
--- a/xmloff/source/text/XMLTextListAutoStylePool.cxx
+++ b/xmloff/source/text/XMLTextListAutoStylePool.cxx
@@ -258,7 +258,7 @@ void XMLTextListAutoStylePool::exportXML() const
     for( i=0; i < nCount; i++ )
     {
         XMLTextListAutoStylePoolEntry_Impl *pEntry = (*pPool)[i];
-        DBG_ASSERT( pEntry->GetPos() < nCount, "Illegal pos" );
+        SAL_WARN_IF( pEntry->GetPos() >= nCount, "xmloff", "Illegal pos" );
         aExpEntries[pEntry->GetPos()] = pEntry;
     }
 
diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx
index e0e0a63..757676d 100644
--- a/xmloff/source/text/XMLTextListBlockContext.cxx
+++ b/xmloff/source/text/XMLTextListBlockContext.cxx
@@ -149,7 +149,7 @@ XMLTextListBlockContext::XMLTextListBlockContext(
                 {
                     xNumRuleProps->getPropertyValue(s_PropNameDefaultListId)
                         >>= sListStyleDefaultListId;
-                    DBG_ASSERT( !sListStyleDefaultListId.isEmpty(),
+                    SAL_WARN_IF( sListStyleDefaultListId.isEmpty(), "xmloff",
                                 "no default list id found at numbering rules instance. Serious defect." );
                 }
             }
diff --git a/xmloff/source/text/XMLTextMasterPageExport.cxx b/xmloff/source/text/XMLTextMasterPageExport.cxx
index a5ad798..fa82c6e 100644
--- a/xmloff/source/text/XMLTextMasterPageExport.cxx
+++ b/xmloff/source/text/XMLTextMasterPageExport.cxx
@@ -57,7 +57,7 @@ void XMLTextMasterPageExport::exportHeaderFooterContent(
             const Reference< XText >& rText,
             bool bAutoStyles, bool bExportParagraph )
 {
-    DBG_ASSERT( rText.is(), "There is the text" );
+    SAL_WARN_IF( !rText.is(), "xmloff", "There is the text" );
 
     // tracked changes (autostyles + changes list)
     GetExport().GetTextParagraphExport()->recordTrackedChangesForXText(rText);
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx
index 1f4e60f..e5503ae 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.cxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx
@@ -134,14 +134,14 @@ void XMLTextNumRuleInfo::Set(
         if ( msNumRulesName.isEmpty() )
         {
             Reference < XNamed > xNamed( mxNumRules, UNO_QUERY );
-            DBG_ASSERT( xNamed.is(),
+            SAL_WARN_IF( !xNamed.is(), "xmloff",
                         "<XMLTextNumRuleInfo::Set(..)> - numbering rules instance have to be named. Serious defect." );
             if( xNamed.is() )
             {
                 msNumRulesName = xNamed->getName();
             }
         }
-        DBG_ASSERT( !msNumRulesName.isEmpty(),
+        SAL_WARN_IF( msNumRulesName.isEmpty(), "xmloff",
                     "<XMLTextNumRuleInfo::Set(..)> - no name found for numbering rules instance. Serious defect." );
 
         if( xPropSetInfo->hasPropertyByName( msPropNameListId ) )
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index 4ebf531..71131c2 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -148,11 +148,11 @@ void XMLTextExportPropertySetMapper::handleSpecialItem(
     switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ) )
     {
     case CTF_DROPCAPWHOLEWORD:
-        DBG_ASSERT( !bDropWholeWord, "drop whole word is set already!" );
+        SAL_WARN_IF( !!bDropWholeWord, "xmloff", "drop whole word is set already!" );
         pThis->bDropWholeWord = *o3tl::doAccess<bool>(rProperty.maValue);
         break;
     case CTF_DROPCAPCHARSTYLE:
-        DBG_ASSERT( sDropCharStyle.isEmpty(), "drop char style is set already!" );
+        SAL_WARN_IF( !sDropCharStyle.isEmpty(), "xmloff", "drop char style is set already!" );
         rProperty.maValue >>= pThis->sDropCharStyle;
         break;
     case CTF_NUMBERINGSTYLENAME:
@@ -1172,7 +1172,7 @@ bool lcl_IsOutlineStyle(const SvXMLExport &rExport, const OUString & rName)
     {
         Reference<XPropertySet> xNumRule(
             xCNSupplier->getChapterNumberingRules(), UNO_QUERY );
-        DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
+        SAL_WARN_IF( !xNumRule.is(), "xmloff", "no chapter numbering rules" );
         if (xNumRule.is())
         {
             xNumRule->getPropertyValue("Name") >>= sOutlineName;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index aee0f3a..3b7028a 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2447,7 +2447,7 @@ void XMLTextFieldExport::ProcessDisplay(bool bIsVisible,
 void XMLTextFieldExport::ProcessBoolean(enum XMLTokenEnum eName,
                                         bool bBool, bool bDefault)
 {
-    DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token");
+    SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff", "invalid element token");
     if ( XML_TOKEN_INVALID == eName )
         return;
 
@@ -2466,7 +2466,7 @@ void XMLTextFieldExport::ProcessString(enum XMLTokenEnum eName,
                                        bool bOmitEmpty,
                                        sal_uInt16 nPrefix)
 {
-    DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token");
+    SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff", "invalid element token");
     if ( XML_TOKEN_INVALID == eName )
         return;
 
@@ -2517,8 +2517,8 @@ void XMLTextFieldExport::ProcessString(
     enum XMLTokenEnum eValue,
     sal_uInt16 nPrefix)
 {
-    DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token" );
-    DBG_ASSERT( eValue != XML_TOKEN_INVALID, "invalid value token" );
+    SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff", "invalid element token" );
+    SAL_WARN_IF( eValue == XML_TOKEN_INVALID, "xmloff", "invalid value token" );
     if ( XML_TOKEN_INVALID == eName )
         return;
 
@@ -2556,7 +2556,7 @@ void XMLTextFieldExport::ProcessParagraphSequence(
 void XMLTextFieldExport::ProcessInteger(enum XMLTokenEnum eName,
                                         sal_Int32 nNum)
 {
-    DBG_ASSERT( eName != XML_TOKEN_INVALID, "invalid element token");
+    SAL_WARN_IF( eName == XML_TOKEN_INVALID, "xmloff", "invalid element token");
     if ( XML_TOKEN_INVALID == eName )
         return;
 
@@ -2802,9 +2802,9 @@ void XMLTextFieldExport::ExportDataBaseElement(
     const Reference<XPropertySet>& rPropertySet,
     const Reference<XPropertySetInfo>& rPropertySetInfo )
 {
-    DBG_ASSERT( eElementName != XML_TOKEN_INVALID, "need token" );
-    DBG_ASSERT( rPropertySet.is(), "need property set" );
-    DBG_ASSERT( rPropertySetInfo.is(), "need property set info" );
+    SAL_WARN_IF( eElementName == XML_TOKEN_INVALID, "xmloff", "need token" );
+    SAL_WARN_IF( !rPropertySet.is(), "xmloff", "need property set" );
+    SAL_WARN_IF( !rPropertySetInfo.is(), "xmloff", "need property set info" );
 
     // get database properties
     OUString sDataBaseName;
diff --git a/xmloff/source/text/txtftne.cxx b/xmloff/source/text/txtftne.cxx
index c80caa9..18333c9 100644
--- a/xmloff/source/text/txtftne.cxx
+++ b/xmloff/source/text/txtftne.cxx
@@ -234,7 +234,7 @@ static void lcl_exportString(
     bool bEncodeName,
     bool bOmitIfEmpty)
 {
-    DBG_ASSERT( eElement != XML_TOKEN_INVALID, "need element token");
+    SAL_WARN_IF( eElement == XML_TOKEN_INVALID, "xmloff", "need element token");
 
     Any aAny = rPropSet->getPropertyValue(sProperty);
     OUString sTmp;
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 5d6abd9..9fb143c 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -929,7 +929,7 @@ XMLTextImportHelper::XMLTextImportHelper(
     }
 
     Reference< XStyleFamiliesSupplier > xFamiliesSupp( rModel, UNO_QUERY );
-//  DBG_ASSERT( xFamiliesSupp.is(), "no chapter numbering supplier" ); for clipboard there may be documents without styles
+//  SAL_WARN_IF( !xFamiliesSupp.is(), "xmloff", "no chapter numbering supplier" ); for clipboard there may be documents without styles
 
     if( xFamiliesSupp.is() )
     {
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 4c3aa29..147d565 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -468,7 +468,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
         xPropMapper = GetRubyPropMapper();
         break;
     }
-    DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" );
+    SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" );
 
     vector< XMLPropertyState > aPropStates =
             xPropMapper->Filter( rPropSet );
@@ -599,7 +599,7 @@ void XMLTextParagraphExport::Add( sal_uInt16 nFamily,
         xPropMapper = GetParaPropMapper();
         break;
     }
-    DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" );
+    SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" );
 
     vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
 
@@ -693,7 +693,7 @@ OUString XMLTextParagraphExport::Find(
         xPropMapper = GetRubyPropMapper();
         break;
     }
-    DBG_ASSERT( xPropMapper.is(), "There is the property mapper?" );
+    SAL_WARN_IF( !xPropMapper.is(), "xmloff", "There is the property mapper?" );
     if( !xPropMapper.is() )
         return sName;
     vector< XMLPropertyState > aPropStates(xPropMapper->Filter( rPropSet ));
@@ -806,7 +806,7 @@ void XMLTextParagraphExport::exportListChange(
         else if ( rPrevInfo.GetLevel() > rNextInfo.GetLevel() )
         {
             // close corresponding sub lists
-            DBG_ASSERT( rNextInfo.GetLevel() > 0,
+            SAL_WARN_IF( rNextInfo.GetLevel() <= 0, "xmloff",
                         "<rPrevInfo.GetLevel() > 0> not hold. Serious defect." );
             nListLevelsToBeClosed = rPrevInfo.GetLevel() - rNextInfo.GetLevel();
         }
@@ -851,7 +851,7 @@ void XMLTextParagraphExport::exportListChange(
         else if ( rNextInfo.GetLevel() > rPrevInfo.GetLevel() )
         {
             // open corresponding sub lists
-            DBG_ASSERT( rPrevInfo.GetLevel() > 0,
+            SAL_WARN_IF( rPrevInfo.GetLevel() <= 0, "xmloff",
                         "<rPrevInfo.GetLevel() > 0> not hold. Serious defect." );
             nListLevelsToBeOpened = rNextInfo.GetLevel() - rPrevInfo.GetLevel();
         }
@@ -1324,7 +1324,7 @@ XMLTextParagraphExport::~XMLTextParagraphExport()
     txtparae_bContainsIllegalCharacters = false;
 #endif
     PopTextListsHelper();
-    DBG_ASSERT( maTextListsHelperStack.empty(),
+    SAL_WARN_IF( !maTextListsHelperStack.empty(), "xmloff",
                 "misusage of text lists helper stack - it is not empty. Serious defect" );
 }
 
@@ -1648,7 +1648,7 @@ void XMLTextParagraphExport::exportText(
 
     // #97718# footnotes don't supply paragraph enumerations in some cases
     // This is always a bug, but at least we don't want to crash.
-    DBG_ASSERT( xParaEnum.is(), "We need a paragraph enumeration" );
+    SAL_WARN_IF( !xParaEnum.is(), "xmloff", "We need a paragraph enumeration" );
     if( ! xParaEnum.is() )
         return;
 
@@ -1733,7 +1733,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration(
         const Reference < XPropertySet > *pRangePropSet,
         bool bExportLevels, TextPNS eExtensionNS )
 {
-    DBG_ASSERT( rContEnum.is(), "No enumeration to export!" );
+    SAL_WARN_IF( !rContEnum.is(), "xmloff", "No enumeration to export!" );
     bool bHasMoreElements = rContEnum->hasMoreElements();
     if( !bHasMoreElements )
         return false;
@@ -1866,7 +1866,7 @@ bool XMLTextParagraphExport::exportTextContentEnumeration(
         }
         else
         {
-            DBG_ASSERT( !xTxtCntnt.is(), "unknown text content" );
+            SAL_WARN_IF( xTxtCntnt.is(), "xmloff", "unknown text content" );
         }
 
         if( !bAutoStyles )
@@ -2026,7 +2026,7 @@ void XMLTextParagraphExport::exportParagraph(
                             if (xCNSupplier.is())
                             {
                                 Reference< XIndexReplace > xNumRule ( xCNSupplier->getChapterNumberingRules() );
-                                DBG_ASSERT( xNumRule.is(), "no chapter numbering rules" );
+                                SAL_WARN_IF( !xNumRule.is(), "xmloff", "no chapter numbering rules" );
 
                                 if (xNumRule.is())
                                 {
@@ -2427,7 +2427,7 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
     }
 
 // now that there are nested enumerations for meta(-field), this may be valid!
-//  DBG_ASSERT( !bOpenRuby, "Red Alert: Ruby still open!" );
+//  SAL_WARN_IF( bOpenRuby, "xmloff", "Red Alert: Ruby still open!" );
 }
 
 void XMLTextParagraphExport::exportTable(
@@ -2445,7 +2445,7 @@ void XMLTextParagraphExport::exportTextField(
     if (xPropSet->getPropertySetInfo()->hasPropertyByName( sTextField ))
     {
         Reference < XTextField > xTxtFld(xPropSet->getPropertyValue( sTextField ), uno::UNO_QUERY);
-        DBG_ASSERT( xTxtFld.is(), "text field missing" );
+        SAL_WARN_IF( !xTxtFld.is(), "xmloff", "text field missing" );
         if( xTxtFld.is() )
         {
             exportTextField(xTxtFld, bAutoStyles, bIsProgress, true);
@@ -2681,7 +2681,7 @@ XMLShapeExportFlags XMLTextParagraphExport::addTextFrameAttributes(
     {
         sal_Int16 nRelWidth =  0;
         rPropSet->getPropertyValue( sRelativeWidth ) >>= nRelWidth;
-        DBG_ASSERT( nRelWidth >= 0 && nRelWidth <= 254,
+        SAL_WARN_IF( nRelWidth < 0 || nRelWidth > 254, "xmloff",
                     "Got illegal relative width from API" );
         if( nRelWidth > 0 )
         {
@@ -3436,7 +3436,7 @@ void XMLTextParagraphExport::exportText( const OUString& rText,
            // the text that has not been exported by now has to be exported now.
         if( nPos > nExpStartPos && !bExpCharAsText )
         {
-            DBG_ASSERT( 0==nSpaceChars, "pending spaces" );
+            SAL_WARN_IF( 0 != nSpaceChars, "xmloff", "pending spaces" );
             OUString sExp( rText.copy( nExpStartPos, nPos - nExpStartPos ) );
             GetExport().Characters( sExp );
             nExpStartPos = nPos;
@@ -3447,7 +3447,7 @@ void XMLTextParagraphExport::exportText( const OUString& rText,
         // exported now.
         if( nSpaceChars > 0 && !bCurrCharIsSpace )
         {
-            DBG_ASSERT( nExpStartPos == nPos, " pending characters" );
+            SAL_WARN_IF( nExpStartPos != nPos, "xmloff", " pending characters" );
 
             if( nSpaceChars > 1 )
             {
@@ -3497,14 +3497,14 @@ void XMLTextParagraphExport::exportText( const OUString& rText,
         // position for text is the position behind the current position.
         if( !bExpCharAsText )
         {
-            DBG_ASSERT( nExpStartPos == nPos, "wrong export start pos" );
+            SAL_WARN_IF( nExpStartPos != nPos, "xmloff", "wrong export start pos" );
             nExpStartPos = nPos+1;
         }
     }
 
     if( nExpStartPos < nEndPos )
     {
-        DBG_ASSERT( 0==nSpaceChars, " pending spaces " );
+        SAL_WARN_IF( 0 != nSpaceChars, "xmloff", " pending spaces " );
         OUString sExp( rText.copy( nExpStartPos, nEndPos - nExpStartPos ) );
         GetExport().Characters( sExp );
     }
@@ -3751,7 +3751,7 @@ void XMLTextParagraphExport::PreventExportOfControlsInMuteSections(
         // if we don't have shapes or a form export, there's nothing to do
         return;
     }
-    DBG_ASSERT( pSectionExport != nullptr, "We need the section export." );
+    SAL_WARN_IF( pSectionExport == nullptr, "xmloff", "We need the section export." );
 
     Reference<XEnumeration> xShapesEnum = pBoundFrameSets->GetShapes()->createEnumeration();
     if(!xShapesEnum.is())
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 447662a..dc60fae 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -1037,7 +1037,7 @@ static XMLPropertyMapEntry *lcl_txtprmap_getMap( TextPropMap nType )
         pMap = aXMLTableRowDefaultsMap;
         break;
     }
-    DBG_ASSERT( pMap, "illegal map type" );
+    SAL_WARN_IF( !pMap, "xmloff", "illegal map type" );
     return pMap;
 }
 
diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx
index a1f147d..75be7fc 100644
--- a/xmloff/source/text/txtstyli.cxx
+++ b/xmloff/source/text/txtstyli.cxx
@@ -496,7 +496,7 @@ void XMLTextStyleContext::FillPropertySet(
         if(IsDefaultStyle() && XML_STYLE_FAMILY_TABLE_ROW == GetFamily())
         {
             OUString sIsSplitAllowed("IsSplitAllowed");
-            DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), "property missing?" );
+            SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sIsSplitAllowed ), "xmloff", "property missing?" );
             rPropSet->setPropertyValue(
                 sIsSplitAllowed,
                 (aContextIDs[1].nIndex == -1) ? makeAny( false ) : GetProperties()[aContextIDs[1].nIndex].maValue );
@@ -505,7 +505,7 @@ void XMLTextStyleContext::FillPropertySet(
         if(IsDefaultStyle() && XML_STYLE_FAMILY_TABLE_TABLE == GetFamily())
         {
             OUString sCollapsingBorders("CollapsingBorders");
-            DBG_ASSERT( rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), "property missing?" );
+            SAL_WARN_IF( !rPropSet->getPropertySetInfo()->hasPropertyByName( sCollapsingBorders ), "xmloff", "property missing?" );
             rPropSet->setPropertyValue(
                 sCollapsingBorders,
                 (aContextIDs[2].nIndex == -1)
diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx
index 3032c81..e595a88 100644
--- a/xmloff/source/xforms/SchemaRestrictionContext.cxx
+++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx
@@ -90,7 +90,7 @@ SchemaRestrictionContext::SchemaRestrictionContext(
         msTypeName( sTypeName ),
         msBaseName()
 {
-    DBG_ASSERT( mxRepository.is(), "need repository" );
+    SAL_WARN_IF( !mxRepository.is(), "xmloff", "need repository" );
 }
 
 SchemaRestrictionContext::~SchemaRestrictionContext()
@@ -103,8 +103,8 @@ void SchemaRestrictionContext::CreateDataType()
     if( mxDataType.is() )
         return;
 
-    DBG_ASSERT( !msBaseName.isEmpty(), "no base name?" );
-    DBG_ASSERT( mxRepository.is(), "no repository?" );
+    SAL_WARN_IF( msBaseName.isEmpty(), "xmloff", "no base name?" );
+    SAL_WARN_IF( !mxRepository.is(), "xmloff", "no repository?" );
 
     try
     {
@@ -121,7 +121,7 @@ void SchemaRestrictionContext::CreateDataType()
     {
         OSL_FAIL( "exception during type creation" );
     }
-    DBG_ASSERT( mxDataType.is(), "can't create type" );
+    SAL_WARN_IF( !mxDataType.is(), "xmloff", "can't create type" );
 }
 
 void SchemaRestrictionContext::HandleAttribute(
diff --git a/xmloff/source/xforms/TokenContext.cxx b/xmloff/source/xforms/TokenContext.cxx
index 8751b9d..a1341b9 100644
--- a/xmloff/source/xforms/TokenContext.cxx
+++ b/xmloff/source/xforms/TokenContext.cxx
@@ -60,7 +60,7 @@ void TokenContext::StartElement(
     // - if in map: call HandleAttribute
     // - xmlns:... : ignore
     // - other: warning
-    DBG_ASSERT( mpAttributes != nullptr, "no token map for attributes" );
+    SAL_WARN_IF( mpAttributes == nullptr, "xmloff", "no token map for attributes" );
     SvXMLTokenMap aMap( mpAttributes );
 
     sal_Int16 nCount = xAttributeList->getLength();
@@ -100,7 +100,7 @@ SvXMLImportContext* TokenContext::CreateChildContext(
 
     SvXMLImportContext* pContext = nullptr;
 
-    DBG_ASSERT( mpChildren != nullptr, "no token map for child elements" );
+    SAL_WARN_IF( mpChildren == nullptr, "xmloff", "no token map for child elements" );
     SvXMLTokenMap aMap( mpChildren );
     sal_uInt16 nToken = aMap.Get( nPrefix, rLocalName );
     if( nToken != XML_TOK_UNKNOWN )
diff --git a/xmloff/source/xforms/XFormsBindContext.cxx b/xmloff/source/xforms/XFormsBindContext.cxx
index 096e3fb..9c7c811 100644
--- a/xmloff/source/xforms/XFormsBindContext.cxx
+++ b/xmloff/source/xforms/XFormsBindContext.cxx
@@ -72,7 +72,7 @@ XFormsBindContext::XFormsBindContext(
 {
     // attach binding to model
     mxBinding = mxModel->createBinding();
-    DBG_ASSERT( mxBinding.is(), "can't create binding" );
+    SAL_WARN_IF( !mxBinding.is(), "xmloff", "can't create binding" );
     mxModel->getBindings()->insert( makeAny( mxBinding ) );
 }
 
@@ -126,7 +126,7 @@ void XFormsBindContext::StartElement(
         mxBinding->getPropertyValue( "BindingNamespaces" ),
         UNO_QUERY );
 
-    DBG_ASSERT( xContainer.is(), "binding should have a namespace container" );
+    SAL_WARN_IF( !xContainer.is(), "xmloff", "binding should have a namespace container" );
     if( xContainer.is() )
         lcl_fillNamespaceContainer( GetImport().GetNamespaceMap(), xContainer);
 
@@ -158,7 +158,7 @@ static void lcl_fillNamespaceContainer(
         const OUString& sNamespace = aMap.GetNameByKey( nKeyIter );
 
         // as a hack, we will ignore our own 'default' namespaces
-        DBG_ASSERT( !sPrefix.isEmpty(), "no prefix?" );
+        SAL_WARN_IF( sPrefix.isEmpty(), "xmloff", "no prefix?" );
         if( !sPrefix.startsWith("_") &&
             nKeyIter >= XML_OLD_NAMESPACE_META_IDX )
         {
diff --git a/xmloff/source/xforms/XFormsInstanceContext.cxx b/xmloff/source/xforms/XFormsInstanceContext.cxx
index d536fc1..cf5a24c 100644
--- a/xmloff/source/xforms/XFormsInstanceContext.cxx
+++ b/xmloff/source/xforms/XFormsInstanceContext.cxx
@@ -63,7 +63,7 @@ XFormsInstanceContext::XFormsInstanceContext(
         TokenContext( rImport, nPrefix, rLocalName, aAttributes, aEmptyMap ),
         mxModel( xModel )
 {
-    DBG_ASSERT( mxModel.is(), "need model" );
+    SAL_WARN_IF( !mxModel.is(), "xmloff", "need model" );
 }
 
 XFormsInstanceContext::~XFormsInstanceContext()
@@ -94,7 +94,7 @@ SvXMLImportContext* XFormsInstanceContext::CreateChildContext(
         pContext = pInstance;
     }
 
-    DBG_ASSERT( pContext != nullptr, "no context!" );
+    SAL_WARN_IF( pContext == nullptr, "xmloff", "no context!" );
     return pContext;
 
 }
diff --git a/xmloff/source/xforms/XFormsSubmissionContext.cxx b/xmloff/source/xforms/XFormsSubmissionContext.cxx
index 3fdfb25..0ebad87 100644
--- a/xmloff/source/xforms/XFormsSubmissionContext.cxx
+++ b/xmloff/source/xforms/XFormsSubmissionContext.cxx
@@ -72,9 +72,9 @@ XFormsSubmissionContext::XFormsSubmissionContext(
         mxSubmission()
 {
     // register submission with model
-    DBG_ASSERT( xModel.is(), "need model" );
+    SAL_WARN_IF( !xModel.is(), "xmloff", "need model" );
     mxSubmission = xModel->createSubmission().get();
-    DBG_ASSERT( mxSubmission.is(), "can't create submission" );
+    SAL_WARN_IF( !mxSubmission.is(), "xmloff", "can't create submission" );
     xModel->getSubmissions()->insert( makeAny( mxSubmission ) );
 }
 
diff --git a/xmloff/source/xforms/xformsapi.cxx b/xmloff/source/xforms/xformsapi.cxx
index 17383a4..13e2204 100644
--- a/xmloff/source/xforms/xformsapi.cxx
+++ b/xmloff/source/xforms/xformsapi.cxx
@@ -90,7 +90,7 @@ void xforms_addXFormsModel(
     }
 
     // TODO: implement proper error handling
-    DBG_ASSERT( bSuccess, "can't import model" );
+    SAL_WARN_IF( !bSuccess, "xmloff", "can't import model" );
     (void)bSuccess;
 }
 
@@ -203,7 +203,7 @@ sal_uInt16 xforms_getTypeClass(
     if( nToken != XML_TOK_UNKNOWN )
     {
         // we found an XSD name: then get the proper API name for it
-        DBG_ASSERT( xRepository.is(), "can't find type without repository");
+        SAL_WARN_IF( !xRepository.is(), "xmloff", "can't find type without repository");
         switch( nToken )
         {
         case XML_STRING:
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx
index f12d07e..e12f9b2 100644
--- a/xmloff/source/xforms/xformsexport.cxx
+++ b/xmloff/source/xforms/xformsexport.cxx
@@ -562,7 +562,7 @@ void exportXFormsSchemas( SvXMLExport& rExport,
         if( xTypes.is() )
         {
             Reference<XEnumeration> xEnum = xTypes->createEnumeration();
-            DBG_ASSERT( xEnum.is(), "no enum?" );
+            SAL_WARN_IF( !xEnum.is(), "xmloff", "no enum?" );
             while( xEnum->hasMoreElements() )
             {
                 Reference<XPropertySet> xType( xEnum->nextElement(), UNO_QUERY );


More information about the Libreoffice-commits mailing list