Dissolve CharStyle initial implementation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20944 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2007-10-13 12:59:44 +00:00
parent 589170bd4b
commit 1ecd2189f2
3 changed files with 10 additions and 1 deletions

View File

@ -140,6 +140,7 @@ Menuset
End
Menu "edit_textstyles"
Item "Dissolve CharStyle" "inset-dissolve charstyle"
CharStyles
Elements
Separator

View File

@ -1840,7 +1840,13 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
break;
case LFUN_INSET_DISSOLVE:
enable = !isMainText(cur.bv().buffer()) && cur.inset().nargs() == 1;
if (!cmd.argument().empty()) {
InsetLayout il = cur.inset().getLayout(cur.buffer().params());
enable = (cur.inset().lyxCode() == FLEX_CODE)
&& (il.lyxtype == to_utf8(cmd.argument()));
} else
enable = !isMainText(cur.bv().buffer())
&& cur.inset().nargs() == 1;
break;
case LFUN_CHANGE_ACCEPT:

View File

@ -40,6 +40,8 @@ public:
InsetFlex(BufferParams const &, InsetLayout);
///
docstring name() const { return from_ascii("Flex"); }
///
InsetLayout const & getLayout(BufferParams const &) const { return layout_; }
/// Is this character style defined in the document's textclass?
/// May be wrong after textclass change or paste from another document
bool undefined() const;