tdf#155647: Pass XFlatParagraph by normal Reference, not WeakReference
commit779d5e279b5f85cabeb2f1ca3cacca0db4aaeec1
authorMike Kaganski <mike.kaganski@collabora.com>
Fri, 2 Jun 2023 11:32:45 +0000 (2 14:32 +0300)
committerAndras Timar <andras.timar@collabora.com>
Fri, 9 Jun 2023 10:26:19 +0000 (9 12:26 +0200)
treeec4c55341e9e6878f42f6927f986d5277ef72fcd
parent319ed7e3cce249994afd043944e86e4f5fac6f0a
tdf#155647: Pass XFlatParagraph by normal Reference, not WeakReference

Since commit a7ce722b476c4bb0c9a113ae0c2759181edfe48f (tdf#155232:
drop m_aFlatParaList from SwXFlatParagraphIterator, 2023-05-13), the
instances of XFlatParagraph are not cached in its iterator. Hence,
the instances created in GrammarCheckingIterator to pass to AddEntry
got immediately destroyed upon the scope end, before the checking
thread (where weak references were passed) had a chance to create own
hard references. Then GrammarCheckingIterator::DequeueAndCheck found
that xFlatPara was empty, and exited.

Just pass hard references there. The iterator was passed to the thread
by hard reference in FPEntry anyway; and so, the use of weak reference
to flat paragraph objects provided no benefit, when the iterator kept
hard references.

Change-Id: Ib56652d88b9a5c6f20aa3d70fed18f8be0d3a3df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152554
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 72869f559021ced673465cb9aa82e461ecaafc91)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152532
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
linguistic/source/gciterator.cxx
linguistic/source/gciterator.hxx