summaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r--qt-models/diveplannermodel.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 5075453d3..474384d63 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -894,11 +894,12 @@ void DivePlannerPointsModel::createPlan(bool replanCopy)
notesDocument.setHtml(current_dive->notes);
QString oldnotes(notesDocument.toPlainText());
int disclaimerPosition = oldnotes.indexOf(disclaimer);
- if (disclaimerPosition >= 0)
- oldnotes.truncate(disclaimerPosition);
+ if (disclaimerPosition == 0)
+ oldnotes.clear();
+ else if (disclaimerPosition >= 1)
+ oldnotes.truncate(disclaimerPosition-1);
// Deal with line breaks
- notesDocument.setPlainText(oldnotes);
- oldnotes = notesDocument.toHtml();
+ oldnotes.replace("\n", "<br>");
oldnotes.append(displayed_dive.notes);
displayed_dive.notes = strdup(oldnotes.toUtf8().data());
// If we save as new create a copy of the dive here