summaryrefslogtreecommitdiff
path: root/unotools/source/i18n
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-18 09:33:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-18 10:31:43 +0200
commit70accc2904edb5c4aa9b5acb7ff2889a77717b75 (patch)
treef6b8aa6e318694b8fe81b40abcf115e4fe54230f /unotools/source/i18n
parentb8775ff8961dbe589799ac7f59427a8e5d07ac72 (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/source/i18n')
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx87
-rw-r--r--unotools/source/i18n/charclass.cxx9
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx41
-rw-r--r--unotools/source/i18n/transliterationwrapper.cxx17
4 files changed, 79 insertions, 75 deletions
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;
}