Bug 37775 - Recent Documents not updated by Save & Save As...
Summary: Recent Documents not updated by Save & Save As...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
3.3.2 release
Hardware: All All
: medium normal
Assignee: Muhammad Haggag
QA Contact:
URL:
Whiteboard: target:3.6.0
Keywords: easyHack, topicUI
Depends on:
Blocks:
 
Reported: 2011-05-30 22:28 UTC by LeMoyne Castle
Modified: 2015-12-16 05:33 UTC (History)
6 users (show)

See Also:


Attachments
Proposed patch. (9.65 KB, patch)
2012-02-08 05:00 UTC, Muhammad Haggag
Details
Alternative patch (based on review feedback). (9.94 KB, patch)
2012-02-14 00:56 UTC, Muhammad Haggag
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LeMoyne Castle 2011-05-30 22:28:13 UTC
Tested on Linux 10.04 with current master and 3.3.2 release (28 May 2011). 

Open Writer, Calc or ...
Create and save new document (does Save As...) 
Check Recent Documents (not there) 
Modify document and Save under same or new name.
Check Recent Documents (still not there) 
Close app and reopen
Recent Documents shows the second version but not the first.

It appears that Recent is updated at close of app - after restart of app the Recent Documents will contain files open when app is closed but not any previous files that have been renamed with Save/Save As...
This may technically be an enhancement but users will expect the last saved doc on the top of the Recent Documents as in "What did I call that thing? I know I'll check Recent" -> urgh.
Tested only on Linux but don't anticipate any OS dependence here. 
Tested only in Writer and Calc but I *think* this is a generic missing. 
Likely missing in 3.4 as well.
Potentially an EasyHack.
Comment 1 Pedro 2011-12-04 03:50:33 UTC
I can confirm this bug both under 3.4.4 Final and 3.5.0 (Build ID: a286353-090bcba-3bf3b94) under Windows XP Pro x86 SP3

This problem can be quite annoying (even a show-stopper) for users that edit frequently the same documents.
Comment 2 Björn Michaelsen 2011-12-23 12:07:11 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 3 Björn Michaelsen 2011-12-23 12:57:27 UTC
An EasyHack should have been checked by developers and thus is confirmed regardless of age. Moving back to NEW from NEEDINFO again. Sorry for the hassle.
Comment 4 Muhammad Haggag 2012-02-02 12:44:31 UTC
I'm investigating, and it seems to me that the current behavior is "by design". Whether that design is sensible is up for debate.

The current behavior is that a document is added to the "Recent Documents" list when it's closed (OApplicationController::disposing, line 437 in AppController.cxx: http://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/app/AppController.cxx). To walk through the repro scenario:
1. Create and save new document "A" -> Current document is "A".
2. Modify and "Save As" document "B" -> Current document is now "B". "A" was not closed, merely renamed.
3. Close Writer -> Document "B" closes, and writes itself to the "Recent Documents" list.
4. On startup, you only see "B", the document that closed.

I checked MS Word 2007's behavior, and it updates the list immediately on Open, Save, and Save As.

If the current LO behavior is indeed inappropriate, we can modify the all document loading/saving operations (Open, Save, Save As, Save All, etc.) handlers to also update the "Recent Documents" list.
Comment 5 Muhammad Haggag 2012-02-05 05:10:21 UTC
Based on feedback on the developers mailing list, I'm working on updating the behavior of document saving/loading code to update the "Recent Documents" list.
Comment 6 Muhammad Haggag 2012-02-08 05:00:34 UTC
Created attachment 56740 [details]
Proposed patch.

This patch will be posted for review on libreoffice-dev shortly. It updates the behavior so that we update "Recent Documents" on file open, save, save as, save to, save all, and close.
Comment 7 Muhammad Haggag 2012-02-08 05:02:13 UTC
(In reply to comment #4)
> The current behavior is that a document is added to the "Recent Documents" list
> when it's closed (OApplicationController::disposing, line 437 in
> AppController.cxx:
> http://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/app/AppController.cxx).

Correction: While the behavior description is correct, the cause isn't. Adding a document to the recent documents list on document close happens in SfxPickList::Notify (sfx2/source/appl/sfxpicklist.cxx).
Comment 8 Muhammad Haggag 2012-02-14 00:56:37 UTC
Created attachment 57016 [details]
Alternative patch (based on review feedback).

This patch removes the update on document open and adds logic to handle the "Save As" case so that the old and new documents are both added to the "Recent Documents" list.
Comment 9 Jan Holesovsky 2012-02-14 08:37:26 UTC
Muhammad Haggag commited a patch related to this issue to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2e01faac3fa50f7036093583ae52f1584b3de55c

fdo#37775: Recent Documents not updated by Save & Save As
Comment 10 Michael Meeks 2012-02-14 09:31:23 UTC
I committed Muhammad's nice patch => fixed.
Comment 11 Not Assigned 2012-04-27 02:16:59 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=de4c18bacaf75f378da829c2114a67f4007d7a22

Related fdo#37775: Update Recent Documents for r/o docs, too
Comment 12 Milan Bouchet-Valat 2012-05-18 05:31:18 UTC
Hey, that's great! This small issue was plaging OpenOffice and then LibreOffice for ages...
Comment 13 gleppert 2012-06-01 15:34:45 UTC
Wouldn't it be nice to also have hybrid PDFs included in the RecentFiles list? Please see: bug 39169 In my opinion, it is a nice idea.
Comment 14 manj_k 2012-06-16 08:40:00 UTC
Removed 'EasyHack' from Summary.
Comment 15 Robinson Tryon (qubit) 2015-12-16 05:33:18 UTC
Migrating Whiteboard tags to Keywords: (EasyHack TopicUi )
[NinjaEdit]