Delete worthless comments

This commit is contained in:
Thomas Goyne 2013-01-10 20:56:40 -08:00
parent 4334514c78
commit 13851ff74d
1 changed files with 0 additions and 15 deletions

View File

@ -152,11 +152,9 @@ void DialogSearchReplace::UpdateSettings() {
void DialogSearchReplace::FindReplace(int mode) { void DialogSearchReplace::FindReplace(int mode) {
if (mode < 0 || mode > 2) return; if (mode < 0 || mode > 2) return;
// Variables
wxString LookFor = FindEdit->GetValue(); wxString LookFor = FindEdit->GetValue();
if (!LookFor) return; if (!LookFor) return;
// Setup
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;
@ -164,7 +162,6 @@ void DialogSearchReplace::FindReplace(int mode) {
Search.affect = Affect->GetSelection(); Search.affect = Affect->GetSelection();
Search.field = Field->GetSelection(); Search.field = Field->GetSelection();
// Find
if (mode == 0) { if (mode == 0) {
Search.FindNext(); Search.FindNext();
if (hasReplace) { if (hasReplace) {
@ -173,8 +170,6 @@ void DialogSearchReplace::FindReplace(int mode) {
config::mru->Add("Replace", from_wx(ReplaceWith)); config::mru->Add("Replace", from_wx(ReplaceWith));
} }
} }
// Replace
else { else {
wxString ReplaceWith = ReplaceEdit->GetValue(); wxString ReplaceWith = ReplaceEdit->GetValue();
Search.ReplaceWith = ReplaceWith; Search.ReplaceWith = ReplaceWith;
@ -183,7 +178,6 @@ void DialogSearchReplace::FindReplace(int mode) {
config::mru->Add("Replace", from_wx(ReplaceWith)); config::mru->Add("Replace", from_wx(ReplaceWith));
} }
// Add to history
config::mru->Add("Find", from_wx(LookFor)); config::mru->Add("Find", from_wx(LookFor));
UpdateDropDowns(); UpdateDropDowns();
} }
@ -273,7 +267,6 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
else else
tempPos = pos+replaceLen; tempPos = pos+replaceLen;
// RegExp
if (isReg) { if (isReg) {
wxRegEx regex (LookFor,regFlags); wxRegEx regex (LookFor,regFlags);
if (regex.IsValid()) { if (regex.IsValid()) {
@ -285,8 +278,6 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
} }
} }
} }
// Normal
else { else {
wxString src = Text->get().Mid(tempPos); wxString src = Text->get().Mid(tempPos);
if (!matchCase) src.MakeLower(); if (!matchCase) src.MakeLower();
@ -309,7 +300,6 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
} }
} }
// Found
if (found) { if (found) {
if (!DoReplace) if (!DoReplace)
replaceLen = matchLen; replaceLen = matchLen;
@ -352,19 +342,16 @@ void SearchReplaceEngine::ReplaceAll() {
if (isReg) if (isReg)
reg.Compile(LookFor, regFlags); reg.Compile(LookFor, regFlags);
// Selection
SubtitleSelection const& sel = context->selectionController->GetSelectedSet(); SubtitleSelection const& sel = context->selectionController->GetSelectedSet();
bool hasSelection = !sel.empty(); bool hasSelection = !sel.empty();
bool inSel = affect == 1; bool inSel = affect == 1;
for (auto diag : context->ass->Line | agi::of_type<AssDialogue>()) { for (auto diag : context->ass->Line | agi::of_type<AssDialogue>()) {
// Check if row is selected
if (inSel && hasSelection && !sel.count(diag)) if (inSel && hasSelection && !sel.count(diag))
continue; continue;
boost::flyweight<wxString> *Text = get_text(diag, field); boost::flyweight<wxString> *Text = get_text(diag, field);
// Regular expressions
if (isReg) { if (isReg) {
if (reg.Matches(*Text)) { if (reg.Matches(*Text)) {
size_t start, len; size_t start, len;
@ -378,7 +365,6 @@ void SearchReplaceEngine::ReplaceAll() {
*Text = repl; *Text = repl;
} }
} }
// Normal replace
else { else {
if (!Search.matchCase) { if (!Search.matchCase) {
bool replaced = false; bool replaced = false;
@ -424,7 +410,6 @@ void SearchReplaceEngine::OnDialogOpen() {
curLine = 0; curLine = 0;
if (sels.Count() > 0) curLine = sels[0]; if (sels.Count() > 0) curLine = sels[0];
// Reset values
LastWasFind = true; LastWasFind = true;
pos = 0; pos = 0;
matchLen = 0; matchLen = 0;