Define a wrapper LyXFont_size for LyXFont::FONT_SIZE.

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
This commit is contained in:
Angus Leeming 2003-09-16 13:43:30 +00:00
parent e7e92ec660
commit f5a0bad734
6 changed files with 33 additions and 7 deletions

View 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

View 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:

View File

@ -14,6 +14,7 @@
#include "buffer.h"
#include "BufferView.h"
#include "funcrequest.h"
#include "lyxfont.h"
#include "lyxlex.h"
#include "paragraph.h"

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

View 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;

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