]> git.lyx.org Git - features.git/commitdiff
Add an InsetOld::Code wrapper class, enabling #include "inset.h" to be
authorAngus Leeming <leeming@lyx.org>
Thu, 18 Sep 2003 10:52:29 +0000 (10:52 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 18 Sep 2003 10:52:29 +0000 (10:52 +0000)
removed from paragraph.h.

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

src/ChangeLog
src/insets/ChangeLog
src/insets/inset.h
src/iterators.C
src/lyxfont.h
src/paragraph.C
src/paragraph.h

index 054b62c92069ca05875595e858fc5492c9718843..dbafc1fede1eb604648606245c135348036e5da8 100644 (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>
 
index db776541fa9935c8c76b492b7c9fd671b112643b..2e203660b7b9ecaa198745e27447f3f41ef766b2 100644 (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
index a9feca8ad4b637d1265a979e63600e3c611c546c..2a7c88624359e74192314c47f226dcad6b37fd3f 100644 (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
index b01ad152a6a05f8e0f4956dcb1702bb42b725ae8..0711990bb2f5391d24d48ed228675037476973af 100644 (file)
@@ -14,6 +14,8 @@
 #include "iterators.h"
 #include "paragraph.h"
 
+#include "insets/inset.h"
+
 #include <boost/next_prior.hpp>
 #include <boost/optional.hpp>
 
index 193f0059be5ee3e05ad6d7b0a01353ac35e9bd83..f407257baff20dba65b2b02e2d57b923ba1ede17 100644 (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 {
index cd5b0699ea24040a5a2604a540c077d286404219..5091301972ffbc93adf9fe46ad0cfb148a167198 100644 (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)
index 0dba4e1cd6695f01dc002329a06f2a33f683fae3..62b1b4048fcc4d3bf87aa13379b54620fee7cb3d 100644 (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);
        ///