Fix for bug 3524: Indent checkbox is enabled even when paragraphs are marked

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
This commit is contained in:
Richard Heck 2007-05-08 15:35:44 +00:00
parent 7753dd6e6f
commit bd71f0adac
3 changed files with 12 additions and 1 deletions

View 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
{

View File

@ -40,6 +40,8 @@ public:
///
bool inInset() const;
///
bool canIndent() const;
///
LyXAlignment alignPossible() const;
///
LyXAlignment alignDefault() const;

View 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;