diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-23 20:40:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-23 21:30:45 +0200 |
commit | a7498603d8b532a1560c3ab816ddb941ad472945 (patch) | |
tree | 03527f37fce654236318daaf8f582b251fcb2c0a | |
parent | cefe8874a142ffb170d93654790b41197c37ef78 (diff) |
basic: pimplify that
Change-Id: I0abe66ded0fd69a2720ad64e1a1426aafc7dfffb
-rw-r--r-- | basic/source/runtime/basrdll.cxx | 28 | ||||
-rw-r--r-- | include/basic/basrdll.hxx | 15 |
2 files changed, 28 insertions, 15 deletions
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx index 6438b5b8f6a6..9086a05079f2 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -29,31 +29,44 @@ #include <basrid.hxx> #include <sb.hrc> +struct BasicDLL::Impl +{ + bool bDebugMode; + bool bBreakEnabled; + + ::boost::scoped_ptr<ResMgr> pBasResMgr; + + Impl() + : bDebugMode(false) + , bBreakEnabled(true) + , pBasResMgr(ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag())) + { } +}; + BasResId::BasResId( sal_uInt32 nId ) : ResId( nId, *(BASIC_DLL()->GetBasResMgr()) ) { } BasicDLL::BasicDLL() + : m_pImpl(new Impl) { BASIC_DLL() = this; - pBasResMgr = ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag() ); - bDebugMode = false; - bBreakEnabled = true; } BasicDLL::~BasicDLL() { - delete pBasResMgr; } +ResMgr* BasicDLL::GetBasResMgr() const { return m_pImpl->pBasResMgr.get(); } + void BasicDLL::EnableBreak( bool bEnable ) { BasicDLL* pThis = BASIC_DLL(); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" ); if ( pThis ) { - pThis->bBreakEnabled = bEnable; + pThis->m_pImpl->bBreakEnabled = bEnable; } } @@ -63,7 +76,7 @@ void BasicDLL::SetDebugMode( bool bDebugMode ) DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" ); if ( pThis ) { - pThis->bDebugMode = bDebugMode; + pThis->m_pImpl->bDebugMode = bDebugMode; } } @@ -78,7 +91,8 @@ void BasicDLL::BasicBreak() DBG_ASSERT( pThis, "BasicDLL::EnableBreak: No instance yet!" ); if ( pThis ) { - if ( StarBASIC::IsRunning() && !bJustStopping && ( pThis->bBreakEnabled || pThis->bDebugMode ) ) + if (StarBASIC::IsRunning() && !bJustStopping + && (pThis->m_pImpl->bBreakEnabled || pThis->m_pImpl->bDebugMode)) { bJustStopping = true; StarBASIC::Stop(); diff --git a/include/basic/basrdll.hxx b/include/basic/basrdll.hxx index bf6ba731cb11..274126d6c461 100644 --- a/include/basic/basrdll.hxx +++ b/include/basic/basrdll.hxx @@ -20,24 +20,23 @@ #ifndef INCLUDED_BASIC_BASRDLL_HXX #define INCLUDED_BASIC_BASRDLL_HXX -class ResMgr; +#include <boost/scoped_ptr.hpp> -#include <vcl/accel.hxx> #include <basic/basicdllapi.h> +class ResMgr; + class BASIC_DLLPUBLIC BasicDLL { -private: - ResMgr* pBasResMgr; - - bool bDebugMode; - bool bBreakEnabled; +public: + struct Impl; + ::boost::scoped_ptr<Impl> m_pImpl; public: BasicDLL(); ~BasicDLL(); - ResMgr* GetBasResMgr() const { return pBasResMgr; } + ResMgr* GetBasResMgr() const; static void BasicBreak(); |