summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-05-21 10:11:51 +0200
committerDaniel Rentz <dr@openoffice.org>2010-05-21 10:11:51 +0200
commit87523ea7109b044939ff51bb481aad00171c2e3a (patch)
treef4451a2a1db327b942d0f18df9211d474c061f97 /vbahelper
parentcff39a2614347c6db8ae1a214947d90a3ea57000 (diff)
parent2f4bff8415b28e36346872157104eb71322a743a (diff)
npower13_objectmodules: rebase and merge with DEV300_m78
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/inc/vbahelper/vbaaccesshelper.hxx79
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx12
-rw-r--r--vbahelper/prj/d.lst1
-rw-r--r--vbahelper/source/msforms/makefile.mk5
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx4
-rw-r--r--vbahelper/source/msforms/vbacontrol.hxx1
-rw-r--r--vbahelper/source/vbahelper/makefile.mk5
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx18
-rw-r--r--vbahelper/util/makefile.mk6
-rw-r--r--vbahelper/util/msforms.map9
10 files changed, 103 insertions, 37 deletions
diff --git a/vbahelper/inc/vbahelper/vbaaccesshelper.hxx b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
new file mode 100644
index 000000000000..79bb44ce30a4
--- /dev/null
+++ b/vbahelper/inc/vbahelper/vbaaccesshelper.hxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * $RCSfile: vbahelper.hxx,v $
+ * $Revision: 1.5.32.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef OOVBAAPI_VBA_ACCESS_HELPER_HXX
+#define OOVBAAPI_VBA_ACCESS_HELPER_HXX
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <basic/basmgr.hxx>
+#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
+#define VBAHELPER_DLLIMPLEMENTATION
+#include <vbahelper/vbadllapi.h>
+#include <memory>
+namespace css = ::com::sun::star;
+namespace ooo
+{
+ namespace vba
+ {
+
+ VBAHELPER_DLLPRIVATE inline css::uno::Reference< css::lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell* pShell )
+ {
+ css::uno::Any aUnoVar;
+ if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) )
+ throw css::lang::IllegalArgumentException();
+ css::uno::Reference< css::lang::XMultiServiceFactory > xVBAFactory( aUnoVar, css::uno::UNO_QUERY_THROW );
+ return xVBAFactory;
+ }
+
+ VBAHELPER_DLLPUBLIC inline css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException)
+ {
+ OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
+ ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
+ css::uno::Reference< css::uno::XInterface > xIf = getVBAServiceFactory( pShell )->createInstanceWithArguments( sVarName, aArgs );
+ return xIf;
+ }
+
+
+ VBAHELPER_DLLPRIVATE inline bool isAlienDoc( SfxObjectShell& rDocShell, const char* pMimeType )
+ {
+ bool bRes( false );
+ const SfxFilter *pFilt = rDocShell.GetMedium()->GetFilter();
+ if ( pFilt && pFilt->IsAlienFormat() )
+ bRes = ( pFilt->GetMimeType().CompareToAscii( pMimeType ) == 0 );
+ return bRes;
+ }
+ VBAHELPER_DLLPUBLIC inline bool isAlienExcelDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-excel" ); }
+ VBAHELPER_DLLPUBLIC inline bool isAlienWordDoc( SfxObjectShell& rDocShell ) { return isAlienDoc( rDocShell, "application/vnd.ms-word" ); }
+
+ } // openoffice
+} // org
+
+#endif
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx
index 83b9737315ea..166ad76475d8 100644
--- a/vbahelper/inc/vbahelper/vbahelper.hxx
+++ b/vbahelper/inc/vbahelper/vbahelper.hxx
@@ -35,17 +35,19 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XDevice.hpp>
+#include <basic/basmgr.hxx>
#include <basic/sberrors.hxx>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <sfx2/dispatch.hxx>
-//#include <ooo/vba/msforms/XShape.hpp>
+#include <sfx2/objsh.hxx>
+#include <sfx2/docfilt.hxx>
+#include <sfx2/docfile.hxx>
#include <vcl/pointr.hxx>
-#define VBAHELPER_DLLIMPLEMENTATION
-#include <vbahelper/vbadllapi.h>
#include <memory>
-namespace css = ::com::sun::star;
+#include "vbaaccesshelper.hxx"
+namespace css = ::com::sun::star;
namespace ooo
{
namespace vba
@@ -62,7 +64,7 @@ namespace ooo
}
VBAHELPER_DLLPUBLIC SfxObjectShell* getSfxObjShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException);
- VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException);
+
css::uno::Reference< css::frame::XModel > getCurrentDoc( const rtl::OUString& sKey ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getThisExcelDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getThisWordDoc( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);
diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst
index d7b61d1e5a61..d683e97c8b90 100644
--- a/vbahelper/prj/d.lst
+++ b/vbahelper/prj/d.lst
@@ -8,6 +8,7 @@
mkdir: %_DEST%\inc%_EXT%\basic
..\inc\vbahelper\vbacollectionimpl.hxx %_DEST%\inc%_EXT%\vbahelper\vbacollectionimpl.hxx
..\inc\vbahelper\vbahelper.hxx %_DEST%\inc%_EXT%\vbahelper\vbahelper.hxx
+..\inc\vbahelper\vbaaccesshelper.hxx %_DEST%\inc%_EXT%\vbahelper\vbaaccesshelper.hxx
..\inc\vbahelper\helperdecl.hxx %_DEST%\inc%_EXT%\vbahelper\helperdecl.hxx
..\inc\vbahelper\vbahelperinterface.hxx %_DEST%\inc%_EXT%\vbahelper\vbahelperinterface.hxx
..\inc\vbahelper\vbaapplicationbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaapplicationbase.hxx
diff --git a/vbahelper/source/msforms/makefile.mk b/vbahelper/source/msforms/makefile.mk
index 9c24c77f8009..7c61e4302b7f 100644
--- a/vbahelper/source/msforms/makefile.mk
+++ b/vbahelper/source/msforms/makefile.mk
@@ -34,6 +34,11 @@ VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
+.IF "$(ENABLE_VBA)" == "NO"
+dummy:
+ @echo "Nothing to build"
+.ENDIF
+
.INCLUDE : settings.mk
SLOFILES=\
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 8cf00748c278..2ff12b145824 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -374,10 +374,6 @@ ScVbaControlFactory::ScVbaControlFactory( const uno::Reference< uno::XComponentC
{
}
-ScVbaControl* ScVbaControlFactory::createControl() throw (uno::RuntimeException)
-{
- return createControl( m_xModel );
-}
ScVbaControl* ScVbaControlFactory::createControl( const uno::Reference< uno::XInterface >& xParent ) throw (uno::RuntimeException)
{
uno::Reference< drawing::XControlShape > xControlShape( m_xControl, uno::UNO_QUERY );
diff --git a/vbahelper/source/msforms/vbacontrol.hxx b/vbahelper/source/msforms/vbacontrol.hxx
index b0db3c476186..1a8ed063548b 100644
--- a/vbahelper/source/msforms/vbacontrol.hxx
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -98,7 +98,6 @@ class ScVbaControlFactory
public:
ScVbaControlFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext,
const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel );
- ScVbaControl* createControl() throw ( css::uno::RuntimeException );
ScVbaControl* createControl( const css::uno::Reference< css::uno::XInterface >& xParent ) throw ( css::uno::RuntimeException );
private:
ScVbaControl* createControl( const css::uno::Reference< css::awt::XControl >&, const css::uno::Reference< css::uno::XInterface >& ) throw ( css::uno::RuntimeException );
diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk
index 791a3ebdcb76..b11b4ffa0a4f 100644
--- a/vbahelper/source/vbahelper/makefile.mk
+++ b/vbahelper/source/vbahelper/makefile.mk
@@ -33,6 +33,11 @@ ENABLE_EXCEPTIONS := TRUE
VISIBILITY_HIDDEN=TRUE
# --- Settings -----------------------------------------------------
+.IF "$(ENABLE_VBA)" == "NO"
+dummy:
+ @echo "Nothing to build"
+.ENDIF
+
.INCLUDE : settings.mk
SLOFILES=\
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index ac8423d2ce3a..a9e72318536d 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -98,15 +98,6 @@ namespace ooo
namespace vba
{
-uno::Reference< lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell* pShell )
-{
- uno::Any aUnoVar;
- if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) )
- throw lang::IllegalArgumentException();
- uno::Reference< lang::XMultiServiceFactory > xVBAFactory( aUnoVar, uno::UNO_QUERY_THROW );
- return xVBAFactory;
-}
-
css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException)
{
OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
@@ -114,13 +105,6 @@ css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShe
return getVBAServiceFactory( pShell )->createInstance( sVarName );
}
-css::uno::Reference< css::uno::XInterface > createVBAUnoAPIServiceWithArgs( SfxObjectShell* pShell, const sal_Char* _pAsciiName, const uno::Sequence< uno::Any >& aArgs ) throw ( css::uno::RuntimeException )
-{
- OSL_PRECOND( pShell, "createVBAUnoAPIService: no shell!" );
- ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
- uno::Reference< uno::XInterface > xIf = getVBAServiceFactory( pShell )->createInstanceWithArguments( sVarName, aArgs );
- return xIf;
-}
// helper method to determine if the view ( calc ) is in print-preview mode
bool isInPrintPreview( SfxViewFrame* pView )
{
@@ -620,7 +604,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
{
if ( bPreview )
{
- if ( !pViewFrame->GetFrame()->IsInPlace() )
+ if ( !pViewFrame->GetFrame().IsInPlace() )
{
// #TODO is this necessary ( calc specific )
// SC_MOD()->InputEnterHandler();
diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk
index 7af48db00aff..dda4be0cbc81 100644
--- a/vbahelper/util/makefile.mk
+++ b/vbahelper/util/makefile.mk
@@ -34,6 +34,10 @@ TARGET=vbahelper
.INCLUDE : settings.mk
+.IF "$(ENABLE_VBA)" == "NO"
+dummy:
+ @echo "Nothing to build"
+.ENDIF
TARGET_HELPER=vbahelper
@@ -73,7 +77,7 @@ TARGET_MSFORMS=msforms
SHL2TARGET=$(TARGET_MSFORMS)$(DLLPOSTFIX).uno
SHL2IMPLIB= i$(TARGET_MSFORMS)
-SHL2VERSIONMAP=$(TARGET_MSFORMS).map
+SHL2VERSIONMAP=$(SOLARENV)/src/component.map
SHL2DEF=$(MISC)$/$(SHL2TARGET).def
DEF2NAME=$(SHL2TARGET)
SHL2STDLIBS= \
diff --git a/vbahelper/util/msforms.map b/vbahelper/util/msforms.map
deleted file mode 100644
index 737cddbfe3df..000000000000
--- a/vbahelper/util/msforms.map
+++ /dev/null
@@ -1,9 +0,0 @@
-OOO_1.1 {
- global:
- component_getImplementationEnvironment;
- component_getFactory;
- component_writeInfo;
-
- local:
- *;
-};