summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-07-06 23:15:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-07-07 07:48:12 +0200
commite69fd541ca4fd542f7e39ca8a1dd9cc113b95be2 (patch)
treeacf3d81a51ce8f0439edeceb77e5d06cb8ad748a
parente294fa9283071cb2816b6d8c759ed76ee552410e (diff)
Replace GetAppData(SHL_IDL) with a static pointer var
Change-Id: Ia1e22ff95457a958ef26974091aa2092b32505bd
-rw-r--r--basic/source/runtime/basrdll.cxx19
-rw-r--r--include/basic/basrdll.hxx2
-rw-r--r--include/tools/shl.hxx2
3 files changed, 13 insertions, 10 deletions
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index e02c0f6798a0..e10b7b356111 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <tools/shl.hxx>
#include <vcl/svapp.hxx>
#include <svl/solar.hrc>
#include <tools/debug.hxx>
@@ -46,15 +45,21 @@ struct BasicDLL::Impl
{ }
};
+namespace {
+
+BasicDLL * BASIC_DLL;
+
+}
+
BasResId::BasResId( sal_uInt32 nId ) :
- ResId( nId, *(BASIC_DLL()->GetBasResMgr()) )
+ ResId( nId, *(BASIC_DLL->GetBasResMgr()) )
{
}
BasicDLL::BasicDLL()
: m_xImpl(new Impl)
{
- BASIC_DLL() = this;
+ BASIC_DLL = this;
}
BasicDLL::~BasicDLL()
@@ -65,7 +70,7 @@ ResMgr* BasicDLL::GetBasResMgr() const { return m_xImpl->xBasResMgr.get(); }
void BasicDLL::EnableBreak( bool bEnable )
{
- BasicDLL* pThis = BASIC_DLL();
+ BasicDLL* pThis = BASIC_DLL;
DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" );
if ( pThis )
{
@@ -75,7 +80,7 @@ void BasicDLL::EnableBreak( bool bEnable )
void BasicDLL::SetDebugMode( bool bDebugMode )
{
- BasicDLL* pThis = BASIC_DLL();
+ BasicDLL* pThis = BASIC_DLL;
DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" );
if ( pThis )
{
@@ -86,7 +91,7 @@ void BasicDLL::SetDebugMode( bool bDebugMode )
void BasicDLL::BasicBreak()
{
- BasicDLL* pThis = BASIC_DLL();
+ BasicDLL* pThis = BASIC_DLL;
DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" );
if ( pThis )
{
@@ -106,7 +111,7 @@ void BasicDLL::BasicBreak()
SbxAppData& GetSbxData_Impl()
{
- return *BASIC_DLL()->m_xImpl->xSbxAppData;
+ return *BASIC_DLL->m_xImpl->xSbxAppData;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basic/basrdll.hxx b/include/basic/basrdll.hxx
index 159e85652bdf..623ec6afcbaf 100644
--- a/include/basic/basrdll.hxx
+++ b/include/basic/basrdll.hxx
@@ -43,8 +43,6 @@ public:
static void SetDebugMode( bool bDebugMode );
};
-#define BASIC_DLL() (*reinterpret_cast<BasicDLL**>(GetAppData( SHL_BASIC )) )
-
#endif // INCLUDED_BASIC_BASRDLL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/shl.hxx b/include/tools/shl.hxx
index c310c55c6141..db6693ca22c6 100644
--- a/include/tools/shl.hxx
+++ b/include/tools/shl.hxx
@@ -47,7 +47,7 @@
//20 (SHL_IDE) removed
//21 (SHL_EDIT) removed
//22 (SHL_VCED) removed
-#define SHL_BASIC 23
+//23 (SHL_BASIC) removed
//24 (SHL_HELP) removed
//25 (SHL_LNKCCH) removed
//26 (SHL_CHANNEL) removed