From 63a7d2f93c0c7dfd8d28f1d87e1cb93dce3ecc41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 27 May 2003 20:59:03 +0000 Subject: [PATCH] parlist-22-a.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7055 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ParagraphList.C | 13 ------------- src/ParagraphList.h | 2 -- src/paragraph.C | 7 +++++++ src/paragraph.h | 2 ++ src/text.C | 4 +++- src/text2.C | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/ParagraphList.C b/src/ParagraphList.C index d9884aa316..0c70bee13d 100644 --- a/src/ParagraphList.C +++ b/src/ParagraphList.C @@ -315,17 +315,4 @@ bool ParagraphList::empty() const return parlist == 0; } - -ParagraphList::iterator ParagraphList::find(Paragraph const & p) -{ - iterator it = begin(); - iterator last = end(); - for (;it != last; ++it) { - if (&*it == &p) - break; - } - return it; -} - - #endif diff --git a/src/ParagraphList.h b/src/ParagraphList.h index a4bba61552..649106e757 100644 --- a/src/ParagraphList.h +++ b/src/ParagraphList.h @@ -99,8 +99,6 @@ public: int size() const; /// bool empty() const; - /// - iterator find(Paragraph const &); private: /// Paragraph * parlist; diff --git a/src/paragraph.C b/src/paragraph.C index d3076b71ec..20ced3064f 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1396,3 +1396,10 @@ bool Paragraph::isFreeSpacing() const return (pimpl_->inset_owner->owner()->lyxCode() == Inset::ERT_CODE); return false; } + + +bool operator==(Paragraph const & lhs, Paragraph const & rhs) +{ +#warning FIXME this implementatoin must be completely wrong... + return &lhs == &rhs; +} diff --git a/src/paragraph.h b/src/paragraph.h index c96bde6512..5abcaf4d78 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -337,4 +337,6 @@ inline bool isDeletedText(Paragraph const & par, lyx::pos_type pos) return par.lookupChange(pos) == Change::DELETED; } +bool operator==(Paragraph const & lhs, Paragraph const & rhs); + #endif // PARAGRAPH_H diff --git a/src/text.C b/src/text.C index 1e7e38d760..2de8e85e18 100644 --- a/src/text.C +++ b/src/text.C @@ -147,7 +147,9 @@ int LyXText::workWidth() const int LyXText::workWidth(Inset const * inset) const { - ParagraphList::iterator par = ownerParagraphs().find(*inset->parOwner()); + ParagraphList::iterator par = std::find(ownerParagraphs().begin(), + ownerParagraphs().end(), + *inset->parOwner()); //lyx::Assert(par); pos_type pos = par->getPositionOfInset(inset); diff --git a/src/text2.C b/src/text2.C index dc33e0a4e9..55a7b7c20d 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1197,7 +1197,7 @@ void LyXText::setCounter(Buffer const * buf, ParagraphList::iterator pit) isOK = true; break; } else { - tmppit = ownerParagraphs().find(*in->parOwner()); + tmppit = std::find(ownerParagraphs().begin(), ownerParagraphs().end(), *in->parOwner()); } } -- 2.39.2