[Libreoffice-commits] .: svtools/inc svtools/source
Sebastian Spaeth
spaetz at kemper.freedesktop.org
Fri Nov 12 01:26:23 PST 2010
svtools/inc/svtools/svlbitm.hxx | 38 +++++++++--------------
svtools/source/contnr/svlbitm.cxx | 62 +++++++-------------------------------
2 files changed, 28 insertions(+), 72 deletions(-)
New commits:
commit 86030e1ad6d9d3951083fb939534368492646efa
Author: Joseph Powers <jpowers27 at cox.net>
Date: Thu Nov 11 12:19:18 2010 -0800
Removed BmpColorMode (SvLBoxContextBmp_Impl and SvLBoxButtonData) - libs-gui
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index bdc2e2e..87a1ad0 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -251,43 +251,37 @@ public:
void Clone( SvLBoxItem* pSource );
- BOOL SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode = BMP_COLOR_NORMAL );
- void GetModeImages( Image& _rBitmap1, Image& _rBitmap2, BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+ BOOL SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 );
+ void GetModeImages( Image& _rBitmap1, Image& _rBitmap2 ) const;
- inline void SetBitmap1( const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
- inline void SetBitmap2( const Image& _rImage, BmpColorMode _eMode = BMP_COLOR_NORMAL );
- inline const Image& GetBitmap1( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
- inline const Image& GetBitmap2( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const;
+ inline void SetBitmap1( const Image& _rImage );
+ inline void SetBitmap2( const Image& _rImage );
+ inline const Image& GetBitmap1( ) const;
+ inline const Image& GetBitmap2( ) const;
private:
- Image& implGetImageStore( sal_Bool _bFirst, BmpColorMode _eMode );
+ Image& implGetImageStore( sal_Bool _bFirst );
};
-inline void SvLBoxContextBmp::SetBitmap1( const Image& _rImage, BmpColorMode _eMode )
+inline void SvLBoxContextBmp::SetBitmap1( const Image& _rImage )
{
- implGetImageStore( sal_True, _eMode ) = _rImage;
+ implGetImageStore( sal_True ) = _rImage;
}
-inline void SvLBoxContextBmp::SetBitmap2( const Image& _rImage, BmpColorMode _eMode )
+inline void SvLBoxContextBmp::SetBitmap2( const Image& _rImage )
{
- implGetImageStore( sal_False, _eMode ) = _rImage;
+ implGetImageStore( sal_False ) = _rImage;
}
-inline const Image& SvLBoxContextBmp::GetBitmap1( BmpColorMode _eMode ) const
+inline const Image& SvLBoxContextBmp::GetBitmap1( ) const
{
- Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True, _eMode );
- if ( !rImage )
- // fallback to the "normal" image
- rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True, BMP_COLOR_NORMAL );
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True );
return rImage;
}
-inline const Image& SvLBoxContextBmp::GetBitmap2( BmpColorMode _eMode ) const
+inline const Image& SvLBoxContextBmp::GetBitmap2( ) const
{
- Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_False, _eMode );
- if ( !rImage )
- // fallback to the "normal" image
- rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_True, BMP_COLOR_NORMAL );
+ Image& rImage = const_cast< SvLBoxContextBmp* >( this )->implGetImageStore( sal_False );
return rImage;
}
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 0803be3..7b12ce6 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -201,7 +201,7 @@ BOOL SvLBoxButtonData::HasDefaultImages( void ) const
}
BOOL SvLBoxButtonData::IsRadio() {
- return pImpl->bShowRadioButton;
+ return pImpl->bShowRadioButton;
}
// ***************************************************************
@@ -246,7 +246,7 @@ void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
}
else
rDev.DrawText( rPos, aStr);
-
+
}
SvLBoxItem* SvLBoxString::Create() const
@@ -412,7 +412,7 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
? SV_BMP_STATICIMAGE : pData->GetIndex( nItemFlags );
USHORT nStyle = eKind != SvLBoxButtonKind_disabledCheckbox &&
rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
-
+
///
//Native drawing
///
@@ -420,13 +420,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
Window *pWin = NULL;
if( rDev.GetOutDevType() == OUTDEV_WINDOW )
pWin = (Window*) &rDev;
-
+
if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
{
ImplControlValue aControlValue;
Rectangle aCtrlRegion( rPos, Size(pData->Width(), pData->Height()) );
ControlState nState = 0;
-
+
//states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
if ( IsStateHilighted() ) nState |= CTRL_STATE_FOCUSED;
if ( nStyle != IMAGE_DRAW_DISABLE ) nState |= CTRL_STATE_ENABLED;
@@ -442,7 +442,7 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
aCtrlRegion, nState, aControlValue, rtl::OUString() );
}
- if( !bNativeOK)
+ if( !bNativeOK)
rDev.DrawImage( rPos, pData->aBmps[nIndex + nBaseOffs] ,nStyle);
}
@@ -483,9 +483,6 @@ struct SvLBoxContextBmp_Impl
Image m_aImage1;
Image m_aImage2;
- Image m_aImage1_hc;
- Image m_aImage2_hc;
-
USHORT m_nB2IndicatorFlags;
};
@@ -523,47 +520,20 @@ USHORT SvLBoxContextBmp::IsA()
return SV_ITEM_ID_LBOXCONTEXTBMP;
}
-BOOL SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2, BmpColorMode _eMode )
+BOOL SvLBoxContextBmp::SetModeImages( const Image& _rBitmap1, const Image& _rBitmap2 )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
sal_Bool bSuccess = sal_True;
- switch ( _eMode )
- {
- case BMP_COLOR_NORMAL:
- m_pImpl->m_aImage1 = _rBitmap1;
- m_pImpl->m_aImage2 = _rBitmap2;
- break;
-
- case BMP_COLOR_HIGHCONTRAST:
- m_pImpl->m_aImage1_hc = _rBitmap1;
- m_pImpl->m_aImage2_hc = _rBitmap2;
- break;
-
- default:
- DBG_ERROR( "SvLBoxContextBmp::SetModeImages: unexpected mode!");
- bSuccess = sal_False;
- break;
- }
+ m_pImpl->m_aImage1 = _rBitmap1;
+ m_pImpl->m_aImage2 = _rBitmap2;
return bSuccess;
}
-Image& SvLBoxContextBmp::implGetImageStore( sal_Bool _bFirst, BmpColorMode _eMode )
+Image& SvLBoxContextBmp::implGetImageStore( sal_Bool _bFirst )
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
- switch ( _eMode )
- {
- case BMP_COLOR_NORMAL:
- return _bFirst ? m_pImpl->m_aImage1 : m_pImpl->m_aImage2;
-
- case BMP_COLOR_HIGHCONTRAST:
- return _bFirst ? m_pImpl->m_aImage1_hc : m_pImpl->m_aImage2_hc;
-
- default:
- DBG_ERROR( "SvLBoxContextBmp::implGetImageStore: unexpected mode!");
- }
-
// OJ: #i27071# wrong mode so we just return the normal images
return _bFirst ? m_pImpl->m_aImage1 : m_pImpl->m_aImage2;
}
@@ -582,16 +552,8 @@ void SvLBoxContextBmp::Paint( const Point& _rPos, SvLBox& _rDev,
{
DBG_CHKTHIS(SvLBoxContextBmp,0);
- // determine the image set
- BmpColorMode eMode( BMP_COLOR_NORMAL );
- if ( !!m_pImpl->m_aImage1_hc )
- { // we really have HC images
- if ( _rDev.GetSettings().GetStyleSettings().GetHighContrastMode() )
- eMode = BMP_COLOR_HIGHCONTRAST;
- }
-
// get the image
- const Image& rImage = implGetImageStore( 0 == ( _nViewDataEntryFlags & m_pImpl->m_nB2IndicatorFlags ), eMode );
+ const Image& rImage = implGetImageStore( 0 == ( _nViewDataEntryFlags & m_pImpl->m_nB2IndicatorFlags ) );
sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT & _pEntry->GetFlags( ) ) );
// draw
More information about the Libreoffice-commits
mailing list