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
This commit is contained in:
Angus Leeming 2003-09-18 10:52:29 +00:00
parent d8028397b2
commit 3fbad6656f
7 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2003-09-18 Angus Leeming <leeming@lyx.org>
* 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 <martin.vermeer@hut.fi>

View File

@ -1,3 +1,7 @@
2003-09-18 Angus Leeming <leeming@lyx.org>
* inset.h: add the InsetOld::Code wrapper class InsetOld_code.
2003-09-16 Angus Leeming <leeming@lyx.org>
* insetinclude.C (localDispatch): ensure that params_.masterFilename_ is

View File

@ -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

View File

@ -14,6 +14,8 @@
#include "iterators.h"
#include "paragraph.h"
#include "insets/inset.h"
#include <boost/next_prior.hpp>
#include <boost/optional.hpp>

View File

@ -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 {

View File

@ -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)

View File

@ -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);
///