diff options
author | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-10 13:50:33 +0800 |
---|---|---|
committer | Xiaofei Zhang <Zhangxiaofei@openoffice.org> | 2010-11-10 13:50:33 +0800 |
commit | fa1f3c352c6126b24ab5af87ea4ebea742c546c2 (patch) | |
tree | 5a5240e4969fee626bb060bd386fceb957081f90 /fpicker | |
parent | d0097a3f35e5e2c68d293d604a2f6f51b2d822a5 (diff) | |
parent | 3c21373571fd0cf89391502aa132c5f420cd75c6 (diff) |
removetooltypes01: #i112600# resync to DEV300_m92; remove tooltypes from xmloff, linguistic, vcl, svtools, accessibility, fpicker, uui and framework
Diffstat (limited to 'fpicker')
59 files changed, 720 insertions, 477 deletions
diff --git a/fpicker/prj/d.lst b/fpicker/prj/d.lst index 7c4e0bf6024a..4fff0467fc87 100644 --- a/fpicker/prj/d.lst +++ b/fpicker/prj/d.lst @@ -9,6 +9,10 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid ..\source\win32\filepicker\*.xml %_DEST%\xml%_EXT%\*.xml ..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml -..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt -..\source\unx\kde4\fps-kde4-ucd.txt %_DEST%\bin%_EXT%\fps-kde4-ucd.txt -..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt +..\%__SRC%\misc\fop.component %_DEST%\xml%_EXT%\fop.component +..\%__SRC%\misc\fpicker.component %_DEST%\xml%_EXT%\fpicker.component +..\%__SRC%\misc\fps.component %_DEST%\xml%_EXT%\fps.component +..\%__SRC%\misc\fps_aqua.component %_DEST%\xml%_EXT%\fps_aqua.component +..\%__SRC%\misc\fps_gnome.component %_DEST%\xml%_EXT%\fps_gnome.component +..\%__SRC%\misc\fps_kde4.component %_DEST%\xml%_EXT%\fps_kde4.component +..\%__SRC%\misc\fps_office.component %_DEST%\xml%_EXT%\fps_office.component diff --git a/fpicker/source/aqua/ControlHelper.cxx b/fpicker/source/aqua/ControlHelper.cxx index 470c22e09b10..0df9c485f65b 100644 --- a/fpicker/source/aqua/ControlHelper.cxx +++ b/fpicker/source/aqua/ControlHelper.cxx @@ -340,8 +340,8 @@ void ControlHelper::createUserPane() int currentHeight = kAquaSpaceBoxFrameViewDiffTop + kAquaSpaceBoxFrameViewDiffBottom; int currentWidth = 300; - BOOL bPopupControlPresent = NO; - BOOL bButtonControlPresent = NO; + sal_Bool bPopupControlPresent = NO; + sal_Bool bButtonControlPresent = NO; int nCheckboxMaxWidth = 0; int nPopupMaxWidth = 0; diff --git a/fpicker/source/aqua/FPentry.cxx b/fpicker/source/aqua/FPentry.cxx index 127d1f5d60bb..5d5dc16c5d32 100644 --- a/fpicker/source/aqua/FPentry.cxx +++ b/fpicker/source/aqua/FPentry.cxx @@ -95,32 +95,6 @@ void SAL_CALL component_getImplementationEnvironment( // //------------------------------------------------ -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - pXNewKey->createKey( OUString::createFromAscii( FOLDER_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; -} - -//------------------------------------------------ -// -//------------------------------------------------ - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx index 10e429f201c5..9c644326005e 100644 --- a/fpicker/source/aqua/FilterHelper.cxx +++ b/fpicker/source/aqua/FilterHelper.cxx @@ -35,6 +35,7 @@ // #endif #include "CFStringUtilities.hxx" #include "NSString_OOoAdditions.hxx" +#include "NSURL_OOoAdditions.hxx" #include "FilterHelper.hxx" @@ -428,6 +429,16 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) } } + // might be an alias + NSString* pResolved = resolveAlias( sFilename ); + if( pResolved ) + { + sal_Bool bResult = filenameMatchesFilter( pResolved ); + [pResolved autorelease]; + if( bResult ) + return sal_True; + } + DBG_PRINT_EXIT(CLASS_NAME, __func__); return sal_False; diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.hxx b/fpicker/source/aqua/NSURL_OOoAdditions.hxx index 8be2c0362096..31b55385e155 100644 --- a/fpicker/source/aqua/NSURL_OOoAdditions.hxx +++ b/fpicker/source/aqua/NSURL_OOoAdditions.hxx @@ -29,15 +29,20 @@ #define _NSURL_OOOADDITIONS_HXX_ #include <premac.h> -#include <Foundation/Foundation.h> +#include <CoreFoundation/CoreFoundation.h> #include <postmac.h> #include "CFStringUtilities.hxx" #include <rtl/ustring.hxx> -// #include <sal/types.h> - @interface NSURL (OOoAdditions) - (rtl::OUString) OUStringForInfo:(InfoType)info; @end -#endif
\ No newline at end of file +/* + returns the resolved string if there was an alias + if there was no alias, nil is returned +*/ + +NSString* resolveAlias( NSString* i_pSystemPath ); + +#endif diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm index 56fc198650c8..ecc38b7e232b 100644 --- a/fpicker/source/aqua/NSURL_OOoAdditions.mm +++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm @@ -80,3 +80,33 @@ return sResult; } @end + +NSString* resolveAlias( NSString* i_pSystemPath ) +{ + NSString* pResolvedPath = nil; + CFURLRef rUrl = CFURLCreateWithFileSystemPath( kCFAllocatorDefault, + (CFStringRef)i_pSystemPath, + kCFURLPOSIXPathStyle, false); + if( rUrl != NULL ) + { + FSRef rFS; + if( CFURLGetFSRef( rUrl, &rFS ) ) + { + MacOSBoolean bIsFolder = false; + MacOSBoolean bAlias = false; + OSErr err = FSResolveAliasFile( &rFS, true, &bIsFolder, &bAlias); + if( (err == noErr) && bAlias ) + { + CFURLRef rResolvedUrl = CFURLCreateFromFSRef( kCFAllocatorDefault, &rFS ); + if( rResolvedUrl != NULL ) + { + pResolvedPath = (NSString*)CFURLCopyFileSystemPath( rResolvedUrl, kCFURLPOSIXPathStyle ); + CFRelease( rResolvedUrl ); + } + } + } + CFRelease( rUrl ); + } + + return pResolvedPath; +} diff --git a/fpicker/source/aqua/fps-aqua-ucd.txt b/fpicker/source/aqua/fps-aqua-ucd.txt deleted file mode 100644 index d71e8f4a574f..000000000000 --- a/fpicker/source/aqua/fps-aqua-ucd.txt +++ /dev/null @@ -1,13 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalAquaFilePicker -ComponentName=fps_aqua.uno.dylib -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.AquaFilePicker - -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalAquaFolderPicker -ComponentName=fps_aqua.uno.dylib -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.AquaFolderPicker diff --git a/fpicker/source/aqua/fps_aqua.component b/fpicker/source/aqua/fps_aqua.component new file mode 100644 index 000000000000..a04443e37ffd --- /dev/null +++ b/fpicker/source/aqua/fps_aqua.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.ui.dialogs.SalAquaFilePicker"> + <service name="com.sun.star.ui.dialogs.AquaFilePicker"/> + </implementation> + <implementation name="com.sun.star.ui.dialogs.SalAquaFolderPicker"> + <service name="com.sun.star.ui.dialogs.AquaFolderPicker"/> + </implementation> +</component> diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk index 10990e22d5e1..ff0473c8a71e 100644 --- a/fpicker/source/aqua/makefile.mk +++ b/fpicker/source/aqua/makefile.mk @@ -83,3 +83,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fps_aqua.component + +$(MISC)/fps_aqua.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_aqua.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_aqua.component diff --git a/fpicker/source/generic/fpicker.component b/fpicker/source/generic/fpicker.component new file mode 100644 index 000000000000..7d44d006d960 --- /dev/null +++ b/fpicker/source/generic/fpicker.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.fpicker.FilePicker"> + <service name="com.sun.star.ui.dialogs.FilePicker"/> + </implementation> + <implementation name="com.sun.star.comp.fpicker.FolderPicker"> + <service name="com.sun.star.ui.dialogs.FolderPicker"/> + </implementation> +</component> diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx index 4589b3319163..7d6417099ae0 100644 --- a/fpicker/source/generic/fpicker.cxx +++ b/fpicker/source/generic/fpicker.cxx @@ -216,13 +216,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * pServiceManager, void * pRegistryKey) -{ - return cppu::component_writeInfoHelper ( - pServiceManager, pRegistryKey, g_entries); -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey) { diff --git a/fpicker/source/generic/makefile.mk b/fpicker/source/generic/makefile.mk index bfbfb65f3da6..0b2ad77baac6 100644 --- a/fpicker/source/generic/makefile.mk +++ b/fpicker/source/generic/makefile.mk @@ -60,3 +60,11 @@ DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fpicker.component + +$(MISC)/fpicker.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fpicker.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fpicker.component diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index e0b5d259302d..6afe6e509acf 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -33,9 +33,8 @@ #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ControlActions.hpp> #include <vcl/lstbox.hxx> -#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HPP_ #include <com/sun/star/uno/Sequence.hxx> -#endif +#include <tools/urlobj.hxx> #include <algorithm> #include <functional> @@ -201,37 +200,36 @@ namespace svt } //--------------------------------------------------------------------- - void OControlAccess::setHelpURL( Window* _pControl, const ::rtl::OUString& _rURL, sal_Bool _bFileView ) + void OControlAccess::setHelpURL( Window* _pControl, const ::rtl::OUString& sHelpURL, sal_Bool _bFileView ) { - String sHelpURL( _rURL ); - if ( COMPARE_EQUAL == sHelpURL.CompareIgnoreCaseToAscii( "HID:", sizeof( "HID:" ) - 1 ) ) - { - String sID = sHelpURL.Copy( sizeof( "HID:" ) - 1 ); - sal_Int32 nHelpId = sID.ToInt32(); + rtl::OUString sHelpID( sHelpURL ); + INetURLObject aHID( sHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + sHelpID = aHID.GetURLPath(); - if ( _bFileView ) - // the file view "overloaded" the SetHelpId - static_cast< SvtFileView* >( _pControl )->SetHelpId( nHelpId ); - else - _pControl->SetHelpId( nHelpId ); - } + // URLs should always be UTF8 encoded and escaped + rtl::OString sID( rtl::OUStringToOString( sHelpID, RTL_TEXTENCODING_UTF8 ) ); + if ( _bFileView ) + // the file view "overloaded" the SetHelpId + static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); else - { - DBG_ERRORFILE( "OControlAccess::setHelpURL: unsupported help URL type!" ); - } + _pControl->SetHelpId( sID ); } //--------------------------------------------------------------------- ::rtl::OUString OControlAccess::getHelpURL( Window* _pControl, sal_Bool _bFileView ) { - sal_Int32 nHelpId = _pControl->GetHelpId(); + rtl::OString aHelpId = _pControl->GetHelpId(); if ( _bFileView ) // the file view "overloaded" the SetHelpId - nHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); - - ::rtl::OUString sHelpURL( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sHelpURL += ::rtl::OUString::valueOf( (sal_Int32)nHelpId ); - + aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); + + ::rtl::OUString sHelpURL; + ::rtl::OUString aTmp( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); + INetURLObject aHID( aTmp ); + if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) + sHelpURL = rtl::OUString::createFromAscii( INET_HID_SCHEME ); + sHelpURL += aTmp; return sHelpURL; } @@ -539,7 +537,7 @@ namespace svt { sal_Int32 nPos = 0; if ( _rValue >>= nPos ) - _pListbox->RemoveEntry( (USHORT) nPos ); + _pListbox->RemoveEntry( (sal_uInt16) nPos ); } break; @@ -677,7 +675,7 @@ namespace svt sal_Int32 nPos = 0; if ( _rValue >>= nPos ) { - static_cast< ListBox* >( _pControl )->SelectEntryPos( (USHORT) nPos ); + static_cast< ListBox* >( _pControl )->SelectEntryPos( (sal_uInt16) nPos ); } else if ( !_bIgnoreIllegalArgument ) { @@ -739,7 +737,7 @@ namespace svt Sequence< ::rtl::OUString > aItems( static_cast< ListBox* >( _pControl )->GetEntryCount() ); ::rtl::OUString* pItems = aItems.getArray(); - for ( USHORT i=0; i<static_cast< ListBox* >( _pControl )->GetEntryCount(); ++i ) + for ( sal_uInt16 i=0; i<static_cast< ListBox* >( _pControl )->GetEntryCount(); ++i ) *pItems++ = static_cast< ListBox* >( _pControl )->GetEntry( i ); aReturn <<= aItems; @@ -751,7 +749,7 @@ namespace svt DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implGetControlProperty: invalid control/property combination!" ); - USHORT nSelected = static_cast< ListBox* >( _pControl )->GetSelectEntryPos(); + sal_uInt16 nSelected = static_cast< ListBox* >( _pControl )->GetSelectEntryPos(); ::rtl::OUString sSelected; if ( LISTBOX_ENTRY_NOTFOUND != nSelected ) sSelected = static_cast< ListBox* >( _pControl )->GetSelectEntry(); @@ -764,7 +762,7 @@ namespace svt DBG_ASSERT( WINDOW_LISTBOX == _pControl->GetType(), "OControlAccess::implGetControlProperty: invalid control/property combination!" ); - USHORT nSelected = static_cast< ListBox* >( _pControl )->GetSelectEntryPos(); + sal_uInt16 nSelected = static_cast< ListBox* >( _pControl )->GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != nSelected ) aReturn <<= (sal_Int32)static_cast< ListBox* >( _pControl )->GetSelectEntryPos(); else diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx index 35196907f900..739b9211a09f 100644 --- a/fpicker/source/office/OfficeControlAccess.hxx +++ b/fpicker/source/office/OfficeControlAccess.hxx @@ -92,7 +92,7 @@ namespace svt @param _rValue the value to set @param _bIgnoreIllegalArgument - if <FALSE/>, an exception will be thrown if the given value is of improper type + if <sal_False/>, an exception will be thrown if the given value is of improper type */ void implSetControlProperty( sal_Int16 _nControlId, diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index 516c62fe7580..c7ef19a4dbb8 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -477,7 +477,7 @@ sal_Int16 SvtFilePicker::implExecutePicker( ) prepareExecute(); - getDialog()->EnableAutocompletion( TRUE ); + getDialog()->EnableAutocompletion( sal_True ); // now we are ready to execute the dialog sal_Int16 nRet = getDialog()->Execute(); @@ -549,7 +549,7 @@ void SAL_CALL SvtFilePicker::startExecuteModal( const Reference< ::com::sun::sta m_xDlgClosedListener = xListener; prepareDialog(); prepareExecute(); - getDialog()->EnableAutocompletion( TRUE ); + getDialog()->EnableAutocompletion( sal_True ); getDialog()->StartExecuteModal( LINK( this, SvtFilePicker, DialogClosedHdl ) ); } @@ -625,8 +625,8 @@ Sequence< rtl::OUString > SAL_CALL SvtFilePicker::getFiles() throw( RuntimeExcep // files first and then the list of the selected entries SvStringsDtor* pPathList = getDialog()->GetPathList(); - USHORT i, nCount = pPathList->Count(); - USHORT nTotal = nCount > 1 ? nCount+1: nCount; + sal_uInt16 i, nCount = pPathList->Count(); + sal_uInt16 nTotal = nCount > 1 ? nCount+1: nCount; Sequence< rtl::OUString > aPath( nTotal ); diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx index 48d3a2b43bad..076635ffa923 100644 --- a/fpicker/source/office/OfficeFolderPicker.cxx +++ b/fpicker/source/office/OfficeFolderPicker.cxx @@ -108,7 +108,7 @@ void SAL_CALL SvtFolderPicker::startExecuteModal( const Reference< ::com::sun::s m_xListener = xListener; prepareDialog(); prepareExecute(); - getDialog()->EnableAutocompletion( TRUE ); + getDialog()->EnableAutocompletion( sal_True ); getDialog()->StartExecuteModal( LINK( this, SvtFolderPicker, DialogClosedHdl ) ); } @@ -124,7 +124,7 @@ sal_Int16 SvtFolderPicker::implExecutePicker( ) prepareExecute(); // now we are ready to execute the dialog - getDialog()->EnableAutocompletion( FALSE ); + getDialog()->EnableAutocompletion( sal_False ); sal_Int16 nRet = getDialog()->Execute(); return nRet; diff --git a/fpicker/source/office/commonpicker.hxx b/fpicker/source/office/commonpicker.hxx index 2531f5e7f4c5..fd6d952fbe2f 100644 --- a/fpicker/source/office/commonpicker.hxx +++ b/fpicker/source/office/commonpicker.hxx @@ -188,7 +188,7 @@ namespace svt /** handle a single argument from the XInitialization::initialize method - @return <TRUE/> if the argument could be handled + @return <sal_True/> if the argument could be handled */ virtual sal_Bool implHandleInitializationArgument( const ::rtl::OUString& _rName, diff --git a/fpicker/source/office/fps_office.component b/fpicker/source/office/fps_office.component new file mode 100644 index 000000000000..3e49f68a49db --- /dev/null +++ b/fpicker/source/office/fps_office.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.svtools.OfficeFilePicker"> + <service name="com.sun.star.ui.dialogs.OfficeFilePicker"/> + </implementation> + <implementation name="com.sun.star.svtools.OfficeFolderPicker"> + <service name="com.sun.star.ui.dialogs.OfficeFolderPicker"/> + </implementation> +</component> diff --git a/fpicker/source/office/fps_office.cxx b/fpicker/source/office/fps_office.cxx index 52659e1f76f5..3d06873338de 100644 --- a/fpicker/source/office/fps_office.cxx +++ b/fpicker/source/office/fps_office.cxx @@ -63,13 +63,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - return cppu::component_writeInfoHelper ( - pServiceManager, pRegistryKey, g_entries); -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey) { diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index b9d7fac3aa3b..131e0841cfb7 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -392,7 +392,7 @@ namespace // ----------------------------------------------------------------------- /** retrieves the value of an environment variable - @return <TRUE/> if and only if the retrieved string value is not empty + @return <sal_True/> if and only if the retrieved string value is not empty */ bool getEnvironmentValue( const sal_Char* _pAsciiEnvName, ::rtl::OUString& _rValue ) { @@ -411,7 +411,7 @@ struct ControlChain_Impl { Window* _pControl; ControlChain_Impl* _pNext; - BOOL _bHasOwnerShip; + sal_Bool _bHasOwnerShip; ControlChain_Impl( Window* pControl, ControlChain_Impl* pNext ); ~ControlChain_Impl(); @@ -426,7 +426,7 @@ ControlChain_Impl::ControlChain_Impl ) : _pControl( pControl ), _pNext( pNext ), - _bHasOwnerShip( TRUE ) + _bHasOwnerShip( sal_True ) { } @@ -464,7 +464,7 @@ namespace struct SvtResId : public ResId { - SvtResId (USHORT nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} + SvtResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} }; } @@ -491,7 +491,7 @@ SvtFileDialog::SvtFileDialog ,_pFileNotifier( NULL ) ,_pImp( new SvtExpFileDlg_Impl( nBits ) ) ,_nExtraBits( nExtraBits ) - ,_bIsInExecute( FALSE ) + ,_bIsInExecute( sal_False ) ,m_bInExecuteAsync( false ) ,m_bHasFilename( false ) { @@ -514,7 +514,7 @@ SvtFileDialog::SvtFileDialog ( Window* _pParent, WinBits nBits ) ,_pFileNotifier( NULL ) ,_pImp( new SvtExpFileDlg_Impl( nBits ) ) ,_nExtraBits( 0L ) - ,_bIsInExecute( FALSE ) + ,_bIsInExecute( sal_False ) ,m_bHasFilename( false ) { Init_Impl( nBits ); @@ -641,7 +641,7 @@ void SvtFileDialog::Init_Impl _pImp->_pBtnStandard->SetAccessibleName( _pImp->_pBtnStandard->GetQuickHelpText() ); if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION ) - _pImp->_bMultiSelection = TRUE; + _pImp->_bMultiSelection = sal_True; _pFileView = new SvtFileView( this, SvtResId( CTL_EXPLORERFILE_FILELIST ), FILEDLG_TYPE_PATHDLG == _pImp->_eDlgType, @@ -670,7 +670,7 @@ void SvtFileDialog::Init_Impl LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width(); // calculate the length of all buttons - const USHORT nBtnCount = 3; // "previous level", "new folder" and "standard dir" + const sal_uInt16 nBtnCount = 3; // "previous level", "new folder" and "standard dir" long nDelta = n6AppFontInPixel; // right border nDelta += ( nBtnCount * aSize.Width() ); // button count * button width nDelta += ( n3AppFontInPixel + n3AppFontInPixel / 2 ); // spacing 1*big 1*small @@ -761,8 +761,8 @@ void SvtFileDialog::Init_Impl SetSizePixel( aSize ); // Beschriftungen dem Modus anpassen. - USHORT nResId = STR_EXPLORERFILE_OPEN; - USHORT nButtonResId = 0; + sal_uInt16 nResId = STR_EXPLORERFILE_OPEN; + sal_uInt16 nButtonResId = 0; if ( nStyle & WB_SAVEAS ) { @@ -900,7 +900,7 @@ sal_Bool SvtFileDialog::createNewUserFilter( const String& _rNewFilter, sal_Bool // 05.12.2001 - 95486 - fs@openoffice.org // now, the default extension is set to the one of the user filter (or empty) - // if the former is not allowed (_bAllowUserDefExt = <FALSE/>), we have to use the ext of the current filter + // if the former is not allowed (_bAllowUserDefExt = <sal_False/>), we have to use the ext of the current filter // (if possible) sal_Bool bUseCurFilterExt = sal_True; String sUserFilter = _pImp->_pUserFilter->GetType(); @@ -945,7 +945,7 @@ sal_uInt16 SvtFileDialog::adjustFilter( const String& _rFilter ) sal_Bool bFilterChanged = sal_True; // search for a corresponding filter - SvtFileDialogFilter_Impl* pFilter = FindFilter_Impl( _rFilter, FALSE, bFilterChanged ); + SvtFileDialogFilter_Impl* pFilter = FindFilter_Impl( _rFilter, sal_False, bFilterChanged ); #ifdef AUTOSELECT_USERFILTER // if we found a filter which without allowing multi-extensions -> select it @@ -958,7 +958,7 @@ sal_uInt16 SvtFileDialog::adjustFilter( const String& _rFilter ) // look for multi-ext filters if necessary if ( !pFilter ) - pFilter = FindFilter_Impl( _rFilter, TRUE, bFilterChanged ); + pFilter = FindFilter_Impl( _rFilter, sal_True, bFilterChanged ); if ( bFilterChanged ) nReturn |= FLT_CHANGED; @@ -1007,7 +1007,7 @@ IMPL_LINK( SvtFileDialog, CancelHdl_Impl, void*, EMPTYARG ) } else { - EndDialog( FALSE ); + EndDialog( sal_False ); } return 1L; } @@ -1085,7 +1085,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) return 0; } - USHORT nLen = aFileName.Len(); + sal_uInt16 nLen = aFileName.Len(); if ( !nLen ) { // if the dialog was opened to select a folder, the last selected folder should be selected @@ -1127,7 +1127,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) } // Pr"ufen, ob es sich um einen Ordner handelt. - BOOL bIsFolder = FALSE; + sal_Bool bIsFolder = sal_False; // first thing before doing anyhing with the content: Reset it. When the user presses "open" (or "save" or "export", // for that matter), s/he wants the complete handling, including all possible error messages, even if s/he @@ -1195,7 +1195,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) pThis->_pImp->GetCurFilter()->GetType()); } - BOOL bOpenFolder = ( FILEDLG_TYPE_PATHDLG == pThis->_pImp->_eDlgType ) && + sal_Bool bOpenFolder = ( FILEDLG_TYPE_PATHDLG == pThis->_pImp->_eDlgType ) && !pThis->_pImp->_bDoubleClick && pVoid != pThis->_pImp->_pEdFileName; if ( bIsFolder ) { @@ -1270,7 +1270,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) INetURLObject aPathObj = aFileObj; aPathObj.removeSegment(); // #97148# & #102204# ------------ - BOOL bFolder = pThis->m_aContent.isFolder( aPathObj.GetMainURL( INetURLObject::NO_DECODE ) ); + sal_Bool bFolder = pThis->m_aContent.isFolder( aPathObj.GetMainURL( INetURLObject::NO_DECODE ) ); if ( !bFolder ) { ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTSPATH ); @@ -1329,7 +1329,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) if ( nRet ) { - pThis->EndDialog( TRUE ); + pThis->EndDialog( sal_True ); } return nRet; @@ -1337,7 +1337,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) //***************************************************************************** -void SvtFileDialog::EnableAutocompletion( BOOL _bEnable ) +void SvtFileDialog::EnableAutocompletion( sal_Bool _bEnable ) { _pImp->_pEdFileName->EnableAutocompletion( _bEnable ); } @@ -1398,7 +1398,7 @@ IMPL_STATIC_LINK( SvtFileDialog, FilterSelectHdl_Impl, ListBox*, pBox ) // Ggf. Endung anzeigen. pThis->SetDefaultExt( pSelectedFilter->GetExtension() ); - USHORT nSepPos = pThis->GetDefaultExt().Search( FILEDIALOG_DEF_EXTSEP ); + sal_uInt16 nSepPos = pThis->GetDefaultExt().Search( FILEDIALOG_DEF_EXTSEP ); if ( nSepPos != STRING_NOTFOUND ) pThis->EraseDefaultExt( nSepPos ); @@ -1450,9 +1450,9 @@ IMPL_STATIC_LINK( SvtFileDialog, FileNameModifiedHdl_Impl, void*, EMPTYARG ) SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl ( const String& _rFilter, - sal_Bool _bMultiExt,/* TRUE - auch Filter mit mehreren Endungen + sal_Bool _bMultiExt,/* sal_True - auch Filter mit mehreren Endungen beruecksichtigen - FALSE - keine ... + sal_False - keine ... */ sal_Bool& _rFilterChanged ) @@ -1466,7 +1466,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl { SvtFileDialogFilter_Impl* pFoundFilter = NULL; SvtFileDialogFilterList_Impl* pList = _pImp->_pFilter; - USHORT nFilter = pList->Count(); + sal_uInt16 nFilter = pList->Count(); while ( nFilter-- ) { @@ -1476,7 +1476,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl if ( _bMultiExt ) { - USHORT nIdx = 0; + sal_uInt16 nIdx = 0; while ( !pFoundFilter && nIdx != STRING_NOTFOUND ) { aSingleType = rType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nIdx ); @@ -1527,7 +1527,7 @@ void SvtFileDialog::OpenMultiSelection_Impl() { String aPath; - ULONG nCount = _pFileView->GetSelectionCount(); + sal_uIntPtr nCount = _pFileView->GetSelectionCount(); SvLBoxEntry* pEntry = nCount ? _pFileView->FirstSelected() : NULL; if ( nCount && pEntry ) @@ -1542,7 +1542,7 @@ void SvtFileDialog::OpenMultiSelection_Impl() nRet = OK(); if ( nRet ) - EndDialog( TRUE ); + EndDialog( sal_True ); } //***************************************************************************** @@ -1565,7 +1565,7 @@ void SvtFileDialog::UpdateControls( const String& rURL ) { // no Fsys path for server file system ( only UCB has mountpoints! ) if ( INET_PROT_FILE != aObj.GetProtocol() ) - sText = rURL.Copy( static_cast< USHORT >( + sText = rURL.Copy( static_cast< sal_uInt16 >( INetURLObject::GetScheme( aObj.GetProtocol() ).getLength() ) ); } @@ -1657,9 +1657,9 @@ IMPL_LINK( SvtFileDialog, SelectHdl_Impl, SvTabListBox*, pBox ) IMPL_LINK( SvtFileDialog, DblClickHdl_Impl, SvTabListBox*, EMPTYARG ) { - _pImp->_bDoubleClick = TRUE; + _pImp->_bDoubleClick = sal_True; OpenHdl_Impl( this, NULL ); - _pImp->_bDoubleClick = FALSE; + _pImp->_bDoubleClick = sal_False; return 0; } @@ -1761,13 +1761,13 @@ long SvtFileDialog::Notify( NotifyEvent& rNEvt ) */ { - USHORT nType = rNEvt.GetType(); + sal_uInt16 nType = rNEvt.GetType(); long nRet = 0; if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() ) { const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode(); - USHORT nCode = rKeyCode.GetCode(); + sal_uInt16 nCode = rKeyCode.GetCode(); if ( !rKeyCode.GetModifier() && KEY_BACKSPACE == nCode && !_pImp->_pEdFileName->HasChildPathFocus() ) @@ -1797,7 +1797,7 @@ long SvtFileDialog::Notify( NotifyEvent& rNEvt ) long SvtFileDialog::OK() { - return TRUE; + return sal_True; } //***************************************************************************** @@ -1874,7 +1874,7 @@ String SvtFileDialog::implGetInitialURL( const String& _rPath, const String& _rF INetURLObject aURLParser; // set the path - bool bWasAbsolute = FALSE; + bool bWasAbsolute = sal_False; aURLParser = aURLParser.smartRel2Abs( _rPath, bWasAbsolute ); // is it a valid folder? @@ -1927,9 +1927,9 @@ short SvtFileDialog::Execute() return 0; // Start des Dialogs. - _bIsInExecute = TRUE; + _bIsInExecute = sal_True; short nResult = ModalDialog::Execute(); - _bIsInExecute = FALSE; + _bIsInExecute = sal_False; DBG_ASSERT( !m_pCurrentAsyncAction.is(), "SvtFilePicker::Execute: still running an async action!" ); // the dialog should not be cancellable while an async action is running - firs, the action @@ -1946,7 +1946,7 @@ short SvtFileDialog::Execute() sal_Int32 nLevel = aURL.getSegmentCount(); // #97148# & #102204# ------ sal_Bool bDir = m_aContent.isFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); - // BOOL bClassPath = ( ( _pImp->_nStyle & SFXWB_CLASSPATH ) == SFXWB_CLASSPATH ); + // sal_Bool bClassPath = ( ( _pImp->_nStyle & SFXWB_CLASSPATH ) == SFXWB_CLASSPATH ); if ( nLevel > 1 && ( FILEDLG_TYPE_FILEDLG == _pImp->_eDlgType || !bDir ) ) aURL.removeSegment(); } @@ -1961,23 +1961,23 @@ void SvtFileDialog::StartExecuteModal( const Link& rEndDialogHdl ) PrepareExecute(); // Start des Dialogs. -// _bIsInExecute = TRUE; +// _bIsInExecute = sal_True; ModalDialog::StartExecuteModal( rEndDialogHdl ); } //----------------------------------------------------------------------------- void SvtFileDialog::onAsyncOperationStarted() { - EnableUI( FALSE ); + EnableUI( sal_False ); // the cancel button must be always enabled - _pImp->_pBtnCancel->Enable( TRUE ); + _pImp->_pBtnCancel->Enable( sal_True ); _pImp->_pBtnCancel->GrabFocus(); } //----------------------------------------------------------------------------- void SvtFileDialog::onAsyncOperationFinished() { - EnableUI( TRUE ); + EnableUI( sal_True ); m_pCurrentAsyncAction = NULL; if ( !m_bInExecuteAsync ) _pImp->_pEdFileName->GrabFocus(); @@ -2029,7 +2029,7 @@ void SvtFileDialog::displayIOException( const String& _rURL, IOErrorCode _eCode } //----------------------------------------------------------------------------- -void SvtFileDialog::EnableUI( BOOL _bEnable ) +void SvtFileDialog::EnableUI( sal_Bool _bEnable ) { Enable( _bEnable ); @@ -2040,13 +2040,13 @@ void SvtFileDialog::EnableUI( BOOL _bEnable ) ++aLoop ) { - (*aLoop)->Enable( FALSE ); + (*aLoop)->Enable( sal_False ); } } } //----------------------------------------------------------------------------- -void SvtFileDialog::EnableControl( Control* _pControl, BOOL _bEnable ) +void SvtFileDialog::EnableControl( Control* _pControl, sal_Bool _bEnable ) { if ( !_pControl ) { @@ -2179,16 +2179,16 @@ short SvtFileDialog::PrepareExecute() _pImp->InitFilterList(); // Initialen Filter einstellen. - USHORT nFilterCount = GetFilterCount(); + sal_uInt16 nFilterCount = GetFilterCount(); String aAll( SvtResId( STR_FILTERNAME_ALL ) ); - BOOL bHasAll = _pImp->HasFilterListEntry( aAll ); + sal_Bool bHasAll = _pImp->HasFilterListEntry( aAll ); if ( _pImp->GetCurFilter() || nFilterCount == 1 || ( nFilterCount == 2 && bHasAll ) ) { // Ggf. einzigen Filter als aktuellen Filter setzen oder den einzigen // Filter, der nicht auf alle Dateien verweist. if ( !_pImp->GetCurFilter() ) { - USHORT nPos = 0; + sal_uInt16 nPos = 0; if ( 2 == nFilterCount && bHasAll ) { nPos = nFilterCount; @@ -2206,7 +2206,7 @@ short SvtFileDialog::PrepareExecute() // Anzeige anpassen. _pImp->SelectFilterListEntry( _pImp->GetCurFilter()->GetName() ); SetDefaultExt( _pImp->GetCurFilter()->GetExtension() ); - USHORT nSepPos = GetDefaultExt().Search( FILEDIALOG_DEF_EXTSEP ); + sal_uInt16 nSepPos = GetDefaultExt().Search( FILEDIALOG_DEF_EXTSEP ); if ( nSepPos != STRING_NOTFOUND ) EraseDefaultExt( nSepPos ); } @@ -2404,7 +2404,7 @@ void SvtFileDialog::OpenURL_Impl( const String& _rURL ) SvtFileDialogFilter_Impl* SvtFileDialog::implAddFilter( const String& _rFilter, const String& _rType ) { SvtFileDialogFilter_Impl* pNewFilter = new SvtFileDialogFilter_Impl( _rFilter, _rType ); - _pImp->_pFilter->C40_INSERT( SvtFileDialogFilter_Impl, pNewFilter, (USHORT)0 ); + _pImp->_pFilter->C40_INSERT( SvtFileDialogFilter_Impl, pNewFilter, (sal_uInt16)0 ); if ( !_pImp->GetCurFilter() ) _pImp->SetCurFilter( pNewFilter, _rFilter ); @@ -2440,7 +2440,7 @@ void SvtFileDialog::SetCurFilter( const String& rFilter ) DBG_ASSERT( !IsInExecute(), "SvtFileDialog::SetCurFilter: currently executing!" ); // Entsprechenden Filter suchen. - USHORT nPos = _pImp->_pFilter->Count(); + sal_uInt16 nPos = _pImp->_pFilter->Count(); while ( nPos-- ) { @@ -2473,14 +2473,14 @@ String SvtFileDialog::getCurFilter( ) const //***************************************************************************** -USHORT SvtFileDialog::GetFilterCount() const +sal_uInt16 SvtFileDialog::GetFilterCount() const { return _pImp->_pFilter->Count(); } //***************************************************************************** -const String& SvtFileDialog::GetFilterName( USHORT nPos ) const +const String& SvtFileDialog::GetFilterName( sal_uInt16 nPos ) const { DBG_ASSERT( nPos < GetFilterCount(), "invalid index" ); return _pImp->_pFilter->GetObject( nPos )->GetName(); @@ -2524,7 +2524,7 @@ void SvtFileDialog::InitSize() SvStringsDtor* SvtFileDialog::GetPathList() const { SvStringsDtor* pList = new SvStringsDtor; - ULONG nCount = _pFileView->GetSelectionCount(); + sal_uIntPtr nCount = _pFileView->GetSelectionCount(); SvLBoxEntry* pEntry = nCount ? _pFileView->FirstSelected() : NULL; if ( ! pEntry ) @@ -2600,12 +2600,12 @@ void SvtFileDialog::implArrangeControls() //***************************************************************************** -BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) +sal_Bool SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) { String aEmpty; String aReversePath( rPath ); aReversePath.Reverse(); - USHORT nQuestionMarkPos = rPath.Search( '?' ); + sal_uInt16 nQuestionMarkPos = rPath.Search( '?' ); if ( nQuestionMarkPos != STRING_NOTFOUND ) { @@ -2615,12 +2615,12 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) if ( INET_PROT_NOT_VALID != eProt && INET_PROT_FILE != eProt ) nQuestionMarkPos = STRING_NOTFOUND; } - USHORT nWildCardPos = Min( rPath.Search( FILEDIALOG_DEF_WILDCARD ), nQuestionMarkPos ); + sal_uInt16 nWildCardPos = Min( rPath.Search( FILEDIALOG_DEF_WILDCARD ), nQuestionMarkPos ); rFilter = aEmpty; if ( nWildCardPos != STRING_NOTFOUND ) { - USHORT nPathTokenPos = aReversePath.Search( INET_PATH_TOKEN ); + sal_uInt16 nPathTokenPos = aReversePath.Search( INET_PATH_TOKEN ); if ( nPathTokenPos == STRING_NOTFOUND ) { @@ -2653,7 +2653,7 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) if ( nPathTokenPos < (rPath.Len() - nWildCardPos - 1) ) { ErrorHandler::HandleError( ERRCODE_SFX_INVALIDSYNTAX ); - return FALSE; + return sal_False; } // Filter abschneiden. @@ -2673,7 +2673,7 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) } } - return TRUE; + return sal_True; } //***************************************************************************** @@ -3021,7 +3021,7 @@ void SvtFileDialog::AddControls_Impl( ) { _pImp->_pCbAutoExtension = new CheckBox( this, SvtResId( CB_AUTO_EXTENSION ) ); _pImp->_pCbAutoExtension->SetText( SvtResId( STR_SVT_FILEPICKER_AUTO_EXTENSION ) ); - _pImp->_pCbAutoExtension->Check( TRUE ); + _pImp->_pCbAutoExtension->Check( sal_True ); AddControl( _pImp->_pCbAutoExtension ); ReleaseOwnerShip( _pImp->_pCbAutoExtension ); _pImp->_pCbAutoExtension->SetClickHdl( LINK( this, SvtFileDialog, AutoExtensionHdl_Impl ) ); @@ -3214,7 +3214,7 @@ void SvtFileDialog::ReleaseOwnerShip( Window* pUserControl ) { if ( pElement->_pControl == pUserControl ) { - pElement->_bHasOwnerShip = FALSE; + pElement->_bHasOwnerShip = sal_False; break; } pElement = pElement->_pNext; @@ -3223,14 +3223,14 @@ void SvtFileDialog::ReleaseOwnerShip( Window* pUserControl ) //*************************************************************************** -BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) +sal_Bool SvtFileDialog::AddControl( Window* pControl, sal_Bool bNewLine ) { // control already exists ControlChain_Impl* pElement = _pUserControls; while ( pElement ) { if ( pElement->_pControl == pControl ) - return FALSE; + return sal_False; pElement = pElement->_pNext; } @@ -3272,8 +3272,8 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) } Point aNewControlPos; Size* pNewDlgSize = NULL; - BOOL bNewRow = bNewLine; - FASTBOOL bFirstNewRow = FALSE; + sal_Bool bNewRow = bNewLine; + int bFirstNewRow = sal_False; if ( nType == WINDOW_WINDOW ) { @@ -3300,13 +3300,13 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) // Check if a new row has to be created. if ( aNewControlRange.X() > aDlgSize.Width() ) - bNewRow = TRUE; + bNewRow = sal_True; } else { // Create a new row if there was no usercontrol before. - bNewRow = TRUE; - bFirstNewRow = TRUE; + bNewRow = sal_True; + bFirstNewRow = sal_True; } // Check if a new row has to be created. @@ -3346,7 +3346,7 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) pControl->Show(); _pUserControls = new ControlChain_Impl( pControl, _pUserControls ); - return TRUE; + return sal_True; } sal_Bool SvtFileDialog::ContentHasParentFolder( const rtl::OUString& rURL ) @@ -3394,14 +3394,14 @@ void SvtFileDialog::appendDefaultExtension(String& _rFileName, if ( ! aType.EqualsAscii(FILEDIALOG_FILTER_ALL) ) { - USHORT nWildCard = aType.GetTokenCount( FILEDIALOG_DEF_EXTSEP ); - USHORT nIndex, nPos = 0; + sal_uInt16 nWildCard = aType.GetTokenCount( FILEDIALOG_DEF_EXTSEP ); + sal_uInt16 nIndex, nPos = 0; for ( nIndex = 0; nIndex < nWildCard; nIndex++ ) { String aExt(aType.GetToken( 0, FILEDIALOG_DEF_EXTSEP, nPos )); // take care of a leading * - USHORT nExtOffset = (aExt.GetBuffer()[0] == '*' ? 1 : 0); + sal_uInt16 nExtOffset = (aExt.GetBuffer()[0] == '*' ? 1 : 0); sal_Unicode* pExt = aExt.GetBufferAccess() + nExtOffset; xub_StrLen nExtLen = aExt.Len() - nExtOffset; xub_StrLen nOffset = aTemp.Len() - nExtLen; @@ -3468,12 +3468,12 @@ IMPL_LINK( QueryFolderNameDialog, NameHdl, Edit *, EMPTYARG ) if ( aName.Len() ) { if ( !aOKBtn.IsEnabled() ) - aOKBtn.Enable( TRUE ); + aOKBtn.Enable( sal_True ); } else { if ( aOKBtn.IsEnabled() ) - aOKBtn.Enable( FALSE ); + aOKBtn.Enable( sal_False ); } return 0; diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index 15f5121b0965..b87082b56cbd 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -28,9 +28,8 @@ #ifndef _SVTOOLS_IODLGIMPL_HRC #define _SVTOOLS_IODLGIMPL_HRC -#ifndef _SVTOOLS_HRC #include "svtools/svtools.hrc" -#endif +#include "svtools/helpid.hrc" // ModalDialog DLG_SVT_EXPLORERFILE @@ -86,22 +85,5 @@ #define SID_SFX_START 5000 #define SID_OPENURL (SID_SFX_START + 596) -#define HID_FILEDLG_STANDARD (HID_SFX_START + 27) -#define HID_FILEDLG_MANAGER (HID_SFX_START + 28) -#define HID_FILEDLG_URL (HID_SFX_START + 29) -#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31) -#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32) - -#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218) -#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219) -#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220) -#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221) -#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222) -#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223) -#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224) -#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225) -#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226) -#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227) - #endif diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index fbfa9a9355a5..3cc06453f11f 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -110,7 +110,7 @@ private: ::svt::IFilePickerListener* _pFileNotifier; SvtExpFileDlg_Impl* _pImp; WinBits _nExtraBits; - BOOL _bIsInExecute : 1; + sal_Bool _bIsInExecute : 1; ImageList m_aImages; ::svt::SmartContent m_aContent; @@ -142,7 +142,7 @@ private: @param _bMultiExt allow for filters with more than one extension pattern @param _rFilterChanged - set to <TRUE/> if the filter changed + set to <sal_True/> if the filter changed @return the filter which has been found */ @@ -163,14 +163,14 @@ private: DECL_LINK( PlayButtonHdl_Impl, PushButton* ); // entfernt einen Filter mit Wildcards aus dem Path und gibt in zurueck - BOOL IsolateFilterFromPath_Impl( String& rPath, String& rFilter ); + sal_Bool IsolateFilterFromPath_Impl( String& rPath, String& rFilter ); void implArrangeControls(); void implUpdateImages( ); protected: virtual long Notify( NotifyEvent& rNEvt ); - void EnableInternet( BOOL bInternet ); + void EnableInternet( sal_Bool bInternet ); // originally from VclFileDialog Link _aOKHdl; @@ -191,14 +191,14 @@ protected: This is under the assumption that you'll use EnableControl. Direct access to the control (such as pControl->Enable()) will break this. */ - void EnableUI( BOOL _bEnable ); + void EnableUI( sal_Bool _bEnable ); /** enables or disables a control You are strongly encouraged to prefer this method over pControl->Enable( _bEnable ). See <member>EnableUI</member> for details. */ - void EnableControl( Control* _pControl, BOOL _bEnable ); + void EnableControl( Control* _pControl, sal_Bool _bEnable ); short PrepareExecute(); public: @@ -228,8 +228,8 @@ public: void SetCurFilter( const String& rFilter ); String GetCurFilter() const; - USHORT GetFilterCount() const; - const String& GetFilterName( USHORT nPos ) const; + sal_uInt16 GetFilterCount() const; + const String& GetFilterName( sal_uInt16 nPos ) const; virtual void Resize(); virtual void DataChanged( const DataChangedEvent& _rDCEvt ); @@ -242,7 +242,7 @@ public: void DisableSaveLastDirectory(); void InitSize(); void UpdateControls( const String& rURL ); - void EnableAutocompletion( BOOL _bEnable = TRUE ); + void EnableAutocompletion( sal_Bool _bEnable = sal_True ); void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) { _pFileNotifier = pNotifier; } @@ -267,7 +267,7 @@ public: } // originally from VclFileDialog - virtual BOOL AddControl( Window* pControl, BOOL bNewLine = FALSE ); + virtual sal_Bool AddControl( Window* pControl, sal_Bool bNewLine = sal_False ); // inline inline void SetPath( const String& rNewURL ); @@ -303,7 +303,7 @@ public: only certain URLs can be browsed. This method checks whether a given URL belongs to this set of permitted URLs.</p> - <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p> + <p>If no "access restriction" is effective, this method always returns <sal_True/>.</p> */ inline bool isUrlAllowed( const String& _rURL ) const { return m_aURLFilter.isUrlAllowed( _rURL ); } @@ -313,16 +313,16 @@ private: /** updates _pUserFilter with a new filter <p>No checks for necessity are made.</p> @param _bAllowUserDefExt - set to <TRUE/> if a filter like "*.txt" should reset the DefaultExtension to doc. + set to <sal_True/> if a filter like "*.txt" should reset the DefaultExtension to doc. <p> In a file-save-dialog this would have the following effect:<br/> Say that auto-extension is checked, and the user enters *.txt, while a non-txt filter is selected.<br/> - If _bAllowUserDefExt is set to <TRUE/>, then a user input of "foo" would save a foo.txt, but in a format + If _bAllowUserDefExt is set to <sal_True/>, then a user input of "foo" would save a foo.txt, but in a format which is determined by the filter selected (which is no txt file as said above).<br/> - If _bAllowUserDefExt is set to <FALSE/>, the default extension will be the one of the selected filter, means + If _bAllowUserDefExt is set to <sal_False/>, the default extension will be the one of the selected filter, means in the above scenario a file "foo.<ext>" will be saved where ext is the extension of the selected filter. </p> - @return <TRUE/> if the new filter is "*.*" + @return <sal_True/> if the new filter is "*.*" */ sal_Bool createNewUserFilter( const String& _rNewFilter, sal_Bool _bAllowUserDefExt ); diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index 0b3c27b68071..da2d1cd926b6 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -79,12 +79,14 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ImageButton BTN_EXPLORERFILE_NEWFOLDER { + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_NEWFOLDER"; TabStop = FALSE ; Pos = MAP_APPFONT ( 59 , 6 ) ; QuickHelpText [ en-US ] = "Create New Directory" ; }; ImageButton BTN_EXPLORERFILE_LISTVIEW { + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_LISTVIEW"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; ButtonImage = Image @@ -99,6 +101,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ImageButton BTN_EXPLORERFILE_DETAILSVIEW { + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_DETAILSVIEW"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; ButtonImage = Image @@ -113,6 +116,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; MenuButton BTN_EXPLORERFILE_UP { + HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_UP"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; QuickHelpText [ en-US ] = "Up One Level" ; @@ -120,6 +124,7 @@ ModalDialog DLG_SVT_EXPLORERFILE MenuButton BTN_EXPLORERFILE_STANDARD { + HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_STANDARD"; TabStop = FALSE ; Pos = MAP_APPFONT ( 59 , 6 ) ; QuickHelpText [ en-US ] = "Default Directory" ; @@ -139,6 +144,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; Edit ED_EXPLORERFILE_FILENAME { + HelpID = "fpicker:Edit:DLG_SVT_EXPLORERFILE:ED_EXPLORERFILE_FILENAME"; Pos = MAP_APPFONT ( 59 , 117 ) ; Size = MAP_APPFONT ( 159 , 12 ) ; Border = TRUE ; @@ -152,6 +158,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ListBox LB_EXPLORERFILE_SHARED_LISTBOX { + HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_SHARED_LISTBOX"; Pos = MAP_APPFONT ( 59 , 132 ) ; Size = MAP_APPFONT ( 159 , 40 ) ; DropDown = TRUE ; @@ -166,6 +173,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ListBox LB_EXPLORERFILE_FILETYPE { + HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_FILETYPE"; Pos = MAP_APPFONT ( 59 , 147 ) ; Size = MAP_APPFONT ( 159 , 80 ) ; DropDown = TRUE ; @@ -175,26 +183,31 @@ ModalDialog DLG_SVT_EXPLORERFILE }; CheckBox CB_EXPLORERFILE_READONLY { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_EXPLORERFILE_READONLY"; Size = MAP_APPFONT ( 80 , 10 ) ; Text [ en-US ] = "~Read-only" ; }; CheckBox CB_EXPLORERFILE_PASSWORD { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_EXPLORERFILE_PASSWORD"; Size = MAP_APPFONT ( 100, 10 ) ; Text [ en-US ] = "Save with password" ; }; CheckBox CB_AUTO_EXTENSION { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_AUTO_EXTENSION"; Size = MAP_APPFONT ( 160 , 10 ) ; Text [ en-US ] = "~Automatic file name extension" ; }; CheckBox CB_OPTIONS { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_OPTIONS"; Size = MAP_APPFONT ( 120 , 10 ) ; Text [ en-US ] = "Edit ~filter settings"; }; PushButton BTN_EXPLORERFILE_OPEN { + HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_OPEN"; Pos = MAP_APPFONT ( 224 , 117 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE ; @@ -243,6 +256,7 @@ ModalDialog DLG_SVT_EXPLORERFILE // QueryFolderNameDialog ---------------------------------------------------------- ModalDialog DLG_SVT_QUERYFOLDERNAME { + HelpID = "fpicker:ModalDialog:DLG_SVT_QUERYFOLDERNAME"; Border = TRUE ; Moveable = TRUE ; OutputSize = TRUE ; @@ -257,6 +271,7 @@ ModalDialog DLG_SVT_QUERYFOLDERNAME }; Edit ED_SVT_QUERYFOLDERNAME_DLG_NAME { + HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 138 , 12 ) ; Border = TRUE ; diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 5e57075a6bb7..41acd84be3e0 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -120,7 +120,7 @@ namespace struct SvtSimpleResId : public ResId { - SvtSimpleResId (USHORT nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} + SvtSimpleResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} }; } @@ -315,7 +315,7 @@ void SvtTravelButton_Impl::FillURLMenu( PopupMenu* _pMenu ) sal_Bool bIsHighContrast = GetDialogParent()->GetView()->GetSettings().GetStyleSettings().GetHighContrastMode(); - USHORT nItemId = 1; + sal_uInt16 nItemId = 1; String sDisplayName; ::std::vector< String >::const_iterator aLoop; @@ -471,7 +471,7 @@ void SvtExpFileDlg_Impl::InsertFilterListEntry( const SvtFileDialogFilter_Impl* sName = _pFilterDesc->GetName(); // insert an set user data - USHORT nPos = _pLbFilter->InsertEntry( sName ); + sal_uInt16 nPos = _pLbFilter->InsertEntry( sName ); _pLbFilter->SetEntryData( nPos, const_cast< void* >( static_cast< const void* >( _pFilterDesc ) ) ); } @@ -483,7 +483,7 @@ void SvtExpFileDlg_Impl::InitFilterList( ) ClearFilterList( ); // reinit it - USHORT nPos = _pFilter->Count(); + sal_uInt16 nPos = _pFilter->Count(); // search for the first entry which is no group separator while ( nPos-- && _pFilter->GetObject( nPos ) && _pFilter->GetObject( nPos )->isGroupSeparator() ) diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index f7a4f9026388..9826290858c2 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -260,7 +260,7 @@ public: inline const ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetBlackList() const { return _aBlackList; } void SetStandardDir( const String& _rDir ); inline const String& GetStandardDir() const { return _aStdDir; } - inline void DisableFilterBoxAutoWidth() { _pLbFilter->EnableDDAutoWidth( FALSE ); } + inline void DisableFilterBoxAutoWidth() { _pLbFilter->EnableDDAutoWidth( sal_False ); } // ------------------------------------------ // access to the filter listbox only as Control* - we want to maintain the entries/userdata ourself diff --git a/fpicker/source/office/makefile.mk b/fpicker/source/office/makefile.mk index adc3c30f9a3d..7481fd867ca7 100644 --- a/fpicker/source/office/makefile.mk +++ b/fpicker/source/office/makefile.mk @@ -86,3 +86,11 @@ RESLIB1SRSFILES=\ # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fps_office.component + +$(MISC)/fps_office.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_office.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_office.component diff --git a/fpicker/source/unx/gnome/FPentry.cxx b/fpicker/source/unx/gnome/FPentry.cxx index 7561d1f4e95f..ccca3dabf72c 100644 --- a/fpicker/source/unx/gnome/FPentry.cxx +++ b/fpicker/source/unx/gnome/FPentry.cxx @@ -99,32 +99,6 @@ void SAL_CALL component_getImplementationEnvironment( // //------------------------------------------------ -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - pXNewKey->createKey( OUString::createFromAscii( FOLDER_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; -} - -//------------------------------------------------ -// -//------------------------------------------------ - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index 4fe6f6f11b20..509c22d3477d 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -33,13 +33,13 @@ //------------------------------------------------------------------------ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <cppuhelper/interfacecontainer.h> #include <osl/diagnose.h> +#include <osl/process.h> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/ui/dialogs/ControlActions.hpp> #include <com/sun/star/uno/Any.hxx> @@ -96,13 +96,15 @@ namespace static void expandexpanders(GtkContainer *pWidget) { + GdkThreadLock aLock; + GList *pChildren = gtk_container_get_children(pWidget); for( GList *p = pChildren; p; p = p->next ) { if GTK_IS_CONTAINER(GTK_WIDGET(p->data)) expandexpanders(GTK_CONTAINER(GTK_WIDGET(p->data))); if GTK_IS_EXPANDER(GTK_WIDGET(p->data)) - gtk_expander_set_expanded(GTK_EXPANDER(GTK_WIDGET(p->data)), TRUE); + gtk_expander_set_expanded(GTK_EXPANDER(GTK_WIDGET(p->data)), sal_True); } g_list_free(pChildren); } @@ -114,6 +116,8 @@ void SalGtkFilePicker::dialog_mapped_cb(GtkWidget *, SalGtkFilePicker *pobjFP) void SalGtkFilePicker::InitialMapping() { + GdkThreadLock aLock; + if (!mbPreviewState ) { gtk_widget_hide( m_pPreview ); @@ -122,41 +126,8 @@ void SalGtkFilePicker::InitialMapping() gtk_widget_set_size_request (m_pPreview, -1, -1); } -static void lcl_setGTKLanguage(const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) -{ - static bool bSet = false; - if (bSet) - return; - - OUString sUILocale; - try - { - uno::Reference<lang::XMultiServiceFactory> xConfigMgr = - uno::Reference<lang::XMultiServiceFactory>(xServiceMgr->createInstance( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), - UNO_QUERY_THROW ); - - Sequence< Any > theArgs(1); - theArgs[ 0 ] <<= OUString::createFromAscii("org.openoffice.Office.Linguistic/General"); - - uno::Reference< container::XNameAccess > xNameAccess = - uno::Reference< container::XNameAccess >(xConfigMgr->createInstanceWithArguments( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"), theArgs ), - UNO_QUERY_THROW ); - - if (xNameAccess.is()) - xNameAccess->getByName(OUString::createFromAscii("UILocale")) >>= sUILocale; - } catch (...) {} - - if (sUILocale.getLength()) - { - sUILocale = rtl::OUString::createFromAscii("LANGUAGE=") + sUILocale.replace('-', '_'); - putenv(strdup(rtl::OUStringToOString(sUILocale, osl_getThreadTextEncoding()).getStr())); - } - bSet = true; -} - SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr ) : + SalGtkPicker(xServiceMgr), cppu::WeakComponentImplHelper10< XFilterManager, XFilterGroupManager, @@ -180,8 +151,6 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact m_PreviewImageWidth( 256 ), m_PreviewImageHeight( 256 ) { - lcl_setGTKLanguage(xServiceMgr); - int i; for( i = 0; i < TOGGLE_LAST; i++ ) @@ -208,6 +177,8 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact CResourceProvider aResProvider; OUString aFilePickerTitle = aResProvider.getResString( FILE_PICKER_TITLE_OPEN ); + GdkThreadLock aLock; + m_pDialog = gtk_file_chooser_dialog_new( OUStringToOString( aFilePickerTitle, RTL_TEXTENCODING_UTF8 ).getStr(), NULL, @@ -218,17 +189,17 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT ); - gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), FALSE ); - gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), FALSE ); + gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); + gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); - m_pVBox = gtk_vbox_new( FALSE, 0 ); + m_pVBox = gtk_vbox_new( sal_False, 0 ); // We don't want clickable items to have a huge hit-area - GtkWidget *pHBox = gtk_hbox_new( FALSE, 0 ); - GtkWidget *pThinVBox = gtk_vbox_new( FALSE, 0 ); + GtkWidget *pHBox = gtk_hbox_new( sal_False, 0 ); + GtkWidget *pThinVBox = gtk_vbox_new( sal_False, 0 ); - gtk_box_pack_end (GTK_BOX( m_pVBox ), pHBox, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX( pHBox ), pThinVBox, FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX( m_pVBox ), pHBox, sal_False, sal_False, 0); + gtk_box_pack_start (GTK_BOX( pHBox ), pThinVBox, sal_False, sal_False, 0); gtk_widget_show( pHBox ); gtk_widget_show( pThinVBox ); @@ -258,12 +229,12 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact break; } - gtk_box_pack_end( GTK_BOX( pThinVBox ), m_pToggles[i], FALSE, FALSE, 0 ); + gtk_box_pack_end( GTK_BOX( pThinVBox ), m_pToggles[i], sal_False, sal_False, 0 ); } for( i = 0; i < LIST_LAST; i++ ) { - m_pHBoxs[i] = gtk_hbox_new( FALSE, 0 ); + m_pHBoxs[i] = gtk_hbox_new( sal_False, 0 ); m_pAligns[i] = gtk_alignment_new(0, 0, 0, 1); @@ -288,18 +259,18 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact } gtk_container_add( GTK_CONTAINER( m_pAligns[i]), m_pLists[i] ); - gtk_box_pack_end( GTK_BOX( m_pHBoxs[i] ), m_pAligns[i], FALSE, FALSE, 0 ); + gtk_box_pack_end( GTK_BOX( m_pHBoxs[i] ), m_pAligns[i], sal_False, sal_False, 0 ); - gtk_box_pack_end( GTK_BOX( m_pHBoxs[i] ), m_pListLabels[i], FALSE, FALSE, 0 ); + gtk_box_pack_end( GTK_BOX( m_pHBoxs[i] ), m_pListLabels[i], sal_False, sal_False, 0 ); - gtk_box_pack_end( GTK_BOX( m_pVBox ), m_pHBoxs[i], FALSE, FALSE, 0 ); + gtk_box_pack_end( GTK_BOX( m_pVBox ), m_pHBoxs[i], sal_False, sal_False, 0 ); } aLabel = aResProvider.getResString( FILE_PICKER_FILE_TYPE ); m_pFilterExpander = gtk_expander_new_with_mnemonic( OUStringToOString( aLabel, RTL_TEXTENCODING_UTF8 ).getStr()); - gtk_box_pack_end( GTK_BOX( m_pVBox ), m_pFilterExpander, FALSE, TRUE, 0 ); + gtk_box_pack_end( GTK_BOX( m_pVBox ), m_pFilterExpander, sal_False, sal_True, 0 ); GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), @@ -317,11 +288,11 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact case 0: break; case 1: - gtk_expander_set_expanded(GTK_EXPANDER(m_pFilterExpander), TRUE); + gtk_expander_set_expanded(GTK_EXPANDER(m_pFilterExpander), sal_True); break; case 2: expandexpanders(GTK_CONTAINER(m_pDialog)); - gtk_expander_set_expanded(GTK_EXPANDER(m_pFilterExpander), TRUE); + gtk_expander_set_expanded(GTK_EXPANDER(m_pFilterExpander), sal_True); break; } @@ -338,8 +309,8 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact { column = gtk_tree_view_column_new (); cell = gtk_cell_renderer_text_new (); - gtk_tree_view_column_set_expand (column, TRUE); - gtk_tree_view_column_pack_start (column, cell, FALSE); + gtk_tree_view_column_set_expand (column, sal_True); + gtk_tree_view_column_pack_start (column, cell, sal_False); gtk_tree_view_column_set_attributes (column, cell, "text", i, (char *)NULL); gtk_tree_view_append_column (GTK_TREE_VIEW(m_pFilterView), column); } @@ -385,14 +356,12 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference<lang::XMultiServiceFact void SAL_CALL SalGtkFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener ) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); m_xListener = xListener; } void SAL_CALL SalGtkFilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& ) throw( uno::RuntimeException ) { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); m_xListener.clear(); } @@ -591,6 +560,8 @@ shrinkFilterName( const rtl::OUString &rFilterName, bool bAllowNoStar = false ) static void dialog_remove_buttons( GtkDialog *pDialog ) { + GdkThreadLock aLock; + g_return_if_fail( GTK_IS_DIALOG( pDialog ) ); GList *pChildren = @@ -700,7 +671,6 @@ void SAL_CALL SalGtkFilePicker::appendFilter( const rtl::OUString& aTitle, const throw( lang::IllegalArgumentException, uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); if( FilterNameExists( aTitle ) ) throw IllegalArgumentException(); @@ -721,7 +691,6 @@ void SAL_CALL SalGtkFilePicker::setCurrentFilter( const rtl::OUString& aTitle ) throw( lang::IllegalArgumentException, uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); OSL_TRACE( "Setting current filter to %s\n", OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -763,6 +732,9 @@ void SalGtkFilePicker::UpdateFilterfromUI() // from the filter of the files glob on which he is currently searching if (!mnHID_FolderChange || !mnHID_SelectionChange) return; + + GdkThreadLock aLock; + GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(m_pFilterView)); GtkTreeIter iter; GtkTreeModel *model; @@ -782,7 +754,6 @@ void SalGtkFilePicker::UpdateFilterfromUI() rtl::OUString SAL_CALL SalGtkFilePicker::getCurrentFilter() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); OSL_TRACE( "GetCURRENTfilter\n" ); @@ -802,7 +773,6 @@ void SAL_CALL SalGtkFilePicker::appendFilterGroup( const rtl::OUString& /*sGroup throw( lang::IllegalArgumentException, uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO m_pImpl->appendFilterGroup( sGroupTitle, aFilters ); // check the names @@ -832,7 +802,8 @@ void SAL_CALL SalGtkFilePicker::appendFilterGroup( const rtl::OUString& /*sGroup void SAL_CALL SalGtkFilePicker::setMultiSelectionMode( sal_Bool bMode ) throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + GdkThreadLock aLock; gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(m_pDialog), bMode ); } @@ -841,7 +812,8 @@ void SAL_CALL SalGtkFilePicker::setDefaultName( const rtl::OUString& aName ) throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + GdkThreadLock aLock; OString aStr = OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ); GtkFileChooserAction eAction = gtk_file_chooser_get_action( GTK_FILE_CHOOSER( m_pDialog ) ); @@ -877,7 +849,8 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getFiles() throw( uno::R uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + GdkThreadLock aLock; GSList* pPathList = gtk_file_chooser_get_uris( GTK_FILE_CHOOSER(m_pDialog) ); @@ -927,6 +900,9 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw { static const OUString aStarDot = OUString::createFromAscii( "*." ); + ::rtl::OUString aNewFilter; + ::rtl::OUString aOldFilter = getCurrentFilter(); + sal_Bool bChangeFilter = sal_True; for ( FilterList::iterator aListIter = m_pFilterList->begin(); aListIter != m_pFilterList->end(); ++aListIter @@ -934,11 +910,17 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw { if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 ) { - setCurrentFilter( aListIter->getTitle() ); + if( !aNewFilter.getLength() ) + aNewFilter = aListIter->getTitle(); + + if( aOldFilter == aListIter->getTitle() ) + bChangeFilter = sal_False; + bExtensionTypedIn = true; - break; } } + if( bChangeFilter ) + setCurrentFilter( aNewFilter ); } } @@ -1014,7 +996,8 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) { OSL_TRACE( "1: HERE WE ARE\n"); OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + GdkThreadLock aLock; sal_Int16 retVal = 0; @@ -1171,6 +1154,8 @@ namespace { void HackWidthToFirst(GtkComboBox *pWidget) { + GdkThreadLock aLock; + GtkRequisition requisition; gtk_widget_size_request(GTK_WIDGET(pWidget), &requisition); gtk_widget_set_size_request(GTK_WIDGET(pWidget), requisition.width, -1); @@ -1179,6 +1164,8 @@ namespace void SalGtkFilePicker::HandleSetListValue(GtkComboBox *pWidget, sal_Int16 nControlAction, const uno::Any& rValue) { + GdkThreadLock aLock; + switch (nControlAction) { case ControlActions::ADD_ITEM: @@ -1253,6 +1240,8 @@ void SalGtkFilePicker::HandleSetListValue(GtkComboBox *pWidget, sal_Int16 nContr uno::Any SalGtkFilePicker::HandleGetListValue(GtkComboBox *pWidget, sal_Int16 nControlAction) const { + GdkThreadLock aLock; + uno::Any aAny; switch (nControlAction) { @@ -1312,15 +1301,15 @@ void SAL_CALL SalGtkFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nContr throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); OSL_TRACE( "SETTING VALUE %d\n", nControlAction ); GType tType; GtkWidget *pWidget; + GdkThreadLock aLock; + if( !( pWidget = getWidget( nControlId, &tType ) ) ) OSL_TRACE("enable unknown control %d\n", nControlId); - else if( tType == GTK_TYPE_TOGGLE_BUTTON ) { sal_Bool bChecked = false; @@ -1340,15 +1329,16 @@ uno::Any SAL_CALL SalGtkFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nC throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + uno::Any aRetval; GType tType; GtkWidget *pWidget; + GdkThreadLock aLock; + if( !( pWidget = getWidget( nControlId, &tType ) ) ) OSL_TRACE("enable unknown control %d\n", nControlId); - else if( tType == GTK_TYPE_TOGGLE_BUTTON ) aRetval <<= (sal_Bool) gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( pWidget ) ); else if( tType == GTK_TYPE_COMBO_BOX ) @@ -1364,24 +1354,24 @@ void SAL_CALL SalGtkFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bE throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); GtkWidget *pWidget; + GdkThreadLock aLock; + if ( nControlId == ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR ) gtk_expander_set_expanded( GTK_EXPANDER( m_pFilterExpander ), bEnable ); - else if( ( pWidget = getWidget( nControlId ) ) ) { if( bEnable ) { OSL_TRACE( "enable\n" ); - gtk_widget_set_sensitive( pWidget, TRUE ); + gtk_widget_set_sensitive( pWidget, sal_True ); } else { OSL_TRACE( "disable\n" ); - gtk_widget_set_sensitive( pWidget, FALSE ); + gtk_widget_set_sensitive( pWidget, sal_False ); } } else @@ -1392,11 +1382,12 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUS throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); GType tType; GtkWidget *pWidget; + GdkThreadLock aLock; + if( !( pWidget = getWidget( nControlId, &tType ) ) ) { OSL_TRACE("Set label on unknown control %d\n", nControlId); @@ -1419,7 +1410,7 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUS } else if( tType == GTK_TYPE_TOGGLE_BUTTON || tType == GTK_TYPE_BUTTON || tType == GTK_TYPE_LABEL ) g_object_set( pWidget, "label", aTxt.getStr(), - "use_underline", TRUE, (char *)NULL ); + "use_underline", sal_True, (char *)NULL ); else OSL_TRACE("Can't set label on list\n"); } @@ -1428,18 +1419,17 @@ rtl::OUString SAL_CALL SalGtkFilePicker::getLabel( sal_Int16 nControlId ) throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); GType tType; OString aTxt; GtkWidget *pWidget; + GdkThreadLock aLock; + if( !( pWidget = getWidget( nControlId, &tType ) ) ) OSL_TRACE("Get label on unknown control %d\n", nControlId); - else if( tType == GTK_TYPE_TOGGLE_BUTTON || tType == GTK_TYPE_BUTTON || tType == GTK_TYPE_LABEL ) aTxt = gtk_button_get_label( GTK_BUTTON( pWidget ) ); - else OSL_TRACE("Can't get label on list\n"); @@ -1453,7 +1443,6 @@ rtl::OUString SAL_CALL SalGtkFilePicker::getLabel( sal_Int16 nControlId ) uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO return m_pImpl->getSupportedImageFormats(); return 0; @@ -1462,7 +1451,6 @@ uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats() t sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO return m_pImpl->getTargetColorDepth(); return 0; @@ -1471,18 +1459,14 @@ sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeEx sal_Int32 SAL_CALL SalGtkFilePicker::getAvailableWidth() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // TODO return m_pImpl->getAvailableWidth(); return m_PreviewImageWidth; } sal_Int32 SAL_CALL SalGtkFilePicker::getAvailableHeight() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // TODO return m_pImpl->getAvailableHeight(); return m_PreviewImageHeight; } @@ -1490,7 +1474,6 @@ void SAL_CALL SalGtkFilePicker::setImage( sal_Int16 /*aImageFormat*/, const uno: throw( lang::IllegalArgumentException, uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO m_pImpl->setImage( aImageFormat, aImage ); } @@ -1499,6 +1482,9 @@ void SalGtkFilePicker::implChangeType( GtkTreeSelection *selection ) { CResourceProvider aResProvider; OUString aLabel = aResProvider.getResString( FILE_PICKER_FILE_TYPE ); + + GdkThreadLock aLock; + GtkTreeIter iter; GtkTreeModel *model; if (gtk_tree_selection_get_selected (selection, &model, &iter)) @@ -1523,6 +1509,8 @@ void SalGtkFilePicker::type_changed_cb( GtkTreeSelection *selection, SalGtkFileP void SalGtkFilePicker::unselect_type() { + GdkThreadLock aLock; + gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(GTK_TREE_VIEW(m_pFilterView))); } @@ -1560,7 +1548,7 @@ void SalGtkFilePicker::update_preview_cb( GtkFileChooser *file_chooser, SalGtkFi GtkWidget *preview; char *filename; GdkPixbuf *pixbuf; - gboolean have_preview = FALSE; + gboolean have_preview = sal_False; preview = pobjFP->m_pPreview; filename = gtk_file_chooser_get_preview_filename( file_chooser ); @@ -1589,11 +1577,12 @@ void SalGtkFilePicker::update_preview_cb( GtkFileChooser *file_chooser, SalGtkFi sal_Bool SAL_CALL SalGtkFilePicker::setShowState( sal_Bool bShowState ) throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO return m_pImpl->setShowState( bShowState ); if( bShowState != mbPreviewState ) { + GdkThreadLock aLock; + if( bShowState ) { // Show @@ -1622,9 +1611,7 @@ sal_Bool SAL_CALL SalGtkFilePicker::setShowState( sal_Bool bShowState ) throw( u sal_Bool SAL_CALL SalGtkFilePicker::getShowState() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - // TODO return m_pImpl->getShowState(); return mbPreviewState; } @@ -1740,6 +1727,8 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu 1 ); } + GdkThreadLock aLock; + if( GTK_FILE_CHOOSER_ACTION_SAVE == eAction ) { CResourceProvider aResProvider; @@ -1801,7 +1790,6 @@ void SalGtkFilePicker::preview_toggled_cb( GtkObject *cb, SalGtkFilePicker* pobj void SAL_CALL SalGtkFilePicker::cancel() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO m_pImpl->cancel(); } @@ -1848,6 +1836,8 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSupportedServiceNames //------------------------------------------------- void SalGtkFilePicker::SetCurFilter( const OUString& rFilter ) { + GdkThreadLock aLock; + // Get all the filters already added GSList *filters = gtk_file_chooser_list_filters ( GTK_FILE_CHOOSER( m_pDialog ) ); bool bFound = false; @@ -1875,22 +1865,22 @@ extern "C" static gboolean case_insensitive_filter (const GtkFileFilterInfo *filter_info, gpointer data) { - gboolean bRetval = FALSE; + gboolean bRetval = sal_False; const char *pFilter = (const char *) data; - g_return_val_if_fail( data != NULL, FALSE ); - g_return_val_if_fail( filter_info != NULL, FALSE ); + g_return_val_if_fail( data != NULL, sal_False ); + g_return_val_if_fail( filter_info != NULL, sal_False ); if( !filter_info->uri ) - return FALSE; + return sal_False; const char *pExtn = strrchr( filter_info->uri, '.' ); if( !pExtn ) - return FALSE; + return sal_False; pExtn++; if( !g_ascii_strcasecmp( pFilter, pExtn ) ) - bRetval = TRUE; + bRetval = sal_True; #ifdef DEBUG fprintf( stderr, "'%s' match extn '%s' vs '%s' yeilds %d\n", @@ -1903,6 +1893,8 @@ case_insensitive_filter (const GtkFileFilterInfo *filter_info, gpointer data) int SalGtkFilePicker::implAddFilter( const OUString& rFilter, const OUString& rType ) { + GdkThreadLock aLock; + GtkFileFilter *filter = gtk_file_filter_new(); OUString aShrunkName = shrinkFilterName( rFilter ); @@ -1981,6 +1973,9 @@ int SalGtkFilePicker::implAddFilterGroup( const OUString& /*_rFilter*/, const Se void SalGtkFilePicker::SetFilters() { OSL_TRACE( "start setting filters\n"); + + GdkThreadLock aLock; + int nAdded = 0; if( m_pFilterList && !m_pFilterList->empty() ) { diff --git a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx index 6b843d8b79f4..e1c98004035b 100644 --- a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx @@ -84,17 +84,21 @@ namespace // constructor //----------------------------------------------------------------------------------------- SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr ) : - m_xServiceMgr( xServiceMgr ) + SalGtkPicker(xServiceMgr), + m_xServiceMgr(xServiceMgr) { CResourceProvider aResProvider; + + GdkThreadLock aLock; + m_pDialog = gtk_file_chooser_dialog_new( OUStringToOString( aResProvider.getResString( FOLDERPICKER_TITLE ), RTL_TEXTENCODING_UTF8 ).getStr(), NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, (char *)NULL ); gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), GTK_RESPONSE_ACCEPT ); - gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), FALSE ); - gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), FALSE ); + gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); + gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( m_pDialog ), sal_False ); } // ------------------------------------------------- @@ -110,7 +114,6 @@ void SAL_CALL SalGtkFolderPicker::setDisplayDirectory( const rtl::OUString& aDir throw( lang::IllegalArgumentException, uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); OString aTxt = unicodetouri( aDirectory ); @@ -119,14 +122,17 @@ void SAL_CALL SalGtkFolderPicker::setDisplayDirectory( const rtl::OUString& aDir OSL_TRACE( "setting path to %s\n", aTxt.getStr() ); + GdkThreadLock aLock; + gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ), - aTxt.getStr() ); + aTxt.getStr() ); } rtl::OUString SAL_CALL SalGtkFolderPicker::getDisplayDirectory() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + GdkThreadLock aLock; gchar* pCurrentFolder = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) ); @@ -156,9 +162,10 @@ void SAL_CALL SalGtkFolderPicker::setDescription( const rtl::OUString& rDescript void SAL_CALL SalGtkFolderPicker::setTitle( const rtl::OUString& aTitle ) throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); ::rtl::OString aWindowTitle = OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ); + + GdkThreadLock aLock; gtk_window_set_title( GTK_WINDOW( m_pDialog ), aWindowTitle.getStr() ); } @@ -166,7 +173,6 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException ) { OSL_TRACE( "1: HERE WE ARE\n"); OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); sal_Int16 retVal = 0; @@ -199,7 +205,6 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException ) void SAL_CALL SalGtkFolderPicker::cancel() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); // TODO m_pImpl->cancel(); } diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx index 2d2e086ba2ca..6fd19b2f7f79 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/awt/XSystemDependentWindowPeer.hpp> #include <com/sun/star/awt/SystemDependentXWindow.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/container/XNameAccess.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/interfacecontainer.h> #include <rtl/process.h> @@ -148,6 +149,8 @@ RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit } } + GdkThreadLock aLock; + GdkDisplay *pDisplay = aWindowHandle.DisplayPointer ? gdk_x11_lookup_xdisplay(reinterpret_cast<void*>(static_cast<sal_IntPtr>(aWindowHandle.DisplayPointer))) : NULL; GdkWindow* pParent = pDisplay ? gdk_window_lookup_for_display(pDisplay, aWindowHandle.WindowHandle) : NULL; if (!pParent && pDisplay) @@ -163,17 +166,22 @@ RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit RunDialog::~RunDialog() { if (mpCreatedParent) + { + GdkThreadLock aLock; gdk_window_destroy (mpCreatedParent); + } } void SAL_CALL RunDialog::windowOpened( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException) { + GdkThreadLock aLock; g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, (GSourceFunc)canceldialog, this, NULL); } void RunDialog::cancel() { + GdkThreadLock aLock; gtk_dialog_response( GTK_DIALOG( mpDialog ), GTK_RESPONSE_CANCEL ); gtk_widget_hide( mpDialog ); } @@ -183,6 +191,7 @@ gint RunDialog::run() if (mxToolkit.is()) mxToolkit->addTopWindowListener(this); + GdkThreadLock aLock; gint nStatus = gtk_dialog_run( GTK_DIALOG( mpDialog ) ); if (mxToolkit.is()) @@ -194,17 +203,59 @@ gint RunDialog::run() return nStatus; } +static void lcl_setGTKLanguage(const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) +{ + static bool bSet = false; + if (bSet) + return; + + OUString sUILocale; + try + { + uno::Reference<lang::XMultiServiceFactory> xConfigMgr = + uno::Reference<lang::XMultiServiceFactory>(xServiceMgr->createInstance( + OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), + UNO_QUERY_THROW ); + + Sequence< Any > theArgs(1); + theArgs[ 0 ] <<= OUString::createFromAscii("org.openoffice.Office.Linguistic/General"); + + uno::Reference< container::XNameAccess > xNameAccess = + uno::Reference< container::XNameAccess >(xConfigMgr->createInstanceWithArguments( + OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"), theArgs ), + UNO_QUERY_THROW ); + + if (xNameAccess.is()) + xNameAccess->getByName(OUString::createFromAscii("UILocale")) >>= sUILocale; + } catch (...) {} + + if (sUILocale.getLength()) + { + sUILocale = sUILocale.replace('-', '_'); + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("LANGUAGE")); + osl_setEnvironment(envVar.pData, sUILocale.pData); + } + bSet = true; +} + +SalGtkPicker::SalGtkPicker(const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) : m_pDialog(0) +{ + lcl_setGTKLanguage(xServiceMgr); +} + SalGtkPicker::~SalGtkPicker() { if (m_pDialog) + { + GdkThreadLock aLock; gtk_widget_destroy(m_pDialog); + } } void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const rtl::OUString& aDirectory ) throw( lang::IllegalArgumentException, uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); OString aTxt = unicodetouri(aDirectory); @@ -213,14 +264,16 @@ void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const rtl::OUString& aDirec OSL_TRACE( "setting path to %s\n", aTxt.getStr() ); + GdkThreadLock aLock; gtk_file_chooser_set_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ), - aTxt.getStr() ); + aTxt.getStr() ); } rtl::OUString SAL_CALL SalGtkPicker::implgetDisplayDirectory() throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + GdkThreadLock aLock; gchar* pCurrentFolder = gtk_file_chooser_get_current_folder_uri( GTK_FILE_CHOOSER( m_pDialog ) ); @@ -233,8 +286,9 @@ rtl::OUString SAL_CALL SalGtkPicker::implgetDisplayDirectory() throw( uno::Runti void SAL_CALL SalGtkPicker::implsetTitle( const rtl::OUString& aTitle ) throw( uno::RuntimeException ) { OSL_ASSERT( m_pDialog != NULL ); - ::vos::OGuard aGuard( Application::GetSolarMutex() ); ::rtl::OString aWindowTitle = OUStringToOString( aTitle, RTL_TEXTENCODING_UTF8 ); + + GdkThreadLock aLock; gtk_window_set_title( GTK_WINDOW( m_pDialog ), aWindowTitle.getStr() ); } diff --git a/fpicker/source/unx/gnome/SalGtkPicker.hxx b/fpicker/source/unx/gnome/SalGtkPicker.hxx index 5baa5bdb56e8..94e7a11de99a 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.hxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.hxx @@ -53,7 +53,7 @@ class SalGtkPicker { public: - SalGtkPicker() : m_pDialog(0) {} + SalGtkPicker(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& xServiceMgr); virtual ~SalGtkPicker(); protected: osl::Mutex m_rbHelperMtx; @@ -71,6 +71,13 @@ class SalGtkPicker static rtl::OString unicodetouri(const rtl::OUString &rURL); }; +class GdkThreadLock +{ +public: + GdkThreadLock() { gdk_threads_enter(); } + ~GdkThreadLock() { gdk_threads_leave(); } +}; + //Run the Gtk Dialog. Watch for any "new windows" created while we're //executing and consider that a CANCEL event to avoid e.g. "file cannot be opened" //modal dialogs and this one getting locked if some other API call causes this diff --git a/fpicker/source/unx/gnome/fps-gnome-ucd.txt b/fpicker/source/unx/gnome/fps-gnome-ucd.txt deleted file mode 100644 index 4a84215dc960..000000000000 --- a/fpicker/source/unx/gnome/fps-gnome-ucd.txt +++ /dev/null @@ -1,13 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalGtkFilePicker -ComponentName=fps_gnome.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.GtkFilePicker - -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalGtkFolderPicker -ComponentName=fps_gnome.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.GtkFolderPicker diff --git a/fpicker/source/unx/gnome/fps_gnome.component b/fpicker/source/unx/gnome/fps_gnome.component new file mode 100644 index 000000000000..72bca42f8acf --- /dev/null +++ b/fpicker/source/unx/gnome/fps_gnome.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.ui.dialogs.SalGtkFilePicker"> + <service name="com.sun.star.ui.dialogs.GtkFilePicker"/> + </implementation> + <implementation name="com.sun.star.ui.dialogs.SalGtkFolderPicker"> + <service name="com.sun.star.ui.dialogs.GtkFolderPicker"/> + </implementation> +</component> diff --git a/fpicker/source/unx/gnome/makefile.mk b/fpicker/source/unx/gnome/makefile.mk index 04c6e650ff6f..82b2413dd4af 100644 --- a/fpicker/source/unx/gnome/makefile.mk +++ b/fpicker/source/unx/gnome/makefile.mk @@ -96,3 +96,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fps_gnome.component + +$(MISC)/fps_gnome.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_gnome.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_gnome.component diff --git a/fpicker/source/unx/gnome/resourceprovider.cxx b/fpicker/source/unx/gnome/resourceprovider.cxx index 393ea7585d5a..8df810060ee5 100644 --- a/fpicker/source/unx/gnome/resourceprovider.cxx +++ b/fpicker/source/unx/gnome/resourceprovider.cxx @@ -168,8 +168,6 @@ public: String aResString; OUString aResOUString; - const ::vos::OGuard aGuard( Application::GetSolarMutex() ); - try { OSL_ASSERT( m_ResMgr && m_OtherResMgr ); diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx index 3d74c1a09dca..174b1fc440a6 100644 --- a/fpicker/source/unx/kde4/KDE4FPEntry.cxx +++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx @@ -55,27 +55,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) - { - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; - } - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* ) { void* pRet = 0; diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx index a7fa01a5ece6..32b26ca02f15 100644 --- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx +++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx @@ -46,6 +46,8 @@ #include <vcl/sysdata.hxx> #include <vcl/syswin.hxx> +#include "osl/file.h" + #include "KDE4FilePicker.hxx" #include "FPServiceInfo.hxx" @@ -246,7 +248,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() // kde file picker returns the file and directories for selectedFiles() // when a file is double clicked // make a true list of files - const QString dir = "file://" + KUrl(rawFiles[0]).directory(); + const QString dir = KUrl(rawFiles[0]).directory(); bool singleFile = true; if (rawFiles.size() > 1) @@ -258,11 +260,11 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() files.append(dir); } - for (USHORT i = 0; i < rawFiles.size(); ++i) + for (sal_uInt16 i = 0; i < rawFiles.size(); ++i) { // if the raw file is not the base directory (see above kde bug) // we add the file to list of avail files - if ((dir + "/") != ("file://" + rawFiles[i])) + if ((dir + "/") != ( rawFiles[i])) { QString filename = KUrl(rawFiles[i]).fileName(); @@ -280,7 +282,11 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() // add all files and leading directory to outgoing OO sequence uno::Sequence< ::rtl::OUString > seq(files.size()); for (int i = 0; i < files.size(); ++i) - seq[i] = toOUString(files[i]); + { + rtl::OUString aFile(toOUString(files[i])), aURL; + osl_getFileURLFromSystemPath(aFile.pData, &aURL.pData ); + seq[i] = aURL; + } return seq; } @@ -333,8 +339,8 @@ void SAL_CALL KDE4FilePicker::appendFilterGroup( const rtl::OUString& , const un if (!_filter.isNull()) _filter.append(QString("\n")); - const USHORT length = filters.getLength(); - for (USHORT i = 0; i < length; ++i) + const sal_uInt16 length = filters.getLength(); + for (sal_uInt16 i = 0; i < length; ++i) { beans::StringPair aPair = filters[i]; diff --git a/fpicker/source/unx/kde4/fps-kde4-ucd.txt b/fpicker/source/unx/kde4/fps-kde4-ucd.txt deleted file mode 100644 index 8ecc4e0a0a52..000000000000 --- a/fpicker/source/unx/kde4/fps-kde4-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.KDE4FilePicker -ComponentName=fps_kde4.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.KDE4FilePicker diff --git a/fpicker/source/unx/kde4/fps_kde4.component b/fpicker/source/unx/kde4/fps_kde4.component new file mode 100644 index 000000000000..d627212b75e8 --- /dev/null +++ b/fpicker/source/unx/kde4/fps_kde4.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.ui.dialogs.KDE4FilePicker"> + <service name="com.sun.star.ui.dialogs.KDE4FilePicker"/> + </implementation> +</component> diff --git a/fpicker/source/unx/kde4/makefile.mk b/fpicker/source/unx/kde4/makefile.mk index e245e6618465..7ccf6df6a0ce 100644 --- a/fpicker/source/unx/kde4/makefile.mk +++ b/fpicker/source/unx/kde4/makefile.mk @@ -80,3 +80,11 @@ DEF1VERSIONMAP=exports.map $(MISC)$/KDE4FilePicker.moc.cxx : KDE4FilePicker.hxx $(MOC4) $< -o $@ + +ALLTAR : $(MISC)/fps_kde4.component + +$(MISC)/fps_kde4.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_kde4.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_kde4.component diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx index e93c3bec18ba..79a2cf3b2865 100644 --- a/fpicker/source/win32/filepicker/FPentry.cxx +++ b/fpicker/source/win32/filepicker/FPentry.cxx @@ -104,31 +104,6 @@ void SAL_CALL component_getImplementationEnvironment( // //------------------------------------------------ -sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; -} - -//------------------------------------------------ -// -//------------------------------------------------ - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* ) { diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.cxx b/fpicker/source/win32/filepicker/PreviewCtrl.cxx index 84627a9f3d82..e387d672fd41 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.cxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.cxx @@ -393,7 +393,7 @@ void SAL_CALL CFilePreview::enable( sal_Bool bEnable ) m_bEnabled = bEnable; // force a redraw - InvalidateRect( m_hwnd, NULL, TRUE ); + InvalidateRect( m_hwnd, NULL, sal_True ); UpdateWindow( m_hwnd ); } @@ -435,7 +435,7 @@ sal_Bool SAL_CALL CFilePreview::update( const rtl::OUString& aFileName ) loadFile( aFileName ); // force a complete window redraw - InvalidateRect( m_hwnd, NULL, TRUE ); + InvalidateRect( m_hwnd, NULL, sal_True ); UpdateWindow( m_hwnd ); } } @@ -548,12 +548,12 @@ sal_Bool CFilePreview::loadFile( const rtl::OUString& aFileName ) goto CLEANUP_AND_EXIT; hr = CreateStreamOnHGlobal( - hGlobal, FALSE, &pIStream ); + hGlobal, sal_False, &pIStream ); if ( SUCCEEDED( hr ) ) { hr = OleLoadPicture( - pIStream, fsize, FALSE, + pIStream, fsize, sal_False, __uuidof( IPicture ), (LPVOID*)&m_IPicture ); } @@ -601,7 +601,7 @@ LRESULT CALLBACK CFilePreview::WndProc( // a result of handling WM_NCCREATE what // leads to a failure of CreateWindow[Ex]!!! case WM_NCCREATE: - lResult = TRUE; + lResult = sal_True; break; default: diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx index 2fadaa6bfdff..4b6ba5d39d49 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx @@ -103,15 +103,15 @@ HRESULT STDMETHODCALLTYPE VistaFilePickerEventHandler::QueryInterface(REFIID rII } //----------------------------------------------------------------------------------------- -ULONG STDMETHODCALLTYPE VistaFilePickerEventHandler::AddRef() +sal_uIntPtr STDMETHODCALLTYPE VistaFilePickerEventHandler::AddRef() { return osl_incrementInterlockedCount(&m_nRefCount); } //----------------------------------------------------------------------------------------- -ULONG STDMETHODCALLTYPE VistaFilePickerEventHandler::Release() +sal_uIntPtr STDMETHODCALLTYPE VistaFilePickerEventHandler::Release() { - ULONG nReturn = --m_nRefCount; + sal_uIntPtr nReturn = --m_nRefCount; if ( m_nRefCount == 0 ) delete this; @@ -332,7 +332,7 @@ STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* //----------------------------------------------------------------------------------------- STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl , - BOOL bChecked ) + sal_Bool bChecked ) { /* if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx index 4b9434d8c6c2..b058f3b5c077 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx @@ -88,8 +88,8 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex //------------------------------------------------------------------------------------ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID rIID , void** ppObject); - virtual ULONG STDMETHODCALLTYPE AddRef(); - virtual ULONG STDMETHODCALLTYPE Release(); + virtual sal_uIntPtr STDMETHODCALLTYPE AddRef(); + virtual sal_uIntPtr STDMETHODCALLTYPE Release(); //------------------------------------------------------------------------------------ // IFileDialogEvents diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx index ac59a4f65b99..677c2bdbfa7d 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx @@ -1105,7 +1105,7 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(const RequestRef& rRequest) //case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW : // can be ignored ... preview is supported native now ! case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION : { - BOOL bValue = sal_False; + BOOL bValue = FALSE; HRESULT hResult = iCustom->GetCheckButtonState(nId, &bValue); if ( SUCCEEDED(hResult) ) aValue = css::uno::makeAny((sal_Bool)bValue); diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index d5bcce4707f4..9fb13c1a2d5e 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -529,7 +529,7 @@ LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), hWnd,wMessage,wParam,lParam); - pImpl->onWMShow((BOOL)wParam); + pImpl->onWMShow((sal_Bool)wParam); break; case WM_NCDESTROY: @@ -610,7 +610,7 @@ BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) OSL_ASSERT(pImpl); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; switch(enumParam->m_action) { @@ -843,7 +843,7 @@ void CWinFileOpenImpl::onWMSize() // //----------------------------------------------------------------------------------------- -void CWinFileOpenImpl::onWMShow(BOOL bShow) +void CWinFileOpenImpl::onWMShow(sal_Bool bShow) { m_Preview->notifyParentShow(bShow); } diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx index 61d63952f8c7..9429f83cf30c 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx @@ -189,7 +189,7 @@ protected: void onWMSize(); - void onWMShow(BOOL bShow); + void onWMShow(sal_Bool bShow); void onWMWindowPosChanged(); void onCustomControlHelpRequest(LPHELPINFO lphi); diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx index 902160f40005..dee52c0ffe2c 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.cxx +++ b/fpicker/source/win32/filepicker/asyncrequests.cxx @@ -43,7 +43,7 @@ namespace css = ::com::sun::star; void lcl_sleep(::osl::Condition& aCondition , ::sal_Int32 nMilliSeconds) { - ULONG nAcquireCount = Application::ReleaseSolarMutex(); + sal_uIntPtr nAcquireCount = Application::ReleaseSolarMutex(); if (nMilliSeconds < 1) aCondition.wait(0); diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx index 11c7a414d63b..13b1354902af 100644 --- a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx +++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx @@ -53,7 +53,7 @@ void SAL_CALL CDialogCustomControlBase::SetFont(HFONT hFont) m_CustomControlHandle, WM_SETFONT, (WPARAM)hFont, - (LPARAM)TRUE); + (LPARAM)sal_True); } //----------------------------------- diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx index fcc369972ff8..aa3a5903002e 100644 --- a/fpicker/source/win32/filepicker/dibpreview.cxx +++ b/fpicker/source/win32/filepicker/dibpreview.cxx @@ -207,7 +207,7 @@ void SAL_CALL CDIBPreview::setImage(sal_Int16 aImageFormat, const Any& aImage) aGuard.clear(); - InvalidateRect(m_Hwnd,NULL,FALSE); + InvalidateRect(m_Hwnd,NULL,sal_False); UpdateWindow(m_Hwnd); } @@ -248,7 +248,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) { BITMAPFILEHEADER* pbmfh; BITMAPINFO * pbmi; - BYTE * pBits; + sal_uInt8 * pBits; int cxDib; int cyDib; @@ -262,7 +262,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) (pbmfh->bfType == ('B' | ('M' << 8))) ) { pbmi = reinterpret_cast<BITMAPINFO*>((pbmfh + 1)); - pBits = reinterpret_cast<BYTE*>(((DWORD)pbmfh) + pbmfh->bfOffBits); + pBits = reinterpret_cast<sal_uInt8*>(((DWORD)pbmfh) + pbmfh->bfOffBits); cxDib = pbmi->bmiHeader.biWidth; cyDib = abs (pbmi->bmiHeader.biHeight); diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx index 43994393e139..ece582089f6e 100644 --- a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx +++ b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx @@ -54,13 +54,13 @@ namespace /* private */ //----------------------------------------------- class CurDirGuard { - BOOL m_bValid; + sal_Bool m_bValid; wchar_t* m_pBuffer; DWORD m_nBufLen; public: CurDirGuard() - : m_bValid( FALSE ) + : m_bValid( sal_False ) , m_pBuffer( NULL ) , m_nBufLen( 0 ) { @@ -74,7 +74,7 @@ namespace /* private */ ~CurDirGuard() { - BOOL bDirSet = FALSE; + sal_Bool bDirSet = sal_False; if ( m_pBuffer ) { diff --git a/fpicker/source/win32/filepicker/previewadapter.cxx b/fpicker/source/win32/filepicker/previewadapter.cxx index d8fee2044115..d4e4d182316d 100644 --- a/fpicker/source/win32/filepicker/previewadapter.cxx +++ b/fpicker/source/win32/filepicker/previewadapter.cxx @@ -308,7 +308,7 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() // style bit of the FileOpen dialog must be set after that // message LONG lStyle = GetWindowLong(prvwnd,GWL_STYLE); - BOOL bIsVisible = (BOOL)(lStyle & WS_VISIBLE); + sal_Bool bIsVisible = (sal_Bool)(lStyle & WS_VISIBLE); int cx = 0; @@ -318,7 +318,7 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() // resize the filelistbox to the half of the // available space - BOOL bRet = SetWindowPos(flb_new, + sal_Bool bRet = SetWindowPos(flb_new, NULL, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); diff --git a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx index 8db37cefd34c..699edc9533a2 100644 --- a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx +++ b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx @@ -179,7 +179,7 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star:: Sequence< sal_Int8 > aDIB( dwFileSize ); DWORD dwBytesRead; - BOOL bSuccess = ReadFile (hFile, aDIB.getArray( ), dwFileSize, &dwBytesRead, NULL) ; + sal_Bool bSuccess = ReadFile (hFile, aDIB.getArray( ), dwFileSize, &dwBytesRead, NULL) ; CloseHandle (hFile); BITMAPFILEHEADER* pbmfh = (BITMAPFILEHEADER*)aDIB.getConstArray( ); diff --git a/fpicker/source/win32/folderpicker/Fopentry.cxx b/fpicker/source/win32/folderpicker/Fopentry.cxx index 717359ba511a..3c861cc67ce3 100644 --- a/fpicker/source/win32/folderpicker/Fopentry.cxx +++ b/fpicker/source/win32/folderpicker/Fopentry.cxx @@ -87,31 +87,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//----------------------------------------------------------------------- -// -//----------------------------------------------------------------------- - -sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_REGKEY_NAME ) ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - bRetVal = sal_False; - } - } - - return bRetVal; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx b/fpicker/source/win32/folderpicker/MtaFop.cxx index 254887a2a0f1..88523848d872 100644 --- a/fpicker/source/win32/folderpicker/MtaFop.cxx +++ b/fpicker/source/win32/folderpicker/MtaFop.cxx @@ -279,7 +279,7 @@ sal_Bool CMtaFolderPicker::browseForFolder( ) while ( bContinue ) { DWORD dwResult = MsgWaitForMultipleObjects( - 1, &aReqCtx.hEvent, FALSE, INFINITE, QS_ALLEVENTS ); + 1, &aReqCtx.hEvent, sal_False, INFINITE, QS_ALLEVENTS ); switch ( dwResult ) { @@ -546,7 +546,7 @@ void SAL_CALL CMtaFolderPicker::onInitialized( ) SendMessageA( m_hwnd, BFFM_SETSELECTION, - (WPARAM)FALSE, + (WPARAM)sal_False, (LPARAM) lpiidDisplayDir ); releaseItemIdList( lpiidDisplayDir ); diff --git a/fpicker/util/exports.dxp b/fpicker/util/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/fpicker/util/exports.dxp +++ b/fpicker/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/fpicker/util/fop.component b/fpicker/util/fop.component new file mode 100644 index 000000000000..a31c096dd42a --- /dev/null +++ b/fpicker/util/fop.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.ui.dialogs.Win32FolderPicker"> + <service name="com.sun.star.ui.dialogs.SystemFolderPicker"/> + </implementation> +</component> diff --git a/fpicker/util/fps.component b/fpicker/util/fps.component new file mode 100644 index 000000000000..cc18d211028c --- /dev/null +++ b/fpicker/util/fps.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.ui.dialogs.Win32FilePicker"> + <service name="com.sun.star.ui.dialogs.SystemFilePicker"/> + </implementation> +</component> diff --git a/fpicker/util/makefile.mk b/fpicker/util/makefile.mk index c249e4259e91..60bd3333cb71 100644 --- a/fpicker/util/makefile.mk +++ b/fpicker/util/makefile.mk @@ -100,3 +100,16 @@ DEF2EXPORTFILE= exports.dxp .INCLUDE : target.mk +ALLTAR : $(MISC)/fop.component $(MISC)/fps.component + +$(MISC)/fop.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fop.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fop.component + +$(MISC)/fps.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps.component |