Skip to content
Commit 21d4b1f9 authored by Elvis Stansvik's avatar Elvis Stansvik
Browse files

Ignore default styles in styleApplied.

DockerStylesComboModel::styleApplied may be called with the default
paragraph style as argument.

The function assumes that the source model can provide an index for the
supplied style (see the calls to indexForCharacterStyle). But the source
model explicitly avoids adding items for the default styles, so these
calls will return an invalid index, which results in a -1 being added as
a row to m_usedStyles. In the next call to styleApplied, this will
result in an invalid internalId being used to try to get the
corresponding style from the style manager. The invalid style pointer is
then used, resulting in the crash described in the bug.

This fix turns DockerStylesComboModel::styleApplied into a no-op if the
supplied style is either the default character style or the default
paragraph styles, since there will never be any items for these in the
source model.

BUG: 319048
REVIEW: 110506
parent 5550755b
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