diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-12 23:02:29 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-12 23:04:11 +0300 |
commit | c3d8b06f0058d808aa62c27d06f77e2a25747dd2 (patch) | |
tree | 3913aacee0a0aba39efd08ceb2dd82c1a9d81863 /basic | |
parent | 9be3e8e8d52cfb00dff851ee221074b7efce46c1 (diff) |
Get rid of SHL_SBC
GetAppData(SHL_SBC) was used only locally in the sb library so no need for
it. Just use a static pointer field.
Change-Id: I37c8429b6c9e521a00c52bb622f78bdc4afe345c
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sb.cxx | 9 | ||||
-rw-r--r-- | basic/source/classes/sbintern.cxx | 12 | ||||
-rw-r--r-- | basic/source/inc/sbintern.hxx | 1 |
3 files changed, 9 insertions, 13 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 63347374e08b..7154e1ee47b9 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -25,7 +25,6 @@ #include <tools/stream.hxx> #include <tools/errinf.hxx> #include <basic/sbx.hxx> -#include <tools/shl.hxx> #include <tools/rc.hxx> #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> @@ -964,12 +963,10 @@ StarBASIC::~StarBASIC() RemoveFactory( GetSbData()->pFormFac ); delete GetSbData()->pFormFac; GetSbData()->pFormFac = NULL; - SbiGlobals** pp = (SbiGlobals**) ::GetAppData( SHL_SBC ); - SbiGlobals* p = *pp; - if( p ) + if( SbiGlobals::pGlobals ) { - delete p; - *pp = 0; + delete SbiGlobals::pGlobals; + SbiGlobals::pGlobals = 0; } } else if( bDocBasic ) diff --git a/basic/source/classes/sbintern.cxx b/basic/source/classes/sbintern.cxx index fb3f802e6bbd..6b3fa495f47e 100644 --- a/basic/source/classes/sbintern.cxx +++ b/basic/source/classes/sbintern.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <tools/shl.hxx> - #include "sbintern.hxx" #include "sbunoobj.hxx" #include "token.hxx" @@ -27,13 +25,13 @@ #include "codegen.hxx" #include <basic/basmgr.hxx> +SbiGlobals* SbiGlobals::pGlobals = 0; + SbiGlobals* GetSbData() { - SbiGlobals** pp = (SbiGlobals**) ::GetAppData( SHL_SBC ); - SbiGlobals* p = *pp; - if( !p ) - p = *pp = new SbiGlobals; - return p; + if( !SbiGlobals::pGlobals ) + SbiGlobals::pGlobals = new SbiGlobals; + return SbiGlobals::pGlobals; } SbiGlobals::SbiGlobals() diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx index 7dfd011f8385..401f7af45e7b 100644 --- a/basic/source/inc/sbintern.hxx +++ b/basic/source/inc/sbintern.hxx @@ -80,6 +80,7 @@ public: struct SbiGlobals { + static SbiGlobals* pGlobals; SbiInstance* pInst; // all active runtime instances SbiFactory* pSbFac; // StarBASIC-Factory SbUnoFactory* pUnoFac; // Factory for Uno-Structs at DIM AS NEW |