On Thu, Dec 01, 2005 at 06:03:42PM +0200, Martin Vermeer wrote: > On Thu, 2005-12-01 at 16:51 +0100, Jean-Marc Lasgouttes wrote: > > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > > > Martin> Which code is doing this? > > > > I suspect the font is a completely instantiated one, instead of being > > full of INHERIT entries. We are probably doing too much resolving... > > Yes, in makeFontEntriesLayoutSpecific.
Attached my fix. Reduces line count for a change. - Martin
Index: lyxtext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v
retrieving revision 1.330
diff -u -p -r1.330 lyxtext.h
--- lyxtext.h 28 Nov 2005 11:52:01 -0000 1.330
+++ lyxtext.h 1 Dec 2005 21:24:45 -0000
@@ -363,7 +363,7 @@ private:
pit_type undoSpan(pit_type pit);
/// used in setlayout
- void makeFontEntriesLayoutSpecific(BufferParams const &, Paragraph &
par);
+ void reduceFontEntries(BufferParams const &, Paragraph & par);
/// Calculate and set the height of the row
void setHeightOfRow(pit_type, Row & row);
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.635
diff -u -p -r1.635 text2.C
--- text2.C 28 Nov 2005 11:52:02 -0000 1.635
+++ text2.C 1 Dec 2005 21:24:46 -0000
@@ -279,21 +286,12 @@ void LyXText::setCharFont(pit_type pit,
// used in setLayout
// Asger is not sure we want to do this...
-void LyXText::makeFontEntriesLayoutSpecific(BufferParams const & params,
- Paragraph & par)
+void LyXText::reduceFontEntries(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);
+ tmpfont.reduce(defaultfont_);
par.setFont(pos, tmpfont);
}
}
@@ -327,7 +325,7 @@ void LyXText::setLayout(pit_type start,
for (pit_type pit = start; pit != end; ++pit) {
pars_[pit].applyLayout(lyxlayout);
- makeFontEntriesLayoutSpecific(bufparams, pars_[pit]);
+ reduceFontEntries(bufparams, pars_[pit]);
if (lyxlayout->margintype == MARGIN_MANUAL)
pars_[pit].setLabelWidthString(lyxlayout->labelstring());
}
pgpD2oQBF53Rg.pgp
Description: PGP signature
