mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 06:19:36 +00:00
* In the process of fixing the math background color bug, this commit transfer backgroundColor() management from InsetOld to InsetBase; because this will be needed for InsetMath based insets.
* 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
This commit is contained in:
parent
ee9782c624
commit
bc92746781
@ -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;
|
||||
|
@ -16,14 +16,10 @@
|
||||
#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_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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_;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user