summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2009-10-20 17:14:56 +0200
committerMichael Stahl <mst@openoffice.org>2009-10-20 17:14:56 +0200
commit5a6147930a6c122d5d5255a8227297286625a68b (patch)
treefa0a8eb42b798362c2f44c61ab51b286711dab07
parentb83220239cec81a050e63f41c32dc1e97fdd348e (diff)
#i106098#: SwFntObj::GetFontHeight(): make ASSERT rounding-tolerant
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 9952c50e678d..68034ae71941 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -386,7 +386,9 @@ USHORT SwFntObj::GetFontHeight( const ViewShell* pSh, const OutputDevice& rOut )
const FontMetric aOutMet( rRefDev.GetFontMetric() );
long nTmpPrtHeight = (USHORT)aOutMet.GetAscent() + aOutMet.GetDescent();
(void) nTmpPrtHeight;
- ASSERT( nTmpPrtHeight == nPrtHeight, "GetTextHeight != Ascent + Descent" )
+ // #i106098#: do not compare with == here due to rounding error
+ ASSERT( abs(nTmpPrtHeight - nPrtHeight) < 3,
+ "GetTextHeight != Ascent + Descent" );
#endif
((OutputDevice&)rRefDev).SetFont( aOldFnt );