diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-21 09:33:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-21 10:24:58 +0200 |
commit | 491fbb1de3697b566f1af8925896053b2a39f33c (patch) | |
tree | 42a93b1ed9c1e748c223e225233f9c3afb3d8cbf | |
parent | ca5b322fd47f527c559f8806162b84eec7158615 (diff) |
return shared_ptr from AnyWidget::Clone
which is what the only call-site wants
Change-Id: I74aa7b9ce059890eb1bdd84d7a0a331ecf227be3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92606
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/vcl/pdfwriter.hxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index b3b0f2c6e691..b4d1ac58b1af 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -262,7 +262,7 @@ public: WidgetType getType() const { return Type; } - virtual std::unique_ptr<AnyWidget> Clone() const = 0; + virtual std::shared_ptr<AnyWidget> Clone() const = 0; protected: // note that this equals the default compiler-generated copy-ctor, but we want to have it @@ -321,9 +321,9 @@ public: Dest( -1 ), Submit( false ), SubmitGet( false ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new PushButtonWidget( *this )); + return std::make_shared<PushButtonWidget>( *this ); } }; @@ -336,9 +336,9 @@ public: Checked( false ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new CheckBoxWidget( *this )); + return std::make_shared<CheckBoxWidget>( *this ); } }; @@ -354,9 +354,9 @@ public: RadioGroup( 0 ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new RadioButtonWidget( *this )); + return std::make_shared<RadioButtonWidget>( *this ); } // radio buttons having the same RadioGroup id comprise one // logical radio button group, that is at most one of the RadioButtons @@ -383,9 +383,9 @@ public: MaxLen( 0 ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new EditWidget( *this )); + return std::make_shared<EditWidget>( *this ); } }; @@ -405,9 +405,9 @@ public: MultiSelect( false ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new ListBoxWidget( *this )); + return std::make_shared<ListBoxWidget>( *this ); } }; @@ -421,9 +421,9 @@ public: : AnyWidget( vcl::PDFWriter::ComboBox ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new ComboBoxWidget( *this )); + return std::make_shared<ComboBoxWidget>( *this ); } }; @@ -433,9 +433,9 @@ public: : AnyWidget( vcl::PDFWriter::Signature ) {} - virtual std::unique_ptr<AnyWidget> Clone() const override + virtual std::shared_ptr<AnyWidget> Clone() const override { - return std::unique_ptr<AnyWidget>(new SignatureWidget( *this )); + return std::make_shared<SignatureWidget>( *this ); } }; |