]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
1.) some white spaces removed
[lyx.git] / src / Text.cpp
index 1d8366930a6378ae10e63869291fa97ccc94eada..91b8a5f02a456ad58c5df78fd1736cfc0c0e8030 100644 (file)
@@ -757,6 +757,25 @@ void Text::selectWord(Cursor & cur, word_location loc)
 }
 
 
+void Text::selectAll(Cursor & cur)
+{
+       LASSERT(this == cur.text(), /**/);
+       if (cur.lastpos() == 0 && cur.lastpit() == 0)
+               return;
+       // If the cursor is at the beginning, make sure the cursor ends there
+       if (cur.pit() == 0 && cur.pos() == 0) {
+               setCursor(cur, cur.lastpit(), getPar(cur.lastpit()).size());
+               cur.resetAnchor();
+               setCursor(cur, 0, 0);           
+       } else {
+               setCursor(cur, 0, 0);
+               cur.resetAnchor();
+               setCursor(cur, cur.lastpit(), getPar(cur.lastpit()).size());
+       }
+       cur.setSelection();
+}
+
+
 // Select the word currently under the cursor when no
 // selection is currently set
 bool Text::selectWordWhenUnderCursor(Cursor & cur, word_location loc)
@@ -1340,6 +1359,7 @@ bool Text::read(Buffer const & buf, Lexer & lex,
                par.params().depth(depth);
                par.setFont(0, Font(inherit_font, 
                                    buf.params().language));
+               par.setPlainOrDefaultLayout(buf.params().documentClass());
                pars_.push_back(par);
        }