> Dekel> 1. Generate a correct latex file when
> Dekel> there is an English text with a footnote that starts with a
> Dekel> Hebrew paragraph, or vice versa 
> 
> I'm willing to apply this one, if you can provide a patch just for
> that (I don't want to apply it wrongly).
> 
Here is the patch
Index: src/lyxparagraph.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxparagraph.h,v
retrieving revision 1.13
diff -u -p -r1.13 lyxparagraph.h
--- src/lyxparagraph.h  2000/02/04 09:38:30     1.13
+++ src/lyxparagraph.h  2000/02/08 20:31:21
@@ -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);
        ///
Index: src/paragraph.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.33
diff -u -p -r1.33 paragraph.C
--- src/paragraph.C     2000/02/07 20:17:03     1.33
+++ src/paragraph.C     2000/02/08 20:32:24
@@ -1911,9 +1911,9 @@ LyXParagraph * LyXParagraph::TeXOnePar(s
                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(s
        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(s
        }
 
        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::TeXEnvironm
 
 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)
@@ -3678,6 +3683,15 @@ LyXParagraph * LyXParagraph::TeXFootnote
                break;
        }
        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) {

Reply via email to