logical vs. boolean operators, unused decls and vars, etc
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -17,16 +17,12 @@
|
|||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/app.h"
|
|
||||||
#include "wx/dcmemory.h"
|
#include "wx/dcmemory.h"
|
||||||
#include "wx/dcprint.h"
|
|
||||||
#include "wx/region.h"
|
#include "wx/region.h"
|
||||||
#include "wx/image.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/mac/uma.h"
|
#include "wx/mac/uma.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef __MSL__
|
#ifdef __MSL__
|
||||||
#if __MSL__ >= 0x6000
|
#if __MSL__ >= 0x6000
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
@@ -58,11 +54,7 @@ const double M_PI = 3.14159265358979 ;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const double RAD2DEG = 180.0 / M_PI;
|
static const double RAD2DEG = 180.0 / M_PI;
|
||||||
const short kEmulatedMode = -1 ;
|
|
||||||
const short kUnsupportedMode = -2 ;
|
|
||||||
|
|
||||||
extern TECObjectRef s_TECNativeCToUnicode ;
|
|
||||||
|
|
||||||
#ifndef __LP64__
|
#ifndef __LP64__
|
||||||
|
|
||||||
@@ -138,8 +130,6 @@ wxMacPortSetter::~wxMacPortSetter()
|
|||||||
// Local functions
|
// Local functions
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
static inline double dmin(double a, double b) { return a < b ? a : b; }
|
|
||||||
static inline double dmax(double a, double b) { return a > b ? a : b; }
|
|
||||||
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -485,7 +475,7 @@ const CGPatternCallbacks wxMacCGPattern::ms_Callbacks = { 0, &wxMacCGPattern::_R
|
|||||||
class ImagePattern : public wxMacCGPattern
|
class ImagePattern : public wxMacCGPattern
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
ImagePattern( const wxBitmap* bmp , CGAffineTransform transform )
|
ImagePattern( const wxBitmap* bmp , const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
wxASSERT( bmp && bmp->Ok() ) ;
|
wxASSERT( bmp && bmp->Ok() ) ;
|
||||||
|
|
||||||
@@ -493,7 +483,7 @@ public :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ImagePattern takes ownership of CGImageRef passed in
|
// ImagePattern takes ownership of CGImageRef passed in
|
||||||
ImagePattern( CGImageRef image , CGAffineTransform transform )
|
ImagePattern( CGImageRef image , const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
if ( image )
|
if ( image )
|
||||||
CFRetain( image ) ;
|
CFRetain( image ) ;
|
||||||
@@ -508,7 +498,7 @@ public :
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
void Init( CGImageRef image, CGAffineTransform transform )
|
void Init( CGImageRef image, const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
m_image = image ;
|
m_image = image ;
|
||||||
if ( m_image )
|
if ( m_image )
|
||||||
@@ -534,7 +524,7 @@ protected :
|
|||||||
class HatchPattern : public wxMacCGPattern
|
class HatchPattern : public wxMacCGPattern
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
HatchPattern( int hatchstyle, CGAffineTransform transform )
|
HatchPattern( int hatchstyle, const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
m_hatch = hatchstyle ;
|
m_hatch = hatchstyle ;
|
||||||
m_imageBounds = CGRectMake( 0.0, 0.0, 8.0 , 8.0 ) ;
|
m_imageBounds = CGRectMake( 0.0, 0.0, 8.0 , 8.0 ) ;
|
||||||
@@ -658,7 +648,7 @@ void wxMacCGContext::SetPen( const wxPen &pen )
|
|||||||
CGContextSetShouldAntialias( m_cgContext , false ) ;
|
CGContextSetShouldAntialias( m_cgContext , false ) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( fill | stroke )
|
if ( fill || stroke )
|
||||||
{
|
{
|
||||||
// set up brushes
|
// set up brushes
|
||||||
m_mode = kCGPathFill ; // just a default
|
m_mode = kCGPathFill ; // just a default
|
||||||
@@ -835,7 +825,7 @@ void wxMacCGContext::SetBrush( const wxBrush &brush )
|
|||||||
CGContextSetShouldAntialias( m_cgContext , false ) ;
|
CGContextSetShouldAntialias( m_cgContext , false ) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( fill | stroke )
|
if ( fill || stroke )
|
||||||
{
|
{
|
||||||
// setup brushes
|
// setup brushes
|
||||||
m_mode = kCGPathFill ; // just a default
|
m_mode = kCGPathFill ; // just a default
|
||||||
@@ -1102,8 +1092,7 @@ void wxMacCGContext::GetPartialTextExtents(const wxString& text, wxArrayInt& wid
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSStatus status;
|
::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) ubuf , 0 , chars , chars , 1 ,
|
||||||
status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) ubuf , 0 , chars , chars , 1 ,
|
|
||||||
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
|
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ;
|
||||||
|
|
||||||
for ( int pos = 0; pos < (int)chars; pos ++ )
|
for ( int pos = 0; pos < (int)chars; pos ++ )
|
||||||
@@ -2142,7 +2131,6 @@ void wxDC::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *height
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoGetTextExtent - invalid DC") );
|
wxCHECK_RET( Ok(), wxT("wxDC(cg)::DoGetTextExtent - invalid DC") );
|
||||||
|
|
||||||
wxFont formerFont = m_font ;
|
|
||||||
if ( theFont )
|
if ( theFont )
|
||||||
{
|
{
|
||||||
m_graphicContext->SetFont( *theFont ) ;
|
m_graphicContext->SetFont( *theFont ) ;
|
||||||
|
@@ -11,22 +11,17 @@
|
|||||||
|
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#include "wx/graphics.h"
|
|
||||||
|
|
||||||
#if wxUSE_GRAPHICS_CONTEXT && wxMAC_USE_CORE_GRAPHICS
|
#if wxUSE_GRAPHICS_CONTEXT && wxMAC_USE_CORE_GRAPHICS
|
||||||
|
|
||||||
|
#include "wx/graphics.h"
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/app.h"
|
|
||||||
#include "wx/dcmemory.h"
|
|
||||||
#include "wx/dcprint.h"
|
|
||||||
#include "wx/region.h"
|
#include "wx/region.h"
|
||||||
#include "wx/image.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/mac/uma.h"
|
#include "wx/mac/uma.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef __MSL__
|
#ifdef __MSL__
|
||||||
#if __MSL__ >= 0x6000
|
#if __MSL__ >= 0x6000
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
@@ -288,19 +283,7 @@ const double M_PI = 3.14159265358979;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const double RAD2DEG = 180.0 / M_PI;
|
static const double RAD2DEG = 180.0 / M_PI;
|
||||||
const short kEmulatedMode = -1;
|
|
||||||
const short kUnsupportedMode = -2;
|
|
||||||
|
|
||||||
extern TECObjectRef s_TECNativeCToUnicode;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Local functions
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static inline double dmin(double a, double b) { return a < b ? a : b; }
|
|
||||||
static inline double dmax(double a, double b) { return a > b ? a : b; }
|
|
||||||
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// device context implementation
|
// device context implementation
|
||||||
@@ -520,7 +503,7 @@ const CGPatternCallbacks wxMacCoreGraphicsPattern::ms_Callbacks = { 0, &wxMacCor
|
|||||||
class ImagePattern : public wxMacCoreGraphicsPattern
|
class ImagePattern : public wxMacCoreGraphicsPattern
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
ImagePattern( const wxBitmap* bmp , CGAffineTransform transform )
|
ImagePattern( const wxBitmap* bmp , const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
wxASSERT( bmp && bmp->Ok() );
|
wxASSERT( bmp && bmp->Ok() );
|
||||||
|
|
||||||
@@ -528,7 +511,7 @@ public :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ImagePattern takes ownership of CGImageRef passed in
|
// ImagePattern takes ownership of CGImageRef passed in
|
||||||
ImagePattern( CGImageRef image , CGAffineTransform transform )
|
ImagePattern( CGImageRef image , const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
if ( image )
|
if ( image )
|
||||||
CFRetain( image );
|
CFRetain( image );
|
||||||
@@ -543,7 +526,7 @@ public :
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
void Init( CGImageRef image, CGAffineTransform transform )
|
void Init( CGImageRef image, const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
m_image = image;
|
m_image = image;
|
||||||
if ( m_image )
|
if ( m_image )
|
||||||
@@ -569,7 +552,7 @@ protected :
|
|||||||
class HatchPattern : public wxMacCoreGraphicsPattern
|
class HatchPattern : public wxMacCoreGraphicsPattern
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
HatchPattern( int hatchstyle, CGAffineTransform transform )
|
HatchPattern( int hatchstyle, const CGAffineTransform& transform )
|
||||||
{
|
{
|
||||||
m_hatch = hatchstyle;
|
m_hatch = hatchstyle;
|
||||||
m_imageBounds = CGRectMake( 0.0, 0.0, 8.0 , 8.0 );
|
m_imageBounds = CGRectMake( 0.0, 0.0, 8.0 , 8.0 );
|
||||||
@@ -693,7 +676,7 @@ void wxMacCoreGraphicsContext::SetPen( const wxPen &pen )
|
|||||||
CGContextSetShouldAntialias( m_cgContext , false );
|
CGContextSetShouldAntialias( m_cgContext , false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( fill | stroke )
|
if ( fill || stroke )
|
||||||
{
|
{
|
||||||
// set up brushes
|
// set up brushes
|
||||||
m_mode = kCGPathFill; // just a default
|
m_mode = kCGPathFill; // just a default
|
||||||
@@ -870,7 +853,7 @@ void wxMacCoreGraphicsContext::SetBrush( const wxBrush &brush )
|
|||||||
CGContextSetShouldAntialias( m_cgContext , false );
|
CGContextSetShouldAntialias( m_cgContext , false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( fill | stroke )
|
if ( fill || stroke )
|
||||||
{
|
{
|
||||||
// setup brushes
|
// setup brushes
|
||||||
m_mode = kCGPathFill; // just a default
|
m_mode = kCGPathFill; // just a default
|
||||||
@@ -1156,8 +1139,7 @@ void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArr
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
OSStatus status;
|
::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) ubuf , 0 , chars , chars , 1 ,
|
||||||
status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) ubuf , 0 , chars , chars , 1 ,
|
|
||||||
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout );
|
&chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout );
|
||||||
|
|
||||||
for ( int pos = 0; pos < (int)chars; pos ++ )
|
for ( int pos = 0; pos < (int)chars; pos ++ )
|
||||||
|
Reference in New Issue
Block a user