diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index b36b1bc88d..2e1d53a1d2 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2002-04-11 Herbert Voss + + * ControlGraphics.C: expand "browse-string" to all available formats + 2002-04-11 Herbert Voss * ControlGraphics.C: read BoundingBox also from non (e)ps files. diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index 4437f0f781..8dc3ba5963 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -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(lv, d) @@ -90,8 +102,6 @@ extern string user_lyxdir; 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 @@ string const ControlGraphics::Browse(string const & in_name) pair 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); }