diff options
Diffstat (limited to 'basic')
43 files changed, 326 insertions, 235 deletions
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx index 3285c09527..2e0c1ea7df 100644 --- a/basic/inc/basic/basmgr.hxx +++ b/basic/inc/basic/basmgr.hxx @@ -32,7 +32,7 @@ #define _BASMGR_HXX #include <tools/string.hxx> -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> #include <basic/sbstar.hxx> #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp> #include <com/sun/star/script/XStarBasicAccess.hpp> @@ -231,6 +231,8 @@ public: ::com::sun::star::uno::Any SetGlobalUNOConstant( const sal_Char* _pAsciiName, const ::com::sun::star::uno::Any& _rValue ); + /** retrieves a global constant in the basic library, referring to some UNO object, returns true if a value is found ( value is in aOut ) false otherwise. */ + bool GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ); /** determines whether there are password-protected modules whose size exceedes the legacy module size @param _out_rModuleNames diff --git a/basic/inc/basic/sbdef.hxx b/basic/inc/basic/sbdef.hxx index c13cd69378..f7367c9364 100644 --- a/basic/inc/basic/sbdef.hxx +++ b/basic/inc/basic/sbdef.hxx @@ -32,7 +32,7 @@ #define _SB_SBDEF_HXX #include <basic/sbxdef.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #define _BASIC_TEXTPORTIONS diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index f71d1ff2fd..0d61e9bad6 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -74,6 +74,11 @@ class StarBASIC : public SbxObject BOOL bDocBasic; BasicLibInfo* pLibInfo; // Info block for basic manager SbLanguageMode eLanguageMode; // LanguageMode of the basic object + BOOL bQuit; + + SbxObjectRef pVBAGlobals; + SbxObject* getVBAGlobals( ); + protected: BOOL CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen ); private: @@ -196,6 +201,10 @@ public: SbxObjectRef getRTL( void ) { return pRtl; } BOOL IsDocBasic() { return bDocBasic; } + SbxVariable* VBAFind( const String& rName, SbxClassType t ); + bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ); + void QuitAndExitApplication(); + BOOL IsQuitApplication() { return bQuit; }; }; #ifndef __SB_SBSTARBASICREF_HXX diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx index 0a686e5d96..70ee8a2b7f 100644 --- a/basic/inc/basic/sbx.hxx +++ b/basic/inc/basic/sbx.hxx @@ -32,9 +32,9 @@ #define _SBXCLASS_HXX #include "tools/ref.hxx" -#include "svtools/svarray.hxx" -#include "svtools/smplhint.hxx" -#include "svtools/lstner.hxx" +#include "svl/svarray.hxx" +#include "svl/smplhint.hxx" +#include "svl/lstner.hxx" #include <basic/sbxdef.hxx> #include <basic/sbxform.hxx> diff --git a/basic/inc/basic/sbxbase.hxx b/basic/inc/basic/sbxbase.hxx index 577e509b28..e3f72c7c79 100644 --- a/basic/inc/basic/sbxbase.hxx +++ b/basic/inc/basic/sbxbase.hxx @@ -33,7 +33,7 @@ #include <i18npool/lang.h> #include "tools/list.hxx" -#include "svtools/svarray.hxx" +#include "svl/svarray.hxx" #include <basic/sbxdef.hxx> class SbxFactory; diff --git a/basic/inc/basic/sbxobj.hxx b/basic/inc/basic/sbxobj.hxx index a517b4375e..2792d6e5d4 100644 --- a/basic/inc/basic/sbxobj.hxx +++ b/basic/inc/basic/sbxobj.hxx @@ -31,7 +31,7 @@ #ifndef _SBX_SBXOBJECT_HXX #define _SBX_SBXOBJECT_HXX -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <basic/sbxvar.hxx> /////////////////////////////////////////////////////////////////////////// diff --git a/basic/inc/basic/testtool.hxx b/basic/inc/basic/testtool.hxx index a425844ce5..f8d65bce9e 100644 --- a/basic/inc/basic/testtool.hxx +++ b/basic/inc/basic/testtool.hxx @@ -30,7 +30,7 @@ #ifndef _BASIC_TESTTOOL_HXX_ #define _BASIC_TESTTOOL_HXX_ -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <tools/string.hxx> #define TESTTOOL_DEFAULT_PORT 12479 diff --git a/basic/inc/pch/precompiled_basic.hxx b/basic/inc/pch/precompiled_basic.hxx index cd10ee53f3..f1c120b261 100644 --- a/basic/inc/pch/precompiled_basic.hxx +++ b/basic/inc/pch/precompiled_basic.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -173,35 +173,35 @@ #include "sot/storage.hxx" #include "sot/storinfo.hxx" -#include "svtools/brdcst.hxx" +#include "svl/brdcst.hxx" #include "svtools/ctrlbox.hxx" #include "svtools/ctrltool.hxx" #include "svtools/ehdl.hxx" #include "svtools/filedlg.hxx" -#include "svtools/hint.hxx" -#include "svtools/lstner.hxx" -#include "svtools/pathoptions.hxx" +#include "svl/hint.hxx" +#include "svl/lstner.hxx" +#include "unotools/pathoptions.hxx" #include "svtools/sfxecode.hxx" -#include "svtools/smplhint.hxx" -#include "svtools/solar.hrc" +#include "svl/smplhint.hxx" +#include "svl/solar.hrc" #include "svtools/stringtransfer.hxx" -#include "svtools/svarray.hxx" -#include "svtools/svdde.hxx" +#include "svl/svarray.hxx" +#include "svl/svdde.hxx" #include "svtools/svmedit.hxx" -#include "svtools/svstdarr.hxx" +#include "svl/svstdarr.hxx" #include "svtools/svtdata.hxx" -#include "svtools/svtools.hrc" +#include "svl/svtools.hrc" #include "svtools/svtreebx.hxx" -#include "svtools/syslocale.hxx" +#include "unotools/syslocale.hxx" #include "svtools/taskbar.hxx" #include "svtools/textdata.hxx" #include "svtools/texteng.hxx" #include "svtools/textview.hxx" #include "svtools/transfer.hxx" #include "svtools/txtattr.hxx" -#include "svtools/undo.hxx" -#include "svtools/zforlist.hxx" -#include "svtools/zformat.hxx" +#include "svl/undo.hxx" +#include "svl/zforlist.hxx" +#include "svl/zformat.hxx" #include "tools/color.hxx" diff --git a/basic/inc/sb.hrc b/basic/inc/sb.hrc index be03905eb0..6caf7ade5c 100644 --- a/basic/inc/sb.hrc +++ b/basic/inc/sb.hrc @@ -31,7 +31,7 @@ #ifndef _SB_HRC #define _SB_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #ifndef IDS_SBERR_START #define IDS_SBERR_START RID_BASIC_START diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index 00a7877fcf..9c7f457ad4 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -80,7 +80,7 @@ #include <com/sun/star/ucb/XContentProviderManager.hpp> #include <ucbhelper/content.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> using namespace comphelper; using namespace cppu; diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx index f348689773..b30b7261c2 100644 --- a/basic/source/app/app.hxx +++ b/basic/source/app/app.hxx @@ -42,8 +42,8 @@ #include <vcl/wrkwin.hxx> #endif #include <vcl/timer.hxx> -#include <svtools/brdcst.hxx> -#include <svtools/lstner.hxx> +#include <svl/brdcst.hxx> +#include <svl/lstner.hxx> class BasicFrame; #include <basic/mybasic.hxx> diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx index 122aa9c7a1..b2e3942d36 100644 --- a/basic/source/app/appedit.cxx +++ b/basic/source/app/appedit.cxx @@ -34,7 +34,7 @@ #include <svtools/ctrltool.hxx> #include <svtools/textview.hxx> #include <svtools/texteng.hxx> -#include <svtools/undo.hxx> +#include <svl/undo.hxx> #ifndef _BASIC_TTRESHLP_HXX #include <basic/ttstrhlp.hxx> diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx index fa770f985f..2fc7baffe1 100644 --- a/basic/source/app/dialogs.cxx +++ b/basic/source/app/dialogs.cxx @@ -60,13 +60,13 @@ #include <svtools/stringtransfer.hxx> #include <vcl/splitwin.hxx> #ifndef _ZFORLIST_HXX //autogen -#include <svtools/zformat.hxx> +#include <svl/zformat.hxx> #endif #include <svtools/ctrltool.hxx> // Ohne Includeschutz #include <svtools/svtdata.hxx> -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #include <basic/dispdefs.hxx> diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx index 1ef046170d..beabe69afe 100644 --- a/basic/source/app/msgedit.cxx +++ b/basic/source/app/msgedit.cxx @@ -48,7 +48,7 @@ Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8 #endif #include <tools/fsys.hxx> #include <svtools/stringtransfer.hxx> -#include <svtools/syslocale.hxx> +#include <unotools/syslocale.hxx> #ifndef _BASIC_TTRESHLP_HXX #include <basic/ttstrhlp.hxx> #endif diff --git a/basic/source/app/textedit.hxx b/basic/source/app/textedit.hxx index 19efd764c2..d31d013e36 100644 --- a/basic/source/app/textedit.hxx +++ b/basic/source/app/textedit.hxx @@ -40,7 +40,7 @@ class BreakpointWindow; #include <vcl/timer.hxx> #include <tools/table.hxx> #include <tools/debug.hxx> -#include <svtools/lstner.hxx> +#include <svl/lstner.hxx> #include <svtools/svmedit.hxx> #include "dataedit.hxx" diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 3c4980e266..3a0be2efa4 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,8 +44,8 @@ /** === end UNO includes === **/ #include <svtools/ehdl.hxx> #include <svtools/sfxecode.hxx> -#include <svtools/pathoptions.hxx> -#include <svtools/smplhint.hxx> +#include <unotools/pathoptions.hxx> +#include <svl/smplhint.hxx> #include <vcl/svapp.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 9c690f1c8d..196965e2ef 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -33,20 +33,21 @@ #include <tools/stream.hxx> #include <sot/storage.hxx> #include <tools/urlobj.hxx> -#include <svtools/smplhint.hxx> +#include <svl/smplhint.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <vcl/wrkwin.hxx> #include <vcl/msgbox.hxx> #include <basic/sbx.hxx> #include <sot/storinfo.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <basic/sbmod.hxx> #include <basic/sbuno.hxx> #include <basic/basmgr.hxx> +#include <sbunoobj.hxx> #include "basrid.hxx" #include "sbintern.hxx" #include <sb.hrc> @@ -1767,6 +1768,15 @@ BasicError* BasicManager::GetNextError() DBG_CHKTHIS( BasicManager, 0 ); return pErrorMgr->GetNextError(); } +bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ) +{ + bool bRes = false; + StarBASIC* pStandardLib = GetStdLib(); + OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" ); + if ( pStandardLib ) + bRes = pStandardLib->GetUNOConstant( _pAsciiName, aOut ); + return bRes; +} Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const Any& _rValue ) { diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 7776b57829..b0c8f4b3c3 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -95,53 +95,48 @@ Any sbxToUnoValue( SbxVariable* pVar ); Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic ) { - Reference< frame::XModel > xModel; - - SbxObject* basicChosen = pBasic; - - if ( basicChosen == NULL) + OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" ); + if ( !pBasic ) + return NULL; + + // look for the ThisComponent variable, first in the parent (which + // might be the document's Basic), then in the parent's parent (which might be + // the application Basic) + const ::rtl::OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) ); + SbxVariable* pThisComponent = NULL; + + SbxObject* pLookup = pBasic->GetParent(); + while ( pLookup && !pThisComponent ) { - OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" ); - return xModel; + pThisComponent = pLookup->Find( sThisComponent, SbxCLASS_OBJECT ); + pLookup = pLookup->GetParent(); } - SbxObject* p = pBasic; - SbxObject* pParent = p->GetParent(); - SbxObject* pParentParent = pParent ? pParent->GetParent() : NULL; - - if( pParentParent ) + if ( !pThisComponent ) { - basicChosen = pParentParent; + OSL_TRACE("Failed to get ThisComponent"); + // the application Basic, at the latest, should have this variable + return NULL; } - else if( pParent ) + + Any aThisComponent( sbxToUnoValue( pThisComponent ) ); + Reference< frame::XModel > xModel( aThisComponent, UNO_QUERY ); + if ( !xModel.is() ) { - basicChosen = pParent; + // it's no XModel. Okay, ThisComponent nowadays is allowed to be a controller. + Reference< frame::XController > xController( aThisComponent, UNO_QUERY ); + if ( xController.is() ) + xModel = xController->getModel(); } + if ( !xModel.is() ) + return NULL; - Any aModel; - SbxVariable *pCompVar = basicChosen->Find( UniString(RTL_CONSTASCII_USTRINGPARAM("ThisComponent")), SbxCLASS_OBJECT ); +#if OSL_DEBUG_LEVEL > 0 + OSL_TRACE("Have model ThisComponent points to url %s", + ::rtl::OUStringToOString( xModel->getURL(), + RTL_TEXTENCODING_ASCII_US ).pData->buffer ); +#endif - if ( pCompVar ) - { - aModel = sbxToUnoValue( pCompVar ); - if ( sal_False == ( aModel >>= xModel ) || - !xModel.is() ) - { - OSL_TRACE("Failed to extract model from thisComponent "); - return xModel; - } - else - { - OSL_TRACE("Have model ThisComponent points to url %s", - ::rtl::OUStringToOString( xModel->getURL(), - RTL_TEXTENCODING_ASCII_US ).pData->buffer ); - - } - } - else - { - OSL_TRACE("Failed to get ThisComponent"); - } return xModel; } diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index aed5b2b3c5..f54cdc800d 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -35,7 +35,7 @@ #include <tools/urlobj.hxx> #include <tools/errcode.hxx> -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <basic/sbstar.hxx> #include <sbunoobj.hxx> diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 6b22b4f280..a217ebc49c 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -65,7 +65,29 @@ SV_IMPL_VARARR(SbTextPortions,SbTextPortion) TYPEINIT1(StarBASIC,SbxObject) #define RTLNAME "@SBRTL" +// i#i68894# +const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); +const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); + +SbxObject* StarBASIC::getVBAGlobals( ) +{ + if ( !pVBAGlobals ) + pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE ); + return pVBAGlobals; +} + +// i#i68894# +SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t ) +{ + if( rName == aThisComponent ) + return NULL; + // rename to init globals + if ( getVBAGlobals( ) ) + return pVBAGlobals->Find( rName, t ); + return NULL; + +} // Create array for conversion SFX <-> VB error code struct SFX_VB_ErrorItem { @@ -303,32 +325,32 @@ SbxObject* SbTypeFactory::cloneTypeObjectImpl( const SbxObject& rTypeObj ) if( pProp ) { SbxProperty* pNewProp = new SbxProperty( *pProp ); - if( pVar->GetType() & SbxARRAY )
- {
- SbxBase* pParObj = pVar->GetObject();
- SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
- SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
- INT32 lb = 0;
- INT32 ub = 0;
-
- pDest->setHasFixedSize( pSource->hasFixedSize() );
- if ( pSource->GetDims() && pSource->hasFixedSize() )
- {
- for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
- {
- pSource->GetDim32( (INT32)j, lb, ub );
- pDest->AddDim32( lb, ub );
- }
- }
- else
- pDest->unoAddDim( 0, -1 ); // variant array
-
- USHORT nSavFlags = pVar->GetFlags();
- pNewProp->ResetFlag( SBX_FIXED );
- // need to reset the FIXED flag
- // when calling PutObject ( because the type will not match Object )
- pNewProp->PutObject( pDest );
- pNewProp->SetFlags( nSavFlags );
+ if( pVar->GetType() & SbxARRAY ) + { + SbxBase* pParObj = pVar->GetObject(); + SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj); + SbxDimArray* pDest = new SbxDimArray( pVar->GetType() ); + INT32 lb = 0; + INT32 ub = 0; + + pDest->setHasFixedSize( pSource->hasFixedSize() ); + if ( pSource->GetDims() && pSource->hasFixedSize() ) + { + for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j ) + { + pSource->GetDim32( (INT32)j, lb, ub ); + pDest->AddDim32( lb, ub ); + } + } + else + pDest->unoAddDim( 0, -1 ); // variant array + + USHORT nSavFlags = pVar->GetFlags(); + pNewProp->ResetFlag( SBX_FIXED ); + // need to reset the FIXED flag + // when calling PutObject ( because the type will not match Object ) + pNewProp->PutObject( pDest ); + pNewProp->SetFlags( nSavFlags ); } pProps->PutDirect( pNewProp, i ); } @@ -445,8 +467,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbProcedureProperty* pNewProp = new SbProcedureProperty ( pProcedureProp->GetName(), pProcedureProp->GetType() ); // ( pProcedureProp->GetName(), pProcedureProp->GetType(), this ); - pNewProp->SetFlags( nFlags_ ); // Copy flags
- pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set
+ pNewProp->SetFlags( nFlags_ ); // Copy flags + pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set pProcedureProp->SetFlags( nFlags_ ); pProps->PutDirect( pNewProp, i ); StartListening( pNewProp->GetBroadcaster(), TRUE ); @@ -681,6 +703,8 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this ); // Search via StarBasic is always global SetFlag( SBX_GBLSEARCH ); + pVBAGlobals = NULL; + bQuit = FALSE; } // #51727 Override SetModified so that the modified state @@ -995,6 +1019,12 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy return pVar; } +void StarBASIC::QuitAndExitApplication() +{ + Stop(); + bQuit = TRUE; +} + void StarBASIC::Stop() { SbiInstance* p = pINST; @@ -1533,6 +1563,18 @@ BOOL StarBASIC::LoadOldModules( SvStream& ) return FALSE; } +bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ) +{ + bool bRes = false; + ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) ); + SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( sVarName, SbxCLASS_DONTCARE ) ); + if ( pGlobs ) + { + aOut = pGlobs->getUnoAny(); + bRes = true; + } + return bRes; +} //======================================================================== // #118116 Implementation Collection object diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 8ee3df992e..06c29a5f2d 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -36,7 +36,7 @@ #ifndef _TOOLERR_HXX //autogen #include <tools/errcode.hxx> #endif -#include <svtools/hint.hxx> +#include <svl/hint.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -750,11 +750,11 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) // SbUnoObject instanzieren String aName; SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue ); - //If this is called externally e.g. from the scripting
- //framework then there is no 'active' runtime the default property will not be set up
- //only a vba object will have XDefaultProp set anyway so... this
- //test seems a bit of overkill
- //if ( SbiRuntime::isVBAEnabled() )
+ //If this is called externally e.g. from the scripting + //framework then there is no 'active' runtime the default property will not be set up + //only a vba object will have XDefaultProp set anyway so... this + //test seems a bit of overkill + //if ( SbiRuntime::isVBAEnabled() ) { String sDfltPropName; @@ -3377,9 +3377,10 @@ SbxVariable* SbUnoService::Find( const String& rName, SbxClassType ) // Create and insert SbUnoServiceCtor SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor ); QuickInsert( (SbxVariable*)xSbCtorRef ); - pRes = xSbCtorRef; } } + + pRes = SbxObject::Find( rName, SbxCLASS_METHOD ); } } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 21b31020f9..bbb529b733 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -36,7 +36,7 @@ #include <vos/macros.hxx> #include <vcl/svapp.hxx> #include <tools/stream.hxx> -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> #include <tools/shl.hxx> #include <basic/sbx.hxx> #include "sb.hxx" @@ -69,6 +69,11 @@ #endif #include <stdio.h> +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <comphelper/processfactory.hxx> +#include <vcl/svapp.hxx> + using namespace ::com::sun::star; TYPEINIT1(SbModule,SbxObject) @@ -84,7 +89,63 @@ SV_IMPL_VARARR(SbiBreakpoints,USHORT) SV_IMPL_VARARR(HighlightPortions, HighlightPortion) +class AsyncQuitHandler +{ + AsyncQuitHandler() {} + AsyncQuitHandler( const AsyncQuitHandler&); +public: + static AsyncQuitHandler& instance() + { + static AsyncQuitHandler dInst; + return dInst; + } + void QuitApplication() + { + uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + if ( xFactory.is() ) + { + uno::Reference< frame::XDesktop > xDeskTop( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop") ) ), uno::UNO_QUERY ); + if ( xDeskTop.is() ) + xDeskTop->terminate(); + } + } + DECL_LINK( OnAsyncQuit, void* ); +}; + +IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ ) +{ + QuitApplication(); + return 0L; +} + +#if 0 +bool UnlockControllerHack( StarBASIC* pBasic ) +{ + bool bRes = false; + if ( pBasic && pBasic->IsDocBasic() ) + { + uno::Any aUnoVar; + ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( "ThisComponent" ) ); + SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( pBasic->Find( sVarName, SbxCLASS_DONTCARE ) ); + if ( pGlobs ) + aUnoVar = pGlobs->getUnoAny(); + uno::Reference< frame::XModel > xModel( aUnoVar, uno::UNO_QUERY); + if ( xModel.is() ) + { + try + { + xModel->unlockControllers(); + bRes = true; + } + catch( uno::Exception& ) + { + } + } + } + return bRes; +} +#endif ///////////////////////////////////////////////////////////////////////////// // Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen @@ -696,6 +757,13 @@ USHORT SbModule::Run( SbMethod* pMeth ) pINST->nCallLvl--; // Call-Level wieder runter StarBASIC::FatalError( SbERR_STACK_OVERFLOW ); } + + // VBA always ensure screenupdating is enabled after completing + StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent()); +#if 0 + if ( pBasic && pBasic->IsDocBasic() && !pINST ) + UnlockControllerHack( pBasic ); +#endif if( bDelInst ) { // #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden, @@ -705,6 +773,11 @@ USHORT SbModule::Run( SbMethod* pMeth ) delete pINST; pINST = NULL; } + if ( pBasic && pBasic->IsDocBasic() && pBasic->IsQuitApplication() && !pINST ) + { + Application::PostUserEvent( LINK( &AsyncQuitHandler::instance(), AsyncQuitHandler, OnAsyncQuit ), NULL ); + } + return nRes; } diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 1b45d28502..a3ead5e305 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -83,7 +83,7 @@ void SbiCodeGen::GenStmnt() UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode ) { -#ifndef PRODUCT +#ifdef DBG_UTIL if( eOpcode < SbOP0_START || eOpcode > SbOP0_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE1" ); #endif @@ -94,7 +94,7 @@ UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode ) UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd ) { -#ifndef PRODUCT +#ifdef DBG_UTIL if( eOpcode < SbOP1_START || eOpcode > SbOP1_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE2" ); #endif @@ -107,7 +107,7 @@ UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd ) UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd1, UINT32 nOpnd2 ) { -#ifndef PRODUCT +#ifdef DBG_UTIL if( eOpcode < SbOP2_START || eOpcode > SbOP2_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE3" ); #endif diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index 9afcf5262f..5da3c41b73 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -170,7 +170,7 @@ void SbiExprNode::Gen( RecursiveMode eRecMode ) void SbiExprNode::GenElement( SbiOpcode eOp ) { -#ifndef PRODUCT +#ifdef DBG_UTIL if( (eOp < _RTL || eOp > _CALLC) && eOp != _FIND_G && eOp != _FIND_CM ) pGen->GetParser()->Error( SbERR_INTERNAL_ERROR, "Opcode" ); #endif diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 2156756164..1d34698104 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -175,7 +175,7 @@ void SbiSymPool::Add( SbiSymDef* pDef ) { if( pDef->pIn ) { -#ifndef PRODUCT +#ifdef DBG_UTIL // schon in einem anderen Pool drin! pParser->Error( SbERR_INTERNAL_ERROR, "Dbl Pool" ); #endif diff --git a/basic/source/inc/propacc.hxx b/basic/source/inc/propacc.hxx index 663060638b..c6517459aa 100644 --- a/basic/source/inc/propacc.hxx +++ b/basic/source/inc/propacc.hxx @@ -30,7 +30,7 @@ #ifndef _SFX_PROPBAG_HXX #define _SFX_PROPBAG_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HXX_ #include <com/sun/star/beans/PropertyValue.hpp> #endif diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx index 8b19aa6da6..e2510b0272 100644 --- a/basic/source/inc/symtbl.hxx +++ b/basic/source/inc/symtbl.hxx @@ -31,7 +31,7 @@ #ifndef _SYMTBL_HXX #define _SYMTBL_HXX -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #include <tools/string.hxx> #include <basic/sbxdef.hxx> #include <basic/sbdef.hxx> diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx index 51a1aa00b0..6933957799 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -33,7 +33,7 @@ #include <tools/shl.hxx> #include <vcl/svapp.hxx> #ifndef _SOLAR_HRC -#include <svtools/solar.hrc> +#include <svl/solar.hrc> #endif #include <tools/debug.hxx> #include <vcl/msgbox.hxx> diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index 3a88477b5b..10a74a6748 100644 --- a/basic/source/runtime/ddectrl.cxx +++ b/basic/source/runtime/ddectrl.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basic.hxx" #include <tools/errcode.hxx> -#include <svtools/svdde.hxx> +#include <svl/svdde.hxx> #include "ddectrl.hxx" #ifndef _SBERRORS_HXX #include <basic/sberrors.hxx> diff --git a/basic/source/runtime/dllmgr.hxx b/basic/source/runtime/dllmgr.hxx index 9cd003e858..f8689ddd10 100644 --- a/basic/source/runtime/dllmgr.hxx +++ b/basic/source/runtime/dllmgr.hxx @@ -32,9 +32,9 @@ #define _DLLMGR_HXX #define _SVSTDARR_BYTESTRINGSSORT -#include <svtools/svarray.hxx> +#include <svl/svarray.hxx> #ifndef _SVSTDARR_HXX //autogen -#include <svtools/svstdarr.hxx> +#include <svl/svstdarr.hxx> #endif // !!! nur zum debuggen fuer infoboxes !!! diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 5c1bae13ab..6621e6c3f0 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -43,7 +43,7 @@ #include <vcl/wintypes.hxx> #include <vcl/msgbox.hxx> #include <basic/sbx.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <rtl/math.hxx> #include <tools/urlobj.hxx> #include <osl/time.h> diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 08a94feefc..3f2b72af39 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -44,7 +44,7 @@ #ifndef _SBX_HXX #include <basic/sbx.hxx> #endif -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <tools/fsys.hxx> #include <tools/urlobj.hxx> #include <osl/file.hxx> diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 87f88ea9e6..a7cf7277c0 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -33,8 +33,8 @@ #include <tools/fsys.hxx> #include <vcl/svapp.hxx> #include <tools/wldcrd.hxx> -#include <svtools/zforlist.hxx> -#include <svtools/syslocale.hxx> +#include <svl/zforlist.hxx> +#include <unotools/syslocale.hxx> #include "runtime.hxx" #include "sbintern.hxx" #include "opcodes.hxx" @@ -867,7 +867,7 @@ void SbiRuntime::PushVar( SbxVariable* pVar ) SbxVariableRef SbiRuntime::PopVar() { -#ifndef PRODUCT +#ifdef DBG_UTIL if( !nExprLvl ) { StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); @@ -902,7 +902,7 @@ BOOL SbiRuntime::ClearExprStack() SbxVariable* SbiRuntime::GetTOS( short n ) { n = nExprLvl - n - 1; -#ifndef PRODUCT +#ifdef DBG_UTIL if( n < 0 ) { StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx index 1f0914dca0..f7c1086304 100644 --- a/basic/source/runtime/step1.cxx +++ b/basic/source/runtime/step1.cxx @@ -160,7 +160,7 @@ void SbiRuntime::StepPAD( UINT32 nOp1 ) void SbiRuntime::StepJUMP( UINT32 nOp1 ) { -#ifndef PRODUCT +#ifdef DBG_UTIL // #QUESTION shouln't this be // if( (BYTE*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() ) if( nOp1 >= pImg->GetCodeSize() ) diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index 2589207ac9..dbc8712063 100644 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -56,57 +56,6 @@ using com::sun::star::uno::Reference; SbxVariable* getVBAConstant( const String& rName ); -const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); -const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); -// i#i68894# -SbxArray* getVBAGlobals( ) -{ - static SbxArrayRef pArray; - static bool isInitialised = false; - if ( isInitialised ) - return pArray; - Reference < XComponentContext > xCtx; - Reference < XPropertySet > xProps( - ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); - xCtx.set( xProps->getPropertyValue( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), - UNO_QUERY_THROW ); - SbUnoObject dGlobs( String( RTL_CONSTASCII_USTRINGPARAM("ExcelGlobals") ), xCtx->getValueByName( ::rtl::OUString::createFromAscii( "/singletons/ooo.vba.theGlobals") ) ); - - SbxVariable *vba = dGlobs.Find( String( RTL_CONSTASCII_USTRINGPARAM("getGlobals") ) , SbxCLASS_DONTCARE ); - - if ( vba ) - { - pArray = static_cast<SbxArray *>(vba->GetObject()); - isInitialised = true; - return pArray; - } - return NULL; -} - -// i#i68894# -SbxVariable* VBAFind( const String& rName, SbxClassType t ) -{ - if( rName == aThisComponent ) - return NULL; - - SbxArray *pVBAGlobals = getVBAGlobals( ); - for (USHORT i = 0; pVBAGlobals && i < pVBAGlobals->Count(); i++) - { - SbxVariable *pElem = pVBAGlobals->Get( i ); - if (!pElem || !pElem->IsObject()) - continue; - SbxObject *pVba = static_cast<SbxObject *>(pElem->GetObject()); - SbxVariable *pVbaVar = pVba ? pVba->Find( rName, t ) : NULL; - if( pVbaVar ) - { - return pVbaVar; - } - } - return NULL; - -} - // Suchen eines Elements // Die Bits im String-ID: // 0x8000 - Argv ist belegt @@ -191,7 +140,7 @@ SbxVariable* SbiRuntime::FindElement if ( bVBAEnabled ) { // Try Find in VBA symbols space - pElem = VBAFind( aName, SbxCLASS_DONTCARE ); + pElem = rBasic.VBAFind( aName, SbxCLASS_DONTCARE ); if ( pElem ) bSetName = false; // don't overwrite uno name else diff --git a/basic/source/sbx/format.src b/basic/source/sbx/format.src index dde88272eb..afdd3f8522 100644 --- a/basic/source/sbx/format.src +++ b/basic/source/sbx/format.src @@ -28,7 +28,7 @@ * ************************************************************************/ -#include "svtools/svtools.hrc" +#include "svl/svtools.hrc" String STR_BASICKEY_FORMAT_ON { diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index efa5daef97..cdfeb2dd3c 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basic.hxx" #include <vcl/svapp.hxx> -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <tools/errcode.hxx> #include <tools/color.hxx> #include <i18npool/lang.h> diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 7f8584d889..e977456814 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -35,7 +35,7 @@ #include <basic/sbx.hxx> #include <basic/sbxbase.hxx> #include "sbxres.hxx" -#include <svtools/brdcst.hxx> +#include <svl/brdcst.hxx> TYPEINIT1(SbxMethod,SbxVariable) TYPEINIT1(SbxProperty,SbxVariable) diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 07a3012b60..041e14b983 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -34,7 +34,7 @@ #include <basic/sbx.hxx> #include "sbxconv.hxx" -#include "svtools/syslocale.hxx" +#include "unotools/syslocale.hxx" #if defined ( UNX ) #include <stdlib.h> @@ -50,12 +50,12 @@ #include "sbxres.hxx" #include <basic/sbxbase.hxx> #include <basic/sbxform.hxx> -#include <svtools/svtools.hrc> +#include <svl/svtools.hrc> #include "basrid.hxx" #include "runtime.hxx" -#include <svtools/zforlist.hxx> +#include <svl/zforlist.hxx> #include <comphelper/processfactory.hxx> diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 1ecd20cc2b..b391023c20 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -33,7 +33,7 @@ #include <tools/stream.hxx> -#include "svtools/brdcst.hxx" +#include "svl/brdcst.hxx" #include <basic/sbx.hxx> #include <basic/sbxbase.hxx> diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index ba67d5bfa5..2ed3a5ca1f 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,7 +51,7 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <xmlscript/xmldlg_imexp.hxx> #include <cppuhelper/factory.hxx> #include <svtools/sfxecode.hxx> @@ -104,7 +104,7 @@ SfxLibrary* SfxDialogLibraryContainer::implCreateLibrary( const ::rtl::OUString& } SfxLibrary* SfxDialogLibraryContainer::implCreateLibraryLink - ( const ::rtl::OUString& aName, const OUString& aLibInfoFileURL, + ( const ::rtl::OUString& aName, const OUString& aLibInfoFileURL, const OUString& StorageURL, sal_Bool ReadOnly ) { SfxLibrary* pRet = new SfxDialogLibrary @@ -144,7 +144,7 @@ bool writeOasis2OOoLibraryElement( { return FALSE; } - + Reference< xml::sax::XParser > xParser( xSMgr->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -166,7 +166,7 @@ bool writeOasis2OOoLibraryElement( { return FALSE; } - + Sequence<Any> aArgs( 1 ); aArgs[0] <<= xWriter; @@ -178,20 +178,20 @@ bool writeOasis2OOoLibraryElement( UNO_QUERY ); xParser->setDocumentHandler( xHandler ); - + xml::sax::InputSource source; source.aInputStream = xInput; source.sSystemId = OUString::createFromAscii( "virtual file" ); - + xParser->parseStream( source ); return TRUE; } void SAL_CALL SfxDialogLibraryContainer::writeLibraryElement -( +( Any aElement, - const OUString& /*aElementName*/, + const OUString& /*aElementName*/, Reference< XOutputStream > xOutput ) throw(Exception) @@ -319,9 +319,9 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement InputSource source; source.aInputStream = xInput; source.sSystemId = aFile; - + try { - // start parsing + // start parsing xParser->setDocumentHandler( ::xmlscript::importDialogModel( xDialogModel, xContext ) ); xParser->parseStream( source ); } @@ -356,7 +356,7 @@ static OUString aResourceFileNameBase = OUString::createFromAscii( "DialogString static OUString aResourceFileCommentBase = OUString::createFromAscii( "# Strings for Dialog Library " ); // Resource handling -Reference< ::com::sun::star::resource::XStringResourcePersistence > +Reference< ::com::sun::star::resource::XStringResourcePersistence > SfxDialogLibraryContainer::implCreateStringResource( SfxDialogLibrary* pDialogLibrary ) { Reference< resource::XStringResourcePersistence > xRet; @@ -528,7 +528,7 @@ OUString SfxDialogLibraryContainer::getImplementationName_static() Reference< XInterface > SAL_CALL SfxDialogLibraryContainer::Create( const Reference< XComponentContext >& ) throw( Exception ) { - Reference< XInterface > xRet = + Reference< XInterface > xRet = static_cast< XInterface* >( static_cast< OWeakObject* >(new SfxDialogLibraryContainer()) ); return xRet; } @@ -540,8 +540,8 @@ Reference< XInterface > SAL_CALL SfxDialogLibraryContainer::Create( const Refere // Ctor SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable, const ::rtl::OUString& aName, - const Reference< XMultiServiceFactory >& xMSF, - const Reference< XSimpleFileAccess >& xSFI, + const Reference< XMultiServiceFactory >& xMSF, + const Reference< XSimpleFileAccess >& xSFI, SfxDialogLibraryContainer* pParent ) : SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ), xMSF, xSFI ) , m_pParent( pParent ) @@ -551,10 +551,10 @@ SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable, SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable, const ::rtl::OUString& aName, - const Reference< XMultiServiceFactory >& xMSF, - const Reference< XSimpleFileAccess >& xSFI, - const OUString& aLibInfoFileURL, - const OUString& aStorageURL, + const Reference< XMultiServiceFactory >& xMSF, + const Reference< XSimpleFileAccess >& xSFI, + const OUString& aLibInfoFileURL, + const OUString& aStorageURL, sal_Bool ReadOnly, SfxDialogLibraryContainer* pParent ) : SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ), @@ -603,7 +603,7 @@ void SfxDialogLibrary::storeResourcesAsURL } } -void SfxDialogLibrary::storeResourcesToURL( const OUString& URL, +void SfxDialogLibrary::storeResourcesToURL( const OUString& URL, const Reference< task::XInteractionHandler >& xHandler ) { OUString aComment = aResourceFileCommentBase; @@ -631,7 +631,7 @@ void SfxDialogLibrary::storeResourcesToStorage( const ::com::sun::star::uno::Ref // XStringResourceSupplier -Reference< resource::XStringResourceResolver > +Reference< resource::XStringResourceResolver > SAL_CALL SfxDialogLibrary::getStringResource( ) throw (RuntimeException) { if( !m_xStringResourcePersistence.is() ) diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index c15d937f9b..71d1dc9e55 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ #include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <unotools/streamwrap.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <basic/basmgr.hxx> @@ -101,7 +101,7 @@ using namespace osl; using com::sun::star::uno::Reference; -// #i34411: Flag for error handling during migration +// #i34411: Flag for error handling during migration static bool GbMigrationSuppressErrors = false; //============================================================================ @@ -940,7 +940,17 @@ sal_Bool SfxLibraryContainer::init_Impl( // #110009 if( !bStorage && meInitMode == DEFAULT ) - implScanExtensions(); + { + try + { + implScanExtensions(); + } + catch( uno::Exception& ) + { + // TODO: error handling? + OSL_ASSERT( "Cannot access extensions!" ); + } + } // #110009 Preload? { @@ -1271,28 +1281,28 @@ SfxLibrary* SfxLibraryContainer::getImplLib( const String& rLibraryName ) // Storing with password encryption // Empty implementation, avoids unneccesary implementation in dlgcont.cxx -sal_Bool SfxLibraryContainer::implStorePasswordLibrary( +sal_Bool SfxLibraryContainer::implStorePasswordLibrary( SfxLibrary*, - const OUString&, + const OUString&, const uno::Reference< embed::XStorage >&, const uno::Reference< task::XInteractionHandler >& ) { return sal_False; } -sal_Bool SfxLibraryContainer::implStorePasswordLibrary( - SfxLibrary* /*pLib*/, - const ::rtl::OUString& /*aName*/, +sal_Bool SfxLibraryContainer::implStorePasswordLibrary( + SfxLibrary* /*pLib*/, + const ::rtl::OUString& /*aName*/, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& /*xStorage*/, - const ::rtl::OUString& /*aTargetURL*/, + const ::rtl::OUString& /*aTargetURL*/, const Reference< XSimpleFileAccess > /*xToUseSFI*/, const uno::Reference< task::XInteractionHandler >& ) { return sal_False; } -sal_Bool SfxLibraryContainer::implLoadPasswordLibrary( - SfxLibrary* /*pLib*/, - const OUString& /*Name*/, +sal_Bool SfxLibraryContainer::implLoadPasswordLibrary( + SfxLibrary* /*pLib*/, + const OUString& /*Name*/, sal_Bool /*bVerifyPasswordOnly*/ ) throw(WrappedTargetException, RuntimeException) { @@ -2000,7 +2010,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto Reference< XActiveDataSource > xSource( xHandler, UNO_QUERY ); xSource->setOutputStream( xOut ); - try + try { xmlscript::exportLibraryContainer( xHandler, pLibArray ); if ( bStorage ) @@ -2602,7 +2612,7 @@ sal_Bool SAL_CALL SfxLibraryContainer::verifyLibraryPassword throw IllegalArgumentException(); } -void SAL_CALL SfxLibraryContainer::changeLibraryPassword( +void SAL_CALL SfxLibraryContainer::changeLibraryPassword( const OUString&, const OUString&, const OUString& ) throw (IllegalArgumentException, NoSuchElementException, RuntimeException) { @@ -2627,8 +2637,8 @@ void SAL_CALL SfxLibraryContainer::removeContainerListener( const Reference< XCo } // Methods XLibraryContainerExport -void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OUString& URL, - const Reference< XInteractionHandler >& Handler ) +void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OUString& URL, + const Reference< XInteractionHandler >& Handler ) throw ( uno::Exception, NoSuchElementException, RuntimeException) { LibraryContainerMethodGuard aGuard( *this ); @@ -3051,7 +3061,7 @@ rtl::OUString ScriptExtensionIterator::nextBasicOrDialogLibrary( bool& rbPureDia case SHARED_EXTENSIONS: { - Reference< deployment::XPackage > xScriptPackage = + Reference< deployment::XPackage > xScriptPackage = implGetNextSharedScriptPackage( rbPureDialogLib ); if( !xScriptPackage.is() ) break; diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 2d7d8e8fc2..c744e6bc2f 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -58,7 +58,7 @@ #include <tools/urlobj.hxx> -#include <svtools/pathoptions.hxx> +#include <unotools/pathoptions.hxx> #include <svtools/sfxecode.hxx> #include <svtools/ehdl.hxx> #include <basic/basmgr.hxx> @@ -162,7 +162,7 @@ SfxLibrary* SfxScriptLibraryContainer::implCreateLibrary( const OUString& aName } SfxLibrary* SfxScriptLibraryContainer::implCreateLibraryLink - ( const OUString& aName, const OUString& aLibInfoFileURL, + ( const OUString& aName, const OUString& aLibInfoFileURL, const OUString& StorageURL, sal_Bool ReadOnly ) { (void)aName; // Only needed for SfxDialogLibrary @@ -495,7 +495,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, return implStorePasswordLibrary( pLib, aName, xStorage, aDummyLocation, xDummySFA, xHandler ); } -sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, const ::rtl::OUString& aName, +sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& aTargetURL, const Reference< XSimpleFileAccess > xToUseSFI, const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ) { @@ -506,7 +506,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, if ( !pBasicMgr ) return sal_False; - // Only need to handle the export case here, + // Only need to handle the export case here, // save/saveas etc are handled in sfxbasemodel::storeSelf & // sfxbasemodel::impl_store uno::Sequence<rtl::OUString> aNames; @@ -516,7 +516,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, { ModuleSizeExceeded* pReq = new ModuleSizeExceeded( aNames ); uno::Reference< task::XInteractionRequest > xReq( pReq ); - xHandler->handle( xReq ); + xHandler->handle( xReq ); if ( pReq->isAbort() ) throw util::VetoException(); } @@ -1136,7 +1136,7 @@ void SfxScriptLibrary::storeResources( void ) // No resources } -void SfxScriptLibrary::storeResourcesToURL( const ::rtl::OUString& URL, +void SfxScriptLibrary::storeResourcesToURL( const ::rtl::OUString& URL, const Reference< task::XInteractionHandler >& Handler ) { (void)URL; |