diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-18 09:33:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-18 10:31:43 +0200 |
commit | 70accc2904edb5c4aa9b5acb7ff2889a77717b75 (patch) | |
tree | f6b8aa6e318694b8fe81b40abcf115e4fe54230f /unotools | |
parent | b8775ff8961dbe589799ac7f59427a8e5d07ac72 (diff) |
loplugin:logexceptionnicely in toolkit..unoxml
Change-Id: I0a3126545f9ef98640f6dd166290e9b9e91b8355
Reviewed-on: https://gerrit.libreoffice.org/74244
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/configitem.cxx | 96 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 5 | ||||
-rw-r--r-- | unotools/source/i18n/calendarwrapper.cxx | 87 | ||||
-rw-r--r-- | unotools/source/i18n/charclass.cxx | 9 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 41 | ||||
-rw-r--r-- | unotools/source/i18n/transliterationwrapper.cxx | 17 | ||||
-rw-r--r-- | unotools/source/misc/mediadescriptor.cxx | 22 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 12 |
8 files changed, 130 insertions, 159 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 803413259d11..6f5e99940703 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -412,13 +412,12 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames) { pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]); } - catch (const Exception& rEx) + catch (const Exception&) { - SAL_WARN( + TOOLS_WARN_EXCEPTION( "unotools.config", "ignoring XHierarchicalNameAccess to /org.openoffice." - << sSubTree << "/" << pNames[i] << " Exception: " - << rEx); + << sSubTree << "/" << pNames[i]); } } @@ -494,11 +493,9 @@ bool ConfigItem::PutProperties( const Sequence< OUString >& rNames, xTopNodeReplace->replaceByName(sProperty, pValues[i]); } } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from PutProperties: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from PutProperties"); } } try @@ -506,11 +503,9 @@ bool ConfigItem::PutProperties( const Sequence< OUString >& rNames, Reference<XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } } @@ -636,11 +631,9 @@ Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode, ConfigNameF } } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from GetNodeNames: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from GetNodeNames"); } } return aRet; @@ -674,19 +667,17 @@ bool ConfigItem::ClearNodeSet(const OUString& rNode) { xCont->removeByName(pNames[i]); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from removeByName(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from removeByName"); } } xBatch->commitChanges(); bRet = true; } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN("unotools.config", "Exception from ClearNodeSet" << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from ClearNodeSet"); } } return bRet; @@ -721,19 +712,15 @@ bool ConfigItem::ClearNodeElements(const OUString& rNode, Sequence< OUString > c Reference<XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges()"); } bRet = true; } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from GetNodeNames: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from GetNodeNames()"); } } return bRet; @@ -818,11 +805,9 @@ bool ConfigItem::SetSetProperties( { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges()"); } const PropertyValue* pProperties = rValues.getConstArray(); @@ -859,21 +844,17 @@ bool ConfigItem::SetSetProperties( OSL_ENSURE( xHierarchyAccess->hasByHierarchicalName(pValues[nValue].Name), "Invalid config path" ); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception form insert/replaceByName(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from insert/replaceByName()"); } } xBatch->commitChanges(); } } - catch (const Exception& rEx) + catch (const Exception&) { - SAL_WARN( - "unotools.config", - "Exception from SetSetProperties: " << rEx); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from SetSetProperties"); bRet = false; } } @@ -949,11 +930,9 @@ bool ConfigItem::ReplaceSetProperties( } } try { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } } @@ -970,11 +949,9 @@ bool ConfigItem::ReplaceSetProperties( } } try { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } const PropertyValue* pProperties = rValues.getConstArray(); @@ -1009,20 +986,17 @@ bool ConfigItem::ReplaceSetProperties( else xCont->insertByName(sSubNode, pValues[nValue].Value); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from insert/replaceByName(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from insert/replaceByName"); } } xBatch->commitChanges(); } } - catch (const Exception& rEx) + catch (const Exception& ) { - SAL_WARN( - "unotools.config", "Exception from ReplaceSetProperties: " << rEx); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from ReplaceSetProperties"); bRet = false; } } @@ -1064,9 +1038,9 @@ bool ConfigItem::AddNode(const OUString& rNode, const OUString& rNewNode) { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN("unotools.config", "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } } else @@ -1077,9 +1051,9 @@ bool ConfigItem::AddNode(const OUString& rNode, const OUString& rNewNode) if(!xCont->hasByName(rNewNode)) xCont->insertByName(rNewNode, Any()); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN("unotools.config", "Exception from AddNode(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from AddNode"); } } xBatch->commitChanges(); diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 29a143f2bb35..df102637118e 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <unotools/pathoptions.hxx> +#include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -294,9 +295,9 @@ void SvtPathOptions_Impl::SetPath( SvtPathOptions::Paths ePath, const OUString& { m_xPathSettings->setFastPropertyValue( m_aMapEnumToPropHandle[ static_cast<sal_Int32>(ePath)], a ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("unotools.config", "SetPath: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "SetPath"); } } } diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx index dd58a9d1196d..6e755be3bd36 100644 --- a/unotools/source/i18n/calendarwrapper.cxx +++ b/unotools/source/i18n/calendarwrapper.cxx @@ -20,6 +20,7 @@ #include <sal/log.hxx> #include <unotools/calendarwrapper.hxx> #include <com/sun/star/i18n/LocaleCalendar2.hpp> +#include <tools/diagnose_ex.h> using namespace ::com::sun::star; using namespace ::com::sun::star::i18n; @@ -45,9 +46,9 @@ void CalendarWrapper::loadDefaultCalendar( const css::lang::Locale& rLocale ) if ( xC.is() ) xC->loadDefaultCalendar( rLocale ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "loadDefaultCalendar: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "loadDefaultCalendar" ); } } @@ -58,10 +59,10 @@ void CalendarWrapper::loadCalendar( const OUString& rUniqueID, const css::lang:: if ( xC.is() ) xC->loadCalendar( rUniqueID, rLocale ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "loadCalendar: Exception caught requested: " - << rUniqueID << " Locale: " << rLocale.Language << "_" << rLocale.Country << " " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "loadCalendar: " + << rUniqueID << " Locale: " << rLocale.Language << "_" << rLocale.Country ); } } @@ -72,9 +73,9 @@ css::uno::Sequence< OUString > CalendarWrapper::getAllCalendars( const css::lang if ( xC.is() ) return xC->getAllCalendars( rLocale ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getAllCalendars: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getAllCalendars" ); } return css::uno::Sequence< OUString > (0); @@ -87,9 +88,9 @@ OUString CalendarWrapper::getUniqueID() const if ( xC.is() ) return xC->getUniqueID(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getUniqueID: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getUniqueID" ); } return OUString(); } @@ -101,9 +102,9 @@ void CalendarWrapper::setDateTime( double fTimeInDays ) if ( xC.is() ) xC->setDateTime( fTimeInDays ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "setDateTime: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "setDateTime" ); } } @@ -114,9 +115,9 @@ double CalendarWrapper::getDateTime() const if ( xC.is() ) return xC->getDateTime(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getDateTime: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getDateTime" ); } return 0.0; } @@ -130,9 +131,9 @@ void CalendarWrapper::setLocalDateTime( double fTimeInDays ) xC->setLocalDateTime( fTimeInDays ); } } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "setLocalDateTime: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "setLocalDateTime" ); } } @@ -145,9 +146,9 @@ double CalendarWrapper::getLocalDateTime() const return xC->getLocalDateTime(); } } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getLocalDateTime: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getLocalDateTime" ); } return 0.0; } @@ -159,9 +160,9 @@ void CalendarWrapper::setValue( sal_Int16 nFieldIndex, sal_Int16 nValue ) if ( xC.is() ) xC->setValue( nFieldIndex, nValue ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "setValue: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "setValue" ); } } @@ -172,9 +173,9 @@ bool CalendarWrapper::isValid() const if ( xC.is() ) return xC->isValid(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "isValid: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "isValid" ); } return false; } @@ -186,9 +187,9 @@ sal_Int16 CalendarWrapper::getValue( sal_Int16 nFieldIndex ) const if ( xC.is() ) return xC->getValue( nFieldIndex ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getValue: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getValue" ); } return 0; } @@ -200,9 +201,9 @@ sal_Int16 CalendarWrapper::getFirstDayOfWeek() const if ( xC.is() ) return xC->getFirstDayOfWeek(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getFirstDayOfWeek: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getFirstDayOfWeek" ); } return 0; } @@ -214,9 +215,9 @@ sal_Int16 CalendarWrapper::getNumberOfMonthsInYear() const if ( xC.is() ) return xC->getNumberOfMonthsInYear(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getNumberOfMonthsInYear: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getNumberOfMonthsInYear" ); } return 0; } @@ -228,9 +229,9 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const if ( xC.is() ) return xC->getNumberOfDaysInWeek(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getNumberOfDaysInWeek: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getNumberOfDaysInWeek" ); } return 0; } @@ -242,9 +243,9 @@ css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getMonths() cons if ( xC.is() ) return xC->getMonths2(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getMonths: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getMonths" ); } return css::uno::Sequence< css::i18n::CalendarItem2 > (0); } @@ -256,9 +257,9 @@ css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getDays() const if ( xC.is() ) return xC->getDays2(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getDays: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getDays" ); } return css::uno::Sequence< css::i18n::CalendarItem2 > (0); } @@ -270,9 +271,9 @@ OUString CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_I if ( xC.is() ) return xC->getDisplayName( nCalendarDisplayIndex, nIdx, nNameType ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getDisplayName: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getDisplayName" ); } return OUString(); } @@ -286,9 +287,9 @@ OUString CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_ if ( xC.is() ) return xC->getDisplayString( nCalendarDisplayCode, nNativeNumberMode ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getDisplayString: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getDisplayString" ); } return OUString(); } @@ -302,9 +303,9 @@ css::i18n::Calendar2 CalendarWrapper::getLoadedCalendar() const if ( xC.is() ) return xC->getLoadedCalendar2(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getLoadedCalendar2: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getLoadedCalendar2" ); } return css::i18n::Calendar2(); } @@ -316,9 +317,9 @@ css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getGenitiveMonth if ( xC.is() ) return xC->getGenitiveMonths2(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getGenitiveMonths: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getGenitiveMonths" ); } return css::uno::Sequence< css::i18n::CalendarItem2 > (0); } @@ -330,9 +331,9 @@ css::uno::Sequence< css::i18n::CalendarItem2 > CalendarWrapper::getPartitiveMont if ( xC.is() ) return xC->getPartitiveMonths2(); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getPartitiveMonths: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getPartitiveMonths" ); } return css::uno::Sequence< css::i18n::CalendarItem2 > (0); } diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index 0fdb80075c68..faec870ff55b 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <unotools/charclass.hxx> #include <rtl/character.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/i18n/CharacterClassification.hpp> @@ -419,9 +420,9 @@ css::i18n::ParseResult CharClass::parseAnyToken( nContCharFlags, userDefinedCharactersCont ); } } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "parseAnyToken: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "parseAnyToken" ); } return ParseResult(); } @@ -445,9 +446,9 @@ css::i18n::ParseResult CharClass::parsePredefinedToken( nContCharFlags, userDefinedCharactersCont ); } } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "parsePredefinedToken: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "parsePredefinedToken" ); } return ParseResult(); } diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index aa9ce284dfef..0374f1548faf 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -24,6 +24,7 @@ #include <unotools/localedatawrapper.hxx> #include <unotools/calendarwrapper.hxx> #include <unotools/digitgroupingiterator.hxx> +#include <tools/diagnose_ex.h> #include <tools/debug.hxx> #include <i18nlangtag/languagetag.hxx> @@ -164,9 +165,9 @@ css::i18n::LanguageCountryInfo LocaleDataWrapper::getLanguageCountryInfo() const { return xLD->getLanguageCountryInfo( getMyLocale() ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getLanguageCountryInfo: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getLanguageCountryInfo" ); } return css::i18n::LanguageCountryInfo(); } @@ -191,9 +192,9 @@ const css::i18n::LocaleDataItem2& LocaleDataWrapper::getLocaleItem() const assert(aRet.second); return aRet.first->second; } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getLocaleItem: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getLocaleItem" ); } static css::i18n::LocaleDataItem2 aEmptyItem; return aEmptyItem; @@ -205,9 +206,9 @@ css::uno::Sequence< css::i18n::Currency2 > LocaleDataWrapper::getAllCurrencies() { return xLD->getAllCurrencies2( getMyLocale() ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getAllCurrencies: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getAllCurrencies" ); } return css::uno::Sequence< css::i18n::Currency2 >(0); } @@ -218,9 +219,9 @@ css::uno::Sequence< css::i18n::FormatElement > LocaleDataWrapper::getAllFormats( { return xLD->getAllFormats( getMyLocale() ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getAllFormats: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getAllFormats" ); } return css::uno::Sequence< css::i18n::FormatElement >(0); } @@ -231,9 +232,9 @@ css::i18n::ForbiddenCharacters LocaleDataWrapper::getForbiddenCharacters() const { return xLD->getForbiddenCharacters( getMyLocale() ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getForbiddenCharacters: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getForbiddenCharacters" ); } return css::i18n::ForbiddenCharacters(); } @@ -244,9 +245,9 @@ css::uno::Sequence< OUString > LocaleDataWrapper::getReservedWord() const { return xLD->getReservedWord( getMyLocale() ); } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getReservedWord: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getReservedWord" ); } return css::uno::Sequence< OUString >(0); } @@ -262,9 +263,9 @@ css::uno::Sequence< css::lang::Locale > LocaleDataWrapper::getAllInstalledLocale { rInstalledLocales = xLD->getAllInstalledLocaleNames(); } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "getAllInstalledLocaleNames: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getAllInstalledLocaleNames" ); } return rInstalledLocales; } @@ -1772,9 +1773,9 @@ css::uno::Sequence< css::i18n::Calendar2 > LocaleDataWrapper::getAllCalendars() { return xLD->getAllCalendars2( getMyLocale() ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getAllCalendars: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getAllCalendars" ); } return css::uno::Sequence< css::i18n::Calendar2 >(0); } @@ -1796,9 +1797,9 @@ css::uno::Sequence< OUString > LocaleDataWrapper::getDateAcceptancePatterns() co xLD->getDateAcceptancePatterns( getMyLocale() ); return aDateAcceptancePatterns; } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "getDateAcceptancePatterns: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "getDateAcceptancePatterns" ); } return css::uno::Sequence< OUString >(0); } @@ -1816,9 +1817,9 @@ void LocaleDataWrapper::setDateAcceptancePatterns( { aDateAcceptancePatterns = xLD->getDateAcceptancePatterns( getMyLocale() ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "setDateAcceptancePatterns: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "setDateAcceptancePatterns" ); } if (!rPatterns.hasElements()) return; // just a reset diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index f9e70cff0724..5deb0e5a6ee9 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -23,6 +23,7 @@ #include <unotools/transliterationwrapper.hxx> #include <i18nlangtag/languagetag.hxx> #include <i18nutil/transliteration.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/i18n/Transliteration.hpp> @@ -145,9 +146,9 @@ void TransliterationWrapper::loadModuleImpl() const if ( xTrans.is() ) xTrans->loadModule( static_cast<TransliterationModules>(nType), aLanguageTag.getLocale() ); } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "loadModuleImpl: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "loadModuleImpl" ); } bFirstCall = false; @@ -166,9 +167,9 @@ void TransliterationWrapper::loadModuleByImplName(const OUString& rModuleName, if ( xTrans.is() ) xTrans->loadModuleByImplName( rModuleName, aLocale ); } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "loadModuleByImplName: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "loadModuleByImplName" ); } bFirstCall = false; @@ -185,9 +186,9 @@ bool TransliterationWrapper::equals( if ( xTrans.is() ) return xTrans->equals( rStr1, nPos1, nCount1, nMatch1, rStr2, nPos2, nCount2, nMatch2 ); } - catch ( const Exception& e ) + catch ( const Exception& ) { - SAL_WARN( "unotools.i18n", "equals: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "equals" ); } return false; } @@ -201,9 +202,9 @@ sal_Int32 TransliterationWrapper::compareString( const OUString& rStr1, const OU if ( xTrans.is() ) return xTrans->compareString( rStr1, rStr2 ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN( "unotools.i18n", "compareString: Exception caught " << e ); + TOOLS_WARN_EXCEPTION( "unotools.i18n", "compareString" ); } return 0; } diff --git a/unotools/source/misc/mediadescriptor.cxx b/unotools/source/misc/mediadescriptor.cxx index 1c9aead6bab5..98f27fc5bc37 100644 --- a/unotools/source/misc/mediadescriptor.cxx +++ b/unotools/source/misc/mediadescriptor.cxx @@ -626,16 +626,14 @@ bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, bool bLockFi } catch(const css::uno::RuntimeException&) { throw; } - catch(const css::ucb::ContentCreationException& e) + catch(const css::ucb::ContentCreationException&) { - SAL_WARN("unotools.misc", "caught \"" << e - << "\" while opening <" << sURL << ">"); + TOOLS_WARN_EXCEPTION("unotools.misc", "url: '" << sURL << "'"); return false; // TODO error handling } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { - SAL_WARN("unotools.misc", "caught \"" << e << "\" while opening <" - << sURL << ">"); + TOOLS_WARN_EXCEPTION("unotools.misc", "url: '" << sURL << "'"); return false; // TODO error handling } @@ -666,8 +664,9 @@ bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, bool bLockFi } catch(const css::uno::RuntimeException&) { throw; } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { + css::uno::Any ex( cppu::getCaughtException() ); // ignore exception, if reason was problem reasoned on // open it in WRITEABLE mode! Then we try it READONLY // later a second time. @@ -675,8 +674,7 @@ bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, bool bLockFi // break this method. if (!pInteraction->wasWriteError() || bModeRequestedExplicitly) { - SAL_WARN("unotools.misc", "caught \"" << e - << "\" while opening <" << sURL << ">"); + SAL_WARN("unotools.misc","url: '" << sURL << "' " << exceptionToString(ex)); // If the protocol is webdav, then we need to treat the stream as readonly, even if the // operation was requested as read/write explicitly (the WebDAV UCB implementation is monodirectional // read or write not both at the same time). @@ -737,11 +735,9 @@ bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, bool bLockFi { throw; } - catch(const css::uno::Exception& e) + catch(const css::uno::Exception&) { - SAL_INFO( - "unotools.misc", - "caught " << e << " while opening <" << sURL << ">"); + TOOLS_INFO_EXCEPTION("unotools.misc","url: '" << sURL << "'"); return false; } } diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 90aead427e39..ca7708b1c863 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -265,11 +265,9 @@ bool utl::UCBContentHelper::MakeFolder( if (e.Code == css::ucb::IOErrorCode_ALREADY_EXISTING) { exists = true; } else { - SAL_INFO( + TOOLS_INFO_EXCEPTION( "unotools.ucbhelper", - "UCBContentHelper::MakeFolder(" << title - << ") InteractiveIOException \"" << e - << "\", code " << + static_cast<sal_Int32>(e.Code)); + "UCBContentHelper::MakeFolder(" << title << ")"); } } catch (css::ucb::NameClashException const &) { exists = true; @@ -279,11 +277,9 @@ bool utl::UCBContentHelper::MakeFolder( assert(false && "this cannot happen"); throw; } catch (css::uno::Exception const &) { - css::uno::Any e(cppu::getCaughtException()); - SAL_INFO( + TOOLS_INFO_EXCEPTION( "unotools.ucbhelper", - "UCBContentHelper::MakeFolder(" << title << ") " - << exceptionToString(e)); + "UCBContentHelper::MakeFolder(" << title << ") "); } if (exists) { INetURLObject o(parent.getURL()); |