From 2faeeb8b965639aa0e5093f4f352c644111f3a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 5 Aug 2003 11:54:44 +0000 Subject: [PATCH] merge InsetText::setParagraphData and InsetText::init git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7506 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insettext.C | 38 ++++++++++++++------------------------ src/insets/insettext.h | 2 -- 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 09666a83b6..b8a20e23fd 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -154,7 +154,16 @@ void InsetText::init(InsetText const * ins) if (ins) { textwidth_ = ins->textwidth_; text_.bv_owner = ins->text_.bv_owner; - setParagraphData(ins->paragraphs); + + paragraphs = ins->paragraphs; + + ParagraphList::iterator pit = paragraphs.begin(); + ParagraphList::iterator end = paragraphs.end(); + for (; pit != end; ++pit) + pit->setInsetOwner(this); + + reinitLyXText(); + autoBreakRows = ins->autoBreakRows; drawFrame_ = ins->drawFrame_; frame_color = ins->frame_color; @@ -1588,32 +1597,11 @@ bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y, } -void InsetText::setParagraphData(ParagraphList const & plist) -{ - // we have to unlock any locked inset otherwise we're in troubles - the_locking_inset = 0; - - // But it it makes no difference that is a lot better. -#warning FIXME. - // See if this can be simplified when std::list is in effect. - paragraphs.clear(); - - ParagraphList::const_iterator it = plist.begin(); - ParagraphList::const_iterator end = plist.end(); - for (; it != end; ++it) { - paragraphs.push_back(*it); - paragraphs.back().setInsetOwner(this); - } - - reinitLyXText(); -} - - void InsetText::markNew(bool track_changes) { ParagraphList::iterator pit = paragraphs.begin(); - ParagraphList::iterator pend = paragraphs.end(); - for (; pit != pend; ++pit) { + ParagraphList::iterator end = paragraphs.end(); + for (; pit != end; ++pit) { if (track_changes) { pit->trackChanges(); } else { @@ -1774,7 +1762,9 @@ void InsetText::resizeLyXText(BufferView * bv, bool /*force*/) const inset_x = cix() - top_x + drawTextXOffset; inset_y = ciy() + drawTextYOffset; } +#endif +#if 1 text_.top_y(bv->screen().topCursorVisible(&text_)); if (!owner()) { const_cast(this)->updateLocal(bv, false); diff --git a/src/insets/insettext.h b/src/insets/insettext.h index bf32fea0b1..46c6d94440 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -123,8 +123,6 @@ public: /// void writeParagraphData(Buffer const *, std::ostream &) const; /// - void setParagraphData(ParagraphList const &); - /// void setText(string const &, LyXFont const &); /// void setAutoBreakRows(bool);