]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/ogl/drawn.cpp
set SMALL_FONT for controls here because InheritAttributes() doesn't do it any longer
[wxWidgets.git] / contrib / src / ogl / drawn.cpp
index 15b1863a49bfc15279bba5c6be4b31debe1afb71..3733cdacd03a2df1dcd975c2a348fd9ad36821d5 100644 (file)
@@ -89,8 +89,7 @@ void wxDrawnShape::SetSize(double w, double h, bool WXUNUSED(recursive))
     scaleY = 1.0;
   else scaleY = h/GetHeight();
 
-  int i = 0;
-  for (i = 0; i < 4; i++)
+  for (int i = 0; i < 4; i++)
   {
     if (m_metafiles[i].IsValid())
         m_metafiles[i].Scale(scaleX, scaleY);
@@ -242,8 +241,7 @@ void wxDrawnShape::WriteAttributes(wxExpr *clause)
   clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile);
   if (m_saveToFile)
   {
-    int i = 0;
-    for (i = 0; i < 4; i++)
+    for (int i = 0; i < 4; i++)
     {
         if (m_metafiles[i].IsValid())
             m_metafiles[i].WriteAttributes(clause, i);
@@ -262,8 +260,7 @@ void wxDrawnShape::ReadAttributes(wxExpr *clause)
 
   if (m_saveToFile)
   {
-    int i = 0;
-    for (i = 0; i < 4; i++)
+    for (int i = 0; i < 4; i++)
     {
       m_metafiles[i].ReadAttributes(clause, i);
     }
@@ -280,8 +277,7 @@ void wxDrawnShape::Copy(wxShape& copy)
 
   wxDrawnShape& drawnCopy = (wxDrawnShape&) copy;
 
-  int i = 0;
-  for (i = 0; i < 4; i++)
+  for (int i = 0; i < 4; i++)
   {
     m_metafiles[i].Copy(drawnCopy.m_metafiles[i]);
   }
@@ -680,7 +676,7 @@ void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr)
  */
 
 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;
@@ -689,13 +685,11 @@ wxOpDraw::wxOpDraw(int theOp, double theX1, double theY1, double theX2, double t
   m_x3 = 0.0;
   m_y3 = 0.0;
   m_radius = theRadius;
-  if (s) m_textString = copystring(s);
-  else m_textString = NULL;
+  m_textString = s;
 }
 
 wxOpDraw::~wxOpDraw()
 {
-  if (m_textString) delete[] m_textString;
 }
 
 wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *WXUNUSED(newImage))
@@ -972,8 +966,7 @@ void wxOpDraw::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr)
     {
       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:
@@ -1261,8 +1254,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1,
   double *xpoints = new double[n];
   double *ypoints = new double[n];
 
-  int i = 0;
-  for (i = 0; i < n; i++)
+  for (int i = 0; i < n; i++)
   {
     wxRealPoint *point = & (m_points[i]);
     xpoints[i] = point->x + xOffset;
@@ -2370,7 +2362,7 @@ void wxPseudoMetaFile::DrawText(const wxString& text, const wxPoint& pt)
     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;
 
     m_ops.Append(theOp);
 }