return checkAndLoadLyXFile(filename);
}
- if (filename.isReadableFile()) {
+ if (filename.exists()) {
+ if (!filename.isReadableFile()) {
+ docstring text = bformat(_("The file %1$s exists but is not "
+ "readable by the current user."),
+ from_utf8(filename.absFilename()));
+ Alert::error(_("File not readable!"), text);
+ return 0;
+ }
Buffer * b = theBufferList().newBuffer(filename.absFilename());
if (!b)
// Buffer creation is not possible.
pos_type const pos = dit.pos();
if (pos != dit.lastpos() && !par.isDeleted(pos)) {
- if (par.isInset(pos)) {
- Inset const * ins = par.getInset(pos);
+ if (Inset const * ins = par.getInset(pos)) {
if (ins->isLetter())
++chars;
else if (with_blanks && ins->isSpace())
// set the label of a paragraph. This includes the counters.
void setLabel(Buffer const & buf, ParIterator & it)
{
- TextClass const & textclass = buf.params().getTextClass();
+ TextClass const & textclass = buf.params().textClass();
Paragraph & par = it.paragraph();
LayoutPtr const & layout = par.layout();
Counters & counters = textclass.counters();
{
Buffer const * const master = buf.masterBuffer();
// Use the master text class also for child documents
- TextClass const & textclass = master->params().getTextClass();
+ TextClass const & textclass = master->params().textClass();
if (!childonly) {
// If this is a child document start with the master