// the bb section
} else if (!controller().bbChanged &&
- ((ob == bbox_->input_bb_x0) || (ob == bbox_->input_bb_y0) ||
- (ob == bbox_->input_bb_x1) || (ob == bbox_->input_bb_y1) ||
- (ob == bbox_->choice_bb_x0) || (ob == bbox_->choice_bb_y0) ||
- (ob == bbox_->choice_bb_x1) || (ob == bbox_->choice_bb_y1))) {
+ (ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_y0 ||
+ ob == bbox_->input_bb_x1 || ob == bbox_->input_bb_y1 ||
+ ob == bbox_->choice_bb_x0 || ob == bbox_->choice_bb_y0 ||
+ ob == bbox_->choice_bb_x1 || ob == bbox_->choice_bb_y1)) {
controller().bbChanged = true;
} else if (ob == bbox_->button_getBB) {
string const filename = getStringFromInput(file_->input_filename);
string bb = controller().readBB(fileWithAbsPath);
lyxerr << "getBB::BoundingBox = " << bb << "\n";
if (!bb.empty()) {
- fl_set_input(bbox_->input_bb_x0, token(bb,' ',0).c_str());
- fl_set_input(bbox_->input_bb_y0, token(bb,' ',1).c_str());
- fl_set_input(bbox_->input_bb_x1, token(bb,' ',2).c_str());
- fl_set_input(bbox_->input_bb_y1, token(bb,' ',3).c_str());
+ updateWidgetsFromLengthString(bbox_->input_bb_x0,
+ bbox_->choice_bb_x0,
+ token(bb,' ',0), "pt");
+ updateWidgetsFromLengthString(bbox_->input_bb_y0,
+ bbox_->choice_bb_y0,
+ token(bb,' ',1), "pt");
+ updateWidgetsFromLengthString(bbox_->input_bb_x1,
+ bbox_->choice_bb_x1,
+ token(bb,' ',2), "pt");
+ updateWidgetsFromLengthString(bbox_->input_bb_y1,
+ bbox_->choice_bb_y1,
+ token(bb,' ',3), "pt");
}
controller().bbChanged = false;
}
#include "graphics/GraphicsCacheItem.h"
#include "frontends/Dialogs.h"
+#include "frontends/Alert.h"
#include "LyXView.h"
#include "buffer.h"
#include "BufferView.h"
string const image_target = decideOutputImageFormat(extension);
if (extension == image_target)
return params.filename;
+ if (!IsFileReadable(params.filename)) {
+ Alert::alert(_("File") + params.filename,
+ _("isn't readable or doesn't exists!"));
+ return params.filename;
+ }
string outfile;
if (!buf->niceFile) {
string const temp = AddName(buf->tmppath, params.filename);
string const file = ChangeExtension(zipped_file, string());
string const tempfile = lyx::tempName(string(), file);
// Run gunzip
- string const command = "gunzip -c "+file+" > "+tempfile;
+ string const command = "gunzip -c "+zipped_file+" > "+tempfile;
Systemcalls one(Systemcalls::System, command);
// test that command was executed successfully
return tempfile;