> Yes, I am getting the attached full output.
> 
> Note (line 175) that the screen redraw is pre-empted by processing the
> character 'a'... so it doesn't get around to calling doneUpdating.
> 
> Then, at line 604, it finally comes tumbling from the sky ;-)
> 
> I expect this would work fine if we could, in coordcache, turn bool
> updating into int updating, counting the number of screen redraws we
> have pending.
> 
> Andre, does that make sense to you?
> 
> - Martin

This fixes the first crash reported by Juergen.

It turns out BufferView::update() can in fact be called multiple times
at the same time, if you press keys fast enough. I wonder if this is
supposed to be. Anyway, making the handling of the coordinate cache
re-entrant fixes the bug. This requires "updating" to be a counter
rather than a bool.

Tell me if I should be happy with this; I'm not so sure.

The second reported crash still happens, but is rarer and presumably
unrelated:

# InsetTabular::getNearestCell()  x=82 y=150
Assertion triggered in pit_type LyXText::getPitNearY(int) const by
failing check "theCoords.getParPos().find(this) !=
theCoords.getParPos().end()" in file text2.C:854

- Martin

Index: src/paragraph.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.404
diff -u -p -r1.404 paragraph.C
--- src/paragraph.C	11 Apr 2005 15:09:54 -0000	1.404
+++ src/paragraph.C	3 May 2005 18:21:40 -0000
@@ -704,7 +704,7 @@ InsetBibitem * Paragraph::bibitem() cons
 {
 	if (!insetlist.empty()) {
 		InsetBase * inset = insetlist.begin()->inset;
-		if (inset->lyxCode() == InsetBase::BIBTEX_CODE)
+		if (inset->lyxCode() == InsetBase::BIBITEM_CODE)
 			return static_cast<InsetBibitem *>(inset);
 	}
 	return 0;
Index: src/buffer_funcs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer_funcs.C,v
retrieving revision 1.26
diff -u -p -r1.26 buffer_funcs.C
--- src/buffer_funcs.C	26 Apr 2005 11:12:09 -0000	1.26
+++ src/buffer_funcs.C	3 May 2005 18:21:40 -0000
@@ -440,10 +440,9 @@ void setCounter(Buffer const & buf, ParI
 	} else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
 		counters.step("bibitem");
 		int number = counters.value("bibitem");
-		if (par.bibitem()) {
+		if (par.bibitem()) 
 			par.bibitem()->setCounter(number);
-			par.params().labelString(layout->labelstring());
-		}
+		par.params().labelString(layout->labelstring());
 		// In biblio should't be following counters but...
 	} else if (layout->labeltype == LABEL_SENSITIVE) {
 		// Search for the first float or wrap inset in the iterator
Index: src/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.600
diff -u -p -r1.600 text.C
--- src/text.C	1 May 2005 16:22:48 -0000	1.600
+++ src/text.C	3 May 2005 18:21:40 -0000
@@ -1654,6 +1654,23 @@ void LyXText::redoParagraph(pit_type con
 	// remove rows of paragraph, keep track of height changes
 	Paragraph & par = pars_[pit];
 
+	// Add bibitem insets if necessary
+	if (par.layout()->labeltype == LABEL_BIBLIO) {
+		bool hasbibitem(false);
+ 		if (!par.insetlist.empty() 
+			// Insist on it being in pos 0
+			&& par.getChar(0) == Paragraph::META_INSET) {
+			InsetBase * inset = par.insetlist.begin()->inset;
+        	        if (inset->lyxCode() == InsetBase::BIBITEM_CODE)
+				hasbibitem = true;
+		}
+		if (!hasbibitem) {
+			InsetBibitem * inset(new
+				InsetBibitem(InsetCommandParams("bibitem")));
+			par.insertInset(0, static_cast<InsetBase *>(inset));
+		}
+	}
+
 	// redo insets
 	InsetList::iterator ii = par.insetlist.begin();
 	InsetList::iterator iend = par.insetlist.end();
Index: lib/layouts/stdlists.inc
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/stdlists.inc,v
retrieving revision 1.10
diff -u -p -r1.10 stdlists.inc
--- lib/layouts/stdlists.inc	13 Oct 2003 09:50:10 -0000	1.10
+++ lib/layouts/stdlists.inc	3 May 2005 18:21:40 -0000
@@ -93,24 +93,6 @@ Style List
 End
 
 
-Style Bibliography
-	Margin                Static
-	LatexType             Bib_Environment
-	LatexName             thebibliography
-	NextNoIndent          1
-	LeftMargin            MMN
-	LabelSep              xx
-	ParSkip               0.0
-	ItemSep               0.2
-	TopSep                0.7
-	BottomSep             0.7
-	ParSep                0.3
-	Align                 Block
-	AlignPossible         Block, Left
-	LabelType             Enumerate
-End
-
-
 #
 # New environments (not active yet)
 #
Index: lib/layouts/stdstruct.inc
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/stdstruct.inc,v
retrieving revision 1.7
diff -u -p -r1.7 stdstruct.inc
--- lib/layouts/stdstruct.inc	13 Oct 2003 09:50:10 -0000	1.7
+++ lib/layouts/stdstruct.inc	3 May 2005 18:21:40 -0000
@@ -50,7 +50,7 @@ Style Bibliography
 	AlignPossible         Block, Left
 	LabelType             Bibliography
 	LabelString           References
-	LabelBottomSep    0.7
+	LabelBottomSep        1.2
 	LabelFont
 	  Series              Bold
 	  Size                Larger

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to