* change LFUN file-insert-ascii to file-insert-plaintext

* change LFUN file-insert-ascii-para to file-insert-plaintext-para
* change LyXRC::RC_ASCIIROFF_COMMAND to LyXRC::RC_PLAINTEXT_ROFF_COMMAND
* change LyXRC::RC_ASCII_LINELEN to LyXRC::RC_PLAINTEXT_LINELEN
* replace "ascii" by "plaintext" in method names


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16697 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Michael Schmitt 2007-01-15 22:49:14 +00:00
parent 74c655ed79
commit 1f7a1257f1
23 changed files with 89 additions and 89 deletions

View File

@ -49,8 +49,8 @@
\bind "M-~S-i o b" "bibtex-insert" \bind "M-~S-i o b" "bibtex-insert"
\bind "M-~S-i e x" "file-insert" \bind "M-~S-i e x" "file-insert"
\bind "M-~S-i e l" "file-insert-ascii" \bind "M-~S-i e l" "file-insert-plaintext"
\bind "M-~S-i e p" "file-insert-ascii-para" \bind "M-~S-i e p" "file-insert-plaintext-para"
\bind "M-~S-f p" "buffer-print" \bind "M-~S-f p" "buffer-print"
\bind "M-~S-f n" "buffer-new" \bind "M-~S-f n" "buffer-new"

View File

