summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-15 10:27:22 +0100
committerAndras Timar <andras.timar@collabora.com>2019-08-22 12:33:14 +0200
commite8b8bccd3e879c16a09c6fe2a9884bd1946c291b (patch)
treeb3c3bb355f6a28596361710fbec77d53930b4256
parent7e7eb14c687b62eb5e38aaded1a5088df4c9a692 (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 eb60b863daaa..4cf1964ace4a 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -563,7 +563,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;
}
}