From 2bf63aa652ecdf69ef4105a6749e8b802e8e54cc Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 9 Aug 2009 17:01:04 +0000 Subject: [PATCH] Get rid of some Paragraph::inInset() access. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30953 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text2.cpp | 2 +- src/Text3.cpp | 4 ++-- src/TextMetrics.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Text2.cpp b/src/Text2.cpp index 5eedf4f307..cda8fae1ae 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -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(); diff --git a/src/Text3.cpp b/src/Text3.cpp index 1874607f53..a9b1e30f09 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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); } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 20aa586a44..89dbbdc0ac 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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) { -- 2.39.2