From 3fbad6656fd967a98cc24ba9ffe37b01f9bc9e40 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 18 Sep 2003 10:52:29 +0000 Subject: [PATCH] Add an InsetOld::Code wrapper class, enabling #include "inset.h" to be removed from paragraph.h. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7786 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/insets/ChangeLog | 4 ++++ src/insets/inset.h | 12 ++++++++++++ src/iterators.C | 2 ++ src/lyxfont.h | 2 +- src/paragraph.C | 2 +- src/paragraph.h | 6 +++--- 7 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 054b62c920..dbafc1fede 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-09-18 Angus Leeming + + * paragraph.[Ch] (insetAllowed): use the InsetOld::Code wrapper class + InsetOld_code to remove #include "inset.h". + + * iterators.C: add #include "inset.h" 2003-09-16 Martin Vermeer diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index db776541fa..2e203660b7 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-09-18 Angus Leeming + + * inset.h: add the InsetOld::Code wrapper class InsetOld_code. + 2003-09-16 Angus Leeming * insetinclude.C (localDispatch): ensure that params_.masterFilename_ is diff --git a/src/insets/inset.h b/src/insets/inset.h index a9feca8ad4..2a7c886243 100644 --- a/src/insets/inset.h +++ b/src/insets/inset.h @@ -332,6 +332,18 @@ private: }; +/** \c InsetOld_code is a wrapper for InsetOld::Code. + * It can be forward-declared and passed as a function argument without + * having to expose inset.h. + */ +class InsetOld_code { + InsetOld::Code val_; +public: + InsetOld_code(InsetOld::Code val) : val_(val) {} + operator InsetOld::Code() const{ return val_; } +}; + + /** * returns true if pointer argument is valid * and points to an editable inset diff --git a/src/iterators.C b/src/iterators.C index b01ad152a6..0711990bb2 100644 --- a/src/iterators.C +++ b/src/iterators.C @@ -14,6 +14,8 @@ #include "iterators.h" #include "paragraph.h" +#include "insets/inset.h" + #include #include diff --git a/src/lyxfont.h b/src/lyxfont.h index 193f0059be..f407257baf 100644 --- a/src/lyxfont.h +++ b/src/lyxfont.h @@ -358,7 +358,7 @@ private: /** \c LyXFont_size is a wrapper for LyXFont::FONT_SIZE. - * It can be forward-declared andpassed as a function argument without + * It can be forward-declared and passed as a function argument without * having to expose lyxfont.h. */ class LyXFont_size { diff --git a/src/paragraph.C b/src/paragraph.C index cd5b0699ea..5091301972 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -285,7 +285,7 @@ void Paragraph::insertInset(pos_type pos, InsetOld * inset, } -bool Paragraph::insetAllowed(InsetOld::Code code) +bool Paragraph::insetAllowed(InsetOld_code code) { //lyxerr << "Paragraph::InsertInsetAllowed" << endl; if (pimpl_->inset_owner) diff --git a/src/paragraph.h b/src/paragraph.h index 0dba4e1cd6..62b1b4048f 100644 --- a/src/paragraph.h +++ b/src/paragraph.h @@ -21,8 +21,6 @@ #include "lyxlayout_ptr_fwd.h" #include "RowList_fwd.h" -#include "insets/inset.h" // Just for InsetOld::Code - #include "support/types.h" #include "support/std_string.h" @@ -32,9 +30,11 @@ class BufferParams; class BufferView; class Counters; class InsetBibitem; +class InsetOld_code; class Language; class LaTeXFeatures; class LatexRunParams; +class LyXFont; class LyXFont_size; class ParagraphParameters; class TexRow; @@ -259,7 +259,7 @@ public: /// void insertInset(lyx::pos_type pos, InsetOld * inset, LyXFont const &, Change change = Change(Change::INSERTED)); /// - bool insetAllowed(InsetOld::Code code); + bool insetAllowed(InsetOld_code code); /// InsetOld * getInset(lyx::pos_type pos); /// -- 2.39.2