Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi,

Released under the LGPLv3+ / MPL

Tested and runs under Debian Linux x86_64

Enjoy,
Chris Carpenter(mordocai)
From c32b2f44f347f9e9ea013791e7878f6651bfca41 Mon Sep 17 00:00:00 2001
From: Chris Carpenter(mordocai) <mordocai@gmail.com>
Date: Tue, 1 Feb 2011 23:39:29 -0600
Subject: [PATCH] Complete Easy Hack: Remove obsolete BmpColorMode enum

---
 vcl/inc/vcl/bitmap.hxx      |   10 +--------
 vcl/inc/vcl/bitmapex.hxx    |    2 +-
 vcl/inc/vcl/image.h         |    2 +-
 vcl/inc/vcl/outdev.hxx      |    2 -
 vcl/source/gdi/bitmap.cxx   |   32 ------------------------------
 vcl/source/gdi/bitmapex.cxx |   30 ----------------------------
 vcl/source/gdi/image.cxx    |   45 -------------------------------------------
 vcl/source/gdi/impimage.cxx |   18 -----------------
 8 files changed, 3 insertions(+), 138 deletions(-)

diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx
index 58195e9..dba8ba0 100644
--- a/vcl/inc/vcl/bitmap.hxx
+++ b/vcl/inc/vcl/bitmap.hxx
@@ -145,14 +145,6 @@ enum BmpFilter
 
 // ------------------------------------------------------------------------
 
-enum BmpColorMode
-{
-    BMP_COLOR_NORMAL = 0,
-    BMP_COLOR_HIGHCONTRAST = 1,
-    BMP_COLOR_MONOCHROME_BLACK = 2,
-    BMP_COLOR_MONOCHROME_WHITE = 3
-};
-
 // --------------------
 // - FilterParameters -
 // --------------------
@@ -362,7 +354,7 @@ public:
     ULONG                                      GetChecksum() const;
 
     Bitmap                  CreateDisplayBitmap( OutputDevice* pDisplay );
-    Bitmap                  GetColorTransformedBitmap( BmpColorMode eColorMode ) const;
+    Bitmap                  GetColorTransformedBitmap() const;
 
     static const BitmapPalette& GetGreyPalette( int nEntries );
 
diff --git a/vcl/inc/vcl/bitmapex.hxx b/vcl/inc/vcl/bitmapex.hxx
index 79cee21..4227b66 100644
--- a/vcl/inc/vcl/bitmapex.hxx
+++ b/vcl/inc/vcl/bitmapex.hxx
@@ -105,7 +105,7 @@ public:
     Bitmap                             GetBitmap( const Color* pTransReplaceColor = NULL ) const;
     Bitmap                             GetMask() const;
 
-    BitmapEx            GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const;
+    BitmapEx            GetColorTransformedBitmapEx() const;
 
     BOOL                               IsAlpha() const;
     AlphaMask                  GetAlpha() const;
diff --git a/vcl/inc/vcl/image.h b/vcl/inc/vcl/image.h
index 0234d57..a7a9a22 100644
--- a/vcl/inc/vcl/image.h
+++ b/vcl/inc/vcl/image.h
@@ -54,7 +54,7 @@ public:
     void               Replace( USHORT nPos, const BitmapEx& rBmpEx );
 
     void        ReplaceColors( const Color* pSrcColors, const Color* pDstColors, ULONG nColorCount 
);
-    void               ColorTransform( BmpColorMode eColorMode );
+    void               ColorTransform();
     void               Invert();
 
     BitmapEx   GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const;
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index e975de6..cef22b9 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -198,8 +198,6 @@ struct KerningPair
 #define IMAGE_DRAW_DEACTIVE             ((USHORT)0x0004)
 #define IMAGE_DRAW_COLORTRANSFORM              ((USHORT)0x0008)
 #define IMAGE_DRAW_SEMITRANSPARENT      ((USHORT)0x0010)
