diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-07 09:33:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-07 09:56:07 +0100 |
commit | 267f401e2ad6e0094de39032671a3191772276ed (patch) | |
tree | be549a278ad37f2e3d10f3ab1be393d14461639a /editeng | |
parent | b0f3024304bf4e7d9efcb539a49394945f052a51 (diff) |
cppcheck: noExplicitConstructor
Change-Id: I2a1add8cf526cdb305ad99ccb138454a88f2fdbd
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 2 | ||||
-rw-r--r-- | editeng/source/accessibility/AccessibleEditableTextPara.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/fieldupdater.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 6 | ||||
-rw-r--r-- | editeng/source/items/frmitems.cxx | 2 | ||||
-rw-r--r-- | editeng/source/lookuptree/Trie.cxx | 2 | ||||
-rw-r--r-- | editeng/source/xml/editsource.hxx | 4 | ||||
-rw-r--r-- | editeng/source/xml/xmltxtexp.cxx | 30 |
11 files changed, 19 insertions, 45 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 8d5fcf7056c9..bc128b538aa3 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -347,7 +347,7 @@ namespace { class UrlEditEngine : public EditEngine { public: - UrlEditEngine(SfxItemPool *pPool) : EditEngine(pPool) {} + explicit UrlEditEngine(SfxItemPool *pPool) : EditEngine(pPool) {} virtual OUString CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_Int32, Color*&, Color*& ) SAL_OVERRIDE { diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 87886f4d7e77..0dc65b211950 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -896,7 +896,7 @@ namespace accessibility struct IndexCompare { const PropertyValue* pValues; - IndexCompare( const PropertyValue* pVals ) : pValues(pVals) {} + explicit IndexCompare( const PropertyValue* pVals ) : pValues(pVals) {} bool operator() ( const sal_Int32& a, const sal_Int32& b ) const { return pValues[a].Name < pValues[b].Name; diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 3f1e34283164..43360140cd3f 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -470,7 +470,7 @@ class FindTextPortionByAddress : std::unary_function<TextPortion, bool> { const TextPortion* mp; public: - FindTextPortionByAddress(const TextPortion* p) : mp(p) {} + explicit FindTextPortionByAddress(const TextPortion* p) : mp(p) {} bool operator() (const TextPortion& v) const { return &v == mp; @@ -1991,7 +1991,7 @@ class RemoveEachItemFromPool : std::unary_function<ContentNode, void> { EditDoc& mrDoc; public: - RemoveEachItemFromPool(EditDoc& rDoc) : mrDoc(rDoc) {} + explicit RemoveEachItemFromPool(EditDoc& rDoc) : mrDoc(rDoc) {} void operator() (const ContentNode& rNode) { mrDoc.RemoveItemsFromPool(rNode); @@ -2896,7 +2896,7 @@ class FindByAddress : std::unary_function<EditCharAttrib, bool> { const EditCharAttrib* mpAttr; public: - FindByAddress(const EditCharAttrib* p) : mpAttr(p) {} + explicit FindByAddress(const EditCharAttrib* p) : mpAttr(p) {} bool operator() (const EditCharAttrib& r) const { return &r == mpAttr; @@ -2985,7 +2985,7 @@ class FindByStartPos : std::unary_function<EditCharAttrib, bool> { sal_Int32 mnPos; public: - FindByStartPos(sal_Int32 nPos) : mnPos(nPos) {} + explicit FindByStartPos(sal_Int32 nPos) : mnPos(nPos) {} bool operator() (const EditCharAttrib& r) const { return r.GetStart() >= mnPos; @@ -3015,7 +3015,7 @@ class RemoveEmptyAttrItem : std::unary_function<EditCharAttrib, void> { SfxItemPool& mrItemPool; public: - RemoveEmptyAttrItem(SfxItemPool& rPool) : mrItemPool(rPool) {} + explicit RemoveEmptyAttrItem(SfxItemPool& rPool) : mrItemPool(rPool) {} void operator() (const EditCharAttrib& r) { if (r.IsEmpty()) diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index c9cce3d29bf9..d9645458610a 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -877,7 +877,7 @@ class FindByParagraph : std::unary_function<editeng::Section, bool> { sal_Int32 mnPara; public: - FindByParagraph(sal_Int32 nPara) : mnPara(nPara) {} + explicit FindByParagraph(sal_Int32 nPara) : mnPara(nPara) {} bool operator() (const editeng::Section& rAttr) const { return rAttr.mnParagraph == mnPara; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 523f8c6cc175..597f60c135e1 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -505,7 +505,7 @@ struct RemoveAttribsFromPool : std::unary_function<ContentAttribsInfo, void> { SfxItemPool& mrPool; public: - RemoveAttribsFromPool(SfxItemPool& rPool) : mrPool(rPool) {} + explicit RemoveAttribsFromPool(SfxItemPool& rPool) : mrPool(rPool) {} void operator() (ContentAttribsInfo& rInfo) { rInfo.RemoveAllCharAttribsFromPool(mrPool); diff --git a/editeng/source/editeng/fieldupdater.cxx b/editeng/source/editeng/fieldupdater.cxx index 1f90fc56bd33..80a35e950c6d 100644 --- a/editeng/source/editeng/fieldupdater.cxx +++ b/editeng/source/editeng/fieldupdater.cxx @@ -22,7 +22,7 @@ class FieldUpdaterImpl { EditTextObjectImpl& mrObj; public: - FieldUpdaterImpl(EditTextObject& rObj) : mrObj(*rObj.mpImpl) {} + explicit FieldUpdaterImpl(EditTextObject& rObj) : mrObj(*rObj.mpImpl) {} FieldUpdaterImpl(const FieldUpdaterImpl& r) : mrObj(r.mrObj) {} void updateTableFields(int nTab) diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 8269dae61488..a78b6c526303 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1731,8 +1731,10 @@ namespace { struct FindByPos { - FindByPos(sal_Int32 nPos): - mnPos(nPos) {} + explicit FindByPos(sal_Int32 nPos) + : mnPos(nPos) + { + } bool operator()(const ScriptTypePosInfos::value_type& rValue) { diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 20fee5de0fab..3ee4bb02fc67 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3317,7 +3317,7 @@ public: //copied to the GraphicObject when necessary SvStream* pStream; - SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {} + explicit SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {} }; diff --git a/editeng/source/lookuptree/Trie.cxx b/editeng/source/lookuptree/Trie.cxx index 43e84b86080c..e148318146b5 100644 --- a/editeng/source/lookuptree/Trie.cxx +++ b/editeng/source/lookuptree/Trie.cxx @@ -26,7 +26,7 @@ struct TrieNode TrieNode* mLatinArray[LATIN_ARRAY_SIZE]; - TrieNode(sal_Unicode aCharacter = '\0'); + explicit TrieNode(sal_Unicode aCharacter = '\0'); virtual ~TrieNode(); void markWord(); diff --git a/editeng/source/xml/editsource.hxx b/editeng/source/xml/editsource.hxx index bc5f12f5abd3..259851f57915 100644 --- a/editeng/source/xml/editsource.hxx +++ b/editeng/source/xml/editsource.hxx @@ -28,7 +28,7 @@ class SvxEditEngineSourceImpl; class SvxEditEngineSource : public SvxEditSource { public: - SvxEditEngineSource( EditEngine* pEditEngine ); + explicit SvxEditEngineSource( EditEngine* pEditEngine ); virtual ~SvxEditEngineSource(); virtual SvxEditSource* Clone() const SAL_OVERRIDE; @@ -36,7 +36,7 @@ public: virtual void UpdateData() SAL_OVERRIDE; private: - SvxEditEngineSource( SvxEditEngineSourceImpl* pImpl ); + explicit SvxEditEngineSource( SvxEditEngineSourceImpl* pImpl ); SvxEditEngineSourceImpl* mpImpl; }; diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 5d575a1d7d60..4efcc4608c1f 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -57,12 +57,8 @@ using namespace com::sun::star::lang; using namespace com::sun::star::xml::sax; using namespace cppu; - - class SvxEditEngineSourceImpl; - - class SvxEditEngineSourceImpl { private: @@ -74,7 +70,7 @@ private: ~SvxEditEngineSourceImpl(); public: - SvxEditEngineSourceImpl( EditEngine* pEditEngine ); + explicit SvxEditEngineSourceImpl( EditEngine* pEditEngine ); void SAL_CALL acquire(); void SAL_CALL release(); @@ -82,11 +78,6 @@ public: SvxTextForwarder* GetTextForwarder(); }; - - - - - SvxEditEngineSourceImpl::SvxEditEngineSourceImpl( EditEngine* pEditEngine ) : maRefCount(0), mpEditEngine( pEditEngine ), @@ -94,30 +85,22 @@ SvxEditEngineSourceImpl::SvxEditEngineSourceImpl( EditEngine* pEditEngine ) { } - - SvxEditEngineSourceImpl::~SvxEditEngineSourceImpl() { delete mpTextForwarder; } - - void SAL_CALL SvxEditEngineSourceImpl::acquire() { osl_atomic_increment( &maRefCount ); } - - void SAL_CALL SvxEditEngineSourceImpl::release() { if( ! osl_atomic_decrement( &maRefCount ) ) delete this; } - - SvxTextForwarder* SvxEditEngineSourceImpl::GetTextForwarder() { if (!mpTextForwarder) @@ -126,40 +109,29 @@ SvxTextForwarder* SvxEditEngineSourceImpl::GetTextForwarder() return mpTextForwarder; } - // SvxTextEditSource - - SvxEditEngineSource::SvxEditEngineSource( EditEngine* pEditEngine ) { mpImpl = new SvxEditEngineSourceImpl( pEditEngine ); mpImpl->acquire(); } - - SvxEditEngineSource::SvxEditEngineSource( SvxEditEngineSourceImpl* pImpl ) { mpImpl = pImpl; mpImpl->acquire(); } - - SvxEditEngineSource::~SvxEditEngineSource() { mpImpl->release(); } - - SvxEditSource* SvxEditEngineSource::Clone() const { return new SvxEditEngineSource( mpImpl ); } - - SvxTextForwarder* SvxEditEngineSource::GetTextForwarder() { return mpImpl->GetTextForwarder(); |