Issue 123812 - File - Versions - Always save a version on closing is not working
Summary: File - Versions - Always save a version on closing is not working
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.1.1
Assignee: Oliver-Rainer Wittmann
QA Contact:
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-12-07 16:20 UTC by Andrea Pescetti
Modified: 2017-05-20 10:35 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.0.1
Developer Difficulty: ---
jsc: 4.1.1_release_blocker+


Attachments
Patch to add FailOnWarning as valid parameter (1.11 KB, patch)
2014-01-26 16:23 UTC, hanya
orw: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Andrea Pescetti 2013-12-07 16:20:09 UTC
This is a regression with respect to at least 3.3.0; reported on the users list by user LG.

1. Start Writer, new document, write "aaa", save as test.odt
2. File - Versions, click "Save new version" (and enter a comment), then enable "Always save a version on closing". Close the dialog.
3. Write "bbb", close OpenOffice, confirm you want to save changes.
4. Reopen the file.

Expected behavior: changes are saved and a new version is created (so File-Versions shows two versions: the manually saved one and the one automatically created on closing).

Actual behavior: changes are saved, but a new version is NOT created. File-Versions only shows the manually saved version.
Comment 1 Edwin Sharp 2013-12-07 19:43:43 UTC
Confirmed with
AOO410m1(Build:9750)  -  Rev. 1548193
2013-12-07_04:10:48 - Rev. 1548790
Debian
Comment 2 Oliver Brinzing 2013-12-09 08:59:32 UTC
.
Comment 3 Oliver-Rainer Wittmann 2014-01-17 09:11:49 UTC
I was able to reproduce the described defect on Windows 7 using OOo 3.2.0 and OOo 3.3.0. It worked in OOo 2.2.0.
Comment 4 hanya 2014-01-26 16:23:23 UTC
Created attachment 82403 [details]
Patch to add FailOnWarning as valid parameter

If "Always save a version on closing" is checked on Versions dialog, 
SID_SAVEDOC request is made with SID_DOCINFO_COMMENTS and 
SID_FAIL_ON_WARNING in SfxObjectShell::PrepareClose method.
The SID_SAVEDOC request is processed in SfxObjectShell::ExecFile_Impl method and 
GUIStoreModel method on SfxStoringHelper method is called.
SfxBaseModel::storeSelf method is called to store into the file but 
I get IllegalArgumentException and store method is called to store alternatively. 
So, no original arguments for saveas command lost.
The exception is raised because FailOnWarning parameter is not accepted in storeSelf method.

Storing a version from Versions dialog does not specify FailOnWarning parameter, 
the same problem does not happen with it.
Comment 5 Andrea Pescetti 2014-03-16 20:39:21 UTC
Thanks hanya, I applied (in my local copy) the patch to the current trunk. It works but not in all cases.

