Remove the pad argument from GetMarginString

It's no longer ever actually set to true.
This commit is contained in:
Thomas Goyne 2012-12-02 07:55:38 -08:00
parent 3045e2d012
commit b507f49cec
3 changed files with 5 additions and 6 deletions

View file

@ -331,9 +331,9 @@ void AssDialogue::SetMarginString(wxString const& origvalue, int which) {
Margin[which] = mid<int>(0, value, 9999); Margin[which] = mid<int>(0, value, 9999);
} }
wxString AssDialogue::GetMarginString(int which, bool pad) const { wxString AssDialogue::GetMarginString(int which) const {
if (which < 0 || which > 2) throw InvalidMarginIdError(); if (which < 0 || which > 2) throw InvalidMarginIdError();
return wxString::Format(pad ? "%04d" : "%d", Margin[which]); return wxString::Format("%d", Margin[which]);
} }
void AssDialogue::ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData) { void AssDialogue::ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData) {

View file

@ -182,8 +182,7 @@ public:
void SetMarginString(wxString const& value, int which); void SetMarginString(wxString const& value, int which);
/// @brief Get a margin /// @brief Get a margin
/// @param which 0 = left, 1 = right, 2 = vertical /// @param which 0 = left, 1 = right, 2 = vertical
/// @param pad Pad the number to four digits wxString GetMarginString(int which) const;
wxString GetMarginString(int which, bool pad=true) const;
/// Get the line as SSA rather than ASS /// Get the line as SSA rather than ASS
wxString GetSSAText() const override; wxString GetSSAText() const override;
/// Does this line collide with the passed line? /// Does this line collide with the passed line?

View file

@ -210,7 +210,7 @@ wxTextCtrl *SubsEditBox::MakeMarginCtrl(wxString const& tooltip, int margin, wxS
Bind(wxEVT_COMMAND_TEXT_UPDATED, [=](wxCommandEvent&) { Bind(wxEVT_COMMAND_TEXT_UPDATED, [=](wxCommandEvent&) {
wxString value = ctrl->GetValue(); wxString value = ctrl->GetValue();
SetSelectedRows([&](AssDialogue *d) { d->SetMarginString(value, margin); }, commit_msg, AssFile::COMMIT_DIAG_META); SetSelectedRows([&](AssDialogue *d) { d->SetMarginString(value, margin); }, commit_msg, AssFile::COMMIT_DIAG_META);
if (line) change_value(ctrl, line->GetMarginString(margin, false)); if (line) change_value(ctrl, line->GetMarginString(margin));
}, ctrl->GetId()); }, ctrl->GetId());
return ctrl; return ctrl;
@ -292,7 +292,7 @@ void SubsEditBox::OnCommit(int type) {
if (type & AssFile::COMMIT_DIAG_META) { if (type & AssFile::COMMIT_DIAG_META) {
Layer->SetValue(line->Layer); Layer->SetValue(line->Layer);
for (size_t i = 0; i < Margin.size(); ++i) for (size_t i = 0; i < Margin.size(); ++i)
change_value(Margin[i], line->GetMarginString(i, false)); change_value(Margin[i], line->GetMarginString(i));
CommentBox->SetValue(line->Comment); CommentBox->SetValue(line->Comment);
StyleBox->Select(StyleBox->FindString(line->Style)); StyleBox->Select(StyleBox->FindString(line->Style));