diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-02 15:18:05 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-04-02 15:44:57 +0000 |
commit | 63dd47aed73a502bfbf3b490bd8b9f26528fdfc0 (patch) | |
tree | 9ea8b35550132c0a6bf058758b847f0d28f60f9e | |
parent | 7f3105323f1db11bc0a3ff5c5c71e1dc62338cc4 (diff) |
Resolves: fdo#75307 discard invalid user data
Change-Id: Id39b51c344004e02d3d5a281ba98721b944468c3
(cherry picked from commit f5b9db43080658201caf07cd646bae4f4f2acc95)
Reviewed-on: https://gerrit.libreoffice.org/8815
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 3e6807c22070..28222fa6473f 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2897,6 +2897,26 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_nSubEsc = (short)sUser.getToken( 1, ';' ).toInt32(); m_nSuperProp = (sal_uInt8)sUser.getToken( 2, ';' ).toInt32(); m_nSubProp = (sal_uInt8)sUser.getToken( 3, ';' ).toInt32(); + + //fdo#75307 validate all the entries and discard all of them if any are + //out of range + bool bValid = true; + if (m_nSuperEsc < m_pHighLowMF->GetMin() || m_nSuperEsc > m_pHighLowMF->GetMax()) + bValid = false; + if (m_nSubEsc*-1 < m_pHighLowMF->GetMin() || m_nSubEsc*-1 > m_pHighLowMF->GetMax()) + bValid = false; + if (m_nSuperProp < m_pFontSizeMF->GetMin() || m_nSuperProp > m_pFontSizeMF->GetMax()) + bValid = false; + if (m_nSubProp < m_pFontSizeMF->GetMin() || m_nSubProp > m_pFontSizeMF->GetMax()) + bValid = false; + + if (!bValid) + { + m_nSuperEsc = DFLT_ESC_SUPER; + m_nSubEsc = DFLT_ESC_SUB; + m_nSuperProp = DFLT_ESC_PROP; + m_nSubProp = DFLT_ESC_PROP; + } } short nEsc = 0; |