diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-07 14:55:32 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-08 08:06:45 +0200 |
commit | 782bbfc65666272497f9c36a9c59d8b32231aa06 (patch) | |
tree | 4a5f93f1f166d25d1e0cb37eba8b8aa4ab143d10 | |
parent | 2c625e036ddaadb71db36f3e44c737b069e6fcb4 (diff) |
fdo#46808, Convert graphic::SvgTools to new style
Change-Id: Id195be7968ab256e44271cad00fa8b5cac8698b4
-rw-r--r-- | offapi/UnoApi_offapi.mk | 2 | ||||
-rw-r--r-- | offapi/com/sun/star/graphic/SvgTools.idl | 11 | ||||
-rw-r--r-- | vcl/source/gdi/svgdata.cxx | 12 |
3 files changed, 8 insertions, 17 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index def1b3a7a716..de96093ab3ce 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -189,6 +189,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/graphic,\ GraphicObject \ GraphicProvider \ Primitive2DTools \ + SvgTools \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection,\ DefaultHelpProvider \ @@ -2651,7 +2652,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/graphic,\ GraphicColorMode \ GraphicType \ PrimitiveFactory2D \ - SvgTools \ XGraphic \ XGraphicObject \ XGraphicProvider \ diff --git a/offapi/com/sun/star/graphic/SvgTools.idl b/offapi/com/sun/star/graphic/SvgTools.idl index 049a4a9ab23a..2a469bdd8c86 100644 --- a/offapi/com/sun/star/graphic/SvgTools.idl +++ b/offapi/com/sun/star/graphic/SvgTools.idl @@ -25,16 +25,11 @@ module com { module sun { module star { module graphic { /** Service that describes the necessary interfaces and properties - to handle svg files + to handle svg files. + Parses a svg file to a sequence of B2DPrimitives for internal usage */ -service SvgTools -{ - /** Interface to parse a svg file to a sequence of - B2DPrimitives for internal usage - */ - interface ::com::sun::star::graphic::XSvgParser; -}; +service SvgTools : XSvgParser; } ; } ; } ; } ; diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx index d5f527c08184..3125e6aa9134 100644 --- a/vcl/source/gdi/svgdata.cxx +++ b/vcl/source/gdi/svgdata.cxx @@ -21,7 +21,7 @@ #include <vcl/svgdata.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/graphic/XSvgParser.hpp> +#include <com/sun/star/graphic/SvgTools.hpp> #include <com/sun/star/graphic/Primitive2DTools.hpp> #include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp> #include <vcl/canvastools.hxx> @@ -119,17 +119,13 @@ void SvgData::ensureSequenceAndRange() if(myInputStream.is()) { // create SVG interpreter - uno::Reference< lang::XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory()); - const OUString aServiceName("com.sun.star.graphic.SvgTools"); + uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext()); try { - const uno::Reference< graphic::XSvgParser > xSvgParser(xFactory->createInstance(aServiceName), uno::UNO_QUERY_THROW); + const uno::Reference< graphic::XSvgParser > xSvgParser = graphic::SvgTools::create(xContext); - if(xSvgParser.is()) - { - maSequence = xSvgParser->getDecomposition(myInputStream, maPath); - } + maSequence = xSvgParser->getDecomposition(myInputStream, maPath); } catch(const uno::Exception&) { |