]> git.lyx.org Git - features.git/commitdiff
parlist-22-a.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 27 May 2003 20:59:03 +0000 (20:59 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 27 May 2003 20:59:03 +0000 (20:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7055 a592a061-630c-0410-9148-cb99ea01b6c8

src/ParagraphList.C
src/ParagraphList.h
src/paragraph.C
src/paragraph.h
src/text.C
src/text2.C

index d9884aa316113f488c025be60e1e72299bd65274..0c70bee13d0c03bfdcd698cd59dfffa9449103ef 100644 (file)
@@ -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
index a4bba61552756bdcc2276293731e5dc82c29ac12..649106e757117e2ccce30659669c064ec3464dad 100644 (file)
@@ -99,8 +99,6 @@ public:
        int size() const;
        ///
        bool empty() const;
-       ///
-       iterator find(Paragraph const &);
 private:
        ///
        Paragraph * parlist;
index d3076b71ecb5a6c46f83af24044aac93278da684..20ced3064f5c3c1392f988e40e2d2a207272a7b1 100644 (file)
@@ -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;
+}
index c96bde65128efbfebfb8901ab206c63862e4787a..5abcaf4d78324cabf8c451763d6b3b8de4d84d00 100644 (file)
@@ -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
index 1e7e38d7602c7179f0c966a90e716c85e99718f4..2de8e85e18b22b1b101f6c723b249210cd9bd0e6 100644 (file)
@@ -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);
index dc33e0a4e99a887b433270a046f7ccb1015967a9..55a7b7c20d50fc46fda361e81922d4dcbba5e1bd 100644 (file)
@@ -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());
                                }
                        }