diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-10-05 17:19:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-10-05 18:31:20 +0200 |
commit | 5926b22b5dc33490d23d594b129eb8a70b94ffb0 (patch) | |
tree | 366bf4c969c0a7118c95dae249de74bc4f866d74 | |
parent | 623c0cff7589e3f2298c16c7402cf160b99fabe2 (diff) |
The SystemEnvData passed into the canvas factories appears to be unused
It was passed in as aArg[1] ever since d551190e8311242eadda4a3e82efff160175cb04
"INTEGRATION: CWS canvas05", but I can't find any current use of that specific
argument in canvas/source/ (assuming that all the factories are implemented
there), nor can I find any trace in the git history of it ever havig been used.
That means that Window::GetSystemDataAny is unused now and can be removed.
Change-Id: I16efe548afb5cc3e0606cffea135f7e6674d5def
Reviewed-on: https://gerrit.libreoffice.org/80295
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | canvas/source/cairo/cairo_canvas.cxx | 17 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_spritecanvas.cxx | 19 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvas.cxx | 12 | ||||
-rw-r--r-- | canvas/source/directx/dx_spritecanvas.cxx | 10 | ||||
-rw-r--r-- | canvas/source/opengl/ogl_spritecanvas.cxx | 17 | ||||
-rw-r--r-- | canvas/source/vcl/canvas.cxx | 11 | ||||
-rw-r--r-- | canvas/source/vcl/spritecanvas.cxx | 15 | ||||
-rw-r--r-- | include/vcl/window.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 23 |
9 files changed, 53 insertions, 72 deletions
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 025beafda4ba..1a5e215171ac 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -59,17 +59,16 @@ namespace cairocanvas /* maArguments: 0: ptr to creating instance (Window or VirtualDevice) - 1: SystemEnvData as a streamed Any (or empty for VirtualDevice) - 2: current bounds of creating instance - 3: bool, denoting always on top state for Window (always false for VirtualDevice) - 4: XWindow for creating Window (or empty for VirtualDevice) - 5: SystemGraphicsData as a streamed Any + 1: current bounds of creating instance + 2: bool, denoting always on top state for Window (always false for VirtualDevice) + 3: XWindow for creating Window (or empty for VirtualDevice) + 4: SystemGraphicsData as a streamed Any */ SAL_INFO("canvas.cairo","Canvas created " << this); - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER && - maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, + maArguments[4].getValueTypeClass() == uno::TypeClass_SEQUENCE, "Canvas::initialize: wrong number of arguments, or wrong types" ); // We expect a single Any here, containing a pointer to a valid @@ -82,10 +81,10 @@ namespace cairocanvas "Canvas::initialize: invalid OutDev pointer" ); awt::Rectangle aBounds; - maArguments[2] >>= aBounds; + maArguments[1] >>= aBounds; uno::Sequence<sal_Int8> aSeq; - maArguments[5] >>= aSeq; + maArguments[4] >>= aSeq; const SystemGraphicsData* pSysData=reinterpret_cast<const SystemGraphicsData*>(aSeq.getConstArray()); if( !pSysData || !pSysData->nSize ) diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index 1ec6f7e65810..23b0bf04eb52 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -59,25 +59,24 @@ namespace cairocanvas /* maArguments: 0: ptr to creating instance (Window or VirtualDevice) - 1: SystemEnvData as a streamed Any (or empty for VirtualDevice) - 2: current bounds of creating instance - 3: bool, denoting always on top state for Window (always false for VirtualDevice) - 4: XWindow for creating Window (or empty for VirtualDevice) - 5: SystemGraphicsData as a streamed Any + 1: current bounds of creating instance + 2: bool, denoting always on top state for Window (always false for VirtualDevice) + 3: XWindow for creating Window (or empty for VirtualDevice) + 4: SystemGraphicsData as a streamed Any */ - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + maArguments[3].getValueTypeClass() == uno::TypeClass_INTERFACE, "CairoSpriteCanvas::initialize: wrong number of arguments, or wrong types" ); awt::Rectangle aRect; - maArguments[2] >>= aRect; + maArguments[1] >>= aRect; bool bIsFullscreen( false ); - maArguments[3] >>= bIsFullscreen; + maArguments[2] >>= bIsFullscreen; uno::Reference< awt::XWindow > xParentWindow; - maArguments[4] >>= xParentWindow; + maArguments[3] >>= xParentWindow; VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index e9fde8ae8fa5..eb00ec6591fc 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -87,12 +87,12 @@ namespace dxcanvas // At index 1, we expect a HWND handle here, containing a // pointer to a valid window, on which to output // At index 2, we expect the current window bound rect - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && - maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && + maArguments[4].getValueTypeClass() == uno::TypeClass_SEQUENCE, "Canvas::initialize: wrong number of arguments, or wrong types" ); uno::Sequence<sal_Int8> aSeq; - maArguments[5] >>= aSeq; + maArguments[4] >>= aSeq; const SystemGraphicsData* pSysData=reinterpret_cast<const SystemGraphicsData*>(aSeq.getConstArray()); if( !pSysData || !pSysData->hDC ) @@ -148,12 +148,12 @@ namespace dxcanvas // At index 1, we expect a HWND handle here, containing a // pointer to a valid window, on which to output // At index 2, we expect the current window bound rect - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && - maArguments[5].getValueTypeClass() == uno::TypeClass_SEQUENCE, + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && + maArguments[4].getValueTypeClass() == uno::TypeClass_SEQUENCE, "Canvas::initialize: wrong number of arguments, or wrong types" ); uno::Sequence<sal_Int8> aSeq; - maArguments[5] >>= aSeq; + maArguments[4] >>= aSeq; const SystemGraphicsData* pSysData=reinterpret_cast<const SystemGraphicsData*>(aSeq.getConstArray()); if( !pSysData || !pSysData->hDC ) diff --git a/canvas/source/directx/dx_spritecanvas.cxx b/canvas/source/directx/dx_spritecanvas.cxx index 65bf68ed792f..5d8243bc121d 100644 --- a/canvas/source/directx/dx_spritecanvas.cxx +++ b/canvas/source/directx/dx_spritecanvas.cxx @@ -76,21 +76,21 @@ namespace dxcanvas 4: XWindow for creating Window (or empty for VirtualDevice) 5: SystemGraphicsData as a streamed Any */ - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && + maArguments[3].getValueTypeClass() == uno::TypeClass_INTERFACE, "VCLSpriteCanvas::initialize: wrong number of arguments, or wrong types" ); uno::Reference< awt::XWindow > xParentWindow; - maArguments[4] >>= xParentWindow; + maArguments[3] >>= xParentWindow; auto pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!" ); awt::Rectangle aRect; - maArguments[2] >>= aRect; + maArguments[1] >>= aRect; bool bIsFullscreen( false ); - maArguments[3] >>= bIsFullscreen; + maArguments[2] >>= bIsFullscreen; // setup helper maDeviceHelper.init( *pParentWindow, diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx index 0bed1cac8565..13fd6ec49c63 100644 --- a/canvas/source/opengl/ogl_spritecanvas.cxx +++ b/canvas/source/opengl/ogl_spritecanvas.cxx @@ -50,25 +50,24 @@ namespace oglcanvas /* aArguments: 0: ptr to creating instance (Window or VirtualDevice) - 1: SystemEnvData as a streamed Any (or empty for VirtualDevice) - 2: current bounds of creating instance - 3: bool, denoting always on top state for Window (always false for VirtualDevice) - 4: XWindow for creating Window (or empty for VirtualDevice) - 5: SystemGraphicsData as a streamed Any + 1: current bounds of creating instance + 2: bool, denoting always on top state for Window (always false for VirtualDevice) + 3: XWindow for creating Window (or empty for VirtualDevice) + 4: SystemGraphicsData as a streamed Any */ - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && + maArguments[3].getValueTypeClass() == uno::TypeClass_INTERFACE, "OpenGL SpriteCanvas::initialize: wrong number of arguments, or wrong types" ); uno::Reference< awt::XWindow > xParentWindow; - maArguments[4] >>= xParentWindow; + maArguments[3] >>= xParentWindow; VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!", nullptr); awt::Rectangle aRect; - maArguments[2] >>= aRect; + maArguments[1] >>= aRect; // setup helper maDeviceHelper.init( *pParentWindow, diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 56f2bc0f0c64..988fa530007b 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -79,17 +79,16 @@ namespace vclcanvas /* maArguments: 0: ptr to creating instance (Window or VirtualDevice) - 1: SystemEnvData as a streamed Any (or empty for VirtualDevice) - 2: current bounds of creating instance - 3: bool, denoting always on top state for Window (always false for VirtualDevice) - 4: XWindow for creating Window (or empty for VirtualDevice) - 5: SystemGraphicsData as a streamed Any + 1: current bounds of creating instance + 2: bool, denoting always on top state for Window (always false for VirtualDevice) + 3: XWindow for creating Window (or empty for VirtualDevice) + 4: SystemGraphicsData as a streamed Any */ SolarMutexGuard aGuard; SAL_INFO("canvas.vcl", "VCLCanvas::initialize called" ); - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 6 && + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER, "Canvas::initialize: wrong number of arguments, or wrong types" ); diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index 1a2580f6c852..469be8eabcda 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.cxx @@ -76,19 +76,18 @@ namespace vclcanvas /* maArguments: 0: ptr to creating instance (Window or VirtualDevice) - 1: SystemEnvData as a streamed Any (or empty for VirtualDevice) - 2: current bounds of creating instance - 3: bool, denoting always on top state for Window (always false for VirtualDevice) - 4: XWindow for creating Window (or empty for VirtualDevice) - 5: SystemGraphicsData as a streamed Any + 1: current bounds of creating instance + 2: bool, denoting always on top state for Window (always false for VirtualDevice) + 3: XWindow for creating Window (or empty for VirtualDevice) + 4: SystemGraphicsData as a streamed Any */ - ENSURE_ARG_OR_THROW( maArguments.getLength() >= 5 && + ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 && maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER && - maArguments[4].getValueTypeClass() == uno::TypeClass_INTERFACE, + maArguments[3].getValueTypeClass() == uno::TypeClass_INTERFACE, "VCLSpriteCanvas::initialize: wrong number of arguments, or wrong types" ); uno::Reference< awt::XWindow > xParentWindow; - maArguments[4] >>= xParentWindow; + maArguments[3] >>= xParentWindow; OutDevProviderSharedPtr pOutDev( new WindowOutDevHolder(xParentWindow) ); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index ed4786d31f55..965bc79f65c7 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1193,7 +1193,6 @@ public: const Point& rPos, const Size& rSize, const Size&) const override; virtual const SystemEnvData* GetSystemData() const; - css::uno::Any GetSystemDataAny() const; // API to set/query the component interfaces virtual css::uno::Reference< css::awt::XWindowPeer > diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 236e08a1bba7..05fe9b8ff9e3 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3695,19 +3695,18 @@ Reference< css::rendering::XCanvas > Window::ImplGetCanvas( bool bSpriteCanvas ) if( xCanvas.is() ) return xCanvas; - Sequence< Any > aArg(6); + Sequence< Any > aArg(5); // Feed any with operating system's window handle // common: first any is VCL pointer to window (for VCL canvas) aArg[ 0 ] <<= reinterpret_cast<sal_Int64>(this); - aArg[ 1 ] = GetSystemDataAny(); - aArg[ 2 ] <<= css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ); - aArg[ 3 ] <<= mpWindowImpl->mbAlwaysOnTop; - aArg[ 4 ] <<= Reference< css::awt::XWindow >( + aArg[ 1 ] <<= css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ); + aArg[ 2 ] <<= mpWindowImpl->mbAlwaysOnTop; + aArg[ 3 ] <<= Reference< css::awt::XWindow >( const_cast<vcl::Window*>(this)->GetComponentInterface(), UNO_QUERY ); - aArg[ 5 ] = GetSystemGfxDataAny(); + aArg[ 4 ] = GetSystemGfxDataAny(); Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); @@ -3793,18 +3792,6 @@ const SystemEnvData* Window::GetSystemData() const return mpWindowImpl->mpFrame ? mpWindowImpl->mpFrame->GetSystemData() : nullptr; } -Any Window::GetSystemDataAny() const -{ - Any aRet; - const SystemEnvData* pSysData = GetSystemData(); - if( pSysData ) - { - Sequence< sal_Int8 > aSeq( reinterpret_cast<sal_Int8 const *>(pSysData), pSysData->nSize ); - aRet <<= aSeq; - } - return aRet; -} - bool Window::SupportsDoubleBuffering() const { return mpWindowImpl->mpFrameData->mpBuffer; |