On Friday 09 August 2002 6:52 pm, Herbert Voss wrote:
> http://marc.theaimsgroup.com/?l=lyx-devel&m=102737398526073&w=2

No, this one is already in.

I'm talking about lyxsize_kind, not size_kind.

Is the attached patch correct? I believe that it will do the trick.

Angus


Index: src/insets/insetgraphicsParams.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphicsParams.C,v
retrieving revision 1.46
diff -u -p -r1.46 insetgraphicsParams.C
--- src/insets/insetgraphicsParams.C	23 Jul 2002 12:20:21 -0000	1.46
+++ src/insets/insetgraphicsParams.C	9 Aug 2002 18:06:52 -0000
@@ -197,6 +197,22 @@ string const getSizeKindStr(InsetGraphic
 	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 & 
 	// 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 & 
 	} 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());

Reply via email to