]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_funcs.cpp
Fix MSVC warning
[lyx.git] / src / paragraph_funcs.cpp
index 0459ed79117dcef4dbdddd46935e9b637735bd2e..cb628992a719d4b73d80a50e976c77126dc48af9 100644 (file)
@@ -256,6 +256,32 @@ bool isFirstInSequence(pit_type par_offset, ParagraphList const & pars)
 }
 
 
+void setLabelWidthStringToSequence(pit_type const par_offset,
+       ParagraphList & pars, docstring const & s)
+{
+       pit_type offset = par_offset;
+       // Find first of same layout in sequence
+       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 = 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)
+                       return;
+               if (pars[pit].layout() != layout)
+                       return;
+               pars[pit].setLabelWidthString(s);
+       }
+}
+
+
 int getEndLabel(pit_type p, ParagraphList const & pars)
 {
        pit_type pit = p;
@@ -327,7 +353,7 @@ void acceptChanges(ParagraphList & pars, BufferParams const & bparams)
        // (do not consider end-of-par)
        for (pit_type pit = 0; pit < pars_size; ++pit) {
                if (!pars[pit].empty())   // prevent assertion failure
-                       pars[pit].acceptChanges(bparams, 0, pars[pit].size());
+                       pars[pit].acceptChanges(0, pars[pit].size());
        }
 
        // next, accept imaginary end-of-par characters