Kaydet (Commit) fc528a46 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More loplugin:cstylecast on macOS

Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after
cab0427c "Enable loplugin:cstylecast for some
more cases" and a409d32e "More
loplugin:cstylecast"

Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870
Reviewed-on: https://gerrit.libreoffice.org/48216Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 0b87fdca
......@@ -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 );
}
......
......@@ -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;
......
......@@ -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:
......
......@@ -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());
......
......@@ -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);
}
......
......@@ -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(
......
......@@ -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;
}
}
......
......@@ -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;
......
......@@ -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)
......
......@@ -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)
......
......@@ -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);
}
......
......@@ -115,7 +115,7 @@ public:
}
bool isAutoExtensionEnabled() {
return ([((NSButton*) m_pToggles[AUTOEXTENSION]) state] == NSOnState);
return ([static_cast<NSButton*>(m_pToggles[AUTOEXTENSION]) state] == NSOnState);
}
private:
......
......@@ -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);
......
......@@ -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;
......
......@@ -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];
......
......@@ -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];
......
......@@ -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];
......
......@@ -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))
......
......@@ -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;
}
}
......
......@@ -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;
}
}
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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); }
......
......@@ -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( )
......
......@@ -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];
......
......@@ -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 ];
}
......
......@@ -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]);