Caolán McNamara 14 years ago
parent 519194a137
commit e91f88f890

@ -25,21 +25,22 @@ index 02febe3..d43c163 100644
// PDF-export does its own strikeout drawing... why again? // PDF-export does its own strikeout drawing... why again?
if( mpPDFWriter && mpPDFWriter->isBuiltinFont(mpFontEntry->maFontSelData.mpFontData) ) if( mpPDFWriter && mpPDFWriter->isBuiltinFont(mpFontEntry->maFontSelData.mpFontData) )
return; return;
@@ -3984,25 +3989,7 @@ @@ -3985,24 +3990,17 @@
aChars[i] = cStrikeoutChar;
const String aStrikeoutTest( aChars, nTestStrLen ); const String aStrikeoutTest( aChars, nTestStrLen );
- // calculate approximation of strikeout atom size // calculate approximation of strikeout atom size
- long nStrikeoutWidth = nWidth; - long nStrikeoutWidth = nWidth;
- SalLayout* pLayout = ImplLayout( aStrikeoutTest, 0, nTestStrLen ); + long nStrikeoutWidth = 0;
- if( pLayout ) SalLayout* pLayout = ImplLayout( aStrikeoutTest, 0, nTestStrLen );
- { if( pLayout )
{
- nStrikeoutWidth = (pLayout->GetTextWidth() +nTestStrLen/2) / (nTestStrLen * pLayout->GetUnitsPerPixel()); - nStrikeoutWidth = (pLayout->GetTextWidth() +nTestStrLen/2) / (nTestStrLen * pLayout->GetUnitsPerPixel());
- pLayout->Release(); + nStrikeoutWidth = pLayout->GetTextWidth() / (nTestStrLen * pLayout->GetUnitsPerPixel());
- } pLayout->Release();
- if( nStrikeoutWidth <= 0 ) // sanity check }
- return; if( nStrikeoutWidth <= 0 ) // sanity check
- return;
- // calculate acceptable strikeout length - // calculate acceptable strikeout length
- // allow the strikeout to be one pixel larger than the text it strikes out - // allow the strikeout to be one pixel larger than the text it strikes out
- long nMaxWidth = nStrikeoutWidth / 2; - long nMaxWidth = nStrikeoutWidth / 2;
@ -52,7 +53,7 @@ index 02febe3..d43c163 100644
// if the text width is smaller than the strikeout text, then do not // if the text width is smaller than the strikeout text, then do not
// strike out at all. This case requires user interaction, e.g. adding // strike out at all. This case requires user interaction, e.g. adding
// a space to the text // a space to the text
@@ -4034,8 +4021,28 @@ @@ -4034,8 +4032,28 @@
ImplInitTextColor(); ImplInitTextColor();
pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY ); pLayout->DrawBase() = Point( nX+mnTextOffX, nY+mnTextOffY );

Loading…
Cancel
Save