]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
minimal effort implementation of:
[lyx.git] / src / BufferView.C
index b4b4cb1a1fc9ba5d0849d98cea1579edb6db16b2..6c8f4bce793a55d69841219884feb0b52f52100a 100644 (file)
@@ -20,7 +20,6 @@
 #include "bufferlist.h"
 #include "bufferparams.h"
 #include "BufferView_pimpl.h"
-#include "CutAndPaste.h"
 #include "coordcache.h"
 #include "debug.h"
 #include "funcrequest.h"
@@ -50,8 +49,6 @@
 
 using lyx::support::bformat;
 
-using lyx::cap::setSelectionRange;
-
 using std::distance;
 using std::find;
 using std::string;
@@ -96,12 +93,6 @@ void BufferView::setBuffer(Buffer * b)
 }
 
 
-string BufferView::firstLayout()
-{
-       return pimpl_->firstLayout();
-}
-
-
 bool BufferView::loadLyXFile(string const & fn, bool tl)
 {
        return pimpl_->loadLyXFile(fn, tl);
@@ -129,9 +120,9 @@ bool BufferView::fitCursor()
 }
 
 
-void BufferView::update(Update::flags flags)
+bool BufferView::update(Update::flags flags)
 {
-       pimpl_->update(flags);
+       return pimpl_->update(flags);
 }
 
 
@@ -153,6 +144,12 @@ void BufferView::scrollDocView(int value)
 }
 
 
+void BufferView::setCursorFromScrollbar()
+{
+       pimpl_->setCursorFromScrollbar();
+}
+
+
 bool BufferView::available() const
 {
        return pimpl_->available();
@@ -235,12 +232,6 @@ void BufferView::workAreaResize(int width, int height)
 }
 
 
-void BufferView::workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state)
-{
-       pimpl_->workAreaKeyPress(key, state);
-}
-
-
 bool BufferView::workAreaDispatch(FuncRequest const & ev)
 {
        return pimpl_->workAreaDispatch(ev);
@@ -253,23 +244,6 @@ void BufferView::scroll(int lines)
 }
 
 
-void BufferView::showErrorList(string const & action) const
-{
-       if (getErrorList().size()) {
-               string const title = bformat(_("%1$s Errors (%2$s)"),
-                       action, buffer()->fileName());
-               owner()->getDialogs().show("errorlist", title);
-               pimpl_->errorlist_.clear();
-       }
-}
-
-
-ErrorList const & BufferView::getErrorList() const
-{
-       return pimpl_->errorlist_;
-}
-
-
 void BufferView::setCursorFromRow(int row)
 {
        int tmpid = -1;
@@ -342,11 +316,13 @@ void BufferView::mouseSetCursor(LCursor & cur)
        BOOST_ASSERT(&cur.bv() == this);
 
        // Has the cursor just left the inset?
+       bool badcursor = false;
        if (&cursor().inset() != &cur.inset())
-               cursor().inset().notifyCursorLeaves(cursor());
+               badcursor = cursor().inset().notifyCursorLeaves(cursor());
 
        // do the dEPM magic if needed
-       if (cursor().inTexted())
+       // FIXME: move this to InsetText::notifyCursorLeaves?
+       if (!badcursor && cursor().inTexted())
                cursor().text()->deleteEmptyParagraphMechanism(cur, cursor());
 
        cursor() = cur;
@@ -404,13 +380,7 @@ ViewMetricsInfo const & BufferView::viewMetricsInfo()
 }
 
 
-bool BufferView::needsRedraw() const
-{
-       return pimpl_->needsRedraw();
-}
-
-
-void BufferView::needsRedraw(bool redraw_needed)
+void BufferView::updateMetrics(bool singlepar)
 {
-       pimpl_->needsRedraw(redraw_needed);
+       pimpl_->updateMetrics(singlepar);
 }