diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-19 13:57:45 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-20 07:32:52 +0200 |
commit | 23a16f5d3856d6eb61d599af9e47add4c456bfb2 (patch) | |
tree | 023648c6747837a37be5f9ec5fed1bae5d023ec4 /svx | |
parent | b4b0b400071a0fd12587334e3b9d615f35be671b (diff) |
fdo#46808, convert graphic::PrimitiveFactory2D to new style
The service already existed, it just needed an IDL file
Change-Id: I40fb28d94253c3c577655bb888ff0d0ee3ba3822
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/charthelper.cxx | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/svx/source/svdraw/charthelper.cxx b/svx/source/svdraw/charthelper.cxx index cc87019a7a5c..fa7ea9b597c8 100644 --- a/svx/source/svdraw/charthelper.cxx +++ b/svx/source/svdraw/charthelper.cxx @@ -26,7 +26,7 @@ #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> -#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp> +#include <com/sun/star/graphic/PrimitiveFactory2D.hpp> #include <drawinglayer/geometry/viewinformation2d.hxx> //// header for function rtl_createUuid @@ -87,32 +87,27 @@ drawinglayer::primitive2d::Primitive2DSequence ChartHelper::tryToGetChartContent if(xShapeAccess.is() && xShapeAccess->getCount()) { const sal_Int32 nShapeCount(xShapeAccess->getCount()); - const uno::Reference< lang::XMultiServiceFactory > xMgr(::comphelper::getProcessServiceFactory()); - const uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory( - xMgr->createInstance( - String(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.graphic.PrimitiveFactory2D" ))), - uno::UNO_QUERY); + const uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); + const uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory = + graphic::PrimitiveFactory2D::create( xContext ); - if(xPrimitiveFactory.is()) + const uno::Sequence< beans::PropertyValue > aParams; + uno::Reference< drawing::XShape > xShape; + + for(sal_Int32 a(0); a < nShapeCount; a++) { - const uno::Sequence< beans::PropertyValue > aParams; - uno::Reference< drawing::XShape > xShape; + xShapeAccess->getByIndex(a) >>= xShape; - for(sal_Int32 a(0); a < nShapeCount; a++) + if(xShape.is()) { - xShapeAccess->getByIndex(a) >>= xShape; - - if(xShape.is()) - { - const drawinglayer::primitive2d::Primitive2DSequence aNew( - xPrimitiveFactory->createPrimitivesFromXShape( - xShape, - aParams)); - - drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence( - aRetval, - aNew); - } + const drawinglayer::primitive2d::Primitive2DSequence aNew( + xPrimitiveFactory->createPrimitivesFromXShape( + xShape, + aParams)); + + drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence( + aRetval, + aNew); } } } |