rgheck wrote:
So it might be that we could go with the attached, which is what you suggested earlier. I'm not sure, however, because e.g.
pars_[pit].inInset()->getLayout(buffer.params()).font()
will be sane_font for InsetText, and I'm worried that that isn't right.

The right patch is attached---the other one had a copy-paste error. But it makes the counters in sections go all weird. It may be that changing sane_font to inherit_font in the InsetLayout constructor---probably that should be the default---would fix this. That's what they end up being set to, as a default, in InsetLayout::read(), anyway.

rh

Index: Text2.cpp
===================================================================
--- Text2.cpp	(revision 26166)
+++ Text2.cpp	(working copy)
@@ -84,10 +84,7 @@
 		// In case the default family has been customized
 		if (layout.font.family() == INHERIT_FAMILY)
 			lf.setFamily(buffer.params().getFont().fontInfo().family());
-		InsetCollapsable const * icp = pars_[pit].inInset()->asInsetCollapsable();
-		if (!icp)
-			return lf;
-		FontInfo icf = icp->getLayout().font();
+		FontInfo icf = pars_[pit].inInset()->getLayout(buffer.params()).font();
 		icf.realize(lf);
 		return icf;
 	}
@@ -111,10 +108,7 @@
 		// In case the default family has been customized
 		if (layout.labelfont.family() == INHERIT_FAMILY)
 			lf.setFamily(buffer.params().getFont().fontInfo().family());
-		InsetCollapsable const * icp = par.inInset()->asInsetCollapsable();
-		if (!icp)
-			return lf;
-		FontInfo icf = icp->getLayout().labelfont();
+		FontInfo icf = par.inInset()->getLayout(buffer.params()).labelfont();
 		icf.realize(lf);
 		return icf;
 	}

Reply via email to