Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333812 - CVS Commit dialog uses wrong comment after spelling quick fix
Summary: CVS Commit dialog uses wrong comment after spelling quick fix
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-09 12:33 EST by Markus Keller CLA
Modified: 2011-01-25 11:35 EST (History)
1 user (show)

See Also:


Attachments
Fix v01 (2.00 KB, patch)
2011-01-10 06:26 EST, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (52.85 KB, application/octet-stream)
2011-01-10 06:26 EST, Tomasz Zarna CLA
no flags Details
Fix v02 (2.00 KB, patch)
2011-01-10 06:59 EST, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-01-09 12:33:40 EST
N20101218-2000

The CVS Commit dialog uses a wrong comment after I've applied a spelling quick fix.
Steps:
- open Commit dialog
- type "Changed startegy."
- put caret into "startegy"
- press Ctrl+1, Enter
=> "strategy" is correctly spelled in the dialog, but when I click the Finish button, the version with the spelling error is committed.
Comment 1 Tomasz Zarna CLA 2011-01-10 06:26:14 EST
Created attachment 186375 [details]
Fix v01

Quick fixes are not caught by ModifyListener added to StyledText widget from  dialog's SourceViewer[1]. I guess a listener on underlying document changes may help here. To limit the event traffic I added a check to fire the property change event only when new text differs from old one.

[1] org.eclipse.team.internal.ccvs.ui.CommitCommentArea, fTextField.addModifyListener(this)
Comment 2 Tomasz Zarna CLA 2011-01-10 06:26:17 EST
Created attachment 186376 [details]
mylyn/context/zip
Comment 3 Dani Megert CLA 2011-01-10 06:36:37 EST
The patch looks good. Only minor tweaks: I would use 'document' directly instead of calling getDocument() and you need to check that fText can't be null since you now use !old.equals(...).
Comment 4 Tomasz Zarna CLA 2011-01-10 06:59:39 EST
Created attachment 186378 [details]
Fix v02

Updated with Dani's tips.
Comment 5 Tomasz Zarna CLA 2011-01-10 07:01:40 EST
Fixed in HEAD, available in builds >N20110109-2000.
Comment 6 Dani Megert CLA 2011-01-20 05:07:03 EST
NOTE: The fixed caused a regression (see bug 334756 for details).
Comment 7 Tomasz Zarna CLA 2011-01-25 11:35:32 EST
Verified in I20110124-1800.