]> git.lyx.org Git - features.git/commitdiff
in addition to the changes mentioned in ChangeLog, there is the usual batch of whites...
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 1 Dec 1999 00:57:31 +0000 (00:57 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 1 Dec 1999 00:57:31 +0000 (00:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@344 a592a061-630c-0410-9148-cb99ea01b6c8

121 files changed:
ChangeLog
images/arrows.xbm
images/banner.xpm
images/banner_bw.xbm
images/bold_bw.xpm
images/bop.xbm
images/brel.xbm
images/build.xpm
images/close.xpm
images/close_bw.xpm
images/copy.xpm
images/copy_bw.xpm
images/cut.xpm
images/cut_bw.xpm
images/deco.xbm
images/deco.xpm
images/delim.xbm
images/delim.xpm
images/delim0.xpm
images/depth.xpm
images/depth_bw.xpm
images/dots.xbm
images/down.xpm
images/emph.xpm
images/emph_bw.xpm
images/equation.xpm
images/fig.xpm
images/fig_bw.xpm
images/foot.xpm
images/frac.xpm
images/free.xpm
images/free_bw.xpm
images/greek.xbm
images/layout_code.xpm
images/layout_latex.xpm
images/layout_scrap.xpm
images/layout_sec.xpm
images/layout_std.xpm
images/lyx.xpm
images/make_ascii_bw.xpm
images/make_latex_bw.xpm
images/margin.xpm
images/margin_bw.xpm
images/math.xpm
images/math_bw.xpm
images/matrix.xpm
images/melt.xpm
images/melt_bw.xpm
images/misc.xbm
images/noun.xpm
images/noun_bw.xpm
images/open.xpm
images/open_bw.xpm
images/paste.xpm
images/paste_bw.xpm
images/print1.xpm
images/print1_bw.xpm
images/quit.xpm
images/quit_bw.xpm
images/run_latex_bw.xpm
images/sans_bw.xpm
images/save.xpm
images/save_bw.xpm
images/smallcaps.xpm
images/smallcaps_bw.xpm
images/space.xpm
images/sqrt.xpm
images/tab.xpm
images/tab_bw.xpm
images/tex.xpm
images/tex_bw.xpm
images/typeset_ps.xpm
images/typeset_ps_bw.xpm
images/unknown.xpm
images/unknown_bw.xpm
images/up.xpm
images/varsz.xbm
images/view_dvi_bw.xpm
images/view_ps_bw.xpm
lib/images/amssymb.xbm
lib/images/amssymb.xpm
lib/images/psnfss1.xbm
lib/images/psnfss1.xpm
lib/images/psnfss2.xbm
lib/images/psnfss2.xpm
lib/images/psnfss3.xbm
lib/images/psnfss3.xpm
lib/images/psnfss4.xbm
lib/images/psnfss4.xpm
lib/images/standard.xbm
lib/images/standard.xpm
lib/lyxrc.example
src/BufferView.C
src/LaTeX.C
src/LyXAction.C
src/LyXView.C
src/bmtable.C
src/bmtable.h
src/bufferparams.C
src/commandtags.h
src/insets/figinset.C
src/layout.C
src/layout.h
src/lyx_cb.C
src/lyx_main.C
src/lyxfont.C
src/lyxfunc.C
src/lyxlex.C
src/lyxlex.h
src/lyxrc.C
src/lyxrc.h
src/mathed/array.h
src/mathed/math_draw.C
src/mathed/math_iter.C
src/mathed/math_iter.h
src/mathed/math_panel.C
src/mathed/math_panel.h
src/mathed/math_symbols.C
src/support/filetools.C
src/toolbar.C
src/toolbar.h

index 65da35043beccdd47e66e461cc81fc1af9775180..c893aaa30aa70abcf766bd300e71e4e70b8c006b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,57 @@
+1999-12-01  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/support/filetools.C (ExpandPath): removed an over eager
+       Assert.
+       (ReplaceEnvironmentPath): ditto
+
+       * src/toolbar.C (BubbleTimerCB): use C++ style casts. This clearly
+       shows that we are doing something fishy in our code...
+       (BubblePost): ditto
+       (ToolbarCB): ditto
+
+       * src/lyxrc.C (read): use a double switch trick to get more help
+       from the compiler. (the same trick is used in layout.C)
+       (write): new function. opens a ofstream and pass that to output
+       (output): new function, takes a ostream and writes the lyxrc
+       elemts to it. uses a dummy switch to make sure no elements are
+       forgotten. 
+
+       * src/lyxlex.h: added a struct pushpophelper for use in functions
+       with more than one exit point.
+
+       * src/lyxlex.[Ch] (GetInteger): made it const
+       (GetFloat): ditto
+       (GetBool): ditto
+
+       * src/lyxfunc.C (Dispatch): added case for LFUN_SAVEPREFERENCES
+
+       * src/layout.[hC] : LayoutTags splitted into several enums, new
+       methods created, better error handling cleaner use of lyxlex. Read
+       the diff.
+
+       * src/bmtable.[Ch]: change some member prototypes because of the
+       image const changes. 
+
+       * commandtags.h, src/LyXAction.C (init): new function:
+       "preferences-save", saves the lyxrc entries into .lyx/preferences.
+       This file is not read automatically but you can add \input
+       preferences to your lyxrc if you want to. We need to discuss how
+       to handle this. 
+
+       * src/LaTeX.C (runBibTeX): use regex to match for the needed lines
+       in .aux, also remove .bib and .bst files from dependencies when
+       running bibtex.
+
+       * src/BufferView.C, src/LyXView.C: add const_cast several places
+       because of changes to images.
+
+       * lib/images/*: same change as for images/*
+       
+       * lib/lyxrc.example: Default for accept_compound is false not no.
+
+       * images/*: changed to be const, however I have som misgivings
+       about this change so it might be changed back.
+
 1999-11-26  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lib/configure, po/POTFILES.in: regenerated
index e2583222135aa77347935d6f6d6afe7357d04b4d..3b5a3cbd36276173cfd2d3a4ca73436e81edd43e 100644 (file)
@@ -1,6 +1,6 @@
 #define arrow_width 185
 #define arrow_height 143
-static unsigned char arrow_bits[] = {
+static unsigned char const arrow_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -232,7 +232,7 @@ static unsigned char arrow_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe};
 #define darrow_width 73
 #define darrow_height 73
-static unsigned char darrow_bits[] = {
+static unsigned char const darrow_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,
@@ -284,7 +284,7 @@ static unsigned char darrow_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe};
 #define larrow_width 103
 #define larrow_height 126
-static unsigned char larrow_bits[] = {
+static unsigned char const larrow_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
index ec82c130aa5d57074eb69febdd54cfefb793d75d..422ec2d5795c5b673c6da2e1ae69aaf3731e7f28 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *banner[] = {
+static char const * banner[] = {
 /* width height num_colors chars_per_pixel */
 "   424   289       16            1",
 /* colors */
index 8bd089e3322325a35eec4da4a3ec033fb2500c84..8fd8ca1bf60fd8280a29717b61b7e47b1cbf9d4f 100644 (file)
@@ -1,6 +1,6 @@
 #define banner_bw_width 424
 #define banner_bw_height 289
-static unsigned char banner_bw_bits[] = {
+static unsigned char const banner_bw_bits[] = {
  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
index 467bd7d2b05af2e99540f1132ae2dcca9e5405ce..d484d886d22ff4f5b3de5219db1a8764c25435e5 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * bold_xpm[] = {
+static char const * bold_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index d4b43979f2c7db5b9672684ac3aefe0a15f9aba5..9783aa9b70438c371db4f94d9d9d8010acdaea0b 100644 (file)
@@ -1,6 +1,6 @@
 #define bop_width 118
 #define bop_height 259
-static unsigned char bop_bits[] = {
+static unsigned char const bop_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
index b67d064ecde565513c69f7b0d405495a630cd171..e9acc3968e407c0457b7c139d2af0c6769c9981a 100644 (file)
@@ -1,6 +1,6 @@
 #define brel_width 123
 #define brel_height 291
-static unsigned char brel_bits[] = {
+static unsigned char const brel_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index caf50d240bc88d3432a4caffdd3555986b8e5c87..6f091d5b0c377b1c0c466568c72fec3bf088beac 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *build_xpm[] = {
+static char const * build_xpm[] = {
 "20 20 4 1",
 ".     c black",
 "      c #BFBFBFBFBFBF",
index df60955c4cacfc4ef278590b8c578c8cb9639384..752a72c8e07255a81b01805d5bffba553724fd14 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * close_xpm[] = {
+static char const * close_xpm[] = {
 "20 20 5 1",
 "      c #BFBFBFBFBFBF",
 ".     c #7B7B00000000",
index e1a7b6999da944012e23a6b0821df407aa51520f..aa5f54423bdf2d64889d09f25d942e4fde38d05e 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * close_xpm[] = {
+static char const * close_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index 2e2a16bd3296e6ca7ba3ba186dd9c73b8062aae6..f6e7abae1fa4eabb140f3e62cc0b876c7dbdc02c 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * copy_xpm[] = {
+static char const * copy_xpm[] = {
 "20 20 5 1",
 "      c #000000000000",
 ".     c #BFBFBFBFBFBF",
index 48778e66115ae2792b7072bd956013769e4d354e..296e842944e6ecce0c933a01adcf475dd71db3ef 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * copy_xpm[] = {
+static char const * copy_xpm[] = {
 "20 20 5 1",
 "      c black",
 ".     c #BFBFBFBFBFBF",
index 4848412b3032d5ccc74cc91d23579318e9aaeffa..0ea70262b089f79eb4b48b7faded93c23c31f390 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * cut_xpm[] = {
+static char const * cut_xpm[] = {
 "20 20 3 1",
 "     c #BFBFBFBFBFBF",
 ".    c #000000000000",
index 82d189a48ff1ee6e85e6c949afcb670dd7692a82..9c303975fc0bdf0c31074126d1e70698abb3bb2a 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * cut_xpm[] = {
+static char const * cut_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 1e3c70554c9f8bf58b80cf3525912a7dc97423d4..e975cd335a65a0f892ccaf4e2901ae4be58e8457 100644 (file)
@@ -1,6 +1,6 @@
 #define deco_width 137
 #define deco_height 90
-static unsigned char deco_bits[] = {
+static unsigned char const deco_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
index 30232848e798f6e499b6be59f024673633cc6a5e..8b068be0613d28227534e52cb95ab35c1e068432 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * deco[] = {
+static char const * deco[] = {
 "20 20 3 1",
 "      c #BEFBBEFBBEFB",
 ".     c #000000000000",
index 2f81b46c31a516cfa74440ebe124fd7aaa585cc4..04283fe1dcac97c025490338b2bb29dd93da817b 100644 (file)
@@ -1,6 +1,6 @@
 #define delim_width 164
 #define delim_height 136
-static unsigned char delim_bits[] = {
+static unsigned char const delim_bits[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
index 73fdf6bc3958cb4f4a32b0a2dbebe7c1b7bb550b..f875f548e5e13e80f5fc0c2ae6d7e40258f14487 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *delim[] = {
+static char const * delim[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        3            1",
 /* colors */
index 0b6d87521cbc0ae9b773c09770fb9b1f1b6998f2..91369eda809eebcccd011d8ff01992427f728ebd 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *delim0[] = {
+static char const * delim0[] = {
 /* width height num_colors chars_per_pixel */
 "    31    31        2            1",
 /* colors */
@@ -10,8 +10,8 @@ static char *delim0[] = {
 "###############################",
 "###############################",
 "###############################",
-"#######a#######################",
-"######a#############aa#########",
+"#######a###########a###########",
+"######a#############a##########",
 "#####a###############a#########",
 "#####a################a########",
 "####a##################a#######",
index bdaab372c6da47c0af942b7feab364cb3dd73436..1acee58000aeb10c6f0a0a5e34737ca34a814437 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * depth_xpm[] = {
+static char const * depth_xpm[] = {
 "20 20 5 1",
 "      c gray60",
 ".     c #000000000000",
index 08cc4cf761c896e0f75e7a6e329dc35b17dcc956..ea51b3c86d5a0971d57fc1b217320dc8ff3f1861 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * depth_xpm[] = {
+static char const * depth_xpm[] = {
 "20 20 3 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index a5520abbf0c3ca5211b14cf86e9a91a8fc3e80d2..e94cfe5f40d230b3797416e3503f5af3238c475c 100644 (file)
@@ -1,6 +1,6 @@
 #define dots_width 72
 #define dots_height 18
-static unsigned char dots_bits[] = {
+static unsigned char const dots_bits[] = {
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
index c6c90b78fb776f26a94dbc3f1cd137776c71877d..7d2be365c513d62d2a6f007651f3ff0a2a646c7e 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *down_xpm[] = {
+static char const * down_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "    11    11        4            1",
 /* colors */
index 03e15ff1da7e3465306a3c9f0fd1c902106d545c..15439b3c428fe0eb334976139f26b88df64df3ff 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * emph_xpm[] = {
+static char const * emph_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 03e15ff1da7e3465306a3c9f0fd1c902106d545c..15439b3c428fe0eb334976139f26b88df64df3ff 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * emph_xpm[] = {
+static char const * emph_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 39d9991fa8be04b10f350000cc29d737718b3e6c..bcdfcf812cfdf4524ee9b9c49f45001eb81cd07d 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *equation[] = {
+static char const * equation[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        3            1",
 /* colors */
index 9f8a0fb0fd60a2ca446aa2de6edfc28576b6f55b..6a7c9bcf9ef75c5f92f9c5b32b74e073474b8fd5 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * fig_xpm[] = {
+static char const * fig_xpm[] = {
 "20 20 4 1",
 "      c #000000000000",
 ".     c #FFFFFFFFFFFF",
index 45f7449ad717a36999a0a7b2fea10d0a3855ba9c..a7c63848dd396879528369a18e35c7fd26ec247c 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * fig_xpm[] = {
+static char const * fig_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index f27888b372356406326797da7f1560c3f8763fed..7972a0f4852e1f08e5eba51b0a55a9637a8de5eb 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * foot_xpm[] = {
+static char const * foot_xpm[] = {
 "20 20 4 1",
 "      c gray60",
 ".     c #000000000000",
index 30696d5f092f2c183bec9f57cc7657f9a2d0dc5c..9ab90164c29e908af181182c74460bb90b1c213e 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *frac[] = {
+static char const * frac[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        3            1",
 /* colors */
index 1a81e962b5d52e5cb71b226dddf8f7ba902b2ffd..3377eab419d24fcd5f659001546e0e5151bbdd99 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * free_xpm[] = {
+static char const * free_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 0e2a58e2079e0c1dc560dd04cb9606dfff829e62..570ca15a0bc5b45444976106a4396ae7302c8c1b 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * free_xpm[] = {
+static char const * free_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index ce4e98645a140d0cf6034c2e19a0aa3d18ce089f..2a8ee67605a118f2c7fa8ad3f437c1e3440ce051 100644 (file)
@@ -1,6 +1,6 @@
 #define Greek_width 182
 #define Greek_height 60
-static unsigned char Greek_bits[] = {
+static unsigned char const Greek_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index d5be2fc4098f8056d1aec77db736bd23d93b7e89..9d0f6bf640b15c188a0c6704cde5df7d0676450a 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * layout_code_xpm[] = {
+static char const * layout_code_xpm[] = {
 "20 20 4 1",
 "      c gray50",
 ".     c black",
index b541b8ad9246fd7f39676ee16279335cd290a126..f38f2620f1b8276044967e4c4c5af162f50d7bf8 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * layout_latex_xpm[] = {
+static char const * layout_latex_xpm[] = {
 "20 20 4 1",
 "      c gray60",
 ".     c #000000000000",
index 13f98e75e18f7116dc9872b2cb6516e6adbb43d1..49b0c5d701921f25113ab2570e5f2e356f2437dd 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *layout_scrap_xpm[] = {
+static char const * layout_scrap_xpm[] = {
 " 20 20 3 1",
 ". c gray30",
 "  c #BFBFBFBFBFBF",
index 2c2568e3ecf2c1ab537a3523db7acec07bfa045f..022d46dca15dfb1cecdb639d61e28514ccbc2963 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * layout_sec_xpm[] = {
+static char const * layout_sec_xpm[] = {
 "20 20 4 1",
 "      c gray60",
 ".     c #000000000000",
index a689d7d97d702c8186251e416c7ec47a80f1c495..8ff7965ef8c7bdf77858a97dad21f78ddd65a471 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * layout_std_xpm[] = {
+static char const * layout_std_xpm[] = {
 "20 20 3 1",
 "      c gray50",
 ".     c #000000000000",
index 7ebf4d4dee67fedd32730dc0b58011f2be8eb0e9..8a8911afe0038537c15453b26ab45611272349d9 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *lyx_xpm[] = {
+static char const * lyx_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "    48    48        7            1",
 /* colors */
index ce13a18615c65a61001a2aec87aba85e55f311f5..a75398fd3de13086cdda63d3f42be7cd5f655d32 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * make_ascii_xpm[] = {
+static char const * make_ascii_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c black",
index 737366c4b57486e47153eb498b683e4dbf54c25d..088c96699b80e76e981386f174f22bd0b2b7fd68 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * make_latex_xpm[] = {
+static char const * make_latex_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c black",
index c5af2f161221929adf480f2b46a1edd78e110e03..874e3d7b898ccf43278f1fd51406e0d8fa9db881 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * margin_xpm[] = {
+static char const * margin_xpm[] = {
 "20 20 5 1",
 "      c gray60",
 ".     c #000000000000",
index bc63ad6873e53e5cc3798ee901a14fab1674cd51..4f038ce66742887db99aa5fa31a78ec1ade055f1 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * margin_xpm[] = {
+static char const * margin_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index cfa9f0d936e992957be25fdb15f8b78662657666..89a3d14f415194a45bdb519fe9a59d9a040b560b 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * math_xpm[] = {
+static char const * math_xpm[] = {
 "20 20 4 1",
 "      c #BFBFBFBFBFBF",
 ".     c #242423238E8E",
index e520016eafa8c832b3ad6b175eb40fd8c4d19377..65083cca270db632ff27ae57672c70276408a7e7 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * math_xpm[] = {
+static char const * math_xpm[] = {
 /**/
 "20 20 2 1",
 /*33333333333*/
index d64b69fb3296cf16f98ca886f078e888ccef2670..0809afbef1965c417ac7e297d9a1c644b8b84777 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *matrix[] = {
+static char const * matrix[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        2            1",
 /* colors */
index b12cd5f551e24f939903bf46d80c2ae28083d3dc..f2af56490196fb91c95a9b1765e24b3998235445 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * melt_xpm[] = {
+static char const * melt_xpm[] = {
 "20 20 5 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index a929502bed5f3fce904caf67dd64621646d4a34d..41e30f2433c2372e0cdb46310788a402d348314d 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * melt_xpm[] = {
+static char const * melt_xpm[] = {
 /**/
 "20 20 2 1",
 /*33333333333*/
index ce861e978ae96d24a30c416b1bf87fa2ec12c83f..ff1b50eaac753f51c3e45a2da2f35df518906bf8 100644 (file)
@@ -1,6 +1,6 @@
 #define misc_width 150
 #define misc_height 193
-static unsigned char misc_bits[] = {
+static unsigned char const misc_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 693e56f676e5988ec915f0ea73acfada3fd0c8e4..0b0f40701c7c571e3972b5246ac9833246f08ea4 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * noun_xpm[] = {
+static char const * noun_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index eb3207d13754de28b7d580a9be0fd0336fa08a82..511a2f24162b1023433cb490bf3b159808c62718 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * noun_xpm[] = {
+static char const * noun_xpm[] = {
 /**/
 "20 20 2 1",
 /*÷F¼\ 4÷FÃd÷FÄD÷FÆôges/delim.xbm*/
index 71e599a0a03e75aee7a429f556890d710bde7d62..591c8bcfad690243d242ae650d5c449c3a0fc458 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * open_xpm[] = {
+static char const * open_xpm[] = {
 "20 20 5 1",
 "      c #BFBFBFBFBFBF",
 ".     c navy",
index 075d78dc6e5bec3a13ea0241110b9fb6280667fd..89c6813555c5cb4ed2dd44bf13e5ce18d380c04a 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * open_xpm[] = {
+static char const * open_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index f2a8b010e540226fad235ae8f62be484e9975241..17eae2594f0993af123fe70a511b97d4a67eb50a 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * paste_xpm[] = {
+static char const * paste_xpm[] = {
 "20 20 6 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index d6c8e43de6b31c53d3130e234d5e1bad38efa076..b502a22d71dc5e44d8063cd481273049b970f554 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * paste_xpm[] = {
+static char const * paste_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index 00fb398dfc31f18c43ad34364245559c668d3de9..21d823790bef39d490595186ad43c182bae2eb2c 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * print1_xpm[] = {
+static char const * print1_xpm[] = {
 "24 20 7 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index fbad75f38b2152fce11590b0bf9fdcdea48501ce..3b230baf447944b335c1fb37bbd4d506edaa2a11 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * print1_xpm[] = {
+static char const * print1_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "24 20 2 1",
 /* colors */
index 9b02c5f7ac22a695f4bf273d24e1192ef1ccef5d..c07adfde5d9a3eb8d2e393cc27f30d0a82b06426 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *quit_xpm[] = {
+static char const * quit_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        7            1",
 /* colors */
index a546cc4ca83a7be8eaaff98b78cb5ef1a48ab7bf..092fbdbe3c9a02a16ef81e609ec32806008655e8 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * quit_xpm[] = {
+static char const * quit_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /* colors */
index ab4a3d5c8bd93f6c4a1056c090b9b408f3aaebe1..6986dc6a789c7bcf37573c1eb03ba99b2041af03 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * run_latex_xpm[] = {
+static char const * run_latex_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 11e6dbf4538eaad6f244c253949b9d18c5a1a575..3ec1a95833fe5a67eadd67ae5a2d933b5c430c58 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * sans_xpm[] = {
+static char const * sans_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index dc0004b77340ecb5711429fcb685922fd5facfa7..b60de2266819720866a5cd66b1caf1e46d124e4d 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * save_xpm[] = {
+static char const * save_xpm[] = {
 "20 20 5 1",
 "      c #BFBFBFBFBFBF",
 ".     c black",
index e1e439fdcd92870a4898ad974814a16d4db236a6..85590e382c68283314403e96edd1f71f9eb7dd6b 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * save_xpm[] = {
+static char const * save_xpm[] = {
 /*\80\10*/
 "20 20 2 1",
 /**/
index 53219c4ddc5c9e3c8a78ff1b02db6791fd96973c..c408cf105bc364b1b2f31d3566878ed891195746 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * smallcaps_xpm[] = {
+static char const * smallcaps_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 4534ce795e94b2861f343e9de6ffe0e7dccc0636..4f3b339ed1a5c8c26592f5105bb9b224261be549 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * smallcaps_xpm[] = {
+static char const * smallcaps_xpm[] = {
 /**/
 "20 20 2 1",
 /**/
index de5c74b4acfe5c13a88fdb9f83b04841952af04a..8fe7e7ff61fd5b337ee4954737883e33c473cb92 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * space_xpm[] = {
+static char const * space_xpm[] = {
 "20 20 2 1",
 "      c #BEFBBEFBBEFB",
 ".     c #FBEE14514103",
index 1278646a8fde60f72a201690d1e259c95a487f93..a1dda93f723d50196b1e8afe57262f9ec8d16eac 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *sqrt[] = {
+static char const * sqrt[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        3            1",
 /* colors */
index 56e8c447fd74168bc78f46af9e4096d33dd3d841..bd7e66e5aacfc275b5a3a12821d66c926346aa16 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * tab_xpm[] = {
+static char const * tab_xpm[] = {
 "20 20 3 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 3096b09776ce539fa632c015dec88c96ee9ad0e9..742c40e5cc46cbe0df24b60867c4328da33d49f5 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * tab_xpm[] = {
+static char const * tab_xpm[] = {
 /*.e:*/
 "20 20 2 1",
 /**/
index 36565942135866d1e03d8b004c21a68c7ee48edf..d107cf90ab025523a974735e0043f375d59d4a80 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * tex_xpm[] = {
+static char const * tex_xpm[] = {
 "20 20 2 1",
 "      c #BEFBBEFBBEFB",
 ".     c #7B7B00000000",
index 692654b3ef043becfb281319b1edd3ce67b02f3c..f7e904795b881d85d1f654d285a3f5180e54c26b 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * tex_xpm[] = {
+static char const * tex_xpm[] = {
 /*.e:*/
 "20 20 2 1",
 /**/
index eeb4fee6bd532e2b62a767e75c07eeb8434e6247..1deb0b0192d96860fa91b379234c2d972561f945 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * update_ps_xpm[] = {
+static char const * update_ps_xpm[] = {
 "20 20 3 1",
 " c #BFBFBFBFBFBF",
 ".c navy",
index 7462c52a4ceb8b9e1e362dee9e986c916079b976..98f2eb1f36031c371c2f674c4ef401e169d5eb35 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * update_ps_xpm[] = {
+static char const * update_ps_xpm[] = {
 "20 20 2 1",
 "       c #BFBFBFBFBFBF",
 ".      c black",
index 4f1b8aad479fc6931cc5e326f2090fe9e20ba037..4771cca01f7cca8b18570f34c3462b61681c172a 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *unknown_xpm[] = {
+static char const * unknown_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "    20    20        2            1",
 /* colors */
index d4df02a83023b8fa0f3a4bb8cf20455b6d592337..8cfa0594fa8b77b68b2ccd9396fd9c9475ae0c26 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * unknown_xpm[] = {
+static char const * unknown_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "20 20 2 1",
 /**/
index c98b1986d61b0aedac2104edd7dec4029e4df2d7..411fd83ea906e9e4b3fe008b7e0e8b0819e90711 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *up_xpm[] = {
+static char const * up_xpm[] = {
 /* width height num_colors chars_per_pixel */
 "    11    11        4            1",
 /* colors */
index 7f6d55c1703a0360f0ccd882c6584a3b9fa2fc34..d2291c57b75a4d5b0259c70f4d0aa7c63544b44a 100644 (file)
@@ -1,6 +1,6 @@
 #define varsz_width 110
 #define varsz_height 192
-static unsigned char varsz_bits[] = {
+static unsigned char const varsz_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,
index 6d0805f34aa48e5492f62542073579cc895d8289..d1b71b313f33c34706a7e77d3027a7639d5df50f 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * view_dvi_xpm[] = {
+static char const * view_dvi_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 5cdc5dcaacacb1094f94ce3d49ffb0592cc93919..090086b1fa33e073676e17a26eb0b15536533821 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char * view_ps_xpm[] = {
+static char const * view_ps_xpm[] = {
 "20 20 2 1",
 "      c #BFBFBFBFBFBF",
 ".     c #000000000000",
index 49db34d917f0a047b251fc942798d28bc12ec86b..404fb01e192d6c324259a39d623f7b08162fda37 100644 (file)
@@ -1,6 +1,6 @@
 #define amssymb_width 264
 #define amssymb_height 174
-static char amssymb_bits[] = {
+static char const amssymb_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 164db267c1d09ee1820e59356d1e9ed557f40f43..50e81704c388b7e5107d7faf03a5839d9ce652ea 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *amssymb[] = {
+static char const * amssymb[] = {
 /* width height num_colors chars_per_pixel */
 "   264   174       16            1",
 /* colors */
index 7498b56e437ddffe769352ade56df02d18439e71..f321ab3c63c02afcbaacfbf94267da7cc036b23c 100644 (file)
@@ -1,6 +1,6 @@
 #define psnfss1_width 264
 #define psnfss1_height 174
-static char psnfss1_bits[] = {
+static char const psnfss1_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 6e932b2e51b6565b3ddafa87894d65020a879f87..deb02b95a5010e4f8b0fae02aa58f18b0490e84d 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *psnfss1[] = {
+static char const * psnfss1[] = {
 /* width height num_colors chars_per_pixel */
 "   264   174       16            1",
 /* colors */
index 60aaf59f484b18bf24eb99cb19f3c04c4ce1b1dd..c69d3257c1da8c971b5f93f8c23aac707e36dd95 100644 (file)
@@ -1,6 +1,6 @@
 #define psnfss2_width 264
 #define psnfss2_height 174
-static char psnfss2_bits[] = {
+static char const psnfss2_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 6cc00fc3e2d1a8f47bb25caa369059f3a5e17b03..ed1fa33bfa8ba8926c9ec144ca32276de3d51bdd 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *psnfss2[] = {
+static char const * psnfss2[] = {
 /* width height num_colors chars_per_pixel */
 "   264   174       16            1",
 /* colors */
index 69e0e5953752e90510a8a72b5f3eadb729a96d32..56a5c7581ff94e5c2e380cd259a40f58f7afa104 100644 (file)
@@ -1,6 +1,6 @@
 #define psnfss3_width 264
 #define psnfss3_height 174
-static char psnfss3_bits[] = {
+static char const psnfss3_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 544e6ac54d2ff38c3882a28854649850ac648c9c..5fc491715bc6ac1aa409d6e29d481d7c4108a437 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *psnfss3[] = {
+static char const * psnfss3[] = {
 /* width height num_colors chars_per_pixel */
 "   264   174       16            1",
 /* colors */
index 04f7c5e16f10e5d3e233badb01568518f987c540..76b687a2e02ea1c172bfde8cd2d1ca6b0ac6e523 100644 (file)
@@ -1,6 +1,6 @@
 #define psnfss4_width 264
 #define psnfss4_height 174
-static char psnfss4_bits[] = {
+static char const psnfss4_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 55ea13b80a7b3322eef42b40456c1f2e5da4d7ca..5d91ef5a4352147941c3fb48e7d2d985c9cf6625 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *psnfss4[] = {
+static char const * psnfss4[] = {
 /* width height num_colors chars_per_pixel */
 "   264   174       16            1",
 /* colors */
index 11775f6b004afd312ee9b7e5782bffa8c64e3af8..4950f9113ab19f9c3ccdfd9e2a09f35051a374b2 100644 (file)
@@ -1,6 +1,6 @@
 #define standard_width 264
 #define standard_height 174
-static char standard_bits[] = {
+static char const standard_bits[] = {
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
index 235f465bc025c5a3155183ed84bc20eef07a8058..6b2b23dc8dc19c939e12a6951f83fe4dc9a984b6 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *standard[] = {
+static char const * standard[] = {
 /* width height num_colors chars_per_pixel */
 "   264   174       16            1",
 /* colors */
index 36d8e5df0d5fd56c90b6be651a38d079bbdc86e2..4f1aab670b65b5ef3a0ff9f07dd5eb5b9f888949 100644 (file)
 #\spell_command aspell
 
 # Consider run-together words, such as "notthe" for "not the", as legal 
-# words? Default is no
+# words? Default is false
 #\accept_compound true
 
 # Specify an alternate language. The default is to use the language of 
index 852ab7d0164f7ed628b3433598ca0527ab2cc50a..1db4d7fd7009e0366d59dc39c0b7dad377f98198 100644 (file)
@@ -437,7 +437,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
        fl_set_object_gravity(obj, NorthEastGravity, NorthEastGravity);
        fl_set_object_callback(obj, C_BufferView_UpCB, 0);
        obj->u_vdata = this;
-       fl_set_pixmapbutton_data(obj, up_xpm);
+       fl_set_pixmapbutton_data(obj, const_cast<char**>(up_xpm));
 
 #if FL_REVISION > 85
        // Remove the blue feedback rectangle
@@ -473,7 +473,7 @@ void BufferView::create_view(int xpos, int ypos, int width, int height)
        fl_set_object_gravity(obj, SouthEastGravity, SouthEastGravity);
        fl_set_object_callback(obj, C_BufferView_DownCB, 0);
        obj->u_vdata = this;
-       fl_set_pixmapbutton_data(obj, down_xpm);
+       fl_set_pixmapbutton_data(obj, const_cast<char**>(down_xpm));
        fl_set_border_width(-bw);
 
 #if FL_REVISION >85
index 2689756f611567fd7d648777f3a57e0c8a2572b1..5bd72091c8a93cb9abed6de9b7a35e3825b74a3b 100644 (file)
@@ -379,14 +379,17 @@ bool LaTeX::runBibTeX(string const & file, DepTable & dep)
        ifstream ifs(file.c_str());
        string token;
        bool using_bibtex = false;
+       LRegex reg1("\\\\bibdata{([^}]+)}");
+       LRegex reg2("\\\\bibstyle{([^}]+)}");
        while (getline(ifs, token)) {
-               if (contains(token, "\\bibdata{")) {
+               if (reg1.exact_match(token)) {
                        using_bibtex = true;
-                       string::size_type a = token.find("\\bibdata{") + 9;
-                       string::size_type b = token.find_first_of("}", a);
-                       string data = token.substr(a, b - a);
+                       LRegex::SubMatches const & sub = reg1.exec(token);
+                       string data = LSubstring(token, sub[1].first,
+                                                sub[2].second);
                        // data is now all the bib files separated by ','
                        // get them one by one and pass them to the helper
+                       string::size_type b;
                        do {
                                b = data.find_first_of(',', 0);
                                string l;
@@ -400,26 +403,26 @@ bool LaTeX::runBibTeX(string const & file, DepTable & dep)
                                        findtexfile(
                                                ChangeExtension(l, "bib", false),
                                                "bib");
-                               lyxerr << "data = `"
-                                      << full_l << "'" << endl;
+                               lyxerr[Debug::LATEX] << "Bibtex database: `"
+                                                    << full_l << "'" << endl;
                                if (!full_l.empty()) {
                                        // add full_l to the dep file.
                                        dep.insert(full_l, true);
                                }
                        } while (b != string::npos);
-               } else if (contains(token, "\\bibstyle{")) {
+               } else if (reg2.exact_match(token)) {
                        using_bibtex = true;
-                       string::size_type a = token.find("\\bibstyle{") + 10;
-                       string::size_type b = token.find_first_of("}", a);
-                       string style = token.substr(a, b - a);
+                       LRegex::SubMatches const & sub = reg2.exec(token);
+                       string style = LSubstring(token, sub[1].first,
+                                                 sub[1].second);
                        // token is now the style file
                        // pass it to the helper
                        string full_l = 
                                findtexfile(
                                        ChangeExtension(style, "bst", false),
                                        "bst");
-                       lyxerr << "style = `"
-                              << full_l << "'" << endl;
+                       lyxerr[Debug::LATEX] << "Bibtex style: `"
+                                            << full_l << "'" << endl;
                        if (!full_l.empty()) {
                                // add full_l to the dep file.
                                dep.insert(full_l, true);
index c817c01c9a55d0b6a616c7b46b62d115c87863ec..78822779fa31b63d6d2731101d3e7116a70e1cc8 100644 (file)
@@ -138,8 +138,6 @@ void LyXAction::init()
                _("Export to"), ReadOnly);
        newFunc(LFUN_FAX,"buffer-fax",
                _("Fax"), ReadOnly);
-       //newFunc(LFUN_INSERTFLOAT,"float-insert",
-       //      "", Noop);
        newFunc(LFUN_INSERTFOOTNOTE, "buffer-float-insert", "", Noop);
        newFunc(LFUN_IMPORT,"buffer-import",
                _("Import document"), NoBuffer);
@@ -153,8 +151,6 @@ void LyXAction::init()
                _("Open"), NoBuffer);
        newFunc(LFUN_PREVBUFFER,"buffer-previous",
                _("Switch to previous document"), ReadOnly);
-        //newFunc(LFUN_SWITCHBUFFER,"buffer-switch",
-        //        _("Switch to an open document"), ReadOnly);
        newFunc(LFUN_MENUPRINT,"buffer-print",
                _("Print"), ReadOnly);
        newFunc(LFUN_MENURELOAD,"buffer-reload",
@@ -348,8 +344,6 @@ void LyXAction::init()
                "", Noop);
        newFunc(LFUN_MATH_MODE,"math-mode",
                _("Math mode"), Noop);
-       //newFunc(LFUN_MATH_PANEL,"math-panel",
-       //      _("Math panel"), Noop);
        newFunc(LFUN_MATH_NONUMBER,"math-nonumber",
                "", Noop);
        newFunc(LFUN_MATH_NUMBER,"math-number",
@@ -379,8 +373,10 @@ void LyXAction::init()
                 _("Select previous paragraph"), ReadOnly);
        newFunc(LFUN_PARENTINSERT,"parent-insert",
                "", Noop);
-       newFunc( LFUN_PASTE,"paste",
+       newFunc(LFUN_PASTE,"paste",
                _("Paste") , Noop);
+       newFunc(LFUN_SAVEPREFERENCES, "preferences-save",
+               "Save Preferences", NoBuffer);
        newFunc(LFUN_PASTESELECTION,"primary-selection-paste",
                "", Noop);
        newFunc(LFUN_PROTECTEDSPACE,"protected-space-insert",
index 7124619326bd0ab350e6d60362d3580f9234b2e5..ad9e37c922fe36276f9c248b20d79354de61f9bd 100644 (file)
@@ -232,7 +232,7 @@ FD_form_main * LyXView::create_form_form_main(int width, int height)
         unsigned int w, h;
         Pixmap lyx_p, lyx_mask;
         lyx_p = fl_create_from_pixmapdata(fl_root,
-                                         lyx_xpm,
+                                         const_cast<char**>(lyx_xpm),
                                          &w,
                                          &h,
                                          &lyx_mask,
index 63a6c945f1756d9b22eca7dce97f4f8340cde978..6b218f21e15577e1b872ba58fc9c6f549ed974ef 100644 (file)
@@ -224,10 +224,10 @@ extern "C" int handle_bitmaptable(FL_OBJECT *ob, int event, FL_Coord mx,
  * 
  * The user could change these later. See below.
  */ 
-void fl_set_bmtable_data(FL_OBJECT *ob, int nx, int ny, int bw, int bh, 
-                       unsigned char * bdata)
+void fl_set_bmtable_data(FL_OBJECT * ob, int nx, int ny, int bw, int bh, 
+                       unsigned char const * bdata)
 {
-   BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
+   BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
    if (sp) {
      sp->nx = nx;
      sp->ny = ny; 
@@ -244,10 +244,10 @@ void fl_set_bmtable_data(FL_OBJECT *ob, int nx, int ny, int bw, int bh,
 }
 
 
-void fl_set_bmtable_pixmap_data(FL_OBJECT *ob, int nx, int ny,
-                       char **pdata)
+void fl_set_bmtable_pixmap_data(FL_OBJECT * ob, int nx, int ny,
+                       char ** pdata)
 {
-       BMTABLE_SPEC *sp = (BMTABLE_SPEC *)ob->spec;
+       BMTABLE_SPEC * sp = (BMTABLE_SPEC *)ob->spec;
        extern Colormap color_map;
        if (sp) {
                sp->nx = nx;
index 7b26b692ca75c584b50c6d1a7b6d42cc0b113749..937b8c112b6c546fb1b5c4d9bb56abb7c2f2b25b 100644 (file)
@@ -47,7 +47,7 @@ int fl_get_bmtable_numb(FL_OBJECT *ob);
 void fl_set_bmtable(FL_OBJECT *, int pushed, int pos);
 
 /** Number of columns and rows, and the background bitmap */
-void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int , unsigned char *);
+void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int , unsigned char const *);
 ///
 void fl_set_bmtable_pixmap_data(FL_OBJECT *, int, int, char **);
 ///
index f475b97410840359c3be2ff30221aa4ac7d4964e..435f7e8310e11b1098c486c042bec2247aebbac5 100644 (file)
@@ -200,13 +200,11 @@ void BufferParams::readPreamble(LyXLex & lex)
 
 void BufferParams::readLanguage(LyXLex & lex)
 {
-       string tmptok;
-       string test;
-       int n = 0;
-       
        if (!lex.next()) return;
        
-       tmptok = lex.GetString();
+       string tmptok = lex.GetString();
+       string test;
+       int n = 0;
        // check if tmptok is part of tex_babel in tex-defs.h
        while (true) {
                test = tex_babel[n++];
index 271805279b59200b5f9df81b93140cfee17d6488..5cbe5a0350cfb89caaf256e0024cecc9c4f41dc3 100644 (file)
@@ -237,10 +237,11 @@ enum kb_action {
        LFUN_URL,                       // CFO-G 971121
        LFUN_WORDFINDFORWARD,           // Etienne 980216
        LFUN_WORDFINDBACKWARD,          // Etienne 980220
-       LFUN_APPENDIX, // ettrich 980505
+       LFUN_APPENDIX,                  // ettrich 980505
        LFUN_IMPORT,                    // Asger 980724
        LFUN_MENU_SEPARATOR,            // Asger 990220
-       LFUN_SEQUENCE,            // Andre' 991111
+       LFUN_SEQUENCE,                  // Andre' 991111
+       LFUN_SAVEPREFERENCES,           // Lgb 991127
        LFUN_LASTACTION  /* this marks the end of the table */
 };
 
index d1b55bd76a8a19a1d91239e4bf4fb85652aaeae7..fd8ab266891a0d1adb902d49007ec5aef66e453e 100644 (file)
@@ -714,8 +714,7 @@ static void runqueue()
 static void addwait(int psx, int psy, int pswid, int pshgh, figdata *data)
 {
        // recompute the stuff and put in the queue
-       queue *p, *p2;
-       p = new queue;
+       queue * p = new queue;
        p->ofsx = psx;
        p->ofsy = psy;
        p->rx = ((float)data->raw_wid*72)/pswid;
@@ -725,7 +724,7 @@ static void addwait(int psx, int psy, int pswid, int pshgh, figdata *data)
        p->next = 0;
 
        // now put into queue
-       p2 = gsqueue;
+       queue * p2 = gsqueue;
        if (!gsqueue) gsqueue = p;
        else {
                while (p2->next) p2 = p2->next;
@@ -737,17 +736,15 @@ static void addwait(int psx, int psy, int pswid, int pshgh, figdata *data)
 }
 
 
-static figdata *getfigdata(int wid, int hgh, string const & fname, 
-                          int psx, int psy, int pswid, int pshgh, 
-                          int raw_wid, int raw_hgh, float angle, char flags)
+static figdata * getfigdata(int wid, int hgh, string const & fname, 
+                           int psx, int psy, int pswid, int pshgh, 
+                           int raw_wid, int raw_hgh, float angle, char flags)
 {
        /* first search for an exact match with fname and width/height */
-       int i = 0;
-       figdata *p;
-       XWindowAttributes wa;
 
        if (fname.empty()) return 0;
 
+       int i = 0;
        while (i < bmpinsref) {
                if (bitmaps[i]->wid == wid && bitmaps[i]->hgh == hgh &&
                    bitmaps[i]->flags == flags && bitmaps[i]->fname == fname &&
@@ -762,12 +759,12 @@ static figdata *getfigdata(int wid, int hgh, string const & fname,
        if (bmpinsref > bmparrsize) {
                // allocate more space
                bmparrsize += figallocchunk;
-               figdata **tmp = (figdata**) malloc(sizeof(figdata*)*bmparrsize);
+               figdata ** tmp = (figdata**) malloc(sizeof(figdata*)*bmparrsize);
                memcpy(tmp, bitmaps, sizeof(figdata*)*(bmparrsize-figallocchunk));
                free(bitmaps);
                bitmaps = tmp;
        }
-       p = new figdata;
+       figdata * p = new figdata;
        bitmaps[bmpinsref-1] = p;
        p->wid = wid;
        p->hgh = hgh;
@@ -776,6 +773,7 @@ static figdata *getfigdata(int wid, int hgh, string const & fname,
        p->angle = angle;
        p->fname = fname;
        p->flags = flags;
+       XWindowAttributes wa;
        XGetWindowAttributes(fl_display, fl_get_canvas_id(
                figinset_canvas), &wa);
 
@@ -815,34 +813,29 @@ static void getbitmap(figdata *p)
 
 static void makeupdatelist(figdata *p)
 {
-       int i;
-
-       for (i = 0; i < figinsref; ++i) if (figures[i]->data == p) {
-               if (lyxerr.debugging()) {
-                       lyxerr << "Updating inset " << figures[i]->inset
-                              << endl;
+       for (int i = 0; i < figinsref; ++i)
+               if (figures[i]->data == p) {
+                       if (lyxerr.debugging()) {
+                               lyxerr << "Updating inset "
+                                      << figures[i]->inset
+                                      << endl;
+                       }
+                       //UpdateInset(figures[i]->inset);
+                       // add inset figures[i]->inset into to_update list
+                       PutInsetIntoInsetUpdateList(figures[i]->inset);
                }
-               //UpdateInset(figures[i]->inset);
-               // add inset figures[i]->inset into to_update list
-               PutInsetIntoInsetUpdateList(figures[i]->inset);
-       }
 }
 
 
-void sigchldchecker(pid_t pid, int *status)
+void sigchldchecker(pid_t pid, int * status)
 {
-       int i;
-       figdata *p;
-
-       bool pid_handled = false;
-       
        lyxerr.debug() << "Got pid = " << pid << endl;
-       pid_handled = false;
-       for (i = bmpinsref - 1; i >= 0; --i) {
+       bool pid_handled = false;
+       for (int i = bmpinsref - 1; i >= 0; --i) {
                if (bitmaps[i]->reading && pid == bitmaps[i]->gspid) {
                        lyxerr.debug() << "Found pid in bitmaps" << endl;
                        // now read the file and remove it from disk
-                       p = bitmaps[i];
+                       figdata * p = bitmaps[i];
                        p->reading = false;
                        if (bitmaps[i]->gsdone) *status = 0;
                        if (*status == 0) {
@@ -877,7 +870,7 @@ void sigchldchecker(pid_t pid, int *status)
        }
        if (!pid_handled) {
                lyxerr.debug() << "Checking pid in pidwait" << endl;
-               pidwait *p = pw, *prev = 0;
+               pidwait * p = pw, * prev = 0;
                while (p) {
                        if (pid == p->pid) {
                                lyxerr.debug() << "Found pid in pidwait" << endl;
@@ -926,9 +919,8 @@ void sigchldchecker(pid_t pid, int *status)
 
 static void getbitmaps()
 {
-       int i;
        bitmap_waiting = false;
-       for (i = 0; i < bmpinsref; ++i)
+       for (int i = 0; i < bmpinsref; ++i)
                if (bitmaps[i]->gspid > 0 && !bitmaps[i]->reading)
                        getbitmap(bitmaps[i]);
 }
@@ -936,8 +928,6 @@ static void getbitmaps()
 
 static void RegisterFigure(InsetFig *fi)
 {
-       Figref *tmpfig;
-
        if (figinsref == 0) InitFigures();
        fi->form = 0;
        ++figinsref;
@@ -949,7 +939,7 @@ static void RegisterFigure(InsetFig *fi)
                free(figures);
                figures = tmp;
        }
-       tmpfig = new Figref;
+       Figref * tmpfig = new Figref;
        tmpfig->data = 0;
        tmpfig->inset = fi;
        figures[figinsref-1] = tmpfig;
@@ -962,7 +952,7 @@ static void RegisterFigure(InsetFig *fi)
 }
 
 
-int FindFigIndex(Figref *tmpfig)
+int FindFigIndex(Figref * tmpfig)
 {
        int i = 0;
        while (i < figinsref) {
@@ -973,10 +963,9 @@ int FindFigIndex(Figref *tmpfig)
 }
 
 
-static void UnregisterFigure(InsetFig *fi)
+static void UnregisterFigure(InsetFig * fi)
 {
-       Figref *tmpfig = fi->figure;
-       int i;
+       Figref * tmpfig = fi->figure;
 
        if (tmpfig->data) freefigdata(tmpfig->data);
        if (tmpfig->inset->form) {
@@ -993,7 +982,7 @@ static void UnregisterFigure(InsetFig *fi)
                tmpfig->inset->form = 0;
 #endif
        }
-       i = FindFigIndex(tmpfig);
+       int i = FindFigIndex(tmpfig);
        --figinsref;
        while (i < figinsref) {
                figures[i] = figures[i+1];
@@ -1005,9 +994,9 @@ static void UnregisterFigure(InsetFig *fi)
 }
 
 
-static char* NextToken(FILE *myfile)
+static char * NextToken(FILE * myfile)
 {
-       char* token = 0;
+       char * token = 0;
        char c;
        int i = 0;
    
@@ -1024,7 +1013,7 @@ static char* NextToken(FILE *myfile)
 }
 
 
-InsetFig::InsetFig(int tmpx, int tmpy, Buffer *o)
+InsetFig::InsetFig(int tmpx, int tmpy, Buffer * o)
        : owner(o)
 {
        wid = tmpx;
@@ -1051,25 +1040,25 @@ InsetFig::~InsetFig()
 }
 
 
-int InsetFig::Ascent(LyXFont const&) const
+int InsetFig::Ascent(LyXFont const &) const
 {
        return hgh + 3;
 }
 
 
-int InsetFig::Descent(LyXFont const&) const
+int InsetFig::Descent(LyXFont const &) const
 {
        return 1;
 }
 
 
-int InsetFig::Width(LyXFont const&) const
+int InsetFig::Width(LyXFont const &) const
 {
        return wid + 2;
 }
 
 
-void InsetFig::Draw(LyXFont font, LyXScreen &scr, int baseline, float &x)
+void InsetFig::Draw(LyXFont font, LyXScreen & scr, int baseline, float & x)
 {
        if (bitmap_waiting) getbitmaps();
 
@@ -1119,7 +1108,7 @@ void InsetFig::Draw(LyXFont font, LyXScreen &scr, int baseline, float &x)
 }
 
 
-void InsetFig::Write(FILE *file)
+void InsetFig::Write(FILE * file)
 {
        Regenerate();
        fprintf(file, "Figure size %d %d\n", wid, hgh);
@@ -1138,7 +1127,7 @@ void InsetFig::Write(FILE *file)
 }
 
 
-void InsetFig::Read(LyXLex &lex)
+void InsetFig::Read(LyXLex & lex)
 {
        string buf;
        bool finished = false;
@@ -1222,7 +1211,7 @@ void InsetFig::Read(LyXLex &lex)
 }
 
 
-int InsetFig::Latex(FILE *file, signed char /* fragile*/ )
+int InsetFig::Latex(FILE * file, signed char /* fragile*/ )
 {
        Regenerate();
        if (!cmd.empty()) fprintf(file, "%s ", cmd.c_str());
@@ -1230,7 +1219,7 @@ int InsetFig::Latex(FILE *file, signed char /* fragile*/ )
 }
 
 
-int InsetFig::Latex(string &file, signed char /* fragile*/ )
+int InsetFig::Latex(string & file, signed char /* fragile*/ )
 {
        Regenerate();
        file += cmd + ' ';
@@ -1244,7 +1233,7 @@ int InsetFig::Linuxdoc(string &/*file*/)
 }
 
 
-int InsetFig::DocBook(string &file)
+int InsetFig::DocBook(string & file)
 {
        string figurename= fname;
 
@@ -1256,7 +1245,7 @@ int InsetFig::DocBook(string &file)
 }
 
 
-void InsetFig::Validate(LaTeXFeatures &features) const
+void InsetFig::Validate(LaTeXFeatures & features) const
 {
        features.graphics = true;
        if (subfigure) features.subfigure = true;
@@ -1354,7 +1343,6 @@ Inset::Code InsetFig::LyxCode() const
 void InsetFig::Regenerate()
 {
        string cmdbuf;
-       string gcmd;
        string resizeW, resizeH;
        string rotate, recmd;
 
@@ -1369,7 +1357,7 @@ void InsetFig::Regenerate()
        string buf1 = OnlyPath(owner->getFileName());
        string fname2 = MakeRelPath(fname, buf1);
 
-       gcmd = "\\includegraphics{" + fname2 + '}';
+       string gcmd = "\\includegraphics{" + fname2 + '}';
        
        switch (wtype) {
        case DEF:
@@ -1479,20 +1467,15 @@ void InsetFig::Regenerate()
 
 void InsetFig::TempRegenerate()
 {
-       string gcmd;
        string cmdbuf;
        string resizeW, resizeH;
        string rotate, recmd;
-       string tsubcap;
        
-       char const *tfname; // *textra;
-       float tangle, txwid, txhgh;
-
-       tfname = fl_get_input(form->EpsFile);
-       tsubcap = fl_get_input(form->Subcaption);
-       tangle = atof(fl_get_input(form->Angle));
-       txwid = atof(fl_get_input(form->Width));
-       txhgh = atof(fl_get_input(form->Height));
+       char const * tfname = fl_get_input(form->EpsFile);
+       string tsubcap = fl_get_input(form->Subcaption);
+       float tangle = atof(fl_get_input(form->Angle));
+       float txwid = atof(fl_get_input(form->Width));
+       float txhgh = atof(fl_get_input(form->Height));
 
        if (!tfname || !*tfname) {
                //fl_set_object_label(form->cmd, "");
@@ -1506,7 +1489,7 @@ void InsetFig::TempRegenerate()
        string buf1 = OnlyPath(owner->getFileName());
        string fname2 = MakeRelPath(tfname, buf1);
        // \includegraphics*[<llx,lly>][<urx,ury>]{file}
-       gcmd = "\\includegraphics{" + fname2 + '}';
+       string gcmd = "\\includegraphics{" + fname2 + '}';
        
        switch (twtype) {
        case DEF:
@@ -1604,25 +1587,20 @@ void InsetFig::TempRegenerate()
                cmdbuf = string("\\subfigure{") + tsubcap
                  + string("}{") + cmdbuf + "}";
        }
-
-       
-       //fl_set_object_label(form->cmd, cmdbuf.c_str());
-       //fl_redraw_object(form->cmd);
 }
 
 
 void InsetFig::Recompute()
 {
        bool changed = changedfname;
-       int newx, newy, nraw_x, nraw_y, frame_wid, frame_hgh;
-       float sin_a, cos_a;
+       int newx, newy, nraw_x, nraw_y;
 
        if (changed) GetPSSizes();
 
-       sin_a = sin (angle / DEG2PI);        /* rotation; H. Zeller 021296 */
-       cos_a = cos (angle / DEG2PI);
-       frame_wid = (int) ceil (fabs(cos_a * pswid) + fabs(sin_a * pshgh));
-       frame_hgh= (int) ceil (fabs(cos_a * pshgh) + fabs(sin_a * pswid));
+       float sin_a = sin (angle / DEG2PI);  /* rotation; H. Zeller 021296 */
+       float cos_a = cos (angle / DEG2PI);
+       int frame_wid = (int) ceil (fabs(cos_a * pswid) + fabs(sin_a * pshgh));
+       int frame_hgh= (int) ceil (fabs(cos_a * pshgh) + fabs(sin_a * pswid));
 
        /* now recompute wid and hgh, and if that is changed, set changed */
        /* this depends on chosen size of the picture and its bbox */
@@ -1702,7 +1680,7 @@ void InsetFig::Recompute()
        subfigure = psubfigure;
 
        if (changed) {
-               figdata *pf = figure->data;
+               figdata * pf = figure->data;
 
                // get new data
                if (!fname.empty() && (flags & 3) && !lyxrc->ps_command.empty()) {
@@ -1726,7 +1704,6 @@ void InsetFig::GetPSSizes()
 {
 #warning rewrite this method to use ifstream
        /* get %%BoundingBox: from postscript file */
-       int lastchar, c;
        char * p = 0;
        
        /* defaults to associated size
@@ -1749,9 +1726,9 @@ void InsetFig::GetPSSizes()
        pswid = 595;
        pshgh = 842;
 
-       lastchar = fgetc(f);
+       int lastchar = fgetc(f);
        for (;;) {
-               c = fgetc(f);
+               int c = fgetc(f);
                if (c == EOF) {
                        lyxerr.debug() << "End of (E)PS file reached and"
                                " no BoundingBox!" << endl;
@@ -1798,7 +1775,7 @@ void InsetFig::GetPSSizes()
 void InsetFig::CallbackFig(long arg)
 {
        bool regen = false;
-       char const *p;
+       char const * p;
 
        if (lyxerr.debugging()) {
                printf("Figure callback, arg %ld\n", arg);
@@ -1907,8 +1884,7 @@ void InsetFig::CallbackFig(long arg)
                break;
        case 7:                         /* apply */
        case 8:                         /* ok (apply and close) */
-               if(!current_view->buffer()->isReadonly())
-               {
+               if(!current_view->buffer()->isReadonly()) {
                        wtype = twtype;
                        htype = thtype;
                        xwid = atof(fl_get_input(form->Width));
@@ -1968,6 +1944,7 @@ void InsetFig::CallbackFig(long arg)
        if (regen) TempRegenerate();
 }
 
+
 inline void DisableFigurePanel(FD_Figure * const form)
 {
         fl_deactivate_object(form->EpsFile);
@@ -2003,6 +1980,7 @@ inline void DisableFigurePanel(FD_Figure * const form)
        fl_set_object_lcol (form->ApplyBtn, FL_INACTIVE);
 }
 
+
 inline void EnableFigurePanel(FD_Figure * const form)
 {
         fl_activate_object(form->EpsFile);
@@ -2038,10 +2016,10 @@ inline void EnableFigurePanel(FD_Figure * const form)
        fl_set_object_lcol (form->ApplyBtn, FL_BLACK);
 }
 
+
 void InsetFig::RestoreForm()
 {
        char buf[32];
-       int pflags;
 
        EnableFigurePanel(form);
 
@@ -2070,7 +2048,7 @@ void InsetFig::RestoreForm()
                fl_activate_object(form->Height);
        }
 
-       pflags = flags & 3;
+       int pflags = flags & 3;
        fl_set_button(form->Wysiwyg0, (pflags == 0));
        fl_set_button(form->Wysiwyg1, (pflags == 1));
        fl_set_button(form->Wysiwyg2, (pflags == 2));
@@ -2100,11 +2078,9 @@ void InsetFig::RestoreForm()
 }
 
 
-void InsetFig::Preview(char const *p)
+void InsetFig::Preview(char const * p)
 {
-       int pid;
-
-       pid = fork();
+       int pid = fork();
 
        if (pid == -1) {
                lyxerr << "Cannot fork process!" << endl;
@@ -2129,7 +2105,6 @@ void InsetFig::Preview(char const *p)
 
 void InsetFig::BrowseFile()
 {
-       string buf, buf2, bufclip;
        static string current_figure_path;
        static int once = 0;
        LyXFileDlg fileDlg;
@@ -2140,8 +2115,8 @@ void InsetFig::BrowseFile()
        }
        string p = fl_get_input(form->EpsFile);
 
-       buf = MakeAbsPath(owner->getFileName());
-       buf2 = OnlyPath(buf);
+       string buf = MakeAbsPath(owner->getFileName());
+       string buf2 = OnlyPath(buf);
        if (!p.empty()) {
                buf = MakeAbsPath(p, buf2);
                buf = OnlyPath(buf);
@@ -2150,7 +2125,7 @@ void InsetFig::BrowseFile()
        }
        
        // Does user clipart directory exist?
-       bufclip = AddName (user_lyxdir, "clipart");     
+       string bufclip = AddName (user_lyxdir, "clipart");      
        FileInfo fileInfo(bufclip);
        if (!(fileInfo.isOK() && fileInfo.isDir()))
          // No - bail out to system clipart directory
@@ -2191,7 +2166,7 @@ void InsetFig::BrowseFile()
 }
 
 
-void GraphicsCB(FL_OBJECT *obj, long arg)
+void GraphicsCB(FL_OBJECT * obj, long arg)
 {
        /* obj->form contains the form */
 
index a90d2ecb493daf57d4e2d5930a01d9e66c3c999d..899f10baa089645df4608ba0a74c4afa67513964 100644 (file)
@@ -47,35 +47,48 @@ void LyXSetStyle()
 //  The order of the LayoutTags enum is no more important. [asierra300396]
 // Tags indexes.
 enum LayoutTags {
-       LT_ALIGN, LT_ALIGNPOSSIBLE, 
-       LT_BLOCK, LT_MARGIN,
-       LT_BOTTOMSEP, LT_CENTER, LT_CENTERED_TOP_ENVIRONMENT, LT_COLUMNS,
-       LT_COPYSTYLE, LT_OBSOLETEDBY,
-       LT_COMMAND, LT_COUNTER_CHAPTER, LT_COUNTER_ENUMI, LT_COUNTER_ENUMII,
-       LT_COUNTER_ENUMIII, LT_COUNTER_ENUMIV, LT_COUNTER_PARAGRAPH,
-       LT_COUNTER_SECTION, LT_COUNTER_SUBPARAGRAPH, LT_COUNTER_SUBSECTION,
-       LT_COUNTER_SUBSUBSECTION, LT_DEFAULTFONT, LT_DYNAMIC, LT_EMPTY,
-       LT_END, LT_ENVIRONMENT, LT_ENVIRONMENT_DEFAULT, 
-       LT_FANCYHDR, LT_FILL_BOTTOM, LT_FILL_TOP, LT_FIRST_COUNTER,
-       LT_FIRST_DYNAMIC, LT_FONT, LT_FREE_SPACING, LT_HEADINGS, LT_INPUT,
-       LT_ITEM_ENVIRONMENT, LT_ITEMSEP, LT_KEEPEMPTY,
-       LT_LABEL_BOTTOMSEP, LT_LABELFONT, LT_TEXTFONT,
-       LT_LABELINDENT, LT_LABELSEP, LT_LABELSTRING,
-       LT_LABELSTRING_APPENDIX, LT_LABELTYPE,
-       LT_LATEXNAME, LT_LATEXPARAM, LT_LATEXTYPE, LT_LAYOUT, LT_LEFT,
-       LT_LEFTMARGIN,
-       LT_LIST_ENVIRONMENT , LT_MANUAL, LT_MAXCOUNTER, 
-       LT_NEED_PROTECT, LT_NEWLINE,
-       LT_NEXTNOINDENT, LT_NO_LABEL, LT_NOSTYLE,
-       LT_PAGESTYLE, LT_PARAGRAPH,
-       LT_PARINDENT, LT_PARSEP, LT_PARSKIP, LT_PLAIN, LT_PREAMBLE, 
-       LT_PROVIDESAMSMATH, LT_PROVIDESMAKEIDX, LT_PROVIDESURL, LT_RIGHT,
-       LT_RIGHT_ADDRESS_BOX, LT_RIGHTMARGIN, LT_SENSITIVE, LT_SIDES,
-       LT_SPACING, LT_SPACING_SINGLE, LT_SPACING_ONEHALF,
-       LT_SPACING_DOUBLE, LT_OTHER,  LT_CLASSOPTIONS, LT_FONTSIZE,
-       LT_STATIC, LT_STYLE, LT_TOP_ENVIRONMENT, LT_TOPSEP, LT_BIBLIO,
-        LT_INTITLE, LT_SECNUMDEPTH, LT_TOCDEPTH,
-       LT_OUTPUTTYPE, LT_OTLATEX, LT_OTLINUXDOC, LT_OTDOCBOOK, LT_OTLITERATE
+       LT_ALIGN = 1, 
+       LT_ALIGNPOSSIBLE, 
+       LT_MARGIN, 
+       LT_BOTTOMSEP, 
+       LT_COPYSTYLE, 
+       LT_OBSOLETEDBY, 
+       //LT_EMPTY,
+       LT_END, 
+       //LT_ENVIRONMENT_DEFAULT, 
+       //LT_FANCYHDR,
+       LT_FILL_BOTTOM, 
+       LT_FILL_TOP, 
+       //LT_FIRST_COUNTER,
+       LT_FONT, 
+       LT_FREE_SPACING, 
+       //LT_HEADINGS,
+       LT_ITEMSEP, 
+       LT_KEEPEMPTY, 
+       LT_LABEL_BOTTOMSEP, 
+       LT_LABELFONT, 
+       LT_TEXTFONT,
+       LT_LABELINDENT, 
+       LT_LABELSEP, 
+       LT_LABELSTRING, 
+       LT_LABELSTRING_APPENDIX, 
+       LT_LABELTYPE, 
+       LT_LATEXNAME, 
+       LT_LATEXPARAM, 
+       LT_LATEXTYPE, 
+       LT_LEFTMARGIN, 
+       LT_NEED_PROTECT, 
+       LT_NEWLINE, 
+       LT_NEXTNOINDENT, 
+       LT_PARINDENT, 
+       LT_PARSEP, 
+       LT_PARSKIP, 
+       //LT_PLAIN,
+       LT_PREAMBLE, 
+       LT_RIGHTMARGIN, 
+       LT_SPACING, 
+       LT_TOPSEP, 
+        LT_INTITLE 
 };
 
 
@@ -83,45 +96,14 @@ enum LayoutTags {
 static keyword_item layoutTags[] = {
        { "align",                      LT_ALIGN },
        { "alignpossible",              LT_ALIGNPOSSIBLE },
-       { "bibliography",               LT_BIBLIO },
-       { "block",                      LT_BLOCK },
        { "bottomsep",                  LT_BOTTOMSEP },
-       { "center",                     LT_CENTER },
-       { "centered_top_environment",   LT_CENTERED_TOP_ENVIRONMENT },
-        { "classoptions",               LT_CLASSOPTIONS },
-       { "columns",                    LT_COLUMNS },
-       { "command",                    LT_COMMAND },
        { "copystyle",                  LT_COPYSTYLE },
-       { "counter_chapter",            LT_COUNTER_CHAPTER },
-       { "counter_enumi",              LT_COUNTER_ENUMI },
-       { "counter_enumii",             LT_COUNTER_ENUMII },
-       { "counter_enumiii",            LT_COUNTER_ENUMIII },
-       { "counter_enumiv",             LT_COUNTER_ENUMIV },
-       { "counter_paragraph",          LT_COUNTER_PARAGRAPH },
-       { "counter_section",            LT_COUNTER_SECTION },
-       { "counter_subparagraph",       LT_COUNTER_SUBPARAGRAPH },
-       { "counter_subsection",         LT_COUNTER_SUBSECTION },
-       { "counter_subsubsection",      LT_COUNTER_SUBSUBSECTION },
-       { "defaultfont",                LT_DEFAULTFONT },
-       { "docbook",                    LT_OTDOCBOOK },
-       { "double",                     LT_SPACING_DOUBLE },
-       { "dynamic",                    LT_DYNAMIC },
-       { "empty",                      LT_EMPTY },
        { "end",                        LT_END },
-       { "environment",                LT_ENVIRONMENT },
-       { "environment_default",        LT_ENVIRONMENT_DEFAULT },
-       { "fancyhdr",                   LT_FANCYHDR },
        { "fill_bottom",                LT_FILL_BOTTOM },
        { "fill_top",                   LT_FILL_TOP },
-       { "first_counter",              LT_FIRST_COUNTER },
-       { "first_dynamic",              LT_FIRST_DYNAMIC },
        { "font",                       LT_FONT },
-       { "fontsize",                   LT_FONTSIZE },
        { "freespacing",                LT_FREE_SPACING },
-       { "headings",                   LT_HEADINGS },
-       { "input",                      LT_INPUT },
        { "intitle",                    LT_INTITLE },
-       { "item_environment",           LT_ITEM_ENVIRONMENT },
        { "itemsep",                    LT_ITEMSEP },
        { "keepempty",                  LT_KEEPEMPTY },
        { "labelbottomsep",             LT_LABEL_BOTTOMSEP },
@@ -131,51 +113,22 @@ static keyword_item layoutTags[] = {
        { "labelstring",                LT_LABELSTRING },
        { "labelstringappendix",        LT_LABELSTRING_APPENDIX },
        { "labeltype",                  LT_LABELTYPE },
-       { "latex",                      LT_OTLATEX },
        { "latexname",                  LT_LATEXNAME },
-       { "latexparam",                 LT_LATEXPARAM },    //arrae970411
+       { "latexparam",                 LT_LATEXPARAM },
        { "latextype",                  LT_LATEXTYPE },
-       { "layout",                     LT_LAYOUT },
-       { "left",                       LT_LEFT },
        { "leftmargin",                 LT_LEFTMARGIN },
-       { "linuxdoc",                   LT_OTLINUXDOC },
-       { "list_environment",           LT_LIST_ENVIRONMENT },
-       { "literate",                   LT_OTLITERATE },
-       { "manual",                     LT_MANUAL },
        { "margin",                     LT_MARGIN },
-       { "maxcounter",                 LT_MAXCOUNTER },
        { "needprotect",                LT_NEED_PROTECT },
        { "newline",                    LT_NEWLINE },
        { "nextnoindent",               LT_NEXTNOINDENT },
-       { "no_label",                   LT_NO_LABEL },
-       { "nostyle",                    LT_NOSTYLE },
        { "obsoletedby",                LT_OBSOLETEDBY },
-       { "onehalf",                    LT_SPACING_ONEHALF },
-       { "other",                      LT_OTHER },
-       { "outputtype",                 LT_OUTPUTTYPE },
-       { "pagestyle",                  LT_PAGESTYLE },
-       { "paragraph",                  LT_PARAGRAPH },
        { "parindent",                  LT_PARINDENT },
        { "parsep",                     LT_PARSEP },
        { "parskip",                    LT_PARSKIP },
-       { "plain",                      LT_PLAIN },
        { "preamble",                   LT_PREAMBLE },
-       { "providesamsmath",            LT_PROVIDESAMSMATH },
-       { "providesmakeidx",            LT_PROVIDESMAKEIDX },
-       { "providesurl",                LT_PROVIDESURL },
-       { "right",                      LT_RIGHT },
-       { "right_address_box",          LT_RIGHT_ADDRESS_BOX },
        { "rightmargin",                LT_RIGHTMARGIN },
-       { "secnumdepth",                LT_SECNUMDEPTH },
-       { "sensitive",                  LT_SENSITIVE },
-       { "sides",                      LT_SIDES },
-       { "single",                     LT_SPACING_SINGLE },
        { "spacing",                    LT_SPACING },
-       { "static",                     LT_STATIC },
-       { "style",                      LT_STYLE },
        { "textfont",                   LT_TEXTFONT },
-       { "tocdepth",                   LT_TOCDEPTH },
-       { "top_environment",            LT_TOP_ENVIRONMENT },
        { "topsep",                     LT_TOPSEP }
 };
 
@@ -218,19 +171,22 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
 {
        bool error = false;
        bool finished = false;
-       
+       lexrc.pushTable(layoutTags, LT_INTITLE);
        // parse style section
        while (!finished && lexrc.IsOK() && !error) {
-               switch(lexrc.lex()) {
-
-               case -2:
-                       break;
+               int le = lexrc.lex();
+               // See comment in lyxrc.C.
+               switch(le) {
+               case LyXLex::LEX_FEOF:
+                       continue; break;
 
-               case -1:                // parse error
-                       lexrc.printError("Unknown tag `$$Token'");
+               case LyXLex::LEX_UNDEF:         // parse error
+                       lexrc.printError("Unknown layout tag `$$Token'");
                        error = true;
-                       break;
-
+                       continue; break;
+               default: break;
+               }
+               switch(static_cast<LayoutTags>(le)) {
                case LT_END:            // end of structure
                        finished = true;
                        break;
@@ -265,50 +221,11 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_MARGIN:         // Margin style definition.
-                      
-                       switch(lexrc.lex()) {
-                       case LT_STATIC:
-                               margintype = MARGIN_STATIC;
-                               break;
-                       case LT_MANUAL:
-                               margintype = MARGIN_MANUAL;
-                               break;
-                       case LT_DYNAMIC:
-                               margintype = MARGIN_DYNAMIC;
-                               break;
-                       case LT_FIRST_DYNAMIC:
-                               margintype = MARGIN_FIRST_DYNAMIC;
-                               break;
-                       case LT_RIGHT_ADDRESS_BOX:
-                               margintype = MARGIN_RIGHT_ADDRESS_BOX;
-                               break;
-                       default:
-                               lexrc.printError("Unknown margin type `$$Token'");
-                               break;
-                       }
+                       readMargin(lexrc);
                        break;
 
                case LT_LATEXTYPE:      // Latex style definition.
-                       switch (lexrc.lex()) {
-                       case LT_PARAGRAPH:
-                               latextype= LATEX_PARAGRAPH;
-                               break;
-                       case LT_COMMAND:
-                               latextype= LATEX_COMMAND;
-                               break;
-                       case LT_ENVIRONMENT:
-                               latextype= LATEX_ENVIRONMENT;
-                               break;
-                       case LT_ITEM_ENVIRONMENT:
-                               latextype= LATEX_ITEM_ENVIRONMENT;
-                               break;
-                       case LT_LIST_ENVIRONMENT:
-                               latextype= LATEX_LIST_ENVIRONMENT;
-                               break;
-                       default:
-                               lexrc.printError("Unknown latextype `$$Token'");
-                               break;
-                       }
+                       readLatexType(lexrc);
                        break;
 
                case LT_INTITLE:
@@ -358,63 +275,9 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_LABELTYPE:
-                       switch (lexrc.lex()) {
-                       case LT_NO_LABEL:
-                               labeltype = LABEL_NO_LABEL;
-                               break;
-                       case LT_MANUAL:
-                               labeltype = LABEL_MANUAL;
-                               break;
-                       case LT_TOP_ENVIRONMENT:
-                               labeltype = LABEL_TOP_ENVIRONMENT;
-                               break;
-                       case LT_CENTERED_TOP_ENVIRONMENT:
-                               labeltype = LABEL_CENTERED_TOP_ENVIRONMENT;
-                               break;
-                       case LT_STATIC:
-                               labeltype = LABEL_STATIC;
-                               break;
-                       case LT_SENSITIVE:
-                               labeltype = LABEL_SENSITIVE;
-                               break;
-                       case LT_COUNTER_CHAPTER:
-                               labeltype = LABEL_COUNTER_CHAPTER;
-                               break;
-                       case LT_COUNTER_SECTION:
-                               labeltype = LABEL_COUNTER_SECTION;
-                               break;
-                       case LT_COUNTER_SUBSECTION:
-                               labeltype = LABEL_COUNTER_SUBSECTION;
-                               break;
-                       case LT_COUNTER_SUBSUBSECTION:
-                               labeltype = LABEL_COUNTER_SUBSUBSECTION;
-                               break;
-                       case LT_COUNTER_PARAGRAPH:
-                               labeltype = LABEL_COUNTER_PARAGRAPH;
-                               break;
-                       case LT_COUNTER_SUBPARAGRAPH:
-                               labeltype = LABEL_COUNTER_SUBPARAGRAPH;
-                               break;
-                       case LT_COUNTER_ENUMI:
-                               labeltype = LABEL_COUNTER_ENUMI;
-                               break;
-                       case LT_COUNTER_ENUMII:
-                               labeltype = LABEL_COUNTER_ENUMII;
-                               break;
-                       case LT_COUNTER_ENUMIII:
-                               labeltype = LABEL_COUNTER_ENUMIII;
-                               break;
-                       case LT_COUNTER_ENUMIV:
-                               labeltype = LABEL_COUNTER_ENUMIV;
-                               break;
-                       case LT_BIBLIO:
-                               labeltype = LABEL_BIBLIO;
-                               break;
-                       default:
-                               lexrc.printError("Unknown labeltype `$$Token'");
-                       }
+                       readLabelType(lexrc);
                        break;
-
+                       
                case LT_LEFTMARGIN:     // left margin type
                        if (lexrc.next())
                                leftmargin = lexrc.GetString();
@@ -487,55 +350,11 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_ALIGN:          // paragraph align
-                       switch (lexrc.lex()) {
-                       case LT_BLOCK:
-                               align = LYX_ALIGN_BLOCK;
-                               break;
-                       case LT_LEFT:
-                               align = LYX_ALIGN_LEFT;
-                               break;
-                       case LT_RIGHT:
-                               align = LYX_ALIGN_RIGHT;
-                               break;
-                       case LT_CENTER:
-                               align = LYX_ALIGN_CENTER;
-                               break;
-                       case LT_LAYOUT:
-                               align = LYX_ALIGN_LAYOUT;
-                               break;
-                       default:
-                               lexrc.printError("Unknown alignment `$$Token'");
-                       }
+                       readAlign(lexrc);
                        break;
-
                case LT_ALIGNPOSSIBLE:  // paragraph allowed align
-               {       alignpossible = LYX_ALIGN_NONE;
-                     
-               int lineno = lexrc.GetLineNo();
-               do {
-                       switch (lexrc.lex()) {
-                       case LT_BLOCK:
-                               alignpossible |= LYX_ALIGN_BLOCK;
-                               break;
-                       case LT_LEFT:
-                               alignpossible |= LYX_ALIGN_LEFT;
-                               break;
-                       case LT_RIGHT:
-                               alignpossible |= LYX_ALIGN_RIGHT;
-                               break;
-                       case LT_CENTER:
-                               alignpossible |= LYX_ALIGN_CENTER;
-                               break;
-                       case LT_LAYOUT:
-                               alignpossible |= LYX_ALIGN_LAYOUT;
-                               break;
-                       default:
-                               lexrc.printError("Unknown alignment `$$Token'");
-
-                       }
-               } while (lineno == lexrc.GetLineNo());
-               break;
-               }
+                       readAlignPossible(lexrc);
+                       break;
 
                case LT_LABELSTRING:    // label string definition
                        if (lexrc.next())
@@ -553,35 +372,330 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_SPACING: // setspace.sty
-                       switch(lexrc.lex()) {
-                       case LT_SPACING_SINGLE:
-                               spacing.set(Spacing::Single);
-                               break;
-                       case LT_SPACING_ONEHALF:
-                               spacing.set(Spacing::Onehalf);
-                               break;
-                       case LT_SPACING_DOUBLE:
-                               spacing.set(Spacing::Double);
-                               break;
-                       case LT_OTHER:
-                               lexrc.next();
-                               spacing.set(Spacing::Other, lexrc.GetFloat());
-                               break;
-                       default:
-                               lexrc.printError("Unknown spacing `$$Token'");
-                       }
+                       readSpacing(lexrc);
                        break;
-               default:                /* context error */
-                       lexrc.printError("Tag `$$Token' is not "
-                                        "allowed in layout");
-                       error = true;
+               }
+       }
+       lexrc.popTable();
+       return error;
+}
+
+enum AlignTags {
+       AT_BLOCK = 1,
+       AT_LEFT,
+       AT_RIGHT,
+       AT_CENTER,
+       AT_LAYOUT
+};
+
+static keyword_item alignTags[] = {
+       { "block",  AT_BLOCK },
+       { "center", AT_CENTER },
+       { "layout", AT_LAYOUT },
+       { "left",   AT_LEFT },
+       { "right",  AT_RIGHT }
+};
+
+
+void LyXLayout::readAlign(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, alignTags, AT_LAYOUT);
+       int le = lexrc.lex();
+       switch (le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown alignment `$$Token'");
+               return; break;
+       default: break;
+       };
+       switch(static_cast<AlignTags>(le)) {
+       case AT_BLOCK:
+               align = LYX_ALIGN_BLOCK;
+               break;
+       case AT_LEFT:
+               align = LYX_ALIGN_LEFT;
+               break;
+       case AT_RIGHT:
+               align = LYX_ALIGN_RIGHT;
+               break;
+       case AT_CENTER:
+               align = LYX_ALIGN_CENTER;
+               break;
+       case AT_LAYOUT:
+               align = LYX_ALIGN_LAYOUT;
+               break;
+       }
+}
+
+
+void LyXLayout::readAlignPossible(LyXLex & lexrc)
+{
+       lexrc.pushTable(alignTags, AT_LAYOUT);
+       alignpossible = LYX_ALIGN_NONE;
+       int lineno = lexrc.GetLineNo();
+       do {
+               int le = lexrc.lex();
+               switch (le) {
+               case LyXLex::LEX_UNDEF:
+                       lexrc.printError("Unknown alignment `$$Token'");
+                       continue; break;
+               default: break;
+               };
+               switch (static_cast<AlignTags>(le)) {
+               case AT_BLOCK:
+                       alignpossible |= LYX_ALIGN_BLOCK;
+                       break;
+               case AT_LEFT:
+                       alignpossible |= LYX_ALIGN_LEFT;
+                       break;
+               case AT_RIGHT:
+                       alignpossible |= LYX_ALIGN_RIGHT;
+                       break;
+               case AT_CENTER:
+                       alignpossible |= LYX_ALIGN_CENTER;
+                       break;
+               case AT_LAYOUT:
+                       alignpossible |= LYX_ALIGN_LAYOUT;
                        break;
                }
+       } while (lineno == lexrc.GetLineNo());
+       lexrc.popTable();
+}
+
+enum LabelTypeTags {
+       LA_NO_LABEL = 1,
+       LA_MANUAL,
+       LA_TOP_ENVIRONMENT,
+       LA_CENTERED_TOP_ENVIRONMENT,
+       LA_STATIC,
+       LA_SENSITIVE,
+       LA_COUNTER_CHAPTER,
+       LA_COUNTER_SECTION,
+       LA_COUNTER_SUBSECTION,
+       LA_COUNTER_SUBSUBSECTION,
+       LA_COUNTER_PARAGRAPH,
+       LA_COUNTER_SUBPARAGRAPH,
+       LA_COUNTER_ENUMI,
+       LA_COUNTER_ENUMII,
+       LA_COUNTER_ENUMIII,
+       LA_COUNTER_ENUMIV,
+       LA_BIBLIO
+};
+
+static keyword_item labelTypeTags[] = {
+       { "bibliography",             LA_BIBLIO },
+       { "centered_top_environment", LA_CENTERED_TOP_ENVIRONMENT },
+       { "counter_chapter",          LA_COUNTER_CHAPTER },
+       { "counter_enumi",            LA_COUNTER_ENUMI },
+       { "counter_enumii",           LA_COUNTER_ENUMII },
+       { "counter_enumiii",          LA_COUNTER_ENUMIII },
+       { "counter_enumiv",           LA_COUNTER_ENUMIV },
+       { "counter_paragraph",        LA_COUNTER_PARAGRAPH },
+       { "counter_section",          LA_COUNTER_SECTION },
+       { "counter_subparagraph",     LA_COUNTER_SUBPARAGRAPH },
+       { "counter_subsection",       LA_COUNTER_SUBSECTION },
+       { "counter_subsubsection",    LA_COUNTER_SUBSUBSECTION },
+       { "manual",                   LA_MANUAL },
+       { "no_label",                 LA_NO_LABEL },
+       { "sensitive",                LA_SENSITIVE },
+       { "static",                   LA_STATIC },
+       { "top_environment",          LA_TOP_ENVIRONMENT }
+};
+
+void LyXLayout::readLabelType(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, labelTypeTags, LA_BIBLIO);
+       int le = lexrc.lex();
+       switch (le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown labeltype tag `$$Token'");
+               return; break;
+       default: break;
+       }
+       switch (static_cast<LabelTypeTags>(le)) {
+       case LA_NO_LABEL:
+               labeltype = LABEL_NO_LABEL;
+               break;
+       case LA_MANUAL:
+               labeltype = LABEL_MANUAL;
+               break;
+       case LA_TOP_ENVIRONMENT:
+               labeltype = LABEL_TOP_ENVIRONMENT;
+               break;
+       case LA_CENTERED_TOP_ENVIRONMENT:
+               labeltype = LABEL_CENTERED_TOP_ENVIRONMENT;
+               break;
+       case LA_STATIC:
+               labeltype = LABEL_STATIC;
+               break;
+       case LA_SENSITIVE:
+               labeltype = LABEL_SENSITIVE;
+               break;
+       case LA_COUNTER_CHAPTER:
+               labeltype = LABEL_COUNTER_CHAPTER;
+               break;
+       case LA_COUNTER_SECTION:
+               labeltype = LABEL_COUNTER_SECTION;
+               break;
+       case LA_COUNTER_SUBSECTION:
+               labeltype = LABEL_COUNTER_SUBSECTION;
+               break;
+       case LA_COUNTER_SUBSUBSECTION:
+               labeltype = LABEL_COUNTER_SUBSUBSECTION;
+               break;
+       case LA_COUNTER_PARAGRAPH:
+               labeltype = LABEL_COUNTER_PARAGRAPH;
+               break;
+       case LA_COUNTER_SUBPARAGRAPH:
+               labeltype = LABEL_COUNTER_SUBPARAGRAPH;
+               break;
+       case LA_COUNTER_ENUMI:
+               labeltype = LABEL_COUNTER_ENUMI;
+               break;
+       case LA_COUNTER_ENUMII:
+               labeltype = LABEL_COUNTER_ENUMII;
+               break;
+       case LA_COUNTER_ENUMIII:
+               labeltype = LABEL_COUNTER_ENUMIII;
+               break;
+       case LA_COUNTER_ENUMIV:
+               labeltype = LABEL_COUNTER_ENUMIV;
+               break;
+       case LA_BIBLIO:
+               labeltype = LABEL_BIBLIO;
+               break;
        }
+}
 
-       return error;
+enum MarginTags {
+       MT_STATIC = 1,
+       MT_MANUAL,
+       MT_DYNAMIC,
+       MT_FIRST_DYNAMIC,
+       MT_RIGHT_ADDRESS_BOX
+};
+
+static keyword_item marginTags[] = {
+       { "dynamic",           MT_DYNAMIC },
+       { "first_dynamic",     MT_FIRST_DYNAMIC },
+       { "manual",            MT_MANUAL },
+       { "right_address_box", MT_RIGHT_ADDRESS_BOX },
+       { "static",            MT_STATIC }
+};
+
+void LyXLayout::readMargin(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, marginTags, MT_RIGHT_ADDRESS_BOX);
+       int le = lexrc.lex();
+       switch(le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown margin type tag `$$Token'");
+               return; break;
+       default: break;
+       }
+       switch(static_cast<MarginTags>(le)) {
+       case MT_STATIC:
+               margintype = MARGIN_STATIC;
+               break;
+       case MT_MANUAL:
+               margintype = MARGIN_MANUAL;
+               break;
+       case MT_DYNAMIC:
+               margintype = MARGIN_DYNAMIC;
+               break;
+       case MT_FIRST_DYNAMIC:
+               margintype = MARGIN_FIRST_DYNAMIC;
+               break;
+       case MT_RIGHT_ADDRESS_BOX:
+               margintype = MARGIN_RIGHT_ADDRESS_BOX;
+               break;
+       }
 }
 
+enum LatexTypeTags {
+       LX_PARAGRAPH = 1,
+       LX_COMMAND,
+       LX_ENVIRONMENT,
+       LX_ITEM_ENVIRONMENT,
+       LX_LIST_ENVIRONMENT
+};
+
+static keyword_item latexTypeTags[] = {
+       { "command",          LX_COMMAND },
+       { "environment",      LX_ENVIRONMENT },
+       { "item_environment", LX_ITEM_ENVIRONMENT },
+       { "list_environment", LX_LIST_ENVIRONMENT },
+       { "paragraph",        LX_PARAGRAPH }
+};
+
+void LyXLayout::readLatexType(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, latexTypeTags, LX_LIST_ENVIRONMENT);
+       int le = lexrc.lex();
+       switch (le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown latextype tag `$$Token'");
+               return; break;
+       default: break;
+       }
+       switch (static_cast<LatexTypeTags>(le)) {
+       case LX_PARAGRAPH:
+               latextype= LATEX_PARAGRAPH;
+               break;
+       case LX_COMMAND:
+               latextype= LATEX_COMMAND;
+               break;
+       case LX_ENVIRONMENT:
+               latextype= LATEX_ENVIRONMENT;
+               break;
+       case LX_ITEM_ENVIRONMENT:
+               latextype= LATEX_ITEM_ENVIRONMENT;
+               break;
+       case LX_LIST_ENVIRONMENT:
+               latextype= LATEX_LIST_ENVIRONMENT;
+               break;
+       }
+}
+
+enum SpacingTags {
+       ST_SPACING_SINGLE = 1,
+       ST_SPACING_ONEHALF,
+       ST_SPACING_DOUBLE,
+       ST_OTHER
+};
+
+static keyword_item spacingTags[] = {
+       {"double",  ST_SPACING_DOUBLE },
+       {"onehalf", ST_SPACING_ONEHALF },
+       {"other",   ST_OTHER },
+       {"single",  ST_SPACING_SINGLE }
+};
+
+void LyXLayout::readSpacing(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, spacingTags, ST_OTHER);
+       int le = lexrc.lex();
+       switch(le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown spacing token `$$Token'");
+               return; break;
+       default: break;
+       }
+       switch(static_cast<SpacingTags>(le)) {
+       case ST_SPACING_SINGLE:
+               spacing.set(Spacing::Single);
+               break;
+       case ST_SPACING_ONEHALF:
+               spacing.set(Spacing::Onehalf);
+               break;
+       case ST_SPACING_DOUBLE:
+               spacing.set(Spacing::Double);
+               break;
+       case ST_OTHER:
+               lexrc.next();
+               spacing.set(Spacing::Other, lexrc.GetFloat());
+               break;
+       }
+}
 
 /* ******************************************************************* */
 
@@ -620,6 +734,48 @@ bool LyXTextClass::do_readStyle(LyXLex & lexrc, LyXLayout & lay)
 }
 
 
+enum TextClassTags {
+       TC_OUTPUTTYPE = 1,
+       TC_INPUT,
+       TC_STYLE,
+       TC_NOSTYLE,
+       TC_COLUMNS,
+       TC_SIDES,
+       TC_PAGESTYLE,
+       TC_DEFAULTFONT,
+       TC_MAXCOUNTER,
+       TC_SECNUMDEPTH,
+       TC_TOCDEPTH,
+       TC_CLASSOPTIONS,
+       TC_PREAMBLE,
+       TC_PROVIDESAMSMATH,
+       TC_PROVIDESMAKEIDX,
+       TC_PROVIDESURL,
+       TC_LEFTMARGIN,
+       TC_RIGHTMARGIN
+};
+
+static keyword_item textClassTags[] = {
+       { "classoptions",    TC_CLASSOPTIONS },
+       { "columns",         TC_COLUMNS },
+       { "defaultfont",     TC_DEFAULTFONT },
+       { "input",           TC_INPUT },
+       { "leftmargin",      TC_LEFTMARGIN },
+       { "maxcounter",      TC_MAXCOUNTER },
+       { "nostyle",         TC_NOSTYLE },
+       { "outputtype",      TC_OUTPUTTYPE },
+       { "pagestyle",       TC_PAGESTYLE },
+       { "preamble",        TC_PREAMBLE },
+       { "providesamsmath", TC_PROVIDESAMSMATH },
+       { "providesmakeidx", TC_PROVIDESMAKEIDX },
+       { "providesurl",     TC_PROVIDESURL },
+       { "rightmargin",     TC_RIGHTMARGIN },
+       { "secnumdepth",     TC_SECNUMDEPTH },
+       { "sides",           TC_SIDES },
+       { "style",           TC_STYLE },
+       { "tocdepth",        TC_TOCDEPTH }
+};
+
 // Reads a textclass structure from file.
 bool LyXTextClass::Read(string const & filename, bool merge)
 {
@@ -632,7 +788,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                                     << MakeDisplayPath(filename)
                                     << endl;
        
-       LyXLex lexrc(layoutTags, sizeof(layoutTags)/sizeof(keyword_item));
+       LyXLex lexrc(textClassTags, TC_RIGHTMARGIN);
        bool error = false;
 
         lexrc.setFile(filename);
@@ -640,36 +796,23 @@ bool LyXTextClass::Read(string const & filename, bool merge)
 
        // parsing
        while (lexrc.IsOK() && !error) {
-               switch(lexrc.lex()) {
-               case -2:
-                       break;
+               int le = lexrc.lex();
+               switch(le) {
+               case LyXLex::LEX_FEOF:
+                       continue; break;
 
-               case -1:                                 
-                       lexrc.printError("Unknown tag `$$Token'");
+               case LyXLex::LEX_UNDEF:                                 
+                       lexrc.printError("Unknown TextClass tag `$$Token'");
                        error = true;
-                       break;
-
-               case LT_OUTPUTTYPE:   // output type definition
-                       switch(lexrc.lex()) {
-                       case LT_OTLATEX:
-                               outputType_ = LATEX;
-                               break;
-                       case LT_OTLINUXDOC:
-                               outputType_ = LINUXDOC;
-                               break;
-                       case LT_OTDOCBOOK:
-                               outputType_ = DOCBOOK;
-                               break;
-                       case LT_OTLITERATE:
-                               outputType_ = LITERATE;
-                               break;
-                       default:
-                               lexrc.printError("Unknown output type `$$Token'");
-                               break;
-                       }
+                       continue; break;
+               default: break;
+               }
+               switch(static_cast<TextClassTags>(le)) {
+               case TC_OUTPUTTYPE:   // output type definition
+                       readOutputType(lexrc);
                        break;
                        
-               case LT_INPUT: // Include file
+               case TC_INPUT: // Include file
                        if (lexrc.next()) {
                                string tmp = LibFileSearch("layouts",
                                                            lexrc.GetString(), 
@@ -683,7 +826,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        }
                        break;
 
-               case LT_STYLE:
+               case TC_STYLE:
                        if (lexrc.next()) {
                                string name = subst(lexrc.GetString(),
                                                    '_', ' ');
@@ -703,7 +846,7 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        }
                        break;
 
-               case LT_NOSTYLE:
+               case TC_NOSTYLE:
                        if (lexrc.next()) {
                                string style = subst(lexrc.GetString(),
                                                     '_', ' ');
@@ -713,12 +856,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        }
                        break;
 
-               case LT_COLUMNS:
+               case TC_COLUMNS:
                        if (lexrc.next())
                                columns_ = lexrc.GetInteger();
                        break;
                        
-               case LT_SIDES:
+               case TC_SIDES:
                        if (lexrc.next()) {
                                switch(lexrc.GetInteger()) {
                                case 1: sides_ = OneSide; break;
@@ -733,12 +876,12 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        }
                        break;
                        
-               case LT_PAGESTYLE:
+               case TC_PAGESTYLE:
                        lexrc.next();
                        pagestyle_ = strip(lexrc.GetString());
                        break;
                        
-               case LT_DEFAULTFONT:
+               case TC_DEFAULTFONT:
                        defaultfont_.lyxRead(lexrc);
                        if (!defaultfont_.resolved()) {
                                lexrc.printError("Warning: defaultfont should "
@@ -747,110 +890,53 @@ bool LyXTextClass::Read(string const & filename, bool merge)
                        }
                        break;
 
-               case LT_MAXCOUNTER:
-                       switch (lexrc.lex()) {
-                       case LT_COUNTER_CHAPTER:
-                               maxcounter_ = LABEL_COUNTER_CHAPTER;
-                               break;
-                       case LT_COUNTER_SECTION:
-                               maxcounter_ = LABEL_COUNTER_SECTION;
-                               break;
-                       case LT_COUNTER_SUBSECTION:
-                               maxcounter_ = LABEL_COUNTER_SUBSECTION;
-                               break;
-                       case LT_COUNTER_SUBSUBSECTION:
-                               maxcounter_ = LABEL_COUNTER_SUBSUBSECTION;
-                               break;
-                       case LT_COUNTER_PARAGRAPH:
-                               maxcounter_ = LABEL_COUNTER_PARAGRAPH;
-                               break;
-                       case LT_COUNTER_SUBPARAGRAPH:
-                               maxcounter_ = LABEL_COUNTER_SUBPARAGRAPH;
-                               break;
-                       case LT_COUNTER_ENUMI:
-                               maxcounter_ = LABEL_COUNTER_ENUMI;
-                               break;
-                       case LT_COUNTER_ENUMII:
-                               maxcounter_ = LABEL_COUNTER_ENUMII;
-                               break;
-                       case LT_COUNTER_ENUMIII:
-                               maxcounter_ = LABEL_COUNTER_ENUMIII;
-                               break;
-                       case LT_COUNTER_ENUMIV:
-                               maxcounter_ = LABEL_COUNTER_ENUMIV;
-                               break;
-                       }
+               case TC_MAXCOUNTER:
+                       readMaxCounter(lexrc);
                        break;
 
-               case LT_SECNUMDEPTH:
+               case TC_SECNUMDEPTH:
                        lexrc.next();
                        secnumdepth_ = lexrc.GetInteger();
                        break;
 
-               case LT_TOCDEPTH:
+               case TC_TOCDEPTH:
                        lexrc.next();
                        tocdepth_ = lexrc.GetInteger();
                        break;
 
                        // First step to support options 
-               case LT_CLASSOPTIONS:
-               {
-                       bool getout = true;
-                       while (getout && lexrc.IsOK()) { 
-                               switch (lexrc.lex()) {
-                               case LT_FONTSIZE:
-                                       lexrc.next();
-                                       opt_fontsize_ = strip(lexrc.GetString());
-                                       break;
-                               case LT_PAGESTYLE:
-                                       lexrc.next();
-                                       opt_pagestyle_ = strip(lexrc.GetString()); 
-                                       break;
-                               case LT_OTHER:
-                                       lexrc.next();
-                                       options_ = lexrc.GetString();
-                                       break;
-                               case LT_END: getout = false; break;
-                               default:
-                                       lexrc.printError("Out of context tag `$$Token'");
-                                       break;
-                               }
-                       }
+               case TC_CLASSOPTIONS:
+                       readClassOptions(lexrc);
                        break;
-               }
 
-               case LT_PREAMBLE:
+               case TC_PREAMBLE:
                        preamble_ = lexrc.getLongString("EndPreamble");
                        break;
 
-               case LT_PROVIDESAMSMATH:
+               case TC_PROVIDESAMSMATH:
                        if (lexrc.next() && lexrc.GetInteger())
                                provides_ |= amsmath;
                        break;
 
-               case LT_PROVIDESMAKEIDX:
+               case TC_PROVIDESMAKEIDX:
                        if (lexrc.next() && lexrc.GetInteger())
                                provides_ |= makeidx;
                        break;
 
-               case LT_PROVIDESURL:
+               case TC_PROVIDESURL:
                        if (lexrc.next() && lexrc.GetInteger())
                                provides_ = url;
                        break;
 
-               case LT_LEFTMARGIN:     // left margin type
+               case TC_LEFTMARGIN:     // left margin type
                        if (lexrc.next())
                                leftmargin_ = lexrc.GetString();
                        break;                  
 
-               case LT_RIGHTMARGIN:    // right margin type
+               case TC_RIGHTMARGIN:    // right margin type
                        if (lexrc.next())
                                rightmargin_ = lexrc.GetString();
                        break;
-
-               default:
-                       lexrc.printError("Out of context tag `$$Token'");
-                       break;
                }
        }       
 
@@ -866,6 +952,163 @@ bool LyXTextClass::Read(string const & filename, bool merge)
        return error;
 }
 
+enum OutputTypeTags {
+       OT_OTLATEX = 1,
+       OT_OTLINUXDOC,
+       OT_OTDOCBOOK,
+       OT_OTLITERATE
+};
+
+static keyword_item outputTypeTags[] = {
+       { "docbook", OT_OTDOCBOOK },
+       { "latex", OT_OTLATEX },
+       { "linuxdoc", OT_OTLINUXDOC },
+       { "literate", OT_OTLITERATE }
+};
+
+void LyXTextClass::readOutputType(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, outputTypeTags, OT_OTLITERATE);
+       int le = lexrc.lex();
+       switch(le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown output type `$$Token'");
+               return; break;
+       default: break;
+       }
+       switch(static_cast<OutputTypeTags>(le)) {
+       case OT_OTLATEX:
+               outputType_ = LATEX;
+               break;
+       case OT_OTLINUXDOC:
+               outputType_ = LINUXDOC;
+               break;
+       case OT_OTDOCBOOK:
+               outputType_ = DOCBOOK;
+               break;
+       case OT_OTLITERATE:
+               outputType_ = LITERATE;
+               break;
+       }
+}
+
+enum MaxCounterTags {
+       MC_COUNTER_CHAPTER = 1,
+       MC_COUNTER_SECTION,
+       MC_COUNTER_SUBSECTION,
+       MC_COUNTER_SUBSUBSECTION,
+       MC_COUNTER_PARAGRAPH,
+       MC_COUNTER_SUBPARAGRAPH,
+       MC_COUNTER_ENUMI,
+       MC_COUNTER_ENUMII,
+       MC_COUNTER_ENUMIII,
+       MC_COUNTER_ENUMIV
+};
+
+static keyword_item maxCounterTags[] = {
+       {"counter_chapter", MC_COUNTER_CHAPTER },
+       {"counter_enumi", MC_COUNTER_ENUMI },
+       {"counter_enumii", MC_COUNTER_ENUMII },
+       {"counter_enumiii", MC_COUNTER_ENUMIII },
+       {"counter_enumiv", MC_COUNTER_ENUMIV },
+       {"counter_paragraph", MC_COUNTER_PARAGRAPH },
+       {"counter_section", MC_COUNTER_SECTION },
+       {"counter_subparagraph", MC_COUNTER_SUBPARAGRAPH },
+       {"counter_subsection", MC_COUNTER_SUBSECTION },
+       {"counter_subsubsection", MC_COUNTER_SUBSUBSECTION }
+};
+
+void LyXTextClass::readMaxCounter(LyXLex & lexrc)
+{
+       pushpophelper pph(lexrc, maxCounterTags, MC_COUNTER_ENUMIV);
+       int le = lexrc.lex();
+       switch(le) {
+       case LyXLex::LEX_UNDEF:
+               lexrc.printError("Unknown MaxCounter tag `$$Token'");
+               return; break;
+       default: break;
+       }
+       switch (static_cast<MaxCounterTags>(le)) {
+       case MC_COUNTER_CHAPTER:
+               maxcounter_ = LABEL_COUNTER_CHAPTER;
+               break;
+       case MC_COUNTER_SECTION:
+               maxcounter_ = LABEL_COUNTER_SECTION;
+               break;
+       case MC_COUNTER_SUBSECTION:
+               maxcounter_ = LABEL_COUNTER_SUBSECTION;
+               break;
+       case MC_COUNTER_SUBSUBSECTION:
+               maxcounter_ = LABEL_COUNTER_SUBSUBSECTION;
+               break;
+       case MC_COUNTER_PARAGRAPH:
+               maxcounter_ = LABEL_COUNTER_PARAGRAPH;
+               break;
+       case MC_COUNTER_SUBPARAGRAPH:
+               maxcounter_ = LABEL_COUNTER_SUBPARAGRAPH;
+               break;
+       case MC_COUNTER_ENUMI:
+               maxcounter_ = LABEL_COUNTER_ENUMI;
+               break;
+       case MC_COUNTER_ENUMII:
+               maxcounter_ = LABEL_COUNTER_ENUMII;
+               break;
+       case MC_COUNTER_ENUMIII:
+               maxcounter_ = LABEL_COUNTER_ENUMIII;
+               break;
+       case MC_COUNTER_ENUMIV:
+               maxcounter_ = LABEL_COUNTER_ENUMIV;
+               break;
+       }
+}
+
+enum ClassOptionsTags {
+       CO_FONTSIZE = 1,
+       CO_PAGESTYLE,
+       CO_OTHER,
+       CO_END
+};
+
+static keyword_item classOptionsTags[] = {
+       {"end", CO_END },
+       {"fontsize", CO_FONTSIZE },
+       {"other", CO_OTHER },
+       {"pagestyle", CO_PAGESTYLE }
+};
+
+void LyXTextClass::readClassOptions(LyXLex & lexrc)
+{
+       lexrc.pushTable(classOptionsTags, CO_END);
+       bool getout = false;
+       while (!getout && lexrc.IsOK()) {
+               int le = lexrc.lex();
+               switch (le) {
+               case LyXLex::LEX_UNDEF:
+                       lexrc.printError("Unknown ClassOption tag `$$Token'");
+                       continue; break;
+               default: break;
+               }
+               switch (static_cast<ClassOptionsTags>(le)) {
+               case CO_FONTSIZE:
+                       lexrc.next();
+                       opt_fontsize_ = strip(lexrc.GetString());
+                       break;
+               case CO_PAGESTYLE:
+                       lexrc.next();
+                       opt_pagestyle_ = strip(lexrc.GetString()); 
+                       break;
+               case CO_OTHER:
+                       lexrc.next();
+                       options_ = lexrc.GetString();
+                       break;
+               case CO_END:
+                       getout = true;
+                       break;
+               }
+       }
+       lexrc.popTable();
+}
+
 
 bool LyXTextClass::hasLayout(string const & name) const
 {
@@ -1099,7 +1342,7 @@ bool LyXTextClassList::Read ()
        if (!lex.IsOK()) {
                lyxerr << "LyXTextClassList::Read: unable to open "
                        "textclass file  `" << MakeDisplayPath(real_file, 1000)
-                      << "\'\nCheck your installation. LyX can't continue."
+                      << "'\nCheck your installation. LyX can't continue."
                       << endl;
                return false;
        }
index 6996913e72c72691a679300a4b602ed27a2da2a9..b10bdcccee363679366564ec9c87af62c508f1f7 100644 (file)
@@ -174,7 +174,12 @@ public:
 
        ///
        bool Read (LyXLex &, LyXTextClass const &);
-
+       void readAlign(LyXLex &);
+       void readAlignPossible(LyXLex &);
+       void readLabelType(LyXLex &);
+       void readMargin(LyXLex &);
+       void readLatexType(LyXLex &);
+       void readSpacing(LyXLex &);
        string const & name() const { return name_; }
        void name(string const & n) { name_ = n; }
        string const & obsoleted_by() const { return obsoleted_by_; }
@@ -342,7 +347,9 @@ public:
        
        ///
        bool Read(string const & filename, bool merge = false);
-
+       void readOutputType(LyXLex &);
+       void readMaxCounter(LyXLex &);
+       void readClassOptions(LyXLex &);
        ///
        bool hasLayout(string const & name) const;
 
index 4a51cb3c7a7adb78b277550282b499fbbe17840d..dea5453b867fd262f9707108dfdb54401686424a 100644 (file)
@@ -3561,7 +3561,7 @@ void Reconfigure()
                           AddName(system_lyxdir, "configure"));
        p.pop();
        minibuffer->Set(_("Reloading configuration..."));
-       lyxrc->Read(LibFileSearch(string(), "lyxrc.defaults"));
+       lyxrc->read(LibFileSearch(string(), "lyxrc.defaults"));
        WriteAlert(_("The system has been reconfigured."), 
                   _("You need to restart LyX to make use of any"),
                   _("updated document class specifications."));
index 4d4fe085a951f553ba9d9e7c81ce926ac8756539..a20a9cc14ee3e40f7414695a87523ce3311e6802 100644 (file)
@@ -339,7 +339,7 @@ void LyX::init(int */*argc*/, char **argv)
                lyxrc->ReadBindFile();
 
        if (lyxerr.debugging(Debug::LYXRC)) {
-               lyxrc->Print();
+               lyxrc->print();
        }
 
        // Create temp directory        
@@ -414,7 +414,7 @@ void LyX::ReadRcFile(string const & name)
        if (!lyxrc_path.empty()){
                lyxerr[Debug::INIT] << "Found " << name
                                    << " in " << lyxrc_path << endl;
-               if (lyxrc->Read(lyxrc_path) < 0) { 
+               if (lyxrc->read(lyxrc_path) < 0) { 
                        WriteAlert(_("LyX Warning!"), 
                                   _("Error while reading ")+lyxrc_path+".",
                                   _("Using built-in defaults."));
@@ -425,13 +425,13 @@ void LyX::ReadRcFile(string const & name)
 
 
 // Set debugging level and report result to user
-void setDebuggingLevel(string const &dbgLevel)
+void setDebuggingLevel(string const & dbgLevel)
 {
        lyxerr << _("Setting debug level to ") <<  dbgLevel << endl;
        lyxerr.level(Debug::value(dbgLevel));
        lyxerr[Debug::INFO] << "Debugging INFO #"  << Debug::INFO << endl;
        lyxerr[Debug::INIT] << "Debugging INIT #"  << Debug::INIT << endl;
-       lyxerr[Debug::KEY] << "Debugging KEY #"  << Debug::KEY << endl;
+       lyxerr[Debug::KEY]  << "Debugging KEY #"  << Debug::KEY << endl;
        lyxerr[Debug::TOOLBAR] << "Debugging TOOLBAR #"  << Debug::TOOLBAR << endl; 
        lyxerr[Debug::PARSER] << "Debugging LEX and PARSER #" << Debug::PARSER << endl;
        lyxerr[Debug::LYXRC] << "Debugging LYXRC #" << Debug::LYXRC << endl;
index 6bd290ead5297b2775c6a730e738d061a4540b8b..d894bc149fb795a78d503114437db0d8d789872f 100644 (file)
@@ -553,7 +553,7 @@ LyXFont & LyXFont::lyxRead(LyXLex & lex)
                        error = true;
                }
        }
-       return *this;
+       return * this;
 }
 
 
index 06980bb084e3705e6af1da432e4c1e1444d1c3cf..c923e5d3e6787ab257ae263c2012f67b895a1179 100644 (file)
@@ -138,11 +138,11 @@ extern void Reconfigure();
 extern int current_layout;
 extern int getISOCodeFromLaTeX(char *);
 
-extern int UnlockInset(UpdatableInset*);
+extern int UnlockInset(UpdatableInset *);
 
 extern void ShowLatexLog();
 
-extern void UpdateInset(Inset* inset, bool mark_dirty = true);
+extern void UpdateInset(Inset * inset, bool mark_dirty = true);
 
 /* === globals =========================================================== */
 
@@ -395,7 +395,7 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
                   break;
         }
         if (disable)
-                flag = func_status(flag | LyXFunc::Disabled);
+                flag |= LyXFunc::Disabled;
 
        func_status box = LyXFunc::ToggleOff;
        //      LyXFont font = buf->text->real_current_font;
@@ -2441,6 +2441,13 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
 
+       case LFUN_SAVEPREFERENCES:
+       {
+               Path p(user_lyxdir);
+               lyxrc->write("preferences");
+       }
+       break;
+       
        case LFUN_UNKNOWN_ACTION:
        {
                if (owner->buffer()->isReadonly()) {
index 00a488341b39b41059953efc1acf892f799379cd..c35caaca7bb48150c83edd82a65be4a5f0bc04f0 100644 (file)
@@ -56,7 +56,7 @@ void LyXLex::popTable()
 void LyXLex::printTable()
 {
        lyxerr << "\nNumber of tags: " << no_items << endl;
-       for(int i= 0; i<no_items; i++)
+       for(int i= 0; i < no_items; ++i)
                lyxerr << "table[" << i
                       << "]:  tag: `" << table[i].tag
                       << "'  code:" << table[i].code << endl;
@@ -64,7 +64,7 @@ void LyXLex::printTable()
 }
 
 
-void LyXLex::printError(string const & message)
+void LyXLex::printError(string const & message) const
 {
        string tmpmsg = subst(message, "$$Token", GetString());
        lyxerr << "LyX: " << tmpmsg << " [around line " << lineno
@@ -74,7 +74,7 @@ void LyXLex::printError(string const & message)
 
 bool LyXLex::setFile(string const & filename)
 {
-        if (file) 
+        if (file)
                lyxerr << "Error in LyXLex::setFile: file already set." <<endl;
        file = fopen(filename.c_str(), "r");
        name = filename;
@@ -87,7 +87,8 @@ bool LyXLex::setFile(string const & filename)
 void LyXLex::setFile(FILE * f)
 {
         if (file) 
-               lyxerr << "Error in LyXLex::setFile: file already set." << endl;
+               lyxerr << "Error in LyXLex::setFile: file already set."
+                      << endl;
        file = f;
        owns_file = false;
        lineno = 0; // this is bogus if the file already has been read from
@@ -104,9 +105,9 @@ int LyXLex::lex()
 }
 
 
-int LyXLex::GetInteger()
+int LyXLex::GetInteger() const
 {
-   if (buff[0]>' ')   
+   if (buff[0] > ' ')   
        return atoi(buff);
    else {
        printError("Bad integer `$$Token'");
@@ -115,10 +116,10 @@ int LyXLex::GetInteger()
 }
 
 
-float LyXLex::GetFloat()
+float LyXLex::GetFloat() const
 {
-   if (buff[0]>' ')   
-       return (float)strtod(buff, (char**)0);
+   if (buff[0] > ' ')   
+       return atof(buff);
    else {
        printError("Bad float `$$Token'");
        return -1;
@@ -182,7 +183,7 @@ string LyXLex::getLongString(string const & endtoken)
 }
 
 
-bool LyXLex::GetBool()
+bool LyXLex::GetBool() const
 {
    if (compare(buff, "true") == 0)
        return true;
@@ -194,7 +195,7 @@ bool LyXLex::GetBool()
 
 bool LyXLex::EatLine()
 {
-       int i= 0;
+       int i = 0;
        int c = '\0'; // getc() returns an int
 
        while (!feof(file) && c!= '\n' && i!= (LEX_MAX_BUFF-1)) {
@@ -222,10 +223,10 @@ bool LyXLex::EatLine()
 
 int LyXLex::search_kw(char const * const tag) const
 {
-       int m, k= 0 , l= 0, r= no_items;
+       int m, k = 0 , l = 0, r = no_items;
 
        while (l < r) {
-               m = (l+r)/2;
+               m = (l + r) / 2;
 
                if (lyxerr.debugging(Debug::PARSER)) {
                        lyxerr << "LyXLex::search_kw: elem " << m
@@ -239,19 +240,16 @@ int LyXLex::search_kw(char const * const tag) const
                if (k == 0)
                        return table[m].code;
                else
-                       if (k<0) l = m+1; else r = m;
+                       if (k < 0) l = m + 1; else r = m;
        }
-       return -1;
+       return LEX_UNDEF;
 }
 
 
 bool LyXLex::next(bool esc)
 {
-
        if (!esc) {
                int c; // getc() returns an int
-               //int i;
-               
                
                status = 0;
                while (!feof(file) && !status) { 
@@ -325,8 +323,6 @@ bool LyXLex::next(bool esc)
                return false;
        } else {
                int c; // getc() returns an int
-               //int i;
-               
                
                status = 0;
                while (!feof(file) && !status) { 
@@ -433,15 +429,12 @@ bool LyXLex::next(bool esc)
 
 bool LyXLex::nextToken()
 {
-       int c; // getc() returns an int
-       int i;
-        
         status = 0;
        while (!feof(file) && !status) { 
-               c = getc(file);
+               int c = getc(file); // getc() returns an int
           
                if (c >= ' ' && !feof(file))  {
-                       i = 0;
+                       int i = 0;
                        if (c == '\\') { // first char == '\\'
                                do {
                                        buff[i++] = c;
@@ -500,7 +493,7 @@ int LyXLex::CheckToken(char const * str[], int print_error)
    int i = -1;
    
    if (compare(buff, "default")) {
-       for (i = 0; str[i][0] && compare(str[i], buff); i++);
+       for (i = 0; str[i][0] && compare(str[i], buff); ++i);
        if (!str[i][0]) {
            if (print_error)
                printError("Unknown argument `$$Token'");
index 39809e476a4e6e32e23ba961f51410b9860b01be..b581a7bb36039bb4875ca9a8d5235917c85910ac 100644 (file)
@@ -4,20 +4,20 @@
 //  texclass and others to come.   [asierra30/03/96]
 //
 //   (C) 1996 Lyx Team.
-#ifndef _LYXLEX_H
-#define _LYXLEX_H
+#ifndef LYXLEX_H
+#define LYXLEX_H
 
 #ifdef __GNUG__
 #pragma interface
 #endif
 
-#include <stdio.h>
+#include <cstdio>
 #include "LString.h"
 
 ///
 struct keyword_item {
        ///
-       char const* tag;
+       char const * tag;
        ///
        short code;
 };
@@ -31,7 +31,7 @@ struct keyword_item {
 class LyXLex { 
 public:
        ///
-       LyXLex (keyword_item*, int);
+       LyXLex (keyword_item *, int);
        ///
        ~LyXLex() { if (file && owns_file) fclose(file); };
 
@@ -48,15 +48,15 @@ public:
        };
 
        /// file is open and end of file is not reached
-       bool IsOK();
+       bool IsOK() const;
        /// return true if able to open file, else false
        bool setFile(string const & filename);
        /// if file is already read from, line numbers will be wrong.
        // should be removed
-       void setFile(FILE *f);
+       void setFile(FILE * f);
        ///
        // should be removed
-       FILE *getFile() { return file; }
+       FILE * getFile() { return file; }
        /// Danger! Don't use it unless you know what you are doing.
        void setLineNo(int l) { lineno = l; }
        /// returns a lex code
@@ -73,32 +73,32 @@ public:
        bool nextToken();
        
        /// 
-       int GetLineNo() { return lineno; }
+       int GetLineNo() const { return lineno; }
        ///
-       int GetInteger();
+       int GetInteger() const;
        ///
-       bool GetBool();
+       bool GetBool() const;
        ///
-       float GetFloat();
+       float GetFloat() const;
        ///
        string GetString() const;
        
        /// get a long string, ended by the tag `endtag'
-       string getLongString(string const &endtoken);
+       string getLongString(string const & endtoken);
        
        ///
        bool EatLine();
        ///
-       int FindToken(char const* string[]);
+       int FindToken(char const * string[]);
        ///
-       int CheckToken(char const* string[], int print_error);
+       int CheckToken(char const * string[], int print_error);
 
        ///
-       char const *text() const { return &buff[0]; }
+       char const * text() const { return &buff[0]; }
 
        /** Pushes a token list on a stack and replaces it with a new one.
         */
-       void pushTable(keyword_item*, int);
+       void pushTable(keyword_item *, int);
 
        /** Pops a token list into void and replaces it with the one now
          on top of the stack.
@@ -109,7 +109,7 @@ public:
          and file name. If message contains the substring `$$Token',
          it is replaced with the value of GetString()
          */
-       void printError(string const & message);
+       void printError(string const & message) const;
 
        /**
          Prints the current token table on cerr.
@@ -118,7 +118,7 @@ public:
 protected:
        ///
        enum {
-       ///
+               ///
                LEX_MAX_BUFF = 2048
        };
 
@@ -130,15 +130,15 @@ protected:
                        table_elem= 0;
                }
                ///
-               pushed_table *next;
+               pushed_table * next;
                ///
-               keyword_item *table_elem;
+               keyword_item * table_elem;
                ///
                int table_siz;
        };
 
        ///
-       FILE *file;
+       FILE * file;
         ///
         bool owns_file;
        /// 
@@ -146,13 +146,13 @@ protected:
        ///
        int lineno;
        ///
-       keyword_item *table;
+       keyword_item * table;
        ///
        int no_items;
        ///
        char buff[LEX_MAX_BUFF];
        ///
-       pushed_table *pushed;
+       pushed_table * pushed;
        ///
        int search_kw(char const * const) const;
        ///
@@ -161,9 +161,22 @@ protected:
 
 
 inline
-bool LyXLex::IsOK()
+bool LyXLex::IsOK() const
 {
        return (file && !feof(file));
 }
 
+// This is needed to ensure that the pop is done upon exit from methods
+// with more than one exit point or that can return as a response to
+// exceptions. (Lgb)
+struct pushpophelper {
+       pushpophelper(LyXLex & lexrc, keyword_item * i, int s) : lex(lexrc) {
+               lex.pushTable(i, s);
+       }
+       ~pushpophelper() {
+               lex.popTable();
+       }
+       LyXLex & lex;
+};
+
 #endif
index ae33b10370cde7a2cb5e1b58419e6ada59da07c2..a60c9cd2bc8699c8c788f472c6d03303c8228abe 100644 (file)
@@ -14,6 +14,9 @@
 #pragma implementation "lyxrc.h"
 #endif
 
+#include <fstream>
+#include <iomanip>
+
 #include "debug.h"
 
 #include "lyxrc.h"
@@ -33,10 +36,10 @@ extern int fast_selection;
 extern string background_color;
 extern char selection_color[];
 extern bool cursor_follows_scrollbar;
-extern kb_keymap *toplevel_keymap;
+extern kb_keymap * toplevel_keymap;
 extern LyXAction lyxaction;
 
-enum _LyXRCTags {
+enum LyXRCTags {
        RC_BEGINTOOLBAR = 1,
        RC_FONT_ENCODING,
        RC_PRINTER,
@@ -215,7 +218,7 @@ static const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
 
 // Should this be moved inside LyXAction? 
 static inline
-int bindKey(char const* seq, int action)
+int bindKey(char const * seq, int action)
 { 
        return toplevel_keymap->bind(seq, action); 
 }
@@ -304,47 +307,61 @@ int LyXRC::ReadBindFile(string const & name)
        hasBindFile = true;
        string tmp = i18nLibFileSearch("bind", name, "bind");
        lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
-       int result = Read(tmp);
+       int result = read(tmp);
        if (result) {
                lyxerr << "Error reading bind file: " << tmp << endl;
        }
        return result;
 }
 
-int LyXRC::Read(string const &filename)
+int LyXRC::read(string const & filename)
 {
        // Default bindfile.
        string bindFile = "cua";
-
+       
        LyXLex lexrc(lyxrcTags, lyxrcCount);
        if (lyxerr.debugging(Debug::PARSER))
                lexrc.printTable();
        
        lexrc.setFile(filename);
        if (!lexrc.IsOK()) return -2;
-
+       
        lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
        
        while (lexrc.IsOK()) {
-
-               switch(lexrc.lex()) {
+               // By using two switches we take advantage of the compiler
+               // telling us if we have missed a LyXRCTags element in
+               // the second switch.
+               // Note that this also shows a problem with LyXLex since it
+               // helps us avoid taking advantage of the strictness of the
+               // compiler.
+
+               int le = lexrc.lex();
+               switch(le) {
+               case LyXLex::LEX_UNDEF:
+                       lexrc.printError("Unknown tag `$$Token'");
+                       continue; break;
                case LyXLex::LEX_FEOF:
-                       break;
+                       continue; break;
+               default: break;
+               }
+               switch (static_cast<LyXRCTags>(le)) {
                case RC_INPUT: // Include file
                        if (lexrc.next()) {
                                string tmp = LibFileSearch(string(),
                                                           lexrc.GetString()); 
-                               if (Read(tmp)) {
+                               if (read(tmp)) {
                                        lexrc.printError("Error reading "
-                                                       "included file: "+tmp);
+                                                        "included file: "+tmp);
                                }
                        }
                        break;
                case RC_BINDFILE:                     // RVDK_PATCH_5
-                       if (lexrc.next()) 
+                       if (lexrc.next()) {
                                ReadBindFile(lexrc.GetString());
+                       }
                        break;
-
+                       
                case RC_BEGINTOOLBAR:
                        // this toolbar should be changed to be a completely
                        // non gui toolbar. (Lgb)
@@ -355,27 +372,27 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                use_kbmap = lexrc.GetBool();
                        break;
-
+                       
                case RC_EXIT_CONFIRMATION:
                        if (lexrc.next())
                                exit_confirmation = lexrc.GetBool();
                        break;
-
+                       
                case RC_DISPLAY_SHORTCUTS:
                        if (lexrc.next())
                                display_shortcuts = lexrc.GetBool();
                        break;
-
+                       
                case RC_KBMAP_PRIMARY:
                        if (lexrc.next())
                                primary_kbmap = lexrc.GetString();
                        break;
-
+                       
                case RC_KBMAP_SECONDARY:
                        if (lexrc.next())
                                secondary_kbmap = lexrc.GetString();
                        break;
-                         
+                       
                case RC_FONT_ENCODING:
                        if (lexrc.next())
                                fontenc = lexrc.GetString();
@@ -405,12 +422,12 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                print_pagerange_flag = lexrc.GetString();
                        break;
-
+                       
                case RC_PRINTCOPIESFLAG:
                        if (lexrc.next())
                                print_copies_flag = lexrc.GetString();
                        break;
-
+                       
                case RC_PRINTCOLLCOPIESFLAG:
                        if (lexrc.next())
                                print_collcopies_flag = lexrc.GetString();
@@ -460,12 +477,12 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                print_spool_printerprefix = lexrc.GetString();
                        break;
-
+                       
                 case RC_PRINTPAPERDIMENSIONFLAG:
                        if (lexrc.next())
                                print_paper_dimension_flag = lexrc.GetString();
                        break;
-
+                       
                 case RC_PRINTPAPERFLAG:
                        if (lexrc.next())
                                print_paper_flag = lexrc.GetString();
@@ -475,7 +492,7 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                custom_export_command = lexrc.GetString();
                        break;
-
+                       
                case RC_CUSTOM_EXPORT_FORMAT:
                        if (lexrc.next())
                                custom_export_format = lexrc.GetString();
@@ -485,96 +502,103 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                latex_command = lexrc.GetString();
                        break;
-
+                       
                 case RC_LITERATE_COMMAND:
                         if (lexrc.next())
                                 literate_command = lexrc.GetString();
                         break;
+                       
                 case RC_LITERATE_EXTENSION:
                         if (lexrc.next())
                                 literate_extension = lexrc.GetString();
                         break;
-
+                       
                 case RC_LITERATE_ERROR_FILTER:
                         if (lexrc.next())
                                 literate_error_filter = lexrc.GetString();
                         break;
-
+                       
                 case RC_BUILD_COMMAND:
                         if (lexrc.next())
                                 build_command = lexrc.GetString();
                         break;
-
+                       
                 case RC_BUILD_ERROR_FILTER:
                         if (lexrc.next())
                                 build_error_filter = lexrc.GetString();
-                         break;
+                       break;
+                       
                case RC_RELYX_COMMAND:
                        if (lexrc.next())
                                relyx_command = lexrc.GetString();
                        break;
-
+                       
                case RC_DEFAULT_PAPERSIZE:
                         if (lexrc.next()) {
                                string size = lowercase(lexrc.GetString());
                                if (size == "usletter")
-                                       default_papersize = BufferParams::PAPER_USLETTER;
+                                       default_papersize =
+                                               BufferParams::PAPER_USLETTER;
                                else if (size == "legal")
-                                       default_papersize = BufferParams::PAPER_LEGALPAPER;
+                                       default_papersize =
+                                               BufferParams::PAPER_LEGALPAPER;
                                else if (size == "executive")
-                                       default_papersize = BufferParams::PAPER_EXECUTIVEPAPER;
+                                       default_papersize =
+                                           BufferParams::PAPER_EXECUTIVEPAPER;
                                else if (size == "a3")
-                                       default_papersize = BufferParams::PAPER_A3PAPER;
+                                       default_papersize =
+                                               BufferParams::PAPER_A3PAPER;
                                else if (size == "a4")
-                                       default_papersize = BufferParams::PAPER_A4PAPER;
+                                       default_papersize =
+                                               BufferParams::PAPER_A4PAPER;
                                else if (size == "a5")
-                                       default_papersize = BufferParams::PAPER_A5PAPER;
+                                       default_papersize =
+                                               BufferParams::PAPER_A5PAPER;
                                else if (size == "b5")
-                                       default_papersize = BufferParams::PAPER_B5PAPER;
+                                       default_papersize =
+                                               BufferParams::PAPER_B5PAPER;
                        }
                        break;
                case RC_VIEWDVI_COMMAND:
                        if (lexrc.next())
                                view_dvi_command = lexrc.GetString();
                        break;
-
+                       
                case RC_PS_COMMAND:
                        if (lexrc.next())
                                ps_command = lexrc.GetString();
                        break;
-
+                       
                case RC_VIEWPS_COMMAND:
                        if (lexrc.next())
                                view_ps_command = lexrc.GetString();
                        break;
-
+                       
                case RC_VIEWPSPIC_COMMAND:
                        if (lexrc.next())
                                view_pspic_command = lexrc.GetString();
                        break;
-
+                       
                case RC_CHKTEX_COMMAND:
                        if (lexrc.next())
                                chktex_command = lexrc.GetString();
                        break;
-
+                       
                case RC_HTML_COMMAND:
                        if (lexrc.next())
                                html_command = lexrc.GetString();
                        break;
-
+                       
                case RC_SCREEN_DPI:
                        if (lexrc.next())
                                dpi = lexrc.GetInteger();
                        break;
-
+                       
                case RC_SCREEN_ZOOM:
                        if (lexrc.next())
                                zoom = lexrc.GetInteger();
                        break;
-
+                       
                case RC_SCREEN_FONT_SIZES:
                        if (lexrc.next())
                                font_sizes[LyXFont::SIZE_TINY] =
@@ -607,12 +631,12 @@ int LyXRC::Read(string const &filename)
                                font_sizes[LyXFont::SIZE_HUGER] =
                                        lexrc.GetFloat();
                        break;
-
+                       
                 case RC_SCREEN_FONT_SCALABLE:
                         if (lexrc.next())
                                 use_scalable_fonts = lexrc.GetBool();
                        break;
-
+                       
                case RC_AUTOSAVE:
                        if (lexrc.next())
                                autosave = lexrc.GetInteger();
@@ -622,18 +646,18 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                sgml_extra_options = lexrc.GetString();
                        break;
-
+                       
                case RC_DOCUMENTPATH:
                        if (lexrc.next()) {
                                document_path = ExpandPath(lexrc.GetString());
                        }
                        break;
-
+                       
                case RC_TEMPLATEPATH:
                        if (lexrc.next())
                                template_path = ExpandPath(lexrc.GetString());
                        break;
-
+                       
                case RC_TEMPDIRPATH:
                        if (lexrc.next())
                                tempdir_path = ExpandPath(lexrc.GetString());
@@ -643,32 +667,32 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                use_tempdir = lexrc.GetBool();
                        break;
-
+                       
                case RC_LASTFILES:
                        if (lexrc.next())
                                lastfiles = ExpandPath(lexrc.GetString());
                        break;
-
+                       
                 case RC_NUMLASTFILES:
                         if (lexrc.next())
                                 num_lastfiles = lexrc.GetInteger();
                        break;
-
+                       
                 case RC_CHECKLASTFILES:
                         if (lexrc.next())
                                 check_lastfiles = lexrc.GetBool();
                        break;
-
+                       
                case RC_SCREEN_FONT_ROMAN:
                        if (lexrc.next())
                                roman_font_name = lexrc.GetString();
                        break;
-
+                       
                case RC_SCREEN_FONT_SANS:
                        if (lexrc.next())
                                sans_font_name = lexrc.GetString();
                        break;
-
+                       
                case RC_SCREEN_FONT_TYPEWRITER:
                        if (lexrc.next())
                                typewriter_font_name = lexrc.GetString();
@@ -702,25 +726,25 @@ int LyXRC::Read(string const &filename)
                        // the default bind file.
                        if (!hasBindFile)
                                ReadBindFile();
-
+                       
                        // !!!chb, dynamic key binding...
                        int action, res = 0;
                        string seq, cmd;
-
+                       
                        if (lexrc.lex() == LyXLex::LEX_DATA)  {
                                seq = lexrc.GetString();
                        } else {
                                lexrc.printError("Bad key sequence: `$$Token'");
                                break;
                        }
-
+                       
                        if (lexrc.lex() == LyXLex::LEX_DATA) {
                                cmd = lexrc.GetString();
                        } else {
                                lexrc.printError("Bad command: `$$Token'");
                                break;
                        }
-
+                       
                        if ((action = lyxaction.LookupFunc(cmd.c_str()))>= 0) {
                                if (lyxerr.debugging(Debug::KEY)) {
                                        lyxerr << "RC_BIND: Sequence `"
@@ -731,12 +755,12 @@ int LyXRC::Read(string const &filename)
                                res = bindKey(seq.c_str(), action);
                                if (res != 0) {
                                        lexrc.printError(
-                                             "Invalid key sequence `"
-                                             + seq + '\''); 
+                                               "Invalid key sequence `"
+                                               + seq + '\''); 
                                }
                        } else {// cmd is the last token read.
                                lexrc.printError(
-                                           "Unknown LyX function `$$Token'");
+                                       "Unknown LyX function `$$Token'");
                        }
                        break;
                }
@@ -781,13 +805,13 @@ int LyXRC::Read(string const &filename)
                        break;
                case RC_ASCIIROFF_COMMAND:
                        if (lexrc.next())
-                            ascii_roff_command = lexrc.GetString();
+                               ascii_roff_command = lexrc.GetString();
                        break;
                case RC_ASCII_LINELEN:
                        if (lexrc.next())
-                            ascii_linelen = lexrc.GetInteger();
+                               ascii_linelen = lexrc.GetInteger();
                        break;
-               // Spellchecker settings:
+                       // Spellchecker settings:
                case RC_SPELL_COMMAND:
                        if (lexrc.next())
                                isp_command = lexrc.GetString();
@@ -824,10 +848,7 @@ int LyXRC::Read(string const &filename)
                        if (lexrc.next())
                                isp_esc_chars = lexrc.GetString();
                        break;
-
-               default:
-                       lexrc.printError("Unknown tag `$$Token'");
-                       break;
+               case RC_LAST: break; // this is just a dummy
                }
        }
 
@@ -835,9 +856,278 @@ int LyXRC::Read(string const &filename)
 }
 
 
-void LyXRC::Print()
+void LyXRC::write(string const & filename) const
 {
-       lyxerr << "The current internal LyXRC:" << endl;
+       ofstream ofs(filename.c_str());
+       if (ofs)
+               output(ofs);
+}
+
+
+void LyXRC::print() const
+{
+       if (lyxerr.debugging())
+               output(lyxerr);
+       else
+               output(cout);
+}
+
+
+void LyXRC::output(ostream & os) const
+{
+       os << "### This file is part of\n"
+          << "### ========================================================\n"
+          << "###          LyX, The Document Processor\n"
+          << "###\n"
+          << "###          Copyright 1995 Matthias Ettrich\n"
+          << "###          Copyright 1995-1998 The LyX Team.\n"
+          << "###\n"
+          << "### ========================================================\n"
+          << "\n"
+          << "# This file is written by LyX, if you want to make your own\n"
+          << "# modifications you should do them from inside LyX and save\n"
+          << "# your preferences, or you can also make your modifications\n"
+          << "# to lyxrc by hand. It is not advisable to edit this file.\n"
+          << "\n";
+       
+       // Why the switch you might ask. It is a trick to ensure that all
+       // the elements in the LyXRCTags enum is handled. As you can see
+       // there are no breaks at all. So it is just a huge fall-through.
+       // The nice thing is that we will get a warning from the compiler
+       // if we forget an element.
+       LyXRCTags tag = RC_LAST;
+       switch(tag) {
+       case RC_LAST:
+       case RC_INPUT:
+               // input/include files are not done here
+       case RC_BIND:
+               // bindings is not written to the preferences file.
+       case RC_BINDFILE:
+               // bind files are not done here.
+       case RC_BEGINTOOLBAR:
+               // Toolbar is not written here (yet).
+       case RC_FONT_ENCODING:
+               os << "\\font_encoding \"" << fontenc << "\"\n";
+       case RC_PRINTER:
+               os << "\\printer \"" << printer << "\"\n";
+       case RC_PRINT_COMMAND:
+               os << "\\print_command \"" << print_command << "\"\n";
+       case RC_PRINTEVENPAGEFLAG:
+               os << "\\print_evenpage_flag \"" << print_evenpage_flag
+                  << "\"\n";
+       case RC_PRINTODDPAGEFLAG:
+               os << "\\print_oddpage_flag \"" << print_oddpage_flag
+                  << "\"\n";
+       case RC_PRINTPAGERANGEFLAG:
+               os << "\\print_pagerange_flag \"" << print_pagerange_flag
+                  << "\"\n";
+       case RC_PRINTCOPIESFLAG:
+               os << "\\print_copies_flag \"" << print_copies_flag << "\"\n";
+       case RC_PRINTCOLLCOPIESFLAG:
+               os << "\\print_collcopies_flag \"" << print_collcopies_flag
+                  << "\"\n";
+       case RC_PRINTREVERSEFLAG:
+               os << "\\print_reverse_flag \"" << print_reverse_flag
+                  << "\"\n";
+       case RC_PRINTLANDSCAPEFLAG:
+               os << "\\print_landscape_flag \"" << print_landscape_flag
+                  << "\"\n";
+       case RC_PRINTTOPRINTER:
+               os << "\\print_to_printer \"" << print_to_printer << "\"\n";
+       case RC_PRINT_ADAPTOUTPUT:
+               os << "\\print_adapt_output " << tostr(print_adapt_output)
+                  << "\n";
+       case RC_PRINTTOFILE:
+               os << "\\print_to_file \"" << print_to_file << "\"\n";
+       case RC_PRINTFILEEXTENSION:
+               os << "\\print_file_extension \"" << print_file_extension
+                  << "\"\n";
+       case RC_PRINTEXSTRAOPTIONS:
+               os << "\\print_extra_options \"" << print_extra_options
+                  << "\"\n";
+       case RC_PRINTSPOOL_COMMAND:
+               os << "\\print_spool_command \"" << print_spool_command
+                  << "\"\n";
+       case RC_PRINTSPOOL_PRINTERPREFIX:
+               os << "\\print_spool_printerprefix \""
+                  << print_spool_printerprefix << "\"\n";
+       case RC_PRINTPAPERDIMENSIONFLAG:
+               os << "\\print_paper_dimension_flag \""
+                  << print_paper_dimension_flag << "\"\n";
+       case RC_PRINTPAPERFLAG:
+               os << "\\print_paper_flag \"" << print_paper_flag << "\"\n";
+       case RC_CUSTOM_EXPORT_COMMAND:
+               os << "\\custom_export_command \"" << custom_export_command
+                  << "\"\n";
+       case RC_CUSTOM_EXPORT_FORMAT:
+               os << "\\custom_export_format \"" << custom_export_format
+                  << "\"\n";
+       case RC_LATEX_COMMAND:
+               os << "\\latex_command \"" << latex_command << "\"\n";
+       case RC_LITERATE_COMMAND:
+               os << "\\literate_command \"" << literate_command << "\"\n";
+       case RC_LITERATE_EXTENSION:
+               os << "\\literate_extension \"" << literate_extension
+                  << "\"\n";
+       case RC_LITERATE_ERROR_FILTER:
+               os << "\\literate_error_filter \"" << literate_error_filter
+                  << "\"\n";
+       case RC_BUILD_COMMAND:
+               os << "\\build_command \"" << build_command << "\"\n";
+       case RC_BUILD_ERROR_FILTER:
+               os << "\\build_error_filter \"" << build_error_filter
+                  << "\"\n";
+       case RC_SCREEN_DPI:
+               os << "\\screen_dpi " << dpi << "\n";
+       case RC_SCREEN_ZOOM:
+               os << "\\screen_zoom " << zoom << "\n";
+       case RC_SCREEN_FONT_SIZES:
+               os.setf(ios::fixed);
+               os.precision(2);
+               os << "\\screen_font_sizes";
+               os << " " << font_sizes[LyXFont::SIZE_TINY];
+               os << " " << font_sizes[LyXFont::SIZE_SCRIPT];
+               os << " " << font_sizes[LyXFont::SIZE_FOOTNOTE];
+               os << " " << font_sizes[LyXFont::SIZE_SMALL];
+               os << " " << font_sizes[LyXFont::SIZE_NORMAL];
+               os << " " << font_sizes[LyXFont::SIZE_LARGE];
+               os << " " << font_sizes[LyXFont::SIZE_LARGER];
+               os << " " << font_sizes[LyXFont::SIZE_LARGEST];
+               os << " " << font_sizes[LyXFont::SIZE_HUGE];
+               os << " " << font_sizes[LyXFont::SIZE_HUGER];
+               os << "\n";
+       case RC_AUTOREGIONDELETE:
+               os << "\\auto_region_delete " << tostr(auto_region_delete)
+                  << "\n";
+       case RC_AUTOSAVE:
+               os << "\\autosave " << autosave << "\n";
+       case RC_EXIT_CONFIRMATION:
+               os << "\\exit_confirmation " << tostr(exit_confirmation)
+                  << "\n";
+       case RC_DISPLAY_SHORTCUTS:
+               os << "\\display_shortcuts " << tostr(display_shortcuts)
+                  << "\n";
+       case RC_VIEWDVI_COMMAND:
+               os << "\\view_dvi_command \"" << view_dvi_command << "\"\n";
+       case RC_DEFAULT_PAPERSIZE:
+               os << "\\default_papersize \"";
+               switch (default_papersize) {
+               case BufferParams::PAPER_USLETTER:
+                       os << "usletter"; break;
+               case BufferParams::PAPER_LEGALPAPER:
+                       os << "legal"; break;
+               case BufferParams::PAPER_EXECUTIVEPAPER:
+                       os << "executive"; break;
+               case BufferParams::PAPER_A3PAPER:
+                       os << "a3"; break;
+               case BufferParams::PAPER_A4PAPER:
+                       os << "a4"; break;
+               case BufferParams::PAPER_A5PAPER:
+                       os << "a5"; break;
+               case BufferParams::PAPER_B5PAPER:
+                       os << "b5"; break;
+               case BufferParams::PAPER_DEFAULT: break;
+               }
+               os << "\"\n";
+       case RC_VIEWPS_COMMAND:
+               os << "\\view_ps_command \"" << view_ps_command << "\"\n";
+       case RC_VIEWPSPIC_COMMAND:
+               os << "\\view_pspic_command \"" << view_pspic_command
+                  << "\"\n";
+       case RC_PS_COMMAND:
+               os << "\\ps_command \"" << ps_command << "\"\n";
+       case RC_CHKTEX_COMMAND:
+               os << "\\chktex_command \"" << chktex_command << "\"\n";
+       case RC_HTML_COMMAND:
+               os << "\\html_command \"" << html_command << "\"\n";
+       case RC_SGML_EXTRA_OPTIONS:
+               os << "\\sgml_extra_options \"" << sgml_extra_options
+                  << "\"\n";
+       case RC_KBMAP:
+               os << "\\kbmap " << tostr(use_kbmap) << "\n";
+       case RC_KBMAP_PRIMARY:
+               os << "\\kbmap_primary \"" << primary_kbmap << "\"\n";
+       case RC_KBMAP_SECONDARY:
+               os << "\\kbmap_secondary \"" << secondary_kbmap << "\"\n";
+       case RC_SERVERPIPE:
+               os << "\\serverpipe \"" << lyxpipes << "\"\n";
+       case RC_RELYX_COMMAND:
+               os << "\\relyx_command \"" << relyx_command << "\"\n";
+       case RC_DOCUMENTPATH:
+               os << "\\document_path \"" << document_path << "\"\n";
+       case RC_TEMPLATEPATH:
+               os << "\\template_path \"" << template_path << "\"\n";
+       case RC_TEMPDIRPATH:
+               os << "\\tempdir_path \"" << tempdir_path << "\"\n";
+       case RC_USETEMPDIR:
+               os << "\\use_tempdir " << tostr(use_tempdir) << "\n";
+       case RC_LASTFILES:
+               os << "\\lastfiles \"" << lastfiles << "\"\n";
+       case RC_NUMLASTFILES:
+               os << "\\num_lastfiles " << num_lastfiles << "\n";
+       case RC_CHECKLASTFILES:
+               os << "\\check_lastfiles " << tostr(check_lastfiles) << "\n";
+       case RC_SCREEN_FONT_ROMAN:
+               os << "\\screen_font_roman \"" << roman_font_name << "\"\n";
+       case RC_SCREEN_FONT_SANS:
+               os << "\\screen_font_sans \"" << sans_font_name << "\"\n";
+       case RC_SCREEN_FONT_TYPEWRITER:
+               os << "\\screen_font_typewriter \""
+                  << typewriter_font_name << "\"\n";
+       case RC_SCREEN_FONT_MENU:
+               os << "\\screen_font_menu \"" << menu_font_name << "\"\n";
+       case RC_SCREEN_FONT_POPUP:
+               os << "\\screen_font_popup \"" << popup_font_name << "\"\n";
+       case RC_SCREEN_FONT_ENCODING:
+               os << "\\screen_font_encoding \"" << font_norm << "\"\n";
+       case RC_SCREEN_FONT_SCALABLE:
+               os << "\\screen_font_scalable " << tostr(use_scalable_fonts)
+                  << "\n";
+       case RC_CURSOR_FOLLOWS_SCROLLBAR:
+               os << "\\cursor_follows_scrollbar "
+                  << tostr(cursor_follows_scrollbar) << "\n";
+       case RC_FAST_SELECTION:
+               os << "\\fast_selection "
+                  << tostr(static_cast<bool>(fast_selection)) << "\n";
+       case RC_BACKGROUND_COLOR:
+               os << "\\background_color \"" << background_color << "\"\n";
+       case RC_SELECTION_COLOR:
+               os << "\\selection_color \"" << selection_color << "\"\n";
+       case RC_FAX_COMMAND:
+               os << "\\fax_command \"" << fax_command << "\"\n";
+       case RC_FAXPROGRAM:
+               os << "\\fax_program \"" << fax_program << "\"\n";
+       case RC_PHONEBOOK:
+               os << "\\phone_book \"" << phone_book << "\"\n";
+       case RC_ASCIIROFF_COMMAND:
+               os << "\\ascii_roff_command \"" << ascii_roff_command
+                  << "\"\n";
+       case RC_ASCII_LINELEN:
+               os << "\\ascii_linelen " << ascii_linelen << "\n";
+       case RC_SPELL_COMMAND:
+               os << "\\spell_command \"" << isp_command << "\"\n";
+       case RC_ACCEPT_COMPOUND:
+               os << "\\accept_compound " << tostr(isp_accept_compound)
+                  << "\n";
+       case RC_USE_INP_ENC:
+               os << "\\use_input_encoding " << tostr(isp_use_input_encoding)
+                  << "\n";
+       case RC_USE_ALT_LANG:
+               os << "\\use_alt_language " << tostr(isp_use_alt_lang) << "\n";
+       case RC_USE_PERS_DICT:
+               os << "\\use_personal_dictionary " << tostr(isp_use_pers_dict)
+                  << "\n";
+       case RC_USE_ESC_CHARS:
+               os << "\\use_escape_chars " << tostr(isp_use_esc_chars)
+                  << "\n";
+       case RC_ALT_LANG:
+               os << "\\alternate_language \"" << isp_alt_lang << "\"\n";
+       case RC_PERS_DICT:
+               os << "\\personal_dictionary \"" << isp_pers_dict << "\"\n";
+       case RC_ESC_CHARS:
+               os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
+       }
+       os.flush();
 }
 
 
@@ -848,17 +1138,17 @@ void LyXRC::defaultKeyBindings()
        bindKey("Left",    LFUN_LEFT);
        bindKey("Up",      LFUN_UP);
        bindKey("Down",    LFUN_DOWN);
-
+       
        bindKey("Tab",  LFUN_TAB);
-
+       
        bindKey("Home",    LFUN_HOME);
        bindKey("End",     LFUN_END);
        bindKey("Prior",   LFUN_PRIOR);
        bindKey("Next",    LFUN_NEXT);
-
+       
        bindKey("Return",  LFUN_BREAKPARAGRAPH);
        bindKey("~C-~S-~M-nobreakspace", LFUN_PROTECTEDSPACE);
-
+       
        bindKey("Delete",  LFUN_DELETE);
        bindKey("BackSpace",    LFUN_BACKSPACE);
        // bindKeyings for transparent handling of deadkeys
@@ -882,7 +1172,7 @@ void LyXRC::defaultKeyBindings()
        bindKey("~C-~S-~M-dead_belowdot",        LFUN_UNDERDOT);
        bindKey("~C-~S-~M-dead_tie",             LFUN_TIE);
        bindKey("~C-~S-~M-dead_ogonek",           LFUN_OGONEK);
-
+       
        // bindings to utilize the use of the numeric keypad
        // e.g. Num Lock set
        bindKey("KP_0",        LFUN_SELFINSERT);
@@ -901,11 +1191,11 @@ void LyXRC::defaultKeyBindings()
        bindKey("KP_Divide",   LFUN_SELFINSERT);
        bindKey("KP_Multiply", LFUN_SELFINSERT);
        bindKey("KP_Subtract", LFUN_SELFINSERT);
-    
+       
        /* Most self-insert keys are handled in the 'default:' section of
         * WorkAreaKeyPress - so we don't have to define them all.
         * However keys explicit decleared as self-insert are
         * handled seperatly (LFUN_SELFINSERT.) Lgb. */
-
+       
         bindKey("C-Tab",  LFUN_TABINSERT);  // ale970515
 }
index 25d0cbdf6e4831f4771411635f0e5bff46c8416e..551fd9278dff252a6d563b05a56a5975dde4b11f 100644 (file)
@@ -25,9 +25,13 @@ public:
        ///
        LyXRC();
        ///
-       int Read (string const & filename);
+       int read (string const & filename);
        ///
-        void Print();
+       void write(string const & filename) const;
+       ///
+        void print() const;
+       ///
+       void output(ostream & os) const;
        /// Is a bind file already (or currently) read?
        bool hasBindFile;
        ///
index 7562df412aae49816ed0c6b34815bed4aa33f187..9b10bd54df5274446cb0ad6862f99124a4b7f40c 100644 (file)
@@ -39,15 +39,15 @@ public:
        };
 
        ///
-       LyxArrayBase(int size= ARRAY_STEP);
+       LyxArrayBase(int size = ARRAY_STEP);
        ///
-       LyxArrayBase(const LyxArrayBase&);
+       LyxArrayBase(LyxArrayBase const &);
        ///
        ~LyxArrayBase();
    
        
        ///
-       int Empty() { return (last == 0); }
+       int empty() const { return (last == 0); }
    
        ///
        int Last() { return last; }
@@ -62,16 +62,16 @@ public:
        void Remove(int pos, int dx);   
 
        /// Merge dx elements from array a at pos. Changes the size if necessary.
-       void Merge(LyxArrayBase *a, int pos, int dx); 
+       void Merge(LyxArrayBase * a, int pos, int dx); 
 
        /// Same as Merge but doesn't changes the size (dangerous)
-       void MergeF(LyxArrayBase *a, int pos, int dx); 
+       void MergeF(LyxArrayBase * a, int pos, int dx); 
 
        /// Copy dx byts from an array at position pos
        void Copy(void *, int pos, int dx); 
 
        /// Constructs a new array with dx elements starting at pos 
-       LyxArrayBase* Extract(int pos, int dx); 
+       LyxArrayBase * Extract(int pos, int dx); 
 
        /// Insert a character at position pos
        void Insert(int pos, byte);
@@ -83,7 +83,7 @@ public:
        byte operator[](const int);
 
        /// Constructs a new array with dx elements starting at pos 
-       LyxArrayBase& operator= (const LyxArrayBase&); 
+       LyxArrayBase & operator= (LyxArrayBase const &); 
 
 protected:
        ///
@@ -92,7 +92,7 @@ protected:
        bool Move(int p, int shift);
 
        /// Buffer
-       byte *bf;
+       byte * bf;
        /// Last position inserted.
        int last;
        /// Max size of the array.
index 95f01c853f38e654b2692f8a68358dc57990f3c9..c55c194c7d317c158d829fdd046e85d16ddd6969 100644 (file)
@@ -59,7 +59,7 @@ MathParInset::Draw(int x, int y)
    bool limits = false;
     
    xo = x;  yo = y; 
-   if (!array || array->Empty()) {
+   if (!array || array->empty()) {
       mathed_set_font(LM_TC_VAR, 1);
        if (array) {
           MathedXIter data(this);
@@ -155,7 +155,7 @@ MathParInset::Metrics()
     width = df_width;
     descent = 0;
     if (!array) return;
-    if (array->Empty()) return;
+    if (array->empty()) return;
     
     ascent = 0;
     MathedXIter data(this);
index 2ea46c45b01e910d15ecca0d331b002a29251315..2f9a13d2e6bd50299602db493e542cd0a5f2e780 100644 (file)
@@ -866,7 +866,7 @@ void MathedXIter::IMetrics(int pos2, int& width, int& ascent, int& descent)
   
     descent = ascent = width = 0;
     if (!array) return;
-    if (array->Empty()) return;
+    if (array->empty()) return;
 //    if  (pos2 > array->last) return;
     x1 = x; 
     while (pos<pos2) {
index 7dcc62663c62e17ce22f7f1ffc7cccc599cc4416..e01c66bfb6aebbad0feff73a2d69149ff71d219f 100644 (file)
@@ -61,9 +61,9 @@ class MathedIter {
     ///
     void goPosAbs(int);
     ///
-    int Empty() { return array->last<= 1; }
+    int Empty() { return array->Last()<= 1; }
     ///
-    int OK() { return array && (pos < array->last); }
+    int OK() { return array && (pos < array->Last()); }
     ///
     int IsFirst() { return (pos == 0); }
     ///
@@ -268,48 +268,48 @@ class MathedXIter: public MathedIter {
 inline
 bool MathedIter::IsInset()
 {
-    return MathIsInset(array->bf[pos]);
+    return MathIsInset((*array)[pos]);
 }
  
 inline
 bool MathedIter::IsActive()
 {
-    return MathIsActive(array->bf[pos]);
+    return MathIsActive((*array)[pos]);
 }
 
 inline
 bool MathedIter::IsFont()
 {
-    return MathIsFont(array->bf[pos]);
+    return MathIsFont((*array)[pos]);
 }
 
 
 inline
 bool MathedIter::IsScript()
 {
-    return MathIsScript(array->bf[pos]);
+    return MathIsScript((*array)[pos]);
 }   
 
 inline
 bool MathedIter::IsTab()
 {
-    return (array->bf[pos] == LM_TC_TAB);
+    return ((*array)[pos] == LM_TC_TAB);
 }  
 
 
 inline
 bool MathedIter::IsCR()
 {
-    return (array->bf[pos] == LM_TC_CR);
+    return ((*array)[pos] == LM_TC_CR);
 }  
 
 
 inline
-MathedIter::MathedIter(LyxArrayBase *d): array(d)
+MathedIter::MathedIter(LyxArrayBase * d): array(d)
 {
     pos = 0;
     row = col = 0;
-    fcode = (array && IsFont()) ? array->bf[0]: 0;
+    fcode = (array && IsFont()) ? (*array)[0]: 0;
 }
      
 
index 3cfdf86f47e258b62b9d9972c03f1216ac481bb9..cedcde2c4b639b5bdefeec946578be06da26ed24 100644 (file)
@@ -268,7 +268,7 @@ extern "C" int align_filter(FL_OBJECT *, char const *, char const * cur, int c)
 }
 
 
-char ** mathed_get_pixmap_from_icon(int d)
+char const ** mathed_get_pixmap_from_icon(int d)
 {
    switch (d) {
     case MM_FRAC: return frac;
@@ -293,20 +293,20 @@ FD_panel * create_math_panel( )
 
    /* fill-in form initialization code */
    fl_set_button(fd_delim->left, 1);
-   fl_set_pixmap_data(fd_delim->pix, delim0);
+   fl_set_pixmap_data(fd_delim->pix, const_cast<char**>(delim0));
    fl_set_bmtable_data(fd_delim->menu, 6, 4, delim_width, delim_height,
                       delim_bits);
    fl_set_bmtable_maxitems(fd_delim->menu, 23);
    
-   fl_set_pixmap_data(fd_panel->sqrt, sqrt);
-   fl_set_pixmap_data(fd_panel->frac, frac);
-   fl_set_pixmap_data(fd_panel->delim, delim);
-   fl_set_pixmap_data(fd_panel->deco, deco);
-   fl_set_pixmap_data(fd_panel->space, space_xpm);
-   fl_set_pixmap_data(fd_panel->matrix, matrix);
-   fl_set_pixmap_data(fd_panel->equation, equation);
-
-   for (int i= 0; i<32; i++) {
+   fl_set_pixmap_data(fd_panel->sqrt, const_cast<char**>(sqrt));
+   fl_set_pixmap_data(fd_panel->frac, const_cast<char**>(frac));
+   fl_set_pixmap_data(fd_panel->delim, const_cast<char**>(delim));
+   fl_set_pixmap_data(fd_panel->deco, const_cast<char**>(deco));
+   fl_set_pixmap_data(fd_panel->space, const_cast<char**>(space_xpm));
+   fl_set_pixmap_data(fd_panel->matrix, const_cast<char**>(matrix));
+   fl_set_pixmap_data(fd_panel->equation, const_cast<char**>(equation));
+
+   for (int i = 0; i < 32; ++i) {
        fl_add_browser_line(fd_panel->func_browse, func_code[i]);
    }
     
index 4d33d0aba7c1b7d4da2b4885c1e44697d47c7d77..de617892cfb4420929068df4fb05e7fe4b210612 100644 (file)
@@ -65,8 +65,9 @@ protected:
    ~BitmapMenu();
    ///
    FL_OBJECT * AddBitmap(int id,
-                       int nx, int ny, int bw, int bh,
-                       unsigned char * data, Bool vert= True); // Why Bool?
+                        int nx, int ny, int bw, int bh,
+                        unsigned char const * data,
+                        Bool vert= True); // Why Bool?
    ///
    void Create();
    ///
index 347424bf3e7d3dcc2528c6081ef578cc79175b32..c8df4a9b45adb1634b15d529ab0bf3f20751bdea 100644 (file)
@@ -42,11 +42,11 @@ using std::max;
 extern void SmallUpdate(signed char);
 extern void BeforeChange();
 extern void Update(signed char);
-extern int UnlockInset(UpdatableInset*);
+extern int UnlockInset(UpdatableInset *);
 extern short greek_kb_flag;
-extern MiniBuffer *minibuffer;
+extern MiniBuffer * minibuffer;
 
-extern BufferView *current_view;
+extern BufferView * current_view;
 
 /* Bitmaps */
 #include "greek.xbm"
@@ -58,7 +58,7 @@ extern BufferView *current_view;
 #include "dots.xbm"
 
 /* Latex code for those bitmaps */
-static char const *latex_greek[] =  {
+static char const * latex_greek[] =  {
    "Gamma", "Delta", "Theta", "Lambda", "Xi", "Pi",
    "Sigma", "Upsilon", "Phi", "Psi", "Omega",
    "alpha", "beta", "gamma", "delta", "epsilon", "varepsilon", "zeta",
@@ -67,7 +67,7 @@ static char const *latex_greek[] =  {
    "tau", "upsilon", "phi", "varphi", "chi", "psi", "omega", ""
 };
 
-static char const *latex_brel[] = {
+static char const * latex_brel[] = {
   "leq", "geq", "equiv", "models", 
   "prec", "succ", "sim", "perp", 
   "preceq", "succeq", "simeq", "mid", 
@@ -79,7 +79,7 @@ static char const *latex_brel[] = {
   "vdash", "dashv", "bowtie", ""
 };
 
-static char const* latex_arrow[] = {
+static char const * latex_arrow[] = {
   "downarrow", "leftarrow", "Downarrow", "Leftarrow", 
   "hookleftarrow", "rightarrow", "uparrow", "Rightarrow", "Uparrow",
   "hookrightarrow", "updownarrow", "Leftrightarrow", "leftharpoonup", 
@@ -90,7 +90,7 @@ static char const* latex_arrow[] = {
   "nwarrow", "nearrow", "swarrow", "searrow",  "",
 };
 
-char const* latex_varsz[] = {
+char const * latex_varsz[] = {
 "sum", "int", "oint", 
 "prod", "coprod", "bigsqcup", 
 "bigotimes", "bigodot", "bigoplus", 
@@ -98,7 +98,7 @@ char const* latex_varsz[] = {
 "bigvee", "bigwedge", ""
 };
 
-static char const* latex_bop[] = {   
+static char const * latex_bop[] = {   
   "pm", "cap", "diamond", "oplus", 
   "mp", "cup", "bigtriangleup", "ominus", 
   "times", "uplus", "bigtriangledown", "otimes", 
@@ -109,7 +109,7 @@ static char const* latex_bop[] = {
   "bullet", "wr", "ddagger", ""
 };
 
-static char const* latex_misc[] = {
+static char const * latex_misc[] = {
   "nabla", "partial", "infty", "prime", "ell", 
   "emptyset", "exists", "forall", "imath",  "jmath",
   "Re", "Im", "aleph", "wp", "hbar", 
@@ -118,7 +118,7 @@ static char const* latex_misc[] = {
   "diamondsuit", "heartsuit", "clubsuit", "spadesuit", "" 
 };
 
-static char const* latex_dots[] = { 
+static char const * latex_dots[] = { 
    "ldots", "cdots", "vdots", "ddots"
 };
 
@@ -132,15 +132,16 @@ static signed char Latin2Greek[] =  {
  5, 2, -1, 6, -1, 7, -1, 10, 4, 9, -1
 }; 
 
-extern char** mathed_get_pixmap_from_icon(int d);
+extern char const ** mathed_get_pixmap_from_icon(int d);
 extern "C" void math_cb(FL_OBJECT*, long);
-static char** pixmapFromBitmapData(char const *, int, int);
-void math_insert_symbol(char const* s);
+static char const ** pixmapFromBitmapData(char const *, int, int);
+void math_insert_symbol(char const * s);
 Bool math_insert_greek(char const c);
 
-BitmapMenu *BitmapMenu::active = 0;
+BitmapMenu * BitmapMenu::active = 0;
 
-BitmapMenu::BitmapMenu(int n,  FL_OBJECT* bt, BitmapMenu* prevx): nb(n)  {
+BitmapMenu::BitmapMenu(int n,  FL_OBJECT * bt, BitmapMenu * prevx): nb(n)
+{
    w = h = 0;
    form = 0;
    i = 0;
@@ -156,20 +157,26 @@ BitmapMenu::BitmapMenu(int n,  FL_OBJECT* bt, BitmapMenu* prevx): nb(n)  {
      prev->next = this;
 }
 
-BitmapMenu::~BitmapMenu() {
+
+BitmapMenu::~BitmapMenu()
+{
  if (next) delete next;
  if (form->visible) Hide();
  fl_free_form(form);  
  delete[] bitmap;
 }
 
-void BitmapMenu::Hide()  {
+
+void BitmapMenu::Hide()
+{
    fl_hide_form(form);
    fl_set_button(button, 0);
    active = 0;
 }
 
-void BitmapMenu::Show()  {
+
+void BitmapMenu::Show()
+{
    if (active)
      active->Hide();
    active = this;
@@ -179,15 +186,15 @@ void BitmapMenu::Show()  {
    fl_show_form(form, FL_PLACE_MOUSE, FL_NOBORDER, "");
 }
 
-FL_OBJECT*
-BitmapMenu::AddBitmap(int id, int nx, int ny, int bw, int bh, unsigned char* data, Bool vert)
+FL_OBJECT *
+BitmapMenu::AddBitmap(int id, int nx, int ny, int bw, int bh, unsigned char const * data, Bool vert)
 {
-   if (i>= nb)
+   if (i >= nb)
      return 0;
-   int wx= bw+ww/2, wy= bh+ww/2;
+   int wx = bw+ww/2, wy = bh+ww/2;
    wx += (wx % nx);
    wy += (wy % ny); 
-   FL_OBJECT *obj = fl_create_bmtable(1, x, y, wx, wy, "");   
+   FL_OBJECT * obj = fl_create_bmtable(1, x, y, wx, wy, "");   
    fl_set_object_callback(obj, math_cb, id);
    fl_set_object_lcol(obj, FL_BLUE);    
    fl_set_object_boxtype(obj, FL_UP_BOX);   
@@ -308,10 +315,10 @@ extern "C" void math_cb(FL_OBJECT* ob, long data)
      menu->Hide(); 
 }
 
-char** get_pixmap_from_symbol(char const *arg, int wx, int hx)
+char const ** get_pixmap_from_symbol(char const * arg, int wx, int hx)
 {
-   char** data= 0;                 
-   latexkeys *l = in_word_set (arg, strlen(arg));
+   char const ** data = 0;                 
+   latexkeys * l = in_word_set (arg, strlen(arg));
    if (!l) 
     return 0;
     
@@ -337,10 +344,10 @@ char** get_pixmap_from_symbol(char const *arg, int wx, int hx)
 Bool math_insert_greek(char const c)
 {
    int i;
-   char const *s= 0;
+   char const * s= 0;
    
-   if ('A'<= c && c<= 'Z') {
-      if ((i= Latin2Greek[c - 'A'])>= 0)
+   if ('A' <= c && c <= 'Z') {
+      if ((i = Latin2Greek[c - 'A']) >= 0)
        s = latex_greek[i];
    }   
    if ('a'<= c && c<= 'z') {
@@ -430,15 +437,15 @@ void  create_symbol_menues(FD_panel * symb_form)
 }
 
 static
-char** pixmapFromBitmapData(char const *s, int wx, int hx)
+char const ** pixmapFromBitmapData(char const * s, int wx, int hx)
 {
-    int i, id;
-    char** data= 0;
+    int i;
+    char const ** data = 0;
     
-    id= -1;
+    int id = -1;
     
-    for (i= 0; i<6; i++) {
-       char const **latex_str = 0;
+    for (i = 0; i < 6; ++i) {
+       char const ** latex_str = 0;
        switch (i) {
         case 0: latex_str = latex_greek; break;
         case 1: latex_str = latex_bop; break;
@@ -454,10 +461,10 @@ char** pixmapFromBitmapData(char const *s, int wx, int hx)
                break;
            }
        }
-       if (id>= 0) break;
+       if (id >= 0) break;
     }
-    if (i<6 && id>= 0) {
-       unsigned char *bdata = 0;
+    if (i < 6 && id >= 0) {
+       unsigned char const * bdata = 0;
        int w = 0, h = 0, dw = 0, dh = 0;
 
        lyxerr[Debug::MATHED] << "Imando " << i << ", " << id << endl;
@@ -523,21 +530,21 @@ char** pixmapFromBitmapData(char const *s, int wx, int hx)
        }
        int ww = w/dw, hh = h/dh, x, y;
    
-       XImage *xima = XCreateImage(fl_display, 0, 1, XYBitmap, 0, 
-                                   reinterpret_cast<char*>(bdata), w, h, 8, 0);
+       XImage * xima = XCreateImage(fl_display, 0, 1, XYBitmap, 0, 
+                                   const_cast<char*>(reinterpret_cast<char const *>(bdata)), w, h, 8, 0);
        xima->byte_order = LSBFirst;
        xima->bitmap_bit_order = LSBFirst;
        x = (id % dw)*ww;
        y = (id/dw)*hh;
-       if (ww>wx) ww = wx;
-       if (hh>hx) hh = hx;
-       XImage *sbima = XSubImage(xima, x, y, ww, hh);
-       XpmCreateDataFromImage(fl_display, &data, sbima, sbima, 0);
+       if (ww > wx) ww = wx;
+       if (hh > hx) hh = hx;
+       XImage * sbima = XSubImage(xima, x, y, ww, hh);
+       XpmCreateDataFromImage(fl_display, const_cast<char***>(&data), sbima, sbima, 0);
        
        // Dirty hack to get blue symbols quickly
-       char *sx = strstr(data[2], "FFFFFFFF");
+       char * sx = strstr(data[2], "FFFFFFFF");
        if (sx) {
-           for (int k= 0; k<8; k++) sx[k] = '0';
+           for (int k = 0; k < 8; ++k) sx[k] = '0';
        }
 
 //     XDestroyImage(xima);
index e8baacf30612e3516b99603511f87922cf233f95..e29bbcdd02eba81e37ace3281cdf6753aa687057 100644 (file)
@@ -616,7 +616,6 @@ bool AbsolutePath(string const & path)
 // Supports ./ and ~/. Later we can add support for ~logname/. (Asger)
 string ExpandPath(string const & path)
 {
-       Assert(!path.empty()); // We don't allow empty path. (Lgb)
        // checks for already absolute path
        string RTemp = ReplaceEnvironmentPath(path);
        if (AbsolutePath(RTemp))
@@ -700,7 +699,6 @@ string CleanupPath(string const & path)
 
 string ReplaceEnvironmentPath(string const & path)
 {
-       Assert(!path.empty()); // We don't allow empty path. (Lgb)
 // 
 // CompareChar: Environmentvariables starts with this character
 // PathChar:    Next path component start with this character
index c63d8fa9f05d4570277f52696cf40b5b46757687..c950b4579fd8417ae7af89aee829ca0dd09ec2eb 100644 (file)
@@ -95,7 +95,7 @@
 
 // this one is not "C" because combox callbacks are really C++ %-|
 extern void LayoutsCB(int, void*);
-extern char** get_pixmap_from_symbol(char const *arg, int, int);
+extern char const ** get_pixmap_from_symbol(char const * arg, int, int);
 extern LyXAction lyxaction;
 
 
@@ -139,23 +139,25 @@ Toolbar::Toolbar(Toolbar const &rct, LyXView *o, int x, int y)
 // timer-cb for bubble-help (Matthias)
 void Toolbar::BubbleTimerCB(FL_OBJECT *, long data)
 {
-       FL_OBJECT* ob = (FL_OBJECT*) data;
-       char* help = (char*) ob->u_vdata;
+       FL_OBJECT * ob = reinterpret_cast<FL_OBJECT*>(data);
+       char* help = static_cast<char*>(ob->u_vdata);
        fl_show_oneliner(help, ob->form->x + ob->x,
                         ob->form->y + ob->y + ob->h);
 }
 
-extern "C" void C_Toolbar_BubbleTimerCB(FL_OBJECT *ob, long data)
+
+extern "C" void C_Toolbar_BubbleTimerCB(FL_OBJECT * ob, long data)
 {
        Toolbar::BubbleTimerCB(ob, data);
 }
 
+
 // post_handler for bubble-help (Matthias)
 int Toolbar::BubblePost(FL_OBJECT *ob, int event,
             FL_Coord /*mx*/, FL_Coord /*my*/, int /*key*/, void */*xev*/)
 {
-       string help = (char *)ob->u_vdata;
-       Toolbar *t = (Toolbar*)ob->u_ldata;
+       string help = static_cast<char *>(ob->u_vdata);
+       Toolbar * t = reinterpret_cast<Toolbar*>(ob->u_ldata);
        
        if(event == FL_ENTER && !help.empty()){
                fl_set_object_callback(t->bubble_timer,
@@ -169,17 +171,19 @@ int Toolbar::BubblePost(FL_OBJECT *ob, int event,
        return 0;
 }
 
-extern "C" int C_Toolbar_BubblePost(FL_OBJECT *ob, int event,
+
+extern "C" int C_Toolbar_BubblePost(FL_OBJECT * ob, int event,
                                   FL_Coord /*mx*/, FL_Coord /*my*/, 
-                                  int key, void *xev)
+                                  int key, void * xev)
 {
        return Toolbar::BubblePost(ob, event, 0, 0, key, xev);
 }
 
+
 void Toolbar::activate()
 {
-       toolbarItem *item, *tmp= 0;
-       item = toollist;
+       toolbarItem * tmp= 0;
+       toolbarItem * item = toollist;
        while(item){
                tmp = item->next;
                if (item->icon) {
@@ -192,8 +196,8 @@ void Toolbar::activate()
 
 void Toolbar::deactivate()
 {
-       toolbarItem *item, *tmp= 0;
-       item = toollist;
+       toolbarItem * tmp= 0;
+       toolbarItem * item = toollist;
        while(item){
                tmp = item->next;
                if (item->icon) {
@@ -204,20 +208,22 @@ void Toolbar::deactivate()
 }
 
 
-void Toolbar::ToolbarCB(FL_OBJECT *ob, long ac)
+void Toolbar::ToolbarCB(FL_OBJECT * ob, long ac)
 {
-       Toolbar *t = (Toolbar*)ob->u_ldata;
+       Toolbar * t = reinterpret_cast<Toolbar*>(ob->u_ldata);
        
        string res = t->owner->getLyXFunc()->Dispatch(int(ac));
        if(!res.empty())
                lyxerr[Debug::TOOLBAR] << res << endl;
 }
 
-extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT *ob, long data)
+
+extern "C" void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
 {
        Toolbar::ToolbarCB(ob, data);
 }
 
+
 int Toolbar::get_toolbar_func(string const & func)
 {
        int action = lyxaction.LookupFunc(func.c_str());
@@ -271,9 +277,8 @@ void Toolbar::set(bool doingmain)
        // we shouldn't set if we have not cleaned
        if (!cleaned) return;
        
-       toolbarItem *item;
-       FL_OBJECT *obj;
-       item = toollist;
+       FL_OBJECT * obj;
+       toolbarItem * item = toollist;
        
        if (!doingmain) {
                fl_freeze_form(owner->getForm());
@@ -336,7 +341,7 @@ void Toolbar::set(bool doingmain)
                          
                          fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
 
-                         fl_set_pixmapbutton_data(obj, item->pixmap);
+                         fl_set_pixmapbutton_data(obj, const_cast<char**>(item->pixmap));
                          item = item->next;
                          // we must remember to update the positions
                          xpos += buttonwidth;
@@ -363,9 +368,9 @@ void Toolbar::set(bool doingmain)
 }
 
 
-char **Toolbar::getPixmap(kb_action action, string const & arg)
+char const **Toolbar::getPixmap(kb_action action, string const & arg)
 {
-       char **pixmap = unknown_xpm; //0
+       char const ** pixmap = unknown_xpm; //0
        switch(action){
        case LFUN_MENUOPEN:    pixmap = open_xpm; break;
        case LFUN_CLOSEBUFFER: pixmap = close_xpm; break;
@@ -442,8 +447,8 @@ void Toolbar::add(int action, bool doclean)
                // first «hide» the toolbar buttons. This is not a real hide
                // actually it deletes and frees the button altogether.
                lyxerr << "Toolbar::add: «hide» the toolbar buttons." << endl;
-               toolbarItem *item, *tmp= 0;
-               item = toollist;
+               toolbarItem * tmp= 0;
+               toolbarItem * item = toollist;
 
                lightReset();
                
@@ -466,10 +471,10 @@ void Toolbar::add(int action, bool doclean)
        
        // there exist some special actions not part of
        // kb_action: SEPARATOR, LAYOUTS
-       char **pixmap = 0;
+       char const ** pixmap = 0;
        string help;
 
-       toolbarItem *newItem,*tmp;
+       toolbarItem * newItem, * tmp;
 
        if (lyxaction.isPseudoAction(action)) {
                string arg;
@@ -524,8 +529,8 @@ void Toolbar::add(string const & func, bool doclean)
 
 void Toolbar::clean()
 {
-       toolbarItem *item, *tmp= 0;
-       item = toollist;
+       toolbarItem * tmp = 0;
+       toolbarItem * item = toollist;
 
        reset();
 
@@ -556,8 +561,8 @@ void Toolbar::push(int nth)
        
        if (nth == 0) return;
 
-       int count= 0;
-       toolbarItem *tmp = toollist;
+       int count = 0;
+       toolbarItem * tmp = toollist;
        while (tmp) {
                count++;
                if (count == nth) {
@@ -571,7 +576,7 @@ void Toolbar::push(int nth)
 }
 
 
-void Toolbar::read(LyXLex &lex)
+void Toolbar::read(LyXLex & lex)
 {
        //consistency check
        if (lex.GetString() != "\\begin_toolbar")
index 574bd5d12ff11ddc7cc5bf741d9332a105d22eaa..f610f5c746521c0ff0a41c9e03e08184960eb38e 100644 (file)
@@ -1,14 +1,14 @@
 // -*- C++ -*-
 /* This file is part of
  * ======================================================
-* 
-*           LyX, The Document Processor
-         Copyright (C) 1995 Matthias Ettrich
-*
-*           This file is Copyright (C) 1996-1998
-*           Lars Gullik Bjønnes
-*
-* ====================================================== */
+ 
+ *           LyX, The Document Processor
+ *         Copyright (C) 1995 Matthias Ettrich
+ *
+ *           This file is Copyright (C) 1996-1999
+ *           Lars Gullik Bjønnes
+ *
+ * ====================================================== */
 
 #ifndef TOOLBAR_H
 #define TOOLBAR_H
@@ -30,7 +30,7 @@
 class Toolbar {
 public:
        ///
-       Toolbar(Toolbar const &, LyXView *o, int x, int y);
+       Toolbar(Toolbar const &, LyXView * o, int x, int y);
 
        ///
        Toolbar()
@@ -63,22 +63,22 @@ public:
        };
 
        ///
-       Combox *combox;
+       Combox * combox;
 
        ///
-       void read(LyXLex&);
+       void read(LyXLex &);
        /// sets up the default toolbar
        void init();
        /// (re)sets the toolbar
-       void set(bool doingmain= false);
+       void set(bool doingmain = false);
 
        /** this is to be the entry point to the toolbar
          frame, where you can change the toolbar realtime. */
        void edit();
        /// add a new button to the toolbar.
-       void add(int , bool doclean= true);
+       void add(int , bool doclean = true);
        /// name of func instead of kb_action
-       void add(string const & , bool doclean= true);
+       void add(string const & , bool doclean = true);
        /// invokes the n'th icon in the toolbar
        void push(int);
        /// activates the toolbar
@@ -87,29 +87,29 @@ public:
         void deactivate();
 
        ///
-       static void ToolbarCB(FL_OBJECT*, long);
+       static void ToolbarCB(FL_OBJECT *, long);
        ///
        static void BubbleTimerCB(FL_OBJECT *, long);
        ///
-       static int BubblePost(FL_OBJECT *ob, int event,
-                             FL_Coord mx, FL_Coord my, int key, void *xev);
+       static int BubblePost(FL_OBJECT * ob, int event,
+                             FL_Coord mx, FL_Coord my, int key, void * xev);
 
 private:
        ///
        struct toolbarItem
        {
                ///
-               toolbarItem *next;
+               toolbarItem * next;
                ///
                int action;
                ///
                string help;
                ///
-               FL_OBJECT *icon;
+               FL_OBJECT * icon;
                ///
                bool IsBitmap;
                ///
-               char **pixmap;
+               char const ** pixmap;
                ///
                toolbarItem(){
                        next = 0;
@@ -129,11 +129,11 @@ private:
        };
 
        /// a list containing all the buttons
-       toolbarItem *toollist;
+       toolbarItem * toollist;
        ///
-       LyXView *owner;
+       LyXView * owner;
        ///
-       FL_OBJECT *bubble_timer;
+       FL_OBJECT * bubble_timer;
        /// Starting position
        int sxpos, sypos;
        ///
@@ -152,7 +152,7 @@ private:
        bool cleaned;
 
        ///
-       char **getPixmap(kb_action, string const & arg = string());
+       char const ** getPixmap(kb_action, string const & arg = string());
        /// removes all toolbar buttons from the toolbar.
        void clean();