Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-10-05 15:38:40 +00:00
parent 908686c52e
commit 254a21292b
49 changed files with 721 additions and 792 deletions

View File

@@ -669,7 +669,7 @@ int main(int argc, char **argv)
}
directoryOut = argv[current];
if ( !!directoryOut ) {
if ( !directoryOut.IsEmpty() ) {
// terminate with a '/' if it doesn't have it
switch ( directoryOut.Last() ) {
case '/':
@@ -729,7 +729,7 @@ int main(int argc, char **argv)
// create a parser object and a visitor derivation
CJSourceParser parser;
HelpGenVisitor visitor(directoryOut, overwrite);
if ( !!ignoreFile && mode == Mode_Dump )
if ( !ignoreFile.IsEmpty() && mode == Mode_Dump )
visitor.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
spContext *ctxTop = NULL;
@@ -775,7 +775,7 @@ int main(int argc, char **argv)
}
}
if ( !!ignoreFile )
if ( !ignoreFile.IsEmpty() )
docman.GetIgnoreHandler().AddNamesFromFile(ignoreFile);
docman.DumpDifferences(ctxTop);
@@ -877,10 +877,10 @@ void HelpGenVisitor::CloseClass()
{
CloseFunction();
if ( m_inClass )
if ( m_inClass )
{
size_t count = m_arrayFuncDocs.GetCount();
if ( count )
if ( count )
{
size_t n;
FunctionDocEntry::classname = m_classname;
@@ -1417,7 +1417,7 @@ bool DocManager::ParseTeXFile(const wxString& filename)
char *buf = new char[len + 1];
buf[len] = '\0';
if ( file.Read(buf, len) == wxInvalidOffset ) {
if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf;
return false;
@@ -1988,7 +1988,7 @@ bool IgnoreNamesHandler::AddNamesFromFile(const wxString& filename)
char *buf = new char[len + 1];
buf[len] = '\0';
if ( file.Read(buf, len) == wxInvalidOffset ) {
if ( (wxFileOffset)file.Read(buf, len) == wxInvalidOffset ) {
delete [] buf;
return false;
@@ -2186,6 +2186,9 @@ static const wxString GetVersionString()
/*
$Log$
Revision 1.31 2004/10/05 15:38:29 ABX
Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.
Revision 1.30 2004/06/18 19:25:50 ABX
Small step in making HelpGen up to date unicode application.

View File

@@ -86,10 +86,6 @@ ctSettings::ctSettings(const ctSettings& settings)
}
ctSettings::~ctSettings()
{
}
void ctSettings::operator = (const ctSettings& settings)
{
Copy(settings);
@@ -265,7 +261,7 @@ bool ctSettings::SaveConfig()
// Indicate that we're no longer running, so we know if the program
// crashed last time around.
config.Write(wxT("Misc/RunningProgram"), (long) 0);
{
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistorySave(config);

View File

@@ -43,7 +43,7 @@ public:
ctSettings(const ctSettings& settings);
/// Destructor.
~ctSettings();
~ctSettings(){};
// Operations

View File

@@ -95,10 +95,6 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView)
END_EVENT_TABLE()
ctConfigToolView::ctConfigToolView()
{
}
// What to do when a view is created. Creates actual
// windows for displaying the view.
bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@@ -121,11 +117,11 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl();
if (!treeCtrl)
return;
wxASSERT (doc != NULL);
ctConfigItem* selItem = NULL;
wxTreeItemId sel = treeCtrl->GetSelection();
if (sel.IsOk())
{
@@ -133,12 +129,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
if (data)
selItem = data->GetConfigItem() ;
}
ctConfigToolHint* hint = (ctConfigToolHint*) hintObj;
int hintOp = ctNoHint;
if (hint)
hintOp = hint->m_op;
switch (hintOp)
{
case ctInitialUpdate:
@@ -151,12 +147,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
}
}
break;
case ctSelChanged:
case ctSelChanged:
{
if (selItem)
{
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
}
}
}
break;
case ctAllSaved:
@@ -175,14 +171,14 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
treeCtrl->DeleteAllItems();
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL);
break;
}
}
case ctValueChanged:
{
// ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
}
}
break;
default:
break;
}
@@ -200,7 +196,7 @@ bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow))
wxGetApp().GetDocManager()->ActivateView(this, false);
Activate(false);
wxGetApp().GetMainFrame()->SetDocument(NULL);
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
@@ -443,7 +439,7 @@ void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg)
parent = sel->GetParent();
insertBefore = sel->FindNextSibling();
}
ctConfigItem* newItem = new ctConfigItem(NULL, type, name);
newItem->InitProperties();
@@ -634,7 +630,7 @@ void ctConfigToolView::OnContextPasteAsChild(wxCommandEvent& WXUNUSED(event))
{
ctConfigItem* parent = sel;
ctConfigItem* insertBefore = NULL;
ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone();
ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE,
NULL, newItem, parent, insertBefore);
@@ -766,7 +762,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
wxString oldType = property->GetVariant().GetType();
wxString oldEditorType = property->GetEditorType();
wxArrayString oldChoices = property->GetChoices();
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
wxID_ANY, _("Edit custom property"));
dialog.SetPropertyName(oldName);
@@ -779,7 +775,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
wxString editorType = dialog.GetEditorType();
wxArrayString choices = dialog.GetChoices();
wxString descr = dialog.GetPropertyDescription();
if (name != oldName && sel->GetProperties().FindProperty(name))
{
wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
@@ -813,7 +809,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
if (descr != oldDescription)
property->SetDescription(descr);
editor->ShowItem(sel);
OnChangeFilename();
}
@@ -917,12 +913,12 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Setup File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
@@ -936,7 +932,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
}
stream << setupStr;
}
}
}
void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
@@ -949,12 +945,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Configure Command File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
@@ -968,7 +964,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
}
stream << configureStr;
}
}
}
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)

View File

@@ -33,9 +33,9 @@ class ctConfigToolView: public wxView
{
DECLARE_DYNAMIC_CLASS(ctConfigToolView)
public:
ctConfigToolView();
~ctConfigToolView() {};
ctConfigToolView(){};
~ctConfigToolView(){};
//// Overrides
bool OnCreate(wxDocument *doc, long flags);
@@ -248,7 +248,7 @@ public:
// constructors and destructors
ctFindReplaceDialog( wxWindow* parent, const wxString& title,
long style = 0 );
void OnFind(wxFindDialogEvent& event);
void OnClose(wxFindDialogEvent& event);

View File

@@ -119,7 +119,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str)
bool bResult = ParseHtml(m_topLevel);
wxASSERT(bResult); // Failed to parse the TAGs.
wxASSERT(bResult); // Failed to parse the TAGs.
// Hint: Check if every open tag has a close tag!
return bResult;
@@ -164,7 +164,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
}
else
parent->AppendTag(tag);
}
}
}
else if (IsTagStartBracket(GetChar(m_pos)))
{
@@ -189,7 +189,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
if(parent->GetParent())
parent->GetParent()->AppendTag(tag);
else
parent->AppendTag(tag); // When this occurs it is probably the
parent->AppendTag(tag); // When this occurs it is probably the
// empty lines at the end of the file...
}
}
@@ -201,7 +201,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text)
{
while (!Eof() && GetChar(m_pos) != wxT('<'))
{
text += GetChar(m_pos);
text += (wxChar)GetChar(m_pos);
m_pos ++;
}
DecodeSpecialChars(text);
@@ -441,7 +441,7 @@ bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt)
while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('='))
{
str += GetChar(pos);
str += (wxChar)GetChar(pos);
pos ++;
}
if (eatIt)
@@ -524,7 +524,7 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
// See here for the used table: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsql/ac_xml1_1nqk.asp
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
{
// XML translation
// XML translation
value.Replace(wxT("&gt;"), wxT(">"), true);
value.Replace(wxT("&lt;"), wxT("<"), true);
value.Replace(wxT("&quot;"), wxT("\""), true);
@@ -536,13 +536,13 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
{
wxString newvalue = value;
// XML translation
// XML translation
newvalue.Replace(wxT("&"), wxT("&amp;"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT("&gt;"), true);
newvalue.Replace(wxT("<"), wxT("&lt;"), true);
newvalue.Replace(wxT("\""),wxT("&quot;"), true);
newvalue.Replace(wxT("'"), wxT("&apos;"), true);
return newvalue;
}
@@ -695,7 +695,7 @@ void wxSimpleHtmlTag::RemoveChild(wxSimpleHtmlTag *remove)
{
child->m_next = NULL;
delete child;
if (prev != NULL)
prev->m_next = next;
else
@@ -721,7 +721,7 @@ void wxSimpleHtmlTag::AppendTag(wxSimpleHtmlTag* tag)
while (last->m_next)
last = last->m_next;
last->m_next = tag;
last->m_next = tag;
}
else
{
@@ -823,7 +823,7 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam
return false;
}
// Search forward from this tag until we find a tag with this name & attribute
// Search forward from this tag until we find a tag with this name & attribute
wxSimpleHtmlTag* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName)
{
wxSimpleHtmlTag* tag = m_next;
@@ -902,10 +902,10 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream)
attr->Write(stream);
if (i < GetAttributeCount() - 1)
stream << wxT(" ");
}
}
if(!m_children)
{
sbUseTab = false; // We're putting the open a close tag on the same line,
sbUseTab = false; // We're putting the open a close tag on the same line,
// so we don't wan't any tabs
stream << wxT(">");
}

View File

@@ -192,11 +192,11 @@ void ctMainFrame::OnCloseWindow(wxCloseEvent& event)
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MINIMIZED ;
else
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_NORMAL ;
// Must delete this now since the DLL loading library will be
// uninitialised by the time the app object is deleted
wxGetApp().ClearHelpControllers();
if (!IsMaximized() && !IsIconized())
{
wxGetApp().GetSettings().m_frameSize = GetRect();
@@ -279,9 +279,9 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
{
// Make a menubar
wxMenu *fileMenu = new wxMenu;
wxGetApp().GetFileHistory().UseMenu(fileMenu);
fileMenu->Append(wxID_NEW, wxT("&New...\tCtrl+N"), wxT("Create a new settings document"));
fileMenu->Append(wxID_OPEN, wxT("&Open...\tCtrl+O"), wxT("Open a settings document"));
fileMenu->Append(wxID_CLOSE, wxT("&Close\tCtrl+W"), wxT("Close the current settings document"));
@@ -297,7 +297,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
wxMenu *editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
@@ -349,9 +349,9 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
helpMenu->Append(wxID_HELP_CONTEXT, wxT("&What's this?"), wxT("Show help on the clicked item"));
helpMenu->AppendSeparator();
helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("Show details about this application"));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(editMenu, wxT("&Edit"));
menuBar->Append(viewMenu, wxT("&View"));
@@ -361,7 +361,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("wxWidgets"));
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistoryLoad(config);
}
}
return menuBar;
}
@@ -438,10 +438,6 @@ ctOutputWindow::ctOutputWindow(wxWindow* parent, wxWindowID id,
CreateWindows();
}
ctOutputWindow::~ctOutputWindow()
{
}
/// Initialise the windows.
void ctOutputWindow::CreateWindows()
{
@@ -492,13 +488,13 @@ void ctOutputWindow::OnCopyToClipboard(wxCommandEvent& WXUNUSED(event))
wxMessageBox(_("Sorry, could not open the clipboard."), _("Clipboard problem"), wxICON_EXCLAMATION|wxOK);
return;
}
wxString value(m_codeCtrl->GetValue());
#ifdef __WXMSW__
value.Replace(_T("\n"), _T("\r\n"));
#endif
wxTextDataObject *data = new wxTextDataObject( value );
if (!wxTheClipboard->SetData( data ))
{
wxTheClipboard->Close();

View File

@@ -41,7 +41,7 @@ class ctConfigurationBrowserWindow;
class ctMainFrame: public wxDocParentFrame
{
DECLARE_CLASS(ctMainFrame)
public:
public:
/// Constructor.
ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
@@ -124,7 +124,7 @@ class ctMainFrame: public wxDocParentFrame
/// Returns the configure page window
ctOutputWindow* GetConfigurePage() const { return m_configurePage; }
/// Returns the main notebook containing editor and text tabs
/// Returns the main notebook containing editor and text tabs
wxNotebook* GetMainNotebook() const { return m_mainNotebook; }
/// Sets the find dialog for future closing
@@ -178,7 +178,7 @@ DECLARE_CLASS(ctOutputWindow)
public:
ctOutputWindow(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
~ctOutputWindow();
~ctOutputWindow(){};
/// Initialise the windows.
void CreateWindows();

View File

@@ -65,10 +65,6 @@ ctPropertyEditor::ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoin
CreateControls(this);
}
ctPropertyEditor::~ctPropertyEditor()
{
}
void ctPropertyEditor::CreateControls(wxWindow* parent)
{
m_elementTitleTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);

View File

@@ -35,7 +35,7 @@ class ctPropertyEditor: public wxPanel
DECLARE_CLASS(ctPropertyEditor)
public:
ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
~ctPropertyEditor();
~ctPropertyEditor(){};
// Event handlers
@@ -216,7 +216,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
bool AddControls(wxWindow* parent, const wxString& msg);
wxString GetText() const { return m_text; }
@@ -231,7 +231,7 @@ private:
* Special-purpose splitter window for changing sash look and
* also saving sash width
*/
class ctSplitterWindow: public wxSplitterWindow
{
public:

View File

@@ -82,9 +82,9 @@ wxString apColourToHexString(const wxColour& col)
// Convert 6-digit hex string to a colour
wxColour apHexStringToColour(const wxString& hex)
{
unsigned int r = wxHexToDec(hex.Mid(0, 2));
unsigned int g = wxHexToDec(hex.Mid(2, 2));
unsigned int b = wxHexToDec(hex.Mid(4, 2));
unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
@@ -132,7 +132,7 @@ wxFont apStringToFont(const wxString& str)
pointSize = 8;
if (pointSize == 9)
pointSize = 10;
#endif
#endif
}
else if (i == 1)
family = StringToInt(token);
@@ -230,7 +230,7 @@ wxString wxGetTempDir()
wxString envVar(wxGetenv(_T("TEMP")));
dir = envVar;
}
if ( dir.empty() )
{
// default
@@ -312,25 +312,25 @@ wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin
}
// Adds a context-sensitive help button, for non-Windows platforms
void apAddContextHelpButton(wxWindow*
void apAddContextHelpButton(wxWindow*
#if defined(__WXGTK__) || defined(__WXMAC__)
parent
#else
WXUNUSED(parent)
#endif
, wxSizer*
, wxSizer*
#if defined(__WXGTK__) || defined(__WXMAC__)
sizer
#else
WXUNUSED(sizer)
#endif
, int
, int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerFlags
#else
WXUNUSED(sizerFlags)
#endif
, int
, int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerBorder
#else
@@ -392,7 +392,7 @@ int wxIconInfo::GetIconId(int state, bool enabled) const
{
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
wxASSERT ( state < m_maxStates );
return m_states[state * 2 + (enabled ? 0 : 1)];
}
@@ -401,7 +401,7 @@ void wxIconInfo::SetIconId(int state, bool enabled, int iconId)
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
if (state+1 > m_maxStates)
m_maxStates = state+1;
m_states[state * 2 + (enabled ? 0 : 1)] = iconId;
}
@@ -426,7 +426,7 @@ void wxIconTable::AppendInfo(wxIconInfo* info)
bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, bool enabled)
{
wxASSERT (m_imageList != NULL);
wxIconInfo* info = FindInfo(name);
if (!info)
{

View File

@@ -57,27 +57,23 @@ ctApp::ctApp()
m_docManager = NULL;
}
ctApp::~ctApp()
{
}
bool ctApp::OnInit(void)
{
#if wxUSE_LOG
wxLog::SetTimestamp(NULL);
#endif // wxUSE_LOG
wxHelpProvider::Set(new wxSimpleHelpProvider);
#if wxUSE_LIBPNG
wxImage::AddHandler( new wxPNGHandler );
#endif
#if wxUSE_LIBJPEG
wxImage::AddHandler( new wxJPEGHandler );
#endif
#if wxUSE_GIF
wxImage::AddHandler( new wxGIFHandler );
#endif
@@ -124,13 +120,13 @@ bool ctApp::OnInit(void)
m_settings.Init();
LoadConfig();
wxString helpFilePathReference(GetFullAppPath(_("wx")));
m_helpControllerReference->Initialize(helpFilePathReference);
wxString helpFilePath(GetFullAppPath(_("configtool")));
m_helpController->Initialize(helpFilePath);
ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, wxID_ANY, wxGetApp().GetSettings().GetAppName(),
GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(),
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
@@ -194,16 +190,16 @@ bool ctApp::OnInit(void)
doc->SetDocumentSaved(true);
}
}
GetTopWindow()->Show(true);
return true;
}
int ctApp::OnExit(void)
{
SaveConfig();
// Save the file history
{
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("Generic Organisation"));
@@ -212,7 +208,7 @@ int ctApp::OnExit(void)
delete m_docManager;
m_docManager = NULL;
return 0;
}
@@ -220,7 +216,7 @@ void ctApp::ClearHelpControllers()
{
delete m_helpController;
m_helpController = NULL;
delete m_helpControllerReference;
m_helpControllerReference = NULL;
}
@@ -233,7 +229,7 @@ wxString ctApp::GetFullAppPath(const wxString& filename) const
if (path.Last() != wxFILE_SEP_PATH && filename[0] != wxFILE_SEP_PATH)
path += wxFILE_SEP_PATH;
path += filename;
return path;
}

View File

@@ -43,7 +43,7 @@ public:
ctApp();
/// Destructor.
~ctApp();
~ctApp(){};
// Accessors

View File

@@ -557,9 +557,9 @@ wxString wxColourToHexString(const wxColour& col)
// Convert 6-digit hex string to a colour
wxColour wxHexStringToColour(const wxString& hex)
{
unsigned int r = wxHexToDec(hex.Mid(0, 2));
unsigned int g = wxHexToDec(hex.Mid(2, 2));
unsigned int b = wxHexToDec(hex.Mid(4, 2));
unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}

View File

@@ -68,7 +68,8 @@ bool hvApp::OnInit()
int istyle = wxHF_DEFAULT_STYLE;
wxString service, windowName, book[10], titleFormat, argStr;
wxString service, windowName, titleFormat, argStr;
wxString book[10];
int bookCount = 0;
int i;
bool hasService = false;

View File

@@ -22,7 +22,7 @@ void DecToHex(int dec, wxChar *buf)
buf[1] = hexArray[secondDigit];
buf[2] = 0;
}
static unsigned int getshort(FILE *fp)
{
int c, c1;
@@ -35,7 +35,7 @@ static unsigned long getint(FILE *fp)
int c, c1, c2, c3;
c = getc(fp); c1 = getc(fp); c2 = getc(fp); c3 = getc(fp);
return (long)((long) c) +
(((long) c1) << 8) +
(((long) c1) << 8) +
(((long) c2) << 16) +
(((long) c3) << 24);
}
@@ -44,20 +44,20 @@ bool GetBMPHeader(FILE *fp, int *Width, int *Height, int *Planes, int *BitsPerPi
{
// Remember about all fields but store only important ones
unsigned long /*
bfSize,
bfOffBits,
biSize,
*/
biWidth,
biHeight,
bfSize,
bfOffBits,
biSize,
*/
biWidth,
biHeight,
biPlanes,
biBitCount
/* ,
biCompression,
biSizeImage,
biXPelsPerMeter,
biYPelsPerMeter,
biClrUsed,
biSizeImage,
biXPelsPerMeter,
biYPelsPerMeter,
biClrUsed,
biClrImportant
*/
;
@@ -161,7 +161,7 @@ struct mfPLACEABLEHEADER {
bool GetMetafileHeader(FILE *handle, int *width, int *height)
{
char buffer[40];
mfPLACEABLEHEADER *theHeader = (mfPLACEABLEHEADER *)&buffer;
mfPLACEABLEHEADER *theHeader = (mfPLACEABLEHEADER *)&buffer[0];
fread((void *)theHeader, sizeof(char), sizeof(mfPLACEABLEHEADER), handle);
if (theHeader->key != 0x9AC6CDD7)
{
@@ -223,7 +223,7 @@ bool OutputMetafileData(FILE *handle)
int ch;
do
{
ch = getc(handle);
ch = getc(handle);
if (bytesSoFar == scanLineWidth)
{
bytesSoFar = 0;

View File

@@ -208,7 +208,7 @@ void ResetContentsLevels(int l)
int i;
for (i = l; i < 5; i++)
ContentsLevels[i] = false;
// There are always books on the top level
ContentsLevels[0] = true;
}
@@ -218,7 +218,7 @@ void ResetContentsLevels(int l)
void OutputSectionKeyword(FILE *fd)
{
OutputCurrentSectionToString(wxTex2RTFBuffer);
unsigned int i;
for (i = 0; i < wxStrlen(wxTex2RTFBuffer); i++)
if (wxTex2RTFBuffer[i] == ':')
@@ -229,7 +229,7 @@ void OutputSectionKeyword(FILE *fd)
wxFprintf(fd, _T("K{\\footnote {K} "));
wxFprintf(fd, _T("%s"), wxTex2RTFBuffer);
wxFprintf(fd, _T("}\n"));
}
@@ -242,12 +242,12 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
int d=0;
while ( (xitle[s]!=0)&&(d<255) )
{
wxChar ch=xitle[s]&0xff;
wxChar ch=wxChar(xitle[s]&0xff);
if (ch==0x5c) {
wxChar ch1=xitle[s+1]&0xff;
wxChar ch2=xitle[s+2]&0xff;
wxChar ch3=xitle[s+3]&0xff;
s+=4; // next character
wxChar ch1=wxChar(xitle[s+1]&0xff);
wxChar ch2=wxChar(xitle[s+2]&0xff);
wxChar ch3=wxChar(xitle[s+3]&0xff);
s+=4; // next character
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('<EFBFBD>'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('<EFBFBD>'); }
@@ -257,7 +257,7 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
} else {
title[d++]=ch;
s++;
}
}
}
title[d]=0;
@@ -267,12 +267,9 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
if (level == 0) // Means we had a Chapter in an article, oops.
return;
ResetContentsLevels(level);
if (!title)
return;
if (winHelp && winHelpContents && WinHelpContentsFile)
{
TexTopic *texTopic = (TexTopic *)TopicTable.Get(topicName);
@@ -352,7 +349,7 @@ void GenerateKeywordsForTopic(wxChar *topic)
// Must separate out main entry form subentry (only 1 subentry allowed)
wxChar buf1[100]; wxChar buf2[100];
SplitIndexEntry(s, buf1, buf2);
// Check for ':' which messes up index
unsigned int i;
for (i = 0; i < wxStrlen(buf1) ; i++)
@@ -382,7 +379,7 @@ void GenerateKeywordsForTopic(wxChar *topic)
* Output index entry in linear RTF
*
*/
void GenerateIndexEntry(wxChar *entry)
{
if (useWord)
@@ -405,7 +402,7 @@ void GenerateIndexEntry(wxChar *entry)
* Write a suitable RTF header.
*
*/
void WriteColourTable(FILE *fd)
{
wxFprintf(fd, _T("{\\colortbl"));
@@ -474,7 +471,7 @@ void WriteRTFHeader(FILE *fd)
// Table of contents styles
wxFprintf(fd, _T("{\\s20\\sb300\\tqr\\tldot\\tx8640 \\b\\f2 \\sbasedon0\\snext0 toc 1;}\n"));
wxFprintf(fd, _T("{\\s21\\sb90\\tqr\\tldot\\li400\\tqr\\tx8640 \\f2\\fs20\\sbasedon0\\snext0 toc 2;}\n"));
wxFprintf(fd, _T("{\\s22\\sb90\\tqr\\tldot\\li800\\tx8640 \\f2\\fs20 \\sbasedon0\\snext0 toc 3;}\n"));
wxFprintf(fd, _T("{\\s23\\sb90\\tqr\\tldot\\li1200\\tx8640 \\f2\\fs20 \\sbasedon0\\snext0 toc 4;}\n"));
@@ -522,7 +519,7 @@ void OutputNumberStyle(wxChar *numberStyle)
/*
* Write a Windows help project file
*/
bool WriteHPJ(wxChar *filename)
{
wxChar hpjFilename[256];
@@ -537,7 +534,7 @@ bool WriteHPJ(wxChar *filename)
wxStrcpy(rtfFile, helpFile);
wxStrcat(helpFile, _T(".hlp"));
wxStrcat(rtfFile, _T(".rtf"));
FILE *fd = wxFopen(hpjFilename, _T("w"));
if (!fd)
return false;
@@ -545,7 +542,7 @@ bool WriteHPJ(wxChar *filename)
wxChar *helpTitle = winHelpTitle;
if (!helpTitle)
helpTitle = _T("Untitled");
wxString thePath = wxPathOnly(InputFile);
if (thePath.IsEmpty())
thePath = _T(".");
@@ -703,7 +700,7 @@ void ProcessText2RTF(TexChunk *chunk)
* and before TraverseDocument is called.
*
*/
void Text2RTF(TexChunk *chunk)
{
Tex2RTFYield();
@@ -758,7 +755,7 @@ void Text2RTF(TexChunk *chunk)
* Not used yet
*
*/
wxChar browseBuf[10];
static long browseId = 0;
wxChar *GetBrowseString(void)
@@ -879,7 +876,7 @@ void OutputRTFHeaderCommands(void)
{
int oldForbidResetPar = forbidResetPar;
forbidResetPar = 0;
if (LeftHeaderEven || CentreHeaderEven || RightHeaderEven)
{
TexOutput(_T("{\\headerl\\fi0 "));
@@ -1147,7 +1144,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
OutputRTFHeaderCommands();
OutputRTFFooterCommands();
}
// Need to reset the current numbering style, or RTF forgets it.
SetCurrentOutput(Chapters);
OutputNumberStyle(currentNumberStyle);
@@ -1168,14 +1165,14 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else SetCurrentOutput(NULL); // No entry in table of contents
}
}
startedSections = true;
// Output heading to contents page
if (!InPopups())
{
OutputCurrentSection();
if (winHelp)
{
wxFprintf(Contents, _T("}{\\v %s}\\pard\\par\n"), topicName);
@@ -1187,12 +1184,12 @@ void RTFOnMacro(int macroId, int no_args, bool start)
// From here, just output to chapter
SetCurrentOutput(Chapters);
}
if (winHelp)
{
wxFprintf(Chapters, _T("}\n#{\\footnote %s}\n"), topicName);
wxFprintf(Chapters, _T("+{\\footnote %s}\n"), GetBrowseString());
OutputSectionKeyword(Chapters);
GenerateKeywordsForTopic(topicName);
@@ -1318,7 +1315,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
}
}
else SetCurrentOutput(NULL);
}
}
if (startedSections)
{
@@ -1349,7 +1346,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else
wxFprintf(Contents, _T("}\\par\\par\\pard\n"));
}
SetCurrentOutput(winHelp ? Sections : Chapters);
if (winHelp)
@@ -1386,7 +1383,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
wxChar *keep = _T("");
if (winHelp && (macroId != ltGLOSS) && !InPopups())
keep = _T("\\keepn\\sa140\\sb140");
wxFprintf(winHelp ? Sections : Chapters, _T("\\pard{%s%s"),
keep, styleCommand);
@@ -1490,7 +1487,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
#if 0
else
wxFprintf(Chapters, _T("\\par\n"));
#endif
#endif
}
startedSections = true;
@@ -1585,7 +1582,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
}
}
OutputCurrentSection(); // Repeat section header
// Experimental JACS
TexOutput(_T("\\par\\pard}\n"));
// TexOutput(_T("\\par\\pard}\\par\n"));
@@ -1641,7 +1638,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else
SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else
}
if (startedSections)
{
if (winHelp)
@@ -1650,7 +1647,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
#if 0
else
wxFprintf(Chapters, _T("\\par\n"));
#endif
#endif
}
startedSections = true;
@@ -1668,7 +1665,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
}
else if ((DocumentStyle == LATEX_ARTICLE) && (macroId != ltSUBSUBSECTIONSTAR))
wxFprintf(Contents, _T("\\par\\pard\n"));
SetCurrentOutput(winHelp ? Subsubsections : Chapters);
if (winHelp)
{
@@ -1708,7 +1705,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
WriteHeadingStyle((winHelp ? Subsubsections : Chapters),
(DocumentStyle == LATEX_ARTICLE ? 3 : 4));
wxFprintf(winHelp ? Subsubsections : Chapters, _T(" "));
if (!winHelp)
{
if ((macroId != ltSUBSUBSECTIONSTAR))
@@ -2003,7 +2000,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
@@ -2072,7 +2069,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
ItemizeStruc *struc = new ItemizeStruc(listType, indentSize2, indentSize1);
itemizeStack.Insert(struc);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\tx%d\\li%d\\sa200"), indentSize1, indentSize2, indentSize2);
PushEnvironmentStyle(buf);
}
@@ -2113,7 +2110,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
ItemizeStruc *struc = new ItemizeStruc(LATEX_TWOCOL, indentSize);
itemizeStack.Insert(struc);
// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\ri%d"), indentSize, indentSize, TwoColWidthA+TwoColWidthB+oldIndent);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200"), indentSize, indentSize);
PushEnvironmentStyle(buf);
@@ -2143,7 +2140,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
OnMacro(ltPAR, 0, true);
OnMacro(ltPAR, 0, false);
}
#endif
#endif
}
break;
}
@@ -2266,7 +2263,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
// WriteEnvironmentStyles();
}
#endif
#endif
// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\fi-%d\\ri%d\n"), TwoColWidthA,
// TwoColWidthA, TwoColWidthA, TwoColWidthA+TwoColWidthB+oldIndent);
@@ -2299,7 +2296,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
else issuedNewParagraph = 0;
}
#endif
if (macroId == ltVERBATIM)
wxSnprintf(buf, sizeof(buf), _T("{\\f3\\s10\\fs20\\li720\\sa0 "));
else
@@ -2317,7 +2314,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
#if 0
TexOutput(_T("\\par\n"));
issuedNewParagraph = 1;
#endif
#endif
}
}
break;
@@ -2508,7 +2505,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
case ltRMFAMILY:
case ltRM:
{
/*
/*
if (start)
{
TexOutput(_T("{\\plain "));
@@ -2585,7 +2582,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
{
TexOutput(_T("\\par\\pard"));
issuedNewParagraph ++;
// Extra par if parskip is more than zero (usually looks best.)
// N.B. JACS 2004-02-21: shouldn't need this for linear RTF if
// we have a suitable set of styles.
@@ -2595,7 +2592,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
TexOutput(_T("\\par"));
issuedNewParagraph ++;
}
#endif
#endif
WriteEnvironmentStyles();
}
// 1 is a whole paragraph if ParSkip == 0,
@@ -2611,7 +2608,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
TexOutput(_T("\\par"));
issuedNewParagraph ++;
}
#endif
#endif
WriteEnvironmentStyles();
}
/*
@@ -3231,7 +3228,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
{
if (!suppressNameDecoration) TexOutput(_T("}"));
}
if (start && (arg_no == 3))
TexOutput(_T("("));
if (!start && (arg_no == 3))
@@ -3339,7 +3336,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (start)
{
wxChar *sec = NULL;
wxChar *refName = GetArgData();
if (winHelp || !useWord)
{
@@ -3547,10 +3544,10 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
{
if (arg_no == 3)
return false;
static int imageWidth = 0;
static int imageHeight = 0;
if (start && (arg_no == 1))
{
wxChar *imageDimensions = copystring(GetArgData());
@@ -3581,7 +3578,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (imageDimensions) // glt
delete [] imageDimensions;
return false;
}
}
else if (start && (arg_no == 2 ))
{
wxChar *filename = copystring(GetArgData());
@@ -3702,7 +3699,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
}
else
{
#endif
#endif
TexOutput(_T("[No BMP or WMF for image file "));
TexOutput(filename);
TexOutput(_T("]"));
@@ -4476,7 +4473,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (currentNumberStyle) delete[] currentNumberStyle;
currentNumberStyle = copystring(data);
OutputNumberStyle(currentNumberStyle);
TexOutput(_T("\n"));
}
return false;
@@ -4687,7 +4684,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
@@ -4753,7 +4750,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200 "), indentSize, indentSize);
PushEnvironmentStyle(buf);
TexOutput(buf);
@@ -4796,7 +4793,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\lr%d\\sa200\\box%s "), indentSize, indentSize, indentSizeRight,
((macroId == ltCENTEREDBOX) ? _T("\\brdrs") : _T("\\brdrdb")));
PushEnvironmentStyle(buf);
@@ -4920,7 +4917,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
OutputRTFHeaderCommands();
OutputRTFFooterCommands();
}
// Need to reset the current numbering style, or RTF forgets it.
OutputNumberStyle(currentNumberStyle);
SetCurrentOutput(Contents);
@@ -4960,7 +4957,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
wxFileNameFromPath(FileRoot), "Contents");
}
}
SetCurrentOutput(Chapters);
wxChar *styleCommand = _T("");
if (!winHelp && useHeadingStyles)
@@ -5171,7 +5168,7 @@ bool RTFGo(void)
startedSections = false;
inVerbatim = false;
browseId = 0;
if (InputFile && OutputFile)
{
// Do some RTF-specific transformations on all the strings,
@@ -5218,7 +5215,7 @@ bool RTFGo(void)
wxFprintf(Chapters, _T("\\titlepg\n"));
wxFprintf(Contents, _T("\\par\\pard\\pgnrestart\\sect\\titlepg"));
}
// In WinHelp, Contents title takes font of title.
// In linear RTF, same as chapter headings.
wxFprintf(Contents, _T("{\\b\\fs%d %s}\\par\\par\\pard\n\n"),
@@ -5226,7 +5223,7 @@ bool RTFGo(void)
// By default, Swiss, 11 point.
wxFprintf(Chapters, _T("\\f2\\fs22\n"));
PushEnvironmentStyle(_T("\\f2\\fs22\\sa200"));
SetCurrentOutput(Chapters);
@@ -5248,7 +5245,7 @@ bool RTFGo(void)
fclose(Header);
PopEnvironmentStyle();
Tex2RTFYield(true);
if (winHelp)
{
@@ -5324,7 +5321,7 @@ bool RTFGo(void)
Tex2RTFYield(true);
wxRemoveFile(_T("tmp1.rtf"));
}
if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
if (!wxRenameFile(TmpContentsName, ContentsName))
@@ -5335,7 +5332,7 @@ bool RTFGo(void)
wxRemoveFile(_T("chapters.rtf"));
wxRemoveFile(_T("header.rtf"));
if (winHelp)
{
wxRemoveFile(_T("sections.rtf"));

View File

@@ -38,7 +38,7 @@ static inline wxChar* copystring(const wxChar* s)
* Variables accessible from clients
*
*/
TexChunk * DocumentTitle = NULL;
TexChunk * DocumentAuthor = NULL;
TexChunk * DocumentDate = NULL;
@@ -181,7 +181,7 @@ wxChar *UpNameString = copystring(_T("Up"));
* Section numbering
*
*/
int chapterNo = 0;
int sectionNo = 0;
int subsectionNo = 0;
@@ -193,7 +193,7 @@ int tableNo = 0;
* Other variables
*
*/
FILE *CurrentOutput1 = NULL;
FILE *CurrentOutput2 = NULL;
FILE *Inputs[15];
@@ -302,7 +302,7 @@ void ForbidWarning(TexMacroDef *def)
break;
}
}
TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBrace)
{
*parseToBrace = true;
@@ -359,11 +359,11 @@ TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBra
macroBuf[j-i] = 0;
def = (TexMacroDef *)MacroDefs.Get(macroBuf);
}
if (def)
{
i = j;
// We want to check whether this is a space-consuming macro
// (e.g. {\bf word})
// No brace, e.g. \input thing.tex instead of \input{thing};
@@ -492,7 +492,7 @@ bool read_a_line(wxChar *buf)
if ((ch1 == 10) || (ch1 == 13))
{
// Eliminate newline (10) following DOS linefeed
if (ch1 == 13)
if (ch1 == 13)
getc(Inputs[CurrentInputIndex]);
buf[bufIndex] = 0;
IncrementLineNumber();
@@ -522,7 +522,7 @@ bool read_a_line(wxChar *buf)
return false;
}
buf[bufIndex] = ch;
buf[bufIndex] = (wxChar)ch;
bufIndex ++;
}
}
@@ -537,7 +537,7 @@ bool read_a_line(wxChar *buf)
case 0xfc: // <20>
case 0xd6: // <20>
case 0xc4: // <20>
case 0xdc: // <20>
case 0xdc: // <20>
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
@@ -556,11 +556,11 @@ bool read_a_line(wxChar *buf)
case 0xfc:buf[bufIndex++]='u';break; // <20>
case 0xd6:buf[bufIndex++]='O';break; // <20>
case 0xc4:buf[bufIndex++]='A';break; // <20>
case 0xdc:buf[bufIndex++]='U';break; // <20>
}
case 0xdc:buf[bufIndex++]='U';break; // <20>
}
buf[bufIndex++]='}';
break;
case 0xdf: // <20>
case 0xdf: // <20>
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
@@ -574,7 +574,7 @@ bool read_a_line(wxChar *buf)
buf[bufIndex++]='s';
buf[bufIndex++]='\\';
buf[bufIndex++]='/';
break;
break;
default:
if (bufIndex >= MAX_LINE_BUFFER_SIZE)
{
@@ -584,11 +584,11 @@ bool read_a_line(wxChar *buf)
OnError((wxChar *)errBuf.c_str());
return false;
}
// If the current character read in is a '_', we need to check
// If the current character read in is a '_', we need to check
// whether there should be a '\' before it or not
if (ch != '_')
{
buf[bufIndex++] = ch;
buf[bufIndex++] = (wxChar)ch;
break;
}
@@ -625,7 +625,7 @@ bool read_a_line(wxChar *buf)
}
}
}
buf[bufIndex++] = ch;
buf[bufIndex++] = (wxChar)ch;
break;
} // switch
} // else
@@ -635,7 +635,7 @@ bool read_a_line(wxChar *buf)
buf[bufIndex] = 0;
fclose(Inputs[CurrentInputIndex]);
Inputs[CurrentInputIndex] = NULL;
if (CurrentInputIndex > 0)
if (CurrentInputIndex > 0)
ch = ' '; // No real end of file
CurrentInputIndex --;
@@ -687,7 +687,7 @@ bool read_a_line(wxChar *buf)
j -= 5;
buf[j] = 0;
}
if (buf[j-1] == '}')
buf[j-1] = 0; // Ignore final brace
@@ -753,7 +753,7 @@ bool read_a_line(wxChar *buf)
buf[j] = 0;
}
if (buf[j-1] == _T('}'))
if (buf[j-1] == _T('}'))
buf[j-1] = 0; // Ignore final brace
// Remove backslashes from name
@@ -975,7 +975,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
{
Tex2RTFYield();
if (stopRunning) return pos;
bool eof = false;
BigBuffer[0] = 0;
int buf_ptr = 0;
@@ -1005,7 +1005,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
}
}
*/
// If not parsing to brace, just read the next word
// (e.g. \vskip 20pt)
if (!parseToBrace)
@@ -1014,7 +1014,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
while (!eof && ch != 13 && ch != 32 && ch != 10 &&
ch != 0 && ch != '{')
{
BigBuffer[buf_ptr] = ch;
BigBuffer[buf_ptr] = (wxChar)ch;
buf_ptr ++;
pos ++;
ch = buffer[pos];
@@ -1124,7 +1124,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
children.Append((wxObject *)chunk);
}
pos ++;
// Try matching \end{environment}
if (environment && FindEndEnvironment(buffer, &pos, environment))
{
@@ -1190,7 +1190,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
}
else
{
wxTex2RTFBuffer[i] = ch;
wxTex2RTFBuffer[i] = (wxChar)ch;
pos ++;
i ++;
if (ch == 0)
@@ -1221,7 +1221,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
if (buffer[pos] == '*')
pos ++;
// Find the delimiter character
// Find the delimiter character
int ch = buffer[pos];
pos ++;
// Now at start of verbatim text
@@ -1297,7 +1297,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
wxStrcat(macroBuf, _T("}"));
ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
// delete chunk; // Might delete children
}
}
@@ -1353,7 +1353,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
wxStrcat(macroBuf, _T("}"));
ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
// delete chunk; // Might delete children
}
}
@@ -1557,7 +1557,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos, wxCha
* Consume as many arguments as the macro definition specifies
*
*/
int ParseMacroBody(const wxChar *WXUNUSED(macro_name), TexChunk *parent,
int no_args, wxChar *buffer, int pos,
wxChar *environment, bool parseToBrace,
@@ -1674,11 +1674,11 @@ bool TexLoadFile(wxChar *filename)
TexPathList.EnsureFileAccessible(filename);
if (line_buffer)
if (line_buffer)
delete line_buffer;
line_buffer = new wxChar[MAX_LINE_BUFFER_SIZE];
Inputs[0] = wxFopen(filename, _T("r"));
LineNumbers[0] = 1;
FileNames[0] = copystring(filename);
@@ -1725,7 +1725,7 @@ TexChunk::TexChunk(TexChunk& toCopy)
no_args = toCopy.no_args;
argn = toCopy.argn;
macroId = toCopy.macroId;
// if (toCopy.name)
// name = copystring(toCopy.name);
// else
@@ -1736,7 +1736,7 @@ TexChunk::TexChunk(TexChunk& toCopy)
value = copystring(toCopy.value);
else
value = NULL;
optional = toCopy.optional;
wxNode *node = toCopy.children.GetFirst();
while (node)
@@ -1776,7 +1776,7 @@ int GetNoArgs(void) // Number of args for this macro
* only!)
*
*/
void GetArgData1(TexChunk *chunk)
{
switch (chunk->type)
@@ -2066,7 +2066,7 @@ void TexCleanUp(void)
refNode = TexReferences.Next();
}
TexReferences.Clear();
wxNode* bibNode = BibList.GetFirst();
while (bibNode)
{
@@ -2506,7 +2506,7 @@ void DefineDefaultMacros(void)
AddMacroDef(ltUPSHAPE, _T("upshape"), 1);
AddMacroDef(ltURLREF, _T("urlref"), 2);
AddMacroDef(ltUSEPACKAGE, _T("usepackage"), 1);
AddMacroDef(ltVAREPSILON, _T("varepsilon"), 0);
AddMacroDef(ltVARPHI, _T("varphi"), 0);
AddMacroDef(ltVARPI, _T("varpi"), 0);
@@ -2570,7 +2570,7 @@ void DefineDefaultMacros(void)
* Default behaviour, should be called by client if can't match locally.
*
*/
// Called on start/end of macro examination
void DefaultOnMacro(int macroId, int no_args, bool start)
{
@@ -2691,7 +2691,7 @@ void DefaultOnMacro(int macroId, int no_args, bool start)
TexOutput(_T("(r)"), true);
break;
case ltBACKSLASH:
if (start)
if (start)
TexOutput(_T("\\"), true);
break;
case ltLDOTS:
@@ -3174,7 +3174,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
else
{
wxString informBuf;
informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
OnInform((wxChar *)informBuf.c_str());
}
}
@@ -3222,7 +3222,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
DocumentStyle = LATEX_LETTER;
else if (wxStrncmp(DocumentStyleString, _T("slides"), 6) == 0)
DocumentStyle = LATEX_SLIDES;
if (StringMatch(_T("10"), DocumentStyleString))
SetFontSizes(10);
else if (StringMatch(_T("11"), DocumentStyleString))
@@ -3436,12 +3436,12 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
if (fd)
{
ch = getc(fd);
smallBuf[0] = ch;
smallBuf[0] = (wxChar)ch;
while (ch != EOF)
{
TexOutput(smallBuf);
ch = getc(fd);
smallBuf[0] = ch;
smallBuf[0] = (wxChar)ch;
}
fclose(fd);
}
@@ -3515,7 +3515,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
s1[i] = wxToupper(s[i]);
s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
return false;
@@ -3535,7 +3535,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
s1[i] = wxTolower(s[i]);
s1[i] = (wxChar)wxTolower(s[i]);
TexOutput(s1);
delete[] s1;
return false;
@@ -3555,7 +3555,7 @@ bool DefaultOnArgument(int macroId, int arg_no, bool start)
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
s1[i] = wxToupper(s[i]);
s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
return false;

View File

@@ -430,7 +430,7 @@ bool MyApp::OnInit()
ReadCustomMacros((wxChar*)path.c_str());
Go();
if (runTwice)
if (runTwice)
{
Go();
}
@@ -1118,7 +1118,7 @@ void OnInform(const wxChar *msg)
/* This whole block of code is just wrong I think. It would behave
completely wrong under anything other than MSW due to the ELSE
with no statement, and the cout calls would fail under MSW, as
the code in this block is compiled if !NO_GUI This code has been
the code in this block is compiled if !NO_GUI This code has been
here since v1.1 of this file too. - gt
else
#ifdef __WXMSW__
@@ -1213,10 +1213,6 @@ Tex2RTFConnection::Tex2RTFConnection(wxChar *buf, int size):wxDDEConnection(buf,
{
}
Tex2RTFConnection::~Tex2RTFConnection(void)
{
}
bool SplitCommand(wxChar *data, wxChar *firstArg, wxChar *secondArg)
{
firstArg[0] = 0;

View File

@@ -22,7 +22,7 @@
#endif
// Define a new application type
class MyApp: public
class MyApp: public
#ifndef NO_GUI
wxApp
#else
@@ -74,7 +74,7 @@ class Tex2RTFConnection: public wxDDEConnection
{
public:
Tex2RTFConnection(wxChar *buf, int size);
~Tex2RTFConnection(void);
~Tex2RTFConnection(void){};
bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format);
wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
};

View File

@@ -88,20 +88,20 @@ void OutputChunkToString(TexChunk *chunk, wxChar *buf)
FILE *tempfd = wxFopen(_T("tmp.tmp"), _T("w"));
if (!tempfd)
return;
FILE *old1 = CurrentOutput1;
FILE *old2 = CurrentOutput2;
CurrentOutput1 = tempfd;
CurrentOutput2 = NULL;
TraverseChildrenFromChunk(chunk);
CurrentOutput1 = old1;
CurrentOutput2 = old2;
fclose(tempfd);
// Read from file into string
tempfd = wxFopen(_T("tmp.tmp"), _T("r"));
if (!tempfd)
@@ -177,7 +177,7 @@ wxChar *FindTopicName(TexChunk *chunk)
{
if (forceTopicName)
return forceTopicName;
wxChar *topicName = NULL;
static wxChar topicBuf[100];
@@ -216,7 +216,7 @@ wxChar *FindTopicName(TexChunk *chunk)
* Snag is that some save a TexChunk, so don't use yet...
*
*/
void StartSimulateArgument(wxChar *data)
{
wxStrcpy(currentArgData, data);
@@ -243,13 +243,13 @@ int ParseUnitArgument(wxChar *unitArg)
if (unitArg[i] == '\\')
unitArg[i] = 0;
len = wxStrlen(unitArg);
if (unitArg && (len > 0) && (isdigit(unitArg[0]) || unitArg[0] == '-'))
{
wxSscanf(unitArg, _T("%f"), &unitValue);
if (len > 1)
{
wxChar units[3];
wxChar units[3];
units[0] = unitArg[len-2];
units[1] = unitArg[len-1];
units[2] = 0;
@@ -272,7 +272,7 @@ int ParseUnitArgument(wxChar *unitArg)
* IF one exists. Inserts zero into buffer.
*
*/
void StripExtension(wxChar *buffer)
{
int len = wxStrlen(buffer);
@@ -339,18 +339,18 @@ void SetFontSizes(int pointSize)
}
}
/*
* Latex references
*
*/
void AddTexRef(wxChar *name, wxChar *file, wxChar *sectionName,
int chapter, int section, int subsection, int subsubsection)
{
TexRef *texRef = (TexRef *)TexReferences.Get(name);
if (texRef) TexReferences.Delete(name);
wxChar buf[100];
buf[0] = 0;
/*
@@ -399,7 +399,7 @@ void WriteTexReferences(wxChar *filename)
wxString name = filename;
wxSTD ofstream ostr((char const *)name.fn_str());
if (ostr.bad()) return;
TexReferences.BeginFind();
wxHashTable::Node *node = TexReferences.Next();
while (node)
@@ -467,17 +467,17 @@ void ReadTexReferences(wxChar *filename)
wxString sectionName_string = wxString::FromAscii(sectionName);
wxString section_string = wxString::FromAscii(section);
// gt - needed to trick the hash table "TexReferences" into deleting the key
// gt - needed to trick the hash table "TexReferences" into deleting the key
// strings it creates in the Put() function, but not the item that is
// created here, as that is destroyed elsewhere. Without doing this, there
// were massive memory leaks
TexReferences.DeleteContents(true);
TexReferences.Put(
label_string.c_str(),
label_string.c_str(),
new TexRef(
label_string.c_str(),
file_string.c_str(),
section_string.c_str(),
label_string.c_str(),
file_string.c_str(),
section_string.c_str(),
sectionName_string.c_str()
)
);
@@ -495,13 +495,13 @@ void ReadTexReferences(wxChar *filename)
void BibEatWhiteSpace(wxSTD istream& str)
{
char ch = (char)str.peek();
while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == EOF))
while (!str.eof() && (ch == ' ' || ch == '\t' || ch == 13 || ch == 10 || ch == (char)EOF))
{
if (ch == 10)
BibLine ++;
str.get(ch);
if ((ch == EOF) || str.eof()) return;
if ((ch == (char)EOF) || str.eof()) return;
ch = (char)str.peek();
}
@@ -585,7 +585,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true,
return;
}
istr.get(ch);
if (ch == '{')
braceCount ++;
@@ -617,7 +617,7 @@ void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true,
buffer[i] = 0;
wxUnusedVar(stopping);
}
bool ReadBib(wxChar *filename)
{
if (!wxFileExists(filename))
@@ -1377,7 +1377,7 @@ bool ReadCustomMacros(wxChar *filename)
istr.get(ch);
if (istr.eof())
break;
if (ch != '\\') // Not a macro definition, so must be NAME=VALUE
{
wxChar settingName[100];
@@ -1426,7 +1426,7 @@ bool ReadCustomMacros(wxChar *filename)
BibReadValue(istr, macroBody, false, false); // Don't ignore extra braces
if (wxStrlen(macroBody) > 0)
macro->macroBody = copystring(macroBody);
BibEatWhiteSpace(istr);
CustomMacroList.Append(macroName, macro);
AddMacroDef(ltCUSTOM_MACRO, macroName, noArgs);
@@ -1437,7 +1437,7 @@ bool ReadCustomMacros(wxChar *filename)
OnInform(mbuf);
return true;
}
CustomMacro *FindCustomMacro(wxChar *name)
{
wxNode *node = CustomMacroList.Find(name);
@@ -1458,7 +1458,7 @@ void ShowCustomMacros(void)
OnInform(_T("No custom macros loaded.\n"));
return;
}
wxChar buf[400];
while (node)
{
@@ -1506,7 +1506,7 @@ wxChar *ParseMultifieldString(wxChar *allFields, int *pos)
buffer[i] = 0;
if (oldPos == (*pos))
*pos = len + 1;
if (i == 0)
return NULL;
else
@@ -1517,7 +1517,7 @@ wxChar *ParseMultifieldString(wxChar *allFields, int *pos)
* Colour tables
*
*/
ColourTableEntry::ColourTableEntry(const wxChar *theName, unsigned int r, unsigned int g, unsigned int b)
{
name = copystring(theName);
@@ -1575,7 +1575,7 @@ bool FindColourHTMLString(wxChar *theName, wxChar *buf)
if (wxStrcmp(theName, entry->name) == 0)
{
wxStrcpy(buf, _T("#"));
wxChar buf2[3];
DecToHex(entry->red, buf2);
wxStrcat(buf, buf2);
@@ -1591,7 +1591,7 @@ bool FindColourHTMLString(wxChar *theName, wxChar *buf)
return false;
}
void InitialiseColourTable(void)
{
// \\red0\\green0\\blue0;
@@ -1602,16 +1602,16 @@ void InitialiseColourTable(void)
// \\red0\\green255\\blue0;
AddColour(_T("green"), 0,255,0);
// \\red255\\green0\\blue255;
AddColour(_T("magenta"), 255,0,255);
// \\red255\\green0\\blue0;
AddColour(_T("red"), 255,0,0);
// \\red255\\green255\\blue0;
AddColour(_T("yellow"), 255,255,0);
// \\red255\\green255\\blue255;}");
AddColour(_T("white"), 255,255,255);
}
@@ -1625,10 +1625,10 @@ void Tex2RTFYield(bool force)
{
#ifdef __WXMSW__
static int yieldCount = 0;
if (isSync)
return;
if (force)
yieldCount = 0;
if (yieldCount == 0)
@@ -1655,7 +1655,7 @@ void AddKeyWordForTopic(wxChar *topic, wxChar *entry, wxChar *filename)
texTopic->keywords = new wxStringList;
TopicTable.Put(topic, texTopic);
}
if (!texTopic->keywords->Member(entry))
texTopic->keywords->Add(entry);
}
@@ -1677,7 +1677,7 @@ void ClearKeyWordTable(void)
/*
* TexTopic structure
*/
TexTopic::TexTopic(wxChar *f)
{
if (f)
@@ -1704,17 +1704,17 @@ wxChar *ConvertCase(wxChar *s)
int i;
if (upperCaseNames)
for (i = 0; i < len; i ++)
buf[i] = wxToupper(s[i]);
buf[i] = (wxChar)wxToupper(s[i]);
else
for (i = 0; i < len; i ++)
buf[i] = wxTolower(s[i]);
buf[i] = (wxChar)wxTolower(s[i]);
buf[i] = 0;
return buf;
return buf;
}
#if !WXWIN_COMPATIBILITY_2
// if substring is true, search for str1 in str2
bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
bool exact)
{
if (subString)
@@ -1729,7 +1729,7 @@ bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
return Sstr2.Index(Sstr1) != (size_t)wxNOT_FOUND;
}
else
return exact ? wxString(str2).Cmp(str1) == 0 :
return exact ? wxString(str2).Cmp(str1) == 0 :
wxString(str2).CmpNoCase(str1) == 0;
}
#endif