diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-04 18:50:42 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-04 21:07:30 +0100 |
commit | 20ddabc88b6b45ea3efcc44ede5244ea526b09c4 (patch) | |
tree | 2193c9d5e0e63394b4161c82afe5dc22363d17e9 | |
parent | b439832fc36a05e4423f480f7a312428f2449cc6 (diff) |
tdf#144989 sw: disable idle jobs during printing or PDF export
The problem is that (with the kde5 and WNT vclplugs) the idle jobs
update fields and un-hides every section, which destroys the layout
that SwXTextDocument::getRendererCount() finalised with great effort.
This doesn't seem to happen with gtk3 or gen vclplugs.
6 SwSectionNode::MakeOwnFrames(SwNodeIndex*, SwNodeIndex*)
7 SwSectionFormat::MakeFrames()
8 SwSection::ImplSetHiddenFlag(bool, bool)
9 SwSection::SetCondHidden(bool)
10 SwDocUpdateField::MakeFieldList_(SwDoc&, int)
11 SwDocUpdateField::MakeFieldList(SwDoc&, bool, int)
12 sw::DocumentFieldsManager::UpdateExpFields(SwTextField*, bool)
13 sw::DocumentTimerManager::DoIdleJobs(Timer*)
14 sw::DocumentTimerManager::LinkStubDoIdleJobs(void*, Timer*)
15 Link<Timer*, void>::Call(Timer*) const
16 Timer::Invoke()
17 Scheduler::CallbackTaskScheduling() ()
18 SalTimer::CallCallback()
19 QtTimer::timeoutActivated()
20 QtTimer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
21 void doActivate<false>(QObject*, int, void**) ()
22 QTimer::timeout(QTimer::QPrivateSignal) ()
23 QObject::event(QEvent*) ()
24 QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
25 QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
26 QTimerInfoList::activateTimers() ()
27 timerSourceDispatch()
28 g_main_context_dispatch ()
29 g_main_context_iterate.constprop ()
30 g_main_context_iteration ()
31 QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
32 QtInstance::ImplYield(bool, bool)
33 QtInstance::DoYield(bool, bool)
34 ImplYield(bool, bool)
35 Application::Reschedule(bool)
36 framework::StatusIndicatorFactory::impl_reschedule(bool)
37 framework::StatusIndicatorFactory::setValue()
38 framework::StatusIndicator::setValue(int)
39 PDFExport::ExportSelection()
40 PDFExport::Export()
Reportedly this started to happen with commit
4184569b963877c2a488ff05766654b9db194798 - presumably before that the
word counting was so slow that the idle didn't progress to updating
fields.
There is little point in running idle jobs during printing anyway as in
the best case it will just slow down the process.
So temporarily disable the idle jobs in getRendererCount() and
enable it again in render() with "IsLastPage" set.
Change-Id: I6359592aefeec298c5e58d44bef5ef16c583ddac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124721
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index c09a9a17c8f2..65ab57970304 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -2580,6 +2580,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( } } OSL_ENSURE( nRet >= 0, "negative number of pages???" ); + // tdf#144989 the layout is complete now - prevent DoIdleJobs() from + // messing it up, particulary SwDocUpdateField::MakeFieldList_() unhiding + // sections + pDoc->getIDocumentTimerAccess().BlockIdling(); return nRet; } @@ -3004,6 +3008,8 @@ void SAL_CALL SwXTextDocument::render( { m_pRenderData.reset(); m_pPrintUIOptions.reset(); + // tdf#144989 enable DoIdleJobs() again after last page + pDoc->getIDocumentTimerAccess().UnblockIdling(); } } |