[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 4 commits - accessibility/source chart2/source chart2/workbench connectivity/source cui/source dbaccess/source desktop/source editeng/source embeddedobj/source filter/source forms/source fpicker/source linguistic/source oox/source package/source reportdesign/source scripting/source sc/source sd/qa sd/source sfx2/source slideshow/source stoc/source svtools/source svx/source sw/source toolkit/source ucb/source unotools/source unoxml/source uui/source vcl/unx vcl/win writerfilter/source xmlsecurity/source

Marco Cecchetti (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 31 08:39:29 UTC 2021


 accessibility/source/extended/accessibleeditbrowseboxcell.cxx   |    3 
 chart2/source/model/filter/XMLFilter.cxx                        |    2 
 chart2/source/tools/WrappedPropertySet.cxx                      |    4 
 chart2/workbench/addin/sampleaddin.cxx                          |    2 
 connectivity/source/commontools/DateConversion.cxx              |    2 
 connectivity/source/commontools/dbexception.cxx                 |    3 
 connectivity/source/commontools/dbtools.cxx                     |    8 
 connectivity/source/commontools/predicateinput.cxx              |    2 
 connectivity/source/drivers/file/fcomp.cxx                      |    3 
 connectivity/source/drivers/hsqldb/HStorageAccess.cxx           |    7 
 connectivity/source/drivers/hsqldb/HStorageMap.cxx              |    2 
 connectivity/source/drivers/hsqldb/StorageFileAccess.cxx        |    2 
 connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx |    7 
 connectivity/source/drivers/mork/MResultSet.cxx                 |    3 
 connectivity/source/manager/mdrivermanager.cxx                  |    2 
 cui/source/dialogs/showcols.cxx                                 |    6 
 cui/source/options/optasian.cxx                                 |    7 
 cui/source/options/sdbcdriverenum.cxx                           |    3 
 dbaccess/source/core/dataaccess/ContentHelper.cxx               |    3 
 dbaccess/source/core/dataaccess/documentdefinition.cxx          |    4 
 dbaccess/source/filter/xml/dbloader2.cxx                        |    4 
 dbaccess/source/filter/xml/xmlExport.cxx                        |    2 
 dbaccess/source/filter/xml/xmlHierarchyCollection.cxx           |    3 
 dbaccess/source/filter/xml/xmlQuery.cxx                         |    3 
 dbaccess/source/filter/xml/xmlTable.cxx                         |    5 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx                  |    2 
 dbaccess/source/ui/browser/sbagrid.cxx                          |    2 
 dbaccess/source/ui/control/tabletree.cxx                        |    2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx           |    3 
 dbaccess/source/ui/querydesign/TableWindow.cxx                  |    5 
 dbaccess/source/ui/relationdesign/RelationTableView.cxx         |    5 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx                |    4 
 editeng/source/accessibility/AccessibleEditableTextPara.cxx     |    2 
 editeng/source/misc/hangulhanja.cxx                             |    2 
 embeddedobj/source/commonembedding/miscobj.cxx                  |    3 
 filter/source/svg/presentation_engine.js                        |   22 ++
 filter/source/svg/svgexport.cxx                                 |   82 ++++++----
 filter/source/svg/svgwriter.cxx                                 |   11 +
 filter/source/svg/svgwriter.hxx                                 |    1 
 forms/source/component/Button.cxx                               |    2 
 forms/source/component/ComboBox.cxx                             |    2 
 forms/source/component/Currency.cxx                             |    3 
 forms/source/component/DatabaseForm.cxx                         |    4 
 forms/source/component/Grid.cxx                                 |    3 
 forms/source/component/ImageControl.cxx                         |    2 
 forms/source/component/clickableimage.cxx                       |    3 
 forms/source/runtime/formoperations.cxx                         |    7 
 forms/source/xforms/submission/submission_get.cxx               |    3 
 forms/source/xforms/submission/submission_post.cxx              |    3 
 forms/source/xforms/submission/submission_put.cxx               |    3 
 fpicker/source/office/fpsmartcontent.cxx                        |    3 
 linguistic/source/gciterator.cxx                                |    2 
 oox/source/helper/binarystreambase.cxx                          |    5 
 oox/source/ppt/slidetransition.cxx                              |    5 
 package/source/zippackage/ZipPackageStream.cxx                  |    6 
 reportdesign/source/core/api/FixedLine.cxx                      |    3 
 reportdesign/source/core/api/ReportDefinition.cxx               |    4 
 reportdesign/source/core/sdr/PropertyForward.cxx                |    2 
 reportdesign/source/core/sdr/RptObject.cxx                      |    2 
 reportdesign/source/filter/xml/xmlCell.cxx                      |    3 
 reportdesign/source/filter/xml/xmlComponent.cxx                 |    3 
 reportdesign/source/filter/xml/xmlCondPrtExpr.cxx               |    3 
 reportdesign/source/filter/xml/xmlFormatCondition.cxx           |    3 
 reportdesign/source/filter/xml/xmlFormattedField.cxx            |    3 
 reportdesign/source/filter/xml/xmlFunction.cxx                  |    5 
 reportdesign/source/filter/xml/xmlGroup.cxx                     |    5 
 reportdesign/source/filter/xml/xmlHelper.cxx                    |    3 
 reportdesign/source/filter/xml/xmlImage.cxx                     |    3 
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx     |    3 
 reportdesign/source/filter/xml/xmlReport.cxx                    |    2 
 reportdesign/source/filter/xml/xmlReportElement.cxx             |    3 
 reportdesign/source/filter/xml/xmlReportElementBase.cxx         |    3 
 reportdesign/source/filter/xml/xmlSection.cxx                   |    3 
 reportdesign/source/filter/xml/xmlTable.cxx                     |    5 
 reportdesign/source/ui/dlg/GroupsSorting.cxx                    |    9 -
 reportdesign/source/ui/inspection/DataProviderHandler.cxx       |    5 
 reportdesign/source/ui/inspection/GeometryHandler.cxx           |   14 -
 reportdesign/source/ui/misc/FunctionHelper.cxx                  |    3 
 reportdesign/source/ui/misc/RptUndo.cxx                         |   10 -
 reportdesign/source/ui/report/ReportController.cxx              |    2 
 reportdesign/source/ui/report/ReportSection.cxx                 |    6 
 reportdesign/source/ui/report/propbrw.cxx                       |   12 -
 sc/source/core/data/dpobject.cxx                                |    4 
 sc/source/core/data/globalx.cxx                                 |    7 
 sc/source/core/tool/charthelper.cxx                             |    3 
 sc/source/core/tool/chartlock.cxx                               |    7 
 sc/source/filter/oox/pivottablebuffer.cxx                       |    3 
 sc/source/ui/dataprovider/sqldataprovider.cxx                   |    3 
 sc/source/ui/dbgui/dapidata.cxx                                 |    5 
 sc/source/ui/docshell/dbdocimp.cxx                              |    3 
 sc/source/ui/docshell/docsh.cxx                                 |    3 
 sc/source/ui/docshell/docsh4.cxx                                |    3 
 sc/source/ui/docshell/docsh8.cxx                                |    6 
 sc/source/ui/miscdlgs/sharedocdlg.cxx                           |    3 
 sc/source/ui/unoobj/celllistsource.cxx                          |    5 
 sc/source/ui/unoobj/cellsuno.cxx                                |    5 
 sc/source/ui/unoobj/cellvaluebinding.cxx                        |    5 
 sc/source/ui/unoobj/shapeuno.cxx                                |    3 
 sc/source/ui/view/tabvwshb.cxx                                  |    3 
 scripting/source/provider/BrowseNodeFactoryImpl.cxx             |    2 
 sd/qa/unit/SVGExportTests.cxx                                   |    2 
 sd/source/core/CustomAnimationEffect.cxx                        |   67 ++++----
 sd/source/core/CustomAnimationPreset.cxx                        |   32 ---
 sd/source/core/TransitionPreset.cxx                             |    3 
 sd/source/core/drawdoc3.cxx                                     |    3 
 sd/source/core/drawdoc4.cxx                                     |    3 
 sd/source/core/sdpage.cxx                                       |    3 
 sd/source/core/stlpool.cxx                                      |    5 
 sd/source/core/undoanim.cxx                                     |    7 
 sd/source/filter/eppt/pptexanimations.cxx                       |    3 
 sd/source/filter/html/buttonset.cxx                             |    9 -
 sd/source/ui/animations/CustomAnimationDialog.cxx               |    3 
 sd/source/ui/animations/CustomAnimationList.cxx                 |    7 
 sd/source/ui/animations/CustomAnimationPane.cxx                 |    9 -
 sd/source/ui/annotations/annotationmanager.cxx                  |    7 
 sd/source/ui/app/sdxfer.cxx                                     |    3 
 sd/source/ui/slideshow/slideshowimpl.cxx                        |    4 
 sd/source/ui/slidesorter/cache/SlsQueueProcessor.cxx            |    7 
 sd/source/ui/slidesorter/controller/SlideSorterController.cxx   |    3 
 sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx     |    5 
 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx         |    3 
 sd/source/ui/table/TableDesignPane.cxx                          |   15 -
 sd/source/ui/table/tablefunction.cxx                            |    3 
 sd/source/ui/unoidl/unopage.cxx                                 |    5 
 sd/source/ui/view/drviews4.cxx                                  |    3 
 sfx2/source/appl/newhelp.cxx                                    |   14 -
 sfx2/source/dialog/filedlghelper.cxx                            |    8 
 sfx2/source/dialog/templdlg.cxx                                 |    3 
 sfx2/source/doc/Metadatable.cxx                                 |    9 -
 sfx2/source/doc/docinsert.cxx                                   |    5 
 sfx2/source/doc/guisaveas.cxx                                   |    2 
 sfx2/source/doc/printhelper.cxx                                 |   15 -
 sfx2/source/view/frame.cxx                                      |    3 
 slideshow/source/engine/slide/slideimpl.cxx                     |    4 
 stoc/source/implementationregistration/implreg.cxx              |    3 
 stoc/source/javavm/javavm.cxx                                   |    8 
 stoc/source/servicemanager/servicemanager.cxx                   |    4 
 svtools/source/brwbox/editbrowsebox2.cxx                        |    3 
 svtools/source/dialogs/addresstemplate.cxx                      |    3 
 svx/source/form/fmsrcimp.cxx                                    |    2 
 sw/source/core/swg/SwXMLTextBlocks.cxx                          |    3 
 sw/source/core/txtnode/fmtatr2.cxx                              |    3 
 sw/source/core/unocore/swunohelper.cxx                          |   11 -
 sw/source/core/unocore/unoparagraph.cxx                         |    5 
 sw/source/core/unocore/unoport.cxx                              |    5 
 sw/source/filter/xml/xmlimp.cxx                                 |    5 
 sw/source/ui/dbui/addresslistdialog.cxx                         |    5 
 sw/source/ui/dbui/mmgreetingspage.cxx                           |    3 
 sw/source/ui/index/cntex.cxx                                    |    5 
 sw/source/uibase/dbui/mailmergehelper.cxx                       |    5 
 sw/source/uibase/fldui/xfldui.cxx                               |    3 
 sw/source/uibase/uno/dlelstnr.cxx                               |    3 
 sw/source/uibase/uno/unomailmerge.cxx                           |    3 
 toolkit/source/controls/accessiblecontrolcontext.cxx            |    2 
 toolkit/source/controls/filectrl.cxx                            |    3 
 ucb/source/ucp/tdoc/tdoc_stgelems.cxx                           |    2 
 unotools/source/config/confignode.cxx                           |   24 --
 unotools/source/misc/sharedunocomponent.cxx                     |    2 
 unoxml/source/dom/documentbuilder.cxx                           |    2 
 uui/source/iahndl.cxx                                           |    2 
 vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx                            |    5 
 vcl/win/dtrans/WinClipboard.cxx                                 |    3 
 vcl/win/dtrans/XNotifyingDataObject.cxx                         |    3 
 vcl/win/dtrans/source.cxx                                       |    3 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx               |   16 -
 writerfilter/source/dmapper/OLEHandler.cxx                      |    2 
 writerfilter/source/dmapper/PropertyMap.cxx                     |   10 -
 writerfilter/source/dmapper/StyleSheetTable.cxx                 |    8 
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx          |    5 
 169 files changed, 530 insertions(+), 410 deletions(-)

New commits:
commit c000b5eeaacf801588904c3642c2a21b7032af3e
Author:     Marco Cecchetti <marco.cecchetti at collabora.com>
AuthorDate: Mon Jan 11 10:28:57 2021 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Mar 31 10:30:50 2021 +0200

    filter: svg: slide with a custom background are not exported correctly
    
    When a slide has a custom background, the background overlaps any
    master page object: text fields, shapes, ...
    
    Change-Id: Icc410617760502fa4092cfe248155b3e20906abb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109089
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Marco Cecchetti <marco.cecchetti at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109867
    Tested-by: Jenkins

diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index b4c8d3a63078..ce68bc6484fe 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -359,7 +359,7 @@ function uniqueArray(src, key, sort) {
  * @returns {String|Undefined} prefixed
  */
 function prefixed(obj, property) {
-    // tml: Have to check for obj being undefined 
+    // tml: Have to check for obj being undefined
     if (obj === undefined) {
         return undefined;
     }
@@ -4436,6 +4436,7 @@ var aOOOAttrSlide = 'slide';
 var aOOOAttrMaster = 'master';
 var aOOOAttrSlideDuration = 'slide-duration';
 var aOOOAttrHasTransition = 'has-transition';
+var aOOOAttrHasCustomBackground = 'has-custom-background';
 var aOOOAttrBackgroundVisibility = 'background-visibility';
 var aOOOAttrMasterObjectsVisibility = 'master-objects-visibility';
 var aOOOAttrPageNumberVisibility = 'page-number-visibility';
@@ -5056,10 +5057,20 @@ function MetaSlide( sMetaSlideId, aMetaDoc )
     assert( this.pageElement,
             'MetaSlide: page element <' + this.slideId + '> not found.' );
 
+    // The slide custom background element and its id attribute.
+    this.backgroundElement = getElementByClassName( this.pageElement, 'Background' );
+    if( this.backgroundElement )
+    {
+        this.backgroundId = this.backgroundElement.getAttribute( 'id' );
+    }
+
     // We initialize the MasterPage object that provides direct access to
     // the target master page element.
     this.masterPage = this.initMasterPage();
 
+    // We check if the slide has a custom background which overrides the one of the targeted master page
+    this.bHasCustomBackground = this.initHasCustomBackground();
+
     // We initialize visibility properties of the target master page elements.
     this.nAreMasterObjectsVisible     = this.initVisibilityProperty( aOOOAttrMasterObjectsVisibility,  VISIBLE );
     this.nIsBackgroundVisible         = this.initVisibilityProperty( aOOOAttrBackgroundVisibility,     VISIBLE );
@@ -5181,6 +5192,12 @@ initHasTransition : function()
     return ( sHasTransition === 'true' );
 },
 
+initHasCustomBackground : function()
+{
+    var sHasCustomBackground = this.element.getAttributeNS( NSS['ooo'], aOOOAttrHasCustomBackground );
+    return ( sHasCustomBackground === 'true' );
+},
+
 initVisibilityProperty : function( aVisibilityAttribute, nDefaultValue )
 {
     var nVisibility = nDefaultValue;
@@ -5660,10 +5677,11 @@ MasterPageView.prototype.createElement = function()
     // init the Background element
     if( this.aMetaSlide.nIsBackgroundVisible )
     {
+        var nBackgroundId = this.aMetaSlide.bHasCustomBackground ? this.aMetaSlide.backgroundId : this.aMasterPage.backgroundId;
         this.aBackgroundElement = theDocument.createElementNS( NSS['svg'], 'use' );
         this.aBackgroundElement.setAttribute( 'class', 'Background' );
         setNSAttribute( 'xlink', this.aBackgroundElement,
-                        'href', '#' + this.aMasterPage.backgroundId );
+                        'href', '#' + nBackgroundId );
 
         // node linking
         aMasterPageViewElement.appendChild( this.aBackgroundElement );
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index bcf97a8b0678..40c82be27dfd 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -35,6 +35,8 @@
 #include <com/sun/star/xml/sax/Writer.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/drawing/ShapeCollection.hpp>
+#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/RectanglePoint.hpp>
 
 #include <rtl/bootstrap.hxx>
 #include <svx/unopage.hxx>
@@ -89,6 +91,7 @@ constexpr char16_t aOOOElemTextField[] = u"" NSPREFIX "text_field";
 // ooo xml attributes for meta_slide
 const char    aOOOAttrSlide[] = NSPREFIX "slide";
 const char    aOOOAttrMaster[] = NSPREFIX "master";
+const char    aOOOAttrHasCustomBackground[] = NSPREFIX "has-custom-background";
 const char    aOOOAttrBackgroundVisibility[] = NSPREFIX "background-visibility";
 const char    aOOOAttrMasterObjectsVisibility[] = NSPREFIX "master-objects-visibility";
 const char    aOOOAttrSlideDuration[] = NSPREFIX "slide-duration";
@@ -1151,6 +1154,18 @@ void SVGFilter::implGenerateMetaData()
                     VariableDateTimeField         aVariableDateTimeField;
                     FooterField                   aFooterField;
 
+                    // check if the slide has a custom background wich overlaps the matser page background
+                    Reference< XPropertySet > xBackground;
+                    xPropSet->getPropertyValue( "Background" ) >>= xBackground;
+                    if( xBackground.is() )
+                    {
+                        drawing::FillStyle aFillStyle;
+                        bool assigned = ( xBackground->getPropertyValue( "FillStyle" ) >>= aFillStyle );
+                        // has a custom background ?
+                        if( assigned && aFillStyle != drawing::FillStyle_NONE )
+                            mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, aOOOAttrHasCustomBackground, "true" );
+                    }
+
                     xPropSet->getPropertyValue( "IsBackgroundVisible" )  >>= bBackgroundVisibility;
                     // in case the attribute is set to its default value it is not appended to the meta-slide element
                     if( !bBackgroundVisibility ) // visibility default value: 'visible'
@@ -1745,34 +1760,47 @@ bool SVGFilter::implExportPage( const OUString & sPageId,
             const GDIMetaFile& rMtf = (*mpObjects)[ rxPage ].GetRepresentation();
             if( rMtf.GetActionSize() )
             {
-                // background id = "bg-" + page id
-                OUString sBackgroundId = "bg-" + sPageId;
-                mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundId );
-
-                // At present (LibreOffice 3.4.0) the 'IsBackgroundVisible' property is not handled
-                // by Impress; anyway we handle this property as referring only to the visibility
-                // of the master page background. So if a slide has its own background object,
-                // the visibility of such a background object is always inherited from the visibility
-                // of the parent slide regardless of the value of the 'IsBackgroundVisible' property.
-                // This means that we need to set up the visibility attribute only for the background
-                // element of a master page.
-                if( !mbPresentation && bMaster )
+                // If this is not a master page wrap the slide custom background
+                // by a <defs> element.
+                // Slide custom background, if any, is referenced at a different position
+                // in order to not overlap background objects.
+                std::unique_ptr<SvXMLElementExport> xDefsExp;
+                if (!bMaster) // insert the <defs> open tag related to the slide background
                 {
-                    if( !mVisiblePagePropSet.bIsBackgroundVisible )
+                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class",  "SlideBackground" );
+                    xDefsExp.reset( new SvXMLElementExport( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ) );
+                }
+                {
+                    // background id = "bg-" + page id
+                    OUString sBackgroundId = OUString::Concat("bg-") + sPageId;
+                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundId );
+
+                    // At present (LibreOffice 3.4.0) the 'IsBackgroundVisible' property is not handled
+                    // by Impress; anyway we handle this property as referring only to the visibility
+                    // of the master page background. So if a slide has its own background object,
+                    // the visibility of such a background object is always inherited from the visibility
+                    // of the parent slide regardless of the value of the 'IsBackgroundVisible' property.
+                    // This means that we need to set up the visibility attribute only for the background
+                    // element of a master page.
+                    if( !mbPresentation && bMaster )
                     {
-                        mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" );
+                        if( !mVisiblePagePropSet.bIsBackgroundVisible )
+                        {
+                            mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", "hidden" );
+                        }
                     }
-                }
 
-                mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class",  "Background" );
+                    mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class",  "Background" );
 
-                // insert the <g> open tag related to the Background
-                SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
+                    // insert the <g> open tag related to the Background
+                    SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", true, true );
+
+                    // append all elements that make up the Background
+                    const Point aNullPt;
+                    mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL );
+                } // insert the </g> closing tag related to the Background
 
-                // append all elements that make up the Background
-                const Point aNullPt;
-                mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL );
-            }   // insert the </g> closing tag related to the Background
+            } // insert the </defs> closing tag related to the slide background
         }
 
         // In case we are dealing with a master page we need to group all its shapes
