summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-19 16:01:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-20 08:00:32 +0200
commit35e80e9726b5fee6a00caa58349a4b5d924dad7c (patch)
tree3f92cdee5079affdc40b73f26845d73e9a994412 /writerfilter
parenta3143aa0dec78177e522858fbf786494c75512a0 (diff)
when calling std::lower_bound
it's not enough to compare != end(), you also need to compare the key against the iterator result Change-Id: Ide5f151ba2297a35e5546f47fbc3c53cbe5ab533 Reviewed-on: https://gerrit.libreoffice.org/62014 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtftokenizer.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx
index 65a80932e90d..5410b652fbe3 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -247,10 +247,9 @@ bool RTFTokenizer::lookupMathKeyword(RTFMathSymbol& rSymbol)
{
auto low
= std::lower_bound(s_aRTFMathControlWords.begin(), s_aRTFMathControlWords.end(), rSymbol);
- int i = low - s_aRTFMathControlWords.begin();
if (low == s_aRTFMathControlWords.end() || rSymbol < *low)
return false;
- rSymbol = s_aRTFMathControlWords[i];
+ rSymbol = *low;
return true;
}