[Libreoffice-commits] core.git: svtools/langsupport svtools/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 18 06:07:50 UTC 2019


 svtools/langsupport/langsupport.cxx              |    5 +++--
 svtools/source/config/itemholder2.cxx            |    5 +++--
 svtools/source/contnr/DocumentInfoPreview.cxx    |    5 +++--
 svtools/source/control/inettbc.cxx               |   17 +++++++++--------
 svtools/source/dialogs/ServerDetailsControls.cxx |    5 +++--
 svtools/source/misc/embedhlp.cxx                 |   12 ++++++------
 svtools/source/misc/imagemgr.cxx                 |    5 +++--
 svtools/source/misc/langhelp.cxx                 |    5 +++--
 8 files changed, 33 insertions(+), 26 deletions(-)

New commits:
commit 129e799e1acf25d7dcd7ccf0438896cc125e7653
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 17 08:22:00 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 18 08:06:33 2019 +0200

    loplugin:logexceptionnicely in svtools
    
    Change-Id: I631f3750af2e9a26d0a034f5a22d5b0c2910325c
    Reviewed-on: https://gerrit.libreoffice.org/74142
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svtools/langsupport/langsupport.cxx b/svtools/langsupport/langsupport.cxx
index 1aae3df70277..7c25d8382b1f 100644
--- a/svtools/langsupport/langsupport.cxx
+++ b/svtools/langsupport/langsupport.cxx
@@ -15,6 +15,7 @@
 #include <i18nlangtag/languagetag.hxx>
 #include <sal/main.h>
 #include <svtools/langtab.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/extendapplicationenvironment.hxx>
 #include <vcl/svapp.hxx>
 #include <iostream>
@@ -65,9 +66,9 @@ SAL_IMPLEMENT_MAIN()
 
         uno::Reference< lang::XComponent >(xContext, uno::UNO_QUERY_THROW)->dispose();
     }
-    catch (const uno::Exception& e)
+    catch (const uno::Exception&)
     {
-        SAL_WARN("vcl.app", "Fatal: " << e);
+        TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
         return 1;
     }
     catch (const std::exception &e)
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index cbd78826d7c0..2871aa3a512b 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -35,6 +35,7 @@
 #include <svtools/printoptions.hxx>
 #include <unotools/options.hxx>
 #include <svtools/miscopt.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace svtools {
 
@@ -54,13 +55,13 @@ ItemHolder2::ItemHolder2()
         throw;
     }
 #ifdef DBG_UTIL
-    catch(const css::uno::Exception& rEx)
+    catch(const css::uno::Exception&)
     {
         static bool bMessage = true;
         if(bMessage)
         {
             bMessage = false;
-            SAL_WARN( "svtools", "CreateInstance with arguments: " << rEx );
+            TOOLS_WARN_EXCEPTION( "svtools", "CreateInstance with arguments" );
         }
     }
 #else
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index a34030701f98..c853084e4e0e 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -38,6 +38,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/builderfactory.hxx>
 #include <tools/datetime.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/urlobj.hxx>
 #include <unotools/ucbhelper.hxx>
 #include <unotools/localedatawrapper.hxx>
@@ -113,8 +114,8 @@ void ODocumentInfoPreview::fill(
         try {
             value = conv->convertToSimpleType(aAny, css::uno::TypeClass_STRING).
                 get< OUString >();
-        } catch (css::script::CannotConvertException & e) {
-            SAL_INFO("svtools.contnr", "ignored " << e);
+        } catch (css::script::CannotConvertException &) {
+            TOOLS_INFO_EXCEPTION("svtools.contnr", "ignored");
         }
         if (!value.isEmpty()) {
             insertEntry(name, value);
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index e740a79e6584..a2ef57c6116a 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -23,6 +23,7 @@
 #endif
 
 #include <svtools/inettbc.hxx>
+#include <tools/diagnose_ex.h>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/beans/Property.hpp>
@@ -967,8 +968,8 @@ void SvtMatchContext_Impl::doExecute()
                                 if (proc2.is()) {
                                     try {
                                         proc2->releaseCommandIdentifier(id);
-                                    } catch (css::uno::RuntimeException & e) {
-                                        SAL_WARN("svtools.control", "ignoring " << e);
+                                    } catch (css::uno::RuntimeException &) {
+                                        TOOLS_WARN_EXCEPTION("svtools.control", "ignoring");
                                     }
                                 }
                                 throw;
@@ -991,8 +992,8 @@ void SvtMatchContext_Impl::doExecute()
                             css::uno::Reference< css::sdbc::XRow > row(
                                 res, css::uno::UNO_QUERY_THROW);
                             folder = row->getBoolean(1) && !row->wasNull();
-                        } catch (css::uno::Exception & e) {
-                            SAL_WARN("svtools.control", "ignoring " << e);
+                        } catch (css::uno::Exception &) {
+                            TOOLS_WARN_EXCEPTION("svtools.control", "ignoring");
                             return;
                         }
                     }
