Menu

#771 Find and Replace on Selected doesn't work with Search

closed-fixed
None
5
2007-06-22
2007-06-14
No

If you attempt to do a Database Find and Replace on (1)"selection" or (2)"shown" when using the Toolbar Search, the search is deleted before the Find and Replace is done, resulting in doing the find and replace on no publications in case (1) and doing the find and replace all publications in case (2).

Expected behavior: find and replace on selection or publications shown.

Discussion

  • Christiaan Hofman

    • assigned_to: nobody --> amaxwell
     
  • Christiaan Hofman

    Logged In: YES
    user_id=1162009
    Originator: NO

    Is this due to the changes of the search? That is, did we (or should we) retain the selection when we remove the search?

     
  • Christiaan Hofman

    Logged In: YES
    user_id=1162009
    Originator: NO

    OK, I figured this one out. It's due to another problem: the selection is lost whenever the table columns change. I've fixed this now.

    I'm actually not sure if Replace All should remove the search as it does now. It confuses the "shown" option. Though I think the point of doing that was that the replace action can remove an item that was changed from the view, which is confusing. On the other hand, when you've got a smart or field group selected you can have the same problem.

     
  • Christiaan Hofman

    • status: open --> open-fixed
     
  • Adam Maxwell

    Adam Maxwell - 2007-06-16

    Logged In: YES
    user_id=732757
    Originator: NO

    I have a couple of guesses as to why that code is in there; I recall adding it, and the comment is mine, but it no longer makes sense :).

    One possibility (based on the comment on clearFrontDocumentQuickSearch) is that the original implementation of Replace All operated on -[BibDocument publications] instead of just the shown pubs. In that case, the semantics would have changed when we added groups, if not before. Another possibility from a quick glance at svn history is that the original code used row indexes, and this would have messed things up (I think it used the -selectedPubEnumerator, and mutating the rows would have been bad).

    It no longer seems necessary, so as long as things work correctly without it, I think the clearFrontDocumentQuickSearch method should be removed.

     
  • Adam Maxwell

    Adam Maxwell - 2007-06-22
    • status: open-fixed --> closed-fixed
     
  • Adam Maxwell

    Adam Maxwell - 2007-06-22

    Logged In: YES
    user_id=732757
    Originator: NO

    fixed in 1.3.6

     

Log in to post a comment.