On Tuesday 24 April 2007 9:59:59 pm Jean-Marc Lasgouttes wrote:
> >>>>> "José" == José Matos <[EMAIL PROTECTED]> writes:
>
> José> On Tuesday 24 April 2007 5:47:10 pm Jean-Marc Lasgouttes wrote:
> >> I am OK with that, but I will need someone to work the necessary
> >> lyx2lyx glue :)
>
> José>   If you tell me what needs to be done I will do it. :-)
>
> I guess increase the format and update the textclass:
>  * cv to simplecv in the f->f+1 direction
>  * simplecv to cv in the f+1->f direction

  The patch attached does that I will commit tomorrow if there are no 
objections.

> JMarc



-- 
José Abílio
Index: src/buffer.C
===================================================================
--- src/buffer.C	(revision 17959)
+++ src/buffer.C	(working copy)
@@ -141,7 +141,7 @@
 
 namespace {
 
-int const LYX_FORMAT = 263;
+int const LYX_FORMAT = 264;
 
 } // namespace anon
 
Index: lib/lyx2lyx/LyX.py
===================================================================
--- lib/lyx2lyx/LyX.py	(revision 17959)
+++ lib/lyx2lyx/LyX.py	(working copy)
@@ -73,8 +73,8 @@
                    ("1_1_6_3", [218], ["1.1.6.3","1.1.6.4","1.1"]),
                    ("1_2",     [220], generate_minor_versions("1.2" , 4)),
                    ("1_3",     [221], generate_minor_versions("1.3" , 7)),
-                   ("1_4", range(222,246), generate_minor_versions("1.4" , 3)),
-                   ("1_5", range(246,264), generate_minor_versions("1.5" , 0))]
+                   ("1_4", range(222,246), generate_minor_versions("1.4" , 4)),
+                   ("1_5", range(246,265), generate_minor_versions("1.5" , 0))]
 
 
 def formats_list():
@@ -257,6 +257,7 @@
         " Writes the LyX file to self.output."
         self.set_version()
         self.set_format()
+        self.set_textclass()
         if self.encoding == "auto":
             self.encoding = get_encoding(self.language, self.encoding, self.format, self.cjk_encoding)
 
@@ -364,6 +365,11 @@
         self.header[i] = "\\lyxformat %s" % format
 
 
+    def set_textclass(self):
+        i = find_token(self.header, "\\textclass", 0)
+        self.header[i] = "\\textclass %s" % self.textclass
+
+
     def set_parameter(self, param, value):
         " Set the value of the header parameter."
         i = find_token(self.header, '\\' + param, 0)
Index: lib/lyx2lyx/lyx_1_5.py
===================================================================
--- lib/lyx2lyx/lyx_1_5.py	(revision 17959)
+++ lib/lyx2lyx/lyx_1_5.py	(working copy)
@@ -1245,7 +1245,18 @@
         i = find_token(document.header, "\\language", 0)
         document.header[i] = "\\language %s" % document.language
 
+#
+#  \textclass cv -> \textclass simplecv
+def convert_cv_textclass(document):
+    if document.textclass == "cv":
+        document.textclass = "simplecv"
 
+
+def revert_cv_textclass(document):
+    if document.textclass == "simplecv":
+        document.textclass = "cv"
+
+
 ##
 # Conversion hub
 #
@@ -1268,9 +1279,11 @@
            [260, []],
            [261, [convert_changes]],
            [262, []],
-           [263, [normalize_language_name]]]
+           [263, [normalize_language_name]],
+           [264, [convert_cv_textclass]]]
 
