mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
* inset*.C:
* insetbase.h: introduce new enum PLAINTEXT_NEWLINE and use it instead of runparams.linelen for plaintex() return values git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17275 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
67528d1b3b
commit
3157f17825
@ -200,9 +200,13 @@ public:
|
||||
/// describe content if cursor behind
|
||||
virtual void infoize2(odocstream &) const {}
|
||||
|
||||
enum {
|
||||
PLAINTEXT_NEWLINE = 10000
|
||||
};
|
||||
|
||||
/// plain text output in ucs4 encoding
|
||||
/// return the number of characters, in case of multiple lines of
|
||||
/// output, add runparams.linelen to the number of chars in the last line
|
||||
/// return the number of characters; in case of multiple lines of
|
||||
/// output, add PLAINTEXT_NEWLINE to the number of chars in the last line
|
||||
virtual int plaintext(Buffer const &, odocstream &,
|
||||
OutputParams const &) const = 0;
|
||||
/// docbook output
|
||||
|
@ -415,7 +415,7 @@ int InsetBox::plaintext(Buffer const & buf, odocstream & os,
|
||||
case Doublebox: os << "\n]]"; len = 2; break;
|
||||
}
|
||||
|
||||
return len + runparams.linelen; // len chars on a separate line
|
||||
return PLAINTEXT_NEWLINE + len; // len chars on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -240,7 +240,7 @@ int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -254,7 +254,7 @@ int InsetCaption::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -726,7 +726,7 @@ int InsetExternal::plaintext(Buffer const & buf, odocstream & os,
|
||||
external::writeExternal(params_, "Ascii", buf, os,
|
||||
*(runparams.exportdata), false,
|
||||
runparams.dryrun || runparams.inComment);
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -335,7 +335,7 @@ int InsetFloat::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,7 +135,7 @@ int InsetFloatList::plaintext(Buffer const & buffer, odocstream & os,
|
||||
|
||||
buffer.tocBackend().writePlaintextTocList(to_ascii(getParam("type")), os);
|
||||
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ int InsetFoot::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,7 +73,7 @@ int InsetLine::plaintext(Buffer const &, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
os << "\n-------------------------------------------\n";
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ int InsetMarginal::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,7 +66,7 @@ int InsetNewline::plaintext(Buffer const &, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
os << '\n';
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -311,7 +311,7 @@ int InsetNote::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
@ -91,7 +91,7 @@ int InsetPagebreak::plaintext(Buffer const &, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
os << '\n';
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1105,7 +1105,7 @@ int InsetTabular::plaintext(Buffer const & buf, odocstream & os,
|
||||
os << '\n'; // output table on a new line
|
||||
int const dp = runparams.linelen > 0 ? runparams.depth : 0;
|
||||
tabular.plaintext(buf, os, runparams, dp, false, 0);
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -291,7 +291,7 @@ void InsetText::rejectChanges(BufferParams const & bparams)
|
||||
|
||||
|
||||
int InsetText::latex(Buffer const & buf, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
TexRow texrow;
|
||||
latexParagraphs(buf, paragraphs(), os, texrow, runparams);
|
||||
@ -300,7 +300,7 @@ int InsetText::latex(Buffer const & buf, odocstream & os,
|
||||
|
||||
|
||||
int InsetText::plaintext(Buffer const & buf, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
ParagraphList::const_iterator beg = paragraphs().begin();
|
||||
ParagraphList::const_iterator end = paragraphs().end();
|
||||
@ -327,7 +327,7 @@ int InsetText::plaintext(Buffer const & buf, odocstream & os,
|
||||
|
||||
|
||||
int InsetText::docbook(Buffer const & buf, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
docbookParagraphs(paragraphs(), buf, os, runparams);
|
||||
return 0;
|
||||
|
@ -63,7 +63,7 @@ int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
|
||||
|
||||
buffer.tocBackend().writePlaintextTocList(getCmdName(), os);
|
||||
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -214,7 +214,7 @@ int InsetVSpace::plaintext(Buffer const &, odocstream & os,
|
||||
OutputParams const & runparams) const
|
||||
{
|
||||
os << "\n\n";
|
||||
return runparams.linelen; // start with column 0 in new line
|
||||
return PLAINTEXT_NEWLINE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,7 +199,7 @@ int InsetWrap::plaintext(Buffer const & buf, odocstream & os,
|
||||
InsetText::plaintext(buf, os, runparams);
|
||||
os << "\n]";
|
||||
|
||||
return 1 + runparams.linelen; // one char on a separate line
|
||||
return PLAINTEXT_NEWLINE + 1; // one char on a separate line
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user