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

View file

@ -243,7 +243,6 @@ public:
void StripTag(wxString tagName);// Strips a specific tag from the text
wxString GetStrippedText() const; // Gets text without tags
void UpdateData(); // Updates raw data from current values + text
void UpdateText(); // Generates text from the override tags
const wxString GetEntryData();
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
curDiag->Text = grid->editBox->TextEdit->GetText();
}
curDiag->UpdateData();
if (!grid->IsInSelection(line_n)) break;
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -92,7 +92,6 @@ void AssFixStylesFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog) {
// Not found, fallback to 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->End.SetMS(Input->GetTimeAtFrame(Output->GetFrameAtTime(curDialogue->End.GetMS(),false),false));
curDialogue->UpdateText();
curDialogue->UpdateData();
curDialogue->ClearBlocks();
n++;
}

View file

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

View file

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

View file

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