- // set the bounding box values, if exists. First we need the whole
- // path, because the controller knows nothing about the doc-dir
- lyxerr << "GraphicsUpdate::BoundingBox = " << igp.bb << "\n";
- controller().bbChanged = false;
- if (igp.bb.empty()) {
- string const fileWithAbsPath = MakeAbsPath(igp.filename, OnlyPath(igp.filename));
- string bb = controller().readBB(fileWithAbsPath);
- lyxerr << "file::BoundingBox = " << bb << "\n";
- if (!bb.empty()) {
- // get the values from the file
- // in this case we always have the point-unit
- 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());
- }
- } else { // get the values from the inset
- controller().bbChanged = true;
- LyXLength anyLength;
- anyLength = LyXLength(token(igp.bb,' ',0));
- updateWidgetsFromLength(bbox_->input_bb_x0,
- bbox_->choice_bb_x0,anyLength,"pt");
- anyLength = LyXLength(token(igp.bb,' ',1));
- updateWidgetsFromLength(bbox_->input_bb_y0,
- bbox_->choice_bb_y0,anyLength,"pt");
- anyLength = LyXLength(token(igp.bb,' ',2));
- updateWidgetsFromLength(bbox_->input_bb_x1,
- bbox_->choice_bb_x1,anyLength,"pt");
- anyLength = LyXLength(token(igp.bb,' ',3));
- updateWidgetsFromLength(bbox_->input_bb_y1,
- bbox_->choice_bb_y1,anyLength,"pt");
- }
- // Update the draft and clip mode
- fl_set_button(bbox_->button_draft, igp.draft);
- fl_set_button(bbox_->button_clip, igp.clip);
- // Update the subcaption check button and input field