]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Safer temp file creation with regards to double slash.
[lyx.git] / src / TextMetrics.cpp
index d45f0deade7a9d48b30d34dde3b244864ba48239..9ca701d2d46786d5bbbfa7882be753b363a8818f 100644 (file)
@@ -1784,7 +1784,7 @@ int TextMetrics::leftMargin(int max_width,
                                l_margin = leftMargin(max_width, newpar);
                        }
                        if (tclass.isDefaultLayout(par.layout())
-                           || tclass.isEmptyLayout(par.layout())) {
+                           || tclass.isPlainLayout(par.layout())) {
                                if (pars[newpar].params().noindent())
                                        parindent.erase();
                                else
@@ -1906,7 +1906,7 @@ int TextMetrics::leftMargin(int max_width,
                    && par.isInset(pos)
                    && par.getInset(pos)->display())
                        && (!(tclass.isDefaultLayout(par.layout())
-                || tclass.isEmptyLayout(par.layout()))
+                || tclass.isPlainLayout(par.layout()))
                || buffer.params().paragraph_separation == BufferParams::ParagraphIndentSeparation)
            )
        {
@@ -2033,6 +2033,10 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) co
                        beg.pos() = row.sel_beg;
                        end.pit() = pit;
                        end.pos() = row.sel_end;
+                       if (end.pos() == row.endpos()) {
+                               // selection goes till the end of the row.
+                               end.boundary(true);
+                       }
                        drawRowSelection(pi, x, row, beg, end, beg_margin, end_margin);
                }