Kaydet (Commit) 782bbfc6 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert graphic::SvgTools to new style

Change-Id: Id195be7968ab256e44271cad00fa8b5cac8698b4
üst 2c625e03
......@@ -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 \
......
......@@ -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;
} ; } ; } ; } ;
......
......@@ -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&)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment