git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26314
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
public:
wxOpDraw(int theOp, double theX1, double theY1, double theX2, double theY2,
{
public:
wxOpDraw(int theOp, double theX1, double theY1, double theX2, double theY2,
- double radius = 0.0, wxChar *s = NULL);
+ double radius = 0.0, const wxString& s = wxEmptyString);
~wxOpDraw();
void Do(wxDC& dc, double xoffset, double yoffset);
void Scale(double scaleX, double scaleY);
~wxOpDraw();
void Do(wxDC& dc, double xoffset, double yoffset);
void Scale(double scaleX, double scaleY);
double m_x3;
double m_y3;
double m_radius;
double m_x3;
double m_y3;
double m_radius;
wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (region->GetText())
{
wxShapeRegion *region = (wxShapeRegion *)node->GetData();
if (region->GetText())
{
- wxChar *s = copystring(region->GetText());
- dividedObject->FormatText(dc, s, i);
- delete[] s;
+ wxString s(region->GetText());
+ dividedObject->FormatText(dc, s.c_str(), i);
}
node = node->GetNext();
i++;
}
node = node->GetNext();
i++;
*/
wxOpDraw::wxOpDraw(int theOp, double theX1, double theY1, double theX2, double theY2,
*/
wxOpDraw::wxOpDraw(int theOp, double theX1, double theY1, double theX2, double theY2,
- double theRadius, wxChar *s) : wxDrawOp(theOp)
+ double theRadius, const wxString& s) : wxDrawOp(theOp)
{
m_x1 = theX1;
m_y1 = theY1;
{
m_x1 = theX1;
m_y1 = theY1;
m_x3 = 0.0;
m_y3 = 0.0;
m_radius = theRadius;
m_x3 = 0.0;
m_y3 = 0.0;
m_radius = theRadius;
- if (s) m_textString = copystring(s);
- else m_textString = NULL;
}
wxOpDraw::~wxOpDraw()
{
}
wxOpDraw::~wxOpDraw()
{
- if (m_textString) delete[] m_textString;
}
wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *WXUNUSED(newImage))
}
wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *WXUNUSED(newImage))
{
m_x1 = expr->Nth(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue();
{
m_x1 = expr->Nth(1)->RealValue();
m_y1 = expr->Nth(2)->RealValue();
- wxString str(expr->Nth(3)->StringValue());
- m_textString = copystring(str);
+ m_textString = wxString(expr->Nth(3)->StringValue());
break;
}
case DRAWOP_DRAW_ARC:
break;
}
case DRAWOP_DRAW_ARC:
wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_TEXT,
(double) pt.x, (double) pt.y, 0.0, 0.0);
wxOpDraw *theOp = new wxOpDraw(DRAWOP_DRAW_TEXT,
(double) pt.x, (double) pt.y, 0.0, 0.0);
- theOp->m_textString = copystring(text);
+ theOp->m_textString = text;
dc.SetClippingRegion(
(long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
dc.SetClippingRegion(
(long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0),
- (long)width, (long)height);
+ (long)width+1, (long)height+1); // +1 to allow for rounding errors
wxNode *current = text_list->GetFirst();
while (current)
wxNode *current = text_list->GetFirst();
while (current)