Tommaso Cucinotta schreef op 29-3-2014 0:07:
On 28/03/14 18:07, Tommaso Cucinotta wrote:
Please commit to the 2.2-staging branch.
ok, no prob. I'll try to address your concerns in the new commit.
So, it's in 2.2-staging, with 2 commits, as per your suggestion.

Hmm, I don't see it.
Interface issues have been tackled by documenting the interface changes.
The bug workaround is still the same: add ignoring of deleted text when 
exporting from lyxfind.cpp (if more time comes, I might make it work with 
deleted text and add an on/off option into advanced pane).


On a closer look at the patch, I don't think that AS_STR_PLAINTEXT should be an option to asString(). Plain text is an output format.

However, plaintext() is often used for other things which feels a bit wrong. Some insets have a toString function that just call plaintext with a default OutputParams object, but I feel like this should be the other way around. If no special make-up is needed for plaintext, just return toString(). Also, the default OutputParams object often produces the correct output, because the plaintext() function doesn't use most of the params. However, this still is wrong. If the plaintext function suddenly does care about dry_run, all the callers are suddenly wrong.

OutputParams::for_toc is also confused with Inset::forToc. The first is meant for the table of contents in an html document, the second one is used for the outliner in LyX.

With respect to your patch. If we really want to say: it's ok to use plaintext for other things than just for output, you should create the OutputParams object within asString.

if (options & AS_STR_FORSEARCH) {
     OutputParams params(encoding);
     params.for_search = true;
     plaintext(os, params);
}

Vincent


Reply via email to