summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-17 08:22:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-18 08:06:33 +0200
commit129e799e1acf25d7dcd7ccf0438896cc125e7653 (patch)
tree7a04097e0a119bb56d68ad284c9ccb7e29d71898 /svtools
parent8a453f96f0181b1eae227ebdadea6ee458d53eb4 (diff)
loplugin:logexceptionnicely in svtools
Change-Id: I631f3750af2e9a26d0a034f5a22d5b0c2910325c Reviewed-on: https://gerrit.libreoffice.org/74142 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/langsupport/langsupport.cxx5
-rw-r--r--svtools/source/config/itemholder2.cxx5
-rw-r--r--svtools/source/contnr/DocumentInfoPreview.cxx5
-rw-r--r--svtools/source/control/inettbc.cxx17
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx5
-rw-r--r--svtools/source/misc/embedhlp.cxx12
-rw-r--r--svtools/source/misc/imagemgr.cxx5
-rw-r--r--svtools/source/misc/langhelp.cxx5
8 files changed, 33 insertions, 26 deletions
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();
}