@# in other dist targets. Ugly and hardly portable but it
@# will run on any Debian box and that's enough for now.
- find $(DISTDIR) \( -name "CVS" -o -name ".cvsignore" -o -name "*.dsp" -o -name "*.dsw" -o -name "*.hh*" -o \
- \( -name "makefile.*" -a ! -name "makefile.unx" \) \) \
- -print0 | xargs -0 rm -rf
+ rm -rf $(DISTDIR)/contrib/build
+ find $(DISTDIR) \( -name "CVS" -o -name ".cvsignore" -o -name "*.dsp" \
+ -o -name "*.dsw" -o -name "*.hh*" -o -name "*.mms" \
+ -o -name "*.mcp" -o -name "*M*.xml" -o -name "*.r" \
+ -o -name "*.bkl" -o -name "*.pro" -o -name "*.def" \
+ -o -name "*.vpj" -o -name "*.sc" \
+ -o \( -name "makefile.*" -a ! -name "makefile.unx" \) \
+ \) -print0 | xargs -0 rm -rf
+
+ rm -rf $(DISTDIR)/wxPython/SWIG
+ rm -rf $(DISTDIR)/wxPython/distrib
+ rm -rf $(DISTDIR)/wxPython/distutils
+ rm -rf $(DISTDIR)/wxPython/samples
+ rm -rf $(DISTDIR)/wxPython/contrib/iewin
+ find $(DISTDIR)/wxPython \( -name "mac" -o -name "msw" \) -print0 | xargs -0 rm -rf
+
@# We can't get at the individual components of the version here
@# anymore, so strip the major and minor version out of the blob.
@# in other dist targets. Ugly and hardly portable but it
@# will run on any Debian box and that's enough for now.
- find $(DISTDIR) \( -name "CVS" -o -name ".cvsignore" -o -name "*.dsp" -o -name "*.dsw" -o -name "*.hh*" -o \
- \( -name "makefile.*" -a ! -name "makefile.unx" \) \) \
- -print0 | xargs -0 rm -rf
+ rm -rf $(DISTDIR)/contrib/build
+ find $(DISTDIR) \( -name "CVS" -o -name ".cvsignore" -o -name "*.dsp" \
+ -o -name "*.dsw" -o -name "*.hh*" -o -name "*.mms" \
+ -o -name "*.mcp" -o -name "*M*.xml" -o -name "*.r" \
+ -o -name "*.bkl" -o -name "*.pro" -o -name "*.def" \
+ -o -name "*.vpj" -o -name "*.sc" \
+ -o \( -name "makefile.*" -a ! -name "makefile.unx" \) \
+ \) -print0 | xargs -0 rm -rf
+
+ rm -rf $(DISTDIR)/wxPython/SWIG
+ rm -rf $(DISTDIR)/wxPython/distrib
+ rm -rf $(DISTDIR)/wxPython/distutils
+ rm -rf $(DISTDIR)/wxPython/samples
+ rm -rf $(DISTDIR)/wxPython/contrib/iewin
+ find $(DISTDIR)/wxPython \( -name "mac" -o -name "msw" \) -print0 | xargs -0 rm -rf
+
@# We can't get at the individual components of the version here
@# anymore, so strip the major and minor version out of the blob.
CFG =
!endif
+# Compiler flags needed to compile test suite in tests directory. If you want
+# to run the tests, set it so that the compiler can find CppUnit headers.
+!ifndef CPPUNIT_CFLAGS
+CPPUNIT_CFLAGS =
+!endif
+
+# Linker flags needed to link test suite in tests directory. If you want
+# to run the tests, include CppUnit library here.
+!ifndef CPPUNIT_LIBS
+CPPUNIT_LIBS =
+!endif
+
# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
-DUSE_GUI="$(USE_GUI)" -DUSE_HTML="$(USE_HTML)" \
-DUSE_OPENGL="$(USE_OPENGL)" -DUSE_ODBC="$(USE_ODBC)" \
-DUSE_EXCEPTIONS="$(USE_EXCEPTIONS)" -DOFFICIAL_BUILD="$(OFFICIAL_BUILD)" \
- -DVENDOR="$(VENDOR)" -DCFG="$(CFG)" -DRUNTIME_LIBS="$(RUNTIME_LIBS)"
+ -DVENDOR="$(VENDOR)" -DCFG="$(CFG)" -DCPPUNIT_CFLAGS="$(CPPUNIT_CFLAGS)" \
+ -DCPPUNIT_LIBS="$(CPPUNIT_LIBS)" -DRUNTIME_LIBS="$(RUNTIME_LIBS)"
OBJS = \
bcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
SETUPHDIR = \
MONOLITHIC="$(MONOLITHIC)" USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" \
USE_OPENGL="$(USE_OPENGL)" USE_ODBC="$(USE_ODBC)" \
USE_EXCEPTIONS="$(USE_EXCEPTIONS)" OFFICIAL_BUILD="$(OFFICIAL_BUILD)" \
- VENDOR="$(VENDOR)" CFG="$(CFG)" RUNTIME_LIBS="$(RUNTIME_LIBS)" \
+ VENDOR="$(VENDOR)" CFG="$(CFG)" CPPUNIT_CFLAGS="$(CPPUNIT_CFLAGS)" \
+ CPPUNIT_LIBS="$(CPPUNIT_LIBS)" RUNTIME_LIBS="$(RUNTIME_LIBS)" \
GCC_VERSION="$(GCC_VERSION)"
OBJS = \
gcc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" USE_OPENGL="$(USE_OPENGL)" \
USE_ODBC="$(USE_ODBC)" USE_EXCEPTIONS="$(USE_EXCEPTIONS)" \
OFFICIAL_BUILD="$(OFFICIAL_BUILD)" VENDOR="$(VENDOR)" CFG="$(CFG)" \
+ CPPUNIT_CFLAGS="$(CPPUNIT_CFLAGS)" CPPUNIT_LIBS="$(CPPUNIT_LIBS)" \
RUNTIME_LIBS="$(RUNTIME_LIBS)"
OBJS = \
vc_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
MONOLITHIC="$(MONOLITHIC)" USE_GUI="$(USE_GUI)" USE_HTML="$(USE_HTML)" &
USE_OPENGL="$(USE_OPENGL)" USE_ODBC="$(USE_ODBC)" &
USE_EXCEPTIONS="$(USE_EXCEPTIONS)" OFFICIAL_BUILD="$(OFFICIAL_BUILD)" &
- VENDOR="$(VENDOR)" CFG="$(CFG)" RUNTIME_LIBS="$(RUNTIME_LIBS)"
+ VENDOR="$(VENDOR)" CFG="$(CFG)" CPPUNIT_CFLAGS="$(CPPUNIT_CFLAGS)" &
+ CPPUNIT_LIBS="$(CPPUNIT_LIBS)" RUNTIME_LIBS="$(RUNTIME_LIBS)"
OBJS = &
wat_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
SETUPHDIR = &
--- /dev/null
+
+These examples are provided as extended documentation for the wxWidgets
+package. If you wish to actually run them rather than just browse them
+as documents you should copy them into a working directory elsewhere
+first. Note that some of them will attempt to write to the current
+working directory, or to the home directory of the user they are run as.
+
+Some of the files have been compressed in accordance with Debian policy
+regarding documentation, you will need to uncompress such files before
+building or executing them.
+
+ Ron
+
+
in court. Eleven or so years of unbroken, unquestioned usage
was not nearly so interesting to these people as the fact we
were a soft target and easy to deprive of due process.
- * wxGTK is now built with gtk2.
+ * wxGTK is now built with gtk2 and unicode support.
* wxBase is no longer a separate package, it is built with the
GUI libs which now depend on it. We might split it out again
one day if there is a need for that.
improve either, but the logical separation may be beneficial.
* Removed many elements of the build scripts that are no longer
required due to improvements and changes elsewhere.
+ * Added README.examples for people who think these are packaged
+ as demos instead of as extended documentation.
-- Ron Lee <ron@debian.org> Fri, 27 Feb 2004 17:00:29 +1030
-usr/share/man/man1/wx-config.1.gz usr/share/man/man1/wxgtk2d-=V-config.1.gz
+usr/share/man/man1/wx-config.1.gz usr/share/man/man1/wxgtk2ud-=V-config.1.gz
#! /bin/sh
set -e
-update-alternatives --install /usr/bin/wx-config wx-config /usr/bin/wxgtk2d-=V-config 50
+update-alternatives --install /usr/bin/wx-config wx-config /usr/bin/wxgtk2ud-=V-config 50
#DEBHELPER#
#! /bin/sh
set -e
-update-alternatives --remove wx-config /usr/bin/wxgtk2d-=V-config
+update-alternatives --remove wx-config /usr/bin/wxgtk2ud-=V-config
#DEBHELPER#
-usr/share/man/man1/wx-config.1.gz usr/share/man/man1/wxgtk2-=V-config.1.gz
+usr/share/man/man1/wx-config.1.gz usr/share/man/man1/wxgtk2u-=V-config.1.gz
#! /bin/sh
set -e
-update-alternatives --install /usr/bin/wx-config wx-config /usr/bin/wxgtk2-=V-config 70
+update-alternatives --install /usr/bin/wx-config wx-config /usr/bin/wxgtk2u-=V-config 70
#DEBHELPER#
#! /bin/sh
set -e
-update-alternatives --remove wx-config /usr/bin/wxgtk2-=V-config
+update-alternatives --remove wx-config /usr/bin/wxgtk2u-=V-config
#DEBHELPER#
-wxPython/README.txt
-wxPython/CHANGES.txt
+wxPython/docs/README.txt
+wxPython/docs/CHANGES.txt
+wxPython/docs/MigrationGuide.txt
-?package(libwxgtk=V-python):needs=X11 section=Apps/Programming\
+?package(libwxgtk=V-python):needs="X11" section="Apps/Programming"\
title="pycrust" command="/usr/bin/pycrust"
-?package(libwxgtk=V-python):needs=X11 section=Apps/Programming\
+?package(libwxgtk=V-python):needs="X11" section="Apps/Programming"\
title="pyshell" command="/usr/bin/pyshell"
-?package(libwxgtk=V-python):needs=X11 section=Apps/Programming\
+?package(libwxgtk=V-python):needs="X11" section="Apps/Programming"\
title="xrced" command="/usr/bin/xrced"
--prefix=$(shell pwd) \
--exec-prefix=$(shell pwd)/$(objdir_gtk_shared)
+contrib_libs := $(subst CVS,,$(notdir $(wildcard contrib/include/wx/*)))
+
# The Rules:
done;
@for f in docs doc-base; do \
echo "generating control file $(package_doc).$$f"; \
- sed -e 's/=V/$(release)/g' < debian/wxwin-doc.$$f \
+ sed -e 's/=V/$(release)/g' < debian/wx-doc.$$f \
> debian/$(package_doc).$$f; \
done;
@for f in examples; do \
echo "generating control file $(package_examples).$$f"; \
- cp debian/wxwin-examples.$$f debian/$(package_examples).$$f; \
+ cp debian/wx-examples.$$f debian/$(package_examples).$$f; \
done;
@for f in dirs links postinst prerm; do \
echo "generating control file $(package_msw_dev).$$f"; \
done;
@for f in dirs; do \
echo "generating control file $(package_headers_msw).$$f"; \
- sed -e 's/=H/$(cross_host)/g' < debian/wxwin-headers-msw.$$f \
+ sed -e 's/=H/$(cross_host)/g' < debian/wx-headers-msw.$$f \
> debian/$(package_headers_msw).$$f; \
done;
touch $@
--cache-file=$(config_cache) \
--with-gtk \
--enable-gtk2 \
+ --enable-unicode \
--with-opengl \
--enable-soname \
--with-zlib=sys \
--cache-file=$(config_cache) \
--with-gtk \
--enable-gtk2 \
+ --enable-unicode \
--with-opengl \
--disable-shared \
--with-zlib=sys \
--cache-file=$(config_cache) \
--with-gtk \
--enable-gtk2 \
+ --enable-unicode \
--with-opengl \
--enable-debug \
--enable-soname \
build-contrib-shared-stamp: build-gtk-shared-stamp
dh_testdir
- cd $(objdir_gtk_shared)/contrib/src \
- && $(MAKE)
+ cd $(objdir_gtk_shared)/contrib/src && $(MAKE)
touch $@
build-contrib-static-stamp: build-gtk-static-stamp
dh_testdir
- cd $(objdir_gtk_static)/contrib/src \
- && $(MAKE)
+ cd $(objdir_gtk_static)/contrib/src && $(MAKE)
touch $@
build-gtk-py-stamp: build-gtk-shared-stamp
dh_testdir
touch docs/lgpl.txt
+ cd wxPython/include/wx \
+ && for f in $(contrib_libs); do \
+ $(RM) $$f; \
+ ln -s ../../../contrib/include/wx/$$f .; \
+ done
cd wxPython \
- && $(python_ver) ./setup.py build WX_CONFIG='$(wxconfig)'
+ && $(python_ver) ./setup.py build \
+ WX_CONFIG='$(wxconfig)' \
+ WXPORT=gtk2 \
+ UNICODE=1
+ cd wxPython/include/wx \
+ && for f in $(contrib_libs); do $(RM) $$f; done
+
touch $@
build-doc-stamp: build-gtk-shared-stamp
cd $(objdir_gtk_shared)/utils/tex2rtf/src \
&& $(MAKE)
rm -rf $(objdir_doc)
+ rm -rf $(objdir_doc_cruft)
mkdir $(objdir_doc)
mkdir $(objdir_doc_cruft)
cd $(objdir_doc_cruft) \
dh_testroot
dh_clean -k
dh_installdirs
- dh_install $(objdir_gtk_install)/bin/wxgtk2-$(release)-config usr/bin
+ dh_install $(objdir_gtk_install)/bin/wxgtk2u-$(release)-config usr/bin
dh_install $(objdir_gtk_install)/lib/{wx,*.so} usr/lib
- dh_install $(objdir_gtk_static)/lib/libwx_gtk2{-,_gl}*.a usr/lib
+ dh_install $(objdir_gtk_static)/lib/libwx_gtk2u{-,_gl}*.a usr/lib
install-gtk-dbg: DH_OPTIONS=-p$(package_gtk_dbg)
install-gtk-dbg: build-gtk-debug-stamp
dh_testroot
dh_clean -k
dh_installdirs usr/share/lintian/overrides
- dh_install $(objdir_gtk_debug)/wxgtk2d-$(release)-config usr/bin
+ dh_install $(objdir_gtk_debug)/wxgtk2ud-$(release)-config usr/bin
dh_install $(objdir_gtk_debug)/lib usr
cp debian/lintian-override debian/$(package_gtk_dbg)/usr/share/lintian/overrides/$(package_gtk_dbg)
dh_installdirs
dh_install $(objdir_gtk_contrib_install)/include usr
dh_install $(objdir_gtk_contrib_install)/lib/*.so usr/lib
- dh_install -Xlibwx_gtk2- -Xlibwx_gtk2_gl- \
+ dh_install -Xlibwx_gtk2u- -Xlibwx_gtk2u_gl- \
$(objdir_gtk_static)/lib/*.a usr/lib
install-gtk-py: DH_OPTIONS=-p$(package_gtk_py)
cd wxPython \
&& $(python_ver) ./setup.py install \
--prefix=`pwd`/../debian/$(package_gtk_py)/usr \
- WX_CONFIG='$(wxconfig)'
+ WX_CONFIG='$(wxconfig)' \
+ WXPORT=gtk2 \
+ UNICODE=1
find debian/$(package_gtk_py)/usr/lib/$(python_ver)/site-packages/wxPython \
-name '*.py?' -exec rm '{}' ';'
usr/share/man/man1/wxPython-tools.1 usr/share/man/man1/pywrap.1
# This is rather bogus, its included in the main copyright file now though.
- rm -f debian/$(package_gtk_py)/usr/lib/$(python_ver)/site-packages/wxPython/tools/XRCed/license.txt
+ rm -f debian/$(package_gtk_py)/usr/lib/$(python_ver)/site-packages/wx/tools/XRCed/license.txt
install-headers: DH_OPTIONS=-p$(package_headers)
install-headers: install-gtk-shared-stamp
dh_fixperms
dh_makeshlibs -N$(package_gtk_py) -V
dh_installdeb
- dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_dbg)/usr/lib
+ dh_shlibdeps -ldebian/$(package_gtk_lib)/usr/lib:debian/$(package_gtk_dbg)/usr/lib:debian/$(package_gtk_contrib)/usr/lib
dh_gencontrol
dh_md5sums
dh_builddeb
-.TH wx\-config 1 "15 Feb 2000" "Debian GNU/Linux" "wxWindows"
+.TH wx\-config 1 "15 Feb 2000" "Debian GNU/Linux" "wxWidgets"
.SH NAME
-wx-config \- generate compile time info for wxWindows
+wx-config \- generate compile time requirements for wxWidgets applications
.SH SYNOPSIS
.nh
.B wxbase\-config
.B wxgtk\-config
.HP
.B wx\-config
-[\-\-version] [\-\-libs] [\-\-cflags] [\-\-cc] [\-\-cxx] [\-\-ld]
-[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP]
+[\-\-version] [\-\-libs\fI[=LIBS]\fP] [\-\-cflags] [\-\-cc] [\-\-cxx] [\-\-ld]
+[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-release] [\-\-basename]
.SH DESCRIPTION
\fIwx\-config\fP is a tool to determine the compiler and linker
-flags required for applications using the \fIwxWindows\fP toolkit(s).
+flags required for applications using the \fIwxWidgets\fP toolkit(s).
.PP
\fIwx\-config\fP is normally a symlink to one of the port\-specific
versions like \fIwxbase\-config\fP or \fIwxgtk\-config\fP which
.SH OPTIONS
.l
\fIwx\-config\fP accepts the following options:
-.TP 8
+.TP 15
.B \-\-version
What to
.B ALWAYS
include in a bug report.
-.br
-( But of course you already knew that ... )
-.TP 8
-.B \-\-libs
-Generate linker flags for a \fIwxWindows\fP program.
-.TP 8
+.TP 15
+.B \-\-libs[=LIBS]
+Generate linker flags for a \fIwxWidgets\fP program.
+The optional argument is a comma separated list of the wxWidgets libraries
+to link with. You may include contrib libs here too. If no argument is
+given it will assume you wish to link all 'core' libraries.
+.TP 15
.B \-\-cflags
Generate compiler flags for the same.
-.TP 8
+.TP 15
.B \-\-cc
Output the name of the C compiler \fB$(CC)\fP.
-.TP 8
+.TP 15
.B \-\-cxx
Output the name of the C++ compiler \fB$(CXX)\fP.
-.TP 8
+.TP 15
.B \-\-ld
Output the Linker command \fB$(LD)\fP.
-.TP 8
+.TP 15
.B \-\-prefix=PREFIX
-If specified, use PREFIX instead of the installation prefix that \fIwxWindows\fP
+If specified, use PREFIX instead of the installation prefix that \fIwxWidgets\fP
was built with when computing the output for the \-\-cflags and
\-\-libs options. This option is also used for the exec prefix
if \-\-exec\-prefix was not specified. This option must be specified
.br
.nh
.HP
-(Translation: this is the root path to the \fIwxWindows\fP headers \-\- [Ron])
+(Translation: this is the root path to the \fIwxWidgets\fP headers \-\- [Ron])
.hy
-.TP 8
+.TP 15
.B \-\-exec\-prefix=PREFIX
If specified, use PREFIX instead of the installation exec prefix that
-\fIwxWindows\fP was built with when computing the output for the \-\-cflags
+\fIwxWidgets\fP was built with when computing the output for the \-\-cflags
and \-\-libs options. This option must be specified before any
\-\-libs or \-\-cflags options.
.br
.nh
.HP
-(Translation: this is the root path to the \fIwxWindows\fP library \-\- [Ron])
+(Translation: this is the root path to the \fIwxWidgets\fP library \-\- [Ron])
.hy
+.TP 15
+.B \-\-release
+Output the wxWidgets release number.
+.TP 15
+.B \-\-basename
+Output the base name of the wxWidgets libraries.
.SH SEE ALSO
.BR gtk\-config (1),
.BR update\-alternatives (8)
.SH COPYRIGHT
This manpage was copied whole\-heartedly from the \fBgtk\-config\fP(1) manpage
by Brian Bassett <brianb@debian.org> for the Debian GNU/Linux distribution of
-wxGTK. It was then updated to include new options and otherwise bastardised
-generally by Ron Lee <ron@debian.org>
+wxGTK. It was subsequently updated to include new options and otherwise
+bastardised generally by Ron Lee <ron@debian.org>
The original gtk\-config manpage copyright:
--- /dev/null
+Document: wx-manual
+Title: wxWidgets Programming Manual
+Author: The wxWidgets Cabal
+Abstract: This manual describes the wxWidgets cross-platform GUI toolkit.
+Section: Apps/Programming
+
+Format: HTML
+Index: /usr/share/doc/wx=V-doc/wx-manual.html/wxwin.htm
+Files: /usr/share/doc/wx=V-doc/wx-manual.html/*
+
--- /dev/null
+docs/wx-manual.html
+
--- /dev/null
+debian/README.examples
+docs/examples/demos
+docs/examples/samples
+docs/examples/wxPython
+
--- /dev/null
+usr/=H/include/wx
+
-.TH wxPython\-tools 1 "3 Jan 2003" "Debian GNU/Linux" "wxWindows"
+.TH wxPython\-tools 1 "3 Jan 2003" "Debian GNU/Linux" "wxWidgets"
.SH NAME
img2py \- wxPython tools.
.br
.SH COPYRIGHT
This manpage was written by Ron Lee <ron@debian.org> for the Debian GNU/Linux
-distribution of wxWindows. It may be freely distributed by anyone insane enough
+distribution of wxWidgets. It may be freely distributed by anyone insane enough
to find it useful.
+++ /dev/null
-Document: wx-manual
-Title: wxWidgets Programming Manual
-Author: The wxWidgets Cabal
-Abstract: This manual describes the wxWidgets cross-platform GUI toolkit.
-Section: Apps/Programming
-
-Format: HTML
-Index: /usr/share/doc/wx=V-doc/wx-manual.html/wxwin.htm
-Files: /usr/share/doc/wx=V-doc/wx-manual.html/*
-
+++ /dev/null
-docs/wx-manual.html
-
+++ /dev/null
-docs/examples/demos
-docs/examples/samples
-docs/examples/wxPython
+++ /dev/null
-usr/=H/include/wx
-
#if defined(__WXMSW__)
#include "wx/msw/dde.h"
-#elif defined(__WXMOTIF__)
- #include "wx/motif/dde.h"
-#elif defined(__WXGTK__)
- #include "wx/gtk/dde.h"
-#elif defined(__WXMAC__)
- #include "wx/mac/dde.h"
-#elif defined(__WXPM__)
- #include "wx/os2/dde.h"
+#else
+ #error DDE is only supported on MSW
#endif
#endif
* Name: wx/wxchar.h
* Purpose: Declarations common to wx char/wchar_t usage (wide chars)
* Author: Joel Farley, Ove KÃ¥ven
- * Modified by: Vadim Zeitlin, Robert Roebling
+ * Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee
* Created: 1998/06/12
* RCS-ID: $Id$
* Copyright: (c) 1998-2002 wxWindows dev team
const wxChar *fmt, const struct tm *tm);
#endif /* wxNEED_WX_TIME_H */
+#ifndef wxCtime
+#include <time.h>
+WXDLLIMPEXP_BASE wxChar *wxCtime(const time_t *timep);
+#endif
+
+
/* missing functions in some WinCE versions */
#ifdef _WIN32_WCE
#if (_WIN32_WCE < 300)
#endif
// Handle User's home (ignore root homes!)
- size_t len;
+ size_t len = 0;
if ((val = wxGetUserHome (user)) != NULL &&
(len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0)
// Name: wxchar.cpp
// Purpose: wxChar implementation
// Author: Ove KÃ¥ven
-// Modified by:
+// Modified by: Ron Lee
// Created: 09/04/99
// RCS-ID: $Id$
// Copyright: (c) wxWindows copyright
va_start(argptr, format);
// callers of wxSprintf() deserve what they get
- int ret = vswprintf( str, UINT_MAX, wxFormatConverter(format), argptr );
+ //int ret = vswprintf( str, UINT_MAX, wxFormatConverter(format), argptr );
+
+ // ... true, but if we are going to implement it, they probably still
+ // deserve something a little better than absolutely guaranteed silent
+ // failure. For some (very mysterious) reason, this call fails under glibc
+ // 2.3.2 if str was allocated on the heap and maxsize is larger than this.
+ // Even more mysterious is that it does still succeed if str was allocated
+ // on the stack. This should still be plenty large enough for people who
+ // want to overflow a buffer. The bug was first noticed in unicode builds
+ // of tex2rtf, but I'm going to fix that to not use this unsafe function
+ // instead of wasting time diagnosing this further right now.
+ int ret = vswprintf( str, INT_MAX / 4, wxFormatConverter(format), argptr );
va_end(argptr);
int wxVsprintf( wxChar *str, const wxChar *format, va_list argptr )
{
// same as for wxSprintf()
- return vswprintf(str, UINT_MAX, wxFormatConverter(format), argptr);
+ return vswprintf(str, INT_MAX / 4, wxFormatConverter(format), argptr);
}
#endif // wxNEED_PRINTF_CONVERSION
}
#endif // wxNEED_WX_TIME_H
+#ifndef wxCtime
+WXDLLEXPORT wxChar *wxCtime(const time_t *timep)
+{
+ static wxChar buf[128];
+
+ wxStrncpy( buf, wxConvertMB2WX( ctime( timep ) ), sizeof( buf ) );
+ buf[ sizeof( buf ) - 1 ] = _T('\0');
+
+ return buf;
+}
+#endif // wxCtime
+
#endif // wxUSE_WCHAR_T
// ----------------------------------------------------------------------------
{
char outbyte = 0;
int old_x = -1;
- guint32 old_pixval;
+ guint32 old_pixval = 0;
for (int w = 0; w < width; w++)
{
{
char outbyte = 0;
int old_x = -1;
- guint32 old_pixval;
+ guint32 old_pixval = 0;
for (int w = 0; w < width; w++)
{
#endif // wxUSE_FONTDLG
-#endif // GPE
\ No newline at end of file
+#endif // GPE
+
int wxMessageDialog::ShowModal()
{
GtkWidget *dlg;
- GtkMessageType type;
+ GtkMessageType type = GTK_MESSAGE_ERROR;
GtkButtonsType buttons = GTK_BUTTONS_OK;
-
+
if (m_dialogStyle & wxYES_NO)
{
buttons = GTK_BUTTONS_YES_NO;
else
buttons = GTK_BUTTONS_OK;
}
-
+
if (m_dialogStyle & wxICON_EXCLAMATION)
type = GTK_MESSAGE_WARNING;
else if (m_dialogStyle & wxICON_ERROR)
type = GTK_MESSAGE_INFO;
else if (m_dialogStyle & wxICON_QUESTION)
type = GTK_MESSAGE_QUESTION;
+ else
+ wxFAIL_MSG( _T("Unknown wxMessageDialog type") );
dlg = gtk_message_dialog_new(m_parent ?
GTK_WINDOW(m_parent->m_widget) : NULL,
else
gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_YES);
}
-
+
gint result = gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_destroy(dlg);
wxFAIL_MSG(_T("unexpected GtkMessageDialog return code"));
// fall through
- case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_CANCEL:
return wxID_CANCEL;
case GTK_RESPONSE_OK:
return wxID_OK;
{
char outbyte = 0;
int old_x = -1;
- guint32 old_pixval;
+ guint32 old_pixval = 0;
for (int w = 0; w < width; w++)
{
{
char outbyte = 0;
int old_x = -1;
- guint32 old_pixval;
+ guint32 old_pixval = 0;
for (int w = 0; w < width; w++)
{
#endif // wxUSE_FONTDLG
-#endif // GPE
\ No newline at end of file
+#endif // GPE
+
int wxMessageDialog::ShowModal()
{
GtkWidget *dlg;
- GtkMessageType type;
+ GtkMessageType type = GTK_MESSAGE_ERROR;
GtkButtonsType buttons = GTK_BUTTONS_OK;
-
+
if (m_dialogStyle & wxYES_NO)
{
buttons = GTK_BUTTONS_YES_NO;
else
buttons = GTK_BUTTONS_OK;
}
-
+
if (m_dialogStyle & wxICON_EXCLAMATION)
type = GTK_MESSAGE_WARNING;
else if (m_dialogStyle & wxICON_ERROR)
type = GTK_MESSAGE_INFO;
else if (m_dialogStyle & wxICON_QUESTION)
type = GTK_MESSAGE_QUESTION;
+ else
+ wxFAIL_MSG( _T("Unknown wxMessageDialog type") );
dlg = gtk_message_dialog_new(m_parent ?
GTK_WINDOW(m_parent->m_widget) : NULL,
else
gtk_dialog_set_default_response(GTK_DIALOG(dlg), GTK_RESPONSE_YES);
}
-
+
gint result = gtk_dialog_run(GTK_DIALOG(dlg));
gtk_widget_destroy(dlg);
wxFAIL_MSG(_T("unexpected GtkMessageDialog return code"));
// fall through
- case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_CANCEL:
return wxID_CANCEL;
case GTK_RESPONSE_OK:
return wxID_OK;
// Purpose: Utilities for manipulating bitmap and metafile images for
// the purposes of conversion to RTF
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
/* read the file type (first two bytes) */
int c = getc(fp); int c1 = getc(fp);
- if (c!='B' || c1!='M') { return FALSE; }
+ if (c!='B' || c1!='M') { return false; }
/* bfSize = */ getint(fp);
getshort(fp); /* reserved and ignored */
*BitsPerPixel = (int)biBitCount;
// fseek(fp, bfOffBits, SEEK_SET);
-
- return TRUE;
+
+ return true;
}
static int scanLineWidth = 0;
-bool OutputBitmapHeader(FILE *fd, bool isWinHelp = FALSE)
+bool OutputBitmapHeader(FILE *fd, bool isWinHelp = false)
{
int Width, Height, Planes, BitsPerPixel;
if (!GetBMPHeader(fd, &Width, &Height, &Planes, &BitsPerPixel))
- return FALSE;
+ return false;
scanLineWidth = (int)((float)Width/(8.0/(float)BitsPerPixel));
if ((float)((int)(scanLineWidth/2.0)) != (float)(scanLineWidth/2.0))
scanLineWidth ++;
-
+
int goalW = 15*Width;
int goalH = 15*Height;
else TexOutput(_T("\\dibitmap)"));
wxChar buf[50];
- TexOutput(_T("\\picw")); wxSprintf(buf, _T("%d"), Width); TexOutput(buf);
- TexOutput(_T("\\pich")); wxSprintf(buf, _T("%d"), Height); TexOutput(buf);
- TexOutput(_T("\\wbmbitspixel")); wxSprintf(buf, _T("%d"), BitsPerPixel); TexOutput(buf);
- TexOutput(_T("\\wbmplanes")); wxSprintf(buf, _T("%d"), Planes); TexOutput(buf);
- TexOutput(_T("\\wbmwidthbytes")); wxSprintf(buf, _T("%d"), scanLineWidth); TexOutput(buf);
- TexOutput(_T("\\picwgoal")); wxSprintf(buf, _T("%d"), goalW); TexOutput(buf);
- TexOutput(_T("\\pichgoal")); wxSprintf(buf, _T("%d"), goalH); TexOutput(buf);
+ TexOutput(_T("\\picw")); wxSnprintf(buf, sizeof(buf), _T("%d"), Width); TexOutput(buf);
+ TexOutput(_T("\\pich")); wxSnprintf(buf, sizeof(buf), _T("%d"), Height); TexOutput(buf);
+ TexOutput(_T("\\wbmbitspixel")); wxSnprintf(buf, sizeof(buf), _T("%d"), BitsPerPixel); TexOutput(buf);
+ TexOutput(_T("\\wbmplanes")); wxSnprintf(buf, sizeof(buf), _T("%d"), Planes); TexOutput(buf);
+ TexOutput(_T("\\wbmwidthbytes")); wxSnprintf(buf, sizeof(buf), _T("%d"), scanLineWidth); TexOutput(buf);
+ TexOutput(_T("\\picwgoal")); wxSnprintf(buf, sizeof(buf), _T("%d"), goalW); TexOutput(buf);
+ TexOutput(_T("\\pichgoal")); wxSnprintf(buf, sizeof(buf), _T("%d"), goalH); TexOutput(buf);
TexOutput(_T("\n"));
- return TRUE;
+ return true;
}
ch = getc(fd);
}
TexOutput(_T("\n}\n"));
- return TRUE;
+ return true;
}
#ifdef __WXMSW__
fread((void *)theHeader, sizeof(char), sizeof(mfPLACEABLEHEADER), handle);
if (theHeader->key != 0x9AC6CDD7)
{
- return FALSE;
+ return false;
}
float widthInUnits = (float)theHeader->bbox.right - theHeader->bbox.left;
float heightInUnits = (float)theHeader->bbox.bottom - theHeader->bbox.top;
*width = (int)((widthInUnits*1440.0)/theHeader->inch);
*height = (int)((heightInUnits*1440.0)/theHeader->inch);
- return TRUE;
+ return true;
}
bool OutputMetafileHeader(FILE *handle, bool WXUNUSED(isWinHelp), int userWidth, int userHeight)
{
int Width, Height;
if (!GetMetafileHeader(handle, &Width, &Height))
- return FALSE;
+ return false;
scanLineWidth = 64;
int goalW = Width;
TexOutput(_T("\\wmetafile8"));
wxChar buf[50];
- TexOutput(_T("\\picw")); wxSprintf(buf, _T("%d"), Width); TexOutput(buf);
- TexOutput(_T("\\pich")); wxSprintf(buf, _T("%d"), Height); TexOutput(buf);
- TexOutput(_T("\\picwgoal")); wxSprintf(buf, _T("%d"), goalW); TexOutput(buf);
- TexOutput(_T("\\pichgoal")); wxSprintf(buf, _T("%d"), goalH); TexOutput(buf);
+ TexOutput(_T("\\picw")); wxSnprintf(buf, sizeof(buf), _T("%d"), Width); TexOutput(buf);
+ TexOutput(_T("\\pich")); wxSnprintf(buf, sizeof(buf), _T("%d"), Height); TexOutput(buf);
+ TexOutput(_T("\\picwgoal")); wxSnprintf(buf, sizeof(buf), _T("%d"), goalW); TexOutput(buf);
+ TexOutput(_T("\\pichgoal")); wxSnprintf(buf, sizeof(buf), _T("%d"), goalH); TexOutput(buf);
TexOutput(_T("\n"));
- return TRUE;
+ return true;
}
bool OutputMetafileData(FILE *handle)
}
} while (ch != EOF);
TexOutput(_T("\n}\n"));
- return TRUE;
+ return true;
}
#endif
// Name: htmlutil.cpp
// Purpose: Converts Latex to HTML
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
FILE *Titlepage = NULL;
// FILE *FrameTitlepage = NULL;
int fileId = 0;
-bool subsectionStarted = FALSE;
+bool subsectionStarted = false;
// Which column of a row are we in? (Assumes no nested tables, of course)
int currentColumn = 0;
// Are we in verbatim mode? If so, format differently.
-static bool inVerbatim = FALSE;
+static bool inVerbatim = false;
// Need to know whether we're in a table or figure for benefit
// of listoffigures/listoftables
-static bool inFigure = FALSE;
-static bool inTable = FALSE;
+static bool inFigure = false;
+static bool inTable = false;
// This is defined in the Tex2Any library.
extern wxChar *BigBuffer;
wxChar buf[400];
if (truncateFilenames)
{
- wxSprintf(buf, _T("%s%d.htm"), FileRoot, fileId);
+ wxSnprintf(buf, sizeof(buf), _T("%s%d.htm"), FileRoot, fileId);
}
else
{
if (fileId == 1)
gs_filenames.Add(wxEmptyString);
- wxSprintf(buf, _T("%s_%s.html"), FileRoot, label);
+ wxSnprintf(buf, sizeof(buf), _T("%s_%s.html"), FileRoot, label);
gs_filenames.Add(buf);
}
if (*fileName) delete[] *fileName;
void ProcessText2HTML(TexChunk *chunk)
{
- bool changed = FALSE;
+ bool changed = false;
int ptr = 0;
int i = 0;
char ch = 1;
{
BigBuffer[ptr] = 0; wxStrcat(BigBuffer, _T("<P>\n\n")); ptr += 5;
i += 2;
- changed = TRUE;
+ changed = true;
}
else if (!inVerbatim && ch == '`' && (len >= i+1 && chunk->value[i+1] == '`'))
{
BigBuffer[ptr] = '"'; ptr ++;
i += 2;
- changed = TRUE;
+ changed = true;
}
else if (!inVerbatim && ch == '`') // Change ` to '
{
BigBuffer[ptr] = 39; ptr ++;
i += 1;
- changed = TRUE;
+ changed = true;
}
else if (ch == '<') // Change < to <
{
wxStrcat(BigBuffer, _T("<"));
ptr += 4;
i += 1;
- changed = TRUE;
+ changed = true;
}
else if (ch == '>') // Change > to >
{
wxStrcat(BigBuffer, _T(">"));
ptr += 4;
i += 1;
- changed = TRUE;
+ changed = true;
}
else
{
return;
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL))
- inVerbatim = TRUE;
+ inVerbatim = true;
wxNode *node = chunk->children.GetFirst();
while (node)
}
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL))
- inVerbatim = FALSE;
+ inVerbatim = false;
break;
}
{
// contentsReference = "<img align=center src=\"contents.gif\" BORDER=0 ALT=\"Contents\">";
contentsReference = contentsReferenceBuf;
- wxSprintf(contentsReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Contents\">"), ConvertCase(_T("contents.gif")));
+ wxSnprintf(contentsReference, sizeof(contentsReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Contents\">"),
+ ConvertCase(_T("contents.gif")));
}
wxChar *upReference; // no need to initialize because always assigned below
{
// upReference = "<img align=center src=\"up.gif\" ALT=\"Up\">";
upReference = upReferenceBuf;
- wxSprintf(upReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Up\">"), ConvertCase(_T("up.gif")));
+ wxSnprintf(upReference, sizeof(upReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Up\">"),
+ ConvertCase(_T("up.gif")));
}
wxChar *backReference; // no need to initialize because always assigned below
{
// backReference = "<img align=center src=\"back.gif\" ALT=\"Previous\">";
backReference = backReferenceBuf;
- wxSprintf(backReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Previous\">"), ConvertCase(_T("back.gif")));
+ wxSnprintf(backReference, sizeof(backReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Previous\">"),
+ ConvertCase(_T("back.gif")));
}
wxChar *forwardReference; // no need to initialize because always assigned below
{
// forwardReference = "<img align=center src=\"forward.gif\" ALT=\"Next\">";
forwardReference = forwardReferenceBuf;
- wxSprintf(forwardReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Next\">"), ConvertCase(_T("forward.gif")));
+ wxSnprintf(forwardReference, sizeof(forwardReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Next\">"),
+ ConvertCase(_T("forward.gif")));
}
TexOutput(_T("<CENTER>"));
{
wxChar buf1[80];
wxStrcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
- wxSprintf(buf, _T("\n<A HREF=\"%s.%s\">%s</A> "), buf1, ConvertCase(_T("htm")), contentsReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("\n<A HREF=\"%s.%s\">%s</A> "),
+ buf1, ConvertCase(_T("htm")), contentsReference);
}
else
{
wxChar buf1[80];
wxStrcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
- wxSprintf(buf, _T("\n<A HREF=\"%s%s\">%s</A> "), buf1, ConvertCase(_T("_contents.html")), contentsReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("\n<A HREF=\"%s%s\">%s</A> "),
+ buf1, ConvertCase(_T("_contents.html")), contentsReference);
}
// TexOutput(_T("<NOFRAMES>"));
TexOutput(buf);
if (upLabel && upFilename)
{
if (wxStrlen(upLabel) > 0)
- wxSprintf(buf, _T("<A HREF=\"%s#%s\">%s</A> "), ConvertCase(upFilename), upLabel, upReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s#%s\">%s</A> "),
+ ConvertCase(upFilename), upLabel, upReference);
else
- wxSprintf(buf, _T("<A HREF=\"%s\">%s</A> "), ConvertCase(upFilename), upReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s\">%s</A> "),
+ ConvertCase(upFilename), upReference);
if (wxStrcmp(upLabel, _T("contents")) == 0)
{
// TexOutput(_T("<NOFRAMES>"));
if (previousLabel && previousFilename)
{
- wxSprintf(buf, _T("<A HREF=\"%s#%s\">%s</A> "), ConvertCase(previousFilename), previousLabel, backReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s#%s\">%s</A> "),
+ ConvertCase(previousFilename), previousLabel, backReference);
if (wxStrcmp(previousLabel, _T("contents")) == 0)
{
// TexOutput(_T("<NOFRAMES>"));
else
{
// A placeholder so the buttons don't keep moving position
- wxSprintf(buf, _T("%s "), backReference);
+ wxSnprintf(buf, sizeof(buf), _T("%s "), backReference);
TexOutput(buf);
}
if (nextLabel && nextFilename)
{
- wxSprintf(buf, _T("<A HREF=\"%s#%s\">%s</A> "), ConvertCase(nextFilename), nextLabel, forwardReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s#%s\">%s</A> "),
+ ConvertCase(nextFilename), nextLabel, forwardReference);
TexOutput(buf);
}
else
{
// A placeholder so the buttons don't keep moving position
- wxSprintf(buf, _T("%s "), forwardReference);
+ wxSnprintf(buf, sizeof(buf), _T("%s "), forwardReference);
TexOutput(buf);
}
wxString token1 = tok.GetNextToken();
if (!tok.HasMoreTokens())
{
- *isPicture = TRUE;
+ *isPicture = true;
return resStr;
}
else
{
wxString token2 = tok.GetNextToken();
- *isPicture = FALSE;
+ *isPicture = false;
if (tok.HasMoreTokens())
{
wxString token3 = tok.GetNextToken();
TexOutput(_T("\n<BODY"));
if (backgroundImageString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(backgroundImageString, &isPicture);
if (s)
{
}
if (backgroundColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(backgroundColourString, &isPicture);
if (s)
{
// Set foreground text colour, if one is specified
if (textColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(textColourString, &isPicture);
if (s)
{
// Set link text colour, if one is specified
if (linkColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(linkColourString, &isPicture);
if (s)
{
// Set followed link text colour, if one is specified
if (followedLinkColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(followedLinkColourString, &isPicture);
if (s)
{
chapterNo ++;
SetCurrentOutput(NULL);
- startedSections = TRUE;
+ startedSections = true;
wxChar *topicName = FindTopicName(GetNextChunk());
ReopenFile(&Chapters, &ChaptersName, topicName);
wxChar titleBuf[200];
if (truncateFilenames)
- wxSprintf(titleBuf, _T("%s.htm"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s.htm"), wxFileNameFromPath(FileRoot));
else
- wxSprintf(titleBuf, _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
wxFprintf(Chapters, _T("<A NAME=\"%s\"></A>"), topicName);
{
subsectionNo = 0;
subsubsectionNo = 0;
- subsectionStarted = FALSE;
+ subsectionStarted = false;
if (macroId != ltSECTIONSTAR)
sectionNo ++;
SetCurrentOutput(NULL);
- startedSections = TRUE;
+ startedSections = true;
wxChar *topicName = FindTopicName(GetNextChunk());
ReopenFile(&Sections, &SectionsName, topicName);
ReopenSectionContentsFile();
}
- startedSections = TRUE;
- subsectionStarted = TRUE;
+ startedSections = true;
+ subsectionStarted = true;
wxChar *topicName = FindTopicName(GetNextChunk());
if (macroId != ltSUBSUBSECTIONSTAR)
subsubsectionNo ++;
- startedSections = TRUE;
+ startedSections = true;
wxChar *topicName = FindTopicName(GetNextChunk());
wxChar buf[100];
if (TableData[currentColumn].justification == 'c')
- wxSprintf(buf, _T("\n<TD ALIGN=CENTER>"));
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=CENTER>"));
else if (TableData[currentColumn].justification == 'r')
- wxSprintf(buf, _T("\n<TD ALIGN=RIGHT>"));
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=RIGHT>"));
else if (TableData[currentColumn].absWidth)
{
// Convert from points * 20 into pixels.
// Say the display is 100 DPI (dots/pixels per inch).
// There are 72 pts to the inch. So 1pt = 1/72 inch, or 100 * 1/72 dots.
int pixels = (int)(points * 100.0 / 72.0);
- wxSprintf(buf, _T("<TD ALIGN=CENTER WIDTH=%d>"), pixels);
+ wxSnprintf(buf, sizeof(buf), _T("<TD ALIGN=CENTER WIDTH=%d>"), pixels);
}
else
- wxSprintf(buf, _T("\n<TD ALIGN=LEFT>"));
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=LEFT>"));
TexOutput(buf);
OutputFont();
}
// Start new row and cell, setting alignment for the first cell.
wxChar buf[100];
if (TableData[currentColumn].justification == 'c')
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=CENTER>"));
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=CENTER>"));
else if (TableData[currentColumn].justification == 'r')
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=RIGHT>"));
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=RIGHT>"));
else if (TableData[currentColumn].absWidth)
{
// Convert from points * 20 into pixels.
// Say the display is 100 DPI (dots/pixels per inch).
// There are 72 pts to the inch. So 1pt = 1/72 inch, or 100 * 1/72 dots.
int pixels = (int)(points * 100.0 / 72.0);
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=CENTER WIDTH=%d>"), pixels);
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=CENTER WIDTH=%d>"), pixels);
}
else
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=LEFT>"));
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=LEFT>"));
TexOutput(buf);
OutputFont();
}
{
if (start)
{
- if (TRUE) // (inVerbatim)
+ #if (1) // if(inVerbatim)
TexOutput(_T("~"));
- else
+ #else
TexOutput(_T(" "));
+ #endif
}
break;
}
if (start)
{
wxChar buf[100];
- wxSprintf(buf, _T("<PRE>\n"));
+ wxSnprintf(buf, sizeof(buf), _T("<PRE>\n"));
TexOutput(buf);
}
else TexOutput(_T("</PRE>\n"));
case ltCOPYRIGHT:
{
if (start)
- TexOutput(_T("©"), TRUE);
+ TexOutput(_T("©"), true);
break;
}
case ltREGISTERED:
{
if (start)
- TexOutput(_T("®"), TRUE);
+ TexOutput(_T("®"), true);
break;
}
// Arrows
figureNo ++;
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("%s %d.%d: "), FigureNameString, chapterNo, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d.%d: "), FigureNameString, chapterNo, figureNo);
else
- wxSprintf(figBuf, _T("%s %d: "), FigureNameString, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d: "), FigureNameString, figureNo);
}
else
{
tableNo ++;
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("%s %d.%d: "), TableNameString, chapterNo, tableNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d.%d: "), TableNameString, chapterNo, tableNo);
else
- wxSprintf(figBuf, _T("%s %d: "), TableNameString, tableNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d: "), TableNameString, tableNo);
}
TexOutput(figBuf);
}
case ltFIGURE:
{
- if (start) inFigure = TRUE;
- else inFigure = FALSE;
+ if (start) inFigure = true;
+ else inFigure = false;
break;
}
case ltTABLE:
{
- if (start) inTable = TRUE;
- else inTable = FALSE;
+ if (start) inTable = true;
+ else inTable = false;
break;
}
default:
{
if (!start && (arg_no == 1))
currentSection = GetArgChunk();
- return FALSE;
+ return false;
}
case ltFUNC:
{
{
TexOutput(sec);
}
- return FALSE;
+ return false;
}
break;
}
case ltURLREF:
{
if (IsArgOptional())
- return FALSE;
+ return false;
else if ((GetNoArgs() - arg_no) == 1)
{
if (start)
helpRefText = GetArgChunk();
- return FALSE;
+ return false;
}
else if ((GetNoArgs() - arg_no) == 0) // Arg = 2, or 3 if first is optional
{
{
TexChunk *ref = GetArgChunk();
TexOutput(_T("<A HREF=\""));
- inVerbatim = TRUE;
+ inVerbatim = true;
TraverseChildrenFromChunk(ref);
- inVerbatim = FALSE;
+ inVerbatim = false;
TexOutput(_T("\">"));
if (helpRefText)
TraverseChildrenFromChunk(helpRefText);
TexOutput(_T("</A>"));
}
- return FALSE;
+ return false;
}
break;
}
{
if (start)
helpRefFilename = GetArgChunk();
- return FALSE;
+ return false;
}
if ((GetNoArgs() - arg_no) == 1)
{
if (start)
helpRefText = GetArgChunk();
- return FALSE;
+ return false;
}
else if ((GetNoArgs() - arg_no) == 0) // Arg = 2, or 3 if first is optional
{
}
else TexOutput(_T("??"));
}
- return FALSE;
+ return false;
}
break;
}
TexOutput(_T("<A HREF=\""));
TexOutput(ConvertCase(wxFileNameFromPath(filename)));
TexOutput(_T("\">Picture</A>\n"));
- wxSprintf(buf, _T("Warning: could not find an inline XBM/GIF for %s."), filename);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find an inline XBM/GIF for %s."), filename);
OnInform(buf);
}
}
}
- return FALSE;
+ return false;
}
// First arg is PSBOX spec (ignored), second is image file, third is map name.
case ltIMAGEMAP:
if (f == _T(""))
{
wxChar buf[300];
- wxSprintf(buf, _T("Warning: could not find an inline XBM/GIF for %s."), filename);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find an inline XBM/GIF for %s."), filename);
OnInform(buf);
}
delete[] filename;
imageFile = NULL;
}
}
- return FALSE;
+ return false;
}
case ltINDENTED :
{
if ( arg_no == 1 )
- return FALSE;
+ return false;
else
{
- return TRUE;
+ return true;
}
}
case ltITEM:
if (start)
{
descriptionItemArg = GetArgChunk();
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
case ltTWOCOLITEM:
case ltTWOCOLITEMRULED:
// DHS
if (TwoColWidthA > -1) {
wxChar buf[100];
- wxSprintf(buf,_T("\n<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
+ wxSnprintf(buf, sizeof(buf), _T("\n<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
TexOutput(buf);
} else
TexOutput(_T("\n<TR><TD VALIGN=TOP>\n"));
if ( start ) {
if (TwoColWidthB > -1) {
wxChar buf[100];
- wxSprintf(buf,_T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
TexOutput(buf);
} else
TexOutput(_T("\n<TD VALIGN=TOP>\n"));
} else
TexOutput(_T("\n</FONT></TD></TR>\n"));
}
- return TRUE;
+ return true;
}
case ltNUMBEREDBIBITEM:
{
if (ref)
{
if (ref->sectionNumber) delete[] ref->sectionNumber;
- wxSprintf(buf, _T("[%d]"), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("[%d]"), citeCount);
ref->sectionNumber = copystring(buf);
}
- wxSprintf(buf, _T("\n<DT> [%d] "), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("\n<DT> [%d] "), citeCount);
TexOutput(buf);
citeCount ++;
- return FALSE;
+ return false;
}
if (arg_no == 2 && !start)
TexOutput(_T("<P>\n"));
- return TRUE;
+ return true;
}
case ltMARGINPAR:
case ltMARGINPARODD:
if (start)
{
TexOutput(_T("<HR>\n"));
- return TRUE;
+ return true;
}
else
TexOutput(_T("<HR><P>\n"));
float points = ParseUnitArgument(val);
TwoColWidthA = (int)((points * 100.0) / 72.0);
}
- return FALSE;
+ return false;
}
// DHS
case ltTWOCOLWIDTHB:
float points = ParseUnitArgument(val);
TwoColWidthB = (int)((points * 100.0) / 72.0);
}
- return FALSE;
+ return false;
}
/*
* Accents
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_ACUTE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CARET:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_TILDE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_UMLAUT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_DOT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltBACKGROUND:
{
wxChar *val = GetArgData();
if (val)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
ParseColourString(val, &isPicture);
if (isPicture)
{
}
}
}
- return FALSE;
+ return false;
}
case ltBACKGROUNDIMAGE:
{
backgroundImageString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltBACKGROUNDCOLOUR:
{
backgroundColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltTEXTCOLOUR:
{
textColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltLINKCOLOUR:
{
linkColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltFOLLOWEDLINKCOLOUR:
{
followedLinkColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CADILLA:
{
}
}
}
- return FALSE;
+ return false;
}
/*
case ltFOOTNOTE:
case ltFOOTNOTEPOPUP:
{
if (arg_no == 1)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
break;
}
*/
if (start)
{
currentRowNumber = 0;
- inTabular = TRUE;
- startRows = TRUE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTabular = true;
+ startRows = true;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
wxChar *alignString = copystring(GetArgData());
ParseTableArgument(alignString);
for (int i = 0; i < noColumns; i++)
{
currentWidth += TableData[i].width;
- wxSprintf(buf, _T("\\cellx%d"), currentWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
TexOutput(_T("\\pard\\intbl\n"));
}
delete[] alignString;
- return FALSE;
+ return false;
}
}
else if (arg_no == 2 && !start)
{
TexOutput(_T("</TABLE>\n"));
- inTabular = FALSE;
+ inTabular = false;
}
break;
}
wxChar titleBuf[150];
if (truncateFilenames)
- wxSprintf(titleBuf, _T("%s.htm"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s.htm"), wxFileNameFromPath(FileRoot));
else
- wxSprintf(titleBuf, _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
HTMLHead();
TexOutput(_T("<title>"));
wxFprintf(Chapters, _T("</H2>\n</A>\n"));
SetCurrentOutput(Chapters);
- return FALSE;
+ return false;
}
if (!start && (arg_no == 2))
{
}
- return TRUE;
+ return true;
}
case ltINDEX:
{
AddKeyWordForTopic(CurrentTopic, buf, currentFileName);
}
}
- return FALSE;
+ return false;
}
case ltFCOL:
// case ltBCOL:
{
wxStrcpy(buf2, _T("#000000"));
wxChar buf[100];
- wxSprintf(buf, _T("Could not find colour name %s"), name);
+ wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
OnError(buf);
}
TexOutput(_T("<FONT COLOR=\""));
}
case 2:
{
- return TRUE;
+ return true;
}
default:
break;
{
if (arg_no == 2) TexOutput(_T("</FONT>"));
}
- return FALSE;
+ return false;
}
case ltINSERTATLEVEL:
{
// This macro allows you to insert text at a different level
// from the current level, e.g. into the Sections from within a subsubsection.
if (useWord)
- return FALSE;
+ return false;
static int currentLevelNo = 1;
static FILE* oldLevelFile = Chapters;
if (start)
}
if (outputFile)
CurrentOutput1 = outputFile;
- return FALSE;
+ return false;
}
case 2:
{
- return TRUE;
+ return true;
}
default:
break;
}
- return TRUE;
+ return true;
}
else
{
{
CurrentOutput1 = oldLevelFile;
}
- return TRUE;
+ return true;
}
}
default:
return DefaultOnArgument(macroId, arg_no, start);
}
- return TRUE;
+ return true;
}
bool HTMLGo(void)
{
fileId = 0;
- inVerbatim = FALSE;
+ inVerbatim = false;
indentLevel = 0;
- inTabular = FALSE;
- startRows = FALSE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTabular = false;
+ startRows = false;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
noColumns = 0;
if (InputFile && OutputFile)
wxChar buf[300];
if (truncateFilenames)
- wxSprintf(buf, _T("%s.htm"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s.htm"), FileRoot);
else
- wxSprintf(buf, _T("%s_contents.html"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s_contents.html"), FileRoot);
if (TitlepageName) delete[] TitlepageName;
TitlepageName = copystring(buf);
Titlepage = wxFopen(buf, _T("w"));
if (truncateFilenames)
- wxSprintf(buf, _T("%s_fc.htm"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s_fc.htm"), FileRoot);
else
- wxSprintf(buf, _T("%s_fcontents.html"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s_fcontents.html"), FileRoot);
contentsFrameName = copystring(buf);
if (!Titlepage || !Contents)
{
OnError(_T("Cannot open output file!"));
- return FALSE;
+ return false;
}
AddTexRef(_T("contents"), wxFileNameFromPath(TitlepageName), ContentsNameString);
{
wxChar firstFileName[300];
if (truncateFilenames)
- wxSprintf(firstFileName, _T("%s1.htm"), FileRoot);
+ wxSnprintf(firstFileName, sizeof(firstFileName), _T("%s1.htm"), FileRoot);
else
wxStrcpy(firstFileName, gs_filenames[1].c_str());
if (htmlIndex)
{
wxChar htmlIndexName[300];
- wxSprintf(htmlIndexName, _T("%s.htx"), FileRoot);
+ wxSnprintf(htmlIndexName, sizeof(htmlIndexName), _T("%s.htx"), FileRoot);
GenerateHTMLIndexFile(htmlIndexName);
}
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// Output .htx index file
/* Generate project file : */
- wxSprintf(buf, _T("%s.hhp"), fname);
+ wxSnprintf(buf, sizeof(buf), _T("%s.hhp"), fname);
f = wxFopen(buf, _T("wt"));
wxFprintf(f,
_T("[OPTIONS]\n")
wxFprintf(f, _T("%s\n"), wxFileNameFromPath(TitlepageName));
for (int i = 1; i <= fileId; i++) {
if (truncateFilenames)
- wxSprintf(buf, _T("%s%d.htm"), wxFileNameFromPath(FileRoot), i);
+ wxSnprintf(buf, sizeof(buf), _T("%s%d.htm"), wxFileNameFromPath(FileRoot), i);
else
wxStrcpy(buf, wxFileNameFromPath(gs_filenames[i].c_str()));
wxFprintf(f, _T("%s\n"), buf);
/* Generate index file : */
- wxSprintf(buf, _T("%s.hhk"), fname);
+ wxSnprintf(buf, sizeof(buf), _T("%s.hhk"), fname);
f = wxFopen(buf, _T("wt"));
wxFprintf(f,
void HTMLWorkshopStartContents()
{
wxChar buf[300];
- wxSprintf(buf, _T("%s.hhc"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s.hhc"), FileRoot);
HTMLWorkshopContents = wxFopen(buf, _T("wt"));
HTMLWorkshopLastLevel = 0;
// reverse-engineering
// and guesswork at its best.
// Author: Petr Smilauer
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 01/01/99
// RCS-ID: $Id$
// Copyright: (c) Petr Smilauer
HotSpot *hotspots = NULL;
int n = ParseSHG(filename, &hotspots);
if (n == 0)
- return FALSE;
+ return false;
wxChar buf[100];
- wxSprintf(buf, _T("Converting .SHG file to HTML map file: there are %d hotspots in %s."), n, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Converting .SHG file to HTML map file: there are %d hotspots in %s."), n, filename);
OnInform(buf);
wxChar outBuf[256];
{
OnError(_T("Could not open .map file for writing."));
delete[] hotspots;
- return FALSE;
+ return false;
}
wxFprintf(fd, _T("default %s\n"), defaultFile);
else
{
wxChar buf[300];
- wxSprintf(buf, _T("Warning: could not find hotspot reference %s"), hotspots[i].szHlpTopic_Macro);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find hotspot reference %s"), hotspots[i].szHlpTopic_Macro);
OnInform(buf);
}
wxFprintf(fd, _T("rect %s %d %d %d %d\n"), refFilename, (int)hotspots[i].left, (int)hotspots[i].top,
fclose(fd);
delete[] hotspots;
- return TRUE;
+ return true;
}
// Name: rtfutils.cpp
// Purpose: Converts Latex to Word RTF/WinHelp RTF
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
extern wxHashTable TexReferences;
// Are we in verbatim mode? If so, format differently.
-static bool inVerbatim = FALSE;
+static bool inVerbatim = false;
// We're in a series of PopRef topics, so don't output section headings
-bool inPopRefSection = FALSE;
+bool inPopRefSection = false;
// Green colour?
-static bool hotSpotColour = TRUE;
-static bool hotSpotUnderline = TRUE;
+static bool hotSpotColour = true;
+static bool hotSpotUnderline = true;
// Transparency (WHITE = transparent)
-static bool bitmapTransparency = TRUE;
+static bool bitmapTransparency = true;
// Linear RTF requires us to set the style per section.
static wxChar *currentNumberStyle = NULL;
// Need to know whether we're in a table or figure for benefit
// of listoffigures/listoftables
-static bool inFigure = FALSE;
-static bool inTable = FALSE;
+static bool inFigure = false;
+static bool inTable = false;
/*
* Current topics
static bool InPopups()
{
if (CurrentChapterName && (wxStrcmp(CurrentChapterName, _T("popups")) == 0))
- return TRUE;
+ return true;
if (CurrentSectionName && (wxStrcmp(CurrentSectionName, _T("popups")) == 0))
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
static void SetCurrentTopic(wxChar *s)
texTopic = new TexTopic;
TopicTable.Put(parentTopic, texTopic);
}
- texTopic->hasChildren = TRUE;
+ texTopic->hasChildren = true;
}
}
{
int i;
for (i = l; i < 5; i++)
- ContentsLevels[i] = FALSE;
+ ContentsLevels[i] = false;
// There are always books on the top level
- ContentsLevels[0] = TRUE;
+ ContentsLevels[0] = true;
}
// Output a WinHelp section as a keyword, substituting
// Remember that at this level, we had a book and *must* for the
// remainder of sections at this level.
- ContentsLevels[level-1] = TRUE;
+ ContentsLevels[level-1] = true;
}
else
{
// Always have a book at level 1
wxFprintf(WinHelpContentsFile, _T("%d %s\n"), level, title);
wxFprintf(WinHelpContentsFile, _T("%d %s=%s\n"), level+1, title, topicName);
- ContentsLevels[level-1] = TRUE;
+ ContentsLevels[level-1] = true;
}
else
// Probably doesn't have children if it hasn't been added to the topic table
FILE *fd = wxFopen(hpjFilename, _T("w"));
if (!fd)
- return FALSE;
+ return false;
wxChar *helpTitle = winHelpTitle;
if (!helpTitle)
wxFprintf(fd, _T("BrowseButtons()\n\n"));
wxFprintf(fd, _T("[MAP]\n\n[BITMAPS]\n\n"));
fclose(fd);
- return TRUE;
+ return true;
}
void ProcessText2RTF(TexChunk *chunk)
{
- bool changed = FALSE;
+ bool changed = false;
int ptr = 0;
int i = 0;
wxChar ch = 1;
BigBuffer[ptr] = 0; wxStrcat(BigBuffer, _T("\\par\n")); ptr += 5;
// BigBuffer[ptr] = 0; wxStrcat(BigBuffer, _T("\\par{\\v this was verbatim}\n")); ptr += 5;
i ++;
- changed = TRUE;
+ changed = true;
}
else
{
((len > i+1 && chunk->value[i+1] == 13) &&
(len > i+2 && isascii(chunk->value[i+2]) &&
!isspace(chunk->value[i+2]))))
-// if (TRUE)
+// if (true)
{
// DOS files have a 13 after the 10
BigBuffer[ptr] = 10;
// Note that the actual ASCII character seen is dealt with in the next
// iteration
- changed = TRUE;
+ changed = true;
}
else
{
{
BigBuffer[ptr] = '"'; ptr ++;
i += 2;
- changed = TRUE;
+ changed = true;
}
else if (!inVerbatim && ch == '`') // Change ` to '
{
BigBuffer[ptr] = 39; ptr ++;
i += 1;
- changed = TRUE;
+ changed = true;
}
else if (inVerbatim && ch == '\\') // Change backslash to two backslashes
{
BigBuffer[ptr] = '\\'; ptr ++;
BigBuffer[ptr] = '\\'; ptr ++;
i += 1;
- changed = TRUE;
+ changed = true;
}
else if (inVerbatim && (ch == '{' || ch == '}')) // Escape the curley bracket
{
BigBuffer[ptr] = '\\'; ptr ++;
BigBuffer[ptr] = ch; ptr ++;
i += 1;
- changed = TRUE;
+ changed = true;
}
else
{
return;
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB))
- inVerbatim = TRUE;
+ inVerbatim = true;
wxNode *node = chunk->children.GetFirst();
while (node)
}
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB))
- inVerbatim = FALSE;
+ inVerbatim = false;
break;
}
{
wxChar buf[10];
browseId ++;
- wxSprintf(buf, _T("%ld"), browseId);
+ wxSnprintf(buf, sizeof(buf), _T("%ld"), browseId);
int noZeroes = 5-wxStrlen(buf);
wxStrcpy(browseBuf, _T("browse"));
for (int i = 0; i < noZeroes; i++)
if (!inTabular && (ParIndent > 0) && (forbidParindent == 0))
{
wxChar buf[15];
- wxSprintf(buf, _T("\\fi%d"), ParIndent*20); // Convert points to TWIPS
+ wxSnprintf(buf, sizeof(buf), _T("\\fi%d"), ParIndent*20); // Convert points to TWIPS
TexOutput(buf);
}
if (environmentStack.GetCount() > 0 || (ParIndent > 0))
TexOutput(_T("{\\i \\qr "));
if (DocumentStyle == LATEX_ARTICLE)
{
- wxSprintf(buf, _T("SECTION %d"), sectionNo);
+ wxSnprintf(buf, sizeof(buf), _T("SECTION %d"), sectionNo);
TexOutput(buf);
}
else
{
- wxSprintf(buf, _T("CHAPTER %d: "), chapterNo);
+ wxSnprintf(buf, sizeof(buf), _T("CHAPTER %d: "), chapterNo);
TexOutput(buf);
}
TexOutput(_T("{\\field{\\*\\fldinst PAGE \\\\* MERGEFORMAT }{\\fldrslt 1}}"));
TexOutput(_T("{\\i \\qc "));
if (DocumentStyle == LATEX_ARTICLE)
{
- wxSprintf(buf, _T("SECTION %d"), sectionNo);
+ wxSnprintf(buf, sizeof(buf), _T("SECTION %d"), sectionNo);
TexOutput(buf);
}
else
{
- wxSprintf(buf, _T("CHAPTER %d"), chapterNo);
+ wxSnprintf(buf, sizeof(buf), _T("CHAPTER %d"), chapterNo);
TexOutput(buf);
}
TexOutput(_T("{\\field{\\*\\fldinst PAGE \\\\* MERGEFORMAT }{\\fldrslt 1}}"));
{
/*
wxChar tmpBuf[40];
- wxSprintf(tmpBuf, _T("%d (%d)"), macroId, (int)start);
+ wxSnprintf(tmpBuf, sizeof(tmpBuf), _T("%d (%d)"), macroId, (int)start);
OutputDebugString("RTFOnMacro Start "); OutputDebugString(tmpBuf);
OutputDebugString("\n"); wxYield();
*/
}
}
- startedSections = TRUE;
+ startedSections = true;
// Output heading to contents page
if (!InPopups())
if (winHelp)
wxFprintf(Sections, _T("\\page\n"));
}
- startedSections = TRUE;
+ startedSections = true;
if (winHelp)
wxFprintf(Sections, _T("\n${\\footnote "));
wxFprintf(Chapters, _T("\\par\n"));
#endif
}
- startedSections = TRUE;
+ startedSections = true;
if (winHelp)
wxFprintf(Subsections, _T("\n${\\footnote "));
#endif
}
- startedSections = TRUE;
+ startedSections = true;
if (winHelp)
wxFprintf(Subsubsections, _T("\n${\\footnote "));
if (winHelp || !useWord)
{
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("%s %d.%d: "), FigureNameString, chapterNo, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d.%d: "), FigureNameString, chapterNo, figureNo);
else
- wxSprintf(figBuf, _T("%s %d: "), FigureNameString, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d: "), FigureNameString, figureNo);
}
else
{
- wxSprintf(figBuf, _T("%s {\\field\\flddirty{\\*\\fldinst SEQ Figure \\\\* ARABIC }{\\fldrslt {\\bkmkstart %s}??{\\bkmkend %s}}}: "),
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s {\\field\\flddirty{\\*\\fldinst SEQ Figure \\\\* ARABIC }{\\fldrslt {\\bkmkstart %s}??{\\bkmkend %s}}}: "),
FigureNameString, topicName, topicName);
}
}
if (winHelp || !useWord)
{
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("%s %d.%d: "), TableNameString, chapterNo, tableNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d.%d: "), TableNameString, chapterNo, tableNo);
else
- wxSprintf(figBuf, _T("%s %d: "), TableNameString, tableNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d: "), TableNameString, tableNo);
}
else
{
- wxSprintf(figBuf, _T("%s {\\field\\flddirty{\\*\\fldinst SEQ Table \\\\* ARABIC }{\\fldrslt {\\bkmkstart %s}??{\\bkmkend %s}}}: "),
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s {\\field\\flddirty{\\*\\fldinst SEQ Table \\\\* ARABIC }{\\fldrslt {\\bkmkstart %s}??{\\bkmkend %s}}}: "),
TableNameString, topicName, topicName);
}
}
if (winHelp)
{
TexOutput(_T("K{\\footnote {K} "));
- suppressNameDecoration = TRUE;
+ suppressNameDecoration = true;
TraverseChildrenFromChunk(currentMember);
- suppressNameDecoration = FALSE;
+ suppressNameDecoration = false;
TexOutput(_T("}\n"));
}
if (!winHelp && useWord)
{
// Insert index entry for this function
TexOutput(_T("{\\xe\\v {"));
- suppressNameDecoration = TRUE; // Necessary so don't print "(\\bf" etc.
+ suppressNameDecoration = true; // Necessary so don't print "(\\bf" etc.
TraverseChildrenFromChunk(currentMember);
- suppressNameDecoration = FALSE;
+ suppressNameDecoration = false;
TexOutput(_T("}}"));
}
}
if (winHelp)
{
TexOutput(_T("K{\\footnote {K} "));
- suppressNameDecoration = TRUE; // Necessary so don't print "(\\bf" etc.
+ suppressNameDecoration = true; // Necessary so don't print "(\\bf" etc.
TraverseChildrenFromChunk(currentMember);
- suppressNameDecoration = FALSE;
+ suppressNameDecoration = false;
TexOutput(_T("}\n"));
}
if (!winHelp && useWord)
{
// Insert index entry for this function
TexOutput(_T("{\\xe\\v {"));
- suppressNameDecoration = TRUE; // Necessary so don't print "(\\bf" etc.
+ suppressNameDecoration = true; // Necessary so don't print "(\\bf" etc.
TraverseChildrenFromChunk(currentMember);
- suppressNameDecoration = FALSE;
+ suppressNameDecoration = false;
TexOutput(_T("}}"));
}
}
{
// Insert index entry for this function
TexOutput(_T("{\\xe\\v {"));
- suppressNameDecoration = TRUE; // Necessary so don't print "(\\bf" etc.
+ suppressNameDecoration = true; // Necessary so don't print "(\\bf" etc.
TraverseChildrenFromChunk(currentMember);
- suppressNameDecoration = FALSE;
+ suppressNameDecoration = false;
TexOutput(_T("}}"));
}
}
TexOutput(_T("\\par\\pard\\pgnrestart\\sect\\titlepg"));
// In linear RTF, same as chapter headings.
- wxSprintf(buf, _T("{\\b\\fs%d %s}\\par\\par\\pard\n\n"), chapterFont*2, ContentsNameString);
+ wxSnprintf(buf, sizeof(buf), _T("{\\b\\fs%d %s}\\par\\par\\pard\n\n"), chapterFont*2, ContentsNameString);
TexOutput(buf);
- wxSprintf(buf, _T("{\\field{\\*\\fldinst TOC \\\\o \"1-%d\" }{\\fldrslt PRESS F9 TO REFORMAT CONTENTS}}\n"), contentsDepth);
+ wxSnprintf(buf, sizeof(buf), _T("{\\field{\\*\\fldinst TOC \\\\o \"1-%d\" }{\\fldrslt PRESS F9 TO REFORMAT CONTENTS}}\n"), contentsDepth);
TexOutput(buf);
// TexOutput(_T("\\sect\\sectd"));
}
{
if (start)
{
- if (TRUE) // (inVerbatim)
+ #if 1 // if(inVerbatim)
TexOutput(_T("~"));
- else
+ #else
TexOutput(_T(" "));
+ #endif
}
break;
}
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
- wxSprintf(buf, _T("\\cellx%d"), currentWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
TexOutput(_T("\\pard\\intbl\n"));
ItemizeStruc *struc = new ItemizeStruc(listType, indentSize2, indentSize1);
itemizeStack.Insert(struc);
- wxSprintf(buf, _T("\\tx%d\\tx%d\\li%d\\sa200"), indentSize1, indentSize2, indentSize2);
+ wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\tx%d\\li%d\\sa200"), indentSize1, indentSize2, indentSize2);
PushEnvironmentStyle(buf);
}
else
/* Change 18/7/97 - don't know why we wish to do this
if (itemizeStack.Number() == 0)
{
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
issuedNewParagraph = 2;
}
*/
ItemizeStruc *struc = new ItemizeStruc(LATEX_TWOCOL, indentSize);
itemizeStack.Insert(struc);
-// wxSprintf(buf, _T("\\tx%d\\li%d\\ri%d"), indentSize, indentSize, TwoColWidthA+TwoColWidthB+oldIndent);
- wxSprintf(buf, _T("\\tx%d\\li%d\\sa200"), indentSize, indentSize);
+// 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);
}
else
if (itemizeStack.GetCount() == 0)
{
issuedNewParagraph = 0;
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
#endif
}
// WriteEnvironmentStyles();
}
- wxSprintf(buf, _T("\\tx%d\\tx%d\\li%d\\fi-%d\n"), indentSize1, indentSize2,
+ wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\tx%d\\li%d\\fi-%d\n"), indentSize1, indentSize2,
indentSize2, 20*itemIndentTab);
TexOutput(buf);
}
else
{
- wxSprintf(indentBuf, _T("\\tab{\\b %d.}\\tab"), struc->currentItem);
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab{\\b %d.}\\tab"), struc->currentItem);
TexOutput(indentBuf);
}
break;
if (bulletFile && winHelp)
{
if (winHelpVersion > 3) // Transparent bitmap
- wxSprintf(indentBuf, _T("\\tab\\{bmct %s\\}\\tab"), bulletFile);
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab\\{bmct %s\\}\\tab"), bulletFile);
else
- wxSprintf(indentBuf, _T("\\tab\\{bmc %s\\}\\tab"), bulletFile);
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab\\{bmc %s\\}\\tab"), bulletFile);
}
else if (winHelp)
- wxSprintf(indentBuf, _T("\\tab{\\b o}\\tab"));
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab{\\b o}\\tab"));
else
- wxSprintf(indentBuf, _T("\\tab{\\f1\\'b7}\\tab"));
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab{\\f1\\'b7}\\tab"));
TexOutput(indentBuf);
}
break;
}
#endif
-// wxSprintf(buf, _T("\\tx%d\\li%d\\fi-%d\\ri%d\n"), TwoColWidthA,
+// wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\fi-%d\\ri%d\n"), TwoColWidthA,
// TwoColWidthA, TwoColWidthA, TwoColWidthA+TwoColWidthB+oldIndent);
/*
- wxSprintf(buf, _T("\\tx%d\\li%d\\fi-%d\n"), TwoColWidthA,
+ wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\fi-%d\n"), TwoColWidthA,
TwoColWidthA, TwoColWidthA);
*/
- wxSprintf(buf, _T("\\tx%d\\li%d\\fi-%d\n"), TwoColWidthA + oldIndent,
+ wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\fi-%d\n"), TwoColWidthA + oldIndent,
TwoColWidthA + oldIndent, TwoColWidthA);
TexOutput(buf);
}
#endif
if (macroId == ltVERBATIM)
- wxSprintf(buf, _T("{\\f3\\s10\\fs20\\li720\\sa0 "));
+ wxSnprintf(buf, sizeof(buf), _T("{\\f3\\s10\\fs20\\li720\\sa0 "));
else
- wxSprintf(buf, _T("{\\f3\\fs20 "));
+ wxSnprintf(buf, sizeof(buf), _T("{\\f3\\fs20 "));
TexOutput(buf);
}
else
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), smallFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), smallFont*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), tinyFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), tinyFont*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), normalFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), normalFont*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), largeFont1*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), largeFont1*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), LargeFont2*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), LargeFont2*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), LARGEFont3*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), LARGEFont3*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), hugeFont1*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), hugeFont1*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), HugeFont2*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), HugeFont2*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("{\\fs%d\n"), HUGEFont3*2);
+ wxSnprintf(buf, sizeof(buf), _T("{\\fs%d\n"), HUGEFont3*2);
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
// Don't need a par at all if we've already had one,
// and ParSkip == 0.
-
#if 0
// Extra par if parskip is more than zero (usually looks best.)
if (winHelp && !inTabular && (ParSkip > 0))
TexOutput(_T("\\par\\pard"));
if (!winHelp)
TexOutput(_T("\\par"));
- wxSprintf(buf, _T("\\qc{\\fs%d\\b "), titleFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("\\qc{\\fs%d\\b "), titleFont*2);
TexOutput(buf);
TraverseChildrenFromChunk(DocumentTitle);
TexOutput(_T("}\\par\\pard\n"));
{
if (!winHelp)
TexOutput(_T("\\par"));
- wxSprintf(buf, _T("\\par\\qc{\\fs%d "), authorFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("\\par\\qc{\\fs%d "), authorFont*2);
TexOutput(buf);
TraverseChildrenFromChunk(DocumentAuthor);
TexOutput(_T("}"));
if (DocumentDate)
{
TexOutput(_T("\\par"));
- wxSprintf(buf, _T("\\qc{\\fs%d "), authorFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("\\qc{\\fs%d "), authorFont*2);
TexOutput(buf);
TraverseChildrenFromChunk(DocumentDate);
TexOutput(_T("}\\par\\pard\n"));
if (start)
{
// TexOutput(_T("{\\field{\\*\\fldinst SECTION \\\\* MERGEFORMAT }{\\fldrslt 1}}"));
- wxSprintf(buf, _T("%d"), chapterNo);
+ wxSnprintf(buf, sizeof(buf), _T("%d"), chapterNo);
TexOutput(buf);
}
break;
if (start)
{
// TexOutput(_T("{\\field{\\*\\fldinst SECTION \\\\* MERGEFORMAT }{\\fldrslt 1}}"));
- wxSprintf(buf, _T("%d"), sectionNo);
+ wxSnprintf(buf, sizeof(buf), _T("%d"), sectionNo);
TexOutput(buf);
}
break;
if (start && useWord && !winHelp)
{
FakeCurrentSection(_T("Index"));
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
TexOutput(_T("\\par{\\field{\\*\\fldinst INDEX \\\\h \"\\emdash A\\emdash \"\\\\c \"2\"}{\\fldrslt PRESS F9 TO REFORMAT INDEX}}\n"));
}
break;
{
if (start && useWord && !winHelp)
{
- FakeCurrentSection(FiguresNameString, FALSE);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ FakeCurrentSection(FiguresNameString, false);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
wxChar buf[200];
- wxSprintf(buf, _T("{\\field\\fldedit{\\*\\fldinst TOC \\\\c \"%s\" }{\\fldrslt PRESS F9 TO REFORMAT LIST OF FIGURES}}\n"),
+ wxSnprintf(buf, sizeof(buf), _T("{\\field\\fldedit{\\*\\fldinst TOC \\\\c \"%s\" }{\\fldrslt PRESS F9 TO REFORMAT LIST OF FIGURES}}\n"),
FigureNameString);
TexOutput(buf);
}
{
if (start && useWord && !winHelp)
{
- FakeCurrentSection(TablesNameString, FALSE);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ FakeCurrentSection(TablesNameString, false);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
wxChar buf[200];
- wxSprintf(buf, _T("{\\field\\fldedit{\\*\\fldinst TOC \\\\c \"%s\" }{\\fldrslt PRESS F9 TO REFORMAT LIST OF TABLES}}\n"),
+ wxSnprintf(buf, sizeof(buf), _T("{\\field\\fldedit{\\*\\fldinst TOC \\\\c \"%s\" }{\\fldrslt PRESS F9 TO REFORMAT LIST OF TABLES}}\n"),
TablesNameString);
TexOutput(buf);
}
break;
case ltFIGURE:
{
- if (start) inFigure = TRUE;
- else inFigure = FALSE;
+ if (start) inFigure = true;
+ else inFigure = false;
break;
}
case ltTABLE:
{
- if (start) inTable = TRUE;
- else inTable = FALSE;
+ if (start) inTable = true;
+ else inTable = false;
break;
}
default:
{
if (!start && (arg_no == 1))
currentSection = GetArgChunk();
- return FALSE;
+ return false;
}
case ltFUNC:
{
wxFprintf(Chapters, _T("{\\field{\\*\\fldinst REF %s \\\\* MERGEFORMAT }{\\fldrslt ??}}"),
refName);
}
- return FALSE;
+ return false;
}
break;
}
if (start)
helpRefText = GetArgChunk();
- return TRUE;
+ return true;
}
else if ((GetNoArgs() - arg_no) == 0) // Arg = 2, or 3 if first is optional
{
{
if (!ignoreBadRefs)
TexOutput(_T("??"));
- wxSprintf(buf, _T("Warning: unresolved reference '%s'"), refName);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: unresolved reference '%s'"), refName);
OnInform(buf);
}
}
TexOutput(_T(")"));
}
}
- return FALSE;
+ return false;
}
}
break;
{
if (arg_no == 1)
{
- return TRUE;
+ return true;
}
else if (arg_no == 2)
{
if (start)
{
- inVerbatim = TRUE;
+ inVerbatim = true;
TexOutput(_T(" ({\\f3 "));
}
else
{
TexOutput(_T("})"));
- inVerbatim = FALSE;
+ inVerbatim = false;
}
- return TRUE;
+ return true;
}
break;
}
TexOutput(_T("{\\i "));
else
TexOutput(_T("}"));
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
break;
}
contentsLineSection = copystring(GetArgData());
else if (arg_no == 3)
contentsLineValue = copystring(GetArgData());
- return FALSE;
+ return false;
}
- else return FALSE;
+ else return false;
}
case ltIMAGE:
case ltIMAGEL:
case ltPSBOXTO:
{
if (arg_no == 3)
- return FALSE;
+ return false;
static int imageWidth = 0;
static int imageHeight = 0;
if (imageDimensions) // glt
delete [] imageDimensions;
- return FALSE;
+ return false;
}
else if (start && (arg_no == 2 ))
{
TexOutput(_T("[No BMP or WMF for image file "));
TexOutput(filename);
TexOutput(_T("]"));
- wxSprintf(buf, _T("Warning: could not find a BMP or WMF equivalent for %s."), filename);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find a BMP or WMF equivalent for %s."), filename);
OnInform(buf);
}
if (filename) // glt
OutputBitmapData(fd);
else
{
- wxSprintf(buf, _T("Could not read bitmap %s.\nMay be in wrong format (needs RGB-encoded Windows BMP)."), f.c_str());
+ wxSnprintf(buf, sizeof(buf), _T("Could not read bitmap %s.\nMay be in wrong format (needs RGB-encoded Windows BMP)."), f.c_str());
OnError(buf);
}
fclose(fd);
}
else
{
- wxSprintf(buf, _T("Could not read metafile %s. Perhaps it's not a placeable metafile?"), f.c_str());
+ wxSnprintf(buf, sizeof(buf), _T("Could not read metafile %s. Perhaps it's not a placeable metafile?"), f.c_str());
OnError(buf);
}
fclose(fd);
TexOutput(_T("[No BMP or WMF for image file "));
TexOutput(filename);
TexOutput(_T("]"));
- wxSprintf(buf, _T("Warning: could not find a BMP or WMF equivalent for %s."), filename);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find a BMP or WMF equivalent for %s."), filename);
OnInform(buf);
#ifdef __WXMSW__
}
#endif
}
}
- return FALSE;
+ return false;
}
else
- return FALSE;
+ return false;
}
case ltTABULAR:
case ltSUPERTABULAR:
if (start)
{
currentRowNumber = 0;
- inTabular = TRUE;
- startRows = TRUE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTabular = true;
+ startRows = true;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
int currentWidth = 0;
wxChar *alignString = copystring(GetArgData());
for (int i = 0; i < noColumns; i++)
{
currentWidth += TableData[i].width;
- wxSprintf(buf, _T("\\cellx%d"), currentWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
TexOutput(_T("\\pard\\intbl\n"));
}
delete[] alignString;
- return FALSE;
+ return false;
}
}
else if (arg_no == 2 && !start)
{
TexOutput(_T("\\pard\n"));
WriteEnvironmentStyles();
- inTabular = FALSE;
+ inTabular = false;
}
break;
}
{
forbidParindent --;
PopEnvironmentStyle();
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
break;
}
else
{
PopEnvironmentStyle();
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
break;
}
{
if (start)
{
- wxSprintf(buf, _T("\\sa200\\box\\trgaph108%s\n"), ((macroId == ltNORMALBOXD) ? _T("\\brdrdb") : _T("\\brdrs")));
+ wxSnprintf(buf, sizeof(buf), _T("\\sa200\\box\\trgaph108%s\n"), ((macroId == ltNORMALBOXD) ? _T("\\brdrdb") : _T("\\brdrs")));
TexOutput(buf);
PushEnvironmentStyle(buf);
}
else
{
PopEnvironmentStyle();
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
break;
}
SetFontSizes(11);
else if (wxStrcmp(data, _T("12")) == 0)
SetFontSizes(12);
- wxSprintf(buf, _T("\\fs%d\n"), normalFont*2);
+ wxSnprintf(buf, sizeof(buf), _T("\\fs%d\n"), normalFont*2);
TexOutput(buf);
TexOutput(buf);
- return FALSE;
+ return false;
}
break;
}
else if (wxStrcmp(data, _T("Times")) == 0)
TexOutput(_T("\\f0\n"));
- return FALSE;
+ return false;
}
break;
}
ParIndent = ParseUnitArgument(data);
if (ParIndent == 0 || forbidParindent == 0)
{
- wxSprintf(buf, _T("\\fi%d\n"), ParIndent*20);
+ wxSnprintf(buf, sizeof(buf), _T("\\fi%d\n"), ParIndent*20);
TexOutput(buf);
}
- return FALSE;
+ return false;
}
break;
}
if (start && IsArgOptional())
{
descriptionItemArg = GetArgChunk();
- return FALSE;
+ return false;
}
break;
}
break;
}
}
- return TRUE;
+ return true;
}
/*
* Accents
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_ACUTE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CARET:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_TILDE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_UMLAUT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_DOT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CADILLA:
{
}
}
}
- return FALSE;
+ return false;
}
case ltFOOTNOTE:
{
OnInform(_T("Consider using \\footnotepopup instead of \\footnote."));
footnoteCount ++;
wxChar footBuf[20];
- wxSprintf(footBuf, _T("(%d)"), footnoteCount);
+ wxSnprintf(footBuf, sizeof(footBuf), _T("(%d)"), footnoteCount);
TexOutput(_T(" {\\ul "));
TexOutput(footBuf);
{
SetCurrentOutput(savedOutput);
}
- return TRUE;
+ return true;
}
- return TRUE;
+ return true;
}
else
{
if (start)
{
- TexOutput(_T(" {\\super \\chftn{\\footnote \\fs20 {\\super \\chftn}"), TRUE);
+ TexOutput(_T(" {\\super \\chftn{\\footnote \\fs20 {\\super \\chftn}"), true);
}
else
{
- TexOutput(_T("}}"), TRUE);
+ TexOutput(_T("}}"), true);
}
- return TRUE;
+ return true;
}
}
case ltFOOTNOTEPOPUP:
{
TexOutput(_T("{\\ul "));
}
- else TexOutput(_T("}"));
- return TRUE;
+ else
+ {
+ TexOutput(_T("}"));
+ }
+ return true;
}
else if (arg_no == 2)
{
{
SetCurrentOutput(savedOutput);
}
- return TRUE;
+ return true;
}
}
else
{
if (arg_no == 1)
- return TRUE;
+ return true;
if (start)
{
- TexOutput(_T(" {\\super \\chftn{\\footnote \\fs20 {\\super \\chftn}"), TRUE);
+ TexOutput(_T(" {\\super \\chftn{\\footnote \\fs20 {\\super \\chftn}"), true);
}
else
{
- TexOutput(_T("}}"), TRUE);
+ TexOutput(_T("}}"), true);
}
- return TRUE;
+ return true;
}
break;
}
case ltFANCYPLAIN:
{
if (start && (arg_no == 1))
- return FALSE;
+ return false;
else
- return TRUE;
+ return true;
}
case ltSETHEADER:
{
else
forbidResetPar --;
- if (winHelp) return FALSE;
+ if (winHelp) return false;
if (start)
{
switch (arg_no)
break;
}
}
- return FALSE;
+ return false;
}
case ltSETFOOTER:
{
else
forbidResetPar --;
- if (winHelp) return FALSE;
+ if (winHelp) return false;
if (start)
{
switch (arg_no)
break;
}
}
- return FALSE;
+ return false;
}
case ltMARKRIGHT:
{
- if (winHelp) return FALSE;
+ if (winHelp) return false;
// Fake a SetHeader command
if (start)
{
RTFOnArgument(ltSETHEADER, 4, start);
if (!start)
OutputRTFHeaderCommands();
- return FALSE;
+ return false;
}
case ltMARKBOTH:
{
- if (winHelp) return FALSE;
+ if (winHelp) return false;
// Fake a SetHeader command
switch (arg_no)
{
RTFOnArgument(ltSETHEADER, 4, start);
if (!start)
OutputRTFHeaderCommands();
- return FALSE;
+ return false;
}
}
break;
else
forbidResetPar --;
- if (winHelp) return FALSE;
+ if (winHelp) return false;
if (start)
{
TexOutput(_T("\\pgnrestart"));
TexOutput(_T("\n"));
}
- return FALSE;
+ return false;
}
case ltTWOCOLUMN:
{
- if (winHelp) return FALSE;
+ if (winHelp) return false;
if (start)
- return TRUE;
+ return true;
break;
}
case ltITEMSEP:
{
wxChar *val = GetArgData();
currentItemSep = ParseUnitArgument(val);
- return FALSE;
+ return false;
}
break;
}
case ltEVENSIDEMARGIN:
{
- return FALSE;
+ return false;
}
case ltODDSIDEMARGIN:
{
// Add an inch since in LaTeX it's specified minus an inch
twips += 1440;
CurrentLeftMarginOdd = twips;
- wxSprintf(buf, _T("\\margl%d\n"), twips);
+ wxSnprintf(buf, sizeof(buf), _T("\\margl%d\n"), twips);
TexOutput(buf);
CurrentMarginParX = CurrentLeftMarginOdd + CurrentTextWidth + CurrentMarginParSep;
}
- return FALSE;
+ return false;
}
case ltMARGINPARWIDTH:
{
int twips = (int)(20*ParseUnitArgument(val));
CurrentMarginParWidth = twips;
}
- return FALSE;
+ return false;
}
case ltMARGINPARSEP:
{
CurrentMarginParSep = twips;
CurrentMarginParX = CurrentLeftMarginOdd + CurrentTextWidth + CurrentMarginParSep;
}
- return FALSE;
+ return false;
}
case ltTEXTWIDTH:
{
CurrentRightMarginOdd = PageWidth - CurrentTextWidth - CurrentLeftMarginOdd;
CurrentRightMarginEven = PageWidth - CurrentTextWidth - CurrentLeftMarginEven;
CurrentMarginParX = CurrentLeftMarginOdd + CurrentTextWidth + CurrentMarginParSep;
- wxSprintf(buf, _T("\\margr%d\n"), CurrentRightMarginOdd);
+ wxSnprintf(buf, sizeof(buf), _T("\\margr%d\n"), CurrentRightMarginOdd);
TexOutput(buf);
}
- return FALSE;
+ return false;
}
case ltMARGINPAR:
case ltMARGINPARODD:
}
else
{
- wxSprintf(buf, _T("\\phpg\\posx%d\\absw%d\n"), CurrentMarginParX, CurrentMarginParWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\phpg\\posx%d\\absw%d\n"), CurrentMarginParX, CurrentMarginParWidth);
TexOutput(buf);
}
- return TRUE;
+ return true;
}
else
{
TexOutput(_T("\\par\\pard\n"));
issuedNewParagraph = 1;
}
- return FALSE;
+ return false;
}
case ltMARGINPAREVEN:
{
// mirror mode, on an even (left-hand) page.
int x = PageWidth - CurrentRightMarginOdd - CurrentMarginParWidth - CurrentMarginParSep
- CurrentTextWidth + GutterWidth;
- wxSprintf(buf, _T("\\phpg\\posx%d\\absw%d\n"), x, CurrentMarginParWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\phpg\\posx%d\\absw%d\n"), x, CurrentMarginParWidth);
TexOutput(buf);
}
else
{
- wxSprintf(buf, _T("\\phpg\\posx%d\\absw%d\n"), CurrentMarginParX, CurrentMarginParWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\phpg\\posx%d\\absw%d\n"), CurrentMarginParX, CurrentMarginParWidth);
TexOutput(buf);
}
}
- return TRUE;
+ return true;
}
else
{
issuedNewParagraph = 1;
TexOutput(_T("\\par\\pard\n"));
}
- return FALSE;
+ return false;
}
case ltTWOCOLWIDTHA:
{
int twips = (int)(20*ParseUnitArgument(val));
TwoColWidthA = twips;
}
- return FALSE;
+ return false;
}
case ltTWOCOLWIDTHB:
{
int twips = (int)(20*ParseUnitArgument(val));
TwoColWidthB = twips;
}
- return FALSE;
+ return false;
}
case ltROW:
case ltRULEDROW:
if (TableData[i].leftBorder)
TexOutput(_T("\\clbrdrl\\brdrs\\brdrw15"));
- wxSprintf(buf, _T("\\cellx%d"), currentWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
TexOutput(_T("\\pard\\intbl\n"));
ruleTop = 0;
ruleBottom = 0;
currentRowNumber ++;
- return TRUE;
+ return true;
}
else
{
case 1:
{
noMultiColumns = wxAtoi(GetArgData());
- return FALSE;
+ return false;
}
case 2:
{
- return FALSE;
+ return false;
}
case 3:
{
- return TRUE;
+ return true;
}
}
}
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
- wxSprintf(buf, _T("\\tx%d\\li%d\\sa200 "), indentSize, indentSize);
+ wxSnprintf(buf, sizeof(buf), _T("\\tx%d\\li%d\\sa200 "), indentSize, indentSize);
PushEnvironmentStyle(buf);
TexOutput(buf);
- return FALSE;
+ return false;
}
if (!start && (arg_no == 2))
{
WriteEnvironmentStyles();
}
}
- return TRUE;
+ return true;
}
/*
case ltSIZEDBOX:
ItemizeStruc *struc = new ItemizeStruc(LATEX_INDENT, indentSize);
itemizeStack.Insert(struc);
- wxSprintf(buf, _T("\\tx%d\\li%d\\lr%d\\sa200\\box%s "), indentSize, indentSize, indentSizeRight,
+ 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);
TexOutput(buf);
- return FALSE;
+ return false;
}
if (!start && (arg_no == 2))
{
WriteEnvironmentStyles();
}
}
- return TRUE;
+ return true;
break;
}
*/
}
TexOutput(_T("\n"));
}
- return FALSE;
+ return false;
}
case ltSETHOTSPOTCOLOUR:
case ltSETHOTSPOTCOLOR:
{
wxChar *text = GetArgData();
if (wxStrcmp(text, _T("yes")) == 0 || wxStrcmp(text, _T("on")) == 0 || wxStrcmp(text, _T("ok")) == 0)
- hotSpotColour = TRUE;
+ hotSpotColour = true;
else
- hotSpotColour = FALSE;
+ hotSpotColour = false;
}
- return FALSE;
+ return false;
}
case ltSETTRANSPARENCY:
{
{
wxChar *text = GetArgData();
if (wxStrcmp(text, _T("yes")) == 0 || wxStrcmp(text, _T("on")) == 0 || wxStrcmp(text, _T("ok")) == 0)
- bitmapTransparency = TRUE;
+ bitmapTransparency = true;
else
- bitmapTransparency = FALSE;
+ bitmapTransparency = false;
}
- return FALSE;
+ return false;
}
case ltSETHOTSPOTUNDERLINE:
{
{
wxChar *text = GetArgData();
if (wxStrcmp(text, _T("yes")) == 0 || wxStrcmp(text, _T("on")) == 0 || wxStrcmp(text, _T("ok")) == 0)
- hotSpotUnderline = TRUE;
+ hotSpotUnderline = true;
else
- hotSpotUnderline = FALSE;
+ hotSpotUnderline = false;
}
- return FALSE;
+ return false;
}
case ltBIBITEM:
{
if (ref)
{
if (ref->sectionNumber) delete[] ref->sectionNumber;
- wxSprintf(buf, _T("[%d]"), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("[%d]"), citeCount);
ref->sectionNumber = copystring(buf);
}
TexOutput(_T("\\li260\\fi-260 ")); // Indent from 2nd line
- wxSprintf(buf, _T("{\\b [%d]} "), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("{\\b [%d]} "), citeCount);
TexOutput(buf);
citeCount ++;
- return FALSE;
+ return false;
}
if (arg_no == 2 && !start)
TexOutput(_T("\\par\\pard\\par\n\n"));
- return TRUE;
+ return true;
}
case ltTHEBIBLIOGRAPHY:
{
else
wxFprintf(Contents, _T("\\par\n\\pard{\\b %s}"), ReferencesNameString);
- startedSections = TRUE;
+ startedSections = true;
if (winHelp)
wxFprintf(Chapters, _T("\n${\\footnote %s}"), ReferencesNameString);
wxFprintf(Chapters, _T("\\pard{%s"), (winHelp ? _T("\\keepn\\sa140\\sb140") : styleCommand));
WriteHeadingStyle(Chapters, 1); wxFprintf(Chapters, _T(" References\\par\\pard}\n"));
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
case ltINDEX:
{
}
else GenerateIndexEntry(buf);
}
- return FALSE;
+ return false;
}
case ltFCOL:
case ltBCOL:
int pos = FindColourPosition(name);
if (pos > -1)
{
- wxSprintf(buf, _T("{%s%d "), ((macroId == ltFCOL) ? _T("\\cf") : _T("\\cb")), pos);
+ wxSnprintf(buf, sizeof(buf), _T("{%s%d "), ((macroId == ltFCOL) ? _T("\\cf") : _T("\\cb")), pos);
TexOutput(buf);
}
else
{
- wxSprintf(buf, _T("Could not find colour name %s"), name);
+ wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
OnError(buf);
}
break;
}
case 2:
{
- return TRUE;
+ return true;
}
default:
break;
{
if (arg_no == 2) TexOutput(_T("}"));
}
- return FALSE;
+ return false;
}
case ltLABEL:
{
wxFprintf(Chapters, _T("{\\bkmkstart %s}{\\bkmkend %s}"), s,s);
}
}
- return FALSE;
+ return false;
}
case ltPAGEREF:
{
wxFprintf(Chapters, _T("{\\field{\\*\\fldinst PAGEREF %s \\\\* MERGEFORMAT }{\\fldrslt ??}}"),
s);
}
- return FALSE;
+ return false;
}
case ltPOPREFONLY:
{
if (start)
- inPopRefSection = TRUE;
+ inPopRefSection = true;
else
- inPopRefSection = FALSE;
+ inPopRefSection = false;
break;
}
case ltINSERTATLEVEL:
// This macro allows you to insert text at a different level
// from the current level, e.g. into the Sections from within a subsubsection.
if (!winHelp & useWord)
- return FALSE;
+ return false;
static int currentLevelNo = 1;
static FILE* oldLevelFile = Chapters;
if (start)
}
if (outputFile)
CurrentOutput1 = outputFile;
- return FALSE;
+ return false;
}
case 2:
{
- return TRUE;
+ return true;
}
default:
break;
}
- return TRUE;
+ return true;
}
else
{
{
CurrentOutput1 = oldLevelFile;
}
- return TRUE;
+ return true;
}
}
default:
return DefaultOnArgument(macroId, arg_no, start);
}
- return TRUE;
+ return true;
}
bool RTFGo(void)
{
if (stopRunning)
- return FALSE;
+ return false;
// Reset variables
indentLevel = 0;
contentsLineSection = NULL;
contentsLineValue = NULL;
descriptionItemArg = NULL;
- inTabular = FALSE;
- inTable = FALSE;
- inFigure = FALSE;
- startRows = FALSE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTabular = false;
+ inTable = false;
+ inFigure = false;
+ startRows = false;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
noColumns = 0;
- startedSections = FALSE;
- inVerbatim = FALSE;
+ startedSections = false;
+ inVerbatim = false;
browseId = 0;
if (InputFile && OutputFile)
if (!Sections || !Subsections || !Subsubsections || !Popups || (winHelpContents && !WinHelpContentsFile))
{
OnError(_T("Ouch! Could not open temporary file(s) for writing."));
- return FALSE;
+ return false;
}
}
if (!Contents || !Chapters)
{
OnError(_T("Ouch! Could not open temporary file(s) for writing."));
- return FALSE;
+ return false;
}
if (winHelp)
SetCurrentOutput(Chapters);
if (stopRunning)
- return FALSE;
+ return false;
OnInform(_T("Converting..."));
if (!Header)
{
OnError(_T("Ouch! Could not open temporary file header.rtf for writing."));
- return FALSE;
+ return false;
}
WriteRTFHeader(Header);
fclose(Header);
PopEnvironmentStyle();
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
if (winHelp)
{
// wxFprintf(Contents, _T("\\page\n"));
if (winHelp)
{
wxConcatFiles(_T("header.rtf"), _T("chapters.rtf"), _T("tmp1.rtf"));
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
wxConcatFiles(_T("tmp1.rtf"), _T("sections.rtf"), _T("tmp2.rtf"));
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
wxConcatFiles(_T("tmp2.rtf"), _T("subsections.rtf"), _T("tmp3.rtf"));
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
wxConcatFiles(_T("tmp3.rtf"), _T("subsubsections.rtf"), _T("tmp4.rtf"));
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
wxConcatFiles(_T("tmp4.rtf"), _T("popups.rtf"), OutputFile);
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
wxRemoveFile(_T("tmp1.rtf"));
wxRemoveFile(_T("tmp2.rtf"));
else
{
wxConcatFiles(_T("header.rtf"), _T("chapters.rtf"), _T("tmp1.rtf"));
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
if (wxFileExists(OutputFile))
wxRemoveFile(OutputFile);
wxCopyFile(_T("tmp1.rtf"), OutputFile);
}
delete [] cwdStr;
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
wxRemoveFile(_T("tmp1.rtf"));
}
}
if (winHelp && generateHPJ)
WriteHPJ(OutputFile);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// Name: table.cpp
// Purpose: Utilities for manipulating tables
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 01/01/99
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
#include "table.h"
ColumnData TableData[40];
-bool inTabular = FALSE;
+bool inTabular = false;
-bool startRows = FALSE;
-bool tableVerticalLineLeft = FALSE;
-bool tableVerticalLineRight = FALSE;
+bool startRows = false;
+bool tableVerticalLineLeft = false;
+bool tableVerticalLineRight = false;
int noColumns = 0; // Current number of columns in table
int ruleTop = 0;
int ruleBottom = 0;
noColumns = 0;
int i = 0;
int len = wxStrlen(value);
- bool isBorder = FALSE;
+ bool isBorder = false;
while (i < len)
{
int ch = value[i];
if (ch == '|')
{
i ++;
- isBorder = TRUE;
+ isBorder = true;
}
else if (ch == 'l')
{
TableData[noColumns].leftBorder = isBorder;
- TableData[noColumns].rightBorder = FALSE;
+ TableData[noColumns].rightBorder = false;
TableData[noColumns].justification = 'l';
TableData[noColumns].width = 2000; // Estimate
- TableData[noColumns].absWidth = FALSE;
+ TableData[noColumns].absWidth = false;
// TableData[noColumns].spacing = ??
noColumns ++;
i ++;
- isBorder = FALSE;
+ isBorder = false;
}
else if (ch == 'c')
{
TableData[noColumns].leftBorder = isBorder;
- TableData[noColumns].rightBorder = FALSE;
+ TableData[noColumns].rightBorder = false;
TableData[noColumns].justification = 'c';
TableData[noColumns].width = defaultTableColumnWidth; // Estimate
- TableData[noColumns].absWidth = FALSE;
+ TableData[noColumns].absWidth = false;
// TableData[noColumns].spacing = ??
noColumns ++;
i ++;
- isBorder = FALSE;
+ isBorder = false;
}
else if (ch == 'r')
{
TableData[noColumns].leftBorder = isBorder;
- TableData[noColumns].rightBorder = FALSE;
+ TableData[noColumns].rightBorder = false;
TableData[noColumns].justification = 'r';
TableData[noColumns].width = 2000; // Estimate
- TableData[noColumns].absWidth = FALSE;
+ TableData[noColumns].absWidth = false;
// TableData[noColumns].spacing = ??
noColumns ++;
i ++;
- isBorder = FALSE;
+ isBorder = false;
}
else if (ch == 'p')
{
i++;
ch = value[i];
}
-
+
while ((i < len) && (isdigit(ch) || ch == '.'))
{
numberBuf[j] = ch;
j ++; i++;
numberBuf[j] = 0;
if (value[i] == '}') i++;
-
+
TableData[noColumns].leftBorder = isBorder;
- TableData[noColumns].rightBorder = FALSE;
+ TableData[noColumns].rightBorder = false;
TableData[noColumns].justification = 'l';
TableData[noColumns].width = 20*ParseUnitArgument(numberBuf);
- TableData[noColumns].absWidth = TRUE;
+ TableData[noColumns].absWidth = true;
// TableData[noColumns].spacing = ??
noColumns ++;
- isBorder = FALSE;
+ isBorder = false;
}
else
{
wxChar *buf = new wxChar[wxStrlen(value) + 80];
- wxSprintf(buf, _T("Tabular first argument \"%s\" too complex!"), value);
+ wxSnprintf(buf, wxStrlen(value) + 80, _T("Tabular first argument \"%s\" too complex!"), value);
OnError(buf);
delete[] buf;
- return FALSE;
+ return false;
}
}
if (isBorder)
- TableData[noColumns-1].rightBorder = TRUE;
- return TRUE;
+ TableData[noColumns-1].rightBorder = true;
+ return true;
}
// Name: tex2any.cpp
// Purpose: Utilities for Latex conversion.
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 01/01/99
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
int subsectionFont = 12; // largeFont1;
int titleFont = LARGEFont3;
int authorFont = LargeFont2;
-int mirrorMargins = TRUE;
-bool winHelp = FALSE; // Output in Windows Help format if TRUE, linear otherwise
-bool isInteractive = FALSE;
-bool runTwice = FALSE;
+int mirrorMargins = true;
+bool winHelp = false; // Output in Windows Help format if TRUE, linear otherwise
+bool isInteractive = false;
+bool runTwice = false;
int convertMode = TEX_RTF;
-bool checkCurleyBraces = FALSE;
-bool checkSyntax = FALSE;
-bool headerRule = FALSE;
-bool footerRule = FALSE;
-bool compatibilityMode = FALSE; // If TRUE, maximum Latex compatibility
+bool checkCurleyBraces = false;
+bool checkSyntax = false;
+bool headerRule = false;
+bool footerRule = false;
+bool compatibilityMode = false; // If TRUE, maximum Latex compatibility
// (Quality of RTF generation deteriorate)
bool generateHPJ; // Generate WinHelp Help Project file
wxChar *winHelpTitle = NULL; // Windows Help title
int labelIndentTab = 18; // From left indent to item label (points)
int itemIndentTab = 40; // From left indent to item (points)
-bool useUpButton = TRUE;
+bool useUpButton = true;
int htmlBrowseButtons = HTML_BUTTONS_TEXT;
-bool truncateFilenames = FALSE; // Truncate for DOS
+bool truncateFilenames = false; // Truncate for DOS
int winHelpVersion = 3; // WinHelp Version (3 for Windows 3.1, 4 for Win95)
-bool winHelpContents = FALSE; // Generate .cnt file for WinHelp 4
-bool htmlIndex = FALSE; // Generate .htx file for HTML
-bool htmlFrameContents = FALSE; // Use frames for HTML contents page
+bool winHelpContents = false; // Generate .cnt file for WinHelp 4
+bool htmlIndex = false; // Generate .htx file for HTML
+bool htmlFrameContents = false; // Use frames for HTML contents page
wxChar *htmlStylesheet = NULL; // Use this CSS stylesheet for HTML pages
-bool useHeadingStyles = TRUE; // Insert \s1, s2 etc.
-bool useWord = TRUE; // Insert proper Word table of contents, etc etc
+bool useHeadingStyles = true; // Insert \s1, s2 etc.
+bool useWord = true; // Insert proper Word table of contents, etc etc
int contentsDepth = 4; // Depth of Word table of contents
-bool indexSubsections = TRUE; // Index subsections in linear RTF
+bool indexSubsections = true; // Index subsections in linear RTF
// Linear RTF method of including bitmaps. Can be "includepicture", "hex"
wxChar *bitmapMethod = copystring(_T("includepicture"));
-bool upperCaseNames = FALSE;
+bool upperCaseNames = false;
// HTML background and text colours
wxChar *backgroundImageString = NULL;
wxChar *backgroundColourString = copystring(_T("255;255;255"));
wxChar *textColourString = NULL;
wxChar *linkColourString = NULL;
wxChar *followedLinkColourString = NULL;
-bool combineSubSections = FALSE;
-bool htmlWorkshopFiles = FALSE;
-bool ignoreBadRefs = FALSE;
+bool combineSubSections = false;
+bool htmlWorkshopFiles = false;
+bool ignoreBadRefs = false;
wxChar *htmlFaceName = NULL;
extern int passNumber;
wxChar *TexFileRoot = NULL;
wxChar *TexBibName = NULL; // Bibliography output file name
wxChar *TexTmpBibName = NULL; // Temporary bibliography output file name
-bool isSync = FALSE; // If TRUE, should not yield to other processes.
-bool stopRunning = FALSE; // If TRUE, should abort.
+bool isSync = false; // If TRUE, should not yield to other processes.
+bool stopRunning = false; // If TRUE, should abort.
static int currentColumn = 0;
wxChar *currentArgData = NULL;
-bool haveArgData = FALSE; // If TRUE, we're simulating the data.
+bool haveArgData = false; // If TRUE, we're simulating the data.
TexChunk *currentArgument = NULL;
TexChunk *nextChunk = NULL;
-bool isArgOptional = FALSE;
+bool isArgOptional = false;
int noArgs = 0;
TexChunk *TopLevel = NULL;
TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBrace)
{
- *parseToBrace = TRUE;
+ *parseToBrace = true;
int i = (*pos);
TexMacroDef *def = NULL;
wxChar macroBuf[40];
if ((buffer[i] == 32) || (buffer[i] == '='))
i ++;
- *parseToBrace = FALSE;
+ *parseToBrace = false;
}
*pos = i;
ForbidWarning(def);
{
int len = wxStrlen(buffer);
int j = *pos;
- bool keepGoing = TRUE;
- bool moreLines = TRUE;
+ bool keepGoing = true;
+ bool moreLines = true;
while ((j < len) && keepGoing &&
(buffer[j] == 10 || buffer[j] == 13 || buffer[j] == ' ' || buffer[j] == 9))
{
j = 0;
}
else
- keepGoing = FALSE;
+ keepGoing = false;
}
}
*pos = j;
(wxStrncmp(buffer+i+4, env, wxStrlen(env)) == 0))
{
*pos = i + 5 + wxStrlen(env);
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
-bool readingVerbatim = FALSE;
-bool readInVerbatim = FALSE; // Within a verbatim, but not nec. verbatiminput
+bool readingVerbatim = false;
+bool readInVerbatim = false; // Within a verbatim, but not nec. verbatiminput
// Switched this off because e.g. \verb${$ causes it to fail. There is no
// detection of \verb yet.
if (CurrentInputIndex < 0)
{
buf[0] = 0;
- return FALSE;
+ return false;
}
int ch = -2;
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(), MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
if (((bufIndex == 14) && (wxStrncmp(buf, _T("\\end{verbatim}"), 14) == 0)) ||
((bufIndex == 16) && (wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0)))
- readInVerbatim = FALSE;
+ readInVerbatim = false;
ch = getc(Inputs[CurrentInputIndex]);
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
wxStrcat(buf, _T("\\par"));
bufIndex += 5;
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
buf[bufIndex] = ch;
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
buf[bufIndex++]='\\';
buf[bufIndex++]='"';
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
buf[bufIndex++]='\\';
buf[bufIndex++]='s';
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
// If the current character read in is a '_', we need to check
// whether there should be a '\' before it or not
if (readingVerbatim)
{
- readingVerbatim = FALSE;
- readInVerbatim = FALSE;
+ readingVerbatim = false;
+ readInVerbatim = false;
wxStrcat(buf, _T("\\end{verbatim}\n"));
- return FALSE;
+ return false;
}
}
if (ch == 10)
}
else
{
- readingVerbatim = TRUE;
- readInVerbatim = TRUE;
+ readingVerbatim = true;
+ readInVerbatim = true;
wxStrcpy(buf, _T("\\begin{verbatim}\n"));
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
else if (wxStrncmp(buf, _T("\\input"), 6) == 0 || wxStrncmp(buf, _T("\\helpinput"), 10) == 0 ||
wxStrncmp(buf, _T("\\include"), 8) == 0)
if (actualFile == _T(""))
{
wxChar buf2[400];
- wxSprintf(buf2, _T("%s.tex"), fileNameStr.c_str());
+ wxSnprintf(buf2, sizeof(buf2), _T("%s.tex"), fileNameStr.c_str());
actualFile = TexPathList.FindValidPath(buf2);
}
currentFileName = actualFile;
if (wxStrncmp(buf, _T("\\begin{verbatim}"), 16) == 0 ||
wxStrncmp(buf, _T("\\begin{toocomplex}"), 18) == 0)
- readInVerbatim = TRUE;
+ readInVerbatim = true;
else if (wxStrncmp(buf, _T("\\end{verbatim}"), 14) == 0 ||
wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0)
- readInVerbatim = FALSE;
+ readInVerbatim = false;
if (checkCurleyBraces)
{
noArgs = (int)(buffer[*pos]) - 48;
*pos += 2; // read past argument and '['
}
- bool end = FALSE;
+ bool end = false;
int braceCount = 0;
while (!end)
{
{
braceCount --;
if (braceCount == 0)
- end = TRUE;
+ end = true;
}
else if (ch == 0)
{
CustomMacroList.Append(commandName, macro);
AddMacroDef(ltCUSTOM_MACRO, commandName, noArgs);
}
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
void MacroError(wxChar *buffer)
if (wxStrcmp(macroBuf,_T("\\end{document}")) == 0)
{
OnInform( _T("Halted build due to unrecoverable error.") );
- stopRunning = TRUE;
+ stopRunning = true;
}
}
Tex2RTFYield();
if (stopRunning) return pos;
- bool eof = FALSE;
+ bool eof = false;
BigBuffer[0] = 0;
int buf_ptr = 0;
int len;
if ((pos > 0) && (buffer[pos-1] != ' ') && (buffer[pos] == '[' || buffer[pos] == '('))
{
- isOptional = TRUE;
+ isOptional = true;
pos ++;
}
else if ((pos > 1) && (buffer[pos-1] != ' ') && (buffer[pos+1] == '[' || buffer[pos+1] == '('))
{
- isOptional = TRUE;
+ isOptional = true;
pos += 2;
}
}
wxTex2RTFBuffer[0] = 0;
int i = 0;
- bool end = FALSE;
+ bool end = false;
while (!end)
{
int ch = buffer[pos];
if (noBraces == 0)
{
wxTex2RTFBuffer[i] = 0;
- end = TRUE;
+ end = true;
}
else
{
pos ++;
i ++;
if (ch == 0)
- end = TRUE;
+ end = true;
}
}
TexChunk *chunk = new TexChunk(CHUNK_TYPE_MACRO);
else
{
wxChar *env = NULL;
- bool tmpParseToBrace = TRUE;
+ bool tmpParseToBrace = true;
TexMacroDef *def = MatchMacro(buffer, &pos, &env, &tmpParseToBrace);
if (def)
{
// wxStrcpy(macroBuf, _T("{"));
wxStrcpy(macroBuf, customMacro->macroBody);
wxStrcat(macroBuf, _T("}"));
- ParseArg(thisArg, children, macroBuf, 0, NULL, TRUE, chunk);
+ ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
// delete chunk; // Might delete children
children.Append((wxObject *)chunk);
pos = ParseMacroBody(def->name, chunk, chunk->no_args,
- buffer, pos, NULL, TRUE, customMacroArgs);
+ buffer, pos, NULL, true, customMacroArgs);
// If custom macro, parse the body substituting the above found args.
if (customMacro)
// wxStrcpy(macroBuf, _T("{"));
wxStrcpy(macroBuf, customMacro->macroBody);
wxStrcat(macroBuf, _T("}"));
- ParseArg(thisArg, children, macroBuf, 0, NULL, TRUE, chunk);
+ ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
// delete chunk; // Might delete children
*/
if (!SoloBlockDef)
{
- SoloBlockDef = new TexMacroDef(ltSOLO_BLOCK, _T("solo block"), 1, FALSE);
+ SoloBlockDef = new TexMacroDef(ltSOLO_BLOCK, _T("solo block"), 1, false);
}
// Save text so far
if (buf_ptr > 0)
arg->argn = 1;
arg->macroId = chunk->macroId;
- pos = ParseArg(arg, arg->children, buffer, pos, NULL, TRUE, customMacroArgs);
+ pos = ParseArg(arg, arg->children, buffer, pos, NULL, true, customMacroArgs);
}
break;
}
else
actualEnv = environment;
- bool isOptional = FALSE;
+ bool isOptional = false;
// Remove the first { of the argument so it doesn't get recognized as { ... }
// EatWhiteSpace(buffer, &pos);
else
if ((pos > 0) && (buffer[pos-1] != ' ') && (buffer[pos] == '['))
{
- isOptional = TRUE;
+ isOptional = true;
pos ++;
}
else if ((pos > 1) && (buffer[pos-1] != ' ') && (buffer[pos+1] == '['))
{
- isOptional = TRUE;
+ isOptional = true;
pos += 2;
}
else if (i > 0)
bool TexLoadFile(wxChar *filename)
{
static wxChar *line_buffer;
- stopRunning = FALSE;
+ stopRunning = false;
wxStrcpy(TexFileRoot, filename);
StripExtension(TexFileRoot);
- wxSprintf(TexBibName, _T("%s.bb"), TexFileRoot);
- wxSprintf(TexTmpBibName, _T("%s.bb1"), TexFileRoot);
+ wxSnprintf(TexBibName, 300, _T("%s.bb"), TexFileRoot);
+ wxSnprintf(TexTmpBibName, 300, _T("%s.bb1"), TexFileRoot);
TexPathList.EnsureFileAccessible(filename);
if (Inputs[0])
{
read_a_line(line_buffer);
- ParseMacroBody(_T("toplevel"), TopLevel, 1, line_buffer, 0, NULL, TRUE);
+ ParseMacroBody(_T("toplevel"), TopLevel, 1, line_buffer, 0, NULL, true);
if (Inputs[0]) fclose(Inputs[0]);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TexMacroDef::TexMacroDef(int the_id, const wxChar *the_name, int n, bool ig, bool forbidLevel)
def = the_def;
macroId = 0;
value = NULL;
- optional = FALSE;
+ optional = false;
}
TexChunk::TexChunk(TexChunk& toCopy)
{
currentArgData[0] = 0;
GetArgData1(currentArgument);
- haveArgData = FALSE;
+ haveArgData = false;
return currentArgData;
}
return;
if (!childrenOnly)
- OnMacro(chunk->macroId, chunk->no_args, TRUE);
+ OnMacro(chunk->macroId, chunk->no_args, true);
wxNode *node = chunk->children.GetFirst();
while (node)
nextChunk = (TexChunk *)thisNode->GetNext()->GetData();
if (!childrenOnly)
- OnMacro(chunk->macroId, chunk->no_args, FALSE);
+ OnMacro(chunk->macroId, chunk->no_args, false);
break;
}
case CHUNK_TYPE_ARG:
isArgOptional = chunk->optional;
noArgs = chunk->no_args;
- // If OnArgument returns FALSE, don't output.
+ // If OnArgument returns false, don't output.
- if (childrenOnly || OnArgument(chunk->macroId, chunk->argn, TRUE))
+ if (childrenOnly || OnArgument(chunk->macroId, chunk->argn, true))
{
wxNode *node = chunk->children.GetFirst();
while (node)
noArgs = chunk->no_args;
if (!childrenOnly)
- (void)OnArgument(chunk->macroId, chunk->argn, FALSE);
+ (void)OnArgument(chunk->macroId, chunk->argn, false);
break;
}
case CHUNK_TYPE_STRING:
if (issuedNewParagraph && !((chunk->value[0] == 10 || chunk->value[0] == 13 || chunk->value[0] == 32)
&& chunk->value[1] == 0))
{
- issuedNewParagraph = FALSE;
+ issuedNewParagraph = false;
}
- TexOutput(chunk->value, TRUE);
+ TexOutput(chunk->value, true);
}
break;
}
CurrentOutput1 = NULL;
CurrentOutput2 = NULL;
CurrentInputIndex = 0;
- haveArgData = FALSE;
+ haveArgData = false;
noArgs = 0;
if (TopLevel)
AddMacroDef(ltCLIPSFUNC, _T("clipsfunc"), 3);
AddMacroDef(ltCLUBSUIT, _T("clubsuit"), 0);
AddMacroDef(ltCOLUMNSEP, _T("columnsep"), 1);
- AddMacroDef(ltCOMMENT, _T("comment"), 1, TRUE);
+ AddMacroDef(ltCOMMENT, _T("comment"), 1, true);
AddMacroDef(ltCONG, _T("cong"), 0);
AddMacroDef(ltCOPYRIGHT, _T("copyright"), 0);
AddMacroDef(ltCPARAM, _T("cparam"), 2);
AddMacroDef(ltHEADHEIGHT, _T("headheight"), 1);
AddMacroDef(ltHEARTSUIT, _T("heartsuit"), 0);
AddMacroDef(ltHELPGLOSSARY, _T("helpglossary"), 1);
- AddMacroDef(ltHELPIGNORE, _T("helpignore"), 1, TRUE);
+ AddMacroDef(ltHELPIGNORE, _T("helpignore"), 1, true);
AddMacroDef(ltHELPONLY, _T("helponly"), 1);
AddMacroDef(ltHELPINPUT, _T("helpinput"), 1);
AddMacroDef(ltHELPFONTFAMILY, _T("helpfontfamily"), 1);
AddMacroDef(ltINCLUDE, _T("include"), 1);
AddMacroDef(ltINDENTED, _T("indented"), 2);
AddMacroDef(ltINDEX, _T("index"), 1);
- AddMacroDef(ltINPUT, _T("input"), 1, TRUE);
+ AddMacroDef(ltINPUT, _T("input"), 1, true);
AddMacroDef(ltIOTA, _T("iota"), 0);
AddMacroDef(ltITEMIZE, _T("itemize"), 1);
AddMacroDef(ltITEM, _T("item"), 0);
AddMacroDef(ltNABLA, _T("nabla"), 0);
AddMacroDef(ltNEG, _T("neg"), 0);
AddMacroDef(ltNEQ, _T("neq"), 0);
- AddMacroDef(ltNEWCOUNTER, _T("newcounter"), 1, FALSE, (bool)FORBID_ABSOLUTELY);
+ AddMacroDef(ltNEWCOUNTER, _T("newcounter"), 1, false, (bool)FORBID_ABSOLUTELY);
AddMacroDef(ltNEWLINE, _T("newline"), 0);
AddMacroDef(ltNEWPAGE, _T("newpage"), 0);
AddMacroDef(ltNI, _T("ni"), 0);
AddMacroDef(ltPRECEQ, _T("preceq"), 0);
AddMacroDef(ltPRINTINDEX, _T("printindex"), 0);
AddMacroDef(ltPROPTO, _T("propto"), 0);
- AddMacroDef(ltPSBOXTO, _T("psboxto"), 1, FALSE, (bool)FORBID_ABSOLUTELY);
- AddMacroDef(ltPSBOX, _T("psbox"), 1, FALSE, (bool)FORBID_ABSOLUTELY);
+ AddMacroDef(ltPSBOXTO, _T("psboxto"), 1, false, (bool)FORBID_ABSOLUTELY);
+ AddMacroDef(ltPSBOX, _T("psbox"), 1, false, (bool)FORBID_ABSOLUTELY);
AddMacroDef(ltPSI, _T("psi"), 0);
AddMacroDef(ltCAP_PSI, _T("Psi"), 0);
AddMacroDef(ltSUPSET, _T("supset"), 0);
AddMacroDef(ltSUBSUBSECTIONSTAR, _T("subsubsection*"), 1);
AddMacroDef(ltSUBSUBSECTION, _T("subsubsection"), 1);
- AddMacroDef(ltSUPERTABULAR, _T("supertabular"), 2, FALSE);
+ AddMacroDef(ltSUPERTABULAR, _T("supertabular"), 2, false);
AddMacroDef(ltSURD, _T("surd"), 0);
AddMacroDef(ltSCRIPTSIZE, _T("scriptsize"), 1);
AddMacroDef(ltSETHEADER, _T("setheader"), 6);
AddMacroDef(ltTABBING, _T("tabbing"), 2);
AddMacroDef(ltTABLEOFCONTENTS, _T("tableofcontents"), 0);
AddMacroDef(ltTABLE, _T("table"), 1);
- AddMacroDef(ltTABULAR, _T("tabular"), 2, FALSE);
+ AddMacroDef(ltTABULAR, _T("tabular"), 2, false);
AddMacroDef(ltTAB, _T("tab"), 0);
AddMacroDef(ltTAU, _T("tau"), 0);
AddMacroDef(ltTEXTRM, _T("textrm"), 1);
{
// Write the heading
FakeCurrentSection(AbstractNameString);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
else
{
{
// Write the heading
FakeCurrentSection(GlossaryNameString);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
if ((convertMode == TEX_RTF) && !winHelp)
{
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
}
break;
case ltCINSERT:
if (start)
- TexOutput(_T("<<"), TRUE);
+ TexOutput(_T("<<"), true);
break;
case ltCEXTRACT:
if (start)
- TexOutput(_T(">>"), TRUE);
+ TexOutput(_T(">>"), true);
break;
case ltDESTRUCT:
if (start)
- TexOutput(_T("~"), TRUE);
+ TexOutput(_T("~"), true);
break;
case ltTILDE:
if (start)
- TexOutput(_T("~"), TRUE);
+ TexOutput(_T("~"), true);
break;
case ltSPECIALTILDE:
if (start)
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
break;
case ltUNDERSCORE:
if (start)
- TexOutput(_T("_"), TRUE);
+ TexOutput(_T("_"), true);
break;
case ltHASH:
if (start)
- TexOutput(_T("#"), TRUE);
+ TexOutput(_T("#"), true);
break;
case ltAMPERSAND:
if (start)
- TexOutput(_T("&"), TRUE);
+ TexOutput(_T("&"), true);
break;
case ltSPACE:
if (start)
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
break;
case ltPIPE:
if (start)
- TexOutput(_T("|"), TRUE);
+ TexOutput(_T("|"), true);
break;
case ltPERCENT:
if (start)
- TexOutput(_T("%"), TRUE);
+ TexOutput(_T("%"), true);
break;
case ltDOLLAR:
if (start)
- TexOutput(_T("$"), TRUE);
+ TexOutput(_T("$"), true);
break;
case ltLPARENTH:
if (start)
- TexOutput(_T(""), TRUE);
+ TexOutput(_T(""), true);
break;
case ltRPARENTH:
if (start)
- TexOutput(_T(""), TRUE);
+ TexOutput(_T(""), true);
break;
case ltLBRACE:
if (start)
- TexOutput(_T("{"), TRUE);
+ TexOutput(_T("{"), true);
break;
case ltRBRACE:
if (start)
- TexOutput(_T("}"), TRUE);
+ TexOutput(_T("}"), true);
break;
case ltCOPYRIGHT:
if (start)
- TexOutput(_T("(c)"), TRUE);
+ TexOutput(_T("(c)"), true);
break;
case ltREGISTERED:
if (start)
- TexOutput(_T("(r)"), TRUE);
+ TexOutput(_T("(r)"), true);
break;
case ltBACKSLASH:
if (start)
- TexOutput(_T("\\"), TRUE);
+ TexOutput(_T("\\"), true);
break;
case ltLDOTS:
case ltCDOTS:
if (start)
- TexOutput(_T("..."), TRUE);
+ TexOutput(_T("..."), true);
break;
case ltVDOTS:
if (start)
- TexOutput(_T("|"), TRUE);
+ TexOutput(_T("|"), true);
break;
case ltLATEX:
if (start)
- TexOutput(_T("LaTeX"), TRUE);
+ TexOutput(_T("LaTeX"), true);
break;
case ltTEX:
if (start)
- TexOutput(_T("TeX"), TRUE);
+ TexOutput(_T("TeX"), true);
break;
case ltPOUNDS:
if (start)
- TexOutput(_T("£"), TRUE);
+ TexOutput(_T("£"), true);
break;
case ltSPECIALDOUBLEDOLLAR: // Interpret as center
OnMacro(ltCENTER, no_args, start);
{
time_t when;
(void) time(&when);
- TexOutput(wxCtime(&when), TRUE);
+ TexOutput(wxCtime(&when), true);
}
break;
}
else i ++;
}
}
- TexOutput(texRef->sectionNumber + i, TRUE);
+ TexOutput(texRef->sectionNumber + i, true);
}
else
{
OnInform((wxChar *)informBuf.c_str());
}
}
- else TexOutput(_T("??"), TRUE);
- return FALSE;
+ else TexOutput(_T("??"), true);
+ return false;
}
break;
}
case ltLABEL:
{
- return FALSE;
+ return false;
}
case ltAUTHOR:
{
if (start && (arg_no == 1))
DocumentAuthor = GetArgChunk();
- return FALSE;
+ return false;
}
case ltDATE:
{
if (start && (arg_no == 1))
DocumentDate = GetArgChunk();
- return FALSE;
+ return false;
}
case ltTITLE:
{
if (start && (arg_no == 1))
DocumentTitle = GetArgChunk();
- return FALSE;
+ return false;
}
case ltDOCUMENTCLASS:
case ltDOCUMENTSTYLE:
else if (StringMatch(_T("12"), DocumentStyleString))
SetFontSizes(12);
- OnMacro(ltHELPFONTSIZE, 1, TRUE);
- wxSprintf(currentArgData, _T("%d"), normalFont);
- haveArgData = TRUE;
- OnArgument(ltHELPFONTSIZE, 1, TRUE);
- OnArgument(ltHELPFONTSIZE, 1, FALSE);
- haveArgData = FALSE;
- OnMacro(ltHELPFONTSIZE, 1, FALSE);
+ OnMacro(ltHELPFONTSIZE, 1, true);
+ wxSnprintf(currentArgData, 2000, _T("%d"), normalFont);
+ haveArgData = true;
+ OnArgument(ltHELPFONTSIZE, 1, true);
+ OnArgument(ltHELPFONTSIZE, 1, false);
+ haveArgData = false;
+ OnMacro(ltHELPFONTSIZE, 1, false);
}
else if (start && IsArgOptional())
{
else if (StringMatch(_T("12"), MinorDocumentStyleString))
SetFontSizes(12);
}
- return FALSE;
+ return false;
}
case ltBIBLIOGRAPHYSTYLE:
{
if (start && !IsArgOptional())
BibliographyStyleString = copystring(GetArgData());
- return FALSE;
+ return false;
}
case ltPAGESTYLE:
{
if (PageStyle) delete[] PageStyle;
PageStyle = copystring(GetArgData());
}
- return FALSE;
+ return false;
}
/*
case ltLHEAD:
{
if (start && !IsArgOptional())
LeftHeader = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltLFOOT:
{
if (start && !IsArgOptional())
LeftFooter = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltCHEAD:
{
if (start && !IsArgOptional())
CentreHeader = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltCFOOT:
{
if (start && !IsArgOptional())
CentreFooter = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltRHEAD:
{
if (start && !IsArgOptional())
RightHeader = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltRFOOT:
{
if (start && !IsArgOptional())
RightFooter = GetArgChunk();
- return FALSE;
+ return false;
break;
}
*/
TexRef *ref = FindReference(citeKey);
if (ref)
{
- TexOutput(ref->sectionNumber, TRUE);
+ TexOutput(ref->sectionNumber, true);
if (wxStrcmp(ref->sectionNumber, _T("??")) == 0)
{
wxString informBuf;
citeKey = ParseMultifieldString(citeKeys, &pos);
if (citeKey)
{
- TexOutput(_T(", "), TRUE);
+ TexOutput(_T(", "), true);
}
}
- return FALSE;
+ return false;
}
break;
}
{
wxChar *citeKey = GetArgData();
AddCitation(citeKey);
- return FALSE;
+ return false;
}
break;
}
SetFontSizes(11);
else if (wxStrcmp(data, _T("12")) == 0)
SetFontSizes(12);
- return FALSE;
+ return false;
}
break;
}
{
if (start)
{
- TexOutput(_T(" ??"), TRUE);
- return FALSE;
+ TexOutput(_T(" ??"), true);
+ return false;
}
break;
}
{
wxChar *data = GetArgData();
ParSkip = ParseUnitArgument(data);
- return FALSE;
+ return false;
}
break;
}
{
wxChar *data = GetArgData();
ParIndent = ParseUnitArgument(data);
- return FALSE;
+ return false;
}
break;
}
case ltFOOTNOTE:
{
if (start)
- TexOutput(_T(" ("), TRUE);
+ TexOutput(_T(" ("), true);
else
- TexOutput(_T(")"), TRUE);
+ TexOutput(_T(")"), true);
break;
}
case ltBIBLIOGRAPHY:
wxRenameFile(TexTmpBibName, TexBibName);
}
SetCurrentOutputs(save1, save2);
- return FALSE;
+ return false;
}
break;
}
s1[i] = wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
- return FALSE;
+ return false;
}
- else return TRUE;
+ else return true;
}
- return TRUE;
+ return true;
}
case ltLOWERCASE:
{
s1[i] = wxTolower(s[i]);
TexOutput(s1);
delete[] s1;
- return FALSE;
+ return false;
}
- else return TRUE;
+ else return true;
}
- return TRUE;
+ return true;
}
case ltUPPERCASE:
{
s1[i] = wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
- return FALSE;
+ return false;
}
- else return TRUE;
+ else return true;
}
- return TRUE;
+ return true;
}
case ltPOPREF: // Ignore second argument by default
return (start && (arg_no == 1));
case ltTWOCOLUMN:
- return TRUE;
+ return true;
case ltXLPIGNORE:
- return ((convertMode == TEX_XLP) ? FALSE : TRUE);
+ return ((convertMode == TEX_XLP) ? false : true);
case ltXLPONLY:
- return ((convertMode != TEX_XLP) ? FALSE : TRUE);
+ return ((convertMode != TEX_XLP) ? false : true);
case ltHTMLIGNORE:
- return ((convertMode == TEX_HTML) ? FALSE : TRUE);
+ return ((convertMode == TEX_HTML) ? false : true);
case ltHTMLONLY:
- return ((convertMode != TEX_HTML) ? FALSE : TRUE);
+ return ((convertMode != TEX_HTML) ? false : true);
case ltRTFIGNORE:
- return (((convertMode == TEX_RTF) && !winHelp) ? FALSE : TRUE);
+ return (((convertMode == TEX_RTF) && !winHelp) ? false : true);
case ltRTFONLY:
- return (!((convertMode == TEX_RTF) && !winHelp) ? FALSE : TRUE);
+ return (!((convertMode == TEX_RTF) && !winHelp) ? false : true);
case ltWINHELPIGNORE:
- return (winHelp ? FALSE : TRUE);
+ return (winHelp ? false : true);
case ltWINHELPONLY:
- return (!winHelp ? FALSE : TRUE);
+ return (!winHelp ? false : true);
case ltLATEXIGNORE:
- return TRUE;
+ return true;
case ltLATEXONLY:
- return FALSE;
+ return false;
case ltCLINE:
case ltARABIC:
case ltALPH1:
case ltIMAGER:
case ltPOPREFONLY:
case ltINSERTATLEVEL:
- return FALSE;
+ return false;
case ltTABULAR:
case ltSUPERTABULAR:
case ltINDENTED:
break;
}
}
- return FALSE;
+ return false;
}
case ltFIGURE:
case ltFIGURESTAR:
default:
return (!IsArgOptional());
}
- return TRUE;
+ return true;
}
bool read_a_line(wxChar *buf);
bool TexLoadFile(wxChar *filename);
int ParseArg(TexChunk *thisArg, wxList& children, wxChar *buffer, int pos,
- wxChar *environment = NULL, bool parseArgToBrace = TRUE, TexChunk *customMacroArgs = NULL);
+ wxChar *environment = NULL, bool parseArgToBrace = true, TexChunk *customMacroArgs = NULL);
int ParseMacroBody(const wxChar *macro_name, TexChunk *parent, int no_args,
- wxChar *buffer, int pos, wxChar *environment = NULL, bool parseArgToBrace = TRUE, TexChunk *customMacroArgs = NULL);
+ wxChar *buffer, int pos, wxChar *environment = NULL, bool parseArgToBrace = true, TexChunk *customMacroArgs = NULL);
void TraverseDocument(void);
-void TraverseFromChunk(TexChunk *chunk, wxNode *thisNode = NULL, bool childrenOnly = FALSE);
-#define TraverseChildrenFromChunk(arg) TraverseFromChunk(arg, NULL, TRUE)
+void TraverseFromChunk(TexChunk *chunk, wxNode *thisNode = NULL, bool childrenOnly = false);
+#define TraverseChildrenFromChunk(arg) TraverseFromChunk(arg, NULL, true)
void SetCurrentOutput(FILE *fd);
void SetCurrentOutputs(FILE *fd1, FILE *fd2);
extern FILE *CurrentOutput1;
extern FILE *CurrentOutput2;
-void AddMacroDef(int the_id, const wxChar *name, int n, bool ignore = FALSE, bool forbidden = FALSE);
+void AddMacroDef(int the_id, const wxChar *name, int n, bool ignore = false, bool forbidden = false);
void TexInitialize(int bufSize);
void TexCleanUp(void);
-void TexOutput(const wxChar *s, bool ordinaryText = FALSE);
+void TexOutput(const wxChar *s, bool ordinaryText = false);
wxChar *GetArgData(TexChunk *chunk);
wxChar *GetArgData(void); // Get the string for the current argument
int GetNoArgs(void); // Get the number of arguments for the current macro
extern wxPathList TexPathList; // Path list, can be used for file searching.
#if !WXWIN_COMPATIBILITY_2
-extern bool StringMatch(const wxChar *one, const wxChar *two, bool subString = TRUE, bool exact = FALSE);
+extern bool StringMatch(const wxChar *one, const wxChar *two, bool subString = true, bool exact = false);
#endif
// Define a variable value from the .ini file
-wxChar *RegisterSetting(wxChar *settingName, wxChar *settingValue, bool interactive = TRUE);
+wxChar *RegisterSetting(wxChar *settingName, wxChar *settingValue, bool interactive = true);
// Major document styles
#define LATEX_REPORT 1
extern void OutputChunkToString(TexChunk *chunk, wxChar *buf);
// Called by Tex2Any to simulate a section
-extern void FakeCurrentSection(wxChar *fakeSection, bool addToContents = TRUE);
+extern void FakeCurrentSection(wxChar *fakeSection, bool addToContents = true);
/*
* Local to Tex2Any library
void OnInform(const wxChar *msg);
// Special yield wrapper
-void Tex2RTFYield(bool force = FALSE);
+void Tex2RTFYield(bool force = false);
/*
* Useful utilities
// Name: tex2rtf.cpp
// Purpose: Converts Latex to linear/WinHelp RTF, HTML, wxHelp.
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
#include "wx/timer.h"
#endif
-#if defined(NO_GUI) || defined(__UNIX__)
#if wxUSE_IOSTREAMH
#include <iostream.h>
#include <fstream.h>
#include <iostream>
#include <fstream>
#endif
-#endif
#include <ctype.h>
#include <stdlib.h>
const float versionNo = TEX2RTF_VERSION_NUMBER;
TexChunk *currentMember = NULL;
-bool startedSections = FALSE;
+bool startedSections = false;
wxChar *contentsString = NULL;
-bool suppressNameDecoration = FALSE;
-bool OkToClose = TRUE;
+bool suppressNameDecoration = false;
+bool OkToClose = true;
int passNumber = 1;
unsigned long errorCount = 0;
wxChar wxTex2RTFBuffer[1500];
#ifdef NO_GUI
-
-int main(int argc, char **argv)
+ IMPLEMENT_APP_CONSOLE(MyApp)
#else
-wxMenuBar *menuBar = NULL;
-MyFrame *frame = NULL;
-
-// DECLARE_APP(MyApp)
-IMPLEMENT_APP(MyApp)
+ wxMenuBar *menuBar = NULL;
+ MyFrame *frame = NULL;
+ // DECLARE_APP(MyApp)
+ IMPLEMENT_APP(MyApp)
+#endif
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit()
-#endif
{
// Use default list of macros defined in tex2any.cc
DefineDefaultMacros();
WinHelpContentsFileName = new wxChar[300];
RefFileName = new wxChar[300];
- ColourTable.DeleteContents(TRUE);
+ ColourTable.DeleteContents(true);
int n = 1;
ShowOptions();
exit(1);
}
-
#endif
+
if (InputFile)
{
TexPathList.EnsureFileAccessible(InputFile);
}
if (!InputFile || !OutputFile)
- isInteractive = TRUE;
+ isInteractive = true;
int i;
for (i = n; i < argc;)
{
i ++;
convertMode = TEX_RTF;
- winHelp = TRUE;
+ winHelp = true;
}
#ifndef NO_GUI
else if (wxStrcmp(argv[i], _T("-interactive")) == 0)
{
i ++;
- isInteractive = TRUE;
+ isInteractive = true;
}
#endif
else if (wxStrcmp(argv[i], _T("-sync")) == 0) // Don't yield
{
i ++;
- isSync = TRUE;
+ isSync = true;
}
else if (wxStrcmp(argv[i], _T("-rtf")) == 0)
{
else if (wxStrcmp(argv[i], _T("-twice")) == 0)
{
i ++;
- runTwice = TRUE;
+ runTwice = true;
}
else if (wxStrcmp(argv[i], _T("-macros")) == 0)
{
else
{
OnError(_T("Incorrect argument for -charset"));
- return FALSE;
+ return false;
}
}
}
else if (wxStrcmp(argv[i], _T("-checkcurleybraces")) == 0)
{
i ++;
- checkCurleyBraces = TRUE;
+ checkCurleyBraces = true;
}
else if (wxStrcmp(argv[i], _T("-checksyntax")) == 0)
{
i ++;
- checkSyntax = TRUE;
+ checkSyntax = true;
}
else
{
ShowOptions();
exit(1);
#endif
- return FALSE;
+ return false;
}
}
wxChar buf[100];
// Create the main frame window
- frame = new MyFrame(NULL, -1, _T("Tex2RTF"), wxPoint(-1, -1), wxSize(400, 300));
+ frame = new MyFrame(NULL, wxID_ANY, _T("Tex2RTF"), wxDefaultPosition, wxSize(400, 300));
frame->CreateStatusBar(2);
// Give it an icon
if (InputFile)
{
- wxSprintf(buf, _T("Tex2RTF [%s]"), wxFileNameFromPath(InputFile));
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), wxFileNameFromPath(InputFile));
frame->SetTitle(buf);
}
wxMenu *options_menu = new wxMenu;
- options_menu->Append(TEX_OPTIONS_CURELY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),TRUE);
- options_menu->Append(TEX_OPTIONS_SYNTAX_CHECKING, _T("Syntax checking"), _T("Syntax checking for common errors"),TRUE);
+ options_menu->Append(TEX_OPTIONS_CURELY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),true);
+ options_menu->Append(TEX_OPTIONS_SYNTAX_CHECKING, _T("Syntax checking"), _T("Syntax checking for common errors"),true);
options_menu->Check(TEX_OPTIONS_CURELY_BRACE, checkCurleyBraces);
options_menu->Check(TEX_OPTIONS_SYNTAX_CHECKING, checkSyntax);
menuBar->Append(help_menu, _T("&Help"));
frame->SetMenuBar(menuBar);
- frame->textWindow = new wxTextCtrl(frame, -1, _T(""), wxPoint(-1, -1), wxSize(-1, -1), wxTE_READONLY|wxTE_MULTILINE);
+ frame->textWindow = new wxTextCtrl(frame, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_MULTILINE);
(*frame->textWindow) << _T("Welcome to Tex2RTF.\n");
// ShowOptions();
wxStrcat(buf, _T(" mode."));
frame->SetStatusText(buf, 1);
- frame->Show(TRUE);
- return TRUE;
+ frame->Show(true);
+ return true;
}
else
#endif // NO_GUI
Go();
}
#ifdef NO_GUI
- return 0;
+ return true;
#else
- return FALSE;
+ return false;
#endif
}
-
-#if 0
- // it already returned something, no need to cause warning
-#ifndef NO_GUI
- // Return the main frame window
- return TRUE;
-#else
- return 0;
-#endif
-#endif
}
#ifndef NO_GUI
void ShowOptions(void)
{
wxChar buf[100];
- wxSprintf(buf, _T("Tex2RTF version %.2f"), versionNo);
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF version %.2f"), versionNo);
OnInform(buf);
OnInform(_T("Usage: tex2rtf [input] [output] [switches]\n"));
OnInform(_T("where valid switches are"));
{
if (!stopRunning && !OkToClose)
{
- stopRunning = TRUE;
- runTwice = FALSE;
+ stopRunning = true;
+ runTwice = false;
return;
}
else if (OkToClose)
{
passNumber = 1;
errorCount = 0;
- menuBar->EnableTop(0, FALSE);
- menuBar->EnableTop(1, FALSE);
- menuBar->EnableTop(2, FALSE);
- menuBar->EnableTop(3, FALSE);
+ menuBar->EnableTop(0, false);
+ menuBar->EnableTop(1, false);
+ menuBar->EnableTop(2, false);
+ menuBar->EnableTop(3, false);
textWindow->Clear();
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
Go();
if (stopRunning)
if (runTwice && !stopRunning)
{
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
Go();
}
- menuBar->EnableTop(0, TRUE);
- menuBar->EnableTop(1, TRUE);
- menuBar->EnableTop(2, TRUE);
- menuBar->EnableTop(3, TRUE);
+ menuBar->EnableTop(0, true);
+ menuBar->EnableTop(1, true);
+ menuBar->EnableTop(2, true);
+ menuBar->EnableTop(3, true);
}
void MyFrame::OnSetInput(wxCommandEvent& WXUNUSED(event))
{
- ChooseInputFile(TRUE);
+ ChooseInputFile(true);
}
void MyFrame::OnSetOutput(wxCommandEvent& WXUNUSED(event))
{
- ChooseOutputFile(TRUE);
+ ChooseOutputFile(true);
}
void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event))
{
textWindow->SaveFile(s);
wxChar buf[350];
- wxSprintf(buf, _T("Saved text to %s"), (const wxChar*) s.c_str());
+ wxSnprintf(buf, sizeof(buf), _T("Saved text to %s"), (const wxChar*) s.c_str());
frame->SetStatusText(buf, 0);
}
}
textWindow->LoadFile(OutputFile);
wxChar buf[300];
wxString str(wxFileNameFromPath(OutputFile));
- wxSprintf(buf, _T("Tex2RTF [%s]"), (const wxChar*) str.c_str());
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), (const wxChar*) str.c_str());
frame->SetTitle(buf);
}
}
textWindow->LoadFile(InputFile);
wxChar buf[300];
wxString str(wxFileNameFromPath(OutputFile));
- wxSprintf(buf, _T("Tex2RTF [%s]"), (const wxChar*) str.c_str());
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), (const wxChar*) str.c_str());
frame->SetTitle(buf);
}
}
void MyFrame::OnShowMacros(wxCommandEvent& WXUNUSED(event))
{
textWindow->Clear();
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
ShowCustomMacros();
}
void MyFrame::OnModeRTF(wxCommandEvent& WXUNUSED(event))
{
convertMode = TEX_RTF;
- winHelp = FALSE;
+ winHelp = false;
InputFile = NULL;
OutputFile = NULL;
SetStatusText(_T("In linear RTF mode."), 1);
void MyFrame::OnModeWinHelp(wxCommandEvent& WXUNUSED(event))
{
convertMode = TEX_RTF;
- winHelp = TRUE;
+ winHelp = true;
InputFile = NULL;
OutputFile = NULL;
SetStatusText(_T("In WinHelp RTF mode."), 1);
void MyFrame::OnModeHTML(wxCommandEvent& WXUNUSED(event))
{
convertMode = TEX_HTML;
- winHelp = FALSE;
+ winHelp = false;
InputFile = NULL;
OutputFile = NULL;
SetStatusText(_T("In HTML mode."), 1);
wxChar *platform = _T("");
#endif
#endif
- wxSprintf(buf, _T("Tex2RTF Version %.2f%s\nLaTeX to RTF, WinHelp, and HTML Conversion\n\n(c) Julian Smart, George Tasker and others, 1999-2002"), versionNo, platform);
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF Version %.2f%s\nLaTeX to RTF, WinHelp, and HTML Conversion\n\n(c) Julian Smart, George Tasker and others, 1999-2002"), versionNo, platform);
wxMessageBox(buf, _T("About Tex2RTF"));
}
#endif
if (!InputFile || !OutputFile || stopRunning)
- return FALSE;
+ return false;
#ifndef NO_GUI
if (isInteractive)
wxChar buf[300];
wxString str = wxFileNameFromPath(InputFile);
- wxSprintf(buf, _T("Tex2RTF [%s]"), (const wxChar*) str);
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), (const wxChar*) str);
frame->SetTitle(buf);
}
sName[5] = '\0'; // that should do!
}
- wxSprintf(ContentsName, _T("%s.con"), FileRoot);
- wxSprintf(TmpContentsName, _T("%s.cn1"), FileRoot);
- wxSprintf(TmpFrameContentsName, _T("%s.frc"), FileRoot);
- wxSprintf(WinHelpContentsFileName, _T("%s.cnt"), FileRoot);
- wxSprintf(RefFileName, _T("%s.ref"), FileRoot);
+ wxSnprintf(ContentsName, 300, _T("%s.con"), FileRoot);
+ wxSnprintf(TmpContentsName, 300, _T("%s.cn1"), FileRoot);
+ wxSnprintf(TmpFrameContentsName, 300, _T("%s.frc"), FileRoot);
+ wxSnprintf(WinHelpContentsFileName, 300, _T("%s.cnt"), FileRoot);
+ wxSnprintf(RefFileName, 300, _T("%s.ref"), FileRoot);
TexPathList.EnsureFileAccessible(InputFile);
if (!bulletFile)
if (wxFileExists(RefFileName))
ReadTexReferences(RefFileName);
- bool success = FALSE;
+ bool success = false;
if (InputFile && OutputFile)
{
{
OnError(_T("Cannot open input file!"));
TexCleanUp();
- return FALSE;
+ return false;
}
#ifndef NO_GUI
if (isInteractive)
frame->SetStatusText((wxChar *)buf.c_str());
}
#endif
- OkToClose = FALSE;
+ OkToClose = false;
OnInform(_T("Reading LaTeX file..."));
TexLoadFile(InputFile);
if (stopRunning)
{
- OkToClose = TRUE;
- return FALSE;
+ OkToClose = true;
+ return false;
}
switch (convertMode)
if (stopRunning)
{
OnInform(_T("*** Aborted by user."));
- success = FALSE;
- stopRunning = FALSE;
- OkToClose = TRUE;
+ success = false;
+ stopRunning = false;
+ OkToClose = true;
}
if (success)
{
WriteTexReferences(RefFileName);
TexCleanUp();
- startedSections = FALSE;
+ startedSections = false;
wxString buf;
#ifndef NO_GUI
#endif
passNumber ++;
errorCount = 0;
- OkToClose = TRUE;
- return TRUE;
+ OkToClose = true;
+ return true;
}
TexCleanUp();
- startedSections = FALSE;
+ startedSections = false;
#ifndef NO_GUI
frame->SetStatusText(_T("Aborted by user."));
#endif // GUI
OnInform(_T("Sorry, unsuccessful."));
- OkToClose = TRUE;
- return FALSE;
+ OkToClose = true;
+ return false;
}
void OnError(const wxChar *msg)
{
+ wxString msg_string = msg;
errorCount++;
#ifdef NO_GUI
- wxSTD cerr << "Error: " << msg << "\n";
+ wxSTD cerr << "Error: " << msg_string.mb_str() << "\n";
wxSTD cerr.flush();
#else
if (isInteractive && frame)
else
#ifdef __UNIX__
{
- wxSTD cerr << "Error: " << msg << "\n";
+ wxSTD cerr << "Error: " << msg_string.mb_str() << "\n";
wxSTD cerr.flush();
}
#endif
#ifdef __WXMSW__
wxLogError(msg);
#endif
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
#endif // NO_GUI
}
void OnInform(const wxChar *msg)
{
+ wxString msg_string = msg;
#ifdef NO_GUI
- wxSTD cout << msg << "\n";
+ wxSTD cout << msg_string.mb_str() << "\n";
wxSTD cout.flush();
#else
if (isInteractive && frame)
else
#ifdef __WXMSW__
{
- wxSTD cout << msg << "\n";
+ wxSTD cout << msg_string.mb_str() << "\n";
wxSTD cout.flush();
}
#endif
*/
if (isInteractive)
{
- Tex2RTFYield(TRUE);
+ Tex2RTFYield(true);
}
#endif // NO_GUI
}
// break;
}
}
- return TRUE;
+ return true;
}
/*
firstArg[0] = 0;
secondArg[0] = 0;
int i = 0;
- bool stop = FALSE;
+ bool stop = false;
// Find first argument (command name)
while (!stop)
{
if (data[i] == ' ' || data[i] == 0)
- stop = TRUE;
+ stop = true;
else
{
firstArg[i] = data[i];
}
secondArg[j] = 0;
}
- return TRUE;
+ return true;
}
bool Tex2RTFConnection::OnExecute(const wxString& WXUNUSED(topic), wxChar *data, int WXUNUSED(size), wxIPCFormat WXUNUSED(format))
{
wxChar buf[100];
wxString str = wxFileNameFromPath(InputFile);
- wxSprintf(buf, _T("Tex2RTF [%s]"), (const wxChar*) str);
+ wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), (const wxChar*) str);
frame->SetTitle(buf);
}
}
else if (wxStrcmp(firstArg, _T("MINIMIZE")) == 0 || wxStrcmp(firstArg, _T("ICONIZE")) == 0)
{
if (frame)
- frame->Iconize(TRUE);
+ frame->Iconize(true);
}
else if (wxStrcmp(firstArg, _T("SHOW")) == 0 || wxStrcmp(firstArg, _T("RESTORE")) == 0)
{
if (frame)
{
- frame->Iconize(FALSE);
- frame->Show(TRUE);
+ frame->Iconize(false);
+ frame->Show(true);
}
}
else
{
// Try for a setting
- wxStrcpy(Tex2RTFLastStatus, RegisterSetting(firstArg, secondArg, FALSE));
+ wxStrcpy(Tex2RTFLastStatus, RegisterSetting(firstArg, secondArg, false));
#ifndef NO_GUI
if (frame && wxStrcmp(firstArg, _T("conversionMode")) == 0)
{
#endif
}
}
- return TRUE;
+ return true;
}
wxChar *Tex2RTFConnection::OnRequest(const wxString& WXUNUSED(topic), const wxString& WXUNUSED(item), int *WXUNUSED(size), wxIPCFormat WXUNUSED(format))
// Name: tex2any.h
// Purpose: tex2RTF conversion header
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef NO_GUI
#include "wx/app.h"
-#include "wx/frame.h"
-class WXDLLEXPORT wxTextCtrl;
+#ifndef NO_GUI
+ #include "wx/frame.h"
+ #include "wx/textctrl.h"
+
+#ifdef __WXMSW__
+ #include "wx/dde.h"
+#endif
+
+#endif
// Define a new application type
-class MyApp: public wxApp
+class MyApp: public
+ #ifndef NO_GUI
+ wxApp
+ #else
+ wxAppConsole
+ #endif
{ public:
bool OnInit();
+#ifdef NO_GUI
+ int OnRun() { return EXIT_SUCCESS; }
+#else
int OnExit();
+#endif
};
+#ifndef NO_GUI
+
// Define a new frame type
class MyFrame: public wxFrame
{ public:
};
#ifdef __WXMSW__
-#include "wx/dde.h"
class Tex2RTFConnection: public wxDDEConnection
{
extern wxChar *bulletFile;
#ifndef NO_GUI
-void ChooseOutputFile(bool force = FALSE);
-void ChooseInputFile(bool force = FALSE);
+void ChooseOutputFile(bool force = false);
+void ChooseInputFile(bool force = false);
#endif
void RTFOnMacro(int macroId, int no_args, bool start);
// Name: texutils.cpp
// Purpose: Miscellaneous utilities
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
int mac = ltSECTIONHEADING;
if (!addToContents)
mac = ltSECTIONHEADINGSTAR;
- OnMacro(mac, 0, TRUE);
- OnMacro(mac, 0, FALSE);
+ OnMacro(mac, 0, true);
+ OnMacro(mac, 0, false);
}
else
{
int mac = ltCHAPTERHEADING;
if (!addToContents)
mac = ltCHAPTERHEADINGSTAR;
- OnMacro(mac, 0, TRUE);
- OnMacro(mac, 0, FALSE);
+ OnMacro(mac, 0, true);
+ OnMacro(mac, 0, false);
}
if (fakeCurrentSection) delete[] fakeCurrentSection;
fakeCurrentSection = NULL;
return topicName;
else
{
- wxSprintf(topicBuf, _T("topic%ld"), topicCounter);
+ wxSnprintf(topicBuf, sizeof(topicBuf), _T("topic%ld"), topicCounter);
topicCounter ++;
return topicBuf;
}
void StartSimulateArgument(wxChar *data)
{
wxStrcpy(currentArgData, data);
- haveArgData = TRUE;
+ haveArgData = true;
}
void EndSimulateArgument(void)
{
- haveArgData = FALSE;
+ haveArgData = false;
}
/*
if (chapter)
{
wxChar buf2[10];
- wxSprintf(buf2, _T("%d"), chapter);
+ wxSnprintf(buf2, sizeof(buf2), _T("%d"), chapter);
wxStrcat(buf, buf2);
}
if (section)
if (chapter)
wxStrcat(buf, _T("."));
- wxSprintf(buf2, _T("%d"), section);
+ wxSnprintf(buf2, sizeof(buf2), _T("%d"), section);
wxStrcat(buf, buf2);
}
if (subsection)
{
wxChar buf2[10];
wxStrcat(buf, _T("."));
- wxSprintf(buf2, _T("%d"), subsection);
+ wxSnprintf(buf2, sizeof(buf2), _T("%d"), subsection);
wxStrcat(buf, buf2);
}
if (subsubsection)
{
wxChar buf2[10];
wxStrcat(buf, _T("."));
- wxSprintf(buf2, _T("%d"), subsubsection);
+ wxSnprintf(buf2, sizeof(buf2), _T("%d"), subsubsection);
wxStrcat(buf, buf2);
}
wxChar *tmp = ((wxStrlen(buf) > 0) ? buf : (wxChar *)NULL);
void WriteTexReferences(wxChar *filename)
{
- wxSTD ofstream ostr(filename);
+ wxString converter;
+ wxString name = filename;
+ wxSTD ofstream ostr((char const *)name.fn_str());
if (ostr.bad()) return;
- wxChar buf[200];
TexReferences.BeginFind();
wxNode *node = TexReferences.Next();
{
Tex2RTFYield();
TexRef *ref = (TexRef *)node->GetData();
- ostr << ref->refLabel << _T(" ") << (ref->refFile ? ref->refFile : _T("??")) << _T(" ");
- ostr << (ref->sectionName ? ref->sectionName : _T("??")) << _T(" ");
- ostr << (ref->sectionNumber ? ref->sectionNumber : _T("??")) << _T("\n");
+ converter = ref->refLabel;
+ ostr << converter.mb_str();
+ ostr << " ";
+ converter = (ref->refFile ? ref->refFile : _T("??"));
+ ostr << converter.mb_str();
+ ostr << " ";
+ converter = (ref->sectionName ? ref->sectionName : _T("??")) ;
+ ostr << converter.mb_str();
+ ostr << " ";
+ converter = (ref->sectionNumber ? ref->sectionNumber : _T("??")) ;
+ ostr << converter.mb_str();
+ ostr << "\n";
if (!ref->sectionNumber || (wxStrcmp(ref->sectionNumber, _T("??")) == 0 && wxStrcmp(ref->sectionName, _T("??")) == 0))
{
- wxSprintf(buf, _T("Warning: reference %s not resolved."), ref->refLabel);
+ wxChar buf[200];
+ wxSnprintf(buf, sizeof(buf), _T("Warning: reference %s not resolved."), ref->refLabel);
OnInform(buf);
}
node = TexReferences.Next();
if (!wxFileExists(filename))
return;
- wxSTD ifstream istr(filename, wxSTD ios::in);
+ wxString name = filename;
+ wxSTD ifstream istr((char const *)name.fn_str(), wxSTD ios::in);
if (istr.bad()) return;
- wxChar label[100];
- wxChar file[400];
- wxChar section[100];
- wxChar sectionName[100];
+ char label[100];
+ char file[400];
+ char section[100];
+ char sectionName[100];
while (!istr.eof())
{
}
section[i] = 0;
+ wxString label_string = wxString::FromAscii(label);
+ wxString file_string = wxString::FromAscii(file);
+ wxString sectionName_string = wxString::FromAscii(sectionName);
+ wxString section_string = wxString::FromAscii(section);
+
// 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, new TexRef(label, file, section, sectionName));
- TexReferences.DeleteContents(FALSE);
+ TexReferences.DeleteContents(true);
+ TexReferences.Put(
+ label_string.c_str(),
+ new TexRef(
+ label_string.c_str(),
+ file_string.c_str(),
+ section_string.c_str(),
+ sectionName_string.c_str()
+ )
+ );
+ TexReferences.DeleteContents(false);
}
}
}
{
int i = 0;
buffer[i] = 0;
- wxChar ch = istr.peek();
- bool inQuotes = FALSE;
- if (ch == _T('"'))
+ char ch = istr.peek();
+ bool inQuotes = false;
+ if (ch == '"')
{
istr.get(ch);
ch = istr.peek();
- inQuotes = TRUE;
+ inQuotes = true;
}
// If in quotes, read white space too. If not,
// stop at white space or comment.
}
// Read }-terminated value, taking nested braces into account.
-void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = TRUE,
- bool quotesMayTerminate = TRUE)
+void BibReadValue(wxSTD istream& istr, wxChar *buffer, bool ignoreBraces = true,
+ bool quotesMayTerminate = true)
{
int braceCount = 1;
int i = 0;
buffer[i] = 0;
char ch = istr.peek();
- bool stopping = FALSE;
+ bool stopping = false;
while (!istr.eof() && !stopping)
{
// i ++;
if (i >= 4000)
{
wxChar buf[100];
- wxSprintf(buf, _T("Sorry, value > 4000 chars in bib file at line %ld."), BibLine);
+ wxSnprintf(buf, sizeof(buf), _T("Sorry, value > 4000 chars in bib file at line %ld."), BibLine);
wxLogError(buf, "Tex2RTF Fatal Error");
return;
}
braceCount --;
if (braceCount == 0)
{
- stopping = TRUE;
+ stopping = true;
break;
}
}
else if (quotesMayTerminate && ch == '"')
{
- stopping = TRUE;
+ stopping = true;
break;
}
if (!stopping)
bool ReadBib(wxChar *filename)
{
if (!wxFileExists(filename))
- return FALSE;
+ return false;
+ wxString name = filename;
wxChar buf[300];
- wxSTD ifstream istr(filename, wxSTD ios::in);
- if (istr.bad()) return FALSE;
+ wxSTD ifstream istr((char const *)name.fn_str(), wxSTD ios::in);
+ if (istr.bad()) return false;
BibLine = 1;
istr.get(ch);
if (ch != '@')
{
- wxSprintf(buf, _T("Expected @: malformed bib file at line %ld (%s)"), BibLine, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Expected @: malformed bib file at line %ld (%s)"), BibLine, filename);
OnError(buf);
- return FALSE;
+ return false;
}
BibReadWord(istr, recordType);
BibEatWhiteSpace(istr);
istr.get(ch);
if (ch != '{' && ch != '(')
{
- wxSprintf(buf, _T("Expected { or ( after record type: malformed .bib file at line %ld (%s)"), BibLine, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Expected { or ( after record type: malformed .bib file at line %ld (%s)"), BibLine, filename);
OnError(buf);
- return FALSE;
+ return false;
}
BibEatWhiteSpace(istr);
- if (StringMatch(recordType, _T("string"), FALSE, TRUE))
+ if (StringMatch(recordType, _T("string"), false, true))
{
BibReadWord(istr, recordType);
BibEatWhiteSpace(istr);
istr.get(ch);
if (ch != '=')
{
- wxSprintf(buf, _T("Expected = after string key: malformed .bib file at line %ld (%s)"), BibLine, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Expected = after string key: malformed .bib file at line %ld (%s)"), BibLine, filename);
OnError(buf);
- return FALSE;
+ return false;
}
BibEatWhiteSpace(istr);
istr.get(ch);
if (ch != '"' && ch != '{')
{
- wxSprintf(buf, _T("Expected = after string key: malformed .bib file at line %ld (%s)"), BibLine, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Expected = after string key: malformed .bib file at line %ld (%s)"), BibLine, filename);
OnError(buf);
- return FALSE;
+ return false;
}
BibReadValue(istr, fieldValue);
bibEntry->key = copystring(recordKey);
bibEntry->type = copystring(recordType);
- bool moreRecords = TRUE;
+ bool moreRecords = true;
while (moreRecords && !istr.eof())
{
BibEatWhiteSpace(istr);
istr.get(ch);
if (ch == '}' || ch == ')')
{
- moreRecords = FALSE;
+ moreRecords = false;
}
else if (ch == ',')
{
istr.get(ch);
if (ch != '=')
{
- wxSprintf(buf, _T("Expected = after field type: malformed .bib file at line %ld (%s)"), BibLine, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Expected = after field type: malformed .bib file at line %ld (%s)"), BibLine, filename);
OnError(buf);
- return FALSE;
+ return false;
}
BibEatWhiteSpace(istr);
istr.get(ch);
}
}
else
- BibReadValue(istr, fieldValue, TRUE, (ch == _T('"') ? TRUE : FALSE));
+ BibReadValue(istr, fieldValue, true, (ch == _T('"') ? true : false));
// Now we can add a field
- if (StringMatch(recordField, _T("author"), FALSE, TRUE))
+ if (StringMatch(recordField, _T("author"), false, true))
bibEntry->author = copystring(fieldValue);
- else if (StringMatch(recordField, _T("key"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("key"), false, true))
{}
- else if (StringMatch(recordField, _T("annotate"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("annotate"), false, true))
{}
- else if (StringMatch(recordField, _T("abstract"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("abstract"), false, true))
{}
- else if (StringMatch(recordField, _T("edition"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("edition"), false, true))
{}
- else if (StringMatch(recordField, _T("howpublished"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("howpublished"), false, true))
{}
- else if (StringMatch(recordField, _T("note"), FALSE, TRUE) || StringMatch(recordField, _T("notes"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("note"), false, true) || StringMatch(recordField, _T("notes"), false, true))
{}
- else if (StringMatch(recordField, _T("series"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("series"), false, true))
{}
- else if (StringMatch(recordField, _T("type"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("type"), false, true))
{}
- else if (StringMatch(recordField, _T("keywords"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("keywords"), false, true))
{}
- else if (StringMatch(recordField, _T("editor"), FALSE, TRUE) || StringMatch(recordField, _T("editors"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("editor"), false, true) || StringMatch(recordField, _T("editors"), false, true))
bibEntry->editor= copystring(fieldValue);
- else if (StringMatch(recordField, _T("title"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("title"), false, true))
bibEntry->title= copystring(fieldValue);
- else if (StringMatch(recordField, _T("booktitle"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("booktitle"), false, true))
bibEntry->booktitle= copystring(fieldValue);
- else if (StringMatch(recordField, _T("journal"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("journal"), false, true))
bibEntry->journal= copystring(fieldValue);
- else if (StringMatch(recordField, _T("volume"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("volume"), false, true))
bibEntry->volume= copystring(fieldValue);
- else if (StringMatch(recordField, _T("number"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("number"), false, true))
bibEntry->number= copystring(fieldValue);
- else if (StringMatch(recordField, _T("year"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("year"), false, true))
bibEntry->year= copystring(fieldValue);
- else if (StringMatch(recordField, _T("month"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("month"), false, true))
bibEntry->month= copystring(fieldValue);
- else if (StringMatch(recordField, _T("pages"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("pages"), false, true))
bibEntry->pages= copystring(fieldValue);
- else if (StringMatch(recordField, _T("publisher"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("publisher"), false, true))
bibEntry->publisher= copystring(fieldValue);
- else if (StringMatch(recordField, _T("address"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("address"), false, true))
bibEntry->address= copystring(fieldValue);
- else if (StringMatch(recordField, _T("institution"), FALSE, TRUE) || StringMatch(recordField, _T("school"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("institution"), false, true) || StringMatch(recordField, _T("school"), false, true))
bibEntry->institution= copystring(fieldValue);
- else if (StringMatch(recordField, _T("organization"), FALSE, TRUE) || StringMatch(recordField, _T("organisation"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("organization"), false, true) || StringMatch(recordField, _T("organisation"), false, true))
bibEntry->organization= copystring(fieldValue);
- else if (StringMatch(recordField, _T("comment"), FALSE, TRUE) || StringMatch(recordField, _T("comments"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("comment"), false, true) || StringMatch(recordField, _T("comments"), false, true))
bibEntry->comment= copystring(fieldValue);
- else if (StringMatch(recordField, _T("annote"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("annote"), false, true))
bibEntry->comment= copystring(fieldValue);
- else if (StringMatch(recordField, _T("chapter"), FALSE, TRUE))
+ else if (StringMatch(recordField, _T("chapter"), false, true))
bibEntry->chapter= copystring(fieldValue);
else
{
- wxSprintf(buf, _T("Unrecognised bib field type %s at line %ld (%s)"), recordField, BibLine, filename);
+ wxSnprintf(buf, sizeof(buf), _T("Unrecognised bib field type %s at line %ld (%s)"), recordField, BibLine, filename);
OnError(buf);
}
}
BibEatWhiteSpace(istr);
}
}
- return TRUE;
+ return true;
}
void OutputBibItem(TexRef *ref, BibEntry *bib)
{
Tex2RTFYield();
- OnMacro(ltNUMBEREDBIBITEM, 2, TRUE);
- OnArgument(ltNUMBEREDBIBITEM, 1, TRUE);
+ OnMacro(ltNUMBEREDBIBITEM, 2, true);
+ OnArgument(ltNUMBEREDBIBITEM, 1, true);
TexOutput(ref->sectionNumber);
- OnArgument(ltNUMBEREDBIBITEM, 1, FALSE);
- OnArgument(ltNUMBEREDBIBITEM, 2, TRUE);
+ OnArgument(ltNUMBEREDBIBITEM, 1, false);
+ OnArgument(ltNUMBEREDBIBITEM, 2, true);
TexOutput(_T(" "));
- OnMacro(ltBF, 1, TRUE);
- OnArgument(ltBF, 1, TRUE);
+ OnMacro(ltBF, 1, true);
+ OnArgument(ltBF, 1, true);
if (bib->author)
TexOutput(bib->author);
- OnArgument(ltBF, 1, FALSE);
- OnMacro(ltBF, 1, FALSE);
+ OnArgument(ltBF, 1, false);
+ OnMacro(ltBF, 1, false);
if (bib->author && (wxStrlen(bib->author) > 0) && (bib->author[wxStrlen(bib->author) - 1] != '.'))
TexOutput(_T(". "));
else
if (bib->year || bib->month)
TexOutput(_T(". "));
- if (StringMatch(bib->type, _T("article"), FALSE, TRUE))
+ if (StringMatch(bib->type, _T("article"), false, true))
{
if (bib->title)
{
}
if (bib->journal)
{
- OnMacro(ltIT, 1, TRUE);
- OnArgument(ltIT, 1, TRUE);
+ OnMacro(ltIT, 1, true);
+ OnArgument(ltIT, 1, true);
TexOutput(bib->journal);
- OnArgument(ltIT, 1, FALSE);
- OnMacro(ltIT, 1, FALSE);
+ OnArgument(ltIT, 1, false);
+ OnMacro(ltIT, 1, false);
}
if (bib->volume)
{
TexOutput(_T(", "));
- OnMacro(ltBF, 1, TRUE);
- OnArgument(ltBF, 1, TRUE);
+ OnMacro(ltBF, 1, true);
+ OnArgument(ltBF, 1, true);
TexOutput(bib->volume);
- OnArgument(ltBF, 1, FALSE);
- OnMacro(ltBF, 1, FALSE);
+ OnArgument(ltBF, 1, false);
+ OnMacro(ltBF, 1, false);
}
if (bib->number)
{
}
TexOutput(_T("."));
}
- else if (StringMatch(bib->type, _T("book"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("unpublished"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("manual"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("phdthesis"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("mastersthesis"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("misc"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("techreport"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("booklet"), FALSE, TRUE))
+ else if (StringMatch(bib->type, _T("book"), false, true) ||
+ StringMatch(bib->type, _T("unpublished"), false, true) ||
+ StringMatch(bib->type, _T("manual"), false, true) ||
+ StringMatch(bib->type, _T("phdthesis"), false, true) ||
+ StringMatch(bib->type, _T("mastersthesis"), false, true) ||
+ StringMatch(bib->type, _T("misc"), false, true) ||
+ StringMatch(bib->type, _T("techreport"), false, true) ||
+ StringMatch(bib->type, _T("booklet"), false, true))
{
if (bib->title || bib->booktitle)
{
- OnMacro(ltIT, 1, TRUE);
- OnArgument(ltIT, 1, TRUE);
+ OnMacro(ltIT, 1, true);
+ OnArgument(ltIT, 1, true);
TexOutput(bib->title ? bib->title : bib->booktitle);
TexOutput(_T(". "));
- OnArgument(ltIT, 1, FALSE);
- OnMacro(ltIT, 1, FALSE);
+ OnArgument(ltIT, 1, false);
+ OnMacro(ltIT, 1, false);
}
- if (StringMatch(bib->type, _T("phdthesis"), FALSE, TRUE))
+ if (StringMatch(bib->type, _T("phdthesis"), false, true))
TexOutput(_T("PhD thesis. "));
- if (StringMatch(bib->type, _T("techreport"), FALSE, TRUE))
+ if (StringMatch(bib->type, _T("techreport"), false, true))
TexOutput(_T("Technical report. "));
if (bib->editor)
{
TexOutput(_T(". "));
}
}
- else if (StringMatch(bib->type, _T("inbook"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("inproceedings"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("incollection"), FALSE, TRUE) ||
- StringMatch(bib->type, _T("conference"), FALSE, TRUE))
+ else if (StringMatch(bib->type, _T("inbook"), false, true) ||
+ StringMatch(bib->type, _T("inproceedings"), false, true) ||
+ StringMatch(bib->type, _T("incollection"), false, true) ||
+ StringMatch(bib->type, _T("conference"), false, true))
{
if (bib->title)
{
if (bib->booktitle)
{
TexOutput(_T(", from "));
- OnMacro(ltIT, 1, TRUE);
- OnArgument(ltIT, 1, TRUE);
+ OnMacro(ltIT, 1, true);
+ OnArgument(ltIT, 1, true);
TexOutput(bib->booktitle);
TexOutput(_T("."));
- OnArgument(ltIT, 1, FALSE);
- OnMacro(ltIT, 1, FALSE);
+ OnArgument(ltIT, 1, false);
+ OnMacro(ltIT, 1, false);
}
if (bib->editor)
{
if (bib->volume)
{
TexOutput(_T(" "));
- OnMacro(ltBF, 1, TRUE);
- OnArgument(ltBF, 1, TRUE);
+ OnMacro(ltBF, 1, true);
+ OnArgument(ltBF, 1, true);
TexOutput(bib->volume);
- OnArgument(ltBF, 1, FALSE);
- OnMacro(ltBF, 1, FALSE);
+ OnArgument(ltBF, 1, false);
+ OnMacro(ltBF, 1, false);
}
if (bib->number)
{
TexOutput(_T("."));
}
}
- OnArgument(ltNUMBEREDBIBITEM, 2, FALSE);
- OnMacro(ltNUMBEREDBIBITEM, 2, FALSE);
+ OnArgument(ltNUMBEREDBIBITEM, 2, false);
+ OnMacro(ltNUMBEREDBIBITEM, 2, false);
}
void OutputBib(void)
FakeCurrentSection(ReferencesNameString);
ForceTopicName(NULL);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
if ((convertMode == TEX_RTF) && !winHelp)
{
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
wxStringListNode *node = CitationList.GetFirst();
// Unused Variable
//BibEntry *entry = (BibEntry *)bibNode->GetData();
if (ref->sectionNumber) delete[] ref->sectionNumber;
- wxSprintf(buf, _T("[%d]"), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("[%d]"), citeCount);
ref->sectionNumber = copystring(buf);
citeCount ++;
}
else
{
- wxSprintf(buf, _T("Warning: bib ref %s not resolved."), citeKey);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: bib ref %s not resolved."), citeKey);
OnInform(buf);
}
node = node->GetNext();
{
if (wxStrncmp(val, _T("yes"), 3) == 0 || wxStrncmp(val, _T("YES"), 3) == 0 ||
wxStrncmp(val, _T("on"), 2) == 0 || wxStrncmp(val, _T("ON"), 2) == 0 ||
- wxStrncmp(val, _T("true"), 4) == 0 || wxStrncmp(val, _T("TRUE"), 4) == 0 ||
+ wxStrncmp(val, _T("true"), 4) == 0 || wxStrncmp(val, _T("true"), 4) == 0 ||
wxStrncmp(val, _T("ok"), 2) == 0 || wxStrncmp(val, _T("OK"), 2) == 0 ||
wxStrncmp(val, _T("1"), 1) == 0)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
// Define a variable value from the .ini file
{
static wxChar errorCode[100];
wxStrcpy(errorCode, _T("OK"));
- if (StringMatch(settingName, _T("chapterName"), FALSE, TRUE))
+ if (StringMatch(settingName, _T("chapterName"), false, true))
{
delete[] ChapterNameString;
ChapterNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("sectionName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("sectionName"), false, true))
{
delete[] SectionNameString;
SectionNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("subsectionName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("subsectionName"), false, true))
{
delete[] SubsectionNameString;
SubsectionNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("subsubsectionName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("subsubsectionName"), false, true))
{
delete[] SubsubsectionNameString;
SubsubsectionNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("indexName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("indexName"), false, true))
{
delete[] IndexNameString;
IndexNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("contentsName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("contentsName"), false, true))
{
delete[] ContentsNameString;
ContentsNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("glossaryName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("glossaryName"), false, true))
{
delete[] GlossaryNameString;
GlossaryNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("referencesName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("referencesName"), false, true))
{
delete[] ReferencesNameString;
ReferencesNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("tablesName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("tablesName"), false, true))
{
delete[] TablesNameString;
TablesNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("figuresName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("figuresName"), false, true))
{
delete[] FiguresNameString;
FiguresNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("tableName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("tableName"), false, true))
{
delete[] TableNameString;
TableNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("figureName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("figureName"), false, true))
{
delete[] FigureNameString;
FigureNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("abstractName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("abstractName"), false, true))
{
delete[] AbstractNameString;
AbstractNameString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("chapterFontSize"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("chapterFontSize"), false, true))
StringToInt(settingValue, &chapterFont);
- else if (StringMatch(settingName, _T("sectionFontSize"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("sectionFontSize"), false, true))
StringToInt(settingValue, §ionFont);
- else if (StringMatch(settingName, _T("subsectionFontSize"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("subsectionFontSize"), false, true))
StringToInt(settingValue, &subsectionFont);
- else if (StringMatch(settingName, _T("titleFontSize"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("titleFontSize"), false, true))
StringToInt(settingValue, &titleFont);
- else if (StringMatch(settingName, _T("authorFontSize"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("authorFontSize"), false, true))
StringToInt(settingValue, &authorFont);
- else if (StringMatch(settingName, _T("ignoreInput"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("ignoreInput"), false, true))
IgnorableInputFiles.Add(wxFileNameFromPath(settingValue));
- else if (StringMatch(settingName, _T("mirrorMargins"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("mirrorMargins"), false, true))
mirrorMargins = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("runTwice"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("runTwice"), false, true))
runTwice = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("isInteractive"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("isInteractive"), false, true))
isInteractive = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("headerRule"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("headerRule"), false, true))
headerRule = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("footerRule"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("footerRule"), false, true))
footerRule = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("combineSubSections"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("combineSubSections"), false, true))
combineSubSections = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("listLabelIndent"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("listLabelIndent"), false, true))
StringToInt(settingValue, &labelIndentTab);
- else if (StringMatch(settingName, _T("listItemIndent"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("listItemIndent"), false, true))
StringToInt(settingValue, &itemIndentTab);
- else if (StringMatch(settingName, _T("useUpButton"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("useUpButton"), false, true))
useUpButton = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("useHeadingStyles"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("useHeadingStyles"), false, true))
useHeadingStyles = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("useWord"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("useWord"), false, true))
useWord = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("contentsDepth"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("contentsDepth"), false, true))
StringToInt(settingValue, &contentsDepth);
- else if (StringMatch(settingName, _T("generateHPJ"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("generateHPJ"), false, true))
generateHPJ = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("truncateFilenames"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("truncateFilenames"), false, true))
truncateFilenames = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("winHelpVersion"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("winHelpVersion"), false, true))
StringToInt(settingValue, &winHelpVersion);
- else if (StringMatch(settingName, _T("winHelpContents"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("winHelpContents"), false, true))
winHelpContents = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("htmlIndex"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("htmlIndex"), false, true))
htmlIndex = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("htmlWorkshopFiles"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("htmlWorkshopFiles"), false, true))
htmlWorkshopFiles = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("htmlFrameContents"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("htmlFrameContents"), false, true))
htmlFrameContents = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("htmlStylesheet"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("htmlStylesheet"), false, true))
{
if (htmlStylesheet) delete[] htmlStylesheet;
htmlStylesheet = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("upperCaseNames"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("upperCaseNames"), false, true))
upperCaseNames = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("ignoreBadRefs"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("ignoreBadRefs"), false, true))
ignoreBadRefs = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("htmlFaceName"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("htmlFaceName"), false, true))
{
delete[] htmlFaceName;
htmlFaceName = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("winHelpTitle"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("winHelpTitle"), false, true))
{
if (winHelpTitle)
delete[] winHelpTitle;
winHelpTitle = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("indexSubsections"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("indexSubsections"), false, true))
indexSubsections = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("compatibility"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("compatibility"), false, true))
compatibilityMode = StringTobool(settingValue);
- else if (StringMatch(settingName, _T("defaultColumnWidth"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("defaultColumnWidth"), false, true))
{
StringToInt(settingValue, &defaultTableColumnWidth);
defaultTableColumnWidth = 20*defaultTableColumnWidth;
}
- else if (StringMatch(settingName, _T("bitmapMethod"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("bitmapMethod"), false, true))
{
if ((wxStrcmp(settingValue, _T("includepicture")) != 0) && (wxStrcmp(settingValue, _T("hex")) != 0) &&
(wxStrcmp(settingValue, _T("import")) != 0))
bitmapMethod = copystring(settingValue);
}
}
- else if (StringMatch(settingName, _T("htmlBrowseButtons"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("htmlBrowseButtons"), false, true))
{
if (wxStrcmp(settingValue, _T("none")) == 0)
htmlBrowseButtons = HTML_BUTTONS_NONE;
wxStrcpy(errorCode, _T("Initialisation file error: htmlBrowseButtons must be one of none, bitmap, or text."));
}
}
- else if (StringMatch(settingName, _T("backgroundImage"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("backgroundImage"), false, true))
{
backgroundImageString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("backgroundColour"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("backgroundColour"), false, true))
{
delete[] backgroundColourString;
backgroundColourString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("textColour"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("textColour"), false, true))
{
textColourString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("linkColour"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("linkColour"), false, true))
{
linkColourString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("followedLinkColour"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("followedLinkColour"), false, true))
{
followedLinkColourString = copystring(settingValue);
}
- else if (StringMatch(settingName, _T("conversionMode"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("conversionMode"), false, true))
{
- if (StringMatch(settingValue, _T("RTF"), FALSE, TRUE))
+ if (StringMatch(settingValue, _T("RTF"), false, true))
{
- winHelp = FALSE; convertMode = TEX_RTF;
+ winHelp = false; convertMode = TEX_RTF;
}
- else if (StringMatch(settingValue, _T("WinHelp"), FALSE, TRUE))
+ else if (StringMatch(settingValue, _T("WinHelp"), false, true))
{
- winHelp = TRUE; convertMode = TEX_RTF;
+ winHelp = true; convertMode = TEX_RTF;
}
- else if (StringMatch(settingValue, _T("XLP"), FALSE, TRUE) ||
- StringMatch(settingValue, _T("wxHelp"), FALSE, TRUE))
+ else if (StringMatch(settingValue, _T("XLP"), false, true) ||
+ StringMatch(settingValue, _T("wxHelp"), false, true))
{
convertMode = TEX_XLP;
}
- else if (StringMatch(settingValue, _T("HTML"), FALSE, TRUE))
+ else if (StringMatch(settingValue, _T("HTML"), false, true))
{
convertMode = TEX_HTML;
}
wxStrcpy(errorCode, _T("Initialisation file error: conversionMode must be one of\nRTF, WinHelp, XLP (or wxHelp), HTML."));
}
}
- else if (StringMatch(settingName, _T("documentFontSize"), FALSE, TRUE))
+ else if (StringMatch(settingName, _T("documentFontSize"), false, true))
{
int n;
StringToInt(settingValue, &n);
else
{
wxChar buf[200];
- wxSprintf(buf, _T("Initialisation file error: nonstandard document font size %d."), n);
+ wxSnprintf(buf, sizeof(buf), _T("Initialisation file error: nonstandard document font size %d."), n);
if (interactive)
OnInform(buf);
wxStrcpy(errorCode, buf);
else
{
wxChar buf[200];
- wxSprintf(buf, _T("Initialisation file error: unrecognised setting %s."), settingName);
+ wxSnprintf(buf, sizeof(buf), _T("Initialisation file error: unrecognised setting %s."), settingName);
if (interactive)
OnInform(buf);
wxStrcpy(errorCode, buf);
bool ReadCustomMacros(wxChar *filename)
{
if (!wxFileExists(filename))
- return FALSE;
+ return false;
- wxSTD ifstream istr(filename, wxSTD ios::in);
+ wxString name = filename;
+ wxSTD ifstream istr((char const *)name.fn_str(), wxSTD ios::in);
- if (istr.bad()) return FALSE;
+ if (istr.bad()) return false;
CustomMacroList.Clear();
char ch;
if (ch != '=')
{
OnError(_T("Expected = following name: malformed tex2rtf.ini file."));
- return FALSE;
+ return false;
}
else
{
if (ch != '[')
{
OnError(_T("Expected [ followed by number of arguments: malformed tex2rtf.ini file."));
- return FALSE;
+ return false;
}
istr >> noArgs;
istr.get(ch);
if (ch != ']')
{
OnError(_T("Expected ] following number of arguments: malformed tex2rtf.ini file."));
- return FALSE;
+ return false;
}
BibEatWhiteSpace(istr);
istr.get(ch);
if (ch != '{')
{
OnError(_T("Expected { followed by macro body: malformed tex2rtf.ini file."));
- return FALSE;
+ return false;
}
CustomMacro *macro = new CustomMacro(macroName, noArgs, NULL);
- BibReadValue(istr, macroBody, FALSE, FALSE); // Don't ignore extra braces
+ BibReadValue(istr, macroBody, false, false); // Don't ignore extra braces
if (wxStrlen(macroBody) > 0)
macro->macroBody = copystring(macroBody);
}
}
wxChar mbuf[200];
- wxSprintf(mbuf, _T("Read initialization file %s."), filename);
+ wxSnprintf(mbuf, sizeof(mbuf), _T("Read initialization file %s."), filename);
OnInform(mbuf);
- return TRUE;
+ return true;
}
CustomMacro *FindCustomMacro(wxChar *name)
while (node)
{
CustomMacro *macro = (CustomMacro *)node->GetData();
- wxSprintf(buf, _T("\\%s[%d]\n {%s}"), macro->macroName, macro->noArgs,
+ wxSnprintf(buf, sizeof(buf), _T("\\%s[%d]\n {%s}"), macro->macroName, macro->noArgs,
macro->macroBody ? macro->macroBody : _T(""));
OnInform(buf);
node = node->GetNext();
int fieldIndex = *pos;
int len = wxStrlen(allFields);
int oldPos = *pos;
- bool keepGoing = TRUE;
+ bool keepGoing = true;
while ((fieldIndex <= len) && keepGoing)
{
if (allFields[fieldIndex] == _T(' '))
else if (allFields[fieldIndex] == _T(','))
{
*pos = fieldIndex + 1;
- keepGoing = FALSE;
+ keepGoing = false;
}
else if (allFields[fieldIndex] == 0)
{
*pos = fieldIndex + 1;
- keepGoing = FALSE;
+ keepGoing = false;
}
else
{
DecToHex(entry->blue, buf2);
wxStrcat(buf, buf2);
- return TRUE;
+ return true;
}
node = node->GetNext();
}
- return FALSE;
+ return false;
}
filename = copystring(f);
else
filename = NULL;
- hasChildren = FALSE;
+ hasChildren = false;
keywords = NULL;
}
// Name: xlputils.cpp
// Purpose: Converts Latex to obsolete XLP format
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
static int indentLevel = 0;
static int noColumns = 0;
static int currentTab = 0;
-static bool tableVerticalLineLeft = FALSE;
-static bool tableVerticalLineRight = FALSE;
-static bool inTable = FALSE;
+static bool tableVerticalLineLeft = false;
+static bool tableVerticalLineRight = false;
+static bool inTable = false;
static int citeCount = 1;
wxList hyperLinks(wxKEY_INTEGER);
wxList hyperLabels(wxKEY_STRING);
{
int currentCol = GetCurrentColumn();
for (int i = currentCol; i < tabPos; i++)
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
}
static long xlpBlockId = 0;
long id1 = NewBlockId();
currentBlockId = NewBlockId();
- startedSections = TRUE;
+ startedSections = true;
wxFprintf(Contents, _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_HEADING, id1);
wxFprintf(Chapters, _T("\n\\hy-%d{%ld}{"), hyBLOCK_LARGE_VISIBLE_SECTION, currentBlockId);
wxFprintf(Index, _T("%ld %ld\n"), id1, currentBlockId);
long id1 = NewBlockId();
currentBlockId = NewBlockId();
- startedSections = TRUE;
+ startedSections = true;
if (DocumentStyle == LATEX_ARTICLE)
wxFprintf(Contents, _T("\\hy-%d{%ld}{"), hyBLOCK_LARGE_HEADING, id1);
}
case ltVOID:
// if (start)
-// TexOutput(_T("void"), TRUE);
+// TexOutput(_T("void"), true);
break;
case ltBACKSLASHCHAR:
if (start)
- TexOutput(_T("\n"), TRUE);
+ TexOutput(_T("\n"), true);
break;
case ltPAR:
{
if (start)
{
if (ParSkip > 0)
- TexOutput(_T("\n"), TRUE);
- TexOutput(_T("\n"), TRUE);
+ TexOutput(_T("\n"), true);
+ TexOutput(_T("\n"), true);
}
break;
}
{
wxChar buf[100];
long id = NewBlockId();
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
TexOutput(buf);
}
else TexOutput(_T("}"));
{
wxChar buf[100];
long id = NewBlockId();
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_ITALIC, id);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_ITALIC, id);
TexOutput(buf);
}
else TexOutput(_T("}"));
if (start)
{
long id = NewBlockId();
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_TELETYPE, id);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_TELETYPE, id);
TexOutput(buf);
}
else TexOutput(_T("}"));
{
if (start)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_TEXT, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_TEXT, NewBlockId());
TexOutput(buf);
}
else TexOutput(_T("}"));
{
if (start)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_TEXT, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_TEXT, NewBlockId());
TexOutput(buf);
}
else TexOutput(_T("}"));
{
if (start)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_NORMAL, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_NORMAL, NewBlockId());
TexOutput(buf);
}
else TexOutput(_T("}"));
{
if (start)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_HEADING, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_HEADING, NewBlockId());
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
if (start)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_LARGE_HEADING, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_LARGE_HEADING, NewBlockId());
TexOutput(buf);
}
else TexOutput(_T("}\n"));
{
case LATEX_ENUMERATE:
{
- wxSprintf(indentBuf, _T("\\hy-%d{%ld}{%d.} "),
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\hy-%d{%ld}{%d.} "),
hyBLOCK_BOLD, NewBlockId(), struc->currentItem);
TexOutput(indentBuf);
break;
}
case LATEX_ITEMIZE:
{
- wxSprintf(indentBuf, _T("\\hy-%d{%ld}{o} "),
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\hy-%d{%ld}{o} "),
hyBLOCK_BOLD, NewBlockId());
TexOutput(indentBuf);
break;
{
if (descriptionItemArg)
{
- wxSprintf(indentBuf, _T("\\hy-%d{%ld}{"),
+ wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\hy-%d{%ld}{"),
hyBLOCK_BOLD, NewBlockId());
TexOutput(indentBuf);
TraverseChildrenFromChunk(descriptionItemArg);
{
if (start && DocumentTitle && DocumentAuthor)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_LARGE_HEADING, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_LARGE_HEADING, NewBlockId());
TexOutput(buf);
TraverseChildrenFromChunk(DocumentTitle);
TexOutput(_T("}\n\n"));
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_HEADING, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_SMALL_HEADING, NewBlockId());
TexOutput(buf);
TraverseChildrenFromChunk(DocumentAuthor);
TexOutput(_T("}\n\n"));
case ltHARDY:
{
if (start)
- TexOutput(_T("HARDY"), TRUE);
+ TexOutput(_T("HARDY"), true);
break;
}
case ltWXCLIPS:
{
if (start)
- TexOutput(_T("wxCLIPS"), TRUE);
+ TexOutput(_T("wxCLIPS"), true);
break;
}
case ltVERBATIM:
{
wxChar buf[100];
long id = NewBlockId();
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_TELETYPE, id);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_TELETYPE, id);
TexOutput(buf);
}
else TexOutput(_T("}"));
{
if (start)
{
- TexOutput(_T("\n------------------------------------------------------------------"), TRUE);
+ TexOutput(_T("\n------------------------------------------------------------------"), true);
}
break;
}
{
if (start)
{
- TexOutput(_T("--------------------------------------------------------------------------------"), TRUE);
+ TexOutput(_T("--------------------------------------------------------------------------------"), true);
}
break;
}
{
if (start)
{
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_TELETYPE, NewBlockId());
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_TELETYPE, NewBlockId());
TexOutput(buf);
}
else
case ltNUMBEREDBIBITEM:
{
if (!start)
- TexOutput(_T("\n\n"), TRUE);
+ TexOutput(_T("\n\n"), true);
break;
}
case ltCAPTION:
wxChar figBuf[40];
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("Figure %d.%d: "), chapterNo, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("Figure %d.%d: "), chapterNo, figureNo);
else
- wxSprintf(figBuf, _T("Figure %d: "), figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("Figure %d: "), figureNo);
TexOutput(figBuf);
}
{
if (!start && (arg_no == 1))
currentSection = GetArgChunk();
- return FALSE;
+ return false;
}
case ltFUNC:
{
if (!start && (arg_no == 1))
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
if (start && (arg_no == 3))
- TexOutput(_T("("), TRUE);
+ TexOutput(_T("("), true);
if (!start && (arg_no == 3))
- TexOutput(_T(")"), TRUE);
+ TexOutput(_T(")"), true);
break;
}
case ltPFUNC:
{
if (!start && (arg_no == 1))
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
if (start && (arg_no == 2))
- TexOutput(_T("(*"), TRUE);
+ TexOutput(_T("(*"), true);
if (!start && (arg_no == 2))
- TexOutput(_T(")"), TRUE);
+ TexOutput(_T(")"), true);
if (start && (arg_no == 3))
- TexOutput(_T("("), TRUE);
+ TexOutput(_T("("), true);
if (!start && (arg_no == 3))
- TexOutput(_T(")"), TRUE);
+ TexOutput(_T(")"), true);
break;
}
case ltCLIPSFUNC:
{
if (!start && (arg_no == 1))
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
if (start && (arg_no == 2))
{
- TexOutput(_T("("), TRUE);
+ TexOutput(_T("("), true);
long id = NewBlockId();
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
TexOutput(buf);
}
if (!start && (arg_no == 2))
TexOutput(_T("}"));
}
if (!start && (arg_no == 3))
- TexOutput(_T(")"), TRUE);
+ TexOutput(_T(")"), true);
break;
}
case ltPARAM:
if (start && (arg_no == 2))
{
long id = NewBlockId();
- wxSprintf(buf, _T(" \\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
+ wxSnprintf(buf, sizeof(buf), _T(" \\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
TexOutput(buf);
}
if (!start && (arg_no == 2))
if (start && (arg_no == 2))
{
long id = NewBlockId();
- wxSprintf(buf, _T(" \\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
+ wxSnprintf(buf, sizeof(buf), _T(" \\hy-%d{%ld}{"), hyBLOCK_BOLD, id);
TexOutput(buf);
}
if (!start && (arg_no == 2))
case ltMEMBER:
{
if (!start && (arg_no == 1))
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
break;
}
case ltLABEL:
{
- return FALSE;
+ return false;
}
case ltREF:
{
{
TexOutput(sec);
}
- return FALSE;
+ return false;
}
break;
}
if (start)
{
currentBlockId = NewBlockId();
- wxSprintf(buf, _T("\\hy-%d{%ld}{"), hyBLOCK_RED_ITALIC, currentBlockId);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{"), hyBLOCK_RED_ITALIC, currentBlockId);
TexOutput(buf);
}
else TexOutput(_T("}"));
hyperLinks.Append(currentBlockId, (wxObject *)copystring(label));
}
- return FALSE;
+ return false;
}
break;
}
{
if (arg_no == 1)
{
- return TRUE;
+ return true;
}
else if (arg_no == 2)
{
TexOutput(_T(" ("));
else
TexOutput(_T(")"));
- return TRUE;
+ return true;
}
break;
}
if (start && IsArgOptional())
{
descriptionItemArg = GetArgChunk();
- return FALSE;
+ return false;
}
break;
}
{
if (start)
{
- inTable = TRUE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTable = true;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
wxChar *alignString = copystring(GetArgData());
if (len > 0)
{
if (alignString[0] == '|')
- tableVerticalLineLeft = TRUE;
+ tableVerticalLineLeft = true;
if (alignString[len-1] == '|')
- tableVerticalLineRight = TRUE;
+ tableVerticalLineRight = true;
}
for (int i = 0; i < len; i++)
// int tabPos = 80/noColumns;
currentTab = 0;
- return FALSE;
+ return false;
}
}
else if (arg_no == 2 && !start)
{
- inTable = FALSE;
+ inTable = false;
}
else if (arg_no == 2 && start)
- return TRUE;
+ return true;
break;
}
case ltMARGINPAR:
{
if (start)
{
- TexOutput(_T("----------------------------------------------------------------------\n"), TRUE);
- return TRUE;
+ TexOutput(_T("----------------------------------------------------------------------\n"), true);
+ return true;
}
else
- TexOutput(_T("\n----------------------------------------------------------------------\n"), TRUE);
+ TexOutput(_T("\n----------------------------------------------------------------------\n"), true);
break;
}
case ltBIBITEM:
if (ref)
{
if (ref->sectionNumber) delete[] ref->sectionNumber;
- wxSprintf(buf, _T("[%d]"), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("[%d]"), citeCount);
ref->sectionNumber = copystring(buf);
}
- wxSprintf(buf, _T("\\hy-%d{%ld}{[%d]} "), hyBLOCK_BOLD, NewBlockId(), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("\\hy-%d{%ld}{[%d]} "), hyBLOCK_BOLD, NewBlockId(), citeCount);
TexOutput(buf);
citeCount ++;
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
case ltTHEBIBLIOGRAPHY:
{
wxFprintf(Index, _T("%ld %ld\n"), id1, id2);
SetCurrentOutput(Chapters);
- return FALSE;
+ return false;
}
if (!start && (arg_no == 2))
{
}
- return TRUE;
+ return true;
}
case ltTWOCOLITEM:
case ltTWOCOLITEMRULED:
if (!start && (arg_no == 2))
TexOutput(_T("\n"));
- return TRUE;
+ return true;
}
/*
* Accents
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_ACUTE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CARET:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_TILDE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_UMLAUT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_DOT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CADILLA:
{
}
}
}
- return FALSE;
+ return false;
}
default:
{
return DefaultOnArgument(macroId, arg_no, start);
}
}
- return TRUE;
+ return true;
}
bool XLPGo(void)
wxRemoveFile(_T("subsections.xlp"));
wxRemoveFile(_T("subsubsections.xlp"));
wxRemoveFile(_T("index.xlp"));
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
[--cc] [--cxx] [--ld]
wx-config returns configuration information about the installed
-version of wxWindows. It may be used to query its version and
+version of wxWidgets. It may be used to query its version and
installation directories and also retrieve the C and C++ compilers
and linker which were used for its building and the corresponding
flags.
Ordinarily it should be installed to the appropriate system location
along with the headers and library files, but it is also possible to
-use it to enable builds with an uninstalled wxWindows version for
+use it to enable builds with an uninstalled wxWidgets version for
package building and bleeding edge developers. To do so, use it like
this:
--static must come before --libs and --gl-libs.
--libs can take optional argument that contains comma-separated list of
-wxWindows libraries to link against. This list can include both core
+wxWidgets libraries to link against. This list can include both core
and contrib libraries.
--gl-libs option is deprecated, used --libs=gl instead.