From be967977f24f9b5ea900a1d1b2d1044b4eb018ce Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 29 Sep 2000 15:14:36 +0000 Subject: [PATCH] More small changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/lyx-1_1_5@1060 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 22 ++++++++++++++++++++++ lib/doc/LaTeXConfig.lyx.in | 16 ++++++++++++++++ src/mathed/formula.C | 25 +++++++++++++++---------- src/paragraph.C | 2 +- src/support/lyxstring.C | 2 +- src/vspace.C | 4 ++-- 6 files changed, 57 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 202d65a3fa..5aaa69581a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2000-09-29 Dekel Tsur + + * src/paragraph.C (TeXFootnote): Fixed bug with LTR table floats. + +2000-09-26 Jean-Marc Lasgouttes + + * lib/layouts/siamltex.layout: new textclass for SIAM journals, + from Kornelia Pietsch + + * src/support/lyxstring.C (lyxstring): When a number of + characters has been given, we should not assume that the string is + 0-terminated. + + * src/vspace.C (nextToken): use isStrDbl() to check for proper + double values. + +2000-09-23 Dekel Tsur + + * src/mathed/formula.C (MathFuncInset::Metrics): Use default + width/descent/ascent values if name is empty. + (mathed_string_height): Use std::max. + 2000-09-22 Jean-Marc Lasgouttes * lib/doc/LaTeXConfig.lyx.in: updated. diff --git a/lib/doc/LaTeXConfig.lyx.in b/lib/doc/LaTeXConfig.lyx.in index c4a344dce7..05528e1cbb 100644 --- a/lib/doc/LaTeXConfig.lyx.in +++ b/lib/doc/LaTeXConfig.lyx.in @@ -931,6 +931,22 @@ Notes: REVTeX 4 is a class used for submitting manuscripts to journals including http://publish.aps.org/revtex4/ \layout Subsection +SIAMLTeX +\layout Description + +Found: @chk_siamltex@ +\layout Description + +CTAN: +\family typewriter +macros/latex/contrib/other/siam/siamltex.tar +\layout Description + +Notes: The Society for Industrial and Applied Mathematics, Philadelphia, + Pennsylvania, wants to ensure quality typesetting according to SIAM style + standards by providing this LaTeX style. +\layout Subsection + Springer Journal of Geodesy \layout Description diff --git a/src/mathed/formula.C b/src/mathed/formula.C index cc61c95dc8..474a8b4372 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -48,6 +48,7 @@ using std::istream; using std::pair; using std::endl; using std::vector; +using std::max; extern char * mathed_label; @@ -231,10 +232,8 @@ int mathed_string_height(short type, int size, byte const * s, LyXFont font = WhichFont(type, size); asc = des = 0; for (int i = 0; i < ls; ++i) { - if (lyxfont::descent(s[i], font) > des) - des = lyxfont::descent(s[i], font); - if (lyxfont::ascent(s[i], font) > asc) - asc = lyxfont::ascent(s[i], font); + des = max(des, lyxfont::descent(s[i], font)); + asc = max(asc, lyxfont::ascent(s[i], font)); } return asc + des; } @@ -1213,13 +1212,19 @@ MathFuncInset::draw(Painter & pain, int x, int y) void MathFuncInset::Metrics() { ln = (name) ? strlen(name): 0; - LyXFont font = WhichFont(LM_TC_TEXTRM, size); + LyXFont font = WhichFont(LM_TC_TEXTRM, size); font.setLatex(LyXFont::ON); - width = lyxfont::width(name, ln, font) - + lyxfont::width('I', font) / 2; - mathed_string_height(LM_TC_TEXTRM, size, - reinterpret_cast(name), - strlen(name), ascent, descent); + if (ln == 0) { + width = df_width; + descent = df_des; + ascent = df_asc; + } else { + width = lyxfont::width(name, ln, font) + + lyxfont::width('I', font) / 2; + mathed_string_height(LM_TC_TEXTRM, size, + reinterpret_cast(name), + strlen(name), ascent, descent); + } } diff --git a/src/paragraph.C b/src/paragraph.C index 6f1986c8ef..6a613ddc71 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -3850,7 +3850,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(ostream & os, TexRow & texrow, bool moving_arg = false; bool need_closing = false; - bool is_rtl = isRightToLeftPar(); + bool is_rtl = lyxrc.rtl_support && getParLanguage()->RightToLeft; if (is_rtl != parent_is_rtl) { if (is_rtl) diff --git a/src/support/lyxstring.C b/src/support/lyxstring.C index d247be4b7f..40e733c714 100644 --- a/src/support/lyxstring.C +++ b/src/support/lyxstring.C @@ -415,7 +415,7 @@ lyxstring::lyxstring(value_type const * s, size_type n) Assert(s && n < npos); // STD! static Srep empty_rep(0, ""); if (*s && n) { // s is not empty string and n > 0 - rep = new Srep(min(strlen(s), n), s); + rep = new Srep(n, s); } else { ++empty_rep.ref; rep = &empty_rep; diff --git a/src/vspace.C b/src/vspace.C index 92de803861..f00fa2964f 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -97,8 +97,8 @@ char nextToken (string & data) if ((i = data.find_last_of("0123456789.")) != string::npos) { if (number_index > 3) return 'E'; // Error string buffer = data.substr(0, i + 1); - if (sscanf (buffer.c_str(), - "%f", &number[number_index]) == 1) { + if (isStrDbl(buffer)) { + number[number_index] = strToDbl(buffer); lyx_advance (data, i + 1); ++number_index; return 'n';