]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.cpp
correct format for unsigned long argument, remoteCloseLink is oneway void
[lyx.git] / src / support / filetools.cpp
index 5891e79fec62c6b89346ed3e611a265e8a7bc1ca..68c92d8daaa65fd5562c2db283c4c7ade4dcb45e 100644 (file)
@@ -30,6 +30,7 @@
 #include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
+#include "support/Messages.h"
 #include "support/Package.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
@@ -282,7 +283,7 @@ FileName const i18nLibFileSearch(string const & dir, string const & name,
           each po file is able to tell us its name. (JMarc)
        */
 
-       string lang = to_ascii(_(languageTestString()));
+       string lang = getGuiMessages().language();
        string const language = getEnv("LANGUAGE");
        if (!lang.empty() && !language.empty())
                lang = language;
@@ -1016,59 +1017,6 @@ FileName const findtexfile(string const & fil, string const & /*format*/)
 }
 
 
-void readBB_lyxerrMessage(FileName const & file, bool & zipped,
-       string const & message)
-{
-       LYXERR(Debug::GRAPHICS, "[readBB_from_PSFile] " << message);
-       // FIXME: Why is this func deleting a file? (Lgb)
-       if (zipped)
-               file.removeFile();
-}
-
-
-string const readBB_from_PSFile(FileName const & file)
-{
-       // in a (e)ps-file it's an entry like %%BoundingBox:23 45 321 345
-       // It seems that every command in the header has an own line,
-       // getline() should work for all files.
-       // On the other hand some plot programs write the bb at the
-       // end of the file. Than we have in the header:
-       // %%BoundingBox: (atend)
-       // In this case we must check the end.
-       bool zipped = file.isZippedFile();
-       FileName const file_ = zipped ? unzipFile(file) : file;
-       string const format = file_.guessFormatFromContents();
-
-       if (format != "eps" && format != "ps") {
-               readBB_lyxerrMessage(file_, zipped,"no(e)ps-format");
-               return string();
-       }
-
-       static lyx::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;
-               if (regex_match(s, what, bbox_re)) {
-                       // Our callers expect the tokens in the string
-                       // separated by single spaces.
-                       // FIXME: change return type from string to something
-                       // sensible
-                       ostringstream os;
-                       os << what.str(1) << ' ' << what.str(2) << ' '
-                          << what.str(3) << ' ' << what.str(4);
-                       string const bb = os.str();
-                       readBB_lyxerrMessage(file_, zipped, bb);
-                       return bb;
-               }
-       }
-       readBB_lyxerrMessage(file_, zipped, "no bb found");
-       return string();
-}
-
-
 int compare_timestamps(FileName const & file1, FileName const & file2)
 {
        // If the original is newer than the copy, then copy the original