]> git.lyx.org Git - features.git/commitdiff
Herbert's bugfix patch
authorAngus Leeming <leeming@lyx.org>
Fri, 8 Feb 2002 10:47:02 +0000 (10:47 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 8 Feb 2002 10:47:02 +0000 (10:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3509 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/xforms_helpers.h
src/insets/ChangeLog
src/insets/insetgraphics.C
src/support/ChangeLog
src/support/filetools.C

index 650d0b5eaf501ec9cf0affbf343a4d8c3a466af4..deb409581e0c67de2b97ee60502e8fc075830884 100644 (file)
@@ -1,4 +1,11 @@
 
+2002-02-08  Herbert Voss  <voss@lyx.org>
+
+       * xforms_helpers.h: change unit "%" to t%
+
+       * FormGraphics.C: fiy bug when BB is read from file and the
+       unit is always "pt"
+
 2002-02-08  Martin Vermeer <martin.vermeer@hut.fi>
 
        * FormMathsDeco.C: \underleftarrow and \underrightarrow
index 8448cd0d0f4698899967249423d27afbe2fa96d7..5eb5c39a52b03cfefde348808f2baf55439e3511 100644 (file)
@@ -474,10 +474,10 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
 
        // 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);
@@ -486,10 +486,18 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
                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;
            }
index c4325d88012c236db156e51d5d180609d1f1a749..c60e29b2eb4ab4a569da161f2e98202df0cec559 100644 (file)
@@ -18,7 +18,7 @@ class LyXLength;
 
 // what we always need for lengths
 string const choice_Length_All =
-    "cm|mm|in|%%|c%%|p%%|l%%|ex|em|pt|sp|bp|dd|pc|cc|mu";
+    "cm|mm|in|t%%|c%%|p%%|l%%|ex|em|pt|sp|bp|dd|pc|cc|mu";
 string const choice_Length_WithUnit =
     "cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu";     // all with a Unit
 
index 3448c7d2b036d65e0571dbc6aa53476c63f63a04..317718ff59138f1a72a337376950bdf259949e47 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-08  Herbert Voss  <voss@lyx.org>
+
+       * insetgraphic.C: prepareFile(): fix bug when file doesn't
+       exists, than return filename with extension
+
 2002-02-06  Herbert Voss  <voss@lyx.org>
 
        * insetgraphic.C: prepareFile(): don't convert the file, when
index f82aca731497f79b44944ee8269b00a68ba2c075..0abcdb398ab3bc84c21489814db5a6425879066f 100644 (file)
@@ -95,6 +95,7 @@ TODO Before initial production release:
 #include "graphics/GraphicsCacheItem.h"
 
 #include "frontends/Dialogs.h"
+#include "frontends/Alert.h"
 #include "LyXView.h"
 #include "buffer.h"
 #include "BufferView.h"
@@ -557,6 +558,11 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
        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);
index 9f3ce4b56dd4c11616cd964d39ca526d80db330f..f81d1cc6fffce689b277b16f1967cd315ce0e4f5 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-08  Herbert Voss  <voss@perce.de>
+
+       * filetools.[C]: (unzipFile) fix typo
+
 2002-02-06  Herbert Voss  <voss@perce.de>
 
        * filetools.[Ch]: fix sume bugs for detecting zipped files 
index 8b7b9d9c17ed6540dcac4e9a6dd916e6d7d14b1d..515e2ea8e163ac31dae7083bb50ce6b973158ff3 100644 (file)
@@ -1051,7 +1051,7 @@ string const unzipFile(string const & zipped_file)
     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;