#include "bufferlist.h"
#include "lyx_main.h"
-#include "lyx_gui_misc.h"
#include "lastfiles.h"
#include "debug.h"
#include "lyxrc.h"
#include "LyXView.h"
#include "vc-backend.h"
#include "TextCache.h"
+#include "lyxtextclasslist.h"
#include "frontends/Alert.h"
while (reask) {
switch (Alert::askConfirmation(_("Changes in document:"),
fname,
- _("Save document?"))){
+ _("Save document?"))) {
case 1: // Yes
if (buf->isUnnamed())
reask = !WriteAs(current_view, buf);
Buffer * BufferList::first()
{
- if (bstore.empty()) return 0;
+ if (bstore.empty())
+ return 0;
return bstore.front();
}
Buffer * BufferList::getBuffer(unsigned int choice)
{
- if (choice >= bstore.size()) return 0;
+ if (choice >= bstore.size())
+ return 0;
return bstore[choice];
}
Buffer * BufferList::readFile(string const & s, bool ronly)
{
- Buffer * b = bstore.newBuffer(s, ronly);
-
string ts(s);
string e = OnlyPath(s);
string a = e;
return 0;
}
+ Buffer * b = bstore.newBuffer(s, ronly);
+
// Check if emergency save file exists and is newer.
e += OnlyFilename(s) + ".emergency";
FileInfo fileInfoE(e);
}
}
if (!templateok) {
- Alert::alert(_("Error!"), _("Unable to open template"),
+ Alert::alert(_("Error!"), _("Unable to open template"),
MakeDisplayPath(tname));
// no template, start with empty buffer
b->paragraph = new Paragraph;
+ b->paragraph->layout(textclasslist[b->params.textclass].defaultLayoutName());
}
} else { // start with empty buffer
b->paragraph = new Paragraph;
+ b->paragraph->layout(textclasslist[b->params.textclass].defaultLayoutName());
}
if (!lyxrc.new_ask_filename && !isNamed) {
// How can we know _how_ to do the checkout?
// With the current VC support it has to be,
// a RCS file since CVS do not have special ,v files.
- RCS::retrive(s);
+ RCS::retrieve(s);
return loadLyXFile(filename, tolastfiles);
}
}