vcl/qt5/Qt5Widget.cxx                      |    5 +++--
 vcl/source/app/session.cxx                 |    5 +++--
 vcl/source/app/svdata.cxx                  |    5 +++--
 vcl/source/app/svmain.cxx                  |    5 +++--
 vcl/source/gdi/gdimtf.cxx                  |    5 +++--
 vcl/source/gdi/vectorgraphicdata.cxx       |    5 +++--
 vcl/source/image/ImplImageTree.cxx         |   17 +++++++++--------
 vcl/source/window/window.cxx               |    9 +++++----
 vcl/unx/generic/fontmanager/fontconfig.cxx |    5 +++--
 vcl/unx/gtk/gtksalframe.cxx                |    5 +++--
 vcl/unx/gtk3/gtk3gtkframe.cxx              |    3 ++-
 vcl/workben/mtfdemo.cxx                    |    5 +++--
 vcl/workben/outdevgrind.cxx                |    5 +++--
 vcl/workben/svdem.cxx                      |    5 +++--
 vcl/workben/svpclient.cxx                  |    3 ++-
 vcl/workben/svptest.cxx                    |    5 +++--
 vcl/workben/vcldemo.cxx                    |    5 +++--
 17 files changed, 57 insertions(+), 40 deletions(-)

New commits:
commit a2e4b76e29e491bac4f9e6dfd9929dfd49a4b05e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jun 18 09:33:28 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jun 18 10:46:40 2019 +0200

    loplugin:logexceptionnicely in vcl
    
    Change-Id: I0ed575a11c84c2e8aabfa1b4204ba6ae27393d5f
    Reviewed-on: https://gerrit.libreoffice.org/74245
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index b46b48b35366..657c5e8e73f7 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -47,6 +47,7 @@
 #include <vcl/commandevent.hxx>
 #include <vcl/event.hxx>
 #include <window.h>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
 #include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
@@ -613,9 +614,9 @@ static bool lcl_retrieveSurrounding(sal_Int32& rPosition, 
sal_Int32& rAnchor, QS
         if (xAccessible.is())
             xText = 
FindFocusedEditableText(xAccessible->getAccessibleContext());
     }
-    catch (const uno::Exception& e)
+    catch (const uno::Exception&)
     {
-        SAL_WARN("vcl.qt5", "Exception in getting input method surrounding 
text: " << e);
+        TOOLS_WARN_EXCEPTION("vcl.qt5", "Exception in getting input method 
surrounding text");
     }
 
     bool result = false;
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index 5679c7a9fb63..c96d179cf90e 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -24,6 +24,7 @@
 #include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 
+#include <tools/diagnose_ex.h>
 #include <vcl/svapp.hxx>
 
 #include <factory.hxx>
@@ -376,8 +377,8 @@ void VCLSession::disposing() {
         try {
             listener.m_xListener->disposing(src);
             SAL_INFO("vcl.se.debug", "  call Listener disposing");
-        } catch (css::uno::RuntimeException & e) {
-            SAL_WARN("vcl.se", "ignoring " << e);
+        } catch (css::uno::RuntimeException &) {
+            TOOLS_WARN_EXCEPTION("vcl.se", "ignoring");
         }
     }
 }
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 93335d48624b..2a3fd1162528 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -22,6 +22,7 @@
 #include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <rtl/process.h>
+#include <tools/diagnose_ex.h>
 #include <tools/gen.hxx>
 #include <unotools/resmgr.hxx>
 #include <uno/current_context.hxx>
@@ -244,9 +245,9 @@ vcl::Window *ImplGetDefaultContextWindow()
                     pContext->acquire();
 #endif
             }
-            catch (const css::uno::Exception& e)
+            catch (const css::uno::Exception&)
             {
-                 SAL_WARN("vcl", "unable to create Default Window: " << e);
+                TOOLS_WARN_EXCEPTION("vcl", "unable to create Default Window");
             }
         }
     }
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 51e47674b604..64395164e8ba 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -102,6 +102,7 @@
 #include <opengl/watchdog.hxx>
 
 #include <basegfx/utils/systemdependentdata.hxx>
