summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-12-10 01:08:40 +0200
committerTor Lillqvist <tml@iki.fi>2012-12-10 01:22:10 +0200
commite8edaed36e50ee33d1d241ce7ebfbeb0911ccf02 (patch)
tree57e97c68c40be97fe3a4a13d8325c6764e6f2971 /vcl/aqua
parenta55c3a3875bb78fd7d2e802cde89f690e0d7fbfa (diff)
WaE: narrowing from int/long to float in initializer list (-Wc++11-narrowing)
Warnings from Clang now with -std=gnu++0x. Change-Id: I3a77e3171b0a298d8a35dd18270453a8a0bc4f07
Diffstat (limited to 'vcl/aqua')
-rw-r--r--vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm2
-rw-r--r--vcl/aqua/source/app/salinst.cxx2
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm6
-rw-r--r--vcl/aqua/source/gdi/aquaprintview.mm2
-rw-r--r--vcl/aqua/source/gdi/atsui/salatslayout.cxx2
-rw-r--r--vcl/aqua/source/gdi/salbmp.cxx4
-rw-r--r--vcl/aqua/source/gdi/salgdicommon.cxx36
-rw-r--r--vcl/aqua/source/gdi/salgdiutils.cxx2
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx2
-rw-r--r--vcl/aqua/source/gdi/salvd.cxx2
-rw-r--r--vcl/aqua/source/window/salframe.cxx14
-rw-r--r--vcl/aqua/source/window/salframeview.mm6
-rw-r--r--vcl/aqua/source/window/salnsmenu.mm15
-rw-r--r--vcl/aqua/source/window/salobj.cxx4
14 files changed, 50 insertions, 49 deletions
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index 74f815385f42..db4e94e6dc93 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -98,7 +98,7 @@ using namespace ::rtl;
+(void)addColor:(sal_Int32)salColor forAttribute:(NSString *)attribute andRange:(NSRange)range toString:(NSMutableAttributedString *)string {
if ( salColor != -1 ) {
- CGFloat elements[] = { salColor & 0x00ff0000, salColor & 0x0000ff00, salColor & 0x000000ff };
+ CGFloat elements[] = { static_cast<CGFloat>(salColor & 0x00ff0000), static_cast<CGFloat>(salColor & 0x0000ff00), static_cast<CGFloat>(salColor & 0x000000ff) };
CGColorRef color = CGColorCreate ( CGColorSpaceCreateWithName ( kCGColorSpaceGenericRGB ), elements );
[ string addAttribute: attribute value: (id) color range: range ];
CGColorRelease ( color );
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 90a3fa737429..715005dec906 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -1303,7 +1303,7 @@ NSImage* CreateNSImage( const Image& rImage )
NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
CGContextRef rCGContext = reinterpret_cast<CGContextRef>([pContext graphicsPort]);
- const CGRect aDstRect = { {0, 0}, { aSize.Width(), aSize.Height() } };
+ const CGRect aDstRect = { {0, 0}, { static_cast<CGFloat>(aSize.Width()), static_cast<CGFloat>(aSize.Height()) } };
CGContextDrawImage( rCGContext, aDstRect, xImage );
[pImage unlockFocus];
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
index 643b6df13f30..3dba1c4ad3c0 100644
--- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -799,7 +799,7 @@ static void addBool( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
ControlTarget* pCtrlTarget
)
{
- NSRect aCheckRect = { { rCurX + nAttachOffset, 0 }, { 0, 15 } };
+ NSRect aCheckRect = { { static_cast<CGFloat>(rCurX + nAttachOffset), 0 }, { 0, 15 } };
NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
[pBtn setButtonType: NSSwitchButton];
[pBtn setState: bValue ? NSOnState : NSOffState];
@@ -868,7 +868,7 @@ static void addRadio( NSView* pCurParent, long& rCurX, long& rCurY, long nAttach
// setup radio matrix
NSButtonCell* pProto = [[NSButtonCell alloc] init];
- NSRect aRadioRect = { { rCurX + nOff, 0 }, { 280 - rCurX, 5*rChoices.getLength() } };
+ NSRect aRadioRect = { { static_cast<CGFloat>(rCurX + nOff), 0 }, { static_cast<CGFloat>(280 - rCurX), static_cast<CGFloat>(5*rChoices.getLength()) } };
[pProto setTitle: @"RadioButtonGroup"];
[pProto setButtonType: NSRadioButton];
NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
@@ -1002,7 +1002,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
nOff = aTextRect.size.width + 5;
}
- NSRect aFieldRect = { { rCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
+ NSRect aFieldRect = { { static_cast<CGFloat>(rCurX + nOff + nAttachOffset), 0 }, { 100, 25 } };
NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
[pFieldView setEditable: YES];
[pFieldView setSelectable: YES];
diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm
index 90a39155a067..d7957eecb5e2 100644
--- a/vcl/aqua/source/gdi/aquaprintview.mm
+++ b/vcl/aqua/source/gdi/aquaprintview.mm
@@ -49,7 +49,7 @@
// #i101108# sanity check
if( nWidth < 1 )
nWidth = 1;
- NSRect aRect = { { page % nWidth, page / nWidth }, aPaperSize };
+ NSRect aRect = { { static_cast<CGFloat>(page % nWidth), static_cast<CGFloat>(page / nWidth) }, aPaperSize };
return aRect;
}
diff --git a/vcl/aqua/source/gdi/atsui/salatslayout.cxx b/vcl/aqua/source/gdi/atsui/salatslayout.cxx
index a9c1288bcd02..1c6dafd1bf59 100644
--- a/vcl/aqua/source/gdi/atsui/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/atsui/salatslayout.cxx
@@ -236,7 +236,7 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs )
#endif
// create the ATSUI layout
- UniCharCount nRunLengths[1] = { mnCharCount };
+ UniCharCount nRunLengths[1] = { static_cast<UniCharCount>(mnCharCount) };
const int nRunCount = sizeof(nRunLengths)/sizeof(*nRunLengths);
OSStatus eStatus = ATSUCreateTextLayoutWithTextPtr( rArgs.mpStr,
rArgs.mnMinCharPos, mnCharCount, rArgs.mnLength,
diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx
index 5b0f2ebb278a..8d8afa2e5dc7 100644
--- a/vcl/aqua/source/gdi/salbmp.cxx
+++ b/vcl/aqua/source/gdi/salbmp.cxx
@@ -88,7 +88,7 @@ bool AquaSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
CreateContext();
// copy layer content into the bitmap buffer
- const CGPoint aSrcPoint = { -nX, -nY };
+ const CGPoint aSrcPoint = { static_cast<CGFloat>(-nX), static_cast<CGFloat>(-nY) };
::CGContextDrawLayerAtPoint( mxGraphicContext, aSrcPoint, xLayer );
return true;
}
@@ -731,7 +731,7 @@ CGImageRef AquaSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, int
else
{
nY = mnHeight - (nY + nNewHeight); // adjust for y-mirrored context
- const CGRect aCropRect = {{nX, nY}, {nNewWidth, nNewHeight}};
+ const CGRect aCropRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nNewWidth), static_cast<CGFloat>(nNewHeight) } };
xCroppedImage = CGImageCreateWithImageInRect( mxCachedImage, aCropRect );
}
diff --git a/vcl/aqua/source/gdi/salgdicommon.cxx b/vcl/aqua/source/gdi/salgdicommon.cxx
index 8485e00128f0..4fbca5aa1fe5 100644
--- a/vcl/aqua/source/gdi/salgdicommon.cxx
+++ b/vcl/aqua/source/gdi/salgdicommon.cxx
@@ -323,7 +323,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGrap
DBG_ASSERT( pSrc->mxLayer!=NULL, "AquaSalGraphics::copyBits() from non-layered graphics" );
- const CGPoint aDstPoint = { +pPosAry->mnDestX - pPosAry->mnSrcX, pPosAry->mnDestY - pPosAry->mnSrcY };
+ const CGPoint aDstPoint = { static_cast<CGFloat>(+pPosAry->mnDestX - pPosAry->mnSrcX), static_cast<CGFloat>(pPosAry->mnDestY - pPosAry->mnSrcY) };
if( (pPosAry->mnSrcWidth == pPosAry->mnDestWidth &&
pPosAry->mnSrcHeight == pPosAry->mnDestHeight) &&
(!mnBitmapDepth || (aDstPoint.x + pSrc->mnWidth) <= mnWidth) ) // workaround a Quartz crasher
@@ -339,7 +339,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGrap
}
}
CGContextSaveGState( xCopyContext );
- const CGRect aDstRect = { {pPosAry->mnDestX, pPosAry->mnDestY}, {pPosAry->mnDestWidth, pPosAry->mnDestHeight} };
+ const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) }, { static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextClipToRect( xCopyContext, aDstRect );
// draw at new destination
@@ -456,10 +456,10 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
CGLayerRef xSrcLayer = mxLayer;
// TODO: if( mnBitmapDepth > 0 )
{
- const CGSize aSrcSize = { nSrcWidth, nSrcHeight };
+ const CGSize aSrcSize = { static_cast<CGFloat>(nSrcWidth), static_cast<CGFloat>(nSrcHeight) };
xSrcLayer = ::CGLayerCreateWithContext( xCopyContext, aSrcSize, NULL );
const CGContextRef xSrcContext = CGLayerGetContext( xSrcLayer );
- CGPoint aSrcPoint = { -nSrcX, -nSrcY };
+ CGPoint aSrcPoint = { static_cast<CGFloat>(-nSrcX), static_cast<CGFloat>(-nSrcY) };
if( IsFlipped() )
{
::CGContextTranslateCTM( xSrcContext, 0, +nSrcHeight );
@@ -470,7 +470,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
}
// draw at new destination
- const CGPoint aDstPoint = { +nDstX, +nDstY };
+ const CGPoint aDstPoint = { static_cast<CGFloat>(+nDstX), static_cast<CGFloat>(+nDstY) };
::CGContextDrawLayerAtPoint( xCopyContext, aDstPoint, xSrcLayer );
// cleanup
@@ -521,7 +521,7 @@ bool AquaSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
}
if ( CheckContext() )
{
- const CGRect aDstRect = {{rTR.mnDestX, rTR.mnDestY}, {rTR.mnDestWidth, rTR.mnDestHeight}};
+ const CGRect aDstRect = { { static_cast<CGFloat>(rTR.mnDestX), static_cast<CGFloat>(rTR.mnDestY) }, { static_cast<CGFloat>(rTR.mnDestWidth), static_cast<CGFloat>(rTR.mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xMaskedImage );
RefreshRect( aDstRect );
}
@@ -541,7 +541,7 @@ bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
CGContextSaveGState( mrContext );
CGContextSetAlpha( mrContext, (100-nTransparency) * (1.0/100) );
- CGRect aRect = {{nX,nY},{nWidth-1,nHeight-1}};
+ CGRect aRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nWidth-1), static_cast<CGFloat>(nHeight-1) } };
if( IsPenVisible() )
{
aRect.origin.x += 0.5;
@@ -571,8 +571,8 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rS
{
return;
}
- const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY},
- {pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
+ const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) },
+ { static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xImage );
CGImageRelease( xImage );
RefreshRect( aDstRect );
@@ -599,8 +599,8 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rS
{
return;
}
- const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY},
- {pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
+ const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY)},
+ { static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xMaskedImage );
CGImageRelease( xMaskedImage );
RefreshRect( aDstRect );
@@ -637,7 +637,7 @@ sal_Bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
[NSGraphicsContext setCurrentContext: pDrawNSCtx];
// draw the EPS
- const NSRect aDstRect = {{nX,nY},{nWidth,nHeight}};
+ const NSRect aDstRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) } };
const BOOL bOK = [xEpsImage drawInRect: aDstRect];
// restore the NSGraphicsContext
@@ -688,8 +688,8 @@ void AquaSalGraphics::drawMask( const SalTwoRect* pPosAry,
{
return;
}
- const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY},
- {pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
+ const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) },
+ { static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xImage );
CGImageRelease( xImage );
RefreshRect( aDstRect );
@@ -1150,7 +1150,7 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY )
{
nY = mnHeight - nY;
}
- const CGPoint aCGPoint = {-nX, -nY};
+ const CGPoint aCGPoint = { static_cast<CGFloat>(-nX), static_cast<CGFloat>(-nY) };
CGContextDrawLayerAtPoint( xOnePixelContext, aCGPoint, mxLayer );
CGContextRelease( xOnePixelContext );
@@ -1178,7 +1178,7 @@ void AquaSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
// overwrite the fill color
CGContextSetFillColor( mrContext, rColor.AsArray() );
// draw 1x1 rect, there is no pixel drawing in Quartz
- CGRect aDstRect = {{nX,nY,},{1,1}};
+ CGRect aDstRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, {1,1}};
CGContextFillRect( mrContext, aDstRect );
RefreshRect( aDstRect );
// reset the fill color
@@ -1457,7 +1457,7 @@ bool AquaSalGraphics::setClipRegion( const Region& i_rClip )
{
if( nW && nH )
{
- CGRect aRect = {{nX,nY}, {nW,nH}};
+ CGRect aRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nW), static_cast<CGFloat>(nH) } };
CGPathAddRect( mxClipPath, NULL, aRect );
}
bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
@@ -1687,7 +1687,7 @@ bool XorEmulation::UpdateTarget()
const int nWidth = (int)CGImageGetWidth( xXorImage );
const int nHeight = (int)CGImageGetHeight( xXorImage );
// TODO: update minimal changerect
- const CGRect aFullRect = {{0,0},{nWidth,nHeight}};
+ const CGRect aFullRect = { {0, 0}, { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) } };
CGContextDrawImage( m_xTargetContext, aFullRect, xXorImage );
CGImageRelease( xXorImage );
}
diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx
index 8de1da137349..a6ffc0c27638 100644
--- a/vcl/aqua/source/gdi/salgdiutils.cxx
+++ b/vcl/aqua/source/gdi/salgdiutils.cxx
@@ -189,7 +189,7 @@ bool AquaSalGraphics::CheckContext()
if( !mrContext )
{
- const CGSize aLayerSize = {nWidth,nHeight};
+ const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getWindow()];
CGContextRef xCGContext = reinterpret_cast<CGContextRef>([pNSGContext graphicsPort]);
mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, NULL );
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index da2014d85982..dab0bb9a9ecf 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -229,7 +229,7 @@ void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientatio
}
else if( i_nWidth > 0 && i_nHeight > 0 )
{
- NSSize aPaperSize = { TenMuToPt(i_nWidth), TenMuToPt(i_nHeight) };
+ NSSize aPaperSize = { static_cast<CGFloat>(TenMuToPt(i_nWidth)), static_cast<CGFloat>(TenMuToPt(i_nHeight)) };
[mpPrintInfo setPaperSize: aPaperSize];
}
// this seems counterintuitive
diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx
index 9696b9a83651..36d9c7c26139 100644
--- a/vcl/aqua/source/gdi/salvd.cxx
+++ b/vcl/aqua/source/gdi/salvd.cxx
@@ -214,7 +214,7 @@ sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
DBG_ASSERT( xCGContext, "no context" );
- const CGSize aNewSize = { nDX, nDY };
+ const CGSize aNewSize = { static_cast<CGFloat>(nDX), static_cast<CGFloat>(nDY) };
mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, NULL );
if( mxLayer && mpGraphics )
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index d2e616c920da..5aa6f0f3b7a6 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -217,7 +217,7 @@ void AquaSalFrame::initWindowAndView()
{
objc_msgSend(mpWindow, @selector(setRestorable:), NO);
}
- NSRect aRect = { { 0,0 }, { maGeometry.nWidth, maGeometry.nHeight } };
+ NSRect aRect = { { 0,0 }, { static_cast<CGFloat>(maGeometry.nWidth), static_cast<CGFloat>(maGeometry.nHeight) } };
mnTrackingRectTag = [mpView addTrackingRect: aRect owner: mpView userData: nil assumeInside: NO];
maSysData.pView = mpView;
@@ -508,7 +508,7 @@ void AquaSalFrame::SetMinClientSize( long nWidth, long nHeight )
nWidth += maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
nHeight += maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
- NSSize aSize = { nWidth, nHeight };
+ NSSize aSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
// Size of full window (content+structure) although we only
// have the client size in arguments
@@ -537,7 +537,7 @@ void AquaSalFrame::SetMaxClientSize( long nWidth, long nHeight )
if (nWidth>32767) nWidth=32767;
if (nHeight>32767) nHeight=32767;
- NSSize aSize = { nWidth, nHeight };
+ NSSize aSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
// Size of full window (content+structure) although we only
// have the client size in arguments
@@ -554,7 +554,7 @@ void AquaSalFrame::SetClientSize( long nWidth, long nHeight )
if( mpWindow )
{
- NSSize aSize = { nWidth, nHeight };
+ NSSize aSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
[mpWindow setContentSize: aSize];
UpdateFrameGeometry();
@@ -962,7 +962,7 @@ void AquaSalFrame::SetPointerPos( long nX, long nY )
// FIXME: use Cocoa functions
// FIXME: multiscreen support
- CGPoint aPoint = { nX + maGeometry.nX, nY + maGeometry.nY };
+ CGPoint aPoint = { static_cast<CGFloat>(nX + maGeometry.nX), static_cast<CGFloat>(nY + maGeometry.nY) };
CGDirectDisplayID mainDisplayID = CGMainDisplayID();
CGDisplayMoveCursorToPoint( mainDisplayID, aPoint );
}
@@ -999,7 +999,7 @@ void AquaSalFrame::Flush( const Rectangle& rRect )
// #i113170# may not be the main thread if called from UNO API
SalData::ensureThreadAutoreleasePool();
- NSRect aNSRect = { {rRect.Left(), rRect.Top()}, { rRect.GetWidth(), rRect.GetHeight() } };
+ NSRect aNSRect = { { static_cast<CGFloat>(rRect.Left()), static_cast<CGFloat>(rRect.Top()) }, { static_cast<CGFloat>(rRect.GetWidth()), static_cast<CGFloat>(rRect.GetHeight()) } };
VCLToCocoa( aNSRect, false );
[mpView setNeedsDisplayInRect: aNSRect];
@@ -1743,7 +1743,7 @@ void AquaSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight
if( nWidth && nHeight )
{
- NSRect aRect = { { nX, nY }, { nWidth, nHeight } };
+ NSRect aRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) } };
VCLToCocoa( aRect, false );
maClippingRects.push_back( CGRectMake(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height) );
}
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 5567260d5b51..d6861a489277 100644
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -143,8 +143,8 @@ static AquaSalFrame* getMouseContainerFrame()
{
mDraggingDestinationHandler = nil;
mpFrame = pFrame;
- NSRect aRect = { { pFrame->maGeometry.nX, pFrame->maGeometry.nY },
- { pFrame->maGeometry.nWidth, pFrame->maGeometry.nHeight } };
+ NSRect aRect = { { static_cast<CGFloat>(pFrame->maGeometry.nX), static_cast<CGFloat>(pFrame->maGeometry.nY) },
+ { static_cast<CGFloat>(pFrame->maGeometry.nWidth), static_cast<CGFloat>(pFrame->maGeometry.nHeight) } };
pFrame->VCLToCocoa( aRect );
NSWindow* pNSWindow = [super initWithContentRect: aRect styleMask: mpFrame->getStyleMask() backing: NSBackingStoreBuffered defer: NO ];
[pNSWindow useOptimizedDrawing: YES]; // OSX recommendation when there are no overlapping subviews within the receiver
@@ -410,7 +410,7 @@ static AquaSalFrame* getMouseContainerFrame()
if( mpFrame && AquaSalFrame::isAlive( mpFrame ) )
{
// FIXME: does this leak the returned NSCursor of getCurrentCursor ?
- NSRect aRect = { { 0, 0 }, { mpFrame->maGeometry.nWidth, mpFrame->maGeometry.nHeight } };
+ NSRect aRect = { { 0, 0 }, { static_cast<CGFloat>(mpFrame->maGeometry.nWidth), static_cast<CGFloat>(mpFrame->maGeometry.nHeight) } };
[self addCursorRect: aRect cursor: mpFrame->getCurrentCursor()];
}
}
diff --git a/vcl/aqua/source/window/salnsmenu.mm b/vcl/aqua/source/window/salnsmenu.mm
index 3163b876de70..39c36aec7615 100644
--- a/vcl/aqua/source/window/salnsmenu.mm
+++ b/vcl/aqua/source/window/salnsmenu.mm
@@ -132,8 +132,8 @@
for( size_t i = 0; i < rButtons.size(); ++i )
{
NSRect aFromRect = { { 0, 0 },
- { rButtons[i].maButton.maImage.GetSizePixel().Width(),
- rButtons[i].maButton.maImage.GetSizePixel().Height() } };
+ { static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Width()),
+ static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Height()) } };
aImgRect.origin.y = floor((aFrame.size.height - aFromRect.size.height)/2);
aImgRect.size = aFromRect.size;
if( rButtons[i].mpNSImage )
@@ -156,8 +156,8 @@
for( size_t i = 0; i < rButtons.size(); ++i )
{
NSRect aFromRect = { { 0, 0 },
- { rButtons[i].maButton.maImage.GetSizePixel().Width(),
- rButtons[i].maButton.maImage.GetSizePixel().Height() } };
+ { static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Width()),
+ static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Height()) } };
aImgRect.origin.y = (aFrame.size.height - aFromRect.size.height)/2;
aImgRect.size = aFromRect.size;
if( aMousePt.x >= aImgRect.origin.x && aMousePt.x <= (aImgRect.origin.x+aImgRect.size.width) &&
@@ -189,9 +189,10 @@
aSize.width = 2;
for( size_t i = 0; i < rButtons.size(); ++i )
{
- NSRect aImgRect = { { aSize.width, floor((aSize.height-rButtons[i].maButton.maImage.GetSizePixel().Height())/2) },
- { rButtons[i].maButton.maImage.GetSizePixel().Width(),
- rButtons[i].maButton.maImage.GetSizePixel().Height() } };
+ NSRect aImgRect = { { static_cast<CGFloat>(aSize.width),
+ static_cast<CGFloat>(floor((aSize.height-rButtons[i].maButton.maImage.GetSizePixel().Height())/2)) },
+ { static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Width()),
+ static_cast<CGFloat>(rButtons[i].maButton.maImage.GetSizePixel().Height()) } };
if( rButtons[i].mpToolTipString )
[self addToolTipRect: aImgRect owner: rButtons[i].mpToolTipString userData: NULL];
aSize.width += 2 + aImgRect.size.width;
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index 32803678abbb..abf085cdd5d1 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -162,14 +162,14 @@ void AquaSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
void AquaSalObject::setClippedPosSize()
{
- NSRect aViewRect = { { 0, 0 }, { mnWidth, mnHeight } };
+ NSRect aViewRect = { { 0, 0 }, { static_cast<CGFloat>(mnWidth), static_cast<CGFloat>(mnHeight) } };
if( maSysData.pView )
{
NSView *pView = maSysData.pView;
[pView setFrame: aViewRect];
}
- NSRect aClipViewRect = { { mnX, mnY }, { mnWidth, mnHeight } };
+ NSRect aClipViewRect = { { static_cast<CGFloat>(mnX), static_cast<CGFloat>(mnY) }, { static_cast<CGFloat>(mnWidth), static_cast<CGFloat>(mnHeight) } };
NSPoint aClipPt = { 0, 0 };
if( mbClip )
{