X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1484b5cc701329c54bbe70f2a155119fd86945c7..a0086878b09ea394de9f5746a5e8f066a3d12dec:/contrib/src/ogl/divided.cpp diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 92448da749..50737984c0 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -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) {