diff options
34 files changed, 249 insertions, 176 deletions
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx index 277bf6b9c34e..159bd6f78de9 100644 --- a/basic/inc/basic/basmgr.hxx +++ b/basic/inc/basic/basmgr.hxx @@ -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/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/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 8cf8a674ec2f..2620852370b1 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -47,6 +47,7 @@ #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/sb.cxx b/basic/source/classes/sb.cxx index 7ff7cb76c7c5..7436c8361da9 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 { @@ -654,6 +676,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 @@ -968,6 +992,12 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy return pVar; } +void StarBASIC::QuitAndExitApplication() +{ + Stop(); + bQuit = TRUE; +} + void StarBASIC::Stop() { SbiInstance* p = pINST; @@ -1506,6 +1536,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/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 2a61557457b7..889426d68d4c 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -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,6 +89,35 @@ 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; +} ///////////////////////////////////////////////////////////////////////////// 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/oovbaapi/genconstidl/makefile.mk b/oovbaapi/genconstidl/makefile.mk index 42219545c672..95397442c208 100644 --- a/oovbaapi/genconstidl/makefile.mk +++ b/oovbaapi/genconstidl/makefile.mk @@ -54,18 +54,16 @@ MYDONEFILES += $(foreach,i,$(MYSYMFILES) $(MISC)$/$(i:b).done) ALLTAR: GENIDL -GENIDL : $(MY_GEN_IDL_PATH) $(MYDONEFILES) +GENIDL : $(MYDONEFILES) GENRDB : GENIDL $(MYURDFILES) $(MISC)$/%.done : %.api + @@-$(MKDIR) $(MY_GEN_IDL_PATH) @echo Processing $? $(PERL) api-to-idl.pl $? $(MY_GEN_IDL_PATH) @$(TOUCH) $@ -$(MY_GEN_IDL_PATH) : - @@-$(MKDIR) $@ - CLEAN : @$(RM) $(MY_GEN_IDL_PATH)$/*.idl @$(RM) $(foreach,i,$(MYSYMFILES) $(MISC)$/$(i:b).done) diff --git a/oovbaapi/ooo/vba/XCommandBar.idl b/oovbaapi/ooo/vba/XCommandBar.idl index 7bf5c9dcf675..395dafcd5567 100644 --- a/oovbaapi/ooo/vba/XCommandBar.idl +++ b/oovbaapi/ooo/vba/XCommandBar.idl @@ -54,9 +54,12 @@ interface XCommandBar [attribute] string Name; [attribute] boolean Visible; + [attribute] boolean Enabled; void Delete() raises ( com::sun::star::script::BasicErrorException ); any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException ); + long Type() raises ( com::sun::star::script::BasicErrorException ); + any FindControl( [in] any Type, [in] any Id, [in] any Tag, [in] any Visible, [in] any Recursive ) raises ( com::sun::star::script::BasicErrorException ); }; }; }; diff --git a/oovbaapi/ooo/vba/XCommandBarControl.idl b/oovbaapi/ooo/vba/XCommandBarControl.idl index 44ec75e01729..b6da3a319d7f 100644 --- a/oovbaapi/ooo/vba/XCommandBarControl.idl +++ b/oovbaapi/ooo/vba/XCommandBarControl.idl @@ -54,6 +54,8 @@ interface XCommandBarControl [attribute] string Caption; [attribute] string OnAction; [attribute] boolean Visible; + [attribute, readonly] long Type; + [attribute] boolean Enabled; void Delete() raises ( com::sun::star::script::BasicErrorException ); any Controls( [in] any Index ) raises ( com::sun::star::script::BasicErrorException ); diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl index 47628b18a7f1..de6763ab242d 100644 --- a/oovbaapi/ooo/vba/excel/XApplication.idl +++ b/oovbaapi/ooo/vba/excel/XApplication.idl @@ -42,10 +42,6 @@ #include <ooo/vba/XAssistant.idl> #endif -#ifndef __ooo_vba_XCommandBars_idl__ -#include <ooo/vba/XCommandBars.idl> -#endif - module ooo { module vba { module excel { interface XRange; @@ -56,10 +52,10 @@ interface XWorksheetFunction; interface XWindow; interface XWorksheet; -interface XApplication +interface XApplication : com::sun::star::uno::XInterface { - interface ::ooo::vba::XHelperInterface; +// interface ::ooo::vba::XHelperInterface; [attribute, readonly] any Selection; [attribute, readonly] XWorkbook ActiveWorkbook; @@ -74,14 +70,11 @@ interface XApplication // to determine this [attribute, readonly] XWorkbook ThisWorkbook; [attribute, readonly] string Name; - [attribute] boolean ScreenUpdating; - [attribute] boolean DisplayStatusBar; [attribute] boolean DisplayAlerts; [attribute] boolean DisplayFormulaBar; [attribute] any CutCopyMode; [attribute] any StatusBar; [attribute] long Cursor; - [attribute, readonly] string Version; void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException); @@ -90,7 +83,7 @@ interface XApplication string LibraryPath() raises(com::sun::star::script::BasicErrorException); string TemplatesPath() raises(com::sun::star::script::BasicErrorException); string PathSeparator() raises(com::sun::star::script::BasicErrorException); - any CommandBars( [in] any aIndex ); + //any CommandBars( [in] any aIndex ); any Workbooks( [in] any aIndex ); any Worksheets( [in] any aIndex ); any Windows( [in] any aIndex ); @@ -110,6 +103,7 @@ interface XApplication raises(com::sun::star::script::BasicErrorException); void Volatile([in] any Volatile); void DoEvents(); + any Caller( [in] any aIndex ); }; }; }; }; diff --git a/oovbaapi/ooo/vba/excel/XDialog.idl b/oovbaapi/ooo/vba/excel/XDialog.idl index 5bfb18f69baf..8c24fe038c25 100644 --- a/oovbaapi/ooo/vba/excel/XDialog.idl +++ b/oovbaapi/ooo/vba/excel/XDialog.idl @@ -45,13 +45,8 @@ module ooo { module vba { module excel { //============================================================================= -interface XApplication; - -interface XDialog +interface XDialog : com::sun::star::uno::XInterface { - interface ::ooo::vba::XHelperInterface; - - void Show(); }; }; }; }; diff --git a/oovbaapi/ooo/vba/excel/XDialogs.idl b/oovbaapi/ooo/vba/excel/XDialogs.idl index 4b4493e9d2ff..346be87b91b4 100644 --- a/oovbaapi/ooo/vba/excel/XDialogs.idl +++ b/oovbaapi/ooo/vba/excel/XDialogs.idl @@ -33,9 +33,6 @@ #ifndef __com_sun_star_uno_XInterface_idl__ #include <com/sun/star/uno/XInterface.idl> #endif -#ifndef __ooo_vba_XCollection_idl__ -#include <ooo/vba/XCollection.idl> -#endif #ifndef __ooo_vba_XHelperInterface_idl__ #include <ooo/vba/XHelperInterface.idl> @@ -44,15 +41,9 @@ //============================================================================= module ooo { module vba { module excel { -interface XApplication; -//============================================================================= -//interface XDialogs : ::ooo::vba::XCollection -interface XDialogs +interface XDialogs : com::sun::star::uno::XInterface { - interface ::ooo::vba::XHelperInterface; - - [attribute, readonly] long Count; any Item( [in] any Index ); }; diff --git a/oovbaapi/ooo/vba/excel/XFont.idl b/oovbaapi/ooo/vba/excel/XFont.idl index 038e6b43a85c..f6da47052195 100644 --- a/oovbaapi/ooo/vba/excel/XFont.idl +++ b/oovbaapi/ooo/vba/excel/XFont.idl @@ -47,22 +47,9 @@ module ooo { module vba { module excel { interface XFont { - interface ::ooo::vba::XHelperInterface; - - [attribute] any Size; [attribute] any StandardFontSize; [attribute] any StandardFont; [attribute] any FontStyle; - [attribute] any ColorIndex; - [attribute] any Color; - [attribute] any Bold; - [attribute] any Underline; - [attribute] any Strikethrough; - [attribute] any Shadow; - [attribute] any Italic; - [attribute] any Subscript; - [attribute] any Superscript; - [attribute] any Name; [attribute] any OutlineFont; }; diff --git a/oovbaapi/ooo/vba/excel/XPageSetup.idl b/oovbaapi/ooo/vba/excel/XPageSetup.idl index b847e656dadb..335040dee224 100644 --- a/oovbaapi/ooo/vba/excel/XPageSetup.idl +++ b/oovbaapi/ooo/vba/excel/XPageSetup.idl @@ -45,20 +45,15 @@ module ooo { module vba { module excel { //============================================================================= -interface XPageSetup +interface XPageSetup : com::sun::star::uno::XInterface { - interface ::ooo::vba::XHelperInterface; +// interface ::ooo::vba::XHelperInterface; //Attributes [attribute] string PrintArea; - [attribute] double TopMargin; - [attribute] double BottomMargin; - [attribute] double RightMargin; - [attribute] double LeftMargin; [attribute] double HeaderMargin; [attribute] double FooterMargin; - [attribute] long Orientation; [attribute] any FitToPagesTall; [attribute] any FitToPagesWide; [attribute] any Zoom; diff --git a/oovbaapi/ooo/vba/excel/XTextFrame.idl b/oovbaapi/ooo/vba/excel/XTextFrame.idl index e0380217e609..201bc1860660 100644 --- a/oovbaapi/ooo/vba/excel/XTextFrame.idl +++ b/oovbaapi/ooo/vba/excel/XTextFrame.idl @@ -34,21 +34,9 @@ #include <ooo/vba/XHelperInterface.idl> #endif -#ifndef __ooo_vba_excel_XCharacters_idl__ -#include <ooo/vba/excel/XCharacters.idl> -#endif - module ooo { module vba { module excel { -interface XTextFrame : ooo::vba::XHelperInterface +interface XTextFrame : com::sun::star::uno::XInterface { - [attribute] boolean AutoSize; - [attribute] float MarginBottom; - [attribute] float MarginTop; - [attribute] float MarginLeft; - [attribute] float MarginRight; - XCharacters Characters(); - /*I don't find it in msdn - Range TextRange();*/ }; }; }; }; #endif diff --git a/oovbaapi/ooo/vba/excel/XWindow.idl b/oovbaapi/ooo/vba/excel/XWindow.idl index b67810a764b3..63a8428c3491 100644 --- a/oovbaapi/ooo/vba/excel/XWindow.idl +++ b/oovbaapi/ooo/vba/excel/XWindow.idl @@ -46,10 +46,8 @@ module ooo { module vba { module excel { interface XRange; interface XWorksheet; interface XPane; -interface XWindow +interface XWindow : com::sun::star::uno::XInterface { - interface ::ooo::vba::XHelperInterface; - [attribute] any Caption; [attribute] boolean DisplayGridlines; [attribute] boolean DisplayHeadings; @@ -58,8 +56,6 @@ interface XWindow [attribute] boolean DisplayVerticalScrollBar; [attribute] boolean DisplayWorkbookTabs; [attribute] boolean FreezePanes; - [attribute] long Height; - [attribute] long Left; [attribute] boolean Split; [attribute] long SplitColumn; [attribute] double SplitHorizontal; @@ -67,10 +63,7 @@ interface XWindow [attribute] double SplitVertical; [attribute] any ScrollColumn; [attribute] any ScrollRow; - [attribute] long Top; [attribute] any View; - [attribute] boolean Visible; - [attribute] long Width; [attribute] any WindowState; [attribute] any Zoom; any SelectedSheets( [in] any aIndex ); diff --git a/oovbaapi/ooo/vba/excel/XWorkbook.idl b/oovbaapi/ooo/vba/excel/XWorkbook.idl index e05a6ccca493..bb043bfa6b29 100644 --- a/oovbaapi/ooo/vba/excel/XWorkbook.idl +++ b/oovbaapi/ooo/vba/excel/XWorkbook.idl @@ -48,31 +48,20 @@ interface XWorksheet; interface XWorksheets; interface XStyles; -interface XWorkbook +interface XWorkbook : com::sun::star::uno::XInterface { - interface ::ooo::vba::XHelperInterface; - - [attribute, readonly] string Name; - [attribute, readonly] string Path; - [attribute, readonly] string FullName; [attribute, readonly] boolean ProtectStructure; [attribute, readonly] XWorksheet ActiveSheet; - [attribute] boolean Saved; [attribute, readonly] string CodeName; + [attribute] boolean PrecisionAsDisplayed; any Worksheets([in] any sheet); any Styles([in] any Index ); any Sheets([in] any sheet); any Windows([in] any index ); - void Close([in] any SaveChanges, [in] any FileName, [in] any RouteWorkBook); - void Protect( [in] any Password ); - void Unprotect( [in] any Password ); - void Save(); - void Activate(); void ResetColors() raises (com::sun::star::script::BasicErrorException); - + void Activate(); any Names( [in] any Index ); - any Colors([in] any Index) raises (com::sun::star::script::BasicErrorException); long FileFormat() raises (com::sun::star::script::BasicErrorException); void SaveCopyAs( [in] string Filename ); diff --git a/oovbaapi/ooo/vba/excel/XWorkbooks.idl b/oovbaapi/ooo/vba/excel/XWorkbooks.idl index a94747282200..685124922707 100644 --- a/oovbaapi/ooo/vba/excel/XWorkbooks.idl +++ b/oovbaapi/ooo/vba/excel/XWorkbooks.idl @@ -45,9 +45,8 @@ module ooo { module vba { module excel { //============================================================================= -interface XWorkbooks +interface XWorkbooks : com::sun::star::uno::XInterface { - interface ::ooo::vba::XCollection; any Add(); any Open([in] string Filename, [in] any UpdateLinks, [in] any ReadOnly, [in] any Format, [in] any Password, [in] any WriteResPassword, [in] any IgnoreReadOnlyRecommended, [in] any Origin, [in] any Delimiter, [in] any Editable, [in] any Notify, [in] any Converter, [in] any AddToMru); diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl index 743e6b8fe6a2..00cd109a8b70 100644 --- a/oovbaapi/ooo/vba/excel/XWorksheet.idl +++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl @@ -53,6 +53,7 @@ interface XRange; interface XOutline; interface XPageSetup; interface XHPageBreaks; +interface XVPageBreaks; interface XWorksheet { interface ::ooo::vba::XHelperInterface; @@ -70,6 +71,7 @@ interface XWorksheet [attribute, readonly] XWorksheet Previous; [attribute, readonly] string CodeName; [attribute, readonly] short Index; + [attribute] long EnableSelection; void Activate(); void Calculate( ); @@ -88,6 +90,7 @@ interface XWorksheet XOutline Outline(); XPageSetup PageSetup(); any HPageBreaks([in] any Index); + any VPageBreaks([in] any Index); any OLEObjects([in] any Index); void ShowDataForm(); any Shapes([in] any Index); diff --git a/oovbaapi/ooo/vba/excel/makefile.mk b/oovbaapi/ooo/vba/excel/makefile.mk index 764c073e6846..4ffa89f94ce1 100644 --- a/oovbaapi/ooo/vba/excel/makefile.mk +++ b/oovbaapi/ooo/vba/excel/makefile.mk @@ -46,7 +46,9 @@ dummy: # ------------------------------------------------------------------------ -IDLFILES= XApplication.idl\ +IDLFILES= XGlobals.idl\ + Globals.idl\ + XApplication.idl\ XComment.idl\ XComments.idl\ XRange.idl\ @@ -103,6 +105,9 @@ IDLFILES= XApplication.idl\ XPageBreak.idl \ XHPageBreak.idl \ XHPageBreaks.idl \ + XVPageBreak.idl \ + XVPageBreaks.idl \ + TextFrame.idl \ # ------------------------------------------------------------------ diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk index ee63d6373feb..093ea81d8d55 100644 --- a/oovbaapi/ooo/vba/makefile.mk +++ b/oovbaapi/ooo/vba/makefile.mk @@ -47,7 +47,6 @@ dummy: IDLFILES=\ XErrObject.idl \ - XGlobals.idl \ XCollection.idl\ XVBAToOOEventDescGen.idl\ XPropValue.idl\ @@ -57,7 +56,21 @@ IDLFILES=\ XCommandBarControls.idl\ XCommandBar.idl\ XCommandBars.idl\ - Globals.idl\ + XCommandBarPopup.idl\ + XCommandBarButton.idl\ + XControlProvider.idl\ + ControlProvider.idl\ + XApplicationBase.idl\ + XWindowBase.idl\ + XDocumentBase.idl\ + XDocumentsBase.idl\ + XGlobalsBase.idl\ + XDocumentProperty.idl\ + XDocumentProperties.idl\ + XFontBase.idl\ + XDialogsBase.idl\ + XDialogBase.idl\ + XPageSetupBase.idl \ # ------------------------------------------------------------------ diff --git a/oovbaapi/ooo/vba/msforms/XControl.idl b/oovbaapi/ooo/vba/msforms/XControl.idl index 75f9becd253c..8db43ffdccf2 100644 --- a/oovbaapi/ooo/vba/msforms/XControl.idl +++ b/oovbaapi/ooo/vba/msforms/XControl.idl @@ -61,6 +61,7 @@ interface XControl [attribute] double Left; [attribute] double Top; [attribute] string Name; + [attribute] string ControlTipText; }; //============================================================================= diff --git a/oovbaapi/ooo/vba/msforms/XShape.idl b/oovbaapi/ooo/vba/msforms/XShape.idl index e43726134680..45a37f23f47a 100644 --- a/oovbaapi/ooo/vba/msforms/XShape.idl +++ b/oovbaapi/ooo/vba/msforms/XShape.idl @@ -34,10 +34,6 @@ #include <ooo/vba/XHelperInterface.idl> #endif -#ifndef __ooo_vba_excel_XTextFrame_idl__ -#include <ooo/vba/excel/XTextFrame.idl> -#endif - #ifndef __ooo_vba_msforms_XLineFormat_idl__ #include <ooo/vba/msforms/XLineFormat.idl> #endif @@ -66,14 +62,13 @@ interface XShape : ooo::vba::XHelperInterface [attribute, readonly] XLineFormat Line; [attribute, readonly] XFillFormat Fill; [attribute, readonly] XPictureFormat PictureFormat; + [attribute] boolean LockAspectRatio; + [attribute] boolean LockAnchor; + [attribute] long RelativeHorizontalPosition; + [attribute] long RelativeVerticalPosition; - /* - using in word - [attribute] RelativeHorizontalPosition - [attribute] RelativeVerticalPosition - [attribute] XWrapFormat WrapFormat; - */ - ooo::vba::excel::XTextFrame TextFrame(); + any TextFrame(); + any WrapFormat(); void Delete(); void ZOrder( [in] long ZOrderCmd ); void IncrementRotation( [in] double Increment ); diff --git a/oovbaapi/ooo/vba/msforms/XShapeRange.idl b/oovbaapi/ooo/vba/msforms/XShapeRange.idl index e0ceb79f94bd..079406ac1e5f 100644 --- a/oovbaapi/ooo/vba/msforms/XShapeRange.idl +++ b/oovbaapi/ooo/vba/msforms/XShapeRange.idl @@ -44,9 +44,25 @@ module ooo { module vba { module msforms { +interface XLineFormat; +interface XFillFormat; interface XShapeRange { interface ooo::vba::XCollection; + + [attribute] double Height; + [attribute] double Width; + [attribute] double Left; + [attribute] double Top; + [attribute, readonly] XLineFormat Line; + [attribute, readonly] XFillFormat Fill; + [attribute] boolean LockAspectRatio; + [attribute] boolean LockAnchor; + [attribute] long RelativeHorizontalPosition; + [attribute] long RelativeVerticalPosition; + + any TextFrame(); + any WrapFormat(); void Select(); XShape Group(); void IncrementRotation( [in] double Increment ); diff --git a/oovbaapi/ooo/vba/msforms/XShapes.idl b/oovbaapi/ooo/vba/msforms/XShapes.idl index 3d49fbc0701b..1bb5dc2a0429 100644 --- a/oovbaapi/ooo/vba/msforms/XShapes.idl +++ b/oovbaapi/ooo/vba/msforms/XShapes.idl @@ -51,6 +51,7 @@ interface XShapes */ any AddLine( [in] long StartX, [in] long StartY, [in] long endX, [in] long endY ); any AddShape([in] long ShapeType, [in] long StartX, [in] long StartY, [in] long endX, [in] long endY ); + any AddTextbox([in] long Orientation, [in] long Left, [in] long Top, [in] long Width, [in] long Height ); }; }; }; }; diff --git a/oovbaapi/ooo/vba/msforms/makefile.mk b/oovbaapi/ooo/vba/msforms/makefile.mk index f6549931444b..012cc7b91a59 100644 --- a/oovbaapi/ooo/vba/msforms/makefile.mk +++ b/oovbaapi/ooo/vba/msforms/makefile.mk @@ -71,6 +71,7 @@ IDLFILES=\ XSpinButton.idl \ XImage.idl \ XControls.idl \ + XTextFrame.idl \ # ------------------------------------------------------------------ diff --git a/oovbaapi/prj/build.lst b/oovbaapi/prj/build.lst index bc34a4f376ff..e6d23a3bed91 100644 --- a/oovbaapi/prj/build.lst +++ b/oovbaapi/prj/build.lst @@ -4,5 +4,6 @@ ovba oovbaapi\genconstidl nmake - all ovba_genconstidl NULL ovba oovbaapi\ooo\vba\constants nmake - all ovba_constants ovba_genconstidl NULL ovba oovbaapi\ooo\vba nmake - all ovba_vba NULL ovba oovbaapi\ooo\vba\excel nmake - all ovba_excel NULL +ovba oovbaapi\ooo\vba\word nmake - all ovba_word NULL ovba oovbaapi\ooo\vba\msforms nmake - all ovba_msforms NULL -ovba oovbaapi\util nmake - all ovba_util ovba_vba ovba_excel ovba_msforms ovba_constants ovba_genconstidl NULL +ovba oovbaapi\util nmake - all ovba_util ovba_vba ovba_excel ovba_word ovba_msforms ovba_constants ovba_genconstidl NULL diff --git a/oovbaapi/util/makefile.mk b/oovbaapi/util/makefile.mk index 97e592a7c053..df7a331540c1 100644 --- a/oovbaapi/util/makefile.mk +++ b/oovbaapi/util/makefile.mk @@ -49,6 +49,7 @@ dummy: UNOIDLDBFILES= \ $(UCR)$/vba.db \ $(UCR)$/excel.db \ + $(UCR)$/word.db \ $(UCR)$/msforms.db \ $(UCR)$/constants.db diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 71f1729840c0..83662632a155 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -264,6 +264,7 @@ public: TYPEINFO(); SFX_DECL_INTERFACE(SFX_INTERFACE_SFXDOCSH) + static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); /* Stampit disable/enable cancel button for print jobs default = true = enable! */ void Stamp_SetPrintCancelState(sal_Bool bState); @@ -882,6 +883,7 @@ public: virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); SfxObjectShell* GetObjectShell() const { return pObjSh; } + }; #endif diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 866c7b029cb5..b94e59b910ff 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -1471,31 +1471,35 @@ sal_Bool SfxObjectShell::IsHelpDocument() const void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const String& rFileName ) { - uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties()); - xDocProps->setTemplateURL( ::rtl::OUString() ); - xDocProps->setTemplateName( ::rtl::OUString() ); - xDocProps->setTemplateDate( util::DateTime() ); - xDocProps->resetUserData( ::rtl::OUString() ); + // only care about reseting this data for openoffice formats otherwise + if ( IsOwnStorageFormat_Impl( *GetMedium()) ) + { + uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties()); + xDocProps->setTemplateURL( ::rtl::OUString() ); + xDocProps->setTemplateName( ::rtl::OUString() ); + xDocProps->setTemplateDate( util::DateTime() ); + xDocProps->resetUserData( ::rtl::OUString() ); - // TODO/REFACTOR: - // Title? + // TODO/REFACTOR: + // Title? - if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) ) - { - String aFoundName; - if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) ) + if( ::utl::LocalFileHelper::IsLocalFile( rFileName ) ) { - INetURLObject aObj( rFileName ); - xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); - xDocProps->setTemplateName( rTemplateName ); + String aFoundName; + if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rTemplateName, aFoundName ) ) + { + INetURLObject aObj( rFileName ); + xDocProps->setTemplateURL( aObj.GetMainURL(INetURLObject::DECODE_TO_IURI) ); + xDocProps->setTemplateName( rTemplateName ); - ::DateTime now; - xDocProps->setTemplateDate( util::DateTime( - now.Get100Sec(), now.GetSec(), now.GetMin(), - now.GetHour(), now.GetDay(), now.GetMonth(), - now.GetYear() ) ); + ::DateTime now; + xDocProps->setTemplateDate( util::DateTime( + now.Get100Sec(), now.GetSec(), now.GetMin(), + now.GetHour(), now.GetDay(), now.GetMonth(), + now.GetYear() ) ); - SetQueryLoadTemplate( sal_True ); + SetQueryLoadTemplate( sal_True ); + } } } } diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index a47fc1bf4747..3d4eedcadada 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1475,3 +1475,19 @@ void SfxObjectShell::SignScriptingContent() ImplSign( TRUE ); } +// static +const uno::Sequence<sal_Int8>& SfxObjectShell::getUnoTunnelId() +{ + static uno::Sequence<sal_Int8> * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 26ba76517d8c..5b1c6bdd3106 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -136,6 +136,33 @@ DBG_NAME(SfxObjectShell) extern svtools::AsynchronLink* pPendingCloser; static WeakReference< XInterface > s_xCurrentComponent; +void lcl_UpdateAppBasicDocVars( const Reference< XInterface >& _rxComponent, bool bClear = false ) +{ + BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); + if ( pAppMgr ) + { + uno::Reference< beans::XPropertySet > xProps( _rxComponent, uno::UNO_QUERY ); + if ( xProps.is() ) + { + try + { + beans::PropertyValue aProp; + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisVBADocObj") ) ) >>= aProp; + rtl::OString sTmp( rtl::OUStringToOString( aProp.Name, RTL_TEXTENCODING_UTF8 ) ); + const char* pAscii = sTmp.getStr(); + if ( bClear ) + pAppMgr->SetGlobalUNOConstant( pAscii, uno::makeAny( uno::Reference< uno::XInterface >() ) ); + else + pAppMgr->SetGlobalUNOConstant( pAscii, aProp.Value ); + + } + catch( uno::Exception& e ) + { + } + } + } +} + //========================================================================= @@ -170,6 +197,7 @@ void SAL_CALL SfxModelListener_Impl::disposing( const com::sun::star::lang::Even ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); if ( SfxObjectShell::GetCurrentComponent() == _rEvent.Source ) { + lcl_UpdateAppBasicDocVars( SfxObjectShell::GetCurrentComponent(), true ); // remove ThisComponent reference from AppBasic SfxObjectShell::SetCurrentComponent( Reference< XInterface >() ); } @@ -1048,7 +1076,10 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); s_xCurrentComponent = _rxComponent; if ( pAppMgr ) + { + lcl_UpdateAppBasicDocVars( _rxComponent ); pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) ); + } #if OSL_DEBUG_LEVEL > 0 const char* pComponentImplName = _rxComponent.get() ? typeid( *_rxComponent.get() ).name() : "void"; diff --git a/svx/prj/d.lst b/svx/prj/d.lst index 7edc2fbc9c11..acbb689082ba 100644 --- a/svx/prj/d.lst +++ b/svx/prj/d.lst @@ -658,5 +658,6 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\table ..\inc\svx\selectioncontroller.hxx %_DEST%\inc%_EXT%\svx\selectioncontroller.hxx ..\inc\svx\helperhittest3d.hxx %_DEST%\inc%_EXT%\svx\helperhittest3d.hxx ..\inc\svx\optimprove.hxx %_DEST%\inc%_EXT%\svx\optimprove.hxx +..\inc\svx\msvbahelper.hxx %_DEST%\inc%_EXT%\svx\msvbahelper.hxx ..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.* diff --git a/svx/source/msfilter/makefile.mk b/svx/source/msfilter/makefile.mk index adbe8b104860..53eab95a5be8 100644 --- a/svx/source/msfilter/makefile.mk +++ b/svx/source/msfilter/makefile.mk @@ -54,7 +54,8 @@ LIB1OBJFILES= \ $(SLO)$/svxmsbas.obj \ $(SLO)$/msocximex.obj \ $(SLO)$/mscodec.obj \ - $(SLO)$/msfiltertracer.obj + $(SLO)$/msfiltertracer.obj \ + $(SLO)$/msvbahelper.obj\ LIB2TARGET= $(SLB)$/$(TARGET)-core.lib LIB2OBJFILES= \ @@ -70,7 +71,8 @@ EXCEPTIONSFILES= \ $(SLO)$/msocximex.obj \ $(SLO)$/msoleexp.obj \ $(SLO)$/svxmsbas.obj \ - $(SLO)$/msfiltertracer.obj + $(SLO)$/msfiltertracer.obj \ + $(SLO)$/msvbahelper.obj\ .INCLUDE : target.mk |