]> git.lyx.org Git - features.git/commitdiff
rev26385: don't know why but some file were not committed...
authorAbdelrazak Younes <younes@lyx.org>
Sat, 13 Sep 2008 20:19:32 +0000 (20:19 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 13 Sep 2008 20:19:32 +0000 (20:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26387 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text.cpp
src/Text2.cpp
src/Text3.cpp
src/TextMetrics.cpp

index 77a668f901f45df6f6916f57f17bef68517bb080..f0b474cc57486a3419e3d101a9bcf1abfc0d3005 100644 (file)
@@ -1304,9 +1304,9 @@ bool Text::read(Buffer const & buf, Lexer & lex,
                        lex.pushToken(token);
 
                        Paragraph par;
+                       par.setInsetOwner(insetPtr);
                        par.params().depth(depth);
                        par.setFont(0, Font(inherit_font, buf.params().language));
-                       par.setInsetOwner(insetPtr);
                        pars_.push_back(par);
 
                        // FIXME: goddamn InsetTabular makes us pass a Buffer
index 65c08044c2160156ffdaabadfa3b7b3e77ba8266..fbb12222c7094337448c6df13a125311f61d1682 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();
index 009077c342ab9f9ed944e627df17c0483131dfac..15b68b8dfb5d05c5b62640596c1d94d6ac717c17 100644 (file)
@@ -1401,7 +1401,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
                // add a separate paragraph for the caption inset
                pars.push_back(Paragraph());
-               pars.back().setInsetOwner(pars[0].inInset());
+               pars.back().setInsetOwner(&pars[0].inInset());
                pars.back().setPlainOrDefaultLayout(tclass);
                int cap_pit = pars.size() - 1;
 
@@ -1410,7 +1410,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                // the graphics (or table).
                if (!content) {
                        pars.push_back(Paragraph());
-                       pars.back().setInsetOwner(pars[0].inInset());
+                       pars.back().setInsetOwner(&pars[0].inInset());
                        pars.back().setPlainOrDefaultLayout(tclass);
                }
 
index a85073c5ac34c39656b12829511c257345d3f8e4..84d268afb4f82e964b369999d29ff5615f0f8a09 100644 (file)
@@ -551,19 +551,18 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
                        align = par.params().align();
 
                // handle alignment inside tabular cells
-               if (Inset const * owner = par.inInset()) {
-                       switch (owner->contentAlignment()) {
-                               case LYX_ALIGN_CENTER:
-                               case LYX_ALIGN_LEFT:
-                               case LYX_ALIGN_RIGHT:
-                                       if (align == LYX_ALIGN_NONE 
-                                           || align == LYX_ALIGN_BLOCK)
-                                               align = owner->contentAlignment();
-                                       break;
-                               default:
-                                       // unchanged (use align)
-                                       break;
-                       }
+               Inset const & owner = par.inInset();
+               switch (owner.contentAlignment()) {
+                       case LYX_ALIGN_CENTER:
+                       case LYX_ALIGN_LEFT:
+                       case LYX_ALIGN_RIGHT:
+                               if (align == LYX_ALIGN_NONE 
+                                   || align == LYX_ALIGN_BLOCK)
+                                       align = owner.contentAlignment();
+                               break;
+                       default:
+                               // unchanged (use align)
+                               break;
                }
 
                // Display-style insets should always be on a centred row
@@ -1916,7 +1915,7 @@ int TextMetrics::leftMargin(int max_width,
            && align == LYX_ALIGN_BLOCK
            && !par.params().noindent()
            // in some insets, paragraphs are never indented
-           && !(par.inInset() && par.inInset()->neverIndent())
+           && !par.inInset().neverIndent()
            // display style insets are always centered, omit indentation
            && !(!par.empty()
                    && par.isInset(pos)