[Libreoffice-commits] core.git: canvas/source cli_ure/source comphelper/source connectivity/source extensions/source framework/source include/sal reportdesign/source sc/source sd/source sfx2/source slideshow/test stoc/source svtools/source svx/source sw/source tools/source unotools/source vcl/source vcl/unx xmlscript/test

Noel Grandin noel.grandin at collabora.co.uk
Fri Jun 23 12:38:36 UTC 2017


 canvas/source/directx/dx_config.cxx               |    8 -
 cli_ure/source/uno_bridge/cli_bridge.cxx          |   30 +------
 cli_ure/source/uno_bridge/cli_proxy.cxx           |    6 -
 comphelper/source/property/propagg.cxx            |   12 --
 connectivity/source/drivers/macab/MacabDriver.cxx |    2 
 extensions/source/ole/oleobjw.cxx                 |    5 -
 framework/source/layoutmanager/layoutmanager.cxx  |   12 --
 include/sal/log-areas.dox                         |    1 
 reportdesign/source/filter/xml/xmlfilter.cxx      |   13 ---
 sc/source/core/data/attarray.cxx                  |    9 --
 sc/source/core/data/formulacell.cxx               |   11 --
 sc/source/core/tool/parclass.cxx                  |    9 --
 sc/source/ui/docshell/docsh3.cxx                  |    5 -
 sd/source/core/CustomAnimationPreset.cxx          |    9 --
 sfx2/source/appl/appuno.cxx                       |   93 ++++------------------
 sfx2/source/control/objface.cxx                   |    9 --
 sfx2/source/control/request.cxx                   |   24 +----
 sfx2/source/doc/docfac.cxx                        |    5 -
 slideshow/test/demoshow.cxx                       |    6 -
 stoc/source/security/access_controller.cxx        |    8 -
 svtools/source/config/test/test.cxx               |    2 
 svx/source/customshapes/EnhancedCustomShape2d.cxx |    4 
 svx/source/form/fmsrcimp.cxx                      |   16 ---
 svx/source/svdraw/svdmodel.cxx                    |    9 --
 sw/source/filter/ww8/sortedarray.hxx              |    2 
 sw/source/filter/ww8/ww8par.cxx                   |    5 -
 sw/source/filter/xml/swxml.cxx                    |   36 +-------
 sw/source/uibase/uiview/viewsrch.cxx              |    8 -
 tools/source/rc/resmgr.cxx                        |    6 -
 tools/source/ref/pstm.cxx                         |   17 ----
 unotools/source/config/confignode.cxx             |   16 ---
 vcl/source/gdi/bitmapex.cxx                       |   11 --
 vcl/source/gdi/svmconverter.cxx                   |    9 --
 vcl/source/window/builder.cxx                     |    8 -
 vcl/source/window/dialog.cxx                      |    6 -
 vcl/source/window/errinf.cxx                      |   12 --
 vcl/source/window/layout.cxx                      |    8 -
 vcl/source/window/printdlg.cxx                    |    6 -
 vcl/source/window/window.cxx                      |   15 +--
 vcl/unx/generic/print/genpspgraphics.cxx          |    4 
 xmlscript/test/imexp.cxx                          |   12 +-
 41 files changed, 108 insertions(+), 381 deletions(-)

New commits:
commit 5e028ad5dccc6ff1a9250baf2196f7a2f235e314
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Jun 23 11:47:53 2017 +0200

    simplify some string handling in tracing calls
    
    Change-Id: I0fb76562429e691400a02216019c7f96791cf9b3
    Reviewed-on: https://gerrit.libreoffice.org/39159
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/canvas/source/directx/dx_config.cxx b/canvas/source/directx/dx_config.cxx
index edd097eae542..39082b6f6e3f 100644
--- a/canvas/source/directx/dx_config.cxx
+++ b/canvas/source/directx/dx_config.cxx
@@ -82,9 +82,7 @@ namespace dxcanvas
         }
         catch( const uno::Exception& )
         {
-            OSL_FAIL( OUStringToOString(
-                            comphelper::anyToString( cppu::getCaughtException() ),
-                            RTL_TEXTENCODING_UTF8 ).getStr() );
+            SAL_WARN( "canvas", comphelper::anyToString( cppu::getCaughtException() ) );
         }
     }
 
@@ -115,9 +113,7 @@ namespace dxcanvas
         }
         catch( const uno::Exception& )
         {
-            OSL_FAIL( OUStringToOString(
-                            comphelper::anyToString( cppu::getCaughtException() ),
-                            RTL_TEXTENCODING_UTF8 ).getStr() );
+            SAL_WARN( "canvas", comphelper::anyToString( cppu::getCaughtException() ) );
         }
     }
 
