#include "debug.h"
#include "gettext.h"
#include "Session.h"
-#include "callback.h"
#include "LyX.h"
#include "output_latex.h"
#include "ParagraphList.h"
#include <algorithm>
#include <functional>
-
-namespace lyx {
-
-using support::addName;
-using support::bformat;
-using support::FileName;
-using support::makeDisplayPath;
-using support::onlyFilename;
-using support::removeAutosaveFile;
-using support::package;
-using support::prefixIs;
-
using boost::bind;
using std::auto_ptr;
using std::back_inserter;
using std::transform;
+
+namespace lyx {
+
+using support::addName;
+using support::bformat;
+using support::FileName;
+using support::makeDisplayPath;
+using support::onlyFilename;
+using support::removeAutosaveFile;
+using support::package;
+using support::prefixIs;
+
namespace Alert = lyx::frontend::Alert;
bool succeeded;
if (buf->isUnnamed())
- succeeded = writeAs(buf);
+ succeeded = buf->writeAs();
else
- succeeded = menuWrite(buf);
+ succeeded = buf->menuWrite();
if (!succeeded)
return false;
if (ret == 0) {
if (buf->isUnnamed()) {
- if (!writeAs(buf))
+ if (!buf->writeAs())
return false;
- } else if (!menuWrite(buf))
- return false;
- else
+ } else if (!buf->menuWrite())
return false;
} else if (ret == 2)
return false;
-
- if (buf->isUnnamed()) {
- removeAutosaveFile(buf->fileName());
- }
+
+ removeAutosaveFile(buf->fileName());
release(buf);
return true;
}
-Buffer * BufferList::getBuffer(unsigned int const choice)
+Buffer * BufferList::getBuffer(unsigned int choice)
{
if (choice >= bstore.size())
return 0;
{
// Use ::assert to avoid a loop, BOOST_ASSERT ends up calling ::assert
// compare with 0 to avoid pointer/interger comparison
- assert(buf != 0);
+ // ::assert(buf != 0);
+ if (!buf)
+ return;
// No need to save if the buffer has not changed.
if (buf->isClean())