#include "paragraph.h"
#include "frontends/Alert.h"
-#include "frontends/LyXView.h"
#include <sstream>
-using lyx::docstring;
-using lyx::pos_type;
-using lyx::support::token;
+
+namespace lyx {
+
+using support::token;
using std::endl;
using std::min;
text_.current_font.setLanguage(latex_language);
text_.real_current_font.setLanguage(latex_language);
- setInsetName("ERT");
+ setInsetName(from_ascii("ERT"));
}
}
-int InsetERT::latex(Buffer const &, ostream & os,
+int InsetERT::latex(Buffer const &, odocstream & os,
OutputParams const &) const
{
ParagraphList::const_iterator par = paragraphs().begin();
pos_type siz = par->size();
for (pos_type i = 0; i < siz; ++i) {
// ignore all struck out text
- if (isDeletedText(*par, i))
+ if (par->isDeleted(i))
continue;
- os << par->getChar(i);
+ os.put(par->getChar(i));
}
++par;
if (par != end) {
}
-int InsetERT::plaintext(Buffer const &, ostream &,
+int InsetERT::plaintext(Buffer const &, odocstream &,
OutputParams const & /*runparams*/) const
{
return 0;
}
-int InsetERT::docbook(Buffer const &, ostream & os,
+int InsetERT::docbook(Buffer const &, odocstream & os,
OutputParams const &) const
{
ParagraphList::const_iterator par = paragraphs().begin();
while (par != end) {
pos_type siz = par->size();
for (pos_type i = 0; i < siz; ++i)
- os << par->getChar(i);
+ os.put(par->getChar(i));
++par;
if (par != end) {
os << "\n";
}
case LFUN_INSET_MODIFY: {
InsetCollapsable::CollapseStatus st;
- InsetERTMailer::string2params(lyx::to_utf8(cmd.argument()), st);
+ InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
setStatus(cur, st);
break;
}
case LFUN_BIBITEM_INSERT:
case LFUN_LINE_INSERT:
case LFUN_PAGEBREAK_INSERT:
+ case LFUN_CLEARPAGE_INSERT:
+ case LFUN_CLEARDOUBLEPAGE_INSERT:
case LFUN_LANGUAGE:
case LFUN_LAYOUT:
case LFUN_LAYOUT_PARAGRAPH:
case LFUN_INSET_INSERT:
case LFUN_PARAGRAPH_PARAMS_APPLY:
case LFUN_PARAGRAPH_UPDATE:
+ case LFUN_NOMENCL_INSERT:
+ case LFUN_NOMENCL_PRINT:
case LFUN_NOACTION:
status.enabled(false);
return true;
// solution, we consider only the first action of the sequence
case LFUN_COMMAND_SEQUENCE: {
// argument contains ';'-terminated commands
- string const firstcmd = token(lyx::to_utf8(cmd.argument()), ';', 0);
+ string const firstcmd = token(to_utf8(cmd.argument()), ';', 0);
FuncRequest func(lyxaction.lookupFunc(firstcmd));
func.origin = cmd.origin;
return getStatus(cur, func, status);
void InsetERT::setButtonLabel()
{
// FIXME UNICODE
- setLabel(isOpen() ? lyx::to_utf8(_("ERT")) : getNewLabel(lyx::to_utf8(_("ERT"))));
+ setLabel(isOpen() ? _("ERT") : getNewLabel(_("ERT")));
}
}
-void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
{
LyXFont tmpfont = mi.base.font;
getDrawFont(mi.base.font);
mi.base.font.realize(tmpfont);
InsetCollapsable::metrics(mi, dim);
mi.base.font = tmpfont;
+ bool const changed = dim_ != dim;
dim_ = dim;
+ return changed;
}
data << name_ << ' ' << status;
return data.str();
}
+
+
+} // namespace lyx