+2005-12-02 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * text2.C (makeFontEntriesLayoutSpecific): remove.
+ (setLayout): adapt.
+
+ * text.C (insertChar): remove bogus caching of fonts (did not do
+ anything).
+
+ * text2.C (LyXText): initialize current_font to ALL_INHERIT (was
+ ALL_SANE). (bug 2146)
+
2005-12-01 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* rowpainter.C (paintFirst): fix centering of
/// the current font
LyXFont real_current_font;
/// our buffer's default layout font. This is textclass specific
+ /* This is actually never initialized! Should be replaced by a
+ * defaultfont() method that looks at the textclass (easy). [JMarc]*/
LyXFont defaultfont_;
///
int background_color_;
/// change on pit
pit_type undoSpan(pit_type pit);
- /// used in setlayout
- void makeFontEntriesLayoutSpecific(BufferParams const &, Paragraph & par);
-
/// Calculate and set the height of the row
void setHeightOfRow(pit_type, Row & row);
// difference are the special checks when calculating the row.fill
// (blank does not count at the end of a row) and the check here
- // The bug is triggered when we type in a description environment:
- // The current_font is not changed when we go from label to main text
- // and it should (along with realtmpfont) when we type the space.
- // CHECK There is a bug here! (Asger)
-
- // store the current font. This is because of the use of cursor
- // movements. The moving cursor would refresh the current font
- LyXFont realtmpfont = real_current_font;
- LyXFont rawtmpfont = current_font;
-
// When the free-spacing option is set for the current layout,
// disable the double-space checking
if (!freeSpacing && IsLineSeparatorChar(c)) {
}
}
- par.insertChar(cur.pos(), c, rawtmpfont);
-
- current_font = rawtmpfont;
- real_current_font = realtmpfont;
+ par.insertChar(cur.pos(), c, current_font);
setCursor(cur, cur.pit(), cur.pos() + 1, false, cur.boundary());
charInserted();
}
LyXText::LyXText(BufferView * bv)
: maxwidth_(bv ? bv->workWidth() : 100),
+ current_font(LyXFont::ALL_INHERIT),
background_color_(LColor::background),
bv_owner(bv),
autoBreakRows_(false)
}
-// used in setLayout
-// Asger is not sure we want to do this...
-void LyXText::makeFontEntriesLayoutSpecific(BufferParams const & params,
- Paragraph & par)
-{
- LyXLayout_ptr const & layout = par.layout();
- pos_type const psize = par.size();
-
- LyXFont layoutfont;
- for (pos_type pos = 0; pos < psize; ++pos) {
- if (pos < par.beginOfBody())
- layoutfont = layout->labelfont;
- else
- layoutfont = layout->font;
-
- LyXFont tmpfont = par.getFontSettings(params, pos);
- tmpfont.reduce(layoutfont);
- par.setFont(pos, tmpfont);
- }
-}
-
-
// return past-the-last paragraph influenced by a layout change on pit
pit_type LyXText::undoSpan(pit_type pit)
{
for (pit_type pit = start; pit != end; ++pit) {
pars_[pit].applyLayout(lyxlayout);
- makeFontEntriesLayoutSpecific(bufparams, pars_[pit]);
if (lyxlayout->margintype == MARGIN_MANUAL)
pars_[pit].setLabelWidthString(lyxlayout->labelstring());
}