-revert =  [[262, [revert_language_name]],
+revert =  [[263, [revert_cv_textclass]],
+           [262, [revert_language_name]],
            [261, [revert_ascii]],
            [260, []],
            [259, [revert_utf8x]],
Index: development/FORMAT
===================================================================
--- development/FORMAT	(revision 17959)
+++ development/FORMAT	(working copy)
@@ -1,7 +1,12 @@
 LyX file-format changes
------------------------§
-2007-02-22  José Matos  <[EMAIL PROTECTED]>
+-----------------------
+2007-04-24  José Matos  <[EMAIL PROTECTED]>
 
+	* format incremented to 264:
+	textclass cv is renamed simplecv
+
+2007-02-22  José Matos  <[EMAIL PROTECTED]>
+
 	* format incremented to 263: changes in the language names (overdue):
 	  brazil -> brazilian
 	  portuges -> portuguese
@@ -40,7 +45,7 @@
 	     'xx \textbf{yy} zz'.
 	New: Spaces are always output with the font set by the user.
 
-2007-01-31  Uwe Stöhr
+2007-01-31  Uwe Stöhr
 
 	* format incremented to 258: new \lyxline definition
 	Old:
@@ -117,7 +122,7 @@
 	The order of the parameters and for each parameter the name and
 	optional/required bit is now stored in InsetCommandParams.
 
-2006-10-03  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2006-10-03  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 251: save show_label param for charstyles.
 
@@ -164,7 +169,7 @@
 	topspace, bottomspace and interlinespace. All take a LyXLength
 	as value, or the special keyword "default".
 
-2006-06-10  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2006-06-10  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 247. The Grand Font Interface Rewrite.
 	(1) Split font selection to rm, sf, tt:
@@ -207,19 +212,19 @@
 	* format incremented to 246. The framed.sty package is 
 	now supported with note types framed and shaded.
 
-2005-10-12  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2005-10-12  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 245. The \quotes_times parameter
 	has been removed.
 
-2005-09-24  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2005-09-24  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 244. Rename '\InsetSpace \,'
 	to '\InsetSpace \thinspace{}', because the comma was
 	not parsed by lyxlex, and '\InsetSpace \space' to
 	'\InsetSpace \space{}' in favour of consistency.
 
-2005-07-18  José Matos  <[EMAIL PROTECTED]>
+2005-07-18  José Matos  <[EMAIL PROTECTED]>
 
 	* format incremented to 243.
 
@@ -247,7 +252,7 @@
 	latex output, but now they can't be read or set anymore (bug 922).
 
 
-2005-01-23  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2005-01-23  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 240.
 	* new bufferparam:
@@ -255,7 +260,7 @@
 	(should the change tracking marks be visible in the output or not?)
 	* lyx2lyx should just delete the param in 239.
 
-2005-01-06  José Matos  <[EMAIL PROTECTED]>
+2005-01-06  José Matos  <[EMAIL PROTECTED]>
 
 	* format incremented to 239.
 	* the paragraph parameters are displayed in their own line. This
@@ -272,7 +277,7 @@
 \end_layout
 
 
-2004-12-03  José Matos  <[EMAIL PROTECTED]>
+2004-12-03  José Matos  <[EMAIL PROTECTED]>
 
 	* format incremented to 238.
 	* The compatibility code to read old latex accents from 0.12.x in
@@ -289,7 +294,7 @@
 	so formats 215 - 237 can have both versions.
 
 
-2004-10-10  José Matos  <[EMAIL PROTECTED]>
+2004-10-10  José Matos  <[EMAIL PROTECTED]>
 
 	* format incremented to 237.
 	* In the header, the following statments use now booleans values,
@@ -298,7 +303,7 @@
 		- \use_bibtopic
 		- \tracking_changes
 
-2004-08-15  José Matos  <[EMAIL PROTECTED]>
+2004-08-15  José Matos  <[EMAIL PROTECTED]>
 
 	* format incremented to 236.
 	* Added tags:
@@ -343,7 +348,7 @@
 	* insetgraphics does not allow filenames without extension anymore.
 	The complete filename has to be given.
 
-2004-03-29  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2004-03-29  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 232.
 
@@ -363,7 +368,7 @@
 	  \end{btSect}
 	  has to be inserted.
 
-2004-03-29  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2004-03-29  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 231.
 
@@ -376,7 +381,7 @@
 	\begin{sidewaystable} <content> \end{sidewaystable}
 	i.e. ERT.
 
-2004-02-23  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2004-02-23  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 230.
 
@@ -392,7 +397,7 @@
 	(jurabib fails if babel is called afterwards). If the natbib commands
 	are used together with jurabib, they have to be converted to ERT too.
 
-2003-12-29  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2003-12-29  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* format incremented to 229.
 	* Minipages cannot be read anymore. All minipage insets will
@@ -434,7 +439,7 @@
 	\begin_inset Comment -> \begin_inset Note Comment
 	\begin_inset Greyedout -> \begin_inset Note Greyedout
 
-2003-11-28  André Pönitz
+2003-11-28  André Pönitz
 
 	* Remove space_above/space_below from Paragraph.
     This is now handled by InsetVSpace.
@@ -522,15 +527,15 @@
 
 	\end_inset
 
-2003-07-28  José Matos  <[EMAIL PROTECTED]>
+2003-07-28  José Matos  <[EMAIL PROTECTED]>
 
 	* \the_end is replaced with \end_document
 
-2003-07-28  José Matos  <[EMAIL PROTECTED]>
+2003-07-28  José Matos  <[EMAIL PROTECTED]>
 
 	* \layout is replaced with \begin_layout
 
-2003-07-28  José Matos  <[EMAIL PROTECTED]>
+2003-07-28  José Matos  <[EMAIL PROTECTED]>
 
 	Format bumped to 225
 
@@ -564,14 +569,14 @@
 	Moreover, the RasterImage template has been scrapped. All RasterImage
 	external insets are now converted to Graphics insets.
 
-2003-05-20  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+2003-05-20  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
 
 	* Added new space insets:
 		\SpecialChar ~ is now \InsetSpace ~
 		ERT: "\ " could be converted to InsetSpace \<space>
 		ERT: "\," could be converted to InsetSpace \,
 
-2003-04-24  André Pönitz <[EMAIL PROTECTED]>
+2003-04-24  André Pönitz <[EMAIL PROTECTED]>
 
 	* Added eqref support:
 	\begin_inset LatexCommand \eqref{label}

Reply via email to