Kaydet (Commit) 60fcbc1a authored tarafından Michael Meeks's avatar Michael Meeks

toolkit: more VclPtr pieces.

Change-Id: I0393d906657b94cc547986a2165960a85d36cf48
üst 95f686d9
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XWindow.hpp> #include <com/sun/star/awt/XWindow.hpp>
#include <vcl/vclptr.hxx>
namespace vcl { class Window; } namespace vcl { class Window; }
...@@ -116,7 +117,7 @@ namespace toolkit ...@@ -116,7 +117,7 @@ namespace toolkit
// stops listening at the control model // stops listening at the control model
void stopModelListening( ); void stopModelListening( );
vcl::Window* implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const; VclPtr< vcl::Window > implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const;
}; };
......
...@@ -56,11 +56,12 @@ namespace com { namespace sun { namespace star { namespace awt { ...@@ -56,11 +56,12 @@ namespace com { namespace sun { namespace star { namespace awt {
#include <vcl/bitmapex.hxx> #include <vcl/bitmapex.hxx>
#include <vcl/region.hxx> #include <vcl/region.hxx>
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/window.hxx>
#include <tools/mapunit.hxx> #include <tools/mapunit.hxx>
#include <tools/fldunit.hxx> #include <tools/fldunit.hxx>
#include <tools/poly.hxx> #include <tools/poly.hxx>
namespace vcl { class Window; }
class OutputDevice; class OutputDevice;
class MouseEvent; class MouseEvent;
class KeyEvent; class KeyEvent;
...@@ -79,9 +80,9 @@ public: ...@@ -79,9 +80,9 @@ public:
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap> CreateBitmap( const BitmapEx& rBitmap ); static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap> CreateBitmap( const BitmapEx& rBitmap );
// Window // Window
static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow ); static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow );
static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 ); static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 );
static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer ); static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer );
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> GetInterface( vcl::Window* pWindow ); static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> GetInterface( vcl::Window* pWindow );
// OutputDevice // OutputDevice
......
...@@ -225,17 +225,18 @@ namespace toolkit ...@@ -225,17 +225,18 @@ namespace toolkit
} }
vcl::Window* OAccessibleControlContext::implGetWindow( Reference< awt::XWindow >* _pxUNOWindow ) const VclPtr< vcl::Window > OAccessibleControlContext::implGetWindow( Reference< awt::XWindow >* _pxUNOWindow ) const
{ {
Reference< awt::XControl > xControl( getAccessibleCreator(), UNO_QUERY ); Reference< awt::XControl > xControl( getAccessibleCreator(), UNO_QUERY );
Reference< awt::XWindow > xWindow; Reference< awt::XWindow > xWindow;
if ( xControl.is() ) if ( xControl.is() )
xWindow.set(xControl->getPeer(), css::uno::UNO_QUERY); xWindow.set(xControl->getPeer(), css::uno::UNO_QUERY);
vcl::Window* pWindow = xWindow.is() ? VCLUnoHelper::GetWindow( xWindow ) : NULL; VclPtr< vcl::Window > pWindow = xWindow.is() ? VCLUnoHelper::GetWindow( xWindow ) : VclPtr< vcl::Window >();
if ( _pxUNOWindow ) if ( _pxUNOWindow )
*_pxUNOWindow = xWindow; *_pxUNOWindow = xWindow;
return pWindow; return pWindow;
} }
...@@ -259,7 +260,7 @@ namespace toolkit ...@@ -259,7 +260,7 @@ namespace toolkit
// our control // our control
Reference< awt::XWindow > xWindow; Reference< awt::XWindow > xWindow;
vcl::Window* pVCLWindow = implGetWindow( &xWindow ); VclPtr< vcl::Window > pVCLWindow = implGetWindow( &xWindow );
awt::Rectangle aBounds( 0, 0, 0, 0 ); awt::Rectangle aBounds( 0, 0, 0, 0 );
if ( xWindow.is() ) if ( xWindow.is() )
...@@ -319,7 +320,7 @@ namespace toolkit ...@@ -319,7 +320,7 @@ namespace toolkit
// want to do some VCL stuff here ... // want to do some VCL stuff here ...
OContextEntryGuard aGuard( this ); OContextEntryGuard aGuard( this );
vcl::Window* pWindow = implGetWindow( ); VclPtr< vcl::Window > pWindow = implGetWindow();
sal_Int32 nColor = 0; sal_Int32 nColor = 0;
if ( pWindow ) if ( pWindow )
{ {
...@@ -345,7 +346,7 @@ namespace toolkit ...@@ -345,7 +346,7 @@ namespace toolkit
// want to do some VCL stuff here ... // want to do some VCL stuff here ...
OContextEntryGuard aGuard( this ); OContextEntryGuard aGuard( this );
vcl::Window* pWindow = implGetWindow( ); VclPtr< vcl::Window > pWindow = implGetWindow();
sal_Int32 nColor = 0; sal_Int32 nColor = 0;
if ( pWindow ) if ( pWindow )
{ {
......
...@@ -108,22 +108,22 @@ BitmapEx VCLUnoHelper::GetBitmap( const ::com::sun::star::uno::Reference< ::com: ...@@ -108,22 +108,22 @@ BitmapEx VCLUnoHelper::GetBitmap( const ::com::sun::star::uno::Reference< ::com:
return xBmp; return xBmp;
} }
vcl::Window* VCLUnoHelper::GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow ) VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow )
{ {
VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow ); VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow );
return pVCLXWindow ? pVCLXWindow->GetWindow() : NULL; return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >();
} }
vcl::Window* VCLUnoHelper::GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow ) VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow )
{ {
VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow ); VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow );
return pVCLXWindow ? pVCLXWindow->GetWindow() : NULL; return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >();
} }
vcl::Window* VCLUnoHelper::GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindow ) VclPtr< vcl::Window > VCLUnoHelper::GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindow )
{ {
VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow ); VCLXWindow* pVCLXWindow = VCLXWindow::GetImplementation( rxWindow );
return pVCLXWindow ? pVCLXWindow->GetWindow() : NULL; return pVCLXWindow ? pVCLXWindow->GetWindow() : VclPtr< vcl::Window >();
} }
vcl::Region VCLUnoHelper::GetRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) vcl::Region VCLUnoHelper::GetRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment