]> git.lyx.org Git - features.git/commitdiff
remove some unneeded version of functions from lstrings,
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 28 Jul 2002 18:13:51 +0000 (18:13 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 28 Jul 2002 18:13:51 +0000 (18:13 +0000)
some gcc 3.2. minor compile fixes.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4800 a592a061-630c-0410-9148-cb99ea01b6c8

35 files changed:
config/ChangeLog
config/lyxinclude.m4
po/POTFILES.in
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/ChangeLog
src/LaTeX.C
src/PrinterParams.h
src/buffer.C
src/bufferparams.C
src/exporter.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/biblio.C
src/frontends/qt2/lyx_gui.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/XMiniBuffer.h
src/frontends/xforms/lyx_gui.C
src/graphics/ChangeLog
src/graphics/PreviewLoader.C
src/insets/ChangeLog
src/insets/insetbib.C
src/insets/insetcite.C
src/insets/insetnote.C
src/lyxfont.C
src/lyxfunc.C
src/lyxlength.C
src/lyxserver.C
src/mathed/ChangeLog
src/mathed/formula.C
src/mathed/math_nestinset.C
src/support/ChangeLog
src/support/filetools.C
src/support/lstrings.C
src/support/lstrings.h
src/vc-backend.C

index 378dc53cdfa8f185435e1a48e19cd399b3371a9e..2429ffd297bde752a3d14dd8c56d46d24d4a14e1 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * lyxinclude.m4 (LYX_PROG_CXX): remove the double -Winline
+
 2002-07-17  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * lyxinclude.m4 (LYX_SCO):
@@ -13,7 +17,7 @@
 2002-06-20  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyxinclude.m4: add -Wno-non-template-friend
+
 2002-06-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * pspell.m4: patch from Garst to help find pspell (bug 428) this
@@ -22,7 +26,7 @@
 2002-06-19  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyxinclude.m4: remove LYX_REGEX properly
+
 2002-06-12  Angus Leeming  <leeming@lyx.org>
 
        * lyxinclude.m4 (LYX_STL_STRING_FWD): removed.
 
 2002-06-12  John Levon  <moz@compsoc.man.ac.uk>
 
-       * qt2.m4: Qt frontend is for Qt 2 OR Qt 3 
+       * qt2.m4: Qt frontend is for Qt 2 OR Qt 3
+
 2002-06-07  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * xforms.m4 (LYX_USE_XFORMS_IMAGE_LOADER): complete rewrite. Now
        simpler and hopefully better. Please test.
        (LYX_PATH_XFORMS): move test for flimage.h in
-       LYX_USE_XFORMS_IMAGE_LOADER. 
+       LYX_USE_XFORMS_IMAGE_LOADER.
        (LYX_XFORMS_IMAGE_LOADER_NEEDS_JPEG): killed. Now just a couple
        lines in LYX_USE_XFORMS_IMAGE_LOADER.
 
index 498f881ba2efd207643f8906f812a29dd773309f..172309f9786cbb3541e1fc017c5f4b0165896d61 100644 (file)
@@ -211,7 +211,7 @@ if test x$GXX = xyes; then
       2.96*)  CXXFLAGS="$lyx_opt -fno-exceptions -Wno-non-template-friend";;
       3.0*)    CXXFLAGS="$lyx_opt";;
       3.1*)    CXXFLAGS="$lyx_opt -finline-limit=500 -fno-exceptions";;
-      3.2*)    CXXFLAGS="$lyx_opt";;
+      3.2*)    CXXFLAGS="$lyx_opt -fno-exceptions";;
       *)       CXXFLAGS="$lyx_opt";;
     esac
     if test x$enable_debug = xyes ; then
@@ -222,7 +222,7 @@ if test x$GXX = xyes; then
     case $gxx_version in
        2.95.*) CXXFLAGS="$CXXFLAGS -W -Wall";;
        2.96*)  CXXFLAGS="$CXXFLAGS -W -Wall";;
-       3.1*)  CXXFLAGS="$CXXFLAGS -W -Wall -Winline";;
+       3.1*)  CXXFLAGS="$CXXFLAGS -W -Wall";;
        *)      CXXFLAGS="$CXXFLAGS -W -Wall";;
     esac
     if test $lyx_devel_version = yes ; then
index 532fdf12084e1396fc3dae468d7362c22812da8c..b6f49b1bd129d767fa6f83771fab3621f4e697e1 100644 (file)
@@ -8,7 +8,6 @@ src/converter.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
-src/ext_l10n.h
 src/FloatList.C
 src/frontends/controllers/biblio.C
 src/frontends/controllers/ButtonController.h
index 78e5740e92773be57af8343947595fd589fbda13..124408dd783c87b1cfe4927917b8214845875c13 100644 (file)
@@ -77,6 +77,7 @@
 #include "support/lyxfunctional.h"
 
 #include <boost/bind.hpp>
+#include <boost/signals/connection.hpp>
 
 #include <cstdio>
 #include <ctime>
index bb42570883bb8de69c5ba71f4bbaea3c4c934a48..429df7b067c4e89e159ece3fec04096e6016f7dc 100644 (file)
@@ -30,7 +30,7 @@
 class LyXView;
 class WorkArea;
 class LyXScreen;
