* Fix reading of lyxsize_type in 1.2.0 documents.

* Document change to format.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4945 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-08-12 16:41:15 +00:00
parent 2a4413e415
commit 9360861f33
4 changed files with 49 additions and 11 deletions

View 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> 2002-08-02 Angus Leeming <leeming@lyx.org>
* FORMAT: a new file to document changes in the LyX file format. * FORMAT: a new file to document changes in the LyX file format.

View File

@ -15,3 +15,22 @@ The LyX file now contains:
\end_inset \end_inset
Earlier versions of LyX just swallow this extra token silently. 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

View 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> 2002-08-12 Juergen Vigna <jug@sad.it>
* insetcollapsable.C (edit): ignore if entered when pressing mouse * insetcollapsable.C (edit): ignore if entered when pressing mouse

View File

@ -197,6 +197,22 @@ string const getSizeKindStr(InsetGraphicsParams::sizeKind sK_in)
return "original"; 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 } //anon
@ -282,17 +298,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
// compatibility-stuff 1.20->1.3.0 // compatibility-stuff 1.20->1.3.0
} else if (token == "size_type") { } else if (token == "size_type") {
lex.next(); lex.next();
switch (lex.getInteger()) { size_kind = getSizeKind(lex.getInteger());
case 0:
size_kind = DEFAULT_SIZE;
break;
case 1:
size_kind = WH;
break;
case 2:
size_kind = SCALE;
break;
}
} else if (token == "width") { } else if (token == "width") {
lex.next(); lex.next();
width = LyXLength(lex.getString()); width = LyXLength(lex.getString());
@ -315,6 +321,10 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
} else if (token == "lyxsize_kind") { } else if (token == "lyxsize_kind") {
lex.next(); lex.next();
lyxsize_kind = getSizeKind(lex.getString()); 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") { } else if (token == "lyxwidth") {
lex.next(); lex.next();
lyxwidth = LyXLength(lex.getString()); lyxwidth = LyXLength(lex.getString());