Changeset 10035


Ignore:
Timestamp:
01/02/10 01:52:06 (2 years ago)
Author:
Sewi
Message:

Revert r10023

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/lib/Padre/Wx/Editor.pm

    r10023 r10035  
    813813sub on_smart_highlight_begin { 
    814814    my ( $self, $event ) = @_; 
     815 
    815816    my $selection        = $self->GetSelectedText; 
    816      
    817     $self->put_text_to_clipboard($selection, 1); 
    818817    my $selection_length = length $selection; 
    819818    return if $selection_length == 0; 
     
    855854        } 
    856855    } 
    857      
     856 
    858857} 
    859858 
     
    871870    if ( Padre::Constant::WXGTK and defined $text and $text ne '' ) { 
    872871 
    873          
    874         $self->put_text_to_clipboard($text,1); 
    875  
    876          
     872        # Only on X11 based platforms 
     873        #       Wx::wxTheClipboard->UsePrimarySelection(1); 
     874        $self->put_text_to_clipboard($text); 
     875 
     876        #       Wx::wxTheClipboard->UsePrimarySelection(0); 
    877877    } 
    878878 
     
    892892    # It seems that another event is doing something but not within this module. 
    893893    # Please look at ticket #390 for details! 
    894     Wx::wxTheClipboard->UsePrimarySelection(1); 
    895     if (Padre::Constant::WIN32) 
    896     { 
    897         Padre::Current->editor->Paste; 
    898     } 
    899      
     894 
     895    Padre::Current->editor->Paste; 
     896 
    900897    my $doc = $self->{Document}; 
    901898    if ( $doc->can('event_on_middle_up') ) { 
    902899        $doc->event_on_middle_up( $self, $event ); 
    903900    } 
    904     Wx::wxTheClipboard->UsePrimarySelection(0); 
     901 
    905902    $event->Skip; 
    906903    return; 
    907904} 
     905 
    908906# Manipulate the window manager selection buffer when editor looses focus 
    909907sub on_kill_focus { 
     
    10611059sub Paste { 
    10621060    my $self = shift; 
    1063      
     1061 
     1062    # Workaround for Copy/Paste bug ticket #390 
    10641063    my $text = $self->get_text_from_clipboard; 
    1065      
     1064 
    10661065    if ($text) { 
    10671066 
     
    11261125} 
    11271126 
    1128 # put_text_to_clipboard 
    1129 # $self->put_text_to_clipboard($text, $clipboard_Number ) 
    1130 # where X11 based display systems  
    1131 # clipboard number is either the GTK clipboard or the X11 
    1132 # clipboard.  Clipboard 1 is used for normal X11 copy onselect and 
    1133 # paste on middle button. Has no affect on windows. 
    1134 # Puts Text on the clipboard 
    1135  
    11361127sub put_text_to_clipboard { 
    1137     my ( $self, $text , $clipboard) = @_; 
     1128    my ( $self, $text ) = @_; 
    11381129    @_ = (); # Feeble attempt to kill Scalars Leaked 
    1139      
    1140      
    1141     if (!defined($clipboard)){ 
    1142         $clipboard = 0 ; 
    1143     } 
    1144      
    1145     if ($text eq ''){return;} 
     1130 
     1131    return if $text eq ''; 
     1132 
    11461133    # Backup last clipboard value: 
    11471134    $self->{Clipboard_Old} = $self->get_text_from_clipboard; 
    1148      
    1149      
    1150      
     1135 
     1136    #         if $self->{Clipboard_Old} ne $self->get_text_from_clipboard; 
     1137 
    11511138    Wx::wxTheClipboard->Open; 
    1152     Wx::wxTheClipboard->UsePrimarySelection($clipboard); 
    11531139    Wx::wxTheClipboard->SetData( Wx::TextDataObject->new($text) ); 
    11541140    Wx::wxTheClipboard->Close; 
    1155      
     1141 
    11561142    return; 
    11571143} 
     
    11601146 
    11611147    my $self = shift; 
    1162      
     1148 
    11631149    my $text = ''; 
    11641150    Wx::wxTheClipboard->Open; 
Note: See TracChangeset for help on using the changeset viewer.