summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/scanner/sanedlg.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 1bf9ffa1978e..cea597cb109b 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -1470,8 +1470,10 @@ bool SaneDlg::SetAdjustedNumericalValue(
double fValue,
int nElement )
{
- int nOption;
- if( ! Sane::IsSane() || ! mrSane.IsOpen() || ( nOption = mrSane.GetOptionByName( pOption ) ) == -1 )
+ if (! Sane::IsSane() || ! mrSane.IsOpen())
+ return false;
+ int const nOption(mrSane.GetOptionByName(pOption));
+ if (nOption == -1)
return false;
if( nElement < 0 || nElement >= mrSane.GetOptionElements( nOption ) )