[Libreoffice-commits] core.git: sw/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 15 07:16:55 UTC 2020
sw/source/core/crsr/crsrsh.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 360adf267b923d263adc536ab542320538609b4e
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Jun 14 21:53:59 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jun 15 09:16:23 2020 +0200
Return early in ExtendedSelectedAll (sw/crsrsh)
No need to search if there's a "pEnd" if there's not even a "pStart"
Change-Id: I8e26b432d4f32b4803e78fc36006bf6c8c7e913e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96301
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 014c515a81f0..9407dd9d6629 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -607,11 +607,12 @@ bool SwCursorShell::ExtendedSelectedAll()
SwNodes& rNodes = GetDoc()->GetNodes();
SwNodeIndex nNode = rNodes.GetEndOfAutotext();
SwContentNode* pStart = rNodes.GoNext(&nNode);
+ if (!pStart)
+ return false;
nNode = rNodes.GetEndOfContent();
SwContentNode* pEnd = SwNodes::GoPrevious(&nNode);
-
- if (!pStart || !pEnd)
+ if (!pEnd)
return false;
SwPosition aStart(*pStart, 0);
More information about the Libreoffice-commits
mailing list