Skip to content

Commit

Permalink
Allow also to search for selected text
Browse files Browse the repository at this point in the history
Instead of using only the text of the whole cell, allow also to use only the part of cell text that is selected.
  • Loading branch information
tobiolo committed Jan 6, 2024
1 parent e69bebf commit 797f02d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,10 @@ struct Document {
case A_SEARCHPREV: {
if (sys->searchstring.Len()) return SearchNext(dc, false, true, k == A_SEARCHPREV);
if (Cell *c = selected.GetCell()) {
if (!c->text.t.Len()) return _(L"No text in this cell.");
wxString str = c->text.ToText(0, selected, A_EXPTEXT);
if (!str.Len()) return _(L"No text to search for.");
sys->frame->filter->SetFocus();
sys->frame->filter->SetValue(c->text.t);
sys->frame->filter->SetValue(str);
return nullptr;
} else {
return _(L"You need to select one cell if you want to search for its text.");
Expand Down

0 comments on commit 797f02d

Please sign in to comment.