[Libreoffice-commits] core.git: connectivity/source cui/source dbaccess/source desktop/source filter/source forms/source fpicker/source oox/source sfx2/source svl/source svtools/source svx/source sw/source ucb/source unotools/source vcl/source writerfilter/source xmloff/source

Noel (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 3 06:14:13 UTC 2020


 connectivity/source/drivers/dbase/DTable.cxx            |    3 +-
 connectivity/source/drivers/file/FResultSet.cxx         |    3 +-
 connectivity/source/drivers/hsqldb/HStorageMap.cxx      |    3 +-
 cui/source/customize/cfg.cxx                            |    2 -
 cui/source/dialogs/AdditionsDialog.cxx                  |   17 ++++++++--------
 cui/source/dialogs/insdlg.cxx                           |    3 +-
 dbaccess/source/core/api/CacheSet.cxx                   |    3 +-
 dbaccess/source/core/api/RowSetBase.cxx                 |    3 +-
 desktop/source/lib/init.cxx                             |    4 +--
 filter/source/pdf/pdfexport.cxx                         |    6 ++---
 forms/source/component/FormComponent.cxx                |    3 --
 fpicker/source/office/contentenumeration.cxx            |    2 -
 oox/source/drawingml/textparagraphpropertiescontext.cxx |    5 ++--
 oox/source/ppt/timenodelistcontext.cxx                  |    3 +-
 sfx2/source/config/evntconf.cxx                         |    5 ++--
 sfx2/source/doc/SfxRedactionHelper.cxx                  |    3 +-
 sfx2/source/doc/doctemplates.cxx                        |    6 ++---
 sfx2/source/doc/objserv.cxx                             |    4 +--
 svl/source/config/itemholder2.cxx                       |    3 --
 svtools/source/misc/templatefoldercache.cxx             |    2 -
 svx/source/table/tablecontroller.cxx                    |    3 +-
 sw/source/core/unocore/unotext.cxx                      |   11 ++++------
 ucb/source/core/ucb.cxx                                 |    5 ++--
 ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx       |    3 +-
 ucb/source/ucp/webdav/webdavdatasupplier.cxx            |    3 +-
 unotools/source/config/itemholder1.cxx                  |    3 --
 vcl/source/gdi/print3.cxx                               |    3 +-
 writerfilter/source/dmapper/GraphicHelpers.cxx          |    3 +-
 xmloff/source/chart/SchXMLChartContext.cxx              |    8 +++----
 xmloff/source/text/txtvfldi.cxx                         |    5 ++--
 30 files changed, 72 insertions(+), 58 deletions(-)

New commits:
commit 547b1d054162a73d49a828bed140ab8671da2ff8
Author:     Noel <noelgrandin at gmail.com>
AuthorDate: Fri Oct 2 16:27:46 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 3 08:13:29 2020 +0200

    use more TOOLS_WARN_EXCEPTION
    
    Change-Id: I8b5cde993c13e0b7c8c830b1ff698933a6b7cfd0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103863
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index e9be4d578ed2..f4d671911739 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -28,6 +28,7 @@
 #include <dbase/DConnection.hxx>
 #include <dbase/DColumns.hxx>
 #include <tools/config.hxx>
+#include <tools/diagnose_ex.h>
 #include <dbase/DIndex.hxx>
 #include <dbase/DIndexes.hxx>
 #include <comphelper/processfactory.hxx>
@@ -2241,7 +2242,7 @@ void ODbaseTable::alterColumn(sal_Int32 index,
     }
     catch(const Exception&)
     {
-        SAL_WARN( "connectivity.drivers","ODbaseTable::alterColumn: Exception occurred!");
+        TOOLS_WARN_EXCEPTION( "connectivity.drivers","");
         throw;
     }
 }
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index d7f3d6bd2090..5cf5d1ae862d 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -41,6 +41,7 @@
 #include <comphelper/types.hxx>
 #include <resource/sharedresources.hxx>
 #include <strings.hrc>
