]> git.lyx.org Git - lyx.git/commitdiff
Get rid of some Paragraph::inInset() access.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 9 Aug 2009 17:01:04 +0000 (17:01 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 9 Aug 2009 17:01:04 +0000 (17:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30953 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 5eedf4f3078bcf079c0844e8ec7924c8f8596f01..cda8fae1aec59e8bc77e2a56e240031c5bb66e04 100644 (file)
@@ -85,7 +85,7 @@ FontInfo Text::layoutFont(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.
-               InsetCollapsable const * icp = pars_[pit].inInset().asInsetCollapsable();
+               InsetCollapsable const * icp = owner_->asInsetCollapsable();
                if (!icp)
                        return lf;
                FontInfo icf = icp->getLayout().font();
index 1874607f53ffa4dee0fe8044dd3e662b8abc1734..a9b1e30f0961de7d3eaac352e0ac59856a05a0f6 100644 (file)
@@ -1685,7 +1685,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(&cur.text()->inset());
                pars.back().setPlainOrDefaultLayout(tclass);
                int cap_pit = pars.size() - 1;
 
@@ -1694,7 +1694,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(&cur.text()->inset());
                        pars.back().setPlainOrDefaultLayout(tclass);
                }
 
index 20aa586a4424ccdf42246c9109de4dfcdce47cdd..89dbbdc0acefd1151d78285367f945d041689870 100644 (file)
@@ -576,7 +576,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit,
                        align = par.params().align();
 
                // handle alignment inside tabular cells
-               Inset const & owner = par.inInset();
+               Inset const & owner = text_->inset();
                switch (owner.contentAlignment()) {
                        case LYX_ALIGN_CENTER:
                        case LYX_ALIGN_LEFT:
@@ -1041,7 +1041,7 @@ Dimension TextMetrics::rowHeight(pit_type const pit, pos_type const first,
        ++maxdesc;
 
        ParagraphList const & pars = text_->paragraphs();
-       Inset const & inset = par.inInset();
+       Inset const & inset = text_->inset();
 
        // is it a top line?
        if (first == 0 && topBottomSpace) {