<div dir="ltr">Hi again,<div><br></div><div style>Some more questions about the style manager :)</div><div style><br></div><div style>The style manager currently contains, among other things:</div><div style><br></div><div style>
<div>    QHash<int, KoCharacterStyle*> charStyles;</div><div>    QHash<int, KoParagraphStyle*> paragStyles;</div><div><div>    QHash<int, KoParagraphStyle *> unusedParagraphStyles;</div></div><div><div>    QVector<int> m_usedCharacterStyles;</div>
<div>    QVector<int> m_usedParagraphStyles;</div></div><div><br></div><div style>The first two are the ones that holds all char/parag styles currently in the manager, and they have been there since a long time.</div>
<div style><br></div><div style>The unusedParagraphStyles, along with the associated API addUnusedStyle(...) and moveToUsedStyles(...) was added later by Gopalakrishna.</div><div style><br></div><div style>The last two are the most recently added, by Pierre, for use in the DockerStylesComboModel.</div>
<div style><br></div><div style>Taking a paragraph style as example, when it is added to the manager normally using add(...), it's added to paragStyles, and if it's used (isApplied() returns true), its ID is also added to m_usedParagraphStyles. The manager also starts listening on the styleApplied signal of the style, and adds the ID to m_usedParagraphStyles when the signal fires. It also seems that these IDs are never removed from m_usedParagraphStyles, but since style IDs are monotonically increasing, I don't think this is a practical problem (just a slight memory/performance bug).</div>
<div style><br></div><div style>However, in <span style="color:rgb(0,0,0)">KoStyleManager</span><span style="color:rgb(0,0,0)">::</span><span style="color:rgb(0,0,0)">moveToUsedStyles(...), which seems to be used for transporting a style from </span><font color="#000000">unusedParagraphStyles into paragStyles, the corresponding ID is never added to </font>m_usedParagraphStyles, and the manager does not connect to the styleApplied signal. Is this a bug or intended?</div>
<div style><br></div><div style>It would be great if someone who's more experienced with the SM could shed some light on the motivation for these different containers, and also point out if I have gotten something wrong.</div>
<div style><br></div><div style>Cheers,</div><div style>Elvis</div>
</div></div>