Author: kitone
Date: Sun May  4 11:39:23 2014
New Revision: 860

URL: http://svn.gna.org/viewcvs/subtitleeditor?rev=860&view=rev
Log:
Fix bug #22009 : Split subtitle file.

Modified:
    trunk/ChangeLog
    trunk/plugins/actions/splitdocument/splitdocument.cc

Modified: trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/subtitleeditor/trunk/ChangeLog?rev=860&r1=859&r2=860&view=diff
==============================================================================
--- trunk/ChangeLog     (original)
+++ trunk/ChangeLog     Sun May  4 11:39:23 2014
@@ -1,3 +1,8 @@
+2014-05-04     kitone  <[email protected]>
+
+       *  plugins/actions/splitdocument/splitdocument.cc
+       Fix bug #22009 : Split subtitle file.
+
 2014-03-01     kitone  <[email protected]>
 
        * src/document.h

Modified: trunk/plugins/actions/splitdocument/splitdocument.cc
URL: 
http://svn.gna.org/viewcvs/subtitleeditor/trunk/plugins/actions/splitdocument/splitdocument.cc?rev=860&r1=859&r2=860&view=diff
==============================================================================
--- trunk/plugins/actions/splitdocument/splitdocument.cc        (original)
+++ trunk/plugins/actions/splitdocument/splitdocument.cc        Sun May  4 
11:39:23 2014
@@ -4,7 +4,7 @@
  *     http://home.gna.org/subtitleeditor/
  *     https://gna.org/projects/subtitleeditor/
  *
- *     Copyright @ 2005-2009, kitone
+ *     Copyright @ 2005-2014, kitone
  *
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -81,20 +81,18 @@
        }
 
        /*
-        *      coupe le doc en 2 et retourne le nouveau
+        * Split the document in two and return the new one
         */
        Document *split_doc(Document *doc, unsigned int number)
        {
-               // creation du nouveau document par copy
-               Document *newdoc = new Document(*doc);
-               // même nom plus -part2
+               // Create new document based on the first one and rename it
+               Document *newdoc = new Document(*doc, true);
                newdoc->setFilename(newdoc->getFilename() + "-par2");
-               // on supprime les sous-titres précédant
                newdoc->subtitles().remove(1, number-1);
 
                DocumentSystem::getInstance().append(newdoc);
 
-               // on supprime ensuite les sous-titres utiliser par le nouveau 
document
+               // Remove subtitles used by the new one
                doc->start_command(_("Split document"));
                doc->subtitles().remove(number, doc->subtitles().size());
                doc->finish_command();


_______________________________________________
Subtitleeditor-commits mailing list
[email protected]
https://mail.gna.org/listinfo/subtitleeditor-commits

Reply via email to