]> git.lyx.org Git - features.git/commitdiff
cleanups from John and Juergen, bib files parsing fix from Herbert
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 26 Feb 2002 10:50:48 +0000 (10:50 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 26 Feb 2002 10:50:48 +0000 (10:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3586 a592a061-630c-0410-9148-cb99ea01b6c8

40 files changed:
ChangeLog
acconfig.h
lib/ChangeLog
lib/ui/default.ui
po/POTFILES.in
src/ChangeLog
src/Makefile.am
src/buffer.C
src/bufferlist.C
src/chset.C
src/chset.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/biblio.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/forms/form_graphics.fd
src/kbmap.h
src/lengthcommon.h
src/lyx_gui.C
src/lyxgluelength.h
src/lyxlength.h
src/lyxserver.C
src/lyxtextclass.C
src/nt_defines.h [deleted file]
src/os2_defines.h [deleted file]
src/os2_errortable.h [deleted file]
src/paragraph.C
src/support/ChangeLog
src/support/Makefile.am
src/support/nt_defines.h [new file with mode: 0644]
src/support/os2_defines.h [new file with mode: 0644]
src/support/os2_errortable.h [new file with mode: 0644]
src/text2.C
src/undo.C
src/vc-backend.C
src/vc-backend.h
src/vms_defines.h [deleted file]
src/vspace.C
src/vspace.h

index 9f2ed701a481003b6ab8773c05ba21c132d1e5ee..4556361d0edd75c3b72d03577ecdabe7e9ef7a93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-02-26  John Levon  <moz@compsoc.man.ac.uk>
+
+       * acconfig.h: nt/os2 defines moved
 2002-02-04  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * README: change reference to bugtracker
index ab7c54953bcfeff03ac5a9472facb763eefe606f..8d0cbf7b644c1c182076dfb1c1fc7fe1c33f8577 100644 (file)
@@ -96,15 +96,11 @@ int mkstemp(char*);
 #endif
 
 #ifdef __EMX__
-#include "os2_defines.h"
-#endif
-
-#ifdef VMS
-#include "vms_defines.h"
+#include "support/os2_defines.h"
 #endif
 
 #if defined(__CYGWIN__) || defined( __CYGWIN32__)
-#include "nt_defines.h"
+#include "support/nt_defines.h"
 #endif
 
 /* Some support for the boost library. */
index aede1d201fd5b01590d8892402b070ce40c726ff..cace336a4844df18a77e61df84088595e974a9fc 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-21  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * ui/default.ui: change Layout>LaTeX Preamble to Layout>Preamble.
+
 2002-02-13  José Matos  <jamatos@fep.up.pt>
 
        * examples/linuxdoc_manpage.lyx: added
index b1a3fd3dfca2695691395c18842f4c5743515050..7c5aa5bdebd4bdec1e2ef5617a177e518a6650a9 100644 (file)
@@ -284,7 +284,7 @@ Menuset
 #      Item "TeX Style|X" "tex-mode"
        Separator
        Item "Change Environment Depth|v" "depth-increment"
-       Item "LaTeX Preamble...|L" "layout-preamble"
+       Item "Preamble...|r" "layout-preamble"
        Item "Start Appendix here|A" "appendix"
     End
 
index 5585e5ec15c9dea2d17ed5595ce4f35f2aaa8545..35706095476e93fda12b88574623f68891dde2c1 100644 (file)
@@ -9,7 +9,6 @@ src/converter.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
-src/ext_l10n.h
 src/figure_form.C
 src/figureForm.C
 src/FontLoader.C
index a8daf974c3af72400ed3390802029dbf7ff2ef6c..a85eaec9cff62d6717320b40b7df4e5e1441187c 100644 (file)
@@ -1,3 +1,36 @@
+2002-02-26  John Levon  <moz@compsoc.man.ac.uk>
+
+       * Makefile.am:
+       * lyxserver.C:
+       * os2_defines.h:
+       * os2_errortable.h:
+       * nt_defines.h: move .h into support/
+
+       * vms_defines.h: remove
+
+       * WorkArea.C: add space in debug output
+
+       * text2.C:
+       * paragraph.C:
+       * buffer.C: add WITH_WARNINGS
+
+       * vc-backend.h:
+       * vc-backend.C:
+       * bufferlist.C: s/retrive/retrieve/, add docs
+
+       * vspace.h:
+       * vspace.C:
+       * kbmap.h:
+       * lyxlength.h:
+       * lyxgluelength.h:
+       * length_common.h:
+       * chset.h:
+       * chset.C: add docs
+
+       * lyxgui.C: add ID to X error handler
+
+       * lyxtestclass.c: fix typo
+
 2002-02-26  Juergen Vigna  <jug@sad.it>
 
        * tabular_funcs.C (write_attribute): changed so that some default
index f1fe39f42592af66ad8eb1f3a7f24dddccf5d609..13818ac81e666ba3a1e1e547212d5d020a4032f8 100644 (file)
@@ -187,9 +187,6 @@ lyx_SOURCES = \
        main.C \
        minibuffer.C \
        minibuffer.h \
-       nt_defines.h \
-       os2_defines.h \
-       os2_errortable.h \
        paragraph.C \
        paragraph.h \
        paragraph_pimpl.C \
index 14094621af6f75845ebe125e32a43d5eb02c145a..52c05a24fd189b26bba4cbacec99d517f38482ef 100644 (file)
@@ -299,7 +299,9 @@ std::stack<ErtComp> ert_stack;
 ErtComp ert_comp;
 #endif
 
+#ifdef WITH_WARNINGS
 #warning And _why_ is this here? (Lgb)
+#endif
 int unknown_layouts;
 int unknown_tokens;
 
index 060e6269fca6bfee6e6a6a887b6a2efc59bfc684..86c632cee3cc5209f6cf172ecb6594d2a2394867 100644 (file)
@@ -542,7 +542,7 @@ Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
                                // How can we know _how_ to do the checkout?
                                // With the current VC support it has to be,
                                // a RCS file since CVS do not have special ,v files.
-                               RCS::retrive(s);
+                               RCS::retrieve(s);
                                return loadLyXFile(filename, tolastfiles);
                        }
                }
