KWPageManager::pages question

Thorsten Zachmann t.zachmann at zagge.de
Sun Dec 6 06:04:08 GMT 2015


On Saturday, December 05, 2015 02:24:43 PM Friedrich W. H. Kossebau wrote:
> 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.

At least for what it is used in cstester that is fine. I will commit it as 
that for now. If we find we need something different we can still update that.

> And I would prefer a qSort over std::sort, at least for now for consistency
> in the code.

qSort is deprecated in Qt5 and I think we should try to move away from 
deprecated stuff.

> 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

Thorrsten



More information about the calligra-devel mailing list