NO_GUI bug fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,6 +101,9 @@ bool Go(void);
|
|||||||
void ShowOptions(void);
|
void ShowOptions(void);
|
||||||
|
|
||||||
#ifdef NO_GUI
|
#ifdef NO_GUI
|
||||||
|
|
||||||
|
extern char *wxBuffer; // we must init it, otherwise tex2rtf will crash
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
#else
|
#else
|
||||||
wxMenuBar *menuBar = NULL;
|
wxMenuBar *menuBar = NULL;
|
||||||
@@ -146,12 +149,16 @@ bool MyApp::OnInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NO_GUI
|
#ifdef NO_GUI
|
||||||
|
wxBuffer = new char[1500];
|
||||||
|
// this is done in wxApp, but NO_GUI version doesn't call it :-(
|
||||||
|
|
||||||
if (!InputFile || !OutputFile)
|
if (!InputFile || !OutputFile)
|
||||||
{
|
{
|
||||||
cout << "Tex2RTF: input or output file is missing.\n";
|
cout << "Tex2RTF: input or output file is missing.\n";
|
||||||
ShowOptions();
|
ShowOptions();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (InputFile)
|
if (InputFile)
|
||||||
{
|
{
|
||||||
@@ -374,10 +381,12 @@ bool MyApp::OnInit()
|
|||||||
// Return the main frame window
|
// Return the main frame window
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
|
delete[] wxBuffer;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_GUI
|
||||||
int MyApp::OnExit()
|
int MyApp::OnExit()
|
||||||
{
|
{
|
||||||
wxNode *node = CustomMacroList.First();
|
wxNode *node = CustomMacroList.First();
|
||||||
@@ -411,7 +420,7 @@ int MyApp::OnExit()
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
void ShowOptions(void)
|
void ShowOptions(void)
|
||||||
{
|
{
|
||||||
char buf[100];
|
char buf[100];
|
||||||
@@ -1073,3 +1082,13 @@ char *Tex2RTFConnection::OnRequest(const wxString& topic, const wxString& item,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NO_GUI
|
||||||
|
void wxObject::Dump(ostream& str)
|
||||||
|
{
|
||||||
|
if (GetClassInfo() && GetClassInfo()->GetClassName())
|
||||||
|
str << GetClassInfo()->GetClassName();
|
||||||
|
else
|
||||||
|
str << "unknown object class";
|
||||||
|
}
|
||||||
|
#endif
|
Reference in New Issue
Block a user