summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-20 12:32:12 +0000
committerpranavk <pranavk@collabora.co.uk>2018-01-26 09:00:52 +0100
commite83ef8c5d1f6999bc0479b7bbbecca64f5d8ab05 (patch)
tree971ad36e13fdac8f345eee13e9abec803be2da21 /cui
parentb4cef1fb91c7b5024c4e370b0c57a1d4c463a476 (diff)
Related: tdf#106099 avoid casting LISTBOX_ENTRY_NOTFOUND to FontEmphasisMark
Change-Id: I7119e47c71f96af27351665ee08ea42b0ae0a622 (cherry picked from commit 609670933a80f670d5f6adc4bcdd71781c43c9fa) Reviewed-on: https://gerrit.libreoffice.org/48655 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/chardlg.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 5d879817f9a1..6ade2368f0fb 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1500,12 +1500,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)