tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 999, 1003
V1037 Two or more case-branches perform the same actions. Check lines: 1557, 1566, 1595
V1037 Two or more case-branches perform the same actions. Check lines: 2593, 2689

Change-Id: I0a3ab375e9e8c72802615108948c96808a2ec0b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175208
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
This commit is contained in:
Bogdan Buzea 2024-10-19 14:18:12 +02:00 committed by David Gilbert
parent c4052eaa4e
commit cd398f3e74

View file

@ -996,9 +996,6 @@ short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
} }
break; break;
case SsGetStar: case SsGetStar:
eState = SsStop;
sSymbolBuffer.append(OUStringChar(cToken));
break;
case SsGetBlank: case SsGetBlank:
eState = SsStop; eState = SsStop;
sSymbolBuffer.append(OUStringChar(cToken)); sSymbolBuffer.append(OUStringChar(cToken));
@ -1554,18 +1551,11 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
} }
break; break;
case SvNumFormatType::PERCENT: case SvNumFormatType::PERCENT:
switch (eNewType)
{
case SvNumFormatType::NUMBER: // Only number to percent
break;
default:
return nPos;
}
break;
case SvNumFormatType::SCIENTIFIC: case SvNumFormatType::SCIENTIFIC:
case SvNumFormatType::FRACTION:
switch (eNewType) switch (eNewType)
{ {
case SvNumFormatType::NUMBER: // Only number to E case SvNumFormatType::NUMBER:
break; break;
default: default:
return nPos; return nPos;
@ -1591,15 +1581,6 @@ sal_Int32 ImpSvNumberformatScan::ScanType()
} }
} }
break; break;
case SvNumFormatType::FRACTION:
switch (eNewType)
{
case SvNumFormatType::NUMBER: // Only number to fraction
break;
default:
return nPos;
}
break;
default: default:
break; break;
} }
@ -2590,6 +2571,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
{ {
case NF_SYMBOLTYPE_BLANK: case NF_SYMBOLTYPE_BLANK:
case NF_SYMBOLTYPE_STAR: case NF_SYMBOLTYPE_STAR:
case NF_SYMBOLTYPE_STRING:
nPos = nPos + sStrArray[i].getLength(); nPos = nPos + sStrArray[i].getLength();
i++; i++;
break; break;
@ -2685,10 +2667,6 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString )
break; break;
} }
break; break;
case NF_SYMBOLTYPE_STRING:
nPos = nPos + sStrArray[i].getLength();
i++;
break;
case NF_KEY_AMPM: // AM/PM case NF_KEY_AMPM: // AM/PM
case NF_KEY_AP: // A/P case NF_KEY_AP: // A/P
bExp = true; // Abuse for A/P bExp = true; // Abuse for A/P