diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-16 15:37:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-17 08:18:51 +0200 |
commit | f41a55474cb6217560af81ae99c3e2fe1aca5215 (patch) | |
tree | 703ddebaa16e967ff0529b0bfe8667661a6abae7 | |
parent | c77a1e1c039c863e6fdb47b92ce315b87fc73d0d (diff) |
loplugin:logexceptionnicely in scripting..sdext
Change-Id: Ib08f41bb0bed494e7ed00f5bae92eae2b8e80d93
Reviewed-on: https://gerrit.libreoffice.org/74113
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | scripting/Library_protocolhandler.mk | 1 | ||||
-rw-r--r-- | scripting/source/protocolhandler/scripthandler.cxx | 13 | ||||
-rw-r--r-- | scripting/source/provider/BrowseNodeFactoryImpl.cxx | 4 | ||||
-rw-r--r-- | scripting/source/provider/MasterScriptProvider.cxx | 10 | ||||
-rw-r--r-- | scripting/source/vbaevents/eventhelper.cxx | 5 | ||||
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 4 | ||||
-rw-r--r-- | sdext/source/pdfimport/filterdet.cxx | 5 | ||||
-rw-r--r-- | sdext/source/pdfimport/pdfiadaptor.cxx | 5 | ||||
-rw-r--r-- | sdext/source/pdfimport/test/pdf2xml.cxx | 5 |
9 files changed, 28 insertions, 24 deletions
diff --git a/scripting/Library_protocolhandler.mk b/scripting/Library_protocolhandler.mk index e140bb322008..3d243f7f849b 100644 --- a/scripting/Library_protocolhandler.mk +++ b/scripting/Library_protocolhandler.mk @@ -27,6 +27,7 @@ $(eval $(call gb_Library_use_libraries,protocolhandler,\ fwe \ sal \ sfx \ + tl \ vcl \ )) diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 07c4353893d6..dff0f3513e4b 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -158,12 +158,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( { xListener->dispatchFinished( aEvent ) ; } - catch(RuntimeException & e) + catch(const RuntimeException &) { - SAL_WARN("scripting", + TOOLS_WARN_EXCEPTION("scripting", "ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException" - "while dispatchFinished with failure of the execution " - << e ); + "while dispatchFinished with failure of the execution"); } } return; @@ -285,11 +284,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( { xListener->dispatchFinished( aEvent ) ; } - catch(const RuntimeException & e) + catch(const RuntimeException &) { - SAL_WARN("scripting", + TOOLS_WARN_EXCEPTION("scripting", "ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException" - "while dispatchFinished " << e ); + "while dispatchFinished" ); } } } diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx index d3fc898086b8..909443f5f511 100644 --- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx +++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx @@ -282,9 +282,9 @@ std::vector< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Referen locnBNs[ mspIndex++ ].set( xFac->createScriptProvider( makeAny( OUString("share") ) ), UNO_QUERY_THROW ); } // TODO proper exception handling, should throw - catch( const Exception& e ) + catch( const Exception& ) { - SAL_WARN("scripting", "Caught " << e ); + TOOLS_WARN_EXCEPTION("scripting", "Caught" ); locnBNs.resize( mspIndex ); return locnBNs; } diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 8daa183d5ec8..fe2d074c4632 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -209,10 +209,10 @@ void MasterScriptProvider::createPkgProvider() xFac->createScriptProvider( location ), UNO_SET_THROW ); } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN("scripting.provider", "Exception creating MasterScriptProvider for uno_packages in context " - << m_sCtxString << ": " << e ); + TOOLS_WARN_EXCEPTION("scripting.provider", "Exception creating MasterScriptProvider for uno_packages in context " + << m_sCtxString ); } } @@ -470,9 +470,9 @@ template <typename Proc> bool FindProviderAndApply(ProviderCache& rCache, Proc p if (bResult) break; } - catch (Exception& e) + catch (const Exception&) { - SAL_INFO("scripting.provider", "ignoring " << e); + TOOLS_INFO_EXCEPTION("scripting.provider", "ignoring"); } } return bResult; diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index 21a52e9b28c4..8388450aa2b2 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -23,6 +23,7 @@ #include <comphelper/uno3.hxx> #include <comphelper/proparrhlp.hxx> #include <comphelper/propertycontainer.hxx> +#include <tools/diagnose_ex.h> #include <ooo/vba/XVBAToOOEventDescGen.hpp> @@ -909,9 +910,9 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet ) ooo::vba::executeMacro( mpShell, url, aArguments, aRet, aDummyCaller ); } } - catch ( uno::Exception& e ) + catch ( const uno::Exception& ) { - SAL_WARN("scripting", "event script raised " << e ); + TOOLS_WARN_EXCEPTION("scripting", "event script raised" ); } } } diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 3c9cf80ab33b..e6e5adb26c4d 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -1005,9 +1005,9 @@ bool SdXMLFilter::Export() mxStatusIndicator->end(); } } - catch (const uno::Exception &e) + catch (const uno::Exception &) { - SAL_WARN( "sd.filter", "uno Exception caught while exporting:" << e); + TOOLS_WARN_EXCEPTION( "sd.filter", "uno Exception caught while exporting"); bDocRet = false; } if ( !bLocked ) diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index a726ef883e3c..4b72c932f44c 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -36,6 +36,7 @@ #include <comphelper/fileurl.hxx> #include <comphelper/hash.hxx> #include <cppuhelper/supportsservice.hxx> +#include <tools/diagnose_ex.h> #include <memory> #include <string.h> @@ -290,8 +291,8 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF } osl_closeFile( aFile ); } - } catch (css::io::IOException & e) { - SAL_WARN("sdext.pdfimport", "caught " << e); + } catch (const css::io::IOException &) { + TOOLS_WARN_EXCEPTION("sdext.pdfimport", "caught"); return OUString(); } OUString aEmbedMimetype; diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx index cd8c67b24ab1..e66cf59f7f79 100644 --- a/sdext/source/pdfimport/pdfiadaptor.cxx +++ b/sdext/source/pdfimport/pdfiadaptor.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/io/XSeekable.hpp> +#include <tools/diagnose_ex.h> #include <memory> @@ -153,9 +154,9 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert m_xContext ), uno::UNO_QUERY ); } - catch(const uno::Exception& e) + catch(const uno::Exception&) { - SAL_INFO("sdext.pdfimport", "subfilter: " << e); + TOOLS_INFO_EXCEPTION("sdext.pdfimport", "subfilter"); } SAL_INFO("sdext.pdfimport", "subfilter: " << xSubFilter.get() ); diff --git a/sdext/source/pdfimport/test/pdf2xml.cxx b/sdext/source/pdfimport/test/pdf2xml.cxx index 5d8c06ca0294..04b5ee8d19c0 100644 --- a/sdext/source/pdfimport/test/pdf2xml.cxx +++ b/sdext/source/pdfimport/test/pdf2xml.cxx @@ -32,6 +32,7 @@ #include <unotest/bootstrapfixturebase.hxx> #include <comphelper/processfactory.hxx> #include <cppuhelper/bootstrap.hxx> +#include <tools/diagnose_ex.h> using namespace ::pdfi; using namespace ::com::sun::star; @@ -80,9 +81,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) xAdaptor->setTreeVisitorFactory(pTreeFactory); nRet = xAdaptor->odfConvert(aSrcURL, new OutputWrap(aDstURL), nullptr) ? 0 : 1; } - 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) |