diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-20 12:32:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-21 09:03:35 +0000 |
commit | 609670933a80f670d5f6adc4bcdd71781c43c9fa (patch) | |
tree | 0af70873c65c26947613584a7df8c4e6b662b5aa | |
parent | 0755b26191782b17e307832452af4a66d8fdfac7 (diff) |
Related: tdf#106099 avoid casting LISTBOX_ENTRY_NOTFOUND to FontEmphasisMark
Change-Id: I7119e47c71f96af27351665ee08ea42b0ae0a622
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 0ce4e2db0795..2fa3116c4942 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1498,12 +1498,16 @@ void SvxCharEffectsPage::UpdatePreview_Impl() rCTLFont.SetStrikeout( eStrikeout ); nPos = m_pPositionLB->GetSelectEntryPos(); - bool bUnder = ( CHRDLG_POSITION_UNDER == reinterpret_cast<sal_uLong>(m_pPositionLB->GetEntryData( nPos )) ); - FontEmphasisMark eMark = (FontEmphasisMark)m_pEmphasisLB->GetSelectEntryPos(); - eMark |= bUnder ? FontEmphasisMark::PosBelow : FontEmphasisMark::PosAbove; - rFont.SetEmphasisMark( eMark ); - rCJKFont.SetEmphasisMark( eMark ); - rCTLFont.SetEmphasisMark( eMark ); + sal_Int32 nEmphasis = m_pEmphasisLB->GetSelectEntryPos(); + if (nEmphasis != LISTBOX_ENTRY_NOTFOUND) + { + bool bUnder = ( CHRDLG_POSITION_UNDER == reinterpret_cast<sal_uLong>(m_pPositionLB->GetEntryData( nPos )) ); + FontEmphasisMark eMark = (FontEmphasisMark)nEmphasis; + eMark |= bUnder ? FontEmphasisMark::PosBelow : FontEmphasisMark::PosAbove; + rFont.SetEmphasisMark( eMark ); + rCJKFont.SetEmphasisMark( eMark ); + rCTLFont.SetEmphasisMark( eMark ); + } sal_Int32 nRelief = m_pReliefLB->GetSelectEntryPos(); if (LISTBOX_ENTRY_NOTFOUND != nRelief) |