summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKeith Curtis <keithcu@gmail.com>2014-02-22 05:30:00 -0500
committerCaolán McNamara <caolanm@redhat.com>2014-03-05 09:01:11 -0600
commitff6f3164dfc454354bee79eac30d6cc279b8a0ec (patch)
tree8eabd42240646136707fccfa46ec297b6230a3a3 /vcl
parent9d4c3a2a217e02444601bea9e0eae7ae342fe0e8 (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 'vcl')
-rw-r--r--vcl/source/gdi/outdev3.cxx37
1 files changed, 13 insertions, 24 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index c9ded12307de..74cd8e7fd304 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5303,8 +5303,7 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
}
-void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
- sal_uInt16 nStyle )
+void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos )
{
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
@@ -5344,32 +5343,22 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
long nWaveHeight;
- if ( nStyle == WAVE_NORMAL )
+ nWaveHeight = 3;
+ nStartY++;
+ nEndY++;
+
+ if (mnDPIScaleFactor > 1)
{
- nWaveHeight = 3;
- nStartY++;
- nEndY++;
+ nWaveHeight *= mnDPIScaleFactor;
- if (mnDPIScaleFactor > 1)
- {
- nWaveHeight *= mnDPIScaleFactor;
+ nStartY += mnDPIScaleFactor - 1; // Shift down additional pixel(s) to create more visual separation.
- // odd heights look better than even
- if (mnDPIScaleFactor % 2 == 0)
- {
- nStartY++; // Shift down an additional pixel to create more visual separation.
- nWaveHeight--;
- }
+ // odd heights look better than even
+ if (mnDPIScaleFactor % 2 == 0)
+ {
+ nWaveHeight--;
}
}
- else if( nStyle == WAVE_SMALL )
- {
- nWaveHeight = 2;
- nStartY++;
- nEndY++;
- }
- else // WAVE_FLAT
- nWaveHeight = 1;
// #109280# make sure the waveline does not exceed the descent to avoid paint problems
ImplFontEntry* pFontEntry = mpFontEntry;
@@ -5381,7 +5370,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
mnDPIScaleFactor, nOrientation, GetLineColor());
if( mpAlphaVDev )
- mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nStyle );
+ mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos );
}
void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr,