]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.C
added a parseError signal to Buffer and use it
[lyx.git] / src / CutAndPaste.C
index 9eeebfd8875e39046f3d844b7739248025fa56e9..f1057254e522d9a0f7513980a2a466d7c1a15ebc 100644 (file)
@@ -57,9 +57,21 @@ CutAndPaste::availableSelections(Buffer const & buffer)
        CutStack::const_iterator cit = cuts.begin();
        CutStack::const_iterator end = cuts.end();
        for (; cit != end; ++cit) {
-               ParagraphList const & pars = cit->first;
-               string asciiPar(pars.front().asString(&buffer, false), 0, 25);
-               selList.push_back(asciiPar);
+               // we do not use cit-> here because gcc 2.9x does not
+               // like it (JMarc)
+               ParagraphList const & pars = (*cit).first;
+               string asciiSel;
+               ParagraphList::const_iterator pit = pars.begin();
+               ParagraphList::const_iterator pend = pars.end();
+               for (; pit != pend; ++pit) {
+                       asciiSel += pit->asString(&buffer, false);
+                       if (asciiSel.size() > 25) {
+                               asciiSel.replace(22, string::npos, "...");
+                               break;
+                       }
+               }
+
+               selList.push_back(asciiSel);
        }
 
        return selList;