@ -496,9 +496,9 @@ def checkOtherEntries():
''' entries other than Format and Converter ''' ''' entries other than Format and Converter '''
checkProg('a *roff formatter', ['groff', 'nroff'], checkProg('a *roff formatter', ['groff', 'nroff'],
rc_entry = [ rc_entry = [
r'\ascii_roff_command "groff -t -Tlatin1 $$FName"', r'\plaintext_roff_command "groff -t -Tlatin1 $$FName"',
r'\ascii_roff_command "tbl $$FName | nroff"', r'\plaintext_roff_command "tbl $$FName | nroff"',
r'\ascii_roff_command ""' ]) r'\plaintext_roff_command ""' ])
checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'], checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
rc_entry = [ r'\chktex_command "%%"' ]) rc_entry = [ r'\chktex_command "%%"' ])
checkProg('a spellchecker', ['ispell'], checkProg('a spellchecker', ['ispell'],

View File

@ -317,8 +317,8 @@ Menuset
Menu "insert_file" Menu "insert_file"
Item "LyX Document...|X" "file-insert" Item "LyX Document...|X" "file-insert"
Item "Plain Text as Lines...|L" "file-insert-ascii" Item "Plain Text as Lines...|L" "file-insert-plaintext"
Item "Plain Text as Paragraphs...|P" "file-insert-ascii-para" Item "Plain Text as Paragraphs...|P" "file-insert-plaintext-para"
End End
Menu "edit_change" Menu "edit_change"

View File

@ -377,8 +377,8 @@ Menuset
Menu "insert_file" Menu "insert_file"
Item "LyX Document...|X" "file-insert" Item "LyX Document...|X" "file-insert"
Item "Plain Text as Lines...|L" "file-insert-ascii" Item "Plain Text as Lines...|L" "file-insert-plaintext"
Item "Plain Text as Paragraphs...|P" "file-insert-ascii-para" Item "Plain Text as Paragraphs...|P" "file-insert-plaintext-para"
Separator Separator
Item "External Material...|M" "dialog-show-new-inset external" Item "External Material...|M" "dialog-show-new-inset external"
Item "Child Document...|d" "dialog-show-new-inset include" Item "Child Document...|d" "dialog-show-new-inset include"

View File

@ -610,8 +610,8 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
flag.enabled(!buffer_->redostack().empty()); flag.enabled(!buffer_->redostack().empty());
break; break;
case LFUN_FILE_INSERT: case LFUN_FILE_INSERT:
case LFUN_FILE_INSERT_ASCII_PARA: case LFUN_FILE_INSERT_PLAINTEXT_PARA:
case LFUN_FILE_INSERT_ASCII: case LFUN_FILE_INSERT_PLAINTEXT:
case LFUN_BOOKMARK_SAVE: case LFUN_BOOKMARK_SAVE:
// FIXME: Actually, these LFUNS should be moved to LyXText // FIXME: Actually, these LFUNS should be moved to LyXText
flag.enabled(cursor_.inTexted()); flag.enabled(cursor_.inTexted());
@ -727,14 +727,14 @@ bool BufferView::dispatch(FuncRequest const & cmd)
menuInsertLyXFile(to_utf8(cmd.argument())); menuInsertLyXFile(to_utf8(cmd.argument()));
break; break;
case LFUN_FILE_INSERT_ASCII_PARA: case LFUN_FILE_INSERT_PLAINTEXT_PARA:
// FIXME UNICODE // FIXME UNICODE
insertAsciiFile(this, to_utf8(cmd.argument()), true); insertPlaintextFile(this, to_utf8(cmd.argument()), true);
break; break;
case LFUN_FILE_INSERT_ASCII: case LFUN_FILE_INSERT_PLAINTEXT:
// FIXME UNICODE // FIXME UNICODE
insertAsciiFile(this, to_utf8(cmd.argument()), false); insertPlaintextFile(this, to_utf8(cmd.argument()), false);
break; break;
case LFUN_FONT_STATE: case LFUN_FONT_STATE:

View File

@ -158,8 +158,8 @@ void LyXAction::init()
{ LFUN_ERROR_NEXT, "error-next", ReadOnly }, { LFUN_ERROR_NEXT, "error-next", ReadOnly },
{ LFUN_ERT_INSERT, "ert-insert", Noop }, { LFUN_ERT_INSERT, "ert-insert", Noop },
{ LFUN_FILE_INSERT, "file-insert", Noop }, { LFUN_FILE_INSERT, "file-insert", Noop },
{ LFUN_FILE_INSERT_ASCII, "file-insert-ascii", Noop }, { LFUN_FILE_INSERT_PLAINTEXT, "file-insert-plaintext", Noop },
{ LFUN_FILE_INSERT_ASCII_PARA, "file-insert-ascii-para", Noop }, { LFUN_FILE_INSERT_PLAINTEXT_PARA, "file-insert-plaintext-para", Noop },
{ LFUN_FILE_NEW, "file-new", NoBuffer }, { LFUN_FILE_NEW, "file-new", NoBuffer },
{ LFUN_FILE_OPEN, "file-open", NoBuffer }, { LFUN_FILE_OPEN, "file-open", NoBuffer },
{ LFUN_FLOAT_INSERT, "float-insert", Noop }, { LFUN_FLOAT_INSERT, "float-insert", Noop },

View File

@ -1672,7 +1672,7 @@ void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
OutputParams runparams; OutputParams runparams;
runparams.nice = true; runparams.nice = true;
runparams.flavor = OutputParams::LATEX; runparams.flavor = OutputParams::LATEX;
runparams.linelen = lyxrc.ascii_linelen; runparams.linelen = lyxrc.plaintext_linelen;
// No side effect of file copying and image conversion // No side effect of file copying and image conversion
runparams.dryrun = true; runparams.dryrun = true;

View File

@ -151,7 +151,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
string backend_format; string backend_format;
OutputParams runparams; OutputParams runparams;
runparams.flavor = OutputParams::LATEX; runparams.flavor = OutputParams::LATEX;
runparams.linelen = lyxrc.ascii_linelen; runparams.linelen = lyxrc.plaintext_linelen;
vector<string> backends = Backends(*buffer); vector<string> backends = Backends(*buffer);
// FIXME: Without this test export to lyx1[34] would be through // FIXME: Without this test export to lyx1[34] would be through
// latex -> lyx -> lyx1[34], because the first backend below with a // latex -> lyx -> lyx1[34], because the first backend below with a

View File

@ -194,24 +194,24 @@ PrefAscii::PrefAscii(QWidget * parent)
: PrefModule(_(Outputs), _("Plain text"), 0, parent) : PrefModule(_(Outputs), _("Plain text"), 0, parent)
{ {
setupUi(this); setupUi(this);
connect(asciiLinelengthSB, SIGNAL(valueChanged(int)), connect(plaintextLinelengthSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed())); this, SIGNAL(changed()));
connect(asciiRoffED, SIGNAL(textChanged(const QString&)), connect(plaintextRoffED, SIGNAL(textChanged(const QString&)),
this, SIGNAL(changed())); this, SIGNAL(changed()));
} }
void PrefAscii::apply(LyXRC & rc) const void PrefAscii::apply(LyXRC & rc) const
{ {
rc.ascii_linelen = asciiLinelengthSB->value(); rc.plaintext_linelen = plaintextLinelengthSB->value();
rc.ascii_roff_command = fromqstr(asciiRoffED->text()); rc.plaintext_roff_command = fromqstr(plaintextRoffED->text());
} }
void PrefAscii::update(LyXRC const & rc) void PrefAscii::update(LyXRC const & rc)
{ {
asciiLinelengthSB->setValue(rc.ascii_linelen); plaintextLinelengthSB->setValue(rc.plaintext_linelen);
asciiRoffED->setText(toqstr(rc.ascii_roff_command)); plaintextRoffED->setText(toqstr(rc.plaintext_roff_command));
} }

View File

@ -31,12 +31,12 @@
<number>6</number> <number>6</number>
</property> </property>
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="asciiRoffLA" > <widget class="QLabel" name="plaintextRoffLA" >
<property name="text" > <property name="text" >
<string>&amp;roff command:</string> <string>&amp;roff command:</string>
</property> </property>
<property name="buddy" > <property name="buddy" >
<cstring>asciiRoffED</cstring> <cstring>plaintextRoffED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -49,7 +49,7 @@
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QSpinBox" name="asciiLinelengthSB" > <widget class="QSpinBox" name="plaintextLinelengthSB" >
<property name="toolTip" > <property name="toolTip" >
<string>Max. line length of exported plain text/LaTeX/SGML files</string> <string>Max. line length of exported plain text/LaTeX/SGML files</string>
</property> </property>
@ -77,17 +77,17 @@
</layout> </layout>
</item> </item>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="asciiLinelengthLA" > <widget class="QLabel" name="plaintextLinelengthLA" >
<property name="text" > <property name="text" >
<string>Output &amp;line length:</string> <string>Output &amp;line length:</string>
</property> </property>
<property name="buddy" > <property name="buddy" >
<cstring>asciiLinelengthSB</cstring> <cstring>plaintextLinelengthSB</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="1" column="1" >
<widget class="QLineEdit" name="asciiRoffED" > <widget class="QLineEdit" name="plaintextRoffED" >
<property name="toolTip" > <property name="toolTip" >
<string>External app for formating tables in plain text output</string> <string>External app for formating tables in plain text output</string>
</property> </property>

View File

@ -87,7 +87,7 @@ bool Importer::Import(LyXView * lv, FileName const & filename,
string filename2 = (loader_format == format) ? filename.absFilename() string filename2 = (loader_format == format) ? filename.absFilename()
: changeExtension(filename.absFilename(), : changeExtension(filename.absFilename(),
formats.extension(loader_format)); formats.extension(loader_format));
insertAsciiFile(lv->view(), filename2, as_paragraphs); insertPlaintextFile(lv->view(), filename2, as_paragraphs);
lv->dispatch(FuncRequest(LFUN_MARK_OFF)); lv->dispatch(FuncRequest(LFUN_MARK_OFF));
} }

