+2004-03-24 Angus Leeming <leeming@lyx.org>
+
+ 64-bit compile fixes.
+
+ * errorlist.[Ch] (pos_start, pos_end): store as lyx::pos_type.
+ (c-tor): pass lyx::pos_types rather than ints.
+
+ * paragraph.[Ch] (beginOfBody, begin_of_body_): return, store as
+ lyx::pos_type.
+
+ * text.C (Delete): compile fix.
+ (getPar): ensure that function declaration is the same as that in
+ the header file.
+
2004-03-23 Angus Leeming <leeming@lyx.org>
* ispell.C (LaunchIspell):
#include "errorlist.h"
+using lyx::pos_type;
using std::string;
-ErrorItem::ErrorItem(string const & error, string const & description,
- int par_id, int pos_start, int pos_end)
- : error(error), description(description), par_id(par_id),
- pos_start(pos_start), pos_end(pos_end)
+ErrorItem::ErrorItem(string const & error_, string const & description_,
+ int par_id_, pos_type pos_start_, pos_type pos_end_)
+ : error(error_), description(description_), par_id(par_id_),
+ pos_start(pos_start_), pos_end(pos_end_)
{}
#ifndef ERRORLIST_H
#define ERRORLIST_H
+#include "support/types.h"
+
#include <vector>
#include <string>
std::string error;
std::string description;
int par_id;
- int pos_start;
- int pos_end;
+ lyx::pos_type pos_start;
+ lyx::pos_type pos_end;
ErrorItem(std::string const & error, std::string const & description,
- int parid, int posstart, int posend);
+ int parid, lyx::pos_type posstart, lyx::pos_type posend);
ErrorItem();
};
+2004-03-24 Angus Leeming <leeming@lyx.org>
+
+ 64-bit compile fixes.
+
+ * ControlErrorList.C (goTo): use lyx::pos_type as type of
+ temporary vars.
+
+ * ControlSpellchecker.C (nextWord): pass progress as a
+ PosIterator::difference_type, not an int.
+
2004-03-17 Angus Leeming <leeming@lyx.org>
* ControlForks.[Ch]: removed.
return;
}
- int const end = std::min(err.pos_end, pit->size());
- int const start = std::min(err.pos_start, end);
- int const range = end - start;
+ lyx::pos_type const end = std::min(err.pos_end, pit->size());
+ lyx::pos_type const start = std::min(err.pos_start, end);
+ lyx::pos_type const range = end - start;
// Now make the selection.
PosIterator const pos(pit, start);
WordLangTuple nextWord(PosIterator & cur, PosIterator const & end,
- int & progress, BufferParams & bp)
+ PosIterator::difference_type & progress,
+ BufferParams & bp)
{
// skip until we have real text (will jump paragraphs)
for (; cur != end && !isLetter(cur); ++cur, ++progress);
}
-int Paragraph::beginOfBody() const
+pos_type Paragraph::beginOfBody() const
{
return begin_of_body_;
}
/// the paragraph alongside the text of the rest of the paragraph
/// (the body). This function returns the starting position of the
/// body of the text in the paragraph.
- int beginOfBody() const;
+ lyx::pos_type beginOfBody() const;
/// recompute this value
void setBeginOfBody();
// for average tasks as buffer loading/switching etc.
TextContainer text_;
/// end of label
- int begin_of_body_;
+ lyx::pos_type begin_of_body_;
struct Pimpl;
///
CursorSlice sl = cur.top();
cursorRight(cur);
if (sl == cur.top()) {
- recordUndo(cur, Undo::DELETE, cur.par(), max(0, cur.par() - 1));
+ recordUndo(cur, Undo::DELETE, cur.par(),
+ max(par_type(0), cur.par() - 1));
backspace(cur);
}
}
}
-ParagraphList::iterator LyXText::getPar(int par) const
+ParagraphList::iterator LyXText::getPar(par_type par) const
{
//lyxerr << "getPar: " << par << " from " << paragraphs().size() << endl;
BOOST_ASSERT(par >= 0);