Move InvalidMarginIdError to ass_dialogue.h

This commit is contained in:
Thomas Goyne 2012-10-26 07:33:50 -07:00
parent ce05857bfa
commit 99a20e4d1c
3 changed files with 10 additions and 28 deletions

View File

@ -319,7 +319,7 @@ void AssDialogue::UpdateText () {
}
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
wxString strvalue = origvalue;
@ -339,7 +339,7 @@ void AssDialogue::SetMarginString(wxString const& origvalue, int which) {
}
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]);
}

View File

@ -39,6 +39,8 @@
#include "ass_entry.h"
#include "ass_time.h"
#include <libaegisub/exception.h>
enum AssBlockType {
BLOCK_BASE,
BLOCK_PLAIN,
@ -196,3 +198,9 @@ public:
AssDialogue(wxString const& data);
~AssDialogue();
};
class InvalidMarginIdError : public agi::InternalError {
public:
InvalidMarginIdError() : InternalError("Invalid margin id", 0) { }
const char *GetName() const { return "internal_error/invalid_margin_id"; }
};

View File

@ -39,12 +39,6 @@
#include <wx/string.h>
#endif
#include <libaegisub/exception.h>
class AssDialogue;
class AssStyle;
class AssAttachment;
enum AssEntryType {
ENTRY_BASE,
ENTRY_DIALOGUE,
@ -52,26 +46,6 @@ enum AssEntryType {
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 {
/// 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;