1 diff --git basic/inc/basic/sbstar.hxx basic/inc/basic/sbstar.hxx
2 index 5f2d594..ea7e75e 100644
3 --- basic/inc/basic/sbstar.hxx
4 +++ basic/inc/basic/sbstar.hxx
5 @@ -204,6 +204,7 @@ public:
6 SbxObjectRef getRTL( void ) { return pRtl; }
7 BOOL IsDocBasic() { return bDocBasic; }
8 SbxVariable* VBAFind( const String& rName, SbxClassType t );
9 + bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut );
12 #ifndef __SB_SBSTARBASICREF_HXX
13 diff --git basic/source/basmgr/basmgr.cxx basic/source/basmgr/basmgr.cxx
14 index 63c4376..1b25f42 100644
15 --- basic/source/basmgr/basmgr.cxx
16 +++ basic/source/basmgr/basmgr.cxx
17 @@ -1840,15 +1840,7 @@ bool BasicManager::GetGlobalUNOConstant( const sal_Char* _pAsciiName, ::com::sun
18 StarBASIC* pStandardLib = GetStdLib();
19 OSL_PRECOND( pStandardLib, "BasicManager::SetGlobalUNOConstant: no lib to insert into!" );
22 - ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
23 - SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( pStandardLib->Find( sVarName, SbxCLASS_DONTCARE ) );
26 - aOut = pGlobs->getUnoAny();
30 + bRes = pStandardLib->GetUNOConstant( _pAsciiName, aOut );
34 diff --git basic/source/classes/sb.cxx basic/source/classes/sb.cxx
35 index 302a2ed..de99045 100644
36 --- basic/source/classes/sb.cxx
37 +++ basic/source/classes/sb.cxx
38 @@ -1547,6 +1547,18 @@ BOOL StarBASIC::LoadOldModules( SvStream& )
42 +bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut )
45 + ::rtl::OUString sVarName( ::rtl::OUString::createFromAscii( _pAsciiName ) );
46 + SbUnoObject* pGlobs = dynamic_cast<SbUnoObject*>( Find( sVarName, SbxCLASS_DONTCARE ) );
49 + aOut = pGlobs->getUnoAny();
55 //========================================================================
56 // #118116 Implementation Collection object
57 diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
58 index 5f62736..6f303f0 100644
59 --- sc/source/ui/vba/vbarange.cxx
60 +++ sc/source/ui/vba/vbarange.cxx
61 @@ -1976,8 +1976,7 @@ ScVbaRange::Select() throw (uno::RuntimeException)
62 // ThisComponent.CurrentController.Frame.getContainerWindow.SetFocus
65 - // #FIXME don't use current document
66 - uno::Reference< frame::XController > xController( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW );
67 + uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
68 uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_QUERY_THROW );
69 uno::Reference< awt::XWindow > xWin( xFrame->getContainerWindow(), uno::UNO_QUERY_THROW );
71 @@ -2547,8 +2546,7 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons
72 // #FIXME doen't use current document
73 uno::Reference< view::XSelectionSupplier > xSelection( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW );
75 - // #FIXME doen't use current document
76 - uno::Reference< uno::XInterface > xSel( getCurrentDocument()->getCurrentSelection() );
77 + uno::Reference< uno::XInterface > xSel( getScDocShell()->GetModel()->getCurrentSelection() );
79 xSelection->select( uno::makeAny( mxRange ) );
81 @@ -3905,7 +3903,6 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
85 - // #FIXME don't use current document
86 uno::Reference< sheet::XSpreadsheetView > xView( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY );
87 uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
88 ScVbaRange* pRange = new ScVbaRange( uno::Reference< XHelperInterface >(), xContext, xSheetRange );
89 diff --git vbahelper/inc/vbahelper/vbahelper.hxx vbahelper/inc/vbahelper/vbahelper.hxx
90 index cfc8ee0..29e8236 100644
91 --- vbahelper/inc/vbahelper/vbahelper.hxx
92 +++ vbahelper/inc/vbahelper/vbahelper.hxx
93 @@ -65,6 +65,8 @@ namespace ooo
94 VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException);
95 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);
96 VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException);
97 + VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getDocumentContext() throw (css::uno::RuntimeException);
99 VBAHELPER_DLLPUBLIC css::uno::Reference< css::beans::XIntrospectionAccess > getIntrospectionAccess( const css::uno::Any& aObject ) throw (css::uno::RuntimeException);
100 VBAHELPER_DLLPUBLIC css::uno::Reference< css::script::XTypeConverter > getTypeConverter( const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw (css::uno::RuntimeException);