+1999-12-07 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * src/support/lyxstring.C: added a lot of inline for no good
+ reason
+
+ * src/lyxfont.[Ch]: removed latexWriteStartChanges, and
+ latexWriteEndChanges, they were not used.
+
+ * src/layout.h (operator<<): output operator for PageSides
+
+ * src/mathed/math_iter.C (my_memcpy): slightly changed.
+
+ * some example files: loaded in LyX 1.0.4 and saved again to update
+ certain constructs (table format)
+
+ * a lot of files: did the change to use fstream/iostream for all
+ writing of files. Done with a close look at Andre Poenitz's patch.
+
+ * some files: whitespace changes.
+
1999-12-06 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/mathed/math_iter.C (my_memcpy): new function. Since the
elif test $ac_cv_prog_cxx_g = yes; then
case $gxx_version in
2.7*) CXXFLAGS="$lyx_opt";;
- 2.95.*) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti -fpermissive";;
+ 2.95.*) CXXFLAGS="-g $lyx_opt";;
*) CXXFLAGS="-g $lyx_opt -fno-exceptions -fno-rtti";;
esac
else
CXXFLAGS="$lyx_opt"
fi
if test x$with_warnings = xyes ; then
- CXXFLAGS="$CXXFLAGS -ansi -Wall"
+ case $gxx_version in
+ 2.95.*) CXXFLAGS="$CXXFLAGS -Wall";;
+ *) CXXFLAGS="$CXXFLAGS -ansi -Wall";;
+ esac
if test $lyx_devel_version = yes ; then
- CXXFLAGS="$CXXFLAGS -pedantic"
+ case $gxx_version in
+ 2.95.*) ;;
+ *) CXXFLAGS="$CXXFLAGS -pedantic";;
+ esac
fi
fi
else
AC_DEFUN(LYX_CXX_STL_MODERN_STREAMS,[
AC_CACHE_CHECK(for modern STL streams,lyx_cv_modern_streams,
[AC_TRY_COMPILE([
-#include <fstream>
+#include <iostream>
],[
std::streambuf * test = std::cerr.rdbuf();
test->pubsync();
-#This file was created by <lasgoutt> Mon Apr 20 15:52:03 1998
-#LyX 0.12 (C) 1995-1998 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:44:19 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass foils
\begin_preamble
hrule height 3pt
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
3 3 0 0 -1 -1 -1 -1
1 1 0 0
1 0 0 0
1 1 0 0
-8 1 0
-8 1 0
-8 1 1
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
Column1
\newline
\begin_float tab
\layout Standard
\align center \LyXTable
-multicol4
+multicol5
3 3 0 0 -1 -1 -1 -1
1 1 0 0
1 0 0 0
1 1 0 0
-8 1 0
-8 1 0
-8 1 1
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
Row1
\newline
-#This file was created by <rae> Sat Oct 4 03:17:47 1997
-#LyX 0.11 (C) 1995-1997 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:45:53 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\begin_preamble
\papersize Default
\paperpackage a4
\use_geometry 0
+\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\end_bullet
\layout Section*
-\cursor 0
+
Introduction
\layout Standard
\bar under
D
\bar default
-ocument
-\begin_inset LatexCommand \ldots
-
-\end_inset
-
+ocument\SpecialChar \ldots{}
menu and select the
\begin_inset Quotes eld
\end_inset
Standard
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
6 6 0 0 -1 -1 -1 -1
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
1 1 0 0
-8 1 0
-8 1 0
-2 1 0
-8 1 0
-8 1 0
-8 1 1
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 2 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
+8 1 0 "" ""
+8 1 0 "" ""
+2 1 0 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 2 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
\latex latex
Maths (AMS-symbols)
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
6 6 0 0 -1 -1 -1 -1
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
1 1 0 0
-8 1 0
-8 1 0
-8 1 0
-8 1 0
-8 1 0
-8 1 1
-0 8 1 1 0 0 0
-0 8 1 1 0 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0 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
\latex latex
Ding 2
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
6 6 0 0 -1 -1 -1 -1
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
1 1 0 0
-8 1 0
-8 1 0
-8 1 0
-8 1 0
-8 1 0
-8 1 1
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1 0 0 0
-0 8 1 1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 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
+0 8 1 1 0 0 0 "" ""
\latex latex
-#This file was created by <larsbj> Fri Sep 12 18:47:36 1997
-#LyX 0.11 (C) 1995-1997 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:46:35 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\language default
\papersize letterpaper
\paperpackage a4
\use_geometry 0
+\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\begin_inset Formula
\begin{equation}
-\label{}
x=y^{2}-3
\end{equation}
) using their corresponding labels.
\layout Standard
-\cursor 0
+
\begin_inset Formula
\begin{eqnarray}
-#This file was created by <ale> Wed Oct 29 15:21:35 1997
-#LyX 0.11 (C) 1995-1997 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:47:02 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\language default
\papersize Default
\paperpackage a4
\use_geometry 0
+\use_amsmath 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
Currently the user can only define command macros, but internally it's possible
to define also environment macros.
\layout Standard
-\cursor 358
+
There are several predefined macros, mainly to allow AMS-LaTeX users to
use AMS macros in a WYSIWYM way, like
\family typewriter
-#This file was created by <jug> Mon Jan 12 12:28:05 1998
-#LyX 0.12 (C) 1995-1997 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:47:25 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\language default
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \pextra_type 2 \pextra_alignment 0 \pext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0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
1
\newline
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \pextra_type 2 \pextra_alignment 0 \pextra_hfill 1 \pextra_start_minipage 1 \pextra_widthp 45
\LyXTable
-multicol4
+multicol5
5 5 0 0 -1 -1 -1 -1
1 1 0 0
1 0 0 0
1 0 0 0
1 0 0 0
1 1 0 0
-8 1 1
-8 1 0
-8 1 0
-8 1 0
-8 1 1
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
+8 1 1 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
1
\newline
-#This file was created by <larsbj> Fri Jan 9 14:59:14 1998
-#LyX 0.12 (C) 1995-1998 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:47:42 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
\begin_preamble
How to use the longtable special options
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
98 3 1 0 3 1 4 4
1 1 0 0
1 1 0 0
0 1 0 0
0 1 0 0
0 1 0 0
-2 1 0 5cm
-2 0 0
-4 1 1
-1 8 1 1 0 0 0
-2 8 1 1 0 0 0
-2 8 1 1 0 0 0
-1 8 0 1 0 0 0
-2 8 1 1 0 0 0
-1 8 0 1 0 0 0
-1 8 1 1 0 0 0
-2 8 1 1 0 0 0
-2 8 1 1 0 0 0
-1 8 0 1 0 0 0
-2 8 1 1 0 0 0
-1 8 0 1 0 0 0
-1 2 1 1 0 0 0
-2 8 1 1 0 0 0
-2 8 1 1 0 0 0
-0 2 1 0 0 0 1
-0 2 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-1 2 1 0 0 0 0
-2 8 1 0 0 0 0
-2 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 4 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-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 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 8 0 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 8 0 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 8 0 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 8 0 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 8 0 1 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 8 0 1 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
a
\newline
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \pextra_type 2 \pextra_alignment 0 \pextra_widthp 25
\LyXTable
-multicol4
+multicol5
6 4 0 0 -1 -1 -1 -1
1 1 0 0
1 0 0 0
1 0 0 0
1 1 0 0
0 1 1 0
-8 1 1
-8 1 0
-8 1 0
-8 1 1
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 1 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 1 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
+8 1 1 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 1 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 1 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
a
\newline
and footnotes will be displayed at the bottom of the page.
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
6 4 1 0 -1 -1 -1 -1
1 1 0 0
1 0 0 0
1 0 0 0
1 1 0 0
0 1 1 0
-8 1 1
-8 1 0
-8 1 0
-8 1 1
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 1 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 1 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
+8 1 1 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 1 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 1 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
a
\newline
Use this method in minipages to get footnotes at the bottom of the page.
\layout Standard
\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
-multicol4
+multicol5
4 4 0 0 -1 -1 -1 -1
1 1 0 0
1 0 0 0
1 0 0 0
1 1 0 0
-8 1 1
-8 1 0
-8 1 0
-8 1 1
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 0 0 0
-0 8 1 0 1 0 0
+8 1 1 "" ""
+8 1 0 "" ""
+8 1 0 "" ""
+8 1 1 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 1 0 0 "" ""
a
\newline
-#This file was created by <lasgoutt> Tue Mar 3 17:28:33 1998
-#LyX 0.12 (C) 1995-1998 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:48:49 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass amsart
\language default
-#This file was created by <dlj0> Sun Dec 14 14:56:10 1997
-#LyX 0.11 (C) 1995-1997 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:49:17 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass amsbook
\language default
-#This file was created by <lasgoutt> Wed Mar 25 16:47:59 1998
-#LyX 0.12 (C) 1995-1998 Matthias Ettrich and the LyX Team
+#This file was created by <larsbj> Sun Dec 5 17:50:17 1999
+#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass foils
\options dvips
-#This file was created by <larsbj> Tue Nov 9 04:47:40 1999
+#This file was created by <larsbj> Sun Dec 5 17:51:04 1999
#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team
\lyxformat 2.15
\textclass article
#include <config.h>
-#include <stdio.h>
+#include <cstdio>
#include "Spacing.h"
/// how can I put this inside of Spacing (class)
static
-char const *spacing_string[] = {"single", "onehalf", "double", "other"};
+char const * spacing_string[] = {"single", "onehalf", "double", "other"};
-void Spacing::writeFile(FILE *file)
+void Spacing::writeFile(ostream & os)
{
if (getSpace() == Spacing::Other) {
- fprintf(file, "\\spacing %s %.2f \n",
- spacing_string[getSpace()],
- getValue());
+ os.setf(ios::showpoint|ios::fixed);
+ os.precision(2);
+ os << "\\spacing " << spacing_string[getSpace()]
+ << " " << getValue() << " \n";
} else {
- fprintf(file, "\\spacing %s \n",
- spacing_string[getSpace()]);
+ os << "\\spacing " << spacing_string[getSpace()] << " \n";
}
}
#define SPACING_H
#include <cstdio>
+#include "support/LOstream.h"
+
///
class Spacing {
set(sp, fval);
}
///
- void writeFile(FILE * file);
+ void writeFile(ostream &);
///
friend bool operator!=(Spacing const & a, Spacing const & b)
{
int dx, dy; /* Size of each item */
int bx, by; /* Bitmap's position */
int bw, bh; /* Bitmap dimensions */
- unsigned char * bdata; /* Bitmap data */
+ unsigned char const * bdata; /* Bitmap data */
int maxi; /* Number of items */
int i; /* Current position */
int mousebut; /* mouse button pushed */
} BMTABLE_SPEC;
-extern "C" int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx,
- FL_Coord my, int key, void *xev);
+extern "C" int handle_bitmaptable(FL_OBJECT * ob, int event, FL_Coord mx,
+ FL_Coord my, int key, void * xev);
-FL_OBJECT *fl_create_bmtable(int type, FL_Coord x, FL_Coord y,
- FL_Coord w, FL_Coord h, char const *label)
+FL_OBJECT * fl_create_bmtable(int type, FL_Coord x, FL_Coord y,
+ FL_Coord w, FL_Coord h, char const * label)
{
- FL_OBJECT *ob;
+ FL_OBJECT * ob;
ob = fl_make_object(FL_BMTABLE, type, x, y, w, h, label, handle_bitmaptable);
ob->boxtype = FL_BMTABLE_BOXTYPE;
/* draw the background bitmap */
if (sp->bdata) {
if (!sp->pix) {
- sp->pix = XCreatePixmapFromBitmapData(fl_display, fl_winget(),
- reinterpret_cast<char*>(sp->bdata),
+ sp->pix = XCreatePixmapFromBitmapData(fl_display, fl_winget(),
+ const_cast<char*>(reinterpret_cast<char const *>(sp->bdata)),
sp->bw, sp->bh,
fl_get_flcolor(ob->lcol), fl_get_flcolor(ob->col1),
/*DefaultDepth(fl_display, DefaultScreen(fl_display))*/ fl_state[fl_get_vclass()].depth);
}
-extern "C" int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx,
+extern "C" int handle_bitmaptable(FL_OBJECT * ob, int event, FL_Coord mx,
FL_Coord my, int key, void */*xev*/)
{
int i, j;
- BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
+ BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
switch (event) {
case FL_DRAW:
sp->maxi = sp->nx * sp->ny;
sp->bw = bw;
sp->bh = bh;
- sp->bdata = const_cast<unsigned char *>(bdata);
+ sp->bdata = bdata;
}
}
*/
#if XlibSpecificationRelease > 5
-void fl_set_bmtable_file(FL_OBJECT *ob, int nx, int ny, char const *filename)
+void fl_set_bmtable_file(FL_OBJECT * ob, int nx, int ny, char const * filename)
{
int xh, yh;
unsigned int bw, bh;
- unsigned char *bdata;
+ unsigned char * bdata;
if(XReadBitmapFileData(filename, &bw, &bh,
&bdata, &xh, &yh) == BitmapSuccess)
}
/* Free the current bitmap and pixmap in preparation for installing a new one */
-void fl_free_bmtable_bitmap(FL_OBJECT *ob)
+void fl_free_bmtable_bitmap(FL_OBJECT * ob)
{
- BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
+ BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
/* dump the temporary pixmap */
if (sp && sp->pix) {
/* and free the space taken by bdata etc. */
if (sp && sp->bdata) {
- fl_free(sp->bdata);
+ fl_free((void*)sp->bdata);
sp->bdata = 0;
}
}
/* This is needed when using data instead of files to set bitmaps */
void fl_free_bmtable_pixmap(FL_OBJECT *ob)
{
- BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
+ BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
/* dump the temporary pixmap */
if (sp && sp->pix) {
#include <config.h>
+#include <fstream>
+#include <iomanip>
#include <cstdlib>
#include <unistd.h>
return false;
}
- FilePtr file(filename, FilePtr::truncate);
- if (!file()) {
+ ofstream ofs(filename.c_str());
+ if (!ofs) {
if (flag)
- lyxerr << _("Error! Cannot write file: ")
+ lyxerr << _("Error! Cannot open file: ")
<< filename << endl;
else
- WriteFSAlert(_("Error! Cannot write file: "),
+ WriteFSAlert(_("Error! Canno open file:"),
filename);
return false;
}
string userName(getUserName()) ;
// write out a comment in the top of the file
- fprintf(file,
- "#LyX 1.1 Copyright 1995-1999 Matthias Ettrich"
- " and the LyX Team\n");
-
- // at the very beginning the used lyx format
- fprintf(file, "\\lyxformat %.2f\n", LYX_FORMAT);
+ ofs << "#LyX 1.1 Copyright 1995-1999 Matthias Ettrich"
+ " and the LyX Team\n";
+ ofs.setf(ios::showpoint|ios::fixed);
+ ofs.precision(2);
+ ofs << "\\lyxformat " << setw(4) << LYX_FORMAT << "\n";
- // now write out the buffer parameters.
- params.writeFile(file);
+ // now write out the buffer paramters.
+ params.writeFile(ofs);
char footnoteflag = 0;
char depth = 0;
// this will write out all the paragraphs
// using recursive descent.
- paragraph->writeFile(file, params, footnoteflag, depth);
+ paragraph->writeFile(ofs, params, footnoteflag, depth);
// Write marker that shows file is complete
- fprintf(file, "\n\\the_end\n");
- if (file.close()) {
- if (flag)
- lyxerr << _("Error! Could not close file properly: ")
- << filename << endl;
- else
- WriteFSAlert(_("Error! Could not close file properly: "),
- filename);
- return false;
- }
+ ofs << "\n\\the_end" << endl;
+ ofs.close();
+ // how to check if close went ok?
return true;
}
void Buffer::writeFileAscii(string const & filename, int linelen)
{
- FilePtr file(filename, FilePtr::write);
LyXFont font1, font2;
Inset * inset;
char c, footnoteflag = 0, depth = 0;
currlinelen = 0;
long fpos = 0;
bool ref_printed = false;
-
-
- if (!file()) {
+
+ ofstream ofs(filename.c_str());
+ if (!ofs) {
WriteFSAlert(_("Error: Cannot write file:"), filename);
return;
}
-
+
string fname1 = TmpFileName();
LyXParagraph * par = paragraph;
while (par) {
footnoteflag = par->footnoteflag;
if (footnoteflag) {
j = strlen(string_footnotekinds[par->footnotekind])+4;
- if (currlinelen+j > linelen)
- fprintf(file, "\n");
- fprintf(file, "([%s] ",
- string_footnotekinds[par->footnotekind]);
+ if (currlinelen + j > linelen)
+ ofs << "\n";
+ ofs << "(["
+ << string_footnotekinds[par->footnotekind] << "] ";
currlinelen += j;
}
}
else {
/* dummy layout, that means a footnote ended */
footnoteflag = LyXParagraph::NO_FOOTNOTE;
- fprintf(file, ") ");
+ ofs << ") ";
noparbreak = 1;
}
if (par->table){
if (!lyxrc->ascii_roff_command.empty() &&
lyxrc->ascii_roff_command != "none") {
- RoffAsciiTable(file, par);
+ RoffAsciiTable(ofs, par);
par = par->next;
continue;
}
c = par->GetChar(i);
if (c == LyXParagraph::META_INSET) {
if ((inset = par->GetInset(i))) {
- FilePtr fp(fname1,
- FilePtr::write);
- if (!fp()) {
+ ofstream fs(fname1.c_str());
+ if (!fs) {
WriteFSAlert(_("Error: Cannot open temporary file:"), fname1);
return;
}
- inset->Latex(fp,-1);
- h += ftell(fp) - 1;
+ inset->Latex(fs, -1);
+ h += fs.tellp() - 1;
remove(fname1.c_str());
}
} else if (c == LyXParagraph::META_NEWLINE) {
clen[j] = h;
h = 0;
j = (++j) % par->table->NumberOfCellsInRow(actcell);
- actcell++;
+ ++actcell;
}
}
if (clen[j] < h)
actcell = 0;
for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) {
if (!i && !footnoteflag && !noparbreak){
- fprintf(file, "\n\n");
- for(j = 0; j<depth; j++)
- fprintf(file, " ");
- currlinelen = depth*2;
+ ofs << "\n\n";
+ for(j = 0; j < depth; ++j)
+ ofs << " ";
+ currlinelen = depth * 2;
switch(ltype) {
case 0: /* Standart */
case 4: /* (Sub)Paragraph */
case 5: /* Description */
break;
case 6: /* Abstract */
- fprintf(file, "Abstract\n\n");
+ ofs << "Abstract\n\n";
break;
case 7: /* Bibliography */
if (!ref_printed) {
- fprintf(file, "References\n\n");
+ ofs << "References\n\n";
ref_printed = true;
}
break;
default:
- fprintf(file, "%s ", par->labelstring.c_str());
+ ofs << par->labelstring << " ";
break;
}
if (ltype_depth > depth) {
for(j = ltype_depth-1; j>depth; j--)
- fprintf(file, " ");
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
if (par->table) {
for(j = 0;j<cells;j++) {
- fputc('+', file);
- for(h = 0; h<(clen[j]+1); h++)
- fputc('-', file);
+ ofs << '+';
+ for(h = 0; h < (clen[j]+1); h++)
+ ofs << '-';
}
- fprintf(file, "+\n");
+ ofs << "+\n";
for(j = 0; j<depth; j++)
- fprintf(file, " ");
+ ofs << " ";
currlinelen = depth*2;
if (ltype_depth > depth) {
for(j = ltype_depth; j>depth; j--)
- fprintf(file, " ");
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
- fprintf(file, "| ");
+ ofs << "| ";
}
}
font2 = par->GetFontSettings(i);
switch (c) {
case LyXParagraph::META_INSET:
if ((inset = par->GetInset(i))) {
- fpos = ftell(file);
- inset->Latex(file,-1);
- currlinelen += (ftell(file) - fpos);
- actpos += (ftell(file) - fpos) - 1;
+ fpos = ofs.tellp();
+ inset->Latex(ofs, -1);
+ currlinelen += (ofs.tellp() - fpos);
+ actpos += (ofs.tellp() - fpos) - 1;
}
break;
case LyXParagraph::META_NEWLINE:
if (par->table) {
if (par->table->NumberOfCellsInRow(actcell) <= cell) {
- for(j = actpos;j<clen[cell-1];j++)
- fputc(' ', file);
- fprintf(file, " |\n");
+ for(j = actpos; j < clen[cell-1];j++)
+ ofs << ' ';
+ ofs << " |\n";
for(j = 0; j<depth; j++)
- fprintf(file, " ");
+ ofs << " ";
currlinelen = depth*2;
if (ltype_depth > depth) {
for(j = ltype_depth; j>depth; j--)
- fprintf(file, " ");
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
for(j = 0;j<cells;j++) {
- fputc('+', file);
- for(h = 0; h<(clen[j]+1); h++)
- fputc('-', file);
+ ofs << '+';
+ for(h = 0; h < (clen[j]+1); ++h)
+ ofs << '-';
}
- fprintf(file, "+\n");
+ ofs << "+\n";
for(j = 0; j<depth; j++)
- fprintf(file, " ");
+ ofs << " ";
currlinelen = depth*2;
if (ltype_depth > depth) {
for(j = ltype_depth; j>depth; j--)
- fprintf(file, " ");
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
- fprintf(file, "| ");
+ ofs << "| ";
cell = 1;
} else {
for(j = actpos; j<clen[cell-1]; j++)
- fputc(' ', file);
- fprintf(file, " | ");
- cell++;
+ ofs << ' ';
+ ofs << " | ";
+ ++cell;
}
- actcell++;
+ ++actcell;
currlinelen = actpos = 0;
} else {
- fprintf(file, "\n");
+ ofs << "\n";
for(j = 0; j<depth; j++)
- fprintf(file, " ");
- currlinelen = depth*2;
+ ofs << " ";
+ currlinelen = depth * 2;
if (ltype_depth > depth) {
for(j = ltype_depth; j>depth; j--)
- fprintf(file, " ");
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
}
break;
case LyXParagraph::META_HFILL:
- fprintf(file, "\t");
+ ofs << "\t";
break;
case LyXParagraph::META_PROTECTED_SEPARATOR:
- fprintf(file, " ");
+ ofs << " ";
break;
- case '\\':
- fprintf(file, "\\");
+ case '\\':
+ ofs << "\\";
break;
default:
if (currlinelen > linelen - 10
&& c == ' ' && i + 2 < par->size()) {
- fprintf(file, "\n");
+ ofs << "\n";
for(j = 0; j < depth; ++j)
- fprintf(file, " ");
+ ofs << " ";
currlinelen = depth * 2;
if (ltype_depth > depth) {
for(j = ltype_depth;
j > depth; --j)
- fprintf(file, " ");
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
} else if (c != '\0')
- fprintf(file, "%c", c);
+ ofs << c;
else if (c == '\0')
lyxerr.debug() << "writeAsciiFile: NULL char in structure." << endl;
- currlinelen++;
+ ++currlinelen;
break;
}
}
if (par->table) {
- for(j = actpos;j<clen[cell-1];j++)
- fputc(' ', file);
- fprintf(file, " |\n");
+ for(j = actpos; j < clen[cell - 1]; ++j)
+ ofs << ' ';
+ ofs << " |\n";
for(j = 0; j<depth; j++)
- fprintf(file, " ");
- currlinelen = depth*2;
+ ofs << " ";
+ currlinelen = depth * 2;
if (ltype_depth > depth) {
- for(j = ltype_depth; j>depth; j--)
- fprintf(file, " ");
+ for(j = ltype_depth; j > depth; --j)
+ ofs << " ";
currlinelen += (ltype_depth-depth)*2;
}
- for(j = 0;j<cells;j++) {
- fputc('+', file);
- for(h = 0; h<(clen[j]+1); h++)
- fputc('-', file);
+ for(j = 0;j<cells; ++j) {
+ ofs << '+';
+ for(h = 0; h < (clen[j] + 1); ++h)
+ ofs << '-';
}
- fprintf(file, "+\n");
+ ofs << "+\n";
delete [] clen;
}
par = par->next;
}
- fprintf(file, "\n");
+ ofs << "\n";
}
LyXTextClass const & tclass =
textclasslist.TextClass(params.textclass);
-
- FilePtr file(filename, FilePtr::write);
- if (!file()) {
- WriteFSAlert(_("Error: Cannot write file:"), filename);
+
+ ofstream ofs(filename.c_str());
+ if (!ofs) {
+ WriteFSAlert(_("Error: Cannot open file:"), filename);
return;
}
-
+
// validate the buffer.
lyxerr[Debug::LATEX] << " Validating buffer..." << endl;
LaTeXFeatures features(tclass.numLayouts());
if (!only_body && nice) {
LFile += "%% This LaTeX-file was created by <";
- LFile += userName + "> " + (char*)date();
+ LFile += userName + "> " + date();
LFile += "%% LyX 1.0 (C) 1995-1999 by Matthias Ettrich and the LyX Team\n";
LFile += "\n%% Do not edit this file unless you know what you are doing.\n";
texrow.newline();
}
// Write out what we've generated so far...and reset LFile
- fwrite(LFile.c_str(), sizeof(char), LFile.length(), file);
+ ofs << LFile;
LFile.clear();
// Now insert the LyX specific LaTeX commands...
texrow.newline();
}
- // A bit faster than printing a char at a time I think.
- fwrite(preamble.c_str(), sizeof(char),
- preamble.length(), file);
+ ofs << preamble;
// make the body.
LFile += "\\begin{document}\n\n";
// gains a few extra % of speed; going higher than
// 2 will slow things down again. I'll look at
// LFile.length() in a future revision. ARRae
- fwrite(LFile.c_str(), sizeof(char),
- LFile.length(), file);
+ ofs << LFile;
LFile.clear();
loop_count = 0;
}
texrow.newline();
// Write out what we've generated...and reset LFile
- fwrite(LFile.c_str(), sizeof(char), LFile.length(), file);
+ ofs << LFile;
LFile.clear();
// tex_code_break_column's value is used to decide
// value when we leave otherwise we save incorrect .lyx files.
tex_code_break_column = lyxrc->ascii_linelen;
- if (file.close()) {
- WriteFSAlert(_("Error! Could not close file properly:"), filename);
- }
+ // How to check if the close went ok when using fstreams
+ ofs.close();
lyxerr.debug() << "Finished making latex file." << endl;
}
}
-void Buffer::sgmlOpenTag(FILE * file, int depth, string const & latexname) const
+void Buffer::sgmlOpenTag(ostream & os, int depth,
+ string const & latexname) const
{
- static char * space[] = {" "," ", " ", " ", " ", " ", " ",
- " ", " ", " ", " "};
+ static char * space[] = {" "," ", " ", " ", " ", " ",
+ " ",
+ " ", " ", " ",
+ " "};
- fprintf(file, "%s<%s>\n", space[depth], latexname.c_str());
+ os << space[depth] << "<" << latexname << ">\n";
}
-void Buffer::sgmlCloseTag(FILE * file, int depth,
+void Buffer::sgmlCloseTag(ostream & os, int depth,
string const & latexname) const
{
- static char * space[] = {" ", " ", " ", " ", " ", " ", " ",
- " ", " ", " ", " "};
+ static char * space[] = {" ", " ", " ", " ", " ",
+ " ", " ", " ",
+ " ", " ", " "};
- fprintf(file, "%s</%s>\n", space[depth], latexname.c_str());
+ os << space[depth] << "</" << latexname << ">\n";
}
int depth = 0; /* paragraph depth */
- FilePtr file(filename, FilePtr::write);
- tex_code_break_column = column;
+ ofstream ofs(filename.c_str());
- if (!file()) {
+ if (!ofs) {
WriteAlert(_("LYX_ERROR:"), _("Cannot write file"), filename);
return;
}
+ tex_code_break_column = column;
texrow.reset();
if (params.preamble.empty()) {
- fprintf(file, "<!doctype linuxdoc system>\n\n");
+ ofs << "<!doctype linuxdoc system>\n\n";
}
else {
- fprintf(file, "<!doctype linuxdoc system \n [ %s \n]>\n\n",
- params.preamble.c_str() );
+ ofs << "<!doctype linuxdoc system \n [ "
+ << params.preamble << " \n]>\n\n";
}
string userName(getUserName());
- fprintf(file,
- "<!-- LinuxDoc file was created by LyX 1.0 (C) 1995-1999 ");
- fprintf(file, "by <%s> %s -->\n", userName.c_str(), (char *)date());
+ ofs << "<!-- LinuxDoc file was created by LyX 1.0 (C) 1995-1999 "
+ << "by <" << userName << "> " << (char*)date() << " -->\n";
if(params.options.empty())
- sgmlOpenTag(file, 0, top_element);
+ sgmlOpenTag(ofs, 0, top_element);
else {
string top = top_element;
top += " ";
top += params.options;
- sgmlOpenTag(file, 0, top);
+ sgmlOpenTag(ofs, 0, top);
}
while (par) {
/* treat <toc> as a special case for compatibility with old code */
if (par->GetChar(0) == LyXParagraph::META_INSET) {
- Inset *inset = par->GetInset(0);
+ Inset * inset = par->GetInset(0);
char lyx_code = inset->LyxCode();
if (lyx_code == Inset::TOC_CODE){
string temp = "toc";
- sgmlOpenTag(file, depth, temp);
+ sgmlOpenTag(ofs, depth, temp);
par = par->next;
- linuxDocHandleFootnote(file, par, depth);
+ linuxDocHandleFootnote(ofs, par, depth);
continue;
}
}
/* environment tag closing */
- for( ;depth > par->depth; depth--) {
- sgmlCloseTag(file, depth, environment_stack[depth]);
+ for( ; depth > par->depth; --depth) {
+ sgmlCloseTag(ofs, depth, environment_stack[depth]);
environment_stack[depth].clear();
}
case LATEX_PARAGRAPH:
if(depth == par->depth
&& !environment_stack[depth].empty()) {
- sgmlCloseTag(file, depth, environment_stack[depth]);
+ sgmlCloseTag(ofs, depth, environment_stack[depth]);
environment_stack[depth].clear();
if(depth)
- depth--;
+ --depth;
else
- fprintf(file, "</p>");
+ ofs << "</p>";
}
- sgmlOpenTag(file, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, style.latexname());
break;
case LATEX_COMMAND:
LinuxDocError(par, 0, _("Error : Wrong depth for LatexType Command.\n"));
if (!environment_stack[depth].empty()){
- sgmlCloseTag(file, depth, environment_stack[depth]);
- fprintf(file, "</p>");
+ sgmlCloseTag(ofs, depth,
+ environment_stack[depth]);
+ ofs << "</p>";
}
environment_stack[depth].clear();
- sgmlOpenTag(file, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, style.latexname());
break;
case LATEX_ENVIRONMENT:
&& environment_stack[depth] != style.latexname()
&& !environment_stack[depth].empty()) {
- sgmlCloseTag(file, depth,
+ sgmlCloseTag(ofs, depth,
environment_stack[depth]);
environment_stack[depth].clear();
}
if (environment_stack[depth] != style.latexname()) {
if(depth == 0) {
string temp = "p";
- sgmlOpenTag(file, depth, temp);
+ sgmlOpenTag(ofs, depth, temp);
}
environment_stack[depth] = style.latexname();
- sgmlOpenTag(file, depth, environment_stack[depth]);
+ sgmlOpenTag(ofs, depth, environment_stack[depth]);
}
if(style.latextype == LATEX_ENVIRONMENT) break;
else
item_name = "item";
- sgmlOpenTag(file, depth+1, item_name);
+ sgmlOpenTag(ofs, depth + 1, item_name);
break;
default:
- sgmlOpenTag(file, depth, style.latexname());
+ sgmlOpenTag(ofs, depth, style.latexname());
break;
}
do {
- SimpleLinuxDocOnePar(file, par, desc_on, depth);
+ SimpleLinuxDocOnePar(ofs, par, desc_on, depth);
par = par->next;
- linuxDocHandleFootnote(file, par, depth);
+ linuxDocHandleFootnote(ofs, par, depth);
}
while(par && par->IsDummy());
- fprintf(file, "\n");
+ ofs << "\n";
/* write closing SGML tags */
switch(style.latextype) {
case LATEX_COMMAND:
case LATEX_ITEM_ENVIRONMENT:
break;
default:
- sgmlCloseTag(file, depth, style.latexname());
+ sgmlCloseTag(ofs, depth, style.latexname());
break;
}
}
/* Close open tags */
- for(;depth>0;depth--)
- sgmlCloseTag(file, depth, environment_stack[depth]);
+ for(; depth > 0; --depth)
+ sgmlCloseTag(ofs, depth, environment_stack[depth]);
if(!environment_stack[depth].empty())
- sgmlCloseTag(file, depth, environment_stack[depth]);
+ sgmlCloseTag(ofs, depth, environment_stack[depth]);
- fprintf(file, "\n\n");
- sgmlCloseTag(file, 0, top_element);
+ ofs << "\n\n";
+ sgmlCloseTag(ofs, 0, top_element);
- if (file.close()) {
- WriteFSAlert(_("Error! Could not close file properly:"),
- filename);
- }
+ ofs.close();
+ // How to check for successful close
}
-void Buffer::linuxDocHandleFootnote(FILE * file, LyXParagraph * & par,
+void Buffer::linuxDocHandleFootnote(ostream & os, LyXParagraph * & par,
int const depth)
{
string tag = "footnote";
while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
- sgmlOpenTag(file, depth+1, tag);
- SimpleLinuxDocOnePar(file, par, 0, depth+1);
- sgmlCloseTag(file, depth+1, tag);
+ sgmlOpenTag(os, depth + 1, tag);
+ SimpleLinuxDocOnePar(os, par, 0, depth + 1);
+ sgmlCloseTag(os, depth + 1, tag);
par = par->next;
}
}
-void Buffer::DocBookHandleCaption(FILE * file, string & inner_tag,
+
+void Buffer::DocBookHandleCaption(ostream & os, string & inner_tag,
int const depth, int desc_on,
LyXParagraph * & par)
{
LyXParagraph * tpar = par;
string tmp_par, extra_par;
while (tpar && (tpar->footnoteflag != LyXParagraph::NO_FOOTNOTE) &&
- (tpar->layout != textclasslist.NumberOfLayout(params.textclass, "Caption").second))
+ (tpar->layout != textclasslist.NumberOfLayout(params.textclass,
+ "Caption").second))
tpar = tpar->next;
if (tpar &&
tpar->layout == textclasslist.NumberOfLayout(params.textclass,
"Caption").second) {
- sgmlOpenTag(file, depth+1, inner_tag);
- SimpleDocBookOnePar(tmp_par, extra_par, tpar, desc_on, depth+2);
- tmp_par = strip(tmp_par);
- tmp_par = frontStrip(tmp_par);
- fprintf(file, "%s", tmp_par.c_str());
- sgmlCloseTag(file, depth+1, inner_tag);
- if(!extra_par.empty())
- fprintf(file, "%s", extra_par.c_str());
- }
+ sgmlOpenTag(os, depth + 1, inner_tag);
+ SimpleDocBookOnePar(tmp_par, extra_par, tpar,
+ desc_on, depth + 2);
+ tmp_par = strip(tmp_par);
+ tmp_par = frontStrip(tmp_par);
+ os << tmp_par;
+ sgmlCloseTag(os, depth+1, inner_tag);
+ if(!extra_par.empty())
+ os << extra_par;
+ }
}
-void Buffer::DocBookHandleFootnote(FILE * file, LyXParagraph * & par,
+
+void Buffer::DocBookHandleFootnote(ostream & os, LyXParagraph * & par,
int const depth)
{
string tag, inner_tag;
if(last == present) {
if(inner_span) {
if(!tmp_par.empty()) {
- fprintf(file, "%s", tmp_par.c_str());
+ os << tmp_par;
tmp_par.clear();
- sgmlCloseTag(file, depth+1, inner_tag);
- sgmlOpenTag(file, depth+1, inner_tag);
+ sgmlCloseTag(os, depth+1, inner_tag);
+ sgmlOpenTag(os, depth+1, inner_tag);
}
}
else
- fprintf(file, "\n");
+ os << "\n";
} else {
- fprintf(file, "%s", tmp_par.c_str());
- if(!inner_tag.empty()) sgmlCloseTag(file, depth+1, inner_tag);
- if(!extra_par.empty()) fprintf(file, "%s", extra_par.c_str());
- if(!tag.empty()) sgmlCloseTag(file, depth, tag);
+ os << tmp_par;
+ if(!inner_tag.empty()) sgmlCloseTag(os, depth+1, inner_tag);
+ if(!extra_par.empty()) os << extra_par;
+ if(!tag.empty()) sgmlCloseTag(os, depth, tag);
extra_par.clear();
switch (par->footnotekind) {
inner_span = false;
break;
}
- sgmlOpenTag(file, depth, tag);
+ sgmlOpenTag(os, depth, tag);
if ((present == TAB_LIKE) || (present == FIG_LIKE)) {
- DocBookHandleCaption(file, inner_tag, depth,
+ DocBookHandleCaption(os, inner_tag, depth,
desc_on, par);
inner_tag.clear();
} else {
- sgmlOpenTag(file, depth+1, inner_tag);
+ sgmlOpenTag(os, depth + 1, inner_tag);
}
}
// ignore all caption here, we processed them above!!!
if (par->layout != textclasslist.NumberOfLayout(params.textclass,
"Caption").second) {
SimpleDocBookOnePar(tmp_par, extra_par, par,
- desc_on, depth+2);
+ desc_on, depth + 2);
}
tmp_par = frontStrip(strip(tmp_par));
last = present;
par = par->next;
}
- fprintf(file, "%s", tmp_par.c_str());
- if(!inner_tag.empty()) sgmlCloseTag(file, depth+1, inner_tag);
- if(!extra_par.empty()) fprintf(file, "%s", extra_par.c_str());
- if(!tag.empty()) sgmlCloseTag(file, depth, tag);
-
+ os << tmp_par;
+ if(!inner_tag.empty()) sgmlCloseTag(os, depth+1, inner_tag);
+ if(!extra_par.empty()) os << extra_par;
+ if(!tag.empty()) sgmlCloseTag(os, depth, tag);
}
/* push a tag in a style stack */
-void Buffer::push_tag(FILE * file, char const * tag,
+void Buffer::push_tag(ostream & os, char const * tag,
int & pos, char stack[5][3])
{
int j;
/* pop all previous tags */
- for (j = pos; j >= 0; j--)
- fprintf(file, "</%s>", stack[j]);
+ for (j = pos; j >= 0; --j)
+ os << "</" << stack[j] << ">";
/* add new tag */
sprintf(stack[++pos], "%s", tag);
/* push all tags */
- for (j= 0; j<= pos; j++)
- fprintf(file, "<%s>", stack[j]);
+ for (j = 0; j <= pos; ++j)
+ os << "<" << stack[j] << ">";
}
// pop a tag from a style stack
-void Buffer::pop_tag(FILE * file, char const * tag,
+void Buffer::pop_tag(ostream & os, char const * tag,
int & pos, char stack[5][3])
{
int j;
// pop all tags till specified one
- for (j= pos; (j>= 0) && (strcmp(stack[j], tag)); j--)
- fprintf(file, "</%s>", stack[j]);
+ for (j = pos; (j >= 0) && (strcmp(stack[j], tag)); --j)
+ os << "</" << stack[j] << ">";
// closes the tag
- fprintf(file, "</%s>", tag);
+ os << "</" << tag << ">";
// push all tags, but the specified one
- for (j= j+1; j<= pos; j++) {
- fprintf(file, "<%s>", stack[j]);
+ for (j = j + 1; j <= pos; ++j) {
+ os << "<" << stack[j] << ">";
strcpy(stack[j-1], stack[j]);
}
- pos --;
+ --pos;
}
// checks, if newcol chars should be put into this line
// writes newline, if necessary.
static
-void linux_doc_line_break(FILE * file, unsigned int & colcount,
+void linux_doc_line_break(ostream & os, unsigned int & colcount,
const unsigned int newcol)
{
colcount += newcol;
if (colcount > lyxrc->ascii_linelen) {
- fprintf(file, "\n");
+ os << "\n";
colcount = newcol; // assume write after this call
}
}
-void Buffer::SimpleLinuxDocOnePar(FILE * file, LyXParagraph * par,
+void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
int desc_on, int const depth)
{
LyXFont font1, font2;
switch(family_type) {
case 0:
if (font2.family() == LyXFont::TYPEWRITER_FAMILY) {
- push_tag(file, "tt", stack_num, stack);
+ push_tag(os, "tt", stack_num, stack);
family_type= 1;
}
else if (font2.family() == LyXFont::SANS_FAMILY) {
- push_tag(file, "sf", stack_num, stack);
+ push_tag(os, "sf", stack_num, stack);
family_type= 2;
}
break;
case 1:
- pop_tag(file, "tt", stack_num, stack);
+ pop_tag(os, "tt", stack_num, stack);
if (font2.family() == LyXFont::SANS_FAMILY) {
- push_tag(file, "sf", stack_num, stack);
+ push_tag(os, "sf", stack_num, stack);
family_type= 2;
}
else {
}
break;
case 2:
- pop_tag(file, "sf", stack_num, stack);
+ pop_tag(os, "sf", stack_num, stack);
if (font2.family() == LyXFont::TYPEWRITER_FAMILY) {
- push_tag(file, "tt", stack_num, stack);
+ push_tag(os, "tt", stack_num, stack);
family_type= 1;
}
else {
/* handle bold face */
if (font1.series() != font2.series()) {
if (font2.series() == LyXFont::BOLD_SERIES) {
- push_tag(file, "bf", stack_num, stack);
+ push_tag(os, "bf", stack_num, stack);
is_bold = true;
}
else if (is_bold) {
- pop_tag(file, "bf", stack_num, stack);
+ pop_tag(os, "bf", stack_num, stack);
is_bold = false;
}
}
switch(shape_type) {
case 0:
if (font2.shape() == LyXFont::ITALIC_SHAPE) {
- push_tag(file, "it", stack_num, stack);
+ push_tag(os, "it", stack_num, stack);
shape_type= 1;
}
else if (font2.shape() == LyXFont::SLANTED_SHAPE) {
- push_tag(file, "sl", stack_num, stack);
+ push_tag(os, "sl", stack_num, stack);
shape_type= 2;
}
break;
case 1:
- pop_tag(file, "it", stack_num, stack);
+ pop_tag(os, "it", stack_num, stack);
if (font2.shape() == LyXFont::SLANTED_SHAPE) {
- push_tag(file, "sl", stack_num, stack);
+ push_tag(os, "sl", stack_num, stack);
shape_type= 2;
}
else {
}
break;
case 2:
- pop_tag(file, "sl", stack_num, stack);
+ pop_tag(os, "sl", stack_num, stack);
if (font2.shape() == LyXFont::ITALIC_SHAPE) {
- push_tag(file, "it", stack_num, stack);
+ push_tag(os, "it", stack_num, stack);
shape_type= 1;
}
else {
/* handle <em> tag */
if (font1.emph() != font2.emph()) {
if (font2.emph() == LyXFont::ON) {
- push_tag(file, "em", stack_num, stack);
+ push_tag(os, "em", stack_num, stack);
is_em = true;
} else if (is_em) {
- pop_tag(file, "em", stack_num, stack);
+ pop_tag(os, "em", stack_num, stack);
is_em = false;
}
}
if (font2.latex() == LyXFont::ON) {
// "TeX"-Mode on == > SGML-Mode on.
if (c!= '\0')
- fprintf(file, "%c", c); // see LaTeX-Generation...
+ os << c; // see LaTeX-Generation...
char_line_count++;
} else if (c == LyXParagraph::META_INSET) {
inset = par->GetInset(i);
string tmp_out;
inset->Linuxdoc(tmp_out);
- fprintf(file, "%s", tmp_out.c_str());
+ os << tmp_out;
}
else {
string sgml_string;
// char is ' '
if (desc_on == 1) {
char_line_count++;
- linux_doc_line_break(file, char_line_count, 6);
- fprintf(file, "</tag>");
+ linux_doc_line_break(os, char_line_count, 6);
+ os << "</tag>";
desc_on = 2;
}
else {
- linux_doc_line_break(file, char_line_count, 1);
- fprintf(file, "%c", c);
+ linux_doc_line_break(os, char_line_count, 1);
+ os << c;
}
}
else {
- fprintf(file, "%s", sgml_string.c_str());
+ os << sgml_string;
char_line_count += sgml_string.length();
}
}
}
/* pop all defined Styles */
- for (j = stack_num; j >= 0; j--) {
- linux_doc_line_break(file,
+ for (j = stack_num; j >= 0; --j) {
+ linux_doc_line_break(os,
char_line_count,
- 3+strlen(stack[j]));
- fprintf(file, "</%s>", stack[j]);
+ 3 + strlen(stack[j]));
+ os << "</" << stack[j] << ">";
}
/* resets description flag correctly */
switch(desc_on){
case 1:
/* <tag> not closed... */
- linux_doc_line_break(file, char_line_count, 6);
- fprintf(file, "</tag>");
+ linux_doc_line_break(os, char_line_count, 6);
+ os << "</tag>";
break;
case 2:
/* fprintf(file, "</p>");*/
int depth= 0; /* paragraph depth */
- FilePtr file(filename, FilePtr::write);
tex_code_break_column = column;
- if (!file()) {
+ ofstream ofs(filename.c_str());
+ if (!ofs) {
WriteAlert(_("LYX_ERROR:"), _("Cannot write file"), filename);
return;
}
//ResetTexRow();
texrow.reset();
- fprintf(file,
- "<!doctype %s public \"-//OASIS//DTD DocBook V3.1//EN\"",
- top_element.c_str());
+ ofs << "<!doctype " << top_element
+ << " public \"-//OASIS//DTD DocBook V3.1//EN\"";
if (params.preamble.empty())
- fprintf(file, ">\n\n");
+ ofs << ">\n\n";
else
- fprintf(file, "\n [ %s \n]>\n\n", params.preamble.c_str() );
+ ofs << "\n [ " << params.preamble << " \n]>\n\n";
string userName(getUserName());
- fprintf(file,
- "<!-- DocBook file was created by LyX 1.0 (C) 1995-1999\n");
- fprintf(file, "by <%s> %s -->\n", userName.c_str(), (char *)date());
+ ofs << "<!-- DocBook file was created by LyX 1.0 (C) 1995-1999\n"
+ << "by <" << userName << "> " << (char*)date() << " -->\n";
if(params.options.empty())
- sgmlOpenTag(file, 0, top_element);
+ sgmlOpenTag(ofs, 0, top_element);
else {
string top = top_element;
top += " ";
top += params.options;
- sgmlOpenTag(file, 0, top);
+ sgmlOpenTag(ofs, 0, top);
}
while (par) {
par->AutoDeleteInsets();
/* environment tag closing */
- for( ;depth > par->depth; depth--) {
+ for( ; depth > par->depth; --depth) {
if(environment_inner[depth] != "!-- --") {
item_name= "listitem";
- sgmlCloseTag(file, command_depth+depth,
+ sgmlCloseTag(ofs, command_depth + depth,
item_name);
if( environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs, depth+command_depth,
environment_inner[depth]);
}
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
environment_stack[depth]);
environment_stack[depth].clear();
environment_inner[depth].clear();
&& !environment_stack[depth].empty()) {
if(environment_inner[depth] != "!-- --") {
item_name= "listitem";
- sgmlCloseTag(file, command_depth+depth,
+ sgmlCloseTag(ofs, command_depth+depth,
item_name);
if( environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs,
+ depth + command_depth,
environment_inner[depth]);
}
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
environment_stack[depth]);
environment_stack[depth].clear();
switch(style.latextype) {
case LATEX_PARAGRAPH:
if(style.latexname() != "dummy")
- sgmlOpenTag(file, depth+command_depth,
+ sgmlOpenTag(ofs, depth+command_depth,
style.latexname());
break;
if(command_flag) {
if(cmd_depth<command_base) {
for(int j = command_depth;
- j >= command_base; j--)
+ j >= command_base; --j)
if(!command_stack[j].empty())
- sgmlCloseTag(file, j, command_stack[j]);
+ sgmlCloseTag(ofs, j, command_stack[j]);
command_depth= command_base= cmd_depth;
}
- else if(cmd_depth<= command_depth) {
- for(int j= command_depth;
- j >= cmd_depth; j--)
+ else if(cmd_depth <= command_depth) {
+ for(int j = command_depth;
+ j >= cmd_depth; --j)
if(!command_stack[j].empty())
- sgmlCloseTag(file, j, command_stack[j]);
+ sgmlCloseTag(ofs, j, command_stack[j]);
command_depth= cmd_depth;
}
else
// treat label as a special case for
// more WYSIWYM handling.
if (par->GetChar(0) == LyXParagraph::META_INSET) {
- Inset *inset = par->GetInset(0);
+ Inset * inset = par->GetInset(0);
char lyx_code = inset->LyxCode();
if (lyx_code == Inset::LABEL_CODE){
- command_name+= " id=\"";
- command_name+= ((InsetCommand *) inset)->getContents();
- command_name+= "\"";
- desc_on= 3;
+ command_name += " id=\"";
+ command_name += (static_cast<InsetCommand *>(inset))->getContents();
+ command_name += "\"";
+ desc_on = 3;
}
}
- sgmlOpenTag(file, depth+command_depth, command_name);
- item_name= "title";
- sgmlOpenTag(file, depth+1+command_depth, item_name);
+ sgmlOpenTag(ofs, depth+command_depth, command_name);
+ item_name = "title";
+ sgmlOpenTag(ofs, depth + 1 + command_depth, item_name);
break;
case LATEX_ENVIRONMENT:
}
if (environment_stack[depth] != style.latexname()) {
- environment_stack[depth]= style.latexname();
- environment_inner[depth]= "!-- --";
- sgmlOpenTag(file, depth + command_depth,
+ environment_stack[depth] = style.latexname();
+ environment_inner[depth] = "!-- --";
+ sgmlOpenTag(ofs, depth + command_depth,
environment_stack[depth]);
} else {
if(environment_inner[depth] != "!-- --") {
item_name= "listitem";
- sgmlCloseTag(file,
+ sgmlCloseTag(ofs,
command_depth + depth,
item_name);
if (environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file,
- depth+command_depth,
+ sgmlCloseTag(ofs,
+ depth + command_depth,
environment_inner[depth]);
}
}
if(style.latextype == LATEX_ENVIRONMENT) {
if(!style.latexparam().empty())
- sgmlOpenTag(file, depth+command_depth,
+ sgmlOpenTag(ofs, depth + command_depth,
style.latexparam());
break;
}
else
environment_inner[depth]= "listitem";
- sgmlOpenTag(file, depth+1+command_depth,
+ sgmlOpenTag(ofs, depth + 1 + command_depth,
environment_inner[depth]);
if(desc_on) {
item_name= "term";
- sgmlOpenTag(file, depth+1+command_depth,
+ sgmlOpenTag(ofs, depth + 1 + command_depth,
item_name);
}
else {
item_name= "para";
- sgmlOpenTag(file, depth+1+command_depth,
+ sgmlOpenTag(ofs, depth + 1 + command_depth,
item_name);
}
break;
default:
- sgmlOpenTag(file, depth + command_depth,
+ sgmlOpenTag(ofs, depth + command_depth,
style.latexname());
break;
}
string tmp_par, extra_par;
SimpleDocBookOnePar(tmp_par, extra_par, par, desc_on,
- depth+1+command_depth);
- fprintf(file, "%s", tmp_par.c_str());
+ depth + 1 + command_depth);
+ ofs << tmp_par;
par = par->next;
- DocBookHandleFootnote(file, par, depth+1+command_depth);
+ DocBookHandleFootnote(ofs, par,
+ depth + 1 + command_depth);
}
while(par && par->IsDummy());
switch(style.latextype) {
case LATEX_COMMAND:
end_tag = "title";
- sgmlCloseTag(file, depth + command_depth, end_tag);
+ sgmlCloseTag(ofs, depth + command_depth, end_tag);
break;
case LATEX_ENVIRONMENT:
if(!style.latexparam().empty())
- sgmlCloseTag(file, depth + command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
style.latexparam());
break;
case LATEX_ITEM_ENVIRONMENT:
if(desc_on == 1) break;
end_tag= "para";
- sgmlCloseTag(file, depth+1+command_depth, end_tag);
+ sgmlCloseTag(ofs, depth + 1 + command_depth, end_tag);
break;
case LATEX_PARAGRAPH:
if(style.latexname() != "dummy")
- sgmlCloseTag(file, depth + command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
style.latexname());
break;
default:
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
style.latexname());
break;
}
}
// Close open tags
- for(;depth>= 0;depth--) {
+ for(; depth >= 0; --depth) {
if(!environment_stack[depth].empty()) {
if(environment_inner[depth] != "!-- --") {
item_name= "listitem";
- sgmlCloseTag(file, command_depth+depth,
+ sgmlCloseTag(ofs, command_depth + depth,
item_name);
if( environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
environment_inner[depth]);
}
- sgmlCloseTag(file, depth+command_depth,
+ sgmlCloseTag(ofs, depth + command_depth,
environment_stack[depth]);
}
}
- for(int j= command_depth;j>= command_base;j--)
+ for(int j = command_depth; j >= command_base; --j)
if(!command_stack[j].empty())
- sgmlCloseTag(file, j, command_stack[j]);
+ sgmlCloseTag(ofs, j, command_stack[j]);
- fprintf(file, "\n\n");
- sgmlCloseTag(file, 0, top_element);
+ ofs << "\n\n";
+ sgmlCloseTag(ofs, 0, top_element);
- if (file.close()) {
- WriteFSAlert(_("Error! Could not close file properly:"),
- filename);
- }
+ ofs.close();
+ // How to check for successful close
}
}
-void Buffer::RoffAsciiTable(FILE * file, LyXParagraph * par)
+void Buffer::RoffAsciiTable(ostream & os, LyXParagraph * par)
{
- LyXFont
- font1 = LyXFont(LyXFont::ALL_INHERIT),
- font2;
+ LyXFont font1 = LyXFont(LyXFont::ALL_INHERIT);
+ LyXFont font2;
Inset * inset;
LyXParagraph::size_type i;
- int
- j,
- cell = 0;
- char
- c;
- FILE
- * fp, * fp2;
+ int j, cell = 0;
+ char c;
string fname1 = TmpFileName(string(), "RAT1");
string fname2 = TmpFileName(string(), "RAT2");
- if (!(fp= fopen(fname1.c_str(), "w"))) {
+
+ ofstream ofs(fname1.c_str());
+ if (!ofs) {
WriteAlert(_("LYX_ERROR:"),
_("Cannot open temporary file:"), fname1);
return;
}
- par->table->RoffEndOfCell(fp, -1);
+ par->table->RoffEndOfCell(ofs, -1);
for (i = 0; i < par->size(); ++i) {
c = par->GetChar(i);
if (par->table->IsContRow(cell)) {
switch (c) {
case LyXParagraph::META_INSET:
if ((inset = par->GetInset(i))) {
- if (!(fp2= fopen(fname2.c_str(), "w+"))) {
+ fstream fs(fname2.c_str(), ios::in|ios::out);
+ if (!fs) {
WriteAlert(_("LYX_ERROR:"),
_("Cannot open temporary file:"), fname2);
- fclose(fp);
+ ofs.close();
remove(fname1.c_str());
return;
}
- inset->Latex(fp2,-1);
- rewind(fp2);
- c = fgetc(fp2);
- while(!feof(fp2)) {
+ inset->Latex(fs, -1);
+ fs.seekp(0);
+ fs.get(c);
+ while(!fs) {
if (c == '\\')
- fprintf(fp, "\\\\");
+ ofs << "\\\\";
else
- fputc(c, fp);
- c = fgetc(fp2);
+ ofs << c;
+ fs >> c;
}
- fclose(fp2);
+ fs.close();
}
break;
case LyXParagraph::META_NEWLINE:
if (par->table->CellHasContRow(cell)>= 0)
- par->RoffContTableRows(fp, i+1, cell);
- par->table->RoffEndOfCell(fp, cell);
+ par->RoffContTableRows(ofs, i+1, cell);
+ par->table->RoffEndOfCell(ofs, cell);
cell++;
break;
case LyXParagraph::META_HFILL:
case LyXParagraph::META_PROTECTED_SEPARATOR:
break;
case '\\':
- fprintf(fp, "\\\\");
+ ofs << "\\\\";
break;
default:
if (c != '\0')
- fprintf(fp, "%c", c);
+ ofs << c;
else if (c == '\0')
lyxerr.debug()
<< "RoffAsciiTable:"
break;
}
}
- par->table->RoffEndOfCell(fp, cell);
- fclose(fp);
+ par->table->RoffEndOfCell(ofs, cell);
+ ofs.close();
string cmd = lyxrc->ascii_roff_command + " >" + fname2;
cmd = subst(cmd, "$$FName", fname1);
Systemcalls one(Systemcalls::System, cmd);
if (!(lyxerr.debugging(Debug::ROFF))) {
remove(fname1.c_str());
}
- if (!(fp= fopen(fname2.c_str(), "r"))) {
+ ifstream ifs(fname2.c_str());
+ if (!ifs) {
WriteFSAlert(_("Error! Can't open temporary file:"), fname2);
return;
}
// now output the produced file
- fprintf(file, "\n\n");
- c = fgetc(fp);
- if (feof(fp))
+ os << "\n\n";
+ ifs.get(c);
+ if (!ifs)
WriteAlert(_("Error!"),
_("Error executing *roff command on table"));
// overread leading blank lines
- while(!feof(fp) && (c == '\n'))
- c = fgetc(fp);
- while(!feof(fp)) {
- for(j= 0; j<par->depth; j++)
- fprintf(file, " ");
- while(!feof(fp) && (c != '\n')) {
- fputc(c, file);
- c = fgetc(fp);
- }
- fputc('\n', file);
+ while(!ifs && (c == '\n'))
+ ifs.get(c);
+ while(!ifs) {
+ for(j = 0; j < par->depth; ++j)
+ os << " ";
+ while(!ifs && (c != '\n')) {
+ os << c;
+ ifs.get(c);
+ }
+ os << '\n';
// overread trailing blank lines
- while(!feof(fp) && (c == '\n'))
- c = fgetc(fp);
+ while(!ifs && (c == '\n'))
+ ifs.get(c);
}
- fclose(fp);
+ ifs.close();
remove(fname2.c_str());
}
#include "lyxtext.h"
#include "support/filetools.h"
+
class LyXRC;
class TeXErrors;
class LaTeXFeatures;
dvi_clean_orgd = false;
nw_clean = false;
bak_clean = false;
- DEPCLEAN* tmp = dep_clean;
+ DEPCLEAN * tmp = dep_clean;
while (tmp) {
tmp->clean = false;
tmp = tmp->next;
private:
///
void insertErrors(TeXErrors &);
-
+
///
- void linuxDocHandleFootnote(FILE * file,
+ void linuxDocHandleFootnote(ostream & os,
LyXParagraph * & par, int const depth);
///
- void DocBookHandleCaption(FILE * file, string & inner_tag,
+ void DocBookHandleCaption(ostream & os, string & inner_tag,
int const depth, int desc_on,
LyXParagraph * &par);
///
- void DocBookHandleFootnote(FILE * file,
+ void DocBookHandleFootnote(ostream & os,
LyXParagraph * & par, int const depth);
///
- void sgmlOpenTag(FILE * file, int depth,
+ void sgmlOpenTag(ostream & os, int depth,
string const & latexname) const;
///
- void sgmlCloseTag(FILE * file, int depth,
+ void sgmlCloseTag(ostream & os, int depth,
string const & latexname) const;
///
void LinuxDocError(LyXParagraph * par, int pos, char const * message);
///
- void SimpleLinuxDocOnePar(FILE * file, LyXParagraph * par,
+ void SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
int desc_on, int const depth);
///
void SimpleDocBookOnePar(string & file, string & extra,
int const depth);
/// LinuxDoc.
- void push_tag(FILE * file, char const * tag,
+ void push_tag(ostream & os, char const * tag,
int & pos, char stack[5][3]);
/// LinuxDoc.
- void pop_tag(FILE * file, char const * tag,
+ void pop_tag(ostream & os, char const * tag,
int & pos, char stack[5][3]);
-
+
///
- void RoffAsciiTable(FILE * file, LyXParagraph * par);
+ void RoffAsciiTable(ostream &, LyXParagraph * par);
/// is save needed
bool lyx_clean;
}
-void BufferParams::writeFile(FILE * file)
+void BufferParams::writeFile(ostream & os)
{
// The top of the file is written by the buffer.
// Prints out the buffer info into the .lyx file given by file
// the textclass
- fprintf(file, "\\textclass %s\n",
- textclasslist.NameOfClass(textclass).c_str());
+ os << "\\textclass " << textclasslist.NameOfClass(textclass) << '\n';
// then the the preamble
if (!preamble.empty()) {
- fprintf(file, "\\begin_preamble\n");
- {
- // remove '\n' from the end of preamble
- preamble = strip(preamble, '\n');
-
- // write out the whole preamble in one go
- fwrite(preamble.c_str(),
- sizeof(char),
- preamble.length(),
- file);
- fprintf(file, "\n\\end_preamble\n");
- }
+ // remove '\n' from the end of preamble
+ preamble = strip(preamble, '\n');
+ os << "\\begin_preamble\n"
+ << preamble
+ << "\n\\end_preamble\n";
}
/* the options */
if (!options.empty()) {
- fprintf(file,
- "\\options %s\n",
- options.c_str());
+ os << "\\options " << options << '\n';
}
- /* then the text parameters */
- fprintf(file, "\\language %s\n", language.c_str());
- fprintf(file, "\\inputencoding %s\n", inputenc.c_str());
- fprintf(file, "\\fontscheme %s\n", fonts.c_str());
- fprintf(file, "\\graphics %s\n", graphicsDriver.c_str());
+ /* then the text parameters */
+ os << "\\language " << language
+ << "\n\\inputencoding " << inputenc
+ << "\n\\fontscheme " << fonts
+ << "\n\\graphics " << graphicsDriver << '\n';
if (!float_placement.empty()) {
- fprintf(file,
- "\\float_placement %s\n",
- float_placement.c_str());
+ os << "\\float_placement " << float_placement << '\n';
}
- fprintf(file, "\\paperfontsize %s\n", fontsize.c_str());
+ os << "\\paperfontsize " << fontsize << '\n';
- spacing.writeFile(file);
+ spacing.writeFile(os);
- fprintf(file, "\\papersize %s\n", string_papersize[papersize2]);
- fprintf(file, "\\paperpackage %s\n",
- string_paperpackages[paperpackage]);
- fprintf(file, "\\use_geometry %d\n", use_geometry);
- fprintf(file, "\\use_amsmath %d\n", use_amsmath);
- fprintf(file, "\\paperorientation %s\n",
- string_orientation[orientation]);
+ os << "\\papersize " << string_papersize[papersize2]
+ << "\n\\paperpackage " << string_paperpackages[paperpackage]
+ << "\n\\use_geometry " << use_geometry
+ << "\n\\use_amsmath " << use_amsmath
+ << "\n\\paperorientation " << string_orientation[orientation]
+ << '\n';
if (!paperwidth.empty())
- fprintf(file, "\\paperwidth %s\n",
- VSpace(paperwidth).asLyXCommand().c_str());
+ os << "\\paperwidth "
+ << VSpace(paperwidth).asLyXCommand() << '\n';
if (!paperheight.empty())
- fprintf(file, "\\paperheight %s\n",
- VSpace(paperheight).asLyXCommand().c_str());
+ os << "\\paperheight "
+ << VSpace(paperheight).asLyXCommand() << '\n';
if (!leftmargin.empty())
- fprintf(file, "\\leftmargin %s\n",
- VSpace(leftmargin).asLyXCommand().c_str());
+ os << "\\leftmargin "
+ << VSpace(leftmargin).asLyXCommand() << '\n';
if (!topmargin.empty())
- fprintf(file, "\\topmargin %s\n",
- VSpace(topmargin).asLyXCommand().c_str());
+ os << "\\topmargin "
+ << VSpace(topmargin).asLyXCommand() << '\n';
if (!rightmargin.empty())
- fprintf(file, "\\rightmargin %s\n",
- VSpace(rightmargin).asLyXCommand().c_str());
+ os << "\\rightmargin "
+ << VSpace(rightmargin).asLyXCommand() << '\n';
if (!bottommargin.empty())
- fprintf(file, "\\bottommargin %s\n",
- VSpace(bottommargin).asLyXCommand().c_str());
+ os << "\\bottommargin "
+ << VSpace(bottommargin).asLyXCommand() << '\n';
if (!headheight.empty())
- fprintf(file, "\\headheight %s\n",
- VSpace(headheight).asLyXCommand().c_str());
+ os << "\\headheight "
+ << VSpace(headheight).asLyXCommand() << '\n';
if (!headsep.empty())
- fprintf(file, "\\headsep %s\n",
- VSpace(headsep).asLyXCommand().c_str());
+ os << "\\headsep "
+ << VSpace(headsep).asLyXCommand() << '\n';
if (!footskip.empty())
- fprintf(file, "\\footskip %s\n",
- VSpace(footskip).asLyXCommand().c_str());
- fprintf(file, "\\secnumdepth %d\n", secnumdepth);
- fprintf(file, "\\tocdepth %d\n", tocdepth);
- fprintf(file, "\\paragraph_separation %s\n",
- string_paragraph_separation[paragraph_separation]);
- fprintf(file, "\\defskip %s\n", defskip.asLyXCommand().c_str());
- fprintf(file, "\\quotes_language %s\n",
- string_quotes_language[quotes_language]);
+ os << "\\footskip "
+ << VSpace(footskip).asLyXCommand() << '\n';
+ os << "\\secnumdepth " << secnumdepth
+ << "\n\\tocdepth " << tocdepth
+ << "\n\\paragraph_separation "
+ << string_paragraph_separation[paragraph_separation]
+ << "\n\\defskip " << defskip.asLyXCommand()
+ << "\n\\quotes_language "
+ << string_quotes_language[quotes_language] << '\n';
switch(quotes_times) {
- case InsetQuotes::SingleQ:
- fprintf(file, "\\quotes_times 1\n"); break;
+ // An output operator for insetquotes would be nice
+ case InsetQuotes::SingleQ:
+ os << "\\quotes_times 1\n"; break;
case InsetQuotes::DoubleQ:
- fprintf(file, "\\quotes_times 2\n"); break;
- }
- fprintf(file, "\\papercolumns %d\n", columns);
- fprintf(file, "\\papersides %d\n", sides);
- fprintf(file, "\\paperpagestyle %s\n", pagestyle.c_str());
+ os << "\\quotes_times 2\n"; break;
+ }
+ os << "\\papercolumns " << columns
+ << "\n\\papersides " << sides
+ << "\n\\paperpagestyle " << pagestyle << '\n';
for (int i = 0; i < 4; ++i) {
if (user_defined_bullets[i] != ITEMIZE_DEFAULTS[i]) {
if (user_defined_bullets[i].getFont() != -1) {
- fprintf(file, "\\bullet %d\n\t%d\n\t%d\n\t%d\n\\end_bullet\n",
- i,
- user_defined_bullets[i].getFont(),
- user_defined_bullets[i].getCharacter(),
- user_defined_bullets[i].getSize());
+ os << "\\bullet " << i
+ << "\n\t"
+ << user_defined_bullets[i].getFont()
+ << "\n\t"
+ << user_defined_bullets[i].getCharacter()
+ << "\n\t"
+ << user_defined_bullets[i].getSize()
+ << "\n\\end_bullet\n";
}
else {
- fprintf(file, "\\bulletLaTeX %d\n\t%s\n\\end_bullet\n",
- i,
- user_defined_bullets[i].c_str());
+ os << "\\bulletLaTeX " << i
+ << "\n\t"
+ << user_defined_bullets[i].c_str()
+ << "\n\\end_bullet\n";
}
}
}
#include "layout.h"
#include "support/block.h"
+
/**
This class contains all the parameters for this a buffer uses. Some
work needs to be done on this class to make it nice. Now everything
//@}
///
- void writeFile(FILE *);
-
+ void writeFile(ostream &);
///
void useClassDefaults();
}
-void InsetFig::Write(FILE * file)
+void InsetFig::Write(ostream & os)
{
Regenerate();
- fprintf(file, "Figure size %d %d\n", wid, hgh);
+ os << "Figure size " << wid << " " << hgh << "\n";
if (!fname.empty()) {
string buf1 = OnlyPath(owner->getFileName());
string fname2 = MakeRelPath(fname, buf1);
- fprintf(file, "file %s\n", fname2.c_str());
+ os << "file " << fname2 << "\n";
}
if (!subcaption.empty())
- fprintf(file, "subcaption %s\n", subcaption.c_str());
- if (wtype) fprintf(file, "width %d %g\n", wtype, xwid);
- if (htype) fprintf(file, "height %d %g\n", htype, xhgh);
- if (angle != 0) fprintf(file, "angle %g\n", angle);
- fprintf(file, "flags %d\n", flags);
- if (subfigure) fprintf(file, "subfigure\n");
+ os << "subcaption " << subcaption << "\n";
+ if (wtype) os << "width " << wtype << " " << xwid << "\n";
+ if (htype) os << "height " << htype << " " << xhgh << "\n";
+ if (angle != 0) os << "angle " << angle << "\n";
+ os << "flags " << flags << "\n";
+ if (subfigure) os << "subfigure\n";
}
}
-int InsetFig::Latex(FILE * file, signed char /* fragile*/ )
+int InsetFig::Latex(ostream & os, signed char /* fragile*/ )
{
Regenerate();
- if (!cmd.empty()) fprintf(file, "%s ", cmd.c_str());
+ if (!cmd.empty()) os << cmd << " ";
return 0;
}
#include "buffer.h"
#include "LString.h"
#include "LaTeXFeatures.h"
-
+#include "insets/lyxinset.h"
/* the rest is figure stuff */
+
struct Figref;
///
///
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
}
}
-FD_citation_form *create_form_citation_form(void)
+
+FD_citation_form * create_form_citation_form(void)
{
- FL_OBJECT *obj;
+ FL_OBJECT * obj;
FD_citation_form *fdui = (FD_citation_form *) fl_calloc(1, sizeof(FD_citation_form));
fdui->citation_form = fl_bgn_form(FL_NO_BOX, 220, 130);
}
/*---------------------------------------*/
-FD_bibitem_form *create_form_bibitem_form(void)
+FD_bibitem_form * create_form_bibitem_form(void)
{
- FL_OBJECT *obj;
+ FL_OBJECT * obj;
FD_bibitem_form *fdui = (FD_bibitem_form *) fl_calloc(1, sizeof(FD_bibitem_form));
fdui->bibitem_form = fl_bgn_form(FL_NO_BOX, 220, 130);
/*---------------------------------------*/
-InsetCitation::InsetCitation(string const & key, string const & note):
- InsetCommand("cite", key, note)
+InsetCitation::InsetCitation(string const & key, string const & note)
+ : InsetCommand("cite", key, note)
{
}
+
+
InsetCitation::~InsetCitation()
{
if(citation_form && citation_form->citation_form
}
-InsetBibKey::InsetBibKey(InsetBibKey const *b):
+InsetBibKey::InsetBibKey(InsetBibKey const * b):
InsetCommand("bibitem", b->contents, b->options)
{
counter = b->counter;
// as a LyX 2.x command, and lyxlex is not enough smart to understand
// real LaTeX commands. Yes, that could be fixed, but would be a waste
// of time cause LyX3 won't use lyxlex anyway. (ale)
-void InsetBibKey::Write(FILE * file)
+void InsetBibKey::Write(ostream & os)
{
string s;
if (!options.empty()) {
}
s += '{';
s += contents + '}';
- fprintf(file, "\\bibitem %s\n", s.c_str());
+ os << "\\bibitem " << s << "\n";
}
InsetBibtex::InsetBibtex(string const & dbase, string const & style,
- Buffer *o)
- :InsetCommand("BibTeX", dbase, style), owner(o)
+ Buffer * o)
+ : InsetCommand("BibTeX", dbase, style), owner(o)
{
}
}
-int InsetBibtex::Latex(FILE *file, signed char /*fragile*/)
+int InsetBibtex::Latex(ostream & os, signed char /*fragile*/)
{
string bib;
signed char dummy = 0;
int result = Latex(bib, dummy);
- fprintf(file, "%s", bib.c_str());
+ os << bib;
return result;
}
-int InsetBibtex::Latex(string &file, signed char /*fragile*/)
+int InsetBibtex::Latex(string & file, signed char /*fragile*/)
{
// this looks like an horrible hack and it is :) The problem
// is that owner is not initialized correctly when the bib
// If we generate in a temp dir, we might need to give an
// absolute path there. This is a bit complicated since we can
// have a comma-separated list of bibliographies
- string db_in, adb, db_out;
- db_in = getContents();
- db_in= split(db_in, adb, ',');
+ string adb, db_out;
+ string db_in = getContents();
+ db_in = split(db_in, adb, ',');
while(!adb.empty()) {
if (!owner->niceFile &&
IsFileReadable(MakeAbsPath(adb, owner->filepath)+".bib"))
void BibitemUpdate(Combox * combox)
{
combox->clear();
-
- if (!current_view->available())
- return;
-
+
+ if (!current_view->available()) return;
+
string tmp, bibkeys = current_view->buffer()->getBibkeyList(',');
bibkeys = split(bibkeys, tmp,',');
while (!tmp.empty()) {
- combox->addto(tmp.c_str());
- bibkeys = split(bibkeys, tmp,',');
+ combox->addto(tmp.c_str());
+ bibkeys = split(bibkeys, tmp,',');
}
}
class InsetCitation: public InsetCommand {
public:
///
- InsetCitation(): InsetCommand("cite") {}
+ InsetCitation() : InsetCommand("cite") {}
///
InsetCitation(string const & key, string const & note = string());
///
///
Inset * Clone() const { return new InsetBibKey(this); }
/// Currently \bibitem is used as a LyX2.x command, so we need this method.
- void Write(FILE *);
+ void Write(ostream &);
///
virtual string getScreenLabel() const;
///
class InsetBibtex: public InsetCommand {
public:
///
- InsetBibtex(): InsetCommand("BibTeX") { owner = 0; }
+ InsetBibtex() : InsetCommand("BibTeX") { owner = 0; }
///
InsetBibtex(string const & dbase, string const & style,
Buffer *);
///
void Edit(int, int);
///
- int Latex(FILE *, signed char);
+ int Latex(ostream &, signed char);
///
int Latex(string & file, signed char fragile);
///
// In lyxf3 this will be just LaTeX
-void InsetCommand::Write(FILE * file)
+void InsetCommand::Write(ostream & os)
{
- fprintf(file, "LatexCommand %s\n", getCommand().c_str());
+ os << "LatexCommand " << getCommand() << "\n";
}
}
-int InsetCommand::Latex(FILE * file, signed char /*fragile*/)
+int InsetCommand::Latex(ostream & os, signed char /*fragile*/)
{
- fprintf(file, "%s", getCommand().c_str());
+ os << getCommand();
return 0;
}
///
void Draw(LyXFont, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
/// Parse the command.
void scanCommand(string const & cmd);
/// Will not be used when lyxf3
void Read(LyXLex & lex);
///
- virtual int Latex(FILE * file, signed char fragile);
+ virtual int Latex(ostream &, signed char fragile);
///
virtual int Latex(string & file, signed char fragile);
///
form = 0;
}
+
InsetError::InsetError(string const & str)
: contents(str)
{
}
-void InsetError::Write(FILE *)
+void InsetError::Write(ostream &)
{
}
+
void InsetError::Read(LyXLex &)
{
}
-int InsetError::Latex(FILE *, signed char /*fragile*/)
+int InsetError::Latex(ostream &, signed char /*fragile*/)
{
return 0;
}
///
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
}
}
+
Inset * InsetInclude::Clone() const
{
InsetInclude * ii = new InsetInclude (contents, master);
return ii;
}
+
void InsetInclude::Edit(int, int)
{
if(current_view->buffer()->isReadonly())
}
-void InsetInclude::Write(FILE * file)
+void InsetInclude::Write(ostream & os)
{
- fprintf(file, "Include %s\n", getCommand().c_str());
+ os << "Include " << getCommand() << "\n";
}
}
-int InsetInclude::Latex(FILE * file, signed char /*fragile*/)
+int InsetInclude::Latex(ostream & os, signed char /*fragile*/)
{
string include_file;
signed char dummy = 0;
Latex(include_file, dummy);
- fprintf(file, "%s", include_file.c_str());
+ os << include_file;
return 0;
}
incfile += contents;
if (loadIfNeeded()) {
- Buffer *tmp = bufferlist.getBuffer(getFileName());
+ Buffer * tmp = bufferlist.getBuffer(getFileName());
if (tmp->params.textclass != master->params.textclass) {
lyxerr << "ERROR: Cannot handle include file `"
if (!master->tmppath.empty()
&& !master->niceFile) {
incfile = subst(incfile, '/','@');
- #ifdef __EMX__
+#ifdef __EMX__
incfile = subst(incfile, ':', '$');
- #endif
+#endif
writefile = AddName(master->tmppath, incfile);
} else
writefile = getFileName();
}
-int InsetInclude::GetNumberOfLabels() const {
+int InsetInclude::GetNumberOfLabels() const
+{
string label;
- int nl;
if (loadIfNeeded()) {
Buffer * tmp = bufferlist.getBuffer(getFileName());
label = tmp->getReferenceList('\n');
tmp->setParentName(getMasterFilename());
}
- nl = (label.empty())? 0: 1;
+ int nl = (label.empty())? 0: 1;
return nl;
}
return 1;
}
/// With lyx3 we won't overload these 3 methods
- void Write(FILE *);
+ void Write(ostream &);
///
void Read(LyXLex &);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
extern BufferView * current_view;
+
InsetInfo::InsetInfo()
{
form = 0;
}
-void InsetInfo::Write(FILE * file)
+void InsetInfo::Write(ostream & os)
{
- fprintf(file, "Info %s", contents.c_str());
+ os << "Info " << contents;
}
}
-int InsetInfo::Latex(FILE *, signed char /*fragile*/)
+int InsetInfo::Latex(ostream &, signed char /*fragile*/)
{
return 0;
}
///
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
return contents;
}
-int InsetLabel::Latex(FILE * file, signed char /*fragile*/)
+
+int InsetLabel::Latex(ostream & os, signed char /*fragile*/)
{
- fprintf(file, "%s", escape(getCommand()).c_str());
+ os << escape(getCommand());
return 0;
}
///
unsigned char Editable() const { return 0; }
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
InsetLatexAccent::InsetLatexAccent(InsetLatexAccent const & other)
- :contents(other.contents),
- candisp(other.candisp),
- modtype(other.modtype),
- remdot(other.remdot),
- plusasc(other.plusasc),
- plusdesc(other.plusdesc),
- ic(other.ic)
+ : contents(other.contents),
+ candisp(other.candisp),
+ modtype(other.modtype),
+ remdot(other.remdot),
+ plusasc(other.plusasc),
+ plusdesc(other.plusdesc),
+ ic(other.ic)
{}
for(string::size_type j = 4; j < contents.length(); ++j)
temp+= contents[j];
contents= temp;
- i++;
+ ++i;
remdot = true;
}
else
max = font.ascent(ic);
if (plusasc)
- max += (font.maxAscent()+3) / 3;
+ max += (font.maxAscent() + 3) / 3;
} else
- max = font.maxAscent()+4;
+ max = font.maxAscent() + 4;
return max;
}
}
-void InsetLatexAccent::Write(FILE * file)
+void InsetLatexAccent::Write(ostream & os)
{
- fprintf(file, "\\i %s\n", contents.c_str());
+ os << "\\i " << contents << "\n";
}
}
-int InsetLatexAccent::Latex(FILE * file, signed char /*fragile*/)
+int InsetLatexAccent::Latex(ostream & os, signed char /*fragile*/)
{
- fprintf(file, "%s", contents.c_str());
+ os << contents;
return 0;
}
///
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
extern BufferView * current_view;
-InsetParent::InsetParent(string fn, Buffer * owner): InsetCommand("lyxparent")
+InsetParent::InsetParent(string const & fn, Buffer * owner)
+ : InsetCommand("lyxparent")
{
- if (owner)
- setContents(MakeAbsPath(fn, OnlyPath(owner->getFileName())));
- else
- setContents(fn);
+ if (owner)
+ setContents(MakeAbsPath(fn, OnlyPath(owner->getFileName())));
+ else
+ setContents(fn);
}
+
void InsetParent::Edit(int, int)
{
- current_view->owner()->getLyXFunc()->Dispatch(LFUN_CHILDOPEN,
- getContents().c_str());
+ current_view->owner()->getLyXFunc()->Dispatch(LFUN_CHILDOPEN,
+ getContents().c_str());
}
+
// LaTeX must just ignore this command
-int InsetParent::Latex(FILE * file, signed char fragile)
+int InsetParent::Latex(ostream & os, signed char fragile)
{
- fprintf(file, "%%#{lyx}");
- InsetCommand::Latex(file, fragile);
- return 0;
+ os << "%%#{lyx}";
+ InsetCommand::Latex(os, fragile);
+ return 0;
}
+
// LaTeX must just ignore this command
int InsetParent::Latex(string & file, signed char fragile)
{
- file += "%%#{lyx}";
- InsetCommand::Latex(file, fragile);
- return 0;
+ file += "%%#{lyx}";
+ InsetCommand::Latex(file, fragile);
+ return 0;
}
/// Non-standard LyX macro
InsetParent() : InsetCommand("lyxparent") {}
///
- InsetParent(string fn, Buffer * owner = 0);
+ InsetParent(string const & fn, Buffer * owner = 0);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
static char const * const quote_char = ",'`<>";
// Index of chars used for the quote. Index is [side, language]
-int quote_index[2][6] =
-{ { 2, 1, 0, 0, 3, 4 }, // "'',,<>"
- { 1, 1, 2, 1, 4, 3 } }; // "`'`'><"
+int quote_index[2][6] = {
+ { 2, 1, 0, 0, 3, 4 }, // "'',,<>"
+ { 1, 1, 2, 1, 4, 3 } }; // "`'`'><"
// Corresponding LaTeX code, for double and single quotes.
static char const * const latex_quote_t1[2][5] =
ParseString(str);
}
+
InsetQuotes::InsetQuotes(InsetQuotes::quote_language l,
InsetQuotes::quote_side s,
InsetQuotes::quote_times t)
str = "eld";
}
- for (i= 0;i<6;i++) {
+ for (i = 0; i < 6; ++i) {
if (str[0] == language_char[i]) {
language = (InsetQuotes::quote_language)i;
break;
}
}
- if (i>= 6) {
+ if (i >= 6) {
lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
" bad language specification." << endl;
language = InsetQuotes::EnglishQ;
}
- for (i= 0;i<2;i++) {
+ for (i = 0; i < 2; ++i) {
if (str[1] == side_char[i]) {
side = (InsetQuotes::quote_side)i;
break;
}
}
- if (i>= 2) {
+ if (i >= 2) {
lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
" bad side specification." << endl;
side = InsetQuotes::LeftQ;
}
- for (i= 0;i<2;i++) {
+ for (i = 0; i < 2; ++i) {
if (str[2] == times_char[i]) {
times = (InsetQuotes::quote_times)i;
break;
}
}
- if (i>= 2) {
+ if (i >= 2) {
lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
" bad times specification." << endl;
times = InsetQuotes::DoubleQ;
}
}
+
string InsetQuotes::DispString() const
{
string disp;
}
-void InsetQuotes::Write(FILE * file)
+void InsetQuotes::Write(ostream & os)
{
string text;
text += language_char[language];
text += side_char[side];
text += times_char[times];
- fprintf(file, "Quotes %s", text.c_str());
+ os << "Quotes " << text;
}
}
-int InsetQuotes::Latex(FILE * file, signed char /*fragile*/)
+int InsetQuotes::Latex(ostream & os, signed char /*fragile*/)
{
string quote;
int res = Latex(quote, 0);
- fprintf(file, "%s", quote.c_str());
+ os << quote;
return res;
}
+
int InsetQuotes::Latex(string & file, signed char /*fragile*/)
{
string doclang =
///
LyXFont ConvertFont(LyXFont font);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
}
-InsetRef::~InsetRef()
-{
-}
-
-
void InsetRef::Edit(int, int)
{
current_view->owner()->getLyXFunc()
}
-int InsetRef::Latex(FILE * file, signed char /*fragile*/)
+int InsetRef::Latex(ostream & os, signed char /*fragile*/)
{
if(getOptions().empty())
- fprintf(file, "%s", escape(getCommand()).c_str());
+ os << escape(getCommand());
else {
string ns;
- InsetCommand clone = InsetCommand(getCmdName(), getContents(), ns);
- fprintf(file, "%s", escape(clone.getCommand()).c_str());
+ InsetCommand clone = InsetCommand(getCmdName(),
+ getContents(), ns);
+ os << escape(clone.getCommand());
}
return 0;
}
file += escape(getCommand());
else {
string ns;
- InsetCommand clone= InsetCommand(getCmdName(), getContents(), ns);
+ InsetCommand clone = InsetCommand(getCmdName(),
+ getContents(), ns);
file += escape(clone.getCommand());
}
return 0;
// This function escapes 8-bit characters and other problematic characters
// It's exactly the same code as in insetlabel.C.
-string InsetRef::escape(string const & lab) const {
+string InsetRef::escape(string const & lab) const
+{
char hexdigit[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
string enc;
InsetRef(string const &, Buffer *);
///
InsetRef(InsetCommand const &, Buffer *);
- ///
- ~InsetRef();
///
Inset * Clone() const {
return new InsetRef (getCommand(), master);
///
void gotoLabel();
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
// In lyxf3 this will be just LaTeX
-void InsetSpecialChar::Write(FILE * file)
+void InsetSpecialChar::Write(ostream & os)
{
string command;
switch (kind) {
case LDOTS: command = "\\ldots{}"; break;
case MENU_SEPARATOR: command = "\\menuseparator"; break;
}
- fprintf(file, "\\SpecialChar %s\n", command.c_str());
+ os << "\\SpecialChar " << command << "\n";
}
}
-int InsetSpecialChar::Latex(FILE * file, signed char /*fragile*/)
+int InsetSpecialChar::Latex(ostream & os, signed char /*fragile*/)
{
string command;
signed char dummy = 0;
Latex(command, dummy);
- fprintf(file, "%s", command.c_str());
+ os << command;
return 0;
}
///
void Draw(LyXFont, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
/// Will not be used when lyxf3
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
if (!fd_form_url) {
fd_form_url = create_form_form_url();
fd_form_url->button_close->u_vdata = this;
- fl_set_form_atclose(fd_form_url->form_url, CancelCloseBoxCB, 0);
+ fl_set_form_atclose(fd_form_url->form_url,
+ CancelCloseBoxCB, 0);
}
fl_set_input(fd_form_url->url_name, getContents().c_str());
fl_set_input(fd_form_url->name_name, getOptions().c_str());
}
-int InsetUrl::Latex(FILE * file, signed char fragile)
+int InsetUrl::Latex(ostream & os, signed char fragile)
{
string latex_output;
int res = Latex(latex_output, fragile);
- fprintf(file, "%s", latex_output.c_str());
+ os << latex_output;
return res;
}
-int InsetUrl::Latex(string &file, signed char fragile)
+int InsetUrl::Latex(string & file, signed char fragile)
{
if (!getOptions().empty())
file += getOptions() + ' ';
///
void gotoLabel();
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
#include "lyxlex.h"
#include "lyxscreen.h"
+
class Buffer;
struct LaTeXFeatures;
///
virtual bool AutoDelete() const;
///
- virtual void Write(FILE * file) = 0;
+ virtual void Write(ostream &) = 0;
///
virtual void Read(LyXLex & lex) = 0;
/** returns the number of rows (\n's) of generated tex code.
fragile != 0 means, that the inset should take care about
fragile commands by adding a \protect before.
*/
- virtual int Latex(FILE * file, signed char fragile) = 0;
+ virtual int Latex(ostream &, signed char fragile) = 0;
+ ///
virtual int Latex(string & file, signed char fragile) = 0;
///
virtual int Linuxdoc(string & /*file*/) = 0;
p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
}
+///
+inline ostream & operator<<(ostream & os, LyXTextClass::PageSides p)
+{
+ switch (p) {
+ case LyXTextClass::OneSide:
+ os << "1";
+ break;
+ case LyXTextClass::TwoSides:
+ os << "2";
+ break;
+ }
+ return os;
+}
///
class LyXTextClassList {
string const GUIFamilyNames[6] =
{ N_("Roman"), N_("Sans serif"), N_("Typewriter"), N_("Symbol"), N_("Inherit"),
- N_("Ignore") };
+ N_("Ignore") };
string const GUISeriesNames[4] =
{ N_("Medium"), N_("Bold"), N_("Inherit"), N_("Ignore") };
string const GUIShapeNames[6] =
{ N_("Upright"), N_("Italic"), N_("Slanted"), N_("Smallcaps"), N_("Inherit"),
- N_("Ignore") };
+ N_("Ignore") };
string const GUISizeNames[14] =
{ N_("Tiny"), N_("Smallest"), N_("Smaller"), N_("Small"), N_("Normal"), N_("Large"),
string const GUIColorNames[13] =
{ N_("None"), N_("Black"), N_("White"), N_("Red"), N_("Green"), N_("Blue"),
- N_("Cyan"), N_("Magenta"),
+ N_("Cyan"), N_("Magenta"),
N_("Yellow"), N_("Math"), N_("Inset"), N_("Inherit"), N_("Ignore") };
//
"yellow", "error12", "error13", "error14", "error15" };
/// Decreases font size by one
-LyXFont& LyXFont::decSize()
+LyXFont & LyXFont::decSize()
{
switch (size()) {
case SIZE_HUGER: setSize(SIZE_HUGE); break;
/// Increases font size by one
-LyXFont& LyXFont::incSize()
+LyXFont & LyXFont::incSize()
{
switch(size()) {
case SIZE_HUGER: break;
void LyXFont::update(LyXFont const & newfont, bool toggleall)
{
if(newfont.family() == family() && toggleall)
- setFamily(INHERIT_FAMILY); // toggle 'back'
+ setFamily(INHERIT_FAMILY); // toggle 'back'
else if (newfont.family() != IGNORE_FAMILY)
- setFamily(newfont.family());
+ setFamily(newfont.family());
// else it's IGNORE_SHAPE
// "Old" behaviour: "Setting" bold will toggle bold on/off.
}
if(newfont.shape() == shape() && toggleall)
- setShape(INHERIT_SHAPE); // toggle 'back'
+ setShape(INHERIT_SHAPE); // toggle 'back'
else if (newfont.shape() != IGNORE_SHAPE)
- setShape(newfont.shape());
+ setShape(newfont.shape());
// else it's IGNORE_SHAPE
if (newfont.size() != IGNORE_SIZE) {
setLatex(setMisc(newfont.latex(), latex()));
if(newfont.color() == color() && toggleall)
- setColor(INHERIT_COLOR); // toggle 'back'
+ setColor(INHERIT_COLOR); // toggle 'back'
else if (newfont.color() != IGNORE_COLOR)
- setColor(newfont.color());
+ setColor(newfont.color());
}
}
if ((bits & (Fam_Mask<<Fam_Pos)) == (ui32(INHERIT_FAMILY)<<Fam_Pos))
- {
- bits &= ~(Fam_Mask << Fam_Pos);
- bits |= (tmplt.bits & Fam_Mask << Fam_Pos);
- }
+ {
+ bits &= ~(Fam_Mask << Fam_Pos);
+ bits |= (tmplt.bits & Fam_Mask << Fam_Pos);
+ }
if ((bits & (Ser_Mask<<Ser_Pos)) == (ui32(INHERIT_SERIES)<<Ser_Pos))
- {
- bits &= ~(Ser_Mask << Ser_Pos);
- bits |= (tmplt.bits & Ser_Mask << Ser_Pos);
- }
+ {
+ bits &= ~(Ser_Mask << Ser_Pos);
+ bits |= (tmplt.bits & Ser_Mask << Ser_Pos);
+ }
if ((bits & (Sha_Mask << Sha_Pos)) == ui32(INHERIT_SHAPE) << Sha_Pos)
- {
- bits &= ~(Sha_Mask << Sha_Pos);
- bits |= (tmplt.bits & Sha_Mask << Sha_Pos);
- }
+ {
+ bits &= ~(Sha_Mask << Sha_Pos);
+ bits |= (tmplt.bits & Sha_Mask << Sha_Pos);
+ }
if ((bits & (Siz_Mask << Siz_Pos)) == ui32(INHERIT_SIZE) << Siz_Pos)
- {
- bits &= ~(Siz_Mask << Siz_Pos);
- bits |= (tmplt.bits & Siz_Mask << Siz_Pos);
- }
+ {
+ bits &= ~(Siz_Mask << Siz_Pos);
+ bits |= (tmplt.bits & Siz_Mask << Siz_Pos);
+ }
if ((bits & (Misc_Mask << Emp_Pos)) == ui32(INHERIT) << Emp_Pos)
- {
- bits &= ~(Misc_Mask << Emp_Pos);
- bits |= (tmplt.bits & Misc_Mask << Emp_Pos);
- }
+ {
+ bits &= ~(Misc_Mask << Emp_Pos);
+ bits |= (tmplt.bits & Misc_Mask << Emp_Pos);
+ }
if ((bits & (Misc_Mask << Und_Pos)) == ui32(INHERIT) << Und_Pos)
- {
- bits &= ~(Misc_Mask << Und_Pos);
- bits |= (tmplt.bits & Misc_Mask << Und_Pos);
- }
+ {
+ bits &= ~(Misc_Mask << Und_Pos);
+ bits |= (tmplt.bits & Misc_Mask << Und_Pos);
+ }
if ((bits & (Misc_Mask << Nou_Pos)) == ui32(INHERIT) << Nou_Pos)
- {
- bits &= ~(Misc_Mask << Nou_Pos);
- bits |= (tmplt.bits & Misc_Mask << Nou_Pos);
- }
+ {
+ bits &= ~(Misc_Mask << Nou_Pos);
+ bits |= (tmplt.bits & Misc_Mask << Nou_Pos);
+ }
if ((bits & (Misc_Mask << Lat_Pos)) == ui32(INHERIT) << Lat_Pos)
- {
- bits &= ~(Misc_Mask << Lat_Pos);
- bits |= (tmplt.bits & Misc_Mask << Lat_Pos);
- }
+ {
+ bits &= ~(Misc_Mask << Lat_Pos);
+ bits |= (tmplt.bits & Misc_Mask << Lat_Pos);
+ }
if ((bits & (Col_Mask << Col_Pos)) == ui32(INHERIT_COLOR) << Col_Pos)
- {
- bits &= ~(Col_Mask << Col_Pos);
- bits |= (tmplt.bits & Col_Mask << Col_Pos);
- }
+ {
+ bits &= ~(Col_Mask << Col_Pos);
+ bits |= (tmplt.bits & Col_Mask << Col_Pos);
+ }
return *this;
}
color() != INHERIT_COLOR);
}
+
/// Build GUI description of font state
string LyXFont::stateText() const
{
// Set family according to lyx format string
-LyXFont& LyXFont::setLyXFamily(string const & fam)
+LyXFont & LyXFont::setLyXFamily(string const & fam)
{
string s = lowercase(fam);
// Set series according to lyx format string
-LyXFont& LyXFont::setLyXSeries(string const & ser)
+LyXFont & LyXFont::setLyXSeries(string const & ser)
{
string s = lowercase(ser);
// Set shape according to lyx format string
-LyXFont& LyXFont::setLyXShape(string const & sha)
+LyXFont & LyXFont::setLyXShape(string const & sha)
{
string s = lowercase(sha);
// Set size according to lyx format string
-LyXFont& LyXFont::setLyXSize(string const & siz)
+LyXFont & LyXFont::setLyXSize(string const & siz)
{
string s = lowercase(siz);
int i= 0;
}
/// Sets color after LyX text format
-LyXFont& LyXFont::setLyXColor(string const & col)
+LyXFont & LyXFont::setLyXColor(string const & col)
{
string s = lowercase(col);
int i= 0;
/// Sets size after GUI name
-LyXFont& LyXFont::setGUISize(string const & siz)
+LyXFont & LyXFont::setGUISize(string const & siz)
{
string s = lowercase(siz);
int i= 0;
while (!lGUISizeNames[i].empty() &&
s != _(lGUISizeNames[i].c_str()))
- i++;
+ i++;
if (s == _(lGUISizeNames[i].c_str())) {
setSize(LyXFont::FONT_SIZE(i));
} else
/// Writes the changes from this font to orgfont in .lyx format in file
-void LyXFont::lyxWriteChanges(LyXFont const & orgfont, FILE * file) const
+void LyXFont::lyxWriteChanges(LyXFont const & orgfont, ostream & os) const
{
- fprintf(file, "\n");
+ os << "\n";
if (orgfont.family() != family()) {
- fprintf(file, "\\family %s \n",
- LyXFamilyNames[family()].c_str());
+ os << "\\family " << LyXFamilyNames[family()] << " \n";
}
if (orgfont.series() != series()) {
- fprintf(file, "\\series %s \n",
- LyXSeriesNames[series()].c_str());
+ os << "\\series " << LyXSeriesNames[series()] << " \n";
}
if (orgfont.shape() != shape()) {
- fprintf(file, "\\shape %s \n", LyXShapeNames[shape()].c_str());
+ os << "\\shape " << LyXShapeNames[shape()] << " \n";
}
if (orgfont.size() != size()) {
- fprintf(file, "\\size %s \n", LyXSizeNames[size()].c_str());
+ os << "\\size " << LyXSizeNames[size()] << " \n";
}
if (orgfont.emph() != emph()) {
- fprintf(file, "\\emph %s \n", LyXMiscNames[emph()].c_str());
+ os << "\\emph " << LyXMiscNames[emph()] << " \n";
}
if (orgfont.underbar() != underbar()) {
// This is only for backwards compatibility
switch (underbar()) {
- case OFF: fprintf(file, "\\bar no \n"); break;
- case ON: fprintf(file, "\\bar under \n"); break;
+ case OFF: os << "\\bar no \n"; break;
+ case ON: os << "\\bar under \n"; break;
case TOGGLE: lyxerr << "LyXFont::lyxWriteFontChanges: "
"TOGGLE should not appear here!"
<< endl;
- break;
- case INHERIT: fprintf(file, "\\bar default \n"); break;
+ break;
+ case INHERIT: os << "\\bar default \n"; break;
case IGNORE: lyxerr << "LyXFont::lyxWriteFontChanges: "
"IGNORE should not appear here!"
<< endl;
- break;
+ break;
}
}
if (orgfont.noun() != noun()) {
- fprintf(file, "\\noun %s \n", LyXMiscNames[noun()].c_str());
+ os << "\\noun " << LyXMiscNames[noun()] << " \n";
}
if (orgfont.latex() != latex()) {
// This is only for backwards compatibility
switch (latex()) {
- case OFF: fprintf(file, "\\latex no_latex \n"); break;
- case ON: fprintf(file, "\\latex latex \n"); break;
+ case OFF: os << "\\latex no_latex \n"; break;
+ case ON: os << "\\latex latex \n"; break;
case TOGGLE: lyxerr << "LyXFont::lyxWriteFontChanges: "
"TOGGLE should not appear here!"
<< endl;
- break;
- case INHERIT: fprintf(file, "\\latex default \n"); break;
+ break;
+ case INHERIT: os << "\\latex default \n"; break;
case IGNORE: lyxerr << "LyXFont::lyxWriteFontChanges: "
"IGNORE should not appear here!"
<< endl;
- break;
+ break;
}
}
if (orgfont.color() != color()) {
- fprintf(file, "\\color %s\n", LyXColorNames[color()].c_str());
+ os << "\\color " << LyXColorNames[color()] << "\n";
}
}
-/// Writes the head of the LaTeX needed to impose this font
-// Returns number of chars written.
-int LyXFont::latexWriteStartChanges(FILE * file, LyXFont const & base) const
-{
- string font;
- int count = latexWriteStartChanges(font, base);
- fprintf(file, "%s", font.c_str());
- return count;
-}
-
-
/// Writes the head of the LaTeX needed to impose this font
// Returns number of chars written.
int LyXFont::latexWriteStartChanges(string & file, LyXFont const & base) const
}
-/// Writes ending block of LaTeX needed to close use of this font
-// Returns number of chars written
-// This one corresponds to latexWriteStartChanges(). (Asger)
-int LyXFont::latexWriteEndChanges(FILE * file, LyXFont const & base) const
-{
- string ending;
- int count = latexWriteEndChanges(ending, base);
- fprintf(file, "%s", ending.c_str());
- return count;
-}
-
-
/// Writes ending block of LaTeX needed to close use of this font
// Returns number of chars written
// This one corresponds to latexWriteStartChanges(). (Asger)
}
-XFontStruct* LyXFont::getXFontstruct() const
+XFontStruct * LyXFont::getXFontstruct() const
{
return fontloader.load(family(), series(), realShape(), size());
}
int LyXFont::ascent(char c) const
{
- XFontStruct *finfo = getXFontstruct();
+ XFontStruct * finfo = getXFontstruct();
if (finfo->per_char
&& c >= static_cast<char>(finfo->min_char_or_byte2)
&& c <= static_cast<char>(finfo->max_char_or_byte2)) {
int LyXFont::descent(char c) const
{
- XFontStruct *finfo = getXFontstruct();
+ XFontStruct * finfo = getXFontstruct();
if (finfo->per_char
&& c >= static_cast<char>(finfo->min_char_or_byte2)
&& c <= static_cast<char>(finfo->max_char_or_byte2)) {
}
-int LyXFont::textWidth(char const *s, int n) const
+int LyXFont::textWidth(char const * s, int n) const
{
if (realShape() != LyXFont::SMALLCAPS_SHAPE){
return XTextWidth(getXFontstruct(), s, n);
return textWidth(s.c_str(), s.length());
}
+
int LyXFont::signedStringWidth(string const & s) const
{
if (s.empty()) return 0;
if (s.c_str()[0] == '-')
- return -textWidth(s.c_str()+1, s.length()-1);
+ return -textWidth(s.c_str()+1, s.length()-1);
else
- return textWidth(s.c_str(), s.length());
+ return textWidth(s.c_str(), s.length());
}
-int LyXFont::drawText(char const* s, int n, Pixmap pm,
- int baseline, int x) const
+int LyXFont::drawText(char const * s, int n, Pixmap pm,
+ int baseline, int x) const
{
if (realShape() != LyXFont::SMALLCAPS_SHAPE) {
XDrawString(fl_display,
smallfont.getGC(),
x, baseline,
&c, 1);
- x += XTextWidth(smallfont.getXFontstruct(), &c, 1);
+ x += XTextWidth(smallfont.getXFontstruct(),
+ &c, 1);
XFlush(fl_display);
} else {
XDrawString(fl_display,
}
-int LyXFont::drawString(string const &s, Pixmap pm, int baseline, int x) const
+int LyXFont::drawString(string const & s, Pixmap pm, int baseline, int x) const
{
return drawText(s.c_str(), s.length(), pm, baseline, x);
}
-bool LyXFont::equalExceptLatex(LyXFont const &f) const
+bool LyXFont::equalExceptLatex(LyXFont const & f) const
{
LyXFont f1 = *this;
f1.setLatex(f.latex());
return f1 == f;
}
+
ostream & operator<<(ostream & o, LyXFont::FONT_MISC_STATE fms)
{
return o << int(fms);
#include "LString.h"
#include "debug.h"
+
// It might happen that locale.h defines ON and OFF. This is not good
// for us, since we use these names below. But of course this is due
// to some old compilers. Than is broken when it comes to C++ scoping.
LyXFont & lyxRead(LyXLex&);
/// Writes the changes from this font to orgfont in .lyx format in file
- void lyxWriteChanges(LyXFont const & orgfont, FILE *) const;
-
- /** Writes the head of the LaTeX needed to change to this font.
- Writes to file, the head of the LaTeX needed to change to this font.
- Returns number of chars written. Base is the font state active now.
- */
- int latexWriteStartChanges(FILE *, LyXFont const & base) const;
+ void lyxWriteChanges(LyXFont const & orgfont, ostream &) const;
- /** Writes to string, the head of the LaTeX needed to change
- to this font. Returns number of chars written. Base is the
- font state active now.
+ /** Writes the head of the LaTeX needed to change to this font.
+ Writes to string, the head of the LaTeX needed to change
+ to this font. Returns number of chars written. Base is the
+ font state active now.
*/
int latexWriteStartChanges(string &, LyXFont const & base) const;
- /** Writes the tail of the LaTeX needd to change to this font.
- Returns number of chars written. Base is the font state we want
- to achieve.
- */
- int latexWriteEndChanges(FILE *, LyXFont const & base) const;
-
/** Writes tha tail of the LaTeX needed to chagne to this font.
Returns number of chars written. Base is the font state we want
to achieve.
~LyXParagraph();
///
- void writeFile(FILE *, BufferParams &, char, char);
-
+ void writeFile(ostream &, BufferParams &, char, char);
///
void validate(LaTeXFeatures &);
///
void UnsetPExtraType();
///
- bool RoffContTableRows(FILE * file, size_type i,
- int actcell);
+ bool RoffContTableRows(ostream &, size_type i, int actcell);
///
void DocBookContTableRows(string & file, string & extra, int & desc_on,
size_type i,
#include "LaTeXFeatures.h"
#include "debug.h"
#include "lyx_gui_misc.h"
+#include "support/LOstream.h"
extern void UpdateInset(Inset * inset, bool mark_dirty = true);
extern void LockedInsetStoreUndo(Undo::undo_kind);
}
-void InsetFormula::Write(FILE * file)
+void InsetFormula::Write(ostream & os)
{
- fprintf(file, "Formula ");
- Latex(file, 0);
+ os << "Formula ";
+ Latex(os, 0);
}
-int InsetFormula::Latex(FILE * file, signed char fragile)
+int InsetFormula::Latex(ostream & os, signed char fragile)
{
int ret = 0;
//#warning Alejandro, the number of lines is not returned in this case
// This problem will disapear at 0.13.
string output;
InsetFormula::Latex(output, fragile);
- fprintf(file, "%s", output.c_str());
+ os << output;
return ret;
}
// extern char *dispatch_result;
MathedTextCodes varcode = LM_TC_MIN;
bool was_macro = mathcursor->InMacroMode();
- bool sel= false;
+ bool sel = false;
bool space_on = false;
bool was_selection = mathcursor->Selection();
bool result = true;
#endif
#include "insets/lyxinset.h"
-
+#include "support/LOstream.h"
class MathParInset;
class MathedCursor;
///
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Read(LyXLex & lex);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream &, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
#include "gettext.h"
-InsetFormulaMacro::InsetFormulaMacro():
- InsetFormula(true)
+InsetFormulaMacro::InsetFormulaMacro()
+ : InsetFormula(true)
{
tmacro = 0;
opened = false;
}
-InsetFormulaMacro::InsetFormulaMacro(string nm, int na, bool /*e*/):
- InsetFormula(true), name(nm)
+InsetFormulaMacro::InsetFormulaMacro(string nm, int na, bool /*e*/)
+ : InsetFormula(true), name(nm)
{
tmacro = MathMacroTable::mathMTable.getTemplate(name.c_str());
if (!tmacro) {
}
-void InsetFormulaMacro::Write(FILE *file)
+void InsetFormulaMacro::Write(ostream & os)
{
- fprintf(file, "FormulaMacro ");
- Latex(file, 0);
+ os << "FormulaMacro ";
+ Latex(os, 0);
}
-int InsetFormulaMacro::Latex(FILE *file, signed char /*fragile*/)
+int InsetFormulaMacro::Latex(ostream & os, signed char /*fragile*/)
{
int ret = 1;
- tmacro->WriteDef(file);
+ tmacro->WriteDef(os);
return ret;
}
}
-void InsetFormulaMacro::Read(LyXLex &lex)
+void InsetFormulaMacro::Read(LyXLex & lex)
{
- FILE *file = lex.getFile();
+ FILE * file = lex.getFile();
mathed_parser_file(file, lex.GetLineNo());
mathed_parse(0, 0, (MathParInset **)&tmacro);
}
-int InsetFormulaMacro::Ascent(LyXFont const &f) const
+int InsetFormulaMacro::Ascent(LyXFont const & f) const
{
if (opened) {
tmacro->update();
}
-int InsetFormulaMacro::Descent(LyXFont const &f) const
+int InsetFormulaMacro::Descent(LyXFont const & f) const
{
if (opened) {
tmacro->update();
}
-int InsetFormulaMacro::Width(LyXFont const &f) const
+int InsetFormulaMacro::Width(LyXFont const & f) const
{
if (opened) {
tmacro->update();
}
-void InsetFormulaMacro::Draw(LyXFont font, LyXScreen &scr,
- int baseline, float &x)
+void InsetFormulaMacro::Draw(LyXFont font, LyXScreen & scr,
+ int baseline, float & x)
{
tmacro->update();
if (opened) {
} else {
font.setColor(LyXFont::MATH);
- int y= baseline - Ascent(font)+1;
- int w= Width(font) - 2, h= (Ascent(font)+Descent(font)-2);
+ int y = baseline - Ascent(font) + 1;
+ int w = Width(font) - 2, h = (Ascent(font) + Descent(font) - 2);
scr.fillRectangle(gc_lighted, int(x), y, w, h);
}
-bool InsetFormulaMacro::LocalDispatch(int action, char const *arg)
+bool InsetFormulaMacro::LocalDispatch(int action, char const * arg)
{
if (action == LFUN_MATH_MACROARG) {
int i = atoi(arg) - 1;
///
void Read(LyXLex & lex);
///
- void Write(FILE * file);
+ void Write(ostream & os);
///
- int Latex(FILE * file, signed char fragile);
+ int Latex(ostream & os, signed char fragile);
///
int Latex(string & file, signed char fragile);
///
void Edit(int x, int y);
///
void InsetUnlock();
-
+ ///
bool LocalDispatch(int, char const *);
-
protected:
+ ///
void UpdateLocal();
private:
+ ///
bool opened;
- string name;
- class MathMacroTemplate * tmacro;
-
+ ///
+ string name;
+ ///
+ MathMacroTemplate * tmacro;
};
-
#endif
-
#include "array.h"
+
///
enum math_align {
///
/// Standard Math Sizes (Math mode styles)
enum MathedStyles {
///
- LM_ST_DISPLAY = 0,
- ///
- LM_ST_TEXT,
- ///
- LM_ST_SCRIPT,
- ///
- LM_ST_SCRIPTSCRIPT
+ LM_ST_DISPLAY = 0,
+ ///
+ LM_ST_TEXT,
+ ///
+ LM_ST_SCRIPT,
+ ///
+ LM_ST_SCRIPTSCRIPT
};
/// Standard LaTeX Math Environments
enum MathedEnvironment {
///
- LM_EN_INTEXT = 0,
- ///
- LM_EN_DISPLAY,
- ///
- LM_EN_EQUATION,
- ///
- LM_EN_EQNARRAYAST,
- ///
- LM_EN_EQNARRAY,
- ///
- LM_EN_ARRAY
+ LM_EN_INTEXT = 0,
+ ///
+ LM_EN_DISPLAY,
+ ///
+ LM_EN_EQUATION,
+ ///
+ LM_EN_EQNARRAYAST,
+ ///
+ LM_EN_EQNARRAY,
+ ///
+ LM_EN_ARRAY
};
/** The restrictions of a standard LaTeX math paragraph
allows to get a small number of text codes (<30) */
enum MathedTextCodes {
- /// This must be >= 0
- LM_TC_MIN = 0,
- /// Open and Close group
- LM_TC_OPEN,
- ///
- LM_TC_CLOSE,
- /// Tabulator
- LM_TC_TAB,
- /// New line
- LM_TC_CR,
- /// Math Inset
- LM_TC_INSET,
- /// Super and sub scripts
- LM_TC_UP,
- ///
- LM_TC_DOWN,
- /// Editable Math Inset
- LM_TC_ACTIVE_INSET,
- /// Editable Text Inset
- LM_TC_TEXT_INSET,
- ///
- LM_FONT_BEGIN,
- /// Internal code for constants
- LM_TC_CONST,
- /// Internal code for variables
- LM_TC_VAR,
- ///
- LM_TC_RM,
- ///
- LM_TC_CAL,
- ///
- LM_TC_BF,
- ///
- LM_TC_SF,
- ///
- LM_TC_TT,
- ///
- LM_TC_IT,
- ///
- LM_TC_TEXTRM,
- /// Math mode TeX characters ",;:{}"
- LM_TC_TEX,
- /// Special characters "{}&#_%"
- LM_TC_SPECIAL,
- /// Internal code for operators
- LM_TC_BOP,
- /// Internal code for symbols
- LM_TC_SYMB,
- ///
- LM_TC_BOPS,
- ///
- LM_TC_BSYM,
- ///
- LM_FONT_END,
-
- /// This must be < 32
- LM_TC_MAX
+ /// This must be >= 0
+ LM_TC_MIN = 0,
+ /// Open and Close group
+ LM_TC_OPEN,
+ ///
+ LM_TC_CLOSE,
+ /// Tabulator
+ LM_TC_TAB,
+ /// New line
+ LM_TC_CR,
+ /// Math Inset
+ LM_TC_INSET,
+ /// Super and sub scripts
+ LM_TC_UP,
+ ///
+ LM_TC_DOWN,
+ /// Editable Math Inset
+ LM_TC_ACTIVE_INSET,
+ /// Editable Text Inset
+ LM_TC_TEXT_INSET,
+ ///
+ LM_FONT_BEGIN,
+ /// Internal code for constants
+ LM_TC_CONST,
+ /// Internal code for variables
+ LM_TC_VAR,
+ ///
+ LM_TC_RM,
+ ///
+ LM_TC_CAL,
+ ///
+ LM_TC_BF,
+ ///
+ LM_TC_SF,
+ ///
+ LM_TC_TT,
+ ///
+ LM_TC_IT,
+ ///
+ LM_TC_TEXTRM,
+ /// Math mode TeX characters ",;:{}"
+ LM_TC_TEX,
+ /// Special characters "{}&#_%"
+ LM_TC_SPECIAL,
+ /// Internal code for operators
+ LM_TC_BOP,
+ /// Internal code for symbols
+ LM_TC_SYMB,
+ ///
+ LM_TC_BOPS,
+ ///
+ LM_TC_BSYM,
+ ///
+ LM_FONT_END,
+
+ /// This must be < 32
+ LM_TC_MAX
};
ostream & operator<<(ostream &, MathedTextCodes mtc);
/// Types of lyx-math insets
enum MathedInsetTypes {
- ///
- LM_OT_MIN = 0,
- /// A simple paragraph
- LM_OT_PAR,
- /// A simple numbered paragraph
- LM_OT_PARN,
- /// A multiline paragraph
- LM_OT_MPAR,
- /// A multiline numbered paragraph
- LM_OT_MPARN,
- /// An array
- LM_OT_MATRIX,
- /// A big operator
- LM_OT_BIGOP,
- /// A LaTeX macro
- LM_OT_UNDEF,
- ///
- LM_OT_FUNC,
- ///
- LM_OT_FUNCLIM,
- ///
- LM_OT_SCRIPT,
- ///
- LM_OT_SPACE,
- ///
- LM_OT_DOTS,
- /// A fraction
- LM_OT_FRAC,
- ///
- LM_OT_ATOP,
- ///
- LM_OT_STACKREL,
- /// A radical
- LM_OT_SQRT,
- /// A delimiter
- LM_OT_DELIM,
- /// A decoration
- LM_OT_DECO,
- /// An accent
- LM_OT_ACCENT,
- ///
- LM_OT_MACRO,
- ///
- LM_OT_MACRO_ARG,
- ///
- LM_OT_MAX
+ ///
+ LM_OT_MIN = 0,
+ /// A simple paragraph
+ LM_OT_PAR,
+ /// A simple numbered paragraph
+ LM_OT_PARN,
+ /// A multiline paragraph
+ LM_OT_MPAR,
+ /// A multiline numbered paragraph
+ LM_OT_MPARN,
+ /// An array
+ LM_OT_MATRIX,
+ /// A big operator
+ LM_OT_BIGOP,
+ /// A LaTeX macro
+ LM_OT_UNDEF,
+ ///
+ LM_OT_FUNC,
+ ///
+ LM_OT_FUNCLIM,
+ ///
+ LM_OT_SCRIPT,
+ ///
+ LM_OT_SPACE,
+ ///
+ LM_OT_DOTS,
+ /// A fraction
+ LM_OT_FRAC,
+ ///
+ LM_OT_ATOP,
+ ///
+ LM_OT_STACKREL,
+ /// A radical
+ LM_OT_SQRT,
+ /// A delimiter
+ LM_OT_DELIM,
+ /// A decoration
+ LM_OT_DECO,
+ /// An accent
+ LM_OT_ACCENT,
+ ///
+ LM_OT_MACRO,
+ ///
+ LM_OT_MACRO_ARG,
+ ///
+ LM_OT_MAX
};
///
enum MathedBinaryTypes {
///
- LMB_NONE = 0,
- ///
- LMB_RELATION,
- ///
- LMB_OPERATOR,
- ///
- LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
+ LMB_NONE = 0,
+ ///
+ LMB_RELATION,
+ ///
+ LMB_OPERATOR,
+ ///
+ LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
};
-class MathedInset;
class MathParInset;
-
/** Abstract base class for all math objects.
A math insets is for use of the math editor only, it isn't a
general LyX inset. It's used to represent all the math objects.
/// Draw the object
virtual void Draw(int x, int baseline) = 0;
-
+
/// Write LaTeX and Lyx code
- virtual void Write(FILE * file) = 0;
+ virtual void Write(ostream &) = 0;
+
/// Write LaTeX and Lyx code
virtual void Write(string & file) = 0;
/// Paragraph permissions
enum MathedParFlag {
- LMPF_BASIC = 0,
- /// If false can use a non-standard size
- LMPF_FIXED_SIZE = 1,
- /// If true can insert newlines
- LMPF_ALLOW_CR = 2,
- /// If true can use tabs
- LMPF_ALLOW_TAB = 4,
- /// If true can insert new columns
- LMPF_ALLOW_NEW_COL = 8,
- /// Smaller than current size (frac)
- LMPF_SMALLER = 16,
- /// Script size (subscript, stackrel)
- LMPF_SCRIPT = 32
+ LMPF_BASIC = 0,
+ /// If false can use a non-standard size
+ LMPF_FIXED_SIZE = 1,
+ /// If true can insert newlines
+ LMPF_ALLOW_CR = 2,
+ /// If true can use tabs
+ LMPF_ALLOW_TAB = 4,
+ /// If true can insert new columns
+ LMPF_ALLOW_NEW_COL = 8,
+ /// Smaller than current size (frac)
+ LMPF_SMALLER = 16,
+ /// Script size (subscript, stackrel)
+ LMPF_SCRIPT = 32
};
class MathParInset: public MathedInset {
public:
///
- MathParInset(short st= LM_ST_TEXT, char const * nm= 0,
- short ot= LM_OT_MIN);
+ MathParInset(short st = LM_ST_TEXT, char const * nm = 0,
+ short ot = LM_OT_MIN);
///
MathParInset(MathParInset *);
///
/// Draw the object on a drawable
virtual void Draw(int x, int baseline);
-
+
/// Write LaTeX code
- virtual void Write(FILE * file);
+ virtual void Write(ostream &);
+
/// Write LaTeX code
virtual void Write(string & file);
///
///
MathedRowSt(int n) {
w = new int[n + 1]; // this leaks
- next = 0;
- label = 0;
- numbered = true;
+ next = 0;
+ label = 0;
+ numbered = true;
}
///
~MathedRowSt() {
///
void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Write(string & file);
///
LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * data,
MathParInset ** mt);
///
-void mathed_write(MathParInset *, FILE *, int *, char fragile,
+void mathed_write(MathParInset *, ostream &, int *, char fragile,
char const * label = 0);
///
+//void mathed_write(MathParInset *, FILE *, int *, char fragile,
+// char const * label = 0);
+///
void mathed_write(MathParInset *, string &, int *, char fragile,
char const * label = 0);
///
#pragma interface
#endif
-#include <stdio.h>
+#include <cstdio>
#include "math_defs.h"
#include "symbol_def.h"
#include "LString.h"
class MathFuncInset: public MathedInset {
public:
///
- MathFuncInset(char const * nm,
- short ot = LM_OT_FUNC, short st = LM_ST_TEXT);
+ MathFuncInset(char const * nm,
+ short ot = LM_OT_FUNC, short st = LM_ST_TEXT);
///
- ~MathFuncInset();
+ ~MathFuncInset();
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
+ void Metrics();
///
- inline bool GetLimits() const;
+ inline bool GetLimits() const;
protected:
///
- int ln;
+ int ln;
///
- bool lims;
+ bool lims;
///
- char * fname;
+ char * fname;
};
/// Accents
class MathAccentInset: public MathedInset {
- public:
+public:
///
- MathAccentInset(byte, MathedTextCodes, int, short st = LM_ST_TEXT);
+ MathAccentInset(byte, MathedTextCodes, int, short st = LM_ST_TEXT);
///
- MathAccentInset(MathedInset *, int, short st = LM_ST_TEXT);
+ MathAccentInset(MathedInset *, int, short st = LM_ST_TEXT);
///
- ~MathAccentInset();
+ ~MathAccentInset();
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
+ void Metrics();
///
- int getAccentCode() const { return code; }
-
- protected:
+ int getAccentCode() const { return code; }
+
+protected:
///
- byte c;
+ byte c;
///
- MathedTextCodes fn;
+ MathedTextCodes fn;
///
- int code;
+ int code;
///
- MathedInset * inset;
+ MathedInset * inset;
///
- int dh, dy;
+ int dh, dy;
};
///
class MathDotsInset: public MathedInset {
- public:
- ///
- MathDotsInset(char const *, int, short st = LM_ST_TEXT);
+public:
///
- ~MathDotsInset() {}
+ MathDotsInset(char const *, int, short st = LM_ST_TEXT);
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
- protected:
+ void Metrics();
+protected:
///
- int dh, code;
+ int dh, code;
};
/// Smart spaces
class MathSpaceInset: public MathedInset {
- public:
- ///
- MathSpaceInset(int sp, short ot = LM_OT_SPACE, short st = LM_ST_TEXT);
+public:
///
- ~MathSpaceInset() {}
+ MathSpaceInset(int sp, short ot = LM_OT_SPACE, short st = LM_ST_TEXT);
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- inline void Metrics();
+ inline void Metrics();
///
- inline void SetSpace(int sp);
+ inline void SetSpace(int sp);
///
- int GetSpace() { return space; }
- protected:
+ int GetSpace() { return space; }
+protected:
///
- int space;
+ int space;
};
/// big operators
class MathBigopInset: public MathedInset {
- public:
- ///
- MathBigopInset(char const *, int, short st = LM_ST_TEXT);
+public:
///
- ~MathBigopInset() {}
+ MathBigopInset(char const *, int, short st = LM_ST_TEXT);
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
+ void Metrics();
///
- inline bool GetLimits() const;
+ inline bool GetLimits() const;
///
- inline void SetLimits(bool);
- protected:
+ inline void SetLimits(bool);
+protected:
///
- int lims;
+ int lims;
///
- int sym;
+ int sym;
};
///
class MathSqrtInset: public MathParInset {
- public:
- ///
- MathSqrtInset(short st = LM_ST_TEXT);
- ///
- ~MathSqrtInset() {}
- ///
- MathedInset * Clone();
- ///
- void Draw(int x, int baseline);
- ///
- void Write(FILE * file);
- ///
- void Write(string & file);
- ///
- void Metrics();
- ///
- bool Inside(int, int);
-
- private:
- ///
- int hmax, wbody;
+public:
+ ///
+ MathSqrtInset(short st = LM_ST_TEXT);
+ ///
+ MathedInset * Clone();
+ ///
+ void Draw(int x, int baseline);
+ ///
+ void Write(ostream &);
+ ///
+ void Write(string & file);
+ ///
+ void Metrics();
+ ///
+ bool Inside(int, int);
+private:
+ ///
+ int hmax, wbody;
};
/// Fraction like objects (frac, stackrel, binom)
class MathFracInset: public MathParInset {
- public:
+public:
///
- MathFracInset(short ot = LM_OT_FRAC);
+ MathFracInset(short ot = LM_OT_FRAC);
///
- ~MathFracInset();
+ ~MathFracInset();
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int x, int baseline);
+ void Draw(int x, int baseline);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
-
- /** This does the same that SetData(LyxArrayBase*) but for both
- numerator and denominator at once.
- */
- void SetData(LyxArrayBase *, LyxArrayBase *);
+ void Metrics();
+
+ /** This does the same that SetData(LyxArrayBase*) but for both
+ numerator and denominator at once.
+ */
+ void SetData(LyxArrayBase *, LyxArrayBase *);
+ ///
+ void SetData(LyxArrayBase *);
+ ///
+ void GetXY(int & x, int & y) const;
+ ///
+ void SetFocus(int, int);
///
- void SetData(LyxArrayBase *);
+ bool Inside(int, int);
///
- void GetXY(int & x, int & y) const;
+ LyxArrayBase * GetData();
///
- void SetFocus(int, int);
- ///
- bool Inside(int, int);
- ///
- LyxArrayBase * GetData();
- ///
- bool setArgumentIdx(int i); // was bool Up/down(void);
- ///
- int getArgumentIdx() { return int(idx); }
- ///
- int getMaxArgumentIdx() { return 1; }
+ bool setArgumentIdx(int i); // was bool Up/down(void);
///
- void SetStyle(short);
- protected:
+ int getArgumentIdx() { return int(idx); }
///
- short idx;
+ int getMaxArgumentIdx() { return 1; }
///
- MathParInset * den;
+ void SetStyle(short);
+protected:
+ ///
+ short idx;
+ ///
+ MathParInset * den;
///
- int w0, w1, des0, dh;
+ int w0, w1, des0, dh;
};
/// A delimiter
class MathDelimInset: public MathParInset {
- public:
- ///
- MathDelimInset(int, int, short st = LM_ST_TEXT);
+public:
///
- ~MathDelimInset() {}
+ MathDelimInset(int, int, short st = LM_ST_TEXT);
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
- protected:
+ void Metrics();
+protected:
///
- int left, right;
+ int left, right;
///
- int dw, dh;
+ int dw, dh;
};
/// Decorations over (below) a math object
class MathDecorationInset: public MathParInset {
- public:
- ///
- MathDecorationInset(int, short st = LM_ST_TEXT);
+public:
///
- ~MathDecorationInset() {}
+ MathDecorationInset(int, short st = LM_ST_TEXT);
///
- MathedInset * Clone();
+ MathedInset * Clone();
///
- void Draw(int, int);
+ void Draw(int, int);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
- void Write(string & file);
+ void Write(string & file);
///
- void Metrics();
+ void Metrics();
///
- inline bool GetLimits() const;
- protected:
+ inline bool GetLimits() const;
+protected:
///
- int deco;
+ int deco;
///
- bool upper;
+ bool upper;
///
- int dw, dh, dy;
+ int dw, dh, dy;
};
inline
-void MathFuncInset::Write(FILE * file)
+void MathFuncInset::Write(ostream & os)
{
- fprintf(file, "\\%s ", name);
+ os << "\\" << name;
}
inline
void MathSpaceInset::Metrics()
{
- width = (space) ? space * 2 : 2;
- if (space>3) width *= 2;
+ width = space ? space * 2 : 2;
+ if (space > 3) width *= 2;
if (space == 5) width *= 2;
width += 4;
ascent = 4; descent = 0;
// the builtin memcpy() is broken in egcs and gcc 2.95.x on alpha
// stations. We provide a hand-made version instead.
-inline void my_memcpy( void* ps_in, const void* pt_in, unsigned int n )
+inline void my_memcpy( void * ps_in, const void * pt_in, size_t n )
{
- char* ps = static_cast<char*>(ps_in);
- char* pt = static_cast<char*>(const_cast<void*>(pt_in));
- for( int i = 0; i < n; i++)
- *ps++ = *pt++;
+ char * ps = static_cast<char *>(ps_in);
+ char const * pt = static_cast<char const *>(pt_in);
+ /*
+ for(size_t i = n; i--;)
+ *ps++ = *pt++;
+ */
+ while (n--) *ps++ = *pt++;
}
void MathedIter::Reset()
{
- if (array->last>0 && MathIsFont(array->bf[0])) {
+ if (array->last > 0 && MathIsFont(array->bf[0])) {
fcode = array->bf[0];
pos = 1;
} else {
nargs = tmplate->getNoArgs();
tcode = tmplate->getTCode();
args = new MacroArgumentBase[nargs];
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
// if (tmplate->getMacroPar(i)->Permit(LMPF_ALLOW_CR))
// args[i].row = new MathedRowSt(tmplate->getMacroPar(i)->GetColumns());
// else
SetName(tmplate->GetName());
}
-MathMacro::MathMacro(MathMacro* m):
+
+MathMacro::MathMacro(MathMacro * m):
MathParInset(LM_ST_TEXT, m->GetName(), LM_OT_MACRO)
{
tmplate = m->tmplate;
args = new MacroArgumentBase[nargs];
idx = 0;
SetName(tmplate->GetName());
- for (int i= 0; i<tmplate->nargs; i++) {
+ for (int i = 0; i < tmplate->nargs; ++i) {
m->setArgumentIdx(i);
MathedIter it(m->GetData());
args[i].row = m->args[i].row;
MathMacro::~MathMacro()
{
- for (idx= 0; idx<nargs; idx++) {
+ for (idx = 0; idx < nargs; ++idx) {
MathedIter it(args[idx].array);
it. Clear();
delete args[idx].row;
MathedInset * MathMacro::Clone()
{
-#if 0
- MathMacro *m = new MathMacro(this);
- return m;
-#endif
return new MathMacro(this);
}
void MathMacro::Metrics()
{
- if (nargs>0)
+ if (nargs > 0)
tmplate->update(this);
tmplate->Metrics();
width = tmplate->Width();
tmplate->SetStyle(size);
mathGC = latexGC;
tmplate->Draw(x, y);
- for (int i= 0; i<nargs; i++)
+ for (int i = 0; i < nargs; ++i)
tmplate->GetMacroXY(i, args[i].x, args[i].y);
}
}
-void MathMacro::GetXY(int& x, int& y) const
+void MathMacro::GetXY(int & x, int & y) const
{
x = args[idx].x; y = args[idx].y;
}
bool MathMacro::Permit(short f)
{
- return ((nargs>0) ? tmplate->getMacroPar(idx)->Permit(f): MathParInset::Permit(f));
+ return (nargs > 0) ?
+ tmplate->getMacroPar(idx)->Permit(f) : MathParInset::Permit(f);
}
+
void MathMacro::SetFocus(int x, int y)
{
tmplate->update(this);
}
-void MathMacro::Write(FILE *file)
+void MathMacro::Write(ostream & os)
{
string output;
MathMacro::Write(output);
- fprintf(file, "%s", output.c_str());
+ os << output;
}
// file += ']';
// }
- if (!(tmplate->flags & MMF_Env) && nargs>0)
+ if (!(tmplate->flags & MMF_Env) && nargs > 0)
file += '{';
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
array = args[i].array;
MathParInset::Write(file);
- if (i<nargs-1)
+ if (i < nargs - 1)
file += "}{";
}
if (tmplate->flags & MMF_Env) {
file += name;
file += '}';
} else {
- if (nargs>0)
+ if (nargs > 0)
file += '}';
else
file += ' ';
SetType(LM_OT_MACRO_ARG);
}
+
void MathMacroArgument::Draw(int x, int baseline)
{
if (expnd_mode) {
}
}
-void MathMacroArgument::Write(FILE *file)
+
+void MathMacroArgument::Write(ostream & os)
{
string output;
MathMacroArgument::Write(output);
- fprintf(file, "%s", output.c_str());
+ os << output;
}
-void MathMacroArgument::Write(string &file)
+
+void MathMacroArgument::Write(string & file)
{
if (expnd_mode) {
MathParInset::Write(file);
/* --------------------- MathMacroTemplate ---------------------------*/
-MathMacroTemplate::MathMacroTemplate(char const *nm, int na, int flg):
+MathMacroTemplate::MathMacroTemplate(char const * nm, int na, int flg):
MathParInset(LM_ST_TEXT, nm, LM_OT_MACRO),
flags(flg), nargs(na)
{
{
if (ed) {
flags |= MMF_Edit;
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(false);
}
} else {
flags &= ~MMF_Edit;
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(true);
}
}
int x2, y2;
bool expnd = (nargs>0) ? args[0].getExpand(): false;
if (flags & MMF_Edit) {
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(false);
}
x2 = x; y2 = y;
} else {
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(true);
}
x2 = xo; y2 = yo;
MathParInset::Draw(x, y);
xo = x2; yo = y2;
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(expnd);
}
}
+
void MathMacroTemplate::Metrics()
{
bool expnd = (nargs>0) ? args[0].getExpand(): false;
}
}
-void MathMacroTemplate::update(MathMacro* macro)
+
+void MathMacroTemplate::update(MathMacro * macro)
{
int idx = (macro) ? macro->getArgumentIdx(): 0;
for (int i= 0; i<nargs; i++) {
}
-void MathMacroTemplate::WriteDef(FILE *file)
+void MathMacroTemplate::WriteDef(ostream & os)
{
- fprintf(file, "\n\\newcommand{\\%s}", name);
+ os << "\n\\newcommand{\\" << name << "}";
if (nargs > 0 )
- fprintf(file, "[%d]", nargs);
+ os << "[" << nargs << "]";
- fprintf(file, "{");
+ os << "{";
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(false);
}
- Write(file);
- fprintf(file, "}\n");
+ Write(os);
+ os << "}\n";
}
+
void MathMacroTemplate::WriteDef(string &file)
{
file += "\n\\newcommand{\\";
file += '{';
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
args[i].setExpand(false);
}
Write(file);
file += "}\n";
}
-void MathMacroTemplate::setArgument(LyxArrayBase *a, int i)
+
+void MathMacroTemplate::setArgument(LyxArrayBase * a, int i)
{
args[i].SetData(a);
}
-void MathMacroTemplate::GetMacroXY(int i, int& x, int& y) const
+
+void MathMacroTemplate::GetMacroXY(int i, int & x, int & y) const
{
args[i].GetXY(x, y);
}
-MathParInset *MathMacroTemplate::getMacroPar(int i) const
+MathParInset * MathMacroTemplate::getMacroPar(int i) const
{
- return ((i>= 0 && i<nargs) ? (MathParInset*)&args[i]: 0);
+ return (i >= 0 && i < nargs) ? (MathParInset*)&args[i] : 0;
}
void MathMacroTemplate::SetMacroFocus(int &idx, int x, int y)
{
- for (int i= 0; i<nargs; i++) {
+ for (int i = 0; i < nargs; ++i) {
if (args[i].Inside(x, y)) {
idx = i;
break;
// The search is currently linear but will be binary or hash, later.
-MathMacroTemplate *MathMacroTable::getTemplate(char const* name) const
+MathMacroTemplate * MathMacroTable::getTemplate(char const * name) const
{
- for (int i= 0; i<num_macros; i++) {
+ for (int i = 0; i < num_macros; ++i) {
if (strcmp(name, macro_table[i]->GetName()) == 0)
return macro_table[i];
}
return 0;
}
-void MathMacroTable::addTemplate(MathMacroTemplate *m)
+void MathMacroTable::addTemplate(MathMacroTemplate * m)
{
- if (num_macros<max_macros)
+ if (num_macros < max_macros)
macro_table[num_macros++] = m;
else
lyxerr << "Error (MathMacroTable::addTemplate): "
void MathMacroTable::builtinMacros()
{
- MathMacroTemplate *m;
MathedIter iter;
- MathParInset* inset;// *arg;
- LyxArrayBase *array, *array2;
+ MathParInset * inset;// *arg;
+ LyxArrayBase * array2;
built = true;
lyxerr[Debug::MATHED] << "Building macros" << endl;
// This macro doesn't have arguments
- m = new MathMacroTemplate("notin"); // this leaks
+ MathMacroTemplate * m = new MathMacroTemplate("notin"); // this leaks
addTemplate(m);
- array = new LyxArrayBase; // this leaks
+ LyxArrayBase * array = new LyxArrayBase; // this leaks
iter.SetData(array);
iter.Insert(new MathAccentInset(LM_in, LM_TC_BOPS, LM_not)); // this leaks
m->SetData(array);
MathMacroTable MathMacroTable::mathMTable(255);
-bool MathMacroTable::built = false;
-
+bool MathMacroTable::built = false;
#include "debug.h"
///
-typedef MathParInset* MathParInsetP;
+typedef MathParInset * MathParInsetP;
///
-typedef LyxArrayBase *LyxArrayBaseP;
+typedef LyxArrayBase * LyxArrayBaseP;
class MathMacroTemplate;
/// This class contains the data for a macro
-class MathMacro: public MathParInset
+class MathMacro : public MathParInset
{
public:
/// A macro can only be builded from an existing template
MathMacro(MathMacroTemplate *);
/// or from another macro.
- MathMacro(MathMacro*);
+ MathMacro(MathMacro *);
///
~MathMacro();
///
///
MathedInset * Clone();
///
- void Write(FILE *);
+ void Write(ostream &);
///
void Write(string &);
///
///
int GetColumns();
///
- void GetXY(int&, int&) const;
+ void GetXY(int &, int &) const;
///
void SetFocus(int, int);
///
- LyxArrayBase *GetData();
+ LyxArrayBase * GetData();
///
- MathedRowSt *getRowSt() const { return args[idx].row; }
+ MathedRowSt * getRowSt() const { return args[idx].row; }
///
void SetData(LyxArrayBase *);
///
private:
///
- MathMacroTemplate *tmplate;
+ MathMacroTemplate * tmplate;
///
- struct MacroArgumentBase {
- /// Position of the macro
- int x, y;
- ///
- MathedRowSt *row;
- ///
- LyxArrayBase *array;
- ///
- MacroArgumentBase() { x = y = 0; array = 0; row = 0; }
- } *args;
+ struct MacroArgumentBase {
+ /// Position of the macro
+ int x, y;
+ ///
+ MathedRowSt * row;
+ ///
+ LyxArrayBase * array;
+ ///
+ MacroArgumentBase() { x = y = 0; array = 0; row = 0; }
+ };
+ MacroArgumentBase * args;
///
- int idx;
+ int idx;
///
- int nargs;
+ int nargs;
///
- MathedTextCodes tcode;
+ MathedTextCodes tcode;
///
- friend class MathMacroTemplate;
+ friend class MathMacroTemplate;
};
///
void Draw(int x, int baseline);
///
- void Write(FILE*);
+ void Write(ostream &);
///
void Write(string &);
///
{
public:
/// A template constructor needs all the data
- MathMacroTemplate(char const*, int na= 0, int f= 0);
+ MathMacroTemplate(char const *, int na = 0, int f = 0);
///
~MathMacroTemplate();
///
///
void Metrics();
///
- void WriteDef(FILE *);
+ void WriteDef(ostream &);
///
void WriteDef(string &);
/// useful for special insets
/// Number of arguments
int getNoArgs() { return nargs; }
///
- void GetMacroXY(int, int&, int&) const;
+ void GetMacroXY(int, int &, int &) const;
///
- MathParInset *getMacroPar(int) const;
+ MathParInset * getMacroPar(int) const;
///
- void SetMacroFocus(int&, int, int);
+ void SetMacroFocus(int &, int, int);
///
void setEditMode(bool);
/// Replace the appropriate arguments with a specific macro's data
- void update(MathMacro* m= 0);
+ void update(MathMacro * m = 0);
private:
///
///
MathedTextCodes tcode;
///
- MathMacroArgument *args;
+ MathMacroArgument * args;
///
int nargs;
///
///
-typedef MathMacro *MathMacroP;
+typedef MathMacro * MathMacroP;
///
-typedef MathMacroTemplate *MathMacroTemplateP;
+typedef MathMacroTemplate * MathMacroTemplateP;
///
class MathMacroTable
///
void addTemplate(MathMacroTemplate *);
///
- MathMacro *getMacro(char const*) const;
+ MathMacro * getMacro(char const *) const;
///
- MathMacroTemplate *getTemplate(char const*) const;
+ MathMacroTemplate * getTemplate(char const *) const;
///
void builtinMacros();
///
///
int num_macros;
///
- MathMacroTemplateP *macro_table;
+ MathMacroTemplateP * macro_table;
};
inline
bool MathMacro::setArgumentIdx(int i)
{
- if (i>= 0 && i<nargs) {
+ if (i >= 0 && i < nargs) {
idx = i;
return true;
} else
inline
int MathMacro::getMaxArgumentIdx()
{
- return nargs-1;
+ return nargs - 1;
}
inline
-LyxArrayBase *MathMacro::GetData()
+LyxArrayBase * MathMacro::GetData()
{
return args[idx].array;
}
inline
-void MathMacro::SetData(LyxArrayBase *a)
+void MathMacro::SetData(LyxArrayBase * a)
{
args[idx].array = a;
}
inline
-MathMacro *MathMacroTable::getMacro(char const* name) const
+MathMacro * MathMacroTable::getMacro(char const * name) const
{
- MathMacroTemplate *mt = getTemplate(name);
+ MathMacroTemplate * mt = getTemplate(name);
return (mt) ? new MathMacro(mt): 0;
}
{
int left= fd_delim->left->u_ldata, right= fd_delim->right->u_ldata;
int side= (fl_get_button(fd_delim->right)!= 0);
- Pixmap p1, p2;
switch (data) {
case MM_APPLY:
right = delim_rversion[i];
}
}
+ Pixmap p1, p2;
p1 = fl_get_pixmap_pixmap(fd_delim->pix, &p1, &p2);
fl_draw_bmtable_item(fd_delim->menu, left, p1, 0, 0);
fl_draw_bmtable_item(fd_delim->menu, right, p1, 16, 0);
/* callbacks for form matrix */
void matrix_cb(FL_OBJECT *, long data)
{
- int nx, ny;
static char v_align_c[] = "tcb";
switch (data) {
char s[80];
char c = v_align_c[fl_get_choice(fd_matrix->valign)-1];
char const * sh = fl_get_input(fd_matrix->halign);
- nx = int(fl_get_slider_value(fd_matrix->columns)+0.5);
- ny = int(fl_get_slider_value(fd_matrix->rows)+0.5);
+ int nx = int(fl_get_slider_value(fd_matrix->columns)+0.5);
+ int ny = int(fl_get_slider_value(fd_matrix->rows)+0.5);
sprintf(s, "%d %d %c%s", nx, ny, c, sh);
if (data == MM_OK) fl_hide_form(fd_matrix->matrix);
lyxfunc->Dispatch(LFUN_INSERT_MATRIX, s);
case MM_CLOSE: fl_hide_form(fd_matrix->matrix); break;
case 2:
{
- nx = int(fl_get_slider_value(fd_matrix->columns)+0.5);
+ int nx = int(fl_get_slider_value(fd_matrix->columns)+0.5);
for (int i= 0; i<nx; i++) h_align_str[i] = 'c';
//memset(h_align_str, 'c', nx);
h_align_str[nx] = '\0';
}
-void MathRootInset::SetData(LyxArrayBase *d)
+void MathRootInset::SetData(LyxArrayBase * d)
{
if (idx == 1)
MathParInset::SetData(d);
}
-void MathRootInset::GetXY(int& x, int& y) const
+void MathRootInset::GetXY(int & x, int & y) const
{
if (idx == 1)
MathParInset::GetXY(x, y);
uroot->GetXY(x, y);
}
-LyxArrayBase *MathRootInset::GetData()
+
+LyxArrayBase * MathRootInset::GetData()
{
if (idx == 1)
return array;
}
-void MathRootInset::Write(FILE *outf)
+void MathRootInset::Write(ostream & os)
{
string output;
- MathRootInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ MathRootInset::Write(output);
+ os << output;
}
///
void Draw(int x, int baseline);
///
- void Write(FILE * file);
+ void Write(ostream &);
///
void Write(string & file);
///
void
-MathSpaceInset::Write(FILE * outf)
+MathSpaceInset::Write(ostream & os)
{
if (space >= 0 && space < 6) {
string output;
MathSpaceInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
}
+
void
MathSpaceInset::Write(string & outf)
{
void
-MathDotsInset::Write(FILE * outf)
+MathDotsInset::Write(ostream & os)
{
string output;
MathDotsInset::Write(output);
- fprintf(outf, "%s", output.c_str());
-}
+ os << output;
+}
+
void
MathDotsInset::Write(string & outf)
}
-void MathSqrtInset::Write(FILE * outf)
+void MathSqrtInset::Write(ostream & os)
{
string output;
- MathSqrtInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ MathSqrtInset::Write(output);
+ os << output;
}
+
void MathSqrtInset::Write(string & outf)
{
outf += '\\';
}
-void MathDelimInset::Write(FILE * outf)
+void MathDelimInset::Write(ostream & os)
{
string output;
MathDelimInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
+
void MathDelimInset::Write(string & outf)
{
latexkeys * l = (left != '|') ? lm_get_key_by_id(left, LM_TK_SYM): 0;
}
-void MathDecorationInset::Write(FILE * outf)
+void MathDecorationInset::Write(ostream & os)
{
string output;
MathDecorationInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
+
void MathDecorationInset::Write(string & outf)
{
latexkeys * l = lm_get_key_by_id(deco, LM_TK_WIDE);
}
-void MathAccentInset::Write(FILE * outf)
+void MathAccentInset::Write(ostream & os)
{
string output;
MathAccentInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
+
void MathAccentInset::Write(string & outf)
{
latexkeys * l = lm_get_key_by_id(code, LM_TK_ACCENT);
}
-void MathBigopInset::Write(FILE * outf)
+void MathBigopInset::Write(ostream & os)
{
string output;
MathBigopInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
+
void MathBigopInset::Write(string & outf)
{
bool limp = GetLimits();
}
-void MathFracInset::Write(FILE * outf)
+void MathFracInset::Write(ostream & os)
{
string output;
- MathFracInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ MathFracInset::Write(output);
+ os << output;
}
+
void MathFracInset::Write(string & outf)
{
outf += '\\';
}
-void MathParInset::Write(FILE * outf)
+void MathParInset::Write(ostream & os)
{
if (!array) return;
string output;
MathParInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
}
-void MathMatrixInset::Write(FILE *outf)
+void MathMatrixInset::Write(ostream & os)
{
string output;
MathMatrixInset::Write(output);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
-void MathMatrixInset::Write(string &outf)
+
+void MathMatrixInset::Write(string & outf)
{
if (GetType() == LM_OT_MATRIX){
outf += "\\begin{";
}
-void mathed_write(MathParInset* p, FILE* outf, int* newlines, char fragile, char const* label)
+void mathed_write(MathParInset * p, ostream & os, int * newlines,
+ char fragile, char const * label)
{
string output;
mathed_write(p, output, newlines, fragile, label);
- fprintf(outf, "%s", output.c_str());
+ os << output;
}
+
extern int tex_code_break_column;
-void mathed_write(MathParInset* p, string & outf, int* newlines,
- char fragile, char const* label)
+void mathed_write(MathParInset * p, string & outf, int * newlines,
+ char fragile, char const * label)
{
number_of_newlines = 0;
short mathed_env = p->GetType();
#pragma implementation "lyxparagraph.h"
#endif
+#include <fstream>
+
#include "lyxparagraph.h"
#include "support/textutils.h"
#include "lyxrc.h"
}
-void LyXParagraph::writeFile(FILE * file, BufferParams & params,
+void LyXParagraph::writeFile(ostream & os, BufferParams & params,
char footflag, char dth)
{
LyXFont font1, font2;
if (footflag != footnoteflag) {
footflag = footnoteflag;
if (footflag) {
- fprintf(file, "\n\\begin_float %s ",
- string_footnotekinds[footnotekind]);
+ os << "\n\\begin_float "
+ << string_footnotekinds[footnotekind]
+ << " ";
}
else {
- fprintf(file, "\n\\end_float ");
+ os << "\n\\end_float ";
}
}
if (dth != depth) {
if (depth > dth) {
while (depth > dth) {
- fprintf(file, "\n\\begin_deeper ");
+ os << "\n\\begin_deeper ";
dth++;
}
}
else {
while (depth < dth) {
- fprintf(file, "\n\\end_deeper ");
+ os << "\n\\end_deeper ";
dth--;
}
}
}
/* First write the layout */
- fprintf(file, "\n\\layout %s\n",
- textclasslist.NameOfLayout(params.textclass, layout)
- .c_str());
+ os << "\n\\layout "
+ << textclasslist.NameOfLayout(params.textclass, layout)
+ << "\n";
/* maybe some vertical spaces */
if (added_space_top.kind() != VSpace::NONE)
- fprintf(file, "\\added_space_top %s ",
- added_space_top.asLyXCommand().c_str());
+ os << "\\added_space_top "
+ << added_space_top.asLyXCommand() << " ";
if (added_space_bottom.kind() != VSpace::NONE)
- fprintf(file, "\\added_space_bottom %s ",
- added_space_bottom.asLyXCommand().c_str());
+ os << "\\added_space_bottom "
+ << added_space_bottom.asLyXCommand() << " ";
/* The labelwidth string used in lists */
if (!labelwidthstring.empty())
- fprintf(file, "\\labelwidthstring %s\n",
- labelwidthstring.c_str());
+ os << "\\labelwidthstring "
+ << labelwidthstring << '\n';
/* Lines above or below? */
if (line_top)
- fprintf(file, "\\line_top ");
+ os << "\\line_top ";
if (line_bottom)
- fprintf(file, "\\line_bottom ");
+ os << "\\line_bottom ";
/* Pagebreaks above or below? */
if (pagebreak_top)
- fprintf(file, "\\pagebreak_top ");
+ os << "\\pagebreak_top ";
if (pagebreak_bottom)
- fprintf(file, "\\pagebreak_bottom ");
+ os << "\\pagebreak_bottom ";
/* Start of appendix? */
if (start_of_appendix)
- fprintf(file, "\\start_of_appendix ");
+ os << "\\start_of_appendix ";
/* Noindent? */
if (noindent)
- fprintf(file, "\\noindent ");
+ os << "\\noindent ";
/* Alignment? */
if (align != LYX_ALIGN_LAYOUT) {
case LYX_ALIGN_CENTER: h = 3; break;
default: h = 0; break;
}
- fprintf(file, "\\align %s ", string_align[h]);
+ os << "\\align " << string_align[h] << " ";
}
if (pextra_type != PEXTRA_NONE) {
- fprintf(file, "\\pextra_type %d", pextra_type);
+ os << "\\pextra_type " << pextra_type;
if (pextra_type == PEXTRA_MINIPAGE) {
- fprintf(file, " \\pextra_alignment %d",
- pextra_alignment);
+ os << " \\pextra_alignment "
+ << pextra_alignment;
if (pextra_hfill)
- fprintf(file, " \\pextra_hfill %d",
- pextra_hfill);
+ os << " \\pextra_hfill "
+ << pextra_hfill;
if (pextra_start_minipage)
- fprintf(file,
- " \\pextra_start_minipage %d",
- pextra_start_minipage);
+ os << " \\pextra_start_minipage "
+ << pextra_start_minipage;
}
if (!pextra_width.empty()) {
- fprintf(file, " \\pextra_width %s",
- VSpace(pextra_width)
- .asLyXCommand().c_str());
+ os << " \\pextra_width "
+ << VSpace(pextra_width).asLyXCommand();
} else if (!pextra_widthp.empty()) {
- fprintf(file, " \\pextra_widthp %s",
- pextra_widthp.c_str());
+ os << " \\pextra_widthp "
+ << pextra_widthp;
}
- fprintf(file, "\n");
+ os << '\n';
}
}
else {
/* Dummy layout. This means that a footnote ended */
- fprintf(file, "\n\\end_float ");
+ os << "\n\\end_float ";
footflag = LyXParagraph::NO_FOOTNOTE;
}
/* It might be a table */
if (table){
- fprintf(file, "\\LyXTable\n");
- table->Write(file);
+ os << "\\LyXTable\n";
+ table->Write(os);
}
// bibitem ale970302
if (bibkey)
- bibkey->Write(file);
+ bibkey->Write(os);
font1 = LyXFont(LyXFont::ALL_INHERIT);
column = 0;
for (size_type i = 0; i < size(); i++) {
if (!i){
- fprintf(file, "\n");
+ os << "\n";
column = 0;
}
// Write font changes
font2 = GetFontSettings(i);
if (font2 != font1) {
- font2.lyxWriteChanges(font1, file);
+ font2.lyxWriteChanges(font1, os);
column = 0;
font1 = font2;
}
// international char, let it write
// code directly so it's shorter in
// the file
- inset->Write(file);
+ inset->Write(os);
} else {
- fprintf(file, "\n\\begin_inset ");
- inset->Write(file);
- fprintf(file, "\n\\end_inset \n");
- fprintf(file, "\n");
+ os << "\n\\begin_inset ";
+ inset->Write(os);
+ os << "\n\\end_inset \n\n";
column = 0;
}
break;
case META_NEWLINE:
- fprintf(file, "\n\\newline \n");
+ os << "\n\\newline \n";
column = 0;
break;
case META_HFILL:
- fprintf(file, "\n\\hfill \n");
+ os << "\n\\hfill \n";
column = 0;
break;
case META_PROTECTED_SEPARATOR:
- fprintf(file, "\n\\protected_separator \n");
+ os << "\n\\protected_separator \n";
column = 0;
break;
- case '\\':
- fprintf(file, "\n\\backslash \n");
+ case '\\':
+ os << "\n\\backslash \n";
column = 0;
break;
case '.':
if (i + 1 < size() && GetChar(i + 1) == ' ') {
- fprintf(file, ".\n");
+ os << ".\n";
column = 0;
} else
- fprintf(file, ".");
+ os << ".";
break;
default:
if ((column > 70 && c == ' ')
|| column > 79){
- fprintf(file, "\n");
+ os << "\n";
column = 0;
}
// this check is to amend a bug. LyX sometimes
// inserts '\0' this could cause problems.
if (c != '\0')
- fprintf(file, "%c", c);
+ os << c;
else
lyxerr << "ERROR (LyXParagraph::writeFile):"
" NULL char in structure." << endl;
// now write the next paragraph
if (next)
- next->writeFile(file, params, footflag, dth);
+ next->writeFile(os, params, footflag, dth);
}
}
-bool LyXParagraph::RoffContTableRows(FILE * fp,
+bool LyXParagraph::RoffContTableRows(ostream & os,
LyXParagraph::size_type i,
int actcell)
{
LyXFont font2;
Inset * inset;
char c;
- FILE * fp2;
string fname2 = TmpFileName(string(), "RAT2");
int lastpos = i;
lastpos = i;
c = GetChar(i);
if ((c != ' ') && (c != LyXParagraph::META_NEWLINE))
- fprintf(fp, " ");
+ os << " ";
for (; i < size()
&& (c = GetChar(i)) != LyXParagraph::META_NEWLINE;
++i) {
switch (c) {
case LyXParagraph::META_INSET:
if ((inset = GetInset(i))) {
- if (!(fp2= fopen(fname2.c_str(), "w+"))) {
+ fstream fs(fname2.c_str(), ios::in|ios::out);
+ if (!fs) {
WriteAlert(_("LYX_ERROR:"),
_("Cannot open temporary file:"),
fname2);
return false;
}
- inset->Latex(fp2,-1);
- rewind(fp2);
- c = fgetc(fp2);
- while(!feof(fp2)) {
+ inset->Latex(fs, -1);
+ fs.seekp(0);
+ fs.get(c);
+ while (!fs) {
if (c == '\\')
- fprintf(fp, "\\\\");
+ os << "\\\\";
else
- fputc(c, fp);
- c = fgetc(fp2);
+ os << c;
+ fs.get(c);
}
- fclose(fp2);
+ fs.close();
}
break;
case LyXParagraph::META_NEWLINE:
case LyXParagraph::META_PROTECTED_SEPARATOR:
break;
case '\\':
- fprintf(fp, "\\\\");
+ os << "\\\\";
break;
default:
if (c != '\0')
- fprintf(fp, "%c", c);
+ os << c;
else
lyxerr.debug() << "RoffAsciiTable: NULL char in structure." << endl;
break;
// Since the current C++ lib in egcs does not have a standard implementation
// of basic_streambuf and basic_filebuf we don't have to include this
// header.
+//#define MODERN_STL_STREAMS
#ifdef MODERN_STL_STREAMS
#include <fstream>
#endif
#endif
string qname = name;
while (qname.find("'") != string::npos)
- LSubstring(qname,"'") = "\\'";
+ LSubstring(qname, "'") = "\\'";
return '\'' + qname + '\'';
}
// a short string...
string ret;
FileInfo fnfo;
- for (int a= 'a'; a<= 'z'; ++a)
- for (int b= 'a'; b<= 'z'; ++b)
- for (int c= 'a'; c<= 'z'; ++c) {
+ for (int a = 'a'; a <= 'z'; ++a)
+ for (int b = 'a'; b <= 'z'; ++b)
+ for (int c = 'a'; c <= 'z'; ++c) {
// if this is not enough I have no idea what
// to do.
ret = tmpfl + char(a) + char(b) + char(c);
}
}
}
- if (remove (tmpfl.c_str())) {
+ if (remove(tmpfl.c_str())) {
WriteFSAlert(_("LyX Internal Error!"),
_("Created test file but cannot remove it?"));
return -1;
// 2) build_lyxdir (if not empty)
// 3) system_lyxdir
string LibFileSearch(string const & dir, string const & name,
- string const & ext)
+ string const & ext)
{
- string fullname = FileSearch(AddPath(user_lyxdir, dir), name,
- ext);
+ string fullname = FileSearch(AddPath(user_lyxdir, dir),
+ name, ext);
if (!fullname.empty())
return fullname;
string i18nLibFileSearch(string const & dir, string const & name,
- string const & ext)
+ string const & ext)
{
string lang = token(string(GetEnv("LANG")), '_', 0);
#warning Look at and fix this.
#endif
// f.ex. what about error checking?
- int retval = 0;
#if HAVE_PUTENV
// this leaks, but what can we do about it?
// Is doing a getenv() and a free() of the older value
// a good idea? (JMarc)
- retval = putenv((new string(envstr))->c_str());
+ int retval = putenv((new string(envstr))->c_str());
#else
#ifdef HAVE_SETENV
string varname;
string str = envstr.split(varname,'=');
- retval = setenv(varname.c_str(), str.c_str(), true);
+ int retval = setenv(varname.c_str(), str.c_str(), true);
#endif
#endif
return retval == 0;
static
int DeleteAllFilesInDir (string const & path)
{
- struct dirent * de;
DIR * dir = opendir(path.c_str());
if (!dir) {
WriteFSAlert (_("Error! Cannot open directory:"), path);
return -1;
}
+ struct dirent * de;
while ((de = readdir(dir))) {
string temp = de->d_name;
if (temp == "." || temp == "..")
lyxerr.debug() << "Deleting file: " << unlinkpath << endl;
- if (remove (unlinkpath.c_str()))
+ if (remove(unlinkpath.c_str()))
WriteFSAlert (_("Error! Could not remove file:"),
unlinkpath);
}
- closedir (dir);
+ closedir(dir);
return 0;
}
string CreateBufferTmpDir (string const & pathfor)
{
- return CreateTmpDir (pathfor, "lyx_bufrtmp");
+ return CreateTmpDir(pathfor, "lyx_bufrtmp");
}
int DestroyBufferTmpDir (string const & tmpdir)
{
- return DestroyTmpDir (tmpdir, true);
+ return DestroyTmpDir(tmpdir, true);
}
string CreateLyXTmpDir (string const & deflt)
{
- string t;
-
if ((!deflt.empty()) && (deflt != "/tmp")) {
- if (mkdir (deflt.c_str(), 0777)) {
+ if (mkdir(deflt.c_str(), 0777)) {
#ifdef __EMX__
Path p(user_lyxdir);
#endif
- t = CreateTmpDir (deflt.c_str(), "lyx_tmp");
+ string t = CreateTmpDir (deflt.c_str(), "lyx_tmp");
return t;
} else
return deflt;
#ifdef __EMX__
Path p(user_lyxdir);
#endif
- t = CreateTmpDir ("/tmp", "lyx_tmp");
+ string t = CreateTmpDir ("/tmp", "lyx_tmp");
return t;
}
}
int n = 256; // Assume path is less than 256 chars
char * err;
char * tbuf = new char[n];
- string result;
// Safe. Hopefully all getcwds behave this way!
while (((err = lyx::getcwd (tbuf, n)) == 0) && (errno == ERANGE)) {
tbuf = new char[n];
}
+ string result;
if (err) result = tbuf;
delete[] tbuf;
return result;
if (Temp == ".") continue;
if (Temp == "..") {
// Remove one level of TempBase
- int i = TempBase.length()-2;
+ int i = TempBase.length() - 2;
#ifndef __EMX__
if (i < 0) i = 0;
while (i > 0 && TempBase[i] != '/') --i;
}
// returns absolute path
- return TempBase;
+ return TempBase;
}
TempBase = "./";
} else if (Temp == "..") {
// Remove one level of TempBase
- int i = TempBase.length()-2;
- while (i>0 && TempBase[i] != '/')
+ int i = TempBase.length() - 2;
+ while (i > 0 && TempBase[i] != '/')
--i;
- if (i>= 0 && TempBase[i] == '/')
- TempBase.erase(i+1, string::npos);
+ if (i >= 0 && TempBase[i] == '/')
+ TempBase.erase(i + 1, string::npos);
else
TempBase = "../";
} else {
if (*res1_contents != FirstChar) {
// Again No Environmentvariable
result1 += CompareString;
- result0 = res0;
+ result0 = res0;
}
// Check for variable names
// Situation ${} is detected as "No Environmentvariable"
- char const * cp1 = res1_contents+1;
+ char const * cp1 = res1_contents + 1;
bool result = isalpha(*cp1) || (*cp1 == UnderscoreChar);
++cp1;
while (*cp1 && result) {
// Append relative stuff from common directory to abspath
if (abspath[i] == '/') ++i;
- for (; i<abslen; ++i)
+ for (; i < abslen; ++i)
buf += abspath[i];
// Remove trailing /
if (suffixIs(buf, '/'))
if (!path.empty() && path != "." && path != "./") {
buf = CleanupPath(path);
if (path[path.length() - 1] != '/')
-
buf += '/';
}
}
-
// Creates a nice compact path for displaying
string MakeDisplayPath (string const & path, unsigned int threshold)
{
bool LyXReadLink(string const & File, string & Link)
{
char LinkBuffer[512];
- // Should be PATH_MAX but that needs autconf support
- int nRead;
- nRead = readlink(File.c_str(), LinkBuffer, sizeof(LinkBuffer)-1);
+ // Should be PATH_MAX but that needs autconf support
+ int nRead = readlink(File.c_str(), LinkBuffer, sizeof(LinkBuffer)-1);
if (nRead <= 0)
return false;
LinkBuffer[nRead] = 0;
///////////////////////////////////////
// The internal string representation
///////////////////////////////////////
-#define NEW_ALLOC 1
struct lyxstring::Srep {
-#ifndef NEW_ALLOC
- ///
- static size_t const xtra = static_cast<size_t>(8);
-#endif
/// size
size_t sz;
/// Reference count
};
+inline
lyxstring::Srep::Srep(lyxstring::size_type nsz, const value_type * p)
{
// can be called with p == 0 by lyxstring::assign(const value_type *, size_type)
sz = nsz;
ref = 1;
-#ifdef NEW_ALLOC
res = sz ? sz : 1;
-#else
- res = sz + xtra;
-#endif
s = new value_type[res + 1]; // add space for terminator
if (p && sz) {
// if sz = 0 nothing gets copied and we have an error
}
+inline
lyxstring::Srep::Srep(lyxstring::size_type nsz, value_type ch)
{
sz = nsz;
ref = 1;
-#ifdef NEW_ALLOC
res = sz ? sz : 1;
-#else
- res = sz + xtra;
-#endif
s = new value_type[res + 1]; // add space for terminator
memset(s, ch, sz);
if (!ch) {
}
+inline
void lyxstring::Srep::assign(lyxstring::size_type nsz, const value_type * p)
{
// can be called with p == 0 by lyxstring::assign(const value_type *, size_type)
if (res < nsz) {
delete[] s;
sz = nsz;
-#ifdef NEW_ALLOC
res = sz ? sz : 1;
-#else
- res = sz + xtra;
-#endif
s = new value_type[res + 1]; // add space for terminator
} else {
sz = nsz;
}
+inline
void lyxstring::Srep::assign(lyxstring::size_type nsz, value_type ch)
{
sz = nsz;
if (res < nsz) {
delete[] s;
-#ifdef NEW_ALLOC
res = sz ? sz : 1;
-#else
- res = sz + xtra;
-#endif
s = new value_type[res + 1]; // add space for terminator
}
memset(s, ch, sz);
}
+inline
void lyxstring::Srep::append(lyxstring::size_type asz, const value_type * p)
{
register unsigned int const len = sz + asz;
if (res < len) {
-#ifdef NEW_ALLOC
do {
res *= 2;
} while (res < len);
-#else
- res = len + xtra;
-#endif
value_type * tmp = new value_type[res + 1];
memcpy(tmp, s, sz);
memcpy(tmp + sz, p, asz);
}
+inline
void lyxstring::Srep::push_back(value_type c)
{
s[sz] = c; // it is always room to put a value_type at the end
++sz;
if (res < sz) {
-#ifdef NEW_ALLOC
do {
res *= 2;
} while (res < sz);
-#else
- res = sz + xtra;
-#endif
value_type * tmp = new value_type[res + 1];
memcpy(tmp, s, sz);
delete[] s;
}
+inline
void lyxstring::Srep::insert(lyxstring::size_type pos, const value_type * p,
lyxstring::size_type n)
{
if (res < n + sz) {
-#ifdef NEW_ALLOC
do {
res *= 2;
} while (res < n + sz);
-#else
- res = sz + n + xtra;
-#endif
value_type * tmp = new value_type[res + 1];
memcpy(tmp, s, pos);
memcpy(tmp + pos, p, n);
- memcpy(tmp + pos + n, & s[pos], sz - pos);
+ memcpy(tmp + pos + n, &s[pos], sz - pos);
sz += n;
delete[] s;
s = tmp;
} else {
- memmove(s + pos + n, & s[pos], sz - pos);
+ memmove(s + pos + n, &s[pos], sz - pos);
memcpy(s + pos, p, n);
sz += n;
}
}
+inline
void lyxstring::Srep::resize(size_type n, value_type c)
{
// This resets sz to res_arg
}
+inline
void lyxstring::Srep::reserve(lyxstring::size_type res_arg)
{
// This keeps the old sz, but
}
+inline
void lyxstring::Srep::replace(lyxstring::size_type i, lyxstring::size_type n,
value_type const * p, size_type n2)
{
memcpy(s + i, p, n2);
sz += n2;
} else {
-#ifdef NEW_ALLOC
do {
res *= 2;
} while (res < n2 + sz);
-#else
- res = sz + n2 + xtra;
-#endif
value_type * tmp = new value_type[res + 1];
memcpy(tmp, s, i);
memcpy(tmp + i, p, n2);
// NOTE: The easiest way to catch this snippet of the output is to wait for
// the splash screen to disappear and then open and close Help->Credits
//
+inline
lyxstringInvariant::lyxstringInvariant(lyxstring const * ls) : object(ls)
{
// printf("lyxstringInvariant constructor\n");
helper();
}
+
+inline
lyxstringInvariant::~lyxstringInvariant()
{
helper();
// printf("lyxstringInvariant destructor completed\n");
}
+
+inline
void lyxstringInvariant::helper() const
{
// Some of these tests might look pointless but they are
lyxstring::size_type const lyxstring::npos =
static_cast<lyxstring::size_type>(-1);
+
+inline
lyxstring::lyxstring()
{
static Srep empty_rep(0, "");
}
+inline
lyxstring::lyxstring(lyxstring const & x, size_type pos, size_type n)
{
Assert(pos <= x.rep->sz); // STD!
}
+inline
lyxstring::lyxstring(value_type const * s, size_type n)
{
Assert(s && n < npos); // STD!
}
+inline
lyxstring::lyxstring(value_type const * s)
{
Assert(s); // STD!
}
+inline
lyxstring::lyxstring(size_type n, value_type c)
{
Assert(n < npos); // STD!
}
+inline
lyxstring::lyxstring(const_iterator first, const_iterator last)
{
rep = new Srep(last - first, first);
}
+inline
lyxstring::~lyxstring()
{
if (--rep->ref == 0) delete rep;
// Iterators
///////////////////////
+inline
lyxstring::iterator lyxstring::begin()
{
return rep->s;
}
+inline
lyxstring::const_iterator lyxstring::begin() const
{
return rep->s;
}
+inline
lyxstring::iterator lyxstring::end()
{
return rep->s + rep->sz;
}
+inline
lyxstring::const_iterator lyxstring::end() const
{
return rep->s + rep->sz;
}
#if 0
+inline
reverse_iterator lyxstring::rbegin()
{
return reverse_iterator( end() );
}
+inline
const_reverse_iterator lyxstring::rbegin() const
{
return const_reverse_iterator( end() );
}
+inline
reverse_iterator lyxstring::rend()
{
return reverse_iterator( begin() );
}
+inline
const_reverse_iterator lyxstring::rend() const
{
return const_reverse_iterator( begin() );
// Size and Capacity
///////////////////////
+inline
lyxstring::size_type lyxstring::size() const
{
return rep->sz;
}
+inline
void lyxstring::resize(size_type n, value_type c)
{
Assert(n <= npos); // STD!
}
+inline
lyxstring::size_type lyxstring::capacity() const
{
return rep->res;
}
+inline
void lyxstring::reserve(size_type res_arg)
{
TestlyxstringInvariant(this);
// Assignment
////////////////
+inline
lyxstring & lyxstring::operator= (lyxstring const & x)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::operator= (value_type const * s)
{
Assert(s); // OURS!
}
+inline
lyxstring & lyxstring::operator=(value_type c)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::assign(lyxstring const & x)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::assign(lyxstring const & x, size_type pos, size_type n)
{
Assert(pos <= x.rep->sz); // STD!
}
+inline
lyxstring & lyxstring::assign(value_type const * s, size_type n)
{
Assert(s); // OURS!
}
+inline
lyxstring & lyxstring::assign(value_type const * s)
{
Assert(s); // OURS!
}
+inline
lyxstring & lyxstring::assign(size_type n, value_type ch)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::assign(const_iterator first, const_iterator last)
{
TestlyxstringInvariant(this);
// Element Access
////////////////////
+inline
lyxstring::const_reference lyxstring::operator[](size_type pos) const
{
Assert(pos <= rep->sz); // OURS!
}
+inline
lyxstring::reference lyxstring::operator[](size_type pos)
{
Assert(pos < rep->sz); // OURS!
}
+inline
lyxstring::const_reference lyxstring::at(size_type n) const
{
Assert(n < rep->sz); // STD!
}
+inline
lyxstring::reference lyxstring::at(size_type n)
{
Assert(n < rep->sz); // STD!
// Insert
/////////////
+inline
lyxstring & lyxstring::operator+=(lyxstring const & x)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::operator+=(value_type const * x)
{
Assert(x); // OURS!
}
+inline
lyxstring & lyxstring::operator+=(value_type c)
{
TestlyxstringInvariant(this);
}
+inline
void lyxstring::push_back(value_type c)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::append(lyxstring const & x)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::append(lyxstring const & x, size_type pos, size_type n)
{
Assert(pos <= x.rep->sz); // STD!
}
+inline
lyxstring & lyxstring::append(value_type const * p, size_type n)
{
Assert(p); // OURS!
}
+inline
lyxstring & lyxstring::append(value_type const * p)
{
Assert(p); // OURS!
}
+inline
lyxstring & lyxstring::append(size_type n, value_type c)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::append(iterator first, iterator last)
{
TestlyxstringInvariant(this);
// insert value_typeacters before (*this)[pos]
+inline
lyxstring & lyxstring::insert(size_type pos, lyxstring const & x)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::insert(size_type pos, lyxstring const & x,
size_type pos2, size_type n)
{
}
+inline
lyxstring & lyxstring::insert(size_type pos, value_type const * p, size_type n)
{
Assert(p); // OURS!
}
+inline
lyxstring & lyxstring::insert(size_type pos, value_type const * p)
{
Assert(p); // OURS!
}
+inline
lyxstring & lyxstring::insert(size_type pos, size_type n, value_type c)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring::iterator lyxstring::insert(iterator p, value_type c)
{
TestlyxstringInvariant(this);
}
+inline
void lyxstring::insert(iterator p, size_type n , value_type c)
{
TestlyxstringInvariant(this);
}
+inline
void lyxstring::insert(iterator p, iterator first, iterator last)
{
TestlyxstringInvariant(this);
// some of the parameters wrong, also some of the funcs can surely
// be written more effectively.
+inline
lyxstring::size_type lyxstring::find(lyxstring const & a, size_type i) const
{
if (!rep->sz || i >= rep->sz) return npos;
}
+inline
lyxstring::size_type lyxstring::find(value_type const * ptr, size_type i,
size_type n) const
{
}
+inline
lyxstring::size_type lyxstring::find(value_type const * s, size_type i) const
{
Assert(s); // OURS!
}
+inline
lyxstring::size_type lyxstring::find(value_type c, size_type i) const
{
if (!rep->sz || i >= rep->sz) return npos;
}
+inline
lyxstring::size_type lyxstring::rfind(lyxstring const & a, size_type i) const
{
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::rfind(value_type const * ptr, size_type i,
size_type n) const
{
}
+inline
lyxstring::size_type lyxstring::rfind(value_type const * ptr,
size_type i) const
{
}
+inline
lyxstring::size_type lyxstring::rfind(value_type c, size_type i) const
{
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::find_first_of(lyxstring const & a,
- size_type i) const
+ size_type i) const
{
Assert(i < rep->sz); // OURS!
TestlyxstringInvariant(this);
}
-lyxstring::size_type lyxstring::find_first_of(value_type const * ptr, size_type i,
- size_type n) const
+inline
+lyxstring::size_type lyxstring::find_first_of(value_type const * ptr,
+ size_type i,
+ size_type n) const
{
Assert(ptr && i < rep->sz); // OURS!
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::find_first_of(value_type const * ptr,
- size_type i) const
+ size_type i) const
{
Assert(ptr && i < rep->sz); // OURS!
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::find_first_of(value_type c, size_type i) const
{
Assert(i < rep->sz); // OURS!
}
+inline
lyxstring::size_type lyxstring::find_last_of(lyxstring const & a,
- size_type i) const
+ size_type i) const
{
TestlyxstringInvariant(this);
return npos;
}
-lyxstring::size_type lyxstring::find_last_of(value_type const * ptr, size_type i,
- size_type n) const
+
+inline
+lyxstring::size_type lyxstring::find_last_of(value_type const * ptr,
+ size_type i,
+ size_type n) const
{
Assert(ptr); // OURS!
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::find_last_of(value_type const * ptr,
- size_type i) const
+ size_type i) const
{
Assert(ptr); // OURS!
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::find_last_of(value_type c, size_type i) const
{
TestlyxstringInvariant(this);
}
+inline
lyxstring::size_type lyxstring::find_first_not_of(lyxstring const & a,
size_type i) const
{
}
+inline
lyxstring::size_type lyxstring::find_first_not_of(value_type const * ptr,
size_type i,
size_type n) const
}
+inline
lyxstring::size_type lyxstring::find_first_not_of(value_type const * ptr,
size_type i) const
{
}
+inline
lyxstring::size_type lyxstring::find_first_not_of(value_type c,
size_type i) const
{
}
+inline
lyxstring::size_type lyxstring::find_last_not_of(lyxstring const & a,
size_type i) const
{
}
+inline
lyxstring::size_type lyxstring::find_last_not_of(value_type const * ptr,
size_type i,
size_type n) const
}
+inline
lyxstring::size_type lyxstring::find_last_not_of(value_type const * ptr,
size_type i) const
{
}
+inline
lyxstring::size_type lyxstring::find_last_not_of(value_type c,
size_type i) const
{
// Replace
/////////////////
+inline
lyxstring & lyxstring::replace(size_type i, size_type n, lyxstring const & x)
{
Assert(i <= rep->sz); // OURS!
}
+inline
lyxstring & lyxstring::replace(size_type i, size_type n, lyxstring const & x,
size_type i2, size_type n2)
{
}
+inline
lyxstring & lyxstring::replace(size_type i, size_type n,
value_type const * p, size_type n2)
{
}
+inline
lyxstring & lyxstring::replace(size_type i, size_type n, value_type const * p)
{
Assert(p && i < rep->sz); // OURS!
}
+inline
lyxstring & lyxstring::replace(size_type i, size_type n,
size_type n2, value_type c)
{
}
+inline
lyxstring & lyxstring::replace(iterator i, iterator i2, const lyxstring & str)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring & lyxstring::replace(iterator i, iterator i2,
value_type const * p, size_type n)
{
}
+inline
lyxstring & lyxstring::replace(iterator i, iterator i2, value_type const * p)
{
Assert(p); // OURS!
}
+inline
lyxstring & lyxstring::replace(iterator i, iterator i2,
size_type n , value_type c)
{
}
+inline
lyxstring & lyxstring::replace(iterator i, iterator i2,
iterator j, iterator j2)
{
}
+inline
void lyxstring::swap(lyxstring & str)
{
if (rep == str.rep) return;
}
+inline
lyxstring & lyxstring::erase(size_type i, size_type n)
{
Assert(i <= rep->sz); // STD!
}
+inline
lyxstring::iterator lyxstring::erase(iterator i)
{
TestlyxstringInvariant(this);
}
+inline
lyxstring::iterator lyxstring::erase(iterator first, iterator last)
{
TestlyxstringInvariant(this);
// Conversion to C-style Strings
/////////////////////////////////////
+inline
lyxstring::value_type const * lyxstring::c_str() const
{
rep->s[length()] = '\0';
}
+inline
lyxstring::value_type const * lyxstring::data() const
{
return rep->s;
}
+inline
lyxstring::size_type lyxstring::copy(value_type * buf, size_type len,
size_type pos) const
{
// Compare funcs should be verified.
+inline
int lyxstring::internal_compare(size_type pos, size_type n,
value_type const * s,
size_type slen, size_type n2) const
}
+inline
int lyxstring::compare(lyxstring const & str) const
{
TestlyxstringInvariant(this);
}
+inline
int lyxstring::compare(value_type const * s) const
{
Assert(s); //OURS!
}
-int lyxstring::compare(size_type pos, size_type n, lyxstring const & str) const
+inline
+int lyxstring::compare(size_type pos, size_type n,
+ lyxstring const & str) const
{
Assert(pos <= rep->sz); // OURS!
TestlyxstringInvariant(this);
}
+inline
int lyxstring::compare(size_type pos, size_type n, lyxstring const & str,
size_type pos2, size_type n2) const
{
}
+inline
int lyxstring::compare(size_type pos, size_type n, value_type const * s,
size_type n2) const
{
/////////////////
// i = index, n = length
+inline
lyxstring lyxstring::substr(size_type i, size_type n) const
{
Assert(i <= rep->sz); // STD!
return is;
}
+
ostream & operator<<(ostream & o, lyxstring const & s)
{
return o.write(s.data(), s.length());
}
+
istream & getline(istream & is, lyxstring & s,
lyxstring::value_type delim)
{
size_type size() const;
/// largest possible string
- size_type max_size() const { return npos -1; }
+ size_type max_size() const { return npos - 1; }
///
size_type length() const { return size(); }
}
-void LyXTable::Write(FILE* file)
+void LyXTable::Write(ostream & os)
{
int i, j;
- fprintf(file, "multicol5\n");
- fprintf(file, "%d %d %d %d %d %d %d %d\n", rows, columns, is_long_table,
- rotate, endhead, endfirsthead, endfoot, endlastfoot);
- for (i = 0; i<rows; i++){
- fprintf(file, "%d %d %d %d\n", row_info[i].top_line,
- row_info[i].bottom_line, row_info[i].is_cont_row,
- row_info[i].newpage);
+ os << "multicol5\n"
+ << rows << " " << columns << " " << is_long_table << " "
+ << rotate << " " << endhead << " " << endfirsthead << " "
+ << endfoot << " " << endlastfoot << "\n";
+ for (i = 0; i < rows; ++i) {
+ os << row_info[i].top_line << " "
+ << row_info[i].bottom_line << " "
+ << row_info[i].is_cont_row << " "
+ << row_info[i].newpage << "\n";
}
- for (i = 0; i<columns; i++){
- fprintf(file, "%d %d %d \"%s\" \"%s\"\n",
- column_info[i].alignment, column_info[i].left_line,
- column_info[i].right_line,
- VSpace(column_info[i].p_width).asLyXCommand().c_str(),
- column_info[i].align_special.c_str());
+ for (i = 0; i < columns; ++i) {
+ os << column_info[i].alignment << " "
+ << column_info[i].left_line << " "
+ << column_info[i].right_line << " \""
+ << VSpace(column_info[i].p_width).asLyXCommand() << "\" \""
+ << column_info[i].align_special << "\"\n";
}
- for (i = 0; i<rows;i++){
- for (j = 0;j<columns;j++){
- fprintf(file, "%d %d %d %d %d %d %d \"%s\" \"%s\"\n",
- cell_info[i][j].multicolumn,
- cell_info[i][j].alignment,
- cell_info[i][j].top_line,
- cell_info[i][j].bottom_line,
- cell_info[i][j].has_cont_row,
- cell_info[i][j].rotate,
- cell_info[i][j].linebreaks,
- cell_info[i][j].align_special.c_str(),
- cell_info[i][j].p_width.c_str());
+ for (i = 0; i < rows; ++i) {
+ for (j = 0; j < columns; ++j) {
+ os << cell_info[i][j].multicolumn << " "
+ << cell_info[i][j].alignment << " "
+ << cell_info[i][j].top_line << " "
+ << cell_info[i][j].bottom_line << " "
+ << cell_info[i][j].has_cont_row << " "
+ << cell_info[i][j].rotate << " "
+ << cell_info[i][j].linebreaks << " \""
+ << cell_info[i][j].align_special << "\" \""
+ << cell_info[i][j].p_width << "\"\n";
}
}
}
-void LyXTable::Read(FILE* file)
+
+void LyXTable::Read(FILE * file)
{
int version;
int i, j;
fscanf(file, "%s\n", vtmp);
s = vtmp;
if (s.length() > 8)
- version = atoi(s.c_str()+8);
+ version = atoi(s.c_str() + 8);
else
version = 1;
#ifdef WITH_WARNINGS
// cell <0 will tex the preamble
// returns the number of printed newlines
-int LyXTable::RoffEndOfCell(FILE* file, int cell)
+int LyXTable::RoffEndOfCell(ostream & os, int cell)
{
int i, j;
int ret = 0;
if (cell == GetNumberOfCells() - 1){
// the very end at the very beginning
if (CellHasContRow(cell) >= 0) {
- fprintf(file, "\nT}");
- ret++;
+ os << "\nT}";
+ ++ret;
}
- fprintf(file, "\n");
+ os << "\n";
ret++;
if (row_info[row_of_cell(cell)].bottom_line) {
- fprintf(file, "_\n");
- ret++;
+ os << "_\n";
+ ++ret;
}
- fprintf(file, ".TE\n.pl 1c");
+ os << ".TE\n.pl 1c";
} else {
if (cell < 0){
int fcell = 0;
// preamble
- fprintf(file, "\n.pl 500c\n.TS\n");
- for (j = 0; j<rows; j++) {
- for (i = 0; i<columns;i++, fcell++) {
+ os << "\n.pl 500c\n.TS\n";
+ for (j = 0; j<rows; ++j) {
+ for (i = 0; i<columns; ++i, ++fcell) {
if (column_info[i].left_line)
- fprintf(file, " | ");
+ os << " | ";
if (cell_info[j][i].multicolumn == CELL_PART_OF_MULTICOLUMN)
- fprintf(file, "s");
+ os << "s";
else {
switch (column_info[i].alignment) {
case LYX_ALIGN_LEFT:
- fprintf(file, "l");
+ os << "l";
break;
case LYX_ALIGN_RIGHT:
- fprintf(file, "r");
+ os << "r";
break;
default:
- fprintf(file, "c");
+ os << "c";
break;
}
}
if (!column_info[i].p_width.empty())
- fprintf(file, "w(%s)", column_info[i].p_width.c_str());
+ os << "w(" << column_info[i].p_width << ")";
if (column_info[i].right_line)
- fprintf(file, " | ");
+ os << " | ";
}
- if ((j+1) < rows) {
- fprintf(file, "\n");
- ret++;
+ if ((j + 1) < rows) {
+ os << "\n";
+ ++ret;
}
}
- fprintf(file, ".\n");
- ret++;
+ os << ".\n";
+ ++ret;
if (row_info[0].top_line) {
- fprintf(file, "_\n");
- ret++;
+ os << "_\n";
+ ++ret;
}
if (CellHasContRow(0) >= 0) {
- fprintf(file, "T{\n");
- ret++;
+ os << "T{\n";
+ ++ret;
}
} else {
// usual cells
if (CellHasContRow(cell) >= 0) {
- fprintf(file, "\nT}");
- ret++;
+ os << "\nT}";
+ ++ret;
}
if (right_column_of_cell(cell) == columns -1){
- fprintf(file, "\n");
- ret++;
+ os << "\n";
+ ++ret;
int row = row_of_cell(cell);
if (row_info[row++].bottom_line) {
- fprintf(file, "_\n");
- ret++;
+ os << "_\n";
+ ++ret;
}
if ((row < rows) && row_info[row].top_line) {
- fprintf(file, "_\n");
- ret++;
+ os << "_\n";
+ ++ret;
}
} else
- fprintf(file, "\t");
+ os << "\t";
if ((cell < GetNumberOfCells() - 1) &&
(CellHasContRow(cell+1) >= 0)) {
- fprintf(file, "T{\n");
- ret++;
+ os << "T{\n";
+ ++ret;
}
}
}
return ret;
}
+
char const *LyXTable::getDocBookAlign(int cell, bool isColumn)
{
int i;
#include "lyxlex.h"
#include "LString.h"
+
/* The features the text class offers for tables */
///
///
LyXTable(int columns_arg, int rows_arg);
///
- LyXTable(LyXLex &lex);
+ LyXTable(LyXLex & lex);
///
~LyXTable();
///
- LyXTable* Clone();
+ LyXTable * Clone();
/// Returns true if there is a topline, returns false if not
bool TopLine(int cell);
void Init(int columns_arg, int rows_arg);
///
- void Write(FILE* file);
+ void Write(ostream &);
///
- void Read(FILE* file);
+ void Read(FILE * file);
// cell <0 will tex the preamble
// returns the number of printed newlines
///
int TexEndOfCell(string & file, int cell);
///
- int RoffEndOfCell(FILE* file, int cell);
+ int RoffEndOfCell(ostream &, int cell);
///
- char const *getDocBookAlign(int cell, bool isColumn= false);
+ char const * getDocBookAlign(int cell, bool isColumn = false);
///
- int DocBookEndOfCell(string &file, int cell, int &depth);
+ int DocBookEndOfCell(string & file, int cell, int & depth);
///
bool IsMultiColumn(int cell);
///
int width_of_cell;
///
- char multicolumn; // add approp. signedness
+ int multicolumn; // add approp. signedness
///
- char alignment; // add approp. signedness
+ int alignment; // add approp. signedness
///
bool top_line;
///
};
///
struct columnstruct {
- char alignment; // add approp. signedness
+ int alignment; // add approp. signedness
bool left_line;
bool right_line;
int width_of_column;
///
int numberofcells;
///
- int* rowofcell;
+ int * rowofcell;
///
- int* columnofcell;
+ int * columnofcell;
///
void set_row_column_number_info();
///
- rowstruct *row_info;
+ rowstruct * row_info;
///
- columnstruct *column_info;
+ columnstruct * column_info;
///
- cellstruct** cell_info;
+ cellstruct ** cell_info;
///
int width_of_table;
///
int right_column_of_cell(int cell);
///
- cellstruct* cellinfo_of_cell(int cell);
+ cellstruct * cellinfo_of_cell(int cell);
///
void delete_column(int column);
string Trans::process(char c, TransManager & k)
{
- lyxerr << "enter process" << endl;
char dummy[2] = "?";
char * dt = dummy;
char * t = Match(c);
- lyxerr << "finished variables" << endl;
if ((t == 0 && (dt[0] = c)) || (t[0] != 0 && (dt = t)) ){
- lyxerr << "normalkey" << endl;
return k.normalkey(c, dt);
} else {
- lyxerr << "deadkey" << endl;
return k.deadkey(c, *kmod_list_[(tex_accent)t[1]]);
}
}
void TransManager::TranslateAndInsert(char c, LyXText * text)
{
- string res;
-
- res = active_->process(c,*this);
+ string res = active_->process(c, *this);
// Process with tokens
string temp;