From 46c55ef6b7d5a983eee0bf5de6527a6867c80ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 10 Jul 2003 10:06:20 +0000 Subject: [PATCH] setViewCache: small helper function to hide messy details. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7253 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/insettext.C | 10 ++++++++-- src/insets/insettext.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/insets/insettext.C b/src/insets/insettext.C index ddd9fb4598..2516a229b2 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -1981,14 +1981,20 @@ RowList::iterator InsetText::crow(BufferView * bv) const LyXText * InsetText::getLyXText(BufferView const * bv, bool const recursive) const { - if (bv) - text_.bv_owner = const_cast(bv); + setViewCache(bv); if (recursive && the_locking_inset) return the_locking_inset->getLyXText(bv, true); return &text_; } +void InsetText::setViewCache(BufferView const * bv) const +{ + if (bv) + text_.bv_owner = const_cast(bv); +} + + void InsetText::deleteLyXText(BufferView * bv, bool recursive) const { if (recursive) { diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 0a6b1ae8c3..1434f06b5c 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -165,6 +165,8 @@ public: LyXText * getLyXText(BufferView const *, bool const recursive = false) const; /// + void setViewCache(BufferView const * bv) const; + /// void deleteLyXText(BufferView *, bool recursive = true) const; /// void resizeLyXText(BufferView *, bool force = false) const;