diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-19 16:28:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-20 14:12:57 +0200 |
commit | 12dce07aec980562fa449fa1884e0e8379d680fb (patch) | |
tree | 77bfe25b147d33bccd8f3dfc656f533d547ab3ae /comphelper | |
parent | fd0348d42568d5f32fb03e1e13055db5938d5f35 (diff) |
loplugin:unusedfields - look for fields that can be const, in comphelper
idea from tml.
Extend the unusedfields plugin to find fields that are only assigned in
the constructor.
Change-Id: I258d3581afbe651d53ce730c9ba27a4598cd9248
Reviewed-on: https://gerrit.libreoffice.org/57733
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/qa/container/comphelper_ifcontainer.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/container/interfacecontainer2.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/eventattachermgr/eventattachermgr.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/backupfilehelper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/hash.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/misc/profilezone.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/officeinstdir/officeinstallationdirectories.hxx | 4 | ||||
-rw-r--r-- | comphelper/source/property/propertycontainerhelper.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/xml/ofopxmlhelper.cxx | 26 |
9 files changed, 26 insertions, 26 deletions
diff --git a/comphelper/qa/container/comphelper_ifcontainer.cxx b/comphelper/qa/container/comphelper_ifcontainer.cxx index cf38b4e45bfe..26a2bd9992d8 100644 --- a/comphelper/qa/container/comphelper_ifcontainer.cxx +++ b/comphelper/qa/container/comphelper_ifcontainer.cxx @@ -42,7 +42,7 @@ struct ContainerStats { class ContainerListener : public cppu::WeakImplHelper< XEventListener > { - ContainerStats *m_pStats; + ContainerStats * const m_pStats; public: explicit ContainerListener(ContainerStats *pStats) : m_pStats(pStats) { m_pStats->m_nAlive++; } diff --git a/comphelper/source/container/interfacecontainer2.cxx b/comphelper/source/container/interfacecontainer2.cxx index c22d1641eef0..aac2e6213098 100644 --- a/comphelper/source/container/interfacecontainer2.cxx +++ b/comphelper/source/container/interfacecontainer2.cxx @@ -39,13 +39,13 @@ namespace comphelper { OInterfaceIteratorHelper2::OInterfaceIteratorHelper2( OInterfaceContainerHelper2 & rCont_ ) - : rCont( rCont_ ) + : rCont( rCont_ ), + bIsList( rCont_.bIsList ) { MutexGuard aGuard( rCont.rMutex ); if( rCont.bInUse ) // worst case, two iterators at the same time rCont.copyAndResetInUse(); - bIsList = rCont_.bIsList; aData = rCont_.aData; if( bIsList ) { diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index 4e5cdb0e0e53..e613a92258ac 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -134,8 +134,8 @@ private: class AttacherAllListener_Impl : public WeakImplHelper< XAllListener > { rtl::Reference<ImplEventAttacherManager> mxManager; - OUString aScriptType; - OUString aScriptCode; + OUString const aScriptType; + OUString const aScriptCode; /// @throws CannotConvertException void convertToEventReturn( Any & rRet, const Type & rRetType ); diff --git a/comphelper/source/misc/backupfilehelper.cxx b/comphelper/source/misc/backupfilehelper.cxx index fc19da6d2570..8bb0804739d5 100644 --- a/comphelper/source/misc/backupfilehelper.cxx +++ b/comphelper/source/misc/backupfilehelper.cxx @@ -549,7 +549,7 @@ namespace { private: ExtensionInfoEntryVector maEntries; - OUString maRegPath; + OUString const maRegPath; public: ExtensionInfo() @@ -998,7 +998,7 @@ namespace sal_uInt32 mnOffset; // offset in File (zero identifies new file) sal_uInt32 mnCrc32; // checksum FileSharedPtr maFile; // file where to find the data (at offset) - bool mbDoCompress; // flag if this file is scheduled to be compressed when written + bool const mbDoCompress; // flag if this file is scheduled to be compressed when written bool copy_content_straight(oslFileHandle& rTargetHandle) { diff --git a/comphelper/source/misc/hash.cxx b/comphelper/source/misc/hash.cxx index b07fd66c0628..b7eab08ce033 100644 --- a/comphelper/source/misc/hash.cxx +++ b/comphelper/source/misc/hash.cxx @@ -67,7 +67,7 @@ struct HashImpl } #endif - HashType meType; + HashType const meType; HashImpl(HashType eType): meType(eType) diff --git a/comphelper/source/misc/profilezone.cxx b/comphelper/source/misc/profilezone.cxx index 12a6172af56d..7847246f09c0 100644 --- a/comphelper/source/misc/profilezone.cxx +++ b/comphelper/source/misc/profilezone.cxx @@ -92,9 +92,9 @@ css::uno::Sequence<OUString> getRecordingAndClear() ProfileZone::ProfileZone(const char * sProfileId) : - m_sProfileId(sProfileId) + m_sProfileId(sProfileId), + m_aCreateTime(ProfileRecording::addRecording(sProfileId, 0)) { - m_aCreateTime = ProfileRecording::addRecording(sProfileId, 0); } ProfileZone::~ProfileZone() diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx index 4437951b7dec..e2b04a7687fb 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.hxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.hxx @@ -69,8 +69,8 @@ public: private: void initDirs(); - OUString m_aOfficeBrandDirMacro; - OUString m_aUserDirMacro; + OUString const m_aOfficeBrandDirMacro; + OUString const m_aUserDirMacro; css::uno::Reference< css::uno::XComponentContext > m_xCtx; std::unique_ptr<OUString> m_pOfficeBrandDir; std::unique_ptr<OUString> m_pUserDir; diff --git a/comphelper/source/property/propertycontainerhelper.cxx b/comphelper/source/property/propertycontainerhelper.cxx index c906c0d22b39..702a7a8e01dd 100644 --- a/comphelper/source/property/propertycontainerhelper.cxx +++ b/comphelper/source/property/propertycontainerhelper.cxx @@ -51,7 +51,7 @@ namespace // comparing two property descriptions (by name) struct PropertyDescriptionNameMatch { - OUString m_rCompare; + OUString const m_rCompare; explicit PropertyDescriptionNameMatch( const OUString& _rCompare ) : m_rCompare( _rCompare ) { } bool operator() (const PropertyDescription& x ) const diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index bfb3dbdd0fa6..62cd50aba2ca 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -45,23 +45,23 @@ namespace comphelper { class OFOPXMLHelper_Impl : public cppu::WeakImplHelper< css::xml::sax::XDocumentHandler > { - sal_uInt16 m_nFormat; // which format to parse + sal_uInt16 const m_nFormat; // which format to parse // Relations info related strings - OUString m_aRelListElement; - OUString m_aRelElement; - OUString m_aIDAttr; - OUString m_aTypeAttr; - OUString m_aTargetModeAttr; - OUString m_aTargetAttr; + OUString const m_aRelListElement; + OUString const m_aRelElement; + OUString const m_aIDAttr; + OUString const m_aTypeAttr; + OUString const m_aTargetModeAttr; + OUString const m_aTargetAttr; // ContentType related strings - OUString m_aTypesElement; - OUString m_aDefaultElement; - OUString m_aOverrideElement; - OUString m_aExtensionAttr; - OUString m_aPartNameAttr; - OUString m_aContentTypeAttr; + OUString const m_aTypesElement; + OUString const m_aDefaultElement; + OUString const m_aOverrideElement; + OUString const m_aExtensionAttr; + OUString const m_aPartNameAttr; + OUString const m_aContentTypeAttr; css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > > m_aResultSeq; std::vector< OUString > m_aElementsSeq; // stack of elements being parsed |