Kill AssDialogue::UpdateData, which last had a non-empty body 3.5 years ago

Originally committed to SVN as r4525.
This commit is contained in:
Thomas Goyne 2010-06-16 06:20:19 +00:00
parent 8086fae633
commit 392ce99083
17 changed files with 1 additions and 87 deletions

View file

@ -63,7 +63,6 @@ AssDialogue::AssDialogue()
group = L"[Events]"; group = L"[Events]";
Valid = true; Valid = true;
for (int i=0;i<4;i++) Margin[i] = 0; for (int i=0;i<4;i++) Margin[i] = 0;
UpdateData();
} }
/// @brief DOCME /// @brief DOCME
@ -94,8 +93,6 @@ AssDialogue::AssDialogue(wxString _data,int version)
if (!Valid) { if (!Valid) {
throw _T("Failed parsing line."); throw _T("Failed parsing line.");
} }
UpdateData();
} }
/// @brief Destructor /// @brief Destructor
@ -253,10 +250,6 @@ wxString AssDialogue::MakeData() {
return final; return final;
} }
/// @brief Update AssDialogue's data line
void AssDialogue::UpdateData () {
}
/// @brief Get entry data /// @brief Get entry data
/// @return /// @return
const wxString AssDialogue::GetEntryData() { const wxString AssDialogue::GetEntryData() {
@ -432,10 +425,6 @@ void AssDialogue::ParseSRTTags () {
// Remove double tagging // Remove double tagging
Text.Replace(_T("}{"),_T("")); Text.Replace(_T("}{"),_T(""));
// Update all stuff
//if (total > 0) UpdateText();
UpdateData();
} }
/// @brief Parse ASS tags /// @brief Parse ASS tags
@ -565,7 +554,6 @@ void AssDialogue::StripTag (wxString tagName) {
// Update // Update
ClearBlocks(); ClearBlocks();
Text = final; Text = final;
UpdateData();
} }
/// @brief TODO: Improve this code ------------------- Convert tags to SRT /// @brief TODO: Improve this code ------------------- Convert tags to SRT
@ -664,7 +652,6 @@ void AssDialogue::ConvertTagsToSRT () {
final += _T("</s>"); final += _T("</s>");
Text = final; Text = final;
UpdateData();
ClearBlocks(); ClearBlocks();
} }

View file

@ -243,7 +243,6 @@ public:
void StripTag(wxString tagName);// Strips a specific tag from the text void StripTag(wxString tagName);// Strips a specific tag from the text
wxString GetStrippedText() const; // Gets text without tags wxString GetStrippedText() const; // Gets text without tags
void UpdateData(); // Updates raw data from current values + text
void UpdateText(); // Generates text from the override tags void UpdateText(); // Generates text from the override tags
const wxString GetEntryData(); const wxString GetEntryData();
void SetEntryData(wxString newData); void SetEntryData(wxString newData);

View file

@ -1199,7 +1199,6 @@ void AudioDisplay::CommitChanges (bool nextLine) {
// so only update from editbox when not in kara mode // so only update from editbox when not in kara mode
curDiag->Text = grid->editBox->TextEdit->GetText(); curDiag->Text = grid->editBox->TextEdit->GetText();
} }
curDiag->UpdateData();
if (!grid->IsInSelection(line_n)) break; if (!grid->IsInSelection(line_n)) break;
} }

View file

@ -440,7 +440,6 @@ namespace Automation4 {
dia->Margin[3] = margin_b; dia->Margin[3] = margin_b;
dia->Effect = effect; dia->Effect = effect;
dia->Text = text; dia->Text = text;
dia->UpdateData();
result = dia; result = dia;

View file

@ -289,7 +289,6 @@ void DialogResample::OnResample (wxCommandEvent &event) {
// Update // Update
curDiag->UpdateText(); curDiag->UpdateText();
curDiag->UpdateData();
curDiag->ClearBlocks(); curDiag->ClearBlocks();
continue; continue;
} }

View file

@ -436,11 +436,6 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
replaceLen = ReplaceWith.Length(); replaceLen = ReplaceWith.Length();
} }
// Update
AssDialogue *cur = grid->GetDialogue(curLine);
//cur->ParseASSTags();
cur->UpdateData();
// Commit // Commit
grid->ass->FlagAsModified(_("replace")); grid->ass->FlagAsModified(_("replace"));
grid->CommitChanges(); grid->CommitChanges();
@ -545,12 +540,6 @@ void SearchReplaceEngine::ReplaceAll() {
} }
} }
} }
// Replaced?
if (replaced) {
AssDialogue *cur = grid->GetDialogue(i);
cur->UpdateData();
}
} }
// Commit // Commit

