]> git.lyx.org Git - features.git/commitdiff
partial fix for bug 1973
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 17 Dec 2005 15:03:41 +0000 (15:03 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 17 Dec 2005 15:03:41 +0000 (15:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10664 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insetbase.h
src/rowpainter.C
src/text.C

index 3c341f2d058f1ffd2fe287eab887841495d13b2a..519672102c9df67e317213de4781ae8264cb3a01 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-08  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * text.C (redoParagraph): honor inset->noFontChange()
+       * rowpainter.C (paintInset): ditto
+
 2005-12-15  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * lyx_main.C (priv_exec): don't initialize Math on startup 
index a81d11ec5264fc8399d5dee9d360fda1982f0187..d92960c25f34047f1fd5ff3b211f625d9048c266 100644 (file)
@@ -1,3 +1,7 @@
+2005-12-12  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * insetbase.h (noFontChange): refine documentation
+
 2005-12-16  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * insetcollapsable.C: fix "turds" when changing openinlined_
index 6f0a860ba85827add88151ffecbea58cf785a6ed..516558828e7fd0803f26cbff512de9a12ec532ff 100644 (file)
@@ -383,7 +383,14 @@ public:
        virtual mode_type currentMode() const { return UNDECIDED_MODE; }
        /// returns whether this inset is allowed in other insets of given mode
        virtual bool allowedIn(mode_type) const { return true; }
-       /// is this inset allowed within a font change?
+       /**
+        * Is this inset allowed within a font change?
+        *
+        * FIXME: noFontChange means currently that the font change is closed
+        * in LaTeX before the inset, and that the contents of the inset
+        * will be in default font. This should be changed so that the inset
+        * changes the font again.
+        */
        virtual bool noFontChange() const { return false; }
 
        /// mark the inset as erased or not
index 8543e147debb00e34680de51d50d402027b5e7f7..75a8f1fb1fbead05e300c339100c27c3dcb05ed5 100644 (file)
@@ -154,7 +154,11 @@ void RowPainter::paintInset(pos_type const pos, LyXFont const & font)
        InsetBase const * inset = par_.getInset(pos);
        BOOST_ASSERT(inset);
        PainterInfo pi(const_cast<BufferView *>(&bv_), pain_);
-       pi.base.font = font;
+       // FIXME: We should always use font, see documentation of
+       // noFontChange() in insetbase.h.
+       pi.base.font = inset->noFontChange() ?
+               bv_.buffer()->params().getLyXTextClass().defaultfont() :
+               font;
        pi.ltr_pos = (text_.bidi.level(pos) % 2 == 0);
        pi.erased_ = erased_ || isDeletedText(par_, pos);
        theCoords.insets().add(inset, int(x_), yo_);
index dcdf3b92ea1109bbb3695e179818657419e0d2db..f19a06144c178fe0b711444366471d1c9f99c8d3 100644 (file)
@@ -1684,12 +1684,19 @@ bool LyXText::redoParagraph(pit_type const pit)
        }
 
        // redo insets
+       // FIXME: We should always use getFont(), see documentation of
+       // noFontChange() in insetbase.h.
+       LyXFont const tclassfont =
+               bv()->buffer()->params().getLyXTextClass().defaultfont();
        InsetList::iterator ii = par.insetlist.begin();
        InsetList::iterator iend = par.insetlist.end();
        for (; ii != iend; ++ii) {
                Dimension dim;
                int const w = maxwidth_ - leftMargin(pit, ii->pos) - rightMargin(par);
-               MetricsInfo mi(bv(), getFont(par, ii->pos), w);
+               LyXFont const & font = ii->inset->noFontChange() ?
+                       tclassfont :
+                       getFont(par, ii->pos);
+               MetricsInfo mi(bv(), font, w);
                ii->inset->metrics(mi, dim);
        }