Kaydet (Commit) 4e124b17 authored tarafından Mike Kaganski's avatar Mike Kaganski

loplugin:unusedindex

Change-Id: Id6e17d00c87d79f899cf691d00e600dfc102cab0
Reviewed-on: https://gerrit.libreoffice.org/46832Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 9c50b0ed
......@@ -352,12 +352,10 @@ namespace i18npool {
// static
Sequence< CalendarItem > LocaleDataImpl::downcastCalendarItems( const Sequence< CalendarItem2 > & rCi )
{
sal_Int32 nSize = rCi.getLength();
Sequence< CalendarItem > aCi( nSize);
Sequence< CalendarItem > aCi(rCi.getLength());
CalendarItem* p1 = aCi.getArray();
const CalendarItem2* p2 = rCi.getConstArray();
for (sal_Int32 i=0; i < nSize; ++i, ++p1, ++p2)
*p1 = *p2;
for (const CalendarItem2& r2 : rCi)
*p1++ = r2;
return aCi;
}
......@@ -712,30 +710,29 @@ Sequence< CalendarItem2 > LocaleDataImpl::getCalendarItems(
}
else
{
sal_Int32 nSize = allCalendars[nWhichItem][nCalendar];
const sal_Int32 nSize = allCalendars[nWhichItem][nCalendar];
aItems.realloc( nSize);
CalendarItem2* pItem = aItems.getArray();
switch (nWhichItem)
{
case REF_DAYS:
case REF_MONTHS:
case REF_GMONTHS:
case REF_PMONTHS:
for (sal_Int32 j = 0; j < nSize; ++j, ++pItem)
for (CalendarItem2& rItem : aItems)
{
CalendarItem2 item( allCalendars[rnOffset], allCalendars[rnOffset+1],
allCalendars[rnOffset+2], allCalendars[rnOffset+3]);
*pItem = item;
rItem = item;
rnOffset += 4;
}
break;
case REF_ERAS:
// Absent narrow name.
for (sal_Int32 j = 0; j < nSize; ++j, ++pItem)
for (CalendarItem2& rItem : aItems)
{
CalendarItem2 item( allCalendars[rnOffset], allCalendars[rnOffset+1],
allCalendars[rnOffset+2], OUString());
*pItem = item;
rItem = item;
rnOffset += 3;
}
break;
......@@ -796,13 +793,11 @@ Sequence< Calendar > SAL_CALL
LocaleDataImpl::getAllCalendars( const Locale& rLocale )
{
const Sequence< Calendar2 > aCal2( getAllCalendars2( rLocale));
sal_Int32 nLen = aCal2.getLength();
Sequence< Calendar > aCal1( nLen);
const Calendar2* p2 = aCal2.getConstArray();
Sequence< Calendar > aCal1( aCal2.getLength());
Calendar* p1 = aCal1.getArray();
for (sal_Int32 i=0; i < nLen; ++i, ++p1, ++p2)
for (const Calendar2& r2 : aCal2)
{
*p1 = downcastCalendar( *p2);
*p1++ = downcastCalendar( r2);
}
return aCal1;
}
......@@ -844,13 +839,11 @@ Sequence< Currency > SAL_CALL
LocaleDataImpl::getAllCurrencies( const Locale& rLocale )
{
Sequence< Currency2 > aCur2( getAllCurrencies2( rLocale));
sal_Int32 nLen = aCur2.getLength();
Sequence< Currency > aCur1( nLen);
const Currency2* p2 = aCur2.getArray();
Sequence< Currency > aCur1( aCur2.getLength());
Currency* p1 = aCur1.getArray();
for (sal_Int32 i=0; i < nLen; ++i, ++p1, ++p2)
for (const Currency2& r2 : aCur2)
{
*p1 = *p2;
*p1 = r2;
}
return aCur1;
}
......
......@@ -99,7 +99,7 @@ bool AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int3
if ( len <= number->multiplierExponent[number->exponentCount-1] ) {
if (number->multiplierExponent[number->exponentCount-1] > 1) {
bool bNotZero = false;
for (sal_Int32 i = 0; i < len; i++, begin++) {
for (const sal_Int32 end = begin+len; begin < end; begin++) {
if (bNotZero || str[begin] != NUMBER_ZERO) {
dst[count] = numberChar[str[begin] - NUMBER_ZERO];
if (useOffset)
......@@ -278,7 +278,7 @@ static void NativeToAscii_numberMaker(sal_Int16 max, sal_Int16 prev, const sal_U
}
if (shift) {
count -= max;
for (sal_Int16 j = 0; j < shift; j++, count++) {
for (const sal_Int32 countEnd = count+shift; count < countEnd; count++) {
dst[count] = dst[count + curr];
if (useOffset)
offset[count] = offset[count + curr];
......
......@@ -73,11 +73,12 @@ ignoreDiacritics_CTL::folding(const OUString& rInStr, sal_Int32 nStartPos,
if (nOffset + aUStr.length() > rOffset.getLength())
rOffset.realloc(rOffset.getLength() + aUStr.length());
sal_Int32* pOffset = rOffset.getArray();
aOutBuf.append(reinterpret_cast<const sal_Unicode*>(aUStr.getBuffer()), aUStr.length());
for (int32_t i = 0; i < aUStr.length(); i++)
rOffset[nOffset++] = nPosition;
for (const sal_Int32 nOffsetEnd = nOffset+aUStr.length(); nOffset < nOffsetEnd; nOffset++)
pOffset[nOffset] = nPosition;
nPosition = nIndex;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment