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, |