+#include <tools/diagnose_ex.h>
 
 using namespace ::comphelper;
 using namespace connectivity;
@@ -1468,7 +1469,7 @@ void OResultSet::setBoundedColumns(const OValueRefRow& _rRow,
         }
         catch (Exception&)
         {
-            SAL_WARN( "connectivity.drivers","OResultSet::setBoundedColumns: caught an Exception!");
+            TOOLS_WARN_EXCEPTION( "connectivity.drivers","");
         }
     }
     // in this case we got more select columns as columns exist in the table
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index d10ee29a69f6..ade3133bd536 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -27,6 +27,7 @@
 #include <sal/log.hxx>
 #include <uno/mapping.hxx>
 #include <algorithm>
+#include <tools/diagnose_ex.h>
 
 namespace connectivity::hsqldb
 {
@@ -308,7 +309,7 @@ namespace connectivity::hsqldb
                         }
                         catch(const Exception& e)
                         {
-                            SAL_WARN( "connectivity.hsqldb", "[HSQLDB-SDBC] caught an exception while opening a stream\n"
+                            TOOLS_WARN_EXCEPTION( "connectivity.hsqldb", "[HSQLDB-SDBC] caught an exception while opening a stream\n"
                                 "Name: " << sName
                                 << "\nMode: 0x" <<  ( _nMode < 16 ? "0" : "")
                                 << std::hex << _nMode );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 5418c4a9de7e..dd3c5645e7e7 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2030,7 +2030,7 @@ void ToolbarSaveInData::SetSystemStyle(
     catch ( uno::Exception& )
     {
         // do nothing, a default value is returned
-        SAL_WARN("cui.customize", "Exception setting toolbar style");
+        TOOLS_WARN_EXCEPTION("cui.customize", "Exception setting toolbar style");
     }
 }
 
diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx
index c9b70b2bf908..dd33d2c24782 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -20,6 +20,7 @@
 #include <rtl/bootstrap.hxx>
 #include <tools/urlobj.hxx>
 #include <tools/stream.hxx>
+#include <tools/diagnose_ex.h>
 #include <comphelper/processfactory.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/svapp.hxx>
@@ -529,15 +530,15 @@ AdditionsDialog::getInstalledExtensions()
     }
     catch (const deployment::DeploymentException&)
     {
-        SAL_WARN("cui.dialogs", "Deployment Exception");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
     }
     catch (const ucb::CommandFailedException&)
     {
-        SAL_WARN("cui.dialogs", "Command Failed Exception");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
     }
     catch (const ucb::CommandAbortedException&)
     {
-        SAL_WARN("cui.dialogs", "Command Aborted Exception");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
     }
     catch (const lang::IllegalArgumentException& e)
     {
@@ -783,31 +784,31 @@ IMPL_LINK_NOARG(AdditionsItem, InstallHdl, weld::Button&, void)
     }
     catch (const ucb::CommandFailedException)
     {
-        SAL_WARN("cui.dialogs", "Additions: addExtension CommandFailedException occurred.");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
         m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
         m_xButtonInstall->set_sensitive(true);
     }
     catch (const ucb::CommandAbortedException)
     {
-        SAL_WARN("cui.dialogs", "Additions: addExtension CommandAbortedException occurred.");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
         m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
         m_xButtonInstall->set_sensitive(true);
     }
     catch (const deployment::DeploymentException)
     {
-        SAL_WARN("cui.dialogs", "Additions: addExtension DeploymentException occurred.");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
         m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
         m_xButtonInstall->set_sensitive(true);
     }
     catch (const lang::IllegalArgumentException)
     {
-        SAL_WARN("cui.dialogs", "Additions: addExtension IllegalArgumentException occurred.");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
         m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
         m_xButtonInstall->set_sensitive(true);
     }
     catch (const css::uno::Exception)
     {
-        SAL_WARN("cui.dialogs", "Additions: addExtension Exception occurred.");
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "");
         m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
         m_xButtonInstall->set_sensitive(true);
     }
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index dd89d0174774..f1752922e066 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -40,6 +40,7 @@
 #include <tools/urlobj.hxx>
 #include <tools/debug.hxx>
 #include <tools/stream.hxx>
