tdf#38837 Reduce power consumption by minimizing idle timers
Both the document statistics- and state-manager have their own modified flags. There is a cyclic dependency between the the two in that updating the document's statistics also marks the document as modified. Of course when a document is edited the statistics modified flag is set to trigger an update. To avoid a perpetual cycle, the statistics manager resets the document's modified state to that before setting the new statistics. However, this doesn't reset the statistics modified flag, which was set when the document was modified by setting the new statistics. Hence, the statistics thinks there are modifications in the document when there isn't. This patch is to make DocumentStateManager::ResetModified() symmetrical to DocumentStateManager::SetModified() by reseting the modified flag of the statistics manager. The idle CPU drops to nil on unmodified documents after this. However, for modified documents the statistics is recalculated perpetually until the document is saved. This will need a different patch to fix. Change-Id: Ib5936bc1acbda34fcac6a00ec46eaa31e4363885 Reviewed-on: https://gerrit.libreoffice.org/16774Tested-by:Jenkins <ci@libreoffice.org> Reviewed-by:
Caolán McNamara <caolanm@redhat.com> Tested-by:
Caolán McNamara <caolanm@redhat.com>
Showing
Please
register
or
sign in
to comment