]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/ogl/divided.cpp
Applied patch [ 919791 ] [widgets sample] Update wxListbox selection handling
[wxWidgets.git] / contrib / src / ogl / divided.cpp
index 92448da7497981bb17a1946ae795e6d22f9c0285..50737984c032dc384c993b36a7ce56ef252bddbb 100644 (file)
@@ -81,7 +81,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
 
   if (m_pen) dc.SetPen(* m_pen);
 
-  if (m_textColour) dc.SetTextForeground(* m_textColour);
+  dc.SetTextForeground(m_textColour);
 
 #ifdef __WXMSW__
   // For efficiency, don't do this under X - doesn't make
@@ -107,7 +107,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc)
   {
     wxShapeRegion *region = (wxShapeRegion *)node->GetData();
     dc.SetFont(* region->GetFont());
-    dc.SetTextForeground(region->GetActualColourObject());
+    dc.SetTextForeground(region->GetActualColourObject());
 
     double proportion =
       region->m_regionProportionY < 0.0 ? defaultProportion : region->m_regionProportionY;
@@ -243,18 +243,8 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y,
   // Left or right.
   else
   {
-    int i = 0;
-    bool isLeft = FALSE;
-    if (attachment < (n+1))
-    {
-      i = attachment-1;
-      isLeft = FALSE;
-    }
-    else
-    {
-      i = (totalNumberAttachments - attachment - 1);
-      isLeft = TRUE;
-    }
+    bool isLeft = !(attachment < (n+1));
+    int i = (isLeft) ? (totalNumberAttachments - attachment - 1) : (attachment-1);
     wxNode *node = GetRegions().Item(i);
     if (node)
     {