[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - cui/source
Caolán McNamara
caolanm at redhat.com
Fri Jan 26 08:01:13 UTC 2018
cui/source/tabpages/chardlg.cxx | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
New commits:
commit e83ef8c5d1f6999bc0479b7bbbecca64f5d8ab05
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 20 12:32:12 2017 +0000
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 at collabora.co.uk>
Tested-by: pranavk <pranavk at collabora.co.uk>
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)
More information about the Libreoffice-commits
mailing list