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>