From a12509db90408e3866238e7160cd2c6a6561ae20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 27 Aug 2003 13:32:26 +0000 Subject: [PATCH] 'fix' outerPar git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7614 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/paragraph_funcs.C | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 34d9b4376e..cbd19ea7cf 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -1052,13 +1052,20 @@ ParagraphList::iterator outerPar(Buffer const & buf, InsetOld const * inset) ParIterator pit = const_cast(buf).par_iterator_begin(); ParIterator end = const_cast(buf).par_iterator_end(); for ( ; pit != end; ++pit) { + + ParagraphList * plist; + // the second '=' below is intentional + for (int i = 0; (plist = inset->getParagraphs(i)); ++i) + if (plist == &pit.plist()) + return pit.outerPar(); + InsetList::iterator ii = pit->insetlist.begin(); InsetList::iterator iend = pit->insetlist.end(); for ( ; ii != iend; ++ii) if (ii->inset == inset) return pit.outerPar(); } - lyxerr << "outerPar: should not happen\n"; + lyxerr << "outerPar: should not happen" << endl; Assert(false); return const_cast(buf).paragraphs.end(); // shut up compiler } @@ -1075,7 +1082,7 @@ Paragraph const & ownerPar(Buffer const & buf, InsetOld const * inset) if (ii->inset == inset) return *pit.pit(); } - lyxerr << "ownerPar: should not happen\n"; + lyxerr << "ownerPar: should not happen" << endl; Assert(false); return buf.paragraphs.front(); // shut up compiler } -- 2.39.2