#include <config.h>
-
#include "insetminipage.h"
#include "insettext.h"
#include "lyxfont.h"
#include "lyxlex.h"
#include "lyxtext.h"
+#include "Lsstream.h"
#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
dispatch_result InsetMinipage::localDispatch(FuncRequest const & cmd)
{
- Inset::RESULT result = UNDISPATCHED;
-
switch (cmd.action) {
case LFUN_INSET_MODIFY: {
InsetMinipage::Params params;
params_.pos = params.pos;
params_.width = params.width;
+ /* FIXME: I refuse to believe we have to live
+ * with ugliness like this ... */
+ LyXText * t = inset.getLyXText(cmd.view());
+ t->need_break_row = t->rows().begin();
+ t->fullRebreak();
+ inset.update(cmd.view(), true);
+ t->setCursorIntern(t->cursor.par(), t->cursor.pos());
cmd.view()->updateInset(this);
- result = DISPATCHED;
+ return DISPATCHED;
}
- break;
- case LFUN_INSET_DIALOG_UPDATE: {
- InsetMinipageMailer mailer(*this);
- mailer.updateDialog(cmd.view());
- }
- break;
+ case LFUN_INSET_DIALOG_UPDATE:
+ InsetMinipageMailer(*this).updateDialog(cmd.view());
+ return DISPATCHED;
default:
- result = InsetCollapsable::localDispatch(cmd);
+ return InsetCollapsable::localDispatch(cmd);
}
-
- return result;
}
{
params = InsetMinipage::Params();
- istringstream data(in);
+ if (in.empty())
+ return;
+
+ istringstream data(STRCONV(in));
LyXLex lex(0,0);
lex.setStream(data);
ostringstream data;
data << name_ << ' ';
params.write(data);
-
- return data.str();
+ return STRCONV(data.str());
}