From ea172e69cfb23ce2072bb999f4cba4c021d77b8e Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sat, 13 Sep 2003 16:11:09 +0000 Subject: [PATCH] Compilation fixes for WXWIN_COMPATIBILITY_2_4. Don't include wx/wx.h, use the much smaller set of required headers instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/tex2rtf/src/htmlutil.cpp | 5 ++++- utils/tex2rtf/src/maths.cpp | 1 - utils/tex2rtf/src/readshg.cpp | 1 - utils/tex2rtf/src/rtfutils.cpp | 6 +++++- utils/tex2rtf/src/table.cpp | 1 - utils/tex2rtf/src/tex2any.cpp | 6 +++++- utils/tex2rtf/src/tex2any.h | 5 ++--- utils/tex2rtf/src/tex2rtf.cpp | 12 +++++++++++- utils/tex2rtf/src/tex2rtf.h | 5 +++++ utils/tex2rtf/src/texutils.cpp | 12 +++++++++++- utils/tex2rtf/src/xlputils.cpp | 6 +++++- 11 files changed, 48 insertions(+), 12 deletions(-) diff --git a/utils/tex2rtf/src/htmlutil.cpp b/utils/tex2rtf/src/htmlutil.cpp index 1029c30603..b384cf9a46 100644 --- a/utils/tex2rtf/src/htmlutil.cpp +++ b/utils/tex2rtf/src/htmlutil.cpp @@ -21,13 +21,16 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include "tex2any.h" #include "tex2rtf.h" #include "table.h" +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +#endif extern wxHashTable TexReferences; diff --git a/utils/tex2rtf/src/maths.cpp b/utils/tex2rtf/src/maths.cpp index cba6dc2ece..1999b3b916 100644 --- a/utils/tex2rtf/src/maths.cpp +++ b/utils/tex2rtf/src/maths.cpp @@ -15,7 +15,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include diff --git a/utils/tex2rtf/src/readshg.cpp b/utils/tex2rtf/src/readshg.cpp index 2a62d48bc5..76b5572908 100644 --- a/utils/tex2rtf/src/readshg.cpp +++ b/utils/tex2rtf/src/readshg.cpp @@ -25,7 +25,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include diff --git a/utils/tex2rtf/src/rtfutils.cpp b/utils/tex2rtf/src/rtfutils.cpp index e4e08c30bb..55a0a1e04f 100644 --- a/utils/tex2rtf/src/rtfutils.cpp +++ b/utils/tex2rtf/src/rtfutils.cpp @@ -21,7 +21,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include "tex2any.h" @@ -37,6 +36,11 @@ #include "bmputils.h" #include "table.h" +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +#endif + wxList itemizeStack; static int indentLevel = 0; static int forbidParindent = 0; // if > 0, no parindent (e.g. in center environment) diff --git a/utils/tex2rtf/src/table.cpp b/utils/tex2rtf/src/table.cpp index fa41681140..6d4b41dd42 100644 --- a/utils/tex2rtf/src/table.cpp +++ b/utils/tex2rtf/src/table.cpp @@ -21,7 +21,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include "wx/hash.h" diff --git a/utils/tex2rtf/src/tex2any.cpp b/utils/tex2rtf/src/tex2any.cpp index 64fee2941b..2e5df17be9 100644 --- a/utils/tex2rtf/src/tex2any.cpp +++ b/utils/tex2rtf/src/tex2any.cpp @@ -21,7 +21,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include @@ -29,6 +28,11 @@ #include #include +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +#endif + /* * Variables accessible from clients * diff --git a/utils/tex2rtf/src/tex2any.h b/utils/tex2rtf/src/tex2any.h index d194288402..81d7c9e850 100644 --- a/utils/tex2rtf/src/tex2any.h +++ b/utils/tex2rtf/src/tex2any.h @@ -10,7 +10,6 @@ ///////////////////////////////////////////////////////////////////////////// #include -#include "wx/wx.h" #include "wx/utils.h" #include "wx/list.h" #include "wx/hash.h" @@ -511,9 +510,9 @@ class CustomMacro: public wxObject inline CustomMacro(char *name, int args, char *body) { noArgs = args; - macroName = copystring(name); + macroName = strcpy(new char[strlen(name) + 1], name); if (body) - macroBody = copystring(body); + macroBody = strcpy(new char[strlen(body) + 1], body); else macroBody = NULL; } diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 89d58fed6e..f48428cc4c 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -21,7 +21,12 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" + #ifndef NO_GUI + #include "wx/menu.h" + #include "wx/textctrl.h" + #include "wx/filedlg.h" + #include "wx/msgdlg.h" + #endif #endif #ifndef NO_GUI @@ -50,6 +55,11 @@ #include "tex2rtf.xpm" #endif +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +#endif + const float versionNo = TEX2RTF_VERSION_NUMBER; TexChunk *currentMember = NULL; diff --git a/utils/tex2rtf/src/tex2rtf.h b/utils/tex2rtf/src/tex2rtf.h index b25cf89970..6ef32e3302 100644 --- a/utils/tex2rtf/src/tex2rtf.h +++ b/utils/tex2rtf/src/tex2rtf.h @@ -10,6 +10,11 @@ ///////////////////////////////////////////////////////////////////////////// #ifndef NO_GUI +#include "wx/app.h" +#include "wx/frame.h" + +class WXDLLEXPORT wxTextCtrl; + // Define a new application type class MyApp: public wxApp { public: diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index be0c83a28c..604b6da8fc 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -21,7 +21,7 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/log.h" #endif #include "wx/hash.h" @@ -42,6 +42,16 @@ using namespace std; #include #include "tex2any.h" +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +static inline void StringToInt (const wxChar *s, int *number) +{ + if (s && *s && number) + *number = (int) wxStrtol (s, (wxChar **) NULL, 10); +} +#endif + wxHashTable TexReferences(wxKEY_STRING); wxList BibList(wxKEY_STRING); wxStringList CitationList; diff --git a/utils/tex2rtf/src/xlputils.cpp b/utils/tex2rtf/src/xlputils.cpp index 217f0416c9..99c7fbd3ad 100644 --- a/utils/tex2rtf/src/xlputils.cpp +++ b/utils/tex2rtf/src/xlputils.cpp @@ -21,13 +21,17 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include "tex2any.h" #include "tex2rtf.h" #include +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +#endif + long currentBlockId = -1; static TexChunk *descriptionItemArg = NULL; static int indentLevel = 0; -- 2.45.2