Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : : #include "Function.hxx"
20 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
21 : : #include "corestrings.hrc"
22 : : #include <tools/debug.hxx>
23 : : #include <connectivity/dbtools.hxx>
24 : : #include <comphelper/sequence.hxx>
25 : : #include <comphelper/property.hxx>
26 : : #include "Tools.hxx"
27 : : #include "corestrings.hrc"
28 : : // =============================================================================
29 : : namespace reportdesign
30 : : {
31 : : // =============================================================================
32 : : using namespace com::sun::star;
33 : : using namespace comphelper;
34 : : //------------------------------------------------------------------------------
35 : 0 : uno::Reference< uno::XInterface > OFunction::create(uno::Reference< uno::XComponentContext > const & xContext)
36 : : {
37 [ # # ]: 0 : return *(new OFunction(xContext));
38 : : }
39 : :
40 : : DBG_NAME( rpt_OFunction )
41 : : // -----------------------------------------------------------------------------
42 : 0 : OFunction::OFunction(uno::Reference< uno::XComponentContext > const & _xContext)
43 : : :FunctionBase(m_aMutex)
44 : : ,FunctionPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
45 : : ,m_xContext(_xContext)
46 : : ,m_bPreEvaluated(sal_False)
47 [ # # ][ # # ]: 0 : ,m_bDeepTraversing(sal_False)
[ # # ][ # # ]
48 : : {
49 : 0 : m_sInitialFormula.IsPresent = sal_False;
50 : : DBG_CTOR( rpt_OFunction,NULL);
51 : 0 : }
52 : : // -----------------------------------------------------------------------------
53 [ # # ][ # # ]: 0 : OFunction::~OFunction()
[ # # ]
54 : : {
55 : : DBG_DTOR( rpt_OFunction,NULL);
56 [ # # ]: 0 : }
57 : : // -----------------------------------------------------------------------------
58 [ # # ][ # # ]: 0 : IMPLEMENT_FORWARD_XINTERFACE2(OFunction,FunctionBase,FunctionPropertySet)
59 : : // -----------------------------------------------------------------------------
60 : 0 : void SAL_CALL OFunction::dispose() throw(uno::RuntimeException)
61 : : {
62 : 0 : FunctionPropertySet::dispose();
63 : 0 : cppu::WeakComponentImplHelperBase::dispose();
64 : 0 : }
65 : : // -----------------------------------------------------------------------------
66 : 0 : ::rtl::OUString OFunction::getImplementationName_Static( ) throw(uno::RuntimeException)
67 : : {
68 : 0 : return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFunction"));
69 : : }
70 : :
71 : : //--------------------------------------------------------------------------
72 : 0 : ::rtl::OUString SAL_CALL OFunction::getImplementationName( ) throw(uno::RuntimeException)
73 : : {
74 : 0 : return getImplementationName_Static();
75 : : }
76 : : //--------------------------------------------------------------------------
77 : 0 : uno::Sequence< ::rtl::OUString > OFunction::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
78 : : {
79 : 0 : uno::Sequence< ::rtl::OUString > aServices(1);
80 [ # # ][ # # ]: 0 : aServices.getArray()[0] = SERVICE_FUNCTION;
81 : :
82 : 0 : return aServices;
83 : : }
84 : : //--------------------------------------------------------------------------
85 : 0 : uno::Sequence< ::rtl::OUString > SAL_CALL OFunction::getSupportedServiceNames( ) throw(uno::RuntimeException)
86 : : {
87 : 0 : return getSupportedServiceNames_Static();
88 : : }
89 : : //------------------------------------------------------------------------------
90 : 0 : sal_Bool SAL_CALL OFunction::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
91 : : {
92 [ # # ]: 0 : return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
93 : : }
94 : : // -----------------------------------------------------------------------------
95 : 0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OFunction::getPropertySetInfo( ) throw(uno::RuntimeException)
96 : : {
97 : 0 : return FunctionPropertySet::getPropertySetInfo();
98 : : }
99 : : // -----------------------------------------------------------------------------
100 : 0 : void SAL_CALL OFunction::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
101 : : {
102 : 0 : FunctionPropertySet::setPropertyValue( aPropertyName, aValue );
103 : 0 : }
104 : : // -----------------------------------------------------------------------------
105 : 0 : uno::Any SAL_CALL OFunction::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
106 : : {
107 : 0 : return FunctionPropertySet::getPropertyValue( PropertyName);
108 : : }
109 : : // -----------------------------------------------------------------------------
110 : 0 : void SAL_CALL OFunction::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
111 : : {
112 : 0 : FunctionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
113 : 0 : }
114 : : // -----------------------------------------------------------------------------
115 : 0 : void SAL_CALL OFunction::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
116 : : {
117 : 0 : FunctionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
118 : 0 : }
119 : : // -----------------------------------------------------------------------------
120 : 0 : void SAL_CALL OFunction::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
121 : : {
122 : 0 : FunctionPropertySet::addVetoableChangeListener( PropertyName, aListener );
123 : 0 : }
124 : : // -----------------------------------------------------------------------------
125 : 0 : void SAL_CALL OFunction::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
126 : : {
127 : 0 : FunctionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
128 : 0 : }
129 : : // -----------------------------------------------------------------------------
130 : : // report::XFunction:
131 : 0 : ::sal_Bool SAL_CALL OFunction::getPreEvaluated() throw (uno::RuntimeException)
132 : : {
133 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
134 [ # # ]: 0 : return m_bPreEvaluated;
135 : : }
136 : : // -----------------------------------------------------------------------------
137 : :
138 : 0 : void SAL_CALL OFunction::setPreEvaluated(::sal_Bool the_value) throw (uno::RuntimeException)
139 : : {
140 [ # # ]: 0 : set(PROPERTY_PREEVALUATED,the_value,m_bPreEvaluated);
141 : 0 : }
142 : : // -----------------------------------------------------------------------------
143 : 0 : ::sal_Bool SAL_CALL OFunction::getDeepTraversing() throw (uno::RuntimeException)
144 : : {
145 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
146 [ # # ]: 0 : return m_bDeepTraversing;
147 : : }
148 : : // -----------------------------------------------------------------------------
149 : :
150 : 0 : void SAL_CALL OFunction::setDeepTraversing(::sal_Bool the_value) throw (uno::RuntimeException)
151 : : {
152 [ # # ]: 0 : set(PROPERTY_DEEPTRAVERSING,the_value,m_bDeepTraversing);
153 : 0 : }
154 : : // -----------------------------------------------------------------------------
155 : :
156 : 0 : ::rtl::OUString SAL_CALL OFunction::getName() throw (uno::RuntimeException)
157 : : {
158 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
159 [ # # ]: 0 : return m_sName;
160 : : }
161 : : // -----------------------------------------------------------------------------
162 : :
163 : 0 : void SAL_CALL OFunction::setName(const ::rtl::OUString & the_value) throw (uno::RuntimeException)
164 : : {
165 [ # # ]: 0 : set(PROPERTY_NAME,the_value,m_sName);
166 : 0 : }
167 : : // -----------------------------------------------------------------------------
168 : 0 : ::rtl::OUString SAL_CALL OFunction::getFormula() throw (uno::RuntimeException)
169 : : {
170 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
171 [ # # ]: 0 : return m_sFormula;
172 : : }
173 : : // -----------------------------------------------------------------------------
174 : 0 : void SAL_CALL OFunction::setFormula(const ::rtl::OUString & the_value) throw (uno::RuntimeException)
175 : : {
176 [ # # ]: 0 : set(PROPERTY_FORMULA,the_value,m_sFormula);
177 : 0 : }
178 : : // -----------------------------------------------------------------------------
179 : 0 : beans::Optional< ::rtl::OUString> SAL_CALL OFunction::getInitialFormula() throw (uno::RuntimeException)
180 : : {
181 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
182 [ # # ]: 0 : return m_sInitialFormula;
183 : : }
184 : : // -----------------------------------------------------------------------------
185 : 0 : void SAL_CALL OFunction::setInitialFormula(const beans::Optional< ::rtl::OUString> & the_value) throw (uno::RuntimeException)
186 : : {
187 [ # # ]: 0 : set(PROPERTY_INITIALFORMULA,the_value,m_sInitialFormula);
188 : 0 : }
189 : : // -----------------------------------------------------------------------------
190 : : // XChild
191 : 0 : uno::Reference< uno::XInterface > SAL_CALL OFunction::getParent( ) throw (uno::RuntimeException)
192 : : {
193 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
194 [ # # ][ # # ]: 0 : return m_xParent;
195 : : }
196 : : // -----------------------------------------------------------------------------
197 : 0 : void SAL_CALL OFunction::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
198 : : {
199 [ # # ]: 0 : osl::MutexGuard g(m_aMutex);
200 [ # # ]: 0 : if ( Parent.is() )
201 : : {
202 [ # # ]: 0 : uno::Reference< report::XFunctions> xFunctions(Parent,uno::UNO_QUERY_THROW);
203 [ # # ]: 0 : m_xParent = xFunctions;
204 : : }
205 : : else
206 [ # # ][ # # ]: 0 : m_xParent = uno::WeakReference< report::XFunctions >();
[ # # ][ # # ]
207 : 0 : }
208 : : // -----------------------------------------------------------------------------
209 : :
210 : : // =============================================================================
211 : : } // namespace reportdesign
212 : : // =============================================================================
213 : :
214 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|