From 7c25e68cf1779b82b82d26f0c6e93e286275a4b1 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 10 Feb 2000 17:06:12 +0000 Subject: [PATCH] Several small things accumulated while cvs was down git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@549 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 22 ++++++++++++++++++++++ lib/kbd/iso8859-1.cdef | 2 +- src/buffer.C | 28 ++++++++++++++-------------- src/lyx_gui.C | 2 +- src/lyxparagraph.h | 3 ++- src/lyxrc.C | 2 +- src/paragraph.C | 25 ++++++++++++++++++++----- src/text.C | 2 +- 8 files changed, 62 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19bd400f23..165ee0f5c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,29 @@ +2000-02-10 Jean-Marc Lasgouttes + + * src/buffer.C (pop_tag): revert to the previous implementation + (use a global variable for both loops). + + * lib/kbd/iso8859-1.cdef: fix definition for \"{e}. + + * src/lyxrc.C (LyXRC): change slightly default date format. + + * src/paragraph.C (TeXOnePar): Generate a correct latex file when + there is an English text with a footnote that starts with a Hebrew + paragraph, or vice versa. + (TeXFootnote): ditto. + + * src/text.C (LeftMargin): allow for negative values for + parindent. Thanks to Philip Lehman for testing + this out. + + * src/lyx_gui.C (create_forms): add iso88595 as a possible choice + for input encoding (cyrillic) + 2000-02-08 Jean-Marc Lasgouttes * src/lyx_gui.C (create_forms): make combo box taller (from Dekel Tsur). + * src/toolbar.C (set): ditto * src/insets/insetbib.C (create_form_citation_form): ditto diff --git a/lib/kbd/iso8859-1.cdef b/lib/kbd/iso8859-1.cdef index 39225540d8..963a0d36b0 100644 --- a/lib/kbd/iso8859-1.cdef +++ b/lib/kbd/iso8859-1.cdef @@ -80,7 +80,7 @@ 232 "\`{e}" 233 "\'{e}" 234 "\^{e}" -235 "\\"{e}" +235 "\"{e}" 236 "\`{\i}" 237 "\'{\i}" 238 "\^{\i}" diff --git a/src/buffer.C b/src/buffer.C index 5bf5c4851f..f6546a512e 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -2253,24 +2253,24 @@ void Buffer::push_tag(ostream & os, char const * tag, os << "<" << stack[i] << ">"; } - -// pop a tag from a style stack void Buffer::pop_tag(ostream & os, char const * tag, - int & pos, char stack[5][3]) + int & pos, char stack[5][3]) { - // pop all tags till specified one - for (int j = pos; (j >= 0) && (strcmp(stack[j], tag)); --j) - os << ""; + int j; - // closes the tag - os << ""; + // pop all tags till specified one + for (j = pos; (j >= 0) && (strcmp(stack[j], tag)); --j) + os << ""; - // push all tags, but the specified one - for (int i = 0; i <= pos; ++i) { - os << "<" << stack[i] << ">"; - strcpy(stack[i - 1], stack[i]); - } - --pos; + // closes the tag + os << ""; + + // push all tags, but the specified one + for (j = j + 1; j <= pos; ++j) { + os << "<" << stack[j] << ">"; + strcpy(stack[j-1], stack[j]); + } + --pos; } diff --git a/src/lyx_gui.C b/src/lyx_gui.C index be68c68d14..b93365bb82 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -440,7 +440,7 @@ void LyXGUI::create_forms() fl_addto_choice(fd_form_document->choice_inputenc, "default|latin1|latin2|latin5" - "|koi8-r|koi8-u|cp866|cp1251"); + "|koi8-r|koi8-u|cp866|cp1251|iso88595"); for (n = 0; tex_graphics[n][0]; ++n) { fl_addto_choice(fd_form_document->choice_postscript_driver, diff --git a/src/lyxparagraph.h b/src/lyxparagraph.h index c17c5e8372..75d49444ee 100644 --- a/src/lyxparagraph.h +++ b/src/lyxparagraph.h @@ -519,7 +519,8 @@ private: /// LyXParagraph * TeXFootnote(string & file, TexRow & texrow, string & foot, TexRow & foot_texrow, - int & foot_count); + int & foot_count, + LyXDirection par_direction); /// bool SimpleTeXOnePar(string & file, TexRow & texrow); /// diff --git a/src/lyxrc.C b/src/lyxrc.C index c3eb369387..f6228e98ff 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -329,7 +329,7 @@ LyXRC::LyXRC() rtl_support = false; defaultKeyBindings(); /// - date_insert_format = "%A, %e. %B %Y"; + date_insert_format = "%A, %e %B %Y"; } diff --git a/src/paragraph.C b/src/paragraph.C index 3378476339..1bd9a76d95 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1911,9 +1911,9 @@ LyXParagraph * LyXParagraph::TeXOnePar(string & file, TexRow & texrow, current_view->buffer()->params.getDocumentDirection(); if (direction != global_direction) { if (direction == LYX_DIR_LEFT_TO_RIGHT) - file += "{\\unsethebrew\n"; + file += "\\unsethebrew\n"; else - file += "{\\sethebrew\n"; + file += "\\sethebrew\n"; texrow.newline(); } @@ -1943,7 +1943,8 @@ LyXParagraph * LyXParagraph::TeXOnePar(string & file, TexRow & texrow, while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE && par->footnoteflag != footnoteflag) { par = par->TeXFootnote(file, texrow, - foot, foot_texrow, foot_count); + foot, foot_texrow, foot_count, + direction); par->SimpleTeXOnePar(file, texrow); par = par->next; } @@ -1974,7 +1975,10 @@ LyXParagraph * LyXParagraph::TeXOnePar(string & file, TexRow & texrow, } if (direction != global_direction) - file += "\\par}"; + if (direction == LYX_DIR_LEFT_TO_RIGHT) + file += "\\sethebrew"; + else + file += "\\unsethebrew"; switch (style.latextype) { case LATEX_ITEM_ENVIRONMENT: @@ -3559,7 +3563,8 @@ LyXParagraph * LyXParagraph::TeXEnvironment(string & file, TexRow & texrow, LyXParagraph * LyXParagraph::TeXFootnote(string & file, TexRow & texrow, string & foot, TexRow & foot_texrow, - int & foot_count) + int & foot_count, + LyXDirection par_direction) { lyxerr[Debug::LATEX] << "TeXFootnote... " << this << endl; if (footnoteflag == LyXParagraph::NO_FOOTNOTE) @@ -3679,6 +3684,16 @@ LyXParagraph * LyXParagraph::TeXFootnote(string & file, TexRow & texrow, } texrow.newline(); + + LyXDirection direction = getParDirection(); + if (direction != par_direction) { + if (direction == LYX_DIR_LEFT_TO_RIGHT) + file += "\\unsethebrew\n"; + else + file += "\\sethebrew\n"; + texrow.newline(); + } + if (footnotekind != LyXParagraph::FOOTNOTE || !footer_in_body) { // Process text for all floats except footnotes in body diff --git a/src/text.C b/src/text.C index 12b2c976c2..e6c18259c3 100644 --- a/src/text.C +++ b/src/text.C @@ -651,7 +651,7 @@ int LyXText::LeftMargin(Row const * row) const parameters->paragraph_separation == BufferParams::PARSEP_INDENT)) x += textclasslist.TextClass(parameters->textclass) - .defaultfont().stringWidth(parindent); + .defaultfont().signedStringWidth(parindent); else if (layout.labeltype == LABEL_BIBLIO) { // ale970405 Right width for bibitems -- 2.39.5