+#include <tools/diagnose_ex.h>
 
 #if OSL_DEBUG_LEVEL > 0
 #include <typeinfo>
@@ -344,9 +345,9 @@ bool InitVCL()
             osl_setEnvironment(envVar.pData, aLocaleString.pData);
         }
     }
-    catch (const uno::Exception &e)
+    catch (const uno::Exception &)
     {
-        SAL_INFO("vcl.app", "Unable to get ui language: '" << e);
+        TOOLS_INFO_EXCEPTION("vcl.app", "Unable to get ui language:");
     }
 
     pSVData->mpDefInst->AfterAppInit();
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index eb730fe578a7..8c01f8302535 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -22,6 +22,7 @@
 #include <memory>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <tools/helpers.hxx>
 #include <tools/stream.hxx>
 #include <tools/vcompat.hxx>
@@ -426,10 +427,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* 
pOut, const Point& rPos, S
     {
         throw; // runtime errors are fatal
     }
-    catch (const uno::Exception& e)
+    catch (const uno::Exception&)
     {
         // ignore errors, no way of reporting them here
-        SAL_WARN("vcl.gdi", "GDIMetaFile::ImplPlayWithRenderer: " << e);
+        TOOLS_WARN_EXCEPTION("vcl.gdi", "GDIMetaFile::ImplPlayWithRenderer");
     }
 
     return false;
diff --git a/vcl/source/gdi/vectorgraphicdata.cxx 
b/vcl/source/gdi/vectorgraphicdata.cxx
index 8c936f00cfd7..3d32af0ee0e7 100644
--- a/vcl/source/gdi/vectorgraphicdata.cxx
+++ b/vcl/source/gdi/vectorgraphicdata.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <tools/diagnose_ex.h>
 #include <tools/stream.hxx>
 #include <sal/log.hxx>
 #include <vcl/vectorgraphicdata.hxx>
@@ -78,9 +79,9 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx(
                 aRetval = vcl::unotools::bitmapExFromXBitmap(xIntBmp);
             }
         }
-        catch (const uno::Exception& e)
+        catch (const uno::Exception&)
         {
-            SAL_WARN("vcl", "Got no graphic::XPrimitive2DRenderer! : " << e);
+            TOOLS_WARN_EXCEPTION("vcl", "Got no 
graphic::XPrimitive2DRenderer!");
         }
         catch (const std::exception& e)
         {
diff --git a/vcl/source/image/ImplImageTree.cxx 
b/vcl/source/image/ImplImageTree.cxx
index d879759b5486..e1bf651e5b02 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -41,6 +41,7 @@
 #include <rtl/bootstrap.hxx>
 #include <rtl/uri.hxx>
 
+#include <tools/diagnose_ex.h>
 #include <tools/stream.hxx>
 #include <tools/urlobj.hxx>
 #include <implimagetree.hxx>
@@ -256,9 +257,9 @@ OUString ImplImageTree::getImageUrl(OUString const & rName, 
OUString const & rSt
                 }
             }
         }
-        catch (const uno::Exception & e)
+        catch (const uno::Exception &)
         {
-            SAL_INFO("vcl", e);
+            TOOLS_INFO_EXCEPTION("vcl", "");
         }
 
         aStyle = fallbackStyle(aStyle);
@@ -296,9 +297,9 @@ std::shared_ptr<SvMemoryStream> 
ImplImageTree::getImageStream(OUString const & r
                 }
             }
         }
-        catch (const uno::Exception & e)
+        catch (const uno::Exception &)
         {
-            SAL_INFO("vcl", e);
+            TOOLS_INFO_EXCEPTION("vcl", "");
         }
 
         aStyle = fallbackStyle(aStyle);
@@ -413,9 +414,9 @@ bool ImplImageTree::doLoadImage(ImageRequestParameters& 
rParameters)
     {
         throw;
     }
-    catch (const uno::Exception& e)
+    catch (const uno::Exception&)
     {
-        SAL_INFO("vcl", "ImplImageTree::doLoadImage exception: " << e);
+        TOOLS_INFO_EXCEPTION("vcl", "ImplImageTree::doLoadImage");
     }
 
     if (bFound)
