Changeset c257144 in subsurface


Ignore:
Timestamp:
Apr 18, 2017, 6:13:52 PM (3 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
5e67a93
Parents:
58a25d3
git-author:
Stefan Fuchs <sfuchs@…> (04/18/17 14:35:43)
git-committer:
Dirk Hohndel <dirk@…> (04/18/17 18:13:52)
Message:

Fix a crash in the URL handling for the dive notes

URLs in the dive notes are detected today. A tooltip is displayed and
one can follow the URL by Ctrl-click.

In the function fromCursorTilWhitespace there is an issue with incorrect
return value of Qt (5.7?!) function cursor->movePosition(). This value is
erroneous true in some condition e.g. if the cursor is inside a table at
the very beginning or the very end of a table line and not moving any more.
This can cause the function end up in an infinite loop.

Bugfix adds an additional exit criteria for the loop if the string is
not growing any more.

Signed-off-by: Stefan Fuchs <sfuchs@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/simplewidgets.cpp

    r2b5a235 rc257144  
    749749        QString noSpaces;
    750750        bool movedOk = false;
     751        int oldSize = -1;
    751752
    752753        do {
     
    760761
    761762                grownText = cursor->selectedText();
     763                if (grownText.size() == oldSize) movedOk = false;
     764                oldSize = grownText.size();
    762765                noSpaces = grownText.simplified().replace(" ", "");
    763766        } while (grownText == noSpaces && movedOk);
Note: See TracChangeset for help on using the changeset viewer.