obvious stuff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8851 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2004-07-25 00:04:42 +00:00
parent c499bd1698
commit e34a1e90af
13 changed files with 54 additions and 42 deletions

View File

@ -1,3 +1,16 @@
2004-07-25 Lars Gullik Bjonnes <larsbj@gullik.net>
* lyxlex_pimpl.C (compare_tags): chagne return type of operator()
to bool.
* converter.C (showMessage): inherit from unary_function, make
operator() const.
* buffer.C (writeFile): initialize retval
* InsetList.h: rename private variable list to list_
* InsetList.[Ch]: adjust accordingly.
2004-07-24 Lars Gullik Bjonnes <larsbj@gullik.net>
* text3.C, text2.C, text.C, tabular.C, paragraph_funcs.C, paragraph.C:

View File

@ -46,8 +46,8 @@ InsetList::~InsetList()
{
// If we begin storing a shared_ptr in the List
// this code can be removed. (Lgb)
List::iterator it = list.begin();
List::iterator end = list.end();
List::iterator it = list_.begin();
List::iterator end = list_.end();
for (; it != end; ++it) {
delete it->inset;
}
@ -57,7 +57,7 @@ InsetList::~InsetList()
InsetList::iterator InsetList::insetIterator(pos_type pos)
{
InsetTable search_elem(pos, 0);
return lower_bound(list.begin(), list.end(), search_elem,
return lower_bound(list_.begin(), list_.end(), search_elem,
InsetTablePosLess());
}
@ -65,38 +65,38 @@ InsetList::iterator InsetList::insetIterator(pos_type pos)
InsetList::const_iterator InsetList::insetIterator(pos_type pos) const
{
InsetTable search_elem(pos, 0);
return lower_bound(list.begin(), list.end(), search_elem,
return lower_bound(list_.begin(), list_.end(), search_elem,
InsetTablePosLess());
}
void InsetList::insert(InsetBase * inset, lyx::pos_type pos)
{
List::iterator end = list.end();
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
if (it != end && it->pos == pos) {
lyxerr << "ERROR (InsetList::insert): "
<< "There is an inset in position: " << pos << endl;
} else {
list.insert(it, InsetTable(pos, inset));
list_.insert(it, InsetTable(pos, inset));
}
}
void InsetList::erase(pos_type pos)
{
List::iterator end = list.end();
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
if (it != end && it->pos == pos) {
delete it->inset;
list.erase(it);
list_.erase(it);
}
}
InsetBase * InsetList::release(pos_type pos)
{
List::iterator end = list.end();
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
if (it != end && it->pos == pos) {
InsetBase * tmp = it->inset;
@ -109,7 +109,7 @@ InsetBase * InsetList::release(pos_type pos)
InsetBase * InsetList::get(pos_type pos) const
{
List::const_iterator end = list.end();
List::const_iterator end = list_.end();
List::const_iterator it = insetIterator(pos);
if (it != end && it->pos == pos)
return it->inset;
@ -119,7 +119,7 @@ InsetBase * InsetList::get(pos_type pos) const
void InsetList::increasePosAfterPos(pos_type pos)
{
List::iterator end = list.end();
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
for (; it != end; ++it) {
++it->pos;
@ -129,7 +129,7 @@ void InsetList::increasePosAfterPos(pos_type pos)
void InsetList::decreasePosAfterPos(pos_type pos)
{
List::iterator end = list.end();
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
for (; it != end; ++it) {
--it->pos;

View File

@ -42,15 +42,15 @@ public:
///
~InsetList();
///
iterator begin() { return list.begin(); }
iterator begin() { return list_.begin(); }
///
iterator end() { return list.end(); }
iterator end() { return list_.end(); }
///
const_iterator begin() const { return list.begin(); }
const_iterator begin() const { return list_.begin(); }
///
const_iterator end() const { return list.end(); }
const_iterator end() const { return list_.end(); }
///
bool empty() const { return list.empty(); }
bool empty() const { return list_.empty(); }
///
iterator insetIterator(lyx::pos_type pos);
///
@ -70,7 +70,7 @@ public:
private:
///
List list;
List list_;
};
#endif

View File

@ -751,7 +751,7 @@ bool Buffer::writeFile(string const & fname) const
if (finfo.exist() && !finfo.writable())
return false;
bool retval;
bool retval = false;
if (params().compressed) {
gz::ogzstream ofs(fname.c_str());
@ -852,6 +852,7 @@ void Buffer::makeLaTeXFile(ostream & os,
lyxerr[Debug::LATEX] << " Buffer validation done." << endl;
texrow().reset();
// The starting paragraph of the coming rows is the
// first paragraph of the document. (Asger)
texrow().start(paragraphs().begin()->id(), 0);

View File

@ -512,10 +512,10 @@ bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
namespace {
class showMessage : public boost::signals::trackable {
class showMessage : public std::unary_function<string, void>, public boost::signals::trackable {
public:
showMessage(Buffer const & b) : buffer_(b) {};
void operator()(string const & m)
void operator()(string const & m) const
{
buffer_.message(m);
}

View File

@ -3,8 +3,7 @@
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author unknown
* \author Lars Gullik Bjønnes
* \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/

View File

@ -1,3 +1,7 @@
2004-07-25 Lars Gullik Bjonnes <larsbj@gullik.net>
* ControlErrorList.C (goTo): shuffle code to avoid compiler warning.
2004-07-24 Lars Gullik Bjonnes <larsbj@gullik.net>
* biblio.C, ControlPrefs.C, ControlParagraph.C:

View File

@ -68,16 +68,15 @@ void ControlErrorList::goTo(int item)
return;
}
pos_type const end = std::min(err.pos_end, pit->size());
pos_type const start = std::min(err.pos_start, end);
pos_type const range = end - start;
// Now make the selection.
#ifdef WITH_WARNINGS
#warning FIXME (goto error)
#warning This should be implemented using an LFUN. (Angus)
#endif
#if 0
pos_type const end = std::min(err.pos_end, pit->size());
pos_type const start = std::min(err.pos_start, end);
pos_type const range = end - start;
PosIterator const pos(pit, start);
kernel().bufferview()->putSelectionAt(pos, range, false);
#endif

View File

@ -37,9 +37,11 @@ using std::ostream;
namespace {
struct compare_tags : public std::binary_function<keyword_item, keyword_item, int> {
struct compare_tags
: public std::binary_function<keyword_item, keyword_item, bool> {
// used by lower_bound, sort and sorted
int operator()(keyword_item const & a, keyword_item const & b) const {
bool operator()(keyword_item const & a, keyword_item const & b) const
{
// we use the ascii version, because in turkish, 'i'
// is not the lowercase version of 'I', and thus
// turkish locale breaks parsing of tags.

View File

@ -23,9 +23,6 @@
#include <stack>
#ifdef HAVE_LOCALE
#endif
using std::ostream;
using std::stack;
using std::vector;

View File

@ -25,9 +25,6 @@
#include "support/gzstream.h"
#include "support/lstrings.h"
#ifdef HAVE_LOCALE
#endif
using lyx::support::ascii_lowercase;
using lyx::support::compare_ascii_no_case;
using lyx::support::compare_no_case;

View File

@ -1765,7 +1765,7 @@ void LyXText::redoParagraphInternal(par_type pit)
void LyXText::redoParagraphs(par_type pit, par_type end)
{
for ( ; pit != end; ++pit)
for (; pit != end; ++pit)
redoParagraphInternal(pit);
updateParPositions();
updateCounters();
@ -1839,7 +1839,7 @@ bool LyXText::isFirstRow(par_type pit, Row const & row) const
void LyXText::getWord(CursorSlice & from, CursorSlice & to,
word_location const loc)
{
Paragraph & from_par = pars_[from.par()];
Paragraph const & from_par = pars_[from.par()];
switch (loc) {
case lyx::WHOLE_WORD_STRICT:
if (from.pos() == 0 || from.pos() == from_par.size()
@ -1895,7 +1895,7 @@ bool LyXText::read(Buffer const & buf, LyXLex & lex)
while (lex.isOK()) {
lex.nextToken();
string token = lex.getString();
string const token = lex.getString();
if (token.empty())
continue;
@ -2025,8 +2025,8 @@ int LyXText::cursorX(CursorSlice const & cur) const
int LyXText::cursorY(CursorSlice const & cur) const
{
Paragraph & par = getPar(cur.par());
Row & row = *par.getRow(cur.pos());
Paragraph const & par = getPar(cur.par());
Row const & row = *par.getRow(cur.pos());
return yo_ + par.y + row.y_offset() + row.baseline();
}

View File

@ -195,10 +195,10 @@ InsetBase * LyXText::checkInsetHit(int x, int y)
lyxerr << "checkInsetHit: x: " << x << " y: " << y << endl;
lyxerr << " pit: " << pit << " end: " << end << endl;
for ( ; pit != end; ++pit) {
for (; pit != end; ++pit) {
InsetList::iterator iit = pars_[pit].insetlist.begin();
InsetList::iterator iend = pars_[pit].insetlist.end();
for ( ; iit != iend; ++iit) {
for (; iit != iend; ++iit) {
InsetBase * inset = iit->inset;
#if 0
lyxerr << "examining inset " << inset