diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-19 17:45:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-20 10:45:48 +0100 |
commit | fc528a468061e165ee29f0ca450245331da3ef93 (patch) | |
tree | 150188c8939379c0134cc827ad94e2225cb8d4a8 /vcl | |
parent | 0b87fdcad55d1927241073bc15c174168c5e0c1d (diff) |
More loplugin:cstylecast on macOS
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after
cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some
more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More
loplugin:cstylecast"
Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870
Reviewed-on: https://gerrit.libreoffice.org/48216
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/osx/salprn.h | 2 | ||||
-rw-r--r-- | vcl/osx/DragSource.cxx | 4 | ||||
-rw-r--r-- | vcl/osx/DropTarget.cxx | 6 | ||||
-rw-r--r-- | vcl/osx/a11ycomponentwrapper.mm | 4 | ||||
-rw-r--r-- | vcl/osx/a11yfactory.mm | 10 | ||||
-rw-r--r-- | vcl/osx/a11ylistener.cxx | 2 | ||||
-rw-r--r-- | vcl/osx/a11yrolehelper.mm | 2 | ||||
-rw-r--r-- | vcl/osx/a11ytextattributeswrapper.mm | 2 | ||||
-rw-r--r-- | vcl/osx/a11ytextwrapper.mm | 6 | ||||
-rw-r--r-- | vcl/osx/a11yutil.mm | 2 | ||||
-rw-r--r-- | vcl/osx/a11yvaluewrapper.mm | 2 | ||||
-rw-r--r-- | vcl/osx/a11ywrapper.mm | 26 | ||||
-rw-r--r-- | vcl/osx/a11ywrappercombobox.mm | 2 | ||||
-rw-r--r-- | vcl/osx/a11ywrapperscrollarea.mm | 4 | ||||
-rw-r--r-- | vcl/osx/printaccessoryview.mm | 28 | ||||
-rw-r--r-- | vcl/osx/printview.mm | 4 | ||||
-rw-r--r-- | vcl/osx/salframe.cxx | 10 | ||||
-rw-r--r-- | vcl/osx/salframeview.mm | 6 | ||||
-rw-r--r-- | vcl/osx/salinst.cxx | 2 | ||||
-rw-r--r-- | vcl/osx/salmenu.cxx | 2 | ||||
-rw-r--r-- | vcl/osx/salobj.cxx | 8 | ||||
-rw-r--r-- | vcl/osx/vclnsapp.mm | 4 | ||||
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 8 | ||||
-rw-r--r-- | vcl/quartz/salbmp.cxx | 8 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 18 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 16 | ||||
-rw-r--r-- | vcl/source/fontsubset/sft.cxx | 4 |
27 files changed, 96 insertions, 96 deletions
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h index 8e390bcaa33b..b82095c7559f 100644 --- a/vcl/inc/osx/salprn.h +++ b/vcl/inc/osx/salprn.h @@ -143,7 +143,7 @@ class AquaSalPrinter : public SalPrinter const double fPtTo100thMM = 35.27777778; -inline int PtTo10Mu( double nPoints ) { return (int)((nPoints*fPtTo100thMM)+0.5); } +inline int PtTo10Mu( double nPoints ) { return static_cast<int>((nPoints*fPtTo100thMM)+0.5); } inline double TenMuToPt( double nUnits ) { return floor((nUnits/fPtTo100thMM)+0.5); } diff --git a/vcl/osx/DragSource.cxx b/vcl/osx/DragSource.cxx index 5adb522610d9..6fa4b9d12f4d 100644 --- a/vcl/osx/DragSource.cxx +++ b/vcl/osx/DragSource.cxx @@ -153,7 +153,7 @@ DragSource::DragSource(): DragSource::~DragSource() { if( mpFrame && AquaSalFrame::isAlive( mpFrame ) ) - [(id <MouseEventListener>)mView unregisterMouseEventListener: mDragSourceHelper]; + [static_cast<id <MouseEventListener>>(mView) unregisterMouseEventListener: mDragSourceHelper]; [mDragSourceHelper release]; } @@ -198,7 +198,7 @@ void SAL_CALL DragSource::initialize(const Sequence< Any >& aArguments) static_cast<OWeakObject*>(this)); } - [(id <MouseEventListener>)mView registerMouseEventListener: mDragSourceHelper]; + [static_cast<id <MouseEventListener>>(mView) registerMouseEventListener: mDragSourceHelper]; } sal_Bool SAL_CALL DragSource::isDragImageSupported( ) diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx index 55f8fc732568..4d99f3c69982 100644 --- a/vcl/osx/DropTarget.cxx +++ b/vcl/osx/DropTarget.cxx @@ -130,7 +130,7 @@ DropTarget::DropTarget() : DropTarget::~DropTarget() { if( AquaSalFrame::isAlive( mpFrame ) ) - [(id <DraggingDestinationHandler>)mView unregisterDraggingDestinationHandler:mDropTargetHelper]; + [static_cast<id <DraggingDestinationHandler>>(mView) unregisterDraggingDestinationHandler:mDropTargetHelper]; [mDropTargetHelper release]; } @@ -361,11 +361,11 @@ void SAL_CALL DropTarget::initialize(const Sequence< Any >& aArguments) sal_uInt64 tmp = 0; pNSView >>= tmp; mView = reinterpret_cast<id>(tmp); - mpFrame = [(SalFrameView*)mView getSalFrame]; + mpFrame = [static_cast<SalFrameView*>(mView) getSalFrame]; mDropTargetHelper = [[DropTargetHelper alloc] initWithDropTarget: this]; - [(id <DraggingDestinationHandler>)mView registerDraggingDestinationHandler:mDropTargetHelper]; + [static_cast<id <DraggingDestinationHandler>>(mView) registerDraggingDestinationHandler:mDropTargetHelper]; [mView registerForDraggedTypes: DataFlavorMapper::getAllSupportedPboardTypes()]; id wnd = [mView window]; diff --git a/vcl/osx/a11ycomponentwrapper.mm b/vcl/osx/a11ycomponentwrapper.mm index e389f176d637..4595ee096b7e 100644 --- a/vcl/osx/a11ycomponentwrapper.mm +++ b/vcl/osx/a11ycomponentwrapper.mm @@ -32,7 +32,7 @@ using namespace ::com::sun::star::uno; +(id)sizeAttributeForElement:(AquaA11yWrapper *)wrapper { Size size = [ wrapper accessibleComponent ] -> getSize(); - NSSize nsSize = NSMakeSize ( (float) size.Width, (float) size.Height ); + NSSize nsSize = NSMakeSize ( static_cast<float>(size.Width), static_cast<float>(size.Height) ); return [ NSValue valueWithSize: nsSize ]; } @@ -42,7 +42,7 @@ using namespace ::com::sun::star::uno; NSRect screenRect = [ [ NSScreen mainScreen ] frame ]; Size size = [ wrapper accessibleComponent ] -> getSize(); Point location = [ wrapper accessibleComponent ] -> getLocationOnScreen(); - NSPoint nsPoint = NSMakePoint ( (float) location.X, (float) ( screenRect.size.height - size.Height - location.Y ) ); + NSPoint nsPoint = NSMakePoint ( static_cast<float>(location.X), static_cast<float>( screenRect.size.height - size.Height - location.Y ) ); return [ NSValue valueWithPoint: nsPoint ]; } diff --git a/vcl/osx/a11yfactory.mm b/vcl/osx/a11yfactory.mm index 0068bf853aca..6a173bbbf633 100644 --- a/vcl/osx/a11yfactory.mm +++ b/vcl/osx/a11yfactory.mm @@ -99,7 +99,7 @@ static bool enabled = false; } else { nKey = [ AquaA11yFactory keyForAccessibleContext: rxAccessibleContext ]; } - AquaA11yWrapper * aWrapper = (AquaA11yWrapper *) [ dAllWrapper objectForKey: nKey ]; + AquaA11yWrapper * aWrapper = static_cast<AquaA11yWrapper *>([ dAllWrapper objectForKey: nKey ]); if ( aWrapper != nil ) { [ aWrapper retain ]; } else if ( bCreate ) { @@ -166,10 +166,10 @@ static bool enabled = false; if (parent) { if ([parent isKindOfClass:[NSView class]]) { // SAL_DEBUG("Wrapper INIT: " << [[aWrapper description] UTF8String] << " ==> " << [[parent description] UTF8String]); - NSView *parentView = (NSView *)parent; + NSView *parentView = static_cast<NSView *>(parent); [parentView addSubview:aWrapper positioned:NSWindowBelow relativeTo:nil]; } else if ([parent isKindOfClass:NSClassFromString(@"SalFrameWindow")]) { - NSWindow *window = (NSWindow *)parent; + NSWindow *window = static_cast<NSWindow *>(parent); NSView *salView = [window contentView]; // SAL_DEBUG("Wrapper INIT SAL: " << [[aWrapper description] UTF8String] << " ==> " << [[salView description] UTF8String]); [salView addSubview:aWrapper positioned:NSWindowBelow relativeTo:nil]; @@ -204,13 +204,13 @@ static bool enabled = false; +(void)registerView: (NSView *) theView { if ( enabled && [ theView isKindOfClass: [ AquaA11yWrapper class ] ] ) { // insertIntoWrapperRepository gets called from SalFrameView itself to bootstrap the bridge initially - [ (AquaA11yWrapper *) theView accessibleContext ]; + [ static_cast<AquaA11yWrapper *>(theView) accessibleContext ]; } } +(void)revokeView: (NSView *) theView { if ( enabled && [ theView isKindOfClass: [ AquaA11yWrapper class ] ] ) { - [ AquaA11yFactory removeFromWrapperRepositoryFor: [ (AquaA11yWrapper *) theView accessibleContext ] ]; + [ AquaA11yFactory removeFromWrapperRepositoryFor: [ static_cast<AquaA11yWrapper *>(theView) accessibleContext ] ]; } } diff --git a/vcl/osx/a11ylistener.cxx b/vcl/osx/a11ylistener.cxx index 3a9499c7ffcc..7bb794f65b27 100644 --- a/vcl/osx/a11ylistener.cxx +++ b/vcl/osx/a11ylistener.cxx @@ -63,7 +63,7 @@ AquaA11yEventListener::~AquaA11yEventListener() void SAL_CALL AquaA11yEventListener::disposing( const EventObject& ) { - [ AquaA11yFactory removeFromWrapperRepositoryFor: [ (AquaA11yWrapper *) m_wrapperObject accessibleContext ] ]; + [ AquaA11yFactory removeFromWrapperRepositoryFor: [ static_cast<AquaA11yWrapper *>(m_wrapperObject) accessibleContext ] ]; } void SAL_CALL diff --git a/vcl/osx/a11yrolehelper.mm b/vcl/osx/a11yrolehelper.mm index e28fc1ad4d6f..2ce476b94c7d 100644 --- a/vcl/osx/a11yrolehelper.mm +++ b/vcl/osx/a11yrolehelper.mm @@ -142,7 +142,7 @@ using namespace ::com::sun::star::uno; } else if ( accessibleContext -> getAccessibleParent().is() ) { Reference < XAccessibleContext > rxParentContext = accessibleContext -> getAccessibleParent() -> getAccessibleContext(); if ( rxParentContext.is() ) { - NSString * roleParent = (NSString *) [ AquaA11yRoleHelper simpleMapNativeRoleFrom: rxParentContext.get() ]; + NSString * roleParent = static_cast<NSString *>([ AquaA11yRoleHelper simpleMapNativeRoleFrom: rxParentContext.get() ]); if ( [ roleParent isEqualToString: NSAccessibilityOutlineRole ] ) { [ nativeRole release ]; nativeRole = NSAccessibilityRowRole; diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm index 34408ba0af6e..8605405d9454 100644 --- a/vcl/osx/a11ytextattributeswrapper.mm +++ b/vcl/osx/a11ytextattributeswrapper.mm @@ -267,7 +267,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'NSJustifiedTextAlignment' is deprecated: first deprecated in macOS 10.12 // 'NSLeftTextAlignment' is deprecated: first deprecated in macOS 10.12 // 'NSRightTextAlignment' is deprecated: first deprecated in macOS 10.12 - switch((css::style::ParagraphAdjust)alignment) { + switch(static_cast<css::style::ParagraphAdjust>(alignment)) { case css::style::ParagraphAdjust_RIGHT : textAlignment = [NSNumber numberWithInteger:NSRightTextAlignment] ; break; case css::style::ParagraphAdjust_CENTER: textAlignment = [NSNumber numberWithInteger:NSCenterTextAlignment] ; break; case css::style::ParagraphAdjust_BLOCK : textAlignment = [NSNumber numberWithInteger:NSJustifiedTextAlignment]; break; diff --git a/vcl/osx/a11ytextwrapper.mm b/vcl/osx/a11ytextwrapper.mm index b76bee5f5594..a6a060d5fe46 100644 --- a/vcl/osx/a11ytextwrapper.mm +++ b/vcl/osx/a11ytextwrapper.mm @@ -60,7 +60,7 @@ using namespace ::com::sun::star::uno; +(void)setSelectedTextAttributeForElement:(AquaA11yWrapper *)wrapper to:(id)value { if ( [ wrapper accessibleEditableText ] ) { NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ]; - OUString newText = GetOUString ( (NSString *) value ); + OUString newText = GetOUString ( static_cast<NSString *>(value) ); NSRange selectedTextRange = [ [ AquaA11yTextWrapper selectedTextRangeAttributeForElement: wrapper ] rangeValue ]; try { [ wrapper accessibleEditableText ] -> replaceText ( selectedTextRange.location, selectedTextRange.location + selectedTextRange.length, newText ); @@ -153,7 +153,7 @@ using namespace ::com::sun::star::uno; +(id)lineForIndexAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)index { NSNumber * lineNumber = nil; try { - sal_Int32 line = [ wrapper accessibleMultiLineText ] -> getLineNumberAtIndex ( (sal_Int32) [ index intValue ] ); + sal_Int32 line = [ wrapper accessibleMultiLineText ] -> getLineNumberAtIndex ( static_cast<sal_Int32>([ index intValue ]) ); lineNumber = [ NSNumber numberWithInt: line ]; } catch ( IndexOutOfBoundsException & e ) { // empty @@ -267,7 +267,7 @@ using namespace ::com::sun::star::uno; +(id)rTFForRangeAttributeForElement:(AquaA11yWrapper *)wrapper forParameter:(id)range { NSData * rtfData = nil; - NSAttributedString * attrString = (NSAttributedString *) [ AquaA11yTextWrapper attributedStringForRangeAttributeForElement: wrapper forParameter: range ]; + NSAttributedString * attrString = static_cast<NSAttributedString *>([ AquaA11yTextWrapper attributedStringForRangeAttributeForElement: wrapper forParameter: range ]); if ( attrString != nil ) { @try { rtfData = [ attrString RTFFromRange: [ range rangeValue ] documentAttributes: @{NSDocumentTypeDocumentAttribute : NSRTFTextDocumentType} ]; diff --git a/vcl/osx/a11yutil.mm b/vcl/osx/a11yutil.mm index 66d574fac616..de0389a19e23 100644 --- a/vcl/osx/a11yutil.mm +++ b/vcl/osx/a11yutil.mm @@ -30,7 +30,7 @@ using namespace ::com::sun::star::awt; +(NSValue *)vclPointToNSPoint:(Point)vclPoint { // VCL coordinates are in upper-left-notation, Cocoa likes it the Cartesian way (lower-left) NSRect screenRect = [ [ NSScreen mainScreen ] frame ]; - NSPoint nsPoint = NSMakePoint ( (float) vclPoint.X, (float) ( screenRect.size.height - vclPoint.Y ) ); + NSPoint nsPoint = NSMakePoint ( static_cast<float>(vclPoint.X), static_cast<float>( screenRect.size.height - vclPoint.Y ) ); return [ NSValue valueWithPoint: nsPoint ]; } diff --git a/vcl/osx/a11yvaluewrapper.mm b/vcl/osx/a11yvaluewrapper.mm index 6251fdc1dca6..ef6cf6e7a400 100644 --- a/vcl/osx/a11yvaluewrapper.mm +++ b/vcl/osx/a11yvaluewrapper.mm @@ -62,7 +62,7 @@ using namespace ::com::sun::star::uno; // TODO: Detect Type from NSNumber if ( [ value isKindOfClass: [ NSNumber class ] ] && [ wrapper accessibleValue ] ) { - NSNumber * number = (NSNumber *) value; + NSNumber * number = static_cast<NSNumber *>(value); Any numberAny ( [ number longValue ] ); [ wrapper accessibleValue ] -> setCurrentValue ( numberAny ); } diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm index 37ad10c3242a..a02cc81995fa 100644 --- a/vcl/osx/a11ywrapper.mm +++ b/vcl/osx/a11ywrapper.mm @@ -327,7 +327,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { return children; } else if ( [ self accessibleTable ] ) { - AquaA11yTableWrapper* pTable = [self isKindOfClass: [AquaA11yTableWrapper class]] ? (AquaA11yTableWrapper*)self : nil; + AquaA11yTableWrapper* pTable = [self isKindOfClass: [AquaA11yTableWrapper class]] ? static_cast<AquaA11yTableWrapper*>(self) : nil; return [ AquaA11yTableWrapper childrenAttributeForElement: pTable ]; } else { try { @@ -352,7 +352,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { if ( ! mActsAsRadioGroup ) { NSEnumerator * enumerator = [ children objectEnumerator ]; AquaA11yWrapper * element; - while ( ( element = ( (AquaA11yWrapper *) [ enumerator nextObject ] ) ) ) { + while ( ( element = static_cast<AquaA11yWrapper *>([ enumerator nextObject ]) ) ) { if ( [ element accessibleContext ] -> getAccessibleRole() == AccessibleRole::RADIO_BUTTON ) { if ( [ element isFirstRadioButtonInGroup ] ) { id wrapper = [ AquaA11yFactory wrapperForAccessibleContext: [ element accessibleContext ] createIfNotExists: YES asRadioGroup: YES ]; @@ -746,8 +746,8 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { NSAccessibilityTopLevelUIElementAttribute, NSAccessibilityRoleDescriptionAttribute, nil ]; - nativeSubrole = (NSString *) [ AquaA11yRoleHelper getNativeSubroleFrom: [ self accessibleContext ] -> getAccessibleRole() ]; - title = (NSString *) [ self titleAttribute ]; + nativeSubrole = static_cast<NSString *>([ AquaA11yRoleHelper getNativeSubroleFrom: [ self accessibleContext ] -> getAccessibleRole() ]); + title = static_cast<NSString *>([ self titleAttribute ]); Reference < XAccessibleRelationSet > rxRelationSet = [ self accessibleContext ] -> getAccessibleRelationSet(); // Special Attributes depending on attribute values if ( nativeSubrole && ! [ nativeSubrole isEqualToString: @"" ] ) { @@ -835,7 +835,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { } -(id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter { - SAL_INFO("vcl.a11y", "[" << self << " accessibilityAttributeValue:" << attribute << " forParameter:" << ((NSObject*)parameter) << "]"); + SAL_INFO("vcl.a11y", "[" << self << " accessibilityAttributeValue:" << attribute << " forParameter:" << (static_cast<NSObject*>(parameter)) << "]"); SEL methodSelector = [ self selectorForAttribute: attribute asGetter: YES withGetterParameter: YES ]; if ( [ self respondsToSelector: methodSelector ] ) { return [ self performSelector: methodSelector withObject: parameter ]; @@ -845,12 +845,12 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { -(BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute { - SAL_INFO("vcl.a11y", "[" << self << " accessibilitySetOverrideValue:" << ((NSObject*)value) << " forAttribute:" << attribute << "]"); + SAL_INFO("vcl.a11y", "[" << self << " accessibilitySetOverrideValue:" << (static_cast<NSObject*>(value)) << " forAttribute:" << attribute << "]"); return NO; // TODO } -(void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute { - SAL_INFO("vcl.a11y", "[" << self << " accessibilitySetValue:" << ((NSObject*)value) << " forAttribute:" << attribute << "]"); + SAL_INFO("vcl.a11y", "[" << self << " accessibilitySetValue:" << (static_cast<NSObject*>(value)) << " forAttribute:" << attribute << "]"); SEL methodSelector = [ self selectorForAttribute: attribute asGetter: NO withGetterParameter: NO ]; if ( [ AquaA11yComponentWrapper respondsToSelector: methodSelector ] ) { [ AquaA11yComponentWrapper performSelector: methodSelector withObject: self withObject: value ]; @@ -899,17 +899,17 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) { -(AquaA11yWrapper *)actionResponder { AquaA11yWrapper * wrapper = nil; // get some information - NSString * role = (NSString *) [ self accessibilityAttributeValue: NSAccessibilityRoleAttribute ]; + NSString * role = static_cast<NSString *>([ self accessibilityAttributeValue: NSAccessibilityRoleAttribute ]); id enabledAttr = [ self enabledAttribute ]; BOOL enabled = [ enabledAttr boolValue ]; - NSView * parent = (NSView *) [ self accessibilityAttributeValue: NSAccessibilityParentAttribute ]; + NSView * parent = static_cast<NSView *>([ self accessibilityAttributeValue: NSAccessibilityParentAttribute ]); AquaA11yWrapper * parentAsWrapper = nil; if ( [ parent isKindOfClass: [ AquaA11yWrapper class ] ] ) { - parentAsWrapper = (AquaA11yWrapper *) parent; + parentAsWrapper = static_cast<AquaA11yWrapper *>(parent); } SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.10 accessibilityAttributeValue: - NSString * parentRole = (NSString *) [ parent accessibilityAttributeValue: NSAccessibilityRoleAttribute ]; + NSString * parentRole = static_cast<NSString *>([ parent accessibilityAttributeValue: NSAccessibilityRoleAttribute ]); SAL_WNODEPRECATED_DECLARATIONS_POP // if we are a textarea inside a combobox, then the combobox is the action responder if ( enabled @@ -1031,7 +1031,7 @@ Reference < XAccessibleContext > hitTestRunner ( css::awt::Point point, NSRect screenRect = [ [ NSScreen mainScreen ] frame ]; css::awt::Point hitPoint ( static_cast<long>(point.x) , static_cast<long>(screenRect.size.height - point.y) ); // check child windows first - NSWindow * window = (NSWindow *) [ self accessibilityAttributeValue: NSAccessibilityWindowAttribute ]; + NSWindow * window = static_cast<NSWindow *>([ self accessibilityAttributeValue: NSAccessibilityWindowAttribute ]); NSArray * childWindows = [ window childWindows ]; if ( [ childWindows count ] > 0 ) { NSWindow * element = nil; @@ -1039,7 +1039,7 @@ Reference < XAccessibleContext > hitTestRunner ( css::awt::Point point, while ( ( element = [ enumerator nextObject ] ) && !hitChild.is() ) { if ( [ element isKindOfClass: [ SalFrameWindow class ] ] && [ self isViewElement: element hitByPoint: point ] ) { // we have a child window that is hit - Reference < XAccessibleRelationSet > relationSet = [ ( ( SalFrameWindow * ) element ) accessibleContext ] -> getAccessibleRelationSet(); + Reference < XAccessibleRelationSet > relationSet = [ static_cast<SalFrameWindow *>(element) accessibleContext ] -> getAccessibleRelationSet(); if ( relationSet.is() && relationSet -> containsRelation ( AccessibleRelationType::SUB_WINDOW_OF )) { // we have a valid relation to the parent element AccessibleRelation relation = relationSet -> getRelationByType ( AccessibleRelationType::SUB_WINDOW_OF ); diff --git a/vcl/osx/a11ywrappercombobox.mm b/vcl/osx/a11ywrappercombobox.mm index 0f0a8c4129a9..962a66914863 100644 --- a/vcl/osx/a11ywrappercombobox.mm +++ b/vcl/osx/a11ywrappercombobox.mm @@ -56,7 +56,7 @@ using namespace ::com::sun::star::uno; NSEnumerator * enumerator = [ elementChildren objectEnumerator ]; id child; while ( ( child = [ enumerator nextObject ] ) ) { - AquaA11yWrapper * element = ( AquaA11yWrapper * ) child; + AquaA11yWrapper * element = static_cast<AquaA11yWrapper *>(child); if ( [ [ AquaA11yRoleHelper getNativeRoleFrom: [ element accessibleContext ] ] isEqualToString: NSAccessibilityTextAreaRole ] ) { textArea = element; break; diff --git a/vcl/osx/a11ywrapperscrollarea.mm b/vcl/osx/a11ywrapperscrollarea.mm index bd5edf75f519..b0b963a6b403 100644 --- a/vcl/osx/a11ywrapperscrollarea.mm +++ b/vcl/osx/a11ywrapperscrollarea.mm @@ -36,9 +36,9 @@ NSEnumerator * enumerator = [ elementChildren objectEnumerator ]; id child; while ( ( child = [ enumerator nextObject ] ) ) { - AquaA11yWrapper * element = ( AquaA11yWrapper * ) child; + AquaA11yWrapper * element = static_cast<AquaA11yWrapper *>(child); if ( [ element isKindOfClass: [ AquaA11yWrapperScrollBar class ] ] ) { - AquaA11yWrapperScrollBar * scrollBar = (AquaA11yWrapperScrollBar *) element; + AquaA11yWrapperScrollBar * scrollBar = static_cast<AquaA11yWrapperScrollBar *>(element); if ( [ [ scrollBar orientationAttribute ] isEqualToString: orientation ] ) { theScrollBar = scrollBar; break; diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm index dda38c4479c8..42c4929e3557 100644 --- a/vcl/osx/printaccessoryview.mm +++ b/vcl/osx/printaccessoryview.mm @@ -285,9 +285,9 @@ public: NSControl* pCtrl = nil; NSCell* pCell = nil; if( [pObj isKindOfClass: [NSControl class]] ) - pCtrl = (NSControl*)pObj; + pCtrl = static_cast<NSControl*>(pObj); else if( [pObj isKindOfClass: [NSCell class]] ) - pCell = (NSCell*)pObj; + pCell = static_cast<NSCell*>(pObj); int nTag = pCtrl ? [pCtrl tag] : pCell ? [pCell tag] : @@ -303,7 +303,7 @@ public: [pCtrl setEnabled: bEnabled]; NSView* pOther = getPair( pCtrl ); if( pOther && [pOther isKindOfClass: [NSControl class]] ) - [(NSControl*)pOther setEnabled: bEnabled]; + [static_cast<NSControl*>(pOther) setEnabled: bEnabled]; } else if( pCell ) [pCell setEnabled: bEnabled]; @@ -336,7 +336,7 @@ static OUString filterAccelerator( rtl::OUString const & rText ) { if( [pSender isMemberOfClass: [NSPopUpButton class]] ) { - NSPopUpButton* pBtn = (NSPopUpButton*)pSender; + NSPopUpButton* pBtn = static_cast<NSPopUpButton*>(pSender); NSMenuItem* pSelected = [pBtn selectedItem]; if( pSelected ) { @@ -346,23 +346,23 @@ static OUString filterAccelerator( rtl::OUString const & rText ) } else if( [pSender isMemberOfClass: [NSButton class]] ) { - NSButton* pBtn = (NSButton*)pSender; + NSButton* pBtn = static_cast<NSButton*>(pSender); int nTag = [pBtn tag]; mpController->changePropertyWithBoolValue( nTag, [pBtn state] == NSOnState ); } else if( [pSender isMemberOfClass: [NSMatrix class]] ) { - NSObject* pObj = [(NSMatrix*)pSender selectedCell]; + NSObject* pObj = [static_cast<NSMatrix*>(pSender) selectedCell]; if( [pObj isMemberOfClass: [NSButtonCell class]] ) { - NSButtonCell* pCell = (NSButtonCell*)pObj; + NSButtonCell* pCell = static_cast<NSButtonCell*>(pObj); int nTag = [pCell tag]; mpController->changePropertyWithIntValue( nTag ); } } else if( [pSender isMemberOfClass: [NSTextField class]] ) { - NSTextField* pField = (NSTextField*)pSender; + NSTextField* pField = static_cast<NSTextField*>(pSender); int nTag = [pField tag]; rtl::OUString aValue = GetOUString( [pSender stringValue] ); mpController->changePropertyWithStringValue( nTag, aValue ); @@ -379,25 +379,25 @@ static OUString filterAccelerator( rtl::OUString const & rText ) { if( [pSender isMemberOfClass: [NSTextField class]] ) { - NSTextField* pField = (NSTextField*)pSender; + NSTextField* pField = static_cast<NSTextField*>(pSender); int nTag = [pField tag]; sal_Int64 nValue = [pField intValue]; NSView* pOther = mpController->getPair( pField ); if( pOther ) - [(NSControl*)pOther setIntValue: nValue]; + [static_cast<NSControl*>(pOther) setIntValue: nValue]; mpController->changePropertyWithIntValue( nTag, nValue ); } else if( [pSender isMemberOfClass: [NSStepper class]] ) { - NSStepper* pStep = (NSStepper*)pSender; + NSStepper* pStep = static_cast<NSStepper*>(pSender); int nTag = [pStep tag]; sal_Int64 nValue = [pStep intValue]; NSView* pOther = mpController->getPair( pStep ); if( pOther ) - [(NSControl*)pOther setIntValue: nValue]; + [static_cast<NSControl*>(pOther) setIntValue: nValue]; mpController->changePropertyWithIntValue( nTag, nValue ); } @@ -546,7 +546,7 @@ static void adjustTabViews( NSTabView* pTabView, NSSize aTabSize ) int nViews = [pTabbedViews count]; for( int i = 0; i < nViews; i++ ) { - NSTabViewItem* pItem = (NSTabViewItem*)[pTabbedViews objectAtIndex: i]; + NSTabViewItem* pItem = static_cast<NSTabViewItem*>([pTabbedViews objectAtIndex: i]); NSView* pNSView = [pItem view]; if( pNSView ) { @@ -733,7 +733,7 @@ static void addRadio( NSView* pCurParent, long rCurX, long& rCurY, long nAttachO [pProto setButtonType: NSRadioButton]; NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect mode: NSRadioModeMatrix - prototype: (NSCell*)pProto + prototype: static_cast<NSCell*>(pProto) numberOfRows: rChoices.getLength() numberOfColumns: 1]; // set individual titles diff --git a/vcl/osx/printview.mm b/vcl/osx/printview.mm index 95875a26f767..b54e1b0561c3 100644 --- a/vcl/osx/printview.mm +++ b/vcl/osx/printview.mm @@ -47,7 +47,7 @@ -(NSRect)rectForPage: (int)page { NSSize aPaperSize = [mpInfoPrinter->getPrintInfo() paperSize]; - int nWidth = (int)aPaperSize.width; + int nWidth = static_cast<int>(aPaperSize.width); // #i101108# sanity check if( nWidth < 1 ) nWidth = 1; @@ -68,7 +68,7 @@ mpInfoPrinter->setStartPageOffset( static_cast<int>(rect.origin.x), static_cast<int>(rect.origin.y) ); NSSize aPaperSize = [mpInfoPrinter->getPrintInfo() paperSize]; - int nPage = (int)(aPaperSize.width * rect.origin.y + rect.origin.x); + int nPage = static_cast<int>(aPaperSize.width * rect.origin.y + rect.origin.x); // page count is 1 based if( nPage - 1 < (mpInfoPrinter->getCurPageRangeStart() + mpInfoPrinter->getCurPageRangeCount() ) ) diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 0752d91e87ae..e8259b5bc223 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -376,12 +376,12 @@ void AquaSalFrame::initShow() if( mpParent ) // center relative to parent { // center on parent - long nNewX = mpParent->maGeometry.nX + ((long)mpParent->maGeometry.nWidth - (long)maGeometry.nWidth)/2; + long nNewX = mpParent->maGeometry.nX + (static_cast<long>(mpParent->maGeometry.nWidth) - static_cast<long>(maGeometry.nWidth))/2; if( nNewX < aScreenRect.Left() ) nNewX = aScreenRect.Left(); if( long(nNewX + maGeometry.nWidth) > aScreenRect.Right() ) nNewX = aScreenRect.Right() - maGeometry.nWidth-1; - long nNewY = mpParent->maGeometry.nY + ((long)mpParent->maGeometry.nHeight - (long)maGeometry.nHeight)/2; + long nNewY = mpParent->maGeometry.nY + (static_cast<long>(mpParent->maGeometry.nHeight) - static_cast<long>(maGeometry.nHeight))/2; if( nNewY < aScreenRect.Top() ) nNewY = aScreenRect.Top(); if( nNewY > aScreenRect.Bottom() ) @@ -707,7 +707,7 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) NSArray* pScreens = [NSScreen screens]; if( pScreens ) { - if( nDisplay >= 0 && (unsigned int)nDisplay < [pScreens count] ) + if( nDisplay >= 0 && static_cast<unsigned int>(nDisplay) < [pScreens count] ) pScreen = [pScreens objectAtIndex: nDisplay]; else { @@ -1109,7 +1109,7 @@ static vcl::Font getFont( NSFont* pFont, long nDPIY, const vcl::Font& rDefault ) if( pFont ) { aResult.SetFamilyName( GetOUString( [pFont familyName] ) ); - aResult.SetFontHeight( static_cast<int>(([pFont pointSize] * 72.0 / (float)nDPIY)+0.5) ); + aResult.SetFontHeight( static_cast<int>(([pFont pointSize] * 72.0 / static_cast<float>(nDPIY))+0.5) ); aResult.SetItalic( ([pFont italicAngle] != 0.0) ? ITALIC_NORMAL : ITALIC_NONE ); // FIMXE: bold ? } @@ -1392,7 +1392,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP } if( bMouseEvent ) { - unsigned int nMask = (unsigned int)[pCur modifierFlags]; + unsigned int nMask = static_cast<unsigned int>([pCur modifierFlags]); SAL_WNODEPRECATED_DECLARATIONS_PUSH // 'NSAlternateKeyMask' is deprecated: first deprecated in macOS 10.12 // 'NSCommandKeyMask' is deprecated: first deprecated in macOS 10.12 diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index e33ccb188616..a12655c4b019 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -179,8 +179,8 @@ static AquaSalFrame* getMouseContainerFrame() for(NSUInteger i = 0; i < [aWindows count] && ! pDispatchFrame; i++ ) { NSWindow* pWin = [NSApp windowWithWindowNumber:[[aWindows objectAtIndex:i] integerValue]]; - if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [(SalFrameWindow*)pWin containsMouse] ) - pDispatchFrame = [(SalFrameWindow*)pWin getSalFrame]; + if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [static_cast<SalFrameWindow*>(pWin) containsMouse] ) + pDispatchFrame = [static_cast<SalFrameWindow*>(pWin) getSalFrame]; } return pDispatchFrame; } @@ -215,7 +215,7 @@ static AquaSalFrame* getMouseContainerFrame() [pNSWindow performSelector:setRestorable withObject:reinterpret_cast<id>(NO)]; } - return (SalFrameWindow *)pNSWindow; + return static_cast<SalFrameWindow *>(pNSWindow); } -(AquaSalFrame*)getSalFrame diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 80b6fec66cc0..48eafa5eac1a 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -565,7 +565,7 @@ static bool isWakeupEvent( NSEvent *pEvent ) { SAL_WNODEPRECATED_DECLARATIONS_PUSH return NSApplicationDefined == [pEvent type] - && AquaSalInstance::YieldWakeupEvent == (int) [pEvent subtype]; + && AquaSalInstance::YieldWakeupEvent == static_cast<int>([pEvent subtype]); SAL_WNODEPRECATED_DECLARATIONS_POP } diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index 4fb54d224503..96e5ef04e63d 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -800,7 +800,7 @@ void AquaSalMenu::statusLayout() { NSView* pNSView = [GetSalData()->mpStatusItem view]; if( [pNSView isMemberOfClass: [OOStatusItemView class]] ) // well of course it is - [(OOStatusItemView*)pNSView layout]; + [static_cast<OOStatusItemView*>(pNSView) layout]; else OSL_FAIL( "someone stole our status view" ); } diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx index e282780f67fa..fcee4596037c 100644 --- a/vcl/osx/salobj.cxx +++ b/vcl/osx/salobj.cxx @@ -67,8 +67,8 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData const * pWi NSOpenGLPFAColorSize, 24, NSOpenGLPFADepthSize, 24, NSOpenGLPFAMultisample, - NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1, - NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)4, + NSOpenGLPFASampleBuffers, NSOpenGLPixelFormatAttribute(1), + NSOpenGLPFASamples, NSOpenGLPixelFormatAttribute(4), 0 }; pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes]; @@ -83,8 +83,8 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData const * pWi NSOpenGLPFAColorSize, 24, NSOpenGLPFADepthSize, 24, NSOpenGLPFAMultisample, - NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1, - NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)4, + NSOpenGLPFASampleBuffers, NSOpenGLPixelFormatAttribute(1), + NSOpenGLPFASamples, NSOpenGLPixelFormatAttribute(4), 0 }; pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes]; diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm index 473c8d7f9a30..f805df6959d4 100644 --- a/vcl/osx/vclnsapp.mm +++ b/vcl/osx/vclnsapp.mm @@ -98,7 +98,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH NSWindow* pKeyWin = [NSApp keyWindow]; if( pKeyWin && [pKeyWin isKindOfClass: [SalFrameWindow class]] ) { - AquaSalFrame* pFrame = [(SalFrameWindow*)pKeyWin getSalFrame]; + AquaSalFrame* pFrame = [static_cast<SalFrameWindow*>(pKeyWin) getSalFrame]; // handle Cmd-W // FIXME: the correct solution would be to handle this in framework // in the menu code @@ -113,7 +113,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH if( nModMask == NSCommandKeyMask && [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] ) { - [(SalFrameWindow*)pFrame->getNSWindow() windowShouldClose: nil]; + [static_cast<SalFrameWindow*>(pFrame->getNSWindow()) windowShouldClose: nil]; return; } } diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 2a09ffc8a87c..b7389c895568 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -65,7 +65,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD ) // handle font stretching if any if( (pReqFont->mnWidth != 0) && (pReqFont->mnWidth != pReqFont->mnHeight) ) { - mfFontStretch = (float)pReqFont->mnWidth / pReqFont->mnHeight; + mfFontStretch = static_cast<float>(pReqFont->mnWidth) / pReqFont->mnHeight; aMatrix = CGAffineTransformConcat(aMatrix, CGAffineTransformMakeScale(mfFontStretch, 1.0F)); } @@ -294,7 +294,7 @@ int CoreTextFontFace::GetFontTable( const char pTagName[5], unsigned char* pResu CFRelease( pDataRef); - return (int)nByteLength; + return static_cast<int>(nByteLength); } FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFontEnabled ) @@ -398,7 +398,7 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont nInt = WEIGHT_THIN; } } - rDFA.SetWeight( (FontWeight)nInt ); + rDFA.SetWeight( static_cast<FontWeight>(nInt) ); // get the font slant double fSlant = 0; @@ -430,7 +430,7 @@ FontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool* bFont nInt = WIDTH_ULTRA_CONDENSED; } } - rDFA.SetWidthType( (FontWidth)nInt ); + rDFA.SetWidthType( static_cast<FontWidth>(nInt) ); // release the attribute dict that we had copied CFRelease( pAttrDict ); diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index 8082621cc5f9..2e69610e2d0c 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -124,11 +124,11 @@ bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits, const CGSize aLayerSize = CGLayerGetSize( xLayer ); SAL_INFO("vcl.cg", "CGLayerGetSize(" << xLayer << ") = " << aLayerSize ); - if( nWidth >= (int)aLayerSize.width - nX ) - nWidth = (int)aLayerSize.width - nX; + if( nWidth >= static_cast<int>(aLayerSize.width) - nX ) + nWidth = static_cast<int>(aLayerSize.width) - nX; - if( nHeight >= (int)aLayerSize.height - nY ) - nHeight = (int)aLayerSize.height - nY; + if( nHeight >= static_cast<int>(aLayerSize.height) - nY ) + nHeight = static_cast<int>(aLayerSize.height) - nY; if( (nWidth < 0) || (nHeight < 0) ) nWidth = nHeight = 0; diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 7db6c7b00927..a6c9a528bff7 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -121,7 +121,7 @@ CoreTextFontFace::~CoreTextFontFace() sal_IntPtr CoreTextFontFace::GetFontId() const { - return (sal_IntPtr)mnFontId; + return static_cast<sal_IntPtr>(mnFontId); } const FontCharMapRef CoreTextFontFace::GetFontCharMap() const @@ -553,15 +553,15 @@ static void FakeDirEntry( const char aTag[5], ByteCount nOfs, ByteCount nLen, // not too important since the subsetter doesn't care currently // for( pData+nOfs ... pData+nOfs+nLen ) // write entry offset - rpDest[ 8] = (char)(nOfs >> 24); - rpDest[ 9] = (char)(nOfs >> 16); - rpDest[10] = (char)(nOfs >> 8); - rpDest[11] = (char)(nOfs >> 0); + rpDest[ 8] = static_cast<char>(nOfs >> 24); + rpDest[ 9] = static_cast<char>(nOfs >> 16); + rpDest[10] = static_cast<char>(nOfs >> 8); + rpDest[11] = static_cast<char>(nOfs >> 0); // write entry length - rpDest[12] = (char)(nLen >> 24); - rpDest[13] = (char)(nLen >> 16); - rpDest[14] = (char)(nLen >> 8); - rpDest[15] = (char)(nLen >> 0); + rpDest[12] = static_cast<char>(nLen >> 24); + rpDest[13] = static_cast<char>(nLen >> 16); + rpDest[14] = static_cast<char>(nLen >> 8); + rpDest[15] = static_cast<char>(nLen >> 0); // advance to next entry rpDest += 16; } diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 62b40f840bfc..d8c539a79d98 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -671,9 +671,9 @@ bool AquaSalGraphics::drawTransformedBitmap( const QuartzSalBitmap* pMaskSalBmp = static_cast<const QuartzSalBitmap*>(pAlphaBmp); if( !pMaskSalBmp) - xImage = rSrcSalBmp.CreateCroppedImage( 0, 0, (int)aSize.Width(), (int)aSize.Height() ); + xImage = rSrcSalBmp.CreateCroppedImage( 0, 0, static_cast<int>(aSize.Width()), static_cast<int>(aSize.Height()) ); else - xImage = rSrcSalBmp.CreateWithMask( *pMaskSalBmp, 0, 0, (int)aSize.Width(), (int)aSize.Height() ); + xImage = rSrcSalBmp.CreateWithMask( *pMaskSalBmp, 0, 0, static_cast<int>(aSize.Width()), static_cast<int>(aSize.Height()) ); if( !xImage ) { DBG_DRAW_OPERATION_EXIT_EARLY("drawTransformedBitmap"); @@ -764,8 +764,8 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rS } const QuartzSalBitmap& rBitmap = static_cast<const QuartzSalBitmap&>(rSalBitmap); - CGImageRef xImage = rBitmap.CreateCroppedImage( (int)rPosAry.mnSrcX, (int)rPosAry.mnSrcY, - (int)rPosAry.mnSrcWidth, (int)rPosAry.mnSrcHeight ); + CGImageRef xImage = rBitmap.CreateCroppedImage( static_cast<int>(rPosAry.mnSrcX), static_cast<int>(rPosAry.mnSrcY), + static_cast<int>(rPosAry.mnSrcWidth), static_cast<int>(rPosAry.mnSrcHeight) ); if( !xImage ) { DBG_DRAW_OPERATION_EXIT_EARLY("drawBitmap"); @@ -820,7 +820,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pEpsData, sal_uLong nByteCount ) { // convert the raw data to an NSImageRef - NSData* xNSData = [NSData dataWithBytes:pEpsData length:(int)nByteCount]; + NSData* xNSData = [NSData dataWithBytes:pEpsData length:static_cast<int>(nByteCount)]; NSImageRep* xEpsImage = [NSEPSImageRep imageRepWithData: xNSData]; if( !xEpsImage ) { @@ -1613,7 +1613,7 @@ void AquaSalGraphics::initResolution( NSWindow* ) { // FIXME: casting a long to CGDirectDisplayID is evil, but // Apple suggest to do it this way - const CGDirectDisplayID nDisplayID = (CGDirectDisplayID)[pVal longValue]; + const CGDirectDisplayID nDisplayID = static_cast<CGDirectDisplayID>([pVal longValue]); const CGSize aSize = CGDisplayScreenSize( nDisplayID ); // => result is in millimeters mnRealDPIX = static_cast<long>((CGDisplayPixelsWide( nDisplayID ) * 25.4) / aSize.width); mnRealDPIY = static_cast<long>((CGDisplayPixelsHigh( nDisplayID ) * 25.4) / aSize.height); @@ -2175,8 +2175,8 @@ bool XorEmulation::UpdateTarget() { CGImageRef xXorImage = CGBitmapContextCreateImage( m_xTempContext ); SAL_INFO( "vcl.cg", "CGBitmapContextCreateImage(" << m_xTempContext << ") = " << xXorImage ); - const int nWidth = (int)CGImageGetWidth( xXorImage ); - const int nHeight = (int)CGImageGetHeight( xXorImage ); + const int nWidth = static_cast<int>(CGImageGetWidth( xXorImage )); + const int nHeight = static_cast<int>(CGImageGetHeight( xXorImage )); // TODO: update minimal changerect const CGRect aFullRect = CGRectMake(0, 0, nWidth, nHeight); SAL_INFO( "vcl.cg", "CGContextDrawImage(" << m_xTargetContext << "," << aFullRect << "," << xXorImage << ")" ); diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 2393318accc8..58cfb6a57e1d 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -2296,7 +2296,7 @@ sal_uInt16 MapChar(TrueTypeFont const *ttf, sal_uInt16 ch) const sal_uInt32 nMaxCmapSize = ttf->ptr + ttf->fsize - ttf->cmap; if( ttf->mapper == getGlyph0 && ( ch & 0xf000 ) == 0xf000 ) ch &= 0x00ff; - return (sal_uInt16)ttf->mapper(ttf->cmap, nMaxCmapSize, ch ); + return static_cast<sal_uInt16>(ttf->mapper(ttf->cmap, nMaxCmapSize, ch )); } case CMAP_MS_Unicode: break; @@ -2308,7 +2308,7 @@ sal_uInt16 MapChar(TrueTypeFont const *ttf, sal_uInt16 ch) default: return 0; } const sal_uInt32 nMaxCmapSize = ttf->ptr + ttf->fsize - ttf->cmap; - ch = (sal_uInt16)ttf->mapper(ttf->cmap, nMaxCmapSize, ch); + ch = static_cast<sal_uInt16>(ttf->mapper(ttf->cmap, nMaxCmapSize, ch)); return ch; } #endif |