+2003-02-22 John Levon <levon@movementarian.org>
+
+ * toc.h:
+ * toc.C: make TocItem store an id not a Paragraph *
+ (bug #913)
+
2003-02-21 Angus Leeming <leeming@lyx.org>
* BufferView_pimpl.C (MenuInsertLyXFile):
+2003-02-22 John Levon <levon@movementarian.org>
+
+ * insetfloat.C:
+ * insetwrap.C: TocItem changed API (bug 913)
+
2003-02-21 Angus Leeming <leeming@lyx.org>
* updatableinset.h (setView, view): remove.
string const str =
tostr(toclist[name].size() + 1)
+ ". " + tmp->asString(buf, false);
- toc::TocItem const item(tmp, 0 , str);
+ toc::TocItem const item(tmp->id(), 0 , str);
toclist[name].push_back(item);
}
}
string const str =
tostr(toclist[name].size() + 1)
+ ". " + tmp->asString(buf, false);
- toc::TocItem const item(tmp, 0 , str);
+ toc::TocItem const item(tmp->id(), 0 , str);
toclist[name].push_back(item);
}
tmp = tmp->next();
void TocItem::goTo(LyXView & lv_) const
{
- string const tmp = tostr(par->id());
+ string const tmp = tostr(id_);
lv_.dispatch(FuncRequest(LFUN_GOTO_PARAGRAPH, tmp));
}
int TocItem::action() const
{
return lyxaction.getPseudoAction(LFUN_GOTO_PARAGRAPH,
- tostr(par->id()));
+ tostr(id_));
}
&& labeltype <= LABEL_COUNTER_CHAPTER + buf->params.tocdepth) {
// insert this into the table of contents
const int depth = max(0, labeltype - textclass.maxcounter());
- TocItem const item(par, depth,
+ TocItem const item(par->id(), depth,
par->asString(buf, true));
toclist["TOC"].push_back(item);
}
///
struct TocItem {
- TocItem(Paragraph const * p, int d, string const & s)
- : par(p), depth(d), str(s) {}
+ TocItem(int par_id, int d, string const & s)
+ : id_(par_id), depth(d), str(s) {}
///
string const asString() const;
/// set cursor in LyXView to this TocItem
void goTo(LyXView & lv_) const;
/// the action corresponding to the goTo above
int action() const;
- ///
- Paragraph const * par;
- ///
+ /// Paragraph ID containing this item
+ int id_;
+ /// nesting depth
int depth;
///
string str;
by ControlToc::getContents() */
string const getType(string const & cmdName);
-///
inline
bool operator==(TocItem const & a, TocItem const & b)
{
- return a.par == b.par && a.str == b.str;
+ return a.id_ == b.id_ && a.str == b.str;
// No need to compare depth.
}
-///
inline
bool operator!=(TocItem const & a, TocItem const & b)
{
return !(a == b);
- // No need to compare depth.
}