summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2014-12-12 19:07:13 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-12-15 06:43:25 +0000
commitaba7f4c0a3527ce0cee6e18385cf69778052402d (patch)
treec72f34df1ee355df395ed7f325f8d5cf66e0f0d5 /extensions
parent68b8f008c8893b6b7d2314c21679bf2dbcd1b4e5 (diff)
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: I026999d6e995185c42df6770a1a700094540d08a Reviewed-on: https://gerrit.libreoffice.org/13454 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/framectr.cxx2
-rw-r--r--extensions/source/ole/unoconversionutilities.hxx2
-rw-r--r--extensions/source/scanner/sane.cxx4
-rw-r--r--extensions/source/scanner/sanedlg.cxx2
-rw-r--r--extensions/source/update/check/updatecheck.cxx5
5 files changed, 8 insertions, 7 deletions
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index 812406335365..ba2f7a8747da 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -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() )
{
diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index b263dbed3b21..d0ab45276bec 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -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:
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 84475d572b5c..ccc597c9b598 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -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 )
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index bc7ee8e4a978..9a4e50cf5484 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -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 );
diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx
index 0ec35467ac31..bf7b6a52a07c 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -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();
}