+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * vc-backend.C (scanMaster): ";" -> ';'
+
2004-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
* lyxtextclasslist.C (less_textclass_avail_desc): inherit from
- std::binary_function
+ std::binary_function
* lyxtextclass.C (compare_name): rename to...
(LayoutNamesEqual): ...this
(getConverter): use it, and make function const
(getNumber): use it, and make function const
(add): use it
- (erase): use it:
+ (erase): use it:
* bufferlist.C: add using boost::bind
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * biblio.C (parseBibTeX): "=" -> '='
+
2004-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
* biblio.C (RegexMatch): inherit from std::unary_function, make
// the \n and in the second we replace it
// with a space
if (!dummy.empty()) {
- if (!contains(dummy, "="))
+ if (!contains(dummy, '='))
data_ += ' ' + dummy;
else
data_ += dummy;
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * GFloat.C (update): "c" -> 'c' in calls to contains
+
2003-12-14 Michael Schmitt <michael.schmitt@teststep.org>
* Dialogs.C:
string placement(controller().params().placement);
- if (contains(placement, "H")) {
+ if (contains(placement, 'H')) {
forcehere = true;
} else {
- if (contains(placement, "t")) {
+ if (contains(placement, 't')) {
top = true;
}
- if (contains(placement, "b")) {
+ if (contains(placement, 'b')) {
bottom = true;
}
- if (contains(placement, "p")) {
+ if (contains(placement, 'p')) {
page = true;
}
- if (contains(placement, "h")) {
+ if (contains(placement, 'h')) {
here = true;
}
}
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * floatplacement.C (set): "c" -> 'c' in calls to contains
+
2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
* QPrefs.C: add using statement for std::distance
if (placement.empty()) {
def_placement = true;
- } else if (contains(placement, "H")) {
+ } else if (contains(placement, 'H')) {
here_definitely = true;
} else {
- if (contains(placement, "!")) {
+ if (contains(placement, '!')) {
force = true;
}
- if (contains(placement, "t")) {
+ if (contains(placement, 't')) {
top = true;
}
- if (contains(placement, "b")) {
+ if (contains(placement, 'b')) {
bottom = true;
}
- if (contains(placement, "p")) {
+ if (contains(placement, 'p')) {
page = true;
}
- if (contains(placement, "h")) {
+ if (contains(placement, 'h')) {
here = true;
}
}
{
int num = QComboBox::count();
for (int i = 0; i < num; i++) {
- if (QComboBox::text(i).contains("%") > 0) {
+ if (QComboBox::text(i).contains('%') > 0) {
QComboBox::removeItem(i);
i -= 1;
num -= 1;
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * FormFloat.C (update): "c" -> 'c' in calls to contains
+
+ * FormDocument.C (build): use boost::bind instead of bind2nd, use
+ contains<char> instead of contains_functor
+ * FormParagraph.C (build): ditto
+ * FormTabular.C (build): ditto
+ * FormVSpace.C (build): ditto
+
2004-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
* RadioButtonGroup.C (is_set_button): inherit from
#include "vspace.h"
#include "support/tostr.h"
-#include "support/lstrings.h" // contains_functor, getStringFromVector
+#include "support/lstrings.h" // contains, getStringFromVector
#include "support/filetools.h" // LibFileSearch
#include "lyx_xpm.h"
+#include <boost/bind.hpp>
+
#include <iomanip>
using lyx::support::bformat;
-using lyx::support::contains_functor;
+using lyx::support::contains;
using lyx::support::getStringFromVector;
using lyx::support::getVectorFromString;
using lyx::support::LibFileSearch;
-using std::bind2nd;
+using boost::bind;
+
using std::endl;
using std::string;
using std::vector;
vector<string>::iterator ret =
std::remove_if(units_vec.begin(),
units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind(contains<char>, _1, '%'));
units_vec.erase(ret, units_vec.end());
string const units = getStringFromVector(units_vec, "|");
fl_get_browser_line(branch_->browser_all_branches, i);
Branch * branch = branchlist_.find(current_branch);
-
+
if (branch && branch->setSelected(selected))
rebuild_selected_branches_browser();
string placement(controller().params().placement);
bool const wide = controller().params().wide;
- bool const here_definitely = contains(placement, "H");
+ bool const here_definitely = contains(placement, 'H');
- bool const top = contains(placement, "t");
- bool const bottom = contains(placement, "b");
- bool const page = contains(placement, "p");
- bool const here = contains(placement, "h");
- bool const force = contains(placement, "!");
+ bool const top = contains(placement, 't');
+ bool const bottom = contains(placement, 'b');
+ bool const page = contains(placement, 'p');
+ bool const here = contains(placement, 'h');
+ bool const force = contains(placement, '!');
bool const alternatives = top || bottom || page || (here && !wide);
if (alternatives) {
#include "lyx_forms.h"
-using lyx::support::contains_functor;
+#include <boost/bind.hpp>
+
+using lyx::support::contains;
using lyx::support::getStringFromVector;
using lyx::support::rtrim;
-using std::bind2nd;
+using boost::bind;
+
using std::remove_if;
using std::vector;
vector<string> units_vec = getLatexUnits();
vector<string>::iterator del =
remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind(contains<char>, _1, '%'));
units_vec.erase(del, units_vec.end());
// set default unit for custom length
#include "lyx_forms.h"
-using lyx::support::contains_functor;
+#include <boost/bind.hpp>
+
+using lyx::support::contains;
using lyx::support::getStringFromVector;
using lyx::support::isStrDbl;
-using std::bind2nd;
+using boost::bind;
+
using std::string;
using std::vector;
vector<string> units_vec = getLatexUnits();
vector<string>::iterator ret =
remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind(contains<char>, _1, '%'));
units_vec.erase(ret, units_vec.end());
string const units = getStringFromVector(units_vec, "|");
#include "lyx_forms.h"
-using lyx::support::contains_functor;
+#include <boost/bind.hpp>
+
+using lyx::support::contains;
using lyx::support::getStringFromVector;
using lyx::support::rtrim;
-using std::bind2nd;
+using boost::bind;
+
using std::remove_if;
using std::vector;
vector<string> units_vec = getLatexUnits();
vector<string>::iterator del =
remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind(contains<char>, _1, '%'));
units_vec.erase(del, units_vec.end());
string const units = getStringFromVector(units_vec, "|");
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * insetlatexaccent.C (checkContents): "c" -> 'c' in calls to contains
+
+ * insetfloat.C (validate): "H" -> 'H' in call to contains
+
+ * insetcite.C (getBasicLabel): "," -> ',' in calls to contains
2004-01-30 André Pönitz <poenitz@gmx.net>
* inset.[Ch]:
string keys(keyList);
string label;
- if (contains(keys, ",")) {
+ if (contains(keys, ',')) {
// Final comma allows while loop to cover all keys
keys = ltrim(split(keys, label, ',')) + ',';
- while (contains(keys, ",")) {
+ while (contains(keys, ',')) {
string key;
keys = ltrim(split(keys, key, ','));
label += ", " + key;
void InsetFloat::validate(LaTeXFeatures & features) const
{
- if (contains(params_.placement, "H")) {
+ if (contains(params_.placement, 'H')) {
features.require("float");
}
bool InsetFloat::insetAllowed(InsetOld::Code code) const
{
return code != InsetOld::FLOAT_CODE
- && code != InsetOld::FOOT_CODE
+ && code != InsetOld::FOOT_CODE
&& code != InsetOld::MARGIN_CODE;
}
// REMOVE IN 0.13
// Dirty Hack for backward compability. remove in 0.13 (Lgb)
contents = trim(contents);
- if (!contains(contents, "{") && !contains(contents, "}")) {
+ if (!contains(contents, '{') && !contains(contents, '}')) {
if (contents.length() == 2) {
string tmp;
tmp += contents[0];
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * lstrings.h (contains_functor): delete
+ (contains): change into template, simplify
+
+ * lstrings.C (contains): remove both functions
+
2004-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
* lyxalgo.h (eliminate_duplicates): reimplement with sort and the
unique-erase idom.
* lstrings.h (contains_functor): inherit from
- std::binary_function, remove typedefs.
+ std::binary_function, remove typedefs.
2004-01-28 Lars Gullik Bjonnes <larsbj@gullik.net>
}
-bool contains(string const & a, string const & b)
-{
- if (a.empty())
- return false;
- return a.find(b) != string::npos;
-}
-
-
-bool contains(string const & a, char b)
-{
- if (a.empty())
- return false;
- return a.find(b) != string::npos;
-}
-
-
bool containsOnly(string const & s, string const & cset)
{
return s.find_first_not_of(cset) == string::npos;
bool suffixIs(std::string const &, std::string const &);
///
-bool contains(std::string const & a, std::string const & b);
-
-///
-bool contains(std::string const & a, char b);
-
-/// This should probably we rewritten to be more general.
-struct contains_functor
- : public std::binary_function<std::string, std::string, bool>
+template <typename B>
+bool contains(std::string const & a, B b)
{
- bool operator()(std::string const & haystack,
- std::string const & needle) const
- {
- return contains(haystack, needle);
- }
-};
-
+ return a.find(b) != std::string::npos;
+}
///
bool containsOnly(std::string const &, std::string const &);
+2004-02-01 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * text.C (parse_box): "\\" -> '\\' in calls to contains.
+
2004-01-07 Lars Gullik Bjonnes <larsbj@gullik.net>
* text.C: reorder the using statements.
string width_unit;
string const latex_width = p.verbatim_item();
translate_len(latex_width, width_value, width_unit);
- if (contains(width_unit, "\\") || contains(height_unit, "\\")) {
+ if (contains(width_unit, '\\') || contains(height_unit, '\\')) {
// LyX can't handle length variables
ostringstream ss;
if (use_parbox)
// nothing
} else if (contains(token, "locks")) {
// get locker here
- if (contains(token, ";")) {
+ if (contains(token, ';')) {
locker_ = "Unlocked";
vcstatus = UNLOCKED;
continue;
vcstatus = LOCKED;
break;
}
- } while (!contains(tmpt, ";"));
+ } while (!contains(tmpt, ';'));
} else if (token == "comment") {
// we don't need to read any further than this.