summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/timer.cxx6
-rw-r--r--vcl/source/control/spinfld.cxx3
-rw-r--r--vcl/source/filter/igif/gifread.cxx2
-rw-r--r--vcl/source/filter/sgfbram.cxx7
-rw-r--r--vcl/source/filter/sgvmain.cxx3
-rw-r--r--vcl/source/filter/sgvspln.cxx16
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx5
-rw-r--r--vcl/source/gdi/dibtools.cxx22
-rw-r--r--vcl/source/gdi/gdimtf.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx20
-rw-r--r--vcl/source/gdi/pngwrite.cxx15
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx3
-rw-r--r--vcl/source/outdev/textline.cxx12
-rw-r--r--vcl/source/window/menu.cxx7
-rw-r--r--vcl/source/window/settings.cxx3
-rw-r--r--vcl/source/window/splitwin.cxx29
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx2
-rw-r--r--vcl/unx/generic/printer/printerinfomanager.cxx2
18 files changed, 66 insertions, 95 deletions
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 2e8ee3d0acc9..0bc86667f09d 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -209,7 +209,6 @@ void TimerTest::testAutoTimer()
const double exp = (nDurationMs * nEventsCount);
sal_Int32 nCount = 0;
- double dur = 0;
std::ostringstream msg;
// Repeat when we have random latencies.
@@ -224,7 +223,7 @@ void TimerTest::testAutoTimer()
}
const auto end = std::chrono::high_resolution_clock::now();
- dur = std::chrono::duration<double, std::milli>(end - start).count();
+ double dur = std::chrono::duration<double, std::milli>(end - start).count();
msg << std::setprecision(2) << std::fixed
<< "periodic multi-timer - dur: "
@@ -257,7 +256,6 @@ void TimerTest::testMultiAutoTimers()
const double expX = (exp / nDurationMsX);
const double expY = (exp / nDurationMsY);
- double dur = 0;
sal_Int32 nCountX = 0;
sal_Int32 nCountY = 0;
sal_Int32 nCount = 0;
@@ -282,7 +280,7 @@ void TimerTest::testMultiAutoTimers()
}
const auto end = std::chrono::high_resolution_clock::now();
- dur = std::chrono::duration<double, std::milli>(end - start).count();
+ double dur = std::chrono::duration<double, std::milli>(end - start).count();
msg << std::setprecision(2) << std::fixed << "periodic multi-timer - dur: "
<< dur << " (" << exp << ") ms, nCount: " << nCount
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 52dcdd0f4082..1eb0fa39bf8d 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -668,7 +668,6 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect
long nBottom1 = aSize.Height()/2;
long nBottom2 = aSize.Height()-1;
long nTop2 = nBottom1;
- long nTop1 = 0;
if ( !(aSize.Height() & 0x01) )
nBottom1--;
@@ -715,7 +714,7 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, Rect
{
aSize.Width() -= CalcZoom( GetDrawPixel( pDev, rStyleSettings.GetSpinSize() ) );
- rSpinUpArea = Rectangle( aSize.Width(), nTop1, rOutSz.Width()-aDropDownSize.Width()-1, nBottom1 );
+ rSpinUpArea = Rectangle( aSize.Width(), 0, rOutSz.Width()-aDropDownSize.Width()-1, nBottom1 );
rSpinDownArea = Rectangle( rSpinUpArea.Left(), nTop2, rSpinUpArea.Right(), nBottom2 );
}
}
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 4032ebb6c5c0..be41ccebf5b6 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -218,13 +218,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount )
bool GIFReader::ReadExtension()
{
bool bRet = false;
- bool bOverreadDataBlocks = false;
// Extension-Label
sal_uInt8 cFunction(0);
rIStm.ReadUChar( cFunction );
if( NO_PENDING( rIStm ) )
{
+ bool bOverreadDataBlocks = false;
sal_uInt8 cSize(0);
// Block length
rIStm.ReadUChar( cSize );
diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index 86bacd124b19..c449afcc9eed 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -334,14 +334,15 @@ bool SgfBMapFilter(SvStream& rInp, SvStream& rOut)
SgfHeader aHead;
SgfEntry aEntr;
sal_uLong nNext;
- bool bRdFlag=false; // read graphics entry?
bool bRet=false; // return value
nFileStart=rInp.Tell();
ReadSgfHeader( rInp, aHead );
if (aHead.ChkMagic() && (aHead.Typ==SgfBitImag0 || aHead.Typ==SgfBitImag1 ||
- aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo)) {
- nNext=aHead.GetOffset();
+ aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo))
+ {
+ bool bRdFlag = false; // read graphics entry?
+ nNext = aHead.GetOffset();
while (nNext && !bRdFlag && !rInp.GetError() && !rOut.GetError()) {
rInp.Seek(nFileStart+nNext);
ReadSgfEntry( rInp, aEntr );
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index 67c89f486102..4882248dbcac 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -638,7 +638,6 @@ void CircType::Draw(OutputDevice& rOut)
void BmapType::Draw(OutputDevice& rOut)
{
//ifstream aInp;
- unsigned char nSgfTyp;
sal_uInt16 nVersion;
OUString aStr(
reinterpret_cast< char const * >(&Filename[ 1 ]),
@@ -648,7 +647,7 @@ void BmapType::Draw(OutputDevice& rOut)
SvStream* pInp = ::utl::UcbStreamHelper::CreateStream( aFNam.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ );
if ( pInp )
{
- nSgfTyp=CheckSgfTyp( *pInp,nVersion);
+ unsigned char nSgfTyp = CheckSgfTyp( *pInp,nVersion);
switch(nSgfTyp) {
case SGF_BITIMAGE: {
GraphicFilter aFlt;
diff --git a/vcl/source/filter/sgvspln.cxx b/vcl/source/filter/sgvspln.cxx
index 1cfaa41f7a8d..58a7a3e25a7f 100644
--- a/vcl/source/filter/sgvspln.cxx
+++ b/vcl/source/filter/sgvspln.cxx
@@ -486,7 +486,7 @@ sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y,
{ // array dimensions should range from [0..n]!
sal_uInt16 Error;
sal_uInt16 i,im1,nm1; //integer
- double hr,hl;
+ double hl;
std::unique_ptr<double[]> a;
std::unique_ptr<double[]> lowrow;
std::unique_ptr<double[]> ricol;
@@ -506,6 +506,7 @@ sal_uInt16 PeriodicSpline(sal_uInt16 n, double* x, double* y,
c[1]=c[1]/(x[2]-x[0]);
c[2]=-c[1];
} else {
+ double hr;
for (i=1;i<=nm1;i++) {
im1=i-1;
hl=x[i]-x[im1];
@@ -550,8 +551,7 @@ sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond,
{
sal_uInt16 Error;
sal_uInt16 i;
- double deltX,deltY,delt,
- alphX = 0,alphY = 0,
+ double alphX = 0,alphY = 0,
betX = 0,betY = 0;
if (n<2) return 1;
@@ -559,6 +559,7 @@ sal_uInt16 ParaSpline(sal_uInt16 n, double* x, double* y, sal_uInt8 MargCond,
if (!CondT) {
T[0]=0.0;
for (i=0;i<n;i++) {
+ double deltX,deltY,delt;
deltX=x[i+1]-x[i]; deltY=y[i+1]-y[i];
delt =deltX*deltX+deltY*deltY;
if (delt<=0.0) return 3; // two identical adjacent points!
@@ -677,8 +678,8 @@ bool CalcSpline(tools::Polygon& rPoly, bool Periodic, sal_uInt16& n,
bool Spline2Poly(tools::Polygon& rSpln, bool Periodic, tools::Polygon& rPoly)
{
- short MinKoord=-32000; // to prevent
- short MaxKoord=32000; // overflows
+ const short MinKoord = -32000; // to prevent
+ const short MaxKoord = 32000; // overflows
double* ax; // coefficients of the polynoms
double* ay;
@@ -690,8 +691,6 @@ bool Spline2Poly(tools::Polygon& rSpln, bool Periodic, tools::Polygon& rPoly)
double* dy;
double* tv;
- double Step; // stepsize for t
- double dt1,dt2,dt3; // delta t, y, ^3
sal_uInt16 n; // number of partial polynoms to draw
sal_uInt16 i; // actual partial polynom
bool bOk; // all still ok?
@@ -699,7 +698,7 @@ bool Spline2Poly(tools::Polygon& rSpln, bool Periodic, tools::Polygon& rPoly)
bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv);
if (bOk) {
- Step =10;
+ const double Step = 10; // stepsize for t
rPoly.SetSize(1);
rPoly.SetPoint(Point(short(ax[0]),short(ay[0])),0); // first point
@@ -708,6 +707,7 @@ bool Spline2Poly(tools::Polygon& rSpln, bool Periodic, tools::Polygon& rPoly)
double t=tv[i]+Step;
bool bEnd=false; // partial polynom ended?
while (!bEnd) { // extrapolate one partial polynom
+ double dt1,dt2,dt3; // delta t, y, ^3
bEnd=t>=tv[i+1];
if (bEnd) t=tv[i+1];
dt1=t-tv[i]; dt2=dt1*dt1; dt3=dt2*dt1;
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index e4359eaf3da5..0cf9f569c265 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -370,12 +370,12 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
case W_META_POLYPOLYGON:
{
- bool bRecordOk = true;
sal_uInt16 nPolyCount(0);
// Number of polygons:
pWMF->ReadUInt16( nPolyCount );
if (nPolyCount && pWMF->good())
{
+ bool bRecordOk = true;
if (nPolyCount > pWMF->remainingSize() / sizeof(sal_uInt16))
{
break;
@@ -1323,12 +1323,11 @@ void WMFReader::ReadWMF()
if ( ReadHeader( ) )
{
- bool bEMFAvailable = false;
-
nPos = pWMF->Tell();
if( nEndPos - nStartPos )
{
+ bool bEMFAvailable = false;
while( true )
{
nCurrentAction++;
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index d90d7bf1c882..05bb8f2353b1 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -553,17 +553,15 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
{
case( 1 ):
{
- sal_uInt8* pTmp;
- sal_uInt8 cTmp;
-
for( ; nCount--; nY += nI )
{
+ sal_uInt8* pTmp;
if (rIStm.Read( pTmp = pBuf.get(), nAlignedWidth )
!= nAlignedWidth)
{
return false;
}
- cTmp = *pTmp++;
+ sal_uInt8 cTmp = *pTmp++;
for( long nX = 0L, nShift = 8L; nX < nWidth; nX++ )
{
@@ -581,17 +579,15 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
case( 4 ):
{
- sal_uInt8* pTmp;
- sal_uInt8 cTmp;
-
for( ; nCount--; nY += nI )
{
+ sal_uInt8* pTmp;
if (rIStm.Read( pTmp = pBuf.get(), nAlignedWidth )
!= nAlignedWidth)
{
return false;
}
- cTmp = *pTmp++;
+ sal_uInt8 cTmp = *pTmp++;
for( long nX = 0L, nShift = 2L; nX < nWidth; nX++ )
{
@@ -609,10 +605,9 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
case( 8 ):
{
- sal_uInt8* pTmp;
-
for( ; nCount--; nY += nI )
{
+ sal_uInt8* pTmp;
if (rIStm.Read( pTmp = pBuf.get(), nAlignedWidth )
!= nAlignedWidth)
{
@@ -639,10 +634,10 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
ColorMask aMask(aRedMask, aGreenMask, aBlueMask);
BitmapColor aColor;
- sal_uInt16* pTmp16;
for( ; nCount--; nY += nI )
{
+ sal_uInt16* pTmp16;
if (rIStm.Read( ( pTmp16 = reinterpret_cast<sal_uInt16*>(pBuf.get()) ), nAlignedWidth )
!= nAlignedWidth)
{
@@ -661,10 +656,10 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
case( 24 ):
{
BitmapColor aPixelColor;
- sal_uInt8* pTmp;
for( ; nCount--; nY += nI )
{
+ sal_uInt8* pTmp;
if (rIStm.Read( pTmp = pBuf.get(), nAlignedWidth )
!= nAlignedWidth)
{
@@ -989,14 +984,13 @@ bool ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, bool bRLE4 )
sal_uLong nCount;
sal_uLong nBufCount;
std::unique_ptr<sal_uInt8[]> pBuf(new sal_uInt8[ ( nWidth << 1 ) + 2 ]);
- sal_uInt8* pTmp;
sal_uInt8 cPix;
sal_uInt8 cLast;
bool bFound;
for ( long nY = nHeight - 1L; nY >= 0L; nY-- )
{
- pTmp = pBuf.get();
+ sal_uInt8* pTmp = pBuf.get();
nX = nBufCount = 0UL;
while( nX < nWidth )
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index bbdb4ebd2d07..c29554948454 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2754,7 +2754,6 @@ SvStream& ReadGDIMetaFile( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
{
// new format
VersionCompat* pCompat;
- MetaAction* pAction;
sal_uInt32 nStmCompressMode = 0;
sal_uInt32 nCount = 0;
@@ -2772,8 +2771,7 @@ SvStream& ReadGDIMetaFile( SvStream& rIStm, GDIMetaFile& rGDIMetaFile )
for( sal_uInt32 nAction = 0UL; ( nAction < nCount ) && !rIStm.IsEof(); nAction++ )
{
- pAction = MetaAction::ReadMetaAction( rIStm, &aReadData );
-
+ MetaAction* pAction = MetaAction::ReadMetaAction( rIStm, &aReadData );
if( pAction )
{
if (pAction->GetType() == MetaActionType::COMMENT)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 95a46f925673..3b93fc77db15 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6570,8 +6570,7 @@ my_NSS_CMSAttributeArray_FindAttrByOidTag(NSSCMSAttribute **attrs, SECOidTag oid
SECStatus
my_NSS_CMSArray_Add(PLArenaPool *poolp, void ***array, void *obj)
{
- void **p;
- int n;
+ int n = 0;
void **dest;
PORT_Assert(array != NULL);
@@ -6579,16 +6578,15 @@ my_NSS_CMSArray_Add(PLArenaPool *poolp, void ***array, void *obj)
return SECFailure;
if (*array == NULL) {
- dest = static_cast<void **>(PORT_ArenaAlloc(poolp, 2 * sizeof(void *)));
- n = 0;
+ dest = static_cast<void **>(PORT_ArenaAlloc(poolp, 2 * sizeof(void *)));
} else {
- n = 0; p = *array;
- while (*p++)
- n++;
- dest = static_cast<void **>(PORT_ArenaGrow (poolp,
- *array,
- (n + 1) * sizeof(void *),
- (n + 2) * sizeof(void *)));
+ void **p = *array;
+ while (*p++)
+ n++;
+ dest = static_cast<void **>(PORT_ArenaGrow (poolp,
+ *array,
+ (n + 1) * sizeof(void *),
+ (n + 2) * sizeof(void *)));
}
if (dest == NULL)
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index d9336ce85a92..63a6565e862a 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -599,9 +599,6 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
pDest = mpDeflateInBuf;
*pDest++ = 4; // filter type
- sal_uLong na, nb, nc;
- long np, npa, npb, npc;
-
sal_uInt8* p1 = mpCurrentScan + 1; // Current Pixel
sal_uInt8* p2 = p1 - mnBBP; // left pixel
sal_uInt8* p3 = mpPreviousScan; // upper pixel
@@ -609,7 +606,8 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
while (pDest < mpDeflateInBuf + mnDeflateInSize)
{
- nb = *p3++;
+ sal_uLong nb = *p3++;
+ sal_uLong na, nc;
if (p2 >= mpCurrentScan + 1)
{
na = *p2;
@@ -620,11 +618,10 @@ sal_uLong PNGWriterImpl::ImplGetFilter (sal_uLong nY, sal_uLong nXStart, sal_uLo
na = nc = 0;
}
- np = na + nb;
- np -= nc;
- npa = np - na;
- npb = np - nb;
- npc = np - nc;
+ long np = na + nb - nc;
+ long npa = np - na;
+ long npb = np - nb;
+ long npc = np - nc;
if (npa < 0)
npa =-npa;
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 876d52da118c..4a723a35287a 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -142,12 +142,11 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc
while (baseSlot && gr_slot_attached_to(baseSlot) != NULL && !gr_slot_can_insert_before(baseSlot))
baseSlot = bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot);
assert(baseSlot);
- float thisBoundary = 0.;
float nextBoundary = gr_slot_origin_X(baseSlot);
// now loop over bases
for ( ; baseSlot; baseSlot = nextBaseSlot)
{
- thisBoundary = nextBoundary;
+ float thisBoundary = nextBoundary;
int firstChar = gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(baseSlot))) + mnSegCharOffset;
nextBaseSlot = get_next_base(bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot), bRtl);
nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : gr_seg_advance_X(pSegment);
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index f83e28375b1d..19a2fac70aea 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -125,8 +125,6 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
long nDiffY = nHeight-1;
long nCount = nWidth;
long nOffY = -1;
- long nFreq;
- long i;
long nPixWidth;
long nPixHeight;
bool bDrawPixAsRect;
@@ -167,10 +165,10 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
else
{
nCurY += nDiffY;
- nFreq = nCount / (nDiffX+nDiffY);
+ long nFreq = nCount / (nDiffX+nDiffY);
while ( nFreq-- )
{
- for( i = nDiffY; i; --i )
+ for( long i = nDiffY; i; --i )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
mpGraphics, this,
@@ -178,7 +176,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
nCurX++;
nCurY += nOffY;
}
- for( i = nDiffX; i; --i )
+ for( long i = nDiffX; i; --i )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
mpGraphics, this,
@@ -190,7 +188,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
nFreq = nCount % (nDiffX+nDiffY);
if ( nFreq )
{
- for( i = nDiffY; i && nFreq; --i, --nFreq )
+ for( long i = nDiffY; i && nFreq; --i, --nFreq )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
mpGraphics, this,
@@ -199,7 +197,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY,
nCurY += nOffY;
}
- for( i = nDiffX; i && nFreq; --i, --nFreq )
+ for( long i = nDiffX; i && nFreq; --i, --nFreq )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
mpGraphics, this,
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 34804c1a3555..4f63cb6120e2 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2607,13 +2607,10 @@ bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu )
bool MenuBar::ImplHandleCmdEvent( const CommandEvent& rCEvent )
{
- bool bDone = false;
- const CommandModKeyData* pCData;
-
// No keyboard processing when system handles the menu or our menubar is invisible
if( !IsDisplayable() ||
( ImplGetSalMenu() && ImplGetSalMenu()->VisibleMenuBar() ) )
- return bDone;
+ return false;
// check for enabled, if this method is called from another window...
MenuBarWindow* pWin = static_cast<MenuBarWindow*>(ImplGetWindow());
@@ -2621,7 +2618,7 @@ bool MenuBar::ImplHandleCmdEvent( const CommandEvent& rCEvent )
{
if (rCEvent.GetCommand() == CommandEventId::ModKeyChange)
{
- pCData = rCEvent.GetModKeyData ();
+ const CommandModKeyData* pCData = rCEvent.GetModKeyData ();
if (pWin->nHighlightedItem == ITEMPOS_INVALID)
{
if (pCData && pCData->IsMod2())
diff --git a/vcl/source/window/settings.cxx b/vcl/source/window/settings.cxx
index 96ab2407085d..4e0e4ed86b71 100644
--- a/vcl/source/window/settings.cxx
+++ b/vcl/source/window/settings.cxx
@@ -241,13 +241,14 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, bool bCallHdl )
// (see above) then accept that
if( !rSettings.GetStyleSettings().GetHighContrastMode() )
{
- bool bTmp = false, bAutoHCMode = true;
+ bool bAutoHCMode = true;
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
comphelper::getProcessComponentContext(),
OUString("org.openoffice.Office.Common/Accessibility") ); // note: case sensitive !
if ( aNode.isValid() )
{
::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString("AutoDetectSystemHC") );
+ bool bTmp = false;
if( aValue >>= bTmp )
bAutoHCMode = bTmp;
}
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 8e643d1db371..572a9a4b6966 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -475,16 +475,8 @@ static void ImplCalcSet( ImplSplitSet* pSet,
sal_uInt16 nVisItems;
sal_uInt16 nAbsItems;
long nCalcSize;
- long nSizeDelta;
- long nSizeWinSize;
- long nNewSizeWinSize;
- long nTemp;
- long nTempErr;
- long nErrorSum;
- long nCurSizeDelta;
long nPos;
long nMaxPos;
- long* pSize;
ImplSplitItems& pItems = pSet->mpItems;
bool bEmpty;
@@ -502,7 +494,6 @@ static void ImplCalcSet( ImplSplitSet* pSet,
else
nCalcSize = nSetWidth;
nCalcSize -= (nVisItems-1)*pSet->mnSplitSize;
- long nCurSize = 0;
if ( pSet->mbCalcPix || (pSet->mnLastSize != nCalcSize) )
{
long nPercentFactor = 10;
@@ -510,6 +501,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
long nPercent = 0;
long nRelPercent = 0;
long nAbsSize = 0;
+ long nCurSize = 0;
for ( i = 0; i < nItems; i++ )
{
if ( !(pItems[i]->mnBits & SplitWindowItemFlags::Invisible) )
@@ -542,7 +534,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
if ( !nPercent )
nPercent = 1;
- nSizeDelta = nCalcSize-nAbsSize;
+ long nSizeDelta = nCalcSize-nAbsSize;
for ( i = 0; i < nItems; i++ )
{
if ( pItems[i]->mnBits & SplitWindowItemFlags::Invisible )
@@ -574,8 +566,8 @@ static void ImplCalcSet( ImplSplitSet* pSet,
if ( nSizeDelta )
{
nAbsItems = 0;
- nSizeWinSize = 0;
- nNewSizeWinSize = 0;
+ long nSizeWinSize = 0;
+ long nNewSizeWinSize = 0;
// first resize absolute items relative
for ( i = 0; i < nItems; i++ )
@@ -646,8 +638,8 @@ static void ImplCalcSet( ImplSplitSet* pSet,
}
// subtract size of individual items
- nErrorSum = nSizeDelta % nCalcItems;
- nCurSizeDelta = nSizeDelta / nCalcItems;
+ long nErrorSum = nSizeDelta % nCalcItems;
+ long nCurSizeDelta = nSizeDelta / nCalcItems;
nMins = 0;
for ( i = 0; i < nItems; i++ )
{
@@ -655,7 +647,8 @@ static void ImplCalcSet( ImplSplitSet* pSet,
nMins++;
else if ( pItems[i]->mbSubSize )
{
- pSize = &(pItems[i]->mnPixSize);
+ long* pSize = &(pItems[i]->mnPixSize);
+ long nTempErr;
if ( nErrorSum )
{
@@ -669,7 +662,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
if ( (*pSize+nCurSizeDelta+nTempErr) <= 0 )
{
- nTemp = *pSize;
+ long nTemp = *pSize;
if ( nTemp )
{
*pSize -= nTemp;
@@ -1468,7 +1461,6 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
// the size is determined according to MainSet
if ( mnWinStyle & WB_SIZEABLE )
{
- long nCurSize;
long nCalcSize = 0;
sal_uInt16 i;
@@ -1484,6 +1476,7 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize )
{
long nDelta = 0;
Point aPos = GetPosPixel();
+ long nCurSize;
if ( mbHorz )
nCurSize = aNewSize.Height()-mnTopBorder-mnBottomBorder;
@@ -1533,7 +1526,6 @@ void SplitWindow::ImplCalcLayout()
// the size is determined according to MainSet
if ( mnWinStyle & WB_SIZEABLE )
{
- long nCurSize;
long nCalcSize = 0;
sal_uInt16 i;
@@ -1547,6 +1539,7 @@ void SplitWindow::ImplCalcLayout()
if ( i == mpMainSet->mpItems.size() )
{
+ long nCurSize;
if ( mbHorz )
nCurSize = mnDY-mnTopBorder-mnBottomBorder;
else
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 425cfc206ded..427cb67a2c02 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -1222,7 +1222,6 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
bool bHaveUTF16 = false;
Atom aUTF8Type = None;
bool bHaveCompound = false;
- bool bHaveText = false;
Sequence< sal_Int8 > aAtoms;
if( selection == m_nXdndSelection )
@@ -1303,6 +1302,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor >
aNativeTypes.resize( nAtoms );
DataFlavor* pFlavors = rTypes.getArray();
sal_Int32 nNativeTypesIndex = 0;
+ bool bHaveText = false;
while( nAtoms-- )
{
SAL_INFO_IF(*pAtoms && *pAtoms < 0x01000000, "vcl.unx.dtrans",
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index abc9cfdd14b0..9018b5152c66 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -1161,7 +1161,6 @@ void SystemQueueInfo::run()
osl_setThreadName("LPR psp::SystemQueueInfo");
char pBuffer[1024];
- FILE *pPipe;
std::list< OString > aLines;
/* Discover which command we can use to get a list of all printer queues */
@@ -1174,6 +1173,7 @@ void SystemQueueInfo::run()
fprintf( stderr, "trying print queue command \"%s\" ... ", aParms[i].pQueueCommand );
#endif
aCmdLine.append( " 2>/dev/null" );
+ FILE *pPipe;
if( (pPipe = popen( aCmdLine.getStr(), "r" )) )
{
while( fgets( pBuffer, 1024, pPipe ) )