diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-24 08:54:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-24 15:06:24 +0100 |
commit | ceb8f5d62c7afc5547c9a6de8eb570a11b5fbd67 (patch) | |
tree | 2782cb4bb3adfe5ad11caa8f5a9c18b82bb03ee4 /unotools | |
parent | 86fac2109d3b5e159628aee6392ecc856fb8a5a6 (diff) |
loplugin:constantparam
Change-Id: I86592be0717c062a918108bf4437074b0f70b372
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 96ad86d4b76a..904808c6a247 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -972,16 +972,13 @@ static void ImplAddNum( OUStringBuffer& rBuf, sal_Int64 nNumber, int nMinLen ) return ImplAddUNum( rBuf, nNumber, nMinLen); } -static void ImplAdd2UNum( OUStringBuffer& rBuf, sal_uInt16 nNumber, bool bLeading ) +static void ImplAdd2UNum( OUStringBuffer& rBuf, sal_uInt16 nNumber ) { DBG_ASSERT( nNumber < 100, "ImplAdd2UNum() - Number >= 100" ); if ( nNumber < 10 ) { - if ( bLeading ) - { - rBuf.append('0'); - } + rBuf.append('0'); rBuf.append(static_cast<char>(nNumber + '0')); } else @@ -1124,25 +1121,25 @@ OUString LocaleDataWrapper::getDate( const Date& rDate ) const switch ( getDateOrder() ) { case DateOrder::DMY : - ImplAdd2UNum( aBuf, nDay, true /* IsDateDayLeadingZero() */ ); + ImplAdd2UNum( aBuf, nDay ); aBuf.append( aLocaleDataItem.dateSeparator ); - ImplAdd2UNum( aBuf, nMonth, true /* IsDateMonthLeadingZero() */ ); + ImplAdd2UNum( aBuf, nMonth ); aBuf.append( aLocaleDataItem.dateSeparator ); ImplAddNum( aBuf, nYear, nYearLen ); break; case DateOrder::MDY : - ImplAdd2UNum( aBuf, nMonth, true /* IsDateMonthLeadingZero() */ ); + ImplAdd2UNum( aBuf, nMonth ); aBuf.append( aLocaleDataItem.dateSeparator ); - ImplAdd2UNum( aBuf, nDay, true /* IsDateDayLeadingZero() */ ); + ImplAdd2UNum( aBuf, nDay ); aBuf.append( aLocaleDataItem.dateSeparator ); ImplAddNum( aBuf, nYear, nYearLen ); break; default: ImplAddNum( aBuf, nYear, nYearLen ); aBuf.append( aLocaleDataItem.dateSeparator ); - ImplAdd2UNum( aBuf, nMonth, true /* IsDateMonthLeadingZero() */ ); + ImplAdd2UNum( aBuf, nMonth ); aBuf.append( aLocaleDataItem.dateSeparator ); - ImplAdd2UNum( aBuf, nDay, true /* IsDateDayLeadingZero() */ ); + ImplAdd2UNum( aBuf, nDay ); } return aBuf.makeStringAndClear(); @@ -1156,13 +1153,13 @@ OUString LocaleDataWrapper::getTime( const tools::Time& rTime, bool bSec, bool b nHour %= 24; - ImplAdd2UNum( aBuf, nHour, true /* IsTimeLeadingZero() */ ); + ImplAdd2UNum( aBuf, nHour ); aBuf.append( aLocaleDataItem.timeSeparator ); - ImplAdd2UNum( aBuf, rTime.GetMin(), true ); + ImplAdd2UNum( aBuf, rTime.GetMin() ); if ( bSec ) { aBuf.append( aLocaleDataItem.timeSeparator ); - ImplAdd2UNum( aBuf, rTime.GetSec(), true ); + ImplAdd2UNum( aBuf, rTime.GetSec() ); if ( b100Sec ) { @@ -1186,11 +1183,11 @@ OUString LocaleDataWrapper::getDuration( const tools::Time& rTime, bool bSec, bo else ImplAddUNum( aBuf, rTime.GetHour() ); aBuf.append( aLocaleDataItem.timeSeparator ); - ImplAdd2UNum( aBuf, rTime.GetMin(), true ); + ImplAdd2UNum( aBuf, rTime.GetMin() ); if ( bSec ) { aBuf.append( aLocaleDataItem.timeSeparator ); - ImplAdd2UNum( aBuf, rTime.GetSec(), true ); + ImplAdd2UNum( aBuf, rTime.GetSec() ); if ( b100Sec ) { |