]> git.lyx.org Git - features.git/commitdiff
Fix bug #8114: LyX does not retrieve negative bbox parameters
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 8 Apr 2012 21:20:01 +0000 (23:20 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 8 Apr 2012 21:20:01 +0000 (23:20 +0200)
LyX fails to read the bounding box from an EPS file if it has
negative values. Adjusting the regex will overcome this problem.
Negative values do not pose big problems later on, but the GUI
doesn't handle it correctly yet (see bug #5718).

src/graphics/epstools.cpp

index 5fb403c3ecc92f9abab5ad5eda13507a747378ac..17aedfcb0ab7d04ddd0b0a9f423b9c5fcc074294 100644 (file)
@@ -57,8 +57,8 @@ string const readBB_from_PSFile(FileName const & file)
                return string();
        }
 
-       static lyx::regex bbox_re(
-               "^%%BoundingBox:\\s*([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)");
+       static lyx::regex bbox_re("^%%BoundingBox:\\s*([-]*[[:digit:]]+)"
+               "\\s+([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)");
        ifstream is(file_.toFilesystemEncoding().c_str());
        while (is) {
                string s;