BFont::_GetExtraFlags() no longer returns a status value, but fills in default
values in case the server communication failed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14742 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -247,7 +247,7 @@ class BFont {
|
|||||||
mutable uint32 fExtraFlags;
|
mutable uint32 fExtraFlags;
|
||||||
uint32 _reserved[2];
|
uint32 _reserved[2];
|
||||||
|
|
||||||
status_t _GetExtraFlags() const;
|
void _GetExtraFlags() const;
|
||||||
void _GetBoundingBoxes(const char charArray[],
|
void _GetBoundingBoxes(const char charArray[],
|
||||||
int32 numChars, font_metric_mode mode,
|
int32 numChars, font_metric_mode mode,
|
||||||
bool string_escapement, escapement_delta *delta,
|
bool string_escapement, escapement_delta *delta,
|
||||||
|
|||||||
@@ -585,9 +585,7 @@ BFont::Flags() const
|
|||||||
font_direction
|
font_direction
|
||||||
BFont::Direction() const
|
BFont::Direction() const
|
||||||
{
|
{
|
||||||
if (_GetExtraFlags() != B_OK)
|
_GetExtraFlags();
|
||||||
return B_FONT_LEFT_TO_RIGHT;
|
|
||||||
|
|
||||||
return (font_direction)(fExtraFlags >> B_PRIVATE_FONT_DIRECTION_SHIFT);
|
return (font_direction)(fExtraFlags >> B_PRIVATE_FONT_DIRECTION_SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1170,12 +1168,12 @@ BFont::PrintToStream() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
void
|
||||||
BFont::_GetExtraFlags() const
|
BFont::_GetExtraFlags() const
|
||||||
{
|
{
|
||||||
// TODO: this has to be const in order to allow other font getters to stay const as well
|
// TODO: this has to be const in order to allow other font getters to stay const as well
|
||||||
if (fExtraFlags != kUninitializedExtraFlags)
|
if (fExtraFlags != kUninitializedExtraFlags)
|
||||||
return B_OK;
|
return;
|
||||||
|
|
||||||
BPrivate::AppServerLink link;
|
BPrivate::AppServerLink link;
|
||||||
link.StartMessage(AS_GET_EXTRA_FONT_FLAGS);
|
link.StartMessage(AS_GET_EXTRA_FONT_FLAGS);
|
||||||
@@ -1184,9 +1182,11 @@ BFont::_GetExtraFlags() const
|
|||||||
|
|
||||||
status_t status = B_ERROR;
|
status_t status = B_ERROR;
|
||||||
if (link.FlushWithReply(status) != B_OK
|
if (link.FlushWithReply(status) != B_OK
|
||||||
|| status != B_OK)
|
|| status != B_OK) {
|
||||||
return status;
|
// use defaut values for the flags
|
||||||
|
fExtraFlags = (uint32)B_FONT_LEFT_TO_RIGHT << B_PRIVATE_FONT_DIRECTION_SHIFT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
link.Read<uint32>(&fExtraFlags);
|
link.Read<uint32>(&fExtraFlags);
|
||||||
return B_OK;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user