]> git.lyx.org Git - lyx.git/blobdiff - src/Text2.cpp
lyx2lyx/lyx_1_6.py: fixes for r26882 as promised
[lyx.git] / src / Text2.cpp
index 65c08044c2160156ffdaabadfa3b7b3e77ba8266..de328e3e2a4a32537f17a283aa064c69e34eded3 100644 (file)
@@ -90,8 +90,7 @@ FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const
                // now, because Inset::getLayout() will return a default-constructed
                // InsetLayout, and that e.g. sets the foreground color to red. So we
                // need to do some work to make that possible.
-               Inset const * inset = pars_[pit].inInset();
-               InsetCollapsable const * icp = inset? inset->asInsetCollapsable() : 0;
+               InsetCollapsable const * icp = pars_[pit].inInset().asInsetCollapsable();
                if (!icp)
                        return lf;
                FontInfo icf = icp->getLayout().font();
@@ -119,8 +118,7 @@ FontInfo Text::labelFont(Buffer const & buffer, Paragraph const & par) const
                if (layout.labelfont.family() == INHERIT_FAMILY)
                        lf.setFamily(buffer.params().getFont().fontInfo().family());
                // FIXME As above....
-               Inset const * inset = par.inInset();
-               InsetCollapsable const * icp = inset? inset->asInsetCollapsable() : 0;
+               InsetCollapsable const * icp = par.inInset().asInsetCollapsable();
                if (!icp)
                        return lf;
                FontInfo icf = icp->getLayout().labelfont();
@@ -199,7 +197,7 @@ void Text::setInsetFont(BufferView const & bv, pit_type pit,
 // return past-the-last paragraph influenced by a layout change on pit
 pit_type Text::undoSpan(pit_type pit)
 {
-       pit_type end = paragraphs().size();
+       pit_type const end = paragraphs().size();
        pit_type nextpit = pit + 1;
        if (nextpit == end)
                return nextpit;