Author: hdu
Date: Wed Jan 8 13:57:53 2014
New Revision: 1556533
URL: http://svn.apache.org/r1556533
Log:
#i123895# make the Mac code 64bit clean regarding CGFloat/float mismatches
Modified:
openoffice/trunk/main/vcl/aqua/source/gdi/salbmp.cxx
openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx
openoffice/trunk/main/vcl/aqua/source/gdi/salnativewidgets.cxx
openoffice/trunk/main/vcl/aqua/source/window/salframe.cxx
openoffice/trunk/main/vcl/inc/aqua/salgdi.h
Modified: openoffice/trunk/main/vcl/aqua/source/gdi/salbmp.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/salbmp.cxx?rev=1556533&r1=1556532&r2=1556533&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/salbmp.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/salbmp.cxx Wed Jan 8 13:57:53
2014
@@ -772,7 +772,7 @@ CGImageRef AquaSalBitmap::CreateWithMask
CFRelease( xMask );
CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(
NULL,
pMaskMem, nHeight * nMaskBytesPerRow, &CFRTLFree ) );
- static const float* pDecode = NULL;
+ static const CGFloat* pDecode = NULL;
xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8,
nMaskBytesPerRow, xDataProvider, pDecode, false );
CFRelease( xDataProvider );
CFRelease( xMaskContext );
Modified: openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx?rev=1556533&r1=1556532&r2=1556533&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/salgdi.cxx Wed Jan 8 13:57:53
2014
@@ -1368,7 +1368,7 @@ static void DrawPattern50( void*, CGCont
void AquaSalGraphics::Pattern50Fill()
{
- static const float aFillCol[4] = { 1,1,1,1 };
+ static const CGFloat aFillCol[4] = { 1,1,1,1 };
static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, NULL };
if( ! GetSalData()->mxP50Space )
GetSalData()->mxP50Space = CGColorSpaceCreatePattern(
GetSalData()->mxRGBSpace );
@@ -1392,7 +1392,7 @@ void AquaSalGraphics::invert( long nX, l
if ( nFlags & SAL_INVERT_TRACKFRAME )
{
- const float dashLengths[2] = { 4.0, 4.0 }; // for drawing
dashed line
+ const CGFloat dashLengths[2] = { 4.0, 4.0 }; // for drawing
dashed line
CGContextSetBlendMode( mrContext, kCGBlendModeDifference );
CGContextSetRGBStrokeColor ( mrContext, 1.0, 1.0, 1.0, 1.0 );
CGContextSetLineDash ( mrContext, 0, dashLengths, 2 );
@@ -1429,7 +1429,7 @@ void AquaSalGraphics::invert( sal_uInt32
CGContextAddLines ( mrContext, CGpoints, nPoints );
if ( nSalFlags & SAL_INVERT_TRACKFRAME )
{
- const float dashLengths[2] = { 4.0, 4.0 }; // for drawing
dashed line
+ const CGFloat dashLengths[2] = { 4.0, 4.0 }; // for drawing
dashed line
CGContextSetBlendMode( mrContext, kCGBlendModeDifference );
CGContextSetRGBStrokeColor ( mrContext, 1.0, 1.0, 1.0, 1.0 );
CGContextSetLineDash ( mrContext, 0, dashLengths, 2 );
Modified: openoffice/trunk/main/vcl/aqua/source/gdi/salnativewidgets.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/gdi/salnativewidgets.cxx?rev=1556533&r1=1556532&r2=1556533&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/gdi/salnativewidgets.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/gdi/salnativewidgets.cxx Wed Jan 8
13:57:53 2014
@@ -710,11 +710,11 @@ sal_Bool AquaSalGraphics::drawNativeCont
// Perhaps some other HIThemeButtonDrawInfo setting would do
the trick ?
CGContextSetShouldAntialias( mrContext, true );
- float aGrey[] = { 0.45, 0.45, 0.45, 1.0 };
+ CGFloat aGrey[] = { 0.45, 0.45, 0.45, 1.0 };
CGContextSetFillColor( mrContext, aGrey );
CGContextBeginPath( mrContext );
- float x = rc.origin.x + rc.size.width;
- float y = rc.origin.y;
+ CGFloat x = rc.origin.x + rc.size.width;
+ CGFloat y = rc.origin.y;
CGContextMoveToPoint( mrContext, x, y );
y += rc.size.height;
CGContextAddLineToPoint( mrContext, x, y );
Modified: openoffice/trunk/main/vcl/aqua/source/window/salframe.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/window/salframe.cxx?rev=1556533&r1=1556532&r2=1556533&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/window/salframe.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/window/salframe.cxx Wed Jan 8
13:57:53 2014
@@ -1191,7 +1191,7 @@ static Color getColor( NSColor* pSysColo
NSColor* pRBGColor = [pSysColor colorUsingColorSpaceName:
NSDeviceRGBColorSpace device: [pWin deviceDescription]];
if( pRBGColor )
{
- float r = 0, g = 0, b = 0, a = 0;
+ CGFloat r = 0, g = 0, b = 0, a = 0;
[pRBGColor getRed: &r green: &g blue: &b alpha: &a];
aRet = Color( int(r*255.999), int(g*255.999), int(b*255.999) );
/*
Modified: openoffice/trunk/main/vcl/inc/aqua/salgdi.h
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/inc/aqua/salgdi.h?rev=1556533&r1=1556532&r2=1556533&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/inc/aqua/salgdi.h (original)
+++ openoffice/trunk/main/vcl/inc/aqua/salgdi.h Wed Jan 8 13:57:53 2014
@@ -40,8 +40,13 @@
class AquaSalFrame;
class AquaSalBitmap;
class ImplDevFontAttributes;
+class ImplMacTextStyle;
-class CGRect;
+struct CGRect;
+
+#ifndef CGFLOAT_TYPE
+typedef float CGFloat;
+#endif
// mac specific physically available font face
class ImplMacFontData : public ImplFontData
@@ -77,11 +82,16 @@ class RGBAColor
public:
RGBAColor( SalColor );
RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha );
//NOTUSEDYET
- const float* AsArray() const { return &mfRed; }
- bool IsVisible() const { return (mfAlpha > 0); }
- void SetAlpha( float fAlpha ) { mfAlpha = fAlpha; }
-private:
- float mfRed, mfGreen, mfBlue, mfAlpha;
+ void SetAlpha( float fAlpha ) { mfRGBA[3] = fAlpha; }
+
+ bool IsVisible() const { return (mfRGBA[3] > 0); }
+ const CGFloat* AsArray() const { return mfRGBA; }
+ CGFloat GetRed() const { return mfRGBA[0]; }
+ CGFloat GetGreen() const { return mfRGBA[1]; }
+ CGFloat GetBlue() const { return mfRGBA[2]; }
+ CGFloat GetAlpha() const { return mfRGBA[3]; }
+ private:
+ CGFloat mfRGBA[4]; // RGBA
};
// -------------------
@@ -402,17 +412,20 @@ inline void AquaSalGraphics::RefreshRect
}
inline RGBAColor::RGBAColor( SalColor nSalColor )
-: mfRed( SALCOLOR_RED(nSalColor) * (1.0/255))
-, mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255))
-, mfBlue( SALCOLOR_BLUE(nSalColor) * (1.0/255))
-, mfAlpha( 1.0 ) // opaque
-{}
+{
+ mfRGBA[0] = SALCOLOR_RED( nSalColor) * (1.0/255);
+ mfRGBA[1] = SALCOLOR_GREEN(nSalColor) * (1.0/255);
+ mfRGBA[2] = SALCOLOR_BLUE( nSalColor) * (1.0/255);
+ mfRGBA[3] = 1.0; // default to opaque
+}
inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float
fAlpha )
-: mfRed( fRed )
-, mfGreen( fGreen )
-, mfBlue( fBlue )
-, mfAlpha( fAlpha )
-{}
+{
+ mfRGBA[0] = fRed;
+ mfRGBA[1] = fGreen;
+ mfRGBA[2] = fBlue;
+ mfRGBA[3] = fAlpha;
+}
#endif // _SV_SALGDI_H
+