Code review cleanup

This commit is contained in:
John Rice
2002-09-30 11:57:03 +00:00
parent 1b92671192
commit ab1b0edaa5
6 changed files with 38 additions and 29 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptNameResolverImpl.cxx,v $ * $RCSfile: ScriptNameResolverImpl.cxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:26 $ * last change: $Author: jmrice $ $Date: 2002-09-30 12:56:39 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -87,7 +87,7 @@ Sequence< OUString > nrs_serviceNames = Sequence< OUString >( &nrs_serviceName,
extern ::rtl_StandardModuleCount s_moduleCount; extern ::rtl_StandardModuleCount s_moduleCount;
// define storages to search // define storages to search
static ::std::vector< int >* m_pSearchIDs = NULL; static ::std::vector< sal_uInt16 >* m_pSearchIDs = NULL;
//************************************************************************* //*************************************************************************
ScriptNameResolverImpl::ScriptNameResolverImpl( ScriptNameResolverImpl::ScriptNameResolverImpl(
@@ -100,7 +100,7 @@ ScriptNameResolverImpl::ScriptNameResolverImpl(
osl::Guard< osl::Mutex > aGuard( m_mutex ); osl::Guard< osl::Mutex > aGuard( m_mutex );
if(!m_pSearchIDs) if(!m_pSearchIDs)
{ {
m_pSearchIDs = new ::std::vector< int >(); m_pSearchIDs = new ::std::vector< sal_uInt16 >();
m_pSearchIDs->push_back( ::scripting_constants::DOC_STORAGE_ID_NOT_SET ); m_pSearchIDs->push_back( ::scripting_constants::DOC_STORAGE_ID_NOT_SET );
m_pSearchIDs->push_back( ::scripting_constants::USER_STORAGE_ID ); m_pSearchIDs->push_back( ::scripting_constants::USER_STORAGE_ID );
m_pSearchIDs->push_back( ::scripting_constants::SHARED_STORAGE_ID ); m_pSearchIDs->push_back( ::scripting_constants::SHARED_STORAGE_ID );
@@ -136,7 +136,7 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
Any any; Any any;
OUString docUri; OUString docUri;
sal_Int16 docSid; sal_uInt16 docSid;
try try
{ {
any = xPropSetScriptingContext->getPropertyValue( scripting_constants::DOC_URI ); any = xPropSetScriptingContext->getPropertyValue( scripting_constants::DOC_URI );
@@ -182,10 +182,10 @@ throw ( lang::IllegalArgumentException, script::CannotConvertException, RuntimeE
OSL_TRACE( "ScriptNameResolverImpl::resolve Starting..." ); OSL_TRACE( "ScriptNameResolverImpl::resolve Starting..." );
::std::vector< int >& m_vSearchIDs = *m_pSearchIDs; ::std::vector< sal_uInt16 >& m_vSearchIDs = *m_pSearchIDs;
m_vSearchIDs[ 0 ] = docSid; m_vSearchIDs[ 0 ] = docSid;
::std::vector< int >::const_iterator iter; ::std::vector< sal_uInt16 >::const_iterator iter;
::std::vector< int >::const_iterator iterEnd = m_vSearchIDs.end(); ::std::vector< sal_uInt16 >::const_iterator iterEnd = m_vSearchIDs.end();
for ( iter = m_vSearchIDs.begin() ; iter != iterEnd; ++iter ) for ( iter = m_vSearchIDs.begin() ; iter != iterEnd; ++iter )
{ {
@@ -249,7 +249,7 @@ throw( RuntimeException )
Reference< scripturi::XScriptURI > Reference< scripturi::XScriptURI >
ScriptNameResolverImpl::resolveURIFromStorageID ScriptNameResolverImpl::resolveURIFromStorageID
( sal_Int16 sid, const Reference< scripturi::XScriptURI >& scriptURI ) ( sal_uInt16 sid, const Reference< scripturi::XScriptURI >& scriptURI )
SAL_THROW ( ( lang::IllegalArgumentException, RuntimeException ) ) SAL_THROW ( ( lang::IllegalArgumentException, RuntimeException ) )
{ {
@@ -272,6 +272,7 @@ SAL_THROW ( ( lang::IllegalArgumentException, RuntimeException ) )
Reference< scripturi::XScriptURI > resolvedName; Reference< scripturi::XScriptURI > resolvedName;
if ( sid == ::scripting_constants::DOC_STORAGE_ID_NOT_SET ) if ( sid == ::scripting_constants::DOC_STORAGE_ID_NOT_SET )
{ {
OSL_TRACE( "@@@@ **** ScriptNameResolverImpl::resolve DOC_STORAGE_ID_NOT_SET" );
return resolvedName; return resolvedName;
} }
try try

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptNameResolverImpl.hxx,v $ * $RCSfile: ScriptNameResolverImpl.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:26 $ * last change: $Author: jmrice $ $Date: 2002-09-30 12:56:40 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -126,7 +126,7 @@ public:
private: private:
::com::sun::star::uno::Reference < ::com::sun::star::uno::Reference <
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > ::drafts::com::sun::star::script::framework::scripturi::XScriptURI >
resolveURIFromStorageID( sal_Int16 sid, resolveURIFromStorageID( sal_uInt16 sid,
const ::com::sun::star::uno::Reference < const ::com::sun::star::uno::Reference <
::drafts::com::sun::star::script::framework::scripturi::XScriptURI > & ::drafts::com::sun::star::script::framework::scripturi::XScriptURI > &
nameToResolve ) nameToResolve )

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: StorageBridgeFactory.cxx,v $ * $RCSfile: StorageBridgeFactory.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:27 $ * last change: $Author: jmrice $ $Date: 2002-09-30 12:56:40 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -90,7 +90,7 @@ StorageBridgeFactory::StorageBridgeFactory(
// use "real" storage. // use "real" storage.
Reference< storage::XScriptImplAccess > Reference< storage::XScriptImplAccess >
StorageBridgeFactory::getStorageInstance( sal_Int16 sid ) StorageBridgeFactory::getStorageInstance( sal_uInt16 sid )
{ {
Reference< storage::XScriptImplAccess > storage = new StorageBridge( m_xContext, Reference< storage::XScriptImplAccess > storage = new StorageBridge( m_xContext,

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: StorageBridgeFactory.hxx,v $ * $RCSfile: StorageBridgeFactory.hxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: jmrice $ $Date: 2002-09-27 12:16:27 $ * last change: $Author: jmrice $ $Date: 2002-09-30 12:56:40 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -81,7 +81,7 @@ public:
); );
::com::sun::star::uno::Reference < ::com::sun::star::uno::Reference <
::drafts::com::sun::star::script::framework::storage::XScriptImplAccess > ::drafts::com::sun::star::script::framework::storage::XScriptImplAccess >
getStorageInstance( sal_Int16 sid ); getStorageInstance( sal_uInt16 sid );
private: private:
StorageBridgeFactory(); // No definition for default ctor StorageBridgeFactory(); // No definition for default ctor
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >

View File

@@ -2,8 +2,8 @@
* *
* $RCSfile: ScriptStorage.cxx,v $ * $RCSfile: ScriptStorage.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* last change: $Author: jmrice $ $Date: 2002-09-30 10:59:39 $ * last change: $Author: jmrice $ $Date: 2002-09-30 12:57:02 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -186,7 +186,7 @@ throw ( RuntimeException, Exception )
Reference< io::XInputStream > xInput; Reference< io::XInputStream > xInput;
sal_Int32 languageDirsLength = languageDirs.getLength(); sal_Int32 languageDirsLength = languageDirs.getLength();
for ( int i = 0; i < languageDirsLength ; ++i ) for ( sal_Int32 i = 0; i < languageDirsLength ; ++i )
{ {
#ifdef _DEBUG #ifdef _DEBUG
fprintf( stderr, "contains: %s\n", ::rtl::OUStringToOString( languageDirs[ i ], fprintf( stderr, "contains: %s\n", ::rtl::OUStringToOString( languageDirs[ i ],
@@ -204,7 +204,7 @@ throw ( RuntimeException, Exception )
m_xSimpleFileAccess->getFolderContents( languageDirs[ i ], true ); m_xSimpleFileAccess->getFolderContents( languageDirs[ i ], true );
sal_Int32 parcelDirsLength = parcelDirs.getLength(); sal_Int32 parcelDirsLength = parcelDirs.getLength();
for ( int j = 0; j < parcelDirsLength ; ++j ) for ( sal_Int32 j = 0; j < parcelDirsLength ; ++j )
{ {
#ifdef _DEBUG #ifdef _DEBUG
fprintf( stderr, "contains: %s\n", fprintf( stderr, "contains: %s\n",
@@ -468,9 +468,17 @@ throw ( RuntimeException )
{ {
::osl::Guard< osl::Mutex > aGuard( m_mutex ); ::osl::Guard< osl::Mutex > aGuard( m_mutex );
Sequence< Reference< storage::XScriptInfo > > sr_xScriptInfo;
//Get iterator over the hash_map //Get iterator over the hash_map
ScriptInfo_hash::const_iterator h_iter = mh_implementations.find( name ); ScriptInfo_hash::const_iterator h_iter = mh_implementations.find( name );
Sequence< Reference< storage::XScriptInfo > > sr_xScriptInfo( h_iter->second.size() );
if ( h_iter == mh_implementations.end() )
{
OSL_TRACE("ScriptStorage::getScriptInfoService: EMPTY STORAGE");
return sr_xScriptInfo;
}
sr_xScriptInfo.realloc( h_iter->second.size() );
try try
{ {
@@ -706,7 +714,7 @@ throw ( RuntimeException )
OUString new_dest; OUString new_dest;
sal_Int32 idx; sal_Int32 idx;
sal_Int32 len = seq.getLength(); sal_Int32 len = seq.getLength();
for ( int i = 0; i < len; i++ ) for ( sal_Int32 i = 0; i < len; i++ )
{ {
new_dest = dest; new_dest = dest;
idx = seq[ i ].lastIndexOf( '/' ); idx = seq[ i ].lastIndexOf( '/' );

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: ScriptStorageManager.hxx,v $ * $RCSfile: ScriptStorageManager.hxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: dfoster $ $Date: 2002-09-27 14:14:14 $ * last change: $Author: jmrice $ $Date: 2002-09-30 12:57:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -80,7 +80,7 @@ namespace scripting_impl
// Define a hash_map used to store the ScriptingStorages key;d by ID // Define a hash_map used to store the ScriptingStorages key;d by ID
typedef ::std::hash_map < typedef ::std::hash_map <
sal_Int16, sal_uInt16,
::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > > ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > >
ScriptStorage_hash; ScriptStorage_hash;
@@ -191,7 +191,7 @@ private:
::com::sun::star::lang::XMultiComponentFactory > m_xMgr; ::com::sun::star::lang::XMultiComponentFactory > m_xMgr;
::osl::Mutex m_mutex; ::osl::Mutex m_mutex;
ScriptStorage_hash m_ScriptStorageHash; ScriptStorage_hash m_ScriptStorageHash;
sal_Int16 m_count; sal_uInt16 m_count;
void setupAppStorage( void setupAppStorage(
const ::com::sun::star::uno::Reference< const ::com::sun::star::uno::Reference<