diff options
author | Jim Raykowski <raykowj@gmail.com> | 2022-02-08 15:56:55 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2022-02-15 03:18:25 +0100 |
commit | d4ce88a36428231e65cc247967890496192e78cc (patch) | |
tree | 1ce063a8f928c95d59f444a0b24fe3747d9d40fa /sw/source/uibase/utlui | |
parent | 2bb10a827ac13d0caf009e8526ccd9f17dc71653 (diff) |
SwNavigator: Check if document changed before calling HasContentChanged
The HasContentChanged function is costly. This patch makes
HasContentChanged only be called if the document change flag has not
been cleared when the content tree gains focus.
Change-Id: Iab051f6eea23d7bea91195214f6efdfcf5f24cc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129700
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ee88b6d3caa4..3a52f9d14e84 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3847,10 +3847,13 @@ IMPL_LINK_NOARG(SwContentTree, FocusInHdl, weld::Widget&, void) if (State::ACTIVE == m_eState && pActShell != GetWrtShell()) SetActiveShell(pActShell); + // Only call HasContentChanged() if the document has changed since last called else if ((State::ACTIVE == m_eState || (State::CONSTANT == m_eState && pActShell == GetWrtShell())) && - HasContentChanged()) + m_bDocHasChanged) { - Display(true); + if (HasContentChanged()) + Display(true); + m_bDocHasChanged = false; } } else if (State::ACTIVE == m_eState) |