Kaydet (Commit) e69fd541 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Replace GetAppData(SHL_IDL) with a static pointer var

Change-Id: Ia1e22ff95457a958ef26974091aa2092b32505bd
üst e294fa92
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <tools/shl.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <svl/solar.hrc> #include <svl/solar.hrc>
#include <tools/debug.hxx> #include <tools/debug.hxx>
...@@ -46,15 +45,21 @@ struct BasicDLL::Impl ...@@ -46,15 +45,21 @@ struct BasicDLL::Impl
{ } { }
}; };
namespace {
BasicDLL * BASIC_DLL;
}
BasResId::BasResId( sal_uInt32 nId ) : BasResId::BasResId( sal_uInt32 nId ) :
ResId( nId, *(BASIC_DLL()->GetBasResMgr()) ) ResId( nId, *(BASIC_DLL->GetBasResMgr()) )
{ {
} }
BasicDLL::BasicDLL() BasicDLL::BasicDLL()
: m_xImpl(new Impl) : m_xImpl(new Impl)
{ {
BASIC_DLL() = this; BASIC_DLL = this;
} }
BasicDLL::~BasicDLL() BasicDLL::~BasicDLL()
...@@ -65,7 +70,7 @@ ResMgr* BasicDLL::GetBasResMgr() const { return m_xImpl->xBasResMgr.get(); } ...@@ -65,7 +70,7 @@ ResMgr* BasicDLL::GetBasResMgr() const { return m_xImpl->xBasResMgr.get(); }
void BasicDLL::EnableBreak( bool bEnable ) void BasicDLL::EnableBreak( bool bEnable )
{ {
BasicDLL* pThis = BASIC_DLL(); BasicDLL* pThis = BASIC_DLL;
DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" ); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" );
if ( pThis ) if ( pThis )
{ {
...@@ -75,7 +80,7 @@ void BasicDLL::EnableBreak( bool bEnable ) ...@@ -75,7 +80,7 @@ void BasicDLL::EnableBreak( bool bEnable )
void BasicDLL::SetDebugMode( bool bDebugMode ) void BasicDLL::SetDebugMode( bool bDebugMode )
{ {
BasicDLL* pThis = BASIC_DLL(); BasicDLL* pThis = BASIC_DLL;
DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" ); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" );
if ( pThis ) if ( pThis )
{ {
...@@ -86,7 +91,7 @@ void BasicDLL::SetDebugMode( bool bDebugMode ) ...@@ -86,7 +91,7 @@ void BasicDLL::SetDebugMode( bool bDebugMode )
void BasicDLL::BasicBreak() void BasicDLL::BasicBreak()
{ {
BasicDLL* pThis = BASIC_DLL(); BasicDLL* pThis = BASIC_DLL;
DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" ); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" );
if ( pThis ) if ( pThis )
{ {
...@@ -106,7 +111,7 @@ void BasicDLL::BasicBreak() ...@@ -106,7 +111,7 @@ void BasicDLL::BasicBreak()
SbxAppData& GetSbxData_Impl() SbxAppData& GetSbxData_Impl()
{ {
return *BASIC_DLL()->m_xImpl->xSbxAppData; return *BASIC_DLL->m_xImpl->xSbxAppData;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -43,8 +43,6 @@ public: ...@@ -43,8 +43,6 @@ public:
static void SetDebugMode( bool bDebugMode ); static void SetDebugMode( bool bDebugMode );
}; };
#define BASIC_DLL() (*reinterpret_cast<BasicDLL**>(GetAppData( SHL_BASIC )) )
#endif // INCLUDED_BASIC_BASRDLL_HXX #endif // INCLUDED_BASIC_BASRDLL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
//20 (SHL_IDE) removed //20 (SHL_IDE) removed
//21 (SHL_EDIT) removed //21 (SHL_EDIT) removed
//22 (SHL_VCED) removed //22 (SHL_VCED) removed
#define SHL_BASIC 23 //23 (SHL_BASIC) removed
//24 (SHL_HELP) removed //24 (SHL_HELP) removed
//25 (SHL_LNKCCH) removed //25 (SHL_LNKCCH) removed
//26 (SHL_CHANNEL) removed //26 (SHL_CHANNEL) removed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment