diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:19:09 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 16:20:35 +0100 |
commit | 90dba06daf4979a431590cb1883a17ecaf5a7711 (patch) | |
tree | 119c6ab9d8644ac433a83cb6ef59b3e3910c2227 | |
parent | 48686457c762bc1f1ad414f6e609b7bc56f958b5 (diff) |
loplugin:nullptr (automatic rewrite; Mac-specific code)
Change-Id: I14ed4aa3cfc52dcb9a75de2364074dec18be3d5d
-rw-r--r-- | fpicker/source/aqua/AquaFilePickerDelegate.mm | 10 | ||||
-rw-r--r-- | fpicker/source/aqua/CFStringUtilities.mm | 12 | ||||
-rw-r--r-- | fpicker/source/aqua/ControlHelper.mm | 12 | ||||
-rw-r--r-- | fpicker/source/aqua/FPentry.mm | 2 | ||||
-rw-r--r-- | fpicker/source/aqua/FilterHelper.mm | 20 | ||||
-rw-r--r-- | fpicker/source/aqua/NSURL_OOoAdditions.mm | 10 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaFilePicker.mm | 8 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaPicker.mm | 10 |
8 files changed, 42 insertions, 42 deletions
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm index af3805a5517a..55fe45699922 100644 --- a/fpicker/source/aqua/AquaFilePickerDelegate.mm +++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm @@ -29,7 +29,7 @@ { if ((self = [super init])) { filePicker = fPicker; - filterHelper = NULL; + filterHelper = nullptr; return self; } return nil; @@ -45,7 +45,7 @@ - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename { (void)sender; - if( filterHelper == NULL ) + if( filterHelper == nullptr ) return true; if( filename == nil ) return false; @@ -55,7 +55,7 @@ - (void)panelSelectionDidChange:(id)sender { (void)sender; - if (filePicker != NULL) { + if (filePicker != nullptr) { css::ui::dialogs::FilePickerEvent evt; filePicker->fileSelectionChanged(evt); } @@ -65,7 +65,7 @@ { (void)sender; (void)path; - if (filePicker != NULL) { + if (filePicker != nullptr) { css::ui::dialogs::FilePickerEvent evt; filePicker->directoryChanged(evt); } @@ -83,7 +83,7 @@ return; } - if (filterHelper == NULL) { + if (filterHelper == nullptr) { return; } diff --git a/fpicker/source/aqua/CFStringUtilities.mm b/fpicker/source/aqua/CFStringUtilities.mm index c1f0c5b90573..464fbfa75ef9 100644 --- a/fpicker/source/aqua/CFStringUtilities.mm +++ b/fpicker/source/aqua/CFStringUtilities.mm @@ -23,7 +23,7 @@ rtl::OUString CFStringToOUString(const CFStringRef sOrig) { //DBG_PRINT_ENTRY("CFStringUtilities", __func__, "sOrig", sOrig); - if (NULL == sOrig) { + if (nullptr == sOrig) { return rtl::OUString(); } @@ -59,7 +59,7 @@ rtl::OUString FSRefToOUString(FSRef const & fsRef, InfoType info) //DBG_PRINT_ENTRY("CFStringUtilities", __func__); SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.9 CFURLCreateFromFSRef - CFURLRef aUrlRef = CFURLCreateFromFSRef(NULL, &fsRef); + CFURLRef aUrlRef = CFURLCreateFromFSRef(nullptr, &fsRef); SAL_WNODEPRECATED_DECLARATIONS_POP rtl::OUString sResult = CFURLRefToOUString(aUrlRef, info); @@ -76,7 +76,7 @@ rtl::OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info) { //DBG_PRINT_ENTRY("CFStringUtilities", __func__); - CFStringRef sURLString = NULL; + CFStringRef sURLString = nullptr; switch(info) { case FULLPATH: @@ -88,18 +88,18 @@ rtl::OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info) { SAL_INFO("fpicker.aqua","Extracting the file name of an item"); CFStringRef fullString = CFURLGetString(aUrlRef); - CFURLRef dirRef = CFURLCreateCopyDeletingLastPathComponent(NULL,aUrlRef); + CFURLRef dirRef = CFURLCreateCopyDeletingLastPathComponent(nullptr,aUrlRef); CFIndex dirLength = CFStringGetLength(CFURLGetString(dirRef)); CFRelease(dirRef); CFIndex fullLength = CFStringGetLength(fullString); CFRange substringRange = CFRangeMake(dirLength, fullLength - dirLength); - sURLString = CFStringCreateWithSubstring(NULL, fullString, substringRange); + sURLString = CFStringCreateWithSubstring(nullptr, fullString, substringRange); } break; case PATHWITHOUTLASTCOMPONENT: { SAL_INFO("fpicker.aqua","Extracting the last but one component of an item's path"); - CFURLRef directoryRef = CFURLCreateCopyDeletingLastPathComponent(NULL,aUrlRef); + CFURLRef directoryRef = CFURLCreateCopyDeletingLastPathComponent(nullptr,aUrlRef); sURLString = CFURLGetString(directoryRef); CFRetain(sURLString); CFRelease(directoryRef); diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm index 8e0c294c46d5..af8a002f2439 100644 --- a/fpicker/source/aqua/ControlHelper.mm +++ b/fpicker/source/aqua/ControlHelper.mm @@ -136,12 +136,12 @@ NSTextField* createLabelWithString(NSString* labelString) { // Constructor / Destructor ControlHelper::ControlHelper() -: m_pUserPane(NULL) +: m_pUserPane(nullptr) , m_pFilterControl(nil) , m_bUserPaneNeeded( false ) , m_bIsUserPaneLaidOut(false) , m_bIsFilterControlNeeded(false) -, m_pFilterHelper(NULL) +, m_pFilterHelper(nullptr) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); @@ -164,11 +164,11 @@ ControlHelper::~ControlHelper() NSAutoreleasePool *pool = [NSAutoreleasePool new]; - if (NULL != m_pUserPane) { + if (nullptr != m_pUserPane) { [m_pUserPane release]; } - if (m_pFilterControl != NULL) { + if (m_pFilterControl != nullptr) { [m_pFilterControl setTarget:nil]; } @@ -319,7 +319,7 @@ void ControlHelper::setLabel( sal_Int16 nControlId, NSString* aLabel ) if (nil != pControl) { if ([pControl class] == [NSPopUpButton class]) { NSString *sOldName = m_aMapListLabels[pControl]; - if (sOldName != NULL && sOldName != aLabel) { + if (sOldName != nullptr && sOldName != aLabel) { [sOldName release]; } @@ -995,7 +995,7 @@ void ControlHelper::updateFilterUI() { DBG_PRINT_ENTRY(CLASS_NAME, __func__); - if (!m_bIsFilterControlNeeded || m_pFilterHelper == NULL) { + if (!m_bIsFilterControlNeeded || m_pFilterHelper == nullptr) { SAL_INFO("fpicker.aqua","no filter control needed or no filter helper present"); DBG_PRINT_EXIT(CLASS_NAME, __func__); return; diff --git a/fpicker/source/aqua/FPentry.mm b/fpicker/source/aqua/FPentry.mm index 5c2689010141..fbb9c0ca2507 100644 --- a/fpicker/source/aqua/FPentry.mm +++ b/fpicker/source/aqua/FPentry.mm @@ -52,7 +52,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL fps_aqua_component_getFactory( const sal_Char* pImplName, void* pSrvManager, void* /*pRegistryKey*/ ) { - void* pRet = 0; + void* pRet = nullptr; if( pSrvManager ) { diff --git a/fpicker/source/aqua/FilterHelper.mm b/fpicker/source/aqua/FilterHelper.mm index 808277deb011..e0b7773d7c2d 100644 --- a/fpicker/source/aqua/FilterHelper.mm +++ b/fpicker/source/aqua/FilterHelper.mm @@ -182,8 +182,8 @@ public: #define CLASS_NAME "FilterHelper" FilterHelper::FilterHelper() -: m_pFilterList(NULL) -, m_pFilterNames(NULL) +: m_pFilterList(nullptr) +, m_pFilterNames(nullptr) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); DBG_PRINT_EXIT(CLASS_NAME, __func__); @@ -195,11 +195,11 @@ FilterHelper::~FilterHelper() NSAutoreleasePool *pool = [NSAutoreleasePool new]; - if (NULL != m_pFilterList) { + if (nullptr != m_pFilterList) { delete m_pFilterList; } - if (NULL != m_pFilterNames) { + if (nullptr != m_pFilterNames) { //we called retain when we added the strings to the list, so we should release them now for (NSStringList::iterator iter = m_pFilterNames->begin(); iter != m_pFilterNames->end(); iter++) { [*iter release]; @@ -251,7 +251,7 @@ bool FilterHelper::FilterNameExists( const UnoFilterList& _rGroupedFilters ) void FilterHelper::ensureFilterList( const ::rtl::OUString& _rInitialCurrentFilter ) { //OSL_TRACE(">>> FilterHelper::%s", __func__); - if( NULL == m_pFilterList ) + if( nullptr == m_pFilterList ) { m_pFilterList = new FilterList; @@ -358,7 +358,7 @@ throw (css::lang::IllegalArgumentException, css::uno::RuntimeException) { SolarMutexGuard aGuard; //add a separator if this is not the first group to be added - bool bPrependSeparator = m_pFilterList != NULL; + bool bPrependSeparator = m_pFilterList != nullptr; // ensure that we have a filter list ::rtl::OUString sInitialCurrentFilter; @@ -386,7 +386,7 @@ bool FilterHelper::filenameMatchesFilter(NSString* sFilename) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); - if (m_aCurrentFilter == NULL) { + if (m_aCurrentFilter == nullptr) { OSL_TRACE("filter name is null"); return true; } @@ -448,9 +448,9 @@ FilterList* FilterHelper::getFilterList() { NSStringList* FilterHelper::getFilterNames() { DBG_PRINT_ENTRY(CLASS_NAME, __func__); - if (NULL == m_pFilterList) - return NULL; - if (NULL == m_pFilterNames) { + if (nullptr == m_pFilterList) + return nullptr; + if (nullptr == m_pFilterNames) { //build filter names list m_pFilterNames = new NSStringList; for (FilterList::iterator iter = m_pFilterList->begin(); iter != m_pFilterList->end(); iter++) { diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm index 1fc59afcda50..9753ed082d34 100644 --- a/fpicker/source/aqua/NSURL_OOoAdditions.mm +++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm @@ -81,18 +81,18 @@ NSString* resolveAlias( NSString* i_pSystemPath ) CFURLRef rUrl = CFURLCreateWithFileSystemPath( kCFAllocatorDefault, reinterpret_cast<CFStringRef>(i_pSystemPath), kCFURLPOSIXPathStyle, false); - if( rUrl != NULL ) + if( rUrl != nullptr ) { CFErrorRef rError; - CFDataRef rBookmark = CFURLCreateBookmarkDataFromFile( NULL, rUrl, &rError ); + CFDataRef rBookmark = CFURLCreateBookmarkDataFromFile( nullptr, rUrl, &rError ); CFRelease( rUrl ); - if( rBookmark != NULL ) + if( rBookmark != nullptr ) { Boolean bIsStale; CFURLRef rResolvedUrl = CFURLCreateByResolvingBookmarkData( kCFAllocatorDefault, rBookmark, kCFBookmarkResolutionWithoutUIMask, - NULL, NULL, &bIsStale, &rError ); + nullptr, nullptr, &bIsStale, &rError ); CFRelease( rBookmark ); - if( rResolvedUrl == NULL ) + if( rResolvedUrl == nullptr ) { CFRelease( rError ); } diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index 6eb3042c266a..915e22442c3a 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -89,7 +89,7 @@ namespace SalAquaFilePicker::SalAquaFilePicker() : SalAquaFilePicker_Base( m_rbHelperMtx ) - , m_pFilterHelper( NULL ) + , m_pFilterHelper( nullptr ) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); @@ -103,7 +103,7 @@ SalAquaFilePicker::~SalAquaFilePicker() { DBG_PRINT_ENTRY(CLASS_NAME, __func__); - if (NULL != m_pFilterHelper) + if (nullptr != m_pFilterHelper) delete m_pFilterHelper; [m_pDelegate release]; @@ -178,7 +178,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException ) //if no filename is set, NavigationServices will set the name to "untitled". We don't want this! //So let's try to get the window title to get the real untitled name NSWindow *frontWindow = [NSApp keyWindow]; - if (NULL != frontWindow) { + if (nullptr != frontWindow) { NSString *windowTitle = [frontWindow title]; if (windowTitle != nil) { rtl::OUString ouName = [windowTitle OUString]; @@ -712,7 +712,7 @@ void SalAquaFilePicker::ensureFilterHelper() { SolarMutexGuard aGuard; - if (NULL == m_pFilterHelper) { + if (nullptr == m_pFilterHelper) { m_pFilterHelper = new FilterHelper; m_pControlHelper->setFilterHelper(m_pFilterHelper); [m_pDelegate setFilterHelper:m_pFilterHelper]; diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm index e45a37e24f49..fde40b1b2a12 100644 --- a/fpicker/source/aqua/SalAquaPicker.mm +++ b/fpicker/source/aqua/SalAquaPicker.mm @@ -52,7 +52,7 @@ using namespace ::com::sun::star::uno; // constructor SalAquaPicker::SalAquaPicker() -: m_pDialog(NULL) +: m_pDialog(nullptr) , m_pControlHelper(new ControlHelper()) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); @@ -67,10 +67,10 @@ SalAquaPicker::~SalAquaPicker() NSAutoreleasePool *pool = [NSAutoreleasePool new]; - if (NULL != m_pControlHelper) + if (nullptr != m_pControlHelper) delete m_pControlHelper; - if (NULL != m_pDialog) + if (nullptr != m_pDialog) [m_pDialog release]; [pool release]; @@ -152,13 +152,13 @@ int SalAquaPicker::run() NSAutoreleasePool *pool = [NSAutoreleasePool new]; - if (m_pDialog == NULL) { + if (m_pDialog == nullptr) { //this is the case e.g. for the folder picker at this stage implInitialize(); } NSView *userPane = m_pControlHelper->getUserPane(); - if (userPane != NULL) { + if (userPane != nullptr) { [m_pDialog setAccessoryView:userPane]; } |