Trying to understand some points in RecentDocs management

Eike Rathke erack at redhat.com
Fri Feb 27 12:28:41 PST 2015


Hi julien2412,

On Monday, 2015-02-16 14:43:03 -0700, julien2412 wrote:

> 1) I noticed that AddDocumentToPickList was called at the opening and at the
> close of a doc (+ some other events like saveAs)
> See
> http://opengrok.libreoffice.org/xref/core/sfx2/source/appl/sfxpicklist.cxx#406
> => I wonder in which case calling this method at close would be useful so
> submitted https://gerrit.libreoffice.org/#/c/14507/

See my comment there.

> 2) I noticed that this line in AddDocumentToPickList was always wrong:
> 178     if ( !pMed->IsUpdatePickList() )

Why wrong? A medium could be set to not updating / be mentioned in the picklist.

> I mean either the recent list or not, it seems we never return from 
> AddDocumentToPickList and so we generate thumbnail of the file (some lines
> below)
> Trying to investigate here, I must recognize I'm not sure what
> "bUpdatePickList" variable from SfxMedium_Impl (see
> http://opengrok.libreoffice.org/xref/core/sfx2/source/doc/docfile.cxx#174)
> means:
> a) boolean to indicate pick list should be updated

Yes.

> or b) boolean to indicate pick list has been updated
> IsUpdatePickList shows a bit this confusion, does it mean: "is updated
> PickList" or "must Update PickList" ?

"is UpdatePickList set" ;-)

> 3) I noticed that at each close, BackingWindow::initControls is called (see
> opengrok.libreoffice.org/xref/core/sfx2/source/dialog/backingwindow.cxx#217) 
> and we never return early from here:
>     217 void BackingWindow::initControls()
>     218 {
>     219     if( mbInitControls )
>     220         return;
>     221 
>     222     mbInitControls = true;
> 
> Indeed, by closing several times the same file (without any change in it
> each time), the object address is different:

Probably the BackingWindow is destroyed when a document is opened, which
makes sense because it is not needed anymore. Once the last document is
closed, a new BackingWindow is created. Just assumptions, I didn't
investigate, you'd have to place a break in dtor and ctor.

> /home/julien/compile-libreoffice/libreoffice/sfx2/source/dialog/backingcomp.cxx:436
> 
> the main problem here is we call mpAllRecentThumbnails->Reload(); (line 260
> of this same file) (see
> http://opengrok.libreoffice.org/xref/core/sfx2/source/control/recentdocsview.cxx#158)
> This method clears and reloads completely SvtHistoryOptions list

Why is that bad? The alternative would be to keep the BackingWindow (IF
my assumption of it being destroyed holds) but then you would have to
refresh the history and corresponding thumbnails of documents that were
opened or saved in the mean time. Which unnecessarily would tie memory
when a document is open and complicate handling.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150227/d6c30bc9/attachment.sig>


More information about the LibreOffice mailing list