Actions
Bug #10976
closedWAbstractItemView#setHeaderAlignment does not update vertical alignment
Start date:
09/27/2022
Due date:
% Done:
100%
Estimated time:
Description
When setHeaderAlignment
is used the vertical alignment is not updated. This is due to a translation error from Wt to JWt:
if (alignment.test(AlignVerticalMask))
Is translated to:
if (alignment.contains(AlignmentFlag.AlignVerticalMask))
The latter is always false, since EnumSet<AlignmentFlag>
will only ever contain AlignmentFlag
s, not EnumSet<AlignmentFlag>
s.
We get the correct translation when the C++ code is changed to:
if (!(alignment & AlignVerticalMask).empty())
The original code incidentally works in C++, since the type of AlignVerticalMask
(WFlags<AlignmentFlag>
) gets implicitly converted to AlignmentFlag
. We may want to consider making this explicit, to avoid more errors like this.
Actions