View file

@ -565,7 +565,6 @@ void DialogStyleEditor::Apply (bool apply,bool close) {
curDiag->ParseASSTags(); curDiag->ParseASSTags();
curDiag->ProcessParameters(ReplaceStyle,&strings); curDiag->ProcessParameters(ReplaceStyle,&strings);
curDiag->UpdateText(); curDiag->UpdateText();
curDiag->UpdateData();
curDiag->ClearBlocks(); curDiag->ClearBlocks();
} }
} }

View file

@ -228,7 +228,6 @@ void DialogStyling::SetStyle (wxString curName, bool jump) {
// Update line // Update line
line->Style = curName; line->Style = curName;
line->UpdateData();
// Update grid/subs // Update grid/subs
grid->Refresh(false); grid->Refresh(false);

View file

@ -489,7 +489,6 @@ void DialogTimingProcessor::Process() {
// Set times // Set times
cur->Start.SetMS(startLead); cur->Start.SetMS(startLead);
cur->End.SetMS(endLead); cur->End.SetMS(endLead);
cur->UpdateData();
} }
} }
@ -529,9 +528,7 @@ void DialogTimingProcessor::Process() {
if (dist > 0 && dist < adjsThres) { if (dist > 0 && dist < adjsThres) {
int setPos = prevEnd+int(dist*bias); int setPos = prevEnd+int(dist*bias);
cur->Start.SetMS(setPos); cur->Start.SetMS(setPos);
cur->UpdateData();
prev->End.SetMS(setPos); prev->End.SetMS(setPos);
prev->UpdateData();
} }
// Set previous // Set previous
@ -548,7 +545,6 @@ void DialogTimingProcessor::Process() {
// Variables // Variables
int startF,endF; int startF,endF;
int closest; int closest;
bool changed;
AssDialogue *cur; AssDialogue *cur;
// Get variables // Get variables
@ -569,25 +565,17 @@ void DialogTimingProcessor::Process() {
// Get start/end frames // Get start/end frames
startF = VFR_Output.GetFrameAtTime(cur->Start.GetMS(),true); startF = VFR_Output.GetFrameAtTime(cur->Start.GetMS(),true);
endF = VFR_Output.GetFrameAtTime(cur->End.GetMS(),false); endF = VFR_Output.GetFrameAtTime(cur->End.GetMS(),false);
changed = false;
// Get closest for start // Get closest for start
closest = GetClosestKeyFrame(startF); closest = GetClosestKeyFrame(startF);
if ((closest > startF && closest-startF <= beforeStart) || (closest < startF && startF-closest <= afterStart)) { if ((closest > startF && closest-startF <= beforeStart) || (closest < startF && startF-closest <= afterStart)) {
cur->Start.SetMS(VFR_Output.GetTimeAtFrame(closest,true)); cur->Start.SetMS(VFR_Output.GetTimeAtFrame(closest,true));
changed = true;
} }
// Get closest for end // Get closest for end
closest = GetClosestKeyFrame(endF)-1; closest = GetClosestKeyFrame(endF)-1;
if ((closest > endF && closest-endF <= beforeEnd) || (closest < endF && endF-closest <= afterEnd)) { if ((closest > endF && closest-endF <= beforeEnd) || (closest < endF && endF-closest <= afterEnd)) {
cur->End.SetMS(VFR_Output.GetTimeAtFrame(closest,false)); cur->End.SetMS(VFR_Output.GetTimeAtFrame(closest,false));
changed = true;
}
// Apply changes
if (changed) {
cur->UpdateData();
} }
} }
} }

View file

@ -356,7 +356,6 @@ void DialogTranslation::OnTransBoxKey(wxKeyEvent &event) {
// Update line // Update line
cur->UpdateText(); cur->UpdateText();
cur->UpdateData();
cur->ClearBlocks(); cur->ClearBlocks();
subs->FlagAsModified(_("translation assistant")); subs->FlagAsModified(_("translation assistant"));
grid->CommitChanges(); grid->CommitChanges();

View file

@ -92,7 +92,6 @@ void AssFixStylesFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog) {
// Not found, fallback to default // Not found, fallback to default
if (!found) diag->Style = _T("Default"); if (!found) diag->Style = _T("Default");
diag->UpdateData();
} }
} }
} }

View file