diff --git a/sd/qa/unit/SVGExportTests.cxx b/sd/qa/unit/SVGExportTests.cxx
index 35adb1ea0684..4a06f3b4e897 100644
--- a/sd/qa/unit/SVGExportTests.cxx
+++ b/sd/qa/unit/SVGExportTests.cxx
@@ -118,7 +118,7 @@ public:
         // There should be only one child (no link to javascript url)
         assertXPathChildren(svgDoc,
                             SAL_STRINGIFY(/ SVG_SVG / SVG_G[2] / SVG_G / SVG_G / SVG_G / SVG_G
-                                             / SVG_G[4] / SVG_G),
+                                             / SVG_G[3] / SVG_G),
                             1);
     }
 
commit 7664f0d0b5237a94c2ecd32a0b51d33bbbe82523
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Thu Nov 19 20:27:13 2020 +0000
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Mar 31 10:28:13 2021 +0200

    Avoid calculating checksums if we can.
    
    We can compare the underlying mxImpGraphic pointers via the
    Graphic's uno tunnelling magic easily enough anyway.
    
    Change-Id: I09bd0fd97b662f07378197fce2956ed0776ba458
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106186
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ash at collabora.com>
    (cherry picked from commit a52246d5a45548820dac55395e64dc1ff83ae11f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107375
    Tested-by: Jenkins

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 26f17227552e..bcf97a8b0678 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -706,9 +706,10 @@ bool SVGFilter::implExportWriterTextGraphic( const Reference< view::XSelectionSu
         if (!xTransformedGraphic.is())
             return false;
         const Graphic aTransformedGraphic(xTransformedGraphic);
-        bool bChecksumMatches = aOriginalGraphic.GetChecksum() == aTransformedGraphic.GetChecksum();
-        const Graphic aGraphic = bChecksumMatches ? aOriginalGraphic : aTransformedGraphic;
-        uno::Reference<graphic::XGraphic> xGraphic = bChecksumMatches ? xOriginalGraphic : xTransformedGraphic;
+        bool bSameGraphic = aTransformedGraphic == aOriginalGraphic ||
+            aOriginalGraphic.GetChecksum() == aTransformedGraphic.GetChecksum();
+        const Graphic aGraphic = bSameGraphic ? aOriginalGraphic : aTransformedGraphic;
+        uno::Reference<graphic::XGraphic> xGraphic = bSameGraphic ? xOriginalGraphic : xTransformedGraphic;
 
         // Calculate size from Graphic
         Point aPos( OutputDevice::LogicToLogic(aGraphic.GetPrefMapMode().GetOrigin(), aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) );
commit 54bfbdc2ffb8938dbef5febe50c22e4eaf4b3c03
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Mon Nov 30 14:19:29 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Wed Mar 31 10:28:06 2021 +0200

    OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTION
    
    Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
index 55016a749f04..7aefcc98bfad 100644
--- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
+++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
@@ -22,6 +22,7 @@
 
 #include <extended/accessibleeditbrowseboxcell.hxx>
 #include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace accessibility
 {
@@ -224,7 +225,7 @@ namespace accessibility
             }
             catch( const Exception& )
             {
-                OSL_FAIL( "EditBrowseBoxTableCellAccess::disposing: caught an exception while disposing the context!" );
+                TOOLS_WARN_EXCEPTION( "accessibility", "EditBrowseBoxTableCellAccess::disposing: caught an exception while disposing the context!" );
             }
         }
 
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index 22291fac852e..ec1bf1f8b3a3 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -569,7 +569,7 @@ ErrCode XMLFilter::impl_Export(
             }
             catch (const uno::Exception&)
             {
-                OSL_FAIL("Exception caught!");
+                TOOLS_WARN_EXCEPTION( "chart2", "Exception caught!");
             }
         }
 
diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx
index 26344a578adc..483c907a81b1 100644
--- a/chart2/source/tools/WrappedPropertySet.cxx
+++ b/chart2/source/tools/WrappedPropertySet.cxx
@@ -115,7 +115,7 @@ void SAL_CALL WrappedPropertySet::setPropertyValue( const OUString& rPropertyNam
     catch( const uno::Exception& ex )
     {
         css::uno::Any anyEx = cppu::getCaughtException();
-        OSL_FAIL("invalid exception caught in WrappedPropertySet::setPropertyValue");
+        TOOLS_WARN_EXCEPTION( "chart2", "invalid exception caught in WrappedPropertySet::setPropertyValue");
         throw lang::WrappedTargetException( ex.Message, nullptr, anyEx );
     }
 }
@@ -152,7 +152,7 @@ Any SAL_CALL WrappedPropertySet::getPropertyValue( const OUString& rPropertyName
     catch( const uno::Exception& ex )
     {
         css::uno::Any anyEx = cppu::getCaughtException();
-        OSL_FAIL("invalid exception caught in WrappedPropertySet::setPropertyValue");
+        TOOLS_WARN_EXCEPTION( "chart2", "invalid exception caught in WrappedPropertySet::setPropertyValue");
         throw lang::WrappedTargetException( ex.Message, nullptr, anyEx );
     }
 
diff --git a/chart2/workbench/addin/sampleaddin.cxx b/chart2/workbench/addin/sampleaddin.cxx
index 665a205abd9d..5e3d23fd5fe6 100644
--- a/chart2/workbench/addin/sampleaddin.cxx
+++ b/chart2/workbench/addin/sampleaddin.cxx
@@ -55,7 +55,7 @@ sal_Bool SAL_CALL component_writeInfo(
         }
         catch( const registry::InvalidRegistryException& )
         {
-            OSL_FAIL( "### InvalidRegistryException!" );
+            TOOLS_WARN_EXCEPTION( "chart2", "" );
         }
     }
     return sal_False;
diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx
index 510736cc6a3f..09b80f62653c 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -433,7 +433,7 @@ OUString DBTypeConversion::getFormattedValue(const Reference< XPropertySet>& _xC
     }
     catch (const Exception& )
     {
-        OSL_FAIL("DBTypeConversion::getValue: caught an exception while asking for the format key!");
+        TOOLS_WARN_EXCEPTION( "connectivity.commontools", "DBTypeConversion::getValue: caught an exception while asking for the format key!");
     }
 
     if (!nKey)
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx
index f15237d82c88..2efc4a6976b3 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/sdb/SQLErrorEvent.hpp>
 #include <strings.hrc>
 #include <resource/sharedresources.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace dbtools
 {
@@ -197,7 +198,7 @@ void SQLExceptionInfo::append( TYPE _eType, const OUString& _rErrorMessage, cons
     case TYPE::SQLWarning:   aAppend <<= SQLWarning();   break;
     case TYPE::SQLContext:   aAppend <<= SQLContext();   break;
     default:
-        OSL_FAIL( "SQLExceptionInfo::append: invalid exception type: this will crash!" );
+        TOOLS_WARN_EXCEPTION( "connectivity.commontools", "SQLExceptionInfo::append: invalid exception type: this will crash!" );
         break;
     }
 
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index a94a99a6327c..d8ce3f42136e 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -345,7 +345,7 @@ Reference< XConnection> getConnection_withFeedback(const OUString& _rDataSourceN
     }
     catch(Exception&)
     {
-        OSL_FAIL("::dbtools::getConnection_withFeedback: unexpected (non-SQL) exception caught!");
+        TOOLS_WARN_EXCEPTION( "connectivity.commontools", "::dbtools::getConnection_withFeedback: unexpected (non-SQL) exception caught!");
     }
     return xReturn;
 }
@@ -463,7 +463,7 @@ static SharedConnection lcl_connectRowSet(const Reference< XRowSet>& _rxRowSet,
             }
             catch(Exception&)
             {
-                OSL_FAIL("EXception when we set the new active connection!");
+                TOOLS_WARN_EXCEPTION( "connectivity.commontools", "EXception when we set the new active connection!");
             }
         }
     }
@@ -717,7 +717,7 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
     catch( const SQLException& e ) { if ( _pErrorInfo ) *_pErrorInfo = SQLExceptionInfo( e ); }
     catch( const Exception& )
     {
-        OSL_FAIL( "::dbtools::getFieldsByCommandDescriptor: caught an exception while retrieving the fields!" );
+        TOOLS_WARN_EXCEPTION( "connectivity.commontools", "::dbtools::getFieldsByCommandDescriptor: caught an exception while retrieving the fields!" );
     }
 
     return xFields;
@@ -1284,7 +1284,7 @@ Reference< XSingleSelectQueryComposer > getCurrentSettingsComposer(
     }
     catch( const Exception& )
     {
-        OSL_FAIL( "::getCurrentSettingsComposer : caught an exception !" );
+        TOOLS_WARN_EXCEPTION( "connectivity.commontools", "::getCurrentSettingsComposer : caught an exception !" );
     }
 
     return xReturn;
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
index 8ab37a3f76f3..f34ad6228532 100644
--- a/connectivity/source/commontools/predicateinput.cxx
+++ b/connectivity/source/commontools/predicateinput.cxx
@@ -211,7 +211,7 @@ namespace dbtools
                 }
                 catch( const Exception& )
                 {
-                    OSL_FAIL( "OPredicateInputController::implPredicateTree: caught an exception while dealing with the formats!" );
+                    TOOLS_WARN_EXCEPTION( "connectivity.commontools", "OPredicateInputController::implPredicateTree: caught an exception while dealing with the formats!" );
                 }
 
                 bool bDecDiffers = ( nCtxDecSep != nFmtDecSep );
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 134565e3e3de..982d0266b949 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -32,6 +32,7 @@
 #include <file/FDateFunctions.hxx>
 #include <file/FNumericFunctions.hxx>
 #include <file/FConnection.hxx>
+#include <tools/diagnose_ex.h>
 #include <sqlbison.hxx>
 #include <strings.hrc>
 
@@ -451,7 +452,7 @@ OOperand* OPredicateCompiler::execute_Operand(OSQLParseNode const * pPredicateNo
         }
         catch(Exception &)
         {
-            OSL_FAIL("OPredicateCompiler::execute_Operand Exception");
+            TOOLS_WARN_EXCEPTION( "connectivity.drivers", "OPredicateCompiler::execute_Operand Exception");
         }
     }
     else if (SQL_ISRULE(pPredicateNode,parameter))
diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
index 7bb868d2ff1a..91b8324008e3 100644
--- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
@@ -22,6 +22,7 @@
 #include <hsqldb/HStorageMap.hxx>
 #include "accesslog.hxx"
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 #include <string.h>
 
@@ -76,7 +77,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Nativ
         }
         catch(const Exception&)
         {
-            OSL_FAIL( "NativeStorageAccess::close: caught an exception while flushing!" );
+            TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "NativeStorageAccess::close: caught an exception while flushing!" );
         }
 #ifdef HSQLDB_DBG
     {
@@ -426,7 +427,7 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jstring name, jstring key
     }
     catch(const Exception& e)
     {
-        OSL_FAIL("Exception caught! : write [BII)V");
+        TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "Exception caught! : write [BII)V");
         StorageContainer::throwJavaException(e,env);
     }
 }
@@ -479,7 +480,7 @@ void write_to_storage_stream( JNIEnv* env, jstring name, jstring key, jint v )
     }
     catch(const Exception& e)
     {
-        OSL_FAIL("Exception caught! : writeBytes(aData);");
+        TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "writeBytes(aData);");
         StorageContainer::throwJavaException(e,env);
     }
 }
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index ade3133bd536..63b5e0481c5c 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -73,7 +73,7 @@ namespace connectivity::hsqldb
             }
             catch(const Exception&)
             {
-                OSL_FAIL("Exception caught!");
+                TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "");
             }
         }
 
diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
index 3e8461a95f8f..65457ab1d129 100644
--- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
@@ -159,7 +159,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora
     }
     catch(const Exception& e)
     {
-        OSL_FAIL("Exception caught! : Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement");
+        TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement");
         StorageContainer::throwJavaException(e,env);
     }
 }
diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
index b16eaf742e1c..7ddf79aa5e77 100644
--- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
@@ -27,6 +27,7 @@
 #include <hsqldb/HStorageMap.hxx>
 
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include "accesslog.hxx"
 
 #include <limits>
@@ -173,7 +174,7 @@ extern "C" SAL_JNI_EXPORT jlong JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stor
             }
             catch(const Exception& e)
             {
-                OSL_FAIL("Exception caught! : skip();");
+                TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "skip();");
                 StorageContainer::throwJavaException(e,env);
             }
         }
@@ -216,7 +217,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora
         }
         catch(const Exception& e)
         {
-            OSL_FAIL("Exception caught! : available();");
+            TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "available();");
             StorageContainer::throwJavaException(e,env);
         }
     }
@@ -260,7 +261,7 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Stora
         }
         catch(const Exception& e)
         {
-            OSL_FAIL("Exception caught! : skip();");
+            TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "skip();");
             StorageContainer::throwJavaException(e,env);
         }
 
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index 4c51bf414e3f..6a6d14f63fb7 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -27,6 +27,7 @@
 #include <cppuhelper/typeprovider.hxx>
 #include <o3tl/safeint.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <vector>
 #include <algorithm>
