diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-03 17:11:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-04 20:38:00 +0200 |
commit | 66df5e5bb0fc19c28c99592b562be8778438057c (patch) | |
tree | 9138b4c21d721fed6d6541fb21fcf2cd2aa6cef7 | |
parent | a7411c2ee537355dc8051b7059e3a4d0bc708c04 (diff) |
Related: tdf#127529 make it harder to misunderstand this VirtualDevice ctor
Change-Id: I250bc68da118a994a2e0ff8ab9eb11112827756d
Reviewed-on: https://gerrit.libreoffice.org/80158
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | canvas/source/directx/dx_textlayout_drawhelper.cxx | 4 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | include/vcl/virdev.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 | ||||
-rw-r--r-- | vcl/qt5/Qt5SvpSurface.cxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/virdev.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairo_xlib_cairo.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/cairo_gtk3_cairo.cxx | 3 |
8 files changed, 13 insertions, 11 deletions
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx index c751b941e8b5..71c4c7e3a904 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx @@ -80,7 +80,7 @@ namespace dxcanvas SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.hDC = reinterpret_cast< ::HDC >(hdc); - ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(&aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT); // disable font antialiasing - GDI does not handle alpha // surfaces properly. @@ -241,7 +241,7 @@ namespace dxcanvas SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.hDC = reinterpret_cast< ::HDC >(GetDC( nullptr )); - ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(&aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xVirtualDevice(aSystemGraphicsData, Size(1, 1), DeviceFormat::DEFAULT); // create the font const css::rendering::FontRequest& rFontRequest = rCanvasFont->getFontRequest(); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index b9aca6845c22..e468c3ed23f7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1773,7 +1773,7 @@ void paintTileToCGContext(ITiledRenderable* pDocument, SystemGraphicsData aData; aData.rCGContext = reinterpret_cast<CGContextRef>(rCGContext); - ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(aData, Size(1, 1), DeviceFormat::DEFAULT); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixel(nCanvasSize); pDocument->paintTile(*pDevice, nCanvasSize.Width(), nCanvasSize.Height(), @@ -4732,7 +4732,7 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW SystemGraphicsData aData; aData.rCGContext = cgc; - ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> pDevice(aData, Size(1, 1), DeviceFormat::DEFAULT); pDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); pDevice->SetOutputSizePixel(Size(nWidth, nHeight)); diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index 2ae778eb73ba..9baba707e23a 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -145,7 +145,7 @@ public: Any rendering will happen directly on the context and not on any intermediate bitmap. Note: This might not be supported on all platforms ! */ - explicit VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, + explicit VirtualDevice(const SystemGraphicsData& rData, const Size &rSize, DeviceFormat eFormat); virtual ~VirtualDevice() override; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 4ec9e293f74b..19c71ccea2db 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3628,7 +3628,7 @@ void SAL_CALL SwXTextDocument::paintTile( const ::css::uno::Any& Parent, ::sal_I sal_Int64 nWindowHandle; Parent >>= nWindowHandle; aData.hWnd = reinterpret_cast<HWND>(nWindowHandle); - ScopedVclPtrInstance<VirtualDevice> xDevice(&aData, Size(1, 1), DeviceFormat::DEFAULT); + ScopedVclPtrInstance<VirtualDevice> xDevice(aData, Size(1, 1), DeviceFormat::DEFAULT); paintTile(*xDevice, nOutputWidth, nOutputHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight); #else // TODO: support other platforms diff --git a/vcl/qt5/Qt5SvpSurface.cxx b/vcl/qt5/Qt5SvpSurface.cxx index 00f6004bd2a0..3e300755a992 100644 --- a/vcl/qt5/Qt5SvpSurface.cxx +++ b/vcl/qt5/Qt5SvpSurface.cxx @@ -65,7 +65,8 @@ void Qt5SvpSurface::flush() const VclPtr<VirtualDevice> Qt5SvpSurface::createVirtualDevice() const { - return VclPtrInstance<VirtualDevice>(nullptr, Size(1, 1), DeviceFormat::DEFAULT); + //TODO allow creating a VirtualDevice to draw to the current surface + return VclPtrInstance<VirtualDevice>(DeviceFormat::DEFAULT); } } // namespace cairo diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 3d16815b2557..a2bbcdff8f03 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -210,7 +210,7 @@ VirtualDevice::VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, ImplInitVirDev(pCompDev ? pCompDev : Application::GetDefaultDevice(), 0, 0); } -VirtualDevice::VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, +VirtualDevice::VirtualDevice(const SystemGraphicsData& rData, const Size &rSize, DeviceFormat eFormat) : OutputDevice(OUTDEV_VIRDEV) , meFormat(eFormat) @@ -218,7 +218,7 @@ VirtualDevice::VirtualDevice(const SystemGraphicsData *pData, const Size &rSize, { SAL_INFO( "vcl.virdev", "VirtualDevice::VirtualDevice( " << static_cast<int>(eFormat) << " )" ); - ImplInitVirDev(Application::GetDefaultDevice(), rSize.Width(), rSize.Height(), pData); + ImplInitVirDev(Application::GetDefaultDevice(), rSize.Width(), rSize.Height(), &rData); } VirtualDevice::~VirtualDevice() diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx index 1ec6f2b67fb4..760a8d595903 100644 --- a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx +++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx @@ -255,7 +255,7 @@ namespace cairo int width = cairo_xlib_surface_get_width(mpSurface.get()); int height = cairo_xlib_surface_get_height(mpSurface.get()); - return VclPtr<VirtualDevice>::Create(&aSystemGraphicsData, + return VclPtr<VirtualDevice>::Create(aSystemGraphicsData, Size(width, height), getFormat()); } diff --git a/vcl/unx/gtk3/cairo_gtk3_cairo.cxx b/vcl/unx/gtk3/cairo_gtk3_cairo.cxx index 73a650e2757c..9b273ea16cf5 100644 --- a/vcl/unx/gtk3/cairo_gtk3_cairo.cxx +++ b/vcl/unx/gtk3/cairo_gtk3_cairo.cxx @@ -108,7 +108,8 @@ namespace cairo VclPtr<VirtualDevice> Gtk3Surface::createVirtualDevice() const { - return VclPtrInstance<VirtualDevice>(nullptr, Size(1, 1), DeviceFormat::DEFAULT); + //TODO allow creating a VirtualDevice to draw to the current surface + return VclPtrInstance<VirtualDevice>(DeviceFormat::DEFAULT); } } |