[Libreoffice-commits] core.git: 3 commits - include/vcl vcl/inc vcl/source

Tor Lillqvist tml at collabora.com
Thu Oct 31 23:19:41 CET 2013


 include/vcl/bitmap.hxx     |    7 ------
 vcl/inc/impbmp.hxx         |   46 ++++++++-------------------------------------
 vcl/source/gdi/bitmap.cxx  |    6 -----
 vcl/source/gdi/impbmp.cxx  |   32 ++-----------------------------
 vcl/source/gdi/impvect.cxx |    3 --
 vcl/source/gdi/pngread.cxx |    2 -
 6 files changed, 12 insertions(+), 84 deletions(-)

New commits:
commit 8204fadf2089d1c0eeb65a409fe3964d1537c765
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 31 16:08:29 2013 +0200

    Bin dead code
    
    Change-Id: I7c3ae0afd6740df326a5c74826e7f204e9df2219

diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index 027a416..7c5ed11 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -275,9 +275,6 @@ private:
 
     void            ImplGetSpace();
 
-    void            ImplCreate();
-    void            ImplCreateInner();
-    void            ImplCreateOuter();
     void            ImplPostProcess( const ImplPointArray& rArr );
 
 public:
commit d68e1a2fcccf0e61c3b480c94c226ee1a58c7da1
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 31 16:05:34 2013 +0200

    Cosmetics and style cleanups
    
    Change-Id: I45b072e5d6a216f0b82f7a0b3a4554ef4cc3570f

diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index b29cabe..31b6e43 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -23,58 +23,43 @@
 #include <tools/gen.hxx>
 #include <tools/solar.h>
 
-// ---------------
-// - ImpBitmap -
-// ---------------
-
 struct BitmapBuffer;
 class SalBitmap;
 class BitmapPalette;
 class SalGraphics;
 class Bitmap;
-class OutputDevice;
-class Color;
-class AlphaMask;
 
 class ImpBitmap
 {
 private:
-
-    sal_uLong               mnRefCount;
-    sal_uLong               mnChecksum;
+    sal_uLong           mnRefCount;
+    sal_uLong           mnChecksum;
     SalBitmap*          mpSalBitmap;
 
 public:
-
                         ImpBitmap();
                         ~ImpBitmap();
 
-public:
-
     void                ImplSetSalBitmap( SalBitmap* pSalBitmap );
     SalBitmap*          ImplGetSalBitmap() const { return mpSalBitmap; }
 
-public:
-
-    sal_Bool                ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
-    sal_Bool                ImplCreate( const ImpBitmap& rImpBitmap );
-    sal_Bool                ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
-    sal_Bool                ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
+    sal_Bool            ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
+    sal_Bool            ImplCreate( const ImpBitmap& rImpBitmap );
+    sal_Bool            ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
+    sal_Bool            ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
 
     Size                ImplGetSize() const;
-    sal_uInt16              ImplGetBitCount() const;
+    sal_uInt16          ImplGetBitCount() const;
 
     BitmapBuffer*       ImplAcquireBuffer( sal_Bool bReadOnly );
     void                ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly );
 
-public:
-
-    sal_uLong               ImplGetRefCount() const { return mnRefCount; }
+    sal_uLong           ImplGetRefCount() const { return mnRefCount; }
     void                ImplIncRefCount() { mnRefCount++; }
     void                ImplDecRefCount() { mnRefCount--; }
 
     inline void         ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
-    inline sal_uLong        ImplGetChecksum() const { return mnChecksum; }
+    inline sal_uLong    ImplGetChecksum() const { return mnChecksum; }
 };
 
 #endif // INCLUDED_VCL_INC_IMPBMP_HXX
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 7181c0d..852f211 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -25,83 +25,60 @@
 #include <salbmp.hxx>
 #include <impbmp.hxx>
 
-// --------------
-// - ImpBitmap  -
-// --------------
-
 ImpBitmap::ImpBitmap() :
-            mnRefCount  ( 1UL ),
-            mnChecksum  ( 0UL ),
+            mnRefCount  ( 1 ),
+            mnChecksum  ( 0 ),
             mpSalBitmap ( ImplGetSVData()->mpDefInst->CreateSalBitmap() )
 {
 }
 
-// -----------------------------------------------------------------------
-
 ImpBitmap::~ImpBitmap()
 {
     delete mpSalBitmap;
 }
 
-// -----------------------------------------------------------------------
 void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap )
 {
     delete mpSalBitmap, mpSalBitmap = pBitmap;
 }
 
-// -----------------------------------------------------------------------
-
 sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
 {
     return mpSalBitmap->Create( rSize, nBitCount, rPal );
 }
 
