Finally got around to removing the memory leak.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2855 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+19
-17
@@ -1,7 +1,7 @@
|
|||||||
#include <Rect.h>
|
#include <Rect.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "Font.h"
|
#include <Font.h>
|
||||||
|
/*
|
||||||
class BFontPrivate
|
class BFontPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -35,11 +35,11 @@ BFontPrivate & BFontPrivate::operator=(const BFontPrivate &fontdata)
|
|||||||
fDirection=fontdata.fDirection;
|
fDirection=fontdata.fDirection;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
BFont::BFont(void)
|
BFont::BFont(void)
|
||||||
{
|
{
|
||||||
private_data=new BFontPrivate();
|
// private_data=new BFontPrivate();
|
||||||
if(be_plain_font)
|
if(be_plain_font)
|
||||||
{
|
{
|
||||||
fFamilyID=be_plain_font->fFamilyID;
|
fFamilyID=be_plain_font->fFamilyID;
|
||||||
@@ -51,7 +51,7 @@ BFont::BFont(void)
|
|||||||
fEncoding=be_plain_font->fEncoding;
|
fEncoding=be_plain_font->fEncoding;
|
||||||
fFace=be_plain_font->fFace;
|
fFace=be_plain_font->fFace;
|
||||||
fHeight=be_plain_font->fHeight;
|
fHeight=be_plain_font->fHeight;
|
||||||
private_data->fPrivateFlags=be_plain_font->private_data->fPrivateFlags;
|
// private_data->fPrivateFlags=be_plain_font->private_data->fPrivateFlags;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -66,13 +66,13 @@ BFont::BFont(void)
|
|||||||
fHeight.ascent=0.0;
|
fHeight.ascent=0.0;
|
||||||
fHeight.descent=0.0;
|
fHeight.descent=0.0;
|
||||||
fHeight.leading=0.0;
|
fHeight.leading=0.0;
|
||||||
private_data->fPrivateFlags=0;
|
// private_data->fPrivateFlags=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BFont::BFont(const BFont &font)
|
BFont::BFont(const BFont &font)
|
||||||
{
|
{
|
||||||
private_data=new BFontPrivate();
|
// private_data=new BFontPrivate();
|
||||||
fFamilyID=font.fFamilyID;
|
fFamilyID=font.fFamilyID;
|
||||||
fStyleID=font.fStyleID;
|
fStyleID=font.fStyleID;
|
||||||
fSize=font.fSize;
|
fSize=font.fSize;
|
||||||
@@ -82,12 +82,12 @@ BFont::BFont(const BFont &font)
|
|||||||
fEncoding=font.fEncoding;
|
fEncoding=font.fEncoding;
|
||||||
fFace=font.fFace;
|
fFace=font.fFace;
|
||||||
fHeight=font.fHeight;
|
fHeight=font.fHeight;
|
||||||
private_data->fPrivateFlags=font.private_data->fPrivateFlags;
|
// private_data->fPrivateFlags=font.private_data->fPrivateFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
BFont::BFont(const BFont *font)
|
BFont::BFont(const BFont *font)
|
||||||
{
|
{
|
||||||
private_data=new BFontPrivate();
|
// private_data=new BFontPrivate();
|
||||||
if(font)
|
if(font)
|
||||||
{
|
{
|
||||||
fFamilyID=font->fFamilyID;
|
fFamilyID=font->fFamilyID;
|
||||||
@@ -99,7 +99,7 @@ BFont::BFont(const BFont *font)
|
|||||||
fEncoding=font->fEncoding;
|
fEncoding=font->fEncoding;
|
||||||
fFace=font->fFace;
|
fFace=font->fFace;
|
||||||
fHeight=font->fHeight;
|
fHeight=font->fHeight;
|
||||||
private_data->fPrivateFlags=font->private_data->fPrivateFlags;
|
// private_data->fPrivateFlags=font->private_data->fPrivateFlags;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -114,7 +114,7 @@ BFont::BFont(const BFont *font)
|
|||||||
fEncoding=be_plain_font->fEncoding;
|
fEncoding=be_plain_font->fEncoding;
|
||||||
fFace=be_plain_font->fFace;
|
fFace=be_plain_font->fFace;
|
||||||
fHeight=be_plain_font->fHeight;
|
fHeight=be_plain_font->fHeight;
|
||||||
private_data->fPrivateFlags=be_plain_font->private_data->fPrivateFlags;
|
// private_data->fPrivateFlags=be_plain_font->private_data->fPrivateFlags;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -129,7 +129,7 @@ BFont::BFont(const BFont *font)
|
|||||||
fHeight.ascent=0.0;
|
fHeight.ascent=0.0;
|
||||||
fHeight.descent=0.0;
|
fHeight.descent=0.0;
|
||||||
fHeight.leading=0.0;
|
fHeight.leading=0.0;
|
||||||
private_data->fPrivateFlags=0;
|
// private_data->fPrivateFlags=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,7 +413,7 @@ BFont &BFont::operator=(const BFont &font)
|
|||||||
fEncoding=font.fEncoding;
|
fEncoding=font.fEncoding;
|
||||||
fFace=font.fFace;
|
fFace=font.fFace;
|
||||||
fHeight=font.fHeight;
|
fHeight=font.fHeight;
|
||||||
private_data->fPrivateFlags=font.private_data->fPrivateFlags;
|
// private_data->fPrivateFlags=font.private_data->fPrivateFlags;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,8 +429,9 @@ bool BFont::operator==(const BFont &font) const
|
|||||||
fFace!=font.fFace ||
|
fFace!=font.fFace ||
|
||||||
fHeight.ascent!=font.fHeight.ascent ||
|
fHeight.ascent!=font.fHeight.ascent ||
|
||||||
fHeight.descent!=font.fHeight.descent ||
|
fHeight.descent!=font.fHeight.descent ||
|
||||||
fHeight.leading!=font.fHeight.leading ||
|
fHeight.leading!=font.fHeight.leading //||
|
||||||
private_data->fPrivateFlags!=font.private_data->fPrivateFlags )
|
// private_data->fPrivateFlags!=font.private_data->fPrivateFlags
|
||||||
|
)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -447,8 +448,9 @@ bool BFont::operator!=(const BFont &font) const
|
|||||||
fFace!=font.fFace ||
|
fFace!=font.fFace ||
|
||||||
fHeight.ascent!=font.fHeight.ascent ||
|
fHeight.ascent!=font.fHeight.ascent ||
|
||||||
fHeight.descent!=font.fHeight.descent ||
|
fHeight.descent!=font.fHeight.descent ||
|
||||||
fHeight.leading!=font.fHeight.leading ||
|
fHeight.leading!=font.fHeight.leading //||
|
||||||
private_data->fPrivateFlags!=font.private_data->fPrivateFlags )
|
// private_data->fPrivateFlags!=font.private_data->fPrivateFlags
|
||||||
|
)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user