[Libreoffice-commits] core.git: starmath/source stoc/Library_bootstrap.mk stoc/Library_javaloader.mk stoc/Library_javavm.mk stoc/source svgio/source

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


 starmath/source/smdetect.cxx                  |    5 +++--
 stoc/Library_bootstrap.mk                     |    1 +
 stoc/Library_javaloader.mk                    |    1 +
 stoc/Library_javavm.mk                        |    1 +
 stoc/source/javaloader/javaloader.cxx         |    7 +++----
 stoc/source/javavm/javavm.cxx                 |   17 +++++++++--------
 stoc/source/servicemanager/servicemanager.cxx |   13 +++++++------
 svgio/source/svguno/xsvgparser.cxx            |    5 +++--
 8 files changed, 28 insertions(+), 22 deletions(-)

New commits:
commit e1eb7cb04a4c30cec238ab0f54d41a6cdc3299c1
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 17 08:21:42 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 18 09:27:59 2019 +0200

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

diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index 90d601157a3e..24e6f2df7bf5 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -26,6 +26,7 @@
 #include <unotools/mediadescriptor.hxx>
 #include <sal/log.hxx>
 #include <sot/storage.hxx>
+#include <tools/diagnose_ex.h>
 
 #include "eqnolefilehdr.hxx"
 
@@ -83,9 +84,9 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor
             }
         }
     }
-    catch (const css::ucb::ContentCreationException &e)
+    catch (const css::ucb::ContentCreationException &)
     {
-        SAL_WARN("starmath", "SmFilterDetect::detect caught " << e);
+        TOOLS_WARN_EXCEPTION("starmath", "SmFilterDetect::detect caught" );
     }
 
     if (!bStorageOk)
diff --git a/stoc/Library_bootstrap.mk b/stoc/Library_bootstrap.mk
index bf5a75f55b6c..b31359663de6 100644
--- a/stoc/Library_bootstrap.mk
+++ b/stoc/Library_bootstrap.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Library_use_libraries,bootstrap,\
     reg \
     sal \
     salhelper \
+    tl \
 ))
 
 $(eval $(call gb_Library_set_componentfile,bootstrap,stoc/util/bootstrap))
diff --git a/stoc/Library_javaloader.mk b/stoc/Library_javaloader.mk
index f0b11fb4a9dc..caf4a1e27df6 100644
--- a/stoc/Library_javaloader.mk
+++ b/stoc/Library_javaloader.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_Library_use_libraries,javaloader,\
     jvmaccess \
     sal \
     salhelper \
+    tl \
 ))
 
 $(eval $(call gb_Library_set_componentfile,javaloader,stoc/source/javaloader/javaloader))
diff --git a/stoc/Library_javavm.mk b/stoc/Library_javavm.mk
index 84e29e8556e0..ce5f773ef394 100644
--- a/stoc/Library_javavm.mk
+++ b/stoc/Library_javavm.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_Library_use_libraries,javavm,\
     jvmfwk \
     sal \
     salhelper \
+    tl \
 ))
 
 $(eval $(call gb_Library_set_componentfile,javavm,stoc/source/javavm/javavm))
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 760f6d356a3c..e980d7dddebe 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/uno/RuntimeException.hpp>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <cppuhelper/exc_hlp.hxx>
+#include <tools/diagnose_ex.h>
 
 #ifdef LINUX
 #undef minor
@@ -343,10 +344,8 @@ static css::uno::Reference<XInterface> JavaComponentLoader_CreateInstance(const
         static css::uno::Reference< XInterface > xStaticRef = *new JavaComponentLoader(xCtx);
         xRet = xStaticRef;
     }
