tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 438, 446
V1037 Two or more case-branches perform the same actions. Check lines: 442, 450
V1037 Two or more case-branches perform the same actions. Check lines: 483, 659
V1037 Two or more case-branches perform the same actions. Check lines: 492, 896
V1037 Two or more case-branches perform the same actions. Check lines: 501, 791, 944
V1037 Two or more case-branches perform the same actions. Check lines: 549, 725
V1037 Two or more case-branches perform the same actions. Check lines: 552, 842
V1037 Two or more case-branches perform the same actions. Check lines: 618, 642
V1037 Two or more case-branches perform the same actions. Check lines: 648, 734
V1037 Two or more case-branches perform the same actions. Check lines: 698, 854
V1037 Two or more case-branches perform the same actions. Check lines: 974, 977

Change-Id: Iadd03f3813deaffcebdb1a661489b86b83bf9d5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175219
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
This commit is contained in:
Bogdan Buzea 2024-10-19 18:29:16 +02:00 committed by David Gilbert
parent dea5d561ba
commit 1b8c22c319

View file

@ -435,16 +435,12 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
{ {
case USCRIPT_CODE_LIMIT: case USCRIPT_CODE_LIMIT:
case USCRIPT_INVALID_CODE: case USCRIPT_INVALID_CODE:
sRet = "zxx"_ostr;
break;
case USCRIPT_COMMON:
case USCRIPT_INHERITED:
sRet = "und"_ostr;
break;
case USCRIPT_MATHEMATICAL_NOTATION: case USCRIPT_MATHEMATICAL_NOTATION:
case USCRIPT_SYMBOLS: case USCRIPT_SYMBOLS:
sRet = "zxx"_ostr; sRet = "zxx"_ostr;
break; break;
case USCRIPT_COMMON:
case USCRIPT_INHERITED:
case USCRIPT_UNWRITTEN_LANGUAGES: case USCRIPT_UNWRITTEN_LANGUAGES:
case USCRIPT_UNKNOWN: case USCRIPT_UNKNOWN:
sRet = "und"_ostr; sRet = "und"_ostr;
@ -480,6 +476,7 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
sRet = "am"_ostr; sRet = "am"_ostr;
break; break;
case USCRIPT_GEORGIAN: case USCRIPT_GEORGIAN:
case USCRIPT_KHUTSURI:
sRet = "ka"_ostr; sRet = "ka"_ostr;
break; break;
case USCRIPT_GOTHIC: case USCRIPT_GOTHIC:
@ -489,6 +486,7 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
sRet = "el"_ostr; sRet = "el"_ostr;
break; break;
case USCRIPT_GUJARATI: case USCRIPT_GUJARATI:
case USCRIPT_KHOJKI:
sRet = "gu"_ostr; sRet = "gu"_ostr;
break; break;
case USCRIPT_GURMUKHI: case USCRIPT_GURMUKHI:
@ -498,7 +496,9 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
sRet = "zh"_ostr; sRet = "zh"_ostr;
break; break;
case USCRIPT_HANGUL: case USCRIPT_HANGUL:
sRet = "ko"_ostr; case USCRIPT_KOREAN:
case USCRIPT_JAMO:
sRet = "ko"_ostr; // Jamo - elements of Hangul Syllables
break; break;
case USCRIPT_HEBREW: case USCRIPT_HEBREW:
sRet = "hr"_ostr; sRet = "hr"_ostr;
@ -546,9 +546,11 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
sRet = "si"_ostr; sRet = "si"_ostr;
break; break;
case USCRIPT_SYRIAC: case USCRIPT_SYRIAC:
case USCRIPT_ESTRANGELO_SYRIAC:
sRet = "syr"_ostr; sRet = "syr"_ostr;
break; break;
case USCRIPT_TAMIL: case USCRIPT_TAMIL:
case USCRIPT_GRANTHA:
sRet = "ta"_ostr; sRet = "ta"_ostr;
break; break;
case USCRIPT_TELUGU: case USCRIPT_TELUGU:
@ -615,6 +617,7 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
sRet = "ch"_ostr; sRet = "ch"_ostr;
break; break;
case USCRIPT_KHAROSHTHI: case USCRIPT_KHAROSHTHI:
case USCRIPT_BRAHMI:
sRet = "pra"_ostr; sRet = "pra"_ostr;
break; break;
case USCRIPT_SYLOTI_NAGRI: case USCRIPT_SYLOTI_NAGRI:
@ -638,13 +641,11 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_BLISSYMBOLS: case USCRIPT_BLISSYMBOLS:
sRet = "en"_ostr; sRet = "en"_ostr;
break; break;
case USCRIPT_BRAHMI:
sRet = "pra"_ostr;
break;
case USCRIPT_CHAM: case USCRIPT_CHAM:
sRet = "cja"_ostr; sRet = "cja"_ostr;
break; break;
case USCRIPT_CIRTH: case USCRIPT_CIRTH:
case USCRIPT_TENGWAR:
sRet = "sjn"_ostr; sRet = "sjn"_ostr;
break; break;
case USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC: case USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC:
@ -655,9 +656,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_EGYPTIAN_HIEROGLYPHS: case USCRIPT_EGYPTIAN_HIEROGLYPHS:
sRet = "egy"_ostr; sRet = "egy"_ostr;
break; break;
case USCRIPT_KHUTSURI:
sRet = "ka"_ostr;
break;
case USCRIPT_SIMPLIFIED_HAN: case USCRIPT_SIMPLIFIED_HAN:
sRet = "zh"_ostr; sRet = "zh"_ostr;
break; break;
@ -694,6 +692,7 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_MAYAN_HIEROGLYPHS: case USCRIPT_MAYAN_HIEROGLYPHS:
sRet = "myn"_ostr; sRet = "myn"_ostr;
break; break;
case USCRIPT_MEROITIC_CURSIVE:
case USCRIPT_MEROITIC: case USCRIPT_MEROITIC:
sRet = "xmr"_ostr; sRet = "xmr"_ostr;
break; break;
@ -721,18 +720,12 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_SARATI: case USCRIPT_SARATI:
sRet = "qya"_ostr; sRet = "qya"_ostr;
break; break;
case USCRIPT_ESTRANGELO_SYRIAC:
sRet = "syr"_ostr;
break;
case USCRIPT_WESTERN_SYRIAC: case USCRIPT_WESTERN_SYRIAC:
sRet = "tru"_ostr; sRet = "tru"_ostr;
break; break;
case USCRIPT_EASTERN_SYRIAC: case USCRIPT_EASTERN_SYRIAC:
sRet = "aii"_ostr; sRet = "aii"_ostr;
break; break;
case USCRIPT_TENGWAR:
sRet = "sjn"_ostr;
break;
case USCRIPT_VAI: case USCRIPT_VAI:
sRet = "vai"_ostr; sRet = "vai"_ostr;
break; break;
@ -787,9 +780,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_CHAKMA: case USCRIPT_CHAKMA:
sRet = "ccp"_ostr; sRet = "ccp"_ostr;
break; break;
case USCRIPT_KOREAN:
sRet = "ko"_ostr;
break;
case USCRIPT_KAITHI: case USCRIPT_KAITHI:
sRet = "awa"_ostr; sRet = "awa"_ostr;
break; break;
@ -838,9 +828,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_ELBASAN: case USCRIPT_ELBASAN:
sRet = "sq"_ostr; sRet = "sq"_ostr;
break; break;
case USCRIPT_GRANTHA:
sRet = "ta"_ostr;
break;
case USCRIPT_KPELLE: case USCRIPT_KPELLE:
sRet = "kpe"_ostr; sRet = "kpe"_ostr;
break; break;
@ -850,9 +837,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_MENDE: case USCRIPT_MENDE:
sRet = "men"_ostr; sRet = "men"_ostr;
break; break;
case USCRIPT_MEROITIC_CURSIVE:
sRet = "xmr"_ostr;
break;
case USCRIPT_OLD_NORTH_ARABIAN: case USCRIPT_OLD_NORTH_ARABIAN:
sRet = "xna"_ostr; sRet = "xna"_ostr;
break; break;
@ -892,9 +876,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_ANATOLIAN_HIEROGLYPHS: case USCRIPT_ANATOLIAN_HIEROGLYPHS:
sRet = "hlu"_ostr; sRet = "hlu"_ostr;
break; break;
case USCRIPT_KHOJKI:
sRet = "gu"_ostr;
break;
case USCRIPT_TIRHUTA: case USCRIPT_TIRHUTA:
sRet = "mai"_ostr; sRet = "mai"_ostr;
break; break;
@ -940,9 +921,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
case USCRIPT_HAN_WITH_BOPOMOFO: case USCRIPT_HAN_WITH_BOPOMOFO:
sRet = "mis-Hanb"_ostr; // Han with Bopomofo, zh-Hanb ? sRet = "mis-Hanb"_ostr; // Han with Bopomofo, zh-Hanb ?
break; break;
case USCRIPT_JAMO:
sRet = "ko"_ostr; // Jamo - elements of Hangul Syllables
break;
case USCRIPT_SYMBOLS_EMOJI: case USCRIPT_SYMBOLS_EMOJI:
sRet = "mis-Zsye"_ostr; // Emoji variant sRet = "mis-Zsye"_ostr; // Emoji variant
break; break;
@ -971,8 +949,6 @@ OString unicode::getExemplarLanguageForUScriptCode(UScriptCode eScript)
sRet = "rhg"_ostr; sRet = "rhg"_ostr;
break; break;
case USCRIPT_SOGDIAN: case USCRIPT_SOGDIAN:
sRet = "sog"_ostr;
break;
case USCRIPT_OLD_SOGDIAN: case USCRIPT_OLD_SOGDIAN:
sRet = "sog"_ostr; sRet = "sog"_ostr;
break; break;