[Libreoffice-commits] core.git: include/vcl
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 21 08:25:35 UTC 2020
include/vcl/pdfwriter.hxx | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
New commits:
commit 491fbb1de3697b566f1af8925896053b2a39f33c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 21 09:33:19 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 21 10:24:58 2020 +0200
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 at collabora.co.uk>
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 );
}
};
More information about the Libreoffice-commits
mailing list