+#include <tools/diagnose_ex.h>
 #include <vcl/image.hxx>
 #include <vcl/weld.hxx>
 #include <vcl/svapp.hxx>
@@ -94,7 +95,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl, weld::Button&, void)
     }
     catch( const IllegalArgumentException& )
     {
-        SAL_WARN( "cui.dialogs", "caught IllegalArgumentException when registering filter" );
+        TOOLS_WARN_EXCEPTION("cui.dialogs", "caught IllegalArgumentException when registering filter" );
     }
 
     if( xFilePicker->execute() == ExecutableDialogResults::OK )
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index 92c1484edd75..e6f31962834f 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -36,6 +36,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 using namespace comphelper;
 
@@ -120,7 +121,7 @@ OCacheSet::~OCacheSet()
     }
     catch(Exception&)
     {
-        SAL_WARN("dbaccess", "Exception occurred");
+        TOOLS_WARN_EXCEPTION("dbaccess", "");
     }
     catch(...)
     {
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index 0bbe5e80ae0a..bc4b81b7a46d 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -34,6 +34,7 @@
 #include <comphelper/seqstream.hxx>
 #include <connectivity/dbexception.hxx>
 #include <o3tl/safeint.hxx>
+#include <tools/diagnose_ex.h>
 
 using namespace dbaccess;
 using namespace connectivity;
@@ -1174,7 +1175,7 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow)
         }
         catch (const Exception&)
         {
-            SAL_WARN("dbaccess", "firePropertyChange: Exception on column " << i);
+            TOOLS_WARN_EXCEPTION("dbaccess", "firePropertyChange: Exception on column " << i);
         }
         ++i;
     }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d8a7f0b4291f..e3c4d8ae7d2f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1326,9 +1326,9 @@ LibLODocument_Impl::~LibLODocument_Impl()
     {
         mxComponent->dispose();
     }
-    catch (const css::lang::DisposedException& rException)
+    catch (const css::lang::DisposedException&)
     {
-        SAL_WARN("lok", "failed to dispose document:" << rException.Message);
+        TOOLS_WARN_EXCEPTION("lok", "failed to dispose document");
     }
 }
 
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 09dc879f85d9..6a0794e94f15 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -22,6 +22,7 @@
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
 #include <tools/poly.hxx>
+#include <tools/diagnose_ex.h>
 #include <unotools/resmgr.hxx>
 #include <vcl/canvastools.hxx>
 #include <vcl/mapmod.hxx>
@@ -232,10 +233,9 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
                                 Graphic bgraph(bmp);
                                 aMtf = bgraph.GetGDIMetaFile();
                             }
-                            catch(const Exception& e)
+                            catch(const Exception&)
                             {
-                                SAL_WARN("filter.pdf", "Something went wrong while converting metafile to bitmap. Exception: "
-                                         << e.Message);
+                                TOOLS_WARN_EXCEPTION("filter.pdf", "Something went wrong while converting metafile to bitmap");
                             }
                         }
 
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index c8bad80d0ae6..8b3047cc176b 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -2259,8 +2259,7 @@ void OBoundControlModel::reset()
 
     catch( const SQLException& )
     {
-        DBG_UNHANDLED_EXCEPTION("forms.component");
-        SAL_WARN("forms.component",  "OBoundControlModel::reset: caught an SQL exception!" );
+        TOOLS_WARN_EXCEPTION("forms.component",  "OBoundControlModel::reset: caught an SQL exception!" );
     }
 
     // #i24495# - don't count the insert row as "invalid"
