]> git.lyx.org Git - lyx.git/blobdiff - src/dimension.h
Fix 3188, update the labels at each Caption insertion.
[lyx.git] / src / dimension.h
index 8bca47a93d1648b910fc696c7e864afc281d4456..5dd32d3bebd2583314cfeec6e55158fc0b2f345a 100644 (file)
@@ -12,8 +12,7 @@
 #ifndef DIMENSION_H
 #define DIMENSION_H
 
-
-class LyXFont;
+namespace lyx {
 
 /// Simple wrapper around three ints
 class Dimension {
@@ -23,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
@@ -64,7 +67,17 @@ 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 ;
 }
 
+
+} // namespace lyx
+
 #endif