Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333812

Summary: CVS Commit dialog uses wrong comment after spelling quick fix
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: CVSAssignee: Tomasz Zarna <tomasz.zarna>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert
Version: 3.7   
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Fix v01
none
mylyn/context/zip
none
Fix v02 none

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.