Skip to content

Commit

Permalink
Fixed bug in bookmak editor (set first/last actions) of the tk::FileD…
Browse files Browse the repository at this point in the history
…ialog widget
  • Loading branch information
sadko4u committed Sep 11, 2024
1 parent 9f1ff4a commit eaa4b6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

=== 1.0.24 ===
* Added aggregate size computation (enabled by default) for tk::TabControl widget.
* Fixed bug in bookmak editor (set first/last actions) of the tk::FileDialog widget.

=== 1.0.23 ===
* Added header support by tk::LedMeterChannel.
Expand Down
20 changes: 12 additions & 8 deletions src/main/widgets/dialogs/FileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,13 @@ namespace lsp
if (bm == NULL)
return STATUS_OK;

bm_entry_t **dst = _this->vBookmarks.prepend((bm_entry_t *)(NULL));
if (dst == NULL)
ssize_t index = _this->vBookmarks.index_of(bm);
if (index < 0)
return STATUS_OK;

if (!_this->vBookmarks.prepend(bm))
return STATUS_UNKNOWN_ERR;
_this->vBookmarks.premove(bm);
*dst = bm;
_this->vBookmarks.remove(index + 1);

return _this->sync_bookmarks();
}
Expand All @@ -1338,11 +1340,13 @@ namespace lsp
if (bm == NULL)
return STATUS_OK;

bm_entry_t **dst = _this->vBookmarks.append((bm_entry_t *)(NULL));
if (dst == NULL)
ssize_t index = _this->vBookmarks.index_of(bm);
if (index < 0)
return STATUS_OK;

if (!_this->vBookmarks.append(bm))
return STATUS_UNKNOWN_ERR;
_this->vBookmarks.premove(bm);
*dst = bm;
_this->vBookmarks.remove(index);

return _this->sync_bookmarks();
}
Expand Down

0 comments on commit eaa4b6e

Please sign in to comment.