]> git.lyx.org Git - features.git/commitdiff
This optional argument to the InsetCollapsable constructor
authorRichard Heck <rgheck@comcast.net>
Sun, 26 Oct 2008 02:25:57 +0000 (02:25 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 26 Oct 2008 02:25:57 +0000 (02:25 +0000)
is more trouble than it is worth.

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

src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetERT.cpp
src/insets/InsetFlex.cpp
src/insets/InsetInfo.cpp
src/insets/InsetListings.cpp

index a64b867baac016a4ab29f50cabac8d8a22569255..d6b0bef0d807284d3316323c8056280b7e5f1483 100644 (file)
@@ -76,9 +76,8 @@ InsetCollapsable::Geometry InsetCollapsable::geometry() const
 }
 
 
-InsetCollapsable::InsetCollapsable(Buffer const & buf,
-               CollapseStatus status)
-       : InsetText(buf), status_(status),
+InsetCollapsable::InsetCollapsable(Buffer const & buf)
+       : InsetText(buf), status_(Inset::Open),
          openinlined_(false), autoOpen_(false), mouse_hover_(false)
 {
        DocumentClass const & dc = buf.params().documentClass();
index 1ef00985b81d27b1ba497e8a6c3bc8d76f5a8f04..7ae146e0390bb94039eb660c5d8a0fd05cf1bf45 100644 (file)
@@ -33,7 +33,7 @@ namespace frontend { class Painter; }
 class InsetCollapsable : public InsetText {
 public:
        ///
-       InsetCollapsable(Buffer const &, CollapseStatus status = Inset::Open);
+       InsetCollapsable(Buffer const &);
        ///
        InsetCollapsable(InsetCollapsable const & rhs);
        ///
@@ -164,7 +164,8 @@ protected:
        docstring floatName(std::string const & type, BufferParams const &) const;
        ///
        virtual void resetParagraphsFont();
-
+       ///
+       mutable CollapseStatus status_;
 private:
        /// cache for the layout_. Make sure it is in sync with the document class!
        InsetLayout const * layout_;
@@ -174,8 +175,6 @@ private:
        docstring labelstring_;
        ///
        mutable Box button_dim;
-       ///
-       mutable CollapseStatus status_;
        /// a substatus of the Open status, determined automatically in metrics
        mutable bool openinlined_;
        /// the inset will automatically open when the cursor is inside
index 888f6bccfd4e99f9c4a2c5ef64953139ad241b59..d6544cd7cb39d98cff3b3715d011691aee3fa7a5 100644 (file)
@@ -44,8 +44,10 @@ using namespace lyx::support;
 namespace lyx {
 
 InsetERT::InsetERT(Buffer const & buf, CollapseStatus status)
-       : InsetCollapsable(buf, status)
-{}
+       : InsetCollapsable(buf)
+{
+       status_ = status;
+}
 
 
 InsetERT::~InsetERT()
index d9c653af6b9634854b042f0a838d51b4d59929d1..5bc513b259fc9f38526306e645434f4a28b0bacc 100644 (file)
@@ -34,10 +34,11 @@ namespace lyx {
 
 
 InsetFlex::InsetFlex(Buffer const & buf, string const & layoutName)
-       : InsetCollapsable(buf, Collapsed), name_(layoutName)
+       : InsetCollapsable(buf), name_(layoutName)
 {
        // again, because now the name is initialized
        setLayout(buf.params().documentClassPtr());
+       status_= Collapsed;
 }
 
 
index 0704c4d819fba6ac061d61514582fd45a2a5d132..c87df0acd1f8025e4f678c65c978898a55c6be51 100644 (file)
@@ -83,10 +83,11 @@ NameTranslator const & nameTranslator()
 
        
 InsetInfo::InsetInfo(Buffer const & buf, string const & name) 
-       : InsetCollapsable(buf, Collapsed), type_(UNKNOWN_INFO), name_()
+       : InsetCollapsable(buf), type_(UNKNOWN_INFO), name_()
 {
        setAutoBreakRows(true);
        setInfo(name);
+       status_ = Collapsed;
 }
 
 
index fdd04f06133dc16dcb6f6de9d0ecb0c72ece1b48..693e205ec1ec20fb9ab72e7dfea9f1e55fc2f0e0 100644 (file)
@@ -53,8 +53,10 @@ char const lstinline_delimiters[] =
        "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
 
 InsetListings::InsetListings(Buffer const & buf, InsetListingsParams const & par)
-       : InsetCollapsable(buf, par.status())
-{}
+       : InsetCollapsable(buf)
+{
+       status_ = par.status();
+}
 
 
 InsetListings::~InsetListings()