Fixes for a broken std::count.

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
This commit is contained in:
Angus Leeming 2002-01-11 17:57:02 +00:00
parent d062eda8e5
commit 44806c63f9
8 changed files with 32 additions and 12 deletions

View 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);

View 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:

View 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.

View 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)

View File

@ -10,6 +10,7 @@
#include "math_support.h"
#include "lyxrc.h"
MathKernInset::MathKernInset()
{}

View 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;
}

View 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);

View 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;
}