From f4af685bd3e37f768974dfc1bf6d9d2a42ad5307 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Tue, 16 Sep 2003 10:30:59 +0000 Subject: [PATCH] Remove #include "LColor.h" from insettext.h. Deps down 10 to 95. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7768 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 7 ++++++- src/bufferview_funcs.C | 1 + src/insets/ChangeLog | 14 ++++++++++++++ src/insets/insetbranch.C | 1 + src/insets/insetcollapsable.h | 1 + src/insets/insettabular.C | 1 + src/insets/insettext.C | 13 ++++++++++--- src/insets/insettext.h | 8 +++++--- src/lyxfunc.C | 1 + src/rowpainter.C | 1 + src/text.C | 1 + 11 files changed, 42 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4760aa26a6..df5cea8963 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,11 @@ 2003-09-16 Angus Leeming - * bufferparams.C, paragraph_pimpl.C: add #include "LColor.h". + * bufferparams.C: + * bufferview_funcs.C: + * lyxfunc.C: + * paragraph_pimpl.C: + * rowpainter.C: + * text.C: add #include "LColor.h". 2003-09-16 Angus Leeming diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 286968a851..7945e4fbc2 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -21,6 +21,7 @@ #include "BufferView.h" #include "gettext.h" #include "language.h" +#include "LColor.h" #include "lyxlex.h" #include "lyxrow.h" #include "paragraph.h" diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 001ae35729..cd921fbe82 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,17 @@ +2003-09-16 Angus Leeming + + * insettext.[Ch] (frameColor): new accessor function. + (frame_color_): stored as an int, allows us to remove #include "LColor.h" from + insettext.h + + * insetbranch.C: + * insettabular.C: + * insettext.C: + add #include "LColor.h". + + * insetcollapsable.h: add #include "LColor.h" + (for its framecolor member variable). + 2003-09-16 Angus Leeming * insetenv.C (constructor): use accessor functions to access InsetText variables. diff --git a/src/insets/insetbranch.C b/src/insets/insetbranch.C index e72e5123e2..af18dd23cd 100644 --- a/src/insets/insetbranch.C +++ b/src/insets/insetbranch.C @@ -17,6 +17,7 @@ #include "BufferView.h" #include "funcrequest.h" #include "gettext.h" +#include "LColor.h" #include "lyxlex.h" #include "paragraph.h" diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index daa33a52e7..98c69cbb48 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -18,6 +18,7 @@ #include "insettext.h" #include "box.h" +#include "LColor.h" #include "lyxfont.h" #include diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 7872bd04ea..fb03637610 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -20,6 +20,7 @@ #include "FuncStatus.h" #include "gettext.h" #include "language.h" +#include "LColor.h" #include "lyx_cb.h" #include "lyxlex.h" #include "metricsinfo.h" diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 9bf5393754..435f4c4318 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -22,6 +22,7 @@ #include "funcrequest.h" #include "gettext.h" #include "intl.h" +#include "LColor.h" #include "lyxfind.h" #include "lyxlex.h" #include "lyxrc.h" @@ -102,11 +103,11 @@ void InsetText::init(InsetText const * ins) autoBreakRows_ = ins->autoBreakRows_; drawFrame_ = ins->drawFrame_; - frame_color_ = ins->frame_color_; + setFrameColor(ins->frameColor()); } else { textwidth_ = 0; // broken drawFrame_ = NEVER; - frame_color_ = LColor::insetframe; + setFrameColor(LColor::insetframe); autoBreakRows_ = false; } the_locking_inset = 0; @@ -280,7 +281,7 @@ void InsetText::drawFrame(Painter & pain, int x) const int const frame_y = top_baseline - dim_.asc + ttoD2; int const frame_w = dim_.wid - TEXT_TO_INSET_OFFSET; int const frame_h = dim_.asc + dim_.des - TEXT_TO_INSET_OFFSET; - pain.rectangle(frame_x, frame_y, frame_w, frame_h, frame_color_); + pain.rectangle(frame_x, frame_y, frame_w, frame_h, frameColor()); } @@ -1451,6 +1452,12 @@ void InsetText::setDrawFrame(DrawFrame how) } +EnumLColor InsetText::frameColor() const +{ + return LColor::color(frame_color_); +} + + void InsetText::setFrameColor(EnumLColor col) { frame_color_ = col; diff --git a/src/insets/insettext.h b/src/insets/insettext.h index 3ac858ff9b..d1079994fb 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -13,7 +13,6 @@ #define INSETTEXT_H #include "updatableinset.h" -#include "LColor.h" #include "ParagraphList_fwd.h" #include "RowList_fwd.h" #include "lyxtext.h" @@ -129,6 +128,7 @@ public: /// void setDrawFrame(DrawFrame); /// + EnumLColor frameColor() const; void setFrameColor(EnumLColor); /// LyXText * getLyXText(BufferView const *, @@ -268,8 +268,10 @@ private: bool autoBreakRows_; /// DrawFrame drawFrame_; - /// - LColor::color frame_color_; + /** We store the LColor::color value as an int to get LColor.h out + * of the header file. + */ + int frame_color_; /// mutable bool locked; /// diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 58260527de..13a9d2d8ee 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -37,6 +37,7 @@ #include "intl.h" #include "iterators.h" #include "kbmap.h" +#include "LColor.h" #include "lyx_cb.h" #include "LyXAction.h" #include "lyxfind.h" diff --git a/src/rowpainter.C b/src/rowpainter.C index 18f92e9b17..0410a79437 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -19,6 +19,7 @@ #include "encoding.h" #include "gettext.h" #include "language.h" +#include "LColor.h" #include "lyxrc.h" #include "lyxrow.h" #include "lyxrow_funcs.h" diff --git a/src/text.C b/src/text.C index 934c7a7b5b..cb29a4cd86 100644 --- a/src/text.C +++ b/src/text.C @@ -26,6 +26,7 @@ #include "funcrequest.h" #include "gettext.h" #include "language.h" +#include "LColor.h" #include "lyxlength.h" #include "lyxrc.h" #include "lyxrow.h"