]> 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>
Mon, 9 Apr 2012 13:17:07 +0000 (15:17 +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).

(cherry picked from commit f0754582b8af481dc636c6d31eb3a52c853d7db0)

src/support/filetools.cpp
status.20x

index bf6198332521c24f70405c421ab9fba757733199..f7c48cade88cdf7c815f173fc7e1d127aa0e1d59 100644 (file)
@@ -1033,7 +1033,7 @@ string const readBB_from_PSFile(FileName const & file)
        }
 
        static lyx::regex bbox_re(
-               "^%%BoundingBox:\\s*([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)\\s+([[:digit:]]+)");
+               "^%%BoundingBox:\\s*([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)\\s+([-]*[[:digit:]]+)");
        ifstream is(file_.toFilesystemEncoding().c_str());
        while (is) {
                string s;
index 081d44e28cb4fb178316399375c9fe8386d7406d..577627a041160ac130fe5d6f848e84b90e9305c9 100644 (file)
@@ -82,6 +82,9 @@ What's new
 
 - Fixed some probelms XHTML output had with empty paragraphs.
 
+- Fixed reading the bounding box from EPS figures with negative
+  values (bug 8114).
+
 
 * USER INTERFACE