[Libreoffice-commits] .: vcl/source vcl/unx vcl/win
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Dec 13 13:34:12 PST 2010
vcl/source/control/button.cxx | 3 +--
vcl/source/control/fixed.cxx | 7 ++-----
vcl/source/gdi/bitmap2.cxx | 2 +-
vcl/source/gdi/bitmap3.cxx | 3 ++-
vcl/source/gdi/outdev3.cxx | 4 ++--
vcl/source/gdi/pngwrite.cxx | 4 ++--
vcl/source/gdi/salmisc.cxx | 2 +-
vcl/source/window/dlgctrl.cxx | 2 --
vcl/unx/source/app/i18n_ic.cxx | 6 +++---
vcl/unx/source/dtrans/X11_selection.cxx | 2 +-
vcl/win/source/gdi/winlayout.cxx | 6 ------
11 files changed, 15 insertions(+), 26 deletions(-)
New commits:
commit f157f79eeccb11a451b5eeac7017abb06e451453
Author: Joachim Trémouroux <joachim.tremouroux at gmail.com>
Date: Mon Dec 13 21:29:13 2010 +0000
cppcheck: cleanup
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 56bc569..a0c4997 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2277,7 +2277,6 @@ void RadioButton::ImplInvalidateOrDrawRadioButtonState()
void RadioButton::ImplDrawRadioButtonState()
{
- USHORT nButtonStyle = 0;
BOOL bNativeOK = FALSE;
// no native drawing for image radio buttons
@@ -2325,12 +2324,12 @@ if ( bNativeOK == FALSE )
Rectangle aImageRect = maStateRect;
Size aImageSize = maImage.GetSizePixel();
BOOL bEnabled = IsEnabled();
+ USHORT nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
// Border und Selektionsstatus ausgeben
- nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageRect = aDecoView.DrawFrame( aImageRect, nButtonStyle );
if ( (ImplGetButtonState() & BUTTON_DRAW_PRESSED) || !bEnabled )
SetFillColor( rStyleSettings.GetFaceColor() );
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index da28c07..f3a7836 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -506,17 +506,14 @@ void FixedLine::ImplDraw( bool bLayout )
{
if( !pVector )
{
- long nX = 0;
- long nY = 0;
-
if ( nWinStyle & WB_VERT )
{
- nX = (aOutSize.Width()-1)/2;
+ long nX = (aOutSize.Width()-1)/2;
aDecoView.DrawSeparator( Point( nX, 0 ), Point( nX, aOutSize.Height()-1 ) );
}
else
{
- nY = (aOutSize.Height()-1)/2;
+ long nY = (aOutSize.Height()-1)/2;
aDecoView.DrawSeparator( Point( 0, nY ), Point( aOutSize.Width()-1, nY ), false );
}
}
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index b595070..f1e4a9a 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -308,7 +308,6 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
// BITMAPCOREHEADER
sal_Int16 nTmp16 = 0;
- sal_uInt8 nTmp8 = 0;
if ( rHeader.nSize == DIBCOREHEADERSIZE )
{
@@ -319,6 +318,7 @@ BOOL Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal
}
else if ( bIsMSOFormat && ( rHeader.nSize == BITMAPINFOHEADER ) )
{
+ sal_uInt8 nTmp8 = 0;
rIStm >> nTmp16; rHeader.nWidth = nTmp16;
rIStm >> nTmp16; rHeader.nHeight = nTmp16;
rIStm >> nTmp8; rHeader.nPlanes = nTmp8;
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index fcd60f2..2b3aa2f 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -966,10 +966,11 @@ BOOL Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
const long nHeight1 = pReadAcc->Height() - 1L;
long* pLutX = new long[ nNewWidth ];
long* pLutY = new long[ nNewHeight ];
- long nX, nY, nMapY, nActY = 0L;
if( nNewWidth1 && nNewHeight1 )
{
+ long nX, nY, nMapY, nActY = 0L;
+
for( nX = 0L; nX < nNewWidth; nX++ )
pLutX[ nX ] = nX * nWidth1 / nNewWidth1;
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 96bfab5..ecb29ff 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -607,10 +607,10 @@ Font OutputDevice::GetDefaultFont( USHORT nType, LanguageType eLang,
// No Name, than set all names
if ( !aFont.GetName().Len() )
{
- xub_StrLen nIndex = 0;
if ( nFlags & DEFAULTFONT_FLAGS_ONLYONE )
{
- //aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) );
+ xub_StrLen nIndex = 0;
+
if( !pOutDev )
pOutDev = (const OutputDevice *)ImplGetSVData()->mpDefaultWin;
if( !pOutDev )
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 4b394ae..9e5ad0a 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -120,7 +120,7 @@ private:
void ImplWriteChunk( BYTE nNumb );
void ImplWriteChunk( sal_uInt32 nNumb );
void ImplWriteChunk( unsigned char* pSource, sal_uInt32 nDatSize );
- void ImplCloseChunk( void );
+ void ImplCloseChunk( void ) const;
};
// ------------------------------------------------------------------------
@@ -699,7 +699,7 @@ void PNGWriterImpl::ImplWriteChunk ( unsigned char* pSource, sal_uInt32 nDatSize
// ------------------------------------------------------------------------
// nothing to do
-void PNGWriterImpl::ImplCloseChunk ( void )
+void PNGWriterImpl::ImplCloseChunk ( void ) const
{
}
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 9cbe0fd..9ba888f 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -213,7 +213,7 @@ static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer
if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_24BIT_TC_BGR )
{
BitmapColor aCol;
- BYTE* pPixel;
+ BYTE* pPixel = NULL;
for( long nActY = 0, nMapY; nActY < nHeight; nActY++ )
{
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index dd8dcca..67ba338 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -896,10 +896,8 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
BOOL Window::ImplHasDlgCtrl()
{
Window* pDlgCtrlParent;
- Window* pDlgCtrl;
// lookup window for dialog control
- pDlgCtrl = this;
pDlgCtrlParent = ImplGetParent();
while ( pDlgCtrlParent &&
!pDlgCtrlParent->ImplIsOverlapWindow() &&
diff --git a/vcl/unx/source/app/i18n_ic.cxx b/vcl/unx/source/app/i18n_ic.cxx
index 5a50b6a..22f7b1e 100644
--- a/vcl/unx/source/app/i18n_ic.cxx
+++ b/vcl/unx/source/app/i18n_ic.cxx
@@ -559,14 +559,14 @@ SalI18N_InputContext::IsSupportedIMStyle( XIMStyle nStyle ) const
Bool
SalI18N_InputContext::SupportInputMethodStyle( XIMStyles *pIMStyles )
{
- int nBestScore = 0;
- int nActualScore = 0;
-
mnPreeditStyle = 0;
mnStatusStyle = 0;
if ( pIMStyles != NULL )
{
+ int nBestScore = 0;
+ int nActualScore = 0;
+
// check whether the XIM supports one of the desired styles
// only a single preedit and a single status style must occure
// in a inpuut method style. Hideki said so, so i trust him
diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx
index ba76524..8e155e3 100644
--- a/vcl/unx/source/dtrans/X11_selection.cxx
+++ b/vcl/unx/source/dtrans/X11_selection.cxx
@@ -1039,7 +1039,6 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In
bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rType, Sequence< sal_Int8 >& rData )
{
- int nFormat;
bool bSuccess = false;
::std::hash_map< Atom, Selection* >::iterator it;
@@ -1223,6 +1222,7 @@ bool SelectionManager::getPasteData( Atom selection, const ::rtl::OUString& rTyp
if( ! bSuccess )
{
+ int nFormat;
::std::list< Atom > aTypes;
convertTypeToNative( rType, selection, nFormat, aTypes );
::std::list< Atom >::const_iterator type_it;
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 724b630..65a416c 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2231,12 +2231,6 @@ void UniscribeLayout::DrawText( SalGraphics& ) const
else
nBaseGlyphPos = nMinGlyphPos;
- const int* pGlyphWidths;
- if( mpJustifications )
- pGlyphWidths = mpJustifications;
- else
- pGlyphWidths = mpGlyphAdvances;
-
int i = mnMinCharPos;
while( (--i >= rVisualItem.mnMinCharPos)
&& (nBaseGlyphPos == mpLogClusters[i]) )
More information about the Libreoffice-commits
mailing list