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