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,\ ...@@ -189,6 +189,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/graphic,\
GraphicObject \ GraphicObject \
GraphicProvider \ GraphicProvider \
Primitive2DTools \ Primitive2DTools \
SvgTools \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection,\
DefaultHelpProvider \ DefaultHelpProvider \
...@@ -2651,7 +2652,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/graphic,\ ...@@ -2651,7 +2652,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/graphic,\
GraphicColorMode \ GraphicColorMode \
GraphicType \ GraphicType \
PrimitiveFactory2D \ PrimitiveFactory2D \
SvgTools \
XGraphic \ XGraphic \
XGraphicObject \ XGraphicObject \
XGraphicProvider \ XGraphicProvider \
......
...@@ -25,16 +25,11 @@ module com { module sun { module star { module graphic ...@@ -25,16 +25,11 @@ module com { module sun { module star { module graphic
{ {
/** Service that describes the necessary interfaces and properties /** 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 service SvgTools : XSvgParser;
{
/** Interface to parse a svg file to a sequence of
B2DPrimitives for internal usage
*/
interface ::com::sun::star::graphic::XSvgParser;
};
} ; } ; } ; } ; } ; } ; } ; } ;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <vcl/svgdata.hxx> #include <vcl/svgdata.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #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/graphic/Primitive2DTools.hpp>
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp> #include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
#include <vcl/canvastools.hxx> #include <vcl/canvastools.hxx>
...@@ -119,18 +119,14 @@ void SvgData::ensureSequenceAndRange() ...@@ -119,18 +119,14 @@ void SvgData::ensureSequenceAndRange()
if(myInputStream.is()) if(myInputStream.is())
{ {
// create SVG interpreter // create SVG interpreter
uno::Reference< lang::XMultiServiceFactory > xFactory(::comphelper::getProcessServiceFactory()); uno::Reference< uno::XComponentContext > xContext(::comphelper::getProcessComponentContext());
const OUString aServiceName("com.sun.star.graphic.SvgTools");
try 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&) catch(const uno::Exception&)
{ {
OSL_ENSURE(sal_False, "Got no graphic::XSvgParser (!)" ); OSL_ENSURE(sal_False, "Got no graphic::XSvgParser (!)" );
......
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