From 6b7f8c2129116382c8c67d05164110238845a1e0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 28 Feb 2021 22:26:32 +0300 Subject: some evident reverse iterators moved to cursors --- plugins/BasicHistory/src/HistoryWindow.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/BasicHistory/src') diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 36ea44152a..353de121b9 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -391,11 +391,9 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM hContact, LPARAM) return FALSE; db_set_safety_mode(FALSE); - MEVENT hDbEvent = db_event_last(hContact); - while (hDbEvent != NULL) { - MEVENT hPrevEvent = db_event_prev(hContact, hDbEvent); - hDbEvent = (db_event_delete(hDbEvent) == 0) ? hPrevEvent : NULL; - } + DB::ECPTR cursor(DB::Events(hContact)); + while (cursor.FetchNext()) + cursor.DeleteEvent(); db_set_safety_mode(TRUE); if (HistoryEventList::IsImportedHistory(hContact)) { -- cgit v1.2.3