diff --git a/cli_ure/source/uno_bridge/cli_bridge.cxx b/cli_ure/source/uno_bridge/cli_bridge.cxx
index da8d0852e927..615941b3f36a 100644
--- a/cli_ure/source/uno_bridge/cli_bridge.cxx
+++ b/cli_ure/source/uno_bridge/cli_bridge.cxx
@@ -82,14 +82,8 @@ void SAL_CALL Mapping_cli2uno(
     }
     catch (BridgeRuntimeError & err)
     {
-#if OSL_DEBUG_LEVEL >= 1
-        OString cstr_msg(
-            OUStringToOString(
-                "[cli_uno bridge error] " + err.m_message, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_FAIL( cstr_msg.getStr() );
-#else
-        (void) err; // unused
-#endif
+        (void) err;
+        SAL_WARN( "cli", "[cli_uno bridge error] " << err.m_message );
     }
 }
 
@@ -142,14 +136,8 @@ void SAL_CALL Mapping_uno2cli(
     }
     catch (BridgeRuntimeError & err)
     {
-#if OSL_DEBUG_LEVEL >= 1
-        OString cstr_msg(
-            OUStringToOString(
-                "[cli_uno bridge error] " + err.m_message, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_FAIL( cstr_msg.getStr() );
-#else
-        (void) err; // unused
-#endif
+        (void) err;
+        SAL_WARN( "cli", "[cli_uno bridge error] " << err.m_message );
     }
 }
 
@@ -320,14 +308,8 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
     }
     catch (BridgeRuntimeError & err)
     {
-#if OSL_DEBUG_LEVEL >= 1
-        OString cstr_msg(
-            OUStringToOString(
-                "[cli_uno bridge error] " + err.m_message, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_FAIL( cstr_msg.getStr() );
-#else
-        (void) err; // unused
-#endif
+        (void) err;
+        SAL_WARN( "cli", "[cli_uno bridge error] " << err.m_message );
     }
     *ppMapping = mapping;
 }
diff --git a/cli_ure/source/uno_bridge/cli_proxy.cxx b/cli_ure/source/uno_bridge/cli_proxy.cxx
index b703cc05cb17..453880298485 100644
--- a/cli_ure/source/uno_bridge/cli_proxy.cxx
+++ b/cli_ure/source/uno_bridge/cli_proxy.cxx
@@ -1096,11 +1096,7 @@ void SAL_CALL cli_proxy_dispatch(
             css::uno::XInterface >() );
         css::uno::Type const & exc_type = cppu::UnoType<decltype(exc)>::get();
         uno_type_any_construct( *uno_exc, &exc, exc_type.getTypeLibType(), 0);
-#if OSL_DEBUG_LEVEL >= 1
-        OString cstr_msg(OUStringToOString(exc.Message,
-                                             RTL_TEXTENCODING_ASCII_US ) );
-        OSL_FAIL(cstr_msg.getStr());
-#endif
+        SAL_WARN( "cli", exc.Message);
     }
 }
 
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index 987fd2e1e323..43f461921fac 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -598,16 +598,8 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues(
         catch( const UnknownPropertyException& )
         {
             // by definition of XMultiPropertySet::setPropertyValues, unknown properties are to be ignored
-        #if OSL_DEBUG_LEVEL > 0
-            OStringBuffer aMessage;
-            aMessage.append( "OPropertySetAggregationHelper::setPropertyValues: unknown property '" );
-            aMessage.append( OUStringToOString( _rPropertyNames[0], RTL_TEXTENCODING_ASCII_US ) );
-            aMessage.append( "'" );
-            aMessage.append( "\n(implementation " );
-            aMessage.append( typeid( *this ).name() );
-            aMessage.append( ")" );
-            OSL_FAIL( aMessage.getStr() );
-        #endif
+            SAL_WARN( "comphelper", "OPropertySetAggregationHelper::setPropertyValues: unknown property: '"
+                    << _rPropertyNames[0] << "', implementation: " << typeid( *this ).name() );
         }
     }
     else
diff --git a/connectivity/source/drivers/macab/MacabDriver.cxx b/connectivity/source/drivers/macab/MacabDriver.cxx
index 2c87a2fff73f..26d6dc812f1a 100644
--- a/connectivity/source/drivers/macab/MacabDriver.cxx
+++ b/connectivity/source/drivers/macab/MacabDriver.cxx
@@ -96,7 +96,7 @@ namespace
 
             if ( !_rFunction )
             {   // did not find the symbol
-                OSL_FAIL( OString( OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + OString( _pAsciiSymbolName ) ).getStr() );
+                SAL_WARN( "connectivity.macab", "lcl_getFunctionFromModuleOrUnload: could not find the symbol " << _pAsciiSymbolName );
                 osl_unloadModule( _rModule );
                 _rModule = nullptr;
             }
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index e074a238756c..25c940611b50 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -291,10 +291,7 @@ void SAL_CALL IUnknownWrapper_Impl::setValue( const OUString& aPropertyName,
              || (aVarDesc && aVarDesc->wVarFlags == VARFLAG_FREADONLY) )
         {
             //read-only
-            OUString msg("[automation bridge] Property " + aPropertyName +
-                         " is read-only");
-            OString sMsg = OUStringToOString(msg, osl_getThreadTextEncoding());
-            OSL_FAIL(sMsg.getStr());
+            SAL_WARN( "extensions.ole", "[automation bridge] Property " << aPropertyName << " is read-only");
             // ignore silently
             return;
         }
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 10704e784b79..55da5a72ea81 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -2187,11 +2187,7 @@ void SAL_CALL LayoutManager::lock()
 
     SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::lock lockCount=" << nLockCount );
 #ifdef DBG_UTIL
-    OStringBuffer aStr("LayoutManager::lock ");
-    aStr.append(reinterpret_cast<sal_Int64>(this));
-    aStr.append(" - ");
-    aStr.append(nLockCount);
-    SAL_INFO( "fwk", "" << aStr.getStr());
+    SAL_INFO( "fwk", "LayoutManager::lock " << reinterpret_cast<sal_Int64>(this) << " - " << nLockCount );
 #endif
 
     Any a( nLockCount );
@@ -2208,11 +2204,7 @@ void SAL_CALL LayoutManager::unlock()
 
     SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::unlock lockCount=" << nLockCount );
 #ifdef DBG_UTIL
-    OStringBuffer aStr("LayoutManager::unlock ");
-    aStr.append(reinterpret_cast<sal_Int64>(this));
-    aStr.append(" - ");
-    aStr.append(nLockCount);
-    SAL_INFO( "fwk", "" << aStr.getStr());
+    SAL_INFO( "fwk", "LayoutManager::unlock " << reinterpret_cast<sal_Int64>(this) << " - " << nLockCount);
 #endif
     // conform to documentation: unlock with lock count == 0 means force a layout
 
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index f414c0e2b423..63f1438d0211 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -558,6 +558,7 @@ certain functionality.
 @li @c animations
 @li @c basegfx
 @li @c binaryurp
+ at li @c cli
 @li @c configmgr
 @li @c configmgr.dconf
 @li @c cppcanvas
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index db0e0e033cd0..7a5bfa5cbd9b 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -150,17 +150,10 @@ ErrCode ReadThroughComponent(
     }
     catch (const SAXParseException& r)
     {
-#if OSL_DEBUG_LEVEL > 1
-        OStringBuffer aError("SAX parse exception caught while importing:\n");
-        aError.append(OUStringToOString(r.Message,
-            RTL_TEXTENCODING_ASCII_US));
-        aError.append(r.LineNumber);
-        aError.append(',');
-        aError.append(r.ColumnNumber);
-        OSL_FAIL(aError.getStr());
-#else
         (void)r;
-#endif
+        SAL_WARN( "reportdesign", "SAX parse exception caught while importing: "
+                    << r.Message << " "
+                    << r.LineNumber << ',' << r.ColumnNumber );
         return ErrCode(1);
     }
     catch (const SAXException&)
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 7ef3044ed633..5214180f0d80 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -116,14 +116,7 @@ void ScAttrArray::TestData() const
     if ( nPos && pData[nPos-1].nRow != MAXROW )
         ++nErr;
 
