]> git.lyx.org Git - features.git/commitdiff
* Fix reading of lyxsize_type in 1.2.0 documents.
authorAngus Leeming <leeming@lyx.org>
Mon, 12 Aug 2002 16:41:15 +0000 (16:41 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 12 Aug 2002 16:41:15 +0000 (16:41 +0000)
* Document change to format.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4945 a592a061-630c-0410-9148-cb99ea01b6c8

development/ChangeLog
development/FORMAT
src/insets/ChangeLog
src/insets/insetgraphicsParams.C

index 1e7ae0d90e0f477a06e3cd2d10df8918926beab5..4f7cb434c135872947e7c4f432c14ccb32217078 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-02  Angus Leeming  <leeming@lyx.org>
+
+       * FORMAT: document the InsetGraphicsParams "size_type" -> "size_kind"
+       change.
+
 2002-08-02  Angus Leeming  <leeming@lyx.org>
 
        * FORMAT: a new file to document changes in the LyX file format.
index 06885038846ba8267e58125033e239ee15d8412f..9d4dfe87b84e3ae0e71aacae9762cb3adb6fd8e5 100644 (file)
@@ -15,3 +15,22 @@ The LyX file now contains:
  \end_inset 
 
 Earlier versions of LyX just swallow this extra token silently.
+
+2002-08-12  Angus Leeming  <leeming@lyx.org>
+
+The 1.2.0 InsetGraphicsParams "size_type" and "lyxsize_type" have been
+renamed as "size_kind" and "lyxsize_kind" respectively.
+
+ \begin_inset Graphics FormatVersion 1
+       filename file.eps
+       display default
+-      size_kind original
++      size_type original
+       width 7cm
+       rotateOrigin center
+-      lyxsize_kind original
++      lyxsize_type original
+       lyxwidth 4cm
+
+ \end_inset 
+
index 928f8e3316eb75e063bbcddd9a872071df66d651..9d399cfcb44af351fac8134469eb6da7b691353c 100644 (file)
@@ -1,3 +1,7 @@
+2002-08-12  Angus Leeming  <leeming@lyx.org>
+
+       * insetgraphicsParams.C: fix reading of lyxsize_type in 1.2.0 documents.
+
 2002-08-12  Juergen Vigna  <jug@sad.it>
 
        * insetcollapsable.C (edit): ignore if entered when pressing mouse
index f1f019845deb354c5989a7dcff221b28ec70ee1a..3445086b61b3b2715e19b5cb6694d1b6f7be202e 100644 (file)
@@ -197,6 +197,22 @@ string const getSizeKindStr(InsetGraphicsParams::sizeKind sK_in)
        return "original";
 }      
 
+// compatibility-stuff 1.20->1.3.0
+InsetGraphicsParams::sizeKind getSizeKind(int type)
+{
+       switch (type) {
+       case 1:
+               return InsetGraphicsParams::WH;
+
+       case 2:
+               return InsetGraphicsParams::SCALE;
+
+       case 0:
+       default:
+               return InsetGraphicsParams::DEFAULT_SIZE;
+       }
+}
+
 } //anon
 
 
@@ -282,17 +298,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
        // compatibility-stuff 1.20->1.3.0
        } else if (token == "size_type") {
                lex.next();
-               switch (lex.getInteger()) {
-               case 0:
-                       size_kind = DEFAULT_SIZE;
-                       break;
-               case 1:
-                       size_kind = WH;
-                       break;
-               case 2:
-                       size_kind = SCALE;
-                       break;
-               }
+               size_kind = getSizeKind(lex.getInteger());
        } else if (token == "width") {
                lex.next();
                width = LyXLength(lex.getString());
@@ -315,6 +321,10 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
        } else if (token == "lyxsize_kind") {
                lex.next();
                lyxsize_kind = getSizeKind(lex.getString());
+       // compatibility-stuff 1.20->1.3.0
+       } else if (token == "lyxsize_type") {
+               lex.next();
+               lyxsize_kind = getSizeKind(lex.getInteger());
        } else if (token == "lyxwidth") {
                lex.next();
                lyxwidth = LyXLength(lex.getString());