-#define IMAGE_DRAW_MONOCHROME_BLACK    ((USHORT)0x0020)
-#define IMAGE_DRAW_MONOCHROME_WHITE    ((USHORT)0x0040)
 #define IMAGE_DRAW_3DLOOK               0
 #define IMAGE_DRAW_BTNLOOK              0
 
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 8fa4ab6..543d948 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -1739,38 +1739,6 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay )
 
 // ------------------------------------------------------------------
 
-Bitmap Bitmap::GetColorTransformedBitmap( BmpColorMode eColorMode ) const
-{
-    Bitmap  aRet;
-    
-    if( BMP_COLOR_HIGHCONTRAST == eColorMode )
-    {
-        Color*  pSrcColors = NULL;
-        Color*  pDstColors = NULL;
-        ULONG   nColorCount = 0;
-        
-        aRet = *this;
-
-        Image::GetColorTransformArrays( (ImageColorTransform) eColorMode, pSrcColors, pDstColors, 
nColorCount );
-
-        if( nColorCount && pSrcColors && pDstColors )
-               aRet.Replace( pSrcColors, pDstColors, nColorCount ); 
-
-        delete[] pSrcColors;
-        delete[] pDstColors;
-    }
-    else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode ||
-             BMP_COLOR_MONOCHROME_WHITE == eColorMode )
-    {
-        aRet = *this;
-        aRet.MakeMono( BMP_COLOR_MONOCHROME_THRESHOLD );
-    }
-            
-    return aRet;
-}
-
-// ------------------------------------------------------------------
-
 BOOL Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
 {
     BitmapReadAccess*  pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index ccd2672..fc44917 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -298,36 +298,6 @@ Bitmap BitmapEx::GetBitmap( const Color* pTransReplaceColor ) const
 
 // ------------------------------------------------------------------
 
-BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const
-{
-    BitmapEx aRet;
-    
-    if( BMP_COLOR_HIGHCONTRAST == eColorMode )
-    {
-        aRet = *this;
-        aRet.aBitmap = aBitmap.GetColorTransformedBitmap( eColorMode );
-    }
-    else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode ||
-             BMP_COLOR_MONOCHROME_WHITE == eColorMode )
-    {
-        aRet = *this;
-        aRet.aBitmap = aRet.aBitmap.GetColorTransformedBitmap( eColorMode );
-        
-        if( !aRet.aMask.IsEmpty() )
-        {
-            aRet.aMask.CombineSimple( aRet.aBitmap, BMP_COMBINE_OR );
-            aRet.aBitmap.Erase( ( BMP_COLOR_MONOCHROME_BLACK == eColorMode ) ? COL_BLACK : 
COL_WHITE );
-
-            DBG_ASSERT( aRet.aBitmap.GetSizePixel() == aRet.aMask.GetSizePixel(),
-                        "BitmapEx::GetColorTransformedBitmapEx(): size mismatch for bitmap and 
alpha mask." );
-        }
-    }
-
-    return aRet;
-}
-
-// ------------------------------------------------------------------
-
 Bitmap BitmapEx::GetMask() const
 {
     Bitmap aRet( aMask );
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index 5dff935..73dacff 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -275,51 +275,6 @@ uno::Reference< graphic::XGraphic > Image::GetXGraphic() const
 
 // -----------------------------------------------------------------------
 
-Image Image::GetColorTransformedImage( ImageColorTransform eColorTransform ) const
-{
-    DBG_CHKTHIS( Image, NULL );
-
-    Image aRet;
-
-    if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
-    {
-        BitmapEx aBmpEx( GetBitmapEx() );
-
-        if( !aBmpEx.IsEmpty() )
-        {
-            Color*  pSrcColors = NULL;
-            Color*  pDstColors = NULL;
-            ULONG   nColorCount = 0;
-
-            Image::GetColorTransformArrays( eColorTransform, pSrcColors, pDstColors, nColorCount );
-
-            if( nColorCount && pSrcColors && pDstColors )
-            {
-                aBmpEx.Replace( pSrcColors, pDstColors, nColorCount ); 
-                aRet = Image( aBmpEx );
-            }
-
-            delete[] pSrcColors;
-            delete[] pDstColors;
-        }
-    }
-    else if( IMAGECOLORTRANSFORM_MONOCHROME_BLACK == eColorTransform ||
-             IMAGECOLORTRANSFORM_MONOCHROME_WHITE == eColorTransform  )
-    {
-        BitmapEx aBmpEx( GetBitmapEx() );
-
-        if( !aBmpEx.IsEmpty() )
-            aRet = Image( aBmpEx.GetColorTransformedBitmapEx( ( BmpColorMode )( eColorTransform ) 
) );
-    }
-
-    if( !aRet )
-        aRet = *this;
-
-    return aRet;
-}
-
-// -----------------------------------------------------------------------
-
 void Image::Invert()
 {
     BitmapEx aInvertedBmp( GetBitmapEx() );
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index ad91356..7775d01 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -347,15 +347,6 @@ void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* 
pDstColo
 
 // -----------------------------------------------------------------------
 
-void ImplImageBmp::ColorTransform( BmpColorMode eColorMode )
-{
-    maBmpEx = maBmpEx.GetColorTransformedBitmapEx( eColorMode );
-    delete mpDisplayBmp;
-    mpDisplayBmp = NULL;
-}
-
-// -----------------------------------------------------------------------
-
 BitmapEx ImplImageBmp::GetBitmapEx( USHORT nPosCount, USHORT* pPosAry ) const
 {
     const Bitmap       aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ),  
maBmpEx.GetBitmap().GetBitCount() );
@@ -405,7 +396,6 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
         else
         {
             if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM |
-                           IMAGE_DRAW_MONOCHROME_BLACK | IMAGE_DRAW_MONOCHROME_WHITE |
                            IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE | IMAGE_DRAW_SEMITRANSPARENT 
) )
             {
                 BitmapEx        aTmpBmpEx;
@@ -418,14 +408,6 @@ void ImplImageBmp::Draw( USHORT nPos, OutputDevice* pOutDev,
 
                 aTmpBmpEx.Crop( aCropRect );
 
-                if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM | IMAGE_DRAW_MONOCHROME_BLACK | 
IMAGE_DRAW_MONOCHROME_WHITE ) )
-                {
-                    const BmpColorMode eMode = ( nStyle & IMAGE_DRAW_COLORTRANSFORM ) ? 
BMP_COLOR_HIGHCONTRAST :
-                                                ( ( nStyle & IMAGE_DRAW_MONOCHROME_BLACK ) ? 
BMP_COLOR_MONOCHROME_BLACK : BMP_COLOR_MONOCHROME_WHITE );
-
-                    aTmpBmpEx = aTmpBmpEx.GetColorTransformedBitmapEx( eMode );
-                }
-
                 Bitmap aTmpBmp( aTmpBmpEx.GetBitmap() );
 
                 if( nStyle & ( IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE ) )
-- 
1.7.2.3

From 001c18a86ff19db71ff1dc6fb4775f65929d311c Mon Sep 17 00:00:00 2001
From: Chris Carpenter(mordocai) <mordocai@gmail.com>
Date: Tue, 1 Feb 2011 23:39:08 -0600
Subject: [PATCH] Complete Easy Hack: Remove obsolete BmpColorMode enum

---
 svx/source/form/filtnav.cxx |    8 ++++----
 svx/source/inc/filtnav.hxx  |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 36b6aca..f992da4 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -150,7 +150,7 @@ OLocalExchange* OFilterExchangeHelper::createExchange() const
 
 //========================================================================
 TYPEINIT0(FmFilterData);
-Image FmFilterData::GetImage( BmpColorMode /*_eMode*/ ) const
+Image FmFilterData::GetImage() const
 {
     return Image();
 }
@@ -168,7 +168,7 @@ FmParentData::~FmParentData()
 //========================================================================
 TYPEINIT1(FmFormItem, FmParentData);
 //------------------------------------------------------------------------
-Image FmFormItem::GetImage( BmpColorMode /* _eMode */) const
+Image FmFormItem::GetImage() const
 {
     static Image aImage;
 
@@ -199,7 +199,7 @@ FmFilterItem* FmFilterItems::Find( const ::sal_Int32 _nFilterComponentIndex ) co
 }
 
 //------------------------------------------------------------------------
-Image FmFilterItems::GetImage( BmpColorMode /* _eMode */ ) const
+Image FmFilterItems::GetImage() const
 {
     static Image aImage;
 
@@ -226,7 +226,7 @@ FmFilterItem::FmFilterItem( const Reference< XMultiServiceFactory >& _rxFactory,
 }
 
 //------------------------------------------------------------------------
-Image FmFilterItem::GetImage( BmpColorMode /* _eMode */ ) const
+Image FmFilterItem::GetImage() const
 {
     static Image aImage;
 
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index 8e53093..d93caef 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -86,7 +86,7 @@ public:
     ::rtl::OUString  GetText() const { return m_aText; }
     FmParentData* GetParent() const {return m_pParent;}
 
-    virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+    virtual Image GetImage() const;
 };
 
 //========================================================================
@@ -130,7 +130,7 @@ public:
     inline const ::com::sun::star::uno::Reference< 
::com::sun::star::form::runtime::XFilterController >&
         GetFilterController() { return m_xFilterController; }
 
-    virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+    virtual Image GetImage() const;
 };
 
 //========================================================================
@@ -142,7 +142,7 @@ public:
     FmFilterItems(const ::com::sun::star::uno::Reference< 
::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,FmFormItem* pParent, const 
::rtl::OUString& rText ):FmParentData(_rxFactory,pParent, rText){}
 
     FmFilterItem* Find( const ::sal_Int32 _nFilterComponentIndex ) const;      
-    virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+    virtual Image GetImage() const;
 };
 
 //========================================================================
