Paragraph & par = pars_[pit];
ParagraphParameters params = par.params();
params.read(argument, merge);
+ // changes to label width string apply to all
+ // paragraph with same layout in a sequence
+ setLabelWidthStringToSequence(pit, pars_,
+ params.labelWidthString());
par.params().apply(params, par.layout());
}
}
for (pit_type pit = cur.selBegin().pit(), end = cur.selEnd().pit();
pit <= end; ++pit) {
Paragraph & par = pars_[pit];
+ // changes to label width string apply to all
+ // paragraph with same layout in a sequence
+ setLabelWidthStringToSequence(pit, pars_,
+ par.params().labelWidthString());
par.params().apply(p, par.layout());
}
}
}
+void setLabelWidthStringToSequence(pit_type par_offset,
+ ParagraphList & pars, docstring const & s)
+{
+ Paragraph & par = pars[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];
+ }
+
+ // 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) {
+ while (pars[pit].getDepth() > depth)
+ ++pit;
+ if (pars[pit].getDepth() < depth)
+ return;
+ if (pars[pit].layout() != layout)
+ return;
+ pars[pit].setLabelWidthString(s);
+ }
+}
+
+
int getEndLabel(pit_type p, ParagraphList const & pars)
{
pit_type pit = p;
#ifndef PARAGRAPH_FUNCS_H
#define PARAGRAPH_FUNCS_H
+#include "support/docstring.h"
#include "support/types.h"
/// Is it the first par with same depth and layout?
bool isFirstInSequence(pit_type par, ParagraphList const & plist);
+/** Set Label Width string to all paragraphs of the same layout
+ and depth in a sequence */
+void setLabelWidthStringToSequence(pit_type par_offset,
+ ParagraphList & pars, docstring const & s);
+
/** Check if the current paragraph is the last paragraph in a
proof environment */
int getEndLabel(pit_type par, ParagraphList const & plist);