diff options
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index ec4065d85..5bcc07cf9 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -856,12 +856,11 @@ void MainTab::rejectChanges() // this macro is rather fragile and is intended to be used as WHAT inside // an invocation of EDIT_SELECTED_DIVES(WHAT) -#define EDIT_TEXT(what, text) \ - if ((!mydive->what && !current_dive->what) || \ - (mydive->what && current_dive->what && strcmp(mydive->what, current_dive->what) == 0)) { \ - QByteArray textByteArray = text.toUtf8(); \ - free(mydive->what); \ - mydive->what = strdup(textByteArray.data()); \ +#define EDIT_TEXT(what, text) \ + if (same_string(mydive->what, current_dive->what)) { \ + QByteArray textByteArray = text.toUtf8(); \ + free(mydive->what); \ + mydive->what = strdup(textByteArray.data()); \ } #define EDIT_VALUE(what, value) \ |