Skip to content

Commit

Permalink
Didn't like yesterday's fix, I changed it so that zero-length selections
Browse files Browse the repository at this point in the history
are allowed.  Warning: untested on WIN32 (although it seems likely that
it will work).


git-svn-id: file:///fltk/svn/fltk/trunk@349 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
spitzak committed Mar 2, 1999
1 parent 32291ad commit 4df7511
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions src/Fl_Input_.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Input_.cxx,v 1.19 1999/03/01 03:44:30 bill Exp $"
// "$Id: Fl_Input_.cxx,v 1.20 1999/03/02 07:03:14 bill Exp $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -436,10 +436,7 @@ int Fl_Input_::copy() {
} else {
e = position(); b = mark();
}
if (type()!=FL_SECRET_INPUT)
Fl::selection(*this, value()+b, e-b);
else
Fl::selection(*this, "*", 1);
Fl::selection(*this, value()+b, (type()!=FL_SECRET_INPUT) ? e-b : 0);
return 1;
}
return 0;
Expand Down Expand Up @@ -736,5 +733,5 @@ Fl_Input_::~Fl_Input_() {
}

//
// End of "$Id: Fl_Input_.cxx,v 1.19 1999/03/01 03:44:30 bill Exp $".
// End of "$Id: Fl_Input_.cxx,v 1.20 1999/03/02 07:03:14 bill Exp $".
//
6 changes: 3 additions & 3 deletions src/Fl_cutpaste.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_cutpaste.cxx,v 1.5 1999/01/07 19:17:31 mike Exp $"
// "$Id: Fl_cutpaste.cxx,v 1.6 1999/03/02 07:03:15 bill Exp $"
//
// Cut/paste code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -124,7 +124,7 @@ void Fl::paste(Fl_Widget &receiver) {

// call this when you create a selection:
void Fl::selection(Fl_Widget &owner, const char *stuff, int len) {
if (!stuff || len<=0) return;
if (!stuff || len<0) return;
if (len+1 > selection_buffer_length) {
delete[] selection_buffer;
selection_buffer = new char[len+100];
Expand All @@ -149,5 +149,5 @@ void Fl::selection(Fl_Widget &owner, const char *stuff, int len) {
#endif

//
// End of "$Id: Fl_cutpaste.cxx,v 1.5 1999/01/07 19:17:31 mike Exp $".
// End of "$Id: Fl_cutpaste.cxx,v 1.6 1999/03/02 07:03:15 bill Exp $".
//
6 changes: 3 additions & 3 deletions src/Fl_cutpaste_win32.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_cutpaste_win32.cxx,v 1.4 1999/01/07 19:17:31 mike Exp $"
// "$Id: Fl_cutpaste_win32.cxx,v 1.5 1999/03/02 07:03:15 bill Exp $"
//
// WIN32 cut/paste for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -76,7 +76,7 @@ static int selection_xevent_handler(int) {

// call this when you create a selection:
void Fl::selection(Fl_Widget &owner, const char *stuff, int len) {
if (!stuff || len<=0) return;
if (!stuff || len<0) return;
if (len+1 > selection_buffer_length) {
delete[] selection_buffer;
selection_buffer = new char[len+100];
Expand Down Expand Up @@ -129,5 +129,5 @@ void Fl::paste(Fl_Widget &receiver) {
}

//
// End of "$Id: Fl_cutpaste_win32.cxx,v 1.4 1999/01/07 19:17:31 mike Exp $".
// End of "$Id: Fl_cutpaste_win32.cxx,v 1.5 1999/03/02 07:03:15 bill Exp $".
//

0 comments on commit 4df7511

Please sign in to comment.