[Libreoffice-commits] core.git: canvas/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Mon Feb 22 12:40:57 UTC 2021
canvas/source/cairo/cairo_canvas.cxx | 4 ++--
canvas/source/cairo/cairo_spritecanvas.cxx | 4 ++--
canvas/source/opengl/ogl_spritecanvas.cxx | 6 +++---
canvas/source/vcl/canvas.cxx | 6 +++---
canvas/source/vcl/spritecanvas.cxx | 6 +++---
5 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 919e47ee210dc40ae8f235e6904b217b26788f26
Author: Noel <noel.grandin at collabora.co.uk>
AuthorDate: Mon Feb 22 12:12:47 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Feb 22 13:40:12 2021 +0100
loplugin:refcounting in canvas
Change-Id: I77e4d29b2911bb86c383afbf977d241eaa8cd341
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111307
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx
index f8266cffe446..10edc0681843 100644
--- a/canvas/source/cairo/cairo_canvas.cxx
+++ b/canvas/source/cairo/cairo_canvas.cxx
@@ -176,7 +176,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_rendering_Canvas_Cairo_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
{
- auto p = new cairocanvas::Canvas(args, context);
+ rtl::Reference<cairocanvas::Canvas> p = new cairocanvas::Canvas(args, context);
p->acquire();
try {
p->initialize();
@@ -185,7 +185,7 @@ com_sun_star_comp_rendering_Canvas_Cairo_get_implementation(
p->release();
throw;
}
- return static_cast<cppu::OWeakObject*>(p);
+ return static_cast<cppu::OWeakObject*>(p.get());
}
diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx
index ddb4491afdf2..91ac7c376b4d 100644
--- a/canvas/source/cairo/cairo_spritecanvas.cxx
+++ b/canvas/source/cairo/cairo_spritecanvas.cxx
@@ -224,10 +224,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_rendering_SpriteCanvas_Cairo_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
{
- auto p = new cairocanvas::SpriteCanvas(args, context);
+ rtl::Reference<cairocanvas::SpriteCanvas> p = new cairocanvas::SpriteCanvas(args, context);
p->acquire();
p->initialize();
- return static_cast<cppu::OWeakObject*>(p);
+ return static_cast<cppu::OWeakObject*>(p.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx
index d55625b47668..babeafa19af9 100644
--- a/canvas/source/opengl/ogl_spritecanvas.cxx
+++ b/canvas/source/opengl/ogl_spritecanvas.cxx
@@ -157,10 +157,10 @@ com_sun_star_comp_rendering_SpriteCanvas_OGL_get_implementation(
{
if( !OpenGLHelper::supportsOpenGL())
return nullptr;
- auto p = new oglcanvas::SpriteCanvas(args, context);
- cppu::acquire(p);
+ rtl::Reference<oglcanvas::SpriteCanvas> p = new oglcanvas::SpriteCanvas(args, context);
+ cppu::acquire(p.get());
p->initialize();
- return static_cast<cppu::OWeakObject*>(p);
+ return static_cast<cppu::OWeakObject*>(p.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx
index e8f6ffe0c62a..467da51f37ed 100644
--- a/canvas/source/vcl/canvas.cxx
+++ b/canvas/source/vcl/canvas.cxx
@@ -134,10 +134,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_rendering_Canvas_VCL_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
{
- auto p = new vclcanvas::Canvas(args, context);
- cppu::acquire(p);
+ rtl::Reference<vclcanvas::Canvas> p = new vclcanvas::Canvas(args, context);
+ cppu::acquire(p.get());
p->initialize();
- return static_cast<cppu::OWeakObject*>(p);
+ return static_cast<cppu::OWeakObject*>(p.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
index bc3b2d9f290a..2238a79127f0 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -163,10 +163,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_rendering_SpriteCanvas_VCL_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args)
{
- auto p = new vclcanvas::SpriteCanvas(args, context);
- cppu::acquire(p);
+ rtl::Reference<vclcanvas::SpriteCanvas> p = new vclcanvas::SpriteCanvas(args, context);
+ cppu::acquire(p.get());
p->initialize();
- return static_cast<cppu::OWeakObject*>(p);
+ return static_cast<cppu::OWeakObject*>(p.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list