summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-18 10:39:48 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-01-18 12:50:09 +0000
commita7f6efc68ba97db98ebab9ebc473bffb8ded757f (patch)
treebad37ce9ee1c9f61f1c8541a9689ecdea8c84c08 /unotools
parenta08745551370a052bfb6b91335956ababf435791 (diff)
loplugin: unused return values
Change-Id: I9c61a46c57894bc63a57740206c0bcb4a16553af Reviewed-on: https://gerrit.libreoffice.org/21571 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/securityoptions.cxx20
-rw-r--r--unotools/source/config/viewoptions.cxx17
2 files changed, 10 insertions, 27 deletions
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 8de1a0c2c69d..5660442b0d0e 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -142,7 +142,7 @@ class SvtSecurityOptions_Impl : public ConfigItem
void SetTrustedAuthors ( const Sequence< SvtSecurityOptions::Certificate >& rAuthors );
bool IsOptionSet ( SvtSecurityOptions::EOption eOption ) const;
- bool SetOption ( SvtSecurityOptions::EOption eOption, bool bValue );
+ void SetOption ( SvtSecurityOptions::EOption eOption, bool bValue );
bool IsOptionEnabled ( SvtSecurityOptions::EOption eOption ) const;
/*-****************************************************************************************************
@@ -878,26 +878,16 @@ bool SvtSecurityOptions_Impl::IsOptionSet( SvtSecurityOptions::EOption eOption )
return bRet;
}
-bool SvtSecurityOptions_Impl::SetOption( SvtSecurityOptions::EOption eOption, bool bValue )
+void SvtSecurityOptions_Impl::SetOption( SvtSecurityOptions::EOption eOption, bool bValue )
{
bool* pValue;
bool* pRO;
- bool bRet = false;
- if( GetOption( eOption, pValue, pRO ) )
+ if( GetOption( eOption, pValue, pRO ) && !*pRO && *pValue != bValue)
{
- if( !*pRO )
- {
- bRet = true;
- if( *pValue != bValue )
- {
- *pValue = bValue;
- SetModified();
- }
- }
+ *pValue = bValue;
+ SetModified();
}
-
- return bRet;
}
bool SvtSecurityOptions_Impl::IsOptionEnabled( SvtSecurityOptions::EOption eOption ) const
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index 6278706b4592..35c3fcd1a945 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -93,9 +93,9 @@ class SvtViewOptionsBase_Impl
explicit SvtViewOptionsBase_Impl(const OUString& rList);
virtual ~SvtViewOptionsBase_Impl ( );
- bool Exists ( const OUString& sName );
- bool Delete ( const OUString& sName );
- OUString GetWindowState ( const OUString& sName );
+ bool Exists ( const OUString& sName );
+ void Delete ( const OUString& sName );
+ OUString GetWindowState ( const OUString& sName );
void SetWindowState ( const OUString& sName ,
const OUString& sState );
css::uno::Sequence< css::beans::NamedValue > GetUserData ( const OUString& sName );
@@ -232,32 +232,25 @@ bool SvtViewOptionsBase_Impl::Exists( const OUString& sName )
@seealso member m_aList
@param "sName", name of entry to delete it
- @return true , if item not exist(!) or could be deleted (should be the same!)
- false, otherwise
*//*-*************************************************************************************************************/
-bool SvtViewOptionsBase_Impl::Delete( const OUString& sName )
+void SvtViewOptionsBase_Impl::Delete( const OUString& sName )
{
#ifdef DEBUG_VIEWOPTIONS
++m_nWriteCount;
#endif
- bool bDeleted = false;
try
{
css::uno::Reference< css::container::XNameContainer > xSet(m_xSet, css::uno::UNO_QUERY_THROW);
xSet->removeByName(sName);
- bDeleted = true;
::comphelper::ConfigurationHelper::flush(m_xRoot);
}
catch(const css::container::NoSuchElementException&)
- { bDeleted = true; }
+ { }
catch(const css::uno::Exception& ex)
{
- bDeleted = false;
SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION(ex)
}
-
- return bDeleted;
}
/*-************************************************************************************************************