summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChristof Pintaske <cp@openoffice.org>2001-09-10 09:56:10 +0000
committerChristof Pintaske <cp@openoffice.org>2001-09-10 09:56:10 +0000
commit4328f16a2217a2e0c6d21c03902051118faafc9e (patch)
tree4a6d73c441945595f880c54ab179237f376a9a1e /vcl
parent31ce8c2209d50f1d660fa6171a5a80e5544d3d69 (diff)
#91058# check for empty strike out string
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev3.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index a255e851eaf2..70df44c83ad7 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: outdev3.cxx,v $
*
- * $Revision: 1.58 $
+ * $Revision: 1.59 $
*
- * last change: $Author: th $ $Date: 2001-08-28 10:47:56 $
+ * last change: $Author: cp $ $Date: 2001-09-10 10:56:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -4977,16 +4977,23 @@ void OutputDevice::ImplDrawTextLine( long nBaseX,
nMaxWidth = 2;
nMaxWidth += nWidth;
long nFullStrikeoutWidth = GetTextWidth( aStrikeoutText );
- while ( (nFullStrikeoutWidth > nMaxWidth) && aStrikeoutText.Len() )
+ // allow the strikeout to be one pixel larger than the text it strikes out
+ while ( (nFullStrikeoutWidth > (nMaxWidth + 1)) && aStrikeoutText.Len() )
{
aStrikeoutText.Erase( aStrikeoutText.Len()-1 );
nFullStrikeoutWidth = GetTextWidth( aStrikeoutText );
}
- if ( mpFontEntry->mnOrientation )
- ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
- ImplDrawTextDirect( nX, nY,
+ // if the textwidth is smaller than the strikeout text, then resign from striking
+ // out at all. This case requires user interaction, e.g. adding a space to the text
+ if (aStrikeoutText.Len() > 0)
+ {
+ if ( mpFontEntry->mnOrientation )
+ ImplRotatePos( nBaseX, nBaseY, nX, nY, mpFontEntry->mnOrientation );
+ ImplDrawTextDirect( nX, nY,
aStrikeoutText.GetBuffer(), aStrikeoutText.Len(),
NULL, FALSE );
+ }
+
SetTextColor( aOldColor );
ImplInitTextColor();
EnableMapMode( bOldMap );