From 0c7c2716db83a0afeb1859b5fde3e44cf61b5fc5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 22 Nov 2024 10:07:15 +0200 Subject: loplugin:methodcycles found cycle FmEntryData::FmEntryData(const FmEntryData &) svx/source/inc/fmexpl.hxx:148 FmFormData::FmFormData(const FmFormData &) svx/source/inc/fmexpl.hxx:230 FmControlData::FmControlData(const FmControlData &) svx/source/inc/fmexpl.hxx:252 std::unique_ptr FmEntryData::Clone() svx/source/inc/fmexpl.hxx:161 Change-Id: I2bef463f62b4513c473bb99eb999a97e99f5e602 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176993 Reviewed-by: Noel Grandin Tested-by: Jenkins --- svx/source/form/fmexpl.cxx | 46 ---------------------------------------------- svx/source/inc/fmexpl.hxx | 6 ------ 2 files changed, 52 deletions(-) diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 59fa0f638188..4394201511d0 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -168,26 +168,6 @@ void FmEntryData::newObject( const css::uno::Reference< css::uno::XInterface >& } -FmEntryData::FmEntryData( const FmEntryData& rEntryData ) -{ - pChildList.reset( new FmEntryDataList() ); - aText = rEntryData.GetText(); - m_aNormalImage = rEntryData.GetNormalImage(); - pParent = rEntryData.GetParent(); - - FmEntryData* pChildData; - size_t nEntryCount = rEntryData.GetChildList()->size(); - for( size_t i = 0; i < nEntryCount; i++ ) - { - pChildData = rEntryData.GetChildList()->at( i ); - std::unique_ptr pNewChildData = pChildData->Clone(); - pChildList->insert( std::move(pNewChildData), size_t(-1) ); - } - - m_xNormalizedIFace = rEntryData.m_xNormalizedIFace; - m_xProperties = rEntryData.m_xProperties; - m_xChild = rEntryData.m_xChild; -} @@ -242,19 +222,6 @@ FmFormData::~FmFormData() { } -FmFormData::FmFormData( const FmFormData& rFormData ) - :FmEntryData( rFormData ) -{ - m_xForm = rFormData.GetFormIface(); -} - - -std::unique_ptr FmFormData::Clone() -{ - return std::unique_ptr(new FmFormData( *this )); -} - - bool FmFormData::IsEqualWithoutChildren( FmEntryData* pEntryData ) { if(this == pEntryData) @@ -291,19 +258,6 @@ FmControlData::~FmControlData() } -FmControlData::FmControlData( const FmControlData& rControlData ) - :FmEntryData( rControlData ) -{ - m_xFormComponent = rControlData.GetFormComponent(); -} - - -std::unique_ptr FmControlData::Clone() -{ - return std::unique_ptr(new FmControlData( *this )); -} - - OUString FmControlData::GetImage() const { // Default-Image diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx index ca69f4de3ff4..8028c7eb3aa9 100644 --- a/svx/source/inc/fmexpl.hxx +++ b/svx/source/inc/fmexpl.hxx @@ -145,7 +145,6 @@ protected: public: FmEntryData( FmEntryData* pParentData, const css::uno::Reference< css::uno::XInterface >& _rIFace ); - FmEntryData( const FmEntryData& rEntryData ); virtual ~FmEntryData(); void SetText( const OUString& rText ){ aText = rText; } @@ -158,7 +157,6 @@ public: FmEntryDataList* GetChildList() const { return pChildList.get(); } virtual bool IsEqualWithoutChildren( FmEntryData* pEntryData ); - virtual std::unique_ptr Clone() = 0; // note that the interface returned is normalized, i.e. querying the given XInterface of the object // for XInterface must return the interface itself. @@ -227,13 +225,11 @@ class FmFormData final : public FmEntryData public: FmFormData(const css::uno::Reference< css::form::XForm >& _rxForm, FmFormData* _pParent); - FmFormData( const FmFormData& rFormData ); virtual ~FmFormData() override; const css::uno::Reference< css::form::XForm >& GetFormIface() const { return m_xForm; } virtual bool IsEqualWithoutChildren( FmEntryData* pEntryData ) override; - virtual std::unique_ptr Clone() override; }; @@ -249,12 +245,10 @@ public: const css::uno::Reference< css::form::XFormComponent >& _rxComponent, FmFormData* _pParent ); - FmControlData( const FmControlData& rControlData ); virtual ~FmControlData() override; const css::uno::Reference< css::form::XFormComponent >& GetFormComponent() const { return m_xFormComponent; } virtual bool IsEqualWithoutChildren( FmEntryData* pEntryData ) override; - virtual std::unique_ptr Clone() override; void ModelReplaced(const css::uno::Reference< css::form::XFormComponent >& _rxNew); }; -- cgit