* Copyright 1995-2002 the LyX Team
* Read the file COPYING
*
- * \author unknown
+ * \author Lars Gullik Bjønnes
* \author John Levon <moz@compsoc.man.ac.uk>
*/
#include "frontends/screen.h"
#include "insets/insetcommand.h" // ChangeRefs
-#include "insets/inseterror.h"
#include "insets/updatableinset.h"
#include "support/FileInfo.h"
extern BufferList bufferlist;
using lyx::pos_type;
+using namespace lyx::support;
using std::pair;
using std::endl;
}
+bool BufferView::newFile(string const & fn, string const & tn, bool named)
+{
+ return pimpl_->newFile(fn, tn, named);
+}
+
+
bool BufferView::loadLyXFile(string const & fn, bool tl)
{
return pimpl_->loadLyXFile(fn, tl);
void BufferView::resize()
{
- if (pimpl_->buffer_) {
+ if (pimpl_->buffer_)
pimpl_->resizeCurrentBuffer();
- }
}
bool res = true;
+ text->breakParagraph(buffer()->paragraphs);
+
if (c == '#') {
// FIXME: huh ? No we won't !
lyxerr[Debug::INFO] << "Will insert file with header" << endl;
}
-void BufferView::resetErrorList()
-{
- pimpl_->errorlist_.clear();
-}
-
-
-void BufferView::setErrorList(ErrorList const & el)
-{
- pimpl_->errorlist_ = el;
-}
-
-
-void BufferView::addError(ErrorItem const & ei)
-{
- pimpl_->errorlist_.push_back(ei);
-
-}
-
-
void BufferView::showErrorList(string const & action) const
{
if (getErrorList().size()) {
string const title = bformat(_("LyX: %1$s errors (%2$s)"), action, buffer()->fileName());
owner()->getDialogs().show("errorlist", title);
+ pimpl_->errorlist_.clear();
}
}
}
-bool BufferView::insertInset(Inset * inset, string const & lout)
+bool BufferView::insertInset(InsetOld * inset, string const & lout)
{
return pimpl_->insertInset(inset, lout);
}
if (text->cursor.pos() < text->cursor.par()->size()
&& text->cursor.par()->getChar(text->cursor.pos()) ==
Paragraph::META_INSET) {
- Inset * in = text->cursor.par()->getInset(text->cursor.pos());
+ InsetOld * in = text->cursor.par()->getInset(text->cursor.pos());
if (inset == in) {
theLockingInset(inset);
return true;
}
-void BufferView::lockedInsetStoreUndo(Undo::undo_kind kind)
-{
- if (!theLockingInset())
- return; // shouldn't happen
- if (kind == Undo::EDIT) // in this case insets would not be stored!
- kind = Undo::FINISH;
- setUndo(this, kind, text->cursor.par());
-}
-
-
-void BufferView::updateInset(Inset * inset)
+void BufferView::updateInset(InsetOld * inset)
{
pimpl_->updateInset(inset);
}
-bool BufferView::ChangeInsets(Inset::Code code,
+bool BufferView::ChangeInsets(InsetOld::Code code,
string const & from, string const & to)
{
bool need_update = false;
text->setCursorIntern(it.pit(), 0);
text->redoParagraphs(text->cursor,
boost::next(text->cursor.par()));
- text->fullRebreak();
+ text->partialRebreak();
}
}
}
if (lyx::count(labels.begin(), labels.end(), from) > 1)
return false;
- return ChangeInsets(Inset::REF_CODE, from, to);
+ return ChangeInsets(InsetOld::REF_CODE, from, to);
}
> 1)
return false;
- return ChangeInsets(Inset::CITE_CODE, from, to);
+ return ChangeInsets(InsetOld::CITE_CODE, from, to);
}
}
-LyXText * BufferView::getParentText(Inset * inset) const
+LyXText * BufferView::getParentText(InsetOld * inset) const
{
if (inset->owner()) {
LyXText * txt = inset->getLyXText(this);
}
-Language const * BufferView::getParentLanguage(Inset * inset) const
+Language const * BufferView::getParentLanguage(InsetOld * inset) const
{
LyXText * text = getParentText(inset);
return text->cursor.par()->getFontSettings(buffer()->params,