#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "BufferView.h"
#include "BufferView_pimpl.h"
#include "lyxlex.h"
#include "lyxtext.h"
#include "undo_funcs.h"
+#include "changes.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
#include "insets/insetcommand.h" // ChangeRefs
#include "insets/inseterror.h"
+#include "insets/updatableinset.h"
#include "support/FileInfo.h"
#include "support/filetools.h"
}
+Change const BufferView::getCurrentChange()
+{
+ return pimpl_->getCurrentChange();
+}
+
+
void BufferView::beforeChange(LyXText * text)
{
pimpl_->beforeChange(text);
}
-int BufferView::defaultHeight() const
-{
- return text->defaultHeight();
-}
-
-
-
// Inserts a file into current document
bool BufferView::insertLyXFile(string const & filen)
//
ifstream ifs(fname.c_str());
if (!ifs) {
- Alert::alert(_("Error!"),
- _("Cannot open specified file: "),
+ Alert::err_alert(_("Error! Cannot open specified file:"),
MakeDisplayPath(fname, 50));
return false;
}
toggleSelection(false);
tt->replaceSelectionWithString(this, replacestring);
- tt->setSelectionOverString(this, replacestring);
+ tt->setSelectionRange(this, replacestring.length());
// Go back so that replacement string is also spellchecked
for (string::size_type i = 0; i < replacestring.length() + 1; ++i) {
finishUndo();
return 0;
}
- return bufferlist.unlockInset(inset);
+ return 1;
}
}
-bool BufferView::ChangeCitationsIfUnique(string const & from,
- string const & to)
+bool BufferView::ChangeCitationsIfUnique(string const & from, string const & to)
{
typedef pair<string, string> StringPair;
- vector<StringPair> keys = buffer()->getBibkeyList();
+ vector<StringPair> keys;
+ buffer()->fillWithBibKeys(keys);
if (count_if(keys.begin(), keys.end(),
lyx::equal_1st_in_pair<StringPair>(from))
> 1)