]> git.lyx.org Git - lyx.git/commitdiff
Do the last commit the right way. The previous one led to a crash because I wasn't
authorRichard Heck <rgheck@comcast.net>
Thu, 14 Aug 2008 15:44:36 +0000 (15:44 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 14 Aug 2008 15:44:36 +0000 (15:44 +0000)
returning a fully realized font.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26163 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text2.cpp

index 1254fbf99ce9eafcb84961dbbac5558ae3d6c7c2..0386ae764f05a475413f323d7e34fb59d921c74f 100644 (file)
@@ -74,6 +74,7 @@ bool Text::isMainText(Buffer const & buffer) const
 }
 
 
+// Note that this is supposed to return a fully realized font.
 FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const
 {
        Layout const & layout = pars_[pit].layout();
@@ -84,9 +85,11 @@ FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const
                if (layout.font.family() == INHERIT_FAMILY)
                        lf.setFamily(buffer.params().getFont().fontInfo().family());
                InsetCollapsable const * icp = pars_[pit].inInset()->asInsetCollapsable();
-               if (icp)
-                       lf.update(icp->getLayout().font(), false);
-               return lf;
+               if (!icp)
+                       return lf;
+               FontInfo icf = icp->getLayout().font();
+               icf.realize(lf);
+               return icf;
        }
 
        FontInfo font = layout.font;
@@ -98,6 +101,7 @@ FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const
 }
 
 
+// Note that this is supposed to return a fully realized font.
 FontInfo Text::labelFont(Buffer const & buffer, Paragraph const & par) const
 {
        Layout const & layout = par.layout();
@@ -108,9 +112,11 @@ FontInfo Text::labelFont(Buffer const & buffer, Paragraph const & par) const
                if (layout.labelfont.family() == INHERIT_FAMILY)
                        lf.setFamily(buffer.params().getFont().fontInfo().family());
                InsetCollapsable const * icp = par.inInset()->asInsetCollapsable();
-               if (icp)
-                       lf.update(icp->getLayout().labelfont(), false);
-               return lf;
+               if (!icp)
+                       return lf;
+               FontInfo icf = icp->getLayout().labelfont();
+               icf.realize(lf);
+               return icf;
        }
 
        FontInfo font = layout.labelfont;