]> git.lyx.org Git - features.git/commitdiff
More signed/unsigned stuff.
authorAngus Leeming <leeming@lyx.org>
Thu, 28 Feb 2002 11:50:42 +0000 (11:50 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 28 Feb 2002 11:50:42 +0000 (11:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3604 a592a061-630c-0410-9148-cb99ea01b6c8

src/graphics/ChangeLog
src/graphics/GraphicsImage.C
src/graphics/GraphicsParams.C
src/graphics/GraphicsParams.h

index 3bccbec74a033c5ac919d0608acd0392a614057f..cd1ca136a0c852562f7bf4de023448d0751f8c27 100644 (file)
@@ -1,5 +1,7 @@
 2002-02-28  Angus Leeming  <a.leeming@ic.ac.uk>
 
+       * GraphicsParams.[Ch]:
+       * GraphicsImage.C:
        * GraphicsImageXPM.C: properly resolve more warnings about comparison
        between signed and unsigned integer expressions.
 
index 6e7c8300aa3ea84cca7507debcf9b56c3e18f1eb..97ee4ed3d22f6d881b97d53ba75426841e1202ae 100644 (file)
@@ -33,11 +33,12 @@ GImage::getScaledDimensions(GParams const & params) const
                // No scaling
                return std::make_pair(getWidth(), getHeight());
 
-       unsigned int width  = 0;
-       unsigned int height = 0;
+       typedef unsigned int dimension;
+       dimension width  = 0;
+       dimension height = 0;
        if (params.scale != 0) {
-               width  = getWidth()  * params.scale / 100.0;
-               height = getHeight() * params.scale / 100.0;
+               width  = dimension(getWidth()  * params.scale / 100.0);
+               height = dimension(getHeight() * params.scale / 100.0);
        } else {
                width  = params.width;
                height = params.height;
index f289b305a18bbbdd39e1162ecd905ad1af412dab..9554e5eb71dc45d271aa992ab4f705fb0f02c773 100644 (file)
@@ -73,8 +73,8 @@ GParams::GParams(InsetGraphicsParams const & iparams)
                // inPixels returns a value scaled by lyxrc.zoom.
                // We want, therefore, to undo this.
                double const scaling_factor = 100.0 / double(lyxrc.zoom);
-               width  = int(scaling_factor * width);
-               height = int(scaling_factor * height);
+               width  = uint(scaling_factor * width);
+               height = uint(scaling_factor * height);
        }
 }
 
@@ -133,10 +133,10 @@ BoundingBox::BoundingBox(string const & bb)
        // want the bounding box in Postscript pixels.
        // Note further that there are 72 Postscript pixels per inch.
        double const scaling_factor = 7200.0 / (lyxrc.dpi * lyxrc.zoom);
-       xl = int(scaling_factor * length_xl.inPixels(1, 1));
-       yb = int(scaling_factor * length_yb.inPixels(1, 1));
-       xr = int(scaling_factor * length_xr.inPixels(1, 1));
-       yt = int(scaling_factor * length_yt.inPixels(1, 1));
+       xl = uint(scaling_factor * length_xl.inPixels(1, 1));
+       yb = uint(scaling_factor * length_yb.inPixels(1, 1));
+       xr = uint(scaling_factor * length_xr.inPixels(1, 1));
+       yt = uint(scaling_factor * length_yt.inPixels(1, 1));
 
        if (xr <= xl || yt <= yb) {
                xl = 0;
index d8a02610d6077023f40ad3708417d93f302a0801..8f90d82d3e416d3355a1af2ac79bfd084ad5f20f 100644 (file)
@@ -37,60 +37,48 @@ struct BoundingBox {
 
        /// 0 0 0 0 is empty!
        bool empty() const;
-       ///
-       int xl;
-       int yb;
-       int xr;
-       int yt;
+
+       unsigned int xl;
+       unsigned int yb;
+       unsigned int xr;
+       unsigned int yt;
 };
 
-///
 bool operator==(BoundingBox const &, BoundingBox const &);
-///
 bool operator!=(BoundingBox const &, BoundingBox const &);
 
 struct GParams 
 {
-       /// 
        GParams(InsetGraphicsParams const &);
 
        /// How is the image to be displayed on the LyX screen?
        enum DisplayType {
-               ///
                COLOR,
-               ///
                GRAYSCALE,
-               ///
                MONOCHROME,
                /// We aren't going to display it at all!
                NONE
        };
 
-       ///
        DisplayType display;
 
        /// The image filename.
        string filename;
 
-       ///
        BoundingBox bb;
 
        /** The size of the view inside lyx in pixels or the scaling of the
         *  image.
         */
        unsigned int width;
-       ///
        unsigned int height;
-       /// 
        unsigned int scale;
 
        /// Rotation angle.
        int angle;
 };
 
-///
 bool operator==(GParams const &, GParams const &);
-///
 bool operator!=(GParams const &, GParams const &);
 
 } // namespace grfx