From 199507a58a25c9b46f6d49e19caa96e1840ec408 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 10 Jan 2013 21:33:49 -0800 Subject: [PATCH] Remove an unused variable and rename a misleading one --- aegisub/src/dialog_search_replace.cpp | 9 +++------ aegisub/src/dialog_search_replace.h | 6 +----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/aegisub/src/dialog_search_replace.cpp b/aegisub/src/dialog_search_replace.cpp index b7b5b7e3d..f6fd39253 100644 --- a/aegisub/src/dialog_search_replace.cpp +++ b/aegisub/src/dialog_search_replace.cpp @@ -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, 1), BUTTON_REPLACE_NEXT); 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() { @@ -157,7 +155,7 @@ void DialogSearchReplace::FindReplace(int mode) { Search.isReg = CheckRegExp->IsChecked() && CheckRegExp->IsEnabled(); Search.matchCase = CheckMatchCase->IsChecked(); Search.LookFor = LookFor; - Search.CanContinue = true; + Search.initialized = true; Search.affect = Affect->GetSelection(); Search.field = Field->GetSelection(); @@ -203,8 +201,7 @@ SearchReplaceEngine::SearchReplaceEngine() , hasReplace(false) , isReg(false) , matchCase(false) -, CanContinue(false) -, hasFocus(false) +, initialized(false) , field(0) , affect(0) , context(0) @@ -224,7 +221,7 @@ static boost::flyweight *get_text(AssDialogue *cur, int field) { } void SearchReplaceEngine::ReplaceNext(bool DoReplace) { - if (!CanContinue) { + if (!initialized) { OpenDialog(DoReplace); return; } diff --git a/aegisub/src/dialog_search_replace.h b/aegisub/src/dialog_search_replace.h index 685b6b467..f80ed3959 100644 --- a/aegisub/src/dialog_search_replace.h +++ b/aegisub/src/dialog_search_replace.h @@ -49,8 +49,7 @@ class SearchReplaceEngine { bool hasReplace; bool isReg; bool matchCase; - bool CanContinue; - bool hasFocus; + bool initialized; int field; int affect; wxString LookFor; @@ -65,9 +64,6 @@ public: void OpenDialog(bool HasReplace); void OnDialogOpen(); - void SetFocus(bool focus) { hasFocus = focus; } - bool HasFocus() const { return hasFocus; } - SearchReplaceEngine(); friend class DialogSearchReplace; };