@@ -1265,7 +1266,7 @@ void OResultSet::setBoundedColumns(const OValueRow& _rRow,
         }
         catch (Exception&)
         {
-            OSL_FAIL("OResultSet::setBoundedColumns: caught an Exception!");
+            TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "OResultSet::setBoundedColumns");
         }
     }
 }
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index afcb38279640..0edf495bd8ab 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -393,7 +393,7 @@ void OSDBCDriverManager::initializeDriverPrecedence()
     }
     catch (Exception&)
     {
-        OSL_FAIL("OSDBCDriverManager::initializeDriverPrecedence: caught an exception while sorting the drivers!");
+        TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "OSDBCDriverManager::initializeDriverPrecedence: caught an exception while sorting the drivers!");
     }
 }
 
diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx
index 6c92d00fc6b2..a567a84010dc 100644
--- a/cui/source/dialogs/showcols.cxx
+++ b/cui/source/dialogs/showcols.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <comphelper/types.hxx>
 #include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
 
 #define CUIFM_PROP_HIDDEN "Hidden"
 #define CUIFM_PROP_LABEL "Label"
@@ -60,7 +61,8 @@ IMPL_LINK_NOARG(FmShowColsDialog, OnClickedOk, weld::Button&, void)
                 }
                 catch (...)
                 {
-                    OSL_FAIL("FmShowColsDialog::OnClickedOk Exception occurred!");
+                    TOOLS_WARN_EXCEPTION("cui.dialogs",
+                                         "FmShowColsDialog::OnClickedOk Exception occurred!");
                 }
             }
         }
@@ -96,7 +98,7 @@ void FmShowColsDialog::SetColumns(const css::uno::Reference<css::container::XInd
         }
         catch (...)
         {
-            OSL_FAIL("FmShowColsDialog::SetColumns Exception occurred!");
+            TOOLS_WARN_EXCEPTION("cui.dialogs", "FmShowColsDialog::SetColumns Exception occurred!");
         }
 
         // if the col is hidden, put it into the list
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index 3e09e3779b81..1daf56dbb64b 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -22,6 +22,7 @@
 #include <optasian.hxx>
 #include <osl/diagnose.h>
 #include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
 #include <o3tl/any.hxx>
 #include <i18nlangtag/mslangid.hxx>
 #include <svl/asiancfg.hxx>
@@ -183,7 +184,7 @@ bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
         }
         catch (const Exception&)
         {
-            OSL_FAIL("exception in XForbiddenCharacters");
+            TOOLS_WARN_EXCEPTION( "cui.options", "in XForbiddenCharacters");
         }
     }
     eLastUsedLanguageTypeForForbiddenCharacters = m_xLanguageLB->get_active_id();
@@ -310,7 +311,7 @@ IMPL_LINK_NOARG(SvxAsianLayoutPage, LanguageHdl, weld::ComboBox&, void)
             }
             catch (const Exception&)
             {
-                OSL_FAIL("exception in XForbiddenCharacters");
+                TOOLS_WARN_EXCEPTION( "cui.options", "in XForbiddenCharacters");
             }
         }
     }
@@ -368,7 +369,7 @@ IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, weld::Entry&, rEdit, void)
         }
         catch (const Exception&)
         {
-            OSL_FAIL("exception in XForbiddenCharacters");
+            TOOLS_WARN_EXCEPTION( "cui.options", "in XForbiddenCharacters");
         }
     }
     pImpl->aConfig.SetStartEndChars( aLocale, bEnable ? &sStart : nullptr, bEnable ? &sEnd : nullptr);
diff --git a/cui/source/options/sdbcdriverenum.cxx b/cui/source/options/sdbcdriverenum.cxx
index 1370c93c254f..f6a0cf3ad1ee 100644
--- a/cui/source/options/sdbcdriverenum.cxx
+++ b/cui/source/options/sdbcdriverenum.cxx
@@ -20,6 +20,7 @@
 #include "sdbcdriverenum.hxx"
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/sdbc/DriverManager.hpp>
 
@@ -66,7 +67,7 @@ namespace offapp
         }
         catch(const Exception&)
         {
-            OSL_FAIL("ODriverEnumerationImpl::ODriverEnumerationImpl: caught an exception while enumerating the drivers!");
+            TOOLS_WARN_EXCEPTION( "cui.options", "ODriverEnumerationImpl::ODriverEnumerationImpl: caught an exception while enumerating the drivers!");
         }
     }
 
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index 7ad1d22ba2f4..6e0e17b360ef 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -34,6 +34,7 @@
 #include <cppuhelper/interfacecontainer.hxx>
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/typeprovider.hxx>
+#include <tools/diagnose_ex.h>
 #include <apitools.hxx>
 #include <sdbcoretools.hxx>
 #include <stringconstants.hxx>
@@ -374,7 +375,7 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue
                     }
                     catch( const Exception& )
                     {
-                        OSL_FAIL( "OContentHelper::setPropertyValues('Title'): caught an exception while renaming!" );
+                        TOOLS_WARN_EXCEPTION( "dbaccess", "OContentHelper::setPropertyValues('Title'): caught an exception while renaming!" );
                     }
                 }
                 else
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 2bfee3800b3b..2778a616597e 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1282,7 +1282,7 @@ bool ODocumentDefinition::save(bool _bApprove, const css::uno::Reference<css::aw
     }
     catch(const Exception&)
     {
-        OSL_FAIL("ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!");
     }
     return true;
 }
@@ -1376,7 +1376,7 @@ void ODocumentDefinition::saveAs()
     }
     catch(const Exception&)
     {
-        OSL_FAIL("ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!");
     }
 }
 
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 60810ad04308..7c2efad43a33 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -263,7 +263,7 @@ namespace
         }
         catch( const Exception& )
         {
-            OSL_FAIL( "lcl_urlAllowsInteraction: caught an exception while analyzing the URL!" );
+            TOOLS_WARN_EXCEPTION( "dbaccess", "lcl_urlAllowsInteraction: caught an exception while analyzing the URL!" );
         }
         return bDoesAllow;
     }
@@ -518,7 +518,7 @@ IMPL_LINK_NOARG( DBContentLoader, OnStartTableWizard, void*, void )
     }
     catch(const Exception&)
     {
-        OSL_FAIL("caught an exception while starting the table wizard!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "caught an exception while starting the table wizard!");
     }
     m_xMySelf = nullptr;
 }
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index 61800a5ab194..4bf8a063afed 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -1216,7 +1216,7 @@ void ODBExport::GetViewSettings(Sequence<PropertyValue>& aProps)
     }
     catch(const Exception&)
     {
-        OSL_FAIL("ODBExport::GetViewSettings: Exception caught!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "ODBExport::GetViewSettings");
     }
 
 }
diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
index 45f0c6ad2d8c..7b2a8cc54e6b 100644
--- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
+++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx
@@ -29,6 +29,7 @@
 #include <comphelper/propertysequence.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace dbaxml
 {
@@ -81,7 +82,7 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport
     }
     catch(Exception&)
     {
-        OSL_FAIL("OXMLHierarchyCollection::OXMLHierarchyCollection -> exception caught");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "OXMLHierarchyCollection::OXMLHierarchyCollection");
     }
 }
 
diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx
index 6a141eb6aa3f..722e650c3b58 100644
--- a/dbaccess/source/filter/xml/xmlQuery.cxx
+++ b/dbaccess/source/filter/xml/xmlQuery.cxx
@@ -25,6 +25,7 @@
 #include <strings.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace dbaxml
 {
@@ -111,7 +112,7 @@ void OXMLQuery::setProperties(Reference< XPropertySet > & _xProp )
     }
     catch(Exception&)
     {
-        OSL_FAIL("OXMLTable::EndElement -> exception caught");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "OXMLTable::EndElement");
     }
 }
 
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index 697f88a7f607..1af5f8e1955a 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -30,6 +30,7 @@
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <comphelper/propertysequence.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <sal/log.hxx>
 
 namespace dbaxml
@@ -152,7 +153,7 @@ void OXMLTable::setProperties(uno::Reference< XPropertySet > & _xProp )
     }
     catch(Exception&)
     {
-        OSL_FAIL("OXMLTable::EndElement -> exception caught");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "OXMLTable::EndElement -> exception caught");
     }
 }
 
@@ -186,7 +187,7 @@ void OXMLTable::endFastElement(sal_Int32 )
     }
     catch(Exception&)
     {
-        OSL_FAIL("OXMLQuery::EndElement -> exception caught");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "OXMLQuery::EndElement");
     }
 
 }
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 0e52b87baf95..de600099cc7b 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -161,7 +161,7 @@ OAppDetailPageHelper::~OAppDetailPageHelper()
     }
     catch(const Exception&)
     {
-        OSL_FAIL("Exception thrown while disposing preview frame!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "Exception thrown while disposing preview frame!");
     }
 
     for (auto& rpBox : m_aLists)
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index f5c909600f54..65b30505fbfc 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -770,7 +770,7 @@ void SbaGridControl::SetRowHeight()
     }
     catch(Exception&)
     {
-        OSL_FAIL("setPropertyValue: PROPERTY_ROW_HEIGHT throws an exception");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "setPropertyValue: PROPERTY_ROW_HEIGHT throws an exception");
     }
 }
 
diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx
index 73d3b8134f00..32a62da248e7 100644
--- a/dbaccess/source/ui/control/tabletree.cxx
+++ b/dbaccess/source/ui/control/tabletree.cxx
@@ -103,7 +103,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn
     }
     catch(RuntimeException&)
     {
-        OSL_FAIL("OTableTreeListBox::UpdateTableList : caught a RuntimeException!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "OTableTreeListBox::UpdateTableList");
     }
     catch ( const SQLException& )
     {
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 22e17c01ec36..4d12925c2205 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -44,6 +44,7 @@
 #include <i18nlangtag/languagetag.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
 
 using namespace ::svt;
 using namespace ::dbaui;
@@ -375,7 +376,7 @@ void OSelectionBrowseBox::Init()
     }
     catch(const SQLException&)
     {
-        OSL_FAIL("Caught Exception when asking for database metadata options!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "Caught Exception when asking for database metadata options!");
         m_nMaxColumns = 0;
     }
 }
diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx
index 5744f58bdb3e..91518656621b 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -31,6 +31,7 @@
 #include <vcl/commandevent.hxx>
 #include <vcl/event.hxx>
 #include <vcl/ptrstyle.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/container/XContainer.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
@@ -205,7 +206,7 @@ void OTableWindow::FillListBox()
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception occurred!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "");
     }
     try
     {
@@ -236,7 +237,7 @@ void OTableWindow::FillListBox()
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception occurred!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "");
     }
 }
 
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 9423d1a8470c..d18f1cfa8037 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <connectivity/dbtools.hxx>
+#include <tools/diagnose_ex.h>
 #include <helpids.h>
 #include <RelationDesignView.hxx>
 #include <JoinController.hxx>
@@ -208,7 +209,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
         }
         catch(const Exception&)
         {
-            OSL_FAIL("ORelationTableView::AddConnection: Exception occurred!");
+            TOOLS_WARN_EXCEPTION( "dbaccess", "ORelationTableView::AddConnection");
         }
     }
 }