View File

@ -679,12 +679,12 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
break; break;
// insert file functions // insert file functions
case LFUN_FILE_INSERT_ASCII_PARA: case LFUN_FILE_INSERT_PLAINTEXT_PARA:
case LFUN_FILE_INSERT_ASCII: { case LFUN_FILE_INSERT_PLAINTEXT: {
// FIXME UNICODE // FIXME UNICODE
string const tmpstr = getContentsOfAsciiFile(&cur.bv(), to_utf8(cmd.argument()), false); string const tmpstr = getContentsOfPlaintextFile(&cur.bv(), to_utf8(cmd.argument()), false);
// FIXME: We don't know the encoding of the file // FIXME: We don't know the encoding of the file
if (!tmpstr.empty() && !insertAsciiString(cur.bv(), from_utf8(tmpstr), false)) if (!tmpstr.empty() && !insertPlaintextString(cur.bv(), from_utf8(tmpstr), false))
cur.undispatched(); cur.undispatched();
break; break;
} }
@ -727,10 +727,10 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
theSelection().get(); theSelection().get();
if (clip.empty()) if (clip.empty())
break; break;
// pass to InsertAsciiString, but // pass to InsertPlaintextString, but
// only if we have multi-cell content // only if we have multi-cell content
if (clip.find_first_of(from_ascii("\t\n")) != docstring::npos) { if (clip.find_first_of(from_ascii("\t\n")) != docstring::npos) {
if (insertAsciiString(cur.bv(), clip, false)) { if (insertPlaintextString(cur.bv(), clip, false)) {
// content has been replaced, // content has been replaced,
// so cursor might be invalid // so cursor might be invalid
cur.pos() = cur.lastpos(); cur.pos() = cur.lastpos();
@ -1957,7 +1957,7 @@ bool InsetTabular::forceDefaultParagraphs(idx_type cell) const
} }
bool InsetTabular::insertAsciiString(BufferView & bv, docstring const & buf, bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf,
bool usePaste) bool usePaste)
{ {
if (buf.length() <= 0) if (buf.length() <= 0)

View File

@ -188,7 +188,7 @@ private:
void getSelection(LCursor & cur, row_type & rs, row_type & re, void getSelection(LCursor & cur, row_type & rs, row_type & re,
col_type & cs, col_type & ce) const; col_type & cs, col_type & ce) const;
/// ///
bool insertAsciiString(BufferView &, docstring const & buf, bool usePaste); bool insertPlaintextString(BufferView &, docstring const & buf, bool usePaste);
/// are we operating on several cells? /// are we operating on several cells?
bool tablemode(LCursor & cur) const; bool tablemode(LCursor & cur) const;

View File

@ -202,8 +202,8 @@ enum kb_action {
// 140 // 140
LFUN_COMMAND_EXECUTE, LFUN_COMMAND_EXECUTE,
LFUN_FILE_INSERT, LFUN_FILE_INSERT,
LFUN_FILE_INSERT_ASCII, // CFO-G 1997-11-19 LFUN_FILE_INSERT_PLAINTEXT, // CFO-G 1997-11-19
LFUN_FILE_INSERT_ASCII_PARA, // Levon 2001-02-14 LFUN_FILE_INSERT_PLAINTEXT_PARA,// Levon 2001-02-14
LFUN_FILE_NEW, // for scripting purposes LFUN_FILE_NEW, // for scripting purposes
// 145 // 145
LFUN_FILE_OPEN, LFUN_FILE_OPEN,

View File

@ -318,14 +318,14 @@ void newFile(BufferView * bv, string const & filename)
} }
// Insert ascii file (if filename is empty, prompt for one) // Insert plain text file (if filename is empty, prompt for one)
void insertAsciiFile(BufferView * bv, string const & f, bool asParagraph) void insertPlaintextFile(BufferView * bv, string const & f, bool asParagraph)
{ {
if (!bv->buffer()) if (!bv->buffer())
return; return;
// FIXME: We don't know the encoding of the file // FIXME: We don't know the encoding of the file
docstring const tmpstr = from_utf8(getContentsOfAsciiFile(bv, f, asParagraph)); docstring const tmpstr = from_utf8(getContentsOfPlaintextFile(bv, f, asParagraph));
if (tmpstr.empty()) if (tmpstr.empty())
return; return;
@ -341,14 +341,14 @@ void insertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
} }
// Insert ascii file (if filename is empty, prompt for one) // Insert plain text file (if filename is empty, prompt for one)
string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagraph) string getContentsOfPlaintextFile(BufferView * bv, string const & f, bool asParagraph)
{ {
FileName fname(f); FileName fname(f);
if (fname.empty()) { if (fname.empty()) {
FileDialog fileDlg(_("Select file to insert"), FileDialog fileDlg(_("Select file to insert"),
(asParagraph) ? LFUN_FILE_INSERT_ASCII_PARA : LFUN_FILE_INSERT_ASCII); (asParagraph) ? LFUN_FILE_INSERT_PLAINTEXT_PARA : LFUN_FILE_INSERT_PLAINTEXT);
FileDialog::Result result = FileDialog::Result result =
fileDlg.open(from_utf8(bv->buffer()->filePath()), fileDlg.open(from_utf8(bv->buffer()->filePath()),

View File

@ -32,9 +32,9 @@ void autoSave(BufferView * bv);
/// ///
void newFile(BufferView * bv, std::string const & filename); void newFile(BufferView * bv, std::string const & filename);
/// ///
void insertAsciiFile(BufferView * bv, std::string const & f, bool asParagraph); void insertPlaintextFile(BufferView * bv, std::string const & f, bool asParagraph);
/// ///
std::string getContentsOfAsciiFile(BufferView * bv, std::string const & f, bool asParagraph); std::string getContentsOfPlaintextFile(BufferView * bv, std::string const & f, bool asParagraph);
/// ///
void reconfigure(LyXView & lv); void reconfigure(LyXView & lv);

View File

@ -2112,8 +2112,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
switch (tag) { switch (tag) {
case LyXRC::RC_ACCEPT_COMPOUND: case LyXRC::RC_ACCEPT_COMPOUND:
case LyXRC::RC_ALT_LANG: case LyXRC::RC_ALT_LANG:
case LyXRC::RC_ASCIIROFF_COMMAND: case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
case LyXRC::RC_ASCII_LINELEN: case LyXRC::RC_PLAINTEXT_LINELEN:
case LyXRC::RC_AUTOREGIONDELETE: case LyXRC::RC_AUTOREGIONDELETE:
case LyXRC::RC_AUTORESET_OPTIONS: case LyXRC::RC_AUTORESET_OPTIONS:
case LyXRC::RC_AUTOSAVE: case LyXRC::RC_AUTOSAVE:

View File

@ -68,8 +68,6 @@ namespace {
keyword_item lyxrcTags[] = { keyword_item lyxrcTags[] = {
{ "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND }, { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
{ "\\alternate_language", LyXRC::RC_ALT_LANG }, { "\\alternate_language", LyXRC::RC_ALT_LANG },
{ "\\ascii_linelen", LyXRC::RC_ASCII_LINELEN },
{ "\\ascii_roff_command", LyXRC::RC_ASCIIROFF_COMMAND },
{ "\\auto_number", LyXRC::RC_AUTO_NUMBER }, { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
{ "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE }, { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
{ "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS }, { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
@ -114,6 +112,8 @@ keyword_item lyxrcTags[] = {
{ "\\num_lastfiles", LyXRC::RC_NUMLASTFILES }, { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
{ "\\path_prefix", LyXRC::RC_PATH_PREFIX }, { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
{ "\\personal_dictionary", LyXRC::RC_PERS_DICT }, { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
{ "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
{ "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
{ "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT }, { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
{ "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING }, { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
{ "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT }, { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
@ -254,7 +254,7 @@ void LyXRC::setDefaults() {
autosave = 300; autosave = 300;
auto_region_delete = true; auto_region_delete = true;
auto_reset_options = false; auto_reset_options = false;
ascii_linelen = 65; plaintext_linelen = 65;
num_lastfiles = maxlastfiles; num_lastfiles = maxlastfiles;
check_lastfiles = true; check_lastfiles = true;
use_lastfilepos = true; use_lastfilepos = true;
@ -892,14 +892,14 @@ int LyXRC::read(LyXLex & lexrc)
} }
break; break;
case RC_ASCIIROFF_COMMAND: case RC_PLAINTEXT_ROFF_COMMAND:
if (lexrc.next()) { if (lexrc.next()) {
ascii_roff_command = lexrc.getString(); plaintext_roff_command = lexrc.getString();
} }
break; break;
case RC_ASCII_LINELEN: case RC_PLAINTEXT_LINELEN:
if (lexrc.next()) { if (lexrc.next()) {
ascii_linelen = lexrc.getInteger(); plaintext_linelen = lexrc.getInteger();
} }
break; break;
// Spellchecker settings: // Spellchecker settings:
@ -1856,10 +1856,10 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
} }
case RC_USETEMPDIR: case RC_USETEMPDIR:
// Ignore it // Ignore it
case RC_ASCII_LINELEN: case RC_PLAINTEXT_LINELEN:
if (ignore_system_lyxrc || if (ignore_system_lyxrc ||
ascii_linelen != system_lyxrc.ascii_linelen) { plaintext_linelen != system_lyxrc.plaintext_linelen) {
os << "\\ascii_linelen " << ascii_linelen << '\n'; os << "\\plaintext_linelen " << plaintext_linelen << '\n';
} }
case RC_MAKE_BACKUP: case RC_MAKE_BACKUP:
if (ignore_system_lyxrc || if (ignore_system_lyxrc ||
@ -1877,10 +1877,10 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
<< "# ASCII EXPORT SECTION ##############################\n" << "# ASCII EXPORT SECTION ##############################\n"
<< "#\n\n"; << "#\n\n";
case RC_ASCIIROFF_COMMAND: case RC_PLAINTEXT_ROFF_COMMAND:
if (ignore_system_lyxrc || if (ignore_system_lyxrc ||
ascii_roff_command != system_lyxrc.ascii_roff_command) { plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
os << "\\ascii_roff_command \"" << ascii_roff_command os << "\\plaintext_roff_command \"" << plaintext_roff_command
<< "\"\n"; << "\"\n";
} }
@ -2172,12 +2172,12 @@ string const LyXRC::getDescription(LyXRCTags tag)
str = _("Specify an alternate language. The default is to use the language of the document."); str = _("Specify an alternate language. The default is to use the language of the document.");
break; break;
case RC_ASCIIROFF_COMMAND: case RC_PLAINTEXT_ROFF_COMMAND:
str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used."); str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
break; break;
case RC_ASCII_LINELEN: case RC_PLAINTEXT_LINELEN:
str = _("This is the maximum line length of an exported text file (LaTeX, SGML or plain text)."); str = _("This is the maximum line length of an exported text file (LaTeX, SGML or plain text). If set to 0, paragraphs are output in a single line; if the line length is != 0, paragraphs are separated by a blank line.");
break; break;
case RC_AUTOREGIONDELETE: case RC_AUTOREGIONDELETE:

View File

@ -40,8 +40,8 @@ public:
enum LyXRCTags { enum LyXRCTags {
RC_ACCEPT_COMPOUND = 1, RC_ACCEPT_COMPOUND = 1,
RC_ALT_LANG, RC_ALT_LANG,
RC_ASCIIROFF_COMMAND, RC_PLAINTEXT_ROFF_COMMAND,
RC_ASCII_LINELEN, RC_PLAINTEXT_LINELEN,
RC_AUTOREGIONDELETE, RC_AUTOREGIONDELETE,
RC_AUTORESET_OPTIONS, RC_AUTORESET_OPTIONS,
RC_AUTOSAVE, RC_AUTOSAVE,
@ -309,9 +309,9 @@ public:
/// ///
unsigned int autosave; unsigned int autosave;
/// ///
std::string ascii_roff_command; std::string plaintext_roff_command;
/// ///
unsigned int ascii_linelen; unsigned int plaintext_linelen;
/// use library instead of process /// use library instead of process
bool use_spell_lib; bool use_spell_lib;
/// Ispell command /// Ispell command

View File

@ -1152,7 +1152,7 @@ void sgmlLineBreak(ostream & os, string::size_type & colcount,
string::size_type newcol) string::size_type newcol)
{ {
colcount += newcol; colcount += newcol;
if (colcount > lyxrc.ascii_linelen) { if (colcount > lyxrc.plaintext_linelen) {
os << "\n"; os << "\n";
colcount = newcol; // assume write after this call colcount = newcol; // assume write after this call
} }

View File

@ -390,7 +390,7 @@ void Paragraph::Pimpl::simpleTeXBlanks(odocstream & os, TexRow & texrow,
if (style.pass_thru) if (style.pass_thru)
return; return;
if (column > lyxrc.ascii_linelen if (column > lyxrc.plaintext_linelen
&& i && i
&& getChar(i - 1) != ' ' && getChar(i - 1) != ' '
&& (i < size() - 1) && (i < size() - 1)

View File

@ -2453,7 +2453,7 @@ int LyXTabular::docbook(Buffer const & buf, odocstream & os,
} }
int LyXTabular::asciiTopHLine(odocstream & os, row_type row, int LyXTabular::plaintextTopHLine(odocstream & os, row_type row,
vector<unsigned int> const & clen) const vector<unsigned int> const & clen) const
{ {
idx_type const fcell = getFirstCellInRow(row); idx_type const fcell = getFirstCellInRow(row);
@ -2501,7 +2501,7 @@ int LyXTabular::asciiTopHLine(odocstream & os, row_type row,
} }
int LyXTabular::asciiBottomHLine(odocstream & os, row_type row, int LyXTabular::plaintextBottomHLine(odocstream & os, row_type row,
vector<unsigned int> const & clen) const vector<unsigned int> const & clen) const
{ {
idx_type const fcell = getFirstCellInRow(row); idx_type const fcell = getFirstCellInRow(row);
@ -2549,7 +2549,7 @@ int LyXTabular::asciiBottomHLine(odocstream & os, row_type row,
} }
int LyXTabular::asciiPrintCell(Buffer const & buf, odocstream & os, int LyXTabular::plaintextPrintCell(Buffer const & buf, odocstream & os,
OutputParams const & runparams, OutputParams const & runparams,
idx_type cell, row_type row, col_type column, idx_type cell, row_type row, col_type column,
vector<unsigned int> const & clen, vector<unsigned int> const & clen,
@ -2645,21 +2645,21 @@ int LyXTabular::plaintext(Buffer const & buf, odocstream & os,
} }
idx_type cell = 0; idx_type cell = 0;
for (row_type i = 0; i < rows_; ++i) { for (row_type i = 0; i < rows_; ++i) {
if (!onlydata && asciiTopHLine(os, i, clen)) if (!onlydata && plaintextTopHLine(os, i, clen))
os << docstring(depth * 2, ' '); os << docstring(depth * 2, ' ');
for (col_type j = 0; j < columns_; ++j) { for (col_type j = 0; j < columns_; ++j) {
if (isPartOfMultiColumn(i, j)) if (isPartOfMultiColumn(i, j))
continue; continue;
if (onlydata && j > 0) if (onlydata && j > 0)
os << delim; os << delim;
ret += asciiPrintCell(buf, os, runparams, ret += plaintextPrintCell(buf, os, runparams,
cell, i, j, clen, onlydata); cell, i, j, clen, onlydata);
++cell; ++cell;
} }
os << endl; os << endl;
if (!onlydata) { if (!onlydata) {
os << docstring(depth * 2, ' '); os << docstring(depth * 2, ' ');
if (asciiBottomHLine(os, i, clen)) if (plaintextBottomHLine(os, i, clen))
os << docstring(depth * 2, ' '); os << docstring(depth * 2, ' ');
} }
} }

View File

@ -604,15 +604,15 @@ public:
int TeXRow(odocstream &, row_type const row, Buffer const & buf, int TeXRow(odocstream &, row_type const row, Buffer const & buf,
OutputParams const &) const; OutputParams const &) const;
/// ///
// helper function for ASCII returns number of newlines // helper functions for plain text return number of newlines
/// ///
int asciiTopHLine(odocstream &, row_type row, int plaintextTopHLine(odocstream &, row_type row,
std::vector<unsigned int> const &) const; std::vector<unsigned int> const &) const;
/// ///
int asciiBottomHLine(odocstream &, row_type row, int plaintextBottomHLine(odocstream &, row_type row,
std::vector<unsigned int> const &) const; std::vector<unsigned int> const &) const;
/// ///
int asciiPrintCell(Buffer const &, odocstream &, int plaintextPrintCell(Buffer const &, odocstream &,
OutputParams const &, OutputParams const &,
idx_type cell, row_type row, col_type column, idx_type cell, row_type row, col_type column,
std::vector<unsigned int> const &, std::vector<unsigned int> const &,