diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index 44e2e42d0c..a26c15740b 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -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);