#include "mathed/math_macrotemplate.h"
#include "mathed/math_hullinset.h"
-#include "frontends/Dialogs.h"
-#include "frontends/LyXView.h"
-
#include "support/lstrings.h"
#include <boost/assert.hpp>
+#include <boost/current_function.hpp>
#include <sstream>
bv->getLyXText()->getStringToIndex(bv->cursor()) :
cmd.argument;
icp.setContents(contents);
-
- string data = InsetCommandMailer::params2string("index", icp);
- LyXView * lv = bv->owner();
-
- if (icp.getContents().empty()) {
- lv->getDialogs().show("index", data, 0);
- } else {
- lv->dispatch(FuncRequest(LFUN_INSET_APPLY, data));
- }
- return 0;
+ return new InsetIndex(icp);
}
- case LFUN_TABULAR_INSERT:
- if (!cmd.argument.empty()) {
- std::istringstream ss(cmd.argument);
- int r = 0, c = 0;
- ss >> r >> c;
- if (r <= 0) r = 2;
- if (c <= 0) c = 2;
- return new InsetTabular(*bv->buffer(), r, c);
- }
- bv->owner()->getDialogs().show("tabularcreate");
- return 0;
+ case LFUN_TABULAR_INSERT: {
+ if (cmd.argument.empty())
+ return 0;
+ std::istringstream ss(cmd.argument);
+ int r = 0, c = 0;
+ ss >> r >> c;
+ if (r <= 0)
+ r = 2;
+ if (c <= 0)
+ c = 2;
+ return new InsetTabular(*bv->buffer(), r, c);
+ }
case LFUN_INSET_CAPTION: {
- UpdatableInset * up = bv->cursor().inset().asUpdatableInset();
- if (!up) {
- auto_ptr<InsetCaption> inset(new InsetCaption(params));
- inset->setAutoBreakRows(true);
- inset->setDrawFrame(true);
- inset->setFrameColor(LColor::captionframe);
- return inset.release();
- }
- return 0;
+ auto_ptr<InsetCaption> inset(new InsetCaption(params));
+ inset->setAutoBreakRows(true);
+ inset->setDrawFrame(true);
+ inset->setFrameColor(LColor::captionframe);
+ return inset.release();
}
case LFUN_INDEX_PRINT:
static_cast<MathMacroTemplate*>(inset.get());
MacroTable::globalMacros().insert
(tmpl->name(), tmpl->asMacroData());
- lyxerr << "creating local macro " << tmpl->name() << endl;
+ lyxerr[Debug::DEBUG]
+ << BOOST_CURRENT_FUNCTION
+ << ": creating local macro " << tmpl->name()
+ << endl;
}
}