]> git.lyx.org Git - features.git/commitdiff
Fix for bug 3524: Indent checkbox is enabled even when paragraphs are marked
authorRichard Heck <rgheck@comcast.net>
Tue, 8 May 2007 15:35:44 +0000 (15:35 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 8 May 2007 15:35:44 +0000 (15:35 +0000)
with skips.

Added helper method canIndent() to controller and appropriate logic to
QParagraph::update_contents().

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

src/frontends/controllers/ControlParagraph.cpp
src/frontends/controllers/ControlParagraph.h
src/frontends/qt4/QParagraph.cpp

index d640ec2124479230cfabfde1eae507b661dc6402..bc80c797cfa9dd7c7136414331a99c55f7b526cf 100644 (file)
@@ -12,6 +12,8 @@
 #include <config.h>
 
 #include "ControlParagraph.h"
+#include "Buffer.h"
+#include "BufferParams.h"
 #include "ButtonController.h"
 #include "FuncRequest.h"
 #include "Lexer.h"
@@ -153,6 +155,11 @@ bool ControlParagraph::inInset() const
        return ininset_;
 }
 
+bool ControlParagraph::canIndent() const
+{
+       return kernel().buffer().params().paragraph_separation == 
+               BufferParams::PARSEP_INDENT;
+}
 
 LyXAlignment ControlParagraph::alignPossible() const
 {
index f984a37b415d2d15be72112a51c69ed1117b1108..91cab426a5b68ad626edb420ac94223bf58741b8 100644 (file)
@@ -40,6 +40,8 @@ public:
        ///
        bool inInset() const;
        ///
+       bool canIndent() const;
+       ///
        LyXAlignment alignPossible() const;
        ///
        LyXAlignment alignDefault() const;
index 5575d477c1d60587dcd2e72bef12187dd3c3ab26..0145b87b418ab1b35a2a8ecb633ae8e5ebc71f00 100644 (file)
@@ -254,7 +254,9 @@ void QParagraph::update_contents()
        dialog_->alignmentToRadioButtons(newAlignment);
 
        //indentation
-       dialog_->indentCB->setChecked(!params.noindent());
+       bool const canindent = controller().canIndent();
+       dialog_->indentCB->setEnabled(canindent);
+       dialog_->indentCB->setChecked(canindent && !params.noindent());
 
        // linespacing
        int linespacing;