summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-15 10:27:22 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-29 07:51:48 +0100
commitfdfaf6196b081ae8f91c9d6650ec4d81fc43eecc (patch)
tree2f9d5e16a91c60bd760ce63b3be826c8b8b5a86f
parent2d57933b451b57689e1036bf96eb67bd1fdf86ab (diff)
ofz#9908 validate no negative editengine selection positions
Change-Id: I37dace2051518224c55756362facd3edba4a9571 Reviewed-on: https://gerrit.libreoffice.org/59059 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit ca3038a05188084b012dd3c799494f30bc5c47ef)
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index e6e763f4123a..0e56cde8483e 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -564,7 +564,9 @@ namespace
bool IsValidSel(const EditEngine& rEngine, const ESelection& rSel)
{
const auto nParaCount = rEngine.GetParagraphCount();
- return rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount;
+ if (rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount)
+ return rSel.nStartPos >= 0 && rSel.nEndPos >= 0;
+ return false;
}
}