On 07/23/2009 02:21 AM, Jürgen Spitzmüller wrote:
* Open the User Guide
* Go to sec. 3.3.6.5 ("The LyX List")
* Set cursor to the second list paragraph
* Open Pargraph Settings dialog and change the longest label value
* Apply:
-------------
LyX Code: 2 name: quote
lassert.cpp(21): ASSERTION false VIOLATED IN insets/Inset.cpp:190
/home/juergen/lyx/lyx-qt/lib/doc/UserGuide.lyx.emergency
Error: Inset::buffer_ member not initialized!
----------------------------------------
LyX Code: 2 name: Quotes
LyX: Attempting to save document /home/juergen/lyx/lyx-
qt/lib/doc/UserGuide.lyx
Save seems successful. Phew.
The current document was closed.
--------------
I think this is not related to the label width string property. It seems
InsetQuote has an uninitialized buffer.
It did have to do with it. It took me a while to figure it out, but the
problem is that you assigned to a reference. It seems so innocent. And
yet it so doesn't do what you actually want it to do. In this case, it
seems to have made the second paragraph a copy of the first paragraph!
And then the buffer_ isn't set for the new quote.
There seems to be another issue here, too: The
setLabelWidthStringToSequence() routine modifies its first argument. I
don't think that's what we want. Please check the attached diff and make
sure it does the right thing.
I'm off on vacation tomorrow, so please commit for me if it's OK.
Richard
Index: paragraph_funcs.h
===================================================================
--- paragraph_funcs.h (revision 30754)
+++ paragraph_funcs.h (working copy)
@@ -63,7 +63,7 @@
/** Set Label Width string to all paragraphs of the same layout
and depth in a sequence */
-void setLabelWidthStringToSequence(pit_type par_offset,
+void setLabelWidthStringToSequence(pit_type const par_offset,
ParagraphList & pars, docstring const & s);
/** Check if the current paragraph is the last paragraph in a
Index: paragraph_funcs.cpp
===================================================================
--- paragraph_funcs.cpp (revision 30754)
+++ paragraph_funcs.cpp (working copy)
@@ -256,22 +256,21 @@
}
-void setLabelWidthStringToSequence(pit_type par_offset,
+void setLabelWidthStringToSequence(pit_type const par_offset,
ParagraphList & pars, docstring const & s)
{
- Paragraph & par = pars[par_offset];
+ pit_type offset = par_offset;
// Find first of same layout in sequence
- while (!isFirstInSequence(par_offset, pars)) {
- par_offset = depthHook(par_offset, pars, par.getDepth());
- par = pars[par_offset];
+ while (!isFirstInSequence(offset, pars)) {
+ offset = depthHook(offset, pars, pars[offset].getDepth());
}
// now apply label width string to every par
// in sequence
pit_type const end = pars.size();
- depth_type const depth = par.getDepth();
- Layout const & layout = par.layout();
- for (pit_type pit = par_offset; pit != end; ++pit) {
+ depth_type const depth = pars[offset].getDepth();
+ Layout const & layout = pars[offset].layout();
+ for (pit_type pit = offset; pit != end; ++pit) {
while (pars[pit].getDepth() > depth)
++pit;
if (pars[pit].getDepth() < depth)