]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
Forgot to save changed file ;)
[lyx.git] / src / paragraph.C
index ae7a8a0f04fb862204ad2c9aa1f961f1fcd9ba61..055f0d435982d8b0aa3515d5475e76aa1b3f6e18 100644 (file)
@@ -884,7 +884,8 @@ void Paragraph::breakParagraph(BufferParams const & bparams,
                tmp->setLabelWidthString(params().labelWidthString());
        }
 
-       if (size() > pos || !size() || flag == 2) {
+       bool isempty = textclasslist[bparams.textclass][layout()].keepempty;
+       if (!isempty && (size() > pos || !size() || flag == 2)) {
                tmp->layout(layout());
                tmp->params().align(params().align());
                tmp->setLabelWidthString(params().labelWidthString());
@@ -915,7 +916,7 @@ void Paragraph::breakParagraph(BufferParams const & bparams,
        }
 
        // just an idea of me
-       if (!pos) {
+       if (!isempty && !pos) {
                tmp->params().lineTop(params().lineTop());
                tmp->params().pagebreakTop(params().pagebreakTop());
                tmp->params().spaceTop(params().spaceTop());
@@ -1633,7 +1634,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                // Fully instantiated font
                LyXFont font = getFont(bparams, i);
 
-               LyXFont const last_font = running_font;
+               LyXFont const last_font = running_font;
 
                // Spaces at end of font change are simulated to be
                // outside font change, i.e. we write "\textXX{text} "
@@ -1647,7 +1648,10 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                }
 
                // We end font definition before blanks
-               if (font != running_font && open_font) {
+               if (open_font &&
+                   (font != running_font ||
+                    font.language() != running_font.language()))
+               {
                        column += running_font.latexWriteEndChanges(os,
                                                                    basefont,
                                                                    (i == main_body-1) ? basefont : font);
@@ -1665,7 +1669,10 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                }
 
                // Do we need to change font?
-               if (font != running_font && i != main_body - 1) {
+               if ((font != running_font ||
+                    font.language() != running_font.language()) &&
+                       i != main_body - 1)
+               {
                        column += font.latexWriteStartChanges(os, basefont,
                                                              last_font);
                        running_font = font;