@@ -269,7 +270,7 @@ bool ORelationTableView::RemoveConnection(VclPtr<OTableConnection>& rConn, bool
     }
     catch(Exception&)
     {
-        OSL_FAIL("ORelationTableView::RemoveConnection: Something other than SQLException occurred!");
+        TOOLS_WARN_EXCEPTION( "dbaccess", "ORelationTableView::RemoveConnection: Something other than SQLException occurred!");
     }
     return false;
 }
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index ca2d23fff9a6..0d0f609cf013 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -736,7 +736,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, HandleCancelBtn, weld::Button&, void)
         }
         catch ( const uno::RuntimeException & )
         {
-            OSL_FAIL( "### unexpected RuntimeException!" );
+            TOOLS_WARN_EXCEPTION( "dbaccess", "" );
         }
     }
 }
@@ -1059,7 +1059,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, HandleCancelBtn, weld::Button&, void)
         }
         catch ( const uno::RuntimeException & )
         {
-            OSL_FAIL( "### unexpected RuntimeException!" );
+            TOOLS_WARN_EXCEPTION( "desktop", "" );
         }
     }
 }
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 46561bea798d..92d2afaf0bbb 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -2355,7 +2355,7 @@ namespace accessibility
                 }
                 catch (const uno::Exception&)
                 {
-                    OSL_FAIL("AccessibleEditableTextPara::setAttributes exception in setPropertyValue");
+                    TOOLS_WARN_EXCEPTION( "dbaccess", "AccessibleEditableTextPara::setAttributes exception in setPropertyValue");
                 }
             }
 
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 7d09c85c096a..709b770bec8c 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -762,7 +762,7 @@ namespace editeng
             }
             catch( const Exception& )
             {
-                OSL_FAIL( "HangulHanjaConversion_Impl::implChange: caught unexpected exception!" );
+                TOOLS_WARN_EXCEPTION( "editeng", "HangulHanjaConversion_Impl::implChange: caught unexpected exception!" );
                 aOffsets.realloc(0);
             }
         }
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index ea2a3cb3c110..c62527f84398 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -32,6 +32,7 @@
 #include <comphelper/mimeconfighelper.hxx>
 
 #include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
 
 #include "persistence.hxx"
 
@@ -286,7 +287,7 @@ void OCommonEmbeddedObject::requestPositioning( const awt::Rectangle& aRect )
         }
         catch( const uno::Exception& )
         {
-            OSL_FAIL( "Exception on request to resize!" );
+            TOOLS_WARN_EXCEPTION( "embeddedobj", "Exception on request to resize!" );
         }
     }
 }
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 8ca9eb0327d6..26f17227552e 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -60,6 +60,7 @@
 #include <svx/svdmodel.hxx>
 #include <svx/svdxcgv.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <memory>
 
@@ -669,9 +670,9 @@ bool SVGFilter::implExportWriterOrCalc( const Reference< XOutputStream >& rxOStm
             }
             catch( ... )
             {
+                TOOLS_WARN_EXCEPTION( "filter.svg", "" );
                 delete mpSVGDoc;
                 mpSVGDoc = nullptr;
-                OSL_FAIL( "Exception caught" );
             }
 
             delete mpSVGWriter;
diff --git a/forms/source/component/Button.cxx b/forms/source/component/Button.cxx
index 70f80a6c8c38..42592fa1f76e 100644
--- a/forms/source/component/Button.cxx
+++ b/forms/source/component/Button.cxx
@@ -470,7 +470,7 @@ IMPL_LINK_NOARG(OButtonControl, OnClick, void*, void)
 #endif
                 catch( const Exception& )
                 {
-                    OSL_FAIL( "OButtonControl::OnClick: caught an exception other than RuntimeException!" );
+                    TOOLS_WARN_EXCEPTION( "forms.component", "OButtonControl::OnClick: caught an exception other than RuntimeException!" );
                 }
             }
         }
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 475ca63bec01..f9eaab0b31b5 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -373,7 +373,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<css::io::XObjectInputStream>&
     }
     catch( const Exception& )
     {
-        OSL_FAIL( "OComboBoxModel::read: caught an exception while examining the aggregate's string item list!" );
+        TOOLS_WARN_EXCEPTION( "forms.component", "OComboBoxModel::read: caught an exception while examining the aggregate's string item list!" );
     }
 
     // Version
diff --git a/forms/source/component/Currency.cxx b/forms/source/component/Currency.cxx
index 5c682aa6474c..925e23cde6fa 100644
--- a/forms/source/component/Currency.cxx
+++ b/forms/source/component/Currency.cxx
@@ -23,6 +23,7 @@
 #include <unotools/localedatawrapper.hxx>
 #include <unotools/syslocale.hxx>
 #include <comphelper/types.hxx>
+#include <tools/diagnose_ex.h>
 #include <com/sun/star/form/FormComponentType.hpp>
 
 
@@ -99,7 +100,7 @@ void OCurrencyModel::implConstruct()
     }
     catch(const Exception&)
     {
-        OSL_FAIL( "OCurrencyModel::implConstruct: caught an exception while initializing the aggregate!" );
+        TOOLS_WARN_EXCEPTION( "forms.component", "OCurrencyModel::implConstruct: caught an exception while initializing the aggregate!" );
     }
 }
 
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 3b1f8f6de5f8..41753cc0a121 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -68,10 +68,12 @@
 #include <tools/inetmsg.hxx>
 #include <tools/inetstrm.hxx>
 #include <tools/urlobj.hxx>
+#include <tools/diagnose_ex.h>
 #include <unotools/ucbstreamhelper.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/timer.hxx>
 #include <osl/mutex.hxx>
+#include <tools/diagnose_ex.h>
 
 using namespace ::dbtools;
 using namespace ::comphelper;
@@ -2933,7 +2935,7 @@ void ODatabaseForm::reload_impl(bool bMoveToFirst, const Reference< XInteraction
     }
     catch(const SQLException&)
     {
-        OSL_FAIL("ODatabaseForm::reload_impl : shouldn't executeRowSet catch this exception?");
+        TOOLS_WARN_EXCEPTION( "forms.component", "ODatabaseForm::reload_impl : shouldn't executeRowSet catch this exception?");
     }
 
     if (bSuccess)
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx
index 40241149738d..10b210b7b1bf 100644
--- a/forms/source/component/Grid.cxx
+++ b/forms/source/component/Grid.cxx
@@ -31,6 +31,7 @@
 #include <comphelper/types.hxx>
 #include <vcl/unohelp.hxx>
 #include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
 
 using namespace ::com::sun::star::uno;
 
@@ -155,7 +156,7 @@ void OGridControlModel::cloneColumns( const OGridControlModel* _pOriginalContain
     }
     catch( const Exception& )
     {
-        OSL_FAIL( "OGridControlModel::cloneColumns: caught an exception while cloning the columns!" );
+        TOOLS_WARN_EXCEPTION( "forms.component", "OGridControlModel::cloneColumns: caught an exception while cloning the columns!" );
     }
 }
 
diff --git a/forms/source/component/ImageControl.cxx b/forms/source/component/ImageControl.cxx
index b75080bae4a2..7dec0dfbc92b 100644
--- a/forms/source/component/ImageControl.cxx
+++ b/forms/source/component/ImageControl.cxx
@@ -823,7 +823,7 @@ bool OImageControlControl::implInsertGraphics()
     }
     catch(const Exception&)
     {
-        OSL_FAIL("OImageControlControl::implInsertGraphics: caught an exception while attempting to execute the FilePicker!");
+        TOOLS_WARN_EXCEPTION( "forms.component", "OImageControlControl::implInsertGraphics: caught an exception while attempting to execute the FilePicker!");
     }
     return false;
 }
diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx
index 661f0c480822..f46bbb562545 100644
--- a/forms/source/component/clickableimage.cxx
+++ b/forms/source/component/clickableimage.cxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/util/VetoException.hpp>
 #include <tools/urlobj.hxx>
 #include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
 #include <vcl/graph.hxx>
 #include <vcl/svapp.hxx>
 #include <sfx2/docfile.hxx>
@@ -425,7 +426,7 @@ namespace frm
         catch( const Exception& )
         {
             css::uno::Any anyEx = cppu::getCaughtException();
-            OSL_FAIL( "OClickableImageBaseControl::implSubmit: caught an unknown exception!" );
+            TOOLS_WARN_EXCEPTION( "forms.component", "OClickableImageBaseControl::implSubmit: caught an unknown exception!" );
             throw WrappedTargetException( OUString(), *this, anyEx );
         }
     }
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index 0e23b5a7ec63..e698d29f4051 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -60,6 +60,7 @@
 #include <osl/mutex.hxx>
 #include <sal/log.hxx>
 #include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
 
 
 namespace frm
@@ -1053,7 +1054,7 @@ namespace frm
         }
         catch( const Exception& )
         {
-            OSL_FAIL( "FormOperations::propertyChange: caught an exception while updating the parser!" );
+            TOOLS_WARN_EXCEPTION( "forms.runtime", "FormOperations::propertyChange: caught an exception while updating the parser!" );
         }
         impl_invalidateAllSupportedFeatures_nothrow( aGuard );
     }
@@ -1561,7 +1562,7 @@ namespace frm
             }
             catch( const Exception& )
             {
-                OSL_FAIL( "FormOperations::impl_executeAutoSort_throw: caught an exception while setting the parser properties!" );
+                TOOLS_WARN_EXCEPTION( "forms.runtime", "FormOperations::impl_executeAutoSort_throw: caught an exception while setting the parser properties!" );
             }
 
 
@@ -1635,7 +1636,7 @@ namespace frm
             }
             catch( const Exception& )
             {
-                OSL_FAIL( "FormOperations::impl_executeAutoFilter_throw: caught an exception while setting the parser properties!" );
+                TOOLS_WARN_EXCEPTION( "forms.runtime", "FormOperations::impl_executeAutoFilter_throw: caught an exception while setting the parser properties!" );
             }
 
 
diff --git a/forms/source/xforms/submission/submission_get.cxx b/forms/source/xforms/submission/submission_get.cxx
index 4939497ec7b9..394c8b817486 100644
--- a/forms/source/xforms/submission/submission_get.cxx
+++ b/forms/source/xforms/submission/submission_get.cxx
@@ -26,6 +26,7 @@
 #include <ucbhelper/content.hxx>
 #include <com/sun/star/io/Pipe.hpp>
 #include <com/sun/star/task/InteractionHandler.hpp>
+#include <tools/diagnose_ex.h>
 
 #include <memory>
 
@@ -95,7 +96,7 @@ CSubmission::SubmissionResult CSubmissionGet::submit(const css::uno::Reference<
     } catch (const Exception&)
     {
         // XXX
-        OSL_FAIL("Exception during UCB operatration.");
+        TOOLS_WARN_EXCEPTION( "forms.misc", "Exception during UCB operation.");
         return UNKNOWN_ERROR;
     }
 
diff --git a/forms/source/xforms/submission/submission_post.cxx b/forms/source/xforms/submission/submission_post.cxx
index ab545e7f6799..b945fdd07b63 100644
--- a/forms/source/xforms/submission/submission_post.cxx
+++ b/forms/source/xforms/submission/submission_post.cxx
@@ -26,6 +26,7 @@
 #include <ucbhelper/content.hxx>
 #include <ucbhelper/activedatasink.hxx>
 #include <com/sun/star/ucb/PostCommandArgument2.hpp>
+#include <tools/diagnose_ex.h>
 
 using namespace css::uno;
 using namespace css::ucb;
