]> git.lyx.org Git - features.git/commitdiff
Fixes for a broken std::count.
authorAngus Leeming <leeming@lyx.org>
Fri, 11 Jan 2002 17:57:02 +0000 (17:57 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 11 Jan 2002 17:57:02 +0000 (17:57 +0000)
A couple of white-space type changes in mathed.

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

src/BufferView2.C
src/ChangeLog
src/mathed/ChangeLog
src/mathed/math_exfuncinset.C
src/mathed/math_kerninset.C
src/mathed/math_mathmlstream.C
src/mathed/math_parser.C
src/mathed/math_streamstr.C

index 7bdda14a64331c48a76ad5896b6e4f6514771b29..0eb2b4611c5383658a03560990f4ed5e7af8a4cc 100644 (file)
@@ -590,7 +590,10 @@ bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
 {
        // Check if the label 'from' appears more than once
        vector<string> labels = buffer()->getLabelList();
-       if (count(labels.begin(), labels.end(), from) > 1)
+       // count is broken on some systems, so use the HP version
+       int res;
+       count(labels.begin(), labels.end(), from, res);
+       if (res > 1)
                return false;
 
        return ChangeInsets(Inset::REF_CODE, from, to);
index 54c59f98f5391d348d9f37fd5a90d86b9ff6458d..64d60bb3ef186ee3d91fdf6d8616168e1cbb0cde 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * BufferView2.C (ChangeRefsIfUnique): use the HP version of std::count
+       as the other one is broken on my machine!
+
 2002-01-10  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * commandtags.h:
index bd7ca57973660a2eeeac59cd7ba4629d7c48539e..10b8e7ae89ef0fbdc1bbfbe21bc1bb631f452b10 100644 (file)
@@ -1,3 +1,14 @@
+2002-01-11  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * math_exfuncinset.C: remove using std::ostream declaration.
+
+       * math_kerninset.C: whitespace change, consistent with other files.
+
+       * math_mathmlstream.C (operator<<):
+       * math_streamstr.C (operator<<): use countChar rather than std::count.
+
+       * math_parser.C (operator==): comment out. Not used.
+
 2002-01-10  Martin Vermeer  <martin.vermeer@hut.fi>
 
        * formulabase.C (localDispatch): handle LFUN_FRAK and LFUN_ITAL.
index c258e2b0b3f5df2f531fbe90ac2fdfdfb60b71aa..10175f52c9551e3c4087eb4665a5173f4a93ce1b 100644 (file)
@@ -5,8 +5,6 @@
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
-using std::ostream;
-
 
 MathExFuncInset::MathExFuncInset(string const & name)
        : MathNestInset(1), name_(name)
index 5fe1d030a6de69e67f0b0185177ba539465eef41..ae853e35b718e3544e0119d2074d2fa65e70be92 100644 (file)
@@ -10,6 +10,7 @@
 #include "math_support.h"
 #include "lyxrc.h"
 
+
 MathKernInset::MathKernInset()
 {}
 
index 8aed771f0bdc8582c436b38360d60fdae2f98a81..ba77e722844667c58acfd557935b7d063178c21e 100644 (file)
@@ -4,6 +4,7 @@
 #include "math_inset.h"
 #include "math_extern.h"
 #include "debug.h"
+#include "support/lstrings.h"
 
 #include <algorithm>
 
@@ -221,7 +222,7 @@ WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
 WriteStream & operator<<(WriteStream & ws, char const * s)
 {
        ws.os() << s;
-       ws.addlines(std::count(s, s + strlen(s), '\n'));
+       ws.addlines(int(countChar(s, '\n')));
        return ws;
 }
 
index 98940b4537ccd53da89cda5bb27680a899370b0e..5c7b4b4a8391f62e0495e5f833d8ab6dfcd29499 100644 (file)
@@ -213,13 +213,13 @@ string Token::asString() const
        return cs_.size() ? cs_ : string(1, char_);
 }
 
-bool operator==(Token const & s, Token const & t)
-{
-       return s.character() == t.character()
-               && s.cat() == t.cat() && s.cs() == t.cs(); 
-}
-
-// Angus' compiler says this is not needed
+// Angus' compiler says these are not needed
+//bool operator==(Token const & s, Token const & t)
+//{
+//     return s.character() == t.character()
+//             && s.cat() == t.cat() && s.cs() == t.cs(); 
+//}
+//
 //bool operator!=(Token const & s, Token const & t)
 //{
 //     return !(s == t);
index 6e47e2b5727c77ff5e81c471c617144934a177d2..fd14d8fc6bc22eab1c2d6a63ee3e16ac5fa017ec 100644 (file)
@@ -3,6 +3,7 @@
 #include "math_streamstr.h"
 #include "math_mathmlstream.h"
 #include "support/LOstream.h"
+#include "support/lstrings.h"
 
 #include <algorithm>
 
@@ -10,7 +11,7 @@
 WriteStream & operator<<(WriteStream & ws, string const & s)
 {
        ws.os() << s;
-       ws.addlines(std::count(s.begin(), s.end(), '\n'));
+       ws.addlines(int(countChar(s, '\n')));
        return ws;
 }