summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-24 12:38:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-04-25 17:50:16 +0200
commit3e3e28dcc89f0b756a7f2af1d410a42655b58a88 (patch)
tree5be3812bfc418f798f0d2e73a858d02c3c144e77 /vcl
parent9e5a7189fd759a5e16959e2f116465fccd41cefa (diff)
ignore mrucount if the entry was not found
Change-Id: I4b69964fc888b18a5e3baff6a1aeec3bf23c8015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92852 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 04a6f68837ea..cb88d8f4b486 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13862,7 +13862,7 @@ public:
virtual int find_text(const OUString& rStr) const override
{
int nPos = find_text_including_mru(rStr, false);
- if (m_nMRUCount)
+ if (nPos != -1 && m_nMRUCount)
nPos -= (m_nMRUCount + 1);
return nPos;
}
@@ -13870,7 +13870,7 @@ public:
virtual int find_id(const OUString& rId) const override
{
int nPos = find_id_including_mru(rId, false);
- if (m_nMRUCount)
+ if (nPos != -1 && m_nMRUCount)
nPos -= (m_nMRUCount + 1);
return nPos;
}