]> git.lyx.org Git - features.git/commitdiff
Define a wrapper LyXFont_size for LyXFont::FONT_SIZE.
authorAngus Leeming <leeming@lyx.org>
Tue, 16 Sep 2003 13:43:30 +0000 (13:43 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 16 Sep 2003 13:43:30 +0000 (13:43 +0000)
Use it in paragraph.[Ch], allowing the removal of #include "lyxfont.h"
from paragraph.h.

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

src/ChangeLog
src/insets/ChangeLog
src/insets/insetbibitem.C
src/lyxfont.h
src/paragraph.C
src/paragraph.h

index 24d007561eabca850cfe70f6cae6b26704494f05..b49edb0215a6652611c9b76bb416d9d834247779 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-16  Angus Leeming  <leeming@lyx.org>
+
+       * lyxfont.h (LyXFont_size): a wrapper class for LyXFont::FONT_SIZE.
+
+       * paragraph.[Ch] (highestFontInRange): use LyXFont_size as function
+       arg/return type.
+
+       * paragraph.h: remove #include "lyxfont.h". Forward declare LyXFont_size.
+
 2003-09-16  Angus Leeming  <leeming@lyx.org>
 
        * paragraph.C (IsInsetChar): new function in namespace anon, moved out of
index 0798436326526457defbdc0ce0009cd7f70261ec..022715c02a3904d3d6b78c2b3531b3d7110f1d75 100644 (file)
@@ -1,3 +1,7 @@
+2003-09-16  Angus Leeming  <leeming@lyx.org>
+
+       * insetbibitem.C: add #include "lyxfont.h".
+
 2003-09-16  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * insetgraphics.C: 
index db28388306383f29e57907c48f8850209a54ddf4..2f21e403d9e6507670f78757cc643106de9b9ce2 100644 (file)
@@ -14,6 +14,7 @@
 #include "buffer.h"
 #include "BufferView.h"
 #include "funcrequest.h"
+#include "lyxfont.h"
 #include "lyxlex.h"
 #include "paragraph.h"
 
index 88f2a2f47c89d3e0c95776fddb866b07049c414c..193f0059be5ee3e05ad6d7b0a01353ac35e9bd83 100644 (file)
@@ -357,6 +357,19 @@ private:
 };
 
 
+/** \c LyXFont_size is a wrapper for LyXFont::FONT_SIZE.
+ *  It can be forward-declared andpassed as a function argument without
+ *  having to expose lyxfont.h.
+ */
+class LyXFont_size {
+        LyXFont::FONT_SIZE val_;
+public:
+       LyXFont_size(LyXFont::FONT_SIZE val) : val_(val) {}
+        operator LyXFont::FONT_SIZE() const{ return val_; }
+};
+
+
+
 inline
 LyXFont::FONT_SHAPE LyXFont::shape() const
 {
index 671e3af71359ebf0306431593ca3d6dbbad42448..084f59d191835fcf1ec1fdf439451b3d29c792d1 100644 (file)
@@ -406,9 +406,9 @@ LyXFont const Paragraph::getLayoutFont(BufferParams const & bparams,
 
 
 /// Returns the height of the highest font in range
-LyXFont::FONT_SIZE
+LyXFont_size
 Paragraph::highestFontInRange(pos_type startpos, pos_type endpos,
-                             LyXFont::FONT_SIZE const def_size) const
+                             LyXFont_size def_size) const
 {
        if (pimpl_->fontlist.empty())
                return def_size;
index fa2a4eb92ac42c9078aabdb5162af4712366c690..e06fe95de7942a1f5d94f337fada4310127b8921 100644 (file)
@@ -19,7 +19,6 @@
 #include "changes.h"
 #include "InsetList.h"
 #include "lyxlayout_ptr_fwd.h"
-#include "lyxfont.h" // Just for LyXFont::FONT_SIZE
 #include "RowList_fwd.h"
 
 #include "insets/inset.h" // Just for InsetOld::Code
@@ -36,6 +35,7 @@ class InsetBibitem;
 class Language;
 class LaTeXFeatures;
 class LatexRunParams;
+class LyXFont_size;
 class ParagraphParameters;
 class TexRow;
 class UpdatableInset;
@@ -243,10 +243,9 @@ public:
        /// pos <= size() (there is a dummy font change at the end of each par)
        void setFont(lyx::pos_type pos, LyXFont const & font);
        /// Returns the height of the highest font in range
-       LyXFont::FONT_SIZE
-       highestFontInRange(lyx::pos_type startpos,
-                          lyx::pos_type endpos,
-                          LyXFont::FONT_SIZE const def_size) const;
+       LyXFont_size highestFontInRange(lyx::pos_type startpos,
+                                       lyx::pos_type endpos,
+                                       LyXFont_size def_size) const;
        ///
        void insertChar(lyx::pos_type pos, value_type c);
        ///