[Libreoffice-commits] core.git: sal/inc xmlscript/source

Radu Ioan ioan.radu.g at gmail.com
Mon Apr 8 01:26:20 PDT 2013


 sal/inc/sal/log-areas.dox                          |    8 ++
 xmlscript/source/xml_helper/xml_impctx.cxx         |   29 ++++-----
 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx    |   61 ++++++++++-----------
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |    8 +-
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx    |    8 +-
 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx   |   14 +---
 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx   |   23 ++-----
 xmlscript/source/xmllib_imexp/xmllib_import.cxx    |    4 -
 xmlscript/source/xmlmod_imexp/xmlmod_import.cxx    |    4 -
 9 files changed, 75 insertions(+), 84 deletions(-)

New commits:
commit b20e7e1d11c8765116c415d7dabd3602d88d1103
Author: Radu Ioan <ioan.radu.g at gmail.com>
Date:   Sun Apr 7 16:47:26 2013 +0300

    fdo#43157 - Clean up OSL_ASSERT
    
     - replaced osl_trace with sal_info
     - added new log areas to log-area.dox
    
    Change-Id: I41444e90a22bad7d04d3827914d4d793b3601304
    Signed-off-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 6466c6e..98adef8 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -302,6 +302,14 @@ certain functionality.
 @li @c xmlsecurity.helper
 @li @c xmlsecurity.xmlsec - xmlsec wrapper
 
+ at section xmlscript
+
+ at li @c xmlscript.xmlhelper
+ at li @c xmlscript.xmldlg
+ at li @c xmlscript.xmlflat
+ at li @c xmlscript.xmllib
+ at li @c xmlscript.xmlmod
+
 @section dbaccess
 
 @li @c dbaccess
diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx
index 9189e53..11906bb 100644
--- a/xmlscript/source/xml_helper/xml_impctx.cxx
+++ b/xmlscript/source/xml_helper/xml_impctx.cxx
@@ -263,7 +263,7 @@ inline sal_Int32 DocumentHandlerImpl::getUidByPrefix(
         if (iFind != m_prefixes.end())
         {
             const PrefixEntry & rPrefixEntry = *iFind->second;
-            OSL_ASSERT( ! rPrefixEntry.m_Uids.empty() );
+            SAL_WARN_IF( rPrefixEntry.m_Uids.empty(), "xmlscript.xmlhelper", "rPrefixEntry.m_Uids is empty" );
             m_nLastPrefix_lookup = rPrefixEntry.m_Uids.back();
             m_aLastPrefix_lookup = rPrefix;
         }
@@ -294,7 +294,7 @@ inline void DocumentHandlerImpl::pushPrefix(
     else
     {
         PrefixEntry * pEntry = iFind->second;
-        OSL_ASSERT( ! pEntry->m_Uids.empty() );
+        SAL_WARN_IF( pEntry->m_Uids.empty(), "xmlscript.xmlhelper", "pEntry->m_Uids is empty" );
         pEntry->m_Uids.push_back( nUid );
     }
 
@@ -481,7 +481,7 @@ sal_Int32 DocumentHandlerImpl::getUidByUri( OUString const & Uri )
     throw (RuntimeException)
 {
     sal_Int32 uid = getUidByURI( Uri );
-    OSL_ASSERT( uid != UID_UNKNOWN );
+    SAL_WARN_IF( uid == UID_UNKNOWN, "xmlscript.xmlhelper", "uid UNKNOWN");
     return uid;
 }
 
@@ -538,8 +538,7 @@ void DocumentHandlerImpl::startElement(
 #if OSL_DEBUG_LEVEL > 1
         OString aQName(
             OUStringToOString( rQElementName, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_TRACE( "### no context given on createChildElement() "
-                   "=> ignoring element \"%s\" ...", aQName.getStr() );
+        SAL_INFO("xmlscript.xmlhelper", "### no context given on createChildElement() => ignoring element \"" << aQName.getStr() << "\" ...");
 #endif
         return;
     }
@@ -595,9 +594,7 @@ void DocumentHandlerImpl::startElement(
         if (pUids[ nPos ] >= 0) // no xmlns: attribute
         {
             OUString const & rQAttributeName = pQNames[ nPos ];
-            OSL_ENSURE(
-                !rQAttributeName.startsWith( "xmlns:" ),
-                "### unexpected xmlns!" );
+            SAL_WARN_IF(rQAttributeName.startsWith( "xmlns:" ), "xmlscript.xmlhelper", "### unexpected xmlns!" );
 
             // collect attribute's uid and current prefix
             sal_Int32 nColonPos = rQAttributeName.indexOf( (sal_Unicode) ':' );
@@ -651,9 +648,7 @@ void DocumentHandlerImpl::startElement(
 #if OSL_DEBUG_LEVEL > 1
         OString aQName(
             OUStringToOString( rQElementName, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_TRACE(
-            "### no context given on createChildElement() => "
-            "ignoring element \"%s\" ...", aQName.getStr() );
+        SAL_INFO("xmlscript.xmlhelper", "### no context given on createChildElement() => ignoring element \"" << aQName.getStr() << "\" ...");
 #endif
     }
     }
@@ -673,14 +668,14 @@ void DocumentHandlerImpl::endElement(
 #if OSL_DEBUG_LEVEL > 1
         OString aQName(
             OUStringToOString( rQElementName, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_TRACE( "### received endElement() for \"%s\".", aQName.getStr() );
+        SAL_INFO("xmlscript.xmlhelper", "### received endElement() for \"" << aQName.getStr() << "\".");
 #endif
         static_cast<void>(rQElementName);
         return;
     }
 
     // popping context
-    OSL_ASSERT( ! m_elements.empty() );
+    SAL_WARN_IF( m_elements.empty(), "xmlscript.xmlhelper", "m_elements is empty" );
     ElementEntry * pEntry = m_elements.back();
     xCurrentElement = pEntry->m_xElement;
 
@@ -688,8 +683,8 @@ void DocumentHandlerImpl::endElement(
     sal_Int32 nUid;
     OUString aLocalName;
     getElementName( rQElementName, &nUid, &aLocalName );
-    OSL_ASSERT( xCurrentElement->getLocalName() == aLocalName );
-    OSL_ASSERT( xCurrentElement->getUid() == nUid );
+    SAL_WARN_IF( xCurrentElement->getLocalName() != aLocalName, "xmlscript.xmlhelper", "xCurrentElement->getLocalName() != aLocalName" );
+    SAL_WARN_IF( xCurrentElement->getUid() != nUid, "xmlscript.xmlhelper", "xCurrentElement->getUid() != nUid" );
 #endif
 
     // pop prefixes
@@ -792,7 +787,7 @@ OUString ExtendedAttributes::getTypeByIndex( sal_Int32 nIndex )
     throw (RuntimeException)
 {
     static_cast<void>(nIndex);
-    OSL_ASSERT( nIndex < m_nAttributes );
+    SAL_WARN_IF( nIndex >= m_nAttributes , "xmlscript.xmlhelper", "nIndex is bigger then m_nAttributes");
     return OUString(); // unsupported
 }
 
@@ -856,7 +851,7 @@ Reference< xml::sax::XDocumentHandler > SAL_CALL createDocumentHandler(
     bool bSingleThreadedUse )
     SAL_THROW(())
 {
-    OSL_ASSERT( xRoot.is() );
+    SAL_WARN_IF( !xRoot.is(), "xmlscript.xmlhelper", "xRoot is NULL" );
     if (xRoot.is())
     {
         return static_cast< xml::sax::XDocumentHandler * >(
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
index e9a2760..cc17c7a 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
@@ -136,7 +136,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
             break;
         }
         default:
-            OSL_FAIL( "### unexpected border value!" );
+            SAL_WARN( "xmlscript.xmldlg", "### unexpected border value!" );
             break;
         }
     }
@@ -156,7 +156,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
             pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":look", "simple" );
             break;
         default:
-            OSL_FAIL( "### unexpected visual effect value!" );
+            SAL_WARN( "xmlscript.xmldlg", "### unexpected visual effect value!" );
             break;
         }
     }
@@ -210,7 +210,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-family", "system" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-family!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-family!" );
                 break;
             }
         }
@@ -250,7 +250,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-charset", "symbol" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-charset!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-charset!" );
                 break;
             }
         }
@@ -266,7 +266,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-pitch", "variable" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-pitch!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-pitch!" );
                 break;
             }
         }