@@ -68,7 +69,7 @@ CSubmission::SubmissionResult CSubmissionPost::submit(const css::uno::Reference<
         }
     } catch (const Exception&)
     {
-        OSL_FAIL("Exception during UCB operatration.");
+        TOOLS_WARN_EXCEPTION( "forms.misc", "Exception during UCB operation.");
         return UNKNOWN_ERROR;
     }
 
diff --git a/forms/source/xforms/submission/submission_put.cxx b/forms/source/xforms/submission/submission_put.cxx
index 030eb589caa9..f3f94fafa256 100644
--- a/forms/source/xforms/submission/submission_put.cxx
+++ b/forms/source/xforms/submission/submission_put.cxx
@@ -25,6 +25,7 @@
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
 #include <ucbhelper/content.hxx>
+#include <tools/diagnose_ex.h>
 
 using namespace css::uno;
 using namespace css::ucb;
@@ -57,7 +58,7 @@ CSubmission::SubmissionResult CSubmissionPut::submit(const css::uno::Reference<
     }
     catch ( const Exception& )
     {
-        OSL_FAIL( "Exception during UCB operation." );
+        TOOLS_WARN_EXCEPTION( "forms.misc", "Exception during UCB operation." );
         return UNKNOWN_ERROR;
     }
 
diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index 55614f884f7c..99600415f63c 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -29,6 +29,7 @@
 #include <comphelper/processfactory.hxx>
 #include <ucbhelper/commandenvironment.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 
 namespace svt
@@ -148,7 +149,7 @@ namespace svt
             }
             catch( const Exception& )
             {
-                OSL_FAIL( "SmartContent::bindTo: unexpected exception caught!" );
+                TOOLS_WARN_EXCEPTION( "fpicker", "SmartContent::bindTo: unexpected exception caught!" );
             }
         }
         else
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index ad2c377e6e6d..fddbead8a452 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -451,7 +451,7 @@ void GrammarCheckingIterator::ProcessResult(
             }
             catch (lang::IllegalArgumentException &)
             {
-                OSL_FAIL( "commitMultiTextMarkup: IllegalArgumentException exception caught" );
+                TOOLS_WARN_EXCEPTION( "linguistic", "commitMultiTextMarkup" );
             }
         }
 
diff --git a/oox/source/helper/binarystreambase.cxx b/oox/source/helper/binarystreambase.cxx
index 5da64a84eb1f..a75832fa475f 100644
--- a/oox/source/helper/binarystreambase.cxx
+++ b/oox/source/helper/binarystreambase.cxx
@@ -22,6 +22,7 @@
 
 #include <com/sun/star/io/XSeekable.hpp>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 namespace oox {
 
@@ -72,7 +73,7 @@ sal_Int64 BinaryXSeekableStream::size() const
     }
     catch( Exception& )
     {
-        OSL_FAIL( "BinaryXSeekableStream::size - exception caught" );
+        TOOLS_WARN_EXCEPTION( "oox", "BinaryXSeekableStream::size" );
     }
     return -1;
 }
@@ -85,7 +86,7 @@ sal_Int64 BinaryXSeekableStream::tell() const
     }
     catch( Exception& )
     {
-        OSL_FAIL( "BinaryXSeekableStream::tell - exception caught" );
+        TOOLS_WARN_EXCEPTION( "oox", "BinaryXSeekableStream::tell" );
     }
     return -1;
 }
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index e65959634161..b3b8031d8a84 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -26,6 +26,7 @@
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
 #include <tools/color.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <oox/helper/propertymap.hxx>
 #include <oox/token/namespaces.hxx>
@@ -90,7 +91,7 @@ namespace oox::ppt {
         catch( Exception& )
         {
             // should not happen
-            OSL_FAIL( "exception raised" );
+            TOOLS_WARN_EXCEPTION( "oox", "" );
         }
     }
 
@@ -107,7 +108,7 @@ namespace oox::ppt {
         catch( Exception& )
         {
             // should not happen
-            OSL_FAIL( "exception raised" );
+            TOOLS_WARN_EXCEPTION( "oox", "" );
         }
     }
 
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 1c055dcc2905..962d206ed1cb 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -909,12 +909,12 @@ uno::Reference< io::XInputStream > ZipPackageStream::getRawData()
     }
     catch ( ZipException & )//rException )
     {
-        OSL_FAIL( "ZipException thrown" );//rException.Message);
+        TOOLS_WARN_EXCEPTION( "package", "" );
         return uno::Reference < io::XInputStream > ();
     }
     catch ( Exception & )
     {
-        OSL_FAIL( "Exception is thrown during stream wrapping!" );
+        TOOLS_WARN_EXCEPTION( "package", "Exception is thrown during stream wrapping!" );
         return uno::Reference < io::XInputStream > ();
     }
 }
@@ -936,7 +936,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream()
     }
     catch ( ZipException & )//rException )
     {
-        OSL_FAIL( "ZipException thrown" );//rException.Message);
+        TOOLS_WARN_EXCEPTION( "package", "" );
         return uno::Reference < io::XInputStream > ();
     }
     catch ( const Exception & )
diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx
index 984bf7d26305..42082bfc3e95 100644
--- a/reportdesign/source/core/api/FixedLine.cxx
+++ b/reportdesign/source/core/api/FixedLine.cxx
@@ -21,6 +21,7 @@
 #include <strings.hrc>
 #include <core_resource.hxx>
 #include <cppuhelper/supportsservice.hxx>
+#include <tools/diagnose_ex.h>
 #include <Tools.hxx>
 #include <FormatCondition.hxx>
 #include <ReportHelperImpl.hxx>
@@ -171,7 +172,7 @@ OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContex
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("OFixedLine::OFixedLine: Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "OFixedLine::OFixedLine");
     }
     osl_atomic_decrement( &m_refCount );
 }
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 981c42bdf00b..4ae9e44be52b 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1069,7 +1069,7 @@ void SAL_CALL OReportDefinition::close(sal_Bool bDeliverOwnership)
             catch (const util::CloseVetoException&) { throw; }
             catch (const uno::Exception&)
             {
-                OSL_FAIL( "ODatabaseDocument::impl_closeControllerFrames: caught an unexpected exception!" );
+                TOOLS_WARN_EXCEPTION( "reportdesign", "ODatabaseDocument::impl_closeControllerFrames" );
             }
         }
     }
@@ -1374,7 +1374,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS
         }
         catch (const uno::Exception&)
         {
-            OSL_FAIL("Exception Caught: Could not commit report storage!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Could not commit report storage!");
             throw io::IOException();
         }
 
diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx
index bf652d01f343..0450e2d342ba 100644
--- a/reportdesign/source/core/sdr/PropertyForward.cxx
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -137,7 +137,7 @@ void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
     m_bInChange = false;
 }
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 0486c787fc2f..b83f742676c6 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -374,7 +374,7 @@ void OObjectBase::EndListening()
             }
             catch(const uno::Exception &)
             {
-                OSL_FAIL("OObjectBase::EndListening: Exception caught!");
+                TOOLS_WARN_EXCEPTION( "package", "OObjectBase::EndListening");
             }
         }
         m_xPropertyChangeListener.clear();
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx
index a118970e106b..1ce789210df1 100644
--- a/reportdesign/source/filter/xml/xmlCell.cxx
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <strings.hxx>
 #include "xmlTable.hxx"
 #include "xmlFormattedField.hxx"
@@ -232,7 +233,7 @@ void OXMLCell::endFastElement(sal_Int32)
                }
             catch(uno::Exception&)
             {
-                OSL_FAIL("OXMLCell::EndElement -> exception caught");
+                TOOLS_WARN_EXCEPTION( "reportdesign", "OXMLCell::EndElement -> exception caught");
             }
         }
     }
diff --git a/reportdesign/source/filter/xml/xmlComponent.cxx b/reportdesign/source/filter/xml/xmlComponent.cxx
index c6433d2a87ed..ab55e9215bf3 100644
--- a/reportdesign/source/filter/xml/xmlComponent.cxx
+++ b/reportdesign/source/filter/xml/xmlComponent.cxx
@@ -22,6 +22,7 @@
 #include <xmloff/xmlnamespace.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -56,7 +57,7 @@ OXMLComponent::OXMLComponent( ORptFilter& _rImport
         }
         catch(const Exception&)
         {
-            OSL_FAIL("Exception caught while putting props into report component!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while putting props into report component!");
         }
     }
 }
diff --git a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
index 5ffd0284e520..35167e338095 100644
--- a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
+++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
@@ -23,6 +23,7 @@
 #include <strings.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -58,7 +59,7 @@ OXMLCondPrtExpr::OXMLCondPrtExpr( ORptFilter& _rImport
     }
     catch(const Exception&)
     {
-        OSL_FAIL("Exception caught while putting Function props!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while putting Function props!");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlFormatCondition.cxx b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
index ca381b22760b..235f6931778f 100644
--- a/reportdesign/source/filter/xml/xmlFormatCondition.cxx
+++ b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
@@ -23,6 +23,7 @@
 #include "xmlHelper.hxx"
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -67,7 +68,7 @@ OXMLFormatCondition::OXMLFormatCondition( ORptFilter& rImport,
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the report definition props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the report definition props");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlFormattedField.cxx b/reportdesign/source/filter/xml/xmlFormattedField.cxx
index 4c419844e756..c34f8adf2414 100644
--- a/reportdesign/source/filter/xml/xmlFormattedField.cxx
+++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx
@@ -22,6 +22,7 @@
 #include <xmloff/xmlnamespace.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 
 namespace rptxml
@@ -64,7 +65,7 @@ OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the report definition props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the report definition props");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlFunction.cxx b/reportdesign/source/filter/xml/xmlFunction.cxx
index 1c26aa4dd27c..62dcaa9256f7 100644
--- a/reportdesign/source/filter/xml/xmlFunction.cxx
+++ b/reportdesign/source/filter/xml/xmlFunction.cxx
@@ -22,6 +22,7 @@
 #include <xmloff/xmlnamespace.hxx>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -76,7 +77,7 @@ OXMLFunction::OXMLFunction( ORptFilter& _rImport
         }
         catch(const Exception&)
         {
-            OSL_FAIL("Exception caught while putting Function props!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while putting Function props!");
         }
     }
 }
@@ -106,7 +107,7 @@ void OXMLFunction::endFastElement(sal_Int32 )
             m_xFunction.clear();
         }catch(uno::Exception&)
         {
-            OSL_FAIL("Exception caught!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "");
         }
     }
 }
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index be7fc44e4d5d..94f6028494ce 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -30,6 +30,7 @@
 #include <com/sun/star/report/KeepTogether.hpp>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -164,7 +165,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
         }
         catch(const Exception&)
         {
-            OSL_FAIL("Exception caught while putting group props!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while putting group props!");
         }
     }
 }
@@ -236,7 +237,7 @@ void OXMLGroup::endFastElement(sal_Int32 )
         m_xGroups->insertByIndex(0,uno::makeAny(m_xGroup));
     }catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx
index 68ba54601959..e26f30be6492 100644
--- a/reportdesign/source/filter/xml/xmlHelper.cxx
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -44,6 +44,7 @@
 #include <com/sun/star/style/VerticalAlignment.hpp>
 #include <xmloff/EnumPropertyHdl.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 #define XML_RPT_ALIGNMENT   (XML_DB_TYPES_START+1)
 namespace rptxml
