diff options
author | Pierre-André Jacquod <pjacquod@alumni.ethz.ch> | 2011-10-03 14:02:57 +0200 |
---|---|---|
committer | Pierre-André Jacquod <pjacquod@alumni.ethz.ch> | 2011-10-07 15:57:54 +0200 |
commit | 2dc8787d06cb8e12d9309c0cc149befc02c405aa (patch) | |
tree | 73b08dde649effc451ce5439c0a3f487fcf6e952 /vcl | |
parent | e9969a918f3b171833991f152f58baf7a0237e2f (diff) |
cppcheck reduce scope of var in vcl/unx/...wmadaptor.cxx
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/app/wmadaptor.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index b33349bfc595..5dfc236bde7c 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -416,7 +416,6 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : if( pAtomNames[i] == NULL ) continue; - int nProtocol = -1; WMAdaptorProtocol aSearch; aSearch.pProtocol = pAtomNames[i]; WMAdaptorProtocol* pMatch = (WMAdaptorProtocol*) @@ -427,15 +426,13 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : compareProtocol ); if( pMatch ) { - nProtocol = pMatch->nProtocol; - m_aWMAtoms[ nProtocol ] = pAtoms[ i ]; + m_aWMAtoms[ pMatch->nProtocol ] = pAtoms[ i ]; if( pMatch->nProtocol == NET_WM_STATE_STAYS_ON_TOP ) m_bEnableAlwaysOnTopWorks = true; } #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, " %s%s\n", pAtomNames[i], nProtocol != -1 ? "" : " (unsupported)" ); + fprintf( stderr, " %s%s\n", pAtomNames[i], ((pMatch)&&(pMatch->nProtocol != -1)) ? "" : " (unsupported)" ); #endif - XFree( pAtomNames[i] ); } } @@ -672,7 +669,6 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : if( pAtomNames[i] == NULL ) continue; - int nProtocol = -1; WMAdaptorProtocol aSearch; aSearch.pProtocol = pAtomNames[i]; WMAdaptorProtocol* pMatch = (WMAdaptorProtocol*) @@ -683,8 +679,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : compareProtocol ); if( pMatch ) { - nProtocol = pMatch->nProtocol; - m_aWMAtoms[ nProtocol ] = pAtoms[ i ]; + m_aWMAtoms[ pMatch->nProtocol ] = pAtoms[ i ]; if( pMatch->nProtocol == WIN_LAYER ) m_bEnableAlwaysOnTopWorks = true; } @@ -695,9 +690,8 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : m_nInitWinGravity = NorthWestGravity; } #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, " %s%s\n", pAtomNames[i], nProtocol != -1 ? "" : " (unsupported)" ); + fprintf( stderr, " %s%s\n", pAtomNames[i], ((pMatch) && (pMatch->nProtocol != -1)) ? "" : " (unsupported)" ); #endif - XFree( pAtomNames[i] ); } } |