@@ -298,7 +298,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-slant", "reverse_italic" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-slant!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-slant!" );
                 break;
             }
         }
@@ -359,7 +359,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-underline", "boldwave" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-underline!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-underline!" );
                 break;
             }
         }
@@ -384,7 +384,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-strikeout", "x" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-strikeout!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-strikeout!" );
                 break;
             }
         }
@@ -418,7 +418,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
                 pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-type", "scalable" );
                 break;
             default:
-                OSL_FAIL( "### unexpected font-type!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected font-type!" );
                 break;
             }
         }
@@ -436,7 +436,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
             pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-relief", "engraved" );
             break;
         default:
-            OSL_FAIL( "### unexpected font-relief!" );
+            SAL_WARN( "xmlscript.xmldlg", "### unexpected font-relief!" );
             break;
         }
         // dialog:font-emphasismark (none|dot|circle|disc|accent|above|below) #IMPLIED
@@ -463,7 +463,7 @@ Reference< xml::sax::XAttributeList > Style::createElement()
             pStyle->addAttribute( XMLNS_DIALOGS_PREFIX ":font-emphasismark", "below" );
             break;
         default:
-            OSL_FAIL( "### unexpected font-emphasismark!" );
+            SAL_WARN( "xmlscript.xmldlg", "### unexpected font-emphasismark!" );
             break;
         }
     }
@@ -522,7 +522,7 @@ void ElementDescriptor::readStringAttr(
         if (a >>= v)
             addAttribute( rAttrName, v );
         else
-            OSL_FAIL( "### unexpected property type!" );
+            SAL_WARN( "xmlscript.xmldlg", "### unexpected property type!" );
     }
 }
 
@@ -590,7 +590,7 @@ void ElementDescriptor::readDateFormatAttr( OUString const & rPropName, OUString
                 addAttribute( rAttrName, "short_YYYYMMDD_DIN5008" );
                 break;
             default:
-                OSL_FAIL( "### unexpected date format!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected date format!" );
                 break;
             }
         }
@@ -625,7 +625,7 @@ void ElementDescriptor::readTimeFormatAttr( OUString const & rPropName, OUString
                 addAttribute( rAttrName, "Duration_long" );
                 break;
             default:
-                OSL_FAIL( "### unexpected time format!" );
+                SAL_WARN( "xmlscript.xmldlg", "### unexpected time format!" );
                 break;
             }
         }
@@ -651,7 +651,7 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons
                 addAttribute( rAttrName, "right" );
                 break;
             default:
-                OSL_FAIL( "### illegal alignment value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal alignment value!" );
                 break;
             }
         }
@@ -679,7 +679,7 @@ void ElementDescriptor::readVerticalAlignAttr( OUString const & rPropName, OUStr
                 addAttribute( rAttrName, "bottom" );
                 break;
             default:
-                OSL_FAIL( "### illegal vertical alignment value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal vertical alignment value!" );
                 break;
             }
         }
@@ -731,7 +731,7 @@ void ElementDescriptor::readImageAlignAttr( OUString const & rPropName, OUString
                 addAttribute( rAttrName, "bottom" );
                 break;
             default:
-                OSL_FAIL( "### illegal image alignment value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal image alignment value!" );
                 break;
             }
         }