@ -302,7 +302,6 @@ void AssTransformFramerateFilter::TransformFrameRate(AssFile *subs) {
curDialogue->Start.SetMS(Input->GetTimeAtFrame(Output->GetFrameAtTime(curDialogue->Start.GetMS(),true),true)); curDialogue->Start.SetMS(Input->GetTimeAtFrame(Output->GetFrameAtTime(curDialogue->Start.GetMS(),true),true));
curDialogue->End.SetMS(Input->GetTimeAtFrame(Output->GetFrameAtTime(curDialogue->End.GetMS(),false),false)); curDialogue->End.SetMS(Input->GetTimeAtFrame(Output->GetFrameAtTime(curDialogue->End.GetMS(),false),false));
curDialogue->UpdateText(); curDialogue->UpdateText();
curDialogue->UpdateData();
curDialogue->ClearBlocks(); curDialogue->ClearBlocks();
n++; n++;
} }

View file

@ -1394,7 +1394,6 @@ void FrameMain::OnSnapToScene (wxCommandEvent &event) {
cur = SubsBox->GetDialogue(sel[i]); cur = SubsBox->GetDialogue(sel[i]);
cur->Start.SetMS(start_ms); cur->Start.SetMS(start_ms);
cur->End.SetMS(end_ms); cur->End.SetMS(end_ms);
cur->UpdateData();
} }
// Commit // Commit
@ -1428,7 +1427,6 @@ void FrameMain::OnShiftToFrame (wxCommandEvent &event) {
if (cur) { if (cur) {
cur->Start.SetMS(cur->Start.GetMS()+shiftBy); cur->Start.SetMS(cur->Start.GetMS()+shiftBy);
cur->End.SetMS(cur->End.GetMS()+shiftBy); cur->End.SetMS(cur->End.GetMS()+shiftBy);
cur->UpdateData();
} }
} }

View file

@ -615,7 +615,6 @@ void SubsEditBox::OnStyleChange(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->Style = StyleBox->GetValue(); cur->Style = StyleBox->GetValue();
cur->UpdateData();
} }
} }
grid->ass->FlagAsModified(_("style change")); grid->ass->FlagAsModified(_("style change"));
@ -640,7 +639,6 @@ void SubsEditBox::OnActorChange(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->Actor = actor; cur->Actor = actor;
cur->UpdateData();
} }
} }
@ -675,7 +673,6 @@ void SubsEditBox::OnLayerChange(wxSpinEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->Layer = temp; cur->Layer = temp;
cur->UpdateData();
} }
} }
@ -703,7 +700,6 @@ void SubsEditBox::OnLayerEnter(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->Layer = temp; cur->Layer = temp;
cur->UpdateData();
} }
} }
@ -816,7 +812,6 @@ void SubsEditBox::OnMarginLChange(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->SetMarginString(MarginL->GetValue(),0); cur->SetMarginString(MarginL->GetValue(),0);
cur->UpdateData();
} }
} }
MarginL->SetValue(cur->GetMarginString(0,false)); MarginL->SetValue(cur->GetMarginString(0,false));
@ -840,7 +835,6 @@ void SubsEditBox::OnMarginRChange(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->SetMarginString(MarginR->GetValue(),1); cur->SetMarginString(MarginR->GetValue(),1);
cur->UpdateData();
} }
} }
MarginR->SetValue(cur->GetMarginString(1,false)); MarginR->SetValue(cur->GetMarginString(1,false));
@ -865,7 +859,6 @@ void SubsEditBox::OnMarginVChange(wxCommandEvent &event) {
if (cur) { if (cur) {
cur->SetMarginString(MarginV->GetValue(),2); cur->SetMarginString(MarginV->GetValue(),2);
cur->SetMarginString(MarginV->GetValue(),3); // also bottom margin for now cur->SetMarginString(MarginV->GetValue(),3); // also bottom margin for now
cur->UpdateData();
} }
} }
MarginV->SetValue(cur->GetMarginString(2,false)); MarginV->SetValue(cur->GetMarginString(2,false));
@ -889,7 +882,6 @@ void SubsEditBox::OnEffectChange(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->Effect = Effect->GetValue(); cur->Effect = Effect->GetValue();
cur->UpdateData();
} }
} }
grid->ass->FlagAsModified(_("effect change")); grid->ass->FlagAsModified(_("effect change"));
@ -911,7 +903,6 @@ void SubsEditBox::OnCommentChange(wxCommandEvent &event) {
cur = grid->GetDialogue(sel[i]); cur = grid->GetDialogue(sel[i]);
if (cur) { if (cur) {
cur->Comment = CommentBox->GetValue(); cur->Comment = CommentBox->GetValue();
cur->UpdateData();
} }
} }
grid->ass->FlagAsModified(_("comment change")); grid->ass->FlagAsModified(_("comment change"));
@ -1012,7 +1003,6 @@ void SubsEditBox::Commit(bool stay) {
newline->Start = cur->End; newline->Start = cur->End;
newline->End.SetMS(cur->End.GetMS()+OPT_GET("Timing/Default Duration")->GetInt()); newline->End.SetMS(cur->End.GetMS()+OPT_GET("Timing/Default Duration")->GetInt());
newline->Style = cur->Style; newline->Style = cur->Style;
newline->UpdateData();
grid->InsertLine(newline,next-1,true,true); grid->InsertLine(newline,next-1,true,true);
updated = true; updated = true;
} }

