]> git.lyx.org Git - features.git/commitdiff
small stuff (white space, const, remove a const_cast...)
authorAndré Pönitz <poenitz@gmx.net>
Fri, 23 May 2003 15:30:48 +0000 (15:30 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 23 May 2003 15:30:48 +0000 (15:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7033 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insetbutton.h
src/insets/insettabular.C
src/insets/updatableinset.C
src/lyxtext.h
src/mathed/ChangeLog
src/mathed/formulamacro.C
src/text.C

index 3908c9055df43d16f0b4d282b147105a91afb2c6..51bb95b09cef3332cf227bd01c95294335594fdd 100644 (file)
@@ -33,6 +33,8 @@
 
        * iterators.[Ch]: add access to topmost ParagraphList
 
+       * lyxtext.[Ch] (workWidth): add a const
+
 2003-05-23  Alfredo Braunstein  <abraunst@libero.it>
 
        * texrow.[Ch] (increasePos): remove function
index 3c761ca39cf8d26d633b058123950563b0cc6925..53ceb435191d771fe275f3e254d1ac3ba22f62ca 100644 (file)
@@ -1,3 +1,13 @@
+
+2003-05-23  André Pönitz  <poenitz@gmx.net>
+
+       * insetbutton.h: whitespace
+
+       * insettabular.C: more compact code
+
+       * updatableinset.C: remove const_cast
+
+
 2003-05-23  Angus Leeming  <leeming@lyx.org>
 
        * insetexternal.C (write): check how many lines are output.
index 9d5deb926666faed8ec585f8b495fe1621285671..821d8683776183a21c4041a807300728940c654b 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef INSET_BUTTON_H
 #define INSET_BUTTON_H
 
-
 #include "inset.h"
 #include "LString.h"
 #include <boost/weak_ptr.hpp>
index fa61c23ffb58be709a1ad597fa8c393f54003048..b92763c79f8262c48d6c2ffe137ffa3c9128d46a 100644 (file)
@@ -681,8 +681,7 @@ bool InsetTabular::lfunMouseRelease(FuncRequest const & cmd)
                ret = the_locking_inset->localDispatch(cmd1);
        }
        if (cmd.button() == mouse_button::button3 && !ret) {
-               InsetTabularMailer mailer(*this);
-               mailer.showDialog(cmd.view());
+               InsetTabularMailer(*this).showDialog(cmd.view());
                return true;
        }
        return ret;
index eb61360c69a585d1dcb5cbc15b5ecb5e268861e7..eef6a357aa7830d0cd4dce7c30ec50b1c3a1f2f9 100644 (file)
@@ -142,16 +142,16 @@ int UpdatableInset::getMaxWidth(BufferView * bv, UpdatableInset const *) const
        int w;
 
        if (owner()) {
-               w = static_cast<UpdatableInset*> (owner())->getMaxWidth(bv, this);
+               w = static_cast<UpdatableInset *>(owner())->getMaxWidth(bv, this);
        } else {
-               w = bv->text->workWidth(const_cast<UpdatableInset *>(this));
+               w = bv->text->workWidth(this);
        }
        if (w < 0) {
                return -1;
        }
        // check for margins left/right and extra right margin "const 5"
-       if ((w - ((2 * TEXT_TO_INSET_OFFSET) + 5)) >= 0)
-               w -= (2 * TEXT_TO_INSET_OFFSET) + 5;
+       if ((w - (2 * TEXT_TO_INSET_OFFSET + 5)) >= 0)
+               w -= 2 * TEXT_TO_INSET_OFFSET + 5;
 
        // Deep magic. I don't understand this either.
        if (owner() && owner()->owner()) {
index 7e44bfb02ce1c21cc425cecbb0a62628554ba846..9978e0d53f2c26ea66d7bab0ccd2303e23799730 100644 (file)
@@ -471,8 +471,8 @@ public:
        void checkParagraph(ParagraphList::iterator pit, lyx::pos_type pos);
        ///
        int workWidth() const;
-       ///
-       int workWidth(Inset * inset) const;
+       /// returns width of row containing inset
+       int workWidth(Inset const * inset) const;
 
        ///
        void computeBidiTables(Buffer const *, RowList::iterator row) const;
index 19f781889ae22e68c214fdd96ac5dd97d5afae7c..6365686d85ce34bcacd5b43f3f268eedbce9cb2e 100644 (file)
@@ -1,3 +1,8 @@
+
+2003-05-19  André Pönitz  <poenitz@gmx.net>
+
+       * formulamacro.C: avoid multiple metrics computation
+
 2003-05-23  Angus Leeming  <leeming@lyx.org>
 
        * formula.C (latex):
index 3a96e87ebf221d3ae7d31e42217029a80cd87990..d64825aa634c09cbb1728bf03cb140ec78f03f83 100644 (file)
@@ -175,10 +175,12 @@ void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
        pi.base.style = LM_ST_TEXT;
        pi.base.font  = font;
 
+       Dimension dim;
+       dimension(bv, font, dim);
        int const x = int(xx);
-       int const a = y - ascent(bv, font) + 1;
-       int const w = width(bv, font) - 2;
-       int const h = ascent(bv, font) + descent(bv, font) - 2;
+       int const a = y - dim.a + 1;
+       int const w = dim.w - 2;
+       int const h = dim.height() - 2;
 
        // LColor::mathbg used to be "AntiqueWhite" but is "linen" now, too
        pi.pain.fillRectangle(x, a, w, h, LColor::mathmacrobg);
index 632370f5991e47c4c9f11e6733cdf74ca7e39b73..29bd502203b8aa1e54d38b87d76fe71f7aefac17 100644 (file)
@@ -145,7 +145,7 @@ int LyXText::workWidth() const
 }
 
 
-int LyXText::workWidth(Inset * inset) const
+int LyXText::workWidth(Inset const * inset) const
 {
        Paragraph * par = inset->parOwner();
        lyx::Assert(par);