]> git.lyx.org Git - lyx.git/commitdiff
remove Inset::update()
authorAndré Pönitz <poenitz@gmx.net>
Thu, 17 Jul 2003 07:32:01 +0000 (07:32 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 17 Jul 2003 07:32:01 +0000 (07:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7298 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/inset.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insetert.C
src/insets/insetert.h
src/insets/insetminipage.C
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/text.C

index 84aa5b4b9a59823407460a2c208af1e0d0eafefb..f5c96356788b4e2c47ac0794d030993a479c342f 100644 (file)
@@ -162,9 +162,6 @@ public:
        int descent(BufferView *, LyXFont const &) const;
        ///
        int width(BufferView *, LyXFont const &) const;
-       /// update the inset representation
-       virtual void update(BufferView *, bool = false)
-               {}
        /// what appears in the minibuffer when opening
        virtual string const editMessage() const;
        ///
index 43d81cc2d315580210ad4aaf1cf14705c032080e..e68267c85dd5652e223d7a59d1accd5f676ad52e 100644 (file)
@@ -289,23 +289,6 @@ int InsetCollapsable::docbook(Buffer const * buf, ostream & os, bool mixcont) co
 }
 
 
-void InsetCollapsable::update(BufferView * bv, bool reinit)
-{
-       if (in_update) {
-               if (reinit && owner()) {
-                       owner()->update(bv, true);
-               }
-               return;
-       }
-       in_update = true;
-       inset.update(bv, reinit);
-       if (reinit && owner()) {
-               owner()->update(bv, true);
-       }
-       in_update = false;
-}
-
-
 Inset::RESULT InsetCollapsable::localDispatch(FuncRequest const & cmd)
 {
        lyxerr << "InsetCollapsable::localDispatch: "
index 3908081e6d69ad84a0c160e87e68f7bbbee50689..bfecd73dd8f3923b2a34fea711aef3fb52f93ded 100644 (file)
@@ -51,8 +51,6 @@ public:
        /// draw, either inlined (no button) or collapsed/open
        void draw(PainterInfo & pi, int x, int y, bool inlined) const;
        ///
-       void update(BufferView *, bool = false);
-       ///
        EDITABLE editable() const;
        ///
        bool insertInset(BufferView *, Inset * inset);
index b0f96d24973d2b8d7a28cd86202eab7c0833a002..9ac0dbe80819fc10e9ab9bf5acf294fd2854c11a 100644 (file)
@@ -453,7 +453,6 @@ Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
                 * taken by the text).
                 */
                inset.getLyXText(cmd.view())->fullRebreak();
-               inset.update(cmd.view(), true);
                bv->updateInset(this);
                result = DISPATCHED;
        }
@@ -550,6 +549,7 @@ bool InsetERT::checkInsertChar(LyXFont & /* font */)
 
 void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
 {
+       setButtonLabel();
        if (inlined())
                inset.metrics(mi, dim);
        else
@@ -662,17 +662,6 @@ int InsetERT::getMaxWidth(BufferView * bv, UpdatableInset const * in) const
 }
 
 
-void InsetERT::update(BufferView * bv, bool reinit)
-{
-       if (inset.need_update & InsetText::INIT ||
-           inset.need_update & InsetText::FULL) {
-               setButtonLabel();
-       }
-
-       InsetCollapsable::update(bv, reinit);
-}
-
-
 string const InsetERTMailer::name_("ert");
 
 InsetERTMailer::InsetERTMailer(InsetERT & inset)
index 86811b6ac35a578839ea69a83fe3f98da6512a6a..a6ed08548bc0af8387937bc0d59e95ac9311ed74 100644 (file)
@@ -114,8 +114,6 @@ public:
        }
        ///
        int getMaxWidth(BufferView *, UpdatableInset const *) const;
-       ///
-       void update(BufferView *, bool =false);
 
 private:
        ///
index ecd4a0070d9c8cf21ad072582f09a8013469007b..69e84c7cd0b1f83e691e6607b249fe492a94af2a 100644 (file)
@@ -119,7 +119,6 @@ dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd)
                /* FIXME: I refuse to believe we have to live
                 * with ugliness like this ... */
                inset.getLyXText(cmd.view())->fullRebreak();
-               inset.update(cmd.view(), true);
                cmd.view()->updateInset(this);
                return DISPATCHED;
        }
