The whole file assumes fStyle cannot be NULL, and it can't be NULL unless there is

no default font at all, in which case we have more serious worries. CID 1559.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40884 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2011-03-08 21:36:35 +00:00
parent 87911f6c6e
commit 663738e98e

View File

@ -174,18 +174,16 @@ ServerFont::~ServerFont()
ServerFont&
ServerFont::operator=(const ServerFont& font)
{
if (font.fStyle) {
fSize = font.fSize;
fRotation = font.fRotation;
fShear = font.fShear;
fFalseBoldWidth = font.fFalseBoldWidth;
fFlags = font.fFlags;
fSpacing = font.fSpacing;
fEncoding = font.fEncoding;
fBounds = font.fBounds;
fSize = font.fSize;
fRotation = font.fRotation;
fShear = font.fShear;
fFalseBoldWidth = font.fFalseBoldWidth;
fFlags = font.fFlags;
fSpacing = font.fSpacing;
fEncoding = font.fEncoding;
fBounds = font.fBounds;
SetStyle(font.fStyle);
}
SetStyle(font.fStyle);
return *this;
}
@ -194,9 +192,6 @@ ServerFont::operator=(const ServerFont& font)
bool
ServerFont::operator==(const ServerFont& other) const
{
if (fStyle == NULL && other.fStyle == NULL)
return true;
if (GetFamilyAndStyle() != other.GetFamilyAndStyle())
return false;
@ -249,8 +244,7 @@ ServerFont::SetStyle(FontStyle* style)
{
if (style && style != fStyle) {
// detach from old style
if (fStyle)
fStyle->Release();
fStyle->Release();
// attach to new style
fStyle = style;
@ -284,7 +278,7 @@ ServerFont::SetFamilyAndStyle(uint16 familyID, uint16 styleID)
gFontManager->Unlock();
}
if (!style)
if (style == NULL)
return B_ERROR;
SetStyle(style);