Fix crash due to invalid pos
Code cleanup: get rid of RenderPreview::status()

This method is a proxy for LyXRC::preview that forces to forward
declare some wrapper around an enum...

Instead, two simple static methods previewMath() and previewText() are
introduced, that make the code much easier to follow.
Fix a GCC warning: comparing signed vs. unsigned

This also changes the type of an int to an ssize_t.

nRead is initialized as an ssize_t because it could
be negative. It is cast to a size_t for comparison
to the size of a vector, but only after we check
that nRead is not negative.
Generalize control on double blank lines.

We can now tell whether a blank line was just output and so can
avoid outputting another one.
Small reorganization.

I am not sure I fully understand the pending_newline/unskip_newline
logic (which seems mainly related to rtl writing), so I prefer to
leave it alone, in the sense that now things go again as in 2.1
until the point where those booleans are used for producing output.
If it turns out that a spurious (and unwanted) empty line comes
from the previous code, it can be easily corrected later.

I am also reintroducing the check about a separator inset at the end
of the paragraph, because that is necessary for the plain version.
Fix reversion of beamer overprint when a nested paragraph has an argument
Fix nesting in some beamer reversion methods.

Patch by Enrico
Output arguments required by arguments with default or preset arg

Fixes: #9128