Kaydet (Commit) d7a4a5b2 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

The "source size" of a VCL bitmap is not used for anything

Thorsten thought it might have been used for to the handling of the "Original
Size" functionality originally. That seems slightly broken currently in some
use cases, and this change doesn't make it any worse. (To see the brokenness,
play with resizing an image, reloading the document, and using "Original
Size". With the right sequence of actions, LO seems to think that the
"original size" is very small (1x1 pixel perhaps).)

Change-Id: I4e0852d2b367def5bc40baf95aac273d59731eec
üst 86ecd956
...@@ -394,13 +394,6 @@ public: ...@@ -394,13 +394,6 @@ public:
Size GetSizePixel() const; Size GetSizePixel() const;
/**
* The pixel size of a bitmap's source (e.g. an image file)
* and the pixel size of its resulting bitmap can differ,
* e.g. when the image reader has its preview mode enabled.
*/
void SetSourceSizePixel( const Size& );
sal_uInt16 GetBitCount() const; sal_uInt16 GetBitCount() const;
inline sal_uLong GetColorCount() const; inline sal_uLong GetColorCount() const;
inline sal_uLong GetSizeBytes() const; inline sal_uLong GetSizeBytes() const;
......
...@@ -43,7 +43,6 @@ private: ...@@ -43,7 +43,6 @@ private:
sal_uLong mnRefCount; sal_uLong mnRefCount;
sal_uLong mnChecksum; sal_uLong mnChecksum;
SalBitmap* mpSalBitmap; SalBitmap* mpSalBitmap;
Size maSourceSize;
public: public:
...@@ -63,8 +62,6 @@ public: ...@@ -63,8 +62,6 @@ public:
sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount ); sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
Size ImplGetSize() const; Size ImplGetSize() const;
Size ImplGetSourceSize() const;
void ImplSetSourceSize( const Size&);
sal_uInt16 ImplGetBitCount() const; sal_uInt16 ImplGetBitCount() const;
BitmapBuffer* ImplAcquireBuffer( sal_Bool bReadOnly ); BitmapBuffer* ImplAcquireBuffer( sal_Bool bReadOnly );
...@@ -80,16 +77,6 @@ public: ...@@ -80,16 +77,6 @@ public:
inline sal_uLong ImplGetChecksum() const { return mnChecksum; } inline sal_uLong ImplGetChecksum() const { return mnChecksum; }
}; };
inline Size ImpBitmap::ImplGetSourceSize() const
{
return maSourceSize;
}
inline void ImpBitmap::ImplSetSourceSize( const Size& rSize)
{
maSourceSize = rSize;
}
#endif // INCLUDED_VCL_INC_IMPBMP_HXX #endif // INCLUDED_VCL_INC_IMPBMP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -262,12 +262,6 @@ Size Bitmap::GetSizePixel() const ...@@ -262,12 +262,6 @@ Size Bitmap::GetSizePixel() const
return( mpImpBmp ? mpImpBmp->ImplGetSize() : Size() ); return( mpImpBmp ? mpImpBmp->ImplGetSize() : Size() );
} }
void Bitmap::SetSourceSizePixel( const Size& rSize)
{
if( mpImpBmp )
mpImpBmp->ImplSetSourceSize( rSize);
}
sal_uInt16 Bitmap::GetBitCount() const sal_uInt16 Bitmap::GetBitCount() const
{ {
return( mpImpBmp ? mpImpBmp->ImplGetBitCount() : 0 ); return( mpImpBmp ? mpImpBmp->ImplGetBitCount() : 0 );
......
...@@ -32,8 +32,7 @@ ...@@ -32,8 +32,7 @@
ImpBitmap::ImpBitmap() : ImpBitmap::ImpBitmap() :
mnRefCount ( 1UL ), mnRefCount ( 1UL ),
mnChecksum ( 0UL ), mnChecksum ( 0UL ),
mpSalBitmap ( ImplGetSVData()->mpDefInst->CreateSalBitmap() ), mpSalBitmap ( ImplGetSVData()->mpDefInst->CreateSalBitmap() )
maSourceSize( 0, 0 )
{ {
} }
...@@ -54,7 +53,6 @@ void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap ) ...@@ -54,7 +53,6 @@ void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap )
sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ) sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
{ {
maSourceSize = rSize;
return mpSalBitmap->Create( rSize, nBitCount, rPal ); return mpSalBitmap->Create( rSize, nBitCount, rPal );
} }
...@@ -62,7 +60,6 @@ sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const B ...@@ -62,7 +60,6 @@ sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const B
sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap ) sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
{ {
maSourceSize = rImpBitmap.maSourceSize;
mnChecksum = rImpBitmap.mnChecksum; mnChecksum = rImpBitmap.mnChecksum;
return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap ); return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap );
} }
......
...@@ -652,8 +652,6 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) ...@@ -652,8 +652,6 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
if( !mpAcc ) if( !mpAcc )
return false; return false;
mpBmp->SetSourceSizePixel( maOrigSize );
if ( mbAlphaChannel ) if ( mbAlphaChannel )
{ {
mpAlphaMask = new AlphaMask( maTargetSize ); mpAlphaMask = new AlphaMask( maTargetSize );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment