View | Details | Raw Unified | Return to issue 108880
Collapse All | Expand All

(-)./old/sc/source/ui/vba/vbaapplication.cxx (-15 / +15 lines)
Lines 2-8 Link Here
2
 *
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 * 
4
 * 
5
 * Copyright 2008 by Sun Microsystems, Inc.
5
 * Copyright 2008, 2010 by Sun Microsystems, Inc.
6
 *
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
8
 *
Lines 140-145 Link Here
140
140
141
ScVbaApplication::ScVbaApplication( const uno::Reference<uno::XComponentContext >& xContext ): ScVbaApplication_BASE( xContext ), m_xCalculation( excel::XlCalculation::xlCalculationAutomatic )
141
ScVbaApplication::ScVbaApplication( const uno::Reference<uno::XComponentContext >& xContext ): ScVbaApplication_BASE( xContext ), m_xCalculation( excel::XlCalculation::xlCalculationAutomatic )
142
{
142
{
143
	m_bEnableEvents = sal_True;
143
}
144
}
144
145
145
ScVbaApplication::~ScVbaApplication()
146
ScVbaApplication::~ScVbaApplication()
Lines 685-712 Link Here
685
686
686
//VBA by minz@cn.ibm.com. Add Application.EnableEvents.
687
//VBA by minz@cn.ibm.com. Add Application.EnableEvents.
687
void SAL_CALL
688
void SAL_CALL
688
ScVbaApplication::setEnableEvents(sal_Bool /*bEnable*/) throw (uno::RuntimeException)
689
ScVbaApplication::setEnableEvents(sal_Bool bEnable) throw (uno::RuntimeException)
689
{
690
{
690
	//TODO.
691
	m_bEnableEvents = bEnable;
691
}
692
}
692
693
693
sal_Bool SAL_CALL
694
sal_Bool SAL_CALL
694
ScVbaApplication::getEnableEvents() throw (uno::RuntimeException)
695
ScVbaApplication::getEnableEvents() throw (uno::RuntimeException)
695
{
696
{
696
	//TODO.
697
	return m_bEnableEvents;
697
	return sal_True;
698
}
698
}
699
699
700
sal_Bool SAL_CALL
700
sal_Bool SAL_CALL
701
ScVbaApplication::getVisible() throw (uno::RuntimeException)
701
ScVbaApplication::getVisible() throw (uno::RuntimeException)
702
{
702
{
703
	sal_Bool bVisible = sal_True;	
703
	sal_Bool bVisible = sal_True;	
704
	return bVisible;
704
	return bVisible;
705
}
705
}
706
706
707
void SAL_CALL
707
void SAL_CALL
708
ScVbaApplication::setVisible(sal_Bool bVisible) throw (uno::RuntimeException)
708
ScVbaApplication::setVisible(sal_Bool bVisible) throw (uno::RuntimeException)
709
{
709
{
710
}
710
}
711
711
712
void SAL_CALL
712
void SAL_CALL
(-)./old/sc/source/ui/vba/vbaapplication.hxx (-2 / +3 lines)
Lines 2-8 Link Here
2
 *
2
 *
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
 * 
4
 * 
5
 * Copyright 2008 by Sun Microsystems, Inc.
5
 * Copyright 2008, 2010 by Sun Microsystems, Inc.
6
 *
6
 *
7
 * OpenOffice.org - a multi-platform office productivity suite
7
 * OpenOffice.org - a multi-platform office productivity suite
8
 *
8
 *
Lines 46-51 Link Here
46
{
46
{
47
private:
47
private:
48
	sal_Int32 m_xCalculation;
48
	sal_Int32 m_xCalculation;
49
	sal_Bool  m_bEnableEvents;
49
	rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException );
50
	rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException );
50
	css::uno::Reference< ov::XFileSearch > m_xFileSearch; //
51
	css::uno::Reference< ov::XFileSearch > m_xFileSearch; //
51
protected:
52
protected:
Lines 94-100 Link Here
94
	virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException);
95
	virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException);
95
	virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException);
96
	virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException);
96
97
97
	virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
98
	virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException);
98
    virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException);
99
    virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException);
99
100
100
	virtual double SAL_CALL CountA( const css::uno::Any& arg1 ) throw (css::uno::RuntimeException) ;
