mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
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:
parent
d062eda8e5
commit
44806c63f9
@ -590,7 +590,10 @@ bool BufferView::ChangeRefsIfUnique(string const & from, string const & to)
|
|||||||
{
|
{
|
||||||
// Check if the label 'from' appears more than once
|
// Check if the label 'from' appears more than once
|
||||||
vector<string> labels = buffer()->getLabelList();
|
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 false;
|
||||||
|
|
||||||
return ChangeInsets(Inset::REF_CODE, from, to);
|
return ChangeInsets(Inset::REF_CODE, from, to);
|
||||||
|
@ -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>
|
2002-01-10 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
* commandtags.h:
|
* commandtags.h:
|
||||||
|
@ -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>
|
2002-01-10 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
* formulabase.C (localDispatch): handle LFUN_FRAK and LFUN_ITAL.
|
* formulabase.C (localDispatch): handle LFUN_FRAK and LFUN_ITAL.
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include "math_mathmlstream.h"
|
#include "math_mathmlstream.h"
|
||||||
#include "math_streamstr.h"
|
#include "math_streamstr.h"
|
||||||
|
|
||||||
using std::ostream;
|
|
||||||
|
|
||||||
|
|
||||||
MathExFuncInset::MathExFuncInset(string const & name)
|
MathExFuncInset::MathExFuncInset(string const & name)
|
||||||
: MathNestInset(1), name_(name)
|
: MathNestInset(1), name_(name)
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "math_support.h"
|
#include "math_support.h"
|
||||||
#include "lyxrc.h"
|
#include "lyxrc.h"
|
||||||
|
|
||||||
|
|
||||||
MathKernInset::MathKernInset()
|
MathKernInset::MathKernInset()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "math_inset.h"
|
#include "math_inset.h"
|
||||||
#include "math_extern.h"
|
#include "math_extern.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "support/lstrings.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -221,7 +222,7 @@ WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
|
|||||||
WriteStream & operator<<(WriteStream & ws, char const * s)
|
WriteStream & operator<<(WriteStream & ws, char const * s)
|
||||||
{
|
{
|
||||||
ws.os() << s;
|
ws.os() << s;
|
||||||
ws.addlines(std::count(s, s + strlen(s), '\n'));
|
ws.addlines(int(countChar(s, '\n')));
|
||||||
return ws;
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,13 +213,13 @@ string Token::asString() const
|
|||||||
return cs_.size() ? cs_ : string(1, char_);
|
return cs_.size() ? cs_ : string(1, char_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(Token const & s, Token const & t)
|
// 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();
|
// return s.character() == t.character()
|
||||||
}
|
// && s.cat() == t.cat() && s.cs() == t.cs();
|
||||||
|
//}
|
||||||
// Angus' compiler says this is not needed
|
//
|
||||||
//bool operator!=(Token const & s, Token const & t)
|
//bool operator!=(Token const & s, Token const & t)
|
||||||
//{
|
//{
|
||||||
// return !(s == t);
|
// return !(s == t);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "math_streamstr.h"
|
#include "math_streamstr.h"
|
||||||
#include "math_mathmlstream.h"
|
#include "math_mathmlstream.h"
|
||||||
#include "support/LOstream.h"
|
#include "support/LOstream.h"
|
||||||
|
#include "support/lstrings.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -10,7 +11,7 @@
|
|||||||
WriteStream & operator<<(WriteStream & ws, string const & s)
|
WriteStream & operator<<(WriteStream & ws, string const & s)
|
||||||
{
|
{
|
||||||
ws.os() << s;
|
ws.os() << s;
|
||||||
ws.addlines(std::count(s.begin(), s.end(), '\n'));
|
ws.addlines(int(countChar(s, '\n')));
|
||||||
return ws;
|
return ws;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user