sfx2/source/appl/sfxpicklist.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 1f6d845e10737d6ad1fec1c0ff660baae0ce3f3c Author: Justin Luth <justin_l...@sil.org> AuthorDate: Fri Dec 10 19:01:04 2021 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Fri Jan 5 11:13:58 2024 +0100 tdf#139636 thumbnail: don't regenerate on file close Back in 2001, this might have been the primary time when the thumbnail was generated. Now it is also generated on file open and file-save. This bug report is at least one example why regenerating on exit is not desireable. But are there examples of why a thumbnail IS needed on file exit? One way the thumbnail can change is viewing track changes, since toggling track changes doesn't "modify" the document. What other things can affect the document layout without be considered a modification? Change-Id: Ic08fefadb7a2ff594dc2788dfc9cf9e0cc528a71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126649 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index cb3b0d5872be..64ebcc1a342c 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -52,14 +52,14 @@ class SfxPickListImpl : public SfxListener certain requirements, e.g. being writable. Check implementation for requirement details. */ - static void AddDocumentToPickList( const SfxObjectShell* pDocShell ); + static void AddDocumentToPickList(const SfxObjectShell* pDocShell, bool bNoThumbnail = false); public: SfxPickListImpl(SfxApplication& rApp); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; }; -void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh ) +void SfxPickListImpl::AddDocumentToPickList(const SfxObjectShell* pDocSh, bool bNoThumbnail) { if (pDocSh->IsAvoidRecentDocs() || comphelper::LibreOfficeKit::isActive()) return; @@ -96,7 +96,7 @@ void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh ) // generate the thumbnail //fdo#74834: only generate thumbnail for history if the corresponding option is not disabled in the configuration - if (!pDocSh->IsModified() && !Application::IsHeadlessModeEnabled() && + if (!bNoThumbnail && !pDocSh->IsModified() && !Application::IsHeadlessModeEnabled() && officecfg::Office::Common::History::RecentDocsThumbnail::get()) { // not modified => the document matches what is in the shell @@ -198,7 +198,8 @@ void SfxPickListImpl::Notify( SfxBroadcaster&, const SfxHint& rHint ) case SfxEventHintId::SaveToDocDone: case SfxEventHintId::CloseDoc: { - AddDocumentToPickList(pDocSh); + const bool bNoThumbnail = rEventHint.GetEventId() == SfxEventHintId::CloseDoc; + AddDocumentToPickList(pDocSh, bNoThumbnail); } break;