[textlayout] Do not enter infinite loop when line rect is not valid
ClosedPublic

Authored by anthonyfieroni on Dec 24 2017, 8:41 AM.

Details

Summary

If lineRect is not valid getLineRect *never* will return a valid rect which will hangs application.

Test Plan

Diff Detail

Repository
R8 Calligra
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
anthonyfieroni requested review of this revision.Dec 24 2017, 8:41 AM
anthonyfieroni created this revision.
anthonyfieroni removed a reviewer: Calligra: 3.0.
anthonyfieroni removed a project: Calligra: 3.0.

Revert qFuzzyIsNull, other part of project don't use it.

Restricted Application added a project: Calligra: 3.0. · View Herald TranscriptDec 28 2017, 7:16 PM
Restricted Application added a project: Calligra: 3.0. · View Herald TranscriptDec 28 2017, 7:17 PM
boemann requested changes to this revision.Dec 28 2017, 9:09 PM
boemann added inline comments.
libs/textlayout/RunAroundHelper.cpp
106

By removing this the lineRect doesn't change when maxLineHeight changes (which iirc it does in getLineRect())
Can you please make sure that we are not introducing a regression over this

And yes i know there should have been unit tests alread (maybe you could add some pls)

This revision now requires changes to proceed.Dec 28 2017, 9:09 PM
anthonyfieroni added inline comments.Dec 29 2017, 6:46 AM
libs/textlayout/RunAroundHelper.cpp
106

maxLineHeight is not changed, the code is same, i notice that creating new rect every time is significantly slower.

boemann accepted this revision.Dec 29 2017, 2:48 PM

Ok - good work

This revision is now accepted and ready to land.Dec 29 2017, 2:48 PM
This revision was automatically updated to reflect the committed changes.