#include "Author.h"
#include "Buffer.h"
#include "BufferParams.h"
-#include "Session.h"
-#include "LyX.h"
-#include "output_latex.h"
-#include "ParagraphList.h"
+#include "OutputParams.h"
#include "frontends/alert.h"
#include "support/FileName.h"
#include "support/FileNameList.h"
#include "support/filetools.h"
-#include "support/gettext.h"
#include "support/lstrings.h"
-#include "support/Package.h"
#include "support/lassert.h"
exit(1);
} else if (message.type_ == WarningException) {
Alert::warning(message.title_, message.details_);
- return 0;
+ return nullptr;
}
}
tmpbuf->params().useClassDefaults();
Buffer * BufferList::first()
{
if (bstore.empty())
- return 0;
+ return nullptr;
return bstore.front();
}
Buffer * BufferList::last()
{
if (bstore.empty())
- return 0;
+ return nullptr;
return bstore.back();
}
Buffer * BufferList::getBuffer(unsigned int choice)
{
if (choice >= bstore.size())
- return 0;
+ return nullptr;
return bstore[choice];
}
Buffer * BufferList::next(Buffer const * buf) const
{
// Something is wrong, but we can probably survive it.
- LASSERT(buf, return 0);
+ LASSERT(buf, return nullptr);
if (bstore.empty())
- return 0;
+ return nullptr;
BufferStorage::const_iterator it =
find(bstore.begin(), bstore.end(), buf);
- LASSERT(it != bstore.end(), return 0);
+ LASSERT(it != bstore.end(), return nullptr);
++it;
Buffer * nextbuf = (it == bstore.end()) ? bstore.front() : *it;
return nextbuf;
Buffer * BufferList::previous(Buffer const * buf) const
{
// Something is wrong, but we can probably survive it.
- LASSERT(buf, return 0);
+ LASSERT(buf, return nullptr);
if (bstore.empty())
- return 0;
+ return nullptr;
BufferStorage::const_iterator it =
find(bstore.begin(), bstore.end(), buf);
- LASSERT(it != bstore.end(), return 0);
+ LASSERT(it != bstore.end(), return nullptr);
Buffer * previousbuf = (it == bstore.begin()) ? bstore.back() : *(it - 1);
return previousbuf;
bool BufferList::exists(FileName const & fname) const
{
- return getBuffer(fname) != 0;
+ return getBuffer(fname) != nullptr;
}
if (equivalent(b->fileName(), fname))
return b;
}
- return 0;
+ return nullptr;
}
-Buffer * BufferList::getBufferFromTmp(string const & s, bool realpath)
+Buffer * BufferList::getBufferFromTmp(string const & path, bool realpath)
{
for (Buffer * buf : bstore) {
string const temppath = realpath ? FileName(buf->temppath()).realPath() : buf->temppath();
- if (prefixIs(s, temppath)) {
+ if (prefixIs(path, temppath)) {
// check whether the filename matches the master
string const master_name = buf->latexName();
- if (suffixIs(s, master_name))
+ if (suffixIs(path, master_name))
return buf;
// if not, try with the children
for (Buffer * child : buf->getDescendants()) {
string const mangled_child_name = DocFileName(
changeExtension(child->absFileName(),
".tex")).mangledFileName();
- if (suffixIs(s, mangled_child_name))
+ if (suffixIs(path, mangled_child_name))
return child;
}
}
}
- return 0;
+ return nullptr;
}