]> git.lyx.org Git - features.git/commitdiff
* In the process of fixing the math background color bug, this commit transfer backgr...
authorAbdelrazak Younes <younes@lyx.org>
Sun, 22 Apr 2007 21:40:10 +0000 (21:40 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 22 Apr 2007 21:40:10 +0000 (21:40 +0000)
* Also transfer InsetBase ctors from .h to .C

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

src/insets/inset.C
src/insets/inset.h
src/insets/insetbase.C
src/insets/insetbase.h

index 29c2a0c3eb945f3b9c2e08f01ce14109ff64e3fe..21b91021ea6d7e86ebe39dbc6f71c05b10651754 100644 (file)
@@ -19,7 +19,6 @@
 #include "debug.h"
 #include "gettext.h"
 #include "lyxtext.h"
-#include "LColor.h"
 #include "metricsinfo.h"
 #include "coordcache.h"
 
@@ -30,29 +29,14 @@ using std::string;
 
 
 InsetOld::InsetOld()
-       : //background_color_(LColor::inherit)
-         background_color_(LColor::background)
 {}
 
 
 InsetOld::InsetOld(InsetOld const & in)
-       : InsetBase(in), name_(in.name_),
-         background_color_(in.background_color_)
+       : InsetBase(in), name_(in.name_)
 {}
 
 
-void InsetOld::setBackgroundColor(LColor_color color)
-{
-       background_color_ = color;
-}
-
-
-LColor_color InsetOld::backgroundColor() const
-{
-       return LColor::color(background_color_);
-}
-
-
 void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const
 {
        //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl;
index f1a4d4856016c98dbf800e84f645defc3e7e3654..73c8a4380f72e2e04ed22de600b48d3844caf9c9 100644 (file)
 #define INSETOLD_H
 
 #include "insetbase.h"
-#include "dimension.h"
 
 
 namespace lyx {
 
-class LColor_color;
-
-
 /// Insets
 class InsetOld : public InsetBase {
 public:
@@ -40,10 +36,6 @@ public:
        void setInsetName(docstring const & s) { name_ = s; }
        ///
        virtual docstring const & getInsetName() const { return name_; }
-       ///
-       virtual void setBackgroundColor(LColor_color);
-       ///
-       LColor_color backgroundColor() const;
        /// set x/y drawing position cache
        void setPosCache(PainterInfo const &, int, int) const;
 
@@ -56,10 +48,6 @@ private:
 
        ///
        docstring name_;
-       /** We store the LColor::color value as an int to get LColor.h out
-        *  of the header file.
-        */
-       int background_color_;
 };
 
 
index 7aa2fef4a591e8d10df67e6dc58860b89e79d226..64bdb67c2c18bbb96f40a34a203167e4449f7a19 100644 (file)
@@ -108,6 +108,16 @@ static TranslatorMap const build_translator()
 }
 
 
+/// pretty arbitrary dimensions
+InsetBase::InsetBase(): dim_(10, 10, 10), background_color_(LColor::background)
+{}
+
+
+InsetBase::InsetBase(InsetBase const & i)
+: dim_(i.dim_), background_color_(i.background_color_)
+{}
+
+
 std::auto_ptr<InsetBase> InsetBase::clone() const
 {
        std::auto_ptr<InsetBase> b = doClone();
@@ -345,6 +355,18 @@ void InsetBase::dump() const
 }
 
 
+void InsetBase::setBackgroundColor(LColor_color color)
+{
+       background_color_ = color;
+}
+
+
+LColor_color InsetBase::backgroundColor() const
+{
+       return LColor::color(background_color_);
+}
+
+
 /////////////////////////////////////////
 
 bool isEditableInset(InsetBase const * inset)
index 46bdf22f19fa517e0cae52cd44ff83b2ada2778a..09990a217a52890a663f163cb5f14b99af1db5e3 100644 (file)
@@ -31,6 +31,7 @@ class FuncStatus;
 class InsetMath;
 class InsetText;
 class LaTeXFeatures;
+class LColor_color;
 class LCursor;
 class LyXLex;
 class LyXText;
@@ -445,6 +446,10 @@ public:
        ///
        int scroll() const { return 0; }
        ///
+       void setBackgroundColor(LColor_color);
+       ///
+       LColor_color backgroundColor() const;
+       ///
        enum CollapseStatus {
                Collapsed,
                Inlined,
@@ -453,9 +458,8 @@ public:
        ///
        virtual void setStatus(LCursor &, CollapseStatus) {}
 protected:
-       /// pretty arbitrary dimensions
-       InsetBase(): dim_(10, 10, 10) {}
-       InsetBase(InsetBase const & i): dim_(i.dim_) {}
+       InsetBase();
+       InsetBase(InsetBase const & i);
        /** The real dispatcher.
         *  Gets normally called from LCursor::dispatch(). LCursor::dispatch()
         *  assumes the common case of 'LFUN handled, need update'.
@@ -473,6 +477,10 @@ protected:
        mutable Dimension dim_;
 private:
        virtual std::auto_ptr<InsetBase> doClone() const = 0;
+       /** We store the LColor::color value as an int to get LColor.h out
+        *  of the header file.
+        */
+       int background_color_;
 };