diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-11 14:30:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-11 20:27:26 +0100 |
commit | 204a70f568cef3d9c685112d1c32f053a91469ca (patch) | |
tree | 57429848f466036d45a339e24d63f4c5f5deea42 /drawinglayer | |
parent | 76867304b550af5c44c1fd6b82928fb2b69addc7 (diff) |
use VCLUnoHelper::GetWindow
instead of directly using VCLXWindow
Change-Id: I886525169834d24b6c060fb4722e1afda23dbc26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112346
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/controlprimitive2d.cxx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx index 3f20baa1351f..7ccc9660c78c 100644 --- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx @@ -18,6 +18,7 @@ */ #include <drawinglayer/primitive2d/controlprimitive2d.hxx> +#include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/processfactory.hxx> #include <com/sun/star/awt/XControl.hpp> @@ -34,7 +35,6 @@ #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <svtools/optionsdrawinglayer.hxx> -#include <toolkit/awt/vclxwindow.hxx> #include <vcl/window.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -144,25 +144,16 @@ namespace drawinglayer::primitive2d if(xControl.is()) { - uno::Reference< awt::XWindowPeer > xWindowPeer(xControl->getPeer()); + uno::Reference<awt::XWindowPeer> xWindowPeer(xControl->getPeer()); - if(xWindowPeer.is()) + VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xWindowPeer); + if (pWindow) { - VCLXWindow* pVCLXWindow = comphelper::getUnoTunnelImplementation<VCLXWindow>(xWindowPeer); + pWindow = pWindow->GetParent(); - if(pVCLXWindow) + if(pWindow && MapUnit::Map100thMM == pWindow->GetMapMode().GetMapUnit()) { - VclPtr<vcl::Window> pWindow = pVCLXWindow->GetWindow(); - - if(pWindow) - { - pWindow = pWindow->GetParent(); - - if(pWindow && MapUnit::Map100thMM == pWindow->GetMapMode().GetMapUnit()) - { - bUserIs100thmm = true; - } - } + bUserIs100thmm = true; } } } |