]> git.lyx.org Git - features.git/commitdiff
small fixes...
authorAngus Leeming <leeming@lyx.org>
Wed, 1 Aug 2001 15:22:01 +0000 (15:22 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 1 Aug 2001 15:22:01 +0000 (15:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2400 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlInset.h
src/frontends/controllers/helper_funcs.C

index 97f2b422c36c09d346d9f35f4522c70a5574d38e..e0a406165c289a3ecc3576c17911fc2f078c75ea 100644 (file)
@@ -1,3 +1,10 @@
+2001-08-01  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * ControlInset.h: const and non-const forms of params().
+
+       * helper_funcs.C (getStringFromVector,getVectorFromString): remove
+       whitespace from either side of each item.
+
 2001-07-30  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * ControlFloat.h: add a != operator for FloatParams.
index ec1cad30101ad45e3c9fafa74efbb929267169fe..8ef34e543d272ded08f058aa95d380012c3df47c 100644 (file)
@@ -31,7 +31,9 @@ public:
        ///
        ControlInset(LyXView &, Dialogs &);
        /// Allow the View access to the local copy.
-       Params & params() const;
+       Params & params();
+       ///
+       Params const & params() const;
 
 protected:
        /// Slots connected in the daughter classes c-tor.
@@ -186,7 +188,15 @@ void ControlInset<Inset, Params>::apply()
 
 
 template <class Inset, class Params>
-Params & ControlInset<Inset, Params>::params() const
+Params & ControlInset<Inset, Params>::params()
+{
+       lyx::Assert(params_);
+       return *params_;
+}
+
+
+template <class Inset, class Params>
+Params  const & ControlInset<Inset, Params>::params() const
 {
        lyx::Assert(params_);
        return *params_;
index 341dcd78eacd38451f9086489aa873ece989cd35..d0db5a923fcbd1a61d86a7e2fc2775653b12f71f 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "frontends/FileDialog.h"
 #include "support/filetools.h" // OnlyPath, OnlyFilename
+#include "support/lstrings.h"
 #include "gettext.h" // _()
 #include "lyx_gui_misc.h" // WriteAlert
 
@@ -38,10 +39,11 @@ string const getStringFromVector(vector<string> const & vec,
        int i = 0;
        for (vector<string>::const_iterator it = vec.begin();
             it != vec.end(); ++it) {
-               if (it->empty()) continue;
+               string item = strip(frontStrip(*it));
+               if (item.empty()) continue;
 
                if (i++ > 0) str += delim;
-               str += *it;
+               str += item;
        }
        return str;
 }
@@ -53,16 +55,17 @@ vector<string> const getVectorFromString(string const & str,
        if (str.empty())
                return vec;
 
-       string keys(str);
+       string keys(strip(str));
 
        for(;;) {
                string::size_type const idx = keys.find(delim);
                if (idx == string::npos) {
+                       string const key = frontStrip(keys);
                        vec.push_back(keys);
                        break;
                }
 
-               string const key = keys.substr(0, idx);
+               string const key = strip(frontStrip(keys.substr(0, idx)));
                if (!key.empty())
                        vec.push_back(key);