merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / model / main / PolarCoordinateSystem.cxx
blobba27a517d94f3aef5366b0dfd478fed5c49ce452
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PolarCoordinateSystem.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "PolarCoordinateSystem.hxx"
34 #include "macros.hxx"
35 #include "servicenames_coosystems.hxx"
37 using namespace ::com::sun::star;
39 using ::com::sun::star::uno::RuntimeException;
40 using ::com::sun::star::uno::Reference;
41 using ::com::sun::star::uno::Sequence;
42 using ::rtl::OUString;
44 namespace
47 static const ::rtl::OUString lcl_aServiceNamePolar2d(
48 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PolarCoordinateSystem2d" ));
49 static const ::rtl::OUString lcl_aServiceNamePolar3d(
50 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PolarCoordinateSystem3d" ));
52 static const ::rtl::OUString lcl_aImplementationNamePolar2d(
53 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PolarCoordinateSystem2d" ));
54 static const ::rtl::OUString lcl_aImplementationNamePolar3d(
55 RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.PolarCoordinateSystem3d" ));
58 namespace chart
61 // explicit
62 PolarCoordinateSystem::PolarCoordinateSystem(
63 const uno::Reference< uno::XComponentContext > & xContext,
64 sal_Int32 nDimensionCount /* = 2 */,
65 sal_Bool bSwapXAndYAxis /* = sal_False */ ) :
66 BaseCoordinateSystem( xContext, nDimensionCount, bSwapXAndYAxis )
69 PolarCoordinateSystem::PolarCoordinateSystem(
70 const PolarCoordinateSystem & rSource ) :
71 BaseCoordinateSystem( rSource )
74 PolarCoordinateSystem::~PolarCoordinateSystem()
77 // ____ XCoordinateSystem ____
78 ::rtl::OUString SAL_CALL PolarCoordinateSystem::getCoordinateSystemType()
79 throw (RuntimeException)
81 return CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
84 ::rtl::OUString SAL_CALL PolarCoordinateSystem::getViewServiceName()
85 throw (RuntimeException)
87 return CHART2_COOSYSTEM_POLAR_VIEW_SERVICE_NAME;
90 // ____ XCloneable ____
91 uno::Reference< util::XCloneable > SAL_CALL PolarCoordinateSystem::createClone()
92 throw (RuntimeException)
94 return Reference< util::XCloneable >( new PolarCoordinateSystem( *this ));
97 // ____ XServiceInfo ____
98 Sequence< OUString > PolarCoordinateSystem::getSupportedServiceNames_Static()
100 Sequence< OUString > aServices( 1 );
101 aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
102 return aServices;
105 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
106 APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem,
107 C2U( "com.sun.star.comp.chart.PolarCoordinateSystem" ))
110 // =================================
111 // ==== PolarCoordinateSystem2d ====
112 // =================================
114 PolarCoordinateSystem2d::PolarCoordinateSystem2d(
115 const uno::Reference< uno::XComponentContext > & xContext ) :
116 PolarCoordinateSystem( xContext, 2, sal_False )
119 PolarCoordinateSystem2d::~PolarCoordinateSystem2d()
122 // ____ XServiceInfo ____
123 Sequence< OUString > PolarCoordinateSystem2d::getSupportedServiceNames_Static()
125 Sequence< OUString > aServices( 2 );
126 aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
127 aServices[ 1 ] = lcl_aServiceNamePolar2d;
128 return aServices;
131 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
132 APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem2d, lcl_aImplementationNamePolar2d )
134 // =================================
135 // ==== PolarCoordinateSystem3d ====
136 // =================================
138 PolarCoordinateSystem3d::PolarCoordinateSystem3d(
139 const uno::Reference< uno::XComponentContext > & xContext ) :
140 PolarCoordinateSystem( xContext, 3, sal_False )
143 PolarCoordinateSystem3d::~PolarCoordinateSystem3d()
146 // ____ XServiceInfo ____
147 Sequence< OUString > PolarCoordinateSystem3d::getSupportedServiceNames_Static()
149 Sequence< OUString > aServices( 2 );
150 aServices[ 0 ] = CHART2_COOSYSTEM_POLAR_SERVICE_NAME;
151 aServices[ 1 ] = lcl_aServiceNamePolar3d;
152 return aServices;
155 // implement XServiceInfo methods basing upon getSupportedServiceNames_Static
156 APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem3d, lcl_aImplementationNamePolar3d )
158 } // namespace chart