@@ -787,7 +787,7 @@ void ElementDescriptor::readImagePositionAttr( OUString const & rPropName, OUStr
                 addAttribute( rAttrName, "center" );
                 break;
             default:
-                OSL_FAIL( "### illegal image position value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal image position value!" );
                 break;
             }
         }
@@ -816,7 +816,7 @@ void ElementDescriptor::readButtonTypeAttr( OUString const & rPropName, OUString
                 addAttribute( rAttrName, "help" );
                 break;
             default:
-                OSL_FAIL( "### illegal button-type value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal button-type value!" );
                 break;
             }
         }
@@ -839,7 +839,7 @@ void ElementDescriptor::readOrientationAttr( OUString const & rPropName, OUStrin
                 addAttribute( rAttrName, "vertical" );
                 break;
             default:
-                OSL_FAIL( "### illegal orientation value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal orientation value!" );
                 break;
             }
         }
@@ -865,7 +865,7 @@ void ElementDescriptor::readLineEndFormatAttr( OUString const & rPropName, OUStr
                 addAttribute( rAttrName, "carriage-return-line-feed" );
                 break;
             default:
-                OSL_FAIL( "### illegal line end format value!" );
+                SAL_WARN( "xmlscript.xmldlg", "### illegal line end format value!" );
                 break;
             }
         }
@@ -896,7 +896,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & rAttrName )
                 if ( !sAddress.isEmpty() )
                     addAttribute( rAttrName, sAddress );
 
-                OSL_TRACE( "*** Bindable value %s", OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() );
+                SAL_INFO("xmlscript.xmldlg", "*** Bindable value " << sAddress );
 
             }
         }
@@ -920,7 +920,7 @@ void ElementDescriptor::readDataAwareAttr( OUString const & rAttrName )
                 OUString sAddress;
                 xConvertor->setPropertyValue( "Address", makeAny( aAddress ) );
                 xConvertor->getPropertyValue( "PersistentRepresentation" ) >>= sAddress;
-                OSL_TRACE("**** cell range source list %s", OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() );
+                SAL_INFO("xmlscript.xmldlg","**** cell range source list " << sAddress );
                 if ( !sAddress.isEmpty() )
                     addAttribute( rAttrName, sAddress );
             }
@@ -957,7 +957,7 @@ void ElementDescriptor::readSelectionTypeAttr( OUString const & rPropName, OUStr
                     addAttribute( rAttrName, "range" );
                     break;
                 default:
-                    OSL_FAIL( "### illegal selection type value!" );
+                    SAL_WARN( "xmlscript.xmldlg", "### illegal selection type value!" );
                     break;
             }
         }
@@ -1018,7 +1018,7 @@ void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible
     }
     else
     {
-        OSL_FAIL( "unexpected property type for \"Enabled\": not bool!" );
+        SAL_WARN( "xmlscript.xmldlg", "unexpected property type for \"Enabled\": not bool!" );
     }
 
     sal_Bool bVisible = sal_True;
@@ -1095,11 +1095,10 @@ void ElementDescriptor::readEvents()
                 script::ScriptEventDescriptor descr;
                 if (xEvents->getByName( pNames[ nPos ] ) >>= descr)
                 {
-                    OSL_ENSURE( !descr.ListenerType.isEmpty() &&
-                                !descr.EventMethod.isEmpty() &&
-                                !descr.ScriptCode.isEmpty() &&
-                                !descr.ScriptType.isEmpty() ,
-                                "### invalid event descr!" );
+                    SAL_WARN_IF( descr.ListenerType.isEmpty() ||
+                                descr.EventMethod.isEmpty() ||
+                                descr.ScriptCode.isEmpty() ||
+                                descr.ScriptType.isEmpty() , "xmlscript.xmldlg", "### invalid event descr!" );
 
                     OUString aEventName;
 
@@ -1170,7 +1169,7 @@ void ElementDescriptor::readEvents()
                 }
                 else
                 {
-                    OSL_FAIL( "### unexpected event type in container!" );
+                    SAL_WARN( "xmlscript.xmldlg", "### unexpected event type in container!" );
                 }
             }
         }
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index d756612..0e61b54 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -65,7 +65,7 @@ Reference< xml::input::XElement > Frame::startChildElement(
     }
     else
     {
-        OSL_TRACE("****** ARGGGGG!!!! **********");
+        SAL_INFO("xmlscript.xmldlg","****** ARGGGGG!!!! **********");
         throw     xml::sax::SAXException("expected event element!", Reference< XInterface >(), Any() );
     }
 }
