diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-05 15:40:06 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-05 15:40:06 +0000 |
commit | 60c23d489d507be3de321375bab5130db9172fd1 (patch) | |
tree | 23768a5cc18bdb759ba143e51f330e30b7704362 /fpicker | |
parent | 8c0f8695fe4e3f205106a2c548429f6c5b154281 (diff) |
INTEGRATION: CWS aquafilepicker02_DEV300 (1.2.40); FILE MERGED
2008/01/14 08:23:24 fheckl 1.2.40.2: Code cleanup and some implementation details
2008/01/02 18:25:59 fheckl 1.2.40.1: issue #80399 more Cocoa
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/aqua/fps_aqua.xml | 1 | ||||
-rw-r--r-- | fpicker/source/aqua/resourceprovider.cxx | 50 | ||||
-rw-r--r-- | fpicker/source/aqua/resourceprovider.hxx | 14 |
3 files changed, 32 insertions, 33 deletions
diff --git a/fpicker/source/aqua/fps_aqua.xml b/fpicker/source/aqua/fps_aqua.xml index e671e8a4a3af..955ad4e32886 100644 --- a/fpicker/source/aqua/fps_aqua.xml +++ b/fpicker/source/aqua/fps_aqua.xml @@ -21,7 +21,6 @@ <type>com.sun.star.ui.dialogs.ExecutableDialogException</type> <type>com.sun.star.ui.dialogs.XFilePickerNotifier</type> <type>com.sun.star.ui.dialogs.XFilePickerControlAccess</type> - <type>com.sun.star.ui.dialogs.XFilePreview</type> <type>com.sun.star.ui.dialogs.ExtendedFilePickerElementIds</type> <type>com.sun.star.ui.dialogs.ExecutableDialogResults</type> <type>com.sun.star.ui.dialogs.FilePickerEvent</type> diff --git a/fpicker/source/aqua/resourceprovider.cxx b/fpicker/source/aqua/resourceprovider.cxx index 6185afb6e421..dd40c411cd5c 100644 --- a/fpicker/source/aqua/resourceprovider.cxx +++ b/fpicker/source/aqua/resourceprovider.cxx @@ -4,9 +4,9 @@ * * $RCSfile: resourceprovider.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ihi $ $Date: 2007-07-11 11:00:56 $ + * last change: $Author: kz $ $Date: 2008-03-05 16:39:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -45,10 +45,6 @@ #include <rtl/ustrbuf.hxx> #endif -#ifndef _RESOURCEPROVIDER_HXX_ -#include "resourceprovider.hxx" -#endif - #ifndef _VOS_MUTEX_HXX_ #include <vos/mutex.hxx> #endif @@ -69,8 +65,19 @@ #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #endif +#ifndef _SVTOOLS_SVTOOLS_HRC_ #include <svtools/svtools.hrc> +#endif + +#ifndef _SVTOOLS_FILEDLG2_HRC_ #include <svtools/filedlg2.hrc> +#endif + +#ifndef _NSSTRING_OOOADDITIONS_HXX_ +#include "NSString_OOoAdditions.hxx" +#endif + +#include "resourceprovider.hxx" //------------------------------------------------------------ // namespace directives @@ -111,13 +118,14 @@ _Entry CtrlIdToResIdTable[] = { { CHECKBOX_SELECTION, STR_SVT_FILEPICKER_SELECTION }, { FOLDERPICKER_TITLE, STR_SVT_FOLDERPICKER_DEFAULT_TITLE }, { FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION }, - { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE } + { FILE_PICKER_OVERWRITE, STR_SVT_ALREADYEXISTOVERWRITE }, + { LISTBOX_FILTER_LABEL, STR_SVT_FILEPICKER_FILTER_TITLE} }; _Entry OtherCtrlIdToResIdTable[] = { { FILE_PICKER_TITLE_OPEN, STR_FILEDLG_OPEN }, { FILE_PICKER_TITLE_SAVE, STR_FILEDLG_SAVE }, - { FILE_PICKER_FILE_TYPE, STR_FILEDLG_TYPE }, + { FILE_PICKER_FILE_TYPE, STR_FILEDLG_TYPE } }; @@ -192,7 +200,7 @@ public: // //------------------------------------- - CFStringRef getResString( sal_Int16 aId ) + NSString* getResString( sal_Int16 aId ) { String aResString; OUString aResOUString; @@ -210,8 +218,9 @@ public: else { aResId = OtherCtrlIdToResId( aId ); - if ( aResId > -1 ) + if ( aResId > -1 ) { aResString = String( ResId( aResId, *m_OtherResMgr ) ); + } } if ( aResId > -1 ) aResOUString = OUString( aResString ); @@ -220,7 +229,7 @@ public: { } - return CFStringCreateWithOUString(aResOUString); + return [NSString stringWithOUString:aResOUString]; } public: @@ -250,20 +259,13 @@ CResourceProvider::~CResourceProvider( ) // //------------------------------------------------------------ -CFStringRef CResourceProvider::getResString( sal_Int32 aId ) +NSString* CResourceProvider::getResString( sal_Int32 aId ) { - CFStringRef sImmutable = m_pImpl->getResString( aId ); - CFIndex nLength = CFStringGetLength(sImmutable); - CFMutableStringRef sMutableString = CFStringCreateMutableCopy(kCFAllocatorDefault,nLength,sImmutable); - CFRelease(sImmutable); - CFStringRef sToFind = CFSTR("~"); - CFStringRef sRep = CFSTR(""); - CFStringFindAndReplace(sMutableString,sToFind,sRep,CFRangeMake(0,nLength),0); - CFRelease(sToFind); - CFRelease(sRep); - - CFStringRef result = CFStringCreateCopy(kCFAllocatorDefault,sMutableString); - CFRelease(sMutableString); + NSString* sImmutable = m_pImpl->getResString( aId ); + NSMutableString *sMutableString = [NSMutableString stringWithString:sImmutable]; + [sMutableString replaceOccurrencesOfString:@"~" withString:@"" options:0 range:NSMakeRange(0, [sMutableString length])]; + + NSString *result = [NSString stringWithString:sMutableString]; return result; } diff --git a/fpicker/source/aqua/resourceprovider.hxx b/fpicker/source/aqua/resourceprovider.hxx index 8ba166560c7f..db4f7cb44816 100644 --- a/fpicker/source/aqua/resourceprovider.hxx +++ b/fpicker/source/aqua/resourceprovider.hxx @@ -4,9 +4,9 @@ * * $RCSfile: resourceprovider.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ihi $ $Date: 2007-07-11 11:01:07 $ + * last change: $Author: kz $ $Date: 2008-03-05 16:40:06 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -45,11 +45,9 @@ #include <sal/types.h> #endif -#ifndef _RTL_USTRING_HXX_ -#include <rtl/ustring> -#endif - -#include "CFStringUtilities.hxx" +#include <premac.h> +#include <Cocoa/Cocoa.h> +#include <postmac.h> #define FOLDERPICKER_TITLE 500 #define FOLDER_PICKER_DEF_DESCRIPTION 501 @@ -70,7 +68,7 @@ public: CResourceProvider( ); ~CResourceProvider( ); - CFStringRef getResString( sal_Int32 aId ); + NSString* getResString( sal_Int32 aId ); private: CResourceProvider_Impl* m_pImpl; |