]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/epstools.cpp
Refactor OutputParams
[lyx.git] / src / graphics / epstools.cpp
index 17aedfcb0ab7d04ddd0b0a9f423b9c5fcc074294..5e3dc6c0a95dfb041c0a8fdab2610afc7b4b249a 100644 (file)
 #include "Format.h"
 
 #include "support/debug.h"
+#include "support/docstream.h"
 #include "support/filetools.h"
 #include "support/FileName.h"
-#include "support/regex.h"
+
+#include <regex>
 
 using namespace std;
 using namespace lyx::support;
@@ -46,9 +48,9 @@ string const readBB_from_PSFile(FileName const & file)
        // end of the file. Than we have in the header:
        // %%BoundingBox: (atend)
        // In this case we must check the end.
-       bool const zipped = formats.isZippedFile(file);
+       bool const zipped = theFormats().isZippedFile(file);
        FileName const file_ = zipped ? unzipFile(file) : file;
-       string const format = formats.getFormatFromFile(file_);
+       string const format = theFormats().getFormatFromFile(file_);
 
        if (!Formats::isPostScriptFileFormat(format)) {
                LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] no(e)ps-format");
@@ -57,13 +59,13 @@ string const readBB_from_PSFile(FileName const & file)
                return string();
        }
 
-       static lyx::regex bbox_re("^%%BoundingBox:\\s*([-]*[[:digit:]]+)"
+       static regex bbox_re("^%%BoundingBox:\\s*([-]*[[:digit:]]+)"
                "\\s+([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)");
        ifstream is(file_.toFilesystemEncoding().c_str());
        while (is) {
                string s;
                getline(is,s);
-               lyx::smatch what;
+               smatch what;
                if (regex_match(s, what, bbox_re)) {
                        // Our callers expect the tokens in the string
                        // separated by single spaces.