From e722564d40143fa029fe10d22a625539c795ee04 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 11 Apr 2018 12:58:07 +0200 Subject: make SvLBoxItem::Clone return a std::unique_ptr and combine the Create/Clone methods into one Change-Id: Ia982be6b50135b8d368d84070327689be6b3d890 Reviewed-on: https://gerrit.libreoffice.org/52745 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/animations/CustomAnimationList.cxx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index c2908041be6d..5008b9f631ea 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -202,8 +202,7 @@ public: CustomAnimationListEntryItem(const OUString& aDescription, const CustomAnimationEffectPtr& pEffect, CustomAnimationList* pParent); void InitViewData(SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* = nullptr) override; - SvLBoxItem* Create() const override; - void Clone(SvLBoxItem* pSource) override; + virtual std::unique_ptr Clone(SvLBoxItem const * pSource) const override; virtual void Paint(const Point&, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView,const SvTreeListEntry& rEntry) override; @@ -328,15 +327,11 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msEffectName, rDev.GetOutputSizePixel().Width() - aPos.X())); } -SvLBoxItem* CustomAnimationListEntryItem::Create() const +std::unique_ptr CustomAnimationListEntryItem::Clone(SvLBoxItem const *) const { return nullptr; } -void CustomAnimationListEntryItem::Clone( SvLBoxItem* ) -{ -} - class CustomAnimationListEntry : public SvTreeListEntry { public: @@ -364,8 +359,7 @@ public: explicit CustomAnimationTriggerEntryItem( const OUString& aDescription ); void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* = nullptr ) override; - SvLBoxItem* Create() const override; - void Clone( SvLBoxItem* pSource ) override; + virtual std::unique_ptr Clone(SvLBoxItem const * pSource) const override; virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) override; @@ -428,15 +422,11 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD rRenderContext.Pop(); } -SvLBoxItem* CustomAnimationTriggerEntryItem::Create() const +std::unique_ptr CustomAnimationTriggerEntryItem::Clone(SvLBoxItem const *) const { return nullptr; } -void CustomAnimationTriggerEntryItem::Clone( SvLBoxItem* ) -{ -} - CustomAnimationList::CustomAnimationList( vcl::Window* pParent ) : SvTreeListBox( pParent, WB_TABSTOP | WB_BORDER | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT ) , mbIgnorePaint(false) -- cgit