@@ -164,7 +164,7 @@ public:
     const ::rtl::OUString& GetFieldName() const {return m_aFieldName;}
     sal_Int32 GetComponentIndex() const { return m_nComponentIndex; }
 
-    virtual Image GetImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+    virtual Image GetImage() const;
 };
 
 //========================================================================
-- 
1.7.2.3

From a89fb085b08ca4c1d0d566f0d4424d3bcabf2bac Mon Sep 17 00:00:00 2001
From: Chris Carpenter(mordocai) <mordocai@gmail.com>
Date: Tue, 1 Feb 2011 23:37:50 -0600
Subject: [PATCH] Complete Easy Hack: Remove obsolete BmpColorMode enum

---
 binfilter/bf_sfx2/source/doc/sfx2_objcont.cxx |    1 -
 binfilter/inc/bf_sfx2/objsh.hxx               |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/binfilter/bf_sfx2/source/doc/sfx2_objcont.cxx 
b/binfilter/bf_sfx2/source/doc/sfx2_objcont.cxx
index d1db80b..8b981b4 100644
--- a/binfilter/bf_sfx2/source/doc/sfx2_objcont.cxx
+++ b/binfilter/bf_sfx2/source/doc/sfx2_objcont.cxx
@@ -407,7 +407,6 @@ using namespace ::com::sun::star::uno;
 /*N*/ void   SfxObjectShell::GetContent(String & /*rText*/,
 /*N*/                                                            Bitmap & /*rClosedBitmap*/,
 /*N*/                                                            Bitmap & /*rOpenedBitmap*/,
-/*N*/                                                            BmpColorMode /*eColorMode*/,
 /*N*/                                                            BOOL & /*bCanDel*/,
 /*N*/                                                            USHORT /*i*/,
 /*N*/                                                            USHORT /*nIdx1*/,
diff --git a/binfilter/inc/bf_sfx2/objsh.hxx b/binfilter/inc/bf_sfx2/objsh.hxx
index a06e1d5..15ffbe4 100644
--- a/binfilter/inc/bf_sfx2/objsh.hxx
+++ b/binfilter/inc/bf_sfx2/objsh.hxx
@@ -348,7 +348,6 @@ public:
     virtual void                               GetContent( String &,
                                         Bitmap &rClosedBitmap,
                                         Bitmap &rOpenedBitmap,
-                                        BmpColorMode eColorMode,
                                         sal_Bool   &bCanDelete,
                                         sal_uInt16 nPos,
                                         sal_uInt16 nIdx1,
-- 
1.7.2.3


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.