Kaydet (Commit) 51906611 authored tarafından Michael Stahl's avatar Michael Stahl

basic: move SbxAppData to a BasicDLL member

... so it is deleted by ~SfxApplication.

Change-Id: I161bd92eb9b5082d1fdeea603921d0372a4d97e6
üst a7498603
......@@ -24,6 +24,7 @@
#include <basic/sbxdef.hxx>
#include <basic/basicdllapi.h>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/noncopyable.hpp>
class SbxFactory;
class SbxVariable;
......@@ -33,6 +34,7 @@ typedef boost::ptr_vector<SbxFactory> SbxFacs;
// AppData structure for SBX:
struct SbxAppData
: private ::boost::noncopyable
{
SbxError eSbxError; // Error code
SbxFacs aFacs; // Factories
......@@ -41,13 +43,7 @@ struct SbxAppData
LanguageType eBasicFormaterLangType;
// It might be useful to store this class 'global' because some string reosurces are saved here
SbxAppData()
: eSbxError(SbxERR_OK)
, aFacs()
, pBasicFormater(NULL)
, eBasicFormaterLangType(LANGUAGE_DONTKNOW)
{
}
SbxAppData();
~SbxAppData();
};
......
......@@ -25,9 +25,9 @@ class MacroSnippet
{
private:
bool mbError;
BasicDLL maDll; // we need a dll instance for resouce manager etc.
SbModuleRef mpMod;
StarBASICRef mpBasic;
BasicDLL maDll; // we need a dll instance for resouce manager etc.
void InitSnippet()
{
......
......@@ -28,6 +28,7 @@
#include <basic/basrdll.hxx>
#include <basrid.hxx>
#include <sb.hrc>
#include <sbxbase.hxx>
struct BasicDLL::Impl
{
......@@ -35,11 +36,13 @@ struct BasicDLL::Impl
bool bBreakEnabled;
::boost::scoped_ptr<ResMgr> pBasResMgr;
::boost::scoped_ptr<SbxAppData> pSbxAppData;
Impl()
: bDebugMode(false)
, bBreakEnabled(true)
, pBasResMgr(ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag()))
, pSbxAppData(new SbxAppData)
{ }
};
......@@ -102,4 +105,9 @@ void BasicDLL::BasicBreak()
}
}
SbxAppData& GetSbxData_Impl()
{
return *BASIC_DLL()->m_pImpl->pSbxAppData;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -32,14 +32,11 @@
TYPEINIT0(SbxBase)
namespace
SbxAppData::SbxAppData()
: eSbxError(SbxERR_OK)
, pBasicFormater(0)
, eBasicFormaterLangType(LANGUAGE_DONTKNOW)
{
class theSbxAppData : public rtl::Static<SbxAppData, theSbxAppData> {};
}
SbxAppData& GetSbxData_Impl()
{
return theSbxAppData::get();
}
SbxAppData::~SbxAppData()
......
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