summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-11-04 18:50:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-11-05 09:38:52 +0100
commit73d3639304100d50422435745f8ecc7ff1583de1 (patch)
tree1fd9c02da39cd4a38605bf4c634dc0817c492480 /sw
parentc246bde769e8a887fb7ec9fe24fbd3669f7c88d5 (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> (cherry picked from commit 20ddabc88b6b45ea3efcc44ede5244ea526b09c4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124693 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 890ccdd8fcc3..326787dea7b5 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2635,6 +2635,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;
}
@@ -3060,6 +3064,8 @@ void SAL_CALL SwXTextDocument::render(
{
m_pRenderData.reset();
m_pPrintUIOptions.reset();
+ // tdf#144989 enable DoIdleJobs() again after last page
+ pDoc->getIDocumentTimerAccess().UnblockIdling();
}
}