Ticket #230: libtool_fix_1_of_1_rev_c46e9ab3000c_Issue__230__use___pasteOrReplace__to_implement_paste_menu_item.patch

File libtool_fix_1_of_1_rev_c46e9ab3000c_Issue__230__use___pasteOrReplace__to_implement_paste_menu_item.patch, 1.4 KB (added by jan vrany, 6 years ago)
  • MultiViewToolApplication.st

    # HG changeset patch
    # User Jan Vrany <jan.vrany@fit.cvut.cz>
    # Date 1531918172 -7200
    #      Wed Jul 18 14:49:32 2018 +0200
    # Branch jv
    # Node ID c46e9ab3000c4bebab375675088574ef91a5e542
    # Parent  eef85526ca1f8bb222aa43ad99726d7d02918844
    Issue #230: use `#pasteOrReplace` to implement paste menu item
    
    ...rather than plain `#paste` with pastes text regardless of any
    possible selection. `#paste` should be considered as private to
    `EditTextView`.      .
    
    The reason why it worked everywhere else was rather subtle.
    Everywhere else the "paste" shortcut was handled by edit view itself
    and hence it ended up in `#pasterOrReplace`. `WorkspaceApplication` however
    contains a 'paste' menu item with shortcut assigned so the shortcut
    processing machinery handled the 'paste; shortcut as menu item
    pick, thus calling (wrong) `#paste`.
    
    https://swing.fit.cvut.cz/projects/stx-jv/ticket/230
    
    diff -r eef85526ca1f -r c46e9ab3000c MultiViewToolApplication.st
    a b  
    12491249    |v|
    12501250
    12511251    (v := self selectedWorkspacesTextView) notNil ifTrue:[
    1252         v paste
     1252        v pasteOrReplace
    12531253    ]
     1254
     1255    "Modified: / 18-07-2018 / 14:35:49 / jv"
    12541256!
    12551257
    12561258paste:aString
     
    14291431
    14301432version_CVS
    14311433    ^ '$Header$'
     1434!
     1435
     1436version_HG
     1437
     1438    ^ '$Changeset: <not expanded> $'
    14321439! !
    14331440