]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbase.C
The speed patch: redraw only rows that have changed
[lyx.git] / src / insets / insetbase.C
index dcbc08fac9fcab7a4bce033a4295dbc0d64e22f0..0736f60fc4d276a2d8e1e0cc14d8a4338d328ff1 100644 (file)
 
 #include "frontends/Painter.h"
 
+#include <boost/current_function.hpp>
+
 #include <map>
+#include <typeinfo>
 
 
 namespace {
@@ -114,6 +117,14 @@ InsetBase::InsetBase(InsetBase const &)
 {}
 
 
+std::auto_ptr<InsetBase> InsetBase::clone() const
+{
+       std::auto_ptr<InsetBase> b = doClone();
+       BOOST_ASSERT(typeid(*b) == typeid(*this));
+       return b;
+}
+
+
 InsetBase::Code InsetBase::translate(std::string const & name)
 {
        static TranslatorMap const translator = build_translator();
@@ -172,23 +183,28 @@ bool InsetBase::getStatus(LCursor &, FuncRequest const & cmd,
 
 void InsetBase::edit(LCursor &, bool)
 {
-       lyxerr << "InsetBase: edit left/right" << std::endl;
+       lyxerr[Debug::INSETS] << BOOST_CURRENT_FUNCTION
+                              << ": edit left/right" << std::endl;
 }
 
 
-InsetBase * InsetBase::editXY(LCursor &, int x, int y) const
+InsetBase * InsetBase::editXY(LCursor &, int x, int y)
 {
-       lyxerr << "InsetBase: editXY x:" << x << " y: " << y << std::endl;
-       return const_cast<InsetBase*>(this);
+       lyxerr[Debug::INSETS] << BOOST_CURRENT_FUNCTION
+                              << ": x=" << x << " y= " << y
+                              << std::endl;
+       return this;
 }
 
 
 InsetBase::idx_type InsetBase::index(row_type row, col_type col) const
 {
        if (row != 0)
-               lyxerr << "illegal row: " << row << std::endl;
+               lyxerr << BOOST_CURRENT_FUNCTION
+                       << ": illegal row: " << row << std::endl;
        if (col != 0)
-               lyxerr << "illegal col: " << col << std::endl;
+               lyxerr << BOOST_CURRENT_FUNCTION
+                       << ": illegal col: " << col << std::endl;
        return 0;
 }
 
@@ -257,13 +273,13 @@ std::string const & InsetBase::getInsetName() const
 }
 
 
-void InsetBase::markErased()
+void InsetBase::markErased(bool)
 {}
 
 
-void InsetBase::getCursorPos(CursorSlice const &, int & x, int & y) const
+void InsetBase::cursorPos(CursorSlice const &, bool, int & x, int & y) const
 {
-       lyxerr << "InsetBase::getCursorPos called directly" << std::endl;
+       lyxerr << "InsetBase::cursorPos called directly" << std::endl;
        x = 100;
        y = 100;
 }