(Rob Lahaye): read and write latex height data of graphic correctly.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5562 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-10-31 11:33:49 +00:00
parent 6de5387b91
commit b3e2ee2a8d
3 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2002-10-31 Rob Lahaye <lahaye@snu.ac.kr>
* insetgraphicsParams.C (Write): use lyx::float_equal.
Write height data correctly.
(Read): zero scale when reading height data.
2002-10-30 John Levon <levon@movementarian.org> 2002-10-30 John Levon <levon@movementarian.org>
* insetfloat.C (addToTOC): recursively traverse all * insetfloat.C (addToTOC): recursively traverse all

View File

@ -18,7 +18,6 @@ TODO
* Add a way to roll the image file into the file format. * Add a way to roll the image file into the file format.
* When loading, if the image is not found in the expected place, try * When loading, if the image is not found in the expected place, try
to find it in the clipart, or in the same directory with the image. to find it in the clipart, or in the same directory with the image.
* Keep a tab on the image file, if it changes, update the lyx view.
* The image choosing dialog could show thumbnails of the image formats * The image choosing dialog could show thumbnails of the image formats
it knows of, thus selection based on the image instead of based on it knows of, thus selection based on the image instead of based on
filename. filename.

View File

@ -142,16 +142,16 @@ void InsetGraphicsParams::Write(ostream & os) const
os << "\tlyxscale " << lyxscale << '\n'; os << "\tlyxscale " << lyxscale << '\n';
if (display != grfx::DefaultDisplay) if (display != grfx::DefaultDisplay)
os << "\tdisplay " << grfx::displayTranslator.find(display) << '\n'; os << "\tdisplay " << grfx::displayTranslator.find(display) << '\n';
if (scale) { if (!lyx::float_equal(scale, 0.0, 0.05)) {
if (!lyx::float_equal(scale, 100.0, 0.05)) if (!lyx::float_equal(scale, 100.0, 0.05))
os << "\tscale " << scale << '\n'; os << "\tscale " << scale << '\n';
} else { } else {
if (!width.zero()) if (!width.zero())
os << "\twidth " << width.asString() << '\n'; os << "\twidth " << width.asString() << '\n';
}
if (!height.zero()) if (!height.zero())
os << "\theight " << height.asString() << '\n'; os << "\theight " << height.asString() << '\n';
}
if (keepAspectRatio) if (keepAspectRatio)
os << "\tkeepAspectRatio\n"; os << "\tkeepAspectRatio\n";
if (draft) // draft mode if (draft) // draft mode
@ -199,6 +199,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
} else if (token == "height") { } else if (token == "height") {
lex.next(); lex.next();
height = LyXLength(lex.getString()); height = LyXLength(lex.getString());
scale = 0.0;
} else if (token == "keepAspectRatio") { } else if (token == "keepAspectRatio") {
keepAspectRatio = true; keepAspectRatio = true;
} else if (token == "draft") { } else if (token == "draft") {
@ -206,9 +207,12 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
} else if (token == "noUnzip") { } else if (token == "noUnzip") {
noUnzip = true; noUnzip = true;
} else if (token == "BoundingBox") { } else if (token == "BoundingBox") {
for (int i=0; i<4 ;i++) { bb.erase();
for (int i = 0; i < 4; ++i) {
if (i != 0)
bb += " ";
lex.next(); lex.next();
bb += (lex.getString()+" "); bb += lex.getString();
} }
} else if (token == "clip") { } else if (token == "clip") {
clip = true; clip = true;