From b4213b9fe56096d989257a4230d7bf43ba74c59a Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 6 Jun 2008 09:01:55 +0000 Subject: [PATCH] LFUN_INFO_INSERT: avoid static_cast. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25155 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index 1e5ec37f81..db6613378a 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1338,18 +1338,18 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_INFO_INSERT: { - Inset * inset = createInset(cur.bv().buffer(), cmd); - if (!inset) - break; - // if an empty inset is created (cmd.argument() is empty) - // use current selection as parameter. + Inset * inset; if (cmd.argument().empty() && cur.selection()) { - // use selected text as info to avoid a separate UI + // if command argument is empty use current selection as parameter. docstring ds = cur.selectionAsString(false); cutSelection(cur, true, false); - static_cast(inset)->setInfo(to_utf8(ds)); - static_cast(inset)->updateInfo(); + FuncRequest cmd0(cmd, ds); + inset = createInset(cur.bv().buffer(), cmd0); + } else { + inset = createInset(cur.bv().buffer(), cmd); } + if (!inset) + break; insertInset(cur, inset); cur.posForward(); break; -- 2.39.5