diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-09 16:58:16 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-10 15:24:55 +0000 |
commit | c023d5deb783e1e463f60e02cfabd045bfdda4c9 (patch) | |
tree | 1ba1e54e5f03d65060e2f03a2c2d790bbb17f2d9 | |
parent | guard against missing SuperTable (diff) | |
download | core-c023d5deb783e1e463f60e02cfabd045bfdda4c9.tar.gz core-c023d5deb783e1e463f60e02cfabd045bfdda4c9.zip |
bounds check GetNameByIndex like Override
Change-Id: If83e255da1683779458556a3ab1af4f00b19265b
(cherry picked from commit 8c67b1b51f21643036c5f5371a6af0a4558e7da2)
Reviewed-on: https://gerrit.libreoffice.org/20548
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | lotuswordpro/source/filter/lwpfont.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwpfont.cxx b/lotuswordpro/source/filter/lwpfont.cxx index 3ee7e1b5ecb1..4307d298e14b 100644 --- a/lotuswordpro/source/filter/lwpfont.cxx +++ b/lotuswordpro/source/filter/lwpfont.cxx @@ -399,8 +399,13 @@ void LwpFontNameManager::Override(sal_uInt16 index, rtl::Reference<XFFont> co if(m_pFontNames[index-1].IsAltFaceNameOverridden()) pFont->SetFontNameAsia(m_FontTbl.GetFaceName(m_pFontNames[index-1].GetAltFaceID())); } + OUString LwpFontNameManager::GetNameByIndex(sal_uInt16 index) + //index: start from 1 { + if (index > m_nCount || index < 1) + return OUString(); + sal_uInt16 nameindex = m_pFontNames[index-1].GetFaceID(); return (m_FontTbl.GetFaceName(nameindex)); } |