- return false;
-
- if (pos > (*par)->size())
- pos = (*par)->size();
-
- // many paragraphs
-
- // make a copy of the simple cut_buffer
-#if 1
- ParagraphList::iterator it = paragraphs.begin();
-
- ParagraphList simple_cut_clone;
- simple_cut_clone.insert(simple_cut_clone.begin(),
- new Paragraph(*it, false));
-
- ParagraphList::iterator end = paragraphs.end();
- while (boost::next(it) != end) {
- ++it;
- simple_cut_clone.insert(simple_cut_clone.end(),
- new Paragraph(*it, false));
- }
-#else
- // Later we want it done like this:
- ParagraphList simple_cut_clone(paragraphs.begin(),
- paragraphs.end());
-#endif
- // now remove all out of the buffer which is NOT allowed in the
- // new environment and set also another font if that is required
- ParagraphList::iterator tmpbuf = paragraphs.begin();
- int depth_delta = (*par)->params().depth() - tmpbuf->params().depth();
- // Temporary set *par as previous of tmpbuf as we might have
- // to realize the font.
- tmpbuf->previous(*par);
-
- // make sure there is no class difference
- SwitchLayoutsBetweenClasses(textclass, tc, &*tmpbuf,
- current_view->buffer()->params);
-
- Paragraph::depth_type max_depth = (*par)->getMaxDepthAfter();
-
- while (tmpbuf != paragraphs.end()) {
+ return make_pair(PitPosPair(pit, pos), pit);
+
+ Assert (pos <= pit->size());
+
+ // Make a copy of the CaP paragraphs.
+ ParagraphList simple_cut_clone = cuts[cut_index].first;
+ textclass_type const textclass = cuts[cut_index].second;
+
+ // Now remove all out of the pars which is NOT allowed in the
+ // new environment and set also another font if that is required.
+
+ // Make sure there is no class difference.
+ SwitchLayoutsBetweenClasses(textclass, tc, simple_cut_clone,
+ errorlist);
+
+ ParagraphList::iterator tmpbuf = simple_cut_clone.begin();
+ int depth_delta = pit->params().depth() - tmpbuf->params().depth();
+
+ Paragraph::depth_type max_depth = pit->getMaxDepthAfter();
+
+ for (; tmpbuf != simple_cut_clone.end(); ++tmpbuf) {