diff --git a/fpicker/source/office/contentenumeration.cxx b/fpicker/source/office/contentenumeration.cxx
index 090d19a47988..6ed0d7626007 100644
--- a/fpicker/source/office/contentenumeration.cxx
+++ b/fpicker/source/office/contentenumeration.cxx
@@ -181,7 +181,7 @@ namespace svt
             }
             catch( CommandAbortedException& )
             {
-                SAL_WARN( "svtools.contnr", "createCursor: CommandAbortedException" );
+                TOOLS_WARN_EXCEPTION( "svtools.contnr", "");
             }
             catch( Exception& )
             {
diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index 17fd33cd7081..b58d8952ca76 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -25,6 +25,7 @@
 
 #include <svx/unopage.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <drawingml/colorchoicecontext.hxx>
 #include <drawingml/misccontexts.hxx>
@@ -222,7 +223,7 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
             }
             catch(SAXException& /* e */ )
             {
-                SAL_WARN("oox", "OOX: SAXException in XML_buAutoNum");
+                TOOLS_WARN_EXCEPTION("oox", "OOX: SAXException in XML_buAutoNum");
             }
             break;
         }
@@ -234,7 +235,7 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl
             }
             catch(SAXException& /* e */)
             {
-                SAL_WARN("oox", "OOX: SAXException in XML_buChar");
+                TOOLS_WARN_EXCEPTION("oox", "OOX: SAXException in XML_buChar");
             }
             break;
         case A_TOKEN( buBlip ):         // CT_TextBlipBullet
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index b13fbb9c9bf3..017b95673c84 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -21,6 +21,7 @@
 
 #include <rtl/math.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/animations/AnimationTransformType.hpp>
 #include <com/sun/star/animations/AnimationCalcMode.hpp>
@@ -333,7 +334,7 @@ namespace oox::ppt {
                 }
                 catch( RuntimeException& )
                 {
-                    SAL_WARN("oox.ppt", "OOX: Exception in CmdTimeNodeContext::endFastElement()" );
+                    TOOLS_WARN_EXCEPTION("oox.ppt", "OOX: Exception in CmdTimeNodeContext::endFastElement()" );
                 }
             }
 
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
index df3803126a94..914c7515d970 100644
--- a/sfx2/source/config/evntconf.cxx
+++ b/sfx2/source/config/evntconf.cxx
@@ -25,6 +25,7 @@
 #include <comphelper/processfactory.hxx>
 #include <sfx2/evntconf.hxx>
 #include <svl/macitem.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <sfx2/objsh.hxx>
 #include <eventsupplier.hxx>
@@ -189,11 +190,11 @@ static void PropagateEvent_Impl( SfxObjectShell const *pDoc, const OUString& aEv
         }
         catch( const css::lang::IllegalArgumentException& )
         {
-            SAL_WARN( "sfx.config", "PropagateEvents_Impl: caught IllegalArgumentException" );
+            TOOLS_WARN_EXCEPTION( "sfx.config", "PropagateEvents_Impl: caught IllegalArgumentException" );
         }
         catch( const css::container::NoSuchElementException& )
         {
-            SAL_WARN( "sfx.config", "PropagateEvents_Impl: caught NoSuchElementException" );
+            TOOLS_WARN_EXCEPTION( "sfx.config", "PropagateEvents_Impl: caught NoSuchElementException" );
         }
     }
     else {
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx b/sfx2/source/doc/SfxRedactionHelper.cxx
index b41f197d09d6..72a096521d17 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -45,6 +45,7 @@
 
 #include <tools/gen.hxx>
 #include <tools/stream.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <vcl/gdimtf.hxx>
 #include <vcl/graph.hxx>
@@ -294,7 +295,7 @@ void SfxRedactionHelper::showRedactionToolbar(const SfxViewFrame* pViewFrame)
     }
     catch (css::uno::Exception&)
     {
-        SAL_WARN("sfx.doc", "Exception while trying to show the Redaction Toolbar!");
+        TOOLS_WARN_EXCEPTION("sfx.doc", "Exception while trying to show the Redaction Toolbar!");
     }
 }
 
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index d8b9614af046..1d17dc828f84 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -961,10 +961,10 @@ bool SfxDocTplService_Impl::setProperty( Content& rContent,
                 }
                 catch( PropertyExistException& ) {}
                 catch( IllegalTypeException& ) {
-                    SAL_WARN( "sfx.doc", "IllegalTypeException" );
+                    TOOLS_WARN_EXCEPTION( "sfx.doc", "" );
                 }
                 catch( IllegalArgumentException& ) {
-                    SAL_WARN( "sfx.doc", "IllegalArgumentException" );
+                    TOOLS_WARN_EXCEPTION( "sfx.doc", "" );
                 }
             }
         }