Namely:
- Manual "Save new version" button -> still works
- Closing with unsaved changes -> The "Do you want to save your changes?" dialog appears, a new version is saved if I confirm (this is thus fixed by the patch)
- Closing after making changes and saving them with CTRL+S -> The "Do you want to save your changes?" dialog does not appear (and this is normal), but I would expect a new version to be saved here too (it doesn't in 4.0.1 and it still doesn't with your patch)
Comment 6 hanya 2014-05-21 15:15:54 UTC
(In reply to Andrea Pescetti from comment #5)
> - Closing after making changes and saving them with CTRL+S -> The "Do you
> want to save your changes?" dialog does not appear (and this is normal), but
> I would expect a new version to be saved here too (it doesn't in 4.0.1 and
> it still doesn't with your patch)
The option on the Versions dialog is creating new version on closing. And its help 
section says: 
> Always save version when closing
> If you have made changes to your document, OpenOffice automatically saves a new 
> version when you close the document.
> If you save the document manually, do not change the document after saving, 
> and then close, no new version will be created.
It seems the behavior after the patch seems match with the description. 
But I see what you want to see. It would be an enhancement.
Comment 7 oooforum (fr) 2014-05-23 13:50:41 UTC
(In reply to Andrea Pescetti from comment #5)
> - Closing after making changes and saving them with CTRL+S -> The "Do you
> want to save your changes?" dialog does not appear (and this is normal), but
> I would expect a new version to be saved here too (it doesn't in 4.0.1 and
> it still doesn't with your patch)
Agree with hanya, this should be an enhancement.
In the meantime, is it possible to integrate this patch for the next build?
Comment 8 Andrea Pescetti 2014-07-06 11:49:42 UTC
Nominating as 4.1.1 release blocker: simple patch by hanya available, works for me, fixes a regression. Should be reviewed and applied both to trunk and AOO410 for OpenOffice 4.1.1.
Comment 9 Andrea Pescetti 2014-07-06 11:50:09 UTC
Nominating as 4.1.1 release blocker: simple patch by hanya available, works for me, fixes a regression. Should be reviewed and applied both to trunk and AOO410 for OpenOffice 4.1.1.
Comment 10 Oliver-Rainer Wittmann 2014-07-07 06:51:35 UTC
taking over to review the patch.
Comment 11 Oliver-Rainer Wittmann 2014-07-07 08:50:43 UTC
Comment on attachment 82403 [details]
Patch to add FailOnWarning as valid parameter

patch looks fine.

@hanya: Do you want to commit the patch by yourself?
Comment 12 Oliver-Rainer Wittmann 2014-07-07 08:51:34 UTC
I have no objections to include the fix also in our planned 4.1.1 release.
Comment 13 jsc 2014-07-07 08:55:38 UTC
grant showstopper flag
Comment 14 jsc 2014-07-07 08:55:53 UTC
set target
Comment 15 Oliver-Rainer Wittmann 2014-07-07 08:59:43 UTC
As Jürgen grants the release blocker status.
As he wants to prepare new snapshots today I am taking the liberty to integrate the patch into trunk and branch AOO410
Comment 16 SVN Robot 2014-07-07 09:04:39 UTC
"orw" committed SVN revision 1608376 into trunk:
123812: <SfxBaseModel::storeSelf(..)> - accept arguement FailOnWarning in ord...
Comment 17 SVN Robot 2014-07-07 09:17:53 UTC
"orw" committed SVN revision 1608384 into branches/AOO410:
123812: <SfxBaseModel::storeSelf(..)> - accept arguement FailOnWarning in ord...
Comment 18 Oliver-Rainer Wittmann 2014-07-07 09:18:59 UTC
fixed on trunk and on branch AOO410
Comment 19 fanyuzhen 2014-07-18 09:00:25 UTC
It's verified fixed in build AOO411m2(Build:9771)  -  Rev. 1608452
2014-07-07 15:29:02 (Mon, 07 Jul 2014)
Comment 20 Pedro 2014-08-03 19:47:41 UTC
This bug is NOT fixed in RC1. If you reopen each Version you will notice that the manually saved Version 1 contains the same as Version 2 (i.e. Aaa bbb) when it should contain only aaa.

Opening a Version does NOT open in Read Only mode.
Comment 21 Ariel Constenla-Haile 2014-08-03 20:12:18 UTC
Strange, on trunk it's working fine
AOO420m1(Build:9800)  -  Rev. 1614365
Comment 22 Ariel Constenla-Haile 2014-08-04 00:46:41 UTC
Verified fixed on AOO411m4(Build:9774)  -  Rev. 1614049
2014-07-28 17:55 - Linux x86_64

(In reply to Pedro from comment #20)
> This bug is NOT fixed in RC1. If you reopen each Version you will notice
> that the manually saved Version 1 contains the same as Version 2 (i.e. Aaa
> bbb) when it should contain only aaa.

I cannot reproduce this.

> Opening a Version does NOT open in Read Only mode.

Neither this, the version os opened read-ony.
Comment 23 Pedro 2014-08-06 06:23:23 UTC
This bug is fixed also under Windows. A new Version is indeed created on close.

Opening a new bug report with described problem (which makes Versions useless under Win7 x64)