#include <cmath>
#include "figinset.h"
-#include "lyx.h"
#include "lyx_main.h"
#include "buffer.h"
#include "frontends/FileDialog.h"
extern char ** environ; // is this only redundtant on linux systems? Lgb.
+// xforms doesn't define this (but it should be in <forms.h>).
+extern "C"
+FL_APPEVENT_CB fl_set_preemptive_callback(Window, FL_APPEVENT_CB, void *);
+
namespace {
float const DEG2PI = 57.295779513;
gs_color = true;
}
-
-// xforms doesn't define this
-extern "C"
-FL_APPEVENT_CB fl_set_preemptive_callback(Window, FL_APPEVENT_CB, void *);
-
-
void InitFigures()
{
// if bitmaps and figures are not empty we will leak mem
tmp->pswid = pswid;
tmp->pshgh = pshgh;
tmp->fname = fname;
- if (!fname.empty() && IsFileReadable(fname)
+ string lfname = fname;
+ if (!fname.empty() && GetExtension(fname).empty())
+ lfname += ".eps";
+ if (!fname.empty() && IsFileReadable(lfname)
&& (flags & 3) && !lyxrc.ps_command.empty()
&& lyxrc.use_gui) {
// do not display if there is
// "do not display" chosen (Matthias 260696)
- tmp->figure->data = getfigdata(wid, hgh, fname, psx, psy,
+ tmp->figure->data = getfigdata(wid, hgh, lfname, psx, psy,
pswid, pshgh, raw_wid, raw_hgh,
angle, flags & (3|8));
} else tmp->figure->data = 0;
if (fname.empty()) return;
string p;
- ifstream ifs(fname.c_str());
+ string lfname = fname;
+ if (GetExtension(fname).empty())
+ lfname += ".eps";
+ ifstream ifs(lfname.c_str());
if (!ifs) return; // file not found !!!!