@@ -309,7 +310,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const OUString& _sStyleName,
        }
     catch(uno::Exception&)
     {
-        OSL_FAIL("OXMLHelper::copyStyleElements -> exception caught");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "OXMLHelper::copyStyleElements");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlImage.cxx b/reportdesign/source/filter/xml/xmlImage.cxx
index fe4d9395232f..9f27b6151e82 100644
--- a/reportdesign/source/filter/xml/xmlImage.cxx
+++ b/reportdesign/source/filter/xml/xmlImage.cxx
@@ -25,6 +25,7 @@
 #include <unotools/pathoptions.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/awt/ImageScaleMode.hpp>
 
@@ -90,7 +91,7 @@ OXMLImage::OXMLImage( ORptFilter& rImport,
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the image props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the image props");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 4012f2632dc7..81ff22b0b26a 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -35,6 +35,7 @@
 #include <xmloff/xmluconv.hxx>
 #include <xmloff/xmltkmap.hxx>
 #include <xmloff/xmlnamespace.hxx>
+#include <tools/diagnose_ex.h>
 
 #include "xmlHelper.hxx"
 #include "xmlEnums.hxx"
@@ -229,7 +230,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
         }
         catch(uno::Exception&)
         {
-            OSL_FAIL("Exception caught while filling the report definition props");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the report definition props");
         }
         bExport = false;
     }
diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx
index a60b42133f69..a559946fc848 100644
--- a/reportdesign/source/filter/xml/xmlReport.cxx
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -94,7 +94,7 @@ OXMLReport::OXMLReport( ORptFilter& rImport,
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the report definition props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the report definition props");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlReportElement.cxx b/reportdesign/source/filter/xml/xmlReportElement.cxx
index 14e3958d3c94..0c49c9fb47e3 100644
--- a/reportdesign/source/filter/xml/xmlReportElement.cxx
+++ b/reportdesign/source/filter/xml/xmlReportElement.cxx
@@ -27,6 +27,7 @@
 #include "xmlFormatCondition.hxx"
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -67,7 +68,7 @@ OXMLReportElement::OXMLReportElement( ORptFilter& rImport,
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the report definition props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the report definition props");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlReportElementBase.cxx b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
index 532cac436429..590af5a2f687 100644
--- a/reportdesign/source/filter/xml/xmlReportElementBase.cxx
+++ b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
@@ -25,6 +25,7 @@
 #include "xmlEnums.hxx"
 #include "xmlTable.hxx"
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 namespace rptxml
 {
@@ -86,7 +87,7 @@ void OXMLReportElementBase::endFastElement(sal_Int32 )
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while inserting a new control!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while inserting a new control!");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx
index 5e1c47e1869c..6e1954ab0456 100644
--- a/reportdesign/source/filter/xml/xmlSection.cxx
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -26,6 +26,7 @@
 #include "xmlTable.hxx"
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 
 namespace rptxml
@@ -79,7 +80,7 @@ OXMLSection::OXMLSection( ORptFilter& rImport,
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the section props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the section props");
     }
 }
 
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index 55c44df062c2..2c3bc48cbdda 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -36,6 +36,7 @@
 #include <com/sun/star/report/XFixedLine.hpp>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <numeric>
 
@@ -106,7 +107,7 @@ OXMLTable::OXMLTable( ORptFilter& rImport
     }
     catch(Exception&)
     {
-        OSL_FAIL("Exception caught while filling the section props");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while filling the section props");
     }
 }
 
@@ -251,7 +252,7 @@ void OXMLTable::endFastElement(sal_Int32 )
     }
     catch(Exception&)
     {
-        OSL_FAIL("OXMLTable::EndElement -> exception caught");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "OXMLTable::EndElement");
     }
 }
 
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 2aca2085fad5..42ed619445e2 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -38,6 +38,7 @@
 #include <cppuhelper/implbase.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <algorithm>
 
@@ -476,7 +477,7 @@ bool OFieldExpressionControl::SaveModified()
         }
         catch(uno::Exception&)
         {
-            OSL_FAIL("OFieldExpressionControl::SaveModified: Exception caught!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "OFieldExpressionControl::SaveModified");
         }
     }
 
