Bug 2854 - Compare: Save code path problematic (1GJYGAX)
Summary: Compare: Save code path problematic (1GJYGAX)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Andre Weinand CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 197 247
  Show dependency tree
 
Reported: 2001-10-10 22:44 EDT by James Moody CLA
Modified: 2002-05-14 19:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Moody CLA 2001-10-10 22:44:45 EDT
See related PRs:
		1GJW3AI: ITPVCM:WIN2000 - Compare with Stream Contents does not 
prompt for save changes.
		1GFMRMH: ITPVCM:ALL - Project compare: edited files aren't 
marked

	We are having problems implementing prompt-for-save-on-close 
functionality in our compare editor.

	Doing this properly seems impossible given the current compare 
framework. If we get rid of our implementation
	of VCMCompareEditorInput.isSaveNeeded(), then the when we close the 
editor we get the following behaviour:

	1. Editor says changes exist, do you want to save? (y/n/cancel)
	2. User says "yes"
	3. CompareEditor.doSave() first sends setInput(null) to each pane, then 
sends save() to the CompareEditorInput.
	BUT
	setInput(null) sent to each pane may cause additional prompting 
(changes exist, do you want to save? (y/n/cancel))
	because, in ContentMergeViewer.inputChanged(), if fConfirmSave is true, 
the pane prompts for saving changes.

	We have no control over fConfirmSave, as it is a global setting. 
(Anyway, even if we did, we wouldn't turn it off
	because it is needed for the case that the user clicks on a different 
item in the tree).

	Why does this not happen in the normal (non-VCM) compare case? Because 
we enable the save actions in
	our editors, and in ContentMergeViewer.inputChanged(), the prompting 
only happens if the save actions are
	enabled.

	This code path needs to be fixed before we can prompt in this way.

NOTES:
Comment 1 DJ Houghton CLA 2001-10-29 19:21:36 EST
PRODUCT VERSION:

	135

Comment 2 Andre Weinand CLA 2002-01-25 13:02:34 EST
fixed for > 20020124.

It should be possible to remove the implementation of 
VCMCompareEditorInput.isSaveNeeded().

When closing the editor the standard alert appears. If this alert is not 
dismissed all changes in the editor panes are saved, but their Save Alerts are 
not shown. I introduced an new method ContentMergeViewer.setConfirmSave
(boolean).