dung out namespacing clutter.

Change-Id: I14794ca0cd2a8ea84ba41e1dc689503647696e3a
This commit is contained in:
Michael Meeks
2012-09-17 16:26:24 +01:00
parent d495c7d42d
commit f88c4a5bc1
2 changed files with 255 additions and 265 deletions

View File

@@ -69,17 +69,15 @@
using com::sun::star::uno::Reference; using com::sun::star::uno::Reference;
using ::std::vector; using ::std::vector;
using ::std::advance; using ::std::advance;
using namespace com::sun::star::container; using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::script; using namespace com::sun::star::script;
using namespace cppu; using namespace cppu;
typedef WeakImplHelper1< XNameContainer > NameContainerHelper; typedef WeakImplHelper1< container::XNameContainer > NameContainerHelper;
typedef WeakImplHelper1< XStarBasicModuleInfo > ModuleInfoHelper; typedef WeakImplHelper1< script::XStarBasicModuleInfo > ModuleInfoHelper;
typedef WeakImplHelper1< XStarBasicDialogInfo > DialogInfoHelper; typedef WeakImplHelper1< script::XStarBasicDialogInfo > DialogInfoHelper;
typedef WeakImplHelper1< XStarBasicLibraryInfo > LibraryInfoHelper; typedef WeakImplHelper1< script::XStarBasicLibraryInfo > LibraryInfoHelper;
typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; typedef WeakImplHelper1< script::XStarBasicAccess > StarBasicAccessHelper;
// Version 1 // Version 1
// sal_uIntPtr nEndPos // sal_uIntPtr nEndPos
@@ -140,7 +138,7 @@ BasicManagerImpl::~BasicManagerImpl()
// BasMgrContainerListenerImpl // BasMgrContainerListenerImpl
//============================================================================ //============================================================================
typedef ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener > ContainerListenerHelper; typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerHelper;
class BasMgrContainerListenerImpl: public ContainerListenerHelper class BasMgrContainerListenerImpl: public ContainerListenerHelper
{ {
@@ -152,23 +150,23 @@ public:
: mpMgr( pMgr ) : mpMgr( pMgr )
, maLibName( aLibName ) {} , maLibName( aLibName ) {}
static void insertLibraryImpl( const Reference< XLibraryContainer >& xScriptCont, BasicManager* pMgr, static void insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont, BasicManager* pMgr,
Any aLibAny, ::rtl::OUString aLibName ); uno::Any aLibAny, ::rtl::OUString aLibName );
static void addLibraryModulesImpl( BasicManager* pMgr, Reference< XNameAccess > xLibNameAccess, static void addLibraryModulesImpl( BasicManager* pMgr, uno::Reference< container::XNameAccess > xLibNameAccess,
::rtl::OUString aLibName ); ::rtl::OUString aLibName );
// XEventListener // XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) virtual void SAL_CALL disposing( const lang::EventObject& Source )
throw(::com::sun::star::uno::RuntimeException); throw(uno::RuntimeException);
// XContainerListener // XContainerListener
virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event )
throw(::com::sun::star::uno::RuntimeException); throw(uno::RuntimeException);
virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) virtual void SAL_CALL elementReplaced( const container::ContainerEvent& Event )
throw(::com::sun::star::uno::RuntimeException); throw(uno::RuntimeException);
virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event )
throw(::com::sun::star::uno::RuntimeException); throw(uno::RuntimeException);
}; };
@@ -176,10 +174,10 @@ public:
// BasMgrContainerListenerImpl // BasMgrContainerListenerImpl
//============================================================================ //============================================================================
void BasMgrContainerListenerImpl::insertLibraryImpl( const Reference< XLibraryContainer >& xScriptCont, void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont,
BasicManager* pMgr, Any aLibAny, ::rtl::OUString aLibName ) BasicManager* pMgr, uno::Any aLibAny, ::rtl::OUString aLibName )
{ {
Reference< XNameAccess > xLibNameAccess; Reference< container::XNameAccess > xLibNameAccess;
aLibAny >>= xLibNameAccess; aLibAny >>= xLibNameAccess;
if( !pMgr->GetLib( aLibName ) ) if( !pMgr->GetLib( aLibName ) )
@@ -192,12 +190,12 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const Reference< XLibraryCo
DBG_ASSERT( pLib, "XML Import: Basic library could not be created"); DBG_ASSERT( pLib, "XML Import: Basic library could not be created");
} }
Reference< XContainer> xLibContainer( xLibNameAccess, UNO_QUERY ); uno::Reference< container::XContainer> xLibContainer( xLibNameAccess, uno::UNO_QUERY );
if( xLibContainer.is() ) if( xLibContainer.is() )
{ {
// Register listener for library // Register listener for library
Reference< XContainerListener > xLibraryListener Reference< container::XContainerListener > xLibraryListener
= static_cast< XContainerListener* > = static_cast< container::XContainerListener* >
( new BasMgrContainerListenerImpl( pMgr, aLibName ) ); ( new BasMgrContainerListenerImpl( pMgr, aLibName ) );
xLibContainer->addContainerListener( xLibraryListener ); xLibContainer->addContainerListener( xLibraryListener );
} }
@@ -210,9 +208,9 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const Reference< XLibraryCo
void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr, void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
Reference< XNameAccess > xLibNameAccess, ::rtl::OUString aLibName ) uno::Reference< container::XNameAccess > xLibNameAccess, ::rtl::OUString aLibName )
{ {
Sequence< ::rtl::OUString > aModuleNames = xLibNameAccess->getElementNames(); uno::Sequence< ::rtl::OUString > aModuleNames = xLibNameAccess->getElementNames();
sal_Int32 nModuleCount = aModuleNames.getLength(); sal_Int32 nModuleCount = aModuleNames.getLength();
StarBASIC* pLib = pMgr->GetLib( aLibName ); StarBASIC* pLib = pMgr->GetLib( aLibName );
@@ -223,10 +221,10 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
for( sal_Int32 j = 0 ; j < nModuleCount ; j++ ) for( sal_Int32 j = 0 ; j < nModuleCount ; j++ )
{ {
::rtl::OUString aModuleName = pNames[ j ]; ::rtl::OUString aModuleName = pNames[ j ];
Any aElement = xLibNameAccess->getByName( aModuleName ); uno::Any aElement = xLibNameAccess->getByName( aModuleName );
::rtl::OUString aMod; ::rtl::OUString aMod;
aElement >>= aMod; aElement >>= aMod;
Reference< vba::XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY ); uno::Reference< vba::XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, uno::UNO_QUERY );
if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) ) if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) )
{ {
ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aModuleName ); ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aModuleName );
@@ -246,8 +244,8 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
// XEventListener // XEventListener
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void SAL_CALL BasMgrContainerListenerImpl::disposing( const EventObject& Source ) void SAL_CALL BasMgrContainerListenerImpl::disposing( const lang::EventObject& Source )
throw( RuntimeException ) throw( uno::RuntimeException )
{ {
(void)Source; (void)Source;
} }
@@ -255,8 +253,8 @@ void SAL_CALL BasMgrContainerListenerImpl::disposing( const EventObject& Source
// XContainerListener // XContainerListener
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent& Event ) void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const container::ContainerEvent& Event )
throw( RuntimeException ) throw( uno::RuntimeException )
{ {
sal_Bool bLibContainer = ( maLibName.getLength() == 0 ); sal_Bool bLibContainer = ( maLibName.getLength() == 0 );
::rtl::OUString aName; ::rtl::OUString aName;
@@ -264,12 +262,12 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
if( bLibContainer ) if( bLibContainer )
{ {
Reference< XLibraryContainer > xScriptCont( Event.Source, UNO_QUERY ); uno::Reference< script::XLibraryContainer > xScriptCont( Event.Source, uno::UNO_QUERY );
insertLibraryImpl( xScriptCont, mpMgr, Event.Element, aName ); insertLibraryImpl( xScriptCont, mpMgr, Event.Element, aName );
StarBASIC* pLib = mpMgr->GetLib( aName ); StarBASIC* pLib = mpMgr->GetLib( aName );
if ( pLib ) if ( pLib )
{ {
Reference< vba::XVBACompatibility > xVBACompat( xScriptCont, UNO_QUERY ); uno::Reference< vba::XVBACompatibility > xVBACompat( xScriptCont, uno::UNO_QUERY );
if ( xVBACompat.is() ) if ( xVBACompat.is() )
pLib->SetVBAEnabled( xVBACompat->getVBACompatibilityMode() ); pLib->SetVBAEnabled( xVBACompat->getVBACompatibilityMode() );
} }
@@ -286,7 +284,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
{ {
::rtl::OUString aMod; ::rtl::OUString aMod;
Event.Element >>= aMod; Event.Element >>= aMod;
Reference< vba::XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY ); uno::Reference< vba::XVBAModuleInfo > xVBAModuleInfo( Event.Source, uno::UNO_QUERY );
if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) ) if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) )
{ {
ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aName ); ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aName );
@@ -302,8 +300,8 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const ContainerEvent& Event ) void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const container::ContainerEvent& Event )
throw( RuntimeException ) throw( uno::RuntimeException )
{ {
::rtl::OUString aName; ::rtl::OUString aName;
Event.Accessor >>= aName; Event.Accessor >>= aName;
@@ -332,8 +330,8 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const ContainerEvent
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const ContainerEvent& Event ) void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const container::ContainerEvent& Event )
throw( RuntimeException ) throw( uno::RuntimeException )
{ {
::rtl::OUString aName; ::rtl::OUString aName;
Event.Accessor >>= aName; Event.Accessor >>= aName;
@@ -391,7 +389,7 @@ private:
sal_Bool bPasswordVerified; sal_Bool bPasswordVerified;
// Lib represents library in new UNO library container // Lib represents library in new UNO library container
Reference< XLibraryContainer > mxScriptCont; uno::Reference< script::XLibraryContainer > mxScriptCont;
public: public:
BasicLibInfo(); BasicLibInfo();
@@ -432,9 +430,9 @@ public:
static BasicLibInfo* Create( SotStorageStream& rSStream ); static BasicLibInfo* Create( SotStorageStream& rSStream );
Reference< XLibraryContainer > GetLibraryContainer( void ) uno::Reference< script::XLibraryContainer > GetLibraryContainer( void )
{ return mxScriptCont; } { return mxScriptCont; }
void SetLibraryContainer( const Reference< XLibraryContainer >& xScriptCont ) void SetLibraryContainer( const uno::Reference< script::XLibraryContainer >& xScriptCont )
{ mxScriptCont = xScriptCont; } { mxScriptCont = xScriptCont; }
}; };
@@ -663,7 +661,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA
void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInfo ) void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInfo )
{ {
Reference< XLibraryContainer > xScriptCont( rInfo.mxScriptCont.get() ); uno::Reference< script::XLibraryContainer > xScriptCont( rInfo.mxScriptCont.get() );
if ( !xScriptCont.is() ) if ( !xScriptCont.is() )
return; return;
@@ -671,8 +669,8 @@ void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInf
if( !xScriptCont->hasByName( aLibName ) ) if( !xScriptCont->hasByName( aLibName ) )
xScriptCont->createLibrary( aLibName ); xScriptCont->createLibrary( aLibName );
Any aLibAny = xScriptCont->getByName( aLibName ); uno::Any aLibAny = xScriptCont->getByName( aLibName );
Reference< XNameContainer > xLib; uno::Reference< container::XNameContainer > xLib;
aLibAny >>= xLib; aLibAny >>= xLib;
if ( !xLib.is() ) if ( !xLib.is() )
return; return;
@@ -687,19 +685,19 @@ void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInf
if( !xLib->hasByName( aModName ) ) if( !xLib->hasByName( aModName ) )
{ {
::rtl::OUString aSource = pModule->GetSource32(); ::rtl::OUString aSource = pModule->GetSource32();
Any aSourceAny; uno::Any aSourceAny;
aSourceAny <<= aSource; aSourceAny <<= aSource;
xLib->insertByName( aModName, aSourceAny ); xLib->insertByName( aModName, aSourceAny );
} }
} }
} }
const Reference< XPersistentLibraryContainer >& BasicManager::GetDialogLibraryContainer() const const uno::Reference< script::XPersistentLibraryContainer >& BasicManager::GetDialogLibraryContainer() const
{ {
return mpImpl->maContainerInfo.mxDialogCont; return mpImpl->maContainerInfo.mxDialogCont;
} }
const Reference< XPersistentLibraryContainer >& BasicManager::GetScriptLibraryContainer() const const uno::Reference< script::XPersistentLibraryContainer >& BasicManager::GetScriptLibraryContainer() const
{ {
return mpImpl->maContainerInfo.mxScriptCont; return mpImpl->maContainerInfo.mxScriptCont;
} }
@@ -708,21 +706,21 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo )
{ {
mpImpl->maContainerInfo = rInfo; mpImpl->maContainerInfo = rInfo;
Reference< XLibraryContainer > xScriptCont( mpImpl->maContainerInfo.mxScriptCont.get() ); uno::Reference< script::XLibraryContainer > xScriptCont( mpImpl->maContainerInfo.mxScriptCont.get() );
StarBASIC* pStdLib = GetStdLib(); StarBASIC* pStdLib = GetStdLib();
String aLibName = pStdLib->GetName(); String aLibName = pStdLib->GetName();
if( xScriptCont.is() ) if( xScriptCont.is() )
{ {
// Register listener for lib container // Register listener for lib container
::rtl::OUString aEmptyLibName; ::rtl::OUString aEmptyLibName;
Reference< XContainerListener > xLibContainerListener uno::Reference< container::XContainerListener > xLibContainerListener
= static_cast< XContainerListener* > = static_cast< container::XContainerListener* >
( new BasMgrContainerListenerImpl( this, aEmptyLibName ) ); ( new BasMgrContainerListenerImpl( this, aEmptyLibName ) );
Reference< XContainer> xLibContainer( xScriptCont, UNO_QUERY ); uno::Reference< container::XContainer> xLibContainer( xScriptCont, uno::UNO_QUERY );
xLibContainer->addContainerListener( xLibContainerListener ); xLibContainer->addContainerListener( xLibContainerListener );
Sequence< ::rtl::OUString > aScriptLibNames = xScriptCont->getElementNames(); uno::Sequence< ::rtl::OUString > aScriptLibNames = xScriptCont->getElementNames();
const ::rtl::OUString* pScriptLibName = aScriptLibNames.getConstArray(); const ::rtl::OUString* pScriptLibName = aScriptLibNames.getConstArray();
sal_Int32 i, nNameCount = aScriptLibNames.getLength(); sal_Int32 i, nNameCount = aScriptLibNames.getLength();
@@ -730,7 +728,7 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo )
{ {
for( i = 0 ; i < nNameCount ; ++i, ++pScriptLibName ) for( i = 0 ; i < nNameCount ; ++i, ++pScriptLibName )
{ {
Any aLibAny = xScriptCont->getByName( *pScriptLibName ); uno::Any aLibAny = xScriptCont->getByName( *pScriptLibName );
if ( *pScriptLibName == "Standard" ) if ( *pScriptLibName == "Standard" )
xScriptCont->loadLibrary( *pScriptLibName ); xScriptCont->loadLibrary( *pScriptLibName );
@@ -1471,7 +1469,7 @@ sal_Bool BasicManager::LoadLib( sal_uInt16 nLib )
DBG_ASSERT( pLibInfo, "Lib?!" ); DBG_ASSERT( pLibInfo, "Lib?!" );
if ( pLibInfo ) if ( pLibInfo )
{ {
Reference< XLibraryContainer > xLibContainer = pLibInfo->GetLibraryContainer(); uno::Reference< script::XLibraryContainer > xLibContainer = pLibInfo->GetLibraryContainer();
if( xLibContainer.is() ) if( xLibContainer.is() )
{ {
String aLibName = pLibInfo->GetLibName(); String aLibName = pLibInfo->GetLibName();
@@ -1546,7 +1544,7 @@ StarBASIC* BasicManager::CreateLib
} }
StarBASIC* BasicManager::CreateLibForLibContainer( const String& rLibName, StarBASIC* BasicManager::CreateLibForLibContainer( const String& rLibName,
const Reference< XLibraryContainer >& xScriptCont ) const uno::Reference< script::XLibraryContainer >& xScriptCont )
{ {
DBG_CHKTHIS( BasicManager, 0 ); DBG_CHKTHIS( BasicManager, 0 );
if ( GetLib( rLibName ) ) if ( GetLib( rLibName ) )
@@ -1600,7 +1598,7 @@ std::vector<BasicError>& BasicManager::GetErrors()
return aErrors; return aErrors;
} }
bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ) bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, uno::Any& aOut )
{ {
bool bRes = false; bool bRes = false;
StarBASIC* pStandardLib = GetStdLib(); StarBASIC* pStandardLib = GetStdLib();
@@ -1610,9 +1608,9 @@ bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun
return bRes; return bRes;
} }
Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const Any& _rValue ) uno::Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const uno::Any& _rValue )
{ {
Any aOldValue; uno::Any aOldValue;
StarBASIC* pStandardLib = GetStdLib(); StarBASIC* pStandardLib = GetStdLib();
OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" ); OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" );
@@ -1633,14 +1631,14 @@ Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const Any&
return aOldValue; return aOldValue;
} }
bool BasicManager::LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< rtl::OUString >& _out_rModuleNames ) bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< rtl::OUString >& _out_rModuleNames )
{ {
try try
{ {
Reference< XNameAccess > xScripts( GetScriptLibraryContainer(), UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xScripts( GetScriptLibraryContainer(), uno::UNO_QUERY_THROW );
Reference< XLibraryContainerPassword > xPassword( GetScriptLibraryContainer(), UNO_QUERY_THROW ); uno::Reference< script::XLibraryContainerPassword > xPassword( GetScriptLibraryContainer(), uno::UNO_QUERY_THROW );
Sequence< ::rtl::OUString > aNames( xScripts->getElementNames() ); uno::Sequence< ::rtl::OUString > aNames( xScripts->getElementNames() );
const ::rtl::OUString* pNames = aNames.getConstArray(); const ::rtl::OUString* pNames = aNames.getConstArray();
const ::rtl::OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength(); const ::rtl::OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength();
for ( ; pNames != pNamesEnd; ++pNames ) for ( ; pNames != pNamesEnd; ++pNames )
@@ -1652,11 +1650,11 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequen
if ( !pBasicLib ) if ( !pBasicLib )
continue; continue;
Reference< XNameAccess > xScriptLibrary( xScripts->getByName( *pNames ), UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xScriptLibrary( xScripts->getByName( *pNames ), uno::UNO_QUERY_THROW );
Sequence< ::rtl::OUString > aElementNames( xScriptLibrary->getElementNames() ); uno::Sequence< ::rtl::OUString > aElementNames( xScriptLibrary->getElementNames() );
sal_Int32 nLen = aElementNames.getLength(); sal_Int32 nLen = aElementNames.getLength();
Sequence< ::rtl::OUString > aBigModules( nLen ); uno::Sequence< ::rtl::OUString > aBigModules( nLen );
sal_Int32 nBigModules = 0; sal_Int32 nBigModules = 0;
const ::rtl::OUString* pElementNames = aElementNames.getConstArray(); const ::rtl::OUString* pElementNames = aElementNames.getConstArray();
@@ -1676,7 +1674,7 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequen
} }
} }
} }
catch( const Exception& ) catch( const uno::Exception& )
{ {
DBG_UNHANDLED_EXCEPTION(); DBG_UNHANDLED_EXCEPTION();
} }
@@ -1807,11 +1805,11 @@ public:
: maName( aName ), maLanguage( aLanguage), maSource( aSource ) {} : maName( aName ), maLanguage( aLanguage), maSource( aSource ) {}
// Methods XStarBasicModuleInfo // Methods XStarBasicModuleInfo
virtual ::rtl::OUString SAL_CALL getName() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getName() throw(uno::RuntimeException)
{ return maName; } { return maName; }
virtual ::rtl::OUString SAL_CALL getLanguage() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getLanguage() throw(uno::RuntimeException)
{ return maLanguage; } { return maLanguage; }
virtual ::rtl::OUString SAL_CALL getSource() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getSource() throw(uno::RuntimeException)
{ return maSource; } { return maSource; }
}; };
@@ -1821,16 +1819,16 @@ public:
class DialogInfo_Impl : public DialogInfoHelper class DialogInfo_Impl : public DialogInfoHelper
{ {
::rtl::OUString maName; ::rtl::OUString maName;
Sequence< sal_Int8 > mData; uno::Sequence< sal_Int8 > mData;
public: public:
DialogInfo_Impl( const ::rtl::OUString& aName, Sequence< sal_Int8 > Data ) DialogInfo_Impl( const ::rtl::OUString& aName, uno::Sequence< sal_Int8 > Data )
: maName( aName ), mData( Data ) {} : maName( aName ), mData( Data ) {}
// Methods XStarBasicDialogInfo // Methods XStarBasicDialogInfo
virtual ::rtl::OUString SAL_CALL getName() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getName() throw(uno::RuntimeException)
{ return maName; } { return maName; }
virtual Sequence< sal_Int8 > SAL_CALL getData() throw(RuntimeException) virtual uno::Sequence< sal_Int8 > SAL_CALL getData() throw(uno::RuntimeException)
{ return mData; } { return mData; }
}; };
@@ -1840,8 +1838,8 @@ public:
class LibraryInfo_Impl : public LibraryInfoHelper class LibraryInfo_Impl : public LibraryInfoHelper
{ {
::rtl::OUString maName; ::rtl::OUString maName;
Reference< XNameContainer > mxModuleContainer; uno::Reference< container::XNameContainer > mxModuleContainer;
Reference< XNameContainer > mxDialogContainer; uno::Reference< container::XNameContainer > mxDialogContainer;
::rtl::OUString maPassword; ::rtl::OUString maPassword;
::rtl::OUString maExternaleSourceURL; ::rtl::OUString maExternaleSourceURL;
::rtl::OUString maLinkTargetURL; ::rtl::OUString maLinkTargetURL;
@@ -1850,8 +1848,8 @@ public:
LibraryInfo_Impl LibraryInfo_Impl
( (
const ::rtl::OUString& aName, const ::rtl::OUString& aName,
Reference< XNameContainer > xModuleContainer, uno::Reference< container::XNameContainer > xModuleContainer,
Reference< XNameContainer > xDialogContainer, uno::Reference< container::XNameContainer > xDialogContainer,
const ::rtl::OUString& aPassword, const ::rtl::OUString& aPassword,
const ::rtl::OUString& aExternaleSourceURL, const ::rtl::OUString& aExternaleSourceURL,
const ::rtl::OUString& aLinkTargetURL const ::rtl::OUString& aLinkTargetURL
@@ -1865,17 +1863,17 @@ public:
{} {}
// Methods XStarBasicLibraryInfo // Methods XStarBasicLibraryInfo
virtual ::rtl::OUString SAL_CALL getName() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getName() throw(uno::RuntimeException)
{ return maName; } { return maName; }
virtual Reference< XNameContainer > SAL_CALL getModuleContainer() throw(RuntimeException) virtual uno::Reference< container::XNameContainer > SAL_CALL getModuleContainer() throw(uno::RuntimeException)
{ return mxModuleContainer; } { return mxModuleContainer; }
virtual Reference< XNameContainer > SAL_CALL getDialogContainer() throw(RuntimeException) virtual uno::Reference< container::XNameContainer > SAL_CALL getDialogContainer() throw(uno::RuntimeException)
{ return mxDialogContainer; } { return mxDialogContainer; }
virtual ::rtl::OUString SAL_CALL getPassword() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getPassword() throw(uno::RuntimeException)
{ return maPassword; } { return maPassword; }
virtual ::rtl::OUString SAL_CALL getExternalSourceURL() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getExternalSourceURL() throw(uno::RuntimeException)
{ return maExternaleSourceURL; } { return maExternaleSourceURL; }
virtual ::rtl::OUString SAL_CALL getLinkTargetURL() throw(RuntimeException) virtual ::rtl::OUString SAL_CALL getLinkTargetURL() throw(uno::RuntimeException)
{ return maLinkTargetURL; } { return maLinkTargetURL; }
}; };
@@ -1890,65 +1888,67 @@ public:
:mpLib( pLib ) {} :mpLib( pLib ) {}
// Methods XElementAccess // Methods XElementAccess
virtual Type SAL_CALL getElementType() virtual uno::Type SAL_CALL getElementType()
throw(RuntimeException); throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements() virtual sal_Bool SAL_CALL hasElements()
throw(RuntimeException); throw(uno::RuntimeException);
// Methods XNameAccess // Methods XNameAccess
virtual Any SAL_CALL getByName( const ::rtl::OUString& aName ) virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException); throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames() virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
throw(RuntimeException); throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
throw(RuntimeException); throw(uno::RuntimeException);
// Methods XNameReplace // Methods XNameReplace
virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const Any& aElement ) virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException); throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException);
// Methods XNameContainer // Methods XNameContainer
virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const Any& aElement ) virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException); throw(lang::IllegalArgumentException, container::ElementExistException,
lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException); throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
}; };
// Methods XElementAccess // Methods XElementAccess
Type ModuleContainer_Impl::getElementType() uno::Type ModuleContainer_Impl::getElementType()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
Type aModuleType = ::getCppuType( (const Reference< XStarBasicModuleInfo > *)0 ); uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicModuleInfo > *)0 );
return aModuleType; return aModuleType;
} }
sal_Bool ModuleContainer_Impl::hasElements() sal_Bool ModuleContainer_Impl::hasElements()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL;
return pMods && pMods->Count() > 0; return pMods && pMods->Count() > 0;
} }
// Methods XNameAccess // Methods XNameAccess
Any ModuleContainer_Impl::getByName( const ::rtl::OUString& aName ) uno::Any ModuleContainer_Impl::getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL; SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL;
if( !pMod ) if( !pMod )
throw NoSuchElementException(); throw container::NoSuchElementException();
Reference< XStarBasicModuleInfo > xMod = (XStarBasicModuleInfo*)new ModuleInfo_Impl uno::Reference< script::XStarBasicModuleInfo > xMod = (XStarBasicModuleInfo*)new ModuleInfo_Impl
( aName, ::rtl::OUString::createFromAscii( szScriptLanguage ), pMod->GetSource32() ); ( aName, ::rtl::OUString::createFromAscii( szScriptLanguage ), pMod->GetSource32() );
Any aRetAny; uno::Any aRetAny;
aRetAny <<= xMod; aRetAny <<= xMod;
return aRetAny; return aRetAny;
} }
Sequence< ::rtl::OUString > ModuleContainer_Impl::getElementNames() uno::Sequence< ::rtl::OUString > ModuleContainer_Impl::getElementNames()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL;
sal_uInt16 nMods = pMods ? pMods->Count() : 0; sal_uInt16 nMods = pMods ? pMods->Count() : 0;
Sequence< ::rtl::OUString > aRetSeq( nMods ); uno::Sequence< ::rtl::OUString > aRetSeq( nMods );
::rtl::OUString* pRetSeq = aRetSeq.getArray(); ::rtl::OUString* pRetSeq = aRetSeq.getArray();
for( sal_uInt16 i = 0 ; i < nMods ; i++ ) for( sal_uInt16 i = 0 ; i < nMods ; i++ )
{ {
@@ -1959,7 +1959,7 @@ Sequence< ::rtl::OUString > ModuleContainer_Impl::getElementNames()
} }
sal_Bool ModuleContainer_Impl::hasByName( const ::rtl::OUString& aName ) sal_Bool ModuleContainer_Impl::hasByName( const ::rtl::OUString& aName )
throw(RuntimeException) throw(uno::RuntimeException)
{ {
SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL; SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL;
sal_Bool bRet = (pMod != NULL); sal_Bool bRet = (pMod != NULL);
@@ -1968,8 +1968,8 @@ sal_Bool ModuleContainer_Impl::hasByName( const ::rtl::OUString& aName )
// Methods XNameReplace // Methods XNameReplace
void ModuleContainer_Impl::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) void ModuleContainer_Impl::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
removeByName( aName ); removeByName( aName );
insertByName( aName, aElement ); insertByName( aName, aElement );
@@ -1977,43 +1977,43 @@ void ModuleContainer_Impl::replaceByName( const ::rtl::OUString& aName, const An
// Methods XNameContainer // Methods XNameContainer
void ModuleContainer_Impl::insertByName( const ::rtl::OUString& aName, const Any& aElement ) void ModuleContainer_Impl::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{ {
Type aModuleType = ::getCppuType( (const Reference< XStarBasicModuleInfo > *)0 ); uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicModuleInfo > *)0 );
Type aAnyType = aElement.getValueType(); uno::Type aAnyType = aElement.getValueType();
if( aModuleType != aAnyType ) if( aModuleType != aAnyType )
throw IllegalArgumentException(); throw lang::IllegalArgumentException();
Reference< XStarBasicModuleInfo > xMod; uno::Reference< script::XStarBasicModuleInfo > xMod;
aElement >>= xMod; aElement >>= xMod;
mpLib->MakeModule32( aName, xMod->getSource() ); mpLib->MakeModule32( aName, xMod->getSource() );
} }
void ModuleContainer_Impl::removeByName( const ::rtl::OUString& Name ) void ModuleContainer_Impl::removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
SbModule* pMod = mpLib ? mpLib->FindModule( Name ) : NULL; SbModule* pMod = mpLib ? mpLib->FindModule( Name ) : NULL;
if( !pMod ) if( !pMod )
throw NoSuchElementException(); throw container::NoSuchElementException();
mpLib->Remove( pMod ); mpLib->Remove( pMod );
} }
//===================================================================== //=====================================================================
Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog ) uno::Sequence< sal_Int8 > implGetDialogData( SbxObject* pDialog )
{ {
SvMemoryStream aMemStream; SvMemoryStream aMemStream;
pDialog->Store( aMemStream ); pDialog->Store( aMemStream );
sal_Int32 nLen = aMemStream.Tell(); sal_Int32 nLen = aMemStream.Tell();
Sequence< sal_Int8 > aData( nLen ); uno::Sequence< sal_Int8 > aData( nLen );
sal_Int8* pDestData = aData.getArray(); sal_Int8* pDestData = aData.getArray();
const sal_Int8* pSrcData = (const sal_Int8*)aMemStream.GetData(); const sal_Int8* pSrcData = (const sal_Int8*)aMemStream.GetData();
rtl_copyMemory( pDestData, pSrcData, nLen ); rtl_copyMemory( pDestData, pSrcData, nLen );
return aData; return aData;
} }
SbxObject* implCreateDialog( Sequence< sal_Int8 > aData ) SbxObject* implCreateDialog( uno::Sequence< sal_Int8 > aData )
{ {
sal_Int8* pData = aData.getArray(); sal_Int8* pData = aData.getArray();
SvMemoryStream aMemStream( pData, aData.getLength(), STREAM_READ ); SvMemoryStream aMemStream( pData, aData.getLength(), STREAM_READ );
@@ -2035,40 +2035,40 @@ public:
:mpLib( pLib ) {} :mpLib( pLib ) {}
// Methods XElementAccess // Methods XElementAccess
virtual Type SAL_CALL getElementType() virtual uno::Type SAL_CALL getElementType()
throw(RuntimeException); throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements() virtual sal_Bool SAL_CALL hasElements()
throw(RuntimeException); throw(uno::RuntimeException);
// Methods XNameAccess // Methods XNameAccess
virtual Any SAL_CALL getByName( const ::rtl::OUString& aName ) virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException); throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames() virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
throw(RuntimeException); throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
throw(RuntimeException); throw(uno::RuntimeException);
// Methods XNameReplace // Methods XNameReplace
virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const Any& aElement ) virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException); throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
// Methods XNameContainer // Methods XNameContainer
virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const Any& aElement ) virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException); throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException); throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
}; };
// Methods XElementAccess // Methods XElementAccess
Type DialogContainer_Impl::getElementType() uno::Type DialogContainer_Impl::getElementType()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
Type aModuleType = ::getCppuType( (const Reference< XStarBasicDialogInfo > *)0 ); uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicDialogInfo > *)0 );
return aModuleType; return aModuleType;
} }
sal_Bool DialogContainer_Impl::hasElements() sal_Bool DialogContainer_Impl::hasElements()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
@@ -2087,31 +2087,31 @@ sal_Bool DialogContainer_Impl::hasElements()
} }
// Methods XNameAccess // Methods XNameAccess
Any DialogContainer_Impl::getByName( const ::rtl::OUString& aName ) uno::Any DialogContainer_Impl::getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ); SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
if( !( pVar && pVar->ISA( SbxObject ) && if( !( pVar && pVar->ISA( SbxObject ) &&
( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) ) ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) )
{ {
throw NoSuchElementException(); throw container::NoSuchElementException();
} }
Reference< XStarBasicDialogInfo > xDialog = uno::Reference< script::XStarBasicDialogInfo > xDialog =
(XStarBasicDialogInfo*)new DialogInfo_Impl (XStarBasicDialogInfo*)new DialogInfo_Impl
( aName, implGetDialogData( (SbxObject*)pVar ) ); ( aName, implGetDialogData( (SbxObject*)pVar ) );
Any aRetAny; uno::Any aRetAny;
aRetAny <<= xDialog; aRetAny <<= xDialog;
return aRetAny; return aRetAny;
} }
Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames() uno::Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
mpLib->GetAll( SbxCLASS_OBJECT ); mpLib->GetAll( SbxCLASS_OBJECT );
sal_Int16 nCount = mpLib->GetObjects()->Count(); sal_Int16 nCount = mpLib->GetObjects()->Count();
Sequence< ::rtl::OUString > aRetSeq( nCount ); uno::Sequence< ::rtl::OUString > aRetSeq( nCount );
::rtl::OUString* pRetSeq = aRetSeq.getArray(); ::rtl::OUString* pRetSeq = aRetSeq.getArray();
sal_Int32 nDialogCounter = 0; sal_Int32 nDialogCounter = 0;
@@ -2129,7 +2129,7 @@ Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames()
} }
sal_Bool DialogContainer_Impl::hasByName( const ::rtl::OUString& aName ) sal_Bool DialogContainer_Impl::hasByName( const ::rtl::OUString& aName )
throw(RuntimeException) throw(uno::RuntimeException)
{ {
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE ); SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
@@ -2143,8 +2143,8 @@ sal_Bool DialogContainer_Impl::hasByName( const ::rtl::OUString& aName )
// Methods XNameReplace // Methods XNameReplace
void DialogContainer_Impl::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) void DialogContainer_Impl::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
removeByName( aName ); removeByName( aName );
insertByName( aName, aElement ); insertByName( aName, aElement );
@@ -2152,29 +2152,29 @@ void DialogContainer_Impl::replaceByName( const ::rtl::OUString& aName, const An
// Methods XNameContainer // Methods XNameContainer
void DialogContainer_Impl::insertByName( const ::rtl::OUString& aName, const Any& aElement ) void DialogContainer_Impl::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{ {
(void)aName; (void)aName;
Type aModuleType = ::getCppuType( (const Reference< XStarBasicDialogInfo > *)0 ); uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicDialogInfo > *)0 );
Type aAnyType = aElement.getValueType(); uno::Type aAnyType = aElement.getValueType();
if( aModuleType != aAnyType ) if( aModuleType != aAnyType )
throw IllegalArgumentException(); throw lang::IllegalArgumentException();
Reference< XStarBasicDialogInfo > xMod; uno::Reference< script::XStarBasicDialogInfo > xMod;
aElement >>= xMod; aElement >>= xMod;
SbxObjectRef xDialog = implCreateDialog( xMod->getData() ); SbxObjectRef xDialog = implCreateDialog( xMod->getData() );
mpLib->Insert( xDialog ); mpLib->Insert( xDialog );
} }
void DialogContainer_Impl::removeByName( const ::rtl::OUString& Name ) void DialogContainer_Impl::removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
(void)Name; (void)Name;
SbxVariable* pVar = mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE ); SbxVariable* pVar = mpLib->GetObjects()->Find( Name, SbxCLASS_DONTCARE );
if( !( pVar && pVar->ISA( SbxObject ) && if( !( pVar && pVar->ISA( SbxObject ) &&
( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) ) ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) ) )
{ {
throw NoSuchElementException(); throw container::NoSuchElementException();
} }
mpLib->Remove( pVar ); mpLib->Remove( pVar );
} }
@@ -2192,41 +2192,41 @@ public:
:mpMgr( pMgr ) {} :mpMgr( pMgr ) {}
// Methods XElementAccess // Methods XElementAccess
virtual Type SAL_CALL getElementType() virtual uno::Type SAL_CALL getElementType()
throw(RuntimeException); throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements() virtual sal_Bool SAL_CALL hasElements()
throw(RuntimeException); throw(uno::RuntimeException);
// Methods XNameAccess // Methods XNameAccess
virtual Any SAL_CALL getByName( const ::rtl::OUString& aName ) virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException); throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
virtual Sequence< ::rtl::OUString > SAL_CALL getElementNames() virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
throw(RuntimeException); throw(uno::RuntimeException);
virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
throw(RuntimeException); throw(uno::RuntimeException);
// Methods XNameReplace // Methods XNameReplace
virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const Any& aElement ) virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException); throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
// Methods XNameContainer // Methods XNameContainer
virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const Any& aElement ) virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException); throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException); throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
}; };
// Methods XElementAccess // Methods XElementAccess
Type LibraryContainer_Impl::getElementType() uno::Type LibraryContainer_Impl::getElementType()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
Type aType = ::getCppuType( (const Reference< XStarBasicLibraryInfo > *)0 ); uno::Type aType = ::getCppuType( (const uno::Reference< script::XStarBasicLibraryInfo > *)0 );
return aType; return aType;
} }
sal_Bool LibraryContainer_Impl::hasElements() sal_Bool LibraryContainer_Impl::hasElements()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
sal_Int32 nLibs = mpMgr->GetLibCount(); sal_Int32 nLibs = mpMgr->GetLibCount();
sal_Bool bRet = (nLibs > 0); sal_Bool bRet = (nLibs > 0);
@@ -2234,19 +2234,19 @@ sal_Bool LibraryContainer_Impl::hasElements()
} }
// Methods XNameAccess // Methods XNameAccess
Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName ) uno::Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName )
throw(NoSuchElementException, WrappedTargetException, RuntimeException) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
Any aRetAny; uno::Any aRetAny;
if( !mpMgr->HasLib( aName ) ) if( !mpMgr->HasLib( aName ) )
throw NoSuchElementException(); throw container::NoSuchElementException();
StarBASIC* pLib = mpMgr->GetLib( aName ); StarBASIC* pLib = mpMgr->GetLib( aName );
Reference< XNameContainer > xModuleContainer = uno::Reference< container::XNameContainer > xModuleContainer =
(XNameContainer*)new ModuleContainer_Impl( pLib ); (container::XNameContainer*)new ModuleContainer_Impl( pLib );
Reference< XNameContainer > xDialogContainer = uno::Reference< container::XNameContainer > xDialogContainer =
(XNameContainer*)new DialogContainer_Impl( pLib ); (container::XNameContainer*)new DialogContainer_Impl( pLib );
BasicLibInfo* pLibInfo = mpMgr->FindLibInfo( pLib ); BasicLibInfo* pLibInfo = mpMgr->FindLibInfo( pLib );
@@ -2260,7 +2260,7 @@ Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName )
else if( pLibInfo->IsExtern() ) else if( pLibInfo->IsExtern() )
aExternaleSourceURL = pLibInfo->GetStorageName(); aExternaleSourceURL = pLibInfo->GetStorageName();
Reference< XStarBasicLibraryInfo > xLibInfo = new LibraryInfo_Impl uno::Reference< script::XStarBasicLibraryInfo > xLibInfo = new LibraryInfo_Impl
( (
aName, aName,
xModuleContainer, xModuleContainer,
@@ -2274,11 +2274,11 @@ Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName )
return aRetAny; return aRetAny;
} }
Sequence< ::rtl::OUString > LibraryContainer_Impl::getElementNames() uno::Sequence< ::rtl::OUString > LibraryContainer_Impl::getElementNames()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
sal_uInt16 nLibs = mpMgr->GetLibCount(); sal_uInt16 nLibs = mpMgr->GetLibCount();
Sequence< ::rtl::OUString > aRetSeq( nLibs ); uno::Sequence< ::rtl::OUString > aRetSeq( nLibs );
::rtl::OUString* pRetSeq = aRetSeq.getArray(); ::rtl::OUString* pRetSeq = aRetSeq.getArray();
for( sal_uInt16 i = 0 ; i < nLibs ; i++ ) for( sal_uInt16 i = 0 ; i < nLibs ; i++ )
{ {
@@ -2288,23 +2288,23 @@ Sequence< ::rtl::OUString > LibraryContainer_Impl::getElementNames()
} }
sal_Bool LibraryContainer_Impl::hasByName( const ::rtl::OUString& aName ) sal_Bool LibraryContainer_Impl::hasByName( const ::rtl::OUString& aName )
throw(RuntimeException) throw(uno::RuntimeException)
{ {
sal_Bool bRet = mpMgr->HasLib( aName ); sal_Bool bRet = mpMgr->HasLib( aName );
return bRet; return bRet;
} }
// Methods XNameReplace // Methods XNameReplace
void LibraryContainer_Impl::replaceByName( const ::rtl::OUString& aName, const Any& aElement ) void LibraryContainer_Impl::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException) throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
removeByName( aName ); removeByName( aName );
insertByName( aName, aElement ); insertByName( aName, aElement );
} }
// Methods XNameContainer // Methods XNameContainer
void LibraryContainer_Impl::insertByName( const ::rtl::OUString& aName, const Any& aElement ) void LibraryContainer_Impl::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{ {
(void)aName; (void)aName;
(void)aElement; (void)aElement;
@@ -2312,51 +2312,49 @@ void LibraryContainer_Impl::insertByName( const ::rtl::OUString& aName, const An
} }
void LibraryContainer_Impl::removeByName( const ::rtl::OUString& Name ) void LibraryContainer_Impl::removeByName( const ::rtl::OUString& Name )
throw(NoSuchElementException, WrappedTargetException, RuntimeException) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{ {
StarBASIC* pLib = mpMgr->GetLib( Name ); StarBASIC* pLib = mpMgr->GetLib( Name );
if( !pLib ) if( !pLib )
throw NoSuchElementException(); throw container::NoSuchElementException();
sal_uInt16 nLibId = mpMgr->GetLibId( Name ); sal_uInt16 nLibId = mpMgr->GetLibId( Name );
mpMgr->RemoveLib( nLibId ); mpMgr->RemoveLib( nLibId );
} }
//===================================================================== //=====================================================================
typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; typedef WeakImplHelper1< script::XStarBasicAccess > StarBasicAccessHelper;
class StarBasicAccess_Impl : public StarBasicAccessHelper class StarBasicAccess_Impl : public StarBasicAccessHelper
{ {
BasicManager* mpMgr; BasicManager* mpMgr;
Reference< XNameContainer > mxLibContainer; uno::Reference< container::XNameContainer > mxLibContainer;
public: public:
StarBasicAccess_Impl( BasicManager* pMgr ) StarBasicAccess_Impl( BasicManager* pMgr )
:mpMgr( pMgr ) {} :mpMgr( pMgr ) {}
public: public:
// Methods // Methods
virtual Reference< XNameContainer > SAL_CALL getLibraryContainer() virtual uno::Reference< container::XNameContainer > SAL_CALL getLibraryContainer()
throw(RuntimeException); throw(uno::RuntimeException);
virtual void SAL_CALL createLibrary( const ::rtl::OUString& LibName, const ::rtl::OUString& Password, virtual void SAL_CALL createLibrary( const ::rtl::OUString& LibName, const ::rtl::OUString& Password,
const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& LinkTargetURL ) const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& LinkTargetURL )
throw(ElementExistException, RuntimeException); throw(container::ElementExistException, uno::RuntimeException);
virtual void SAL_CALL addModule( const ::rtl::OUString& LibraryName, const ::rtl::OUString& ModuleName, virtual void SAL_CALL addModule( const ::rtl::OUString& LibraryName, const ::rtl::OUString& ModuleName,
const ::rtl::OUString& Language, const ::rtl::OUString& Source ) const ::rtl::OUString& Language, const ::rtl::OUString& Source )
throw(NoSuchElementException, RuntimeException); throw(container::NoSuchElementException, uno::RuntimeException);
virtual void SAL_CALL addDialog( const ::rtl::OUString& LibraryName, const ::rtl::OUString& DialogName, virtual void SAL_CALL addDialog( const ::rtl::OUString& LibraryName, const ::rtl::OUString& DialogName,
const Sequence< sal_Int8 >& Data ) const uno::Sequence< sal_Int8 >& Data )
throw(NoSuchElementException, RuntimeException); throw(container::NoSuchElementException, uno::RuntimeException);
}; };
Reference< XNameContainer > SAL_CALL StarBasicAccess_Impl::getLibraryContainer() uno::Reference< container::XNameContainer > SAL_CALL StarBasicAccess_Impl::getLibraryContainer()
throw(RuntimeException) throw(uno::RuntimeException)
{ {
if( !mxLibContainer.is() ) if( !mxLibContainer.is() )
mxLibContainer = (XNameContainer*)new LibraryContainer_Impl( mpMgr ); mxLibContainer = (container::XNameContainer*)new LibraryContainer_Impl( mpMgr );
return mxLibContainer; return mxLibContainer;
} }
@@ -2367,7 +2365,7 @@ void SAL_CALL StarBasicAccess_Impl::createLibrary
const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& ExternalSourceURL,
const ::rtl::OUString& LinkTargetURL const ::rtl::OUString& LinkTargetURL
) )
throw(ElementExistException, RuntimeException) throw(container::ElementExistException, uno::RuntimeException)
{ {
(void)ExternalSourceURL; (void)ExternalSourceURL;
#ifdef DBG_UTIL #ifdef DBG_UTIL
@@ -2384,7 +2382,7 @@ void SAL_CALL StarBasicAccess_Impl::addModule
const ::rtl::OUString& Language, const ::rtl::OUString& Language,
const ::rtl::OUString& Source const ::rtl::OUString& Source
) )
throw(NoSuchElementException, RuntimeException) throw(container::NoSuchElementException, uno::RuntimeException)
{ {
(void)Language; (void)Language;
StarBASIC* pLib = mpMgr->GetLib( LibraryName ); StarBASIC* pLib = mpMgr->GetLib( LibraryName );
@@ -2397,9 +2395,9 @@ void SAL_CALL StarBasicAccess_Impl::addDialog
( (
const ::rtl::OUString& LibraryName, const ::rtl::OUString& LibraryName,
const ::rtl::OUString& DialogName, const ::rtl::OUString& DialogName,
const Sequence< sal_Int8 >& Data const uno::Sequence< sal_Int8 >& Data
) )
throw(NoSuchElementException, RuntimeException) throw(container::NoSuchElementException, uno::RuntimeException)
{ {
(void)LibraryName; (void)LibraryName;
(void)DialogName; (void)DialogName;
@@ -2407,9 +2405,9 @@ void SAL_CALL StarBasicAccess_Impl::addDialog
} }
// Basic XML Import/Export // Basic XML Import/Export
Reference< XStarBasicAccess > getStarBasicAccess( BasicManager* pMgr ) uno::Reference< script::XStarBasicAccess > getStarBasicAccess( BasicManager* pMgr )
{ {
Reference< XStarBasicAccess > xRet = uno::Reference< script::XStarBasicAccess > xRet =
new StarBasicAccess_Impl( (BasicManager*)pMgr ); new StarBasicAccess_Impl( (BasicManager*)pMgr );
return xRet; return xRet;
} }

View File

@@ -53,21 +53,13 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess3.hpp> #include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/script/XErrorQuery.hpp> #include <com/sun/star/script/XErrorQuery.hpp>
#include <ooo/vba/XHelperInterface.hpp> #include <ooo/vba/XHelperInterface.hpp>
#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp> #include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
using namespace comphelper; using namespace comphelper;
using namespace osl; using namespace osl;
using namespace com::sun::star::uno; using namespace com::sun::star;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::io;
using namespace com::sun::star::script;
using namespace com::sun::star::frame;
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
@@ -115,7 +107,7 @@ SbxVariable* getDefaultProp( SbxVariable* pRef );
bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet );
// from source/classes/sbxmod.cxx // from source/classes/sbxmod.cxx
Reference< XModel > getDocumentModel( StarBASIC* ); uno::Reference< frame::XModel > getDocumentModel( StarBASIC* );
static void FilterWhiteSpace( String& rStr ) static void FilterWhiteSpace( String& rStr )
{ {
@@ -142,7 +134,7 @@ static long GetDayDiff( const Date& rDate );
static const CharClass& GetCharClass( void ) static const CharClass& GetCharClass( void )
{ {
static bool bNeedsInit = true; static bool bNeedsInit = true;
static ::com::sun::star::lang::Locale aLocale; static lang::Locale aLocale;
if( bNeedsInit ) if( bNeedsInit )
{ {
bNeedsInit = false; bNeedsInit = false;
@@ -179,16 +171,16 @@ String getFullPath( const String& aRelPath )
} }
// TODO: -> SbiGlobals // TODO: -> SbiGlobals
static com::sun::star::uno::Reference< XSimpleFileAccess3 > getFileAccess( void ) static uno::Reference< ucb::XSimpleFileAccess3 > getFileAccess( void )
{ {
static com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI; static uno::Reference< ucb::XSimpleFileAccess3 > xSFI;
if( !xSFI.is() ) if( !xSFI.is() )
{ {
com::sun::star::uno::Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory();
if( xSMgr.is() ) if( xSMgr.is() )
{ {
xSFI = com::sun::star::uno::Reference< XSimpleFileAccess3 >( xSMgr->createInstance xSFI = uno::Reference< ucb::XSimpleFileAccess3 >( xSMgr->createInstance
( ::rtl::OUString("com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY ); ( ::rtl::OUString("com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY );
} }
} }
return xSFI; return xSFI;
@@ -260,7 +252,7 @@ RTLFUNC(Error)
// ( complicated isn't it ? ) // ( complicated isn't it ? )
if ( bVBA && rPar.Count() > 1 ) if ( bVBA && rPar.Count() > 1 )
{ {
com::sun::star::uno::Reference< ooo::vba::XErrObject > xErrObj( SbxErrObject::getUnoErrObject() ); uno::Reference< ooo::vba::XErrObject > xErrObj( SbxErrObject::getUnoErrObject() );
if ( xErrObj.is() && xErrObj->getNumber() == nCode && !xErrObj->getDescription().isEmpty() ) if ( xErrObj.is() && xErrObj->getNumber() == nCode && !xErrObj->getDescription().isEmpty() )
tmpErrMsg = xErrObj->getDescription(); tmpErrMsg = xErrObj->getDescription();
} }
@@ -501,7 +493,7 @@ RTLFUNC(ChDrive)
// Implementation of StepRENAME with UCB // Implementation of StepRENAME with UCB
void implStepRenameUCB( const String& aSource, const String& aDest ) void implStepRenameUCB( const String& aSource, const String& aDest )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -548,7 +540,7 @@ RTLFUNC(FileCopy)
String aDest = rPar.Get(2)->GetString(); String aDest = rPar.Get(2)->GetString();
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -586,7 +578,7 @@ RTLFUNC(Kill)
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
String aFullPath = getFullPath( aFileSpec ); String aFullPath = getFullPath( aFileSpec );
@@ -626,7 +618,7 @@ RTLFUNC(MkDir)
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -717,7 +709,7 @@ RTLFUNC(RmDir)
String aPath = rPar.Get(1)->GetString(); String aPath = rPar.Get(1)->GetString();
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -796,7 +788,7 @@ RTLFUNC(FileLen)
sal_Int32 nLen = 0; sal_Int32 nLen = 0;
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -1555,12 +1547,12 @@ RTLFUNC(StrComp)
::utl::TransliterationWrapper* pTransliterationWrapper = GetSbData()->pTransliterationWrapper; ::utl::TransliterationWrapper* pTransliterationWrapper = GetSbData()->pTransliterationWrapper;
if( !pTransliterationWrapper ) if( !pTransliterationWrapper )
{ {
com::sun::star::uno::Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory();
pTransliterationWrapper = GetSbData()->pTransliterationWrapper = pTransliterationWrapper = GetSbData()->pTransliterationWrapper =
new ::utl::TransliterationWrapper( xSMgr, new ::utl::TransliterationWrapper( xSMgr,
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE | i18n::TransliterationModules_IGNORE_CASE |
::com::sun::star::i18n::TransliterationModules_IGNORE_KANA | i18n::TransliterationModules_IGNORE_KANA |
::com::sun::star::i18n::TransliterationModules_IGNORE_WIDTH ); i18n::TransliterationModules_IGNORE_WIDTH );
} }
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
@@ -1841,7 +1833,7 @@ RTLFUNC(DateValue)
if( !bSuccess && ( eLangType != LANGUAGE_ENGLISH_US ) ) if( !bSuccess && ( eLangType != LANGUAGE_ENGLISH_US ) )
{ {
// Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value; // Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > uno::Reference< lang::XMultiServiceFactory >
xFactory = comphelper::getProcessServiceFactory(); xFactory = comphelper::getProcessServiceFactory();
SvNumberFormatter aFormatter( xFactory, LANGUAGE_ENGLISH_US ); SvNumberFormatter aFormatter( xFactory, LANGUAGE_ENGLISH_US );
bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, fResult ); bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, fResult );
@@ -2274,9 +2266,9 @@ RTLFUNC(IsError)
if ( SbxBase* pBaseObj = pVar->GetObject() ) if ( SbxBase* pBaseObj = pVar->GetObject() )
pObj = PTR_CAST(SbUnoObject, pBaseObj ); pObj = PTR_CAST(SbUnoObject, pBaseObj );
} }
Reference< XErrorQuery > xError; uno::Reference< script::XErrorQuery > xError;
if ( pObj ) if ( pObj )
xError.set( pObj->getUnoAny(), UNO_QUERY ); xError.set( pObj->getUnoAny(), uno::UNO_QUERY );
if ( xError.is() ) if ( xError.is() )
rPar.Get( 0 )->PutBool( xError->hasError() ); rPar.Get( 0 )->PutBool( xError->hasError() );
else else
@@ -2455,7 +2447,7 @@ RTLFUNC(Dir)
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
if ( nParCount >= 2 ) if ( nParCount >= 2 )
@@ -2733,7 +2725,7 @@ RTLFUNC(GetAttr)
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -2801,12 +2793,12 @@ RTLFUNC(FileDateTime)
Date aDate( Date::EMPTY ); Date aDate( Date::EMPTY );
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
{ {
com::sun::star::util::DateTime aUnoDT = xSFI->getDateTimeModified( aPath ); util::DateTime aUnoDT = xSFI->getDateTimeModified( aPath );
aTime = Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.HundredthSeconds ); aTime = Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.HundredthSeconds );
aDate = Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ); aDate = Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year );
} }
@@ -3353,21 +3345,21 @@ String getObjectTypeName( SbxVariable* pVar )
// we need to get detect the vba-ness of the object in some // we need to get detect the vba-ness of the object in some
// other way // other way
// note: Automation objects do not support XServiceInfo // note: Automation objects do not support XServiceInfo
Reference< XServiceInfo > xServInfo( aObj, UNO_QUERY ); uno::Reference< XServiceInfo > xServInfo( aObj, uno::UNO_QUERY );
if ( xServInfo.is() ) if ( xServInfo.is() )
{ {
// is this a VBA object ? // is this a VBA object ?
Reference< ooo::vba::XHelperInterface > xVBA( aObj, UNO_QUERY ); uno::Reference< ooo::vba::XHelperInterface > xVBA( aObj, uno::UNO_QUERY );
Sequence< rtl::OUString > sServices = xServInfo->getSupportedServiceNames(); Sequence< rtl::OUString > sServices = xServInfo->getSupportedServiceNames();
if ( sServices.getLength() ) if ( sServices.getLength() )
sRet = sServices[ 0 ]; sRet = sServices[ 0 ];
} }
else else
{ {
Reference< com::sun::star::bridge::oleautomation::XAutomationObject > xAutoMation( aObj, UNO_QUERY ); uno::Reference< bridge::oleautomation::XAutomationObject > xAutoMation( aObj, uno::UNO_QUERY );
if ( xAutoMation.is() ) if ( xAutoMation.is() )
{ {
Reference< XInvocation > xInv( aObj, UNO_QUERY ); uno::Reference< script::XInvocation > xInv( aObj, uno::UNO_QUERY );
if ( xInv.is() ) if ( xInv.is() )
{ {
try try
@@ -3775,26 +3767,26 @@ RTLFUNC(StrConv)
aOldStr = rCharClass.titlecase( aOldStr.ToLowerAscii(), 0, nOldLen ); aOldStr = rCharClass.titlecase( aOldStr.ToLowerAscii(), 0, nOldLen );
} }
else if ( (nConversion & 0x01) == 1 ) // vbUpperCase else if ( (nConversion & 0x01) == 1 ) // vbUpperCase
nType |= ::com::sun::star::i18n::TransliterationModules_LOWERCASE_UPPERCASE; nType |= i18n::TransliterationModules_LOWERCASE_UPPERCASE;
else if ( (nConversion & 0x02) == 2 ) // vbLowerCase else if ( (nConversion & 0x02) == 2 ) // vbLowerCase
nType |= ::com::sun::star::i18n::TransliterationModules_UPPERCASE_LOWERCASE; nType |= i18n::TransliterationModules_UPPERCASE_LOWERCASE;
if ( (nConversion & 0x04) == 4 ) // vbWide if ( (nConversion & 0x04) == 4 ) // vbWide
nType |= ::com::sun::star::i18n::TransliterationModules_HALFWIDTH_FULLWIDTH; nType |= i18n::TransliterationModules_HALFWIDTH_FULLWIDTH;
else if ( (nConversion & 0x08) == 8 ) // vbNarrow else if ( (nConversion & 0x08) == 8 ) // vbNarrow
nType |= ::com::sun::star::i18n::TransliterationModules_FULLWIDTH_HALFWIDTH; nType |= i18n::TransliterationModules_FULLWIDTH_HALFWIDTH;
if ( (nConversion & 0x10) == 16) // vbKatakana if ( (nConversion & 0x10) == 16) // vbKatakana
nType |= ::com::sun::star::i18n::TransliterationModules_HIRAGANA_KATAKANA; nType |= i18n::TransliterationModules_HIRAGANA_KATAKANA;
else if ( (nConversion & 0x20) == 32 ) // vbHiragana else if ( (nConversion & 0x20) == 32 ) // vbHiragana
nType |= ::com::sun::star::i18n::TransliterationModules_KATAKANA_HIRAGANA; nType |= i18n::TransliterationModules_KATAKANA_HIRAGANA;
String aNewStr( aOldStr ); String aNewStr( aOldStr );
if( nType != 0 ) if( nType != 0 )
{ {
com::sun::star::uno::Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); uno::Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory();
::utl::TransliterationWrapper aTransliterationWrapper( xSMgr,nType ); ::utl::TransliterationWrapper aTransliterationWrapper( xSMgr,nType );
com::sun::star::uno::Sequence<sal_Int32> aOffsets; uno::Sequence<sal_Int32> aOffsets;
aTransliterationWrapper.loadModuleIfNeeded( nLanguage ); aTransliterationWrapper.loadModuleIfNeeded( nLanguage );
aNewStr = aTransliterationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets ); aNewStr = aTransliterationWrapper.transliterate( aOldStr, nLanguage, 0, nOldLen, &aOffsets );
} }
@@ -4118,7 +4110,7 @@ RTLFUNC(SetAttr)
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try
@@ -4187,7 +4179,7 @@ RTLFUNC(FileExists)
if( hasUno() ) if( hasUno() )
{ {
com::sun::star::uno::Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() ) if( xSFI.is() )
{ {
try try