#include "InsetText.h"
-#include "insets/InsetOptArg.h"
+#include "insets/InsetArgument.h"
#include "buffer_funcs.h"
#include "Buffer.h"
#include "support/gettext.h"
#include "support/lstrings.h"
-#include <boost/bind.hpp>
+#include "support/bind.h"
#include "support/lassert.h"
+#include <algorithm>
+
+
using namespace std;
using namespace lyx::support;
-using boost::bind;
-using boost::ref;
namespace lyx {
void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
{
LYXERR(Debug::ACTION, "InsetText::doDispatch()"
- << " [ cmd.action = " << cmd.action << ']');
+ << " [ cmd.action() = " << cmd.action() << ']');
if (getLayout().isPassThru()) {
// Force any new text to latex_language FIXME: This
cur.real_current_font.setLanguage(latex_language);
}
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_PASTE:
case LFUN_CLIPBOARD_PASTE:
case LFUN_SELECTION_PASTE:
bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_DISSOLVE: {
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
}
OutputParams rp = runparams;
if (il.isPassThru())
- rp.verbatim = true;
+ rp.pass_thru = true;
if (il.isNeedProtect())
rp.moving_arg = true;
TexRow texrow;
latexParagraphs(buffer(), text_, os, texrow, rp);
rows += texrow.rows();
+ runparams.encoding = rp.encoding;
if (!il.latexname().empty()) {
if (il.latextype() == InsetLayout::COMMAND) {
}
-void InsetText::updateLabels(ParIterator const & it, UpdateType utype)
+void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
{
ParIterator it2 = it;
it2.forwardPos();
cnt.clearLastLayout();
// FIXME cnt.saveLastCounter()?
}
- buffer().updateLabels(it2, utype);
+ buffer().updateBuffer(it2, utype);
if (save_layouts) {
// LYXERR0("Exiting " << name());
cnt.restoreLastLayout();
// tclass.counters().clearLastLayout()
// since we are saving and restoring the existing counters, etc.
Counters const savecnt = tclass.counters();
- buffer().updateLabels(it2, utype);
+ buffer().updateBuffer(it2, utype);
tclass.counters() = savecnt;
}
}
//lyxerr << (void*)&inset << " code: " << inset.lyxCode() << std::endl;
inset.addToToc(dit);
switch (inset.lyxCode()) {
- case OPTARG_CODE: {
+ case ARG_CODE: {
if (!tocstring.empty())
break;
dit.pos() = 0;
Paragraph const & insetpar =
- *static_cast<InsetOptArg&>(inset).paragraphs().begin();
+ *static_cast<InsetArgument&>(inset).paragraphs().begin();
if (!par.labelString().empty())
tocstring = par.labelString() + ' ';
tocstring += insetpar.asString(AS_STR_INSETS);
// insert this into the table of contents
if (tocstring.empty())
tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
- toc.push_back(TocItem(dit, toclevel - min_toclevel, tocstring));
+ toc.push_back(TocItem(dit, toclevel - min_toclevel,
+ tocstring, tocstring));
}
// And now the list of changes.
}
+docstring InsetText::toolTipText() const
+{
+ OutputParams rp(&buffer().params().encoding());
+ odocstringstream ods;
+ // do not remove InsetText::, otherwise there
+ // will be no tooltip text for InsetNotes
+ InsetText::plaintext(ods, rp);
+ docstring const content_tip = ods.str();
+ return support::wrapParas(content_tip, 4);
+}
+
+
InsetCaption const * InsetText::getCaptionInset() const
{
ParagraphList::const_iterator pit = paragraphs().begin();