On Thu, Feb 21, 2002 at 06:53:55PM +0100, Michael Schmitt wrote: > Hi, > > the following effect is not nice: > > - Create new doc; insert "enumerate" par and two pars for > sub-enumerations; select the two sub-enumeration, copy them and > paste them in front of the first par -> endless console message: > > ERROR (Paragraph::DepthHook): no hook. > > Easily reproducible. No valgrind report this time.
Not for me. Fairly recent CVS. How do you do it? > Have a nice day, > > Michael There is another bug perhaps related to this, for which I posted a fix ages ago, but it went to the great CVS repository in the sky it seems... the "infinite depth" bug. You can click on a positive depth paragraph and increas its depth indefinitely, when it ought to cycle back to zero depth. Attached again (and this time someone should review it ;-). Martin
--- text2.C Wed Feb 20 17:49:41 2002
+++ text2.C.bak Wed Feb 20 09:09:43 2002
@@ -650,13 +650,18 @@
).labeltype != LABEL_BIBLIO) {
Paragraph * prev = cursor.par()->previous();
- if (prev
- && (prev->getDepth() - cursor.par()->getDepth() > 0
- || (prev->getDepth() == cursor.par()->getDepth()
+ if (prev) {
+ int depth_diff = prev->getDepth() -
+cursor.par()->getDepth();
+ // go deeper only if
+ // (1) the previous para is already deeper (depth_diff
+> 0)
+ // (2) the previous para is a list-environment at the
+ // same depth as this para.
+ if (depth_diff > 0 || (depth_diff > -1
&&
textclasslist.Style(bview->buffer()->params.textclass,
-
prev->getLayout()).isEnvironment()))) {
-
cursor.par()->params().depth(cursor.par()->params().depth() + 1);
- anything_changed = true;
+
+prev->getLayout()).isEnvironment())) {
+
+cursor.par()->params().depth(cursor.par()->params().depth() + 1);
+ anything_changed = true;
+ }
}
}
if (cursor.par() == selection.end.par())
msg33366/pgp00000.pgp
Description: PGP signature
