summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-19 17:45:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-20 10:45:48 +0100
commitfc528a468061e165ee29f0ca450245331da3ef93 (patch)
tree150188c8939379c0134cc827ad94e2225cb8d4a8 /fpicker
parent0b87fdcad55d1927241073bc15c174168c5e0c1d (diff)
More loplugin:cstylecast on macOS
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870 Reviewed-on: https://gerrit.libreoffice.org/48216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/aqua/AquaFilePickerDelegate.mm4
-rw-r--r--fpicker/source/aqua/ControlHelper.hxx2
-rw-r--r--fpicker/source/aqua/ControlHelper.mm18
-rw-r--r--fpicker/source/aqua/FilterHelper.mm2
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.mm4
-rw-r--r--fpicker/source/aqua/SalAquaFolderPicker.mm2
-rw-r--r--fpicker/source/aqua/SalAquaPicker.mm12
7 files changed, 22 insertions, 22 deletions
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];