+
 ///
 struct BufferView::Pimpl : public boost::signals::trackable {
        ///
@@ -133,11 +133,12 @@ private:
         */
        Box insetDimensions(LyXText const & text, LyXCursor const & cursor) const;
        /**
-        * check if the given co-ordinates are inside an inset at the given cursor,
-        * if one exists. If so, the inset is returned, and the co-ordinates are
-        * made relative. Otherwise, 0 is returned.
+        * check if the given co-ordinates are inside an inset at the
+        * given cursor, if one exists. If so, the inset is returned,
+        * and the co-ordinates are made relative. Otherwise, 0 is returned.
         */
-       Inset * checkInset(LyXText const & text, LyXCursor const & cursor, int & x, int & y) const;
+       Inset * checkInset(LyXText const & text, LyXCursor const & cursor,
+                          int & x, int & y) const;
        ///
        friend class BufferView;
        /// open and lock an updatable inset
index 9569e3105fee773d173515d4d5429ebe6c80914e..4c27a3ef7afcfca3e5c7065844eff42d08e15ef9 100644 (file)
@@ -1,3 +1,19 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * PrinterParams.h: remove extern containsOnly, and include
+       support/lstrings.h instead.
+
+       * LaTeX.C (scanAuxFile): modify because of strip changes
+       (deplog): ditto
+       * buffer.C (makeLaTeXFile): ditto
+       * bufferparams.C (writeFile): ditt
+       * lyxfont.C (stateText): ditto
+       * lyxserver.C (read_ready): ditto
+       * vc-backend.C (scanMaster): ditto
+
+       * BufferView_pimpl.h: ws changes
+
+       * BufferView_pimpl.C: inlude boost/signals/connection.hpp
 
 2002-07-26  André Pönitz <poenitz@gmx.net>
 
 2002-07-25  John Levon  <moz@compsoc.man.ac.uk>
 
        * MenuBackend.C: using std::max
+
 2002-07-25  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
-       * MenuBackend.C (expandToc): 
+       * MenuBackend.C (expandToc):
        (expandToc2): code moved from xforms menu frontend. It is now
        generic and TOCs are transparent to menu frontends.
 
@@ -83,7 +99,7 @@
        * LyXAction.C:
        * commandtags.h:
        * lyxfunc.C: remove LFUN_ADD_TO_TOOLBAR
+
 2002-07-22  John Levon  <moz@compsoc.man.ac.uk>
 
        * LyXAction.C:
index b1817790ea804cc5ebe76b4024d1f224577913ee..cf2f884fe9d2d0190dc2986f0a626853a2bc033c 100644 (file)
@@ -430,7 +430,7 @@ void LaTeX::scanAuxFile(string const & file, Aux_Info & aux_info)
        regex reg4("\\\\@input\\{([^}]+)\\}");
 
        while (getline(ifs, token)) {
-               token = strip(token, '\r');
+               token = strip(token, "\r");
                smatch sub;
                if (regex_match(token, sub, reg1)) {
                        string data = sub[1];
@@ -679,7 +679,7 @@ void LaTeX::deplog(DepTable & head)
                string foundfile;
                string token;
                getline(ifs, token);
-               token = strip(token, '\r');
+               token = strip(token, "\r");
                if (token.empty()) continue;
 
                smatch sub;
index 71253ce75e542596a527b7e17106db604a7e86ab..8b6150552f0935bc46503610ba747d1c2a54509c 100644 (file)
@@ -18,8 +18,8 @@
 #include "lyxrc.h"
 
 #ifdef ENABLE_ASSERTIONS
+#include "support/lstrings.h"
 #include "support/LAssert.h"
-extern bool containsOnly(string const &, char const *);
 #endif
 
 
index 5b1d4c3625883a94e3100bc5760317dab4ba768c..2810843d66585bf49ecdcf39c01f66e0d95f0dbf 100644 (file)
@@ -2338,7 +2338,7 @@ void Buffer::makeLaTeXFile(ostream & os,
 
                string strOptions(options.str().c_str());
                if (!strOptions.empty()) {
-                       strOptions = strip(strOptions, ',');
+                       strOptions = strip(strOptions, ",");
                        os << '[' << strOptions << ']';
                }
 
index 0d73595781c0de04710986b417685c4f103d3774..504e9c9eed88a85ab3481737a061272a12eaf48c 100644 (file)
@@ -81,7 +81,7 @@ void BufferParams::writeFile(ostream & os) const
        // then the the preamble
        if (!preamble.empty()) {
                // remove '\n' from the end of preamble
-               string const tmppreamble = strip(preamble, '\n');
+               string const tmppreamble = strip(preamble, "\n");
                os << "\\begin_preamble\n"
                   << tmppreamble
                   << "\n\\end_preamble\n";
index 898d6301a9d66f113843588d2abf507a2733bce6..c82a0aa9b8d63d2f4da421594ff85b5501818bbe 100644 (file)
@@ -39,7 +39,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
        if (bv) {
                // Remove all error insets
                if (bv->removeAutoInsets()) {
-#warning repaint() or update() or nothing ? 
+#warning repaint() or update() or nothing ?
                        bv->repaint();
                        bv->fitCursor();
                }
index 7635b1b40fa57caa440b86c276012aef5f59993b..c5529e938a1baee8553e430265a9c1a1591e5e47 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * biblio.C (parseBibTeX): modify because of strip changes
+
 2002-07-24  Juergen Spitzmueller <j.spitzmueller@gmx.de>
 
        * ControlFloat.[Ch]: Implement Wide Float toggle
@@ -6,7 +10,7 @@
 2002-07-22  Herbert Voss  <voss@lyx.org>
 
        * ControlGraphics.C: small changes
-       
+
 2002-07-21  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * ControlToc.C: remove getType
 2002-07-20  John Levon  <moz@compsoc.man.ac.uk>
 
        * ControlCommandBuffer.C: don't add "" to history
+
 2002-07-20  John Levon  <moz@compsoc.man.ac.uk>
 
        * ControlRef.C: fix dispatch call nicely
+
 2002-07-19  John Levon  <moz@compsoc.man.ac.uk>
 
        * Makefile.am:
        * ControlCommandBuffer.h:
        * ControlCommandBuffer.C: add controller for command (mini) buffer
          handling
+
 2002-07-19  John Levon  <moz@compsoc.man.ac.uk>
 
        * ControlRef.C: fix dispatch call
+
 2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
 
        * ControlCharacter.C: use view_state_changed not setState
+
 2002-07-15  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * biblio.C (parseBibTeX): use ascii_lowercase instead of lowercase
index 7ae01ac0fa2751fde2021a33a15a407d09d48d2b..629e495c480d639fc14476c40863b19b62a36c34 100644 (file)
@@ -451,10 +451,10 @@ string const parseBibTeX(string data, string const & findkey)
 
        // Clean-up.
        // 1. Spaces
-       data = strip(data, ' ');
+       data = strip(data);
        // 2. if there is no opening '{' then a closing '{' is probably cruft.
        if (!contains(data, '{'))
-               data = strip(data, '}');
+               data = strip(data, "}");
        // happens, when last keyword
        string::size_type const idx =
                !data.empty() ? data.find('=') : string::npos;
@@ -469,7 +469,7 @@ string const parseBibTeX(string data, string const & findkey)
                return string();
        } else {
                // delete '=' and the following spaces
-               data = frontStrip(frontStrip(data,'='));
+               data = frontStrip(frontStrip(data, "="));
                if (data.length() < 2) {
                        return data;    // not long enough to find delimiters
                } else {
@@ -482,7 +482,7 @@ string const parseBibTeX(string data, string const & findkey)
                        } else {
                                // no {} and no "", pure data but with a
                                // possible ',' at the end
-                               return strip(data,',');
+                               return strip(data, ",");
                        }
                        string tmp = data.substr(keypos);
                        while (tmp.find('{') != string::npos &&
index 952edde40222f306d6984230fd658e751145f6f5..b21382e0f27493472939190f11dd13b3637a5263 100644 (file)
@@ -8,21 +8,21 @@
  */
 
 #include <config.h>
+
 #include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/filetools.h"
 #include "debug.h"
 #include "gettext.h"
+
 #include <fcntl.h>
 #include <boost/bind.hpp>
+
 #include "lyx_gui.h"
 #include "lyx_main.h"
 #include "lyxrc.h"
 #include "lyxfont.h"
+
 // FIXME: move this stuff out again
 #include "bufferlist.h"
 #include "lyxfunc.h"
 #include <boost/shared_ptr.hpp>
 #include <boost/function/function0.hpp>
 #include <boost/signals/signal1.hpp>
+
 #include "QtView.h"
 #include "QLImage.h"
 #include "qfont_loader.h"
-#include "io_callback.h" 
+#include "io_callback.h"
+
 #include <qapplication.h>
+
 #ifndef CXX_GLOBAL_CSTD
 using std::exit;
 #endif
@@ -49,30 +49,30 @@ using std::exit;
 using std::vector;
 using std::hex;
 using std::endl;
+
 extern BufferList bufferlist;
+
 // FIXME: wrong place !
 LyXServer * lyxserver;
+
 void lyx_gui::parse_init(int & argc, char * argv[])
 {
        static QApplication a(argc, argv);
+
        using namespace grfx;
 
        Image::newImage = boost::bind(&QLImage::newImage);
        Image::loadableFormats = boost::bind(&QLImage::loadableFormats);
 }
+
 
 void lyx_gui::parse_lyxrc()
 {
-       // FIXME !!!! 
+       // FIXME !!!!
        lyxrc.dpi = 95;
 }
 
+
 void lyx_gui::start(string const & batch, vector<string> files)
 {
        // initial geometry
@@ -80,17 +80,17 @@ void lyx_gui::start(string const & batch, vector<string> files)
        int ypos = -1;
        unsigned int width = 690;
        unsigned int height = 510;
+
        QtView view(width, height);
        view.show(xpos, ypos, "LyX");
        view.init();
 
        Buffer * last = 0;
+
        // FIXME: some code below needs moving
 
        lyxserver = new LyXServer(view.getLyXFunc(), lyxrc.lyxpipes);
+
        vector<string>::const_iterator cit = files.begin();
        vector<string>::const_iterator end = files.end();
        for (; cit != end; ++cit) {
@@ -111,18 +111,18 @@ void lyx_gui::start(string const & batch, vector<string> files)
        }
 
        qApp->exec();
-                
+
        // FIXME
        delete lyxserver;
 }
+
+
 void lyx_gui::exit()
 {
        qApp->exit(0);
 }
 
+
 string const lyx_gui::hexname(LColor::color col)
 {
        QColor color(lcolor.getX11Name(col).c_str());
index 54f44545124c1aab6bf59b34608c98fcf0ffd8df..eb0fc4ce88ff1a2a75d5d59a7feb008ab66f301c 100644 (file)
@@ -679,8 +679,8 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
                setEnabled(lyxview_->check_lyxaspectratio, 1);
                setEnabled(lyxview_->input_lyxscale, 0);
        } else if (ob == lyxview_->button_latex_values) {
-               if (contains(fl_get_choice_text(size_->choice_width),'%') || 
-                       contains(fl_get_choice_text(size_->choice_height),'%'))
+               if (contains(fl_get_choice_text(size_->choice_width), '%') ||
+                   contains(fl_get_choice_text(size_->choice_height), '%'))
                        Alert::alert(_("Warning!"),
                                     _("The %-units are not allowed here."),
                                     _("Cannot use the values from LaTeX size!"));
index 2d0bd6b144df97397a3f594e8e3da254e5c93eab..a01fb692a1b94c42a4e1ed4bd8b71b098f47caca 100644 (file)
@@ -34,7 +34,7 @@ public:
 
        ///
        ~XMiniBuffer();
-
+       
        /// create drop down
        void dd_init();
 
index 01458e8e487c1bcb59909564df5e2daf1b728d40..b424142506bfe265b34320c20d54ee34885787b5 100644 (file)
@@ -155,7 +155,7 @@ void lyx_gui::parse_init(int & argc, char * argv[])
        XSetErrorHandler(LyX_XErrHandler);
 
        lyxColorHandler.reset(new LyXColorHandler());
+
        using namespace grfx;
 
 #ifdef USE_XFORMS_IMAGE_LOADER
@@ -317,7 +317,7 @@ void lyx_gui::exit()
        finished = true;
 }
 
+
 string const lyx_gui::hexname(LColor::color col)
 {
        string const name = lcolor.getX11Name(col);
@@ -367,7 +367,7 @@ namespace {
 extern "C"
 void C_read_callback(int, void * data)
 {
-       LyXComm * comm = static_cast<LyXComm *>(data); 
+       LyXComm * comm = static_cast<LyXComm *>(data);
        comm->read_ready();
 }
 
index b6ef29dc1ab3e1a4c1a61daf72e3fd5d0c65ee36..baccf953426ad142df69ded8cf238d545d5eb274 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * PreviewLoader.C (setAscentFractions): modify because of strip
+       changes
+
 2002-07-22  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * GraphicsConverter.C (build_script): take a ostream as a more
index 14eb559e3dcac30603e30fe0eaf5d93cb27c59b3..cea9a7f5237d3cd392c2092b7fde5adb2646911d 100644 (file)
@@ -737,7 +737,7 @@ void setAscentFractions(vector<double> & ascent_fractions,
 
                if (!ifs.good() ||
                    page != "%%Page" ||
-                   !isStrUnsignedInt(strip(page_id, ':'))) {
+                   !isStrUnsignedInt(strip(page_id, ":"))) {
                        lyxerr[Debug::GRAPHICS] << "setAscentFractions("
                                                << metrics_file << ")\n"
                                                << "Error reading file!"
index 2222e9549bb999bd4fe20d27d29f25267e5a5aeb..032d120859539d63007efbf7da13f5d122b7a79e 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * insetbib.C (latex): modify because of strip changes
+       (getKeys): ditto
+       * insetnote.C (InsetNote): ditto
+
 2002-07-26  Juergen Vigna  <jug@sad.it>
 
        * insettabular.C (searchForward): check for lastcell if we
 2002-07-25  Dekel Tsur  <dekelts@tau.ac.il>
 
        * insetfloat.C (read, write): Allow default placement
-       (floatPlacement_ is empty).
+       (floatPlacement_ is empty).
 
 2002-07-23  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
-       * insetminipage.h (noFontChange): 
-       * insettabular.h (noFontChange): 
-       * insetfootlike.h (noFontChange): 
+       * insetminipage.h (noFontChange):
+       * insettabular.h (noFontChange):
+       * insetfootlike.h (noFontChange):
        * insetfloat.h (noFontChange): return true
 
        * inset.h (noFontChange): new method, defaulting to false
 
        * insetgraphicsParams.h: do not include "lyxlex.h" and "buffer.h"
 
-       * insetquotes.C: 
-       * insetlatexaccent.C: 
-       * insetgraphics.C: 
-       * insetexternal.C: 
-       * insetert.C: 
+       * insetquotes.C:
+       * insetlatexaccent.C:
+       * insetgraphics.C:
+       * insetexternal.C:
+       * insetert.C:
        * insetbib.C: #include "lyxlex.h"
 
-       * insetinclude.C: 
-       * insetfloat.C: 
-       * insetert.C: 
-       * insetbib.C: 
+       * insetinclude.C:
+       * insetfloat.C:
+       * insetert.C:
+       * insetbib.C:
        * insettext.C: use BufferParams::getLyXTextClass
-       
+
 
        * insetfloat.C (addToToc): new method. Add to toclist the entries
        corresponding to Caption layouts
@@ -66,7 +72,7 @@
 
 2002-07-21  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
-       * insettoc.C (ascii): 
+       * insettoc.C (ascii):
        * insetfloatlist.C (ascii): change to use the new Toc functions
        instead of stuff that was in Buffer
 
@@ -80,7 +86,7 @@
        * insetgraphicsParams.C (as_grfxParams): use the new
        keepLyXAspectRatio parameter. Note that this is an adaptation of a
        1.2.0 patch, and I do not really know how to adapt it to the new
-       grfx::Cache world. Angus, please could you have a look? 
+       grfx::Cache world. Angus, please could you have a look?
 
 2002-05-01  Herbert Voss  <voss@lyx.org>
 
 2002-07-17  John Levon  <moz@compsoc.man.ac.uk>
 
        * insettext.C: use view_state_changed, switchKeyMap
+
 2002-07-17  Herbert Voss  <voss@perce.de>
 
        * insetgraphics.C (prepareFile): keep the extension when
 
 2002-07-15  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
-       * insetcite.C (getNatbibLabel): 
+       * insetcite.C (getNatbibLabel):
        * insetbib.C (getKeys): use ascii_lowercase instead of lowercase
 
 2002-07-15  John Levon  <moz@compsoc.man.ac.uk>
 
        * insetgraphics.C: use ->isDrawable()
+
 2002-07-12  Angus Leeming  <leeming@lyx.org>
 
        * insetgraphics.C: use the new smart loading capabilities of the image
 2002-07-13  Dekel Tsur  <dekelts@tau.ac.il>
 
        * insettabular.C (edit): Move into correct cell when entering a
-       tabular in 
+       tabular in
 
        * insettext.C (unlockInsetInInset): Correct cursor behaviour for
        RTL paragraphs.
index 1525c4d274d5d014ffa1456e7fd61da5b9f01433..738e4ecd920d586f669093aedf350a8a4bb475c2 100644 (file)
@@ -152,10 +152,10 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
        // Style-Options
        string style = getOptions(); // maybe empty! and with bibtotoc
        string bibtotoc;
-       if (prefixIs(style,"bibtotoc")) {
+       if (prefixIs(style, "bibtotoc")) {
                bibtotoc = "bibtotoc";
-               if (contains(style,',')) {
-                       style = split(style,bibtotoc,',');
+               if (contains(style, ',')) {
+                       style = split(style, bibtotoc, ',');
                }
        }
 
@@ -206,7 +206,7 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os,
                db_out += ',';
                db_in= split(db_in, adb,',');
        }
-       db_out = strip(db_out, ',');
+       db_out = strip(db_out, ",");
        os   << "\\bibliography{" << db_out << "}\n";
        return 2;
 }
@@ -264,7 +264,7 @@ vector<pair<string, string> > const InsetBibtex::getKeys(Buffer const * buffer)
                                    && !prefixIs(tmp, "@preamble")) {
                                        linebuf = split(linebuf, tmp, ',');
                                        tmp = frontStrip(tmp);
-                                       tmp = frontStrip(tmp,'\t');
+                                       tmp = frontStrip(tmp,"\t");
                                        if (!tmp.empty()) {
                                                keys.push_back(pair<string,string>(tmp,string()));
                                        }
index ecd9aa77055d8c58be22305cfb1d212e182f8ff8..f4a5f41bb8582c72e33f1d4982cd93acb33af7a5 100644 (file)
@@ -44,7 +44,7 @@ namespace {
 // reload the bibkey list
 std::map<Buffer const *, bool> loading_buffer;
 
-string const getNatbibLabel(Buffer const * buffer, 
+string const getNatbibLabel(Buffer const * buffer,
                            string const & citeType, string const & keyList,
                            string const & before, string const & after,
                            bool numerical)
@@ -66,7 +66,7 @@ string const getNatbibLabel(Buffer const * buffer,
 
                InfoType::const_iterator bit  = bibkeys.begin();
                InfoType::const_iterator bend = bibkeys.end();
-       
+
                biblio::InfoMap infomap;
                for (; bit != bend; ++bit) {
                        infomap[bit->first] = bit->second;
@@ -76,7 +76,7 @@ string const getNatbibLabel(Buffer const * buffer,
 
                cached_keys[buffer] = infomap;
        }
-       
+
        biblio::InfoMap infomap = cached_keys[buffer];
 
        // the natbib citation-styles
@@ -90,12 +90,12 @@ string const getNatbibLabel(Buffer const * buffer,
 
        // We don't currently use the full or forceUCase fields.
        // bool const forceUCase = citeType[0] == 'C';
-       bool const full = citeType[citeType.size()-1] == '*';
+       bool const full = citeType[citeType.size() - 1] == '*';
 
        string const cite_type = full ?
-               ascii_lowercase(citeType.substr(0,citeType.size()-1)) :
+               ascii_lowercase(citeType.substr(0, citeType.size() - 1)) :
                ascii_lowercase(citeType);
-       
+
        string before_str;
        if (!before.empty()) {
                // In CITET and CITEALT mode, the "before" string is
@@ -106,7 +106,7 @@ string const getNatbibLabel(Buffer const * buffer,
                if (cite_type == "citet" ||
                    cite_type == "citealt" ||
                    cite_type == "citep" ||
-                   cite_type == "citealp" || 
+                   cite_type == "citealp" ||
                    cite_type == "citeyearpar")
                        before_str = before + ' ';
        }
@@ -120,17 +120,18 @@ string const getNatbibLabel(Buffer const * buffer,
        // One day, these might be tunable (as they are in BibTeX).
        char const op  = '('; // opening parenthesis.
        char const cp  = ')'; // closing parenthesis.
-       char const sep = ';'; // puctuation mark separating citation entries.
+       // puctuation mark separating citation entries.
+       char const * const sep = ";";
 
        string const op_str(string(1, ' ')  + string(1, op));
        string const cp_str(string(1, cp)   + string(1, ' '));
-       string const sep_str(string(1, sep) + string(1, ' '));
+       string const sep_str(string(sep) + " ");
 
        string label;
        vector<string> keys = getVectorFromString(keyList);
        vector<string>::const_iterator it  = keys.begin();
        vector<string>::const_iterator end = keys.end();
-       for (; it != end; ++it) {
+       for (; it != end; ++it) {
                // get the bibdata corresponding to the key
                string const author(biblio::getAbbreviatedAuthor(infomap, *it));
                string const year(biblio::getYear(infomap, *it));
@@ -176,7 +177,7 @@ string const getNatbibLabel(Buffer const * buffer,
        if (!after_str.empty()) {
                if (cite_type == "citet") {
                        // insert "after" before last ')'
-                       label.insert(label.size()-1, after_str);
+                       label.insert(label.size() - 1, after_str);
                } else {
                        bool const add = !(numerical &&
                                           (cite_type == "citeauthor" ||
@@ -187,7 +188,7 @@ string const getNatbibLabel(Buffer const * buffer,
        }
 
        if (!before_str.empty() && (cite_type == "citep" ||
-                                   cite_type == "citealp" || 
+                                   cite_type == "citealp" ||
                                    cite_type == "citeyearpar")) {
                label = before_str + label;
        }
@@ -217,7 +218,7 @@ string const getBasicLabel(string const & keyList, string const & after)
 
        if (!after.empty())
                label += ", " + after;
-       
+
        return "[" + label + "]";
 }
 
@@ -248,7 +249,7 @@ string const InsetCitation::generateLabel(Buffer const * buffer) const
                        else
                                cmd = "citet";
                }
-               label = getNatbibLabel(buffer, cmd, getContents(), 
+               label = getNatbibLabel(buffer, cmd, getContents(),
                                       before, after,
                                       buffer->params.use_numerical_citations);
        }
@@ -350,14 +351,24 @@ int InsetCitation::latex(Buffer const * buffer, ostream & os,
                os << getCmdName();
        else
                os << "cite";
-       
+
+#warning What is this code supposed to do? (Lgb)
+
+#if 1
+       // The current strange code
+
        string const before = string();
        string const after  = getOptions();
        if (!before.empty() && buffer->params.use_natbib)
                os << "[" << before << "][" << after << "]";
        else if (!after.empty())
                os << "[" << after << "]";
-
+#else
+       // and the cleaned up equvalent, should it just be changed? (Lgb)
+       string const after  = getOptions();
+       if (!after.empty())
+               os << "[" << after << "]";
+#endif
        string::const_iterator it  = getContents().begin();
        string::const_iterator end = getContents().end();
        // Paranoia check: make sure that there is no whitespace in here
index 21c1e9770fb643ad8cba552fbe041a185c7a5f83..b060e919019d5065bdb5adbcac19c17b1c2e5d6a 100644 (file)
@@ -77,7 +77,7 @@ InsetNote::InsetNote(Buffer const * buf, string const & contents,
                font.setLanguage(default_language);
 
        lyx::pos_type pos = 0;
-       buf->insertStringAsLines(par, pos, font, strip(contents, '\n'));
+       buf->insertStringAsLines(par, pos, font, strip(contents, "\n"));
 }
 
 
index 362253b678e817bef473543bb955557cccea2248..e684207226f8ceb97ab1222222ed14f6a3ac2c02 100644 (file)
@@ -571,8 +571,7 @@ string const LyXFont::stateText(BufferParams * params) const
                ost << _("  Number ") << _(GUIMiscNames[number()]);
 
        string buf(ost.str().c_str());
-       buf = strip(buf, ' ');
-       buf = strip(buf, ',');
+       buf = strip(buf, ", ");
        return buf;
 }
 
index 26344401ad76e20f6f8535821434b34d18dd21d9..9856b6331ae1736ce427c817d1cb7578356cbce1 100644 (file)
@@ -684,7 +684,7 @@ FuncStatus LyXFunc::getStatus(kb_action action,
        if (action == LFUN_SEQUENCE) {
                // argument contains ';'-terminated commands
                const int ac = lyxaction.LookupFunc(token(argument, ';', 0));
-               flag = getStatus(ac); 
+               flag = getStatus(ac);
        }
 
        return flag;
@@ -1284,7 +1284,7 @@ void LyXFunc::dispatch(kb_action action, string argument, bool verbose)
                owner->view()->setCursorFromRow(row);
 
                owner->view()->center();
-               // see BufferView_pimpl::center() 
+               // see BufferView_pimpl::center()
                owner->view()->updateScrollbar();
        }
        break;
@@ -1316,7 +1316,7 @@ void LyXFunc::dispatch(kb_action action, string argument, bool verbose)
                owner->view_state_changed();
 
                owner->view()->center();
-               // see BufferView_pimpl::center() 
+               // see BufferView_pimpl::center()
                owner->view()->updateScrollbar();
        }
        break;
@@ -1531,18 +1531,18 @@ void LyXFunc::sendDispatchMessage(string const & msg, kb_action action, string c
 {
        owner->updateMenubar();
        owner->updateToolbar();
+
        if (action == LFUN_SELFINSERT || !verbose) {
                lyxerr[Debug::ACTION] << "dispatch msg is " << msg << endl;
                if (!msg.empty())
                        owner->message(msg);
                return;
        }
+
        string dispatch_msg(msg);
        if (!dispatch_msg.empty())
                dispatch_msg += " ";
+
        string comname = lyxaction.getActionName(action);
 
        int pseudoaction = action;
@@ -1578,7 +1578,7 @@ void LyXFunc::sendDispatchMessage(string const & msg, kb_action action, string c
                owner->message(dispatch_msg);
 }
 
+
 void LyXFunc::setupLocalKeymap()
 {
        keyseq.stdmap = keyseq.curmap = toplevel_keymap.get();
@@ -1863,6 +1863,6 @@ string const LyXFunc::view_status_message()
 
        if (!owner->view()->available())
                return _("Welcome to LyX!");
+
        return currentState(owner->view());
 }
index fea213df8909bb7511575d9efd5ae50707367b85..af8d8734e8c2dfb0c99da4eac7c6e60bd16ee256 100644 (file)
@@ -37,15 +37,15 @@ LyXLength::LyXLength(double v, LyXLength::UNIT u)
 
 
 #ifndef NO_PEXTRA_REALLY
-// compatibility stuff < version 1.2.0pre and for 
+// compatibility stuff < version 1.2.0pre and for
 // "old" 1.2.0 files before the pre
 namespace {
-string const convertOldRelLength(string const & oldLength) 
+string const convertOldRelLength(string const & oldLength)
 {
        // we can have only one or none of the following
        if (oldLength.find("c%") != string::npos) {
                return subst(oldLength,"c%","col%");
-                   
+
        } else if (oldLength.find("t%") != string::npos) {
                if (oldLength.find("text%") != string::npos ||
                    oldLength.find("height%") != string::npos)
index db90e4619032e6d726c2810092531afce1c5deb2..ed4948919c41247394ac240a9b01fd0a17f78949 100644 (file)
@@ -270,7 +270,7 @@ void LyXComm::read_ready()
        while ((status = read(infd, charbuf, CMDBUFLEN-1))) {
                if (status > 0) {
                        charbuf[status]= '\0'; // turn it into a c string
-                       lsbuf += strip(charbuf, '\r');
+                       lsbuf += strip(charbuf, "\r");
                        // commit any commands read
                        while (lsbuf.find('\n') != string::npos) {
                                // split() grabs the entire string if
@@ -474,7 +474,7 @@ void LyXServer::callback(LyXServer * serv, string const & msg)
 
                        serv->func->dispatch(cmd + ' ' + arg);
                        string const rval = serv->func->getMessage();
-                       
+
                        //modified june 1999 stefano@zool.su.se:
                        //all commands produce an INFO or ERROR message
                        //in the output pipe, even if they do not return
index 306f2f372de18f263f0efa5832cc648c376b4e6a..671a420d53612e73f1541603fa25f73cb20bccef 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * math_nestinset.C: add using std::vector
+
 2002-07-23  Angus Leeming  <leeming@lyx.org>
 
        * formula.C (descent): add an arbitrary 12 pixels to the descent when
 2002-07-12  Angus Leeming  <leeming@lyx.org>
 
        * formula.C: use the new smart loading capabilities of the image
-       loader. 
+       loader.
 
 2002-07-14  John Levon  <moz@compsoc.man.ac.uk>
 
        * mathformula.C: use Lsstream.h not sstream
+
 2002-07-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * math_support.C:
        * math_factory.C: use lyx_gui::font_available()
+
 2002-07-09  Angus Leeming  <leeming@lyx.org>
 
        * math_braceinset.h:
index d2c32a2e49344e9c73787e8e35b053d15f014a09..8f6ee33d0f50fd1661b13ff6c7d8b163138a1b24 100644 (file)
@@ -78,7 +78,7 @@ struct InsetFormula::PreviewImpl : public boost::signals::trackable {
         *  signal.
         */
        void previewReady(grfx::PreviewImage const &);
-       
+
        /// A helper method.
        string const latexString() const;
 
@@ -102,8 +102,8 @@ InsetFormula::InsetFormula()
 
 
 InsetFormula::InsetFormula(InsetFormula const & other)
-       :       InsetFormulaBase(other),
-               par_(other.par_),
+       : InsetFormulaBase(other),
+         par_(other.par_),
          preview_(new PreviewImpl(*this))
 {}
 
index dd328b8312041905cc5710a5a11e2e4e36427fc5..639553660ba903dec80676205301ebb19550d322 100644 (file)
@@ -12,6 +12,8 @@
 #include "graphics/PreviewLoader.h"
 #include "graphics/Previews.h"
 
+using std::vector;
+
 
 MathNestInset::MathNestInset(idx_type nargs)
        : MathDimInset(), cells_(nargs), lock_(false)
@@ -212,10 +214,10 @@ void MathNestInset::drawMarkers(MathPainterInfo & pi, int x, int y) const
                return;
        int t = x + width() - 1;
        int d = y + descent();
-       pi.pain.line(x, d - 3, x, d, LColor::mathframe); 
-       pi.pain.line(t, d - 3, t, d, LColor::mathframe); 
-       pi.pain.line(x, d, x + 3, d, LColor::mathframe); 
-       pi.pain.line(t - 2, d, t, d, LColor::mathframe); 
+       pi.pain.line(x, d - 3, x, d, LColor::mathframe);
+       pi.pain.line(t, d - 3, t, d, LColor::mathframe);
+       pi.pain.line(x, d, x + 3, d, LColor::mathframe);
+       pi.pain.line(t - 2, d, t, d, LColor::mathframe);
 }
 
 
@@ -223,13 +225,13 @@ void MathNestInset::drawMarkers2(MathPainterInfo & pi, int x, int y) const
 {
        if (!editing())
                return;
-       drawMarkers(pi, x, y);  
+       drawMarkers(pi, x, y);
        int t = x + width() - 1;
        int a = y - ascent();
-       pi.pain.line(x, a + 3, x, a, LColor::mathframe); 
-       pi.pain.line(t, a + 3, t, a, LColor::mathframe); 
-       pi.pain.line(x, a, x + 3, a, LColor::mathframe); 
-       pi.pain.line(t - 2, a, t, a, LColor::mathframe); 
+       pi.pain.line(x, a + 3, x, a, LColor::mathframe);
+       pi.pain.line(t, a + 3, t, a, LColor::mathframe);
+       pi.pain.line(x, a, x + 3, a, LColor::mathframe);
+       pi.pain.line(t - 2, a, t, a, LColor::mathframe);
 }
 
 
index 7785c10a8decda328ef520a01dd51ad5d15fe457..c499c11ed3922c8e4457ba61e1977297cafc993a 100644 (file)
@@ -1,3 +1,17 @@
+2002-07-28  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * filetools.C (GetEnvPath): modify because of strip changes
+       (createDirectory): ditto
+       (findtexfile): ditto
+       * lstrings.[Ch] (isStrInt): ditto
+       (isStrUnsignedInt): ditto
+       (strToInt): ditto
+       (strToUnsignedInt): ditto
+       (isStrDbl): ditto
+       (contains): removed unneeded version of contains
+       (containsOnly): removed uneeded versions of containsOnly
+       (strip, frontStrip): removed unneded versions, changed argument types. 
+
 2002-07-22  Dekel Tsur  <dekelts@tau.ac.il>
 
        * filetools.C (RunCommand): Made public
@@ -5,7 +19,7 @@
 2002-07-22  John Levon  <moz@compsoc.man.ac.uk>
 
        * limited_stack.h: fix comment, remove un-needed header
+
 2002-07-21  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * lstrings.h: correct comments for token and tokenPos
@@ -37,7 +51,7 @@
        (IsSGMLFilename): use ascii_lowercase instead of lowercase
 
        * lstrings.[Ch] (ascii_lowercase): new function
-       
+
 2002-07-16  André Pönitz <poenitz@gmx.net>
 
        * FileInfo.Ch: remove unneeded code
@@ -46,7 +60,7 @@
 
        * filetools.[C] (readExtFromContents): add support for
        (x)fig format images
-               
+
 2002-06-26  André Pönitz <poenitz@gmx.net>
 
        * filetools.[Ch]: small whitespace, more compact 'return' statement
@@ -60,7 +74,7 @@
        * filetools.[C]: (readBB_from_PSFile) add a helperfunc
        (readBB_lyxerrMessage) to get better lyxerr messages
        (getExtFromContents) test epsi files in the right way
-               
+
        * DestroxLyXTmpDir.C: changed to true, to delete the
        temporary unzipped files, too.
 
index a63806850f68e3e797253bc730f61c6f404e14aa..1a8fc1636308ba04f6523b2168b1bc25f5632b56 100644 (file)
@@ -364,7 +364,7 @@ string const GetEnvPath(string const & name)
 #else
        string const pathlist = os::slashify_path(GetEnv(name));
 #endif
-       return strip(pathlist, ';');
+       return strip(pathlist, ";");
 }
 
 
@@ -554,17 +554,17 @@ string const CreateLyXTmpDir(string const & deflt)
 }
 
 
-// FIXME: no need for separate method like this ... 
+// FIXME: no need for separate method like this ...
 int DestroyLyXTmpDir(string const & tmpdir)
 {
-       return DestroyTmpDir(tmpdir, true); 
+       return DestroyTmpDir(tmpdir, true);
 }
 
 
 // Creates directory. Returns true if succesfull
 bool createDirectory(string const & path, int permission)
 {
-       string temp(strip(os::slashify_path(path), '/'));
+       string temp(strip(os::slashify_path(path), "/"));
 
        if (temp.empty()) {
                Alert::alert(_("Internal error!"),
@@ -1022,7 +1022,7 @@ string const getExtFromContents(string const & filename)
        if (filename.empty() || !IsFileReadable(filename))
                return string();
 
-       
+
        ifstream ifs(filename.c_str());
        if (!ifs)
                // Couldn't open file...
@@ -1139,7 +1139,7 @@ string const getExtFromContents(string const & filename)
                else if (contains(str,"%!PS-Adobe")) {
                        // eps or ps
                        ifs >> str;
-                       if (contains(str,"EPSF")) 
+                       if (contains(str,"EPSF"))
                                format = "eps";
                        else
                            format = "ps";
@@ -1352,10 +1352,10 @@ string const findtexfile(string const & fil, string const & /*format*/)
        cmd_ret const c = RunCommand(kpsecmd);
 
        lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n"
-                << "kpse result = `" << strip(c.second, '\n')
+                << "kpse result = `" << strip(c.second, "\n")
                 << "'" << endl;
        if (c.first != -1)
-               return os::internal_path(strip(strip(c.second, '\n'), '\r'));
+               return os::internal_path(strip(strip(c.second, "\n"), "\r"));
        else
                return string();
 }
@@ -1376,10 +1376,10 @@ void removeAutosaveFile(string const & filename)
 }
 
 
-void readBB_lyxerrMessage(string const & file, bool & zipped, 
-       string const & message) 
+void readBB_lyxerrMessage(string const & file, bool & zipped,
+       string const & message)
 {
-       lyxerr[Debug::GRAPHICS] << "[readBB_from_PSFile] " 
+       lyxerr[Debug::GRAPHICS] << "[readBB_from_PSFile] "
                << message << std::endl;
        if (zipped)
                lyx::unlink(file);
@@ -1401,7 +1401,7 @@ string const readBB_from_PSFile(string const & file)
        string const format = getExtFromContents(file_);
 
        if (format != "eps" && format != "ps") {
-               readBB_lyxerrMessage(file_, zipped,"no(e)ps-format"); 
+               readBB_lyxerrMessage(file_, zipped,"no(e)ps-format");
                return string();
        }
 
index d5af3d18c11987d1a52965df6bdfdb5bb8e1d0b2..71efb395598c269f599cecd5fe8be33442a2ff19 100644 (file)
@@ -120,7 +120,7 @@ bool isStrInt(string const & str)
        if (str.empty()) return false;
 
        // Remove leading and trailing white space chars.
-       string const tmpstr = frontStrip(strip(str, ' '), ' ');
+       string const tmpstr = frontStrip(strip(str));
        if (tmpstr.empty()) return false;
 
        string::const_iterator cit = tmpstr.begin();
@@ -138,7 +138,7 @@ bool isStrUnsignedInt(string const & str)
        if (str.empty()) return false;
 
        // Remove leading and trailing white space chars.
-       string const tmpstr = frontStrip(strip(str, ' '), ' ');
+       string const tmpstr = frontStrip(strip(str));
        if (tmpstr.empty()) return false;
 
        string::const_iterator cit = tmpstr.begin();
@@ -154,7 +154,7 @@ int strToInt(string const & str)
 {
        if (isStrInt(str)) {
                // Remove leading and trailing white space chars.
-               string const tmpstr = frontStrip(strip(str, ' '), ' ');
+               string const tmpstr = frontStrip(strip(str));
                // Do the conversion proper.
                return lyx::atoi(tmpstr);
        } else {
@@ -167,7 +167,7 @@ unsigned int strToUnsignedInt(string const & str)
 {
        if (isStrUnsignedInt(str)) {
                // Remove leading and trailing white space chars.
-               string const tmpstr = frontStrip(strip(str, ' '), ' ');
+               string const tmpstr = frontStrip(strip(str));
                // Do the conversion proper.
                return lyx::atoi(tmpstr);
        } else {
@@ -181,7 +181,7 @@ bool isStrDbl(string const & str)
        if (str.empty()) return false;
 
        // Remove leading and trailing white space chars.
-       string const tmpstr = frontStrip(strip(str, ' '), ' ');
+       string const tmpstr = frontStrip(strip(str));
        if (tmpstr.empty()) return false;
        //      if (1 < tmpstr.count('.')) return false;
 
@@ -210,7 +210,7 @@ double strToDbl(string const & str)
 {
        if (isStrDbl(str)) {
                // Remove leading and trailing white space chars.
-               string const tmpstr = frontStrip(strip(str, ' '), ' ');
+               string const tmpstr = frontStrip(strip(str));
                // Do the conversion proper.
                return ::atof(tmpstr.c_str());
        } else {
@@ -371,22 +371,6 @@ bool suffixIs(string const & a, string const & suf)
 }
 
 
-bool contains(char const * a, string const & b)
-{
-       lyx::Assert(a);
-       string const at(a);
-       return contains(at, b);
-}
-
-
-bool contains(string const & a, char const * b)
-{
-       lyx::Assert(b);
-       string const bt(b);
-       return contains(a, bt);
-}
-
-
 bool contains(string const & a, string const & b)
 {
        if (a.empty())
@@ -403,45 +387,12 @@ bool contains(string const & a, char b)
 }
 
 
-bool contains(char const * a, char const * b)
-{
-       lyx::Assert(a && b);
-       string const at(a);
-       string const bt(b);
-       return contains(at, bt);
-}
-
-
-bool containsOnly(string const & s, char const * cset)
-{
-       lyx::Assert(cset);
-
-       return s.find_first_not_of(cset) == string::npos;
-}
-
-
 bool containsOnly(string const & s, string const & cset)
 {
        return s.find_first_not_of(cset) == string::npos;
 }
 
 
-bool containsOnly(char const * s, char const * cset)
-{
-       lyx::Assert(s && cset);
-
-       return string(s).find_first_not_of(cset) == string::npos;
-}
-
-
-bool containsOnly(char const * s, string const & cset)
-{
-       lyx::Assert(s);
-
-       return string(s).find_first_not_of(cset) == string::npos;
-}
-
-
 // ale970405+lasgoutt-970425
 // rewritten to use new string (Lgb)
 string const token(string const & a, char delim, int n)
@@ -543,23 +494,26 @@ string const subst(string const & a,
 }
 
 
-string const strip(string const & a, char c)
+string const strip(string const & a, char const * p)
 {
-       if (a.empty()) return a;
+       lyx::Assert(p);
+
+       if (a.empty() || !*p) return a;
        string tmp(a);
-       string::size_type i = tmp.find_last_not_of(c);
+       string::size_type i = tmp.find_last_not_of(p);
        if (i == a.length() - 1) return tmp; // no c's at end of a
        if (i != string::npos)
                tmp.erase(i + 1, string::npos);
 #if !defined(USE_INCLUDED_STRING) && !defined(STD_STRING_IS_GOOD)
+       // Ok This code is now suspect... (Lgb)
        /// Needed for broken string::find_last_not_of
-       else if (tmp[0] != c) {
+       else if (tmp[0] != p[0]) {
                if (a.length() == 1) return tmp;
                tmp.erase(1, string::npos);
        }
 #endif
        else
-               tmp.erase(); // only c in the whole string
+               tmp.erase(); // only chars from p in the whole string
        return tmp;
 }
 
@@ -577,17 +531,6 @@ string const frontStrip(string const & a, char const * p)
 }
 
 
-string const frontStrip(string const & a, char c)
-{
-       if (a.empty()) return a;
-       string tmp(a);
-       string::size_type i = tmp.find_first_not_of(c);
-       if (i > 0)
-               tmp.erase(0, i);
-       return tmp;
-}
-
-
 string const split(string const & a, string & piece, char delim)
 {
        string tmp;
index e20d0d80e588ec6bb1b9b4ebc07f8f9ae6f6d8e3..f47d592c83ab8fb9245b88355bce27c1ed75662f 100644 (file)
@@ -16,9 +16,6 @@
 #pragma interface
 #endif
 
-//#include <cstring>
-//#include <cctype>
-//#include <cctype>
 #include <vector>
 
 #include "Lsstream.h"
@@ -134,21 +131,12 @@ bool suffixIs(string const &, char const *);
 /// Does the string end with this suffix?
 bool suffixIs(string const &, string const &);
 
-///
-bool contains(char const * a, string const & b);
-
-///
-bool contains(string const & a, char const * b);
-
 ///
 bool contains(string const & a, string const & b);
 
 ///
 bool contains(string const & a, char b);
 
-///
-bool contains(char const * a, char const * b);
-
 /// This should probably we rewritten to be more general.
 class contains_functor {
 public:
@@ -162,18 +150,9 @@ public:
 };
 
 
-///
-bool containsOnly(string const &, char const *);
-
 ///
 bool containsOnly(string const &, string const &);
 
-///
-bool containsOnly(char const *, char const *);
-
-///
-bool containsOnly(char const *, string const &);
-
 /** Extracts a token from this string at the nth delim.
     Doesn't modify the original string. Similar to strtok.
     Example:
@@ -215,24 +194,17 @@ string const subst(string const & a,
 
 /** Strips characters off the end of a string.
     \code
-    "abccc".strip('c') = "ab".
-    \endcode
-*/
-string const strip(string const & a, char c = ' ');
-
-/** Strips characters of the beginning of a string.
-    \code
-    "cccba".frontstrip('c') = "ba"
+    strip("abccc", "c") == "ab".
     \endcode
 */
-string const frontStrip(string const & a, char c = ' ');
+string const strip(string const & a, char const * p = " ");
 
 /** Strips characters off the beginning of a string.
     \code
-    "ababcdef".frontstrip("ab") = "cdef"
+    frontstrip("ababcdef", "ab") = "cdef"
     \endcode
 */
-string const frontStrip(string const & a, char const * p);
+string const frontStrip(string const & a, char const * p = " ");
 
 /** Splits the string by the first delim.
     Splits the string by the first appearance of delim.
index 671afdd36ce28df069c27aa8270ee5480802449f..a998ac85c4c81eeb1a6b2855511ebccbe222edfd 100644 (file)
@@ -107,7 +107,7 @@ void RCS::scanMaster()
                        // get version here
                        string tmv;
                        ifs >> tmv;
-                       tmv = strip(tmv, ';');
+                       tmv = strip(tmv, ";");
                        version_ = tmv;
                        lyxerr[Debug::LYXVC] << "LyXVC: version found to be "
                                             << tmv << endl;
@@ -127,7 +127,7 @@ void RCS::scanMaster()
                        string s2;
                        do {
                                ifs >> tmpt;
-                               s1 = strip(tmpt, ';');
+                               s1 = strip(tmpt, ";");
                                // tmp is now in the format <user>:<version>
                                s1 = split(s1, s2, ':');
                                // s2 is user, and s1 is version
@@ -265,7 +265,7 @@ void CVS::scanMaster()
                        FileInfo fi(file_);
                        // FIXME: must double check file is stattable/existing
                        time_t mod = fi.getModificationTime();
-                       string mod_date = strip(asctime(gmtime(&mod)), '\n');
+                       string mod_date = strip(asctime(gmtime(&mod)), "\n");
                        lyxerr[Debug::LYXVC]
                                <<  "Date in Entries: `" << file_date
                                << "'\nModification date of file: `"