Improve verbatim for RTL

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21153 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2007-10-23 18:23:03 +00:00
parent 45482a947d
commit 6da13bd888
2 changed files with 16 additions and 3 deletions

View File

@ -1957,8 +1957,9 @@ bool Paragraph::latex(Buffer const & buf,
open_font = false;
}
// Switch file encoding if necessary
if (runparams.encoding->package() == Encoding::inputenc &&
// Switch file encoding if necessary (and allowed)
if (!runparams.verbatim &&
runparams.encoding->package() == Encoding::inputenc &&
font.language()->encoding()->package() == Encoding::inputenc) {
std::pair<bool, int> const enc_switch = switchEncoding(os, bparams,
runparams.moving_arg, *(runparams.encoding),

View File

@ -253,6 +253,18 @@ TeXOnePar(Buffer const & buf,
BufferParams const & bparams = buf.params();
LayoutPtr style;
if (runparams_in.verbatim) {
Font const outerfont =
outerFont(std::distance(paragraphs.begin(), pit),
paragraphs);
// FIXME UNICODE
bool need_par = pit->latex(buf, bparams, outerfont,
os, texrow, runparams_in);
os << '\n';
texrow.newline();
return ++pit;
}
// In an inset with unlimited length (all in one row),
// force layout to default
if (!pit->forceDefaultParagraphs())
@ -558,7 +570,7 @@ TeXOnePar(Buffer const & buf,
if (closing_rtl_ltr_environment)
os << "}";
if (pending_newline && !runparams.verbatim) {
if (pending_newline) {
os << '\n';
texrow.newline();
}