Changeset 1e6f023 in subsurface


Ignore:
Timestamp:
Apr 24, 2017, 8:35:49 AM (5 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
cd9dc8f
Parents:
9b5d3b6
git-author:
Stefan Fuchs <sfuchs@…> (04/23/17 04:48:47)
git-committer:
Dirk Hohndel <dirk@…> (04/24/17 08:35:49)
Message:

Deal with additional line break in dive notes from planner

With current code when re-planning a dive the planner output in the
dive notes is always moved down by one line.
This fix avoids that this additional line break is added.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/diveplannermodel.cpp

    rdfe50922 r1e6f023  
    895895                QString oldnotes(notesDocument.toPlainText());
    896896                int disclaimerPosition = oldnotes.indexOf(disclaimer);
    897                 if (disclaimerPosition >= 0)
    898                         oldnotes.truncate(disclaimerPosition);
     897                if (disclaimerPosition == 0)
     898                        oldnotes.clear();
     899                else if (disclaimerPosition >= 1)
     900                        oldnotes.truncate(disclaimerPosition-1);
    899901                // Deal with line breaks
    900                 notesDocument.setPlainText(oldnotes);
    901                 oldnotes = notesDocument.toHtml();
     902                oldnotes.replace("\n", "<br>");
    902903                oldnotes.append(displayed_dive.notes);
    903904                displayed_dive.notes = strdup(oldnotes.toUtf8().data());
Note: See TracChangeset for help on using the changeset viewer.