From 7803b6341b9e9bfcacdb1928f3d90b72e65f7c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 10 Nov 2003 18:13:00 +0000 Subject: [PATCH] small clenaup git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8072 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/InsetList.C | 6 ++---- src/insets/inset.C | 7 +++++++ src/insets/inset.h | 10 +++------- src/insets/insetcollapsable.C | 4 ++-- src/insets/insetcollapsable.h | 2 +- src/insets/insettabular.C | 3 ++- src/insets/insettabular.h | 2 +- src/insets/insettext.C | 12 +++++------- src/insets/insettext.h | 2 +- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/InsetList.C b/src/InsetList.C index ef21a07310..de65af8109 100644 --- a/src/InsetList.C +++ b/src/InsetList.C @@ -182,10 +182,8 @@ void InsetList::deleteInsetsLyXText(BufferView * bv) List::iterator it = list.begin(); List::iterator end = list.end(); for (; it != end; ++it) { - if (it->inset && it->inset->isTextInset()) { - static_cast - (it->inset)->deleteLyXText(bv, true); - } + if (it->inset) + it->inset->deleteLyXText(bv); } } diff --git a/src/insets/inset.C b/src/insets/inset.C index f533708967..6b523f82c0 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -141,6 +141,13 @@ bool InsetOld::checkInsertChar(LyXFont &) } +int InsetOld::scroll(bool recursive) const +{ + if (!recursive || !owner_) + return scx; + return 0; +} + bool isEditableInset(InsetOld const * i) { return i && i->editable(); diff --git a/src/insets/inset.h b/src/insets/inset.h index 0a477651be..70abbb6a5e 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -217,13 +217,9 @@ public: /// int y() const { return yo_; } /// - virtual void deleteLyXText(BufferView *, bool = true) const {} - /// returns the actuall scroll-value - virtual int scroll(bool recursive=true) const { - if (!recursive || !owner_) - return scx; - return 0; - } + virtual void deleteLyXText(BufferView *) const {} + /// returns the actual scroll-value + virtual int scroll(bool recursive = true) const; /// if this insets owns paragraphs (f.ex. InsetText) then it /// should return it's very first one! diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index e7313e0ab1..88cfedffbc 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -351,9 +351,9 @@ void InsetCollapsable::setFont(BufferView * bv, LyXFont const & font, } -void InsetCollapsable::deleteLyXText(BufferView * bv, bool recursive) const +void InsetCollapsable::deleteLyXText(BufferView * bv) const { - inset.deleteLyXText(bv, recursive); + inset.deleteLyXText(bv); } diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index 536e440d6f..f8f095b719 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -92,7 +92,7 @@ public: void setAutoCollapse(bool f); #endif /// - void deleteLyXText(BufferView *, bool recursive=true) const; + void deleteLyXText(BufferView *) const; /// Appends \c list with all labels found within this inset. void getLabelList(Buffer const &, std::vector & list) const; /// diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index e0fec53c00..a38ab49e58 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -1650,8 +1650,9 @@ bool InsetTabular::activateCellInset(BufferView * bv, int x, int y, bool behind) } -void InsetTabular::deleteLyXText(BufferView * /*bv*/, bool /*recursive*/) const +void InsetTabular::deleteLyXText(BufferView * /*bv*/) const { +#warning this is strange, isnt it? But this is 1.3.x code... //resizeLyXText(bv, recursive); } diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 74cfd6798f..28862fb362 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -122,7 +122,7 @@ public: void setFont(BufferView *, LyXFont const &, bool toggleall = false, bool selectall = false); /// - void deleteLyXText(BufferView *, bool recursive = true) const; + void deleteLyXText(BufferView *) const; /// void openLayoutDialog(BufferView *) const; /// diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 56a718e4e2..85dc75e69a 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -959,14 +959,12 @@ void InsetText::setViewCache(BufferView const * bv) const } -void InsetText::deleteLyXText(BufferView * bv, bool recursive) const +void InsetText::deleteLyXText(BufferView * bv) const { - if (recursive) { - /// then remove all LyXText in text-insets - for_each(const_cast(paragraphs).begin(), - const_cast(paragraphs).end(), - boost::bind(&Paragraph::deleteInsetsLyXText, _1, bv)); - } + /// then remove all LyXText in text-insets + for_each(const_cast(paragraphs).begin(), + const_cast(paragraphs).end(), + boost::bind(&Paragraph::deleteInsetsLyXText, _1, bv)); } diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 863288d56e..752ecf3669 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -119,7 +119,7 @@ public: /// void setViewCache(BufferView const * bv) const; /// - void deleteLyXText(BufferView *, bool recursive = true) const; + void deleteLyXText(BufferView *) const; /// bool showInsetDialog(BufferView *) const; /// Appends \c list with all labels found within this inset.