::sleep(1);
XGrabServer(tempdisp);
}
+#ifdef HAVE_SSTREAM
XChangeProperty(tempdisp,
fl_get_canvas_id(figinset_canvas),
XInternAtom(tempdisp, "GHOSTVIEW", false),
XInternAtom(tempdisp, "STRING", false),
8, PropModeAppend,
-#ifdef HAVE_SSTREAM
reinterpret_cast<unsigned char*>(const_cast<char*>(t1.str().c_str())),
- t1.str().size()
+ t1.str().size());
#else
+
+ XChangeProperty(tempdisp,
+ fl_get_canvas_id(figinset_canvas),
+ XInternAtom(tempdisp, "GHOSTVIEW", false),
+ XInternAtom(tempdisp, "STRING", false),
+ 8, PropModeAppend,
reinterpret_cast<unsigned char*>(const_cast<char*>(t1.str())),
- strlen(t1.str())
+ ::strlen(t1.str()));
#endif
- );
XUngrabServer(tempdisp);
XFlush(tempdisp);
#ifdef HAVE_SSTREAM
ostringstream t3;
#else
- char tbuf3[384];
- ostrstream t3(tbuf3, sizeof(tbuf3));
+ //char tbuf[384];
+ ostrstream t3(tbuf, sizeof(tbuf));
#endif
switch (p->data->flags & 3) {
case 0: t3 << 'H'; break; // Hidden
#endif
XGrabServer(tempdisp);
+#ifdef HAVE_SSTREAM
XChangeProperty(tempdisp,
fl_get_canvas_id(figinset_canvas),
XInternAtom(tempdisp,
"GHOSTVIEW_COLORS", false),
XInternAtom(tempdisp, "STRING", false),
8, PropModeReplace,
-#ifdef HAVE_SSTREAM
reinterpret_cast<unsigned char*>(const_cast<char*>(t3.str().c_str())),
- t3.str().size()
+ t3.str().size());
#else
+ XChangeProperty(tempdisp,
+ fl_get_canvas_id(figinset_canvas),
+ XInternAtom(tempdisp,
+ "GHOSTVIEW_COLORS", false),
+ XInternAtom(tempdisp, "STRING", false),
+ 8, PropModeReplace,
reinterpret_cast<unsigned char*>(const_cast<char*>(t3.str())),
- strlen(t3.str())
+ ::strlen(t3.str()));
#endif
- );
XUngrabServer(tempdisp);
XFlush(tempdisp);
{
/* first search for an exact match with fname and width/height */
- if (fname.empty()) return 0;
+ if (fname.empty() || !IsFileReadable(fname))
+ return 0;
for (bitmaps_type::iterator it = bitmaps.begin();
it != bitmaps.end(); ++it) {
fl_hide_form(tmpfig->inset->form->Figure);
}
#if FL_REVISION == 89
-#warning Reactivate this free_form calls
+ // CHECK Reactivate this free_form calls
#else
fl_free_form(tmpfig->inset->form->Figure);
free(tmpfig->inset->form); // Why free?
if (figure && figure->data) {
if (figure->data->broken) msg = _("[render error]");
else if (figure->data->reading) msg = _("[rendering ... ]");
- } else
- if (fname.empty()) msg = _("[no file]");
- else if ((flags & 3) == 0) msg = _("[not displayed]");
- else if (lyxrc.ps_command.empty()) msg = _("[no ghostscript]");
+ }
+ else if (fname.empty())
+ msg = _("[no file]");
+ else if (!IsFileReadable(fname))
+ msg = _("[bad file name]");
+ else if ((flags & 3) == 0)
+ msg = _("[not displayed]");
+ else if (lyxrc.ps_command.empty())
+ msg = _("[no ghostscript]");
if (!msg) msg = _("[unknown error]");
tmp->pswid = pswid;
tmp->pshgh = pshgh;
tmp->fname = fname;
- if (!fname.empty() && (flags & 3) && !lyxrc.ps_command.empty()
+ if (!fname.empty() && IsFileReadable(fname)
+ && (flags & 3) && !lyxrc.ps_command.empty()
&& lyxrc.use_gui) {
// do not display if there is
// "do not display" chosen (Matthias 260696)
/* now recompute wid and hgh, and if that is changed, set changed */
/* this depends on chosen size of the picture and its bbox */
// This will be redone in 0.13 ... (hen)
- if (!fname.empty()) {
+ if (!fname.empty() && IsFileReadable(fname)) {
// say, total width is 595 pts, as A4 in TeX, thats in 1/72" */
newx = frame_wid;
figdata * pf = figure->data;
// get new data
- if (!fname.empty() && (flags & 3)
+ if (!fname.empty() && IsFileReadable(fname) && (flags & 3)
&& !lyxrc.ps_command.empty()) {
// do not display if there is "do not display"
// chosen (Matthias 260696)
} else {
if (!fname.empty()) {
changedfname = true;
- fname.clear();
+ fname.erase();
}
}
subcaption = fl_get_input(form->Subcaption);
fl_set_focus_object(form->Figure, form->OkBtn);
fl_hide_form(form->Figure);
#if FL_REVISION == 89
-#warning Reactivate this free_form calls
+ // CHECK Reactivate this free_form calls
#else
fl_free_form(form->Figure);
free(form); // Why free?
fl_set_focus_object(form->Figure, form->OkBtn);
fl_hide_form(form->Figure);
#if FL_REVISION == 89
-#warning Reactivate this free_form calls
-#warning Jug, is this still a problem?
+ // CHECK Reactivate this free_form calls
+ // Jug, is this still a problem?
#else
fl_free_form(form->Figure);
free(form); // Why free?