Angus Leeming wrote:
> I'm sure someone, somewhere, will tell us to use the std algorithms, rather > than roll our own loops, but the above (or something close to it) should work. > > Alternatively, why not just add "agr" to that string!!!!! here is the alternative: Herbert -- http://www.lyx.org/help/
Index: src/frontends/controllers/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v retrieving revision 1.158 diff -u -r1.158 ChangeLog --- src/frontends/controllers/ChangeLog 11 Apr 2002 17:40:44 -0000 1.158 +++ src/frontends/controllers/ChangeLog 12 Apr 2002 14:39:27 -0000 @@ -1,5 +1,9 @@ 2002-04-11 Herbert Voss <[EMAIL PROTECTED]> + * ControlGraphics.C: expand "browse-string" to all available formats + +2002-04-11 Herbert Voss <[EMAIL PROTECTED]> + * ControlGraphics.C: read BoundingBox also from non (e)ps files. 2002-04-08 Adrien Rebollo <[EMAIL PROTECTED]> Index: src/frontends/controllers/ControlGraphics.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlGraphics.C,v retrieving revision 1.32 diff -u -r1.32 ControlGraphics.C --- src/frontends/controllers/ControlGraphics.C 11 Apr 2002 17:40:44 -0000 1.32 +++ src/frontends/controllers/ControlGraphics.C 12 Apr 2002 14:39:28 -0000 @@ -46,6 +46,18 @@ using std::pair; using std::make_pair; using std::ifstream; + +namespace { + +// FIXME: currently we need the second '|' to prevent mis-interpretation! +// All supported graphic formats with their file-extension and the +// gzip-ext for zipped (e)ps-files. +string const grfx_pattern = + "*.(agr|bmp|eps|epsi|fits|gif|jpg|obj|pdf|pbm|pgm|png|" + "ppm|ps|tif|tiff|xbm|xpm|xwd|gz)|"; + +} + ControlGraphics::ControlGraphics(LyXView & lv, Dialogs & d) : ControlInset<InsetGraphics, InsetGraphicsParams>(lv, d) @@ -90,8 +102,6 @@ string const ControlGraphics::Browse(string const & in_name) { string const title = _("Select graphics file"); - // FIXME: currently we need the second '|' to prevent mis-interpretation - string const pattern = "*.(ps|eps|png|jpeg|jpg|gif|gz)|"; // Does user clipart directory exist? string clipdir = AddName (user_lyxdir, "clipart"); @@ -103,7 +113,7 @@ pair<string, string> dir2(_("Documents|#o#O"), string(lyxrc.document_path)); // Show the file browser dialog return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(), - title, pattern, dir1, dir2); + title, ::grfx_pattern, dir1, dir2); }