View file

@ -650,8 +650,6 @@ void SubtitlesGrid::OnRecombine(wxCommandEvent &event) {
n3 = GetDialogue(n+2); n3 = GetDialogue(n+2);
n1->End = n2->End; n1->End = n2->End;
n3->Start = n2->Start; n3->Start = n2->Start;
n1->UpdateData();
n3->UpdateData();
DeleteLines(GetRangeArray(n+1,n+1)); DeleteLines(GetRangeArray(n+1,n+1));
} }
@ -699,13 +697,11 @@ void SubtitlesGrid::OnRecombine(wxCommandEvent &event) {
} }
// Commit // Commit
n1->UpdateData();
n2->UpdateData();
ass->FlagAsModified(_("combining")); ass->FlagAsModified(_("combining"));
CommitChanges(); CommitChanges();
} }
// Adjus scrollbar // Adjust scrollbar
AdjustScrollbar(); AdjustScrollbar();
} }
@ -935,7 +931,6 @@ void SubtitlesGrid::InsertLine(AssDialogue *line,int n,bool after,bool update) {
n++; n++;
pos++; pos++;
} }
line->UpdateData();
entryIter newIter = ass->Line.insert(pos,line); entryIter newIter = ass->Line.insert(pos,line);
//InsertRows(n); //InsertRows(n);
//SetRowToLine(n,line); //SetRowToLine(n,line);
@ -1187,7 +1182,6 @@ void SubtitlesGrid::JoinLines(int n1,int n2,bool concat) {
cur->Start.SetMS(min_ms); cur->Start.SetMS(min_ms);
cur->End.SetMS(max_ms); cur->End.SetMS(max_ms);
cur->Text = finalText; cur->Text = finalText;
cur->UpdateData();
// Delete remaining lines (this will auto commit) // Delete remaining lines (this will auto commit)
DeleteLines(GetRangeArray(n1+1,n2)); DeleteLines(GetRangeArray(n1+1,n2));
@ -1214,7 +1208,6 @@ void SubtitlesGrid::AdjoinLines(int n1,int n2,bool setStart) {
cur = GetDialogue(i); cur = GetDialogue(i);
if (!cur) return; if (!cur) return;
cur->Start = prev->End; cur->Start = prev->End;
cur->UpdateData();
prev = cur; prev = cur;
} }
} }
@ -1227,7 +1220,6 @@ void SubtitlesGrid::AdjoinLines(int n1,int n2,bool setStart) {
next = GetDialogue(i+1); next = GetDialogue(i+1);
if (!next) return; if (!next) return;
cur->End = next->Start; cur->End = next->Start;
cur->UpdateData();
cur = next; cur = next;
} }
} }
@ -1279,7 +1271,6 @@ void SubtitlesGrid::JoinAsKaraoke(int n1,int n2) {
cur->Start.SetMS(firststart); cur->Start.SetMS(firststart);
cur->End.SetMS(lastend); cur->End.SetMS(lastend);
cur->Text = finalText; cur->Text = finalText;
cur->UpdateData();
// Delete remaining lines (this will auto commit) // Delete remaining lines (this will auto commit)
DeleteLines(GetRangeArray(n1+1,n2)); DeleteLines(GetRangeArray(n1+1,n2));
@ -1310,7 +1301,6 @@ void SubtitlesGrid::DuplicateLines(int n1,int n2,bool nextFrame) {
int posFrame = VFR_Output.GetFrameAtTime(cur->End.GetMS(),false) + 1; int posFrame = VFR_Output.GetFrameAtTime(cur->End.GetMS(),false) + 1;
cur->Start.SetMS(VFR_Output.GetTimeAtFrame(posFrame,true)); cur->Start.SetMS(VFR_Output.GetTimeAtFrame(posFrame,true));
cur->End.SetMS(VFR_Output.GetTimeAtFrame(posFrame,false)); cur->End.SetMS(VFR_Output.GetTimeAtFrame(posFrame,false));
cur->UpdateData();
} }
// Insert // Insert
@ -1340,13 +1330,8 @@ void SubtitlesGrid::DuplicateLines(int n1,int n2,bool nextFrame) {
void SubtitlesGrid::ShiftLineByTime(int n,int len,int type) { void SubtitlesGrid::ShiftLineByTime(int n,int len,int type) {
AssDialogue *cur = GetDialogue(n); AssDialogue *cur = GetDialogue(n);
// Start
if (type != 2) cur->Start.SetMS(cur->Start.GetMS() + len); if (type != 2) cur->Start.SetMS(cur->Start.GetMS() + len);
// End
if (type != 1) cur->End.SetMS(cur->End.GetMS() + len); if (type != 1) cur->End.SetMS(cur->End.GetMS() + len);
// Update data
cur->UpdateData();
} }
@ -1360,13 +1345,8 @@ void SubtitlesGrid::ShiftLineByTime(int n,int len,int type) {
void SubtitlesGrid::ShiftLineByFrames(int n,int len,int type) { void SubtitlesGrid::ShiftLineByFrames(int n,int len,int type) {
AssDialogue *cur = GetDialogue(n); AssDialogue *cur = GetDialogue(n);
// Start
if (type != 2) cur->Start.SetMS(VFR_Output.GetTimeAtFrame(len + VFR_Output.GetFrameAtTime(cur->Start.GetMS(),true),true)); if (type != 2) cur->Start.SetMS(VFR_Output.GetTimeAtFrame(len + VFR_Output.GetFrameAtTime(cur->Start.GetMS(),true),true));
// End
if (type != 1) cur->End.SetMS(VFR_Output.GetTimeAtFrame(len + VFR_Output.GetFrameAtTime(cur->End.GetMS(),false),false)); if (type != 1) cur->End.SetMS(VFR_Output.GetTimeAtFrame(len + VFR_Output.GetFrameAtTime(cur->End.GetMS(),false),false));
// Update data
cur->UpdateData();
} }
@ -1407,10 +1387,6 @@ void SubtitlesGrid::SplitLine(int n,int pos,int mode,wxString textIn) {
n2->Start.SetMS(splitTime); n2->Start.SetMS(splitTime);
} }
// Update data
n1->UpdateData();
n2->UpdateData();
// Update editbox and audio // Update editbox and audio
editBox->SetToLine(n); editBox->SetToLine(n);
@ -1451,7 +1427,6 @@ bool SubtitlesGrid::SplitLineByKaraoke(int lineNumber) {
start_ms += syl->duration * 10; start_ms += syl->duration * 10;
nl->End.SetMS(start_ms); nl->End.SetMS(start_ms);
nl->Text = syl->unstripped_text; nl->Text = syl->unstripped_text;
nl->UpdateData();
InsertLine(nl, nextpos++, true, false); InsertLine(nl, nextpos++, true, false);
} }
@ -1523,7 +1498,6 @@ void SubtitlesGrid::SetSubsToVideo(bool start) {
modified++; modified++;
if (start) cur->Start.SetMS(ms); if (start) cur->Start.SetMS(ms);
else cur->End.SetMS(ms); else cur->End.SetMS(ms);
cur->UpdateData();
} }
} }

View file

@ -170,7 +170,6 @@ void SRTSubtitleFormat::ReadFile(wxString filename,wxString encoding) {
line->group = _T("[Events]"); line->group = _T("[Events]");
line->Style = _T("Default"); line->Style = _T("Default");
line->Comment = false; line->Comment = false;
line->UpdateData();
line->ParseSRTTags(); line->ParseSRTTags();
Line->push_back(line); Line->push_back(line);
lines++; lines++;

View file

@ -172,8 +172,6 @@ void TXTSubtitleFormat::ReadFile(wxString filename,wxString encoding) { using na
line->Text = value; line->Text = value;
line->Start.SetMS(0); line->Start.SetMS(0);
line->End.SetMS(0); line->End.SetMS(0);
line->UpdateData();
//line->ParseASSTags();
// Adds line // Adds line
Line->push_back(line); Line->push_back(line);