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:17:33 +0200
commit88574730c6feac2f9b4a4334fb1f3c4224eab135 (patch)
tree2ee87cb38dc8777e613edf50d60c919bc998f737
parente5df0d8414e977936a5d91de2444ab6f16d940d1 (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;
}
}