@@ -501,7 +502,7 @@ OUString OFieldExpressionControl::GetCellText( sal_Int32 nRow, sal_uInt16 /*nCol
         }
         catch (const uno::Exception&)
         {
-            OSL_FAIL("Exception caught while getting expression value from the group");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while getting expression value from the group");
         }
     }
     return sText;
@@ -573,7 +574,7 @@ EditBrowseBox::RowStatus OFieldExpressionControl::GetRowStatus(sal_Int32 nRow) c
         }
         catch(uno::Exception&)
         {
-            OSL_FAIL("Exception caught while try to get a group!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while try to get a group!");
         }
     }
     return EditBrowseBox::CLEAN;
@@ -921,7 +922,7 @@ sal_Int32 OGroupsSortingDialog::getColumnDataType(const OUString& _sColumnName)
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught while getting the type of a column");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while getting the type of a column");
     }
 
     return nDataType;
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 92c53478df73..9f22c4e5ae35 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -43,6 +43,7 @@
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <metadata.hxx>
 #include <osl/mutex.hxx>
+#include <tools/diagnose_ex.h>
 #include <core_resource.hxx>
 #include <helpids.h>
 #include <strings.hrc>
@@ -287,7 +288,7 @@ uno::Any SAL_CALL DataProviderHandler::convertToPropertyValue(const OUString & _
             }
             catch( const uno::Exception& )
             {
-                OSL_FAIL( "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
+                TOOLS_WARN_EXCEPTION( "reportdesign", "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
             }
             break;
         case PROPERTY_ID_MASTERFIELDS:
@@ -321,7 +322,7 @@ uno::Any SAL_CALL DataProviderHandler::convertToControlValue(const OUString & _r
             }
             catch( const uno::Exception& )
             {
-                OSL_FAIL( "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
+                TOOLS_WARN_EXCEPTION( "reportdesign", "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
             }
             break;
         default:
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 079812ccb1c9..b5b78e02f74e 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -987,7 +987,7 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const OUString & Prope
                     }
                     catch( const uno::Exception& )
                     {
-                        OSL_FAIL( "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
+                        TOOLS_WARN_EXCEPTION( "reportdesign", "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
                     }
                 }
             }
@@ -1160,7 +1160,7 @@ uno::Any SAL_CALL GeometryHandler::convertToControlValue(const OUString & Proper
                 }
                 catch( const uno::Exception& )
                 {
-                    OSL_FAIL( "GeometryHandler::convertToControlValue: caught an exception while converting via TypeConverter!" );
+                    TOOLS_WARN_EXCEPTION( "reportdesign", "GeometryHandler::convertToControlValue: caught an exception while converting via TypeConverter!" );
                 }
             }
             break;
@@ -1687,7 +1687,7 @@ void GeometryHandler::impl_fillMimeTypes_nothrow(::std::vector< OUString >& _out
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
 }
 
@@ -1718,7 +1718,7 @@ void GeometryHandler::impl_fillScopeList_nothrow(::std::vector< OUString >& _out
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
 }
 
@@ -1832,7 +1832,7 @@ bool GeometryHandler::isDefaultFunction( const OUString& _sQuotedFunction
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
     return bDefaultFunction;
 }
@@ -1871,7 +1871,7 @@ bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference< repo
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
     return bDefaultFunction;
 }
@@ -1956,7 +1956,7 @@ void GeometryHandler::createDefaultFunction(::osl::ResettableMutexGuard& _aGuard
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
 }
 
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx
index c9cfbbd4ba72..d5265a514bfb 100644
--- a/reportdesign/source/ui/misc/FunctionHelper.cxx
+++ b/reportdesign/source/ui/misc/FunctionHelper.cxx
@@ -21,6 +21,7 @@
 
 #include <o3tl/safeint.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <formula/funcvarargs.h>
 
 
@@ -167,7 +168,7 @@ OUString FunctionDescription::getFormula(const ::std::vector< OUString >& _aArgu
     }
     catch(const uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
     return sFormula;
 }
diff --git a/reportdesign/source/ui/misc/RptUndo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx
index bb319b668377..be280a8368f2 100644
--- a/reportdesign/source/ui/misc/RptUndo.cxx
+++ b/reportdesign/source/ui/misc/RptUndo.cxx
@@ -85,7 +85,7 @@ namespace
             }
             catch(const uno::Exception&)
             {
-                OSL_FAIL("lcl_insertElements:Exception caught!");
+                TOOLS_WARN_EXCEPTION( "reportdesign", "lcl_insertElements");
             }
         }
     }
@@ -103,7 +103,7 @@ namespace
             }
             catch(const uno::Exception&)
             {
-                OSL_FAIL("lcl_setValues:Exception caught!");
+                TOOLS_WARN_EXCEPTION( "reportdesign", "lcl_setValues");
             }
         }
     }
@@ -143,7 +143,7 @@ OSectionUndo::~OSectionUndo()
         }
         catch(const uno::Exception &)
         {
-            OSL_FAIL("Exception caught!");
+            TOOLS_WARN_EXCEPTION( "reportdesign", "");
         }
     }
 }
@@ -334,7 +334,7 @@ void OGroupUndo::implReInsert( )
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught while undoing remove group");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while undoing remove group");
     }
 }
 
@@ -346,7 +346,7 @@ void OGroupUndo::implReRemove( )
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught while redoing remove group");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while redoing remove group");
     }
 }
 
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index cae05f329d5a..53d6fb125813 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -309,7 +309,7 @@ void OReportController::disposing()
     }
     catch(const uno::Exception&)
     {
-        OSL_FAIL("Exception caught while disposing row sets.");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while disposing row sets.");
     }
     m_xRowSet.clear();
     m_xRowSetMediator.clear();
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 9eb402e841e3..ace815efbf9b 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -91,7 +91,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("Exception caught!");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "");
     }
 
     m_pFunc.reset(new DlgEdFuncSelect( this ));
@@ -274,7 +274,7 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC
             }
             catch(uno::Exception&)
             {
-                OSL_FAIL("Exception caught while pasting a new object!");
+                TOOLS_WARN_EXCEPTION( "reportdesign", "Exception caught while pasting a new object!");
             }
             if ( !_bForce )
                 break;
@@ -541,7 +541,7 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
     }
     catch(const uno::Exception &)
     {
-        OSL_FAIL("Exception caught: OReportSection::impl_adjustObjectSizePosition()");
+        TOOLS_WARN_EXCEPTION( "reportdesign", "OReportSection::impl_adjustObjectSizePosition()");
     }
 }
 
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
index fe4c7df47f0b..84656ded767f 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -235,7 +235,7 @@ OUString PropBrw::getCurrentPage() const
     }
     catch( const Exception& )
     {
-        OSL_FAIL( "PropBrw::getCurrentPage: caught an exception while retrieving the current page!" );
+        TOOLS_WARN_EXCEPTION( "reportdesign", "PropBrw::getCurrentPage: caught an exception while retrieving the current page!" );
     }
     return sCurrentPage;
 }
@@ -255,7 +255,7 @@ bool PropBrw::Close()
         }
         catch( const Exception& )
         {
-            OSL_FAIL( "FmPropBrw::Close: caught an exception while asking the controller!" );
+            TOOLS_WARN_EXCEPTION( "reportdesign", "FmPropBrw::Close: caught an exception while asking the controller!" );
         }
     }
     implDetachController();
@@ -310,7 +310,7 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface>
         }
         catch( const Exception& )
         {
-            OSL_FAIL( "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
+            TOOLS_WARN_EXCEPTION( "reportdesign", "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
         }
     }
     SetText( GetHeadlineName(_aObjects) );
@@ -446,7 +446,7 @@ void PropBrw::Update( OSectionView* pNewView )
                 }
                 catch( const Exception& )
                 {
-                    OSL_FAIL( "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
+                    TOOLS_WARN_EXCEPTION( "reportdesign", "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
                 }
             }
         }
@@ -489,7 +489,7 @@ void PropBrw::Update( OSectionView* pNewView )
     }
     catch ( Exception& )
     {
-        OSL_FAIL( "PropBrw::Update: Exception occurred!" );
+        TOOLS_WARN_EXCEPTION( "reportdesign", "PropBrw::Update" );
     }
 }
 
@@ -512,7 +512,7 @@ void PropBrw::Update( const uno::Reference< uno::XInterface>& _xReportComponent)
     }
     catch ( Exception& )
     {
-        OSL_FAIL( "PropBrw::Update: Exception occurred!" );
+        TOOLS_WARN_EXCEPTION( "reportdesign", "PropBrw::Update: Exception occurred!" );
     }
 }
 
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 74a99790422a..31ec67dcddd7 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -772,7 +772,7 @@ void ScDPObject::CreateObjects()
             }
             catch(uno::Exception&)
             {
-                OSL_FAIL("exception in refresh");
+                TOOLS_WARN_EXCEPTION( "sc", "exception in refresh");
             }
         }
 
@@ -3266,7 +3266,7 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet(
     }
     catch ( uno::Exception& )
     {
-        OSL_FAIL("Unexpected exception in database");
+        TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database");
     }
 
     xRowSet.set(nullptr);
diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx
index 04f587d4df5e..554d59d7adab 100644
--- a/sc/source/core/data/globalx.cxx
+++ b/sc/source/core/data/globalx.cxx
@@ -22,6 +22,7 @@
 #include <osl/diagnose.h>
 #include <osl/file.hxx>
 #include <tools/urlobj.hxx>
+#include <tools/diagnose_ex.h>
 #include <ucbhelper/content.hxx>
 
 #include <unotools/pathoptions.hxx>
@@ -100,13 +101,13 @@ void ScGlobal::InitAddIns()
                 }
                 catch ( Exception& )
                 {
-                    OSL_FAIL( "ResultSetException caught!" );
+                    TOOLS_WARN_EXCEPTION( "sc", "" );
                 }
             }
         }
         catch ( Exception& )
         {
-            OSL_FAIL( "Exception caught!" );
+            TOOLS_WARN_EXCEPTION( "sc", "" );
         }
         catch ( ... )
         {
@@ -133,7 +134,7 @@ OUString ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)
     }
     catch ( Exception& )
     {
-        OSL_FAIL( "GetOrdinalSuffix: exception caught during init" );
+        TOOLS_WARN_EXCEPTION( "sc", "GetOrdinalSuffix: exception caught during init" );
     }
     return OUString();
 }
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index 54ace0282c44..aeb3c53bdc80 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -28,6 +28,7 @@
 #include <svx/svdoole2.hxx>
 #include <svx/svdpage.hxx>
 #include <svtools/embedhlp.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
@@ -271,7 +272,7 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument
     }
     catch (const uno::Exception&)
     {
-        OSL_FAIL("Exception in ScChartHelper::SetChartRanges - invalid range string?");
+        TOOLS_WARN_EXCEPTION( "sc", "Exception in ScChartHelper::SetChartRanges - invalid range string?");
     }
 
     xChartDoc->unlockControllers();
diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx
index f1ecef38df5e..b001697ec72f 100644
--- a/sc/source/core/tool/chartlock.cxx
+++ b/sc/source/core/tool/chartlock.cxx
@@ -21,6 +21,7 @@
 #include <svx/svditer.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/svdpage.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <chartlock.hxx>
 #include <document.hxx>
@@ -93,7 +94,7 @@ ScChartLockGuard::ScChartLockGuard( ScDocument* pDoc ) :
         }
         catch ( uno::Exception& )
         {
-            OSL_FAIL("Unexpected exception in ScChartLockGuard");
+            TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in ScChartLockGuard");
         }
     }
 }
@@ -110,7 +111,7 @@ ScChartLockGuard::~ScChartLockGuard()
         }
         catch ( uno::Exception& )
         {
-            OSL_FAIL("Unexpected exception in ScChartLockGuard");
+            TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in ScChartLockGuard");
         }
     }
 }
@@ -134,7 +135,7 @@ void ScChartLockGuard::AlsoLockThisChart( const Reference< frame::XModel >& xMod
         }
         catch ( uno::Exception& )
         {
-            OSL_FAIL("Unexpected exception in ScChartLockGuard");
+            TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in ScChartLockGuard");
         }
     }
 }
diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx
index 6469f8da70be..46d8075197db 100644
--- a/sc/source/filter/oox/pivottablebuffer.cxx
+++ b/sc/source/filter/oox/pivottablebuffer.cxx
@@ -39,6 +39,7 @@
 #include <com/sun/star/sheet/XSheetOperation.hpp>
 #include <com/sun/star/xml/sax/XFastAttributeList.hpp>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <sal/log.hxx>
 #include <oox/helper/binaryinputstream.hxx>
 #include <oox/helper/attributelist.hxx>
@@ -1313,7 +1314,7 @@ void PivotTable::finalizeImport()
     }
     catch( Exception& )
     {
-        OSL_FAIL( "PivotTable::finalizeImport - exception while creating the DataPilot table" );
+        TOOLS_WARN_EXCEPTION( "sc", "PivotTable::finalizeImport - exception while creating the DataPilot table" );
     }
 }
 
diff --git a/sc/source/ui/dataprovider/sqldataprovider.cxx b/sc/source/ui/dataprovider/sqldataprovider.cxx
index 3267822b0b93..7bf10b023fcd 100644
--- a/sc/source/ui/dataprovider/sqldataprovider.cxx
+++ b/sc/source/ui/dataprovider/sqldataprovider.cxx
@@ -22,6 +22,7 @@
 #include <vcl/svapp.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 using namespace css;
 using namespace ::com::sun::star::beans;
@@ -110,7 +111,7 @@ void SQLFetchThread::execute()
     }
     catch (uno::Exception&)
     {
-        OSL_FAIL("exception in database");
+        TOOLS_WARN_EXCEPTION("sc", "exception in database");
     }
 
     for (auto& itr : maDataTransformations)
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 75e895f25a5f..6775ac8f9bdb 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -21,6 +21,7 @@
 
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/sheet/DataImportMode.hpp>
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
@@ -62,7 +63,7 @@ ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg(weld::Window* pParent)
     }
     catch(uno::Exception&)
     {
-        OSL_FAIL("exception in database");
+        TOOLS_WARN_EXCEPTION( "sc", "exception in database");
     }
 
     m_xLbDatabase->set_active(0);
@@ -163,7 +164,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
     catch(uno::Exception&)
     {
         //  this may happen if an invalid database is selected -> no DBG_ERROR
-        OSL_FAIL("exception in database");
+        TOOLS_WARN_EXCEPTION( "sc", "exception in database");
     }
 }
 
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index edc242b8ccc5..2baf0d901ee3 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -26,6 +26,7 @@
 #include <sfx2/viewfrm.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/sdb/CommandType.hpp>
 #include <com/sun/star/sdb/XCompletedExecution.hpp>
@@ -366,7 +367,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
     }
     catch ( uno::Exception& )
     {
-        OSL_FAIL("Unexpected exception in database");
+        TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database");
     }
 
     //  test for cell protection
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 91020db0b2e0..5a9915580725 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -65,6 +65,7 @@
 #include <com/sun/star/util/VetoException.hpp>
 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
 #include <ooo/vba/excel/XWorkbook.hpp>
+#include <tools/diagnose_ex.h>
 
 #include <config_folders.h>
 
@@ -956,7 +957,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                             }
                             catch ( uno::Exception& )
                             {
-                                OSL_FAIL( "SfxEventHintId::SaveDoc: caught exception" );
+                                TOOLS_WARN_EXCEPTION( "sc", "SfxEventHintId::SaveDoc" );
                                 SC_MOD()->SetInSharedDocSaving( false );
 
                                 try
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 111fb8262234..65e1337c3fa3 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -56,6 +56,7 @@ using namespace ::com::sun::star;
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <sal/log.hxx>
 #include <unotools/charclass.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
@@ -1122,7 +1123,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                             }
                             catch ( uno::Exception& )
                             {
-                                OSL_FAIL( "SID_SHARE_DOC: caught exception" );
+                                TOOLS_WARN_EXCEPTION( "sc", "SID_SHARE_DOC" );
                                 SC_MOD()->SetInSharedDocSaving( false );
 
                                 try
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index cb2f0586e5ab..395c02a383c7 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -214,7 +214,7 @@ bool ScDocShell::IsDocument( const INetURLObject& rURL )
     catch( uno::Exception& )
     {
         // ucb may throw different exceptions on failure now - warning only
-        OSL_FAIL( "Any other exception" );
+        TOOLS_WARN_EXCEPTION( "sc", "Any other exception" );
     }
 
     return bRet;
@@ -428,7 +428,7 @@ ErrCode ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding
     }
     catch ( uno::Exception& )
     {
-        OSL_FAIL("Unexpected exception in database");
+        TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database");
         nErr = ERRCODE_IO_GENERAL;
     }
 
@@ -1072,7 +1072,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding
     }
     catch ( uno::Exception& )
     {
-        OSL_FAIL("Unexpected exception in database");
+        TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database");
         nErr = ERRCODE_IO_GENERAL;
     }
 
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 432bc6234488..9f1a6e16185b 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -22,6 +22,7 @@
 #include <sfx2/dialoghelper.hxx>
 #include <svl/sharecontrolfile.hxx>
 #include <unotools/useroptions.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <docsh.hxx>
 
@@ -159,7 +160,7 @@ void ScShareDocumentDlg::UpdateView()
         }
         catch ( uno::Exception& )
         {
-            OSL_FAIL( "ScShareDocumentDlg::UpdateView(): caught exception" );
+            TOOLS_WARN_EXCEPTION( "sc", "ScShareDocumentDlg::UpdateView()" );
             m_xLbUsers->clear();
             m_xLbUsers->append_text(m_aStrNoUserData);
         }
diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx
index e8591c1732b2..39e17f79ca55 100644
--- a/sc/source/ui/unoobj/celllistsource.cxx
+++ b/sc/source/ui/unoobj/celllistsource.cxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <cppuhelper/supportsservice.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace calc
 {
@@ -327,7 +328,7 @@ namespace calc
             }
             catch( const Exception& )
             {
-                OSL_FAIL( "OCellListSource::notifyModified: caught a (non-runtime) exception!" );
+                TOOLS_WARN_EXCEPTION( "sc", "OCellListSource::notifyModified: caught a (non-runtime) exception!" );
             }
         }
 
@@ -399,7 +400,7 @@ namespace calc
         }
         catch( const Exception& )
         {
-            OSL_FAIL( "OCellListSource::initialize: caught an exception while retrieving the cell object!" );
+            TOOLS_WARN_EXCEPTION( "sc", "OCellListSource::initialize: caught an exception while retrieving the cell object!" );
         }
 
         if ( !m_xRange.is() )
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list