diff options
author | Keith Curtis <keithcu@gmail.com> | 2014-02-22 05:30:00 -0500 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-05 09:01:11 -0600 |
commit | ff6f3164dfc454354bee79eac30d6cc279b8a0ec (patch) | |
tree | 8eabd42240646136707fccfa46ec297b6230a3a3 /editeng | |
parent | 9d4c3a2a217e02444601bea9e0eae7ae342fe0e8 (diff) |
Simplify DrawWave
This patch simplifies the DrawWave logic. Callers of that code would try to
figure out what size wave to draw and pass down a style integer to
DrawWaveLine, but DrawWaveLine already has logic which trims the height of the
wave so it doesn't need the hint.
This doesn't change the UNO API
(::com::sun::star::awt::FontUnderline::SMALLWAVE), but it does get rid of
internal usages and maps those small waves to normal.
Note that changing the zoom in Calc right now causes spelling underlines to
disappear. That bug is not related to these changes.
Conflicts:
editeng/source/editeng/impedit3.cxx
Change-Id: I3caa2a74a0f5228b924d4e1b0a77f96eaef5fa00
Reviewed-on: https://gerrit.libreoffice.org/8168
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 1ee1a1b65c6f..c095ba2d206e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -83,8 +83,6 @@ using namespace ::com::sun::star::linguistic2; #define RESDIFF 10 #define WRONG_SHOW_MIN 5 -#define WRONG_SHOW_SMALL 11 -#define WRONG_SHOW_MEDIUM 15 struct TabInfo { @@ -169,14 +167,6 @@ static void lcl_DrawRedLines( long nHght = pOutDev->LogicToPixel( Size( 0, nFontHeight ) ).Height(); if( WRONG_SHOW_MIN < nHght ) { - sal_uInt16 nStyle; - if( WRONG_SHOW_MEDIUM < nHght ) - nStyle = WAVE_NORMAL; - else if( WRONG_SHOW_SMALL < nHght ) - nStyle = WAVE_SMALL; - else - nStyle = WAVE_FLAT; - size_t nEnd, nStart = nIndex; bool bWrong = pWrongs->NextWrong( nStart, nEnd ); while ( bWrong ) @@ -189,12 +179,12 @@ static void lcl_DrawRedLines( if ( nEnd > nMaxEnd ) nEnd = nMaxEnd; Point aPnt1( rPnt ); - if ( bVertical && ( nStyle != WAVE_FLAT ) ) + if ( bVertical ) { // VCL doesn't know that the text is vertical, and is manipulating // the positions a little bit in y direction... long nOnePixel = pOutDev->PixelToLogic( Size( 0, 1 ) ).Height(); - long nCorrect = ( nStyle == WAVE_NORMAL ) ? 2*nOnePixel : nOnePixel; + long nCorrect = 2*nOnePixel; aPnt1.Y() -= nCorrect; aPnt1.X() -= nCorrect; } @@ -227,7 +217,7 @@ static void lcl_DrawRedLines( aPnt2 = Rotate( aPnt2, nOrientation, rOrigin ); } - pOutDev->DrawWaveLine( aPnt1, aPnt2, nStyle ); + pOutDev->DrawWaveLine( aPnt1, aPnt2 ); nStart = nEnd+1; if ( nEnd < nMaxEnd ) |