CComponentsText: remove delete of CBox() object

Obtain of one instance of CBox() should working
just as like a new instance.
This commit is contained in:
2013-07-07 18:35:25 +02:00
parent 20fd26a65d
commit 25c40a63dd

View File

@@ -118,20 +118,15 @@ void CComponentsText::initCCText()
//define height from font size //define height from font size
height = max(height, ct_font->getHeight()); height = max(height, ct_font->getHeight());
//text box dimensions
if (ct_box== NULL){
//ensure that we have a new instance
delete ct_box;
ct_box = NULL;
}
//using of real x/y values to paint images if this text object is bound in a parent form //using of real x/y values to paint images if this text object is bound in a parent form
int tx = x, ty = y; int tx = x, ty = y;
if (cc_parent){ if (cc_parent){
tx = cc_xr; tx = cc_xr;
ty = cc_yr; ty = cc_yr;
} }
ct_box = new CBox(); //init text box dimensions
if (ct_box == NULL)
ct_box = new CBox();
ct_box->iX = tx+fr_thickness; ct_box->iX = tx+fr_thickness;
ct_box->iY = ty+fr_thickness; ct_box->iY = ty+fr_thickness;
ct_box->iWidth = width-2*fr_thickness; ct_box->iWidth = width-2*fr_thickness;