Kaydet (Commit) aba7f4c0 authored tarafından Michael Weghorn's avatar Michael Weghorn Kaydeden (comit) Noel Grandin

fdo#39440 reduce scope of local variables

This addresses some cppcheck warnings.

Change-Id: I026999d6e995185c42df6770a1a700094540d08a
Reviewed-on: https://gerrit.libreoffice.org/13454Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 68b8f008
......@@ -695,11 +695,11 @@ bool DocumentHolder::ShowUI( const uno::Reference< ::com::sun::star::frame::XLay
}
catch( const uno::Exception& ){}
// make sure that lock state of LM is correct even if an exception is thrown in between
bool bUnlock = false;
bool bLock = false;
if ( xOwnLM.is() && xDocAreaAcc.is() )
{
// make sure that lock state of LM is correct even if an exception is thrown in between
bool bUnlock = false;
bool bLock = false;
try
{
// take over the control over the containers window
......
......@@ -323,7 +323,6 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
{
const CmdToInfoCache& rCmdCache = GetCommandToInfoCache();
bool bGroupFound( false );
frame::DispatchInformation aDispatchInfo;
std::list< frame::DispatchInformation > aDispatchInfoList;
......@@ -332,6 +331,7 @@ throw (::com::sun::star::uno::RuntimeException, std::exception)
( nCommandGroup == frame::CommandGroup::DATA ) ||
( nCommandGroup == frame::CommandGroup::VIEW ))
{
bool bGroupFound = false;
CmdToInfoCache::const_iterator pIter = rCmdCache.begin();
while ( pIter != rCmdCache.end() )
{
......
......@@ -686,9 +686,9 @@ void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny,
template<class T>
void UnoConversionUtilities<T>::anyToVariant(VARIANT* pVariant, const Any& rAny)
{
bool bIllegal = false;
try
{
bool bIllegal = false;
switch (rAny.getValueTypeClass())
{
case TypeClass_INTERFACE:
......
......@@ -559,12 +559,13 @@ bool Sane::Start( BitmapTransporter& rBitmap )
int nWidthMM = 0;
int nHeightMM = 0;
double fTLx, fTLy, fBRx, fBRy, fResl = 0.0;
double fTLx, fTLy, fResl = 0.0;
int nOption;
if( ( nOption = GetOptionByName( "tl-x" ) ) != -1 &&
GetOptionValue( nOption, fTLx, 0 ) &&
GetOptionUnit( nOption ) == SANE_UNIT_MM )
{
double fBRx;
if( ( nOption = GetOptionByName( "br-x" ) ) != -1 &&
GetOptionValue( nOption, fBRx, 0 ) &&
GetOptionUnit( nOption ) == SANE_UNIT_MM )
......@@ -576,6 +577,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
GetOptionValue( nOption, fTLy, 0 ) &&
GetOptionUnit( nOption ) == SANE_UNIT_MM )
{
double fBRy;
if( ( nOption = GetOptionByName( "br-y" ) ) != -1 &&
GetOptionValue( nOption, fBRy, 0 ) &&
GetOptionUnit( nOption ) == SANE_UNIT_MM )
......
......@@ -761,11 +761,11 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit )
}
else if( pEdit == mpVectorBox )
{
char pBuf[256];
mnCurrentElement = mpVectorBox->GetValue()-1;
double fValue;
if( mrSane.GetOptionValue( mnCurrentOption, fValue, mnCurrentElement ))
{
char pBuf[256];
sprintf( pBuf, "%g", fValue );
OUString aValue( pBuf, strlen(pBuf), osl_getThreadTextEncoding() );
mpNumericEdit->SetText( aValue );
......
......@@ -465,7 +465,6 @@ UpdateCheckThread::run()
{
osl_setThreadName("UpdateCheckThread");
bool bExtensionsChecked = false;
TimeValue systime;
TimeValue nExtCheckTime;
osl_getSystemTime( &nExtCheckTime );
......@@ -477,6 +476,7 @@ UpdateCheckThread::run()
aResult = m_aCondition.wait(&tv);
try {
bool bExtensionsChecked = false;
while( schedule() )
{
......@@ -569,9 +569,8 @@ UpdateCheckThread::run()
void SAL_CALL
ManualUpdateCheckThread::run()
{
bool bExtensionsChecked = false;
try {
bool bExtensionsChecked = false;
runCheck( bExtensionsChecked );
m_aCondition.reset();
}
......
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