]> git.lyx.org Git - lyx.git/commitdiff
* src/frontends/qt4/GuiBox.cpp:
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 4 Apr 2008 13:33:52 +0000 (13:33 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 4 Apr 2008 13:33:52 +0000 (13:33 +0000)
* src/insets/InsetBox.cpp:
- assure that framed boxes do not contain an inner box.

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

src/frontends/qt4/GuiBox.cpp
src/insets/InsetBox.cpp

index fb8d1618105938b21b70ba436d3ec087eed915b2..71546b4d1a0e9fb98af051a45de18b14f6173bc7 100644 (file)
@@ -157,6 +157,7 @@ void GuiBox::innerBoxChanged(QString const & str)
        ialignCO->setEnabled(ibox);
        halignCO->setEnabled(!ibox);
        heightCB->setEnabled(ibox);
+       pagebreakCB->setEnabled(!ibox && typeCO->currentIndex() == 1);
        if (heightCB->checkState() == Qt::Checked && ibox) {
                heightED->setEnabled(true);
                heightUnitsLC->setEnabled(true);
@@ -179,8 +180,8 @@ void GuiBox::typeChanged(int index)
        }
        if (index != 1)
                pagebreakCB->setChecked(false);
-       pagebreakCB->setEnabled(index == 1);
        int itype = innerBoxCO->currentIndex();
+       pagebreakCB->setEnabled(index == 1 && itype == 0);
        setInnerType(frameless, itype);
 }
 
@@ -228,7 +229,7 @@ void GuiBox::updateContents()
                pagebreakCB->setChecked(false);
        }
 
-       pagebreakCB->setEnabled(type == "Boxed");
+       pagebreakCB->setEnabled(type == "Boxed" && !params_.inner_box);
 
        for (int i = 0; i != gui_names_.size(); ++i) {
                if (type == ids_[i])
@@ -306,7 +307,7 @@ void GuiBox::updateContents()
 
 void GuiBox::applyView()
 {
-       bool pagebreak = pagebreakCB->isChecked();
+       bool pagebreak = pagebreakCB->isEnabled() && pagebreakCB->isChecked();
        if (pagebreak)
                params_.type = "Framed";
        else
index 254f9ea840b4c84e825e6152df8b5f843cd2d314..384526f8dbff9ca82597ea64fd5c07f689a94000 100644 (file)
@@ -184,7 +184,7 @@ bool InsetBox::forceEmptyLayout(idx_type) const
 
 bool InsetBox::showInsetDialog(BufferView * bv) const
 {
-       bv->showDialog("box", params2string(params_), 
+       bv->showDialog("box", params2string(params_),
                const_cast<InsetBox *>(this));
        return true;
 }
@@ -627,6 +627,8 @@ void InsetBoxParams::read(Lexer & lex)
        if (token == "has_inner_box") {
                lex.next();
                inner_box = lex.getInteger();
+               if (type == "Framed")
+                       inner_box = false;
        } else {
                lyxerr << "InsetBox::Read: Missing 'has_inner_box'-tag!" << endl;
                lex.pushToken(token);