X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FConverter.cpp;h=ab7e51f912e2c7fbe782207a52a8404dce1fe609;hb=2f271f61bcd514da3ab5b44d2b7bf61e12ac0c44;hp=fc82114308018ffbb6d284c006800b2f2e52d9ab;hpb=5c4a20fe0406ca60a084f733b5fc4324ab1a0933;p=lyx.git diff --git a/src/Converter.cpp b/src/Converter.cpp index fc82114308..ab7e51f912 100644 --- a/src/Converter.cpp +++ b/src/Converter.cpp @@ -25,44 +25,20 @@ #include "frontends/alert.h" #include "support/debug.h" +#include "support/FileNameList.h" #include "support/filetools.h" #include "support/gettext.h" #include "support/lstrings.h" -#include "support/lyxlib.h" #include "support/os.h" #include "support/Package.h" #include "support/Path.h" #include "support/Systemcall.h" -using std::find_if; -using std::string; -using std::vector; -using std::distance; - +using namespace std; +using namespace lyx::support; namespace lyx { -using support::addName; -using support::bformat; -using support::changeExtension; -using support::compare_ascii_no_case; -using support::contains; -using support::FileName; -using support::getExtension; -using support::libFileSearch; -using support::libScriptSearch; -using support::makeAbsPath; -using support::makeRelPath; -using support::onlyFilename; -using support::onlyPath; -using support::package; -using support::prefixIs; -using support::quoteName; -using support::removeExtension; -using support::split; -using support::subst; -using support::Systemcall; - namespace Alert = lyx::frontend::Alert; @@ -88,8 +64,8 @@ string const dvipdfm_options(BufferParams const & bp) string result; if (bp.papersize != PAPER_CUSTOM) { - string const paper_size = bp.paperSizeName(); - if (paper_size != "b5" && paper_size != "foolscap") + string const paper_size = bp.paperSizeName(BufferParams::DVIPDFM); + if (!paper_size.empty()) result = "-p "+ paper_size; if (bp.orientation == ORIENTATION_LANDSCAPE) @@ -309,7 +285,7 @@ bool Converters::convert(Buffer const * buffer, formats.extension(from_format); string const to_ext = formats.extension(to_format); string const command = - support::os::python() + ' ' + + os::python() + ' ' + quoteName(libFileSearch("scripts", "convertDefault.py").toFilesystemEncoding()) + ' ' + quoteName(from_ext + ':' + from_file.toFilesystemEncoding()) + @@ -347,7 +323,7 @@ bool Converters::convert(Buffer const * buffer, string const path(onlyPath(from_file.absFilename())); // Prevent the compiler from optimizing away p FileName pp(path); - support::PathChanger p(pp); + PathChanger p(pp); // empty the error list before any new conversion takes place. errorList.clear(); @@ -519,9 +495,8 @@ bool Converters::move(string const & fmt, string const to_base = removeExtension(to.absFilename()); string const to_extension = getExtension(to.absFilename()); - vector const files = - support::dirList(FileName(path), getExtension(from.absFilename())); - for (vector::const_iterator it = files.begin(); + support::FileNameList const files = FileName(path).dirList(getExtension(from.absFilename())); + for (support::FileNameList::const_iterator it = files.begin(); it != files.end(); ++it) { string const from2 = it->absFilename(); string const file2 = onlyFilename(from2); @@ -649,8 +624,8 @@ void Converters::buildGraph() } -std::vector const -Converters::intToFormat(std::vector const & input) +vector const +Converters::intToFormat(vector const & input) { vector result(input.size());