Kaydet (Commit) 83ad767d authored tarafından Pierre-André Jacquod's avatar Pierre-André Jacquod

cppcheck: reduce scope of var in vcl toolbox.cxx

üst b01f94c5
...@@ -1877,7 +1877,6 @@ sal_Bool ToolBox::ImplCalcItem() ...@@ -1877,7 +1877,6 @@ sal_Bool ToolBox::ImplCalcItem()
long nDefHeight; long nDefHeight;
long nMaxWidth = 0; long nMaxWidth = 0;
long nMaxHeight = 0; long nMaxHeight = 0;
long nHeight;
long nMinWidth = 6; long nMinWidth = 6;
long nMinHeight = 6; long nMinHeight = 6;
long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
...@@ -2038,7 +2037,7 @@ sal_Bool ToolBox::ImplCalcItem() ...@@ -2038,7 +2037,7 @@ sal_Bool ToolBox::ImplCalcItem()
// Gegebenenfalls die Fensterhoehe mit beruecksichtigen // Gegebenenfalls die Fensterhoehe mit beruecksichtigen
if ( it->mpWindow ) if ( it->mpWindow )
{ {
nHeight = it->mpWindow->GetSizePixel().Height(); long nHeight = it->mpWindow->GetSizePixel().Height();
if ( nHeight > mnWinHeight ) if ( nHeight > mnWinHeight )
mnWinHeight = nHeight; mnWinHeight = nHeight;
} }
...@@ -2387,12 +2386,8 @@ void ToolBox::ImplFormat( sal_Bool bResize ) ...@@ -2387,12 +2386,8 @@ void ToolBox::ImplFormat( sal_Bool bResize )
Rectangle aEmptyRect; Rectangle aEmptyRect;
long nLineSize; long nLineSize;
long nLeft; long nLeft;
long nRight;
long nTop; long nTop;
long nBottom;
long nMax; // width of layoutarea in pixels long nMax; // width of layoutarea in pixels
long nX;
long nY;
sal_uInt16 nFormatLine; sal_uInt16 nFormatLine;
sal_Bool bMustFullPaint; sal_Bool bMustFullPaint;
sal_Bool bLastSep; sal_Bool bLastSep;
...@@ -2438,6 +2433,7 @@ void ToolBox::ImplFormat( sal_Bool bResize ) ...@@ -2438,6 +2433,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
// Horizontal // Horizontal
if ( mbHorz ) if ( mbHorz )
{ {
long nBottom;
// nLineSize: height of a single line, will fit highest item // nLineSize: height of a single line, will fit highest item
nLineSize = mnMaxItemHeight; nLineSize = mnMaxItemHeight;
...@@ -2488,6 +2484,7 @@ void ToolBox::ImplFormat( sal_Bool bResize ) ...@@ -2488,6 +2484,7 @@ void ToolBox::ImplFormat( sal_Bool bResize )
} }
else else
{ {
long nRight;
nLineSize = mnMaxItemWidth; nLineSize = mnMaxItemWidth;
if ( mbScroll ) if ( mbScroll )
...@@ -2562,8 +2559,8 @@ void ToolBox::ImplFormat( sal_Bool bResize ) ...@@ -2562,8 +2559,8 @@ void ToolBox::ImplFormat( sal_Bool bResize )
else else
{ {
// init start values // init start values
nX = nLeft; // top-left offset long nX = nLeft; // top-left offset
nY = nTop; long nY = nTop;
nFormatLine = 1; nFormatLine = 1;
bLastSep = sal_True; bLastSep = sal_True;
...@@ -3464,8 +3461,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa ...@@ -3464,8 +3461,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa
long nOffY = SMALLBUTTON_OFF_NORMAL_Y; long nOffY = SMALLBUTTON_OFF_NORMAL_Y;
long nImageOffX = 0; long nImageOffX = 0;
long nImageOffY = 0; long nImageOffY = 0;
long nTextOffX = 0;
long nTextOffY = 0;
sal_uInt16 nStyle = 0; sal_uInt16 nStyle = 0;
// draw separators in flat style only // draw separators in flat style only
...@@ -3662,8 +3657,8 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa ...@@ -3662,8 +3657,8 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa
sal_Bool bRotate = sal_False; sal_Bool bRotate = sal_False;
if ( bText ) if ( bText )
{ {
nTextOffX = nOffX; long nTextOffX = nOffX;
nTextOffY = nOffY; long nTextOffY = nOffY;
// rotate text when vertically docked // rotate text when vertically docked
Font aOldFont = GetFont(); Font aOldFont = GetFont();
......
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