From aa4a7fdac4664b630aeafe77e05533f7f8631a8d Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Mon, 27 Feb 2006 22:31:44 +0000 Subject: [PATCH] Fixed SRT generation Originally committed to SVN as r187. --- core/subtitle_format_srt.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/core/subtitle_format_srt.cpp b/core/subtitle_format_srt.cpp index b40435c5c..04aa5a26b 100644 --- a/core/subtitle_format_srt.cpp +++ b/core/subtitle_format_srt.cpp @@ -189,19 +189,9 @@ void SRTSubtitleFormat::DialogueToSRT(AssDialogue *current,std::list: } // Fix line breaks - size_t cur = 0; - while ((cur = current->Text.find(_T("\\n"),cur)) != wxString::npos) { - current->Text.replace(cur,2,_T("\r\n")); - } - cur = 0; - while ((cur = current->Text.find(_T("\\N"),cur)) != wxString::npos) { - current->Text.replace(cur,2,_T("\r\n")); - } - cur = 0; - while ((cur = current->Text.find(_T("\r\n\r\n"),cur)) != wxString::npos) { - current->Text.replace(cur,2,_T("\r\n")); - cur = 0; - } + current->Text.Replace(_T("\\n"),_T("\r\n"),true); + current->Text.Replace(_T("\\N"),_T("\r\n"),true); + current->Text.Replace(_T("\r\n\r\n"),_T("\r\n"),true); }