index 277f7db184d66fe78ccf6f34e66f84c8f9b17e37..c912b31149438eab3169440a994c5f9a9af46f54 100644 (file)
@@ -23,9 +23,10 @@ bool CharacterSet::loadFile(string const & fname)
 {
        map_.clear();
        name_.erase();
-       
-       if (fname.empty() || fname == "ascii") 
-               return true;    // ascii 7-bit
+       // ascii 7-bit
+       if (fname.empty() || fname == "ascii")
+               return true;
        
        // open definition file
        lyxerr[Debug::KBMAP]
index 90d9affad48156848b3a92da9195fa17f87d0373..a3691af1df5e1308193ad97a60cf4d27f35f69b8 100644 (file)
@@ -1,4 +1,10 @@
 // -*- C++ -*-
+/**
+ * \file chset.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ */
+
 #ifndef CHSET_H
 #define CHSET_H
 
 
 #include "LString.h"
 
-///
+/// a class for mapping char strings such as "\^{A}" to the integer value
 class CharacterSet {
 public:
-       ///
-       bool loadFile(string const &);
-       ///
+       /**
+        * initialise this charset from the given .cdef file
+        * param charset the charset to look for
+        *
+        * Finds a .cdef file corresponding to the named charset
+        * and parses it. This function is only intended to be
+        * called once.
+        */
+       bool loadFile(string const & charset);
+       /// return the name of the current charset
        string const & getName() const;
-       ///
+       /**
+        * Return the encoded charset value of the given string.
+        *
+        * The bool value is false if an encoding could not be found
+        * in this charset, and true otherwise.
+        */
        std::pair<bool, int> const encodeString(string const &) const;
 private:
-       ///
+       /// charset name
        string name_;
        ///
        typedef std::map<string, unsigned char> Cdef;
-       ///
+       /// mapping from string representation to encoded value
        Cdef map_;
 };
 #endif
index ff2756a20fddd8041faf94d2ba1b6e5582a82a44..ac150815c43638a6f40ede07e0a32dd4c0558b97 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-21  Herbert Voss  <voss@lyx.org>
+
+       * biblio.C: fix bug with commentlines in a bibentry
+
 2002-02-20  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * Makefile.am: simpler obj. file compile
index 658160f5813b49b1fcde7c6dd38e43d9f15b9d2b..3d8aa28979b1dccc213c52369b86ea7cad8cc007 100644 (file)
@@ -320,18 +320,29 @@ searchKeys(InfoMap const & theMap,
 string const parseBibTeX(string data, string const & findkey)
 {
        string keyvalue;
-       for (string::iterator it = data.begin(); it < data.end(); ++it) {
-               if ((*it) == '\n' || (*it) == '\t')
-                       (*it)= ' ';
+       // at first we delete all characters right of '%' and
+       // replace tabs through a space and remove leading spaces
+       string data_;
+       int Entries = 0;
+       string dummy = token(data,'\n', Entries);
+       while (!dummy.empty()) {
+               dummy = subst(dummy, '\t', ' ');        // no tabs
+               dummy = frontStrip(dummy);      // no leading spaces
+               if (dummy.find('%') != string::npos) {
+                   if (dummy.find('%') > 0)
+                       data_ += dummy.substr(0,data.find('%'));
+               }
+               else
+                   data_ += dummy;
+               dummy = token(data, '\n', ++Entries);
        }
-       data = frontStrip(data);
-       
+       data = data_;
        // now get only the important line of the bibtex entry.
        // all entries are devided by ',' except the last one.  
        data += ',';  // now we have same behaviour for all entries
                      // because the last one is "blah ... }"
-       int Entries = 0;                        
-       string dummy = token(data, ',', Entries);
+       Entries = 0;                    
+       dummy = token(data, ',', Entries);
        while (!contains(lowercase(dummy), findkey) && !dummy.empty())
                dummy = token(data, ',', ++Entries);
        if (dummy.empty())
index 9defce899285c0b4662b7a3f8fa9c6ebd307ed0a..78fe413384a73f1d7c33357f9bc94c156205a13f 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-24  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * forms/form_graphics.fd: Enlarge Restore button.
+       * FormGraphics.C: Set filter to bounding box input fields.
+
 2002-02-20  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * Makefile.am: simpler obj. file compiling
index 5cb9d4345bc83c84a319f86aee5f13bcf6e5c9ae..419d44052ac1c3b08ec3ae7e849401e2a7b1786f 100644 (file)
@@ -143,6 +143,10 @@ void FormGraphics::build()
        fl_set_input_return (bbox_->input_bb_x1, FL_RETURN_CHANGED);
        fl_set_input_return (bbox_->input_bb_y1, FL_RETURN_CHANGED);
 
+       fl_set_input_filter(bbox_->input_bb_x0,  fl_unsigned_float_filter);
+       fl_set_input_filter(bbox_->input_bb_y0,  fl_unsigned_float_filter);
+       fl_set_input_filter(bbox_->input_bb_x1,  fl_unsigned_float_filter);
+
        string const bb_units = "pt|cm|in";
        fl_addto_choice(bbox_->choice_bb_units, bb_units.c_str());
        bc().addReadOnly(bbox_->button_getBB);
index ca5222e954134b450cdd9f4fbbe8f030ffc4669b..dea86faf11441113e1cc628d6eebca96c7264542 100644 (file)
@@ -22,9 +22,9 @@ FD_form_graphics * FormGraphics::build_graphics()
   FL_OBJECT *obj;
   FD_form_graphics *fdui = new FD_form_graphics;
 
-  fdui->form = fl_bgn_form(FL_NO_BOX, 510, 360);
+  fdui->form = fl_bgn_form(FL_NO_BOX, 510, 345);
   fdui->form->u_vdata = this;
-  obj = fl_add_box(FL_FLAT_BOX, 0, 0, 510, 360, "");
+  obj = fl_add_box(FL_FLAT_BOX, 0, 0, 510, 345, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
   fdui->tabFolder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 500, 270, _("Tabbed folder"));
     fl_set_object_boxtype(obj, FL_FRAME_BOX);
@@ -32,7 +32,7 @@ FD_form_graphics * FormGraphics::build_graphics()
     fl_set_object_resize(obj, FL_RESIZE_ALL);
   {
     char const * const dummy = N_("Restore|#R");
-    fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 5, 310, 80, 30, idex(_(dummy)));
+    fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 5, 310, 100, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
index e32cc62a42c87f5e4dac8a802a84beab405ac243..7d0645dba52e53adba569916bb9bcfeb981faadb 100644 (file)
@@ -10,13 +10,13 @@ SnapGrid: 5
 =============== FORM ===============
 Name: form_graphics
 Width: 510
-Height: 360
+Height: 345
 Number of Objects: 7
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 510 360
+box: 0 0 510 345
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -52,7 +52,7 @@ argument:
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 310 80 30
+box: 5 310 100 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
index 7852e586c5e4580c6c8755aff55d88bf6f036fe0..e7f35d723690a5991d2df1f90e0eed888f039090 100644 (file)
@@ -1,10 +1,12 @@
 // -*- C++ -*-
-/* ======================================================================= *\
-   File   : kbmap.h, kbmap.h,v 1.3 1996/12/10 04:35:57 larsbj Exp
-   Author : chb, 30.Oct.1995
-   Docu   : see kbmap.C
-   Purpose: class definitions for XKeyEvent keymap handling
-   \* ==================================================================== */
+/**
+ * \file kbmap.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Lars Gullik Bjønnes <larsbj@lyx.org>
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
 
 #ifndef KBMAP_H
 #define KBMAP_H
@@ -93,4 +95,4 @@ private:
        Table table;
 };
 
-#endif
+#endif // KBMAP_H
index 7991f2c573d0a4b543bfd74dc0e8014d113af349..71d72ea9882c36eb66f90da7762b6e1d2d88cd37 100644 (file)
@@ -1,16 +1,22 @@
 // -*- C++ -*-
 
-#ifndef LENGHT_COMMON_H
-#define LENGHT_COMMON_H
+#ifndef LENGTH_COMMON_H
+#define LENGTH_COMMON_H
 
 #include "LString.h"
 #include "lyxlength.h"
 
+/// the number of units possible
 extern int const num_units;
 
-// I am not sure if "mu" should be possible to select (Lgb)
+/**
+ * array of unit names
+ *
+ * FIXME: I am not sure if "mu" should be possible to select (Lgb)
+ */
 extern char const *unit_name[];
 
+/// return the unit given a string representation such as "cm"
 LyXLength::UNIT unitFromString(string const & data);
 
-#endif
+#endif // LENGTH_COMMON_H
index 552819fdd7b78080967c0c427fc7d5e0e03a4737..21312bad5d878105fabfdc674cdd84bab1d82b04 100644 (file)
@@ -88,7 +88,7 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev)
        // Get the reason for the crash.
        char etxt[513];
        XGetErrorText(display, xeev->error_code, etxt, 512);
-       lyxerr << etxt << endl;
+       lyxerr << etxt << " id: " << xeev->resourceid << endl;
        // By doing an abort we get a nice backtrace. (hopefully)
        lyx::abort();
        return 0; // Solaris CC wants us to return something
index e07b0fa664d97d881fd09a4618cba9776b25c657..e392093cf0c094d1ffa8324898af117729adf16b 100644 (file)
@@ -1,13 +1,12 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxgluelength.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
  *
- *           LyX, The Document Processor
- *     
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
+
 
 #ifndef LYX_GLUE_LENGTH_H
 #define LYX_GLUE_LENGTH_H
@@ -78,4 +77,4 @@ bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
 ///
 bool isValidGlueLength(string const & data, LyXGlueLength * result);
 
-#endif
+#endif // LYXGLUELENGTH_H
index a4d71aef2cffd06de47d6b3004e6900ae03caa43..6c79982f2360fa3aa36cba9693a84833a29b2332 100644 (file)
@@ -1,13 +1,12 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file lyxlength.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
  *
- *           LyX, The Document Processor
- *     
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
+
 
 #ifndef LYX_LENGTH_H
 #define LYX_LENGTH_H
 
 #include "LString.h"
 
-//
-///  LyXLength Class
-//
+/**
+ * LyXLength - Represents latex length measurement
+ */
 class LyXLength {
 public:
        /// length units
        enum UNIT {
-               /// Scaled point (65536sp = 1pt) TeX's smallest unit.
-               SP,
-               /// Point = 1/72.27in = 0.351mm
-               PT,
-               /// Big point (72bp = 1in), also PostScript point
-               BP,
-               /// Didot point = 1/72 of a French inch, = 0.376mm
-               DD,
-               /// Millimeter = 2.845pt
-               MM,
-               /// Pica = 12pt = 4.218mm
-               PC,
-               /// Cicero = 12dd = 4.531mm
-               CC,
-               /// Centimeter = 10mm = 2.371pc
-               CM,
-               /// Inch = 25.4mm = 72.27pt = 6.022pc
-               IN,
-               /// Height of a small "x" for the current font.
-               EX,
-               /// Width of capital "M" in current font.
-               EM,
-               /// Math unit (18mu = 1em) for positioning in math mode
-               MU,
-               /// Percent of columnwidth both "%" or "%c"
-               PW,
-               ///
-               PE,
-               /// Percent of pagewidth
-               PP,
-               /// Percent of linewidth
-               PL,
-               /// no unit
-               UNIT_NONE
+               SP, ///< Scaled point (65536sp = 1pt) TeX's smallest unit.
+               PT, ///< Point = 1/72.27in = 0.351mm
+               BP, ///< Big point (72bp = 1in), also PostScript point
+               DD, ///< Didot point = 1/72 of a French inch, = 0.376mm
+               MM, ///< Millimeter = 2.845pt
+               PC, ///< Pica = 12pt = 4.218mm
+               CC, ///< Cicero = 12dd = 4.531mm
+               CM, ///< Centimeter = 10mm = 2.371pc
+               IN, ///< Inch = 25.4mm = 72.27pt = 6.022pc
+               EX, ///< Height of a small "x" for the current font.
+               EM, ///< Width of capital "M" in current font.
+               MU, ///< Math unit (18mu = 1em) for positioning in math mode
+               PW, ///< Percent of columnwidth both "%" or "%c"
+               PE, ///< FIXME
+               PP, ///< Percent of pagewidth
+               PL, ///< Percent of linewidth
+               UNIT_NONE ///< no unit
        };
 
        ///
@@ -79,11 +61,11 @@ public:
        void unit(LyXLength::UNIT unit);
        ///
        bool zero() const;
-       /// conversion
+       /// return string representation
        string const asString() const;
-       ///
+       /// return string representation for LaTeX
        string const asLatexString() const;
-       ///
+       /// return the on-screen size of this length
        int inPixels(int default_width, int default_height) const;
 
        /** If "data" is valid, the length represented by it is
@@ -103,7 +85,7 @@ bool operator==(LyXLength const & l1, LyXLength const & l2);
 bool operator!=(LyXLength const & l1, LyXLength const & l2);
 ///
 bool isValidLength(string const & data, LyXLength * result);
-///
+/// return the name of the given unit number
 char const * stringFromUnit(int unit);
 
-#endif
+#endif // LYXLENGTH_H
index 69fa710eea49ee844e5adbe74db90e809784ce4d..64d0c156221b9686a1629b37552e5ae789ce85ff 100644 (file)
@@ -62,7 +62,7 @@
 #define INCL_DOSNMPIPES
 #define INCL_DOSERRORS
 #include <os2.h>
-#include "os2_errortable.h"
+#include "support/os2_errortable.h"
 #endif
 
 using std::endl;
index 110f2c7d8944ba090f3e82464d30d80ec33594c1..e449feaa662fef49c02b3fff8f2c8674a2e37697 100644 (file)
@@ -57,7 +57,7 @@ bool LyXTextClass::do_readStyle(LyXLex & lexrc, LyXLayout & lay)
 {
        lyxerr[Debug::TCLASS] << "Reading style " << lay.name() << endl;
        if (!lay.Read(lexrc, *this)) {
-               // Reslove fonts
+               // Resolve fonts
                lay.resfont = lay.font;
 #ifndef INHERIT_LANGUAGE
                lay.resfont.realize(defaultfont());
diff --git a/src/nt_defines.h b/src/nt_defines.h
deleted file mode 100644 (file)
index 4a060ab..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- C++ -*- */
-/* This file is part of
- * ====================================================== 
- * 
- *           LyX, the High Level Word Processor
- *        
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1998 The LyX Team.
- *
- * ====================================================== 
- A few prototypes and definitions needed for Windows NT */
-
-/* Hacks to get LyX running under Win-NT w. Cygnus b19 (steven@cs.uu.nl) */
-
-#ifndef NT_DEFINES_H
-#define NT_DEFINES_H
-
-
-#endif /* NT_DEFINES_H */
diff --git a/src/os2_defines.h b/src/os2_defines.h
deleted file mode 100644 (file)
index aa2b0c7..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- C++ -*- */
-/* This file is part of
-* ====================================================== 
-* 
-*           LyX, The Document Processor
-*        
-*           Copyright 1995 Matthias Ettrich
-*           Copyright 1995-2001 The LyX Team.
-*
-* ====================================================== 
- A few prototypes and definitions needed for OS/2 */
-
-#ifndef OS2_DEFINES_H
-#define OS2_DEFINES_H
-
-#if defined (__cplusplus)
-#include <cctype>
-#include <cstdlib>
-
-extern "C"
-inline int readlink(const char *, char *, size_t) {return -1;}
-
-#else
-#include <ctype.h>
-#include <stdlib.h>
-#define readlink(s, t, l) (-1)
-#endif
-#include <process.h>
-#include <unistd.h>
-#include <X11/Xlocale.h>
-/* #include <malloc.h> */
-#define lstat stat
-#define S_ISLNK(x) false
-#define S_ISBLK(x) false
-/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
-#define chdir _chdir2
-#define strcasecmp stricmp
-#if defined (__cplusplus)
-extern "C" {
-#endif
-const char* __XOS2RedirRoot(const char* pathname);
-#if defined (__cplusplus)
-}
-#endif
-#undef LYX_DIR
-#define LYX_DIR __XOS2RedirRoot("/XFree86/lib/X11/lyx")
-#undef LOCALEDIR
-#define LOCALEDIR __XOS2RedirRoot("/XFree86/lib/X11/locale")
-#undef TOP_SRCDIR
-#define TOP_SRCDIR ".."
-/* I have the slightest idea what I am doing here... */
-#define bindtextdomain bindtextdomain__
-#define textdomain textdomain__
-
-#endif /* _OS2_DEFINES_H */
diff --git a/src/os2_errortable.h b/src/os2_errortable.h
deleted file mode 100644 (file)
index b2b4c3e..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- C++ -*- */
-/* This file is part of
-* ======================================================
-* 
-*           LyX, The Document Processor
-*        
-*           Copyright 1995 Matthias Ettrich
-*           Copyright 1995-2001 The LyX Team.
-*
-* ======================================================
- A table for translating OS/2 API return code into errno.
- Copied from emx library source.                        */
-
-#ifndef OS2_ERRORTABLE_H
-#define OS2_ERRORTABLE_H
-//#ifndef _ERRNO_H
-#include <cerrno>
-//#endif
-
-namespace {
-
-unsigned char const errno_tab[] =
-{
-  EINVAL, EINVAL, ENOENT, ENOENT, EMFILE,  /* 0..4 */
-  EACCES, EBADF,  EIO,    ENOMEM, EIO,     /* 5..9 */
-  EINVAL, ENOEXEC, EINVAL, EINVAL, EINVAL,  /* 10..14 */
-  ENOENT, EBUSY,  EXDEV,  ENOENT, EROFS,   /* 15..19 */
-  EIO,    EIO,    EIO,    EIO,    EIO,     /* 20..24 */
-  EIO,    EIO,    EIO,    ENOSPC, EIO,     /* 25..29 */
-  EIO,    EIO,    EACCES, EACCES, EIO,     /* 30..34 */
-  EIO,    EIO,    EIO,    EIO,    ENOSPC,  /* 35..39 */
-  EIO,    EIO,    EIO,    EIO,    EIO,     /* 40..44 */
-  EIO,    EIO,    EIO,    EIO,    EIO,     /* 45..49 */
-  EIO,    EIO,    EIO,    EIO,    EBUSY,   /* 50..54 */
-  EIO,    EIO,    EIO,    EIO,    EIO,     /* 55..59 */
-  EIO,    ENOSPC, ENOSPC, EIO,    EIO,     /* 60..64 */
-  EACCES, EIO,    EIO,    EIO,    EIO,     /* 65..69 */
-  EIO,    EIO,    EIO,    EROFS,  EIO,     /* 70..74 */
-  EIO,    EIO,    EIO,    EIO,    EIO,     /* 75..79 */
-  EEXIST, EIO,    ENOENT, EIO,    EIO,     /* 80..84 */
-  EIO,    EIO,    EINVAL, EIO,    EAGAIN,  /* 85..89 */
-  EIO,    EIO,    EIO,    EIO,    EIO,     /* 90..94 */
-  EINTR,  EIO,    EIO,    EIO,    EACCES,  /* 95..99 */
-  ENOMEM, EINVAL, EINVAL, ENOMEM, EINVAL,  /* 100..104 */
-  EINVAL, ENOMEM, EIO,    EACCES, EPIPE,   /* 105..109 */
-  ENOENT, E2BIG,  ENOSPC, ENOMEM, EINVAL,  /* 110..114 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 115..119 */
-  EINVAL, EINVAL, EINVAL, ENOENT, EINVAL,  /* 120..124 */
-  ENOENT, ENOENT, ENOENT, ECHILD, ECHILD,  /* 125..129 */
-  EACCES, EINVAL, ESPIPE, EINVAL, EINVAL,  /* 130..134 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 135..139 */
-  EINVAL, EINVAL, EBUSY,  EINVAL, EINVAL,  /* 140..144 */
-  EINVAL, EINVAL, EINVAL, EBUSY,  EINVAL,  /* 145..149 */
-  EINVAL, EINVAL, ENOMEM, EINVAL, EINVAL,  /* 150..154 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 155..159 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN,  /* 160..164 */
-  EINVAL, EINVAL, EACCES, EINVAL, EINVAL,  /* 165..169 */
-  EBUSY,  EINVAL, EINVAL, EINVAL, EINVAL,  /* 170..174 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 175..179 */
-  EINVAL, EINVAL, EINVAL, EINVAL, ECHILD,  /* 180..184 */
-  EINVAL, EINVAL, ENOENT, EINVAL, EINVAL,  /* 185..189 */
-  ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 190..194 */
-  ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 195..199 */
-  ENOEXEC, ENOEXEC, ENOEXEC, ENOENT, EINVAL,  /* 200..204 */
-  EINVAL, ENAMETOOLONG, EINVAL, EINVAL, EINVAL,  /* 205..209 */
-  EINVAL, EINVAL, EACCES, ENOEXEC, ENOEXEC, /* 210..214 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 215..219 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 220..224 */
-  EINVAL, EINVAL, EINVAL, ECHILD, EINVAL,  /* 225..229 */
-  EINVAL, EBUSY,  EAGAIN, ENOTCONN, EINVAL, /* 230..234 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 235..239 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 240..244 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 245..249 */
-  EACCES, EACCES, EINVAL, ENOENT, EINVAL,  /* 250..254 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 255..259 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 260..264 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 265..269 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 270..274 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 275..279 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EEXIST,  /* 280..284 */
-  EEXIST, EINVAL, EINVAL, EINVAL, EINVAL,  /* 285..289 */
-  ENOMEM, EMFILE, EINVAL, EINVAL, EINVAL,  /* 290..294 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 295..299 */
-  EINVAL, EBUSY,  EINVAL, ESRCH,  EINVAL,  /* 300..304 */
-  ESRCH,  EINVAL, EINVAL, EINVAL, ESRCH,   /* 305..309 */
-  EINVAL, ENOMEM, EINVAL, EINVAL, EINVAL,  /* 310..314 */
-  EINVAL, E2BIG,  ENOENT, EIO,    EIO,     /* 315..319 */
-  EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN,  /* 320..324 */
-  EINVAL, EINVAL, EINVAL, EIO,    ENOENT,  /* 325..329 */
-  EACCES, EACCES, EACCES, ENOENT, ENOMEM   /* 330..334 */
-};
-
-} // namespace anon
-
-
-inline
-int TranslateOS2Error(unsigned long rc)
-{
-       if (rc >= sizeof (errno_tab))
-               return EINVAL;
-       else
-               return errno_tab[rc];
-}
-
-#endif /* _OS2_ERRORTABLE_H */
index fd27bfb8460ec1e22c41b28a554b2c3b36f053fd..3f29163e4a8802b4dc08b9db33762b8dc4469ea5 100644 (file)
@@ -1615,13 +1615,13 @@ bool Paragraph::simpleTeXOnePar(Buffer const * buf,
                // Fully instantiated font
                LyXFont font = getFont(bparams, i);
 
-               LyXFont const last_font = running_font;
+               LyXFont const last_font = running_font;
 
                // Spaces at end of font change are simulated to be
                // outside font change, i.e. we write "\textXX{text} "
                // rather than "\textXX{text }". (Asger)
                if (open_font && c == ' ' && i <= size() - 2) {
-                       LyXFont const next_font = getFont(bparams, i + 1);
+                       LyXFont const next_font = getFont(bparams, i + 1);
                        if (next_font != running_font
                            && next_font != font) {
                                font = next_font;
@@ -1943,7 +1943,9 @@ Paragraph::getParLanguage(BufferParams const & bparams) const
                return getFirstFontSettings().language();
 #else
                Language const * lang = getFirstFontSettings().language();
+#ifdef WITH_WARNINGS
 #warning We should make this somewhat better, any ideas? (Jug)
+#endif
                if (lang == inherit_language || lang == ignore_language)
                        lang = bparams.language;
                return lang;
index c12d709ad5028aade2febcf92769ae241cec8916..1e72a15a0d85851f89eaa8ae78d13a014e55d0b9 100644 (file)
@@ -1,3 +1,10 @@
+2002-02-26  John Levon  <moz@compsoc.man.ac.uk>
+
+       * Makefile.am:
+       * os2_defines.h:
+       * os2_errortable.h:
+       * nt_defines.h: moved from src/
 2002-02-18  Herbert Voss  <voss@perce.de>
 
        * filetools.C: (getExtFromContents) return the fileextension
index 7d5070b0961c504028ee3a4c3a9a3e63c89ebc87..4670add509981d2a6a48ea3b8a0dc477ec51803e 100644 (file)
@@ -54,6 +54,9 @@ libsupport_la_SOURCES = \
        lyxmanip.h \
        $(LYXSTRING) lyxsum.C \
        mkdir.C \
+       nt_defines.h \
+       os2_defines.h \
+       os2_errortable.h \
        path.C \
        path.h \
        putenv.C \
diff --git a/src/support/nt_defines.h b/src/support/nt_defines.h
new file mode 100644 (file)
index 0000000..4a060ab
--- /dev/null
@@ -0,0 +1,19 @@
+/* -*- C++ -*- */
+/* This file is part of
+ * ====================================================== 
+ * 
+ *           LyX, the High Level Word Processor
+ *        
+ *           Copyright 1995 Matthias Ettrich
+ *           Copyright 1995-1998 The LyX Team.
+ *
+ * ====================================================== 
+ A few prototypes and definitions needed for Windows NT */
+
+/* Hacks to get LyX running under Win-NT w. Cygnus b19 (steven@cs.uu.nl) */
+
+#ifndef NT_DEFINES_H
+#define NT_DEFINES_H
+
+
+#endif /* NT_DEFINES_H */
diff --git a/src/support/os2_defines.h b/src/support/os2_defines.h
new file mode 100644 (file)
index 0000000..aa2b0c7
--- /dev/null
@@ -0,0 +1,55 @@
+/* -*- C++ -*- */
+/* This file is part of
+* ====================================================== 
+* 
+*           LyX, The Document Processor
+*        
+*           Copyright 1995 Matthias Ettrich
+*           Copyright 1995-2001 The LyX Team.
+*
+* ====================================================== 
+ A few prototypes and definitions needed for OS/2 */
+
+#ifndef OS2_DEFINES_H
+#define OS2_DEFINES_H
+
+#if defined (__cplusplus)
+#include <cctype>
+#include <cstdlib>
+
+extern "C"
+inline int readlink(const char *, char *, size_t) {return -1;}
+
+#else
+#include <ctype.h>
+#include <stdlib.h>
+#define readlink(s, t, l) (-1)
+#endif
+#include <process.h>
+#include <unistd.h>
+#include <X11/Xlocale.h>
+/* #include <malloc.h> */
+#define lstat stat
+#define S_ISLNK(x) false
+#define S_ISBLK(x) false
+/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
+#define chdir _chdir2
+#define strcasecmp stricmp
+#if defined (__cplusplus)
+extern "C" {
+#endif
+const char* __XOS2RedirRoot(const char* pathname);
+#if defined (__cplusplus)
+}
+#endif
+#undef LYX_DIR
+#define LYX_DIR __XOS2RedirRoot("/XFree86/lib/X11/lyx")
+#undef LOCALEDIR
+#define LOCALEDIR __XOS2RedirRoot("/XFree86/lib/X11/locale")
+#undef TOP_SRCDIR
+#define TOP_SRCDIR ".."
+/* I have the slightest idea what I am doing here... */
+#define bindtextdomain bindtextdomain__
+#define textdomain textdomain__
+
+#endif /* _OS2_DEFINES_H */
diff --git a/src/support/os2_errortable.h b/src/support/os2_errortable.h
new file mode 100644 (file)
index 0000000..b2b4c3e
--- /dev/null
@@ -0,0 +1,105 @@
+/* -*- C++ -*- */
+/* This file is part of
+* ======================================================
+* 
+*           LyX, The Document Processor
+*        
+*           Copyright 1995 Matthias Ettrich
+*           Copyright 1995-2001 The LyX Team.
+*
+* ======================================================
+ A table for translating OS/2 API return code into errno.
+ Copied from emx library source.                        */
+
+#ifndef OS2_ERRORTABLE_H
+#define OS2_ERRORTABLE_H
+//#ifndef _ERRNO_H
+#include <cerrno>
+//#endif
+
+namespace {
+
+unsigned char const errno_tab[] =
+{
+  EINVAL, EINVAL, ENOENT, ENOENT, EMFILE,  /* 0..4 */
+  EACCES, EBADF,  EIO,    ENOMEM, EIO,     /* 5..9 */
+  EINVAL, ENOEXEC, EINVAL, EINVAL, EINVAL,  /* 10..14 */
+  ENOENT, EBUSY,  EXDEV,  ENOENT, EROFS,   /* 15..19 */
+  EIO,    EIO,    EIO,    EIO,    EIO,     /* 20..24 */
+  EIO,    EIO,    EIO,    ENOSPC, EIO,     /* 25..29 */
+  EIO,    EIO,    EACCES, EACCES, EIO,     /* 30..34 */
+  EIO,    EIO,    EIO,    EIO,    ENOSPC,  /* 35..39 */
+  EIO,    EIO,    EIO,    EIO,    EIO,     /* 40..44 */
+  EIO,    EIO,    EIO,    EIO,    EIO,     /* 45..49 */
+  EIO,    EIO,    EIO,    EIO,    EBUSY,   /* 50..54 */
+  EIO,    EIO,    EIO,    EIO,    EIO,     /* 55..59 */
+  EIO,    ENOSPC, ENOSPC, EIO,    EIO,     /* 60..64 */
+  EACCES, EIO,    EIO,    EIO,    EIO,     /* 65..69 */
+  EIO,    EIO,    EIO,    EROFS,  EIO,     /* 70..74 */
+  EIO,    EIO,    EIO,    EIO,    EIO,     /* 75..79 */
+  EEXIST, EIO,    ENOENT, EIO,    EIO,     /* 80..84 */
+  EIO,    EIO,    EINVAL, EIO,    EAGAIN,  /* 85..89 */
+  EIO,    EIO,    EIO,    EIO,    EIO,     /* 90..94 */
+  EINTR,  EIO,    EIO,    EIO,    EACCES,  /* 95..99 */
+  ENOMEM, EINVAL, EINVAL, ENOMEM, EINVAL,  /* 100..104 */
+  EINVAL, ENOMEM, EIO,    EACCES, EPIPE,   /* 105..109 */
+  ENOENT, E2BIG,  ENOSPC, ENOMEM, EINVAL,  /* 110..114 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 115..119 */
+  EINVAL, EINVAL, EINVAL, ENOENT, EINVAL,  /* 120..124 */
+  ENOENT, ENOENT, ENOENT, ECHILD, ECHILD,  /* 125..129 */
+  EACCES, EINVAL, ESPIPE, EINVAL, EINVAL,  /* 130..134 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 135..139 */
+  EINVAL, EINVAL, EBUSY,  EINVAL, EINVAL,  /* 140..144 */
+  EINVAL, EINVAL, EINVAL, EBUSY,  EINVAL,  /* 145..149 */
+  EINVAL, EINVAL, ENOMEM, EINVAL, EINVAL,  /* 150..154 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 155..159 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN,  /* 160..164 */
+  EINVAL, EINVAL, EACCES, EINVAL, EINVAL,  /* 165..169 */
+  EBUSY,  EINVAL, EINVAL, EINVAL, EINVAL,  /* 170..174 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 175..179 */
+  EINVAL, EINVAL, EINVAL, EINVAL, ECHILD,  /* 180..184 */
+  EINVAL, EINVAL, ENOENT, EINVAL, EINVAL,  /* 185..189 */
+  ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 190..194 */
+  ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 195..199 */
+  ENOEXEC, ENOEXEC, ENOEXEC, ENOENT, EINVAL,  /* 200..204 */
+  EINVAL, ENAMETOOLONG, EINVAL, EINVAL, EINVAL,  /* 205..209 */
+  EINVAL, EINVAL, EACCES, ENOEXEC, ENOEXEC, /* 210..214 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 215..219 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 220..224 */
+  EINVAL, EINVAL, EINVAL, ECHILD, EINVAL,  /* 225..229 */
+  EINVAL, EBUSY,  EAGAIN, ENOTCONN, EINVAL, /* 230..234 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 235..239 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 240..244 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 245..249 */
+  EACCES, EACCES, EINVAL, ENOENT, EINVAL,  /* 250..254 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 255..259 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 260..264 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 265..269 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 270..274 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 275..279 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EEXIST,  /* 280..284 */
+  EEXIST, EINVAL, EINVAL, EINVAL, EINVAL,  /* 285..289 */
+  ENOMEM, EMFILE, EINVAL, EINVAL, EINVAL,  /* 290..294 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EINVAL,  /* 295..299 */
+  EINVAL, EBUSY,  EINVAL, ESRCH,  EINVAL,  /* 300..304 */
+  ESRCH,  EINVAL, EINVAL, EINVAL, ESRCH,   /* 305..309 */
+  EINVAL, ENOMEM, EINVAL, EINVAL, EINVAL,  /* 310..314 */
+  EINVAL, E2BIG,  ENOENT, EIO,    EIO,     /* 315..319 */
+  EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN,  /* 320..324 */
+  EINVAL, EINVAL, EINVAL, EIO,    ENOENT,  /* 325..329 */
+  EACCES, EACCES, EACCES, ENOENT, ENOMEM   /* 330..334 */
+};
+
+} // namespace anon
+
+
+inline
+int TranslateOS2Error(unsigned long rc)
+{
+       if (rc >= sizeof (errno_tab))
+               return EINVAL;
+       else
+               return errno_tab[rc];
+}
+
+#endif /* _OS2_ERRORTABLE_H */
index ca8502196eb86377c4ae270cb2f22df58f09a21f..f83a41fbdec6ebd3c7149a43aa612e8193dfeeb3 100644 (file)
@@ -2207,10 +2207,12 @@ void LyXText::setCursorIntern(BufferView * bview, Paragraph * par,
                if (it != inset_owner) {
                        lyxerr << "InsetText   is " << it << endl;
                        lyxerr << "inset_owner is " << inset_owner << endl;
+#ifdef WITH_WARNINGS
 #warning I believe this code is wrong. (Lgb)
 #warning Jürgen, have a look at this. (Lgb)
 #warning Hmmm, I guess you are right but we
 #warning should verify when this is needed
+#endif
                        // Jürgen, would you like to have a look?
                        // I guess we need to move the outer cursor
                        // and open and lock the inset (bla bla bla)
index f2c02285089528ef1d91a2cbe33de79c79a0ff01..289bf32fd3b8cbad3b4a8dba203fd5d6a2408ba9 100644 (file)
@@ -42,5 +42,3 @@ Undo::~Undo()
                delete tmppar;
        }
 }
-
-
index 23d36b25b61d83004d58a9d101507d7a9a7edeef..33a59362cdfbf822f9be69165d476dce404b8af2 100644 (file)
@@ -70,9 +70,9 @@ string const RCS::find_file(string const & file)
 }
 
 
-void RCS::retrive(string const & file)
+void RCS::retrieve(string const & file)
 {
-       lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrive.\n\t" << file << endl;
+       lyxerr[Debug::LYXVC] << "LyXVC::RCS: retrieve.\n\t" << file << endl;
        VCS::doVCCommand("co -q -r \""
                         + file + "\"",
                         string());
index 065276b44bcd1fc88021d9cd38b7a3bc94abbd05..45508ca0c25c160dd8b7b08a03f12117c99810fc 100644 (file)
@@ -1,4 +1,12 @@
 // -*- C++ -*-
+/**
+ * \file vc-backend.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Lars Gullik Bjønnes
+ */
+
 
 #ifndef VC_BACKEND_H
 #define VC_BACKEND_H
 
 class Buffer;
 
-///
+/// A simple version control system interface
 class VCS {
 public:
-       ///
+       /// the status of the managed file
        enum VCStatus {
-               ///
                UNLOCKED,
-               ///
                LOCKED
        };
-       ///
+
        virtual ~VCS() {}
-       ///
-       virtual void scanMaster() = 0;
-       ///
+
+       /// register a file for version control
        virtual void registrer(string const & msg) = 0;
-       ///
+       /// check in the current revision
        virtual void checkIn(string const & msg) = 0;
-       ///
+       /// check out for editing
        virtual void checkOut() = 0;
-       ///
+       /// revert current edits
        virtual void revert() = 0;
-       ///
+       /// FIXME
        virtual void undoLast() = 0;
-       ///
+       /**
+        * getLog - read the revision log into the given file
+        * @param fname file name to read into
+        */ 
        virtual void getLog(string const &) = 0;
-       ///
+       /// return the current version description
        virtual string const versionString() const = 0;
-       ///
+       /// return the current version
        string const & version() const {
                return version_; 
        }
-       ///
+       /// return the user who has locked the file
        string const & locker() const { return locker_; }
-       ///
+       /// set the owning buffer
        void owner(Buffer * b) { owner_ = b; }
-       ///
+       /// return the owning buffer
        Buffer * owner() const { return owner_; }
-       ///
+       /// return the lock status of this file
        VCStatus status() const { return vcstatus; }
 protected:
-       ///
-       static int doVCCommand(string const &, string const &);
+       /// parse information from the version file
+       virtual void scanMaster() = 0;
+       /**
+        * doVCCommand - call out to the version control utility
+        * @param cmd the command to execute
+        * @param path the path from which to execute
+        * @return exit status
+        */
+       static int doVCCommand(string const & cmd, string const & path);
 
-       /** The master VC file. For RCS this is *,v or RCS/ *,v. master should
-           have full path.
-       */
+       /** 
+        * The master VC file. For RCS this is *,v or RCS/ *,v. master should
+        * have full path.
+        */
        string master_;
        
        /// The status of the VC controlled file.
        VCStatus vcstatus;
        
-       /** The version of the VC file. I am not sure if this can be a
-           string of if it must be a
-           float/int. */
+       /** 
+        * The version of the VC file. I am not sure if this can be a
+        * string or if it must be a float/int. 
+        */
        string version_;
        
        /// The user currently keeping the lock on the VC file.
@@ -78,31 +96,33 @@ protected:
 ///
 class RCS : public VCS {
 public:
-       ///
+
        explicit
        RCS(string const & m);
-       ///
+
+       /// return the revision file for the given file, if found
        static string const find_file(string const & file);
-       ///
-       static void retrive(string const & file);
-       ///
-       virtual void scanMaster();
-       ///
+
+       static void retrieve(string const & file);
+
        virtual void registrer(string const & msg);
-       ///
+
        virtual void checkIn(string const & msg);
-       ///
+
        virtual void checkOut();
-       ///
+
        virtual void revert();
-       ///
+
        virtual void undoLast();
-       ///
+
        virtual void getLog(string const &);
-       ///
+
        virtual string const versionString() const {
                return "RCS: " + version_;
        }
+
+protected:
+       virtual void scanMaster();
 };
 
 
@@ -112,27 +132,30 @@ public:
        ///
        explicit
        CVS(string const & m, string const & f);
-       ///
+
+       /// return the revision file for the given file, if found
        static string const find_file(string const & file);
-       ///
-       virtual void scanMaster();
-       ///
+
        virtual void registrer(string const & msg);
-       ///
+
        virtual void checkIn(string const & msg);
-       ///
+
        virtual void checkOut();
-       ///
+
        virtual void revert();
-       ///
+
        virtual void undoLast();
-       ///
+
        virtual void getLog(string const &);
-       ///
+
        virtual string const versionString() const {
                return "CVS: " + version_;
        }
+
+protected:
+       virtual void scanMaster();
 private:
        string file_;
 };
-#endif
+#endif // VCBACKEND_H
diff --git a/src/vms_defines.h b/src/vms_defines.h
deleted file mode 100644 (file)
index 1460908..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- C++ -*- */
-/* This file is part of
-* ======================================================
-* 
-*           LyX, the High Level Word Processor
-*        
-*           Copyright 1995 Matthias Ettrich
-*           Copyright 1995-2001 The LyX Team.
-*
-* ======================================================
- A few prototypes and definitions needed for VMS / OpenVMS */
-
-#ifndef VMS_DEFINES_H
-#define VMS_DEFINES_H
-
-/* Currently empty. */
-
-#endif /* _VMS_DEFINES_H */
index c93722d99e19f6b16a92b52e4ef62654ecded2b6..50b28231bc32e8cca366b76fb7f516f10b95451f 100644 (file)
@@ -1,12 +1,10 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file vspace.C
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
  *
- *           LyX, The Document Processor
- *     
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
 
 #include <config.h>
 
@@ -21,6 +19,7 @@
 #include "lyxrc.h"
 #include "lyxtext.h"
 #include "BufferView.h"
+#include "support/LAssert.h"
 
 #include "support/lstrings.h"
 
 
 namespace {
 
-double           number[4] = { 0, 0, 0, 0 };
-LyXLength::UNIT unit[4]   = { LyXLength::UNIT_NONE,
-                             LyXLength::UNIT_NONE,
-                             LyXLength::UNIT_NONE,
-                             LyXLength::UNIT_NONE };
+/// used to return numeric values in parsing vspace
+double number[4] = { 0, 0, 0, 0 };
+/// used to return unit types in parsing vspace
+LyXLength::UNIT unit[4] = { LyXLength::UNIT_NONE,
+                           LyXLength::UNIT_NONE,
+                           LyXLength::UNIT_NONE,
+                           LyXLength::UNIT_NONE };
 
+/// the current position in the number array
 int number_index;
+/// the current position in the unit array
 int unit_index;
 
+/// skip n characters of input
 inline
 void lyx_advance(string & data, string::size_type n)
 {
        data.erase(0, n);
 }
 
-
+/// return true when the input is at the end
 inline
 bool isEndOfData(string const & data)
 {
        return frontStrip(data).empty();
 }
 
-
+/**
+ * nextToken -  return the next token in the input
+ * @param data input string
+ * @return a char representing the type of token returned
+ *
+ * The possible return values are : 
+ *     +       stretch indicator for glue length
+ *     -       shrink indicator for glue length
+ *     n       a numeric value (stored in number array)
+ *     u       a unit type (stored in unit array)
+ *     E       parse error
+ */
 char nextToken(string & data)
 {
        data = frontStrip(data);
@@ -125,6 +140,7 @@ char nextToken(string & data)
 }
 
 
+/// latex representation of a vspace
 struct LaTeXLength {
        char const * pattern;
        int  plus_val_index;
@@ -134,6 +150,7 @@ struct LaTeXLength {
 };
 
 
+/// the possible formats for a vspace string
 LaTeXLength table[] = {
        { "nu",       0, 0, 0, 0 },
        { "nu+nu",    2, 0, 2, 0 },
@@ -242,10 +259,10 @@ bool isValidGlueLength(string const & data, LyXGlueLength * result)
 
 bool isValidLength(string const & data, LyXLength * result)
 {
-       /// This is a trimmed down version of isValidGlueLength.
-       /// The parser may seem overkill for lengths without
-       /// glue, but since we already have it, using it is
-       /// easier than writing something from scratch.
+       // This is a trimmed down version of isValidGlueLength.
+       // The parser may seem overkill for lengths without
+       // glue, but since we already have it, using it is
+       // easier than writing something from scratch.
        if (data.empty())
                return true;
 
@@ -425,7 +442,8 @@ string const VSpace::asLatexCommand(BufferParams const & params) const
        case LENGTH:    return keep_ ? "\\vspace*{" + len_.asLatexString() + '}'
                                : "\\vspace{" + len_.asLatexString() + '}';
        }
-       return string();  // should never be reached
+       
+       lyx::Assert(0);
 }
 
 
@@ -464,14 +482,12 @@ int VSpace::inPixels(BufferView * bv) const
                retval = 3 * default_height;
                break;
                
-       case LENGTH:
-       {
+       case LENGTH: {
                int const default_width  = bv->workWidth();
                retval = len_.len().inPixels(default_width, default_height);
                break;
        }
                
        }
-
        return retval;
 }
index 266e04196da2c6ebf9a674fcc3adb22f30c99604..b2b18bcfe730564b651d298550f596eb158f17c6 100644 (file)
@@ -1,13 +1,11 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file vspace.h
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
  *
- *           LyX, The Document Processor
- *     
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Matthias Ettrich
+ */
 
 #ifndef VSPACE_H
 #define VSPACE_H
@@ -24,63 +22,57 @@ class BufferParams;
 class BufferView;
 
 
-///
+/// A class representing latex vertical spacing
 class VSpace {
 public:
        /// The different kinds of spaces.
        enum vspace_kind {
-               ///
-               NONE,
-               ///
+               NONE, ///< no added vertical space
                DEFSKIP,
-               ///
                SMALLSKIP,
-               ///
                MEDSKIP,
-               ///
                BIGSKIP,
-               ///
                VFILL,
-               ///
-               LENGTH
+               LENGTH ///< user-defined length
        };
-       /// Constructor
+
        VSpace();
-       /// Constructor
+
        explicit VSpace(vspace_kind k);
-       /// Constructor
+
        explicit VSpace(LyXLength const & l);
-       /// Constructor
+
        explicit VSpace(LyXGlueLength const & l);
 
        /// Constructor for reading from a .lyx file
        explicit VSpace(string const & data);
        
-       /// access functions
+       /// return the type of vertical space
        vspace_kind kind() const;
-       ///
+       /// return the length of this space
        LyXGlueLength length() const;
 
        // a flag that switches between \vspace and \vspace*
        bool keep() const;
-       ///
+       /// if set true, use \vspace* when type is not DEFSKIP
        void setKeep(bool val);
        ///
        bool operator==(VSpace const &) const;
 
        // conversion
        /// how it goes into the LyX file
        string const asLyXCommand() const; 
-       ///
+       /// the latex representation
        string const asLatexCommand(BufferParams const & params) const;
-       ///
+       /// the size of the space on-screen
        int inPixels(BufferView * bv) const;
 private:
        /// This VSpace kind
        vspace_kind kind_;
-       ///
+       /// the specified length
        LyXGlueLength len_;
-       ///
+       /// if true, use \vspace* type
        bool keep_;
 };