index 7a2229a0155b073059a760926227fed895f70787..1672bdfa5bc31a1aaf62823f9eb5654ebdfa47c9 100644 (file)
@@ -410,11 +410,6 @@ void InsetTabular::drawCellSelection(Painter & pain, int x, int y,
 }
 
 
-void InsetTabular::update(BufferView * bv, bool reinit)
-{
-}
-
-
 string const InsetTabular::editMessage() const
 {
        return _("Opened table");
@@ -1270,8 +1265,6 @@ bool InsetTabular::calculate_dimensions_of_cells(BufferView * bv, bool reinit) c
                                continue;
                        ++cell;
                        inset = tabular.getCellInset(cell);
-                       if (!reinit && !tabular.getPWidth(cell).zero())
-                               inset->update(bv, false);
                        maxAsc = max(maxAsc, inset->ascent(bv, font));
                        maxDesc = max(maxDesc, inset->descent(bv, font));
                        changed = tabular.setWidthOfCell(cell, inset->width(bv, font)) || changed;
index f1a4d012a273fe1e8a04223721ec9b23b9231797..9ff09c9c461a94943144ff78167adfae6e0b301a 100644 (file)
@@ -86,8 +86,6 @@ public:
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void update(BufferView *, bool = false);
-       ///
        string const editMessage() const;
        //
        void insetUnlock(BufferView *);
index 570e8b486ca392281408a34fa47edd70297e9d6a..d359758e083def086a735d8e3c8c85778751aa04 100644 (file)
@@ -403,12 +403,6 @@ void InsetText::drawFrame(Painter & pain, int x) const
 }
 
 
-void InsetText::update(BufferView * bv, bool reinit)
-{
-       setViewCache(bv);
-}
-
-
 void InsetText::setUpdateStatus(int what) const
 {
        need_update |= what;
index 62db777f941a2ed8afddfa7e66712bad2b474c43..8672ae8071cda37046faf34ce93aff9219623112 100644 (file)
@@ -92,8 +92,6 @@ public:
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void update(BufferView *, bool = false);
-       ///
        void setUpdateStatus(int what) const;
        ///
        string const editMessage() const;
index d6b9af3b3644362737664020ed004ae470f59f30..174bd209a9a1fa9cbf1575348618767691a9a7f7 100644 (file)
@@ -35,6 +35,7 @@
 #include "paragraph_funcs.h"
 #include "rowpainter.h"
 #include "lyxrow_funcs.h"
+#include "metricsinfo.h"
 
 #include "insets/insettext.h"
 
@@ -319,9 +320,15 @@ int LyXText::singleWidth(ParagraphList::iterator pit,
                        // this IS needed otherwise on initialitation we don't get the fill
                        // of the row right (ONLY on initialization if we read a file!)
                        // should be changed! (Jug 20011204)
-                       tmpinset->update(bv());
+                       //tmpinset->update(bv());
+                       Dimension dim;
+                       MetricsInfo mi;
+                       mi.base.bv = bv();
+                       mi.base.font = font;
+                       tmpinset->metrics(mi, dim);
 #endif
-                       return tmpinset->width(bv(), font);
+                       //return tmpinset->width(bv(), font);
+                       return dim.wid;
                }
                return 0;
        }
@@ -1079,13 +1086,21 @@ void LyXText::setHeightOfRow(RowList::iterator rit)
                                if (tmpinset) {
 #if 1 // this is needed for deep update on initialitation
 #warning inset->update FIXME
-                                       tmpinset->update(bv());
+                                       //tmpinset->update(bv());
+                                       Dimension dim;
+                                       MetricsInfo mi;
+                                       mi.base.bv = bv();
+                                       mi.base.font = tmpfont;
+                                       tmpinset->metrics(mi, dim);
 #endif
-                                       maxwidth += tmpinset->width(bv(), tmpfont);
-                                       maxasc = max(maxasc,
-                                                    tmpinset->ascent(bv(), tmpfont));
-                                       maxdesc = max(maxdesc,
-                                                     tmpinset->descent(bv(), tmpfont));
+                                       //maxwidth += tmpinset->width(bv(), tmpfont);
+                                       //maxasc = max(maxasc,
+                                       //           tmpinset->ascent(bv(), tmpfont));
+                                       //maxdesc = max(maxdesc,
+                                       //            tmpinset->descent(bv(), tmpfont));
+                                       maxwidth += dim.wid;
+                                       maxasc = max(maxasc, dim.asc);
+                                       maxdesc = max(maxdesc, dim.des);
                                }
                        } else {
                                maxwidth += singleWidth(pit, pos);