// The test for not selection possible is needed, that only motion
// events are used, where the bottom press event was on
- // the drawing area too
+ // the drawing area too
if (!selection_possible)
return;
// We are in inset locking mode
// Check whether the inset was hit. If not reset mode,
- // otherwise give the event to the inset
+ // otherwise give the event to the inset
if (inset_hit == bv_->theLockingInset()) {
FuncRequest cmd(bv_, LFUN_MOUSE_PRESS, xpos, ypos, button);
bv_->theLockingInset()->localDispatch(cmd);
} else {
text->selectWord(bv_, LyXText::WHOLE_WORD_STRICT);
}
- // This will fit the cursor on the screen if necessary
+ // This will fit the cursor on the screen if necessary
update(text, BufferView::SELECT|BufferView::FITCUR);
workarea().haveSelection(bv_->getLyXText()->selection.set());
}
if (text->bv_owner) {
screen().toggleSelection(text, bv_, false);
}
- // This will fit the cursor on the screen if necessary
+ // This will fit the cursor on the screen if necessary
update(text, BufferView::SELECT|BufferView::FITCUR);
workarea().haveSelection(bv_->getLyXText()->selection.set());
}
*/
-inline
void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
{
LyXText * lt = bv_->getLyXText();
Buffer::inset_iterator end = b->inset_iterator_end();
bool cursor_par_seen = false;
-
+
for (; beg != end; ++beg) {
if (beg.getPar() == cursor.par()) {
cursor_par_seen = true;
break;
}
}
-
+
}
if (beg != end) {
// Now find the first inset that matches code.
2002-08-20 Lars Gullik Bjønnes <larsbj@gullik.net>
+ * bufferlist.C (emergencyWriteAll): use boost bind
+
+ * BufferView_pimpl.C (moveCursorUpdate): remove inline
+
* text.C: include paragraph_funcs.h
(breakParagraph): breakParagraph is now in global scope
#include "support/lyxfunctional.h"
#include "support/LAssert.h"
+#include <boost/bind.hpp>
+
#include <cassert>
#include <algorithm>
#include <functional>
void BufferList::emergencyWriteAll()
{
for_each(bstore.begin(), bstore.end(),
- lyx::void_class_fun(*this, &BufferList::emergencyWrite));
+ boost::bind(&BufferList::emergencyWrite, this, _1));
}
+2002-08-20 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * lyxfunctional.h: remove class_fun_t, void_class_fun_t,
+ class_fun and void_class_fun
+
2002-08-20 John Levon <levon@movementarian.org>
* Makefile.am:
* fmt.C: remove
-
+
2002-08-14 Lars Gullik Bjønnes <larsbj@gullik.net>
* textutils.h: formatting.
namespace lyx {
-template<class R, class C, class A>
-class class_fun_t {
-public:
- class_fun_t(C & ct, R(C::*p)(A))
- : c(ct), cmf(p) {}
- R operator()(A & a) const {
- return (c.*cmf)(a);
- }
-private:
- C & c;
- R(C::*cmf)(A);
-};
-
-
-template<class C, class A>
-class void_class_fun_t {
-public:
- void_class_fun_t(C & ct, void(C::*p)(A))
- : c(ct), cmf(p) {}
- void operator()(A & a) const {
- (c.*cmf)(a);
- }
-private:
- C & c;
- void(C::*cmf)(A);
-};
-
-
-/// Use to call a class method with a container element.
-/** Most easily used as a functor to std::algoritms.
- Small example:
- \verbatim
- A a; // class that have a int print(string const &) method
- vector<string> vs;
- for_each(vs.begin(), vs.end(), class_fun(int, vs, &A::print);
- \endverbatim
-**/
-template <class R, class C, class A> class_fun_t<R, C, A>
-class_fun(C & c, R(C::*f)(A))
-{
- return class_fun_t<R, C, A>(c, f);
-}
-
-
-template <class C, class A> void_class_fun_t<C, A>
-void_class_fun(C & c, void(C::*f)(A))
-{
- return void_class_fun_t<C, A>(c, f);
-}
-
-
template <class Cont, class Type, class MemRet>
class back_insert_fun_iterator {
protected: