]> git.lyx.org Git - features.git/commitdiff
Dissolve CharStyle initial implementation.
authorMartin Vermeer <martin.vermeer@hut.fi>
Sat, 13 Oct 2007 12:59:44 +0000 (12:59 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Sat, 13 Oct 2007 12:59:44 +0000 (12:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20944 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ui/stdmenus.inc
src/Text3.cpp
src/insets/InsetFlex.h

index 64c50e83da1ea5afb62fe2f48e6b0df6ef367027..d658f25a137c6b63942fb9431882160624f7f1e9 100644 (file)
@@ -140,6 +140,7 @@ Menuset
        End
 
        Menu "edit_textstyles"
+               Item "Dissolve CharStyle" "inset-dissolve charstyle"
                CharStyles
                Elements
                Separator
index 1f7157a48e9e6d74650b0368fc387b09d2b0d3a6..c5795bfb557faf7105fdf2586b63e4191475cf91 100644 (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:
index eba3503fb2e12c599fbca9dfbdce366a7478309e..51e1ec44c5737e108d11091d488ad50da66636fe 100644 (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;