Make the BObjectList member for font families a non-pointer.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28596 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -97,7 +97,7 @@ class Message : public BScreenSaver
|
|||||||
status_t StartSaver(BView *view, bool preview);
|
status_t StartSaver(BView *view, bool preview);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BObjectList<font_family> *fFontFamilies;
|
BObjectList<font_family> fFontFamilies;
|
||||||
float fScaleFactor;
|
float fScaleFactor;
|
||||||
bool fPreview;
|
bool fPreview;
|
||||||
};
|
};
|
||||||
@@ -111,19 +111,15 @@ BScreenSaver *instantiate_screen_saver(BMessage *msg, image_id image)
|
|||||||
|
|
||||||
Message::Message(BMessage *archive, image_id id)
|
Message::Message(BMessage *archive, image_id id)
|
||||||
: BScreenSaver(archive, id)
|
: BScreenSaver(archive, id)
|
||||||
, fFontFamilies(NULL)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Message::~Message()
|
Message::~Message()
|
||||||
{
|
{
|
||||||
if (fFontFamilies) {
|
for (int32 i = 0; i < fFontFamilies.CountItems(); i++) {
|
||||||
for (int32 i = 0; i < fFontFamilies->CountItems(); i++) {
|
if (fFontFamilies.ItemAt(i))
|
||||||
if (fFontFamilies->ItemAt(i))
|
delete fFontFamilies.ItemAt(i);
|
||||||
delete fFontFamilies->ItemAt(i);
|
|
||||||
}
|
|
||||||
delete fFontFamilies;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,14 +142,13 @@ Message::StartSaver(BView *view, bool preview)
|
|||||||
|
|
||||||
// Get font families
|
// Get font families
|
||||||
int numFamilies = count_font_families();
|
int numFamilies = count_font_families();
|
||||||
fFontFamilies = new BObjectList<font_family>();
|
|
||||||
for (int32 i = 0; i < numFamilies; i++) {
|
for (int32 i = 0; i < numFamilies; i++) {
|
||||||
font_family *family = new font_family[1];
|
font_family *family = new font_family[1];
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
if (get_font_family(i, family, &flags) == B_OK) {
|
if (get_font_family(i, family, &flags) == B_OK) {
|
||||||
// Do not add fixed fonts
|
// Do not add fixed fonts
|
||||||
if (!(flags & B_IS_FIXED))
|
if (!(flags & B_IS_FIXED))
|
||||||
fFontFamilies->AddItem(family);
|
fFontFamilies.AddItem(family);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +194,7 @@ Message::Draw(BView *view, int32 frame)
|
|||||||
BFont font;
|
BFont font;
|
||||||
offscreen.GetFont(&font);
|
offscreen.GetFont(&font);
|
||||||
font.SetFace(B_BOLD_FACE);
|
font.SetFace(B_BOLD_FACE);
|
||||||
font.SetFamilyAndStyle(*(fFontFamilies->ItemAt(rand() % fFontFamilies->CountItems())), NULL);
|
font.SetFamilyAndStyle(*(fFontFamilies.ItemAt(rand() % fFontFamilies.CountItems())), NULL);
|
||||||
offscreen.SetFont(&font);
|
offscreen.SetFont(&font);
|
||||||
|
|
||||||
// Get the message
|
// Get the message
|
||||||
|
|||||||
Reference in New Issue
Block a user