-    if (nErr)
-    {
-        OStringBuffer aMsg;
-        aMsg.append(static_cast<sal_Int32>(nErr));
-        aMsg.append(" errors in attribute array, column ");
-        aMsg.append(static_cast<sal_Int32>(nCol));
-        OSL_FAIL(aMsg.getStr());
-    }
+    SAL_WARN_IF( nErr, "sc", nErr << " errors in attribute array, column " << nCol );
 }
 #endif
 
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index b0c5752f3f5a..7494f567bb24 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2715,13 +2715,10 @@ sc::MatrixEdge ScFormulaCell::GetMatrixEdge( ScAddress& rOrgPos ) const
                 else
                 {
 #if OSL_DEBUG_LEVEL > 0
-                    OStringBuffer aMsg("broken Matrix, no MatFormula at origin, Pos: ");
-                    OUString aTmp(aPos.Format(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID, pDocument));
-                    aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_ASCII_US));
-                    aMsg.append(", MatOrg: ");
-                    aTmp = aOrg.Format(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID, pDocument);
-                    aMsg.append(OUStringToOString(aTmp, RTL_TEXTENCODING_ASCII_US));
-                    OSL_FAIL(aMsg.getStr());
+                    SAL_WARN( "sc", "broken Matrix, no MatFormula at origin, Pos: "
+                                << aPos.Format(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID, pDocument)
+                                << ", MatOrg: "
+                                << aOrg.Format(ScRefFlags::COL_VALID | ScRefFlags::ROW_VALID, pDocument) );
 #endif
                     return sc::MatrixEdge::Nothing;
                 }
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index d4b425a905f1..3835af788984 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -489,12 +489,9 @@ void ScParameterClassification::MergeArgumentsFromFunctionResource()
         }
         if ( nArgs > CommonData::nMaxParams )
         {
-            OStringBuffer aBuf;
-            aBuf.append("ScParameterClassification::Init: too many arguments in listed function: ");
-            aBuf.append(OUStringToOString(*(pDesc->pFuncName), RTL_TEXTENCODING_UTF8));
-            aBuf.append(": ");
-            aBuf.append(sal_Int32(nArgs));
-            OSL_FAIL( aBuf.getStr());
+            SAL_WARN( "sc", "ScParameterClassification::Init: too many arguments in listed function: "
+                        << *(pDesc->pFuncName)
+                        << ": " << nArgs );
             nArgs = CommonData::nMaxParams - 1;
             pRun->aData.nRepeatLast = 1;
         }
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index e6b547a6ceee..b20ad11cde30 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -922,10 +922,7 @@ void ScDocShell::MergeDocument( ScDocument& rOtherDoc, bool bShared, bool bCheck
                 OUString aValue;
                 if ( eSourceType == SC_CAT_CONTENT )
                     static_cast<const ScChangeActionContent*>(pSourceAction)->GetNewString( aValue, &aDocument );
-                OStringBuffer aError(OUStringToOString(aValue,
-                    osl_getThreadTextEncoding()));
-                aError.append(" weggelassen");
-                OSL_FAIL( aError.getStr() );
+                SAL_WARN( "sc", aValue << " omitted");
 #endif
             }
             else
diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx
index 35bb383dfbe6..502ed08a6bb5 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -472,13 +472,8 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor
     }
 
 #ifdef DEBUG
-    if( !aMissedPresetIds.isEmpty() )
-    {
-        OStringBuffer aTmp("sd::CustomAnimationPresets::importPresets(), invalid preset id!\n");
-        aTmp.append(OUStringToOString(aMissedPresetIds,
-            RTL_TEXTENCODING_ASCII_US));
-        OSL_FAIL(aTmp.getStr());
-    }
+    SAL_WARN_IF(!aMissedPresetIds.isEmpty(), "sd", "sd::CustomAnimationPresets::importPresets(), invalid preset id: "
+                    << aMissedPresetIds);
 #endif
 }
 
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index e79e1177c52e..2abeaf4f4e28 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -194,11 +194,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
 
         if ( !pItem )
         {
-#ifdef DBG_UTIL
-            OStringBuffer aStr("No creator method for item: ");
-            aStr.append(static_cast<sal_Int32>(nSlotId));
-            OSL_FAIL(aStr.getStr());
-#endif
+            SAL_WARN( "sfx", "No creator method for item: " << nSlotId );
             return;
         }
 
@@ -216,14 +212,10 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
             if( pItem->PutValue( rProp.Value, bConvertTwips ? CONVERT_TWIPS : 0 ) )
                 // only use successfully converted items
                 rSet.Put( *pItem );
-#ifdef DBG_UTIL
             else
             {
-                OStringBuffer aStr("Property not convertible: ");
-                aStr.append(pSlot->pUnoName);
-                OSL_FAIL( aStr.getStr() );
+                SAL_WARN( "sfx", "Property not convertible: " << pSlot->pUnoName );
             }
-#endif
         }
 #ifdef DBG_UTIL
         else if ( nSubCount == 0 )
@@ -242,9 +234,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
             // so this should be notified as a warning only
             if ( nCount != nSubCount )
             {
-                OStringBuffer aStr("MacroPlayer: wrong number of parameters for slot: ");
-                aStr.append(static_cast<sal_Int32>(nSlotId));
-                SAL_INFO("sfx.appl", aStr.getStr());
+                SAL_INFO("sfx.appl", "MacroPlayer: wrong number of parameters for slot: " << nSlotId );
             }
 #endif
             // complex property; collect sub items from the parameter set and reconstruct complex item
@@ -265,27 +255,16 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
                             nSubId |= CONVERT_TWIPS;
                         if ( pItem->PutValue( rPropValue.Value, nSubId ) )
                             nFound++;
-#ifdef DBG_UTIL
                         else
                         {
-                            OStringBuffer aDbgStr("Property not convertible: ");
-                            aDbgStr.append(pSlot->pUnoName);
-                            OSL_FAIL( aDbgStr.getStr() );
+                            SAL_WARN( "sfx.appl", "Property not convertible: " << pSlot->pUnoName);
                         }
-#endif
                         break;
                     }
                 }
 
-#ifdef DBG_UTIL
-                if ( nSub >= nSubCount )
-                {
-                    // there was a parameter with a name that didn't match to any of the members
-                    OStringBuffer aStr("Property name does not match: ");
-                    aStr.append(OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8));
-                    OSL_FAIL( aStr.getStr() );
-                }
-#endif
+                // there was a parameter with a name that didn't match to any of the members
+                SAL_WARN_IF( nSub >= nSubCount, "sfx.appl", "Property name does not match: " << rPropValue.Name );
             }
 
             // at least one part of the complex item must be present; other parts can have default values
