* src/insets/insetbranch.[Ch]:

* src/insets/inseturl.[Ch]:
	* src/insets/insetfoot.[Ch]: fix plaintext() & WS changes


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17218 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Michael Schmitt 2007-02-16 09:28:25 +00:00
parent 6c9e07b2da
commit 26054c940e
6 changed files with 41 additions and 28 deletions

View File

@ -23,6 +23,7 @@
#include "LColor.h"
#include "lyxlex.h"
#include "paragraph.h"
#include "outputparams.h"
#include <sstream>
@ -222,26 +223,32 @@ bool InsetBranch::isBranchSelected(Buffer const & buffer) const
int InsetBranch::latex(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
OutputParams const & runparams) const
{
return isBranchSelected(buf) ?
InsetText::latex(buf, os, runparams) : 0;
}
int InsetBranch::docbook(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
return isBranchSelected(buf) ?
InsetText::docbook(buf, os, runparams) : 0;
if (!isBranchSelected(buf))
return 0;
os << '[' << _("branch") << ' ' << params_.branch << ":\n";
InsetText::plaintext(buf, os, runparams);
os << "\n]";
return 1 + runparams.linelen; // one char on a separate line
}
int InsetBranch::plaintext(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
int InsetBranch::docbook(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
return isBranchSelected(buf) ?
InsetText::plaintext(buf, os, runparams): 0;
InsetText::docbook(buf, os, runparams) : 0;
}

View File

@ -55,13 +55,14 @@ public:
///
bool showInsetDialog(BufferView *) const;
///
int latex(Buffer const &, odocstream &, OutputParams const &) const;
///
int docbook(Buffer const &, odocstream &,
OutputParams const & runparams) const;
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
///
int plaintext(Buffer const &, odocstream &,
OutputParams const & runparams) const;
OutputParams const &) const;
///
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
///
void textString(Buffer const & buf, odocstream &) const;
///

View File

@ -60,7 +60,7 @@ docstring const InsetFoot::editMessage() const
int InsetFoot::latex(Buffer const & buf, odocstream & os,
OutputParams const & runparams_in) const
OutputParams const & runparams_in) const
{
OutputParams runparams = runparams_in;
// footnotes in titling commands like \title have moving arguments
@ -81,7 +81,7 @@ int InsetFoot::latex(Buffer const & buf, odocstream & os,
int InsetFoot::plaintext(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
OutputParams const & runparams) const
{
os << '[' << _("footnote") << ":\n";
InsetText::plaintext(buf, os, runparams);
@ -92,7 +92,7 @@ int InsetFoot::plaintext(Buffer const & buf, odocstream & os,
int InsetFoot::docbook(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
OutputParams const & runparams) const
{
os << "<footnote>";
int const i = InsetText::docbook(buf, os, runparams);

View File

@ -29,13 +29,13 @@ public:
InsetBase::Code lyxCode() const { return InsetBase::FOOT_CODE; }
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
OutputParams const &) const;
///
int plaintext(Buffer const &, odocstream &,
OutputParams const &) const;
///
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
OutputParams const &) const;
///
virtual docstring const editMessage() const;
protected:

View File

@ -58,7 +58,7 @@ docstring const InsetUrl::getScreenLabel(Buffer const &) const
int InsetUrl::latex(Buffer const &, odocstream & os,
OutputParams const & runparams) const
OutputParams const & runparams) const
{
docstring const & name = getParam("name");
if (!name.empty())
@ -71,19 +71,24 @@ int InsetUrl::latex(Buffer const &, odocstream & os,
int InsetUrl::plaintext(Buffer const &, odocstream & os,
OutputParams const &) const
OutputParams const &) const
{
os << '[' << getParam("target");
odocstringstream oss;
oss << '[' << getParam("target");
if (getParam("name").empty())
os << ']';
oss << ']';
else
os << "||" << getParam("name") << ']';
return 0;
oss << "||" << getParam("name") << ']';
docstring str = oss.str();
os << str;
return str.size();
}
int InsetUrl::docbook(Buffer const &, odocstream & os,
OutputParams const &) const
OutputParams const &) const
{
os << "<ulink url=\""
<< subst(getParam("target"), from_ascii("&"), from_ascii("&amp;"))

View File

@ -39,13 +39,13 @@ public:
bool display() const { return false; }
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
OutputParams const &) const;
///
int plaintext(Buffer const &, odocstream &,
OutputParams const &) const;
OutputParams const &) const;
///
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
OutputParams const &) const;
/// the string that is passed to the TOC
virtual int textString(Buffer const &, odocstream &,
OutputParams const &) const;