summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-08-25 00:01:03 +0200
committerCaolán McNamara <caolanm@redhat.com>2020-08-25 10:11:49 +0200
commitfc7b4bfeba39a2479c9a2c9c8ef5ced5ab3c0de7 (patch)
tree2d020cbaec63641056ddf24111f3211328dba7ab /cui
parent9662a743ab8dd1f9a3ce1552e9d23a5e5259f5b5 (diff)
tdf#135997: properly check loop condition
It should break when any of iterators reaches end, not only when both. Introduced in commit 710a39414569995bd5a8631a948c939dc73bcef9. The crash dump from the bug report points to one of these lines; this is a blind fix, since I cannot reproduce myself. Change-Id: Ie7f6b827256cdb7061901dc9b2ae5ee8e0222a38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101162 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 3b386467f2d4b2b96b7e697d9f5b133819f6180e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101163 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/cuicharmap.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 3f3651bce366..13d3c8e7658b 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -261,7 +261,7 @@ void SvxCharacterMap::updateRecentCharControl()
{
int i = 0;
for ( std::deque< OUString >::iterator it = maRecentCharList.begin(), it2 = maRecentCharFontList.begin();
- it != maRecentCharList.end() || it2 != maRecentCharFontList.end();
+ it != maRecentCharList.end() && it2 != maRecentCharFontList.end();
++it, ++it2, i++)
{
m_aRecentCharView[i].SetText(*it);
@@ -360,7 +360,7 @@ void SvxCharacterMap::updateFavCharControl()
{
int i = 0;
for ( std::deque< OUString >::iterator it = maFavCharList.begin(), it2 = maFavCharFontList.begin();
- it != maFavCharList.end() || it2 != maFavCharFontList.end();
+ it != maFavCharList.end() && it2 != maFavCharFontList.end();
++it, ++it2, i++)
{
m_aFavCharView[i].SetText(*it);