diff options
author | Andreas Bregas <ab@openoffice.org> | 2010-02-08 10:03:32 +0100 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2010-02-08 10:03:32 +0100 |
commit | 98667ff62f37ab02e6d3add532c976b9ae2a6bbd (patch) | |
tree | 87aed18a33c743643fbe728a7de34a5e937ff268 /basic | |
parent | 10a6f8b96a40912b0e89705570806de3aca41e3e (diff) | |
parent | 3c550e9f7bdd8c9f1f75f4148f516ddc94290f92 (diff) |
ab76: merge with DEV300_m71
Diffstat (limited to 'basic')
46 files changed, 299 insertions, 296 deletions
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx index 277bf6b9c34e..29f2d7ebc25c 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 dbb6e703b0c6..f15391e227d1 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 3ec0803eb4a9..1278972135f9 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 ce2e992da854..87aacbcab44f 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 dc7707cce57d..c8cd59ba320f 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 6a62f4a52978..bd3bb8333b54 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 1cdb42fd042c..64645e05ba55 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 32b4fd480afb..f1c120b2618f 100644 --- a/basic/inc/pch/precompiled_basic.hxx +++ b/basic/inc/pch/precompiled_basic.hxx @@ -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 6275ad19c996..89db04cef511 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 4743b8c0ddca..4cc2765604fd 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; @@ -1401,19 +1401,10 @@ long BasicFrame::Command( short nID, BOOL bChecked ) // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); break; case RID_FILEPRINT: -#ifndef UNX if( pWork ) pPrn->Print( pWork->GetText(), pWork->pDataEdit->GetText(), this ); -#else - InfoBox( this, SttResId( IDS_NOPRINTERERROR ) ).Execute(); -#endif break; case RID_FILESETUP: -#ifndef UNX - pPrn->Setup(); -#else - InfoBox( this, SttResId( IDS_NOPRINTERERROR ) ).Execute(); -#endif break; case RID_QUIT: if( Close() ) aBasicApp.Quit(); diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx index 4fc9e9cb9c07..68b3db186785 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 a9b7b1d03b77..31e4192e5965 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 8c4df4186f41..00eba2fbac6c 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/makefile.mk b/basic/source/app/makefile.mk index 13c3b4a8b507..3a52f402b329 100644 --- a/basic/source/app/makefile.mk +++ b/basic/source/app/makefile.mk @@ -61,6 +61,7 @@ OBJFILES = \ EXCEPTIONSFILES = \ $(OBJ)$/app.obj \ + $(OBJ)$/printer.obj \ $(OBJ)$/process.obj .IF "$(GUI)" == "WNT" diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx index 7d0755d39aa6..544d7c9f4d4d 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/printer.cxx b/basic/source/app/printer.cxx index 6f173fd53ffa..61879d628d39 100644 --- a/basic/source/app/printer.cxx +++ b/basic/source/app/printer.cxx @@ -64,35 +64,32 @@ public: void ChangeMessage( short ); }; -BasicPrinter::BasicPrinter() : Printer() +BasicPrinter::BasicPrinter() : mpPrinter( new Printer() ) { nPage = 0; nLine = 9999; - SetMapMode( MapMode( MAP_POINT ) ); - Size s( GetOutputSize() ); + mpPrinter->SetMapMode( MapMode( MAP_POINT ) ); + Size s( mpPrinter->GetOutputSize() ); // Use 10 point font Font aFont( FAMILY_MODERN, Size( 0, 10 ) ); aFont.SetPitch( PITCH_FIXED ); - SetFont( aFont ); + mpPrinter->SetFont( aFont ); // Output: 6 Lines/Inch = 12 Point nLines = (short) s.Height() / 12; nYoff = 12; - SetStartPrintHdl( LINK( this, BasicPrinter, StartPrintHdl ) ); - SetEndPrintHdl( LINK( this, BasicPrinter, EndPrintHdl ) ); - SetPrintPageHdl( LINK( this, BasicPrinter, PrintPageHdl ) ); } void BasicPrinter::Header() { - if( nPage ) EndPage(); + if( nPage ) mpListener->EndPage(); nPage++; - StartPage(); + mpListener->StartPage(); String aHdr; String aPage( SttResId( IDS_PAGE ) ); aPage.Append( String::CreateFromInt32(nPage) ); aHdr = aFile.Copy( 0, 80 - aPage.Len() ); aHdr.Expand( 80 - aPage.Len(), ' ' ); aHdr += aPage; - DrawText( Point( 0, 0 ), aHdr ); + mpPrinter->DrawText( Point( 0, 0 ), aHdr ); nLine = 2; } @@ -100,98 +97,29 @@ void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame * { nPage = 0; nLine = 9999; aFile = rFile; - // Setup dialog - SttResId aResId( IDD_PRINT_DIALOG ); - pDlg = new PrintingDialog - ( aBasicApp.pFrame, this, aResId, aFile ); - // Set position of dialog - Size s1 = aBasicApp.pFrame->GetSizePixel(); - Size s2 = pDlg->GetSizePixel(); - pDlg->SetPosPixel( Point( (s1.Width() - s2.Width() ) / 2, - (s1.Height()- s2.Height() ) / 2 ) ); // Disable PRINT-Menu MenuBar* pBar = pFrame->GetMenuBar(); Menu* pFileMenu = pBar->GetPopupMenu( RID_APPFILE ); pFileMenu->EnableItem( RID_FILEPRINT, FALSE ); - pDlg->ChangeMessage( 1 ); - pDlg->Show(); - StartJob( rFile ); - StartPage(); + mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) ); + mpListener->StartPage(); xub_StrLen nDone=0; while( nDone < rText.Len() ) { if( nLine >= nLines ) Header(); xub_StrLen nLineEnd = std::min( rText.Search( '\n', nDone ), rText.Search( '\r', nDone ) ); - DrawText( Point( 0, nLine * nYoff ), rText, nDone, nLineEnd-nDone-1 ); + mpPrinter->DrawText( Point( 0, nLine * nYoff ), rText, nDone, nLineEnd-nDone-1 ); nDone = nLineEnd; if( nDone <= rText.Len() && rText.GetChar(nDone) == '\r' ) nDone++; if( nDone <= rText.Len() && rText.GetChar(nDone) == '\n' ) nDone++; nLine++; - Application::Reschedule(); } - EndPage(); - EndJob(); + mpListener->EndPage(); + + Printer::PrintJob( mpListener, mpPrinter->GetJobSetup() ); nPage = 1; - while( IsPrinting() ) Application::Reschedule(); - delete pDlg; pDlg = NULL; pFileMenu->EnableItem( RID_FILEPRINT, TRUE ); } -IMPL_LINK_INLINE_START( BasicPrinter, StartPrintHdl, Printer *, pPrinter ) -{ - (void) pPrinter; /* avoid warning about unused parameter */ - if( pDlg != NULL ) - pDlg->Show(); - return 0; -} -IMPL_LINK_INLINE_END( BasicPrinter, StartPrintHdl, Printer *, pPrinter ) - -IMPL_LINK_INLINE_START( BasicPrinter, EndPrintHdl, Printer *, pPrinter ) -{ - (void) pPrinter; /* avoid warning about unused parameter */ - if( pDlg != NULL) - pDlg->Hide(); - return 0; -} -IMPL_LINK_INLINE_END( BasicPrinter, EndPrintHdl, Printer *, pPrinter ) - -IMPL_LINK_INLINE_START( BasicPrinter, PrintPageHdl, Printer *, pPrinter ) -{ - (void) pPrinter; /* avoid warning about unused parameter */ - if( pDlg != NULL) - pDlg->ChangeMessage( nPage ); - return 0; -} -IMPL_LINK_INLINE_END( BasicPrinter, PrintPageHdl, Printer *, pPrinter ) - -IMPL_LINK_INLINE( BasicPrinter, Abort , void *, EMPTYARG, -{ - AbortJob(); - return 0L; -} -) - -///////////////////////////////////////////////////////////////////////// - -PrintingDialog::PrintingDialog - ( Window* pParent, BasicPrinter* pPrn, ResId& rId, String& rName ) -: ModelessDialog( pParent, rId ) -, aName ( rName ) -, aText ( this, ResId( RID_TEXT, *rId.GetResMgr() ) ) -, aCancel( this, ResId( RID_CANCEL, *rId.GetResMgr() ) ) -{ - FreeResource(); - aCancel.SetClickHdl( LINK( pPrn, BasicPrinter, Abort ) ); -} - -void PrintingDialog::ChangeMessage( short nPage ) -{ - String aMsg( SttResId( IDS_PRINTMSG ) ); - aMsg += aName; - aMsg += CUniString("\n"); - aMsg += String( SttResId( IDS_PAGE ) ); - aMsg += String::CreateFromInt32( nPage ); - aText.SetText( aMsg ); -} diff --git a/basic/source/app/printer.hxx b/basic/source/app/printer.hxx index d6db8154c57f..26b89b5278fe 100644 --- a/basic/source/app/printer.hxx +++ b/basic/source/app/printer.hxx @@ -31,31 +31,25 @@ #ifndef _BASICPRN_HXX #define _BASICPRN_HXX -#ifndef _PRINT_HXX //autogen -#include <vcl/print.hxx> -#endif +#include "vcl/print.hxx" +#include "vcl/oldprintadaptor.hxx" -class PrintingDialog; +class BasicPrinter +{ + boost::shared_ptr<Printer> mpPrinter; + boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener; -class BasicPrinter : public Printer { short nLine; // aktuelle Zeile short nPage; // aktuelle Seite short nLines; // Zeilen pro Seite short nYoff; // Zeilenabstand in Points String aFile; // Dateiname - PrintingDialog* pDlg; // Druck-Dialog + void Header(); // Seitenkopf drucken + void StartPage(); public: BasicPrinter(); void Print( const String& rFile, const String& rText, BasicFrame *pFrame ); - DECL_LINK( Abort, void * ); - DECL_LINK( StartPrintHdl, Printer * ); - DECL_LINK( EndPrintHdl, Printer * ); - DECL_LINK( PrintPageHdl, Printer * ); -#if defined( PM20 ) - // StarView-Bug, bald wieder zu entfernen: - virtual void SetPageQueueSize( USHORT ) {} -#endif }; #endif diff --git a/basic/source/app/textedit.hxx b/basic/source/app/textedit.hxx index 1598d4867140..5caf90d738d7 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 17bd8a712763..3a0be2efa41c 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -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 8cf8a674ec2f..0645bfb85c2a 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 7776b57829c9..b0c8f4b3c36c 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 aed5b2b3c575..f54cdc800d38 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 af056b884826..80fa3c6bb836 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 08bed1019116..273f2f2c8e65 100755 --- 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> @@ -3390,9 +3390,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 2a61557457b7..393719b71c2d 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 c3e8a000cf8c..8b840770a0e6 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 c18501c98e40..32a0007a61ca 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 2eb87dcdcc52..089dc068773a 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 565c7a358a97..698b3d453d5b 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 f3d691bf059a..7221ee68252f 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 e4c9ad1fe307..a13569ee0a9f 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -32,9 +32,7 @@ #include "precompiled_basic.hxx" #include <tools/shl.hxx> #include <vcl/svapp.hxx> -#ifndef _SOLAR_HRC -#include <svtools/solar.hrc> -#endif +#include <svl/solar.hrc> #include <tools/debug.hxx> #include <vcl/msgbox.hxx> diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index 751bd57cc808..425eec2eaf85 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 607abaa843fa..ae25e570f10c 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 e92c8c974eb2..6c26409a883c 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 dbd66a61575c..bac63edb62f9 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 cc276eea766b..6c83c6e2f3f1 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 938e5f6ad236..3c461c1f5541 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 413d3a6f4def..fb0b217b76c4 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 8609bbc875b3..618b6d97a8d1 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 c6862a88a56c..76bb917699ce 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 3f747f27c5bd..bb62caba2076 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 acc5d91c4e2e..1fc3ad018b15 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 66c56adc731a..2f517c3453ca 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 f7e5f9a842e4..f199353c2d7a 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -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> diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index c397e402fac4..02a7b174da1c 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -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> @@ -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? { diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index aad4815872c0..e72205744ce0 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -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> |