summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-10-21 10:47:36 +0300
committerTor Lillqvist <tml@collabora.com>2021-10-21 11:16:53 +0200
commit33d5c0248039c0b24a2adb4c2d4c1606f05e6278 (patch)
tree9f282c01f9b960e79e637a2c673309e868d4c9e3
parentf1b5443217c89a577226faa39408acdc807c4fe4 (diff)
Bin dead code
Change-Id: I2098172d065a195a15b7fd81a34dab25b1f38e57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123956 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--fpicker/Library_fps_aqua.mk1
-rw-r--r--fpicker/source/aqua/CFStringUtilities.hxx41
-rw-r--r--fpicker/source/aqua/CFStringUtilities.mm107
-rw-r--r--fpicker/source/aqua/ControlHelper.mm1
-rw-r--r--fpicker/source/aqua/FilterHelper.mm1
-rw-r--r--fpicker/source/aqua/NSString_OOoAdditions.mm1
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.hxx3
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.mm42
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.mm3
-rw-r--r--fpicker/source/aqua/SalAquaFolderPicker.mm3
-rw-r--r--fpicker/source/aqua/SalAquaPicker.mm3
11 files changed, 8 insertions, 198 deletions
diff --git a/fpicker/Library_fps_aqua.mk b/fpicker/Library_fps_aqua.mk
index 1c382e9638f5..4c033a838bc5 100644
--- a/fpicker/Library_fps_aqua.mk
+++ b/fpicker/Library_fps_aqua.mk
@@ -37,7 +37,6 @@ $(eval $(call gb_Library_use_libraries,fps_aqua,\
$(eval $(call gb_Library_add_objcxxobjects,fps_aqua,\
fpicker/source/aqua/AquaFilePickerDelegate \
- fpicker/source/aqua/CFStringUtilities \
fpicker/source/aqua/ControlHelper \
fpicker/source/aqua/FilterHelper \
fpicker/source/aqua/NSString_OOoAdditions \
diff --git a/fpicker/source/aqua/CFStringUtilities.hxx b/fpicker/source/aqua/CFStringUtilities.hxx
deleted file mode 100644
index b881081e29cf..000000000000
--- a/fpicker/source/aqua/CFStringUtilities.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <Cocoa/Cocoa.h>
-#include <postmac.h>
-#include <rtl/ustring.hxx>
-#include <sal/types.h>
-
-enum InfoType
-{
- FULLPATH,
- FILENAME,
- PATHWITHOUTLASTCOMPONENT
-};
-
-OUString CFStringToOUString(const CFStringRef sOrig);
-OUString FSRefToOUString(FSRef const& fsRef, InfoType info = FULLPATH);
-OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info);
-CFStringRef CFStringCreateWithOUString(const OUString& aString);
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/CFStringUtilities.mm b/fpicker/source/aqua/CFStringUtilities.mm
deleted file mode 100644
index b56f5d38242c..000000000000
--- a/fpicker/source/aqua/CFStringUtilities.mm
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <sal/log.hxx>
-#include "CFStringUtilities.hxx"
-
-OUString CFStringToOUString(const CFStringRef sOrig)
-{
- if (nullptr == sOrig) {
- return OUString();
- }
-
- CFRetain(sOrig);
- CFIndex nFileNameLength = CFStringGetLength(sOrig);
- //SAL_INFO("fpicker.aqua","FH: string length: " << (int)(nFileNameLength));
- UniChar unichars[nFileNameLength+1];
- //'close' the string buffer correctly
- unichars[nFileNameLength] = '\0';
-
- CFStringGetCharacters (sOrig, CFRangeMake(0,nFileNameLength), unichars);
-
- //we no longer need the original string
- CFRelease(sOrig);
-
- return OUString(reinterpret_cast<sal_Unicode *>(unichars));
-}
-
-CFStringRef CFStringCreateWithOUString(const OUString& aString)
-{
- CFStringRef ref = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<UniChar const *>(aString.getStr()), aString.getLength());
-
- return ref;
-}
-
-OUString FSRefToOUString(FSRef const & fsRef, InfoType info)
-{
- SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.9 CFURLCreateFromFSRef
- CFURLRef aUrlRef = CFURLCreateFromFSRef(nullptr, &fsRef);
- SAL_WNODEPRECATED_DECLARATIONS_POP
-
- OUString sResult = CFURLRefToOUString(aUrlRef, info);
-
- //we no longer need the CFURLRef
- CFRelease(aUrlRef);
-
- return sResult;
-}
-
-OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info)
-{
- CFStringRef sURLString = nullptr;
-
- switch(info) {
- case FULLPATH:
- SAL_INFO("fpicker.aqua","Extracting the full path of an item");
- sURLString = CFURLGetString(aUrlRef);
- CFRetain(sURLString);
- break;
- case FILENAME:
- {
- SAL_INFO("fpicker.aqua","Extracting the file name of an item");
- CFStringRef fullString = CFURLGetString(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(nullptr, fullString, substringRange);
- }
- break;
- case PATHWITHOUTLASTCOMPONENT:
- {
- SAL_INFO("fpicker.aqua","Extracting the last but one component of an item's path");
- CFURLRef directoryRef = CFURLCreateCopyDeletingLastPathComponent(nullptr,aUrlRef);
- sURLString = CFURLGetString(directoryRef);
- CFRetain(sURLString);
- CFRelease(directoryRef);
- }
- break;
- default:
- break;
- }
-
- OUString sResult = CFStringToOUString(sURLString);
-
- CFRelease(sURLString);
-
- return sResult;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm
index 22b7f37b1a13..84c002abc68c 100644
--- a/fpicker/source/aqua/ControlHelper.mm
+++ b/fpicker/source/aqua/ControlHelper.mm
@@ -23,7 +23,6 @@
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#include "CFStringUtilities.hxx"
#include "resourceprovider.hxx"
#include "NSString_OOoAdditions.hxx"
#include <sal/log.hxx>
diff --git a/fpicker/source/aqua/FilterHelper.mm b/fpicker/source/aqua/FilterHelper.mm
index b992785fa0a5..58508c434191 100644
--- a/fpicker/source/aqua/FilterHelper.mm
+++ b/fpicker/source/aqua/FilterHelper.mm
@@ -24,7 +24,6 @@
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
-#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
#include "NSURL_OOoAdditions.hxx"
diff --git a/fpicker/source/aqua/NSString_OOoAdditions.mm b/fpicker/source/aqua/NSString_OOoAdditions.mm
index aaca75a18827..23ae6bc5c853 100644
--- a/fpicker/source/aqua/NSString_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSString_OOoAdditions.mm
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
@implementation NSString (OOoAdditions)
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.hxx b/fpicker/source/aqua/NSURL_OOoAdditions.hxx
index f4e14e6e89bd..f63ccfdcc144 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.hxx
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.hxx
@@ -22,11 +22,10 @@
#include <premac.h>
#include <CoreFoundation/CoreFoundation.h>
#include <postmac.h>
-#include "CFStringUtilities.hxx"
#include <rtl/ustring.hxx>
@interface NSURL (OOoAdditions)
-- (OUString)OUStringForInfo:(InfoType)info;
+- (OUString)OUString;
@end
/*
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm
index 8e5398da6d53..5a3737e9b5c1 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm
@@ -22,49 +22,15 @@
#include <sal/log.hxx>
@implementation NSURL (OOoAdditions)
-- (OUString) OUStringForInfo:(InfoType)info
+- (OUString) OUString
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSString *sURLString = nil;
- switch(info) {
- case FULLPATH:
- SAL_INFO("fpicker.aqua","Extracting the full path of an item");
- sURLString = [self absoluteString];
- [sURLString retain];
- break;
- case FILENAME:
- {
- SAL_INFO("fpicker.aqua","Extracting the file name of an item");
- NSString *path = [self path];
- if (path == nil) {
- sURLString = @"";
- }
- else {
- sURLString = [path lastPathComponent];
- }
- [sURLString retain];
- }
- break;
- case PATHWITHOUTLASTCOMPONENT:
- {
- SAL_INFO("fpicker.aqua","Extracting the last but one component of an item's path");
- NSString *path = [self absoluteString];
- if (path == nil) {
- sURLString = @"";
- }
- else {
- NSString* lastComponent = [path lastPathComponent];
- unsigned int lastLength = [lastComponent length];
- sURLString = [path substringToIndex:([path length] - lastLength)];
- }
- [sURLString retain];
- }
- break;
- default:
- break;
- }
+ SAL_INFO("fpicker.aqua","Extracting the full path of an item");
+ sURLString = [self absoluteString];
+ [sURLString retain];
OUString sResult = [sURLString OUString];
[sURLString release];
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index 3426c9ed4265..6c16b04fc702 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -39,7 +39,6 @@
#include "resourceprovider.hxx"
#include <osl/file.hxx>
-#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
#include "NSURL_OOoAdditions.hxx"
@@ -278,7 +277,7 @@ uno::Sequence<OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles()
}
#endif
- OUString sFileOrDirURL = [url OUStringForInfo:FULLPATH];
+ OUString sFileOrDirURL = [url OUString];
aSelectedFiles[nIndex] = sFileOrDirURL;
}
diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm
index fa1285b053e9..3dabf488a365 100644
--- a/fpicker/source/aqua/SalAquaFolderPicker.mm
+++ b/fpicker/source/aqua/SalAquaFolderPicker.mm
@@ -36,7 +36,6 @@
#include "resourceprovider.hxx"
#include <osl/file.hxx>
-#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
#include "NSURL_OOoAdditions.hxx"
@@ -125,7 +124,7 @@ OUString SAL_CALL SalAquaFolderPicker::getDirectory()
NSURL *url = [files objectAtIndex:0];
- aDirectory = [url OUStringForInfo:FULLPATH];
+ aDirectory = [url OUString];
implsetDisplayDirectory(aDirectory);
diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm
index 19b649eed472..713d6d2ade13 100644
--- a/fpicker/source/aqua/SalAquaPicker.mm
+++ b/fpicker/source/aqua/SalAquaPicker.mm
@@ -28,7 +28,6 @@
#include <vcl/svapp.hxx>
#include "SalAquaPicker.hxx"
#include <osl/file.hxx>
-#include "CFStringUtilities.hxx"
#include "NSString_OOoAdditions.hxx"
#include "NSURL_OOoAdditions.hxx"
@@ -170,7 +169,7 @@ int SalAquaPicker::run()
SAL_WNODEPRECATED_DECLARATIONS_POP
NSURL* pDir = [m_pDialog directoryURL];
if (pDir) {
- implsetDisplayDirectory([pDir OUStringForInfo:FULLPATH]);
+ implsetDisplayDirectory([pDir OUString]);
}
}