mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-26 18:07:18 +00:00
replace insetVerbatim with InsetText methods (bug 1731), fix LaTeX output problems
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9144 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
876a495c6b
commit
29285691b1
@ -1,3 +1,10 @@
|
|||||||
|
2004-10-30 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||||
|
|
||||||
|
* insetcharstyle.C (latex, linuxdoc, docbook, plaintext): use
|
||||||
|
InsetText methods rather than outputVerbatim (escapes special
|
||||||
|
characters) [bug 1731]
|
||||||
|
* insetcharstyle.C (outputVerbatim): remove this function.
|
||||||
|
|
||||||
2004-10-29 José Matos <jamatos@lyx.org>
|
2004-10-29 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
* insetgraphics.C (uniqueID): transfered to sgml.C
|
* insetgraphics.C (uniqueID): transfered to sgml.C
|
||||||
@ -5,7 +12,7 @@
|
|||||||
2004-10-29 Andreas Vox <vox@isp.uni-luebeck.de>
|
2004-10-29 Andreas Vox <vox@isp.uni-luebeck.de>
|
||||||
|
|
||||||
* insetlabel.C (docbook, linuxdoc):
|
* insetlabel.C (docbook, linuxdoc):
|
||||||
* insetref.C (docbook, linuxdoc) sanitize id.
|
* insetref.C (docbook, linuxdoc): sanitize id.
|
||||||
|
|
||||||
2004-10-29 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
2004-10-29 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||||
|
|
||||||
|
@ -163,77 +163,43 @@ void InsetCharStyle::priv_dispatch(LCursor & cur, FuncRequest & cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
int InsetCharStyle::latex(Buffer const & buf, ostream & os,
|
||||||
|
OutputParams const & runparams) const
|
||||||
int outputVerbatim(std::ostream & os, InsetText const & inset)
|
|
||||||
{
|
{
|
||||||
int lines = 0;
|
os << "\\" << params_.latexname;
|
||||||
ParagraphList::const_iterator par = inset.paragraphs().begin();
|
|
||||||
ParagraphList::const_iterator end = inset.paragraphs().end();
|
|
||||||
while (par != end) {
|
|
||||||
lyx::pos_type siz = par->size();
|
|
||||||
for (lyx::pos_type i = 0; i < siz; ++i) {
|
|
||||||
if (par->isNewline(i)) {
|
|
||||||
os << '\n';
|
|
||||||
++lines;
|
|
||||||
} else {
|
|
||||||
os << par->getChar(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
++par;
|
|
||||||
if (par != end) {
|
|
||||||
os << "\n";
|
|
||||||
lines ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace anon
|
|
||||||
|
|
||||||
|
|
||||||
int InsetCharStyle::latex(Buffer const &, ostream & os,
|
|
||||||
OutputParams const &) const
|
|
||||||
{
|
|
||||||
os << "%\n\\" << params_.latexname;
|
|
||||||
if (!params_.latexparam.empty())
|
if (!params_.latexparam.empty())
|
||||||
os << params_.latexparam;
|
os << params_.latexparam;
|
||||||
os << "{";
|
os << "{";
|
||||||
int i = outputVerbatim(os, *this);
|
int i = InsetText::latex(buf, os, runparams);
|
||||||
os << "}%\n";
|
os << "}";
|
||||||
i += 2;
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InsetCharStyle::linuxdoc(Buffer const &, std::ostream & os,
|
int InsetCharStyle::linuxdoc(Buffer const & buf, ostream & os,
|
||||||
OutputParams const &) const
|
OutputParams const & runparams) const
|
||||||
{
|
{
|
||||||
ostringstream oss;
|
|
||||||
int i = outputVerbatim(oss, *this);
|
|
||||||
sgml::openTag(os, params_.latexname, params_.latexparam);
|
sgml::openTag(os, params_.latexname, params_.latexparam);
|
||||||
os << sgml::escapeString(oss.str());
|
int i = InsetText::linuxdoc(buf, os, runparams);
|
||||||
sgml::closeTag(os, params_.latexname);
|
sgml::closeTag(os, params_.latexname);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InsetCharStyle::docbook(Buffer const &, std::ostream & os,
|
int InsetCharStyle::docbook(Buffer const & buf, ostream & os,
|
||||||
OutputParams const &) const
|
OutputParams const & runparams) const
|
||||||
{
|
{
|
||||||
ostringstream oss;
|
|
||||||
int i = outputVerbatim(oss, *this);
|
|
||||||
sgml::openTag(os, params_.latexname, params_.latexparam);
|
sgml::openTag(os, params_.latexname, params_.latexparam);
|
||||||
os << sgml::escapeString(oss.str());
|
int i = InsetText::docbook(buf, os, runparams);
|
||||||
sgml::closeTag(os, params_.latexname);
|
sgml::closeTag(os, params_.latexname);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int InsetCharStyle::plaintext(Buffer const &, std::ostream & os,
|
int InsetCharStyle::plaintext(Buffer const & buf, ostream & os,
|
||||||
OutputParams const & /*runparams*/) const
|
OutputParams const & runparams) const
|
||||||
{
|
{
|
||||||
return outputVerbatim(os, *this);
|
return InsetText::plaintext(buf, os, runparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user