]> git.lyx.org Git - features.git/commitdiff
fix bug 3434.
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 5 Oct 2008 09:51:28 +0000 (09:51 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 5 Oct 2008 09:51:28 +0000 (09:51 +0000)
* InsetText.cpp (getStatus):
- correctly disable layout and paragraph settings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26739 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetText.cpp

index 142d21b6127b5d9af139775c0fd37aef60d7c100..ab480f8c135396070a193627852c5cc3d01baa92 100644 (file)
@@ -25,6 +25,7 @@
 #include "DispatchResult.h"
 #include "ErrorList.h"
 #include "FuncRequest.h"
+#include "FuncStatus.h"
 #include "InsetList.h"
 #include "Intl.h"
 #include "Lexer.h"
@@ -250,7 +251,21 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
        FuncStatus & status) const
 {
-       return text_.getStatus(cur, cmd, status);
+       switch (cmd.action) {
+       case LFUN_LAYOUT:
+               status.setEnabled(!forcePlainLayout());
+               return true;
+
+       case LFUN_LAYOUT_PARAGRAPH:
+       case LFUN_PARAGRAPH_PARAMS:
+       case LFUN_PARAGRAPH_PARAMS_APPLY:
+       case LFUN_PARAGRAPH_SPACING:
+       case LFUN_PARAGRAPH_UPDATE:
+               status.setEnabled(allowParagraphCustomization());
+               return true;
+       default:
+               return text_.getStatus(cur, cmd, status);
+       }
 }