Kaydet (Commit) a4b62663 authored tarafından Chris Sherlock's avatar Chris Sherlock

vcl: Remove DummyApplication

DummyApplication is, frankly, a hack. Application is an abstract class because
Application::Main() is a pure virtual function. However, as DummyApplication
shows - this is not necessary because InitVCL() just makes a dummy app anyway.
Anyone who uses Application::Main() will get a warning.

Also: I want to move some of the global data into Application, and I can't do this
whilst it is an abstract class. Given it's not necessary, then I'm getting rid of
Main() as a pure virtual function.

Change-Id: I425cf6feae4866f5670963ee9905f6161e421dd2
üst 03c049a0
......@@ -204,13 +204,12 @@ private:
};
/**
@brief Abstract base class used mainly for the LibreOffice Desktop class.
@brief Base class used mainly for the LibreOffice Desktop class.
The Application class is an abstract class with one pure virtual
function: Main(), however, there are a \em lot of static functions
that are vital for applications. It is really meant to be subclassed
to provide a global singleton, and heavily relies on a single data
structure ImplSVData
The Application class is a base class mainly used by the Desktop
class. It is really meant to be subclassed, and the Main() function
should be overridden. Many of the ImplSVData members should be
moved to this class.
The reason Application exists is because the VCL used to be a
standalone framework, long since abandoned by anything other than
......@@ -342,7 +341,7 @@ public:
vcl/fpicker/test/svdem.cxx
*/
virtual int Main() = 0;
virtual int Main();
/** Exit from the application
......
......@@ -209,6 +209,12 @@ Application::~Application()
ImplDestroySVData();
}
int Application::Main()
{
SAL_WARN("vcl", "Application is a base class and should be overridden.");
return EXIT_SUCCESS;
}
bool Application::QueryExit()
{
WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin;
......
......@@ -200,12 +200,6 @@ static Application * pOwnSvApp = NULL;
// Exception handler. pExceptionHandler != NULL => VCL already inited
oslSignalHandler pExceptionHandler = NULL;
class DummyApplication : public Application
{
public:
int Main() SAL_OVERRIDE { return EXIT_SUCCESS; };
};
class DesktopEnvironmentContext: public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext >
{
public:
......@@ -248,7 +242,7 @@ bool InitVCL()
if( !ImplGetSVData()->mpApp )
{
pOwnSvApp = new DummyApplication();
pOwnSvApp = new Application();
}
InitSalMain();
......
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