From: Angus Leeming Date: Wed, 20 Feb 2002 16:34:53 +0000 (+0000) Subject: Herbert's graphics14.diff X-Git-Tag: 1.6.10~19818 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=fae3fd8ab1d81fa8883594e8b5ccb02a4466ca06;p=features.git Herbert's graphics14.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3578 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 2539f60738..54b0de5e8c 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2002-02-18 Herbert Voss + + * ControlGraphics.[C]: remove help-file call + 2002-02-18 Angus Leeming * helper_funcs.h: wrap the structs firster and seconder up in a diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index 5c0972bfb8..9bf1949d3f 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -131,8 +131,4 @@ string const ControlGraphics::readBB(string const & file) return string(); } -void ControlGraphics::help() const -{ - lv_.getDialogs()->showFile(i18nLibFileSearch("help","Graphics.hlp")); -} diff --git a/src/frontends/controllers/ControlGraphics.h b/src/frontends/controllers/ControlGraphics.h index 0c9dc1696f..022e3e9564 100644 --- a/src/frontends/controllers/ControlGraphics.h +++ b/src/frontends/controllers/ControlGraphics.h @@ -40,8 +40,6 @@ public: string const readBB(string const & file); /// Control the bb bool bbChanged; - /// Show Help file - void help() const; private: /// Dispatch the changed parameters to the kernel. diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 262d0ef064..18ea844eff 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -9,6 +9,10 @@ * xforms_helpers.h: remove incorrect comment. +2002-02-18 Herbert Voss + + * FormGraphics.C: same units for LyX and Latex view, cosmetics + 2002-02-18 Angus Leeming * Timeout_pimpl.[Ch] (running): new method. diff --git a/src/frontends/xforms/FormGraphics.C b/src/frontends/xforms/FormGraphics.C index 4222641bc6..5cb9d4345b 100644 --- a/src/frontends/xforms/FormGraphics.C +++ b/src/frontends/xforms/FormGraphics.C @@ -106,8 +106,8 @@ void FormGraphics::build() fl_set_input_return (lyxview_->input_lyxheight, FL_RETURN_CHANGED); fl_set_input_return (lyxview_->input_lyxscale, FL_RETURN_CHANGED); - fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_WithUnit.c_str()); - fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_WithUnit.c_str()); + fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_All.c_str()); + fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_All.c_str()); bc().addReadOnly(lyxview_->radio_pref); bc().addReadOnly(lyxview_->radio_mono); @@ -385,9 +385,10 @@ void FormGraphics::update() { // path, because the controller knows nothing about the doc-dir controller().bbChanged = false; if (igp.bb.empty()) { - string const fileWithAbsPath = + lyxerr[Debug::GRAPHICS] << "update:: no BoundingBox" << endl; + string const fileWithAbsPath = MakeAbsPath(igp.filename, OnlyPath(igp.filename)); - string const bb = controller().readBB(fileWithAbsPath); + string const bb = controller().readBB(fileWithAbsPath); if (!bb.empty()) { // get the values from the file // in this case we always have the point-unit @@ -401,9 +402,9 @@ void FormGraphics::update() { fl_set_input(bbox_->input_bb_x1, bb.c_str()); fl_set_input(bbox_->input_bb_y1, bb.c_str()); } - string const unit("pt"); - fl_set_choice_text(bbox_->choice_bb_units, unit.c_str()); + fl_set_choice(bbox_->choice_bb_units, 1); // "pt" } else { // get the values from the inset + lyxerr[Debug::GRAPHICS] << "update:: igp has BoundingBox" << endl; controller().bbChanged = true; LyXLength anyLength; anyLength = LyXLength(token(igp.bb,' ',0)); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index e94f901168..db78511f3d 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -35,6 +35,10 @@ (docbook): (validate): the file locatation is given by an entity reference. +2002-02-18 Herbert Voss + + * insetgraphics.C: use [Debug::GRAPHICS] for lyxerr + 2002-02-18 Angus Leeming * insetexternal.C Changes due to the renaming of support/syscall.[Ch] diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 1dc04a8530..59f463c436 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -350,7 +350,7 @@ void InsetGraphics::read(Buffer const * buf, LyXLex & lex) else if (token == "Figure") // Compatibility reading of FigInset figures. readFigInset(buf, lex); else - lyxerr[Debug::INFO] << "Not a Graphics or Figure inset!\n"; + lyxerr[Debug::GRAPHICS] << "Not a Graphics or Figure inset!\n"; updateInset(); } @@ -363,7 +363,7 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex) lex.next(); string const token = lex.getString(); - lyxerr[Debug::INFO] << "Token: '" << token << '\'' + lyxerr[Debug::GRAPHICS] << "Token: '" << token << '\'' << endl; if (token.empty()) { @@ -408,7 +408,7 @@ void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex) lex.next(); string const token = lex.getString(); - lyxerr[Debug::INFO] << "Token: " << token << endl; + lyxerr[Debug::GRAPHICS] << "Token: " << token << endl; if (token.empty()) continue; @@ -526,7 +526,7 @@ string decideOutputImageFormat(string const & suffix) // lyxrc.pdf_mode means: // Are we creating a PDF or a PS file? // (Should actually mean, are we using latex or pdflatex). - lyxerr[Debug::INFO] << "decideOutput::lyxrc.pdf_mode = " << lyxrc.pdf_mode << "\n"; + lyxerr[Debug::GRAPHICS] << "decideOutput::lyxrc.pdf_mode = " << lyxrc.pdf_mode << "\n"; if (lyxrc.pdf_mode) { if (contains(suffix,"ps") || suffix == "pdf") return "pdf"; @@ -536,7 +536,7 @@ string decideOutputImageFormat(string const & suffix) return "png"; } // If it's postscript, we always do eps. - lyxerr[Debug::INFO] << "decideOutput: we have PostScript mode\n"; + lyxerr[Debug::GRAPHICS] << "decideOutput: we have PostScript mode\n"; if (suffix != "ps") return "eps"; else @@ -561,7 +561,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const // // if it's a zipped one, than let LaTeX do the rest!!! if ((zippedFile(params.filename) && params.noUnzip) || buf->niceFile) { - lyxerr[Debug::INFO] << "don't unzip file or export latex" + lyxerr[Debug::GRAPHICS] << "don't unzip file or export latex" << params.filename << endl; return params.filename; } @@ -586,10 +586,10 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const string outfile; string const temp = AddName(buf->tmppath, filename_); outfile = RemoveExtension(temp); - lyxerr[Debug::INFO] << "tempname = " << temp << "\n"; - lyxerr[Debug::INFO] << "buf::tmppath = " << buf->tmppath << "\n"; - lyxerr[Debug::INFO] << "filename_ = " << filename_ << "\n"; - lyxerr[Debug::INFO] << "outfile = " << outfile << endl; + lyxerr[Debug::GRAPHICS] << "tempname = " << temp << "\n"; + lyxerr[Debug::GRAPHICS] << "buf::tmppath = " << buf->tmppath << "\n"; + lyxerr[Debug::GRAPHICS] << "filename_ = " << filename_ << "\n"; + lyxerr[Debug::GRAPHICS] << "outfile = " << outfile << endl; converters.convert(buf, filename_, outfile, extension, image_target); return outfile; } diff --git a/src/support/ChangeLog b/src/support/ChangeLog index ac88819a6a..c12d709ad5 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2002-02-18 Herbert Voss + + * filetools.C: (getExtFromContents) return the fileextension + if no format is detected. + 2002-02-18 Angus Leeming * syscall.[Ch]: renamed as systemcall.[Ch]. class Systemcalls renamed diff --git a/src/support/filetools.C b/src/support/filetools.C index 656e90ea64..6f2376999a 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -980,7 +980,10 @@ string const GetExtension(string const & name) // GZIP \037\213\010\010... http://www.ietf.org/rfc/rfc1952.txt // ZIP PK... http://www.halyava.ru/document/ind_arch.htm // Z \037\177 UNIX compress + /// return the "extension" which belongs to the contents +/// for no knowing contents return the extension. Without +/// an extension and unknown contents we return "user" string const getExtFromContents(string const & filename) { if (filename.empty() || !IsFileReadable(filename)) return string(); // paranoia check @@ -996,7 +999,7 @@ string const getExtFromContents(string const & filename) { bool zipChecked = false; for (; count < max_count; ++count) { if (ifs.eof()) { - lyxerr[Debug::INFO] << "filetools(getExtFromContents)" + lyxerr[Debug::GRAPHICS] << "filetools(getExtFromContents)" " End of file reached and it wasn't found to be a known Type!" << endl; break; } @@ -1027,7 +1030,6 @@ string const getExtFromContents(string const & filename) { else if (contains(str,"PNG")) return "png"; else if (contains(str,"%!PS-Adobe")) { // eps or ps - // test if it's ps or eps ifs >> str; if (contains(str,"EPSF")) return "eps"; @@ -1038,9 +1040,12 @@ string const getExtFromContents(string const & filename) { else if (contains(str,"XPM")) return "xpm"; } - lyxerr[Debug::INFO] << "filetools(getExtFromContents)\n" + lyxerr[Debug::GRAPHICS] << "filetools(getExtFromContents)\n" "\tCouldn't find a known Type!" - "\twill use a \"user\" defined format (based on file extension)" << endl; + "\twill use ext or a \"user\" defined format" << endl; + string const ext(GetExtension(filename)); + if (!ext.empty()) + return ext; return "user"; }