+ ShowInsetCursor(bv);
+}
+
+// this is for the simple cut and paste mechanism
+// this then should be a global stuff so that cut'n'paste can work in and
+// and outside text-insets
+static LyXParagraph * simple_cut_buffer = 0;
+// static char simple_cut_buffer_textclass = 0;
+
+// for now here this should be in another Cut&Paste Class!
+//
+static void DeleteSimpleCutBuffer()
+{
+ if (!simple_cut_buffer)
+ return;
+ LyXParagraph * tmppar;
+
+ while (simple_cut_buffer) {
+ tmppar = simple_cut_buffer;
+ simple_cut_buffer = simple_cut_buffer->next;
+ delete tmppar;
+ }
+ simple_cut_buffer = 0;
+}
+
+bool InsetText::cutSelection()
+{
+ if (!hasSelection())
+ return false;
+ DeleteSimpleCutBuffer();
+
+ // only within one paragraph
+ simple_cut_buffer = new LyXParagraph;
+ LyXParagraph::size_type i = selection_start;
+ for (; i < selection_end; ++i) {
+ par->CopyIntoMinibuffer(selection_start);
+ par->Erase(selection_start);
+ simple_cut_buffer->InsertFromMinibuffer(simple_cut_buffer->Last());
+ }
+ return true;
+}
+
+bool InsetText::copySelection()
+{
+ if (!hasSelection())
+ return false;
+ DeleteSimpleCutBuffer();
+
+ // only within one paragraph
+ simple_cut_buffer = new LyXParagraph;
+ LyXParagraph::size_type i = selection_start;
+ for (; i < selection_end; ++i) {
+ par->CopyIntoMinibuffer(i);
+ simple_cut_buffer->InsertFromMinibuffer(simple_cut_buffer->Last());
+ }
+ return true;
+}
+
+bool InsetText::pasteSelection()
+{
+ if (!simple_cut_buffer)
+ return false;
+
+ LyXParagraph * tmppar = simple_cut_buffer->Clone();
+
+ while (simple_cut_buffer->size()) {
+ simple_cut_buffer->CutIntoMinibuffer(0);
+ simple_cut_buffer->Erase(0);
+ par->InsertFromMinibuffer(actpos);
+ ++actpos;
+ }
+ delete simple_cut_buffer;
+ simple_cut_buffer = tmppar;
+ return true;