@@ -311,11 +290,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
         std::unique_ptr<SfxPoolItem> pItem(rArg.CreateItem());
         if ( !pItem )
         {
-#ifdef DBG_UTIL
-            OStringBuffer aStr("No creator method for argument: ");
-            aStr.append(rArg.pName);
-            OSL_FAIL( aStr.getStr() );
-#endif
+            SAL_WARN( "sfx", "No creator method for argument: " << rArg.pName );
             return;
         }
 
@@ -339,14 +314,10 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
                     if( pItem->PutValue( rProp.Value, 0 ) )
                         // only use successfully converted items
                         rSet.Put( *pItem );
-#ifdef DBG_UTIL
                     else
                     {
-                        OStringBuffer aStr("Property not convertible: ");
-                        aStr.append(rArg.pName);
-                        OSL_FAIL( aStr.getStr() );
+                        SAL_WARN( "sfx", "Property not convertible: " << rArg.pName );
                     }
-#endif
                     break;
                 }
             }
@@ -368,14 +339,10 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
                     if( pItem->PutValue( rProp.Value, 0 ) )
                         // only use successfully converted items
                         rSet.Put( *pItem );
-#ifdef DBG_UTIL
                     else
                     {
-                        OStringBuffer aStr("Property not convertible: ");
-                        aStr.append(rArg.pName);
-                        OSL_FAIL( aStr.getStr() );
+                        SAL_WARN( "sfx", "Property not convertible: " << rArg.pName );
                     }
-#endif
                 }
             }
 
@@ -407,11 +374,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
                             {
                                 // ... but it was not convertible
                                 bRet = false;
-#ifdef DBG_UTIL
-                                OStringBuffer aDbgStr("Property not convertible: ");
-                                aDbgStr.append(rArg.pName);
-                                OSL_FAIL( aDbgStr.getStr() );
-#endif
+                                SAL_WARN( "sfx", "Property not convertible: " << rArg.pName );
                             }
 
                             break;
@@ -901,9 +864,7 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert
     if ( nFoundArgs == nCount )
     {
         // except for the "special" slots: assure that every argument was convertible
-        OStringBuffer aStr("MacroPlayer: Some properties didn't match to any formal argument for slot: ");
-        aStr.append(pSlot->pUnoName);
-        SAL_INFO( "sfx.appl", aStr.getStr() );
+        SAL_INFO( "sfx.appl", "MacroPlayer: Some properties didn't match to any formal argument for slot: "<< pSlot->pUnoName );
     }
 #endif
 }
@@ -945,15 +906,11 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
                 // simple property: we expect to get exactly one item
                 nProps++;
         }
-#ifdef DBG_UTIL
         else
         {
             // we will not rely on the "toggle" ability of some property slots
-            OStringBuffer aStr("Processing property slot without argument: ");
-            aStr.append(static_cast<sal_Int32>(nSlotId));
-            OSL_FAIL(aStr.getStr());
+            SAL_WARN( "sfx", "Processing property slot without argument: " << nSlotId );
         }
-#endif
 
 #ifdef DBG_UTIL
         nItems++;
@@ -1281,9 +1238,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
                 pValue[nActProp].Name = OUString::createFromAscii(pSlot->pUnoName) ;
                 if ( !pItem->QueryValue( pValue[nActProp].Value ) )
                 {
-                    OStringBuffer aStr("Item not convertible: ");
-                    aStr.append(static_cast<sal_Int32>(nSlotId));
-                    OSL_FAIL(aStr.getStr());
+                    SAL_WARN( "sfx", "Item not convertible: " << nSlotId );
                 }
             }
             else
@@ -1302,12 +1257,8 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
                     pValue[nActProp].Name = aName;
                     if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) )
                     {
-                        OStringBuffer aStr("Sub item ");
-                        aStr.append(static_cast<sal_Int32>(
-                            pType->aAttrib[n-1].nAID));
-                        aStr.append(" not convertible in slot: ");
-                        aStr.append(static_cast<sal_Int32>(nSlotId));
-                        OSL_FAIL( aStr.getStr() );
+                        SAL_WARN( "sfx", "Sub item " << pType->aAttrib[n-1].nAID
+                                    << " not convertible in slot: " << nSlotId );
                     }
                 }
             }
@@ -1333,9 +1284,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
                 pValue[nActProp].Name = OUString::createFromAscii( rArg.pName ) ;
                 if ( !pItem->QueryValue( pValue[nActProp++].Value ) )
                 {
-                    OStringBuffer aStr("Item not convertible: ");
-                    aStr.append(static_cast<sal_Int32>(rArg.nSlotId));
-                    OSL_FAIL(aStr.getStr());
+                    SAL_WARN( "sfx", "Item not convertible: " << rArg.nSlotId );
                 }
             }
             else
@@ -1354,12 +1303,10 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b
                     pValue[nActProp].Name = aName;
                     if ( !pItem->QueryValue( pValue[nActProp++].Value, nSubId ) )
                     {
-                        OStringBuffer aStr("Sub item ");
-                        aStr.append(static_cast<sal_Int32>(
-                            rArg.pType->aAttrib[n-1].nAID));
-                        aStr.append(" not convertible in slot: ");
-                        aStr.append(static_cast<sal_Int32>(rArg.nSlotId));
-                        OSL_FAIL(aStr.getStr());
+                        SAL_WARN( "sfx", "Sub item "
+                                    << rArg.pType->aAttrib[n-1].nAID
+                                    << " not convertible in slot: "
+                                    << rArg.nSlotId );
                     }
                 }
             }
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 39ebcc96eb55..2a12149cc6b3 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -179,12 +179,9 @@ void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, sal_uInt16 nSlotCount )
                 pCurSlot = pCurSlot->pNextSlot;
                 if ( pCurSlot->GetStateFnc() != pIter->GetStateFnc() )
                 {
-                    OStringBuffer aStr("Linked Slots with different State Methods : ");
-                    aStr.append(static_cast<sal_Int32>(
-                        pCurSlot->GetSlotId()));
-                    aStr.append(" , ");
-                    aStr.append(static_cast<sal_Int32>(pIter->GetSlotId()));
-                    SAL_WARN("sfx.control", aStr.getStr());
+                    SAL_WARN("sfx.control", "Linked Slots with different State Methods : "
+                                << pCurSlot->GetSlotId()
+                                << " , " << pIter->GetSlotId() );
                 }
             }
             while ( pCurSlot != pIter );
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index b9bcabb547a6..11f5bb9e7786 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -191,14 +191,10 @@ SfxRequest::SfxRequest
         pImpl->xRecorder = SfxRequest::GetMacroRecorder( pViewFrame );
         pImpl->aTarget = pImpl->pShell->GetName();
     }
