]> git.lyx.org Git - features.git/commitdiff
(Rob Lahaye): read and write latex height data of graphic correctly.
authorAngus Leeming <leeming@lyx.org>
Thu, 31 Oct 2002 11:33:49 +0000 (11:33 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 31 Oct 2002 11:33:49 +0000 (11:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5562 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetgraphics.C
src/insets/insetgraphicsParams.C

index 8dd59712947a0cbf692cc465d0e79b7932648c82..a70f289dc5fc7a29e71d5ab0655b7fac9b002dbd 100644 (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>
 
        * insetfloat.C (addToTOC): recursively traverse all
index dbaf7813e484434de4359a06550631a2c98cdeb7..dd92daaba04fa6196e82a5987df42c65a3c0550c 100644 (file)
@@ -18,7 +18,6 @@ TODO
     * 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
       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
       it knows of, thus selection based on the image instead of based on
       filename.
index 2a4c0b00409672d184126cbe53f5a920a7006576..ad012fd9fe73d4fe8442592b7aa47ca3fb2cb4a8 100644 (file)
@@ -142,16 +142,16 @@ void InsetGraphicsParams::Write(ostream & os) const
                os << "\tlyxscale " << lyxscale << '\n';
        if (display != grfx::DefaultDisplay)
                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))
                        os << "\tscale " << scale << '\n';
        } else {
                if (!width.zero())
                        os << "\twidth " << width.asString() << '\n';
+               if (!height.zero())
+                       os << "\theight " << height.asString() << '\n';
        }
 
-       if (!height.zero())
-               os << "\theight " << height.asString() << '\n';
        if (keepAspectRatio)
                os << "\tkeepAspectRatio\n";
        if (draft)                      // draft mode
@@ -199,6 +199,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
        } else if (token == "height") {
                lex.next();
                height = LyXLength(lex.getString());
+               scale = 0.0;
        } else if (token == "keepAspectRatio") {
                keepAspectRatio = true;
        } else if (token == "draft") {
@@ -206,9 +207,12 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
        } else if (token == "noUnzip") {
                noUnzip = true;
        } 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();
-                       bb += (lex.getString()+" ");
+                       bb += lex.getString();
                }
        } else if (token == "clip") {
                clip = true;