@@ -574,7 +574,7 @@ void FormattedFieldElement::endElement()
         }
         catch (const util::MalformedNumberFormatException & exc)
         {
-            OSL_FAIL( "### util::MalformedNumberFormatException occurred!" );
+           SAL_WARN( "xmlscript.xmldlg", "### util::MalformedNumberFormatException occurred!" );
             // rethrow
             throw xml::sax::SAXException( exc.Message, Reference< XInterface >(), Any() );
         }
@@ -1121,7 +1121,7 @@ void TextFieldElement::endElement()
     OUString aValue;
     if (getStringAttr( &aValue, "echochar", _xAttributes, _pImport->XMLNS_DIALOGS_UID ) && !aValue.isEmpty() )
     {
-        OSL_ENSURE( aValue.getLength() == 1, "### more than one character given for echochar!" );
+        SAL_WARN_IF( aValue.getLength() != 1, "xmlscript.xmldlg", "### more than one character given for echochar!" );
         sal_Int16 nChar = (sal_Int16)aValue[ 0 ];
         xControlModel->setPropertyValue( "EchoChar", makeAny( nChar ) );
     }
@@ -1377,7 +1377,7 @@ Reference< xml::input::XElement > MenuPopupElement::startChildElement(
     else if ( rLocalName == "menuitem" )
     {
         OUString aValue( xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID,"value" ) );
-        OSL_ENSURE( !aValue.isEmpty(), "### menuitem has no value?" );
+        SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has no value?" );
         if (!aValue.isEmpty())
         {
             _itemValues.push_back( aValue );
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
index 6a520ff..754efaf 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
@@ -1478,7 +1478,7 @@ void ImportContext::importEvents(
                     }
                     else // script:listener-event element
                     {
-                        OSL_ASSERT( aLocalName == "listener-event" );
+                        SAL_WARN_IF( aLocalName != "listener-event", "xmlscript.xmldlg", "aLocalName != listener-event" );
 
                         if (!getStringAttr( &descr.ListenerType, "listener-type"  , xAttributes, _pImport->XMLNS_SCRIPT_UID ) ||
                             !getStringAttr( &descr.EventMethod , "listener-method", xAttributes, _pImport->XMLNS_SCRIPT_UID ))
@@ -1491,7 +1491,7 @@ void ImportContext::importEvents(
                 }
                 else // deprecated dlg:event element
                 {
-                    OSL_ASSERT( _pImport->XMLNS_DIALOGS_UID == nUid && aLocalName == "event" );
+                    SAL_WARN_IF( _pImport->XMLNS_DIALOGS_UID != nUid || aLocalName != "event", "xmlscript.xmldlg", "_pImport->XMLNS_DIALOGS_UID != nUid || aLocalName != \"event\"" );
 
                     if (!getStringAttr( &descr.ListenerType, "listener-type", xAttributes, _pImport->XMLNS_DIALOGS_UID ) ||
                         !getStringAttr( &descr.EventMethod,  "event-method",  xAttributes, _pImport->XMLNS_DIALOGS_UID ))
@@ -1682,7 +1682,7 @@ ElementBase::~ElementBase()
 #if OSL_DEBUG_LEVEL > 1
     OString aStr( OUStringToOString(
                              _aLocalName, RTL_TEXTENCODING_ASCII_US ) );
-    OSL_TRACE( "ElementBase::~ElementBase(): %s", aStr.getStr() );
+    SAL_INFO("xmlscript.xmldlg", "ElementBase::~ElementBase(): " << aStr.getStr() );
 #endif
 }
 
@@ -1744,7 +1744,7 @@ DialogImport::~DialogImport()
     SAL_THROW(())
 {
 #if OSL_DEBUG_LEVEL > 1
-    OSL_TRACE( "DialogImport::~DialogImport()." );
+    SAL_INFO("xmlscript.xmldlg", "DialogImport::~DialogImport()." );
 #endif
 }
 //__________________________________________________________________________________________________
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
index 8380020..d294924 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx
@@ -243,7 +243,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
                         xPSet->getPropertyValue("BasicLibraries" ) >>= xLibContainer;
                 }
 
-                OSL_ENSURE( xLibContainer.is(), "XMLBasicExporterBase::filter: nowhere to export to!" );
+                SAL_WARN_IF( !xLibContainer.is(), "xmlscript.xmlflat", "XMLBasicExporterBase::filter: nowhere to export to!" );
 
                 if ( xLibContainer.is() )
                 {
@@ -398,26 +398,22 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
         }
         catch ( const container::NoSuchElementException& e )
         {
-            OSL_TRACE( "XMLBasicExporterBase::filter: caught NoSuchElementException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "XMLBasicExporterBase::filter: caught NoSuchElementException reason " << e.Message );
             bReturn = sal_False;
         }
         catch ( const lang::IllegalArgumentException& e )
         {
-            OSL_TRACE( "XMLBasicExporterBase::filter: caught IllegalArgumentException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "XMLBasicExporterBase::filter: caught IllegalArgumentException reason " << e.Message );
             bReturn = sal_False;
         }
         catch ( const lang::WrappedTargetException& e )
         {
-            OSL_TRACE( "XMLBasicExporterBase::filter: caught WrappedTargetException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "XMLBasicExporterBase::filter: caught WrappedTargetException reason " << e.Message );
             bReturn = sal_False;
         }
         catch ( const xml::sax::SAXException& e )
         {
-            OSL_TRACE( "XMLBasicExporterBase::filter: caught SAXException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "XMLBasicExporterBase::filter: caught SAXException reason " << e.Message );
             bReturn = sal_False;
         }
 
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
index 34eadcb..adb50e5 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx
@@ -221,13 +221,11 @@ void BasicElementBase::processingInstruction( const OUString& /*rTarget*/, const
                     }
                     catch ( const container::ElementExistException& e )
                     {
-                        OSL_TRACE( "BasicLibrariesElement::startChildElement: caught ElementExceptionExist reason %s",
-                            OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+                        SAL_INFO("xmlscript.xmlflat", "BasicLibrariesElement::startChildElement: caught ElementExceptionExist reason " << e.Message );
                     }
                     catch ( const lang::IllegalArgumentException& e )
                     {
-                        OSL_TRACE( "BasicLibrariesElement::startChildElement: caught IllegalArgumentException reason %s",
-                            OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+                        SAL_INFO("xmlscript.xmlflat", "BasicLibrariesElement::startChildElement: caught IllegalArgumentException reason " << e.Message );
                     }
                 }
             }
@@ -263,8 +261,7 @@ void BasicElementBase::processingInstruction( const OUString& /*rTarget*/, const
                     }
                     catch ( const lang::IllegalArgumentException& e )
                     {
-                        OSL_TRACE( "BasicLibrariesElement::startChildElement: caught IllegalArgumentException reason %s",
-                            OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+                        SAL_INFO("xmlscript.xmlflat", "BasicLibrariesElement::startChildElement: caught IllegalArgumentException reason " << e.Message );
                     }
                 }
             }
@@ -306,8 +303,7 @@ void BasicElementBase::processingInstruction( const OUString& /*rTarget*/, const
         }
         catch ( const lang::WrappedTargetException& e )
         {
-            OSL_TRACE( "BasicEmbeddedLibraryElement CTOR: caught WrappedTargetException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "BasicEmbeddedLibraryElement CTOR: caught WrappedTargetException reason " << e.Message );
         }
     }
 
@@ -451,18 +447,15 @@ void BasicElementBase::processingInstruction( const OUString& /*rTarget*/, const
         }
         catch ( const container::ElementExistException& e )
         {
-            OSL_TRACE( "BasicSourceCodeElement::endElement: caught ElementExceptionExist reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "BasicSourceCodeElement::endElement: caught ElementExceptionExist reason " << e.Message );
         }
         catch ( const lang::IllegalArgumentException& e )
         {
-            OSL_TRACE( "BasicSourceCodeElement::endElement: caught IllegalArgumentException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "BasicSourceCodeElement::endElement: caught IllegalArgumentException reason " << e.Message );
         }
         catch ( const lang::WrappedTargetException& e )
         {
-            OSL_TRACE( "BasicSourceCodeElement::endElement: caught WrappedTargetException reason %s",
-                OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).pData->buffer );
+            SAL_INFO("xmlscript.xmlflat", "BasicSourceCodeElement::endElement: caught WrappedTargetException reason " << e.Message );
         }
     }
 
@@ -552,7 +545,7 @@ void BasicImport::setDocumentLocator( const Reference< xml::sax::XLocator >& /*x
                     xPSet->getPropertyValue("BasicLibraries" ) >>= xLibContainer;
             }
 
-            OSL_ENSURE( xLibContainer.is(), "BasicImport::startRootElement: nowhere to import to!" );
+            SAL_WARN_IF( !xLibContainer.is(), "xmlscript.xmlflat", "BasicImport::startRootElement: nowhere to import to!" );
 
             if ( xLibContainer.is() )
             {
diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
index 0a0e08ba..16a5a80 100644
--- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx
+++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx
@@ -114,7 +114,7 @@ LibElementBase::~LibElementBase()
 
 #if OSL_DEBUG_LEVEL > 1
     OString aStr( OUStringToOString( _aLocalName, RTL_TEXTENCODING_ASCII_US ) );
-    OSL_TRACE( "LibElementBase::~LibElementBase(): %s", aStr.getStr() );
+    SAL_INFO("xmlscript.xmllib", "LibElementBase::~LibElementBase(): " << aStr.getStr() );
 #endif
 }
 
@@ -183,7 +183,7 @@ LibraryImport::~LibraryImport()
     SAL_THROW(())
 {
 #if OSL_DEBUG_LEVEL > 1
-    OSL_TRACE( "LibraryImport::~LibraryImport()." );
+    SAL_INFO("xmlscript.xmllib", "LibraryImport::~LibraryImport()." );
 #endif
 }
 
diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
index ec13ec5..ae77871 100644
--- a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
+++ b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx
@@ -114,7 +114,7 @@ ModuleElement::~ModuleElement()
 
 #if OSL_DEBUG_LEVEL > 1
     OString aStr( OUStringToOString( _aLocalName, RTL_TEXTENCODING_ASCII_US ) );
-    OSL_TRACE( "ModuleElement::~ModuleElement(): %s", aStr.getStr() );
+    SAL_INFO("xmlscript.xmlmod", "ModuleElement::~ModuleElement(): " << aStr.getStr() );
 #endif
 }
 
@@ -179,7 +179,7 @@ ModuleImport::~ModuleImport()
     SAL_THROW(())
 {
 #if OSL_DEBUG_LEVEL > 1
-    OSL_TRACE( "ModuleImport::~ModuleImport()." );
+    SAL_INFO("xmlscript.xmlmod", "ModuleImport::~ModuleImport()." );
 #endif
 }
 


More information about the Libreoffice-commits mailing list