-#ifdef DBG_UTIL
     else
     {
-        OStringBuffer aStr("Recording unsupported slot: ");
-        aStr.append(static_cast<sal_Int32>(pImpl->pPool->GetSlotId(nSlotId)));
-        OSL_FAIL(aStr.getStr());
+        SAL_WARN( "sfx", "Recording unsupported slot: " << pImpl->pPool->GetSlotId(nSlotId) );
     }
-#endif
 }
 
 
@@ -573,12 +569,8 @@ void SfxRequest::Done_Impl
 
     // recordable?
     // new Recording uses UnoName!
-    if ( !pImpl->pSlot->pUnoName )
-    {
-        OStringBuffer aStr("Recording not exported slot: ");
-        aStr.append(static_cast<sal_Int32>(pImpl->pSlot->GetSlotId()));
-        OSL_FAIL(aStr.getStr());
-    }
+    SAL_WARN_IF( !pImpl->pSlot->pUnoName, "sfx", "Recording not exported slot: "
+                    << pImpl->pSlot->GetSlotId() );
 
     if ( !pImpl->pSlot->pUnoName ) // playing it safe
         return;
@@ -593,14 +585,8 @@ void SfxRequest::Done_Impl
         const SfxPoolItem *pItem;
         sal_uInt16 nWhich = rPool.GetWhich(pImpl->pSlot->GetSlotId());
         SfxItemState eState = pSet ? pSet->GetItemState( nWhich, false, &pItem ) : SfxItemState::UNKNOWN;
-#ifdef DBG_UTIL
-        if ( SfxItemState::SET != eState )
-        {
-            OStringBuffer aStr("Recording property not available: ");
-            aStr.append(static_cast<sal_Int32>(pImpl->pSlot->GetSlotId()));
-            OSL_FAIL(aStr.getStr());
-        }
-#endif
+        SAL_WARN_IF( SfxItemState::SET != eState, "sfx", "Recording property not available: "
+                     << pImpl->pSlot->GetSlotId() );
         uno::Sequence < beans::PropertyValue > aSeq;
         if ( eState == SfxItemState::SET )
             TransformItems( pImpl->pSlot->GetSlotId(), *pSet, aSeq, pImpl->pSlot );
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 6a26e7b8420f..3fcbcdc4a77d 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -108,10 +108,7 @@ void SfxObjectFactory::RegisterViewFactory
         {
             if ( (*it)->GetAPIViewName() != sViewName )
                 continue;
-            OStringBuffer aStr("SfxObjectFactory::RegisterViewFactory: duplicate view name '");
-            aStr.append(OUStringToOString(sViewName, RTL_TEXTENCODING_ASCII_US));
-            aStr.append("'!");
-            OSL_FAIL(aStr.getStr());
+            SAL_WARN( "sfx", "SfxObjectFactory::RegisterViewFactory: duplicate view name: " << sViewName );
             break;
         }
     }
diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx
index f3b2fe33673c..d1e2c6005326 100644
--- a/slideshow/test/demoshow.cxx
+++ b/slideshow/test/demoshow.cxx
@@ -519,14 +519,12 @@ void DemoApp::Main()
     }
     catch( uno::Exception& )
     {
-        OSL_FAIL( OUStringToOString(
-                        comphelper::anyToString( cppu::getCaughtException() ),
-                        RTL_TEXTENCODING_UTF8 ).getStr() );
+        SAL_WARN( "slideshow", comphelper::anyToString( cppu::getCaughtException() ) );
     }
 
     if( !xFactory.is() )
     {
-        SAL_INFO("slideshow",( "Could not bootstrap UNO, installation must be in disorder. Exiting." );
+        SAL_INFO("slideshow", "Could not bootstrap UNO, installation must be in disorder. Exiting." );
         exit( 1 );
     }
 
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index cbeb631d2be8..998c8b16ed47 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -607,13 +607,7 @@ PermissionCollection AccessController::getEffectivePermissions(
             rec->push_back( pair< OUString, Any >( userId, demanded_perm ) );
         }
 #ifdef __DIAGNOSE
-        OUStringBuffer buf( 48 );
-        buf.append( "> info: recurring call of user \"" );
-        buf.append( userId );
-        buf.append( "\"" );
-        OString str(
-            OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) );
-        SAL_INFO("stoc",( "%s", str.getStr() );
+        SAL_INFO("stoc", "> info: recurring call of user: " << userId );
 #endif
         return PermissionCollection( new AllPermission() );
     }
diff --git a/svtools/source/config/test/test.cxx b/svtools/source/config/test/test.cxx
index c0df89ef68e1..85e5437af107 100644
--- a/svtools/source/config/test/test.cxx
+++ b/svtools/source/config/test/test.cxx
@@ -194,7 +194,7 @@ void TestApplication::impl_testDynamicMenuOptions()
         }
     }
 
-    OSL_FAIL( OUStringToOString( sOut.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ).getStr() );
+    SAL_WARN( "svtools", sOut );
 }
 
 
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 26fbc948bf94..e6bb4233d98c 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1943,9 +1943,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_Int32& rSrcPt, sal_Int32& rSegmen
                 case UNKNOWN :
                 default :
                 {
-                    OStringBuffer aString("CustomShapes::unknown PolyFlagValue :");
-                    aString.append(static_cast<sal_Int32>(nCommand));
-                    OSL_FAIL(aString.getStr());
+                    SAL_WARN( "svx", "CustomShapes::unknown PolyFlagValue :" << nCommand );
                 }
                 break;
 #endif
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 87d3dafc64cd..2ec434d312c8 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -211,26 +211,14 @@ bool FmSearchEngine::MoveCursor()
     }
     catch(css::sdbc::SQLException const& e)
     {
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer sDebugMessage("FmSearchEngine::MoveCursor : catched a DatabaseException (");
-        sDebugMessage.append(OUStringToOString(e.SQLState, RTL_TEXTENCODING_ASCII_US));
-        sDebugMessage.append(") !");
-        OSL_FAIL(sDebugMessage.getStr());
-#else
         (void)e;
-#endif
+        SAL_WARN( "svx", "FmSearchEngine::MoveCursor: catched a DatabaseException: " << e.SQLState );
         bSuccess = false;
     }
     catch(Exception const& e)
     {
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer sDebugMessage("FmSearchEngine::MoveCursor : catched an Exception (");
-        sDebugMessage.append(OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US));
-        sDebugMessage.append(") !");
-        OSL_FAIL(sDebugMessage.getStr());
-#else
         (void)e;
