diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-13 14:10:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-14 08:54:15 +0000 |
commit | 276e3ccbdd3259ec3daf8a1a98fa7f406b14e21c (patch) | |
tree | 17e0d9934b8f85ffe6dd8b8b4bbf3ad859bb4126 /canvas/source/vcl/cachedbitmap.cxx | |
parent | cbb3f697245d7d57439cb5019e9f9834cb9cd35f (diff) |
loplugin:unocast (vclcanvas::RepaintTarget)
(The overall inheritance hierarchies of the classes deriving from RepaintTarget
are so over-engineered that it looks easier to make each of those classes derive
from css::uno::XUnoTunnel individually, rather than deriving RepaintTarget from
something like cppu::WeakImplHelper<css::uno::XUnoTunnel>. And see the upcoming
commit introducing that loplugin:unocast on why such dynamic_casts from UNO
types are dangerous.)
Change-Id: I4bcfad4049a2fb366768602a432c1282c2bf477e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144140
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'canvas/source/vcl/cachedbitmap.cxx')
-rw-r--r-- | canvas/source/vcl/cachedbitmap.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/canvas/source/vcl/cachedbitmap.cxx b/canvas/source/vcl/cachedbitmap.cxx index 60b5f7986c55..2364c073e1fa 100644 --- a/canvas/source/vcl/cachedbitmap.cxx +++ b/canvas/source/vcl/cachedbitmap.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/rendering/RepaintResult.hpp> #include <utility> #include <comphelper/diagnose_ex.hxx> +#include <comphelper/servicehelper.hxx> #include "cachedbitmap.hxx" #include "repainttarget.hxx" @@ -70,7 +71,7 @@ namespace vclcanvas if( rNewState.Clip != rOldState.Clip ) return rendering::RepaintResult::FAILED; - RepaintTarget* pTarget = dynamic_cast< RepaintTarget* >(rTargetCanvas.get()); + RepaintTarget* pTarget = comphelper::getFromUnoTunnel< RepaintTarget >(rTargetCanvas); ENSURE_OR_THROW( pTarget, "CachedBitmap::redraw(): cannot cast target to RepaintTarget" ); |