summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-01 15:39:39 +0200
committerNoel Grandin <noel@peralex.com>2016-03-02 07:57:38 +0200
commit09b5fe4c898cacd69042d1c585e27daf5d86cae7 (patch)
treeec6a77f4d3d2c595da0ef1f61721b23006246109 /desktop
parentb0e18a68c86733b6d88a0c990d4fa4d938680727 (diff)
loplugin:unuseddefaultparam in desktop
Change-Id: I9a7ac03dcbc3849eced0f8431e186b59b31b2418
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/officeipcthread.cxx26
-rw-r--r--desktop/source/app/officeipcthread.hxx8
-rw-r--r--desktop/source/deployment/dp_persmap.cxx5
-rw-r--r--desktop/source/deployment/inc/dp_persmap.h2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx34
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h5
6 files changed, 29 insertions, 51 deletions
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
index a3505795d3fa..2a726277c4b6 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -400,7 +400,7 @@ void OfficeIPCThread::SetDowning()
static bool s_bInEnableRequests = false;
-void OfficeIPCThread::EnableRequests( bool i_bEnable )
+void OfficeIPCThread::EnableRequests()
{
// switch between just queueing the requests and executing them
::osl::MutexGuard aGuard( GetMutex() );
@@ -408,14 +408,11 @@ void OfficeIPCThread::EnableRequests( bool i_bEnable )
if ( pGlobalOfficeIPCThread.is() )
{
s_bInEnableRequests = true;
- pGlobalOfficeIPCThread->mbRequestsEnabled = i_bEnable;
- if( i_bEnable )
- {
- // hit the compiler over the head
- ProcessDocumentsRequest aEmptyReq = ProcessDocumentsRequest( boost::optional< OUString >() );
- // trigger already queued requests
- OfficeIPCThread::ExecuteCmdLineRequests( aEmptyReq );
- }
+ pGlobalOfficeIPCThread->mbRequestsEnabled = true;
+ // hit the compiler over the head
+ ProcessDocumentsRequest aEmptyReq = ProcessDocumentsRequest( boost::optional< OUString >() );
+ // trigger already queued requests
+ OfficeIPCThread::ExecuteCmdLineRequests( aEmptyReq );
s_bInEnableRequests = false;
}
}
@@ -430,14 +427,14 @@ bool OfficeIPCThread::AreRequestsPending()
return false;
}
-void OfficeIPCThread::RequestsCompleted( int nCount )
+void OfficeIPCThread::RequestsCompleted()
{
// Remove nCount pending requests from our internal counter
::osl::MutexGuard aGuard( GetMutex() );
if ( pGlobalOfficeIPCThread.is() )
{
if ( pGlobalOfficeIPCThread->mnPendingRequests > 0 )
- pGlobalOfficeIPCThread->mnPendingRequests -= nCount;
+ pGlobalOfficeIPCThread->mnPendingRequests --;
}
}
@@ -682,12 +679,9 @@ void OfficeIPCThread::SetReady(
}
}
-void OfficeIPCThread::WaitForReady(
- rtl::Reference< OfficeIPCThread > const & pThread)
-
+void OfficeIPCThread::WaitForReady()
{
- rtl::Reference< OfficeIPCThread > const & t(
- pThread.is() ? pThread : pGlobalOfficeIPCThread);
+ rtl::Reference< OfficeIPCThread > const & t(pGlobalOfficeIPCThread);
if (t.is())
{
t->cReady.wait();
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
index 401480353c1d..e00593dee359 100644
--- a/desktop/source/app/officeipcthread.hxx
+++ b/desktop/source/app/officeipcthread.hxx
@@ -106,9 +106,9 @@ class OfficeIPCThread : public salhelper::Thread
// controlling pipe communication during shutdown
static void SetDowning();
- static void EnableRequests( bool i_bEnable = true );
+ static void EnableRequests();
static bool AreRequestsPending();
- static void RequestsCompleted( int n = 1 );
+ static void RequestsCompleted();
static bool ExecuteCmdLineRequests( ProcessDocumentsRequest& );
// return sal_False if second office
@@ -118,9 +118,7 @@ class OfficeIPCThread : public salhelper::Thread
static void SetReady(
rtl::Reference< OfficeIPCThread > const & pThread =
rtl::Reference< OfficeIPCThread >());
- static void WaitForReady(
- rtl::Reference< OfficeIPCThread > const & pThread =
- rtl::Reference< OfficeIPCThread >());
+ static void WaitForReady();
static bool IsEnabled();
bool AreRequestsEnabled() const { return mbRequestsEnabled && ! mbDowning; }
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index d032153cf8dc..f77aff0d01ad 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.cxx
@@ -290,7 +290,7 @@ void PersistentMap::put( OString const & key, OString const & value )
flush();
}
-bool PersistentMap::erase( OString const & key, bool flush_immediately )
+bool PersistentMap::erase( OString const & key )
{
if( m_bReadOnly)
return false;
@@ -298,8 +298,7 @@ bool PersistentMap::erase( OString const & key, bool flush_immediately )
if( !nCount)
return false;
m_bIsDirty = true;
- if( flush_immediately)
- flush();
+ flush();
return true;
}
diff --git a/desktop/source/deployment/inc/dp_persmap.h b/desktop/source/deployment/inc/dp_persmap.h
index d40aed40d062..892339590f8a 100644
--- a/desktop/source/deployment/inc/dp_persmap.h
+++ b/desktop/source/deployment/inc/dp_persmap.h
@@ -51,7 +51,7 @@ public:
bool get( OString * value, OString const & key ) const;
const t_string2string_map& getEntries() const { return m_entries; }
void put( OString const & key, OString const & value );
- bool erase( OString const & key, bool flush_immediately = true );
+ bool erase( OString const & key );
protected:
void open();
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 3b73159cb1c4..2be62e16668d 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -67,7 +67,7 @@ OUString toString( OptionInfo const * info )
OptionInfo const * getOptionInfo(
OptionInfo const * list,
- OUString const & opt, sal_Unicode copt )
+ OUString const & opt )
{
for ( ; list->m_name != nullptr; ++list )
{
@@ -75,16 +75,7 @@ OptionInfo const * getOptionInfo(
if (!opt.isEmpty())
{
if (opt.equalsAsciiL(
- option_info.m_name, option_info.m_name_length ) &&
- (copt == '\0' || copt == option_info.m_short_option))
- {
- return &option_info;
- }
- }
- else
- {
- OSL_ASSERT( copt != '\0' );
- if (copt == option_info.m_short_option)
+ option_info.m_name, option_info.m_name_length ))
{
return &option_info;
}
@@ -198,7 +189,7 @@ OUString const & getProcessWorkingDir()
OUString makeAbsoluteFileUrl(
- OUString const & sys_path, OUString const & base_url, bool throw_exc )
+ OUString const & sys_path, OUString const & base_url )
{
// system path to file url
OUString file_url;
@@ -209,7 +200,7 @@ OUString makeAbsoluteFileUrl(
{
file_url = sys_path;
}
- else if (throw_exc)
+ else
{
throw RuntimeException("cannot get file url from system path: " +
sys_path );
@@ -220,16 +211,13 @@ OUString makeAbsoluteFileUrl(
if (osl_getAbsoluteFileURL(
base_url.pData, file_url.pData, &abs.pData ) != osl_File_E_None)
{
- if (throw_exc) {
- OUStringBuffer buf;
- buf.append( "making absolute file url failed: \"" );
- buf.append( base_url );
- buf.append( "\" (base-url) and \"" );
- buf.append( file_url );
- buf.append( "\" (file-url)!" );
- throw RuntimeException( buf.makeStringAndClear() );
- }
- return OUString();
+ OUStringBuffer buf;
+ buf.append( "making absolute file url failed: \"" );
+ buf.append( base_url );
+ buf.append( "\" (base-url) and \"" );
+ buf.append( file_url );
+ buf.append( "\" (file-url)!" );
+ throw RuntimeException( buf.makeStringAndClear() );
}
return abs[ abs.getLength() -1 ] == '/'
? abs.copy( 0, abs.getLength() -1 ) : abs;
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index e263b6119028..a11a29beda43 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -59,7 +59,7 @@ OUString toString( OptionInfo const * info );
OptionInfo const * getOptionInfo(
OptionInfo const * list,
- OUString const & opt, sal_Unicode copt = '\0' );
+ OUString const & opt );
bool isOption( OptionInfo const * option_info, sal_uInt32 * pIndex );
@@ -94,8 +94,7 @@ OUString const & getProcessWorkingDir();
OUString makeAbsoluteFileUrl(
- OUString const & sys_path, OUString const & base_url,
- bool throw_exc = true );
+ OUString const & sys_path, OUString const & base_url );