Bug 64088 - Reuse Recent Documents code in the Start Center
Summary: Reuse Recent Documents code in the Start Center
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp
Depends on:
Blocks: Start-Center
  Show dependency treegraph
 
Reported: 2013-04-30 13:38 UTC by Jan Holesovsky
Modified: 2015-12-16 00:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Holesovsky 2013-04-30 13:38:16 UTC
The Start Center constructs the Recent Documents menu in BackingWindow::prepareRecentFileMenu():

http://cgit.freedesktop.org/libreoffice/core/tree/framework/source/services/backingwindow.cxx#n283

But this is effectively duplicating code (AKA copy'n'paste) from elsewhere, which causes that it lacks the nice 'Clear List' feature.  It would be much better to re-use the code, like in SfxRecentFilesToolBoxControl::CreatePopupWindow():

http://cgit.freedesktop.org/libreoffice/core/tree/sfx2/source/toolbox/tbxitem.cxx#n1761

To do this, you want to change the ActivateHdl link:

http://cgit.freedesktop.org/libreoffice/core/tree/framework/source/services/backingwindow.cxx#n970

to do the same thing as SfxRecentFilesToolBoxControl::CreatePopupWindow(), and remove all unnecessary pieces like prepareRecentFileMenu, maRecentFiles, etc. etc.

Should be straightforward, but in case you have problems, please ask :-)
Comment 1 Krisztian Pinter 2013-05-02 12:10:51 UTC
I'm about to spend the following 2 weeks on this.
Comment 2 Jan Holesovsky 2013-05-28 19:45:24 UTC
This has been sorted out by

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

in the meantime
Comment 3 Robinson Tryon (qubit) 2015-12-16 00:20:42 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp)
[NinjaEdit]