summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-07 12:05:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-10-07 12:49:40 +0200
commit27ec6a8ef39e95a7094503aa3036f268f62408ad (patch)
tree1e06059fbcbd14db4167c842926158e5f13d521c /extensions
parent432ca6166976bd093d1c3921aa72d9b72865eeeb (diff)
Sane::SetOptionValue return values are unused
Change-Id: Ie9310be6508fe828ca1ef36372d56596a02085aa
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/scanner/sane.cxx43
-rw-r--r--extensions/source/scanner/sane.hxx8
2 files changed, 18 insertions, 33 deletions
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index e95446af369a..d2d3e4ba655d 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -410,46 +410,37 @@ bool Sane::GetOptionValue( int n, double* pSet )
return true;
}
-bool Sane::SetOptionValue( int n, bool bSet )
+void Sane::SetOptionValue( int n, bool bSet )
{
if( ! maHandle || mppOptions[n]->type != SANE_TYPE_BOOL )
- return false;
+ return;
SANE_Word nRet = bSet ? SANE_TRUE : SANE_FALSE;
- SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nRet );
- if( nStatus != SANE_STATUS_GOOD )
- return false;
- return true;
+ ControlOption( n, SANE_ACTION_SET_VALUE, &nRet );
}
-bool Sane::SetOptionValue( int n, const OUString& rSet )
+void Sane::SetOptionValue( int n, const OUString& rSet )
{
if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING )
- return false;
+ return;
OString aSet(OUStringToOString(rSet, osl_getThreadTextEncoding()));
- SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, const_cast<char *>(aSet.getStr()) );
- if( nStatus != SANE_STATUS_GOOD )
- return false;
- return true;
+ ControlOption( n, SANE_ACTION_SET_VALUE, const_cast<char *>(aSet.getStr()) );
}
-bool Sane::SetOptionValue( int n, double fSet, int nElement )
+void Sane::SetOptionValue( int n, double fSet, int nElement )
{
- bool bSuccess = false;
-
if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT &&
mppOptions[n]->type != SANE_TYPE_FIXED ) )
- return false;
+ return;
- SANE_Status nStatus;
if( mppOptions[n]->size/sizeof(SANE_Word) > 1 )
{
std::unique_ptr<SANE_Word[]> pSet(new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]);
- nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pSet.get() );
+ SANE_Status nStatus = ControlOption( n, SANE_ACTION_GET_VALUE, pSet.get() );
if( nStatus == SANE_STATUS_GOOD )
{
pSet[nElement] = mppOptions[n]->type == SANE_TYPE_INT ?
(SANE_Word)fSet : SANE_FIX( fSet );
- nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pSet.get() );
+ ControlOption( n, SANE_ACTION_SET_VALUE, pSet.get() );
}
}
else
@@ -458,18 +449,15 @@ bool Sane::SetOptionValue( int n, double fSet, int nElement )
mppOptions[n]->type == SANE_TYPE_INT ?
(SANE_Word)fSet : SANE_FIX( fSet );
- nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, &nSetTo );
- if( nStatus == SANE_STATUS_GOOD )
- bSuccess = true;
+ ControlOption( n, SANE_ACTION_SET_VALUE, &nSetTo );
}
- return bSuccess;
}
-bool Sane::SetOptionValue( int n, double* pSet )
+void Sane::SetOptionValue( int n, double* pSet )
{
if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_INT &&
mppOptions[n]->type != SANE_TYPE_FIXED ) )
- return false;
+ return;
std::unique_ptr<SANE_Word[]> pFixedSet(new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]);
for( size_t i = 0; i < mppOptions[n]->size/sizeof(SANE_Word); i++ )
{
@@ -478,10 +466,7 @@ bool Sane::SetOptionValue( int n, double* pSet )
else
pFixedSet[i] = (SANE_Word)pSet[i];
}
- SANE_Status nStatus = ControlOption( n, SANE_ACTION_SET_VALUE, pFixedSet.get() );
- if( nStatus != SANE_STATUS_GOOD )
- return false;
- return true;
+ ControlOption( n, SANE_ACTION_SET_VALUE, pFixedSet.get() );
}
enum FrameStyleType {
diff --git a/extensions/source/scanner/sane.hxx b/extensions/source/scanner/sane.hxx
index 7f204f6f5544..4f755e6edc4d 100644
--- a/extensions/source/scanner/sane.hxx
+++ b/extensions/source/scanner/sane.hxx
@@ -150,10 +150,10 @@ public:
bool GetOptionValue( int, double&, int nElement = 0 );
bool GetOptionValue( int, double* );
- bool SetOptionValue( int, bool );
- bool SetOptionValue( int, const OUString& );
- bool SetOptionValue( int, double, int nElement = 0 );
- bool SetOptionValue( int, double* );
+ void SetOptionValue( int, bool );
+ void SetOptionValue( int, const OUString& );
+ void SetOptionValue( int, double, int nElement = 0 );
+ void SetOptionValue( int, double* );
bool ActivateButtonOption( int );