]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
Fix wrongly copy-pasted entries in SpellcheckerUi.ui
[lyx.git] / src / insets / InsetTabular.cpp
index 8c9824161ecb2cb5d91afe9a71af35bbab611df2..5eb59e54d2513c8100e86b0ba3de223c4ec22f7d 100644 (file)
@@ -2563,6 +2563,10 @@ void Tabular::latex(otexstream & os, OutputParams const & runparams) const
        //+                      first the opening preamble                    +
        //+---------------------------------------------------------------------
 
+       os << safebreakln;
+       if (runparams.lastid != -1)
+               os.texrow().start(runparams.lastid, runparams.lastpos);
+
        if (rotate)
                os << "\\begin{sideways}\n";
 
@@ -2883,9 +2887,9 @@ docstring Tabular::xhtmlRow(XHTMLStream & xs, row_type row,
                if (isMultiColumn(cell))
                        attr << " colspan='" << columnSpan(cell) << "'";
 
-               xs << html::StartTag(celltag, attr.str());
+               xs << html::StartTag(celltag, attr.str()) << html::CR();
                ret += cellInset(cell)->xhtml(xs, runparams);
-               xs << html::EndTag(celltag);
+               xs << html::EndTag(celltag) << html::CR();
                ++cell;
        }
        xs << html::EndTag("tr");
@@ -2911,17 +2915,19 @@ docstring Tabular::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
                        align = "right";
                        break;
                }
-               xs << html::StartTag("div", "class='longtable' style='text-align: " + align + ";'");
+               xs << html::StartTag("div", "class='longtable' style='text-align: " + align + ";'")
+                  << html::CR();
                if (haveLTCaption()) {
-                       xs << html::StartTag("div", "class='longtable-caption' style='text-align: " + align + ";'");
+                       xs << html::StartTag("div", "class='longtable-caption' style='text-align: " + align + ";'")
+                          << html::CR();
                        for (row_type r = 0; r < nrows(); ++r)
                                if (row_info[r].caption)
                                        ret += xhtmlRow(xs, r, runparams);
-                       xs << html::EndTag("div");
+                       xs << html::EndTag("div") << html::CR();
                }
        }
 
-       xs << html::StartTag("table");
+       xs << html::StartTag("table") << html::CR();
 
        // output header info
        bool const havefirsthead = haveLTFirstHead();
@@ -2930,40 +2936,42 @@ docstring Tabular::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
        // in XHTML. this test accomplishes that.
        bool const havehead = !havefirsthead && haveLTHead();
        if (havehead || havefirsthead) {
-               xs << html::StartTag("thead");
+               xs << html::StartTag("thead") << html::CR();
                for (row_type r = 0; r < nrows(); ++r) {
                        if ((havefirsthead && row_info[r].endfirsthead)
                            || (havehead && row_info[r].endhead)) {
                                ret += xhtmlRow(xs, r, runparams, true);
                        }
                }
-               xs << html::EndTag("thead");
+               xs << html::EndTag("thead") << html::CR();
        }
        // output footer info
        bool const havelastfoot = haveLTLastFoot();
        // as before.
        bool const havefoot = !havelastfoot && haveLTFoot();
        if (havefoot || havelastfoot) {
-               xs << html::StartTag("tfoot");
+               xs << html::StartTag("tfoot") << html::CR();
                for (row_type r = 0; r < nrows(); ++r) {
                        if ((havelastfoot && row_info[r].endlastfoot)
                            || (havefoot && row_info[r].endfoot)) {
                                ret += xhtmlRow(xs, r, runparams);
                        }
                }
-               xs << html::EndTag("tfoot");
+               xs << html::EndTag("tfoot") << html::CR();
        }
 
-       xs << html::StartTag("tbody");
+       xs << html::StartTag("tbody") << html::CR();
        for (row_type r = 0; r < nrows(); ++r) {
                if (isValidRow(r)) {
                        ret += xhtmlRow(xs, r, runparams);
                }
        }
        xs << html::EndTag("tbody")
-          << html::EndTag("table");
+          << html::CR()
+          << html::EndTag("table")
+          << html::CR();
        if (is_long_tabular)
-               xs << html::EndTag("div");
+               xs << html::EndTag("div") << html::CR();
        return ret;
 }
 
@@ -4001,6 +4009,8 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cmd = FuncRequest(finish_lfun);
                else
                        cur.dispatched();
+
+               cur.screenUpdateFlags(Update::Force | Update::FitCursor);
                break;
 
        }
@@ -4037,6 +4047,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.setCurrentFont();
                        return;
                }
+               cur.screenUpdateFlags(Update::FitCursor);
                break;
 
        case LFUN_UP_SELECT:
@@ -4070,6 +4081,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cur.setCurrentFont();
                        return;
                }
+               cur.screenUpdateFlags(Update::FitCursor);
                break;
 
 //     case LFUN_SCREEN_DOWN: {