diff options
author | Jan Holesovsky <kendy@collabora.com> | 2020-11-24 15:34:55 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-11-26 13:50:32 +0100 |
commit | 8e996d7aa41d29b46964c656f4f959316e5ad265 (patch) | |
tree | 2f5faa9c1f0d4dac8dcc93ed0f2585c27a8b9510 /sw | |
parent | 3ed2f733f81b348e4be1c46c019e9588a6062bd2 (diff) |
lok: Don't even iterate through the redlines when they are disabled.
It is not necessary, when we are not issuing any output anyway.
Change-Id: Id952549befb1bef04a2dd9237d286922939eaae2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106509
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 8f44a939ad09d0365607ae8960e2abfe77e3fe72)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106516
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index a3fabfaf514d..174437ea4156 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -355,14 +355,22 @@ void lcl_LOKInvalidateStartEndFrames(SwShellCursor& rCursor) FRM_CNTNT, &rCursor.GetEndPos()); } +bool lcl_LOKRedlineNotificationEnabled() +{ + static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr; + if (comphelper::LibreOfficeKit::isActive() && !bDisableRedlineComments) + return true; + + return false; +} + } // anonymous namespace /// Emits LOK notification about one addition / removal of a redline item. void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRedline* pRedline) { // Disable since usability is very low beyond some small number of changes. - static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr; - if (!comphelper::LibreOfficeKit::isActive() || bDisableRedlineComments) + if (!lcl_LOKRedlineNotificationEnabled()) return; boost::property_tree::ptree aRedline; @@ -1091,7 +1099,7 @@ SwRangeRedline::~SwRangeRedline() void MaybeNotifyRedlineModification(SwRangeRedline* pRedline, SwDoc* pDoc) { - if (!comphelper::LibreOfficeKit::isActive()) + if (!lcl_LOKRedlineNotificationEnabled()) return; const SwRedlineTable& rRedTable = pDoc->getIDocumentRedlineAccess().GetRedlineTable(); @@ -1107,7 +1115,7 @@ void MaybeNotifyRedlineModification(SwRangeRedline* pRedline, SwDoc* pDoc) void SwRangeRedline::MaybeNotifyRedlinePositionModification(long nTop) { - if (!comphelper::LibreOfficeKit::isActive()) + if (!lcl_LOKRedlineNotificationEnabled()) return; if(!m_oLOKLastNodeTop || *m_oLOKLastNodeTop != nTop) |