@@ -681,9 +682,9 @@ bool ImplImageTree::checkPathAccess()
     {
         throw;
     }
-    catch (const uno::Exception & e)
+    catch (const uno::Exception &)
     {
-        SAL_INFO("vcl", "ImplImageTree::zip file location " << e << " for " << 
rIconSet.maURL);
+        TOOLS_INFO_EXCEPTION("vcl", "ImplImageTree::zip file location " << 
rIconSet.maURL);
         return false;
     }
     return rNameAccess.is();
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 27f027eb3224..5a0b505e2aef 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -70,6 +70,7 @@
 #include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <unotools/configmgr.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/debug.hxx>
 
 #include <cassert>
@@ -3288,9 +3289,9 @@ Reference< XClipboard > Window::GetClipboard()
                     = css::datatransfer::clipboard::SystemClipboard::create(
                         comphelper::getProcessComponentContext());
             }
-            catch (DeploymentException & e)
+            catch (DeploymentException const &)
             {
-                SAL_WARN("vcl.window", "ignoring " << e);
+                TOOLS_WARN_EXCEPTION("vcl.window", "ignoring");
             }
         }
 
@@ -3329,9 +3330,9 @@ Reference< XClipboard > Window::GetPrimarySelection()
                 mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
 #endif
             }
-            catch (RuntimeException & e)
+            catch (RuntimeException const &)
             {
-                SAL_WARN("vcl.window", "ignoring " << e);
+                TOOLS_WARN_EXCEPTION("vcl.window", "ignoring");
             }
         }
 
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx 
b/vcl/unx/generic/fontmanager/fontconfig.cxx
index b518493a967d..3f0a2aa4418b 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -32,6 +32,7 @@
 #include <i18nutil/unicode.hxx>
 #include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <unicode/uchar.h>
 #include <unicode/uscript.h>
 #include <officecfg/Office/Common.hxx>
@@ -863,9 +864,9 @@ IMPL_LINK_NOARG(PrintFontManager, 
autoInstallFontLangSupport, Timer *, void)
         css::uno::Reference<XSyncDbusSessionHelper> 
xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
         
xSyncDbusSessionHelper->InstallFontconfigResources(comphelper::containerToSequence(m_aCurrentRequests),
 "hide-finished");
     }
