]> git.lyx.org Git - features.git/commitdiff
Remove remnant of the past.
authorAbdelrazak Younes <younes@lyx.org>
Tue, 25 Sep 2007 07:41:03 +0000 (07:41 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 25 Sep 2007 07:41:03 +0000 (07:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20481 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetSpace.cpp
src/insets/InsetSpace.h
src/insets/InsetVSpace.cpp
src/insets/InsetVSpace.h
src/mathed/InsetMathBig.cpp
src/mathed/InsetMathBig.h
src/mathed/InsetMathChar.h

index bb57145452698bea8c0dfe4c059cddfd25aef3e9..bbab7f278e73cabf0b3c9a2d37abd0bb44973516 100644 (file)
@@ -74,12 +74,15 @@ void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
                        dim.wid = 10;
                        break;
        }
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
 }
 
 
 void InsetSpace::draw(PainterInfo & pi, int x, int y) const
 {
-       int const w = dim_.wid;
+       Dimension const dim = dimension(*pi.base.bv);
+       int const w = dim.wid;
        int const h = theFontMetrics(pi.base.font)
                .ascent('x');
        int xp[4], yp[4];
index 459afedcca667a4e46cfe7a8a070d8f26cd2bc98..b254556185e5377aa0eb83abe154f17390eeed3b 100644 (file)
@@ -58,8 +58,6 @@ public:
        ///
        void metrics(MetricsInfo &, Dimension &) const;
        ///
-       Dimension const dimension(BufferView const &) const { return dim_; };
-       ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        void write(Buffer const &, std::ostream &) const;
@@ -94,8 +92,6 @@ private:
 
        /// And which kind is this?
        Kind kind_;
-       ///
-       mutable Dimension dim_;
 };
 
 
index f45801c7b6571b335471e79528cce715a85b3f10..0d630b5cdbf2bdfc3167e5c71862ef6833a8f901 100644 (file)
@@ -138,16 +138,17 @@ void InsetVSpace::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.asc = height / 2 + (a - d) / 2; // align cursor with the
        dim.des = height - dim.asc;         // label text
        dim.wid = ADD_TO_VSPACE_WIDTH + 2 * arrow_size + 5 + w;
-       dim_ = dim;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
 }
 
 
 void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
 {
+       Dimension const dim = dimension(*pi.base.bv);
        x += ADD_TO_VSPACE_WIDTH;
-
-       int const start = y - dim_.asc;
-       int const end   = y + dim_.des;
+       int const start = y - dim.asc;
+       int const end   = y + dim.des;
 
        // y-values for top arrow
        int ty1, ty2;
index 916b440fa5418e35ffdc80082660be0f592834c8..7d511d9b223638c82201567548b4efd0c143c081 100644 (file)
@@ -31,8 +31,6 @@ public:
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       Dimension const dimension(BufferView const &) const { return dim_; };
-       ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        int latex(Buffer const &, odocstream &,
@@ -63,8 +61,6 @@ private:
 
        ///
        VSpace space_;
-       ///
-       mutable Dimension dim_;
 };
 
 
index a5a0295fbfc3402ea47d195a4c0ae10eaea29a60..117127e882ba2c303dfaa453d0b1e72dd3e2bef5 100644 (file)
@@ -67,19 +67,21 @@ void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.wid = 6;
        dim.asc = int(h + f * h);
        dim.des = int(f * h);
-       dim_ = dim;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
 }
 
 
 void InsetMathBig::draw(PainterInfo & pi, int x, int y) const
 {
+       Dimension const dim = dimension(*pi.base.bv);
        // mathed_draw_deco does not use the leading backslash, so remove it
        // (but don't use ltrim if this is the backslash delimiter).
        // Replace \| by \Vert (equivalent in LaTeX), since mathed_draw_deco
        // would treat it as |.
        docstring const delim = (delim_ == "\\|") ?  from_ascii("Vert") :
                (delim_ == "\\\\") ? from_ascii("\\") : support::ltrim(delim_, "\\");
-       mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(),
+       mathed_draw_deco(pi, x + 1, y - dim.ascent(), 4, dim.height(),
                         delim);
        setPosCache(pi, x, y);
 }
index ec590a094d7ee55a2624c389630876c00f599d3d..2736669b58628a87060af6f616c2c83b4594a2de 100644 (file)
@@ -50,8 +50,6 @@ private:
        docstring const name_;
        /// ( or [ or \\Vert...
        docstring const delim_;
-       ///
-       mutable Dimension dim_;
 };
 
 
index 0b57bbe76a05b190e89bc0efb9a40034957995b2..3a65841c4f8d0538b273030415aec41d5c49382d 100644 (file)
@@ -55,8 +55,6 @@ private:
        char_type char_;
        /// cached kerning for superscript
        mutable int kerning_;
-       /// FIXME: move this out to BufferView
-       mutable Dimension dim_;
 };
 
 } // namespace lyx