diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-04-02 15:18:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-04-02 15:19:39 +0100 |
commit | f5b9db43080658201caf07cd646bae4f4f2acc95 (patch) | |
tree | 2b3a69fca129e32d5759e5d0ed740bb6c896facf | |
parent | 604f67db541060146a8a33944d4bcf31f2e346b4 (diff) |
Resolves: fdo#75307 discard invalid user data
Change-Id: Id39b51c344004e02d3d5a281ba98721b944468c3
-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 5f8e25540e6d..28c118f9521a 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; |