Remove an unused variable and rename a misleading one

This commit is contained in:
Thomas Goyne 2013-01-10 21:33:49 -08:00
parent c923b05c23
commit 199507a58a
2 changed files with 4 additions and 11 deletions

View file

@ -135,8 +135,6 @@ DialogSearchReplace::DialogSearchReplace(agi::Context* c, bool withReplace)
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 0), BUTTON_FIND_NEXT); Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 0), BUTTON_FIND_NEXT);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 1), BUTTON_REPLACE_NEXT); Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 1), BUTTON_REPLACE_NEXT);
Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 2), BUTTON_REPLACE_ALL); Bind(wxEVT_COMMAND_BUTTON_CLICKED, std::bind(&DialogSearchReplace::FindReplace, this, 2), BUTTON_REPLACE_ALL);
Bind(wxEVT_SET_FOCUS, std::bind(&SearchReplaceEngine::SetFocus, &Search, true));
Bind(wxEVT_KILL_FOCUS, std::bind(&SearchReplaceEngine::SetFocus, &Search, false));
} }
DialogSearchReplace::~DialogSearchReplace() { DialogSearchReplace::~DialogSearchReplace() {
@ -157,7 +155,7 @@ void DialogSearchReplace::FindReplace(int mode) {
Search.isReg = CheckRegExp->IsChecked() && CheckRegExp->IsEnabled(); Search.isReg = CheckRegExp->IsChecked() && CheckRegExp->IsEnabled();
Search.matchCase = CheckMatchCase->IsChecked(); Search.matchCase = CheckMatchCase->IsChecked();
Search.LookFor = LookFor; Search.LookFor = LookFor;
Search.CanContinue = true; Search.initialized = true;
Search.affect = Affect->GetSelection(); Search.affect = Affect->GetSelection();
Search.field = Field->GetSelection(); Search.field = Field->GetSelection();
@ -203,8 +201,7 @@ SearchReplaceEngine::SearchReplaceEngine()
, hasReplace(false) , hasReplace(false)
, isReg(false) , isReg(false)
, matchCase(false) , matchCase(false)
, CanContinue(false) , initialized(false)
, hasFocus(false)
, field(0) , field(0)
, affect(0) , affect(0)
, context(0) , context(0)
@ -224,7 +221,7 @@ static boost::flyweight<wxString> *get_text(AssDialogue *cur, int field) {
} }
void SearchReplaceEngine::ReplaceNext(bool DoReplace) { void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
if (!CanContinue) { if (!initialized) {
OpenDialog(DoReplace); OpenDialog(DoReplace);
return; return;
} }

View file

@ -49,8 +49,7 @@ class SearchReplaceEngine {
bool hasReplace; bool hasReplace;
bool isReg; bool isReg;
bool matchCase; bool matchCase;
bool CanContinue; bool initialized;
bool hasFocus;
int field; int field;
int affect; int affect;
wxString LookFor; wxString LookFor;
@ -65,9 +64,6 @@ public:
void OpenDialog(bool HasReplace); void OpenDialog(bool HasReplace);
void OnDialogOpen(); void OnDialogOpen();
void SetFocus(bool focus) { hasFocus = focus; }
bool HasFocus() const { return hasFocus; }
SearchReplaceEngine(); SearchReplaceEngine();
friend class DialogSearchReplace; friend class DialogSearchReplace;
}; };