X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fdimension.h;h=5dd32d3bebd2583314cfeec6e55158fc0b2f345a;hb=e5a46922e916a06ad1b958d5895cc3cfb4f13d2c;hp=4e803682d3d97f6663840544cdbaceeae73f52f8;hpb=6c300f72a217722652dc27db9108e1050028979c;p=lyx.git diff --git a/src/dimension.h b/src/dimension.h index 4e803682d3..5dd32d3beb 100644 --- a/src/dimension.h +++ b/src/dimension.h @@ -12,11 +12,8 @@ #ifndef DIMENSION_H #define DIMENSION_H - namespace lyx { -class LyXFont; - /// Simple wrapper around three ints class Dimension { public: @@ -25,12 +22,16 @@ public: /// initialize data Dimension(int w, int a, int d) : wid(w), asc(a), des(d) {} + Dimension & operator=(Dimension const & dim) { + wid = dim.wid; + asc = dim.asc; + des = dim.des; + return *this; + } /// glue horizontally void operator+=(Dimension const & dim); /// set to empty box void clear() { wid = asc = des = 0; } - /// set to empty box suitble for given font - void clear(LyXFont const & font); /// get height int height() const { return asc + des; } /// get ascent @@ -66,7 +67,14 @@ public: inline bool operator==(Dimension const & a, Dimension const & b) { - return a.wid == b.wid && a.asc == b.asc && a.des ==b.des ; + return a.wid == b.wid && a.asc == b.asc && a.des == b.des ; +} + + +inline +bool operator!=(Dimension const & a, Dimension const & b) +{ + return a.wid != b.wid || a.asc != b.asc || a.des != b.des ; }