diff options
Diffstat (limited to 'cppcanvas/source/wrapper')
-rw-r--r-- | cppcanvas/source/wrapper/basegfxfactory.cxx | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/cppcanvas/source/wrapper/basegfxfactory.cxx b/cppcanvas/source/wrapper/basegfxfactory.cxx index d8dedb37eab4..bac25aa1d9d4 100644 --- a/cppcanvas/source/wrapper/basegfxfactory.cxx +++ b/cppcanvas/source/wrapper/basegfxfactory.cxx @@ -43,6 +43,7 @@ #include "implbitmap.hxx" #include "impltext.hxx" + using namespace ::com::sun::star; namespace cppcanvas @@ -71,6 +72,48 @@ namespace cppcanvas { } + PolyPolygonSharedPtr BaseGfxFactory::createPolyPolygon( const CanvasSharedPtr& rCanvas, + const ::basegfx::B2DPolygon& rPoly ) const + { + OSL_ENSURE( rCanvas.get() != NULL && + rCanvas->getUNOCanvas().is(), + "BaseGfxFactory::createPolyPolygon(): Invalid canvas" ); + + if( rCanvas.get() == NULL ) + return PolyPolygonSharedPtr(); + + uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() ); + if( !xCanvas.is() ) + return PolyPolygonSharedPtr(); + + return PolyPolygonSharedPtr( + new internal::ImplPolyPolygon( rCanvas, + ::basegfx::unotools::xPolyPolygonFromB2DPolygon( + xCanvas->getDevice(), + rPoly) ) ); + } + + PolyPolygonSharedPtr BaseGfxFactory::createPolyPolygon( const CanvasSharedPtr& rCanvas, + const ::basegfx::B2DPolyPolygon& rPolyPoly ) const + { + OSL_ENSURE( rCanvas.get() != NULL && + rCanvas->getUNOCanvas().is(), + "BaseGfxFactory::createPolyPolygon(): Invalid canvas" ); + + if( rCanvas.get() == NULL ) + return PolyPolygonSharedPtr(); + + uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() ); + if( !xCanvas.is() ) + return PolyPolygonSharedPtr(); + + return PolyPolygonSharedPtr( + new internal::ImplPolyPolygon( rCanvas, + ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( + xCanvas->getDevice(), + rPolyPoly) ) ); + } + BitmapSharedPtr BaseGfxFactory::createBitmap( const CanvasSharedPtr& rCanvas, const ::basegfx::B2ISize& rSize ) const { @@ -110,6 +153,13 @@ namespace cppcanvas xCanvas->getDevice()->createCompatibleAlphaBitmap( ::basegfx::unotools::integerSize2DFromB2ISize(rSize) ) ) ); } + + TextSharedPtr BaseGfxFactory::createText( const CanvasSharedPtr& rCanvas, const ::rtl::OUString& rText ) const + { + return TextSharedPtr( new internal::ImplText( rCanvas, + rText ) ); + } + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |