diff options
Diffstat (limited to 'canvas/source/directx/dx_impltools.cxx')
-rw-r--r-- | canvas/source/directx/dx_impltools.cxx | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 21778b4843fb..0364ebcbdd52 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -35,7 +35,7 @@ #include <com/sun/star/geometry/RealPoint2D.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <canvas/canvastools.hxx> #include <verifyinput.hxx> @@ -52,10 +52,8 @@ using namespace ::com::sun::star; -namespace dxcanvas +namespace dxcanvas::tools { - namespace tools - { ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D( const uno::Reference< rendering::XPolyPolygon2D >& xPoly ) { LinePolyPolygon* pPolyImpl = dynamic_cast< LinePolyPolygon* >( xPoly.get() ); @@ -134,9 +132,9 @@ namespace dxcanvas return pRet; } - Gdiplus::Graphics* createGraphicsFromBitmap(const BitmapSharedPtr& rBitmap) + GraphicsSharedPtr createGraphicsFromBitmap(const BitmapSharedPtr& rBitmap) { - Gdiplus::Graphics* pRet = Gdiplus::Graphics::FromImage(rBitmap.get()); + GraphicsSharedPtr pRet(Gdiplus::Graphics::FromImage(rBitmap.get())); if( pRet ) setupGraphics( *pRet ); return pRet; @@ -351,14 +349,13 @@ namespace dxcanvas uno::Sequence< sal_Int8 > argbToIntSequence( Gdiplus::ARGB rColor ) { // TODO(F1): handle color space conversions, when defined on canvas/graphicDevice - uno::Sequence< sal_Int8 > aRet(4); - - aRet[0] = static_cast<sal_Int8>((rColor >> 16) & 0xFF); // red - aRet[1] = static_cast<sal_Int8>((rColor >> 8) & 0xFF); // green - aRet[2] = static_cast<sal_Int8>(rColor & 0xFF); // blue - aRet[3] = static_cast<sal_Int8>((rColor >> 24) & 0xFF); // alpha - - return aRet; + return + { + static_cast<sal_Int8>((rColor >> 16) & 0xFF), // red + static_cast<sal_Int8>((rColor >> 8) & 0xFF), // green + static_cast<sal_Int8>(rColor & 0xFF), // blue + static_cast<sal_Int8>((rColor >> 24) & 0xFF) // alpha + }; } Gdiplus::ARGB sequenceToArgb( const uno::Sequence< sal_Int8 >& rColor ) @@ -627,7 +624,6 @@ namespace dxcanvas o_rAttr.SetColorMatrix( &aColorMatrix ); } - } // namespace tools -} // namespace dxcanvas +} // namespace dxcanvas::tools /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |