X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=9826b51f7fd3b0bf068a8961be5bf141c878083c;hb=3bbce7f24afbb469fff5ad352778af73d57b44d8;hp=1867e75513c6ac1f98553914d5e3a1a5536c562d;hpb=d15a96d93d0af675a88cfa90ae1a16f161914385;p=features.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 1867e75513..9826b51f7f 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1110,6 +1110,24 @@ bool Buffer::readDocument(Lexer & lex) } +bool Buffer::isSyncTeXenabled() const +{ + bool enabled = params().output_sync; + + if (!enabled) + for (auto const & c : theConverters()) { + const string dest = c.to().substr(0,3); + if (dest == "dvi" || dest == "pdf") { + const string cmd = c.command(); + enabled |= cmd.find("-synctex=") != string::npos + && cmd.find("-synctex=0") == string::npos; + if (enabled) + break; + } + } + return enabled; +} + bool Buffer::importString(string const & format, docstring const & contents, ErrorList & errorList) { Format const * fmt = theFormats().getFormat(format); @@ -1145,7 +1163,7 @@ bool Buffer::importFile(string const & format, FileName const & name, ErrorList FileName const lyx = tempFileName("Buffer_importFileXXXXXX.lyx"); Converters::RetVal const retval = - theConverters().convert(nullptr, name, lyx, name, format, "lyx", errorList); + theConverters().convert(this, name, lyx, name, format, "lyx", errorList); if (retval == Converters::SUCCESS) { bool const success = readFile(lyx) == ReadSuccess; removeTempFile(lyx); @@ -1812,7 +1830,7 @@ Buffer::ExportStatus Buffer::makeLaTeXFile(FileName const & fname, lyx_exit(1); } - d->texrow = move(os.texrow()); + d->texrow = std::move(os.texrow()); ofs.close(); if (ofs.fail()) { @@ -2686,7 +2704,7 @@ void Buffer::markDepClean(string const & name) } -bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag) +bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag) const { if (isInternal()) { // FIXME? if there is an Buffer LFUN that can be dispatched even