From 3b7d4a219c8fd978a6d93db36646e40f5b50825c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Thu, 27 Jan 2005 15:13:57 +0000 Subject: [PATCH] INTEGRATION: CWS sj14 (1.5.22); FILE MERGED 2005/01/11 11:11:27 sj 1.5.22.1: #i40320# solved overrun when calculating max pixel size --- goodies/source/base3d/b3ddeflt.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/goodies/source/base3d/b3ddeflt.cxx b/goodies/source/base3d/b3ddeflt.cxx index ff4adec8606f..e588fb8b6f8c 100644 --- a/goodies/source/base3d/b3ddeflt.cxx +++ b/goodies/source/base3d/b3ddeflt.cxx @@ -2,9 +2,9 @@ * * $RCSfile: b3ddeflt.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: hr $ $Date: 2004-09-09 11:24:50 $ + * last change: $Author: rt $ $Date: 2005-01-27 16:13:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -408,12 +408,14 @@ void Base3DDefault::SetTransformationSet(B3dTransformationSet* pSet) // Testen, ob die Bitmap zu gross wird aLocalSizePixel = aSizePixel; - long nQuadSize = aLocalSizePixel.GetWidth() * aLocalSizePixel.GetHeight(); - if(nQuadSize > GetMaxPixels()) + double fQuadSize = aLocalSizePixel.GetWidth(); // sj: #i40320# solved overrun + fQuadSize *= aLocalSizePixel.GetHeight(); + + if( fQuadSize > GetMaxPixels() ) { // Groesse reduzieren - double fFactor = sqrt((double)GetMaxPixels() / (double)nQuadSize); + double fFactor = sqrt((double)GetMaxPixels() / fQuadSize); // Bei Druckjobs die Reduzierung einschraenken if(fFactor < 0.25 && GetOutputDevice()->GetOutDevType() == OUTDEV_PRINTER)