]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcollapsable.C
* In the process of fixing the math background color bug, this commit transfer backgr...
[lyx.git] / src / insets / insetcollapsable.C
index 68ea69ac4baad138ffbf04d9b80c871c97a62537..0c480765c7af010bc22a93af0a9ce36a13356b55 100644 (file)
@@ -173,6 +173,8 @@ bool InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
                        } else {
                                dim.des += textdim_.height() + TEXT_TO_BOTTOM_OFFSET;
                                dim.wid = max(dim.wid, textdim_.wid);
+                               if (hasFixedWidth())
+                                       dim.wid = max(dim.wid, mi.base.textwidth);
                        }
                }
        }
@@ -441,6 +443,9 @@ void InsetCollapsable::setStatus(LCursor & cur, CollapseStatus status)
        setButtonLabel();
        if (status_ == Collapsed)
                cur.leaveInset(*this);
+       // Because we save CollapseStatus in lyx file, change of status
+       // should lead to a dirty buffer. (This fixes bug 2993).
+       cur.bv().buffer()->markDirty();
 }
 
 
@@ -449,7 +454,7 @@ void InsetCollapsable::setLabelFont(LyXFont & font)
        labelfont_ = font;
 }
 
-docstring InsetCollapsable::floatName(string const & type, BufferParams const & bp)
+docstring InsetCollapsable::floatName(string const & type, BufferParams const & bp) const
 {
        FloatList const & floats = bp.getLyXTextClass().floats();
        FloatList::const_iterator it = floats[type];