@@ -2308,7 +2308,7 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList,
     }
     catch (ContentCreationException&)
     {
-        SAL_WARN( "sfx.doc", "addHierGroup: ContentCreationException" );
+        TOOLS_WARN_EXCEPTION( "sfx.doc", "" );
     }
     catch (Exception&) {}
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 47c25433ee51..3930e451c916 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1630,9 +1630,9 @@ static bool HasSignatureStream(const uno::Reference<embed::XStorage>& xStorage)
                        || xMetaInf->hasByName("packagesignatures.xml");
             }
         }
-        catch (const css::io::IOException& rException)
+        catch (const css::io::IOException&)
         {
-            SAL_WARN("sfx.doc", "HasSignatureStream: failed to open META-INF: " << rException.Message);
+            TOOLS_WARN_EXCEPTION("sfx.doc", "HasSignatureStream: failed to open META-INF");
         }
     }
 
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index d9182c8cc410..b444251b272f 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -51,8 +51,7 @@ ItemHolder2::ItemHolder2()
         if(bMessage)
         {
             bMessage = false;
-            css::uno::Any ex( cppu::getCaughtException() );
-            SAL_WARN( "svl", "CreateInstance with arguments exception: " << exceptionToString(ex));
+            TOOLS_WARN_EXCEPTION( "svl", "" );
         }
     }
 #else
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 8a0c338be63b..6a0af5a84552 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -553,7 +553,7 @@ namespace svt
             }
             catch( CommandAbortedException& )
             {
-                SAL_WARN( "svtools.misc", "TemplateFolderCacheImpl::implReadFolder: caught a CommandAbortedException!" );
+                TOOLS_WARN_EXCEPTION( "svtools.misc", "" );
                 return false;
             }
             catch( css::uno::Exception& )
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index f61ea7605567..d03f197e9351 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -73,6 +73,7 @@
 #include <sfx2/viewsh.hxx>
 #include <editeng/editview.hxx>
 #include <tools/UnitConversion.hxx>
+#include <tools/diagnose_ex.h>
 
 using ::editeng::SvxBorderLine;
 using namespace sdr::table;
@@ -1935,7 +1936,7 @@ void SvxTableController::MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, s
     }
     catch( Exception& )
     {
-        SAL_WARN( "svx", "sdr::table::SvxTableController::MergeRange(), exception caught!" );
+        TOOLS_WARN_EXCEPTION( "svx", "" );
     }
 }
 
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 3b38b63871c4..8dfbf6689566 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -36,6 +36,7 @@
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <cmdid.h>
 #include <unotextbodyhf.hxx>
@@ -2075,10 +2076,9 @@ lcl_ApplyCellProperties(
             {
                 xCellPS->setPropertyValue(rName, rValue);
             }
-            catch (const uno::Exception& e)
+            catch (const uno::Exception&)
             {
-                SAL_WARN( "sw.uno", "Exception when getting PropertyState: "
-                        + rName + ". Message: " + e.Message );
+                TOOLS_WARN_EXCEPTION( "sw.uno", "Exception when getting PropertyState: " << rName );
             }
         }
     }
