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