KWPageManager::pages question

Friedrich W. H. Kossebau kossebau at kde.org
Sat Dec 5 13:24:43 GMT 2015


Hi Thorsten,

Am Samstag, 5. Dezember 2015, 06:24:11 schrieb Thorsten Zachmann:
[snip]
> Is it ok to add that or is the comment wrong and I could use the sort inside
> cstester. I don't know if any other code depends on the pages being sorted

Looks like some code expects the pages ordered by page order, e.g.
KWDocument::updatePagesForStyle(const KWPageStyle &style)
KWOdfWriter::save(KoOdfWriteStore &odfStore, KoEmbeddedDocumentSaver 
&embeddedSaver)
KWViewModeNormal::updatePageCache()

So fixing the implementation of KWPageManager::pages(...) to return the list 
sorted might be needed in general, yes.
Not sure though by what is should be sorted. pageNumber or pageId. The latter 
is what is used by KWPage compare operators currently.

Would need more investigation... but good catch for now at least.

And I would prefer a qSort over std::sort, at least for now for consistency in 
the code.
Given newer C++ standards etc. it might be time to reconsider the Calligra 
coding standards perhaps, e.g. Krita have a nice shot at it with 
https://community.kde.org/Krita/C%2B%2B11

Cheers
Friedrich



More information about the calligra-devel mailing list