@@ -1215,8 +1216,8 @@ void MatchContext_Impl::doExecute()
                                 if (proc2.is()) {
                                     try {
                                         proc2->releaseCommandIdentifier(id);
-                                    } catch (css::uno::RuntimeException & e) {
-                                        SAL_WARN("svtools.control", "ignoring " << e);
+                                    } catch (css::uno::RuntimeException &) {
+                                        TOOLS_WARN_EXCEPTION("svtools.control", "ignoring");
                                     }
                                 }
                                 throw;
@@ -1239,8 +1240,8 @@ void MatchContext_Impl::doExecute()
                             css::uno::Reference< css::sdbc::XRow > row(
                                 res, css::uno::UNO_QUERY_THROW);
                             folder = row->getBoolean(1) && !row->wasNull();
-                        } catch (css::uno::Exception & e) {
-                            SAL_WARN("svtools.control", "ignoring " << e);
+                        } catch (css::uno::Exception &) {
+                            TOOLS_WARN_EXCEPTION("svtools.control", "ignoring");
                             return;
                         }
                     }
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index b792a51574bc..9011f4784136 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -21,6 +21,7 @@
 #include <rtl/uri.hxx>
 #include <ucbhelper/content.hxx>
 #include <ucbhelper/commandenvironment.hxx>
+#include <tools/diagnose_ex.h>
 #include <toolkit/helper/vclunohelper.hxx>
 
 #include <svtools/PlaceEditDialog.hxx>
@@ -467,9 +468,9 @@ IMPL_LINK_NOARG( CmisDetailsContainer, RefreshReposHdl, weld::Button&, void  )
             m_pDialog->m_xLBRepository->append_text(sName);
         }
     }
-    catch ( const Exception& e)
+    catch ( const Exception&)
     {
-        SAL_WARN( "svtools.dialogs", "RefreshReposHdl exception=" << e );
+        TOOLS_WARN_EXCEPTION( "svtools.dialogs", "RefreshReposHdl" );
     }
 
     // Auto-select the first one
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 55a65e513734..eace6d8e927a 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -341,9 +341,9 @@ void EmbeddedObjectRef::Clear()
                 {
                     // there's still someone who needs the object!
                 }
-                catch (const uno::Exception& e)
+                catch (const uno::Exception&)
                 {
-                    SAL_WARN("svtools.misc", "Error on switching of the object to loaded state and closing: \"" << e << "\"");
+                    TOOLS_WARN_EXCEPTION("svtools.misc", "Error on switching of the object to loaded state and closing");
                 }
             }
         }
@@ -493,18 +493,18 @@ Size EmbeddedObjectRef::GetSize( MapMode const * pTargetMapMode ) const
             catch(const embed::NoVisualAreaSizeException&)
             {
             }
-            catch (const uno::Exception& e)
+            catch (const uno::Exception&)
             {
-                SAL_WARN("svtools.misc", "Something went wrong on getting of the size of the object: \"" << e << "\"");
+                TOOLS_WARN_EXCEPTION("svtools.misc", "Something went wrong on getting of the size of the object");
             }
 
             try
             {
                 aSourceMapMode = MapMode(VCLUnoHelper::UnoEmbed2VCLMapUnit(mpImpl->mxObj->getMapUnit(mpImpl->nViewAspect)));
             }
-            catch (const uno::Exception& e)
+            catch (const uno::Exception&)
             {
-                SAL_WARN("svtools.misc", "Can not get the map mode: \"" << e << "\"");
+                TOOLS_WARN_EXCEPTION("svtools.misc", "Can not get the map mode");
             }
         }
 
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index e38760f829b0..e7eab73f2b54 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <svtools/imagemgr.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/urlobj.hxx>
 #include <tools/debug.hxx>
 #include <sal/log.hxx>
@@ -392,9 +393,9 @@ static SvImageId GetImageId_Impl( const INetURLObject& rObject, bool bDetectFold
                         nId = SvImageId::MathTemplate;
                 }
             }
-            catch (const css::ucb::ContentCreationException& e)
+            catch (const css::ucb::ContentCreationException&)
             {
-                SAL_WARN("svtools.misc", "GetImageId_Impl: Caught " << e);
+                TOOLS_WARN_EXCEPTION("svtools.misc", "GetImageId_Impl");
             }
 
             return nId;
diff --git a/svtools/source/misc/langhelp.cxx b/svtools/source/misc/langhelp.cxx
index 57d1d2f89ca3..6cedddca3f89 100644
--- a/svtools/source/misc/langhelp.cxx
+++ b/svtools/source/misc/langhelp.cxx
@@ -20,6 +20,7 @@
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
 #include <svtools/langhelp.hxx>
+#include <tools/diagnose_ex.h>
 #include <vcl/idle.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/sysdata.hxx>
@@ -97,9 +98,9 @@ public:
             css::uno::Reference<XSyncDbusSessionHelper> xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
             xSyncDbusSessionHelper->InstallPackageNames(comphelper::containerToSequence(m_aPackages), OUString());
         }
-        catch (const css::uno::Exception& e)
+        catch (const css::uno::Exception&)
         {
-            SAL_INFO("svl", "trying to install a LibreOffice langpack, caught " << e);
+            TOOLS_INFO_EXCEPTION("svl", "trying to install a LibreOffice langpack");
         }
         xLangpackInstaller.reset();
     }


More information about the Libreoffice-commits mailing list