From f879ff4b474857a3458f3ec24ab8b108a1d88b63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Wed, 4 Apr 2001 21:37:14 +0000 Subject: [PATCH] move code in file git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1891 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView2.C | 1 + src/TextCache.C | 61 ++++++++++++++++++++--------------------------- 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/src/BufferView2.C b/src/BufferView2.C index 9c26846fb4..745cc2b88a 100644 --- a/src/BufferView2.C +++ b/src/BufferView2.C @@ -1020,6 +1020,7 @@ LyXText * BufferView::getParentText(Inset * inset) const return text; } + Language const * BufferView::getParentLanguage(Inset * inset) const { LyXText * text = getParentText(inset); diff --git a/src/TextCache.C b/src/TextCache.C index 5e11893eb9..28f956499b 100644 --- a/src/TextCache.C +++ b/src/TextCache.C @@ -3,9 +3,9 @@ * * LyX, The Document Processor * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team + * Copyright 1995-2001 The LyX Team * - * This file is Copyright 2000 + * This file is Copyright 2000-2001 * Lars Gullik Bjønnes * * ====================================================== */ @@ -31,6 +31,8 @@ using std::make_pair; extern BufferList bufferlist; +namespace { + class text_fits { public: text_fits(Buffer * b, int p) @@ -46,6 +48,28 @@ private: }; +class show_text { +public: + show_text(ostream & o) : os(o) {} + void operator()(TextCache::value_type const & vt) { + os << "\tBuffer: " << vt.first + << "\tWidth: " << vt.second.first << endl; + } +private: + ostream & os; +}; + + +class delete_text { +public: + void operator()(TextCache::value_type & vt) { + delete vt.second.second; + } +}; + +} // namespace anon + + LyXText * TextCache::findFit(Buffer * b, int p) { Cache::iterator it = find_if(cache.begin(), cache.end(), @@ -59,18 +83,6 @@ LyXText * TextCache::findFit(Buffer * b, int p) } -class show_text { -public: - show_text(ostream & o) : os(o) {} - void operator()(TextCache::value_type const & vt) { - os << "\tBuffer: " << vt.first - << "\tWidth: " << vt.second.first << endl; - } -private: - ostream & os; -}; - - void TextCache::show(ostream & os, string const & str) { os << "TextCache: " << str << endl; @@ -98,14 +110,6 @@ void TextCache::add(Buffer * buf, int workwidth, LyXText * text) } -class delete_text { -public: - void operator()(TextCache::value_type & vt) { - delete vt.second.second; - } -}; - - void TextCache::clear() { for_each(cache.begin(), cache.end(), delete_text()); @@ -113,19 +117,6 @@ void TextCache::clear() } -class has_buffer { -public: - has_buffer(Buffer * b) - : buf(b) {} - bool operator()(TextCache::value_type const & vt) const{ - if (vt.first == buf) return true; - return false; - } -private: - Buffer const * buf; -}; - - void TextCache::removeAllWithBuffer(Buffer * buf) { cache.erase(buf); -- 2.39.2