diff options
52 files changed, 172 insertions, 172 deletions
diff --git a/avmedia/source/macavf/player.mm b/avmedia/source/macavf/player.mm index 2df11fba099b..1d51ca276474 100644 --- a/avmedia/source/macavf/player.mm +++ b/avmedia/source/macavf/player.mm @@ -286,7 +286,7 @@ sal_Int16 SAL_CALL Player::getVolumeDB() // 0dB <-> AVPlayer volume 1.0 const int nVolumeDB = (fVolume <= 0) ? -40 : lrint( 20.0*log10(fVolume)); - return (sal_Int16)nVolumeDB; + return static_cast<sal_Int16>(nVolumeDB); } @@ -298,7 +298,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() NSArray* pVideoTracks = [pMovie tracksWithMediaType:AVMediaTypeVideo]; if ([pVideoTracks count] > 0) { - AVAssetTrack* pFirstVideoTrack = (AVAssetTrack*) [pVideoTracks objectAtIndex:0]; + AVAssetTrack* pFirstVideoTrack = static_cast<AVAssetTrack*>([pVideoTracks objectAtIndex:0]); const CGSize aPrefSize = [pFirstVideoTrack naturalSize]; aSize = awt::Size( aPrefSize.width, aPrefSize.height ); } diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx index 71a207b69c1c..54f0598d9ef9 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx @@ -406,7 +406,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool bHasHiddenParam ) { - sal_uInt64 nOffsetAndIndex = ( ( (sal_uInt64) nVtableOffset ) << 32 ) | ( (sal_uInt64) nFunctionIndex ); + sal_uInt64 nOffsetAndIndex = ( static_cast<sal_uInt64>(nVtableOffset) << 32 ) | static_cast<sal_uInt64>(nFunctionIndex); if ( bHasHiddenParam ) nOffsetAndIndex |= 0x80000000; diff --git a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx index 635b929c2106..cda96cdcbf4e 100644 --- a/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabDatabaseMetaData.cxx @@ -770,13 +770,13 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTypeInfo( ) aRow[0] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[1] = new ORowSetValueDecorator(OUString("CHAR")); aRow[2] = new ORowSetValueDecorator(DataType::CHAR); - aRow[3] = new ORowSetValueDecorator((sal_Int32) 254); + aRow[3] = new ORowSetValueDecorator(sal_Int32(254)); aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue(); aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue(); aRow[6] = ODatabaseMetaDataResultSet::getEmptyValue(); - aRow[7] = new ORowSetValueDecorator((sal_Int32) ColumnValue::NULLABLE); + aRow[7] = new ORowSetValueDecorator(sal_Int32(ColumnValue::NULLABLE)); aRow[8] = ODatabaseMetaDataResultSet::get1Value(); - aRow[9] = new ORowSetValueDecorator((sal_Int32) ColumnSearch::CHAR); + aRow[9] = new ORowSetValueDecorator(sal_Int32(ColumnSearch::CHAR)); aRow[10] = ODatabaseMetaDataResultSet::get1Value(); aRow[11] = ODatabaseMetaDataResultSet::get0Value(); aRow[12] = ODatabaseMetaDataResultSet::get0Value(); @@ -785,27 +785,27 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getTypeInfo( ) aRow[15] = ODatabaseMetaDataResultSet::get0Value(); aRow[16] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[17] = ODatabaseMetaDataResultSet::getEmptyValue(); - aRow[18] = new ORowSetValueDecorator((sal_Int32) 10); + aRow[18] = new ORowSetValueDecorator(sal_Int32(10)); aRows.push_back(aRow); aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP")); aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP); - aRow[3] = new ORowSetValueDecorator((sal_Int32)19); + aRow[3] = new ORowSetValueDecorator(sal_Int32(19)); aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue(); aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue(); aRows.push_back(aRow); aRow[1] = new ORowSetValueDecorator(OUString("INTEGER")); aRow[2] = new ORowSetValueDecorator(DataType::INTEGER); - aRow[3] = new ORowSetValueDecorator((sal_Int32)20); - aRow[15] = new ORowSetValueDecorator((sal_Int32)20); + aRow[3] = new ORowSetValueDecorator(sal_Int32(20)); + aRow[15] = new ORowSetValueDecorator(sal_Int32(20)); aRows.push_back(aRow); aRow[1] = new ORowSetValueDecorator(OUString("FLOAT")); aRow[2] = new ORowSetValueDecorator(DataType::FLOAT); - aRow[3] = new ORowSetValueDecorator((sal_Int32)20); - aRow[15] = new ORowSetValueDecorator((sal_Int32)15); + aRow[3] = new ORowSetValueDecorator(sal_Int32(20)); + aRow[15] = new ORowSetValueDecorator(sal_Int32(15)); aRows.push_back(aRow); } pResult->setRows(aRows); @@ -856,13 +856,13 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns( aRow[3] = new ORowSetValueDecorator(sTableName); aRow[8] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[9] = ODatabaseMetaDataResultSet::get0Value(); - aRow[10] = new ORowSetValueDecorator((sal_Int32) 10); + aRow[10] = new ORowSetValueDecorator(sal_Int32(10)); aRow[11] = ODatabaseMetaDataResultSet::get1Value(); aRow[12] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[13] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[14] = ODatabaseMetaDataResultSet::getEmptyValue(); aRow[15] = ODatabaseMetaDataResultSet::getEmptyValue(); - aRow[16] = new ORowSetValueDecorator((sal_Int32) 254); + aRow[16] = new ORowSetValueDecorator(sal_Int32(254)); aRow[18] = new ORowSetValueDecorator(OUString("YES")); sal_Int32 nPosition = 1; @@ -885,7 +885,7 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns( case kABStringProperty: aRow[5] = new ORowSetValueDecorator(DataType::CHAR); aRow[6] = new ORowSetValueDecorator(OUString("CHAR")); - aRow[7] = new ORowSetValueDecorator((sal_Int32) 256); + aRow[7] = new ORowSetValueDecorator(sal_Int32(256)); aRows.push_back(aRow); break; case kABDateProperty: @@ -896,13 +896,13 @@ Reference< XResultSet > SAL_CALL MacabDatabaseMetaData::getColumns( case kABIntegerProperty: aRow[5] = new ORowSetValueDecorator(DataType::INTEGER); aRow[6] = new ORowSetValueDecorator(OUString("INTEGER")); - aRow[7] = new ORowSetValueDecorator((sal_Int32) 20); + aRow[7] = new ORowSetValueDecorator(sal_Int32(20)); aRows.push_back(aRow); break; case kABRealProperty: aRow[5] = new ORowSetValueDecorator(DataType::FLOAT); aRow[6] = new ORowSetValueDecorator(OUString("FLOAT")); - aRow[7] = new ORowSetValueDecorator((sal_Int32) 15); + aRow[7] = new ORowSetValueDecorator(sal_Int32(15)); aRows.push_back(aRow); break; default: diff --git a/connectivity/source/drivers/macab/MacabGroup.cxx b/connectivity/source/drivers/macab/MacabGroup.cxx index d963d64a7e2d..f4217b018aac 100644 --- a/connectivity/source/drivers/macab/MacabGroup.cxx +++ b/connectivity/source/drivers/macab/MacabGroup.cxx @@ -48,7 +48,7 @@ MacabGroup::MacabGroup(const ABAddressBookRef _addressBook, const MacabRecords * CFRelease(sGroupName); // The _group's_ records (remember MacabGroup inherits from MacabRecords) - recordsSize = (sal_Int32) CFArrayGetCount(xGroupMembers); + recordsSize = static_cast<sal_Int32>(CFArrayGetCount(xGroupMembers)); records = new MacabRecord *[recordsSize]; setHeader(_allRecords->getHeader()); diff --git a/connectivity/source/drivers/macab/MacabHeader.cxx b/connectivity/source/drivers/macab/MacabHeader.cxx index a674dad8f359..8c37dd7fa147 100644 --- a/connectivity/source/drivers/macab/MacabHeader.cxx +++ b/connectivity/source/drivers/macab/MacabHeader.cxx @@ -260,7 +260,7 @@ sal_Int32 MacabHeader::compareFields(const macabfield *_field1, const macabfield static_cast<CFStringRef>(_field2->value), 0); // 0 = no options (like ignore case) - return (sal_Int32) result; + return static_cast<sal_Int32>(result); } diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx index 549d94d3d863..102dcae458c9 100644 --- a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx +++ b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx @@ -42,7 +42,7 @@ void MacabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) if (nParams < 1) ::dbtools::throwInvalidIndexException(*this); - if (nParams >= (sal_Int32) m_aParameterRow->get().size()) + if (nParams >= static_cast<sal_Int32>(m_aParameterRow->get().size())) m_aParameterRow->get().resize(nParams); } @@ -69,7 +69,7 @@ void MacabPreparedStatement::resetParameters() const void MacabPreparedStatement::getNextParameter(OUString &rParameter) const { - if (m_nParameterIndex >= (sal_Int32) m_aParameterRow->get().size()) + if (m_nParameterIndex >= static_cast<sal_Int32>(m_aParameterRow->get().size())) { ::connectivity::SharedResources aResources; const OUString sError( aResources.getResourceString( diff --git a/connectivity/source/drivers/macab/MacabRecord.cxx b/connectivity/source/drivers/macab/MacabRecord.cxx index f4e9a8c65341..0df2588bf67d 100644 --- a/connectivity/source/drivers/macab/MacabRecord.cxx +++ b/connectivity/source/drivers/macab/MacabRecord.cxx @@ -214,7 +214,7 @@ sal_Int32 MacabRecord::compareFields(const macabfield *_field1, const macabfield result = kCFCompareEqualTo; // can't compare } - return (sal_Int32) result; + return static_cast<sal_Int32>(result); } @@ -246,7 +246,7 @@ macabfield *MacabRecord::createMacabField(const OUString& _newFieldString, const double nTime = DBTypeConversion::toDouble(aDateTime, DBTypeConversion::getStandardDate()); nTime -= kCFAbsoluteTimeIntervalSince1970; newField = new macabfield; - newField->value = CFDateCreate(nullptr, (CFAbsoluteTime) nTime); + newField->value = CFDateCreate(nullptr, static_cast<CFAbsoluteTime>(nTime)); newField->type = _abType; } } diff --git a/connectivity/source/drivers/macab/MacabRecords.cxx b/connectivity/source/drivers/macab/MacabRecords.cxx index 68ebe0780b0d..675757cf629c 100644 --- a/connectivity/source/drivers/macab/MacabRecords.cxx +++ b/connectivity/source/drivers/macab/MacabRecords.cxx @@ -168,7 +168,7 @@ void MacabRecords::initialize() ABRecordRef record; sal_Int32 i; - recordsSize = (sal_Int32) CFArrayGetCount(allRecords); + recordsSize = static_cast<sal_Int32>(CFArrayGetCount(allRecords)); records = new MacabRecord *[recordsSize]; /* First, we create the header... */ @@ -361,8 +361,8 @@ MacabHeader *MacabRecords::createHeaderForRecordType(const CFArrayRef _records, */ CFArrayRef allProperties = ABCopyArrayOfPropertiesForRecordType(addressBook, _recordType); CFStringRef *nonRequiredProperties; - sal_Int32 numRecords = (sal_Int32) CFArrayGetCount(_records); - sal_Int32 numProperties = (sal_Int32) CFArrayGetCount(allProperties); + sal_Int32 numRecords = static_cast<sal_Int32>(CFArrayGetCount(_records)); + sal_Int32 numProperties = static_cast<sal_Int32>(CFArrayGetCount(allProperties)); sal_Int32 numNonRequiredProperties = numProperties - requiredProperties.size(); /* While searching through the properties for required properties, these @@ -561,7 +561,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert OUString multiLabelString; OUString multiPropertyString; OUString headerNameString; - ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100); + ABPropertyType multiType = static_cast<ABPropertyType>(ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100); length = multiLength; headerNames = new macabfield *[multiLength]; @@ -610,7 +610,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert OUString multiLabelString; OUString multiPropertyString; std::vector<std::unique_ptr<MacabHeader>> multiHeaders; - ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100); + ABPropertyType multiType = static_cast<ABPropertyType>(ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100); multiPropertyString = CFStringToOUString(_propertyName); @@ -678,7 +678,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert if(_propertyValue != nullptr) { /* Assume all keys are strings */ - sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue)); + sal_Int32 numRecords = static_cast<sal_Int32>(CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue))); /* The only method for getting info out of a CFDictionary, of both * keys and values, is to all of them all at once, so these @@ -758,7 +758,7 @@ MacabHeader *MacabRecords::createHeaderForProperty(const ABPropertyType _propert */ if(_propertyValue != nullptr) { - sal_Int32 arrLength = (sal_Int32) CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue)); + sal_Int32 arrLength = static_cast<sal_Int32>(CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue))); sal_Int32 i,j,k; CFTypeRef arrValue; ABPropertyType arrType; @@ -845,7 +845,7 @@ MacabRecord *MacabRecords::createMacabRecord(const ABRecordRef _abrecord, const MacabRecord *macabRecord = new MacabRecord(_header->getSize()); CFArrayRef recordProperties = ABCopyArrayOfPropertiesForRecordType(addressBook, _recordType); - sal_Int32 numProperties = (sal_Int32) CFArrayGetCount(recordProperties); + sal_Int32 numProperties = static_cast<sal_Int32>(CFArrayGetCount(recordProperties)); sal_Int32 i; @@ -964,7 +964,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT * is go through the array, and rerun this method recursively * on each element. */ - sal_Int32 arrLength = (sal_Int32) CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue)); + sal_Int32 arrLength = static_cast<sal_Int32>(CFArrayGetCount(static_cast<CFArrayRef>(_propertyValue))); sal_Int32 i; OUString newPropertyName; @@ -993,7 +993,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT * we hit a scalar value. */ - sal_Int32 numRecords = (sal_Int32) CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue)); + sal_Int32 numRecords = static_cast<sal_Int32>(CFDictionaryGetCount(static_cast<CFDictionaryRef>(_propertyValue))); OUString dictKeyString; sal_Int32 i; OUString newPropertyName; @@ -1047,7 +1047,7 @@ void MacabRecords::insertPropertyIntoMacabRecord(const ABPropertyType _propertyT CFStringRef multiLabel, localizedMultiLabel; CFTypeRef multiValue; OUString multiLabelString, newPropertyName; - ABPropertyType multiType = (ABPropertyType) (ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100); + ABPropertyType multiType = static_cast<ABPropertyType>(ABMultiValuePropertyType(static_cast<ABMutableMultiValueRef>(const_cast<void *>(_propertyValue))) - 0x100); /* Go through each element... */ for(i = 0; i < multiLength; i++) @@ -1099,7 +1099,7 @@ ABPropertyType MacabRecords::getABTypeFromCFType(const CFTypeID cf_type ) const /* A match! */ if(i.cf == cf_type) { - return (ABPropertyType) i.ab; + return static_cast<ABPropertyType>(i.ab); } } return kABErrorInProperty; diff --git a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx index c424b1ea9302..f3f2d5483f4f 100644 --- a/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx +++ b/connectivity/source/drivers/macab/MacabResultSetMetaData.cxx @@ -189,7 +189,7 @@ sal_Int32 SAL_CALL MacabResultSetMetaData::getScale(sal_Int32) sal_Int32 SAL_CALL MacabResultSetMetaData::isNullable(sal_Int32) { - return (sal_Int32) true; + return sal_Int32(true); } sal_Bool SAL_CALL MacabResultSetMetaData::isSearchable(sal_Int32) diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx index 5cd342b93e30..1d71ab72d3fb 100644 --- a/connectivity/source/drivers/odbc/OConnection.cxx +++ b/connectivity/source/drivers/odbc/OConnection.cxx @@ -129,9 +129,9 @@ SQLRETURN OConnection::OpenConnection(const OUString& aConnectStr, sal_Int32 nTi nSQLRETURN = N3SQLDriverConnect(m_aConnectionHandle, nullptr, szConnStrIn, - (SQLSMALLINT) std::min<sal_Int32>((sal_Int32)2048,aConStr.getLength()), + static_cast<SQLSMALLINT>(std::min<sal_Int32>(sal_Int32(2048),aConStr.getLength())), szConnStrOut, - (SQLSMALLINT) sizeof szConnStrOut, + SQLSMALLINT(sizeof szConnStrOut), &cbConnStrOut, nSilent); if (nSQLRETURN == SQL_ERROR || nSQLRETURN == SQL_NO_DATA) diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm index 55fe45699922..e6eaf32c37ea 100644 --- a/fpicker/source/aqua/AquaFilePickerDelegate.mm +++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm @@ -87,7 +87,7 @@ return; } - NSPopUpButton *popup = (NSPopUpButton*)sender; + NSPopUpButton *popup = static_cast<NSPopUpButton*>(sender); unsigned int selectedIndex = [popup indexOfSelectedItem]; filterHelper->SetFilterAtIndex(selectedIndex); @@ -105,7 +105,7 @@ return; } uno::Any aValue; - aValue <<= ([((NSButton*)sender) state] == NSOnState); + aValue <<= ([static_cast<NSButton*>(sender) state] == NSOnState); filePicker->setValue(css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0, aValue); } diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx index cdf636990765..a657104c4ba3 100644 --- a/fpicker/source/aqua/ControlHelper.hxx +++ b/fpicker/source/aqua/ControlHelper.hxx @@ -115,7 +115,7 @@ public: } bool isAutoExtensionEnabled() { - return ([((NSButton*) m_pToggles[AUTOEXTENSION]) state] == NSOnState); + return ([static_cast<NSButton*>(m_pToggles[AUTOEXTENSION]) state] == NSOnState); } private: diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm index 2b988d741792..0c459e23cee8 100644 --- a/fpicker/source/aqua/ControlHelper.mm +++ b/fpicker/source/aqua/ControlHelper.mm @@ -50,7 +50,7 @@ uno::Any HandleGetListValue(const NSControl* pControl, const sal_Int16 nControlA return aAny; } - NSPopUpButton *pButton = (NSPopUpButton*)pControl; + NSPopUpButton *pButton = static_cast<NSPopUpButton*>(pControl); NSMenu *rMenu = [pButton menu]; if (nil == rMenu) { SAL_INFO("fpicker.aqua","button has no menu"); @@ -164,7 +164,7 @@ ControlHelper::~ControlHelper() [sLabelName release]; } if ([pControl class] == [NSPopUpButton class]) { - NSTextField* pField = m_aMapListLabelFields[(NSPopUpButton*)pControl]; + NSTextField* pField = m_aMapListLabelFields[static_cast<NSPopUpButton*>(pControl)]; if (pField != nil) { [pField release]; } @@ -330,7 +330,7 @@ void ControlHelper::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, co bool bChecked = false; rValue >>= bChecked; SAL_INFO("fpicker.aqua"," value is a bool: " << bChecked); - [(NSButton*)pControl setState:(bChecked ? NSOnState : NSOffState)]; + [static_cast<NSButton*>(pControl) setState:(bChecked ? NSOnState : NSOffState)]; } else { SAL_INFO("fpicker.aqua","Can't set value on button / list " << nControlId << " " << nControlAction); @@ -353,7 +353,7 @@ uno::Any ControlHelper::getValue( sal_Int16 nControlId, sal_Int16 nControlAction aRetval = HandleGetListValue(pControl, nControlAction); } else if( [pControl class] == [NSButton class] ) { //NSLog(@"control: %@", [[pControl cell] title]); - bool bValue = [(NSButton*)pControl state] == NSOnState; + bool bValue = [static_cast<NSButton*>(pControl) state] == NSOnState; aRetval <<= bValue; SAL_INFO("fpicker.aqua","value is a bool (checkbox): " << bValue); } @@ -422,7 +422,7 @@ void ControlHelper::createUserPane() NSTextField *textField = createLabelWithString(label); [textField sizeToFit]; - m_aMapListLabelFields[(NSPopUpButton*)pControl] = textField; + m_aMapListLabelFields[static_cast<NSPopUpButton*>(pControl)] = textField; [m_pUserPane addSubview:textField]; NSRect tfRect = [textField frame]; @@ -578,7 +578,7 @@ void ControlHelper::createControls() NSControl *pPreviewBox = m_pToggles[PREVIEW]; if (pPreviewBox != nil) { [pPreviewBox setEnabled:NO]; - [(NSButton*)pPreviewBox setState:NSOnState]; + [static_cast<NSButton*>(pPreviewBox) setState:NSOnState]; } } @@ -625,7 +625,7 @@ void ControlHelper::HandleSetListValue(const NSControl* pControl, const sal_Int1 return; } - NSPopUpButton *pButton = (NSPopUpButton*)pControl; + NSPopUpButton *pButton = static_cast<NSPopUpButton*>(pControl); NSMenu *rMenu = [pButton menu]; if (nil == rMenu) { SAL_INFO("fpicker.aqua","button has no menu"); @@ -780,7 +780,7 @@ void ControlHelper::layoutControls() if (nPopupMaxWidth < nControlWidth) { nPopupMaxWidth = nControlWidth; } - NSTextField *label = m_aMapListLabelFields[(NSPopUpButton*)pControl]; + NSTextField *label = m_aMapListLabelFields[static_cast<NSPopUpButton*>(pControl)]; NSRect labelFrame = [label frame]; int nLabelWidth = labelFrame.size.width; if (nPopupLabelMaxWidth < nLabelWidth) { @@ -825,7 +825,7 @@ void ControlHelper::layoutControls() currenttop += kAquaSpacePopupMenuFrameBoundsDiffTop;//from top //get the corresponding popup label - NSTextField *label = m_aMapListLabelFields[(NSPopUpButton*)pControl]; + NSTextField *label = m_aMapListLabelFields[static_cast<NSPopUpButton*>(pControl)]; NSRect labelFrame = [label frame]; int totalWidth = nPopupMaxWidth + labelFrame.size.width + kAquaSpaceBetweenControls - kAquaSpacePopupMenuFrameBoundsDiffLeft - kAquaSpaceLabelFrameBoundsDiffH; SAL_INFO("fpicker.aqua","totalWidth: " << totalWidth); diff --git a/fpicker/source/aqua/FilterHelper.mm b/fpicker/source/aqua/FilterHelper.mm index 63e578873292..4bfff715e748 100644 --- a/fpicker/source/aqua/FilterHelper.mm +++ b/fpicker/source/aqua/FilterHelper.mm @@ -328,7 +328,7 @@ bool FilterHelper::filenameMatchesFilter(NSString* sFilename) NSObject* pType = [pAttribs objectForKey: NSFileType]; if( pType && [pType isKindOfClass: [NSString class]] ) { - NSString* pT = (NSString*)pType; + NSString* pT = static_cast<NSString*>(pType); if( [pT isEqualToString: NSFileTypeDirectory] || [pT isEqualToString: NSFileTypeSymbolicLink] ) return true; diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index 761198bdcbf0..2ab668c0ba32 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -203,7 +203,7 @@ void SAL_CALL SalAquaFilePicker::setMultiSelectionMode( sal_Bool /* bMode */ ) SolarMutexGuard aGuard; if (m_nDialogType == NAVIGATIONSERVICES_OPEN) { - [(NSOpenPanel*)m_pDialog setAllowsMultipleSelection:YES]; + [static_cast<NSOpenPanel*>(m_pDialog) setAllowsMultipleSelection:YES]; } } @@ -256,7 +256,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles() NSArray *files = nil; if (m_nDialogType == NAVIGATIONSERVICES_OPEN) { - files = [(NSOpenPanel*)m_pDialog URLs]; + files = [static_cast<NSOpenPanel*>(m_pDialog) URLs]; } else if (m_nDialogType == NAVIGATIONSERVICES_SAVE) { files = [NSArray arrayWithObjects:[m_pDialog URL], nil]; diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm index 51da7ede79b9..a419701a9129 100644 --- a/fpicker/source/aqua/SalAquaFolderPicker.mm +++ b/fpicker/source/aqua/SalAquaFolderPicker.mm @@ -132,7 +132,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getDirectory() NSArray *files = nil; if (m_nDialogType == NAVIGATIONSERVICES_DIRECTORY) { - files = [(NSOpenPanel*)m_pDialog URLs]; + files = [static_cast<NSOpenPanel*>(m_pDialog) URLs]; } long nFiles = [files count]; diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm index cb83b21f6b89..a54cc49cb3ab 100644 --- a/fpicker/source/aqua/SalAquaPicker.mm +++ b/fpicker/source/aqua/SalAquaPicker.mm @@ -77,8 +77,8 @@ void SalAquaPicker::implInitialize() { case NAVIGATIONSERVICES_OPEN: m_pDialog = [NSOpenPanel openPanel]; - [(NSOpenPanel*)m_pDialog setCanChooseDirectories:NO]; - [(NSOpenPanel*)m_pDialog setCanChooseFiles:YES]; + [static_cast<NSOpenPanel*>(m_pDialog) setCanChooseDirectories:NO]; + [static_cast<NSOpenPanel*>(m_pDialog) setCanChooseFiles:YES]; break; case NAVIGATIONSERVICES_SAVE: @@ -104,8 +104,8 @@ void SalAquaPicker::implInitialize() case NAVIGATIONSERVICES_DIRECTORY: m_pDialog = [NSOpenPanel openPanel]; - [(NSOpenPanel*)m_pDialog setCanChooseDirectories:YES]; - [(NSOpenPanel*)m_pDialog setCanChooseFiles:NO]; + [static_cast<NSOpenPanel*>(m_pDialog) setCanChooseDirectories:YES]; + [static_cast<NSOpenPanel*>(m_pDialog) setCanChooseFiles:NO]; break; default: @@ -113,7 +113,7 @@ void SalAquaPicker::implInitialize() } if (m_pDialog != nil) { - [(NSOpenPanel*)m_pDialog setCanCreateDirectories:YES]; + [static_cast<NSOpenPanel*>(m_pDialog) setCanCreateDirectories:YES]; //Retain the dialog instance or it will go away immediately [m_pDialog retain]; } @@ -152,7 +152,7 @@ int SalAquaPicker::run() case NAVIGATIONSERVICES_DIRECTORY: case NAVIGATIONSERVICES_OPEN: [m_pDialog setDirectoryURL:startDirectory]; - retVal = [(NSOpenPanel*)m_pDialog runModal]; + retVal = [static_cast<NSOpenPanel*>(m_pDialog) runModal]; break; case NAVIGATIONSERVICES_SAVE: [m_pDialog setDirectoryURL:startDirectory]; diff --git a/include/vcl/keycodes.hxx b/include/vcl/keycodes.hxx index a46373d55e68..a17da6f95bd4 100644 --- a/include/vcl/keycodes.hxx +++ b/include/vcl/keycodes.hxx @@ -97,14 +97,14 @@ #define KEY_F15 (sal_uInt16(css::awt::Key::F15)) #define KEY_F16 (sal_uInt16(css::awt::Key::F16)) #define KEY_F17 (sal_uInt16(css::awt::Key::F17)) -#define KEY_F18 ((sal_uInt16)css::awt::Key::F18) +#define KEY_F18 (sal_uInt16(css::awt::Key::F18)) #define KEY_F19 (sal_uInt16(css::awt::Key::F19)) -#define KEY_F20 ((sal_uInt16)css::awt::Key::F20) -#define KEY_F21 ((sal_uInt16)css::awt::Key::F21) -#define KEY_F22 ((sal_uInt16)css::awt::Key::F22) -#define KEY_F23 ((sal_uInt16)css::awt::Key::F23) +#define KEY_F20 (sal_uInt16(css::awt::Key::F20)) +#define KEY_F21 (sal_uInt16(css::awt::Key::F21)) +#define KEY_F22 (sal_uInt16(css::awt::Key::F22)) +#define KEY_F23 (sal_uInt16(css::awt::Key::F23)) #define KEY_F24 (sal_uInt16(css::awt::Key::F24)) -#define KEY_F25 ((sal_uInt16)css::awt::Key::F25) +#define KEY_F25 (sal_uInt16(css::awt::Key::F25)) #define KEY_F26 (sal_uInt16(css::awt::Key::F26)) #define KEY_DOWN (sal_uInt16(css::awt::Key::DOWN)) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm index 5755d4c44c50..5a5d7303a18a 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm +++ b/jvmfwk/plugins/sunmajor/pluginlib/util_cocoa.mm @@ -85,7 +85,7 @@ bool JvmfwkUtil_isLoadableJVM( OUString const & aURL ) { if ( [pJVMCapabilities isKindOfClass:[NSMutableArray class]] ) { - [(NSMutableArray *)pJVMCapabilities addObject:@"JNI"]; + [static_cast<NSMutableArray *>(pJVMCapabilities) addObject:@"JNI"]; bRet = true; } else if ( [pJavaVM isKindOfClass:[NSMutableDictionary class]] ) @@ -94,7 +94,7 @@ bool JvmfwkUtil_isLoadableJVM( OUString const & aURL ) if ( pNewJVMCapabilities ) { [pNewJVMCapabilities addObject:@"JNI"]; - [(NSMutableDictionary *)pJavaVM setObject:pNewJVMCapabilities forKey:@"JVMCapabilities"]; + [static_cast<NSMutableDictionary *>(pJavaVM) setObject:pNewJVMCapabilities forKey:@"JVMCapabilities"]; bRet = true; } } diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm index 66ba35f017f7..15a195c52a02 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm @@ -115,7 +115,7 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales() //Test for existence of the dictionaries for (NSUInteger i = 0; i < [aLocales count]; i++) { - NSString* pLangStr = (NSString*)[aLocales objectAtIndex:i]; + NSString* pLangStr = static_cast<NSString*>([aLocales objectAtIndex:i]); if( [[NSSpellChecker sharedSpellChecker] setLanguage:pLangStr ] ) { postspdict.push_back( pLangStr ); @@ -349,7 +349,7 @@ Reference< XSpellAlternatives > { // if needed add: if (suglst[ii] == NULL) continue; NSString* guess = [guesses objectAtIndex:ii]; - OUString cvtwrd(reinterpret_cast<const sal_Unicode*>([guess cStringUsingEncoding:NSUnicodeStringEncoding]), (sal_Int32)[guess length]); + OUString cvtwrd(reinterpret_cast<const sal_Unicode*>([guess cStringUsingEncoding:NSUnicodeStringEncoding]), static_cast<sal_Int32>([guess length])); pStr[ii] = cvtwrd; } } diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index 103202b12310..d6c7f76442e9 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -124,7 +124,7 @@ oslFileError osl_getVolumeInformation( rtl_uString* ustrDirectoryURL, oslVolumeI #if defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD) || defined(DRAGONFLY) # define OSL_detail_STATFS_STRUCT struct statfs # define OSL_detail_STATFS(dir, sfs) statfs((dir), (sfs)) -# define OSL_detail_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_bsize)) +# define OSL_detail_STATFS_BLKSIZ(a) (static_cast<sal_uInt64>((a).f_bsize)) # define OSL_detail_STATFS_TYPENAME(a) ((a).f_fstypename) #if defined(OPENBSD) # define OSL_detail_STATFS_ISREMOTE(a) (rtl_str_compare((a).f_fstypename, "nfs") == 0) diff --git a/sal/osl/unx/time.cxx b/sal/osl/unx/time.cxx index 4e42e2dcac9a..4bd3003ef7d5 100644 --- a/sal/osl/unx/time.cxx +++ b/sal/osl/unx/time.cxx @@ -288,7 +288,7 @@ sal_uInt32 SAL_CALL osl_getGlobalTimer() mach_port_deallocate(mach_task_self(), cclock); nSeconds = ( currentTime.tv_sec - startTime.tv_sec ); - nSeconds = ( nSeconds * 1000 ) + (long) (( currentTime.tv_nsec - startTime.tv_nsec) / 1000000 ); + nSeconds = ( nSeconds * 1000 ) + static_cast<long>(( currentTime.tv_nsec - startTime.tv_nsec) / 1000000 ); #else osl_time_t currentTime; diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 968a7542bb57..ccdb332dc7ef 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -460,7 +460,7 @@ sal_Int32 OSXBluetoothWrapper::readLine( OString& aLine ) if (*p == '\n') s << "\\n"; else if (*p < ' ' || *p >= 0x7F) - s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << (int) *p << std::setfill(' ') << std::setw(1) << std::dec; + s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << static_cast<int>(*p) << std::setfill(' ') << std::setw(1) << std::dec; else s << *p; } diff --git a/shell/source/backends/macbe/macbackend.mm b/shell/source/backends/macbe/macbackend.mm index 5c5c0cfafae7..56a7ca2cc2de 100644 --- a/shell/source/backends/macbe/macbackend.mm +++ b/shell/source/backends/macbe/macbackend.mm @@ -106,7 +106,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por } if (result) - result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII); + result = CFStringGetCString(hostStr, host, static_cast<CFIndex>(hostSize), kCFStringEncodingASCII); // Get proxy port if (result) @@ -126,7 +126,7 @@ bool GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *por result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt); if (result) - *port = (UInt16) portInt; + *port = static_cast<UInt16>(portInt); if (proxyDict) CFRelease(proxyDict); diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index d74c7659235f..0209c9559089 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -450,7 +450,7 @@ sal_uInt64 tools::Time::GetMonotonicTicks() static mach_timebase_info_data_t info = { 0, 0 }; if ( 0 == info.numer ) mach_timebase_info( &info ); - nMicroSeconds = mach_absolute_time() * (double) (info.numer / info.denom) / 1000; + nMicroSeconds = mach_absolute_time() * static_cast<double>(info.numer / info.denom) / 1000; #else #if defined(USE_CLOCK_GETTIME) struct timespec currentTime; 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 |