diff options
author | Noel Grandin <noel@peralex.com> | 2016-04-04 15:18:26 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-04-05 06:27:17 +0000 |
commit | 8375affb39ac72f5a20d8a1377ccea59fe94aa73 (patch) | |
tree | 334289f729633b7878de37f932fa25bde54c12f2 /ucb | |
parent | b9372f0e909c32d143540bf0ce7b79003d9b26e9 (diff) |
loplugin:constantparam in ucb
Change-Id: Ifa36b58a36232e6333a1c85d85d0372fb0de219b
Reviewed-on: https://gerrit.libreoffice.org/23829
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/ucb.cxx | 2 | ||||
-rw-r--r-- | ucb/source/inc/regexpmap.hxx | 17 | ||||
-rw-r--r-- | ucb/source/sorter/sortdynres.cxx | 4 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 15 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/ftp/ftpdirp.hxx | 20 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontent.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchydata.cxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchydata.hxx | 2 |
9 files changed, 21 insertions, 49 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 43750567dd7b..09437c20576d 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -413,7 +413,7 @@ UniversalContentBroker::registerContentProvider( aList.push_front( ProviderListEntry_Impl(Provider) ); try { - m_aProviders.add(Scheme, aList, false); + m_aProviders.add(Scheme, aList); } catch (const IllegalArgumentException&) { diff --git a/ucb/source/inc/regexpmap.hxx b/ucb/source/inc/regexpmap.hxx index 45a64fdb68f6..09244e6d89b2 100644 --- a/ucb/source/inc/regexpmap.hxx +++ b/ucb/source/inc/regexpmap.hxx @@ -378,7 +378,7 @@ public: RegexpMap & operator =(RegexpMap const & rOther); - void add(OUString const & rKey, Val const & rValue, bool bOverwrite); + void add(OUString const & rKey, Val const & rValue); iterator find(OUString const & rKey); @@ -424,8 +424,7 @@ RegexpMap< Val > & RegexpMap< Val >::operator =(RegexpMap const & rOther) } template< typename Val > -void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, - bool bOverwrite) +void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue) { Regexp aRegexp(Regexp::parse(rKey)); @@ -433,9 +432,7 @@ void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, { if (m_pImpl->m_pDefault) { - if (!bOverwrite) - return; - delete m_pImpl->m_pDefault; + return; } m_pImpl->m_pDefault = new Entry< Val >(aRegexp, rValue); } @@ -448,13 +445,7 @@ void RegexpMap< Val >::add(rtl::OUString const & rKey, Val const & rValue, { if (aIt->m_aRegexp == aRegexp) { - if (bOverwrite) - { - rTheList.erase(aIt); - break; - } - else - return; + return; } } diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx index b9aae2f37ca2..e4552ec59bce 100644 --- a/ucb/source/sorter/sortdynres.cxx +++ b/ucb/source/sorter/sortdynres.cxx @@ -544,11 +544,11 @@ void EventList::Clear() maData.clear(); } -void EventList::AddEvent( sal_IntPtr nType, sal_IntPtr nPos, sal_IntPtr nCount ) +void EventList::AddEvent( sal_IntPtr nType, sal_IntPtr nPos ) { ListAction *pAction = new ListAction; pAction->Position = nPos; - pAction->Count = nCount; + pAction->Count = 1; pAction->ListActionType = nType; Insert( pAction ); diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 627dcdf337aa..47ad05a0bf6b 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -77,11 +77,11 @@ struct SortInfo struct SortListData { - bool mbModified; + bool mbModified; sal_IntPtr mnCurPos; sal_IntPtr mnOldPos; - SortListData( sal_IntPtr nPos, bool bModified = false ); + SortListData( sal_IntPtr nPos ); }; @@ -1525,7 +1525,7 @@ void SortedResultSet::Remove( sal_IntPtr nPos, sal_IntPtr nCount, EventList *pEv // generate remove Event, but not for new entries if ( nSortPos <= nOldLastSort ) - pEvents->AddEvent( ListActionType::REMOVED, nSortPos, 1 ); + pEvents->AddEvent( ListActionType::REMOVED, nSortPos ); } // correct the positions in the sorted list @@ -1742,8 +1742,7 @@ void SortedResultSet::ResortModified( EventList* pList ) pAction->ActionInfo <<= nNewPos-nCurPos; pList->Insert( pAction ); } - pList->AddEvent( ListActionType::PROPERTIES_CHANGED, - nNewPos, 1 ); + pList->AddEvent( ListActionType::PROPERTIES_CHANGED, nNewPos ); } } } @@ -1779,7 +1778,7 @@ void SortedResultSet::ResortNew( EventList* pList ) maO2S.Replace( reinterpret_cast<void*>(nNewPos), (sal_uInt32) pData->mnCurPos ); } mnLastSort++; - pList->AddEvent( ListActionType::INSERTED, nNewPos, 1 ); + pList->AddEvent( ListActionType::INSERTED, nNewPos ); } } catch (const SQLException&) @@ -1792,9 +1791,9 @@ void SortedResultSet::ResortNew( EventList* pList ) // SortListData -SortListData::SortListData( sal_IntPtr nPos, bool bModified ) +SortListData::SortListData( sal_IntPtr nPos ) { - mbModified = bModified; + mbModified = false; mnCurPos = nPos; mnOldPos = nPos; }; diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx index 9681ce374cf4..ab16c45bb604 100644 --- a/ucb/source/sorter/sortresult.hxx +++ b/ucb/source/sorter/sortresult.hxx @@ -77,7 +77,7 @@ public: sal_uInt32 Count() { return (sal_uInt32) maData.size(); } - void AddEvent( sal_IntPtr nType, sal_IntPtr nPos, sal_IntPtr nCount ); + void AddEvent( sal_IntPtr nType, sal_IntPtr nPos ); void Insert( css::ucb::ListAction *pAction ) { maData.push_back( pAction ); } void Clear(); css::ucb::ListAction* GetAction( sal_IntPtr nIndex ) { return maData[ nIndex ]; } diff --git a/ucb/source/ucp/ftp/ftpdirp.hxx b/ucb/source/ucp/ftp/ftpdirp.hxx index 69567b30e22d..441d6a4cb488 100644 --- a/ucb/source/ucp/ftp/ftpdirp.hxx +++ b/ucb/source/ucp/ftp/ftpdirp.hxx @@ -41,21 +41,7 @@ namespace ftp { struct DateTime : public css::util::DateTime { - DateTime(const sal_uInt32& nanoSeconds, - const sal_uInt16& seconds, - const sal_uInt16& minutes, - const sal_uInt16& hours, - const sal_uInt16& day, - const sal_uInt16& month, - const sal_uInt16& year) - : css::util::DateTime(nanoSeconds, - seconds, - minutes, - hours, - day, - month, - year, - false) { } + DateTime() : css::util::DateTime(0, 0, 0, 0, 0, 0, 0, false) { } void SetYear(sal_uInt16 year) { Year = year; } void SetMonth(sal_uInt16 month) { Month = month; } @@ -92,14 +78,14 @@ namespace ftp { sal_uInt32 m_nSize; FTPDirentry() - : m_aDate(0,0,0,0,0,0,0), + : m_aDate(), m_nMode(INETCOREFTP_FILEMODE_UNKNOWN), m_nSize((sal_uInt32)(-1)) { } void clear() { m_aURL.clear(); m_aName.clear(); - m_aDate = DateTime(0,0,0,0,0,0,0); + m_aDate = DateTime(); m_nMode = INETCOREFTP_FILEMODE_UNKNOWN; m_nSize = sal_uInt32(-1); } diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index e73cdcf99aeb..99dc529481ba 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -674,7 +674,7 @@ bool HierarchyContent::storeData() { HierarchyEntry aEntry( m_xContext, m_pProvider, m_xIdentifier->getContentIdentifier() ); - return aEntry.setData( m_aProps.getHierarchyEntryData(), true ); + return aEntry.setData( m_aProps.getHierarchyEntryData() ); } diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index c027ec46f0dc..7730248132b0 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -253,8 +253,7 @@ bool HierarchyEntry::getData( HierarchyEntryData& rData ) } -bool HierarchyEntry::setData( - const HierarchyEntryData& rData, bool bCreate ) +bool HierarchyEntry::setData( const HierarchyEntryData& rData ) { try { @@ -351,9 +350,6 @@ bool HierarchyEntry::setData( } else { - if ( !bCreate ) - return true; - // Key does not exist. Create / fill / insert it. uno::Reference< lang::XSingleServiceFactory > xFac; diff --git a/ucb/source/ucp/hierarchy/hierarchydata.hxx b/ucb/source/ucp/hierarchy/hierarchydata.hxx index badca56297c6..08639f3d9810 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.hxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.hxx @@ -102,7 +102,7 @@ public: bool getData( HierarchyEntryData& rData ); - bool setData( const HierarchyEntryData& rData, bool bCreate ); + bool setData( const HierarchyEntryData& rData ); bool move( const OUString& rNewURL, const HierarchyEntryData& rData ); |