From 297cd250fa5ae719b821d0a3814f2e688296f29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 1 Nov 2005 13:19:00 +0000 Subject: [PATCH] Followed Marcus' suggestion and made fHeight mutable - not nice, but cleaner than casting away the const. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14614 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/Font.h | 4 ++-- src/kits/interface/Font.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/headers/os/interface/Font.h b/headers/os/interface/Font.h index e94831e522..43cc6abc1b 100644 --- a/headers/os/interface/Font.h +++ b/headers/os/interface/Font.h @@ -262,7 +262,7 @@ friend void _font_control_(BFont*, int32, void*); uint8 fEncoding; uint16 fFace; uint32 fFlags; - font_height fHeight; + mutable font_height fHeight; uint32 _reserved[3]; void SetPacket(void *packet) const; @@ -355,4 +355,4 @@ bool unicode_block::operator!=(const unicode_block &block) const { return ((fData[0] != block.fData[0]) || (fData[1] != block.fData[1])); } -#endif +#endif /* _FONT_H_ */ diff --git a/src/kits/interface/Font.cpp b/src/kits/interface/Font.cpp index 4c51f53359..3d1a00c7b1 100644 --- a/src/kits/interface/Font.cpp +++ b/src/kits/interface/Font.cpp @@ -1026,8 +1026,9 @@ BFont::GetHeight(font_height *_height) const || code != SERVER_TRUE) return; - // who put that "const" to this method? :-) - link.Read(const_cast(&fHeight)); + // Who put that "const" to this method? :-) + // We made fHeight mutable for this, but we should drop the "const" when we can + link.Read(&fHeight); } *_height = fHeight;