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_scripting.hxx"
30*cdf0e10cSrcweir #include <cppuhelper/implementationentry.hxx>
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include <hash_map>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <osl/file.hxx>
35*cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
36*cdf0e10cSrcweir 
37*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyContainer.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir #include <drafts/com/sun/star/script/framework/storage/XScriptStorageManager.hpp>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir #include <util/util.hxx>
43*cdf0e10cSrcweir #include "ScriptInfo.hxx"
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir using namespace ::rtl;
46*cdf0e10cSrcweir using namespace com::sun::star;
47*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
48*cdf0e10cSrcweir using namespace ::drafts::com::sun::star::script::framework;
49*cdf0e10cSrcweir using namespace ::drafts::com::sun::star::script::framework::storage;
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir namespace scripting_impl
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir typedef ::std::hash_map < ::rtl::OUString, css::uno::Any, ::rtl::OUStringHash,
55*cdf0e10cSrcweir     ::std::equal_to< ::rtl::OUString > > PropertySet_hash;
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir class PropertySetImpl : public ::cppu::WeakImplHelper1< css::beans::XPropertySet >
58*cdf0e10cSrcweir {
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir public:
61*cdf0e10cSrcweir 
62*cdf0e10cSrcweir     PropertySetImpl();
63*cdf0e10cSrcweir     ~PropertySetImpl();
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir // XPropertySet implementation
66*cdf0e10cSrcweir     virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
67*cdf0e10cSrcweir         getPropertySetInfo()
68*cdf0e10cSrcweir         throw ( css::uno::RuntimeException );
69*cdf0e10cSrcweir     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
70*cdf0e10cSrcweir         const css::uno::Any& aValue )
71*cdf0e10cSrcweir         throw ( css::beans::UnknownPropertyException,
72*cdf0e10cSrcweir             css::beans::PropertyVetoException,
73*cdf0e10cSrcweir             css::lang::IllegalArgumentException,
74*cdf0e10cSrcweir             css::lang::WrappedTargetException,
75*cdf0e10cSrcweir             css::uno::RuntimeException );
76*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
77*cdf0e10cSrcweir         throw ( css::beans::UnknownPropertyException,
78*cdf0e10cSrcweir             css::lang::WrappedTargetException,
79*cdf0e10cSrcweir             css::uno::RuntimeException );
80*cdf0e10cSrcweir     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
81*cdf0e10cSrcweir         const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener )
82*cdf0e10cSrcweir         throw ( css::beans::UnknownPropertyException,
83*cdf0e10cSrcweir             css::lang::WrappedTargetException,
84*cdf0e10cSrcweir             css::uno::RuntimeException );
85*cdf0e10cSrcweir     virtual void SAL_CALL removePropertyChangeListener(
86*cdf0e10cSrcweir         const ::rtl::OUString& aPropertyName,
87*cdf0e10cSrcweir         const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener )
88*cdf0e10cSrcweir         throw ( css::beans::UnknownPropertyException,
89*cdf0e10cSrcweir             css::lang::WrappedTargetException,
90*cdf0e10cSrcweir             css::uno::RuntimeException );
91*cdf0e10cSrcweir     virtual void SAL_CALL addVetoableChangeListener(
92*cdf0e10cSrcweir         const ::rtl::OUString& PropertyName,
93*cdf0e10cSrcweir         const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener )
94*cdf0e10cSrcweir         throw ( css::beans::UnknownPropertyException,
95*cdf0e10cSrcweir             css::lang::WrappedTargetException,
96*cdf0e10cSrcweir             css::uno::RuntimeException );
97*cdf0e10cSrcweir     virtual void SAL_CALL removeVetoableChangeListener(
98*cdf0e10cSrcweir         const ::rtl::OUString& PropertyName,
99*cdf0e10cSrcweir         const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener )
100*cdf0e10cSrcweir         throw ( css::beans::UnknownPropertyException,
101*cdf0e10cSrcweir             css::lang::WrappedTargetException,
102*cdf0e10cSrcweir             css::uno::RuntimeException );
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir private:
105*cdf0e10cSrcweir     friend class ScriptInfo;
106*cdf0e10cSrcweir 
107*cdf0e10cSrcweir     css::uno::Reference< css::uno::XComponentContext > m_xContext;
108*cdf0e10cSrcweir     void PropertySetImpl::privateSetPropertyValue( const ::rtl::OUString& aPropertyName, const Any& aValue )
109*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, beans::PropertyVetoException,
110*cdf0e10cSrcweir             lang::IllegalArgumentException, lang::WrappedTargetException,
111*cdf0e10cSrcweir             RuntimeException );
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     osl::Mutex m_mutex;
114*cdf0e10cSrcweir     PropertySet_hash m_propertyMap;
115*cdf0e10cSrcweir };
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir PropertySetImpl::PropertySetImpl()
118*cdf0e10cSrcweir {
119*cdf0e10cSrcweir    OSL_TRACE( "<PropertySetImpl ctor called\n" );
120*cdf0e10cSrcweir }
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir PropertySetImpl::~PropertySetImpl()
123*cdf0e10cSrcweir {
124*cdf0e10cSrcweir     OSL_TRACE( "<PropertySetImpl dtor called\n>" );
125*cdf0e10cSrcweir }
126*cdf0e10cSrcweir 
127*cdf0e10cSrcweir Reference< beans::XPropertySetInfo > SAL_CALL PropertySetImpl::getPropertySetInfo( )
128*cdf0e10cSrcweir     throw ( RuntimeException )
129*cdf0e10cSrcweir {
130*cdf0e10cSrcweir     return Reference< beans::XPropertySetInfo > (); // Not supported
131*cdf0e10cSrcweir }
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir void SAL_CALL PropertySetImpl::setPropertyValue( const ::rtl::OUString& aPropertyName,
134*cdf0e10cSrcweir     const Any& aValue )
135*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, beans::PropertyVetoException,
136*cdf0e10cSrcweir             lang::IllegalArgumentException, lang::WrappedTargetException,
137*cdf0e10cSrcweir             RuntimeException )
138*cdf0e10cSrcweir {
139*cdf0e10cSrcweir     throw RuntimeException(
140*cdf0e10cSrcweir         OUSTR( "PropertySetImpl::setPropertyValue: method not supported. Read-only PropertySet" ),
141*cdf0e10cSrcweir         Reference< XInterface >() );
142*cdf0e10cSrcweir }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir void PropertySetImpl::privateSetPropertyValue( const ::rtl::OUString& aPropertyName,
145*cdf0e10cSrcweir     const Any& aValue )
146*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, beans::PropertyVetoException,
147*cdf0e10cSrcweir             lang::IllegalArgumentException, lang::WrappedTargetException,
148*cdf0e10cSrcweir             RuntimeException )
149*cdf0e10cSrcweir {
150*cdf0e10cSrcweir     ::osl::Guard< osl::Mutex > aGuard( m_mutex );
151*cdf0e10cSrcweir     m_propertyMap[ aPropertyName ] = aValue;
152*cdf0e10cSrcweir }
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir //*************************************************************************
155*cdf0e10cSrcweir Any SAL_CALL PropertySetImpl::getPropertyValue( const ::rtl::OUString& PropertyName )
156*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException,
157*cdf0e10cSrcweir             lang::WrappedTargetException, RuntimeException )
158*cdf0e10cSrcweir {
159*cdf0e10cSrcweir     if ( m_propertyMap.find( PropertyName ) == m_propertyMap.end() )
160*cdf0e10cSrcweir     {
161*cdf0e10cSrcweir         throw RuntimeException(
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir             OUSTR( "PropertySetImpl::getPropertyValue: invalid PropertyName ").concat(
164*cdf0e10cSrcweir                 PropertyName),
165*cdf0e10cSrcweir             Reference< XInterface >() );
166*cdf0e10cSrcweir     }
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir     ::osl::Guard< osl::Mutex > aGuard( m_mutex );
169*cdf0e10cSrcweir     Any returnValue = m_propertyMap[ PropertyName ];
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir     return returnValue;
172*cdf0e10cSrcweir }
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir //*************************************************************************
175*cdf0e10cSrcweir void SAL_CALL PropertySetImpl::addPropertyChangeListener(
176*cdf0e10cSrcweir     const ::rtl::OUString& aPropertyName,
177*cdf0e10cSrcweir     const Reference< beans::XPropertyChangeListener >& xListener )
178*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, lang::WrappedTargetException,
179*cdf0e10cSrcweir             RuntimeException )
180*cdf0e10cSrcweir {
181*cdf0e10cSrcweir     throw RuntimeException(
182*cdf0e10cSrcweir         OUSTR( "PropertySetImpl::addPropertyChangeListener: method not supported" ),
183*cdf0e10cSrcweir         Reference< XInterface >() );
184*cdf0e10cSrcweir }
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir //*************************************************************************
187*cdf0e10cSrcweir void SAL_CALL PropertySetImpl::removePropertyChangeListener(
188*cdf0e10cSrcweir     const ::rtl::OUString& aPropertyName,
189*cdf0e10cSrcweir     const Reference< beans::XPropertyChangeListener >& aListener )
190*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, lang::WrappedTargetException,
191*cdf0e10cSrcweir             RuntimeException )
192*cdf0e10cSrcweir {
193*cdf0e10cSrcweir     throw RuntimeException(
194*cdf0e10cSrcweir         OUSTR( "PropertySetImpl::removePropertyChangeListener: method not supported" ),
195*cdf0e10cSrcweir         Reference< XInterface >() );
196*cdf0e10cSrcweir }
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir //*************************************************************************
199*cdf0e10cSrcweir void SAL_CALL PropertySetImpl::addVetoableChangeListener(
200*cdf0e10cSrcweir     const ::rtl::OUString& PropertyName,
201*cdf0e10cSrcweir     const Reference< beans::XVetoableChangeListener >& aListener )
202*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, lang::WrappedTargetException,
203*cdf0e10cSrcweir             RuntimeException )
204*cdf0e10cSrcweir {
205*cdf0e10cSrcweir     throw RuntimeException(
206*cdf0e10cSrcweir         OUSTR( "PropertySetImpl::addVetoableChangeListener: method not supported" ),
207*cdf0e10cSrcweir         Reference< XInterface >() );
208*cdf0e10cSrcweir }
209*cdf0e10cSrcweir 
210*cdf0e10cSrcweir //*************************************************************************
211*cdf0e10cSrcweir void SAL_CALL PropertySetImpl::removeVetoableChangeListener(
212*cdf0e10cSrcweir     const ::rtl::OUString& PropertyName,
213*cdf0e10cSrcweir     const Reference< beans::XVetoableChangeListener >& aListener )
214*cdf0e10cSrcweir     throw ( beans::UnknownPropertyException, lang::WrappedTargetException,
215*cdf0e10cSrcweir             RuntimeException )
216*cdf0e10cSrcweir {
217*cdf0e10cSrcweir     throw RuntimeException(
218*cdf0e10cSrcweir         OUSTR( "PropertySetImpl::removeVetoableChangeListener: method not supported" ),
219*cdf0e10cSrcweir         Reference< XInterface >() );
220*cdf0e10cSrcweir }
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir //*************************************************************************
224*cdf0e10cSrcweir ScriptInfo::ScriptInfo( const ScriptData & scriptData, sal_Int32 storageID )
225*cdf0e10cSrcweir         : m_scriptData( scriptData ), m_storageID( storageID )
226*cdf0e10cSrcweir {
227*cdf0e10cSrcweir     OSL_TRACE( "< ++++++ ScriptInfo ctor called >\n" );
228*cdf0e10cSrcweir     OSL_TRACE( "< ++++++ parcelURI=%s>\n",::rtl::OUStringToOString(m_scriptData.parcelURI , RTL_TEXTENCODING_ASCII_US ).pData->buffer );
229*cdf0e10cSrcweir }
230*cdf0e10cSrcweir //*************************************************************************
231*cdf0e10cSrcweir ScriptInfo::~ScriptInfo()
232*cdf0e10cSrcweir {
233*cdf0e10cSrcweir     OSL_TRACE( "< ScriptInfo dtor called >\n" );
234*cdf0e10cSrcweir }
235*cdf0e10cSrcweir //*************************************************************************
236*cdf0e10cSrcweir OUString SAL_CALL ScriptInfo::getLogicalName(  ) throw ( RuntimeException )
237*cdf0e10cSrcweir {
238*cdf0e10cSrcweir     OSL_TRACE( "ScriptInfo::getLogicalName() " );
239*cdf0e10cSrcweir     return m_scriptData.logicalname;
240*cdf0e10cSrcweir }
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir //*************************************************************************
243*cdf0e10cSrcweir OUString SAL_CALL ScriptInfo::getDescription(  ) throw ( RuntimeException )
244*cdf0e10cSrcweir {
245*cdf0e10cSrcweir     OUString rs_desc;
246*cdf0e10cSrcweir     // TDB need to determine locale here, hardcoded at the moment
247*cdf0e10cSrcweir     // to english
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir     OUString localeLang = OUString::createFromAscii( "en" );
250*cdf0e10cSrcweir     strpair_map::const_iterator str_it =
251*cdf0e10cSrcweir         m_scriptData.locales.find( localeLang );
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir     if( str_it == m_scriptData.locales.end() )
254*cdf0e10cSrcweir     {
255*cdf0e10cSrcweir         OSL_TRACE( "No description set in meta-data" );
256*cdf0e10cSrcweir         return rs_desc;
257*cdf0e10cSrcweir     }
258*cdf0e10cSrcweir     rs_desc = str_it->second.second;
259*cdf0e10cSrcweir     return rs_desc;
260*cdf0e10cSrcweir }
261*cdf0e10cSrcweir 
262*cdf0e10cSrcweir //*************************************************************************
263*cdf0e10cSrcweir OUString SAL_CALL ScriptInfo::getLanguage(  ) throw ( RuntimeException )
264*cdf0e10cSrcweir {
265*cdf0e10cSrcweir     OSL_TRACE( "ScriptInfo::getLanguage() " );
266*cdf0e10cSrcweir     return m_scriptData.language;
267*cdf0e10cSrcweir }
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir //*************************************************************************
270*cdf0e10cSrcweir OUString SAL_CALL ScriptInfo::getFunctionName(  ) throw ( RuntimeException )
271*cdf0e10cSrcweir {
272*cdf0e10cSrcweir     OSL_TRACE( "ScriptInfo::getFunctionName() " );
273*cdf0e10cSrcweir     return m_scriptData.functionname;
274*cdf0e10cSrcweir }
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir //*************************************************************************
277*cdf0e10cSrcweir OUString SAL_CALL ScriptInfo::getParcelURI(  ) throw ( RuntimeException )
278*cdf0e10cSrcweir {
279*cdf0e10cSrcweir     return m_scriptData.parcelURI;
280*cdf0e10cSrcweir }
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir //*************************************************************************
283*cdf0e10cSrcweir Reference< beans::XPropertySet > SAL_CALL ScriptInfo::getLanguageProperties(  )
284*cdf0e10cSrcweir     throw ( RuntimeException )
285*cdf0e10cSrcweir {
286*cdf0e10cSrcweir     PropertySetImpl* propSetImpl = new PropertySetImpl();
287*cdf0e10cSrcweir     Reference< beans::XPropertySet > xPropSet = propSetImpl;
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir     props_vec::const_iterator pv_it = m_scriptData.languagedepprops.begin();
290*cdf0e10cSrcweir     props_vec::const_iterator pv_itend = m_scriptData.languagedepprops.end();
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir     for( ; pv_it != pv_itend; ++pv_it )
293*cdf0e10cSrcweir     {
294*cdf0e10cSrcweir         try
295*cdf0e10cSrcweir         {
296*cdf0e10cSrcweir             propSetImpl->privateSetPropertyValue( pv_it->first, makeAny( pv_it->second ) );
297*cdf0e10cSrcweir         }
298*cdf0e10cSrcweir         catch( Exception& e )
299*cdf0e10cSrcweir         {
300*cdf0e10cSrcweir             OUString msg = OUSTR(
301*cdf0e10cSrcweir                 "ScriptInfo::getLanguage caught exception while setting property," );
302*cdf0e10cSrcweir             msg = msg.concat( OUSTR( " PropertryName: " ) ).concat( pv_it->first );
303*cdf0e10cSrcweir             msg = msg.concat( OUSTR( " \nException message is: " ) );
304*cdf0e10cSrcweir             msg = msg.concat( e.Message );
305*cdf0e10cSrcweir             throw RuntimeException( msg , Reference< XInterface >() );
306*cdf0e10cSrcweir         }
307*cdf0e10cSrcweir     }
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir     return xPropSet;
310*cdf0e10cSrcweir }
311*cdf0e10cSrcweir //*************************************************************************
312*cdf0e10cSrcweir css::uno::Sequence< ::rtl::OUString > SAL_CALL ScriptInfo::getFileSetNames()
313*cdf0e10cSrcweir throw ( css::uno::RuntimeException )
314*cdf0e10cSrcweir {
315*cdf0e10cSrcweir     OSL_TRACE("ScriptInfo::getFileSetNames");
316*cdf0e10cSrcweir     Sequence< OUString > results;
317*cdf0e10cSrcweir     filesets_map::iterator fsm_it = m_scriptData.filesets.begin();
318*cdf0e10cSrcweir     filesets_map::iterator fsm_itend = m_scriptData.filesets.end();
319*cdf0e10cSrcweir     if( fsm_it == fsm_itend )
320*cdf0e10cSrcweir     {
321*cdf0e10cSrcweir         OSL_TRACE( "ScriptInfo::getFileSetNames: no filesets" );
322*cdf0e10cSrcweir         return results;
323*cdf0e10cSrcweir     }
324*cdf0e10cSrcweir     results.realloc( m_scriptData.filesets.size() );
325*cdf0e10cSrcweir     for ( sal_Int32 count = 0; fsm_it != fsm_itend; ++fsm_it )
326*cdf0e10cSrcweir     {
327*cdf0e10cSrcweir         OUString fileSetName = fsm_it->first;
328*cdf0e10cSrcweir         OSL_TRACE( "ScriptInfo::getFileSetNames: adding name %s",
329*cdf0e10cSrcweir             ::rtl::OUStringToOString( fileSetName,
330*cdf0e10cSrcweir                 RTL_TEXTENCODING_ASCII_US ).pData->buffer );
331*cdf0e10cSrcweir         results[ count++ ] = fileSetName;
332*cdf0e10cSrcweir     }
333*cdf0e10cSrcweir     return results;
334*cdf0e10cSrcweir }
335*cdf0e10cSrcweir //*************************************************************************
336*cdf0e10cSrcweir css::uno::Sequence< ::rtl::OUString > SAL_CALL
337*cdf0e10cSrcweir ScriptInfo::getFilesInFileSet( const ::rtl::OUString & fileSetName )
338*cdf0e10cSrcweir throw ( css::uno::RuntimeException )
339*cdf0e10cSrcweir {
340*cdf0e10cSrcweir     Sequence< OUString > results;
341*cdf0e10cSrcweir     filesets_map::iterator fsm_it = m_scriptData.filesets.find( fileSetName );
342*cdf0e10cSrcweir     filesets_map::iterator fsm_itend = m_scriptData.filesets.end();
343*cdf0e10cSrcweir     if( fsm_it == fsm_itend )
344*cdf0e10cSrcweir     {
345*cdf0e10cSrcweir         OSL_TRACE( "ScriptInfo::getFilesInFileSet: no fileset named %s",
346*cdf0e10cSrcweir             ::rtl::OUStringToOString( fileSetName,
347*cdf0e10cSrcweir                 RTL_TEXTENCODING_ASCII_US ).pData->buffer );
348*cdf0e10cSrcweir         return results;
349*cdf0e10cSrcweir     }
350*cdf0e10cSrcweir 
351*cdf0e10cSrcweir     strpairvec_map files = fsm_it->second.second;
352*cdf0e10cSrcweir     strpairvec_map::iterator spvm_it = files.begin();
353*cdf0e10cSrcweir     strpairvec_map::iterator spvm_itend = files.end();
354*cdf0e10cSrcweir     if( spvm_it == spvm_itend )
355*cdf0e10cSrcweir     {
356*cdf0e10cSrcweir         OSL_TRACE( "ScriptInfo::getFilesInFileSet: no files in fileset %s",
357*cdf0e10cSrcweir             ::rtl::OUStringToOString( fileSetName,
358*cdf0e10cSrcweir                 RTL_TEXTENCODING_ASCII_US ).pData->buffer );
359*cdf0e10cSrcweir         return results;
360*cdf0e10cSrcweir     }
361*cdf0e10cSrcweir     results.realloc( files.size() );
362*cdf0e10cSrcweir     for( sal_Int32 count = 0; spvm_it != spvm_itend ; ++spvm_it )
363*cdf0e10cSrcweir     {
364*cdf0e10cSrcweir         OUString fileName = spvm_it->first;
365*cdf0e10cSrcweir         OSL_TRACE( "ScriptInfo::getFilesInFileSet: adding file %s",
366*cdf0e10cSrcweir             ::rtl::OUStringToOString( fileName,
367*cdf0e10cSrcweir                 RTL_TEXTENCODING_ASCII_US ).pData->buffer );
368*cdf0e10cSrcweir         results[ count++ ] = fileName;
369*cdf0e10cSrcweir     }
370*cdf0e10cSrcweir     return results;
371*cdf0e10cSrcweir }
372*cdf0e10cSrcweir //*************************************************************************
373*cdf0e10cSrcweir }
374