From 6ee9ab65db0a993bc93bbf0140f0a4657be10657 Mon Sep 17 00:00:00 2001 From: Noel Date: Fri, 2 Oct 2020 15:56:31 +0200 Subject: use more TOOLS_WARN_EXCEPTION Change-Id: Id83c478af5d04ad548c7cf4239fe2fb3ee154dc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103861 Tested-by: Jenkins Reviewed-by: Noel Grandin --- connectivity/source/cpool/ZPoolCollection.cxx | 2 +- cui/source/options/optinet2.cxx | 28 ++++++++++++---------- dbaccess/source/core/api/tablecontainer.cxx | 2 +- dbaccess/source/ui/browser/brwctrlr.cxx | 2 +- unotools/source/i18n/charclass.cxx | 32 ++++++++++++------------- unotools/source/i18n/nativenumberwrapper.cxx | 9 +++---- unotools/source/i18n/textsearch.cxx | 5 ++-- unotools/source/i18n/transliterationwrapper.cxx | 4 ++-- xmloff/source/chart/SchXMLChartContext.cxx | 2 +- xmloff/source/chart/SchXMLTools.cxx | 2 +- 10 files changed, 46 insertions(+), 42 deletions(-) diff --git a/connectivity/source/cpool/ZPoolCollection.cxx b/connectivity/source/cpool/ZPoolCollection.cxx index 629d8b7da097..53c1cea0d3c3 100644 --- a/connectivity/source/cpool/ZPoolCollection.cxx +++ b/connectivity/source/cpool/ZPoolCollection.cxx @@ -400,7 +400,7 @@ void SAL_CALL OPoolCollection::disposing( const EventObject& Source ) } catch(const Exception&) { - SAL_WARN("connectivity.cpool", "Exception caught"); + TOOLS_WARN_EXCEPTION("connectivity.cpool", ""); } } } diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 025d31d6e724..b47cd1178149 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -272,14 +272,15 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() } catch (const beans::UnknownPropertyException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::ReadConfigDefaults_Impl: UnknownPropertyException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } - catch (const css::lang::WrappedTargetException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::ReadConfigDefaults_Impl: WrappedTargetException caught" ); + catch (const css::lang::WrappedTargetException &) + { + TOOLS_WARN_EXCEPTION("cui.options", "" ); } catch (const RuntimeException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::ReadConfigDefaults_Impl: RuntimeException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } } @@ -303,14 +304,15 @@ void SvxProxyTabPage::RestoreConfigDefaults_Impl() } catch (const beans::UnknownPropertyException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } - catch (const css::lang::WrappedTargetException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" ); + catch (const css::lang::WrappedTargetException &) + { + TOOLS_WARN_EXCEPTION("cui.options", "" ); } catch (const RuntimeException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } } @@ -396,19 +398,19 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) xChangesBatch->commitChanges(); } catch (const css::lang::IllegalArgumentException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::FillItemSet: IllegalArgumentException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } catch (const beans::UnknownPropertyException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::FillItemSet: UnknownPropertyException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } catch (const beans::PropertyVetoException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::FillItemSet: PropertyVetoException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } catch (const css::lang::WrappedTargetException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::FillItemSet: WrappedTargetException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } catch (const RuntimeException &) { - SAL_WARN("cui.options", "SvxProxyTabPage::FillItemSet: RuntimeException caught" ); + TOOLS_WARN_EXCEPTION("cui.options", "" ); } return bModified; diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 2da2c3350a91..443e78a67de7 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -77,7 +77,7 @@ namespace } catch(const Exception&) { - SAL_WARN("dbaccess", "lcl_isPropertySetDefaulted: Exception caught!" ); + TOOLS_WARN_EXCEPTION("dbaccess", "" ); } } return ( pIter == pEnd ); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 3366ed97df15..c2e175020b4e 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1859,7 +1859,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property } catch(Exception&) { - SAL_WARN("dbaccess.ui", "Exception caught!"); + TOOLS_WARN_EXCEPTION("dbaccess.ui", "" ); } break; case SID_FM_DELETEROWS: diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index faec870ff55b..394ed81c2936 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -122,7 +122,7 @@ bool CharClass::isAlpha( const OUString& rStr, sal_Int32 nPos ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isAlpha: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -144,7 +144,7 @@ bool CharClass::isLetter( const OUString& rStr, sal_Int32 nPos ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isLetter: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -161,7 +161,7 @@ bool CharClass::isLetter( const OUString& rStr ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isLetter: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -183,7 +183,7 @@ bool CharClass::isDigit( const OUString& rStr, sal_Int32 nPos ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isDigit: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -200,7 +200,7 @@ bool CharClass::isNumeric( const OUString& rStr ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isNumeric: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -222,7 +222,7 @@ bool CharClass::isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isAlphaNumeric: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -244,7 +244,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isLetterNumeric: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -261,7 +261,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "isLetterNumeric: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return false; } @@ -278,7 +278,7 @@ OUString CharClass::titlecase(const OUString& rStr, sal_Int32 nPos, sal_Int32 nC } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "titlecase: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return rStr.copy( nPos, nCount ); } @@ -295,7 +295,7 @@ OUString CharClass::uppercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "uppercase: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return rStr.copy( nPos, nCount ); } @@ -312,7 +312,7 @@ OUString CharClass::lowercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "lowercase: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return rStr.copy( nPos, nCount ); } @@ -329,7 +329,7 @@ sal_Int16 CharClass::getType( const OUString& rStr, sal_Int32 nPos ) const } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getType: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return 0; } @@ -346,7 +346,7 @@ css::i18n::DirectionProperty CharClass::getCharacterDirection( const OUString& r } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getCharacterDirection: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return css::i18n::DirectionProperty_LEFT_TO_RIGHT; } @@ -363,7 +363,7 @@ css::i18n::UnicodeScript CharClass::getScript( const OUString& rStr, sal_Int32 n } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getScript: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return UnicodeScript_kBasicLatin; } @@ -380,7 +380,7 @@ sal_Int32 CharClass::getCharacterType( const OUString& rStr, sal_Int32 nPos ) co } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getCharacterType: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return 0; } @@ -397,7 +397,7 @@ sal_Int32 CharClass::getStringType( const OUString& rStr, sal_Int32 nPos, sal_In } catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getStringType: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return 0; } diff --git a/unotools/source/i18n/nativenumberwrapper.cxx b/unotools/source/i18n/nativenumberwrapper.cxx index 26fcbd7fa32f..5c1bb4c0b5de 100644 --- a/unotools/source/i18n/nativenumberwrapper.cxx +++ b/unotools/source/i18n/nativenumberwrapper.cxx @@ -22,6 +22,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -49,7 +50,7 @@ NativeNumberWrapper::getNativeNumberString( } catch ( const uno::Exception& ) { - SAL_WARN( "unotools.i18n", "getNativeNumberString: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return OUString(); } @@ -69,7 +70,7 @@ NativeNumberWrapper::getNativeNumberStringParams( } catch ( const uno::Exception& ) { - SAL_WARN( "unotools.i18n", "getNativeNumberStringParams: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return OUString(); } @@ -86,7 +87,7 @@ NativeNumberWrapper::convertToXmlAttributes( } catch ( const uno::Exception& ) { - SAL_WARN( "unotools.i18n", "convertToXmlAttributes: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return i18n::NativeNumberXmlAttributes(); } @@ -102,7 +103,7 @@ NativeNumberWrapper::convertFromXmlAttributes( } catch ( const uno::Exception& ) { - SAL_WARN( "unotools.i18n", "convertFromXmlAttributes: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return 0; } diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx index c55b7a712147..b6c71aa25c1e 100644 --- a/unotools/source/i18n/textsearch.cxx +++ b/unotools/source/i18n/textsearch.cxx @@ -34,6 +34,7 @@ #include #include #include +#include using namespace ::com::sun::star::util; using namespace ::com::sun::star::uno; @@ -258,7 +259,7 @@ bool TextSearch::SearchForward( const OUString &rStr, } catch ( Exception& ) { - SAL_WARN( "unotools.i18n", "SearchForward: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return bRet; } @@ -298,7 +299,7 @@ bool TextSearch::SearchBackward( const OUString & rStr, sal_Int32* pStart, } catch ( Exception& ) { - SAL_WARN( "unotools.i18n", "SearchBackward: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } return bRet; } diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index 5deb0e5a6ee9..ff6f4933d88c 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -62,7 +62,7 @@ OUString TransliterationWrapper::transliterate(const OUString& rStr, LanguageTyp } catch( Exception& ) { - SAL_WARN( "unotools.i18n", "transliterate: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } } return sRet; @@ -80,7 +80,7 @@ OUString TransliterationWrapper::transliterate( const OUString& rStr, } catch( Exception& ) { - SAL_WARN( "unotools.i18n", "transliterate: Exception caught!" ); + TOOLS_WARN_EXCEPTION("unotools.i18n", "" ); } } return sRet; diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index 574fa0bd8fae..3a9cd84ff125 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -105,7 +105,7 @@ void lcl_MoveDataToCandleStickSeries( } catch(const uno::Exception&) { - SAL_WARN("xmloff.chart", "Exception caught while moving data to candlestick series" ); + TOOLS_WARN_EXCEPTION("xmloff.chart", "Exception caught while moving data to candlestick series" ); } } diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 1dc06c7e88f7..6ac7475a1afd 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -520,7 +520,7 @@ void CreateCategories( } catch( uno::Exception & ) { - SAL_WARN("xmloff.chart", "Exception caught while creating Categories" ); + TOOLS_WARN_EXCEPTION("xmloff.chart", "Exception caught while creating Categories" ); } } -- cgit