Kaydet (Commit) 722fffd6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Some svgio clean-up

Change-Id: I48adf3b0500f3e4e37fbe444f8a0773d273e09d2
üst 90ddb6cc
......@@ -20,20 +20,16 @@ $(eval $(call gb_Library_Library,svgio))
$(eval $(call gb_Library_set_componentfile,svgio,svgio/svgio))
$(eval $(call gb_Library_use_packages,svgio,\
svgio_inc \
$(eval $(call gb_Library_set_include,svgio,\
$$(INCLUDE) \
-I$(SRCDIR)/svgio/inc \
))
$(eval $(call gb_Library_use_sdk_api,svgio))
$(eval $(call gb_Library_add_defs,svgio,\
-DSVGIO_DLLIMPLEMENTATION \
))
$(eval $(call gb_Library_use_libraries,svgio,\
basegfx \
drawinglayer \
comphelper \
cppu \
cppuhelper \
sal \
......
......@@ -20,7 +20,6 @@ $(eval $(call gb_Module_Module,svgio))
$(eval $(call gb_Module_add_targets,svgio,\
Library_svgio \
Package_inc \
))
# vim: set noet ts=4 sw=4:
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
$(eval $(call gb_Package_Package,svgio_inc,$(SRCDIR)/svgio/inc))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgiodllapi.h,svgio/svgiodllapi.h))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgcharacternode.hxx,svgio/svgreader/svgcharacternode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgcirclenode.hxx,svgio/svgreader/svgcirclenode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgclippathnode.hxx,svgio/svgreader/svgclippathnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgdocument.hxx,svgio/svgreader/svgdocument.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgdocumenthandler.hxx,svgio/svgreader/svgdocumenthandler.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgellipsenode.hxx,svgio/svgreader/svgellipsenode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svggnode.hxx,svgio/svgreader/svggnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svggradientnode.hxx,svgio/svgreader/svggradientnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svggradientstopnode.hxx,svgio/svgreader/svggradientstopnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgimagenode.hxx,svgio/svgreader/svgimagenode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svglinenode.hxx,svgio/svgreader/svglinenode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgnode.hxx,svgio/svgreader/svgnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgmarkernode.hxx,svgio/svgreader/svgmarkernode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgmasknode.hxx,svgio/svgreader/svgmasknode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgpaint.hxx,svgio/svgreader/svgpaint.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgpathnode.hxx,svgio/svgreader/svgpathnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgpatternnode.hxx,svgio/svgreader/svgpatternnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgpolynode.hxx,svgio/svgreader/svgpolynode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgrectnode.hxx,svgio/svgreader/svgrectnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgstyleattributes.hxx,svgio/svgreader/svgstyleattributes.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgstylenode.hxx,svgio/svgreader/svgstylenode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgsvgnode.hxx,svgio/svgreader/svgsvgnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgsymbolnode.hxx,svgio/svgreader/svgsymbolnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgtextnode.hxx,svgio/svgreader/svgtextnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgtoken.hxx,svgio/svgreader/svgtoken.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgtrefnode.hxx,svgio/svgreader/svgtrefnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgtools.hxx,svgio/svgreader/svgtools.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgtextpathnode.hxx,svgio/svgreader/svgtextpathnode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgtspannode.hxx,svgio/svgreader/svgtspannode.hxx))
$(eval $(call gb_Package_add_file,svgio_inc,inc/svgio/svgreader/svgusenode.hxx,svgio/svgreader/svgusenode.hxx))
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "precompiled_svgio.hxx"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:30.796084
#ifdef PRECOMPILED_HEADERS
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGCHARACTERNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGCHARACTERNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
//////////////////////////////////////////////////////////////////////////////
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGCIRCLENODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGCIRCLENODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGCLIPPATHNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGCLIPPATHNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGDOCUMENT_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGDOCUMENT_HXX
#include <svgio/svgiodllapi.h>
#include <boost/utility.hpp>
#include <svgio/svgreader/svgnode.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGDOCUMENTHANDLER_HXX
#include <svgio/svgiodllapi.h>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <svgio/svgreader/svgdocument.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGELLIPSENODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGELLIPSENODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGGNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGGNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGGRADIENTNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGGRADIENTNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <drawinglayer/primitive2d/svggradientprimitive2d.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGGRADIENTSTOPNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGGRADIENTSTOPNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGIMAGENODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGIMAGENODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGLINENODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGLINENODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGMARKERNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGMARKERNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGMASKNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGMASKNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgtools.hxx>
#include <svgio/svgreader/svgtoken.hxx>
#include <svgio/svgreader/svgpaint.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGPAINT_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGPAINT_HXX
#include <svgio/svgiodllapi.h>
#include <basegfx/color/bcolor.hxx>
//////////////////////////////////////////////////////////////////////////////
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGPATHNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGPATHNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGPATTERNNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGPATTERNNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGPOLYNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGPOLYNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGRECTNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGRECTNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGSTYLEATTRIBUTES_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGSTYLEATTRIBUTES_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgpaint.hxx>
#include <svgio/svgreader/svgnode.hxx>
#include <vcl/vclenum.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGSTYLENODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGSTYLENODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGSVGNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGSVGNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgstyleattributes.hxx>
//////////////////////////////////////////////////////////////////////////////
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGSYMBOLNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGSYMBOLNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgstyleattributes.hxx>
//////////////////////////////////////////////////////////////////////////////
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGTEXTNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGTEXTNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <svgio/svgreader/svgcharacternode.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGTEXTPATHNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGTEXTPATHNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <svgio/svgreader/svgpathnode.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGTOKEN_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGTOKEN_HXX
#include <svgio/svgiodllapi.h>
#include <rtl/ustring.hxx>
#include <boost/unordered_map.hpp>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGTOOLS_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGTOOLS_HXX
#include <svgio/svgiodllapi.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGTREFNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGTREFNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <svgio/svgreader/svgtextnode.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_SVGTSPANNODE_HXX
#define INCLUDED_SVGIO_SVGREADER_SVGTSPANNODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgcharacternode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <svgio/svgreader/svgtools.hxx>
......
......@@ -20,7 +20,6 @@
#ifndef INCLUDED_SVGIO_SVGREADER_USENODE_HXX
#define INCLUDED_SVGIO_SVGREADER_USENODE_HXX
#include <svgio/svgiodllapi.h>
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
......
......@@ -17,76 +17,30 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <svgio/svgiodllapi.h>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <uno/environment.h>
#include <cppuhelper/factory.hxx>
#include "sal/config.h"
//////////////////////////////////////////////////////////////////////////////
#include "cppuhelper/factory.hxx"
#include "cppuhelper/implementationentry.hxx"
#include "sal/types.h"
using namespace ::com::sun::star;
#include "xsvgparser.hxx"
//////////////////////////////////////////////////////////////////////////////
// predefines
namespace {
namespace svgio
{
namespace svgreader
{
extern uno::Sequence< rtl::OUString > SAL_CALL XSvgParser_getSupportedServiceNames();
extern rtl::OUString SAL_CALL XSvgParser_getImplementationName();
extern uno::Reference< uno::XInterface > SAL_CALL XSvgParser_createInstance( const uno::Reference< lang::XMultiServiceFactory > & );
} // end of namespace svgreader
} // end of namespace svgio
//////////////////////////////////////////////////////////////////////////////
// component_getImplementationEnvironment
static cppu::ImplementationEntry const services[] = {
{ &svgio::svgreader::XSvgParser_createInstance,
&svgio::svgreader::XSvgParser_getImplementationName,
&svgio::svgreader::XSvgParser_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 } };
extern "C"
{
SVGIO_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
}
//////////////////////////////////////////////////////////////////////////////
// component_getFactory
extern "C"
extern "C" SAL_DLLPUBLIC void * SAL_CALL svgio_component_getFactory(
char const * pImplName, void * pServiceManager, void * pRegistryKey)
{
SVGIO_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
{
uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = 0;
if(svgio::svgreader::XSvgParser_getImplementationName().equalsAscii(pImplName))
{
xFactory = ::cppu::createSingleFactory(
reinterpret_cast< lang::XMultiServiceFactory * >(pServiceManager),
svgio::svgreader::XSvgParser_getImplementationName(),
svgio::svgreader::XSvgParser_createInstance,
svgio::svgreader::XSvgParser_getSupportedServiceNames());
}
if(xFactory.is())
{
xFactory->acquire();
pRet = xFactory.get();
}
return pRet;
}
return cppu::component_getFactoryHelper(
pImplName, pServiceManager, pRegistryKey, services);
}
//////////////////////////////////////////////////////////////////////////////
// eof
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -17,15 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "sal/config.h"
#include <com/sun/star/graphic/XSvgParser.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include <svgio/svgreader/svgdocumenthandler.hxx>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <comphelper/processfactory.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include "xsvgparser.hxx"
//////////////////////////////////////////////////////////////////////////////
using namespace ::com::sun::star;
......@@ -42,9 +46,12 @@ namespace svgio
XSvgParser(const XSvgParser&);
XSvgParser& operator=(const XSvgParser&);
uno::Reference< uno::XComponentContext > context_;
protected:
public:
XSvgParser();
XSvgParser(
uno::Reference< uno::XComponentContext > const & context);
virtual ~XSvgParser();
// XSvgParser
......@@ -80,9 +87,9 @@ namespace svgio
return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "svgio::svgreader::XSvgParser" ) );
}
uno::Reference< uno::XInterface > SAL_CALL XSvgParser_createInstance(const uno::Reference< lang::XMultiServiceFactory >&)
uno::Reference< uno::XInterface > SAL_CALL XSvgParser_createInstance(const uno::Reference< uno::XComponentContext >& context)
{
return static_cast< ::cppu::OWeakObject* >(new XSvgParser);
return static_cast< ::cppu::OWeakObject* >(new XSvgParser(context));
}
} // end of namespace svgreader
} // end of namespace svgio
......@@ -93,7 +100,9 @@ namespace svgio
{
namespace svgreader
{
XSvgParser::XSvgParser()
XSvgParser::XSvgParser(
uno::Reference< uno::XComponentContext > const & context):
context_(context)
{
}
......@@ -121,9 +130,7 @@ namespace svgio
// get parser
uno::Reference< xml::sax::XParser > xParser(
comphelper::getProcessServiceFactory()->createInstance(
rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser") ),
uno::UNO_QUERY_THROW );
xml::sax::Parser::create(context_));
// connect parser and filter
xParser->setDocumentHandler(xSvgDocHdl);
......
......@@ -16,18 +16,38 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SVGIODLLAPI_H
#define INCLUDED_SVGIODLLAPI_H
#ifndef INCLUDED_SVGIO_SOURCE_SVGUNO_XSVGPARSER_HXX
#define INCLUDED_SVGIO_SOURCE_SVGUNO_XSVGPARSER_HXX
#include "sal/config.h"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
#include "sal/types.h"
#if defined(SVGIO_DLLIMPLEMENTATION)
#define SVGIO_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
#else
#define SVGIO_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
#define SVGIO_DLLPRIVATE SAL_DLLPRIVATE
namespace com { namespace sun { namespace star {
namespace uno {
class XComponentContext;
class XInterface;
}
} } }
namespace rtl { class OUString; }
namespace svgio { namespace svgreader {
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
XSvgParser_createInstance(
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
const &);
#endif /* INCLUDED_SVGIODLLAPI_H */
rtl::OUString SAL_CALL XSvgParser_getImplementationName();
com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
XSvgParser_getSupportedServiceNames();
} }
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<component loader="com.sun.star.loader.SharedLibrary"
<component loader="com.sun.star.loader.SharedLibrary" prefix="svgio"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="svgio::svgreader::XSvgParser">
<service name="com.sun.star.graphic.SvgTools"/>
......
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