forked from mia/Aegisub
Move InvalidMarginIdError to ass_dialogue.h
This commit is contained in:
parent
ce05857bfa
commit
99a20e4d1c
3 changed files with 10 additions and 28 deletions
|
@ -319,7 +319,7 @@ void AssDialogue::UpdateText () {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssDialogue::SetMarginString(wxString const& origvalue, int which) {
|
void AssDialogue::SetMarginString(wxString const& origvalue, int which) {
|
||||||
if (which < 0 || which > 2) throw Aegisub::InvalidMarginIdError();
|
if (which < 0 || which > 2) throw InvalidMarginIdError();
|
||||||
|
|
||||||
// Make it numeric
|
// Make it numeric
|
||||||
wxString strvalue = origvalue;
|
wxString strvalue = origvalue;
|
||||||
|
@ -339,7 +339,7 @@ void AssDialogue::SetMarginString(wxString const& origvalue, int which) {
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString AssDialogue::GetMarginString(int which, bool pad) const {
|
wxString AssDialogue::GetMarginString(int which, bool pad) const {
|
||||||
if (which < 0 || which > 2) throw Aegisub::InvalidMarginIdError();
|
if (which < 0 || which > 2) throw InvalidMarginIdError();
|
||||||
return wxString::Format(pad ? "%04d" : "%d", Margin[which]);
|
return wxString::Format(pad ? "%04d" : "%d", Margin[which]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#include "ass_entry.h"
|
#include "ass_entry.h"
|
||||||
#include "ass_time.h"
|
#include "ass_time.h"
|
||||||
|
|
||||||
|
#include <libaegisub/exception.h>
|
||||||
|
|
||||||
enum AssBlockType {
|
enum AssBlockType {
|
||||||
BLOCK_BASE,
|
BLOCK_BASE,
|
||||||
BLOCK_PLAIN,
|
BLOCK_PLAIN,
|
||||||
|
@ -196,3 +198,9 @@ public:
|
||||||
AssDialogue(wxString const& data);
|
AssDialogue(wxString const& data);
|
||||||
~AssDialogue();
|
~AssDialogue();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class InvalidMarginIdError : public agi::InternalError {
|
||||||
|
public:
|
||||||
|
InvalidMarginIdError() : InternalError("Invalid margin id", 0) { }
|
||||||
|
const char *GetName() const { return "internal_error/invalid_margin_id"; }
|
||||||
|
};
|
||||||
|
|
|
@ -39,12 +39,6 @@
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libaegisub/exception.h>
|
|
||||||
|
|
||||||
class AssDialogue;
|
|
||||||
class AssStyle;
|
|
||||||
class AssAttachment;
|
|
||||||
|
|
||||||
enum AssEntryType {
|
enum AssEntryType {
|
||||||
ENTRY_BASE,
|
ENTRY_BASE,
|
||||||
ENTRY_DIALOGUE,
|
ENTRY_DIALOGUE,
|
||||||
|
@ -52,26 +46,6 @@ enum AssEntryType {
|
||||||
ENTRY_ATTACHMENT
|
ENTRY_ATTACHMENT
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @see aegisub.h
|
|
||||||
namespace Aegisub {
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
/// @class InvalidMarginIdError
|
|
||||||
/// @brief DOCME
|
|
||||||
///
|
|
||||||
/// DOCME
|
|
||||||
class InvalidMarginIdError : public agi::InternalError {
|
|
||||||
public:
|
|
||||||
InvalidMarginIdError() : InternalError("Invalid margin id", 0) { }
|
|
||||||
const char *GetName() const { return "internal_error/invalid_margin_id"; }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
/// @class AssEntry
|
|
||||||
/// @brief DOCME
|
|
||||||
///
|
|
||||||
/// DOCME
|
|
||||||
class AssEntry {
|
class AssEntry {
|
||||||
/// Raw data, exactly the same line that appears on the .ass (note that this will be in ass even if source wasn't)
|
/// Raw data, exactly the same line that appears on the .ass (note that this will be in ass even if source wasn't)
|
||||||
wxString data;
|
wxString data;
|
||||||
|
|
Loading…
Reference in a new issue