]> git.lyx.org Git - lyx.git/blobdiff - src/textcursor.C
Remove the inset and view member functions from PreviewedInset.
[lyx.git] / src / textcursor.C
index c448aa39c0729f317bf0d71ba3ce4a63750f8164..2b7238ccc67b9139809441f32c05c4be0950e485 100644 (file)
 
 #include "textcursor.h"
 #include "paragraph.h"
+#include "ParagraphList_fwd.h"
+
+#include <string>
+
+using std::string;
 
 
 void TextCursor::setSelection()
@@ -61,33 +66,3 @@ void TextCursor::clearSelection()
        selection.cursor = cursor;
 }
 
-
-string const TextCursor::selectionAsString(Buffer const & buffer,
-                                       bool label) const
-{
-       if (!selection.set())
-               return string();
-
-       // should be const ...
-       ParagraphList::iterator startpit = selection.start.par();
-       ParagraphList::iterator endpit = selection.end.par();
-       size_t const startpos = selection.start.pos();
-       size_t const endpos = selection.end.pos();
-
-       if (startpit == endpit)
-               return startpit->asString(buffer, startpos, endpos, label);
-
-       // First paragraph in selection
-       string result =
-               startpit->asString(buffer, startpos, startpit->size(), label) + "\n\n";
-
-       // The paragraphs in between (if any)
-       ParagraphList::iterator pit = startpit;
-       for (++pit; pit != endpit; ++pit)
-               result += pit->asString(buffer, 0, pit->size(), label) + "\n\n";
-
-       // Last paragraph in selection
-       result += endpit->asString(buffer, 0, endpos, label);
-
-       return result;
-}