-    catch (const css::uno::Exception& e)
+    catch (const css::uno::Exception&)
     {
-        SAL_INFO("vcl.fonts", "InstallFontconfigResources problem, caught " << 
e);
+        TOOLS_INFO_EXCEPTION("vcl.fonts", "InstallFontconfigResources 
problem");
         // Disable this method from now on. It's simply not available on some 
systems
         // and leads to an error dialog being shown each time this is called 
tdf#104883
         std::shared_ptr<comphelper::ConfigurationChanges> batch( 
comphelper::ConfigurationChanges::create() );
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 75526e55a59b..425ad0562d82 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -34,6 +34,7 @@
 #include <rtl/bootstrap.hxx>
 #include <rtl/process.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <vcl/floatwin.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
@@ -3509,9 +3510,9 @@ static 
uno::Reference<accessibility::XAccessibleEditableText> lcl_GetxText(vcl::
         if (xAccessible.is())
             xText = 
FindFocusedEditableText(xAccessible->getAccessibleContext());
     }
-    catch(const uno::Exception& e)
+    catch(const uno::Exception&)
     {
-        SAL_WARN( "vcl.gtk", "Exception in getting input method surrounding 
text: " << e);
+        TOOLS_WARN_EXCEPTION( "vcl.gtk", "Exception in getting input method 
surrounding text");
     }
     return xText;
 }
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 888a7fb9aeb4..1061345344bc 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -36,6 +36,7 @@
 #include <rtl/bootstrap.hxx>
 #include <rtl/process.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <vcl/floatwin.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/weld.hxx>
@@ -4083,7 +4084,7 @@ static 
uno::Reference<accessibility::XAccessibleEditableText> lcl_GetxText(vcl::
     }
     catch(const uno::Exception& e)
     {
-        SAL_WARN( "vcl.gtk3", "Exception in getting input method surrounding 
text: " << e);
+        TOOLS_WARN_EXCEPTION( "vcl.gtk3", "Exception in getting input method 
surrounding text");
     }
     return xText;
 }
diff --git a/vcl/workben/mtfdemo.cxx b/vcl/workben/mtfdemo.cxx
index 7addd2bc54a3..0ee726e051f8 100644
--- a/vcl/workben/mtfdemo.cxx
+++ b/vcl/workben/mtfdemo.cxx
@@ -19,6 +19,7 @@
 #include <vcl/gdimtf.hxx>
 #include <vcl/wmf.hxx>
 
+#include <tools/diagnose_ex.h>
 #include <tools/urlobj.hxx>
 #include <tools/stream.hxx>
 #include <tools/vcompat.hxx>
@@ -91,9 +92,9 @@ public:
 
             Application::Execute();
         }
-        catch (const css::uno::Exception& e)
+        catch (const css::uno::Exception&)
         {
-            SAL_WARN("vcl.app", "Fatal: " << e);
+            TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
             return 1;
         }
         catch (const std::exception& e)
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index ac6f12aaa373..8283a5e59da2 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -19,6 +19,7 @@
 
 #include <sal/main.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/extendapplicationenvironment.hxx>
 
 #include <cppuhelper/bootstrap.hxx>
@@ -731,9 +732,9 @@ SAL_IMPLEMENT_MAIN()
 
         DeInitVCL();
     }
-    catch (const css::uno::Exception& e)
+    catch (const css::uno::Exception&)
     {
-        SAL_WARN("vcl.app", "Fatal: " << e);
+        TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
         return EXIT_FAILURE;
     }
     catch (const std::exception& e)
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index 579141839cc4..dd9027a81be5 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -19,6 +19,7 @@
 
 #include <sal/main.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/extendapplicationenvironment.hxx>
 
 #include <cppuhelper/bootstrap.hxx>
@@ -57,9 +58,9 @@ SAL_IMPLEMENT_MAIN()
         ::Main();
         DeInitVCL();
     }
-    catch (const Exception& e)
+    catch (const Exception&)
     {
-        SAL_WARN("vcl.app", "Fatal: " << e);
+        TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
         return 1;
     }
     catch (const std::exception &e)
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 1b78996642e7..9ffdbcb38f2c 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -36,6 +36,7 @@
 #include <vcl/bitmapex.hxx>
 #include <vcl/graphicfilter.hxx>
 #include <vcl/graph.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/extendapplicationenvironment.hxx>
 #include <tools/stream.hxx>
 
@@ -79,7 +80,7 @@ SAL_IMPLEMENT_MAIN()
     }
     catch (const Exception& e)
     {
-        SAL_WARN("vcl", "Fatal: " << e);
+        TOOLS_WARN_EXCEPTION("vcl", "Fatal");
         return 1;
     }
     catch (const std::exception& e)
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index e2425807a8e9..a79cda4df507 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -19,6 +19,7 @@
 
 #include <sal/main.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/extendapplicationenvironment.hxx>
 
 #include <cppuhelper/bootstrap.hxx>
@@ -67,9 +68,9 @@ SAL_IMPLEMENT_MAIN()
         ::Main();
         DeInitVCL();
     }
-    catch (const Exception& e)
+    catch (const Exception&)
     {
-        SAL_WARN("vcl.app", "Fatal: " << e);
+        TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
         return 1;
     }
     catch (const std::exception &e)
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index befde4053660..3685e905a1ec 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -31,6 +31,7 @@
 #include <vcl/ptrstyle.hxx>
 #include <salhelper/thread.hxx>
 
+#include <tools/diagnose_ex.h>
 #include <tools/urlobj.hxx>
 #include <tools/stream.hxx>
 #include <vcl/svapp.hxx>
@@ -2376,9 +2377,9 @@ public:
             xWidgets.disposeAndClear();
             xPopup.disposeAndClear();
         }
-        catch (const css::uno::Exception& e)
+        catch (const css::uno::Exception&)
         {
-            SAL_WARN("vcl.app", "Fatal: " << e);
+            TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
             return 1;
         }
         catch (const std::exception& e)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to