From 1cd14974e16ee6749af2380dd25d89942fc61962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 27 Jun 2004 13:14:08 +0000 Subject: [PATCH] fix off-by-one-error with paperpackage selection git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8824 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 9 +++++++++ src/bufferparams.C | 2 +- src/lyxlex.C | 2 +- src/lyxlex.h | 2 +- src/tex-strings.C | 20 ++++++++++---------- src/tex-strings.h | 18 +++++++++--------- 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f9d437842e..2411f55200 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2004-06-27 Jürgen Spitzmüller + + * tex-strings.C: add "none" to string_paperpackages[], fixes + off-by-one-error in the paperpackage selection. + + * lyxlex.[Ch]: + * tex-strings.[Ch]: char const * string[n] + -> char const * const string[] + 2004-06-10 Jean-Marc Lasgouttes * lyxfunc.C (getStatus): if lyx_gui::getStatus disables the diff --git a/src/bufferparams.C b/src/bufferparams.C index d3475dd639..da924693fe 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -557,7 +557,7 @@ void BufferParams::writeFile(ostream & os) const cite_engine_str = "jurabib"; break; } - + os << "\\papersize " << string_papersize[papersize2] << "\n\\paperpackage " << string_paperpackages[paperpackage] << "\n\\use_geometry " << use_geometry diff --git a/src/lyxlex.C b/src/lyxlex.C index bff5266e19..32c4ace873 100644 --- a/src/lyxlex.C +++ b/src/lyxlex.C @@ -231,7 +231,7 @@ void LyXLex::pushToken(string const & pt) } -int LyXLex::findToken(char const * str[]) +int LyXLex::findToken(char const * const str[]) { if (!next()) { pimpl_->printError("file ended while scanning string token"); diff --git a/src/lyxlex.h b/src/lyxlex.h index 8feb0094a6..13937e6a7d 100644 --- a/src/lyxlex.h +++ b/src/lyxlex.h @@ -112,7 +112,7 @@ public: /// bool eatLine(); /// - int findToken(char const * str[]); + int findToken(char const * const str[]); /// Pushes a token list on a stack and replaces it with a new one. void pushTable(keyword_item *, int); diff --git a/src/tex-strings.C b/src/tex-strings.C index bc47fec4b6..b5f68fa0c3 100644 --- a/src/tex-strings.C +++ b/src/tex-strings.C @@ -16,38 +16,38 @@ // this file should perhaps be split into even smaller parts -char const * string_paragraph_separation[3] = { +char const * const string_paragraph_separation[] = { "indent", "skip", "" }; -char const * string_quotes_language[7] = { +char const * const string_quotes_language[] = { "english", "swedish", "german", "polish", "french", "danish", "" }; -char const * string_papersize[12] = { +char const * const string_papersize[] = { "Default", "Custom", "letterpaper", "executivepaper", "legalpaper", "a3paper", "a4paper", "a5paper", "b3paper", "b4paper", "b5paper", "" }; -char const * string_paperpackages[4] = { - "a4", "a4wide", "widemarginsa4", "" +char const * const string_paperpackages[] = { + "none", "a4", "a4wide", "widemarginsa4", "" }; -char const * string_orientation[3] = { +char const * const string_orientation[] = { "portrait", "landscape", "" }; -char const * string_footnotekinds[8] = { +char const * const string_footnotekinds[] = { "footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", "" }; -char const * string_align[5] = { +char const * const string_align[] = { "block", "left", "right", "center", "" }; @@ -56,9 +56,9 @@ char const * string_align[5] = { // used all over. As it happens, that meant that these strings were included // 27 times in the object file. (Asger) -char const * tex_graphics[] = {"default", "dvips", "dvitops", "emtex", +char const * const tex_graphics[] = {"default", "dvips", "dvitops", "emtex", "ln", "oztex", "textures", "none", ""}; -char const * tex_fonts[] = {"default", "ae", "pslatex", "times", "palatino", +char const * const tex_fonts[] = {"default", "ae", "pslatex", "times", "palatino", "helvet", "avant", "newcent", "bookman", ""}; diff --git a/src/tex-strings.h b/src/tex-strings.h index cd19688f42..3af6004330 100644 --- a/src/tex-strings.h +++ b/src/tex-strings.h @@ -16,28 +16,28 @@ // this file should perhaps be split into even smaler parts /// -extern char const * string_paragraph_separation[]; +extern char const * const string_paragraph_separation[]; /// -extern char const * string_quotes_language[]; +extern char const * const string_quotes_language[]; /// -extern char const * string_papersize[]; +extern char const * const string_papersize[]; /// -extern char const * string_paperpackages[]; +extern char const * const string_paperpackages[]; /// -extern char const * string_orientation[]; +extern char const * const string_orientation[]; /// -extern char const * string_footnotekinds[]; +extern char const * const string_footnotekinds[]; /// -extern char const * string_align[]; +extern char const * const string_align[]; // The following was moved from tex-defs.h to here, because tex-defs.h is // used all over. As it happens, that meant that these strings were included // 27 times in the object file. (Asger) /// -extern char const * tex_graphics[]; +extern char const * const tex_graphics[]; /// -extern char const * tex_fonts[]; +extern char const * const tex_fonts[]; #endif