-#endif
+        SAL_WARN( "svx", "FmSearchEngine::MoveCursor: catched an Exception: " << e.Message);
         bSuccess = false;
     }
     catch(...)
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index d487bfd25832..72afa042efae 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -249,13 +249,8 @@ SdrModel::~SdrModel()
 
     ClearUndoBuffer();
 #ifdef DBG_UTIL
-    if(pAktUndoGroup)
-    {
-        OStringBuffer aStr("In the Dtor of the SdrModel there is an open Undo left: \"");
-        aStr.append(OUStringToOString(pAktUndoGroup->GetComment(), osl_getThreadTextEncoding()))
-            .append('\"');
-        OSL_FAIL(aStr.getStr());
-    }
+    SAL_WARN_IF(pAktUndoGroup, "svx", "In the Dtor of the SdrModel there is an open Undo left: \""
+                    << pAktUndoGroup->GetComment() << '\"');
 #endif
     delete pAktUndoGroup;
 
diff --git a/sw/source/filter/ww8/sortedarray.hxx b/sw/source/filter/ww8/sortedarray.hxx
index 8038ad8a5344..7efec13aa9ff 100644
--- a/sw/source/filter/ww8/sortedarray.hxx
+++ b/sw/source/filter/ww8/sortedarray.hxx
@@ -95,7 +95,7 @@ namespace ww
             }
             if (bBroken)
             {
-               OSL_FAIL( OUStringToOString( sError, RTL_TEXTENCODING_ASCII_US ).getStr() );
+               SAL_WARN( "sw", sError );
             }
 #endif
         }
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index a12f89e25dd9..9eb7f693b77e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3337,10 +3337,7 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString)
         return;
 
 #if OSL_DEBUG_LEVEL > 1
-        {
-            OString sText(OUStringToOString(rAddString, RTL_TEXTENCODING_UTF8));
-            SAL_INFO("sw.ww8", "<addTextToParagraph>" << sText.getStr() << "</addTextToParagraph>");
-        }
+    SAL_INFO("sw.ww8", "<addTextToParagraph>" << rAddString << "</addTextToParagraph>");
 #endif
 
     const SwContentNode *pCntNd = m_pPaM->GetContentNode();
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 8282b081c2e8..61bd0949f002 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -194,12 +194,7 @@ ErrCode ReadThroughComponent(
         if( bEncrypted )
             return ERRCODE_SFX_WRONGPASSWORD;
 
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer aError("SAX parse exception caught while importing:\n");
-        aError.append(OUStringToOString(r.Message,
-            RTL_TEXTENCODING_ASCII_US));
-        OSL_FAIL(aError.getStr());
-#endif
+        SAL_WARN( "sw", "SAX parse exception caught while importing: " << r.Message );
 
         const OUString sErr( OUString::number( r.LineNumber )
             + ","
@@ -229,46 +224,25 @@ ErrCode ReadThroughComponent(
         if( bEncrypted )
             return ERRCODE_SFX_WRONGPASSWORD;
 
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer aError("SAX exception caught while importing:\n");
-        aError.append(OUStringToOString(r.Message,
-            RTL_TEXTENCODING_ASCII_US));
-        OSL_FAIL(aError.getStr());
-#endif
-
+        SAL_WARN( "sw", "SAX exception caught while importing: " << r.Message);
         return ERR_SWG_READ_ERROR;
     }
     catch(const packages::zip::ZipIOException& r)
     {
         (void)r;
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer aError("Zip exception caught while importing:\n");
-        aError.append(OUStringToOString(r.Message,
-            RTL_TEXTENCODING_ASCII_US));
-        OSL_FAIL(aError.getStr());
-#endif
+        SAL_WARN( "sw", "Zip exception caught while importing: " << r.Message);
         return ERRCODE_IO_BROKENPACKAGE;
     }
     catch(const io::IOException& r)
     {
         (void)r;
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer aError("IO exception caught while importing:\n");
-        aError.append(OUStringToOString(r.Message,
-            RTL_TEXTENCODING_ASCII_US));
-        OSL_FAIL(aError.getStr());
-#endif
+        SAL_WARN( "sw", "IO exception caught while importing: " << r.Message);
         return ERR_SWG_READ_ERROR;
     }
     catch(const uno::Exception& r)
     {
         (void)r;
-#if OSL_DEBUG_LEVEL > 0
-        OStringBuffer aError("uno exception caught while importing:\n");
-        aError.append(OUStringToOString(r.Message,
-            RTL_TEXTENCODING_ASCII_US));
-        OSL_FAIL(aError.getStr());
-#endif
+        SAL_WARN( "sw", "uno exception caught while importing: " << r.Message );
         return ERR_SWG_READ_ERROR;
     }
 
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index c94038539893..0c08d996dd27 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -498,13 +498,7 @@ void SwView::ExecSearch(SfxRequest& rReq)
         }
         break;
         default:
-#if OSL_DEBUG_LEVEL > 1
-            if(nSlot)
-            {
-                OString sStr("nSlot: " + OString::number(nSlot) + " wrong Dispatcher (viewsrch.cxx)");
-                OSL_FAIL(sStr.getStr());
-            }
-#endif
+            SAL_WARN_IF( nSlot, "sw", "nSlot: " << nSlot << " wrong Dispatcher (viewsrch.cxx)" );
             return;
     }
 }
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 3e808571923e..4556423c132b 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -801,11 +801,7 @@ void ResMgr::Init( const OUString& rFileName )
 
     if ( !pImpRes )
     {
-#ifdef DBG_UTIL
-        OStringBuffer aStr("Resourcefile not found:\n");
-        aStr.append(OUStringToOString(rFileName, RTL_TEXTENCODING_UTF8));
-        OSL_FAIL(aStr.getStr());
-#endif
+        SAL_WARN( "tools.rc", "Resourcefile not found: " << rFileName);
         RscException_Impl();
     }
 #ifdef DBG_UTIL
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index 77856390e2a6..41b8cacf3135 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -454,10 +454,7 @@ void SvPersistStream::ReadObj
             if( !pFunc )
             {
 #ifdef DBG_UTIL
-                OStringBuffer aStr("no class with id: " );
-                aStr.append(static_cast<sal_Int32>(nClassId));
-                aStr.append(" registered");
-                SAL_INFO("tools", aStr.getStr());
+                SAL_INFO( "tools", "no class with id: " << nClassId << " registered" );
 #else
                 (void)nObjLen;
 #endif
@@ -475,16 +472,8 @@ void SvPersistStream::ReadObj
             SAL_WARN_IF( (nHdr & P_DBGUTIL) && (nId != nNewId), "tools","read write id conflict: not the same");
 
             rpObj->Load( *this );
-#ifdef DBG_UTIL
-            if( nObjLen + nObjPos != Tell() )
-            {
-                OStringBuffer aStr("false object len: read = ");
-                aStr.append(static_cast<sal_Int64>((long)(Tell() - nObjPos)));
-                aStr.append(", should = ");
-                aStr.append(static_cast<sal_Int32>(nObjLen));
-                OSL_FAIL(aStr.getStr());
-            }
-#endif
+            SAL_WARN_IF( nObjLen + nObjPos != Tell(), "tools", "false object len: read = " << (Tell() - nObjPos)
+                            << ", should = " << nObjLen);
             rpObj->RestoreNoDelete();
             rpObj->ReleaseRef();
         }
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index c0dc0043a6e0..f90a94d6dbf6 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -220,13 +220,7 @@ namespace utl
             }
             catch (NoSuchElementException&)
             {
-                #if OSL_DEBUG_LEVEL > 0
-                OStringBuffer aBuf( 256 );
-                aBuf.append("OConfigurationNode::removeNode: there is no element named!");
-                aBuf.append( OUStringToOString( _rName, RTL_TEXTENCODING_ASCII_US ) );
-                aBuf.append( "!" );
-                OSL_FAIL(aBuf.getStr());
-                #endif
+                SAL_WARN( "unotools", "OConfigurationNode::removeNode: there is no element named: " << _rName );
             }
             catch (WrappedTargetException&)
             {
@@ -316,13 +310,7 @@ namespace utl
         }
         catch(const NoSuchElementException&)
         {
-            #if OSL_DEBUG_LEVEL > 0
-            OStringBuffer aBuf( 256 );
-            aBuf.append("OConfigurationNode::openNode: there is no element named ");
-            aBuf.append( OUStringToOString( _rPath, RTL_TEXTENCODING_ASCII_US ) );
-            aBuf.append("!");
-            OSL_FAIL(aBuf.getStr());
-            #endif
+            SAL_WARN( "unotools", "OConfigurationNode::openNode: there is no element named " << _rPath );
         }
         catch(Exception&)
         {
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 62c571ebe855..50229734c508 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -109,16 +109,7 @@ void BitmapEx::loadFromIconTheme( const OUString& rIconName )
         bSuccess = false;
     }
 
