Hi,

The following patch should fix many/most of the buffer missettings in
mathed. However, I did not keep trace of the ways to trigger a null
buffer assertion with trunk. Could somebody refresh my memory?

JMarc

svndiff

Index: src/mathed/InsetMathHull.cpp
===================================================================
--- src/mathed/InsetMathHull.cpp	(révision 30846)
+++ src/mathed/InsetMathHull.cpp	(copie de travail)
@@ -211,12 +211,7 @@ InsetMathHull & InsetMathHull::operator=
 
 void InsetMathHull::setBuffer(Buffer & buffer)
 {
-	buffer_ = &buffer;
-	for (idx_type i = 0, n = nargs(); i != n; ++i) {
-		MathData & data = cell(i);
-		for (size_t j = 0; j != data.size(); ++j)
-			data[j].nucleus()->setBuffer(buffer);
-	}
+	InsetMathGrid::setBuffer(buffer);
 
 	for (size_t i = 0; i != label_.size(); ++i) {
 		if (label_[i])
Index: src/mathed/InsetMathNest.cpp
===================================================================
--- src/mathed/InsetMathNest.cpp	(révision 30846)
+++ src/mathed/InsetMathNest.cpp	(copie de travail)
@@ -100,6 +100,17 @@ InsetMathNest & InsetMathNest::operator=
 }
 
 
+void InsetMathNest::setBuffer(Buffer & buffer)
+{
+	InsetMath::setBuffer(buffer);
+	for (idx_type i = 0, n = nargs(); i != n; ++i) {
+		MathData & data = cell(i);
+		for (size_t j = 0; j != data.size(); ++j)
+			data[j].nucleus()->setBuffer(buffer);
+	}
+}
+
+
 InsetMath::idx_type InsetMathNest::nargs() const
 {
 	return cells_.size();
Index: src/mathed/InsetMathNest.h
===================================================================
--- src/mathed/InsetMathNest.h	(révision 30846)
+++ src/mathed/InsetMathNest.h	(copie de travail)
@@ -30,6 +30,8 @@ public:
 	explicit InsetMathNest(idx_type ncells);
 	///
 	virtual ~InsetMathNest() {}
+	///
+	void setBuffer(Buffer &);
 
 	/// the size is usually some sort of convex hull of the cells
 	/// hides inset::metrics() intentionally!

Reply via email to