From 8dbf9d296ef9568328d022b253abc7e2ec190a2d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 9 Mar 2000 16:13:43 +0000 Subject: [PATCH] A bit of cxx warniong hunting; update to rpm spec file. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@596 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 21 +++++++++++ development/lyx.spec.in | 2 ++ lib/doc/LaTeXConfig.lyx.in | 65 ++++++++++++++++++++++++++++------- src/insets/insetcollapsable.C | 2 +- src/insets/insetcollapsable.h | 2 +- src/insets/insetfoot.C | 4 +-- src/insets/insetfoot.h | 2 +- src/mathed/formula.C | 4 +-- src/mathed/formulamacro.C | 8 +++-- src/mathed/formulamacro.h | 4 +-- src/mathed/math_defs.h | 2 +- src/mathed/math_delim.C | 2 +- src/mathed/math_macro.C | 15 ++++---- 13 files changed, 100 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62d092d026..b22baafe00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2000-03-09 Jean-Marc Lasgouttes + + * lib/doc/LaTeXConfig.lyx.in: add description of textclass llncs. + + * src/mathed/math_macro.C (draw): do some cast magic. + (Metrics): ditto. + + * src/mathed/math_defs.h: change byte* argument to byte const*. + + * src/mathed/formulamacro.[Ch]: add free_spc to Latex() method. + + * src/insets/insetfoot.[Ch]: Clone() always returns an Inset* (well I + know it is right to return InsetFoot* too, but cxx does not like + it...). + + * src/insets/insetcollapsable.[Ch] (Clone): make const. + + * development/lyx.spec.in: unset LINGUAS to avoid i18n problems. + + * src/mathed/math_delim.C: change == to proper assignment. + 2000-03-09 Juergen Vigna * src/insets/insettext.C (setPos): fixed various cursor positioning diff --git a/development/lyx.spec.in b/development/lyx.spec.in index e41156012f..1860970447 100644 --- a/development/lyx.spec.in +++ b/development/lyx.spec.in @@ -36,10 +36,12 @@ place that the Redhat tetex package is installed and would see it. %setup %build +unset LINGUAS CXXFLAGS="$RPM_OPT_FLAGS" CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr make %install +unset LINGUAS rm -rf ${RPM_BUILD_ROOT} install -d -m 755 ${RPM_BUILD_ROOT} make prefix=${RPM_BUILD_ROOT}/usr install diff --git a/lib/doc/LaTeXConfig.lyx.in b/lib/doc/LaTeXConfig.lyx.in index d43db3437b..a11faee958 100644 --- a/lib/doc/LaTeXConfig.lyx.in +++ b/lib/doc/LaTeXConfig.lyx.in @@ -492,6 +492,33 @@ dinbrief can be used to type letters according to German conventions. \layout Subsection +docbook +\layout Description + +Found: @chk_docbook@ +\layout Description + +CTAN: N/A +\layout Description + +WWW: +\begin_inset LatexCommand \url{http://www.sgmltools.org} + +\end_inset + + +\layout Description + +Notes: The class docbook is not a LaTeX document class. + It is designed to produce Docbook SGML documents, which, in turn, can be + exported as HTML, RTF, text, or dvi (through +\family typewriter +jadetex +\family default +). + You need the sgmltools v2.0 package installed to use this. +\layout Subsection + g-brief-en \layout Description @@ -759,31 +786,43 @@ LinuxDoc \layout Subsection -docbook +llncs \layout Description -Found: @chk_docbook@ +Found: @chk_llncs@ \layout Description CTAN: N/A \layout Description -WWW: -\begin_inset LatexCommand \url{http://www.sgmltools.org} +Notes: The document class +\family sans +llncs +\family default +can be used to write articles for submission to the Springer journal +\begin_inset Quotes eld +\end_inset +Lecture Notes in Computer Science +\begin_inset Quotes erd \end_inset +. + LaTeX documents are available from Springer's ftp site on the following + URL: +\newline -\layout Description +\begin_inset LatexCommand \url{ftp://trick.ntp.springer.de/pub/tex/latex/llncs/latex2e} -Notes: The class docbook is not a LaTeX document class. - It is designed to produce Docbook SGML documents, which, in turn, can be - exported as HTML, RTF, text, or dvi (through -\family typewriter -jadetex -\family default -). - You need the sgmltools v2.0 package installed to use this. +\end_inset + +. + +\begin_deeper +\layout Standard + +The LyX layout file for this document class is still insufficiently tested. +\end_deeper \layout Subsection paper diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index f64a6fc636..fe51decf1a 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -32,7 +32,7 @@ InsetCollapsable::InsetCollapsable(Buffer * bf): InsetText(bf) } -Inset * InsetCollapsable::Clone() +Inset * InsetCollapsable::Clone() const { Inset * result = new InsetCollapsable(buffer); return result; diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index da93bc8266..039a3256c7 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -38,7 +38,7 @@ public: /// ~InsetCollapsable() {} /// - Inset * Clone(); + Inset * Clone() const; /// int ascent(Painter &, LyXFont const &) const; /// diff --git a/src/insets/insetfoot.C b/src/insets/insetfoot.C index 3d7e768062..d86d7267ca 100644 --- a/src/insets/insetfoot.C +++ b/src/insets/insetfoot.C @@ -33,9 +33,9 @@ InsetFoot::InsetFoot(Buffer * bf): InsetCollapsable(bf) } -InsetFoot * InsetFoot::Clone() const +Inset * InsetFoot::Clone() const { - InsetFoot * result = new InsetFoot(buffer); + Inset * result = new InsetFoot(buffer); return result; } diff --git a/src/insets/insetfoot.h b/src/insets/insetfoot.h index c162375f78..6a3249ec09 100644 --- a/src/insets/insetfoot.h +++ b/src/insets/insetfoot.h @@ -33,7 +33,7 @@ public: /// ~InsetFoot() {} /// - InsetFoot * Clone() const; + Inset * Clone() const; /// Inset::Code LyxCode() const { return Inset::FOOT_CODE; } #ifndef USE_OSTREAM_ONLY diff --git a/src/mathed/formula.C b/src/mathed/formula.C index b3286f288a..e8ae2e91f0 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -238,7 +238,7 @@ int mathed_char_height(short type, int size, byte c, int & asc, int & des) // In a near future maybe we use a better fonts renderer void MathedInset::drawStr(Painter & pain, short type, int size, - int x, int y, byte * s, int ls) + int x, int y, byte const * s, int ls) { string st; if (MathIsBinary(type)) { @@ -246,7 +246,7 @@ void MathedInset::drawStr(Painter & pain, short type, int size, st += string(" ") + char(s[i]) + ' '; } } else { - st = string(reinterpret_cast(s), ls); + st = string(reinterpret_cast(s), ls); } LyXFont mf = mathed_get_font(type, size); pain.text(x, y, st, mf); diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index cb40a7bcd0..6aca4ea6b3 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -66,11 +66,12 @@ Inset * InsetFormulaMacro::Clone() const void InsetFormulaMacro::Write(ostream & os) const { os << "FormulaMacro "; - Latex(os, 0); + Latex(os, 0, false); } -int InsetFormulaMacro::Latex(ostream & os, signed char /*fragile*/) const +int InsetFormulaMacro::Latex(ostream & os, signed char /*fragile*/, + bool /*free_spacing*/) const { int ret = 1; tmacro->WriteDef(os); @@ -79,7 +80,8 @@ int InsetFormulaMacro::Latex(ostream & os, signed char /*fragile*/) const #ifndef USE_OSTREAM_ONLY -int InsetFormulaMacro::Latex(string &file, signed char /*fragile*/) const +int InsetFormulaMacro::Latex(string &file, signed char /*fragile*/, + bool /*free_spacing*/) const { int ret = 1; tmacro->WriteDef(file); diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index 741f8dabfe..64480b4eb8 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -48,10 +48,10 @@ public: /// void Write(ostream & os) const; /// - int Latex(ostream & os, signed char fragile) const; + int Latex(ostream & os, signed char fragile, bool free_spc) const; #ifndef USE_OSTREAM_ONLY /// - int Latex(string & file, signed char fragile) const; + int Latex(string & file, signed char fragile, bool free_spc) const; /// int Linuxdoc(string & file) const; /// diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 515027ab20..dc8687c17a 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -289,7 +289,7 @@ class MathedInset { static int df_asc, df_des, df_width; /// In a near future maybe we use a better fonts renderer than X - void drawStr(Painter &, short, int, int, int, byte *, int); + void drawStr(Painter &, short, int, int, int, byte const *, int); /// friend class MathedCursor; /// diff --git a/src/mathed/math_delim.C b/src/mathed/math_delim.C index b47d4e9efe..6dfb0855aa 100644 --- a/src/mathed/math_delim.C +++ b/src/mathed/math_delim.C @@ -321,7 +321,7 @@ public: sort(math_deco_table, math_deco_table + math_deco_table_size, math_deco_compare()); - init_deco_table::init == true; + init_deco_table::init = true; } } private: diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index bfd5b5cb75..d2c716ad61 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -271,13 +271,14 @@ void MathMacroArgument::draw(Painter & pain, int x, int baseline) #ifdef HAVE_SSTREAM ostringstream ost; ost << '#' << number; - drawStr(pain, LM_TC_TEX, size, x, baseline, ost.str().c_str(), 2); + drawStr(pain, LM_TC_TEX, size, x, baseline, + reinterpret_cast(ost.str().c_str()), 2); #else char s[3]; ostrstream ost(s, 3); ost << '#' << number << '\0'; drawStr(pain, LM_TC_TEX, size, x, baseline, - reinterpret_cast(ost.str()), 2); + reinterpret_cast(ost.str()), 2); #endif } } @@ -291,18 +292,20 @@ void MathMacroArgument::Metrics() #ifdef HAVE_SSTREAM ostringstream ost; ost << '#' << number; - width = mathed_string_width(LM_TC_TEX, size, ost.str().c_str(), 2); + width = mathed_string_width(LM_TC_TEX, size, + reinterpret_cast(ost.str().c_str()), 2); mathed_string_height(LM_TC_TEX, size, - ost.str().c_str(), 2, ascent, descent); + reinterpret_cast(ost.str().c_str()), + 2, ascent, descent); #else char s[3]; ostrstream ost(s, 3); ost << '#' << number << '\0'; width = mathed_string_width(LM_TC_TEX, size, - reinterpret_cast + reinterpret_cast (ost.str()), 2); mathed_string_height(LM_TC_TEX, size, - reinterpret_cast(ost.str()), + reinterpret_cast(ost.str()), 2, ascent, descent); #endif } -- 2.39.5