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
This commit is contained in:
Jürgen Spitzmüller 2004-06-27 13:14:08 +00:00
parent a5bf3f142f
commit 1cd14974e1
6 changed files with 31 additions and 22 deletions

View File

@ -1,3 +1,12 @@
2004-06-27 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* 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 <lasgouttes@lyx.org> 2004-06-10 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* lyxfunc.C (getStatus): if lyx_gui::getStatus disables the * lyxfunc.C (getStatus): if lyx_gui::getStatus disables the

View File

@ -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()) { if (!next()) {
pimpl_->printError("file ended while scanning string token"); pimpl_->printError("file ended while scanning string token");

View File

@ -112,7 +112,7 @@ public:
/// ///
bool eatLine(); 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. /// Pushes a token list on a stack and replaces it with a new one.
void pushTable(keyword_item *, int); void pushTable(keyword_item *, int);

View File

@ -16,38 +16,38 @@
// this file should perhaps be split into even smaller parts // this file should perhaps be split into even smaller parts
char const * string_paragraph_separation[3] = { char const * const string_paragraph_separation[] = {
"indent", "skip", "" "indent", "skip", ""
}; };
char const * string_quotes_language[7] = { char const * const string_quotes_language[] = {
"english", "swedish", "german", "polish", "french", "danish", "" "english", "swedish", "german", "polish", "french", "danish", ""
}; };
char const * string_papersize[12] = { char const * const string_papersize[] = {
"Default", "Custom", "letterpaper", "executivepaper", "legalpaper", "Default", "Custom", "letterpaper", "executivepaper", "legalpaper",
"a3paper", "a4paper", "a5paper", "b3paper", "b4paper", "b5paper", "" "a3paper", "a4paper", "a5paper", "b3paper", "b4paper", "b5paper", ""
}; };
char const * string_paperpackages[4] = { char const * const string_paperpackages[] = {
"a4", "a4wide", "widemarginsa4", "" "none", "a4", "a4wide", "widemarginsa4", ""
}; };
char const * string_orientation[3] = { char const * const string_orientation[] = {
"portrait", "landscape", "" "portrait", "landscape", ""
}; };
char const * string_footnotekinds[8] = { char const * const string_footnotekinds[] = {
"footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", "" "footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", ""
}; };
char const * string_align[5] = { char const * const string_align[] = {
"block", "left", "right", "center", "" "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 // used all over. As it happens, that meant that these strings were included
// 27 times in the object file. (Asger) // 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", ""}; "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", ""}; "helvet", "avant", "newcent", "bookman", ""};

View File

@ -16,28 +16,28 @@
// this file should perhaps be split into even smaler parts // 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 // 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 // used all over. As it happens, that meant that these strings were included
// 27 times in the object file. (Asger) // 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 #endif