From 513fcb4121bf4eb14911e9e930f05822c6a69bd3 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 7 Jun 2009 00:22:36 +0000 Subject: [PATCH] The AssEntry::Clone() function ought to have been const all the time... make it. (Ugh, I had to make a const_cast in AssStyle::Clone().) Originally committed to SVN as r3028. --- aegisub/src/ass_dialogue.cpp | 2 +- aegisub/src/ass_dialogue.h | 2 +- aegisub/src/ass_entry.cpp | 2 +- aegisub/src/ass_entry.h | 2 +- aegisub/src/ass_style.cpp | 4 ++-- aegisub/src/ass_style.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/aegisub/src/ass_dialogue.cpp b/aegisub/src/ass_dialogue.cpp index 3a5e57efe..2b6b1e231 100644 --- a/aegisub/src/ass_dialogue.cpp +++ b/aegisub/src/ass_dialogue.cpp @@ -784,7 +784,7 @@ wxString AssDialogue::GetStrippedText() const { } ///////// // Clone -AssEntry *AssDialogue::Clone() { +AssEntry *AssDialogue::Clone() const { // Create clone AssDialogue *final = new AssDialogue(); diff --git a/aegisub/src/ass_dialogue.h b/aegisub/src/ass_dialogue.h index f43feb7db..2126e0262 100644 --- a/aegisub/src/ass_dialogue.h +++ b/aegisub/src/ass_dialogue.h @@ -196,7 +196,7 @@ public: wxString GetSSAText(); bool CollidesWith(AssDialogue *target); // Checks if two lines collide - AssEntry *Clone(); + AssEntry *Clone() const; AssDialogue(); AssDialogue(wxString data,int version=1); diff --git a/aegisub/src/ass_entry.cpp b/aegisub/src/ass_entry.cpp index 05b33a6ba..b6c1753ec 100644 --- a/aegisub/src/ass_entry.cpp +++ b/aegisub/src/ass_entry.cpp @@ -119,7 +119,7 @@ wxString AssEntry::GetSSAText() { ///////// // Clone -AssEntry *AssEntry::Clone() { +AssEntry *AssEntry::Clone() const { // Create clone AssEntry *final = new AssEntry(); diff --git a/aegisub/src/ass_entry.h b/aegisub/src/ass_entry.h index 40745d9c6..15c865ab3 100644 --- a/aegisub/src/ass_entry.h +++ b/aegisub/src/ass_entry.h @@ -75,7 +75,7 @@ public: AssEntry(wxString data); virtual ~AssEntry(); - virtual AssEntry *Clone(); + virtual AssEntry *Clone() const; virtual int GetStartMS() const { return StartMS; } virtual int GetEndMS() const { return StartMS; } diff --git a/aegisub/src/ass_style.cpp b/aegisub/src/ass_style.cpp index 462383596..7b2c4737a 100644 --- a/aegisub/src/ass_style.cpp +++ b/aegisub/src/ass_style.cpp @@ -493,7 +493,7 @@ wxString AssStyle::GetSSAText() { ///////// // Clone -AssEntry *AssStyle::Clone() { +AssEntry *AssStyle::Clone() const { // Create clone AssStyle *final = new AssStyle(); @@ -526,7 +526,7 @@ AssEntry *AssStyle::Clone() { final->strikeout = strikeout; final->underline = underline; final->relativeTo = relativeTo; - final->SetEntryData(GetEntryData()); + final->SetEntryData(const_cast(this)->GetEntryData()); // Return return final; diff --git a/aegisub/src/ass_style.h b/aegisub/src/ass_style.h index e0235e9a6..0be3e64c7 100644 --- a/aegisub/src/ass_style.h +++ b/aegisub/src/ass_style.h @@ -105,7 +105,7 @@ public: void SetMarginString(const wxString value,int which); // Sets margin value from a string (0 = left, 1 = right, 2 = vertical/top, 3 = bottom) static void GetEncodings(wxArrayString &encodingStrings); - AssEntry *Clone(); + AssEntry *Clone() const; bool IsEqualTo(AssStyle *style); AssStyle();