diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-05 14:43:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-05 15:57:31 +0100 |
commit | 349d64b821c657aa9b94667c7f9fac3bdb677342 (patch) | |
tree | 8fa136400b64d2b6367655c57e1ee1cb7dc64c1a /writerfilter | |
parent | remove classic theme from configure (diff) | |
download | core-349d64b821c657aa9b94667c7f9fac3bdb677342.tar.gz core-349d64b821c657aa9b94667c7f9fac3bdb677342.zip |
Related: fdo#47347 m_aFontEncodings is a map so returns 0 on unknown fontindex
Change-Id: I3addf0d27058ed9ef01d4893ad932c13623c283c
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 9bbbcb0c151d..da167874af32 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -518,8 +518,9 @@ rtl_TextEncoding RTFDocumentImpl::getEncoding(sal_uInt32 nFontIndex) { if (!m_pSuperstream) { - if (nFontIndex < m_aFontEncodings.size()) - return m_aFontEncodings[nFontIndex]; + std::map<int, rtl_TextEncoding>::iterator it = m_aFontEncodings.find(nFontIndex); + if (it != m_aFontEncodings.end()) + return it->second; return msfilter::util::getBestTextEncodingFromLocale(Application::GetSettings().GetLocale()); } else |