xref: /aoo41x/main/sc/source/ui/unoobj/miscuno.cxx (revision b3f79822)
1*b3f79822SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b3f79822SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b3f79822SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b3f79822SAndrew Rist  * distributed with this work for additional information
6*b3f79822SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b3f79822SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b3f79822SAndrew Rist  * "License"); you may not use this file except in compliance
9*b3f79822SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*b3f79822SAndrew Rist  *
11*b3f79822SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*b3f79822SAndrew Rist  *
13*b3f79822SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b3f79822SAndrew Rist  * software distributed under the License is distributed on an
15*b3f79822SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b3f79822SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b3f79822SAndrew Rist  * specific language governing permissions and limitations
18*b3f79822SAndrew Rist  * under the License.
19*b3f79822SAndrew Rist  *
20*b3f79822SAndrew Rist  *************************************************************/
21*b3f79822SAndrew Rist 
22*b3f79822SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sc.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <tools/debug.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "miscuno.hxx"
32cdf0e10cSrcweir #include "unoguard.hxx"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir using namespace com::sun::star;
35cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
36cdf0e10cSrcweir using ::com::sun::star::uno::Any;
37cdf0e10cSrcweir using ::rtl::OUString;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir //------------------------------------------------------------------------
40cdf0e10cSrcweir 
41cdf0e10cSrcweir //UNUSED2008-05  SC_SIMPLE_SERVICE_INFO( ScEmptyEnumeration, "ScEmptyEnumeration", "stardiv.unknown" )
42cdf0e10cSrcweir //UNUSED2008-05  SC_SIMPLE_SERVICE_INFO( ScEmptyEnumerationAccess, "ScEmptyEnumerationAccess", "stardiv.unknown" )
43cdf0e10cSrcweir //UNUSED2008-05  SC_SIMPLE_SERVICE_INFO( ScIndexEnumeration, "ScIndexEnumeration", "stardiv.unknown" )
44cdf0e10cSrcweir //UNUSED2008-05  SC_SIMPLE_SERVICE_INFO( ScPrintSettingsObj, "ScPrintSettingsObj", "stardiv.unknown" )
45cdf0e10cSrcweir 
46cdf0e10cSrcweir SC_SIMPLE_SERVICE_INFO( ScNameToIndexAccess, "ScNameToIndexAccess", "stardiv.unknown" )
47cdf0e10cSrcweir 
48cdf0e10cSrcweir //------------------------------------------------------------------------
49cdf0e10cSrcweir 
50cdf0e10cSrcweir //	static
AnyToInterface(const uno::Any & rAny)51cdf0e10cSrcweir uno::Reference<uno::XInterface> ScUnoHelpFunctions::AnyToInterface( const uno::Any& rAny )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir 	if ( rAny.getValueTypeClass() == uno::TypeClass_INTERFACE )
54cdf0e10cSrcweir 	{
55cdf0e10cSrcweir 		return uno::Reference<uno::XInterface>(rAny, uno::UNO_QUERY);
56cdf0e10cSrcweir 	}
57cdf0e10cSrcweir 	return uno::Reference<uno::XInterface>();	//! Exception?
58cdf0e10cSrcweir }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir //	static
GetBoolProperty(const uno::Reference<beans::XPropertySet> & xProp,const rtl::OUString & rName,sal_Bool bDefault)61cdf0e10cSrcweir sal_Bool ScUnoHelpFunctions::GetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp,
62cdf0e10cSrcweir 											const rtl::OUString& rName, sal_Bool bDefault )
63cdf0e10cSrcweir {
64cdf0e10cSrcweir 	sal_Bool bRet = bDefault;
65cdf0e10cSrcweir 	if ( xProp.is() )
66cdf0e10cSrcweir 	{
67cdf0e10cSrcweir 		try
68cdf0e10cSrcweir 		{
69cdf0e10cSrcweir 			uno::Any aAny(xProp->getPropertyValue( rName ));
70cdf0e10cSrcweir 			//!	type conversion???
71cdf0e10cSrcweir 			//	operator >>= shouldn't be used for bool (?)
72cdf0e10cSrcweir 			if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN )
73cdf0e10cSrcweir 			{
74cdf0e10cSrcweir 				//!	safe way to get bool value from any???
75cdf0e10cSrcweir 				bRet = *(sal_Bool*)aAny.getValue();
76cdf0e10cSrcweir 			}
77cdf0e10cSrcweir 		}
78cdf0e10cSrcweir 		catch(uno::Exception&)
79cdf0e10cSrcweir 		{
80cdf0e10cSrcweir 			// keep default
81cdf0e10cSrcweir 		}
82cdf0e10cSrcweir 	}
83cdf0e10cSrcweir 	return bRet;
84cdf0e10cSrcweir }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir //	static
GetLongProperty(const uno::Reference<beans::XPropertySet> & xProp,const rtl::OUString & rName,long nDefault)87cdf0e10cSrcweir sal_Int32 ScUnoHelpFunctions::GetLongProperty( const uno::Reference<beans::XPropertySet>& xProp,
88cdf0e10cSrcweir 											const rtl::OUString& rName, long nDefault )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir 	sal_Int32 nRet = nDefault;
91cdf0e10cSrcweir 	if ( xProp.is() )
92cdf0e10cSrcweir 	{
93cdf0e10cSrcweir 		try
94cdf0e10cSrcweir 		{
95cdf0e10cSrcweir 			//!	type conversion???
96cdf0e10cSrcweir 			xProp->getPropertyValue( rName ) >>= nRet;
97cdf0e10cSrcweir 		}
98cdf0e10cSrcweir 		catch(uno::Exception&)
99cdf0e10cSrcweir 		{
100cdf0e10cSrcweir 			// keep default
101cdf0e10cSrcweir 		}
102cdf0e10cSrcweir 	}
103cdf0e10cSrcweir 	return nRet;
104cdf0e10cSrcweir }
105cdf0e10cSrcweir 
106cdf0e10cSrcweir //	static
GetEnumProperty(const uno::Reference<beans::XPropertySet> & xProp,const rtl::OUString & rName,long nDefault)107cdf0e10cSrcweir sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference<beans::XPropertySet>& xProp,
108cdf0e10cSrcweir 											const rtl::OUString& rName, long nDefault )
109cdf0e10cSrcweir {
110cdf0e10cSrcweir 	sal_Int32 nRet = nDefault;
111cdf0e10cSrcweir 	if ( xProp.is() )
112cdf0e10cSrcweir 	{
113cdf0e10cSrcweir 		try
114cdf0e10cSrcweir 		{
115cdf0e10cSrcweir 			uno::Any aAny(xProp->getPropertyValue( rName ));
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 			if ( aAny.getValueTypeClass() == uno::TypeClass_ENUM )
118cdf0e10cSrcweir 			{
119cdf0e10cSrcweir 				//!	get enum value from any???
120cdf0e10cSrcweir 				nRet = *(sal_Int32*)aAny.getValue();
121cdf0e10cSrcweir 			}
122cdf0e10cSrcweir 			else
123cdf0e10cSrcweir 			{
124cdf0e10cSrcweir 				//!	type conversion???
125cdf0e10cSrcweir 				aAny >>= nRet;
126cdf0e10cSrcweir 			}
127cdf0e10cSrcweir 		}
128cdf0e10cSrcweir 		catch(uno::Exception&)
129cdf0e10cSrcweir 		{
130cdf0e10cSrcweir 			// keep default
131cdf0e10cSrcweir 		}
132cdf0e10cSrcweir 	}
133cdf0e10cSrcweir 	return nRet;
134cdf0e10cSrcweir }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir // static
GetStringProperty(const Reference<beans::XPropertySet> & xProp,const OUString & rName,const OUString & rDefault)137cdf0e10cSrcweir OUString ScUnoHelpFunctions::GetStringProperty(
138cdf0e10cSrcweir     const Reference<beans::XPropertySet>& xProp, const OUString& rName, const OUString& rDefault )
139cdf0e10cSrcweir {
140cdf0e10cSrcweir     OUString aRet = rDefault;
141cdf0e10cSrcweir     if (!xProp.is())
142cdf0e10cSrcweir         return aRet;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     try
145cdf0e10cSrcweir     {
146cdf0e10cSrcweir         Any any = xProp->getPropertyValue(rName);
147cdf0e10cSrcweir         any >>= aRet;
148cdf0e10cSrcweir     }
149cdf0e10cSrcweir     catch (const uno::Exception&)
150cdf0e10cSrcweir     {
151cdf0e10cSrcweir     }
152cdf0e10cSrcweir 
153cdf0e10cSrcweir     return aRet;
154cdf0e10cSrcweir }
155cdf0e10cSrcweir 
156cdf0e10cSrcweir //	static
GetBoolFromAny(const uno::Any & aAny)157cdf0e10cSrcweir sal_Bool ScUnoHelpFunctions::GetBoolFromAny( const uno::Any& aAny )
158cdf0e10cSrcweir {
159cdf0e10cSrcweir 	if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN )
160cdf0e10cSrcweir 		return *(sal_Bool*)aAny.getValue();
161cdf0e10cSrcweir 	return sal_False;
162cdf0e10cSrcweir }
163cdf0e10cSrcweir 
164cdf0e10cSrcweir //	static
GetInt16FromAny(const uno::Any & aAny)165cdf0e10cSrcweir sal_Int16 ScUnoHelpFunctions::GetInt16FromAny( const uno::Any& aAny )
166cdf0e10cSrcweir {
167cdf0e10cSrcweir 	sal_Int16 nRet = 0;
168cdf0e10cSrcweir 	if ( aAny >>= nRet )
169cdf0e10cSrcweir 		return nRet;
170cdf0e10cSrcweir 	return 0;
171cdf0e10cSrcweir }
172cdf0e10cSrcweir 
173cdf0e10cSrcweir //	static
GetInt32FromAny(const uno::Any & aAny)174cdf0e10cSrcweir sal_Int32 ScUnoHelpFunctions::GetInt32FromAny( const uno::Any& aAny )
175cdf0e10cSrcweir {
176cdf0e10cSrcweir 	sal_Int32 nRet = 0;
177cdf0e10cSrcweir 	if ( aAny >>= nRet )
178cdf0e10cSrcweir 		return nRet;
179cdf0e10cSrcweir 	return 0;
180cdf0e10cSrcweir }
181cdf0e10cSrcweir 
182cdf0e10cSrcweir //	static
GetEnumFromAny(const uno::Any & aAny)183cdf0e10cSrcweir sal_Int32 ScUnoHelpFunctions::GetEnumFromAny( const uno::Any& aAny )
184cdf0e10cSrcweir {
185cdf0e10cSrcweir 	sal_Int32 nRet = 0;
186cdf0e10cSrcweir 	if ( aAny.getValueTypeClass() == uno::TypeClass_ENUM )
187cdf0e10cSrcweir 		nRet = *(sal_Int32*)aAny.getValue();
188cdf0e10cSrcweir 	else
189cdf0e10cSrcweir 		aAny >>= nRet;
190cdf0e10cSrcweir 	return nRet;
191cdf0e10cSrcweir }
192cdf0e10cSrcweir 
193cdf0e10cSrcweir //	static
SetBoolInAny(uno::Any & rAny,sal_Bool bValue)194cdf0e10cSrcweir void ScUnoHelpFunctions::SetBoolInAny( uno::Any& rAny, sal_Bool bValue )
195cdf0e10cSrcweir {
196cdf0e10cSrcweir 	rAny.setValue( &bValue, getBooleanCppuType() );
197cdf0e10cSrcweir }
198cdf0e10cSrcweir 
199cdf0e10cSrcweir //  static
SetOptionalPropertyValue(Reference<beans::XPropertySet> & rPropSet,const sal_Char * pPropName,const Any & rVal)200cdf0e10cSrcweir void ScUnoHelpFunctions::SetOptionalPropertyValue(
201cdf0e10cSrcweir     Reference<beans::XPropertySet>& rPropSet, const sal_Char* pPropName, const Any& rVal )
202cdf0e10cSrcweir {
203cdf0e10cSrcweir     try
204cdf0e10cSrcweir     {
205cdf0e10cSrcweir         rPropSet->setPropertyValue(OUString::createFromAscii(pPropName), rVal);
206cdf0e10cSrcweir     }
207cdf0e10cSrcweir     catch (const beans::UnknownPropertyException&)
208cdf0e10cSrcweir     {
209cdf0e10cSrcweir         // ignored - not supported.
210cdf0e10cSrcweir     }
211cdf0e10cSrcweir }
212cdf0e10cSrcweir 
213cdf0e10cSrcweir //------------------------------------------------------------------------
214cdf0e10cSrcweir 
ScIndexEnumeration(const uno::Reference<container::XIndexAccess> & rInd,const rtl::OUString & rServiceName)215cdf0e10cSrcweir ScIndexEnumeration::ScIndexEnumeration(const uno::Reference<container::XIndexAccess>& rInd,
216cdf0e10cSrcweir                                        const rtl::OUString& rServiceName) :
217cdf0e10cSrcweir 	xIndex( rInd ),
218cdf0e10cSrcweir     sServiceName(rServiceName),
219cdf0e10cSrcweir 	nPos( 0 )
220cdf0e10cSrcweir {
221cdf0e10cSrcweir }
222cdf0e10cSrcweir 
~ScIndexEnumeration()223cdf0e10cSrcweir ScIndexEnumeration::~ScIndexEnumeration()
224cdf0e10cSrcweir {
225cdf0e10cSrcweir }
226cdf0e10cSrcweir 
227cdf0e10cSrcweir // XEnumeration
228cdf0e10cSrcweir 
hasMoreElements()229cdf0e10cSrcweir sal_Bool SAL_CALL ScIndexEnumeration::hasMoreElements() throw(uno::RuntimeException)
230cdf0e10cSrcweir {
231cdf0e10cSrcweir 	ScUnoGuard aGuard;
232cdf0e10cSrcweir 	return ( nPos < xIndex->getCount() );
233cdf0e10cSrcweir }
234cdf0e10cSrcweir 
nextElement()235cdf0e10cSrcweir uno::Any SAL_CALL ScIndexEnumeration::nextElement() throw(container::NoSuchElementException,
236cdf0e10cSrcweir 										lang::WrappedTargetException, uno::RuntimeException)
237cdf0e10cSrcweir {
238cdf0e10cSrcweir 	ScUnoGuard aGuard;
239cdf0e10cSrcweir     uno::Any aReturn;
240cdf0e10cSrcweir     try
241cdf0e10cSrcweir     {
242cdf0e10cSrcweir         aReturn = xIndex->getByIndex(nPos++);
243cdf0e10cSrcweir     }
244cdf0e10cSrcweir     catch (lang::IndexOutOfBoundsException&)
245cdf0e10cSrcweir     {
246cdf0e10cSrcweir         throw container::NoSuchElementException();
247cdf0e10cSrcweir     }
248cdf0e10cSrcweir 	return aReturn;
249cdf0e10cSrcweir }
250cdf0e10cSrcweir 
getImplementationName()251cdf0e10cSrcweir ::rtl::OUString SAL_CALL ScIndexEnumeration::getImplementationName()
252cdf0e10cSrcweir 	throw(::com::sun::star::uno::RuntimeException)
253cdf0e10cSrcweir {
254cdf0e10cSrcweir 	return ::rtl::OUString::createFromAscii("ScIndexEnumeration");
255cdf0e10cSrcweir }
256cdf0e10cSrcweir 
supportsService(const::rtl::OUString & ServiceName)257cdf0e10cSrcweir sal_Bool SAL_CALL ScIndexEnumeration::supportsService( const ::rtl::OUString& ServiceName )
258cdf0e10cSrcweir 	throw(::com::sun::star::uno::RuntimeException)
259cdf0e10cSrcweir {
260cdf0e10cSrcweir 	return sServiceName == ServiceName;
261cdf0e10cSrcweir }
262cdf0e10cSrcweir 
263cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::rtl::OUString >
getSupportedServiceNames(void)264cdf0e10cSrcweir 	SAL_CALL ScIndexEnumeration::getSupportedServiceNames(void)
265cdf0e10cSrcweir 	throw(::com::sun::star::uno::RuntimeException)
266cdf0e10cSrcweir {
267cdf0e10cSrcweir 	::com::sun::star::uno::Sequence< ::rtl::OUString > aRet(1);
268cdf0e10cSrcweir 	::rtl::OUString* pArray = aRet.getArray();
269cdf0e10cSrcweir 	pArray[0] = sServiceName;
270cdf0e10cSrcweir 	return aRet;
271cdf0e10cSrcweir }
272cdf0e10cSrcweir 
273cdf0e10cSrcweir //------------------------------------------------------------------------
274cdf0e10cSrcweir 
275cdf0e10cSrcweir //UNUSED2008-05  ScEmptyEnumerationAccess::ScEmptyEnumerationAccess()
276cdf0e10cSrcweir //UNUSED2008-05  {
277cdf0e10cSrcweir //UNUSED2008-05  }
278cdf0e10cSrcweir //UNUSED2008-05
279cdf0e10cSrcweir //UNUSED2008-05  ScEmptyEnumerationAccess::~ScEmptyEnumerationAccess()
280cdf0e10cSrcweir //UNUSED2008-05  {
281cdf0e10cSrcweir //UNUSED2008-05  }
282cdf0e10cSrcweir //UNUSED2008-05
283cdf0e10cSrcweir //UNUSED2008-05  // XEnumerationAccess
284cdf0e10cSrcweir //UNUSED2008-05
285cdf0e10cSrcweir //UNUSED2008-05  uno::Reference<container::XEnumeration> SAL_CALL ScEmptyEnumerationAccess::createEnumeration()
286cdf0e10cSrcweir //UNUSED2008-05                                                      throw(uno::RuntimeException)
287cdf0e10cSrcweir //UNUSED2008-05  {
288cdf0e10cSrcweir //UNUSED2008-05      ScUnoGuard aGuard;
289cdf0e10cSrcweir //UNUSED2008-05      return new ScEmptyEnumeration;
290cdf0e10cSrcweir //UNUSED2008-05  }
291cdf0e10cSrcweir //UNUSED2008-05
292cdf0e10cSrcweir //UNUSED2008-05  uno::Type SAL_CALL ScEmptyEnumerationAccess::getElementType() throw(uno::RuntimeException)
293cdf0e10cSrcweir //UNUSED2008-05  {
294cdf0e10cSrcweir //UNUSED2008-05      ScUnoGuard aGuard;
295cdf0e10cSrcweir //UNUSED2008-05      return getCppuType((uno::Reference<uno::XInterface>*)0);    // or what?
296cdf0e10cSrcweir //UNUSED2008-05  }
297cdf0e10cSrcweir //UNUSED2008-05
298cdf0e10cSrcweir //UNUSED2008-05  sal_Bool SAL_CALL ScEmptyEnumerationAccess::hasElements() throw(uno::RuntimeException)
299cdf0e10cSrcweir //UNUSED2008-05  {
300cdf0e10cSrcweir //UNUSED2008-05      return sal_False;
301cdf0e10cSrcweir //UNUSED2008-05  }
302cdf0e10cSrcweir 
303cdf0e10cSrcweir //------------------------------------------------------------------------
304cdf0e10cSrcweir 
305cdf0e10cSrcweir //UNUSED2008-05  ScEmptyEnumeration::ScEmptyEnumeration()
306cdf0e10cSrcweir //UNUSED2008-05  {
307cdf0e10cSrcweir //UNUSED2008-05  }
308cdf0e10cSrcweir //UNUSED2008-05
309cdf0e10cSrcweir //UNUSED2008-05  ScEmptyEnumeration::~ScEmptyEnumeration()
310cdf0e10cSrcweir //UNUSED2008-05  {
311cdf0e10cSrcweir //UNUSED2008-05  }
312cdf0e10cSrcweir //UNUSED2008-05
313cdf0e10cSrcweir //UNUSED2008-05  // XEnumeration
314cdf0e10cSrcweir //UNUSED2008-05
315cdf0e10cSrcweir //UNUSED2008-05  sal_Bool SAL_CALL ScEmptyEnumeration::hasMoreElements() throw(uno::RuntimeException)
316cdf0e10cSrcweir //UNUSED2008-05  {
317cdf0e10cSrcweir //UNUSED2008-05      ScUnoGuard aGuard;
318cdf0e10cSrcweir //UNUSED2008-05      return sal_False;
319cdf0e10cSrcweir //UNUSED2008-05  }
320cdf0e10cSrcweir //UNUSED2008-05
321cdf0e10cSrcweir //UNUSED2008-05  uno::Any SAL_CALL ScEmptyEnumeration::nextElement() throw(container::NoSuchElementException,
322cdf0e10cSrcweir //UNUSED2008-05                                          lang::WrappedTargetException, uno::RuntimeException)
323cdf0e10cSrcweir //UNUSED2008-05  {
324cdf0e10cSrcweir //UNUSED2008-05      ScUnoGuard aGuard;
325cdf0e10cSrcweir //UNUSED2008-05      return uno::Any();
326cdf0e10cSrcweir //UNUSED2008-05  }
327cdf0e10cSrcweir 
328cdf0e10cSrcweir //------------------------------------------------------------------------
329cdf0e10cSrcweir 
ScNameToIndexAccess(const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess> & rNameObj)330cdf0e10cSrcweir ScNameToIndexAccess::ScNameToIndexAccess( const com::sun::star::uno::Reference<
331cdf0e10cSrcweir 											com::sun::star::container::XNameAccess>& rNameObj ) :
332cdf0e10cSrcweir 	xNameAccess( rNameObj )
333cdf0e10cSrcweir {
334cdf0e10cSrcweir 	//!	test for XIndexAccess interface at rNameObj, use that instead!
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 	if ( xNameAccess.is() )
337cdf0e10cSrcweir 		aNames = xNameAccess->getElementNames();
338cdf0e10cSrcweir }
339cdf0e10cSrcweir 
~ScNameToIndexAccess()340cdf0e10cSrcweir ScNameToIndexAccess::~ScNameToIndexAccess()
341cdf0e10cSrcweir {
342cdf0e10cSrcweir }
343cdf0e10cSrcweir 
344cdf0e10cSrcweir // XIndexAccess
345cdf0e10cSrcweir 
getCount()346cdf0e10cSrcweir sal_Int32 SAL_CALL ScNameToIndexAccess::getCount(  ) throw(::com::sun::star::uno::RuntimeException)
347cdf0e10cSrcweir {
348cdf0e10cSrcweir 	return aNames.getLength();
349cdf0e10cSrcweir }
350cdf0e10cSrcweir 
getByIndex(sal_Int32 nIndex)351cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL ScNameToIndexAccess::getByIndex( sal_Int32 nIndex )
352cdf0e10cSrcweir 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
353cdf0e10cSrcweir 										::com::sun::star::lang::WrappedTargetException,
354cdf0e10cSrcweir 										::com::sun::star::uno::RuntimeException)
355cdf0e10cSrcweir {
356cdf0e10cSrcweir 	if ( xNameAccess.is() && nIndex >= 0 && nIndex < aNames.getLength() )
357cdf0e10cSrcweir 		return xNameAccess->getByName( aNames.getConstArray()[nIndex] );
358cdf0e10cSrcweir 
359cdf0e10cSrcweir 	throw lang::IndexOutOfBoundsException();
360cdf0e10cSrcweir //    return uno::Any();
361cdf0e10cSrcweir }
362cdf0e10cSrcweir 
363cdf0e10cSrcweir // XElementAccess
364cdf0e10cSrcweir 
getElementType()365cdf0e10cSrcweir ::com::sun::star::uno::Type SAL_CALL ScNameToIndexAccess::getElementType(  )
366cdf0e10cSrcweir 								throw(::com::sun::star::uno::RuntimeException)
367cdf0e10cSrcweir {
368cdf0e10cSrcweir 	if ( xNameAccess.is() )
369cdf0e10cSrcweir 		return xNameAccess->getElementType();
370cdf0e10cSrcweir 	else
371cdf0e10cSrcweir 		return uno::Type();
372cdf0e10cSrcweir }
373cdf0e10cSrcweir 
hasElements()374cdf0e10cSrcweir sal_Bool SAL_CALL ScNameToIndexAccess::hasElements(  ) throw(::com::sun::star::uno::RuntimeException)
375cdf0e10cSrcweir {
376cdf0e10cSrcweir 	return getCount() > 0;
377cdf0e10cSrcweir }
378cdf0e10cSrcweir 
379cdf0e10cSrcweir //------------------------------------------------------------------------
380cdf0e10cSrcweir 
381cdf0e10cSrcweir //UNUSED2008-05  ScPrintSettingsObj::ScPrintSettingsObj()
382cdf0e10cSrcweir //UNUSED2008-05  {
383cdf0e10cSrcweir //UNUSED2008-05  }
384cdf0e10cSrcweir //UNUSED2008-05
385cdf0e10cSrcweir //UNUSED2008-05  ScPrintSettingsObj::~ScPrintSettingsObj()
386cdf0e10cSrcweir //UNUSED2008-05  {
387cdf0e10cSrcweir //UNUSED2008-05  }
388cdf0e10cSrcweir //UNUSED2008-05
389cdf0e10cSrcweir //UNUSED2008-05  // XPropertySet
390cdf0e10cSrcweir //UNUSED2008-05
391cdf0e10cSrcweir //UNUSED2008-05  uno::Reference<beans::XPropertySetInfo> SAL_CALL ScPrintSettingsObj::getPropertySetInfo()
392cdf0e10cSrcweir //UNUSED2008-05                                                          throw(uno::RuntimeException)
393cdf0e10cSrcweir //UNUSED2008-05  {
394cdf0e10cSrcweir //UNUSED2008-05      return NULL;
395cdf0e10cSrcweir //UNUSED2008-05  }
396cdf0e10cSrcweir //UNUSED2008-05
397cdf0e10cSrcweir //UNUSED2008-05  void SAL_CALL ScPrintSettingsObj::setPropertyValue(
398cdf0e10cSrcweir //UNUSED2008-05                          const rtl::OUString& /* aPropertyName */, const uno::Any& /* aValue */ )
399cdf0e10cSrcweir //UNUSED2008-05                  throw(beans::UnknownPropertyException, beans::PropertyVetoException,
400cdf0e10cSrcweir //UNUSED2008-05                          lang::IllegalArgumentException, lang::WrappedTargetException,
401cdf0e10cSrcweir //UNUSED2008-05                          uno::RuntimeException)
402cdf0e10cSrcweir //UNUSED2008-05  {
403cdf0e10cSrcweir //UNUSED2008-05      //! later...
404cdf0e10cSrcweir //UNUSED2008-05  }
405cdf0e10cSrcweir //UNUSED2008-05
406cdf0e10cSrcweir //UNUSED2008-05  uno::Any SAL_CALL ScPrintSettingsObj::getPropertyValue( const rtl::OUString& /* aPropertyName */ )
407cdf0e10cSrcweir //UNUSED2008-05                  throw(beans::UnknownPropertyException, lang::WrappedTargetException,
408cdf0e10cSrcweir //UNUSED2008-05                          uno::RuntimeException)
409cdf0e10cSrcweir //UNUSED2008-05  {
410cdf0e10cSrcweir //UNUSED2008-05      //! later...
411cdf0e10cSrcweir //UNUSED2008-05      return uno::Any();
412cdf0e10cSrcweir //UNUSED2008-05  }
413cdf0e10cSrcweir //UNUSED2008-05
414cdf0e10cSrcweir //UNUSED2008-05  SC_IMPL_DUMMY_PROPERTY_LISTENER( ScPrintSettingsObj )
415cdf0e10cSrcweir 
416cdf0e10cSrcweir 
417cdf0e10cSrcweir //------------------------------------------------------------------------
418cdf0e10cSrcweir 
419cdf0e10cSrcweir 
420cdf0e10cSrcweir 
421