101
	virtual double SAL_CALL CountA( const css::uno::Any& arg1 ) throw (css::uno::RuntimeException) ;
(-)./old/sc/source/ui/vba/vbaeventshelper.cxx (-2 / +19 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
17
 *    Copyright 2005, 2010 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
19
 *
20
 *    This library is free software; you can redistribute it and/or
20
 *    This library is free software; you can redistribute it and/or
Lines 64-69 Link Here
64
#include <map>
64
#include <map>
65
#include <svx/msvbahelper.hxx>
65
#include <svx/msvbahelper.hxx>
66
#include <vcl/svapp.hxx>
66
#include <vcl/svapp.hxx>
67
#include <basic/basmgr.hxx>
68
#include <ooo/vba/XHelperInterface.hpp>
67
69
68
using namespace std;
70
using namespace std;
69
using namespace com::sun::star;
71
using namespace com::sun::star;
Lines 843-850 Link Here
843
sal_Bool SAL_CALL 
845
sal_Bool SAL_CALL 
844
ScVbaEventsHelper::ProcessCompatibleVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& aArgs ) throw (uno::RuntimeException)
846
ScVbaEventsHelper::ProcessCompatibleVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& aArgs ) throw (uno::RuntimeException)
845
{
847
{
848
	// Get Application Object.
849
	if ( !m_xApplication.is() )
850
	{
851
		if ( pDocShell )
852
		{
853
			uno::Any aVBAGlobals;
854
			pDocShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aVBAGlobals );
855
			uno::Reference< ::ooo::vba::XHelperInterface > xHelperInterface( aVBAGlobals, uno::UNO_QUERY );
856
			if ( xHelperInterface.is() )
857
			{
858
				m_xApplication = uno::Reference< ::ooo::vba::excel::XApplication >( xHelperInterface->Application(), uno::UNO_QUERY );
859
			}
860
		}
861
	}
862
846
	SfxObjectShell* pShell = pDoc->GetDocumentShell();
863
	SfxObjectShell* pShell = pDoc->GetDocumentShell();
847
	if( !pShell || mbIgnoreEvents || mbDocDisposed )
864
	if( !pShell || mbIgnoreEvents || ( m_xApplication.is() && !m_xApplication->getEnableEvents() ) )
848
		return sal_False;
865
		return sal_False;
849
    
866
    
850
    // In order to better support "withevents" in the future, 
867
    // In order to better support "withevents" in the future, 
(-)./old/sc/source/ui/vba/vbaeventshelper.hxx (-1 / +3 lines)
Lines 14-20 Link Here
14
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
17
 *    Copyright 2005, 2010 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
19
 *
20
 *    This library is free software; you can redistribute it and/or
20
 *    This library is free software; you can redistribute it and/or
Lines 43-48 Link Here
43
#include <com/sun/star/document/XVbaEventsHelper.hpp>
43
#include <com/sun/star/document/XVbaEventsHelper.hpp>
44
#include <com/sun/star/lang/XEventListener.hpp>
44
#include <com/sun/star/lang/XEventListener.hpp>
45
#include <com/sun/star/awt/XWindowListener.hpp>
45
#include <com/sun/star/awt/XWindowListener.hpp>
46
#include <ooo/vba/excel/XApplication.hpp>
46
#include "excelvbahelper.hxx"
47
#include "excelvbahelper.hxx"
47
#include <vbahelper/vbaeventshelperbase.hxx>
48
#include <vbahelper/vbaeventshelperbase.hxx>
48
49
Lines 61-66 Link Here
61
    css::uno::Reference< css::awt::XWindowListener > m_xVbaEventsListener;
62
    css::uno::Reference< css::awt::XWindowListener > m_xVbaEventsListener;
62
    sal_Bool mbOpened;
63
    sal_Bool mbOpened;
63
    sal_Bool mbDocDisposed;
64
    sal_Bool mbDocDisposed;
65
    css::uno::Reference< ::ooo::vba::excel::XApplication > m_xApplication;
64
66
65
	String getSheetModuleName( SCTAB nTab );
67
	String getSheetModuleName( SCTAB nTab );
66
	css::uno::Any createWorkSheet( SfxObjectShell* pShell, SCTAB nTab );
68
	css::uno::Any createWorkSheet( SfxObjectShell* pShell, SCTAB nTab );

Return to issue 108880