@@ -2182,10 +2182,9 @@ SwXText::convertToTable(
             {
                 xPrSet->setPropertyValue(rTableProperty.Name, rTableProperty.Value);
             }
-            catch (const uno::Exception& e)
+            catch (const uno::Exception&)
             {
-                SAL_WARN( "sw.uno", "Exception when setting property: "
-                    + rTableProperty.Name + ". Message: " + e.Message );
+                TOOLS_WARN_EXCEPTION( "sw.uno", "Exception when setting property: " << rTableProperty.Name  );
             }
         }
 
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 64f74ec26d00..f49dd87a4939 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -42,6 +42,7 @@
 #include <cppuhelper/weak.hxx>
 #include <ucbhelper/cancelcommandexecution.hxx>
 #include <ucbhelper/macros.hxx>
+#include <tools/diagnose_ex.h>
 #include "identify.hxx"
 #include "ucbcmds.hxx"
 
@@ -847,14 +848,14 @@ bool UniversalContentBroker::getContentProviderData(
     }
     catch (const uno::RuntimeException&)
     {
-        SAL_WARN( "ucb", "caught RuntimeException!" );
+        TOOLS_WARN_EXCEPTION( "ucb", "" );
         return false;
     }
     catch (const uno::Exception&)
     {
         // createInstance, createInstanceWithArguments
 
-        SAL_WARN( "ucb", "caught Exception!" );
+        TOOLS_WARN_EXCEPTION( "ucb", "" );
         return false;
     }
 
diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
index 7675f6c5d418..b87d987752fb 100644
--- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
@@ -39,6 +39,7 @@
 #include <com/sun/star/ucb/ResultSetException.hpp>
 #include <ucbhelper/contentidentifier.hxx>
 #include <ucbhelper/providerhelper.hxx>
+#include <tools/diagnose_ex.h>
 #include <memory>
 #include <vector>
 #include "webdavdatasupplier.hxx"
@@ -378,7 +379,7 @@ bool DataSupplier::getData()
         }
         catch ( DAVException & )
         {
-            SAL_WARN( "ucb.ucp.webdav", "Running PROPFIND: DAVException" );
+            TOOLS_WARN_EXCEPTION( "ucb.ucp.webdav", "Running PROPFIND: DAVException" );
             m_pImpl->m_bThrowException = true;
         }
 
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
index 6001b8665f4c..8be3a0d401d2 100644
--- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
@@ -33,6 +33,7 @@
 #include "SerfUri.hxx"
 #include <com/sun/star/ucb/IllegalIdentifierException.hpp>
 #include <com/sun/star/ucb/ResultSetException.hpp>
+#include <tools/diagnose_ex.h>
 
 using namespace com::sun::star;
 using namespace http_dav_ucp;
@@ -357,7 +358,7 @@ bool DataSupplier::getData()
         }
         catch ( DAVException & )
         {
-            SAL_WARN( "ucb.ucp.webdav", "PROPFIND : DAVException" );
+            TOOLS_WARN_EXCEPTION( "ucb.ucp.webdav", "PROPFIND : DAVException" );
             m_pImpl->m_bThrowException = true;
         }
 
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx
index f24af51db595..bad26a977108 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -59,8 +59,7 @@ ItemHolder1::ItemHolder1()
         if(bMessage)
         {
             bMessage = false;
-            css::uno::Any ex( cppu::getCaughtException() );
-            SAL_WARN( "unotools", "CreateInstance with arguments exception: " << exceptionToString(ex));
+            TOOLS_WARN_EXCEPTION( "unotools", "CreateInstance with arguments");
         }
     }
 #else
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 1d0e31c69f77..3291b00d5ed1 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -28,6 +28,7 @@
 #include <sal/types.h>
 #include <sal/log.hxx>
 #include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <printdlg.hxx>
 #include <svdata.hxx>