-// -----------------------------------------------------------------------
-
 sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
 {
     mnChecksum = rImpBitmap.mnChecksum;
     return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap );
 }
 
-// -----------------------------------------------------------------------
-
 sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics )
 {
     return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, pGraphics );
 }
 
-// -----------------------------------------------------------------------
-
 sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount )
 {
     return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap, nNewBitCount );
 }
 
-// -----------------------------------------------------------------------
-
 Size ImpBitmap::ImplGetSize() const
 {
     return mpSalBitmap->GetSize();
 }
 
-// -----------------------------------------------------------------------
-
 sal_uInt16 ImpBitmap::ImplGetBitCount() const
 {
     sal_uInt16 nBitCount = mpSalBitmap->GetBitCount();
     return( ( nBitCount <= 1 ) ? 1 : ( nBitCount <= 4 ) ? 4 : ( nBitCount <= 8 ) ? 8 : 24 );
 }
 
-// -----------------------------------------------------------------------
-
 BitmapBuffer* ImpBitmap::ImplAcquireBuffer( sal_Bool bReadOnly )
 {
     return mpSalBitmap->AcquireBuffer( bReadOnly );
 }
 
-// -----------------------------------------------------------------------
-
 void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly )
 {
     mpSalBitmap->ReleaseBuffer( pBuffer, bReadOnly );
commit d7a4a5b26813c94398aa51c3e817e882aba299ba
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 31 15:26:51 2013 +0200

    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

diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx
index e5e3d61..adf6b63 100644
--- a/include/vcl/bitmap.hxx
+++ b/include/vcl/bitmap.hxx
@@ -394,13 +394,6 @@ public:
 
     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;
     inline sal_uLong            GetColorCount() const;
     inline sal_uLong            GetSizeBytes() const;
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index fa48db1..b29cabe 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -43,7 +43,6 @@ private:
     sal_uLong               mnRefCount;
     sal_uLong               mnChecksum;
     SalBitmap*          mpSalBitmap;
-    Size                maSourceSize;
 
 public:
 
@@ -63,8 +62,6 @@ public:
     sal_Bool                ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
 
     Size                ImplGetSize() const;
-    Size                ImplGetSourceSize() const;
-    void                ImplSetSourceSize( const Size&);
     sal_uInt16              ImplGetBitCount() const;
 
     BitmapBuffer*       ImplAcquireBuffer( sal_Bool bReadOnly );
@@ -80,16 +77,6 @@ public:
     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
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 7ba90c7..41fff74 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -262,12 +262,6 @@ Size Bitmap::GetSizePixel() const
     return( mpImpBmp ? mpImpBmp->ImplGetSize() : Size() );
 }
 
-void Bitmap::SetSourceSizePixel( const Size& rSize)
-{
-    if( mpImpBmp )
-        mpImpBmp->ImplSetSourceSize( rSize);
-}
-
 sal_uInt16 Bitmap::GetBitCount() const
 {
     return( mpImpBmp ? mpImpBmp->ImplGetBitCount() : 0 );
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 5148163..7181c0d 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -32,8 +32,7 @@
 ImpBitmap::ImpBitmap() :
             mnRefCount  ( 1UL ),
             mnChecksum  ( 0UL ),
-            mpSalBitmap ( ImplGetSVData()->mpDefInst->CreateSalBitmap() ),
-            maSourceSize( 0, 0 )
+            mpSalBitmap ( ImplGetSVData()->mpDefInst->CreateSalBitmap() )
 {
 }
 
@@ -54,7 +53,6 @@ void ImpBitmap::ImplSetSalBitmap( SalBitmap* pBitmap )
 
 sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal )
 {
-    maSourceSize = rSize;
     return mpSalBitmap->Create( rSize, nBitCount, rPal );
 }
 
@@ -62,7 +60,6 @@ sal_Bool ImpBitmap::ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const B
 
 sal_Bool ImpBitmap::ImplCreate( const ImpBitmap& rImpBitmap )
 {
-    maSourceSize = rImpBitmap.maSourceSize;
     mnChecksum = rImpBitmap.mnChecksum;
     return mpSalBitmap->Create( *rImpBitmap.mpSalBitmap );
 }
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index ad5eff0..1dc4f4d 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -652,8 +652,6 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint )
     if( !mpAcc )
         return false;
 
-    mpBmp->SetSourceSizePixel( maOrigSize );
-
     if ( mbAlphaChannel )
     {
         mpAlphaMask = new AlphaMask( maTargetSize );


More information about the Libreoffice-commits mailing list