-    if (!bSuccess)
-    {
-#ifdef DBG_UTIL
-        OStringBuffer aErrorStr(
-            "BitmapEx::BitmapEx(): could not load image <");
-        aErrorStr.append(OUStringToOString(rIconName, RTL_TEXTENCODING_ASCII_US)).append("> via icon theme ");
-        aErrorStr.append(OUStringToOString(aIconTheme, RTL_TEXTENCODING_ASCII_US)).append('.');
-        OSL_FAIL(aErrorStr.getStr());
-#endif
-    }
+    SAL_WARN_IF( !bSuccess, "vcl", "BitmapEx::BitmapEx(): could not load image " << rIconName << " via icon theme " << aIconTheme);
 }
 
 BitmapEx::BitmapEx( const Bitmap& rBmp ) :
diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx
index 049479961bef..56fa5330b363 100644
--- a/vcl/source/gdi/svmconverter.cxx
+++ b/vcl/source/gdi/svmconverter.cxx
@@ -2573,14 +2573,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
             break;
 
             default:
-#ifdef DBG_UTIL
-            {
-                OStringBuffer aStr("Missing implementation for Action#: ");
-                aStr.append(static_cast<sal_Int32>(pAction->GetType()));
-                aStr.append('!');
-                OSL_FAIL(aStr.getStr());
-            }
-#endif
+                SAL_WARN( "vcl", "Missing implementation for Action#: " << static_cast<sal_Int32>(pAction->GetType()) );
             break;
         }
     }
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index da3435510a7e..9d8c448970ec 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -779,7 +779,7 @@ namespace
             return VclResId(SV_BUTTONTEXT_YES);
         else if (rType == "gtk-no")
             return VclResId(SV_BUTTONTEXT_NO);
-        SAL_WARN("vcl.layout", "unknown stock type: " << rType.getStr());
+        SAL_WARN("vcl.layout", "unknown stock type: " << rType);
         return OUString();
     }
 
@@ -1461,20 +1461,20 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
             if (sPattern == "hh:mm")
             {
                 connectTimeFormatterAdjustment(id, sAdjustment);
-                SAL_INFO("vcl.layout", "making time field for " << name << " " << sUnit.getStr());
+                SAL_INFO("vcl.layout", "making time field for " << name << " " << sUnit);
                 xWindow = VclPtr<TimeField>::Create(pParent, nBits);
             }
             else if (sPattern == "yy:mm:dd")
             {
                 connectDateFormatterAdjustment(id, sAdjustment);
-                SAL_INFO("vcl.layout", "making date field for " << name << " " << sUnit.getStr());
+                SAL_INFO("vcl.layout", "making date field for " << name << " " << sUnit);
                 xWindow = VclPtr<DateField>::Create(pParent, nBits);
             }
             else
             {
                 connectNumericFormatterAdjustment(id, sAdjustment);
                 FieldUnit eUnit = detectMetricUnit(sUnit);
-                SAL_INFO("vcl.layout", "making metric field for " << name << " " << sUnit.getStr());
+                SAL_INFO("vcl.layout", "making metric field for " << name << " " << sUnit);
                 VclPtrInstance<MetricField> xField(pParent, nBits);
                 xField->SetUnit(eUnit);
                 if (eUnit == FUNIT_CUSTOM)
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 6847fb2d5d76..0cb24e9cdef9 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -751,10 +751,8 @@ bool Dialog::ImplStartExecuteModal()
     if ( mbInExecute )
     {
 #ifdef DBG_UTIL
-        OStringBuffer aErrorStr;
-        aErrorStr.append("Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): ");
-        aErrorStr.append(ImplGetDialogText(this));
-        OSL_FAIL(aErrorStr.getStr());
+        SAL_WARN( "vcl", "Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): "
+                    << ImplGetDialogText(this) );
 #endif
         return false;
     }
diff --git a/vcl/source/window/errinf.cxx b/vcl/source/window/errinf.cxx
index 7815e67bb11a..8eba53584b5c 100644
--- a/vcl/source/window/errinf.cxx
+++ b/vcl/source/window/errinf.cxx
@@ -70,11 +70,7 @@ void ErrorRegistry::RegisterDisplay(WindowDisplayErrorFunc *aDsp)
 
 static void aDspFunc(const OUString &rErr, const OUString &rAction)
 {
-    OStringBuffer aErr("Action: ");
-    aErr.append(OUStringToOString(rAction, RTL_TEXTENCODING_ASCII_US));
-    aErr.append(" Error: ");
-    aErr.append(OUStringToOString(rErr, RTL_TEXTENCODING_ASCII_US));
-    OSL_FAIL(aErr.getStr());
+    SAL_WARN("vcl", "Action: " << rAction << " Error: " << rErr);
 }
 
 ErrorHandler::ErrorHandler()
@@ -156,11 +152,7 @@ DialogMask ErrorHandler::HandleError(ErrCode nErrCodeId, DialogMask nFlags)
     {
         if(!rData.pDsp)
         {
-            OStringBuffer aStr("Action: ");
-            aStr.append(OUStringToOString(aAction, RTL_TEXTENCODING_ASCII_US));
-            aStr.append("\nError: ");
-            aStr.append(OUStringToOString(aErr, RTL_TEXTENCODING_ASCII_US));
-            OSL_FAIL(aStr.getStr());
+            SAL_WARN( "vcl", "Action: " << aAction <<  "Error: " << aErr);
         }
         else
         {
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 4dab791301f4..32643162d110 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -723,7 +723,7 @@ bool VclButtonBox::set_property(const OString &rKey, const OUString &rValue)
             eStyle = VclButtonBoxStyle::Center;
         else
         {
-            SAL_WARN("vcl.layout", "unknown layout style " << rValue.getStr());
+            SAL_WARN("vcl.layout", "unknown layout style " << rValue);
         }
         m_eLayoutStyle = eStyle;
     }
@@ -2139,7 +2139,7 @@ bool VclSizeGroup::set_property(const OString &rKey, const OUString &rValue)
             eMode = VclSizeGroupMode::Both;
         else
         {
-            SAL_WARN("vcl.layout", "unknown size group mode" << rValue.getStr());
+            SAL_WARN("vcl.layout", "unknown size group mode" << rValue);
         }
         set_mode(eMode);
     }
@@ -2465,7 +2465,7 @@ bool MessageDialog::set_property(const OString &rKey, const OUString &rValue)
             eMode = VclMessageType::Error;
         else
         {
-            SAL_WARN("vcl.layout", "unknown message type mode" << rValue.getStr());
+            SAL_WARN("vcl.layout", "unknown message type mode" << rValue);
         }
         m_eMessageType = eMode;
     }
