diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-12-07 10:05:52 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-12-07 10:05:52 +0000 |
commit | 5dc4a2d96b627a0cac8b1893218e535a153bccec (patch) | |
tree | 5dc53627f2b57f27af66f467c629a40dfd787b55 | |
parent | 684374b10275c0066838e9e65dbac716ce450508 (diff) |
INTEGRATION: CWS npower8 (1.2.4); FILE MERGED
2007/07/18 13:46:48 npower 1.2.4.2: #i77189# sync ooo-build and this module
2007/05/10 11:23:10 npower 1.2.4.1: -m#i77189#
-rw-r--r-- | sc/source/ui/vba/vbavalidation.hxx | 14 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindows.cxx | 42 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindows.hxx | 12 |
3 files changed, 48 insertions, 20 deletions
diff --git a/sc/source/ui/vba/vbavalidation.hxx b/sc/source/ui/vba/vbavalidation.hxx index da3567fa917e..f2e496806dca 100644 --- a/sc/source/ui/vba/vbavalidation.hxx +++ b/sc/source/ui/vba/vbavalidation.hxx @@ -4,9 +4,9 @@ * * $RCSfile: vbavalidation.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-04-25 16:11:38 $ + * last change: $Author: vg $ $Date: 2007-12-07 11:04:59 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -38,17 +38,16 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <org/openoffice/excel/XValidation.hpp> #include <com/sun/star/table/XCellRange.hpp> -#include "vbahelper.hxx" +#include "vbahelperinterface.hxx" -typedef ::cppu::WeakImplHelper1<oo::excel::XValidation > ValidationImpl_BASE; +typedef InheritedHelperInterfaceImpl1<oo::excel::XValidation > ValidationImpl_BASE; class ScVbaValidation : public ValidationImpl_BASE { - css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::table::XCellRange > m_xRange; public: - ScVbaValidation( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::table::XCellRange >& xRange ) : m_xContext(xContext), m_xRange( xRange) {} + ScVbaValidation( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::table::XCellRange >& xRange ) : ValidationImpl_BASE( xParent, xContext ), m_xRange( xRange) {} // Attributes virtual ::sal_Bool SAL_CALL getIgnoreBlank() throw (css::uno::RuntimeException); virtual void SAL_CALL setIgnoreBlank( ::sal_Bool _ignoreblank ) throw (css::uno::RuntimeException); @@ -71,6 +70,9 @@ public: // Methods virtual void SAL_CALL Delete( ) throw (css::uno::RuntimeException); virtual void SAL_CALL Add( const css::uno::Any& Type, const css::uno::Any& AlertStyle, const css::uno::Any& Operator, const css::uno::Any& Formula1, const css::uno::Any& Formula2 ) throw (css::uno::RuntimeException); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index 284ca472fbcd..f6e59ac20c81 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -4,9 +4,9 @@ * * $RCSfile: vbawindows.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-04-25 16:12:27 $ + * last change: $Author: vg $ $Date: 2007-12-07 11:05:39 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -40,6 +40,7 @@ #include <tools/urlobj.hxx> #include "vbawindow.hxx" +//#include "vbaworkbook.hxx" using namespace ::com::sun::star; using namespace ::org::openoffice; @@ -48,10 +49,16 @@ typedef std::hash_map< rtl::OUString, sal_Int32, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameIndexHash; + +uno::Reference< vba::XHelperInterface > lcl_createWorkbookHIParent( const uno::Reference< frame::XModel >& xModel, const uno::Reference< uno::XComponentContext >& xContext ) +{ + return new ScVbaWorkbook( uno::Reference< vba::XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext, xModel ); +} + uno::Any ComponentToWindow( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext ) { uno::Reference< frame::XModel > xModel( aSource, uno::UNO_QUERY_THROW ); - uno::Reference< excel::XWindow > xWin( new ScVbaWindow( xContext,xModel ) ); + uno::Reference< excel::XWindow > xWin( new ScVbaWindow( lcl_createWorkbookHIParent( xModel, xContext ), xContext,xModel ) ); return uno::makeAny( xWin ); } @@ -135,7 +142,7 @@ public: { m_windows.push_back( xNext ); uno::Reference< frame::XModel > xModel( xNext, uno::UNO_QUERY_THROW ); // that the spreadsheetdocument is a xmodel is a given - ScVbaWindow window( m_xContext, xModel ); + ScVbaWindow window( uno::Reference< vba::XHelperInterface >(), m_xContext, xModel ); rtl::OUString sCaption; window.getCaption() >>= sCaption; namesToIndices[ sCaption ] = nIndex++; @@ -203,20 +210,20 @@ public: }; -ScVbaWindows::ScVbaWindows( const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaWindows_BASE( xContext, xIndexAccess ) +ScVbaWindows::ScVbaWindows( const uno::Reference< oo::vba::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaWindows_BASE( xParent, xContext, xIndexAccess ) { } uno::Reference< container::XEnumeration > ScVbaWindows::createEnumeration() throw (uno::RuntimeException) { - return new WindowEnumImpl( m_xContext ); + return new WindowEnumImpl( mxContext ); } uno::Any ScVbaWindows::createCollectionObject( const css::uno::Any& aSource ) { - return ComponentToWindow( aSource, m_xContext ); + return ComponentToWindow( aSource, mxContext ); } uno::Type @@ -229,8 +236,7 @@ uno::Reference< vba::XCollection > ScVbaWindows::Windows( const css::uno::Reference< css::uno::XComponentContext >& xContext ) { uno::Reference< container::XIndexAccess > xIndex( new WindowsAccessImpl( xContext ) ); - - return uno::Reference< vba::XCollection >( new ScVbaWindows( xContext , xIndex ) ); + return new ScVbaWindows( uno::Reference< vba::XHelperInterface >( ScVbaGlobals::getGlobalsImpl( xContext )->getApplication(), uno::UNO_QUERY_THROW ), xContext , xIndex ); } void SAL_CALL @@ -240,3 +246,21 @@ ScVbaWindows::Arrange( ::sal_Int32 /*ArrangeStyle*/, const uno::Any& /*ActiveWor } +rtl::OUString& +ScVbaWindows::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaWindows") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +ScVbaWindows::getServiceNames() +{ + static uno::Sequence< rtl::OUString > sNames; + if ( sNames.getLength() == 0 ) + { + sNames.realloc( 1 ); + sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("org.openoffice.excel.Windows") ); + } + return sNames; +} diff --git a/sc/source/ui/vba/vbawindows.hxx b/sc/source/ui/vba/vbawindows.hxx index 86a2d3ee1b03..16c32abb9eef 100644 --- a/sc/source/ui/vba/vbawindows.hxx +++ b/sc/source/ui/vba/vbawindows.hxx @@ -4,9 +4,9 @@ * * $RCSfile: vbawindows.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-04-25 16:12:39 $ + * last change: $Author: vg $ $Date: 2007-12-07 11:05:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -44,13 +44,12 @@ #include "vbacollectionimpl.hxx" -typedef ::cppu::ImplInheritanceHelper1< ScVbaCollectionBaseImpl, oo::excel::XWindows > ScVbaWindows_BASE; +typedef CollTestImplHelper< oo::excel::XWindows > ScVbaWindows_BASE; class ScVbaWindows : public ScVbaWindows_BASE { -protected: public: - ScVbaWindows( const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); + ScVbaWindows( const css::uno::Reference< oo::vba::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); virtual ~ScVbaWindows() {} // XEnumerationAccess @@ -65,6 +64,9 @@ public: static css::uno::Reference< oo::vba::XCollection > Windows( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); }; #endif //SC_VBA_WINDOWS_HXX |