-    catch(const RuntimeException & runtimeException) {
-        SAL_INFO(
-            "stoc",
-            "could not init javaloader due to " << runtimeException);
+    catch(const RuntimeException &) {
+        TOOLS_INFO_EXCEPTION("stoc", "could not init javaloader");
         throw;
     }
 
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 7f253f0ea7eb..eaecc2a91174 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -60,6 +60,7 @@
 #include <rtl/ustring.hxx>
 #include <sal/types.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <uno/current_context.hxx>
 #include <jvmfwk/framework.hxx>
 #include <i18nlangtag/languagetag.hxx>
@@ -527,23 +528,23 @@ void initVMConfiguration(
     try {
         getINetPropsFromConfig(&jvm, xSMgr, xCtx);
     }
-    catch(const css::uno::Exception & exception) {
-        SAL_INFO("stoc", "can not get INETProps because of " << exception);
+    catch(const css::uno::Exception &) {
+        TOOLS_INFO_EXCEPTION("stoc", "can not get INETProps");
     }
 
     try {
         getDefaultLocaleFromConfig(&jvm, xSMgr,xCtx);
     }
-    catch(const css::uno::Exception & exception) {
-        SAL_INFO("stoc", "can not get locale because of " << exception);
+    catch(const css::uno::Exception &) {
+        TOOLS_INFO_EXCEPTION("stoc", "can not get locale");
     }
 
     try
     {
         getJavaPropsFromSafetySettings(&jvm, xSMgr, xCtx);
     }
-    catch(const css::uno::Exception & exception) {
-        SAL_INFO("stoc", "couldn't get safety settings because of " << exception);
+    catch(const css::uno::Exception &) {
+        TOOLS_INFO_EXCEPTION("stoc", "couldn't get safety settings");
     }
 
     *pjvm= jvm;
@@ -1330,9 +1331,9 @@ void JavaVirtualMachine::registerConfigChangesListener()
             if (m_xJavaConfiguration.is())
                 m_xJavaConfiguration->addContainerListener(this);
         }
-    }catch(const css::uno::Exception & e)
+    }catch(const css::uno::Exception &)
     {
-        SAL_INFO("stoc", "could not set up listener for Configuration because of >" << e << "<");
+        TOOLS_INFO_EXCEPTION("stoc", "could not set up listener for Configuration");
     }
 }
 
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 9d6f0e0d0c0a..5f38ec917c71 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -24,6 +24,7 @@
 #include <osl/diagnose.h>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/weakref.hxx>
@@ -619,9 +620,9 @@ void OServiceManager::disposing()
             if( xComp.is() )
                 xComp->dispose();
         }
-        catch (const RuntimeException & exc)
+        catch (const RuntimeException &)
         {
-            SAL_INFO("stoc", "RuntimeException occurred upon disposing factory: " << exc);
+            TOOLS_INFO_EXCEPTION("stoc", "RuntimeException occurred upon disposing factory:");
         }
     }
 
@@ -807,9 +808,9 @@ Reference< XInterface > OServiceManager::createInstanceWithContext(
                 }
             }
         }
-        catch (const lang::DisposedException & exc)
+        catch (const lang::DisposedException &)
         {
-            SAL_INFO("stoc", "DisposedException occurred: " << exc);
+            TOOLS_INFO_EXCEPTION("stoc", "");
         }
     }
 
@@ -861,9 +862,9 @@ Reference< XInterface > OServiceManager::createInstanceWithArgumentsAndContext(
                 }
             }
         }
-        catch (const lang::DisposedException & exc)
+        catch (const lang::DisposedException &)
         {
-            SAL_INFO("stoc", "DisposedException occurred: " << exc);
+            TOOLS_INFO_EXCEPTION("stoc", "DisposedException occurred:");
         }
     }
 
diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx
index 6a16aa5d8282..57c1c81ed28f 100644
--- a/svgio/source/svguno/xsvgparser.cxx
+++ b/svgio/source/svguno/xsvgparser.cxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/xml/sax/InputSource.hpp>
 #include <drawinglayer/geometry/viewinformation2d.hxx>
 #include <svgdocumenthandler.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <svgvisitor.hxx>
 
@@ -135,9 +136,9 @@ namespace svgio
                 // be processable from all our processors
                 xParser->parseStream(myInputSource);
             }
-            catch(const uno::Exception& e)
+            catch(const uno::Exception&)
             {
-                SAL_INFO( "svg", "Parse error: " << e);
+                TOOLS_INFO_EXCEPTION( "svg", "Parse error");
                 return false;
             }
 


More information about the Libreoffice-commits mailing list