@@ -2486,7 +2486,7 @@ bool MessageDialog::set_property(const OString &rKey, const OUString &rValue)
             eMode = VclButtonsType::OkCancel;
         else
         {
-            SAL_WARN("vcl.layout", "unknown buttons type mode" << rValue.getStr());
+            SAL_WARN("vcl.layout", "unknown buttons type mode" << rValue);
         }
         m_eButtonsType = eMode;
     }
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6aef0dbafd69..07c26f5c24ab 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1164,11 +1164,7 @@ void PrintDialog::setupOptionalUI()
         }
         else
         {
-            OStringBuffer sMessage;
-            sMessage.append("Unsupported UI option: \"");
-            sMessage.append(OUStringToOString(aCtrlType, RTL_TEXTENCODING_UTF8));
-            sMessage.append('"');
-            OSL_FAIL( sMessage.getStr() );
+            SAL_WARN( "vcl", "Unsupported UI option: \"" << aCtrlType << '"');
         }
     }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 19fcebba9c48..12bd3c0a03aa 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -376,10 +376,7 @@ void Window::dispose()
         }
         else
         {
-            OStringBuffer aTempStr("Window (");
-            aTempStr.append(OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8));
-            aTempStr.append(") not found in TaskPanelList!");
-            OSL_FAIL( aTempStr.getStr() );
+            SAL_WARN( "vcl", "Window (" << GetText() << ") not found in TaskPanelList");
         }
     }
 
@@ -417,12 +414,10 @@ void Window::dispose()
         // #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below
         bHasFocussedChild = true;
 #if OSL_DEBUG_LEVEL > 0
-        OStringBuffer aTempStr("Window (");
-        aTempStr.append(OUStringToOString(GetText(),
-            RTL_TEXTENCODING_UTF8)).
-                append(") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !");
-        OSL_FAIL( aTempStr.getStr() );
-        Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ));   // abort in debug build version, this must be fixed!
+        OUString aTempStr = "Window (" + GetText() +
+                ") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !";
+        SAL_WARN( "vcl", aTempStr );
+        Application::Abort(aTempStr);   // abort in debug build version, this must be fixed!
 #endif
     }
 
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index 6e30a1da8591..ce451fc139c7 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -859,9 +859,7 @@ FontAttributes GenPspGraphics::Info2FontAttributes( const psp::FastPrintFontInfo
 #if OSL_DEBUG_LEVEL > 2
     if( aDFA.HasMapNames() )
     {
-        OString aOrigName(OUStringToOString(aDFA.GetFamilyName(), osl_getThreadTextEncoding()));
-        OString aAliasNames(OUStringToOString(aDFA.GetAliasNames(), osl_getThreadTextEncoding()));
-        SAL_INFO( "vcl.fonts", "using alias names " << aAliasNames.getStr() << " for font family " << aOrigName.getStr() );
+        SAL_INFO( "vcl.fonts", "using alias names " << aDFA.GetAliasNames() << " for font family " << aDFA.GetFamilyName() );
     }
 #endif
 
diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx
index 2c8521015255..0159e734bba2 100644
--- a/xmlscript/test/imexp.cxx
+++ b/xmlscript/test/imexp.cxx
@@ -72,8 +72,7 @@ Reference< XComponentContext > createInitialComponentContext(
 
     catch( const Exception& rExc )
     {
-        OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_FAIL( aStr.getStr() );
+        SAL_WARN( "xmlscript", rExc.Message );
     }
 
     return xContext;
@@ -186,19 +185,18 @@ void MyApp::Main()
     }
     catch (const xml::sax::SAXException & rExc)
     {
-        OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
+        OUString aStr( rExc.Message );
         uno::Exception exc;
         if (rExc.WrappedException >>= exc)
         {
             aStr += " >>> ";
-            aStr += OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US );
+            aStr += exc.Message;
         }
-        OSL_FAIL( aStr.getStr() );
+        SAL_WARN( "xmlscript", aStr );
     }
     catch (const uno::Exception & rExc)
     {
-        OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
-        OSL_FAIL( aStr.getStr() );
+        SAL_WARN( "xmlscript", rExc.Message );
     }
 
     Reference< lang::XComponent > xComp( xContext, UNO_QUERY );


More information about the Libreoffice-commits mailing list