View | Details | Raw Unified | Return to issue 120165
Collapse All | Expand All

(-)original/source/graphic/grfmgr2.cxx (-6 / +18 lines)
Lines 1205-1210 Link Here
1205
		}
1205
		}
1206
		else
1206
		else
1207
		{
1207
		{
1208
            //Some abnormal .svm file may hit this assertion( sample file of Bug 120165 ) 
1208
            DBG_ASSERT( rBmpEx.GetMask().GetSizePixel() == rBmpEx.GetSizePixel(),
1209
            DBG_ASSERT( rBmpEx.GetMask().GetSizePixel() == rBmpEx.GetSizePixel(),
1209
                        "GraphicManager::ImplCreateScaled(): mask size inconsistent" );
1210
                        "GraphicManager::ImplCreateScaled(): mask size inconsistent" );
1210
1211
Lines 1240-1256 Link Here
1240
					for( nY = 0UL, nTmpY = nStartY; nY < nDstH; nTmpY++ )
1241
					for( nY = 0UL, nTmpY = nStartY; nY < nDstH; nTmpY++ )
1241
						pMapLY[ nY++ ] = FRound( (double) pMapIY[ nTmpY ] + pMapFY[ nTmpY ] / 1048576. );
1242
						pMapLY[ nY++ ] = FRound( (double) pMapIY[ nTmpY ] + pMapFY[ nTmpY ] / 1048576. );
1242
1243
1244
                    //Bug 120165 
1245
                    //Here pMapLY is calculated from pMapIY&pMapFY, and pMapIY&pMapFY is calculated from the height of rBmpEx.GetSizePixel() In function "GraphicManager::ImplCreateOutput"
1246
                    //rBmpEx.GetSizePixel() should be equal to rBmpEx.GetMask().GetSizePixel() usually. But in some .svm file, rBmpEx.GetMask() may be smaller than rBmpEx.GetBitmap()
1247
                    long nDstWV( nDstW ), nDstHV( nDstH );
1248
                    
1249
                    if( rBmpEx.GetMask().GetSizePixel() != rBmpEx.GetSizePixel() ) //abnormal BitmapEx whose mask does not have the same size as its Bitmap
1250
                    {
1251
                        for( const unsigned nWMask( pAcc->Width() ); nDstWV > 0 && pMapLX[ nDstWV - 1 ] >= nWMask; nDstWV -- );
1252
                        for( const unsigned nHMask( pAcc->Height() ); nDstHV > 0 && pMapLY[ nDstHV - 1 ] >= nHMask; nDstHV -- );
1253
                    }
1254
1243
					// do normal scaling
1255
					// do normal scaling
1244
					if( pAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
1256
					if( pAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL &&
1245
						pWAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL )
1257
						pWAcc->GetScanlineFormat() == BMP_FORMAT_1BIT_MSB_PAL )
1246
					{
1258
					{
1247
						// optimized
1259
						// optimized
1248
						for( nY = 0; nY < nDstH; nY++ )
1260
						for( nY = 0; nY < nDstHV; nY++ )
1249
						{
1261
						{
1250
							Scanline pSrc = pAcc->GetScanline( pMapLY[ nY ] );
1262
							Scanline pSrc = pAcc->GetScanline( pMapLY[ nY ] );
1251
							Scanline pDst = pWAcc->GetScanline( nY );
1263
							Scanline pDst = pWAcc->GetScanline( nY );
1252
1264
1253
							for( nX = 0L; nX < nDstW; nX++ )
1265
							for( nX = 0L; nX < nDstWV; nX++ )
1254
							{
1266
							{
1255
								const long nSrcX = pMapLX[ nX ];
1267
								const long nSrcX = pMapLX[ nX ];
1256
1268
Lines 1269-1277 Link Here
1269
1281
1270
						if( pAcc->HasPalette() )
1282
						if( pAcc->HasPalette() )
1271
						{
1283
						{
1272
							for( nY = 0L; nY < nDstH; nY++ )
1284
							for( nY = 0L; nY < nDstHV; nY++ )
1273
							{
1285
							{
1274
								for( nX = 0L; nX < nDstW; nX++ )
1286
								for( nX = 0L; nX < nDstWV; nX++ )
1275
								{
1287
								{
1276
									if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
1288
									if( pAcc->GetPaletteColor( (sal_uInt8) pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) ) == aB )
1277
										pWAcc->SetPixel( nY, nX, aWB );
1289
										pWAcc->SetPixel( nY, nX, aWB );
Lines 1282-1290 Link Here
1282
						}
1294
						}
1283
						else
1295
						else
1284
						{
1296
						{
1285
							for( nY = 0L; nY < nDstH; nY++ )
1297
							for( nY = 0L; nY < nDstHV; nY++ )
1286
							{
1298
							{
1287
								for( nX = 0L; nX < nDstW; nX++ )
1299
								for( nX = 0L; nX < nDstWV; nX++ )
1288
								{
1300
								{
1289
									if( pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) == aB )
1301
									if( pAcc->GetPixel( pMapLY[ nY ], pMapLX[ nX ] ) == aB )
1290
										pWAcc->SetPixel( nY, nX, aWB );
1302
										pWAcc->SetPixel( nY, nX, aWB );

Return to issue 120165