QSvgHandler: enable -Wswitch in parseFontSize()


Coverity keeps complaining that sizeTable[spec] accesses sizeTable[7]
out of bounds. It's not your typical "enums can contain more values
than are enumerated" issue, since the Coverity Occurrence trace says
that 'spec' is in the range [1,8].

This is objectively wrong: fontSizeSpec() returns all enumerated
values of FontSizeSpec, and there are nine of them, so the range is
[0,8]. The last two are FontSizeNone and FontSizeValue, handled
separately, so what we use to index into sizeTable is [0,6], which is
never out of bounds for a seven-element array.

In the spirit of "if the tool doesn't understand the code, a human
won't, either", enable -Wswitch in the function by replacing the
default case label with a list of explicit enumerators. Hopefully this
will make Coverity see the light, but at least it will cause a -Werror
when at some point Larger and Smaller are added without adjusting the
switch.

Amends 967536c12d8a8684899117aafd63faf8d831b656 (5.11).

Pick-to: 6.12 6.11 6.8
Coverity-Id: 911288
Change-Id: I7d75e07b3655889cf207f1a448d61855f560f85c
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commit90259ea5137e474be62c743b64969dfa15ec7d4e
parentea765682d9cddf2fad94a3f9c2043a44b6613672
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeMon, 13 Jul 2026 07:08:23 +0000