
AutoSave feature
----------------

Keys (Office.Common/Save)
       "Document/AutoSave",
       "Document/AutoSavePrompt",
       "Document/AutoSaveTimeIntervall",
    [ svtools/inc/saveopt.hxx (GetAutoSaveTime):
	-> sfx2/source/appl/appcfg.cxx (GetOptions)
	    -> SID_ATTR_AUTOSAVEMINUTE
		    only used for tools->options dialog ]

framework/framework/inc/services/autorecovery.hxx, line 178
    implements the functionality of AutoSave and AutoRecovery


AutoRecovery feature
--------------------

1> A user can change autorecovery time from default 15 to 1 min (though the spec
says minim is 5 min) tools->load/save -> general -> "Save autorecovery
information every ...". It helps to reduce this time :)

2> AutoRecovery works in a simple way. Whenever a file is opened in OOo a "node entry" (RecoveryList/recovery_item_NN) is created in the file 
~/.ooo-2.0-pre/user/registry/data/org/openoffice/Office/Recovery.xcu .
OR ~/.openoffice.org1.9.milestone/user/registry/data/org/openoffice/Office/Recovery.xcu

Now this Recovery.xcu has few interesting attributes:

- DocumentState : Contains some int values. Which tells the current state of document I have seen values 0,512,513 (Don't ask me what they are).putting my guesses 0=new document without any content, 512 = Document saved. 513 = modified document exsists.
  
- OriginalURL : If the file already exsists. This attribute is filled.

- TempURL : All the "modified files" are put up as a tempfile untill it is saved in some home-directory. typically this tempfile would be in "~/.openoffice.org1.9.milestone/user/backup" directory. 

If a document is closed properly the recovery_item_NN Entry is Removed. But if OOo closes abruptly : 
On next launch of OOo, depending upon the value of DocumentState a recovery dialog pops up and the file is recoverd from TempURL. The entries is removed from the Recovery.xcu file.

files to look:

 - framework/source/services/autorecovery.cxx
 - desktop/source/app/app.cxx:impl_callRecoveryUI()
 - svx/source/unodraw/Recoveryui.cxx:impl_doRecovery()
 - unotools/source/ucbhelper/tempfile.cxx

  
