]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
added a parseError signal to Buffer and use it
[lyx.git] / src / BufferView.C
index 6e1ef133efa0d6cc3ee6f8d63d2d95992ee3f5e9..5b0a7330e7748a99c0eb310966b5b2e9b6f0b084 100644 (file)
@@ -36,7 +36,6 @@
 #include "frontends/screen.h"
 
 #include "insets/insetcommand.h" // ChangeRefs
-#include "insets/inseterror.h"
 #include "insets/updatableinset.h"
 
 #include "support/FileInfo.h"
@@ -104,11 +103,17 @@ void BufferView::buffer(Buffer * b)
 }
 
 
+bool BufferView::loadLyXFile(string const & fn, bool tl)
+{
+       return pimpl_->loadLyXFile(fn, tl);
+}
+
+
 void BufferView::reload()
 {
        string const fn = buffer()->fileName();
        if (bufferlist.close(buffer(), false))
-               buffer(bufferlist.loadLyXFile(fn));
+               loadLyXFile(fn);
 }
 
 
@@ -343,13 +348,6 @@ void BufferView::setErrorList(ErrorList const & el)
 }
 
 
-void BufferView::addError(ErrorItem const & ei)
-{
-       pimpl_->errorlist_.push_back(ei);
-
-}
-
-
 void BufferView::showErrorList(string const & action) const
 {
        if (getErrorList().size()) {
@@ -379,7 +377,7 @@ void BufferView::setCursorFromRow(int row)
                texrowpar = text->ownerParagraphs().begin();
                tmppos = 0;
        } else {
-               texrowpar = *buffer()->getParFromID(tmpid);
+               texrowpar = buffer()->getParFromID(tmpid).pit();
        }
        text->setCursor(texrowpar, tmppos);
 }
@@ -395,7 +393,8 @@ void BufferView::gotoLabel(string const & label)
 {
        for (Buffer::inset_iterator it = buffer()->inset_iterator_begin();
             it != buffer()->inset_iterator_end(); ++it) {
-               vector<string> labels = it->getLabelList();
+               vector<string> labels;
+               it->getLabelList(labels);
                if (find(labels.begin(),labels.end(),label)
                     != labels.end()) {
                        beforeChange(text);
@@ -645,7 +644,7 @@ bool BufferView::ChangeInsets(Inset::Code code,
                        // The test it.size()==1 was needed to prevent crashes.
                        // How to set the cursor corretly when it.size()>1 ??
                        if (it.size() == 1) {
-                               text->setCursorIntern(*it, 0);
+                               text->setCursorIntern(it.pit(), 0);
                                text->redoParagraphs(text->cursor,
                                                     boost::next(text->cursor.par()));
                                text->fullRebreak();
@@ -660,7 +659,8 @@ bool BufferView::ChangeInsets(Inset::Code code,
 bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
 {
        // Check if the label 'from' appears more than once
-       vector<string> labels = buffer()->getLabelList();
+       vector<string> labels;
+       buffer()->getLabelList(labels);
 
        if (lyx::count(labels.begin(), labels.end(), from) > 1)
                return false;