@@ -261,7 +262,7 @@ static OUString queryFile( Printer const * pPrinter )
     }
     catch (const css::lang::IllegalArgumentException&)
     {
-        SAL_WARN( "vcl.gdi", "caught IllegalArgumentException when registering filter" );
+        TOOLS_WARN_EXCEPTION( "vcl.gdi", "caught IllegalArgumentException when registering filter" );
     }
 
     if( xFilePicker->execute() == css::ui::dialogs::ExecutableDialogResults::OK )
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 7051f3c45b47..54933b284e06 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -32,6 +32,7 @@
 #include <sal/log.hxx>
 #include <svx/dialmgr.hxx>
 #include <svx/strings.hrc>
+#include <tools/diagnose_ex.h>
 
 #include <iostream>
 
@@ -300,7 +301,7 @@ sal_Int32 GraphicZOrderHelper::findZOrder( sal_Int32 relativeHeight, bool bOldSt
             return itemZOrder + itemZOrderOffset;
     }
     catch (const uno::RuntimeException&) {
-        SAL_WARN("writerfilter", "Exception when getting item z-order");
+        TOOLS_WARN_EXCEPTION("writerfilter", "Exception when getting item z-order");
     }
     SAL_WARN( "writerfilter", "findZOrder() didn't find item z-order" );
     return 0; // this should not(?) happen
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 692a7e5e172e..574fa0bd8fae 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -425,7 +425,7 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
             }
             catch(const uno::Exception&)
             {
-                SAL_WARN("xmloff.chart", "Exception during import SchXMLChartContext::StartElement" );
+                TOOLS_WARN_EXCEPTION("xmloff.chart", "Exception during import SchXMLChartContext::StartElement" );
             }
         }
     }
@@ -844,7 +844,7 @@ void SchXMLChartContext::EndElement()
             catch(const uno::Exception&)
             {
                 //try to fallback to internal data
-                SAL_WARN("xmloff.chart", "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram try to fallback to internal data" );
+                TOOLS_WARN_EXCEPTION("xmloff.chart", "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram try to fallback to internal data" );
                 if(!bHasOwnData)
                 {
                     bHasOwnData = true;
@@ -859,7 +859,7 @@ void SchXMLChartContext::EndElement()
                         }
                         catch(const uno::Exception&)
                         {
-                            SAL_WARN("xmloff.chart", "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram fallback to internal data failed also" );
+                            TOOLS_WARN_EXCEPTION("xmloff.chart", "Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram fallback to internal data failed also" );
                         }
                     }
                 }
@@ -1015,7 +1015,7 @@ void SchXMLChartContext::MergeSeriesForStockChart()
     }
     catch(const uno::Exception&)
     {
-        SAL_WARN("xmloff.chart", "Exception while merging series for stock chart" );
+        TOOLS_WARN_EXCEPTION("xmloff.chart", "Exception while merging series for stock chart" );
     }
 }
 
diff --git a/xmloff/source/text/txtvfldi.cxx b/xmloff/source/text/txtvfldi.cxx
index ed635d9a51c8..76ac17fa6f33 100644
--- a/xmloff/source/text/txtvfldi.cxx
+++ b/xmloff/source/text/txtvfldi.cxx
@@ -49,6 +49,7 @@
 #include <sal/log.hxx>
 
 #include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
 
 
 // service names
@@ -1039,9 +1040,9 @@ void XMLDatabaseDisplayImportContext::EndElement()
                             // success!
                             return;
                         }
-                        catch (const lang::IllegalArgumentException& rException)
+                        catch (const lang::IllegalArgumentException&)
                         {
-                            SAL_WARN("xmloff.text", "Failed to insert text content: " << rException.Message);
+                            TOOLS_WARN_EXCEPTION("xmloff.text", "Failed to insert text content");
                         }
                     }
                 }


More information about the Libreoffice-commits mailing list