diff options
Diffstat (limited to 'fpicker/source')
98 files changed, 901 insertions, 975 deletions
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.hxx b/fpicker/source/aqua/AquaFilePickerDelegate.hxx index b7bea762af..e3afccb814 100644 --- a/fpicker/source/aqua/AquaFilePickerDelegate.hxx +++ b/fpicker/source/aqua/AquaFilePickerDelegate.hxx @@ -46,7 +46,7 @@ class FilterHelper; - (void)setFilterHelper:(FilterHelper*)filterHelper; -- (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; +- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; - (void)panelSelectionDidChange:(id)sender; - (void)panel:(id)sender directoryDidChange:(NSString *)path; diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm index 4266453a71..d5c9062814 100644 --- a/fpicker/source/aqua/AquaFilePickerDelegate.mm +++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm @@ -56,7 +56,7 @@ #pragma mark NSSavePanel delegate methods -- (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename +- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename { if( filterHelper == NULL ) return true; diff --git a/fpicker/source/aqua/ControlHelper.cxx b/fpicker/source/aqua/ControlHelper.cxx index 67725c19ec..de224e3191 100644 --- a/fpicker/source/aqua/ControlHelper.cxx +++ b/fpicker/source/aqua/ControlHelper.cxx @@ -86,7 +86,7 @@ ControlHelper::~ControlHelper() [m_pUserPane release]; } - for(std::list<NSControl *>::iterator control = m_aActiveControls.begin(); control != m_aActiveControls.end(); control++) { + for(std::list<NSControl *>::iterator control = m_aActiveControls.begin(); control != m_aActiveControls.end(); ++control) { NSControl* pControl = (*control); NSString* sLabelName = m_aMapListLabels[pControl]; if (sLabelName != nil) { @@ -341,8 +341,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/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx index b2037471a5..145ba707f4 100644 --- a/fpicker/source/aqua/ControlHelper.hxx +++ b/fpicker/source/aqua/ControlHelper.hxx @@ -43,7 +43,8 @@ #include "AquaFilePickerDelegate.hxx" using namespace com::sun::star; -using namespace rtl; + +using ::rtl::OUString; class ControlHelper { diff --git a/fpicker/source/aqua/FPentry.cxx b/fpicker/source/aqua/FPentry.cxx index f25037a8a3..9e08ef84fa 100644 --- a/fpicker/source/aqua/FPentry.cxx +++ b/fpicker/source/aqua/FPentry.cxx @@ -80,32 +80,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*/ ) { @@ -122,7 +96,7 @@ void* SAL_CALL component_getFactory( { Sequence< OUString > aSNS( 1 ); aSNS.getArray( )[0] = - OUString::createFromAscii(FILE_PICKER_SERVICE_NAME); + OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_SERVICE_NAME)); xFactory = createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), @@ -134,7 +108,7 @@ void* SAL_CALL component_getFactory( { Sequence< OUString > aSNS( 1 ); aSNS.getArray( )[0] = - OUString::createFromAscii(FOLDER_PICKER_SERVICE_NAME); + OUString(RTL_CONSTASCII_USTRINGPARAM(FOLDER_PICKER_SERVICE_NAME)); xFactory = createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx index 33d0769ca7..c67d1e8565 100644 --- a/fpicker/source/aqua/FilterHelper.cxx +++ b/fpicker/source/aqua/FilterHelper.cxx @@ -372,7 +372,7 @@ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno:: // append the filter if (bPrependSeparator) { - rtl::OUString dash = rtl::OUString::createFromAscii("-"); + rtl::OUString dash(RTL_CONSTASCII_USTRINGPARAM("-")); OUStringList emptyList; m_pFilterList->push_back(FilterEntry(dash, emptyList)); } @@ -419,7 +419,7 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename) { rtl::OUString aName = [sFilename OUString]; - rtl::OUString allMatcher = rtl::OUString::createFromAscii(".*"); + rtl::OUString allMatcher(RTL_CONSTASCII_USTRINGPARAM(".*")); for(OUStringList::iterator iter = suffixList.begin(); iter != suffixList.end(); iter++) { if (aName.matchIgnoreAsciiCase(*iter, aName.getLength() - (*iter).getLength()) || ((*iter).equals(allMatcher))) { return sal_True; diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm index ecc38b7e23..6be80a7652 100644 --- a/fpicker/source/aqua/NSURL_OOoAdditions.mm +++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm @@ -92,8 +92,8 @@ NSString* resolveAlias( NSString* i_pSystemPath ) FSRef rFS; if( CFURLGetFSRef( rUrl, &rFS ) ) { - MacOSBoolean bIsFolder = false; - MacOSBoolean bAlias = false; + Boolean bIsFolder = false; + Boolean bAlias = false; OSErr err = FSResolveAliasFile( &rFS, true, &bIsFolder, &bAlias); if( (err == noErr) && bAlias ) { diff --git a/fpicker/source/aqua/SalAquaFilePicker.cxx b/fpicker/source/aqua/SalAquaFilePicker.cxx index f48f174c74..ea798295c7 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.cxx +++ b/fpicker/source/aqua/SalAquaFilePicker.cxx @@ -94,9 +94,9 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(3); - aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" ); - aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" ); - aRet[2] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFilePicker" ); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" )); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFilePicker" )); + aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.AquaFilePicker" )); return aRet; } } @@ -187,7 +187,6 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException ) // if m_pDialog is nil after initialization, something must have gone wrong before // or there was no initialization (see issue http://www.openoffice.org/issues/show_bug.cgi?id=100214) if (m_pDialog == nil) { - //throw uno::RuntimeException(rtl::OUString::createFromAscii("The dialog was not properly initialized!"), static_cast< XFilePicker* >( this )); m_nDialogType = NAVIGATIONSERVICES_OPEN; } @@ -206,7 +205,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException ) rtl::OUString ouName = [windowTitle OUString]; //a window title will typically be something like "Untitled1 - OpenOffice.org Writer" //but we only want the "Untitled1" part of it - sal_Int32 indexOfDash = ouName.indexOf(rtl::OUString::createFromAscii(" - ")); + sal_Int32 indexOfDash = ouName.indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - "))); if (indexOfDash > -1) { m_sSaveFileName = ouName.copy(0,indexOfDash); if (m_sSaveFileName.getLength() > 0) { @@ -244,7 +243,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException ) break; default: - throw uno::RuntimeException(rtl::OUString::createFromAscii("The dialog returned with an unknown result!"), static_cast< XFilePicker* >( this )); + throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The dialog returned with an unknown result!")), static_cast< XFilePicker* >( this )); break; } @@ -506,14 +505,14 @@ throw( uno::Exception, uno::RuntimeException ) // parameter checking uno::Any aAny; if( 0 == aArguments.getLength() ) - throw lang::IllegalArgumentException(rtl::OUString::createFromAscii( "no arguments" ), + throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )), static_cast<XFilePicker*>( this ), 1 ); aAny = aArguments[0]; if( ( aAny.getValueType() != ::getCppuType( ( sal_Int16* )0 ) ) && (aAny.getValueType() != ::getCppuType( ( sal_Int8* )0 ) ) ) - throw lang::IllegalArgumentException(rtl::OUString::createFromAscii( "invalid argument type" ), + throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )), static_cast<XFilePicker*>( this ), 1 ); sal_Int16 templateId = -1; @@ -566,7 +565,7 @@ throw( uno::Exception, uno::RuntimeException ) OSL_TRACE( "Template: FILESAVE_AUTOEXTENSION" ); break; default: - throw lang::IllegalArgumentException(rtl::OUString::createFromAscii( "Unknown template" ), + throw lang::IllegalArgumentException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )), static_cast< XFilePicker* >( this ), 1 ); } @@ -625,7 +624,7 @@ throw( uno::RuntimeException ) { DBG_PRINT_ENTRY(CLASS_NAME, __func__); - rtl::OUString retVal = rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME ); + rtl::OUString retVal(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME )); DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal); diff --git a/fpicker/source/aqua/SalAquaFilePicker.hxx b/fpicker/source/aqua/SalAquaFilePicker.hxx index 26b1ffeaa0..cc08f96581 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.hxx +++ b/fpicker/source/aqua/SalAquaFilePicker.hxx @@ -59,8 +59,7 @@ //---------------------------------------------------------- // forward declarations //---------------------------------------------------------- - -using namespace rtl; +using ::rtl::OUString; //---------------------------------------------------------- // class declaration diff --git a/fpicker/source/aqua/SalAquaFolderPicker.cxx b/fpicker/source/aqua/SalAquaFolderPicker.cxx index de229cd3bd..bad373aec8 100644 --- a/fpicker/source/aqua/SalAquaFolderPicker.cxx +++ b/fpicker/source/aqua/SalAquaFolderPicker.cxx @@ -80,8 +80,8 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FolderPicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(2); - aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" ); - aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.AquaFolderPicker" ); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFolderPicker" )); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.AquaFolderPicker" )); return aRet; } } @@ -137,7 +137,7 @@ sal_Int16 SAL_CALL SalAquaFolderPicker::execute() throw( uno::RuntimeException ) break; default: - throw uno::RuntimeException(rtl::OUString::createFromAscii("The dialog returned with an unknown result!"), static_cast< XFolderPicker* >( this )); + throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The dialog returned with an unknown result!")), static_cast< XFolderPicker* >( this )); break; } @@ -189,7 +189,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getDirectory() throw( uno::RuntimeEx OSL_TRACE("# of items: %d", nFiles); if (nFiles < 1) { - throw uno::RuntimeException(rtl::OUString::createFromAscii("no directory selected"), static_cast< XFolderPicker* >( this )); + throw uno::RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("no directory selected")), static_cast< XFolderPicker* >( this )); } rtl::OUString aDirectory; @@ -226,7 +226,7 @@ rtl::OUString SAL_CALL SalAquaFolderPicker::getImplementationName() { DBG_PRINT_ENTRY(CLASS_NAME, __func__); - rtl::OUString retVal = rtl::OUString::createFromAscii( FOLDER_PICKER_IMPL_NAME ); + rtl::OUString retVal(RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_IMPL_NAME )); DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal); diff --git a/fpicker/source/aqua/fps-aqua-ucd.txt b/fpicker/source/aqua/fps-aqua-ucd.txt deleted file mode 100644 index d71e8f4a57..0000000000 --- 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 0000000000..a04443e37f --- /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 10990e22d5..ff0473c8a7 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/aqua/resourceprovider.cxx b/fpicker/source/aqua/resourceprovider.cxx index 7c6b651d30..8681492be3 100644 --- a/fpicker/source/aqua/resourceprovider.cxx +++ b/fpicker/source/aqua/resourceprovider.cxx @@ -95,8 +95,8 @@ _Entry OtherCtrlIdToResIdTable[] = { }; -const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry ); -const sal_Int32 OTHER_SIZE_TABLE = sizeof( OtherCtrlIdToResIdTable ) / sizeof( _Entry ); +const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable ); +const sal_Int32 OTHER_SIZE_TABLE = SAL_N_ELEMENTS( OtherCtrlIdToResIdTable ); //------------------------------------------------------------ // diff --git a/fpicker/source/generic/fpicker.component b/fpicker/source/generic/fpicker.component new file mode 100644 index 0000000000..7d44d006d9 --- /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 cf2251faf6..2044885fd6 100644 --- a/fpicker/source/generic/fpicker.cxx +++ b/fpicker/source/generic/fpicker.cxx @@ -34,17 +34,18 @@ #include "cppuhelper/implementationentry.hxx" #include "com/sun/star/lang/XMultiComponentFactory.hpp" -#ifdef WNT -#include <tools/prewin.h> -#include <tools/postwin.h> -#include <odma_lib.hxx> -#endif - #include "svtools/miscopt.hxx" #include "svl/pickerhistoryaccess.hxx" #include "vcl/svapp.hxx" +#ifdef WNT +#define GradientStyle_RECT BLA_GradientStyle_RECT +#include <windows.h> +#undef GradientStyle_RECT +#include <odma_lib.hxx> +#endif + namespace css = com::sun::star; using css::uno::Reference; @@ -233,13 +234,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 f426bd7ad7..29f900ac41 100644 --- a/fpicker/source/generic/makefile.mk +++ b/fpicker/source/generic/makefile.mk @@ -61,3 +61,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/odma/ODMAFilePicker.cxx b/fpicker/source/odma/ODMAFilePicker.cxx index 39153b631f..0e611262b8 100644 --- a/fpicker/source/odma/ODMAFilePicker.cxx +++ b/fpicker/source/odma/ODMAFilePicker.cxx @@ -49,8 +49,7 @@ #include <unotools/ucbhelper.hxx> #ifndef ODMA_LIB_HXX -#include <tools/prewin.h> -#include <tools/postwin.h> +#include <windows.h> #include <odma_lib.hxx> #endif @@ -85,7 +84,7 @@ ODMAFilePicker::ODMAFilePicker( const Reference < XMultiServiceFactory >& xFacto { m_bUseDMS = ::odma::DMSsAvailable(); m_xSystemFilePicker = xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.Win32FilePicker" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.Win32FilePicker" ) )); } // XExecutableDialog functions @@ -163,7 +162,7 @@ sal_Int16 SAL_CALL ODMAFilePicker::execute( ) // Insane API... the first element is a full URI, the rest // are just the "basenames" in the same "directory". if (i == 0) - strings[0] = rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) + rtl::OUString::createFromAscii( p ); + strings[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.odma:/" )) + rtl::OUString::createFromAscii( p ); else strings[i] = rtl::OUString::createFromAscii( p ); p += strlen( p ); @@ -198,7 +197,7 @@ sal_Int16 SAL_CALL ODMAFilePicker::execute( ) NODMUnRegisterApp( handle ); if (status == ODM_SUCCESS) { - rtl::OUString s( rtl::OUString::createFromAscii( "vnd.sun.star.odma:/" ) + + rtl::OUString s( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.odma:/" )) + rtl::OUString::createFromAscii( newdocid ) ); // Create a Content for the odma URL so that // odma::ContentProvider will learn about the DOCID we @@ -520,7 +519,7 @@ Sequence< rtl::OUString > ODMAFilePicker::impl_getStaticSupportedServiceNames( ) { Sequence< rtl::OUString > seqServiceNames( 2 ); rtl::OUString* pArray = seqServiceNames.getArray(); - pArray[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFilePicker" ); + pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.ODMAFilePicker" )); // Super-ugly, but check the function sal_Bool // lcl_isSystemFilePicker( const Reference< XFilePicker >& ) in @@ -530,13 +529,13 @@ Sequence< rtl::OUString > ODMAFilePicker::impl_getStaticSupportedServiceNames( ) // isn't it? If we don't claim to implement this "service" (which // is not defined in any IDL file, btw), we get hangs. - pArray[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" ); + pArray[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFilePicker" )); return seqServiceNames ; } rtl::OUString ODMAFilePicker::impl_getStaticImplementationName( ) { - return rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFilePicker" ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svtools.ODMAFilePicker" )); } Reference< XInterface > SAL_CALL ODMAFilePicker::impl_createInstance( diff --git a/fpicker/source/odma/ODMAFolderPicker.cxx b/fpicker/source/odma/ODMAFolderPicker.cxx index 82e83a918b..a8d1f15138 100644 --- a/fpicker/source/odma/ODMAFolderPicker.cxx +++ b/fpicker/source/odma/ODMAFolderPicker.cxx @@ -43,9 +43,8 @@ #include <unotools/pathoptions.hxx> #ifndef ODMA_LIB_HXX -#include <tools/prewin.h> +#include <windows.h> #include <odma_lib.hxx> -#include <tools/postwin.h> #endif // using ---------------------------------------------------------------- @@ -67,7 +66,7 @@ ODMAFolderPicker::ODMAFolderPicker( const Reference < XMultiServiceFactory >& xF m_bUseDMS( sal_False ) { m_xInterface = xFactory->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" ) ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFolderPicker" ) )); } // XExecutableDialog functions @@ -166,13 +165,13 @@ Sequence< ::rtl::OUString > ODMAFolderPicker::impl_getStaticSupportedServiceName { Sequence< ::rtl::OUString > seqServiceNames( 1 ); ::rtl::OUString* pArray = seqServiceNames.getArray(); - pArray[0] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.ODMAFolderPicker" ); + pArray[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.ODMAFolderPicker" )); return seqServiceNames ; } ::rtl::OUString ODMAFolderPicker::impl_getStaticImplementationName( ) { - return ::rtl::OUString::createFromAscii( "com.sun.star.svtools.ODMAFolderPicker" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svtools.ODMAFolderPicker" )); } Reference< XInterface > SAL_CALL ODMAFolderPicker::impl_createInstance( const Reference< XComponentContext >& rxContext ) diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index c107252e63..a68f9ce957 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -36,6 +36,7 @@ #include <com/sun/star/ui/dialogs/ControlActions.hpp> #include <vcl/lstbox.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <tools/urlobj.hxx> #include <algorithm> #include <functional> @@ -201,37 +202,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 +539,7 @@ namespace svt { sal_Int32 nPos = 0; if ( _rValue >>= nPos ) - _pListbox->RemoveEntry( (USHORT) nPos ); + _pListbox->RemoveEntry( (sal_uInt16) nPos ); } break; @@ -677,7 +677,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 ) { @@ -704,7 +704,7 @@ namespace svt break; default: - DBG_ERROR( "OControlAccess::implSetControlProperty: invalid property id!" ); + OSL_FAIL( "OControlAccess::implSetControlProperty: invalid property id!" ); } } @@ -739,7 +739,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 +751,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 +764,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 @@ -780,7 +780,7 @@ namespace svt break; default: - DBG_ERROR( "OControlAccess::implGetControlProperty: invalid property id!" ); + OSL_FAIL( "OControlAccess::implGetControlProperty: invalid property id!" ); } return aReturn; } diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index c75245b845..32621d3b5c 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -476,7 +476,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(); @@ -548,7 +548,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 ) ); } @@ -624,8 +624,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 ); @@ -1107,19 +1107,19 @@ void SAL_CALL SvtFilePicker::initialize( const Sequence< Any >& _rArguments ) //------------------------------------------------------------------------- sal_Bool SvtFilePicker::implHandleInitializationArgument( const ::rtl::OUString& _rName, const Any& _rValue ) SAL_THROW( ( Exception, RuntimeException ) ) { - if ( _rName.equalsAscii( "TemplateDescription" ) ) + if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "TemplateDescription" ) ) ) { m_nServiceType = TemplateDescription::FILEOPEN_SIMPLE; OSL_VERIFY( _rValue >>= m_nServiceType ); return sal_True; } - if ( _rName.equalsAscii( "StandardDir" ) ) + if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StandardDir" ) ) ) { OSL_VERIFY( _rValue >>= m_aStandardDir ); return sal_True; } - if ( _rName.equalsAscii( "BlackList" ) ) + if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BlackList" ) ) ) { OSL_VERIFY( _rValue >>= m_aBlackList ); return sal_True; @@ -1166,14 +1166,14 @@ Sequence< rtl::OUString > SvtFilePicker::impl_getStaticSupportedServiceNames() { Sequence< rtl::OUString > seqServiceNames( 1 ); rtl::OUString* pArray = seqServiceNames.getArray(); - pArray[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.OfficeFilePicker" ); + pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.OfficeFilePicker" )); return seqServiceNames ; } /* Helper for XServiceInfo */ rtl::OUString SvtFilePicker::impl_getStaticImplementationName() { - return rtl::OUString::createFromAscii( "com.sun.star.svtools.OfficeFilePicker" ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svtools.OfficeFilePicker" )); } /* Helper for registry */ diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx index ebea3196ed..53b53cd897 100644 --- a/fpicker/source/office/OfficeFilePicker.hxx +++ b/fpicker/source/office/OfficeFilePicker.hxx @@ -41,7 +41,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> -#include <vcl/wintypes.hxx> +#include <tools/wintypes.hxx> #include "commonpicker.hxx" #include "pickercallbacks.hxx" diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx index f6133f5e99..ad8ac8e731 100644 --- a/fpicker/source/office/OfficeFolderPicker.cxx +++ b/fpicker/source/office/OfficeFolderPicker.cxx @@ -109,7 +109,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 ) ); } @@ -125,7 +125,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; @@ -246,14 +246,14 @@ Sequence< ::rtl::OUString > SAL_CALL SvtFolderPicker::getSupportedServiceNames() Sequence< ::rtl::OUString > SvtFolderPicker::impl_getStaticSupportedServiceNames() { Sequence< ::rtl::OUString > seqServiceNames(1); - seqServiceNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.OfficeFolderPicker" ); + seqServiceNames[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.OfficeFolderPicker" )); return seqServiceNames ; } /* Helper for XServiceInfo */ ::rtl::OUString SvtFolderPicker::impl_getStaticImplementationName() { - return ::rtl::OUString::createFromAscii( "com.sun.star.svtools.OfficeFolderPicker" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.svtools.OfficeFolderPicker" )); } /* Helper for registry */ diff --git a/fpicker/source/office/asyncfilepicker.cxx b/fpicker/source/office/asyncfilepicker.cxx index 26888c76e3..3982ed001f 100644 --- a/fpicker/source/office/asyncfilepicker.cxx +++ b/fpicker/source/office/asyncfilepicker.cxx @@ -143,7 +143,7 @@ namespace svt break; default: - DBG_ERROR( "AsyncPickerAction::execute: unknown action!" ); + OSL_FAIL( "AsyncPickerAction::execute: unknown action!" ); break; } @@ -208,7 +208,7 @@ namespace svt break; default: - DBG_ERROR( "AsyncPickerAction::OnActionDone: unknown action!" ); + OSL_FAIL( "AsyncPickerAction::OnActionDone: unknown action!" ); break; } diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx index 73a915203e..b9084c3d93 100644 --- a/fpicker/source/office/commonpicker.cxx +++ b/fpicker/source/office/commonpicker.cxx @@ -67,13 +67,13 @@ namespace svt { // the two properties we have registerProperty( - ::rtl::OUString::createFromAscii( "HelpURL" ), PROPERTY_ID_HELPURL, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "HelpURL" )), PROPERTY_ID_HELPURL, PropertyAttribute::TRANSIENT, &m_sHelpURL, ::getCppuType( &m_sHelpURL ) ); registerProperty( - ::rtl::OUString::createFromAscii( "Window" ), PROPERTY_ID_WINDOW, + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Window" )), PROPERTY_ID_WINDOW, PropertyAttribute::TRANSIENT | PropertyAttribute::READONLY, &m_xWindow, ::getCppuType( &m_xWindow ) ); @@ -169,7 +169,7 @@ namespace svt } else { - DBG_ERROR( "OCommonPicker::disposing: where did this come from?" ); + OSL_FAIL( "OCommonPicker::disposing: where did this come from?" ); } } @@ -465,7 +465,7 @@ namespace svt } else { - DBG_ERROR( + OSL_FAIL( ( ::rtl::OString( "OCommonPicker::initialize: unknown argument type at position " ) += ::rtl::OString::valueOf( (sal_Int32)( pArguments - _rArguments.getConstArray() ) ) ).getStr() @@ -490,7 +490,7 @@ namespace svt sal_Bool OCommonPicker::implHandleInitializationArgument( const ::rtl::OUString& _rName, const Any& _rValue ) SAL_THROW( ( Exception, RuntimeException ) ) { sal_Bool bKnown = sal_True; - if ( _rName.equalsAscii( "ParentWindow" ) ) + if ( _rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ParentWindow" ) ) ) { m_xDialogParent.clear(); OSL_VERIFY( _rValue >>= m_xDialogParent ); diff --git a/fpicker/source/office/fps_office.component b/fpicker/source/office/fps_office.component new file mode 100644 index 0000000000..3e49f68a49 --- /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 fb4bf48fb2..58bee9ce5b 100644 --- a/fpicker/source/office/fps_office.cxx +++ b/fpicker/source/office/fps_office.cxx @@ -62,13 +62,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/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx index 630cadec48..5b33754049 100644 --- a/fpicker/source/office/fpsmartcontent.cxx +++ b/fpicker/source/office/fpsmartcontent.cxx @@ -165,7 +165,7 @@ namespace svt } catch( Exception& ) { - DBG_ERROR( "SmartContent::bindTo: unexpected exception caught!" ); + OSL_FAIL( "SmartContent::bindTo: unexpected exception caught!" ); } } else @@ -226,7 +226,7 @@ namespace svt try { ::rtl::OUString sTitle; - m_pContent->getPropertyValue( ::rtl::OUString::createFromAscii( "Title" ) ) >>= sTitle; + m_pContent->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Title" )) ) >>= sTitle; _rTitle = sTitle; // from here on, we definately know that the content is valid diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 149a963b2e..980d75315f 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -86,7 +86,6 @@ #include <osl/file.h> #include <vcl/waitobj.hxx> -// #97148# ------------------------------------ #include <com/sun/star/task/XInteractionHandler.hpp> #include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" #include "fpinteraction.hxx" @@ -123,8 +122,8 @@ using namespace InternalFilePickerElementIds; #define GET_DECODED_NAME(aObj) \ aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET ) -// Zeit die beim Traveln in der Filterbox gewartet wird, -// bis in der Browsebox gefiltert wird ( in ms ). +// Time to wait while traveling in the filterbox until +// the browsebox gets filtered ( in ms). #define TRAVELFILTER_TIMEOUT 750 #define WIDTH_ADDITION 15 @@ -143,7 +142,6 @@ namespace if ( !pFilter ) pFilter = pImpl->GetCurFilter(); - // Filtern. if ( !pFilter ) return String(); @@ -237,7 +235,6 @@ namespace { // check if it is a real file extension, and not only the "post-dot" part in // a directory name - // 28.03.2002 - 98337 - fs@openoffice.org sal_Bool bRealExtensions = sal_True; if ( STRING_NOTFOUND != aExt.Search( '/' ) ) bRealExtensions = sal_False; @@ -258,7 +255,6 @@ namespace } if ( INET_PROT_FILE == aURL.GetProtocol() ) { - // #97148# & #102204# ----- try { bRealExtensions = !_pDialog->ContentIsFolder( aURL.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -316,7 +312,7 @@ namespace } catch( const Exception& ) { - DBG_ERROR( "lcl_getHomeDirectory: caught an exception!" ); + OSL_FAIL( "lcl_getHomeDirectory: caught an exception!" ); } return 0 < _rHomeDir.Len(); } @@ -402,7 +398,7 @@ struct ControlChain_Impl { Window* _pControl; ControlChain_Impl* _pNext; - BOOL _bHasOwnerShip; + sal_Bool _bHasOwnerShip; ControlChain_Impl( Window* pControl, ControlChain_Impl* pNext ); ~ControlChain_Impl(); @@ -417,7 +413,7 @@ ControlChain_Impl::ControlChain_Impl ) : _pControl( pControl ), _pNext( pNext ), - _bHasOwnerShip( TRUE ) + _bHasOwnerShip( sal_True ) { } @@ -455,7 +451,7 @@ namespace struct SvtResId : public ResId { - SvtResId (USHORT nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} + SvtResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} }; } @@ -482,7 +478,7 @@ SvtFileDialog::SvtFileDialog ,_pFileNotifier( NULL ) ,_pImp( new SvtExpFileDlg_Impl( nBits ) ) ,_nExtraBits( nExtraBits ) - ,_bIsInExecute( FALSE ) + ,_bIsInExecute( sal_False ) ,m_bInExecuteAsync( false ) ,m_bHasFilename( false ) { @@ -505,7 +501,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 ); @@ -521,7 +517,7 @@ SvtFileDialog::~SvtFileDialog() SvtViewOptions aDlgOpt( E_DIALOG, _pImp->_aIniKey ); aDlgOpt.SetWindowState( String( GetWindowState(), osl_getThreadTextEncoding() ) ); String sUserData = _pFileView->GetConfigString(); - aDlgOpt.SetUserItem( ::rtl::OUString::createFromAscii( "UserData" ), + aDlgOpt.SetUserItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserData" )), makeAny( ::rtl::OUString( sUserData ) ) ); } @@ -548,8 +544,7 @@ void SvtFileDialog::Init_Impl WinBits nStyle ) { - sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); - m_aImages = ImageList( SvtResId( bIsHighContrast ? RID_FILEPICKER_IMAGES_HC : RID_FILEPICKER_IMAGES ) ); + m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) ); _pImp->_nStyle = nStyle; _pImp->_a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); @@ -563,14 +558,13 @@ void SvtFileDialog::Init_Impl INetURLObject aStdDirObj( SvtPathOptions().GetWorkPath() ); SetStandardDir( aStdDirObj.GetMainURL( INetURLObject::NO_DECODE ) ); - // Reichweite bestimmen. + // determine range if ( !( nStyle & SFXWB_NOREMOTE ) ) { _pImp->_nState |= FILEDLG_STATE_REMOTE; } - // Kontrollelement erzeugen, wobei die Reihenfolge die Tab-Steuerung - // bestimmt. + // Create control element, the order defines the tab control. _pImp->_pFtFileName = new FixedText( this, SvtResId( FT_EXPLORERFILE_FILENAME ) ); SvtURLBox* pURLBox = new SvtURLBox( this ); @@ -632,7 +626,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, @@ -643,7 +637,7 @@ void SvtFileDialog::Init_Impl _pFileView->SetHelpId( HID_FILEDLG_STANDARD ); _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP ); - // Positionen und Groessen der Knoepfe bestimmen. + // determine the positions and size of the buttons Image aNewFolderImg( GetButtonImage( IMG_FILEDLG_CREATEFOLDER ) ); _pImp->_pBtnNewFolder->SetModeImage( aNewFolderImg ); @@ -661,7 +655,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 @@ -713,15 +707,14 @@ void SvtFileDialog::Init_Impl AddControls_Impl( ); - // Zahl der Pixel bestimmen, um die die anderen Elemente in der Position - // Angepasst werden muessen. + // Determine the amount of pixel the other elements have to be adjusted in their position. aPos.Y() += aSize.Height(); aPos.Y() += LogicToPixel( Size( 0, 6 ), MAP_APPFONT ).Height(); long nYOffset = aPos.Y(); aPos = _pFileView->GetPosPixel(); nYOffset -= aPos.Y(); - // Positionen der uebrigen Elemente anpassen. + // Adjust the position of the other elements. aPos.Y() += nYOffset; _pFileView->SetPosPixel( aPos ); @@ -746,14 +739,14 @@ void SvtFileDialog::Init_Impl lcl_MoveControl( _pImp->_pBtnHelp, 0, nYOffset + 3 ); // a little more spacing between Cancel- and HelpButton - // Groesse des Dialoges anpassen. + // adjust size of the dialog aSize = GetSizePixel(); aSize.Height() += nYOffset; SetSizePixel( aSize ); - // Beschriftungen dem Modus anpassen. - USHORT nResId = STR_EXPLORERFILE_OPEN; - USHORT nButtonResId = 0; + // adjust the labels to the mode + sal_uInt16 nResId = STR_EXPLORERFILE_OPEN; + sal_uInt16 nButtonResId = 0; if ( nStyle & WB_SAVEAS ) { @@ -779,7 +772,7 @@ void SvtFileDialog::Init_Impl _pImp->GetFilterListControl()->Hide(); } - // Einstellungen der Steuerelemente vornehmen. + // Setting preferences of the control elements. _pImp->_pBtnNewFolder->SetClickHdl( STATIC_LINK( this, SvtFileDialog, NewFolderHdl_Impl ) ); _pImp->_pBtnFileOpen->SetClickHdl( STATIC_LINK( this, SvtFileDialog, OpenHdl_Impl ) ); _pImp->_pBtnCancel->SetClickHdl( LINK( this, SvtFileDialog, CancelHdl_Impl ) ); @@ -790,17 +783,15 @@ void SvtFileDialog::Init_Impl _pFileView->SetDoubleClickHdl( LINK( this, SvtFileDialog, DblClickHdl_Impl ) ); _pFileView->SetOpenDoneHdl( LINK( this, SvtFileDialog, OpenDoneHdl_Impl ) ); - // Resourcen freigeben. FreeResource(); - // Timer fuer Filterbox Travel setzen + // set timer for the filterbox travel _pImp->_aFilterTimer.SetTimeout( TRAVELFILTER_TIMEOUT ); _pImp->_aFilterTimer.SetTimeoutHdl( STATIC_LINK( this, SvtFileDialog, FilterSelectHdl_Impl ) ); if ( WB_SAVEAS & nStyle ) { // different help ids if in save-as mode - // 90744 - 09.08.2001 - frank.schoenheit@sun.com SetHelpId( HID_FILESAVE_DIALOG ); _pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL ); @@ -816,7 +807,6 @@ void SvtFileDialog::Init_Impl // for the extra use cases, and separated _pLbFileVersion // I did not find out in which cases the help ID is really needed HID_FILESAVE_TEMPLATE - all // tests I made lead to a dialog where _no_ of the three list boxes was present. - // 96930 - 15.08.2002 - fs@openoffice.org if ( _pImp->_pLbFileVersion ) _pImp->_pLbFileVersion->SetHelpId( HID_FILESAVE_TEMPLATE ); if ( _pImp->_pLbTemplates ) @@ -872,7 +862,6 @@ IMPL_STATIC_LINK_NOINSTANCE( SvtFileDialog, ViewHdl_Impl, ImageButton*, EMPTYARG return 0; } -//***************************************************************************** //----------------------------------------------------------------------------- sal_Bool SvtFileDialog::createNewUserFilter( const String& _rNewFilter, sal_Bool _bAllowUserDefExt ) { @@ -888,7 +877,6 @@ sal_Bool SvtFileDialog::createNewUserFilter( const String& _rNewFilter, sal_Bool SetDefaultExt( _rNewFilter.Copy( 2 ) ); // TODO: this is nonsense. In the whole file there are a lotta places where we assume that a user filter // is always "*.<something>". But changing this would take some more time than I have now ... - // 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 @@ -936,7 +924,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 @@ -949,7 +937,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; @@ -998,7 +986,7 @@ IMPL_LINK( SvtFileDialog, CancelHdl_Impl, void*, EMPTYARG ) } else { - EndDialog( FALSE ); + EndDialog( sal_False ); } return 1L; } @@ -1008,7 +996,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { if ( pThis->_pImp->_bMultiSelection && pThis->_pFileView->GetSelectionCount() > 1 ) { - // bei Multiselektion spezielles Open + // special open in case of multiselection pThis->OpenMultiSelection_Impl(); return 0; } @@ -1024,7 +1012,6 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) // if an entry is selected in the view .... if ( pThis->_pFileView->GetSelectionCount() ) { // -> use this one. This will allow us to step down this folder - // #i8928# - 2002-12-20 - fs@openoffice.org aFileName = pThis->_pFileView->GetCurrentURL(); } } @@ -1049,7 +1036,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) return 0; } -#if defined( UNX ) || defined( FS_PRIV_DEBUG ) +#if defined( UNX ) if ( ( 1 == aText.Len() ) && ( '~' == aText.GetBuffer()[0] ) ) { // go to the home directory @@ -1076,7 +1063,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 @@ -1117,8 +1104,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) } } - // Pr"ufen, ob es sich um einen Ordner handelt. - BOOL bIsFolder = FALSE; + // check if it is a folder + 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 @@ -1127,7 +1114,6 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) // error messages for the same content a second time .... pThis->m_aContent.bindTo( ::rtl::OUString( ) ); - // #97148# & #102204# --------- if ( aFileName.Len() ) { // Make sure we have own Interaction Handler in place. We do not need @@ -1176,8 +1162,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) && !( FILEDLG_MODE_SAVE == pThis->_pImp->_eMode // we're saving a file && pThis->_pFileView->GetSelectionCount() // there is a selected file in the file view -> it will later on ) // (in SvtFileDialog::GetPathList) be taken as file to save to - // (#114818# - 2004-03-17 - fs@openoffice.org) - && FILEDLG_MODE_OPEN != pThis->_pImp->_eMode // pb: #i83408# don't append extension on open + + && FILEDLG_MODE_OPEN != pThis->_pImp->_eMode // #i83408# don't append extension on open ) { // check extension and append the default extension if necessary @@ -1186,7 +1172,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 ) { @@ -1217,12 +1203,12 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) } else if ( !( nNewFilterFlags & FLT_NONEMPTY ) ) { - // Ggf. URL speichern. + // if applicable save URL pThis->_aPath = aFileName; } else { - // Ggf. neu filtern. + // if applicable filter again if ( nNewFilterFlags & FLT_CHANGED ) pThis->ExecuteFilter(); return 0; @@ -1248,7 +1234,12 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { if ( ::utl::UCBContentHelper::Exists( aFileObj.GetMainURL( INetURLObject::NO_DECODE ) ) ) { - QueryBox aBox( pThis, WB_YES_NO, SvtResId( STR_SVT_ALREADYEXISTOVERWRITE ) ); + String aMsg = SvtResId( STR_SVT_ALREADYEXISTOVERWRITE ); + aMsg.SearchAndReplace( + String( RTL_CONSTASCII_USTRINGPARAM( "$filename$" ) ), + aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET) + ); + QueryBox aBox( pThis, WB_YES_NO, aMsg ); if ( aBox.Execute() != RET_YES ) return 0; } @@ -1260,8 +1251,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) // if content does not exist: at least its path must exist 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 ); @@ -1275,12 +1265,10 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) case FILEDLG_MODE_OPEN: { // do an existence check herein, again - // 16.11.2001 - 93107 - frank.schoenheit@sun.com if ( INET_PROT_FILE == aFileObj.GetProtocol( ) ) { sal_Bool bExists = sal_False; - // #102204# -------------- bExists = pThis->m_aContent.is( aFileObj.GetMainURL( INetURLObject::NO_DECODE ) ); @@ -1307,10 +1295,10 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) break; default: - DBG_ERROR("SvtFileDialog, OpenHdl_Impl: invalid mode!"); + OSL_FAIL("SvtFileDialog, OpenHdl_Impl: invalid mode!"); } - // Interessenten benachrichtigen. + // notify interested parties long nRet; if ( pThis->_aOKHdl.IsSet() ) @@ -1320,7 +1308,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) if ( nRet ) { - pThis->EndDialog( TRUE ); + pThis->EndDialog( sal_True ); } return nRet; @@ -1328,7 +1316,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) //***************************************************************************** -void SvtFileDialog::EnableAutocompletion( BOOL _bEnable ) +void SvtFileDialog::EnableAutocompletion( sal_Bool _bEnable ) { _pImp->_pEdFileName->EnableAutocompletion( _bEnable ); } @@ -1339,10 +1327,10 @@ IMPL_STATIC_LINK( SvtFileDialog, FilterSelectHdl_Impl, ListBox*, pBox ) { DBG_ASSERT( pBox, "SvtFileDialog:keine Instanz" ); - // wurde der Handler vom Travel-Timer gefeuert? + // was the handler executed by the travel timer? if ( pBox == (ListBox*)&pThis->_pImp->_aFilterTimer ) { - // Anzeige erneut filtern. + // filter the view again pThis->ExecuteFilter(); return 0; } @@ -1384,12 +1372,12 @@ IMPL_STATIC_LINK( SvtFileDialog, FilterSelectHdl_Impl, ListBox*, pBox ) String sLastFilterExt = pThis->_pImp->GetCurFilter()->GetExtension(); DELETEZ( pThis->_pImp->_pUserFilter ); - // Ggf. Filter des Benutzers entfernen. + // if applicable remove filter of the user pThis->_pImp->SetCurFilter( pSelectedFilter, sSelectedFilterDisplayName ); - // Ggf. Endung anzeigen. + // if applicable show extension 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 ); @@ -1397,20 +1385,20 @@ IMPL_STATIC_LINK( SvtFileDialog, FilterSelectHdl_Impl, ListBox*, pBox ) // update the extension of the current file if necessary lcl_autoUpdateFileExtension( pThis, sLastFilterExt ); - // wenn der Benutzer schnell durch die Filterbox - // travelt, nicht sofort Filtern + // if the user is traveling fast through the filterbox + // do not filter instantly if ( pThis->_pImp->IsFilterListTravelSelect() ) { - // FilterSelectHdl_Impl soll in - // TRAVELFILTER_TIMEOUT ms neu gefeuert werden + // FilterSelectHdl_Impl should be started again in + // TRAVELFILTER_TIMEOUT ms pThis->_pImp->_aFilterTimer.Start(); } else { - // evtl. vorher gestarteten Timer stoppen + // stop previously started timer pThis->_pImp->_aFilterTimer.Stop(); - // Anzeige erneut filtern. + // filter the view again pThis->ExecuteFilter(); } } @@ -1441,23 +1429,21 @@ 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 - beruecksichtigen - FALSE - keine ... + sal_Bool _bMultiExt,/* TRUE - regard filter with several extensions + FALSE - do not ... */ sal_Bool& _rFilterChanged ) -/* [Beschreibung] +/* [Description] - Die Methode sucht in den eingef"ugten Filtern nach der - spezifizierten Endung. + This method looks for the specified extension in the included filters. */ { SvtFileDialogFilter_Impl* pFoundFilter = NULL; SvtFileDialogFilterList_Impl* pList = _pImp->_pFilter; - USHORT nFilter = pList->Count(); + sal_uInt16 nFilter = pList->Count(); while ( nFilter-- ) { @@ -1467,7 +1453,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 ); @@ -1488,7 +1474,7 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl if ( pFoundFilter ) { - // Filter aktivieren. + // activate filter _rFilterChanged = _pImp->_pUserFilter || ( _pImp->GetCurFilter() != pFilter ); createNewUserFilter( _rFilter, sal_False ); @@ -1511,20 +1497,20 @@ void SvtFileDialog::ExecuteFilter() void SvtFileDialog::OpenMultiSelection_Impl() -/* [Beschreibung] +/* [Description] - OpenHandler f"ur MultiSelektion + OpenHandler for MultiSelection */ { String aPath; - ULONG nCount = _pFileView->GetSelectionCount(); + sal_uLong nCount = _pFileView->GetSelectionCount(); SvLBoxEntry* pEntry = nCount ? _pFileView->FirstSelected() : NULL; if ( nCount && pEntry ) _aPath = _pFileView->GetURL( pEntry ); - // Interessenten benachrichtigen. + // notify interested parties long nRet; if ( _aOKHdl.IsSet() ) @@ -1533,7 +1519,7 @@ void SvtFileDialog::OpenMultiSelection_Impl() nRet = OK(); if ( nRet ) - EndDialog( TRUE ); + EndDialog( sal_True ); } //***************************************************************************** @@ -1556,7 +1542,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() ) ); } @@ -1635,7 +1621,7 @@ IMPL_LINK( SvtFileDialog, SelectHdl_Impl, SvTabListBox*, pBox ) if ( _pImp->_bMultiSelection && _pFileView->GetSelectionCount() > 1 ) { - // bei Multiselektion den Datei-Edit leeren + // clear the file edit for multiselection _pImp->_pEdFileName->SetText( String() ); } @@ -1648,9 +1634,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; } @@ -1746,24 +1732,24 @@ IMPL_LINK( SvtFileDialog, PlayButtonHdl_Impl, PushButton*, EMPTYARG ) long SvtFileDialog::Notify( NotifyEvent& rNEvt ) -/* [Beschreibung] +/* [Description] - Die Methode wird gerufen, <BACKSPACE> abzufangen. + This method gets called to catch <BACKSPACE>. */ { - 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() ) { - nRet = 0; //! (long)_pFileView->DoBeamerKeyInput( *rNEvt.GetKeyEvent() ); + nRet = 0; if ( !nRet && _pImp->_pBtnUp->IsEnabled() ) { @@ -1771,15 +1757,6 @@ long SvtFileDialog::Notify( NotifyEvent& rNEvt ) nRet = 1; } } -// else if ( rKeyCode.IsMod1() && ( KEY_C == nCode || KEY_V == nCode || KEY_X == nCode ) ) -// { -/* (mhu) - String aVerb = KEY_C == nCode ? UniString(RTL_CONSTASCII_USTRINGPARAM(SVT_MENUPART_VERB_COPY)) : - ( KEY_V == nCode ? UniString(RTL_CONSTASCII_USTRINGPARAM(SVT_MENUPART_VERB_PASTE)) : UniString(RTL_CONSTASCII_USTRINGPARAM(SVT_MENUPART_VERB_CUT)) ); -//(dv) if ( !CntPopupMenu::DoVerbCommand( aVerb, _pFileView->GetView() ) ) -//(dv) Sound::Beep(); -*/ -// } } return nRet ? nRet : ModalDialog::Notify( rNEvt ); } @@ -1788,7 +1765,7 @@ long SvtFileDialog::Notify( NotifyEvent& rNEvt ) long SvtFileDialog::OK() { - return TRUE; + return sal_True; } //***************************************************************************** @@ -1865,7 +1842,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? @@ -1875,7 +1852,6 @@ String SvtFileDialog::implGetInitialURL( const String& _rPath, const String& _rF if ( bIsInvalid && m_bHasFilename && !aURLParser.hasFinalSlash() ) { // check if the parent folder exists - // #108429# - 2003-03-26 - fs@openoffice.org INetURLObject aParent( aURLParser ); aParent.removeSegment( ); aParent.setFinalSlash( ); @@ -1917,27 +1893,24 @@ short SvtFileDialog::Execute() if ( !PrepareExecute() ) return 0; - // Start des Dialogs. - _bIsInExecute = TRUE; + // start the dialog + _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 + // the dialog should not be cancellable while an async action is running - first, the action // needs to be cancelled - // letztes Verzeichnis merken + // remember last directory if ( RET_OK == nResult ) { INetURLObject aURL( _aPath ); if ( aURL.GetProtocol() == INET_PROT_FILE ) { - // nur bei File-URL's und nicht bei virtuelle Folder - // das ausgew"ahlte Verzeichnis merken + // remember the selected directory only for file URLs not for virtual folders 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 ); if ( nLevel > 1 && ( FILEDLG_TYPE_FILEDLG == _pImp->_eDlgType || !bDir ) ) aURL.removeSegment(); } @@ -1951,24 +1924,23 @@ void SvtFileDialog::StartExecuteModal( const Link& rEndDialogHdl ) { PrepareExecute(); - // Start des Dialogs. -// _bIsInExecute = TRUE; + // start of the dialog 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(); @@ -2015,12 +1987,12 @@ void SvtFileDialog::displayIOException( const String& _rURL, IOErrorCode _eCode } catch( const Exception& ) { - DBG_ERROR( "iodlg::displayIOException: caught an exception!" ); + OSL_FAIL( "iodlg::displayIOException: caught an exception!" ); } } //----------------------------------------------------------------------------- -void SvtFileDialog::EnableUI( BOOL _bEnable ) +void SvtFileDialog::EnableUI( sal_Bool _bEnable ) { Enable( _bEnable ); @@ -2031,13 +2003,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 ) { @@ -2063,7 +2035,7 @@ short SvtFileDialog::PrepareExecute() { rtl::OUString aEnvValue; if ( getEnvironmentValue( "WorkDirMustContainRemovableMedia", aEnvValue ) && - aEnvValue.equalsAscii( "1" ) ) + aEnvValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "1" ) ) ) { try { @@ -2072,8 +2044,8 @@ short SvtFileDialog::PrepareExecute() INetURLObject::NO_DECODE ) ), Reference< XCommandEnvironment >() ); Sequence< rtl::OUString > aProps(2); - aProps[0] = rtl::OUString::createFromAscii( "IsVolume" ); - aProps[1] = rtl::OUString::createFromAscii( "IsRemoveable" ); + aProps[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsVolume" )); + aProps[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsRemoveable" )); Reference< XResultSet > xResultSet = aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_FOLDERS_ONLY ); @@ -2089,21 +2061,7 @@ short SvtFileDialog::PrepareExecute() } else { -// @@@ KSO 05/18/2006: support for removable media currently hardcoded/incomplete in OSL -// -// do -// { -// // check, whether child is a removable volume -// if ( xRow->getBoolean( 1 ) && !xRow->wasNull() ) -// { -// if ( xRow->getBoolean( 2 ) && !xRow->wasNull() ) -// { bEmpty = false; -// break; -// } -// } -// } -// while ( xResultSet->next() ); } if ( bEmpty ) @@ -2122,16 +2080,14 @@ short SvtFileDialog::PrepareExecute() } } - // #102204# --------------- if ( ( _pImp->_nStyle & WB_SAVEAS ) && m_bHasFilename ) // when doing a save-as, we do not want the handler to handle "this file does not exist" messages // - finally we're going to save that file, aren't we? - // #105812# - 2002-12-02 - fs@openoffice.org m_aContent.enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::E_DOESNOTEXIST); else m_aContent.enableDefaultInteractionHandler(); - // #53016# evtl. nur ein Filename ohne Pfad? + // possibly just a filename without a path String aFileNameOnly; if( _aPath.Len() && (_pImp->_eMode == FILEDLG_MODE_SAVE) && (_aPath.Search(':') == STRING_NOTFOUND) @@ -2142,13 +2098,13 @@ short SvtFileDialog::PrepareExecute() _aPath.Erase(); } - // kein Startpfad angegeben? + // no starting path specified? if ( !_aPath.Len() ) { - // dann das Standard-Dir verwenden + // then use the standard directory _aPath = lcl_ensureFinalSlash( _pImp->GetStandardDir() ); - // #53016# vorgegebener Dateiname an Pfad anh"angen + // attach given filename to path if ( aFileNameOnly.Len() ) _aPath += aFileNameOnly; } @@ -2166,20 +2122,20 @@ short SvtFileDialog::PrepareExecute() if ( !m_aURLFilter.isUrlAllowed( _aPath ) ) _aPath = m_aURLFilter.getFilter()[0]; - // Ggf. Filter anzeigen. + // if applicable show filter _pImp->InitFilterList(); - // Initialen Filter einstellen. - USHORT nFilterCount = GetFilterCount(); + // set up initial filter + 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 applicable set the only filter or the only filter that + // does not refer to all files, as the current one if ( !_pImp->GetCurFilter() ) { - USHORT nPos = 0; + sal_uInt16 nPos = 0; if ( 2 == nFilterCount && bHasAll ) { nPos = nFilterCount; @@ -2194,16 +2150,16 @@ short SvtFileDialog::PrepareExecute() _pImp->SetCurFilter( pNewCurFilter, pNewCurFilter->GetName() ); } - // Anzeige anpassen. + // adjust view _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 ); } else { - // Ggf. Filter fuer alle Dateien setzen bzw. erzeugen. + // if applicable set respectively create filter for all files if ( !bHasAll ) { SvtFileDialogFilter_Impl* pAllFilter = implAddFilter( aAll, UniString(RTL_CONSTASCII_USTRINGPARAM(FILEDIALOG_FILTER_ALL)) ); @@ -2215,8 +2171,7 @@ short SvtFileDialog::PrepareExecute() _pImp->_pDefaultFilter = _pImp->GetCurFilter(); - // HACK #50065# - // ggf. Filter isolieren. + // if applicable isolate filter String aFilter; if ( !IsolateFilterFromPath_Impl( _aPath, aFilter ) ) @@ -2227,9 +2182,8 @@ short SvtFileDialog::PrepareExecute() { _pImp->_pEdFileName->SetText( aFilter ); } - // HACK #50065# - // Instanz fuer den gesetzten Pfad erzeugen und anzeigen. + // create and show instance for set path INetURLObject aFolderURL( _aPath ); String aFileName( aFolderURL.getName( INetURLObject::LAST_SEGMENT, false ) ); xub_StrLen nFileNameLen = aFileName.Len(); @@ -2243,7 +2197,7 @@ short SvtFileDialog::PrepareExecute() INetURLObject aObj = aFolderURL; if ( aObj.GetProtocol() == INET_PROT_FILE ) { - // Ordner als aktuelles Verzeichnis setzen. + // set folder as current directory aObj.setFinalSlash(); } @@ -2252,16 +2206,13 @@ short SvtFileDialog::PrepareExecute() // Somebody might want to enable some controls acording to the current filter FilterSelect(); - // Zustand der Steuerelemente anpassen. -// EndListeningAll(); - ViewHdl_Impl( this, NULL ); OpenURL_Impl( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); _pFileView->Show(); SvtDefModalDialogParent_Impl aDefParent( this ); - // ggf. Gr"osse aus Ini lesen und setzen + // if applicable read and set size from ini InitSize(); return 1; @@ -2335,9 +2286,9 @@ void SvtFileDialog::FilterSelect() void SvtFileDialog::SetStandardDir( const String& rStdDir ) -/* [Beschreibung] +/* [Description] - Die Methode setzt den Pfad f"ur den Standardknopf. + This method sets the path for the default button. */ { @@ -2362,9 +2313,9 @@ const ::com::sun::star::uno::Sequence< ::rtl::OUString >& SvtFileDialog::GetBlac const String& SvtFileDialog::GetStandardDir() const -/* [Beschreibung] +/* [Description] - Diese Methode gibt den eingestellten Standardpfad zur"uck. + This method returns the standard path. */ { @@ -2395,7 +2346,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 ); @@ -2423,15 +2374,13 @@ void SvtFileDialog::AddFilterGroup( const String& _rFilter, const Sequence< Stri implAddFilter( pSubFilters->First, pSubFilters->Second ); } -//***************************************************************************** - //----------------------------------------------------------------------------- void SvtFileDialog::SetCurFilter( const String& rFilter ) { DBG_ASSERT( !IsInExecute(), "SvtFileDialog::SetCurFilter: currently executing!" ); - // Entsprechenden Filter suchen. - USHORT nPos = _pImp->_pFilter->Count(); + // look for corresponding filter + sal_uInt16 nPos = _pImp->_pFilter->Count(); while ( nPos-- ) { @@ -2464,14 +2413,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(); @@ -2489,8 +2438,7 @@ void SvtFileDialog::InitSize() if ( !_pImp->_nFixDeltaHeight ) { - // Fixgr"ossen errechnen und merken - Point aPnt = _pFileView->GetPosPixel(); + // calculate and save fixsize long nBoxH = _pFileView->GetSizePixel().Height(); long nH = GetSizePixel().Height(); _pImp->_nFixDeltaHeight = nH - nBoxH; @@ -2503,7 +2451,7 @@ void SvtFileDialog::InitSize() { SetWindowState( ByteString( String( aDlgOpt.GetWindowState() ), osl_getThreadTextEncoding() ) ); - Any aUserData = aDlgOpt.GetUserItem( ::rtl::OUString::createFromAscii( "UserData" ) ); + Any aUserData = aDlgOpt.GetUserItem( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "UserData" ) )); ::rtl::OUString sCfgStr; if ( aUserData >>= sCfgStr ) _pFileView->SetConfigString( String( sCfgStr ) ); @@ -2515,7 +2463,7 @@ void SvtFileDialog::InitSize() SvStringsDtor* SvtFileDialog::GetPathList() const { SvStringsDtor* pList = new SvStringsDtor; - ULONG nCount = _pFileView->GetSelectionCount(); + sal_uLong nCount = _pFileView->GetSelectionCount(); SvLBoxEntry* pEntry = nCount ? _pFileView->FirstSelected() : NULL; if ( ! pEntry ) @@ -2565,7 +2513,6 @@ void SvtFileDialog::implArrangeControls() // (including the FixedTexts is important - not for tabbing order (they're irrelevant there), // but for working keyboard shortcuts) - // 96861 - 23.01.2002 - fs@openoffice.org }; // loop through all these controls and adjust the z-order @@ -2591,27 +2538,27 @@ 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 ) { - // Fragezeichen als Wildcard nur bei Files + // use question mark as wildcard only for files INetProtocol eProt = INetURLObject::CompareProtocolScheme( rPath ); 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 ) { @@ -2638,21 +2585,21 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) #endif } - // Syntax pr"ufen. + // check syntax if ( nPathTokenPos != STRING_NOTFOUND ) { if ( nPathTokenPos < (rPath.Len() - nWildCardPos - 1) ) { ErrorHandler::HandleError( ERRCODE_SFX_INVALIDSYNTAX ); - return FALSE; + return sal_False; } - // Filter abschneiden. + // cut off filter rFilter = aReversePath; rFilter.Erase( nPathTokenPos ); rFilter.Reverse(); - // Ordner bestimmen. + // determine folder rPath = aReversePath; rPath.Erase( 0, nPathTokenPos ); rPath.Reverse(); @@ -2664,19 +2611,13 @@ BOOL SvtFileDialog::IsolateFilterFromPath_Impl( String& rPath, String& rFilter ) } } - return TRUE; + return sal_True; } -//***************************************************************************** - //----------------------------------------------------------------------------- void SvtFileDialog::implUpdateImages( ) { - // determine high contrast mode - { - sal_Bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); - m_aImages = ImageList( SvtResId( bIsHighContrast ? RID_FILEPICKER_IMAGES_HC : RID_FILEPICKER_IMAGES ) ); - } + m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) ); // set the appropriate images on the buttons if ( _pImp->_pBtnUp ) @@ -2735,7 +2676,7 @@ void SvtFileDialog::Resize() _pFileView->SetSizePixel( aNewSize ); if ( !nDeltaY && !nDeltaX ) - // Dieses Resize wurde nur zum Ein - oder Ausblenden des Indicators aufgerufen + // This resize was only called to show or hide the indicator. return; // ------------- @@ -2801,12 +2742,12 @@ void SvtFileDialog::Resize() } } - // zus"atzliche Controls ausrichten + // align additional controls if ( _pPrevWin && _pPrevWin->GetPosPixel().X() > _pFileView->GetPosPixel().X() ) { - // Controls vom Typ Window speziell ausrichten - // auch die Gr"osse anpassen + // special alignment for controls of the type window + // also adjust the size Point aNewPos = _pPrevWin->GetPosPixel(); aNewPos.X() += nDeltaX; _pPrevWin->SetPosPixel( aNewPos ); @@ -2825,8 +2766,6 @@ void SvtFileDialog::Resize() _pFileNotifier->notify( DIALOG_SIZE_CHANGED, 0 ); } -//***************************************************************************** - //----------------------------------------------------------------------------- Control* SvtFileDialog::getControl( sal_Int16 _nControlId, sal_Bool _bLabelControl ) const { @@ -2989,7 +2928,7 @@ void SvtFileDialog::AddControls_Impl( ) // we need to disable the auto width feature of the filter box _pImp->DisableFilterBoxAutoWidth(); - // "Vorschau" + // "preview" _pCbPreviewBox = new CheckBox( this ); _pCbPreviewBox->SetText( SvtResId( STR_SVT_FILEPICKER_SHOW_PREVIEW ) ); _pCbPreviewBox->SetHelpId( HID_FILEDLG_PREVIEW_CB ); @@ -2997,7 +2936,7 @@ void SvtFileDialog::AddControls_Impl( ) ReleaseOwnerShip( _pCbPreviewBox ); _pCbPreviewBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); - // Preview-Fenster erst hier erzeugen + // generate preview window just here _pPrevWin = new Window( this, WinBits( WB_BORDER ) ); AddControl( _pPrevWin ); ReleaseOwnerShip( _pPrevWin ); @@ -3006,13 +2945,14 @@ void SvtFileDialog::AddControls_Impl( ) _pPrevBmp = new FixedBitmap( this, WinBits( WB_BORDER ) ); _pPrevBmp->SetBackground( Wallpaper( Color( COL_WHITE ) ) ); _pPrevBmp->Show(); + _pPrevBmp->SetAccessibleName(SvtResId(STR_PREVIEW)); } if ( _nExtraBits & SFX_EXTRA_AUTOEXTENSION ) { _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 ) ); @@ -3064,7 +3004,6 @@ void SvtFileDialog::AddControls_Impl( ) // This is strange. During the re-factoring during 96930, I discovered that this help id // is set in the "Templates mode". This was hidden in the previous implementation. // Shouldn't this be a more meaningfull help id. - // 96930 - 15.08.2002 - fs@openoffice.org } else if ( _nExtraBits & SFX_EXTRA_IMAGE_TEMPLATE ) { @@ -3142,15 +3081,6 @@ sal_Bool SvtFileDialog::setShowState( sal_Bool /*bShowState*/ ) // of the file dialog dynamically // support for set/getShowState is opionally // see com::sun::star::ui::dialogs::XFilePreview - /* - if ( _pPrevBmp ) - { - _pPrevBmp->Show( bShowState ); - return sal_True; - } - else - return sal_False; - */ return sal_False; } @@ -3194,9 +3124,9 @@ sal_Bool SvtFileDialog::getShowState() void SvtFileDialog::ReleaseOwnerShip( Window* pUserControl ) /* - [Beschreibung] - Die Methode sorgt dafuer das das spezifizierte Element nicht mehr im Besitz - der Instanz ist. + [Description] + This method ensures that the specified element is no longer in possession + of the instance. */ { @@ -3205,7 +3135,7 @@ void SvtFileDialog::ReleaseOwnerShip( Window* pUserControl ) { if ( pElement->_pControl == pUserControl ) { - pElement->_bHasOwnerShip = FALSE; + pElement->_bHasOwnerShip = sal_False; break; } pElement = pElement->_pNext; @@ -3214,14 +3144,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; } @@ -3239,8 +3169,8 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) long nTextWidth = pControl->GetTextWidth( pControl->GetText() ); aSize.Width() = nTextWidth + WIDTH_ADDITION; - // PushButton: Mindestbreite 50 logische Einheiten, - // H"ohe immer 14 logische Einheiten + // PushButton: Minimum width 50 logical units, + // height always 14 logical units. if ( aDefSiz.Width() > aSize.Width() ) aSize.Width() = aDefSiz.Width(); aSize.Height() = aDefSiz.Height(); @@ -3263,7 +3193,7 @@ BOOL SvtFileDialog::AddControl( Window* pControl, BOOL bNewLine ) } Point aNewControlPos; Size* pNewDlgSize = NULL; - BOOL bNewRow = bNewLine; + sal_Bool bNewRow = bNewLine; if ( nType == WINDOW_WINDOW ) { @@ -3290,12 +3220,12 @@ 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; + bNewRow = sal_True; } // Check if a new row has to be created. @@ -3335,7 +3265,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 ) @@ -3383,14 +3313,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; @@ -3407,8 +3337,6 @@ void SvtFileDialog::appendDefaultExtension(String& _rFileName, } } -// ----------------------------------------------------------------------- - // QueryFolderNameDialog ------------------------------------------------------- namespace svtools { @@ -3457,12 +3385,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 f28cb90925..b971773f12 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 @@ -71,6 +70,7 @@ #define STR_PATHSELECT 5 #define STR_BUTTONSELECT 6 #define STR_ACTUALVERSION 7 +#define STR_PREVIEW 8 // DLG_SVT_QUERYFOLDERNAME ----------------------- @@ -86,22 +86,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 0bc19f0196..3b92330acd 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -66,10 +66,10 @@ class SvtFileDialogFilter_Impl; #define SFXWB_READONLY WB_READONLY #define SFXWB_PATHDIALOG WB_PATH #define SFXWB_CLASSPATH ( 0x08000000L | SFXWB_PATHDIALOG ) -#define SFXWB_SHOWALLFOLDER 0x10000000L // alle Ordner auch Mail/News/... -#define SFXWB_MULTISELECTION 0x20000000L // Multiselection an +#define SFXWB_SHOWALLFOLDER 0x10000000L // all directories including Mail/News/... +#define SFXWB_MULTISELECTION 0x20000000L // activate Multiselection #define SFXWB_NOREMOTE 0x40000000L -#define SFXWB_SHOWVERSIONS 0x80000000L // Versionsauswahl anzeigen +#define SFXWB_SHOWVERSIONS 0x80000000L // show version selection #define SFX_EXTRA_AUTOEXTENSION 0x00000001L #define SFX_EXTRA_FILTEROPTIONS 0x00000002L @@ -107,7 +107,7 @@ private: ::svt::IFilePickerListener* _pFileNotifier; SvtExpFileDlg_Impl* _pImp; WinBits _nExtraBits; - BOOL _bIsInExecute : 1; + sal_Bool _bIsInExecute : 1; ImageList m_aImages; ::svt::SmartContent m_aContent; @@ -159,15 +159,15 @@ private: DECL_LINK( ClickHdl_Impl, CheckBox* ); DECL_LINK( PlayButtonHdl_Impl, PushButton* ); - // entfernt einen Filter mit Wildcards aus dem Path und gibt in zurueck - BOOL IsolateFilterFromPath_Impl( String& rPath, String& rFilter ); + // removes a filter with wildcards from the path and returns it + 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; @@ -188,14 +188,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: @@ -214,7 +214,7 @@ public: const ::com::sun::star::uno::Sequence< ::rtl::OUString >& GetBlackList() const; void SetStandardDir( const String& rStdDir ); const String& GetStandardDir() const; - SvStringsDtor* GetPathList() const; // bei MultiSelektion + SvStringsDtor* GetPathList() const; // for MultiSelection void AddFilter( const String& rFilter, const String& rType ); @@ -225,8 +225,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 ); @@ -239,7 +239,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; } @@ -264,7 +264,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 ); diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index 413f91c5c8..4a3c2f6736 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -53,13 +53,6 @@ ImageList RID_FILEPICKER_IMAGES FILEPICKER_IL_IDLIST }; -ImageList RID_FILEPICKER_IMAGES_HC -{ - Prefix = "fph"; - MASKCOLOR - FILEPICKER_IL_IDLIST -}; - // dialogs ******************************************************************* ModalDialog DLG_SVT_EXPLORERFILE @@ -79,12 +72,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 @@ -97,22 +92,10 @@ ModalDialog DLG_SVT_EXPLORERFILE }; QuickHelpText [ en-US ] = "List"; }; - ImageButton BTN_EXPLORERFILE_DETAILSVIEW - { - TabStop = FALSE ; - Pos = MAP_APPFONT ( 109 , 6 ) ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc06356.bmp" ; - }; - MASKCOLOR - }; - QuickHelpText [ en-US ] = "Details"; - }; + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_DETAILSVIEW"; 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 +103,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 +123,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 +137,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 +152,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 +162,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 ; @@ -238,11 +230,16 @@ ModalDialog DLG_SVT_EXPLORERFILE { Text [ en-US ] = "Current version"; }; + String STR_PREVIEW + { + Text [ en-US ] = "File Preview"; + }; }; // QueryFolderNameDialog ---------------------------------------------------------- ModalDialog DLG_SVT_QUERYFOLDERNAME { + HelpID = "fpicker:ModalDialog:DLG_SVT_QUERYFOLDERNAME"; Border = TRUE ; Moveable = TRUE ; OutputSize = TRUE ; @@ -257,6 +254,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 ; @@ -301,7 +299,7 @@ String STR_FILTERNAME_ALL String STR_SVT_ALREADYEXISTOVERWRITE { - Text [ en-US ] = "The file already exists. Overwrite?" ; + Text [ en-US ] = "A file named \"$filename$\" already exists.\n\nDo you want to replace it?" ; }; String STR_SVT_NEW_FOLDER diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 6b630af9e3..67dd4976ef 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -82,7 +82,7 @@ static inline String GetViewOptUserItem( const SvtViewOptions& rOpt ) } -// defines f"ur den Style der BrowseBox +// defines for the style of the BrowseBox #define STYLE_MULTI_SELECTION \ CNTVIEWSTYLE_NODE_BUTTONS | \ @@ -121,7 +121,7 @@ namespace struct SvtSimpleResId : public ResId { - SvtSimpleResId (USHORT nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} + SvtSimpleResId (sal_uInt16 nId) : ResId (nId, *ResMgrHolder::getOrCreate()) {} }; } @@ -219,15 +219,14 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu ) delete _pURLs; _pURLs = new SvStringsDtor; - // "Ubergeordnete Ebenen bestimmen. + // determine parent levels INetURLObject aObject( pBox->GetViewURL() ); sal_Int32 nCount = aObject.getSegmentCount(); ::svtools::VolumeInfo aVolInfo( sal_True /* volume */, sal_False /* remote */, sal_False /* removable */, sal_False /* floppy */, sal_False /* compact disk */ ); - sal_Bool bIsHighContrast = pBox->GetSettings().GetStyleSettings().GetHighContrastMode(); - Image aVolumeImage( SvFileInformationManager::GetFolderImage( aVolInfo, bIsHighContrast ) ); + Image aVolumeImage( SvFileInformationManager::GetFolderImage( aVolInfo ) ); while ( nCount >= 1 ) { @@ -242,8 +241,7 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu ) aTitle = aObject.getName(); Image aImage = ( nCount > 1 ) // if nCount == 1 means workplace, which detects the wrong image - ? SvFileInformationManager::GetImage( aObject, bIsHighContrast ) - : aVolumeImage; + ? SvFileInformationManager::GetImage( aObject ) : aVolumeImage; _pMenu->InsertItem( nItemId++, aTitle, aImage ); _pURLs->Insert( pParentURL, _pURLs->Count() ); @@ -314,9 +312,7 @@ void SvtTravelButton_Impl::FillURLMenu( PopupMenu* _pMenu ) _pMenu->Clear(); - sal_Bool bIsHighContrast = GetDialogParent()->GetView()->GetSettings().GetStyleSettings().GetHighContrastMode(); - - USHORT nItemId = 1; + sal_uInt16 nItemId = 1; String sDisplayName; ::std::vector< String >::const_iterator aLoop; @@ -324,8 +320,7 @@ void SvtTravelButton_Impl::FillURLMenu( PopupMenu* _pMenu ) { if ( GetDialogParent()->isUrlAllowed( *aLoop ) ) { - Image aImage = SvFileInformationManager::GetImage( - INetURLObject(*aLoop), bIsHighContrast ); + Image aImage = SvFileInformationManager::GetImage( INetURLObject(*aLoop) ); if ( LocalFileHelper::ConvertURLToSystemPath(*aLoop, sDisplayName) ) _pMenu->InsertItem( nItemId, sDisplayName, aImage ); else @@ -472,7 +467,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 ) ) ); } @@ -484,7 +479,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 87a6276b11..e4a5d72d7b 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -58,9 +58,9 @@ class SvUShorts; // SvtFileDialogFilter_Impl //***************************************************************************** -/* [Beschreibung] +/* [Description] - Instanzen dieser Klasse repr"asentieren einen Filter + Instances of this class represent a filter. */ class SvtFileDialogFilter_Impl @@ -231,21 +231,21 @@ public: String _aStdDir; - // beim traveln der Filterbox erst Zeitversetzt filtern + // delay filter when traveling the filterbox Timer _aFilterTimer; - // Zeigt der OpenHdl_Imp(), ob das Open durch einen Doppelclick ausgel"ost wurde + // shows OpenHdl_Imp() if the open was triggered by a double click sal_Bool _bDoubleClick; sal_Bool m_bNeedDelayedFilterExecute; - // Liste mit den 5 zuletzt genutzten Filtern - // Defaultfilter fuer <Alle> oder <Alle ...> + // list of the 5 most recently used filters + // Defaultfilter for <All> oder <All ...> const SvtFileDialogFilter_Impl* _pDefaultFilter; - // Multiselektion? + // MultiSelection? sal_Bool _bMultiSelection; - // Fixgr"ossen f"ur Resize merken + // remember fixsizes for resize long _nFixDeltaHeight; Size _a6Size; Size _aDlgSize; @@ -261,7 +261,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 adc3c30f9a..7481fd867c 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 1a5708890a..2f63a948e2 100644 --- a/fpicker/source/unx/gnome/FPentry.cxx +++ b/fpicker/source/unx/gnome/FPentry.cxx @@ -39,11 +39,9 @@ // includes of other projects //---------------------------------------------- #include <cppuhelper/factory.hxx> -#include <com/sun/star/container/XSet.hpp> #include <osl/diagnose.h> #include "SalGtkFilePicker.hxx" #include "SalGtkFolderPicker.hxx" -#include <vcl/svapp.hxx> #include "FPServiceInfo.hxx" #include <glib-object.h> @@ -57,11 +55,9 @@ extern const guint gtk_minor_version; using namespace ::rtl; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; using namespace ::cppu; -using ::com::sun::star::ui::dialogs::XFilePicker; using ::com::sun::star::ui::dialogs::XFilePicker2; using ::com::sun::star::ui::dialogs::XFolderPicker; @@ -106,32 +102,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*/ ) { @@ -153,7 +123,7 @@ void* SAL_CALL component_getFactory( { Sequence< OUString > aSNS( 1 ); aSNS.getArray( )[0] = - OUString::createFromAscii(FILE_PICKER_SERVICE_NAME); + OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_SERVICE_NAME)); xFactory = createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), @@ -165,7 +135,7 @@ void* SAL_CALL component_getFactory( { Sequence< OUString > aSNS( 1 ); aSNS.getArray( )[0] = - OUString::createFromAscii(FOLDER_PICKER_SERVICE_NAME); + OUString(RTL_CONSTASCII_USTRINGPARAM(FOLDER_PICKER_SERVICE_NAME)); xFactory = createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index 6a8579898a..3eccc609e6 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -38,13 +38,10 @@ //------------------------------------------------------------------------ // includes //------------------------------------------------------------------------ -#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.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> @@ -52,16 +49,15 @@ #include <com/sun/star/uno/Any.hxx> #include <FPServiceInfo.hxx> #include <osl/mutex.hxx> -#include <vcl/svapp.hxx> #include <SalGtkFilePicker.hxx> +#include <tools/string.hxx> #include <tools/urlobj.hxx> -#include <iostream> #include <algorithm> #include <set> +#include <string.h> #include "resourceprovider.hxx" -#include <tools/rc.hxx> //------------------------------------------------------------------------ // namespace directives @@ -89,9 +85,9 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(3); - aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" ); - aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFilePicker" ); - aRet[2] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFilePicker" ); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" )); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFilePicker" )); + aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.GtkFilePicker" )); return aRet; } } @@ -110,7 +106,7 @@ static void expandexpanders(GtkContainer *pWidget) 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); } @@ -196,17 +192,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 ); @@ -236,12 +232,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); @@ -266,18 +262,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), @@ -295,11 +291,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; } @@ -316,8 +312,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); } @@ -406,52 +402,6 @@ void SAL_CALL SalGtkFilePicker::controlStateChanged( FilePickerEvent aEvent ) if (m_xListener.is()) m_xListener->controlStateChanged( aEvent ); } -//----------------------------------------------------------------------------------------- -// If there are more then one listener the return value of the last one wins -//----------------------------------------------------------------------------------------- - -rtl::OUString SAL_CALL SalGtkFilePicker::helpRequested( FilePickerEvent aEvent ) const -{ - rtl::OUString aHelpText; - - ::cppu::OInterfaceContainerHelper* pICHelper = - rBHelper.getContainer( getCppuType( ( uno::Reference<XFilePickerListener> * )0 ) ); - - if( pICHelper ) - { - ::cppu::OInterfaceIteratorHelper iter( *pICHelper ); - - while( iter.hasMoreElements() ) - { - try - { - /* - if there are multiple listeners responding - to this notification the next response - overwrittes the one before if it is not empty - */ - - rtl::OUString aTempString; - - uno::Reference<XFilePickerListener> xFPListener( iter.next(), uno::UNO_QUERY ); - if( xFPListener.is() ) - { - aTempString = xFPListener->helpRequested( aEvent ); - if( aTempString.getLength() ) - aHelpText = aTempString; - } - - } - catch( uno::RuntimeException& ) - { - OSL_ENSURE( false, "RuntimeException during event dispatching" ); - } - } - } - - return aHelpText; -} - //===================================================================== struct FilterEntry @@ -539,7 +489,7 @@ shrinkFilterName( const rtl::OUString &rFilterName, bool bAllowNoStar = false ) int i; int nBracketLen = -1; int nBracketEnd = -1; - const sal_Unicode *pStr = rFilterName; + const sal_Unicode *pStr = rFilterName.getStr(); OUString aRealName = rFilterName; for( i = aRealName.getLength() - 1; i > 0; i-- ) @@ -907,7 +857,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw if( sExtension.getLength() >= 3 ) // 3 = typical/minimum extension length { - static const OUString aStarDot = OUString::createFromAscii( "*." ); + static const OUString aStarDot(RTL_CONSTASCII_USTRINGPARAM( "*." )); ::rtl::OUString aNewFilter; ::rtl::OUString aOldFilter = getCurrentFilter(); @@ -974,10 +924,10 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw } while( nTokenIndex >= 0 ); - if( !bExtensionTypedIn && ( !sToken.equalsAscii( "*" ) ) ) + if( !bExtensionTypedIn && ( !sToken.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*")) ) ) { //if the filename does not already have the auto extension, stick it on - OUString sExtension = OUString::createFromAscii( "." ) + sToken; + OUString sExtension = OUString(RTL_CONSTASCII_USTRINGPARAM( "." )) + sToken; OUString &rBase = aSelectedFiles[nIndex]; sal_Int32 nExtensionIdx = rBase.getLength() - sExtension.getLength(); OSL_TRACE( "idx are %d %d\n", rBase.lastIndexOf( sExtension ), nExtensionIdx ); @@ -1028,9 +978,12 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) int btn = GTK_RESPONSE_NO; uno::Reference< awt::XExtendedToolkit > xToolkit( - m_xServiceMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY); + m_xServiceMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ), uno::UNO_QUERY); + + uno::Reference< frame::XDesktop > xDesktop( + m_xServiceMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), uno::UNO_QUERY); - RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit); + RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop); uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog); while( GTK_RESPONSE_NO == btn ) { @@ -1050,20 +1003,47 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) { CResourceProvider aResProvider; GtkWidget *dlg; - - dlg = gtk_message_dialog_new( NULL, + + + INetURLObject aFileObj( sFileName ); + + OString baseName( + OUStringToOString( + aFileObj.getName( + INetURLObject::LAST_SEGMENT, + true, + INetURLObject::DECODE_WITH_CHARSET + ), + RTL_TEXTENCODING_UTF8 + ) + ); + OString aMsg( + OUStringToOString( + aResProvider.getResString( FILE_PICKER_OVERWRITE ), + RTL_TEXTENCODING_UTF8 + ) + ); + OString toReplace( RTL_CONSTASCII_STRINGPARAM( "$filename$" )); + + aMsg = aMsg.replaceAt( + aMsg.indexOf( toReplace ), + toReplace.getLength(), + baseName + ); + + dlg = gtk_message_dialog_new( NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, - OUStringToOString( - aResProvider.getResString( FILE_PICKER_OVERWRITE ), - RTL_TEXTENCODING_UTF8 ).getStr() ); + "%s", + aMsg.getStr() + ); gtk_window_set_title( GTK_WINDOW( dlg ), OUStringToOString(aResProvider.getResString(FILE_PICKER_TITLE_SAVE ), RTL_TEXTENCODING_UTF8 ).getStr() ); - RunDialog* pAnotherDialog = new RunDialog(dlg, xToolkit); + RunDialog* pAnotherDialog = new RunDialog(dlg, xToolkit, xDesktop); uno::Reference < awt::XTopWindowListener > xAnotherLifeCycle(pAnotherDialog); btn = pAnotherDialog->run(); @@ -1380,12 +1360,12 @@ throw( uno::RuntimeException ) 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 @@ -1424,7 +1404,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"); } @@ -1459,7 +1439,7 @@ uno::Sequence<sal_Int16> SAL_CALL SalGtkFilePicker::getSupportedImageFormats() t OSL_ASSERT( m_pDialog != NULL ); // TODO return m_pImpl->getSupportedImageFormats(); - return 0; + return uno::Sequence<sal_Int16>(); } sal_Int32 SAL_CALL SalGtkFilePicker::getTargetColorDepth() throw( uno::RuntimeException ) @@ -1505,7 +1485,7 @@ void SalGtkFilePicker::implChangeType( GtkTreeSelection *selection ) { gchar *title; gtk_tree_model_get (model, &iter, 2, &title, -1); - aLabel += rtl::OUString::createFromAscii( ": " ); + aLabel += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ": " )); aLabel += rtl::OUString( title, strlen(title), RTL_TEXTENCODING_UTF8 ); g_free (title); } @@ -1562,7 +1542,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 ); @@ -1640,7 +1620,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu uno::Any aAny; if( 0 == aArguments.getLength() ) throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "no arguments" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )), static_cast<XFilePicker2*>( this ), 1 ); aAny = aArguments[0]; @@ -1648,7 +1628,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu if( ( aAny.getValueType() != ::getCppuType( ( sal_Int16* )0 ) ) && (aAny.getValueType() != ::getCppuType( ( sal_Int8* )0 ) ) ) throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "invalid argument type" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )), static_cast<XFilePicker2*>( this ), 1 ); sal_Int16 templateId = -1; @@ -1736,7 +1716,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu break; default: throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "Unknown template" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )), static_cast< XFilePicker2* >( this ), 1 ); } @@ -1815,7 +1795,7 @@ void SAL_CALL SalGtkFilePicker::cancel() throw( uno::RuntimeException ) rtl::OUString SAL_CALL SalGtkFilePicker::getImplementationName() throw( uno::RuntimeException ) { - return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME )); } // ------------------------------------------------- @@ -1879,24 +1859,24 @@ 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 +#if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "'%s' match extn '%s' vs '%s' yeilds %d\n", filter_info->uri, pExtn, pFilter, bRetval ); #endif @@ -1913,9 +1893,9 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O OUString aShrunkName = shrinkFilterName( rFilter ); OString aFilterName = rtl::OUStringToOString( aShrunkName, RTL_TEXTENCODING_UTF8 ); - gtk_file_filter_set_name( filter, aFilterName ); + gtk_file_filter_set_name( filter, aFilterName.getStr() ); - static const OUString aStarDot = OUString::createFromAscii( "*." ); + static const OUString aStarDot(RTL_CONSTASCII_USTRINGPARAM( "*." )); OUString aTokens; bool bAllGlob = !rType.compareToAscii( "*.*" ) || !rType.compareToAscii( "*" ); @@ -1933,16 +1913,16 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O if (aToken.getLength()) { if (aTokens.getLength()) - aTokens += OUString::createFromAscii(","); + aTokens += OUString(RTL_CONSTASCII_USTRINGPARAM(",")); aTokens = aTokens += aToken; gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_URI, case_insensitive_filter, - g_strdup( rtl::OUStringToOString( aToken, RTL_TEXTENCODING_UTF8 ) ), + g_strdup( rtl::OUStringToOString(aToken, RTL_TEXTENCODING_UTF8).getStr() ), (GDestroyNotify) g_free ); OSL_TRACE( "fustering with %s\n", rtl::OUStringToOString( aToken, RTL_TEXTENCODING_UTF8 ).getStr()); } -#ifdef DEBUG +#if OSL_DEBUG_LEVEL > 0 else { g_warning( "Duff filter token '%s'\n", diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.hxx b/fpicker/source/unx/gnome/SalGtkFilePicker.hxx index 5c52d9aaad..2ad10d4131 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.hxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.hxx @@ -58,8 +58,8 @@ // forward declarations //---------------------------------------------------------- -using namespace rtl; - +using ::rtl::OUString; +using ::rtl::OString; struct FilterEntry; struct ElementEntry_Impl; @@ -243,7 +243,6 @@ class SalGtkFilePicker : void SAL_CALL fileSelectionChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ); void SAL_CALL directoryChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ); - rtl::OUString SAL_CALL helpRequested( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ) const; void SAL_CALL controlStateChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ); private: diff --git a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx index caeb1e8c36..033faa4238 100644 --- a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx @@ -38,26 +38,19 @@ //------------------------------------------------------------------------ // includes //------------------------------------------------------------------------ -#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XMultiServiceFactory.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 <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <com/sun/star/uno/Any.hxx> #include <FPServiceInfo.hxx> #include <osl/mutex.hxx> -#include <vcl/svapp.hxx> #include "SalGtkFolderPicker.hxx" - -#include <tools/urlobj.hxx> - -#include <iostream> #include "resourceprovider.hxx" -#include <tools/rc.hxx> + +#include <string.h> //------------------------------------------------------------------------ // namespace directives @@ -79,8 +72,8 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FolderPicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(2); - aRet[0] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.SystemFolderPicker" ); - aRet[1] = rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.GtkFolderPicker" ); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.SystemFolderPicker" )); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.GtkFolderPicker" )); return aRet; } } @@ -102,8 +95,8 @@ SalGtkFolderPicker::SalGtkFolderPicker( const uno::Reference<lang::XMultiService 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 ); } // ------------------------------------------------- @@ -182,9 +175,12 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException ) sal_Int16 retVal = 0; uno::Reference< awt::XExtendedToolkit > xToolkit( - m_xServiceMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY); + m_xServiceMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")) ), uno::UNO_QUERY); + + uno::Reference< frame::XDesktop > xDesktop( + m_xServiceMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), uno::UNO_QUERY); - RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit); + RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop); uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog); gint nStatus = pRunDialog->run(); switch( nStatus ) @@ -221,7 +217,7 @@ void SAL_CALL SalGtkFolderPicker::cancel() throw( uno::RuntimeException ) rtl::OUString SAL_CALL SalGtkFolderPicker::getImplementationName() throw( uno::RuntimeException ) { - return rtl::OUString::createFromAscii( FOLDER_PICKER_IMPL_NAME ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_IMPL_NAME )); } // ------------------------------------------------- diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx index ceea7444ce..9bdad500c4 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx @@ -130,9 +130,10 @@ extern "C" extern GdkDisplay* gdk_x11_lookup_xdisplay (void*xdisplay); } -RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit >& rToolkit ) : - cppu::WeakComponentImplHelper1< awt::XTopWindowListener >( maLock ), - mpDialog(pDialog), mpCreatedParent(NULL), mxToolkit(rToolkit) +RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit >& rToolkit, + uno::Reference< frame::XDesktop >& rDesktop ) : + cppu::WeakComponentImplHelper2< awt::XTopWindowListener, frame::XTerminateListener >( maLock ), + mpDialog(pDialog), mpCreatedParent(NULL), mxToolkit(rToolkit), mxDesktop(rDesktop) { awt::SystemDependentXWindow aWindowHandle; @@ -186,6 +187,18 @@ void SAL_CALL RunDialog::windowOpened( const ::com::sun::star::lang::EventObject g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, (GSourceFunc)canceldialog, this, NULL); } +void SAL_CALL RunDialog::queryTermination( const ::com::sun::star::lang::EventObject& ) + throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException) +{ +} + +void SAL_CALL RunDialog::notifyTermination( 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; @@ -221,19 +234,19 @@ static void lcl_setGTKLanguage(const uno::Reference<lang::XMultiServiceFactory>& { uno::Reference<lang::XMultiServiceFactory> xConfigMgr = uno::Reference<lang::XMultiServiceFactory>(xServiceMgr->createInstance( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))), UNO_QUERY_THROW ); Sequence< Any > theArgs(1); - theArgs[ 0 ] <<= OUString::createFromAscii("org.openoffice.Office.Linguistic/General"); + theArgs[ 0 ] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Linguistic/General")); uno::Reference< container::XNameAccess > xNameAccess = uno::Reference< container::XNameAccess >(xConfigMgr->createInstanceWithArguments( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"), theArgs ), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), theArgs ), UNO_QUERY_THROW ); if (xNameAccess.is()) - xNameAccess->getByName(OUString::createFromAscii("UILocale")) >>= sUILocale; + xNameAccess->getByName(OUString(RTL_CONSTASCII_USTRINGPARAM("UILocale"))) >>= sUILocale; } catch (...) {} if (sUILocale.getLength()) diff --git a/fpicker/source/unx/gnome/SalGtkPicker.hxx b/fpicker/source/unx/gnome/SalGtkPicker.hxx index 889790dae7..52fe5a060a 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.hxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.hxx @@ -34,7 +34,7 @@ //_____________________________________________________________________________ #include <osl/mutex.hxx> -#include <cppuhelper/compbase1.hxx> +#include <cppuhelper/compbase2.hxx> #include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilePicker2.hpp> #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> @@ -43,6 +43,8 @@ #include <com/sun/star/awt/XTopWindowListener.hpp> #include <com/sun/star/awt/XExtendedToolkit.hpp> +#include <com/sun/star/frame/XDesktop.hpp> +#include <com/sun/star/frame/XTerminateListener.hpp> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> @@ -85,13 +87,16 @@ public: //to happen while we're opened waiting for user input, e.g. //https://bugzilla.redhat.com/show_bug.cgi?id=441108 class RunDialog : - public cppu::WeakComponentImplHelper1< ::com::sun::star::awt::XTopWindowListener > + public cppu::WeakComponentImplHelper2< + ::com::sun::star::awt::XTopWindowListener, + ::com::sun::star::frame::XTerminateListener > { private: osl::Mutex maLock; GtkWidget *mpDialog; GdkWindow *mpCreatedParent; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit> mxToolkit; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop > mxDesktop; public: // XTopWindowListener @@ -112,8 +117,17 @@ public: throw (::com::sun::star::uno::RuntimeException) {} virtual void SAL_CALL windowDeactivated( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException) {} + + // XTerminateListener + virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) + throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) + throw(::com::sun::star::uno::RuntimeException); public: - RunDialog(GtkWidget *pDialog, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit > &rToolkit); + RunDialog(GtkWidget *pDialog, + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit > &rToolkit, + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDesktop > &rDesktop + ); gint run(); void cancel(); ~RunDialog(); 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 4a84215dc9..0000000000 --- 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 0000000000..72bca42f8a --- /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 04c6e650ff..82b2413dd4 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 86daf325d6..0f86159530 100644 --- a/fpicker/source/unx/gnome/resourceprovider.cxx +++ b/fpicker/source/unx/gnome/resourceprovider.cxx @@ -94,8 +94,8 @@ _Entry OtherCtrlIdToResIdTable[] = { }; -const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry ); -const sal_Int32 OTHER_SIZE_TABLE = sizeof( OtherCtrlIdToResIdTable ) / sizeof( _Entry ); +const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable ); +const sal_Int32 OTHER_SIZE_TABLE = SAL_N_ELEMENTS( OtherCtrlIdToResIdTable ); //------------------------------------------------------------ // diff --git a/fpicker/source/unx/kde/kdecommandthread.cxx b/fpicker/source/unx/kde/kdecommandthread.cxx index 3e7df60a47..b68ddb0030 100644 --- a/fpicker/source/unx/kde/kdecommandthread.cxx +++ b/fpicker/source/unx/kde/kdecommandthread.cxx @@ -26,13 +26,17 @@ * ************************************************************************/ +#include <cstddef> + #include <kdecommandthread.hxx> #include <qstringlist.h> #include <kapplication.h> +#if OSL_DEBUG_LEVEL > 1 #include <iostream> +#endif ////////////////////////////////////////////////////////////////////////// // CommandEvent @@ -103,7 +107,7 @@ void KDECommandThread::handleCommand( const QString &rString, bool &bQuit ) { QMutexLocker qMutexLocker( &m_aMutex ); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 1 ::std::cerr << "kdefilepicker received: " << rString.latin1() << ::std::endl; #endif diff --git a/fpicker/source/unx/kde/kdefilepicker.cxx b/fpicker/source/unx/kde/kdefilepicker.cxx index 35e60d256d..779a34d894 100644 --- a/fpicker/source/unx/kde/kdefilepicker.cxx +++ b/fpicker/source/unx/kde/kdefilepicker.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <cstddef> + #include <kdecommandthread.hxx> #include <kdefilepicker.hxx> @@ -648,7 +650,7 @@ void KDEFileDialog::selectionChangedCommand() void KDEFileDialog::sendCommand( const QString &rCommand ) { -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 1 ::std::cerr << "kdefilepicker sent: " << rCommand.latin1() << ::std::endl; #endif diff --git a/fpicker/source/unx/kde/kdefilepicker.hxx b/fpicker/source/unx/kde/kdefilepicker.hxx index d0e0330f29..4d545ebc76 100644 --- a/fpicker/source/unx/kde/kdefilepicker.hxx +++ b/fpicker/source/unx/kde/kdefilepicker.hxx @@ -29,6 +29,8 @@ #ifndef _KDEFILEPICKER_HXX_ #define _KDEFILEPICKER_HXX_ +#include <cstddef> + #include <kfiledialog.h> #include <kfilefiltercombo.h> diff --git a/fpicker/source/unx/kde/kdefpmain.cxx b/fpicker/source/unx/kde/kdefpmain.cxx index 002eb80257..2300fe61a2 100644 --- a/fpicker/source/unx/kde/kdefpmain.cxx +++ b/fpicker/source/unx/kde/kdefpmain.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <cstddef> + #include <kdemodalityfilter.hxx> #include <kdefilepicker.hxx> #include <kdecommandthread.hxx> diff --git a/fpicker/source/unx/kde/kdemodalityfilter.cxx b/fpicker/source/unx/kde/kdemodalityfilter.cxx index 99fbf92b8e..5aeddb0a80 100644 --- a/fpicker/source/unx/kde/kdemodalityfilter.cxx +++ b/fpicker/source/unx/kde/kdemodalityfilter.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <cstddef> + #include <kdemodalityfilter.hxx> #include <kapplication.h> diff --git a/fpicker/source/unx/kde/makefile.mk b/fpicker/source/unx/kde/makefile.mk index b6a8a7ca7c..e1bc4db47d 100644 --- a/fpicker/source/unx/kde/makefile.mk +++ b/fpicker/source/unx/kde/makefile.mk @@ -31,8 +31,7 @@ PRJNAME=fpicker TARGET=kdefilepicker LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE -#COMP1TYPELIST=$(TARGET) -#COMPRDB=$(SOLARBINDIR)$/types.rdb +EXTERNAL_WARNINGS_NOT_ERRORS=TRUE # --- Settings ----------------------------------------------------- diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx index a51502c7ea..49bd760a00 100644 --- a/fpicker/source/unx/kde4/KDE4FPEntry.cxx +++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx @@ -56,27 +56,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; @@ -84,7 +63,7 @@ extern "C" if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) ) { Sequence< OUString > aSNS( 1 ); - aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ); + aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME )); Reference< XSingleServiceFactory > xFactory ( createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx index cef3d39221..e2f43fdea1 100644 --- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx +++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx @@ -99,9 +99,9 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(3); - aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker"); - aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker"); - aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDE4FilePicker"); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker")); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker")); + aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.KDE4FilePicker")); return aRet; } } @@ -198,8 +198,8 @@ sal_Int16 SAL_CALL KDE4FilePicker::execute() // (see the KDE VCL plug), then this won't happen, but otherwise // simply release the SolarMutex here. The KDE file dialog does not // call back to the core, so this should be safe (and if it does, - // SolarMutex will need to be re-acquired. - ULONG mutexrelease = 0; + // SolarMutex will need to be re-acquired). + long mutexrelease = 0; if( !qApp->clipboard()->property( "useEventLoopWhenWaiting" ).toBool()) mutexrelease = Application::ReleaseSolarMutex(); //block and wait for user input @@ -264,7 +264,7 @@ 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 @@ -339,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]; @@ -615,7 +615,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args ) if (args.getLength() == 0) { throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "no arguments" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )), static_cast< XFilePicker* >( this ), 1 ); } @@ -625,7 +625,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args ) ( arg.getValueType() != ::getCppuType((sal_Int8*)0))) { throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "invalid argument type" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )), static_cast< XFilePicker* >( this ), 1 ); } @@ -697,7 +697,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args ) default: throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "Unknown template" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )), static_cast< XFilePicker* >( this ), 1 ); } @@ -726,7 +726,7 @@ void SAL_CALL KDE4FilePicker::disposing( const lang::EventObject &rEvent ) rtl::OUString SAL_CALL KDE4FilePicker::getImplementationName() throw( uno::RuntimeException ) { - return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME )); } sal_Bool SAL_CALL KDE4FilePicker::supportsService( const rtl::OUString& ServiceName ) 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 8ecc4e0a0a..0000000000 --- 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 0000000000..d627212b75 --- /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 e245e66184..7ccf6df6a0 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/unx/kde_unx/UnxCommandThread.cxx b/fpicker/source/unx/kde_unx/UnxCommandThread.cxx index cc19ae3f62..3b113346eb 100644 --- a/fpicker/source/unx/kde_unx/UnxCommandThread.cxx +++ b/fpicker/source/unx/kde_unx/UnxCommandThread.cxx @@ -188,27 +188,27 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString & ::rtl::OUString aCommandName = aList.front(); aList.pop_front(); - if ( aCommandName.equalsAscii( "accept" ) ) + if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "accept" ) ) ) { m_aResult = sal_True; m_aExecCondition.set(); } - else if ( aCommandName.equalsAscii( "reject" ) ) + else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "reject" ) ) ) { m_aResult = sal_False; m_aExecCondition.set(); } - else if ( aCommandName.equalsAscii( "fileSelectionChanged" ) ) + else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "fileSelectionChanged" ) ) ) { if ( m_pNotifyThread ) m_pNotifyThread->fileSelectionChanged(); } - else if ( aCommandName.equalsAscii( "files" ) ) + else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "files" ) ) ) { m_aGetFiles = aList; m_aGetFilesCondition.set(); } - else if ( aCommandName.equalsAscii( "value" ) ) + else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "value" ) ) ) { ::rtl::OUString aType; if ( !aList.empty() ) @@ -217,14 +217,14 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString & aList.pop_front(); } - if ( aType.equalsAscii( "bool" ) ) + if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "bool" ) ) ) { sal_Bool bValue = !aList.empty() && aList.front().equalsIgnoreAsciiCaseAscii( "true" ); m_aGetValue <<= bValue; m_aGetValueCondition.set(); } - else if ( aType.equalsAscii( "int" ) ) + else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "int" ) ) ) { sal_Int32 nValue = 0; if ( !aList.empty() ) @@ -233,7 +233,7 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString & m_aGetValue <<= nValue; m_aGetValueCondition.set(); } - else if ( aType.equalsAscii( "string" ) ) + else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "string" ) ) ) { ::rtl::OUString aValue; if ( !aList.empty() ) @@ -242,7 +242,7 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString & m_aGetValue <<= aValue; m_aGetValueCondition.set(); } - else if ( aType.equalsAscii( "stringList" ) ) + else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "stringList" ) ) ) { uno::Sequence< ::rtl::OUString > aSequence( aList.size() ); sal_Int32 nIdx = 0; @@ -258,12 +258,12 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString & m_aGetValueCondition.set(); } } - else if ( aCommandName.equalsAscii( "currentFilter" ) ) + else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "currentFilter" ) ) ) { m_aGetCurrentFilter = aList.empty()? ::rtl::OUString(): aList.front(); m_aGetCurrentFilterCondition.set(); } - else if ( aCommandName.equalsAscii( "currentDirectory" ) ) + else if ( aCommandName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "currentDirectory" ) ) ) { m_aGetDirectory = aList.empty()? ::rtl::OUString(): aList.front(); m_aGetDirectoryCondition.set(); diff --git a/fpicker/source/unx/kde_unx/UnxFPentry.cxx b/fpicker/source/unx/kde_unx/UnxFPentry.cxx index ac011348ea..9a87432928 100644 --- a/fpicker/source/unx/kde_unx/UnxFPentry.cxx +++ b/fpicker/source/unx/kde_unx/UnxFPentry.cxx @@ -64,7 +64,7 @@ extern "C" // component_getImplementationEnvironment ////////////////////////////////////////////////////////////////////////// -void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) +void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } @@ -73,7 +73,7 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTyp // ////////////////////////////////////////////////////////////////////////// -sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey ) +sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) { sal_Bool bRetVal = sal_True; @@ -82,11 +82,11 @@ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey try { Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); + pXNewKey->createKey( OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_REGKEY_NAME ) )); } catch( InvalidRegistryException& ) { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); + OSL_FAIL( "InvalidRegistryException caught" ); bRetVal = sal_False; } } @@ -98,14 +98,14 @@ sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey // ////////////////////////////////////////////////////////////////////////// -void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey ) +void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { void* pRet = 0; if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) ) { Sequence< OUString > aSNS( 1 ); - aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ); + aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME )); Reference< XSingleServiceFactory > xFactory ( createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), diff --git a/fpicker/source/unx/kde_unx/UnxFilePicker.cxx b/fpicker/source/unx/kde_unx/UnxFilePicker.cxx index c38ffcedb7..c2756ee716 100644 --- a/fpicker/source/unx/kde_unx/UnxFilePicker.cxx +++ b/fpicker/source/unx/kde_unx/UnxFilePicker.cxx @@ -79,9 +79,9 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(3); - aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker"); - aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker"); - aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDEFilePicker"); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker")); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker")); + aRet[2] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.KDEFilePicker")); return aRet; } } @@ -115,7 +115,7 @@ UnxFilePicker::~UnxFilePicker() { if ( m_nFilePickerPid > 0 ) { - sendCommand( ::rtl::OUString::createFromAscii( "exit" ) ); + sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "exit" )) ); waitpid( m_nFilePickerPid, NULL, 0 ); } @@ -184,7 +184,7 @@ sal_Int16 SAL_CALL UnxFilePicker::execute() // this is _not_ an osl::Condition, see i#93366 m_pCommandThread->execCondition().reset(); - sendCommand( ::rtl::OUString::createFromAscii( "exec" ) ); + sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "exec" ) )); m_pCommandThread->execCondition().wait(); @@ -198,8 +198,8 @@ void SAL_CALL UnxFilePicker::setMultiSelectionMode( sal_Bool bMode ) ::osl::MutexGuard aGuard( m_aMutex ); ::rtl::OUString aString = bMode? - ::rtl::OUString::createFromAscii( "setMultiSelection true" ): - ::rtl::OUString::createFromAscii( "setMultiSelection false" ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "setMultiSelection true" )): + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "setMultiSelection false" )); sendCommand( aString ); } @@ -238,7 +238,7 @@ rtl::OUString SAL_CALL UnxFilePicker::getDisplayDirectory() checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - sendCommand( ::rtl::OUString::createFromAscii( "getDirectory" ), + sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "getDirectory" )), m_pCommandThread->getDirectoryCondition() ); return m_pCommandThread->getDirectory(); @@ -250,7 +250,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getFiles() checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - sendCommand( ::rtl::OUString::createFromAscii( "getFiles" ), + sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "getFiles" )), m_pCommandThread->getFilesCondition() ); return m_pCommandThread->getFiles(); @@ -292,7 +292,7 @@ rtl::OUString SAL_CALL UnxFilePicker::getCurrentFilter() checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - sendCommand( ::rtl::OUString::createFromAscii( "getCurrentFilter" ), + sendCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "getCurrentFilter" )), m_pCommandThread->getCurrentFilterCondition() ); return m_pCommandThread->getCurrentFilter(); @@ -341,7 +341,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA aBuffer.appendAscii( " ", 1 ); aBuffer.append( aAction ); - if ( aType.equalsAscii( "checkbox" ) ) + if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "checkbox" ) ) ) { sal_Bool bControlValue; if ( ( rValue >>= bControlValue ) && bControlValue ) @@ -349,7 +349,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA else aBuffer.appendAscii( " false" ); } - else if ( aType.equalsAscii( "listbox" ) ) + else if ( aType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "listbox" ) ) ) { switch ( nControlAction ) { @@ -545,21 +545,21 @@ void SAL_CALL UnxFilePicker::initialize( const uno::Sequence<uno::Any> &rArgumen uno::Any aAny; if ( 0 == rArguments.getLength( ) ) throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "no arguments" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )), static_cast< XFilePicker* >( this ), 1 ); aAny = rArguments[0]; if ( ( aAny.getValueType() != ::getCppuType( (sal_Int16*)0 ) ) && ( aAny.getValueType() != ::getCppuType( (sal_Int8*)0 ) ) ) throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "invalid argument type" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )), static_cast< XFilePicker* >( this ), 1 ); sal_Int16 templateId = -1; aAny >>= templateId; - ::rtl::OUString aTypeOpen = ::rtl::OUString::createFromAscii( "setType \"open\"" ); - ::rtl::OUString aTypeSaveAs = ::rtl::OUString::createFromAscii( "setType \"save\"" ); + ::rtl::OUString aTypeOpen(RTL_CONSTASCII_USTRINGPARAM( "setType \"open\"" )); + ::rtl::OUString aTypeSaveAs(RTL_CONSTASCII_USTRINGPARAM( "setType \"save\"" )); switch ( templateId ) { @@ -636,7 +636,7 @@ void SAL_CALL UnxFilePicker::initialize( const uno::Sequence<uno::Any> &rArgumen default: throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "Unknown template" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )), static_cast< XFilePicker* >( this ), 1 ); } @@ -664,7 +664,7 @@ void SAL_CALL UnxFilePicker::disposing( const lang::EventObject &rEvent ) rtl::OUString SAL_CALL UnxFilePicker::getImplementationName() throw( uno::RuntimeException ) { - return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME ); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_IMPL_NAME )); } sal_Bool SAL_CALL UnxFilePicker::supportsService( const rtl::OUString& ServiceName ) @@ -779,7 +779,7 @@ void UnxFilePicker::checkFilePicker() throw( ::com::sun::star::uno::RuntimeExcep else { throw uno::RuntimeException( - ::rtl::OUString::createFromAscii( "the external file picker does not run" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "the external file picker does not run" )), *this ); } } @@ -789,7 +789,7 @@ void UnxFilePicker::sendCommand( const ::rtl::OUString &rCommand ) if ( m_nFilePickerWrite < 0 ) return; - ::rtl::OString aUtfString = OUStringToOString( rCommand + ::rtl::OUString::createFromAscii( "\n" ), RTL_TEXTENCODING_UTF8 ); + ::rtl::OString aUtfString = OUStringToOString( rCommand + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "\n" )), RTL_TEXTENCODING_UTF8 ); #if OSL_DEBUG_LEVEL > 0 ::std::cerr << "UnxFilePicker sent: \"" << aUtfString.getStr() << "\"" << ::std::endl; diff --git a/fpicker/source/unx/kde_unx/UnxFilePicker.hxx b/fpicker/source/unx/kde_unx/UnxFilePicker.hxx index d48af8567d..d2a065486d 100644 --- a/fpicker/source/unx/kde_unx/UnxFilePicker.hxx +++ b/fpicker/source/unx/kde_unx/UnxFilePicker.hxx @@ -86,6 +86,10 @@ public: UnxFilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr ); virtual ~UnxFilePicker(); + // XComponent + + using cppu::WeakComponentImplHelperBase::disposing; + // XFilePickerNotifier virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx b/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx index 6570290250..a97fdfc24f 100644 --- a/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx +++ b/fpicker/source/unx/kde_unx/UnxNotifyThread.cxx @@ -52,7 +52,7 @@ void SAL_CALL UnxFilePickerNotifyThread::addFilePickerListener( const uno::Refer m_xListener = xListener; } -void SAL_CALL UnxFilePickerNotifyThread::removeFilePickerListener( const uno::Reference< ui::dialogs::XFilePickerListener >& xListener ) +void SAL_CALL UnxFilePickerNotifyThread::removeFilePickerListener( const uno::Reference< ui::dialogs::XFilePickerListener >& /*xListener*/ ) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx index 68d367a9e0..e804a43aa5 100644 --- a/fpicker/source/win32/filepicker/FPentry.cxx +++ b/fpicker/source/win32/filepicker/FPentry.cxx @@ -105,31 +105,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* ) { @@ -138,7 +113,7 @@ void* SAL_CALL component_getFactory( if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) ) { Sequence< OUString > aSNS( 1 ); - aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ); + aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME )); Reference< XSingleServiceFactory > xFactory ( createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.cxx b/fpicker/source/win32/filepicker/FileOpenDlg.cxx index 8155cc630f..ffd9fa3324 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.cxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.cxx @@ -560,8 +560,8 @@ void SAL_CALL CFileOpenDialog::handleInitDialog(HWND hwndDlg, HWND hwndChild) // //------------------------------------------------------------------------ -unsigned int CALLBACK CFileOpenDialog::ofnHookProc( - HWND hChildDlg, unsigned int uiMsg, WPARAM wParam, LPARAM lParam) +UINT_PTR CALLBACK CFileOpenDialog::ofnHookProc( + HWND hChildDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) { HWND hwndDlg = GetParent(hChildDlg); CFileOpenDialog* pImpl = NULL; @@ -577,10 +577,10 @@ unsigned int CALLBACK CFileOpenDialog::ofnHookProc( // subclass the base dialog for WM_NCDESTROY processing pImpl->m_pfnBaseDlgProc = reinterpret_cast<WNDPROC>( - SetWindowLong( - hwndDlg, - GWL_WNDPROC, - reinterpret_cast<LONG>(CFileOpenDialog::BaseDlgProc))); + SetWindowLongPtr( + hwndDlg, + GWLP_WNDPROC, + reinterpret_cast<LONG_PTR>(CFileOpenDialog::BaseDlgProc))); // connect the instance handle to the window SetProp(hwndDlg, CURRENT_INSTANCE, pImpl); pImpl->handleInitDialog(hwndDlg, hChildDlg); @@ -621,8 +621,8 @@ LRESULT CALLBACK CFileOpenDialog::BaseDlgProc( pImpl = reinterpret_cast<CFileOpenDialog*>( RemoveProp(hWnd,CURRENT_INSTANCE)); - SetWindowLong(hWnd, GWL_WNDPROC, - reinterpret_cast<LONG>(pImpl->m_pfnBaseDlgProc)); + SetWindowLongPtr(hWnd, GWLP_WNDPROC, + reinterpret_cast<LONG_PTR>(pImpl->m_pfnBaseDlgProc)); } else { diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.hxx b/fpicker/source/win32/filepicker/FileOpenDlg.hxx index a351a994a6..4ad6776151 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.hxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.hxx @@ -212,10 +212,10 @@ public: // the method returns: // 0 - when the dialog was canceled by the user // 1 - when the dialog was closed with ok - // -1 - when an error occured + // -1 - when an error occurred sal_Int16 SAL_CALL doModal(); - // returns the last dialog error that occured + // returns the last dialog error that occurred sal_uInt32 SAL_CALL getLastDialogError() const; // retrievs the currently selected file @@ -303,9 +303,9 @@ private: WNDPROC m_pfnBaseDlgProc; // callback function - static unsigned int CALLBACK ofnHookProc( + static UINT_PTR CALLBACK ofnHookProc( HWND hChildDlg, // handle to child dialog box - unsigned int uiMsg, // message identifier + UINT uiMsg, // message identifier WPARAM wParam, // message parameter LPARAM lParam // message parameter ); diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 322c4ae2f2..f0782d353e 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -76,8 +76,8 @@ namespace uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(2); - aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker"); - aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker"); + aRet[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker")); + aRet[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker")); return aRet; } } @@ -123,7 +123,7 @@ void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePicke { if ( rBHelper.bDisposed ) throw lang::DisposedException( - rtl::OUString::createFromAscii( "object is already disposed" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "object is already disposed" )), static_cast< XFilePicker2* >( this ) ); if ( !rBHelper.bInDispose && !rBHelper.bDisposed ) @@ -139,7 +139,7 @@ void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePi { if ( rBHelper.bDisposed ) throw lang::DisposedException( - rtl::OUString::createFromAscii( "object is already disposed" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "object is already disposed" )), static_cast< XFilePicker2* >( this ) ); rBHelper.aLC.removeInterface( getCppuType( &xListener ), xListener ); @@ -238,7 +238,7 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const } catch(uno::RuntimeException&) { - OSL_ENSURE( false, "RuntimeException during event dispatching" ); + OSL_FAIL( "RuntimeException during event dispatching" ); } } } @@ -459,10 +459,10 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) } else { - OSL_ENSURE(sal_False, "Could not start event notifier thread!"); + OSL_FAIL("Could not start event notifier thread!"); throw uno::RuntimeException( - rtl::OUString::createFromAscii("Error executing dialog"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Error executing dialog")), static_cast<XFilePicker2*>(this)); } @@ -630,7 +630,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) uno::Any aAny; if ( 0 == aArguments.getLength( ) ) throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "no arguments" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )), static_cast<XFilePicker2*>(this), 1); aAny = aArguments[0]; @@ -638,7 +638,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) if ( (aAny.getValueType() != ::getCppuType((sal_Int16*)0)) && (aAny.getValueType() != ::getCppuType((sal_Int8*)0)) ) throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii("invalid argument type"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid argument type")), static_cast<XFilePicker2*>(this), 1); sal_Int16 templateId = -1; @@ -728,7 +728,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) default: throw lang::IllegalArgumentException( - rtl::OUString::createFromAscii( "Unknown template" ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )), static_cast< XFilePicker2* >( this ), 1 ); } @@ -768,7 +768,7 @@ void SAL_CALL CFilePicker::cancel() rtl::OUString SAL_CALL CFilePicker::getImplementationName() throw(uno::RuntimeException) { - return rtl::OUString::createFromAscii(FILE_PICKER_IMPL_NAME); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FILE_PICKER_IMPL_NAME)); } // ------------------------------------------------- diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index 2c609c4f94..e4cdbb3e7f 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -145,7 +145,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& } catch( std::out_of_range& ) { - OSL_ENSURE( sal_False, "Filter not in filter container" ); + OSL_FAIL( "Filter not in filter container" ); pos = -1; } @@ -166,7 +166,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi } catch( std::out_of_range& ) { - OSL_ENSURE( sal_False, "Filter index out of range" ); + OSL_FAIL( "Filter index out of range" ); bRet = sal_False; } diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.cxx b/fpicker/source/win32/filepicker/PreviewCtrl.cxx index 82a29ae05d..6db88fec3e 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.cxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.cxx @@ -226,12 +226,12 @@ CFilePreview* CFilePreview::createInstance( catch( CPreviewException& ) { OSL_ASSERT( !s_FilePreviewInst ); - OSL_ENSURE( sal_False, "Creation of the preview window failed" ); + OSL_FAIL( "Creation of the preview window failed" ); } catch( CAutoOleInit::COleInitException& ) { OSL_ASSERT( !s_FilePreviewInst ); - OSL_ENSURE( sal_False, "OleInitalize failed" ); + OSL_FAIL( "OleInitalize failed" ); } } @@ -394,7 +394,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 ); } @@ -419,7 +419,7 @@ sal_Bool SAL_CALL CFilePreview::show( sal_Bool bShow ) // if the preview is shown and enabled // preview of the given file will be shown // returns true on success or false if an error -// occured (the file in not there or not accessible etc.) +// occurred (the file in not there or not accessible etc.) //--------------------------------------------------- sal_Bool SAL_CALL CFilePreview::update( const rtl::OUString& aFileName ) @@ -436,7 +436,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 ); } } @@ -549,12 +549,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 ); } @@ -602,7 +602,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/PreviewCtrl.hxx b/fpicker/source/win32/filepicker/PreviewCtrl.hxx index 32937c7c69..818a78b711 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.hxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.hxx @@ -152,7 +152,7 @@ public: // if the preview is shown and enabled // preview of the given file will be shown // returns true on success or false if an error - // occured (the file in not there or not accessible etc.) + // occurred (the file in not there or not accessible etc.) virtual sal_Bool SAL_CALL update( const rtl::OUString& aFileName ); protected: diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index 397fac4f14..ce38abf435 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -92,8 +92,8 @@ namespace css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker_getSupportedServiceNames() { css::uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker"); - aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker"); + aRet[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.FilePicker")); + aRet[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFilePicker")); return aRet; } } @@ -552,17 +552,9 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An throw(css::uno::Exception , css::uno::RuntimeException) { - /* - // called twice ? - if (m_pDlg) - throw css::uno::Exception( - ::rtl::OUString::createFromAscii( "XInitialization::initialize() called twice." ), - static_cast< css::ui::dialogs::XFilePicker* >( this )); - */ - if (lArguments.getLength() < 1) throw css::lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii( "XInitialization::initialize() called without arguments." ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "XInitialization::initialize() called without arguments." )), static_cast< css::ui::dialogs::XFilePicker2* >( this ), 1); @@ -692,7 +684,7 @@ void SAL_CALL VistaFilePicker::cancel() ::rtl::OUString SAL_CALL VistaFilePicker::getImplementationName() throw(css::uno::RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.fpicker.VistaFileDialog"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.fpicker.VistaFileDialog")); } // ------------------------------------------------- diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx index 48dbfcaa37..14cefe36f7 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx @@ -164,7 +164,7 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog* //----------------------------------------------------------------------------------------- void lcl_updateVersionListDirectly(IFileDialog* pDialog) { - static const ::rtl::OUString SERVICENAME_REVISIONPERSISTENCE = ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentRevisionListPersistence"); + static const ::rtl::OUString SERVICENAME_REVISIONPERSISTENCE(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")); static const ::sal_Int16 CONTROL_VERSIONLIST = css::ui::dialogs::ExtendedFilePickerElementIds::LISTBOX_VERSION; TFileDialog iDialog (pDialog); @@ -405,8 +405,8 @@ void VistaFilePickerEventHandler::stopListening() } } -static const ::rtl::OUString PROP_CONTROL_ID = ::rtl::OUString::createFromAscii("control_id"); -static const ::rtl::OUString PROP_PICKER_LISTENER = ::rtl::OUString::createFromAscii("picker_listener"); +static const ::rtl::OUString PROP_CONTROL_ID(RTL_CONSTASCII_USTRINGPARAM("control_id")); +static const ::rtl::OUString PROP_PICKER_LISTENER(RTL_CONSTASCII_USTRINGPARAM("picker_listener")); //----------------------------------------------------------------------------------------- class AsyncPickerEvents : public RequestHandler diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx index 9f006d6925..b13069c0bf 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx @@ -1106,7 +1106,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/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx index c902cf9f2d..823141d3b8 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx @@ -93,24 +93,24 @@ static const ::sal_Int32 FEATURE_PLAY = 256; static const ::sal_Int32 FEATURE_READONLY = 512; static const ::sal_Int32 FEATURE_VERSION = 1024; -static const ::rtl::OUString PROP_PICKER_LISTENER = ::rtl::OUString::createFromAscii("picker_listener" ); // [XFilePickerListenert] -static const ::rtl::OUString PROP_DIALOG_SHOW_RESULT = ::rtl::OUString::createFromAscii("dialog_show_result" ); // [sal_Bool] true=OK, false=CANCEL -static const ::rtl::OUString PROP_SELECTED_FILES = ::rtl::OUString::createFromAscii("selected_files" ); // [seq< OUString >] contains all user selected files (can be empty!) -static const ::rtl::OUString PROP_MULTISELECTION_MODE = ::rtl::OUString::createFromAscii("multiselection_mode"); // [sal_Bool] true=ON, false=OFF -static const ::rtl::OUString PROP_TITLE = ::rtl::OUString::createFromAscii("title" ); // [OUString] -static const ::rtl::OUString PROP_FILENAME = ::rtl::OUString::createFromAscii("filename" ); // [OUString] -static const ::rtl::OUString PROP_DIRECTORY = ::rtl::OUString::createFromAscii("directory" ); // [OUString] -static const ::rtl::OUString PROP_FEATURES = ::rtl::OUString::createFromAscii("features" ); // [sal_Int32] -static const ::rtl::OUString PROP_TEMPLATE_DESCR = ::rtl::OUString::createFromAscii("templatedescription"); // [sal_Int32] -static const ::rtl::OUString PROP_FILTER_TITLE = ::rtl::OUString::createFromAscii("filter_title" ); // [OUString] -static const ::rtl::OUString PROP_FILTER_VALUE = ::rtl::OUString::createFromAscii("filter_value" ); // [OUString] -static const ::rtl::OUString PROP_FORCE = ::rtl::OUString::createFromAscii("force" ); // [sal_Bool] +static const ::rtl::OUString PROP_PICKER_LISTENER(RTL_CONSTASCII_USTRINGPARAM("picker_listener" ) ); // [XFilePickerListenert] +static const ::rtl::OUString PROP_DIALOG_SHOW_RESULT(RTL_CONSTASCII_USTRINGPARAM("dialog_show_result" )); // [sal_Bool] true=OK, false=CANCEL +static const ::rtl::OUString PROP_SELECTED_FILES(RTL_CONSTASCII_USTRINGPARAM("selected_files" )); // [seq< OUString >] contains all user selected files (can be empty!) +static const ::rtl::OUString PROP_MULTISELECTION_MODE(RTL_CONSTASCII_USTRINGPARAM("multiselection_mode")); // [sal_Bool] true=ON, false=OFF +static const ::rtl::OUString PROP_TITLE(RTL_CONSTASCII_USTRINGPARAM("title" )); // [OUString] +static const ::rtl::OUString PROP_FILENAME(RTL_CONSTASCII_USTRINGPARAM("filename" ) ); // [OUString] +static const ::rtl::OUString PROP_DIRECTORY(RTL_CONSTASCII_USTRINGPARAM("directory" )); // [OUString] +static const ::rtl::OUString PROP_FEATURES(RTL_CONSTASCII_USTRINGPARAM("features" )); // [sal_Int32] +static const ::rtl::OUString PROP_TEMPLATE_DESCR(RTL_CONSTASCII_USTRINGPARAM("templatedescription")); // [sal_Int32] +static const ::rtl::OUString PROP_FILTER_TITLE(RTL_CONSTASCII_USTRINGPARAM("filter_title" )); // [OUString] +static const ::rtl::OUString PROP_FILTER_VALUE(RTL_CONSTASCII_USTRINGPARAM("filter_value" )); // [OUString] +static const ::rtl::OUString PROP_FORCE(RTL_CONSTASCII_USTRINGPARAM("force" )); // [sal_Bool] -static const ::rtl::OUString PROP_CONTROL_ID = ::rtl::OUString::createFromAscii("control_id" ); // [sal_Int16] -static const ::rtl::OUString PROP_CONTROL_ACTION = ::rtl::OUString::createFromAscii("control_action" ); // [sal_Int16] -static const ::rtl::OUString PROP_CONTROL_VALUE = ::rtl::OUString::createFromAscii("control_value" ); // [Any] -static const ::rtl::OUString PROP_CONTROL_LABEL = ::rtl::OUString::createFromAscii("control_label" ); // [OUString] -static const ::rtl::OUString PROP_CONTROL_ENABLE = ::rtl::OUString::createFromAscii("control_enable" ); // [sal_Bool] true=ON, false=OFF +static const ::rtl::OUString PROP_CONTROL_ID(RTL_CONSTASCII_USTRINGPARAM("control_id" )); // [sal_Int16] +static const ::rtl::OUString PROP_CONTROL_ACTION(RTL_CONSTASCII_USTRINGPARAM("control_action" )); // [sal_Int16] +static const ::rtl::OUString PROP_CONTROL_VALUE(RTL_CONSTASCII_USTRINGPARAM("control_value" )); // [Any] +static const ::rtl::OUString PROP_CONTROL_LABEL(RTL_CONSTASCII_USTRINGPARAM("control_label" )); // [OUString] +static const ::rtl::OUString PROP_CONTROL_ENABLE(RTL_CONSTASCII_USTRINGPARAM("control_enable" )); // [sal_Bool] true=ON, false=OFF //----------------------------------------------------------------------------- /** native implementation of the file picker on Vista and upcoming windows versions. diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index 9a0cb5b7b1..6f549cf708 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -134,7 +134,7 @@ void CWinFileOpenImpl::setDisplayDirectory(const rtl::OUString& aDirectory) if ( ::osl::FileBase::E_None != ::osl::FileBase::getSystemPathFromFileURL(aDirectory,aSysDirectory)) throw IllegalArgumentException( - rtl::OUString::createFromAscii("Invalid directory"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Invalid directory")), static_cast<XFilePicker2*>(m_FilePicker), 1); // we ensure that there is a trailing '/' at the end of @@ -205,7 +205,7 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException) rc = ::com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL; else throw uno::RuntimeException( - rtl::OUString::createFromAscii("Error executing dialog"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Error executing dialog")), static_cast<XFilePicker2*>(m_FilePicker)); return rc; @@ -224,7 +224,7 @@ void SAL_CALL CWinFileOpenImpl::appendFilter(const rtl::OUString& aTitle, const if (!bRet) throw IllegalArgumentException( - rtl::OUString::createFromAscii("filter already exists"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("filter already exists")), static_cast<XFilePicker2*>(m_FilePicker), 1); // #95345# see MSDN OPENFILENAME @@ -249,7 +249,7 @@ void SAL_CALL CWinFileOpenImpl::setCurrentFilter(const rtl::OUString& aTitle) if (filterPos < 0) throw IllegalArgumentException( - rtl::OUString::createFromAscii("filter doesn't exist"), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("filter doesn't exist")), static_cast<XFilePicker2*>(m_FilePicker), 1); // filter index of the base class starts with 1 @@ -528,13 +528,13 @@ 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: // restore the old window proc - SetWindowLong(hWnd, GWL_WNDPROC, - reinterpret_cast<LONG>(pImpl->m_pfnOldDlgProc)); + SetWindowLongPtr(hWnd, GWLP_WNDPROC, + reinterpret_cast<LONG_PTR>(pImpl->m_pfnOldDlgProc)); lResult = CallWindowProc( reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), @@ -609,7 +609,7 @@ BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) OSL_ASSERT(pImpl); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; switch(enumParam->m_action) { @@ -842,7 +842,7 @@ void CWinFileOpenImpl::onWMSize() // //----------------------------------------------------------------------------------------- -void CWinFileOpenImpl::onWMShow(BOOL bShow) +void CWinFileOpenImpl::onWMShow(sal_Bool bShow) { m_Preview->notifyParentShow(bShow); } @@ -885,8 +885,8 @@ void SAL_CALL CWinFileOpenImpl::onInitDialog(HWND hwndDlg) // subclass the dialog window m_pfnOldDlgProc = reinterpret_cast<WNDPROC>( - SetWindowLong( hwndDlg, GWL_WNDPROC, - reinterpret_cast<LONG>(SubClassFunc))); + SetWindowLongPtr( hwndDlg, GWLP_WNDPROC, + reinterpret_cast<LONG_PTR>(SubClassFunc))); } //----------------------------------------------------------------------------------------- diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx index 379a2dd496..b7ade2afcd 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx @@ -188,7 +188,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/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx index d69746fd07..2048eb0c33 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx @@ -94,12 +94,12 @@ void SAL_CALL CAsyncEventNotifier::addListener(const uno::Type& { if ( m_rBroadcastHelper.bDisposed ) throw lang::DisposedException( - ::rtl::OUString::createFromAscii( "FilePicker is already disposed" ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilePicker is already disposed" )), uno::Reference< uno::XInterface >() ); if ( m_rBroadcastHelper.bInDispose ) throw lang::DisposedException( - ::rtl::OUString::createFromAscii( "FilePicker will be disposed now." ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilePicker will be disposed now." )), uno::Reference< uno::XInterface >() ); m_rBroadcastHelper.aLC.addInterface( aType, xListener ); @@ -114,7 +114,7 @@ void SAL_CALL CAsyncEventNotifier::removeListener(const uno::Type& { if ( m_rBroadcastHelper.bDisposed ) throw lang::DisposedException( - ::rtl::OUString::createFromAscii( "FilePicker is already disposed." ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FilePicker is already disposed." )), uno::Reference< uno::XInterface >() ); m_rBroadcastHelper.aLC.removeInterface( aType, xListener ); @@ -180,7 +180,7 @@ void SAL_CALL CAsyncEventNotifier::shutdown() // we are waiting infinite, so error will // be better detected in form of deadlocks if (WaitForSingleObject(m_hThread, INFINITE) == WAIT_FAILED) { - OSL_ENSURE(false, "Waiting for thread termination failed!"); + OSL_FAIL("Waiting for thread termination failed!"); } // lock mutex again to reset m_hThread @@ -299,7 +299,7 @@ void SAL_CALL CAsyncEventNotifier::run() } catch(uno::RuntimeException&) { - OSL_ENSURE(sal_False,"RuntimeException during event dispatching"); + OSL_FAIL("RuntimeException during event dispatching"); } } } diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx index ed197cd9b4..cfaa8e3faf 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.cxx +++ b/fpicker/source/win32/filepicker/asyncrequests.cxx @@ -44,7 +44,7 @@ namespace css = ::com::sun::star; void lcl_sleep(::osl::Condition& aCondition , ::sal_Int32 nMilliSeconds) { - ULONG nAcquireCount = Application::ReleaseSolarMutex(); + sal_uLong nAcquireCount = Application::ReleaseSolarMutex(); if (nMilliSeconds < 1) aCondition.wait(0); diff --git a/fpicker/source/win32/filepicker/controlaccess.cxx b/fpicker/source/win32/filepicker/controlaccess.cxx index cde1ee52f6..b21fa64e55 100644 --- a/fpicker/source/win32/filepicker/controlaccess.cxx +++ b/fpicker/source/win32/filepicker/controlaccess.cxx @@ -64,14 +64,14 @@ namespace // private CheckboxSetState }; const size_t SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE = - sizeof( CheckboxSetValueFunctionTable ) / sizeof( CTRL_SETVALUE_FUNCTION_T ); + SAL_N_ELEMENTS( CheckboxSetValueFunctionTable ); CTRL_GETVALUE_FUNCTION_T CheckboxGetValueFunctionTable[] = { CheckboxGetState }; const size_t SIZE_CHECKBOX_GETVALUE_FUNCTION_TABLE = - sizeof( CheckboxGetValueFunctionTable ) / sizeof( CTRL_GETVALUE_FUNCTION_T ); + SAL_N_ELEMENTS( CheckboxGetValueFunctionTable ); CTRL_SETVALUE_FUNCTION_T ListboxSetValueFunctionTable[] = { @@ -83,7 +83,7 @@ namespace // private ListboxSetSelectedItem }; const size_t SIZE_LISTBOX_SETVALUE_FUNCTION_TABLE = - sizeof( ListboxSetValueFunctionTable ) / sizeof( CTRL_SETVALUE_FUNCTION_T ); + SAL_N_ELEMENTS( ListboxSetValueFunctionTable ); CTRL_GETVALUE_FUNCTION_T ListboxGetValueFunctionTable[] = { @@ -98,7 +98,7 @@ namespace // private ListboxGetSelectedItemIndex }; const size_t SIZE_LISTBOX_GETVALUE_ACTION_TABLE = - sizeof( ListboxGetValueFunctionTable ) / sizeof( CTRL_GETVALUE_FUNCTION_T ); + SAL_N_ELEMENTS( ListboxGetValueFunctionTable ); struct _ENTRY { @@ -226,9 +226,10 @@ CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl ) { CTRL_CLASS aCtrlClass = UNKNOWN; - TCHAR aClassName[256]; + const size_t nClassNameSize = 256; + TCHAR aClassName[nClassNameSize]; - int nRet = GetClassName(hwndCtrl,aClassName,(sizeof(aClassName)/sizeof(TCHAR))); + int nRet = GetClassName(hwndCtrl,aClassName,nClassNameSize); if (nRet) { if (0 == _tcsicmp(aClassName,TEXT("button"))) diff --git a/fpicker/source/win32/filepicker/customcontrolfactory.cxx b/fpicker/source/win32/filepicker/customcontrolfactory.cxx index 5332fe4087..36f2a3748a 100644 --- a/fpicker/source/win32/filepicker/customcontrolfactory.cxx +++ b/fpicker/source/win32/filepicker/customcontrolfactory.cxx @@ -50,7 +50,7 @@ CCustomControl* CCustomControlFactory::CreateCustomControl(HWND aControlHandle, TCHAR aClsName[256]; ZeroMemory(aClsName,sizeof(aClsName)); if (GetClassName(aControlHandle,aClsName,sizeof(aClsName)) == 0) { - OSL_ENSURE(false,"Invalid window handle"); + OSL_FAIL("Invalid window handle"); } if (0 == _tcsicmp(aClsName,TEXT("button"))) diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx index afe673c77a..563cd964b4 100644 --- a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx +++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx @@ -54,7 +54,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 ede628d2b6..4f7ebe81c0 100644 --- a/fpicker/source/win32/filepicker/dibpreview.cxx +++ b/fpicker/source/win32/filepicker/dibpreview.cxx @@ -204,7 +204,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); } @@ -245,7 +245,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) { BITMAPFILEHEADER* pbmfh; BITMAPINFO * pbmi; - BYTE * pBits; + sal_uInt8 * pBits; int cxDib; int cyDib; @@ -259,7 +259,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/filepickerstate.cxx b/fpicker/source/win32/filepicker/filepickerstate.cxx index 1ec72dcec0..5429a6ed2e 100644 --- a/fpicker/source/win32/filepicker/filepickerstate.cxx +++ b/fpicker/source/win32/filepicker/filepickerstate.cxx @@ -395,14 +395,14 @@ void SAL_CALL CExecuteFilePickerState::setValue( sal_Int16 aControlId, sal_Int16 // method the caller should use XFilterManager if ( !hwndCtrl || (aControlId == LISTBOX_FILTER) ) { - OSL_ENSURE( sal_False, "invalid control id" ); + OSL_FAIL( "invalid control id" ); return; } CTRL_CLASS aCtrlClass = GetCtrlClass( hwndCtrl ); if ( UNKNOWN == aCtrlClass ) { - OSL_ENSURE( sal_False, "unsupported control class" ); + OSL_FAIL( "unsupported control class" ); return; } @@ -411,7 +411,7 @@ void SAL_CALL CExecuteFilePickerState::setValue( sal_Int16 aControlId, sal_Int16 if ( !lpfnSetValue ) { - OSL_ENSURE( sal_False, "unsupported control action" ); + OSL_FAIL( "unsupported control action" ); return; } @@ -437,14 +437,14 @@ Any SAL_CALL CExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int16 // method the caller should use XFilterManager if ( !hwndCtrl || (aControlId == LISTBOX_FILTER) ) { - OSL_ENSURE( sal_False, "invalid control id" ); + OSL_FAIL( "invalid control id" ); return Any( ); } CTRL_CLASS aCtrlClass = GetCtrlClass( hwndCtrl ); if ( UNKNOWN == aCtrlClass ) { - OSL_ENSURE( sal_False, "unsupported control class" ); + OSL_FAIL( "unsupported control class" ); return Any( ); } @@ -453,7 +453,7 @@ Any SAL_CALL CExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int16 if ( !lpfnGetValue ) { - OSL_ENSURE( sal_False, "unsupported control action" ); + OSL_FAIL( "unsupported control action" ); return Any( ); } diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx index 70977b6272..4199d26f8a 100644 --- a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx +++ b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx @@ -55,13 +55,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 ) { @@ -75,7 +75,7 @@ namespace /* private */ ~CurDirGuard() { - BOOL bDirSet = FALSE; + bool bDirSet = false; if ( m_pBuffer ) { diff --git a/fpicker/source/win32/filepicker/helppopupwindow.cxx b/fpicker/source/win32/filepicker/helppopupwindow.cxx index 42c1ec1327..33b26a0c5d 100644 --- a/fpicker/source/win32/filepicker/helppopupwindow.cxx +++ b/fpicker/source/win32/filepicker/helppopupwindow.cxx @@ -608,7 +608,7 @@ void SAL_CALL CHelpPopupWindow::UnregisterWindowClass( ) if ( !UnregisterClass( (LPCTSTR)MAKELONG( s_ClassAtom, 0 ), m_hInstance ) ) { - OSL_ENSURE( false, "unregister window class failed" ); + OSL_FAIL( "unregister window class failed" ); } s_ClassAtom = 0; diff --git a/fpicker/source/win32/filepicker/makefile.mk b/fpicker/source/win32/filepicker/makefile.mk index 17e4f26090..bfe5bee1da 100644 --- a/fpicker/source/win32/filepicker/makefile.mk +++ b/fpicker/source/win32/filepicker/makefile.mk @@ -29,7 +29,6 @@ PRJ=..$/..$/.. PRJNAME=fpicker TARGET=fps -#LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE COMP1TYPELIST=$(TARGET) @@ -41,11 +40,8 @@ COMP1TYPELIST=$(TARGET) CDEFS+=-D_UNICODE CDEFS+=-DUNICODE -#CDEFS+=-DWIN32_LEAN_AND_MEAN -#CDEFS+=-DWIN32 CDEFS+=-U_WIN32_WINNT -D_WIN32_WINNT=0x0600 - # --- Resources ---------------------------------------------------- .IF "$(GUI)" == "WNT" diff --git a/fpicker/source/win32/filepicker/previewadapter.cxx b/fpicker/source/win32/filepicker/previewadapter.cxx index b0f7effb8b..776d564e79 100644 --- a/fpicker/source/win32/filepicker/previewadapter.cxx +++ b/fpicker/source/win32/filepicker/previewadapter.cxx @@ -307,7 +307,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; @@ -317,7 +317,7 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() // resize the filelistbox to the half of the // available space - BOOL bRet = SetWindowPos(flb_new, + bool bRet = SetWindowPos(flb_new, NULL, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); diff --git a/fpicker/source/win32/filepicker/previewbase.cxx b/fpicker/source/win32/filepicker/previewbase.cxx index ae505af164..3776cea2d5 100644 --- a/fpicker/source/win32/filepicker/previewbase.cxx +++ b/fpicker/source/win32/filepicker/previewbase.cxx @@ -34,7 +34,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; -using namespace rtl; + +using ::rtl::OUString; //------------------------------- // @@ -90,11 +91,11 @@ void SAL_CALL PreviewBase::setImage( sal_Int16 aImageFormat, const ::com::sun::s { if (aImageFormat != ::com::sun::star::ui::dialogs::FilePreviewImageFormats::BITMAP) throw IllegalArgumentException( - OUString::createFromAscii("unsupported image format"), 0, 1); + OUString(RTL_CONSTASCII_USTRINGPARAM("unsupported image format")), 0, 1); if (aImage.hasValue() && (aImage.getValueType() != getCppuType((Sequence<sal_Int8>*)0))) throw IllegalArgumentException( - OUString::createFromAscii("invalid image data"), 0, 2); + OUString(RTL_CONSTASCII_USTRINGPARAM("invalid image data")), 0, 2); // save the new image data and force a redraw m_ImageData = aImage; diff --git a/fpicker/source/win32/filepicker/propmap.hxx b/fpicker/source/win32/filepicker/propmap.hxx index 2eed6fce13..904f8fa11c 100644 --- a/fpicker/source/win32/filepicker/propmap.hxx +++ b/fpicker/source/win32/filepicker/propmap.hxx @@ -29,11 +29,11 @@ #ifndef _PROPMAP_HXX_ #define _PROPMAP_HXX_ -#include <hash_map> +#include <boost/unordered_map.hpp> #include <rtl/ustring.hxx> #include <sal/types.h> -typedef ::std::hash_map< ::rtl::OUString , +typedef ::boost::unordered_map< ::rtl::OUString , void* , ::rtl::OUStringHash , ::std::equal_to< ::rtl::OUString > > TPropMapBase; diff --git a/fpicker/source/win32/filepicker/shared.hxx b/fpicker/source/win32/filepicker/shared.hxx index cfec9032f3..34e27b615c 100644 --- a/fpicker/source/win32/filepicker/shared.hxx +++ b/fpicker/source/win32/filepicker/shared.hxx @@ -31,9 +31,9 @@ #include <rtl/ustring.hxx> -const ::rtl::OUString BACKSLASH = ::rtl::OUString::createFromAscii( "\\" ); -const ::rtl::OUString FILTER_SEPARATOR = ::rtl::OUString::createFromAscii( "------------------------------------------" ); -const ::rtl::OUString ALL_FILES_WILDCARD = ::rtl::OUString::createFromAscii( "*.*" ); +const ::rtl::OUString BACKSLASH(RTL_CONSTASCII_USTRINGPARAM( "\\" )); +const ::rtl::OUString FILTER_SEPARATOR(RTL_CONSTASCII_USTRINGPARAM( "------------------------------------------" )); +const ::rtl::OUString ALL_FILES_WILDCARD(RTL_CONSTASCII_USTRINGPARAM( "*.*" )); const ::sal_Bool ALLOW_DUPLICATES = sal_True; #endif diff --git a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx index ada72efb6e..e1b660e6f7 100644 --- a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx +++ b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx @@ -98,7 +98,7 @@ void TestFilterManager( Reference< XFilePicker > xFilePicker ); Reference< XMultiServiceFactory > g_xFactory; -const OUString BMP_EXTENSION = OUString::createFromAscii( "bmp" ); +const OUString BMP_EXTENSION(RTL_CONSTASCII_USTRINGPARAM( "bmp" )); //------------------------------------------------------------------------------------------------------------------------- // a test client @@ -178,7 +178,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( ); @@ -196,9 +196,8 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star:: } } } - catch( IllegalArgumentException& ex ) + catch( IllegalArgumentException& ) { - ex = ex; } } @@ -270,10 +269,10 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) ); Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) ); - // Print a message if an error occured. + // Print a message if an error occurred. if ( g_xFactory.is() == sal_False ) { - OSL_ENSURE(sal_False, "Can't create RegistryServiceFactory"); + OSL_FAIL("Can't create RegistryServiceFactory"); return(-1); } @@ -282,19 +281,11 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) //------------------------------------------------- Sequence< Any > arguments(1); - //arguments[0] = makeAny( FILEOPEN_SIMPLE ); - //arguments[0] = makeAny( FILESAVE_SIMPLE ); - //arguments[0] = makeAny( FILESAVE_AUTOEXTENSION_PASSWORD ); - //arguments[0] = makeAny( FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS ); - //arguments[0] = makeAny( FILESAVE_AUTOEXTENSION_SELECTION ); - //arguments[0] = makeAny( FILESAVE_AUTOEXTENSION_TEMPLATE ); - //arguments[0] = makeAny( FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE ); - //arguments[0] = makeAny( FILEOPEN_PLAY ); arguments[0] = makeAny( FILEOPEN_READONLY_VERSION ); Reference< XFilePicker > xFilePicker = Reference< XFilePicker >( g_xFactory->createInstanceWithArguments( - OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ), arguments ), UNO_QUERY ); + OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME )), arguments ), UNO_QUERY ); // install a FilePicker notifier Reference< XFilePickerListener > xFPListener( @@ -304,9 +295,9 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) if ( xFPNotifier.is( ) ) xFPNotifier->addFilePickerListener( xFPListener ); - xFilePicker->setTitle( OUString::createFromAscii("FileOpen Simple...")); + xFilePicker->setTitle( OUString(RTL_CONSTASCII_USTRINGPARAM("FileOpen Simple..."))); xFilePicker->setMultiSelectionMode( sal_True ); - xFilePicker->setDefaultName( OUString::createFromAscii("d:\\test2.sxw")); + xFilePicker->setDefaultName( OUString(RTL_CONSTASCII_USTRINGPARAM("d:\\test2.sxw"))); OUString aDirURL; OUString aSysPath = OStringToOUString( "d:\\ueaeoe", osl_getThreadTextEncoding( ) ); @@ -369,10 +360,10 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) // Cast factory to XComponent Reference< XComponent > xComponent( g_xFactory, UNO_QUERY ); - // Print a message if an error occured. + // Print a message if an error occurred. if ( xComponent.is() == sal_False ) { - OSL_ENSURE(sal_False, "Error shuting down"); + OSL_FAIL("Error shuting down"); } // Dispose and clear factory diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx index f75f98f33e..cae36a0f70 100644 --- a/fpicker/source/win32/folderpicker/FolderPicker.cxx +++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx @@ -71,7 +71,7 @@ namespace Sequence< OUString > SAL_CALL FolderPicker_getSupportedServiceNames() { Sequence< OUString > aRet(1); - aRet[0] = OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFolderPicker"); + aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.SystemFolderPicker")); return aRet; } } @@ -166,7 +166,7 @@ sal_Int16 SAL_CALL CFolderPicker::execute( ) OUString SAL_CALL CFolderPicker::getImplementationName( ) throw( RuntimeException ) { - return OUString::createFromAscii( FOLDERPICKER_IMPL_NAME ); + return OUString(RTL_CONSTASCII_USTRINGPARAM( FOLDERPICKER_IMPL_NAME )); } // ------------------------------------------------- diff --git a/fpicker/source/win32/folderpicker/Fopentry.cxx b/fpicker/source/win32/folderpicker/Fopentry.cxx index 1f71a0771e..9204cce0c5 100644 --- a/fpicker/source/win32/folderpicker/Fopentry.cxx +++ b/fpicker/source/win32/folderpicker/Fopentry.cxx @@ -84,31 +84,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 db9662c428..3c4f51765e 100644 --- a/fpicker/source/win32/folderpicker/MtaFop.cxx +++ b/fpicker/source/win32/folderpicker/MtaFop.cxx @@ -252,7 +252,7 @@ sal_Bool CMtaFolderPicker::browseForFolder( ) if ( WaitForSingleObject( m_hEvtThrdReady, MAX_WAITTIME ) != WAIT_OBJECT_0 ) { - OSL_ENSURE( sal_False, "sta thread not ready" ); + OSL_FAIL( "sta thread not ready" ); return sal_False; } @@ -280,7 +280,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 ) { @@ -547,7 +547,7 @@ void SAL_CALL CMtaFolderPicker::onInitialized( ) SendMessageA( m_hwnd, BFFM_SETSELECTION, - (WPARAM)FALSE, + (WPARAM)sal_False, (LPARAM) lpiidDisplayDir ); releaseItemIdList( lpiidDisplayDir ); @@ -721,7 +721,7 @@ unsigned int CMtaFolderPicker::run( ) // we stop here and return if ( FAILED( hr ) ) { - OSL_ENSURE( sal_False, "CoInitialize failed" ); + OSL_FAIL( "CoInitialize failed" ); return sal::static_int_cast< unsigned int >(-1); } @@ -740,7 +740,7 @@ unsigned int CMtaFolderPicker::run( ) } else { - OSL_ENSURE( sal_False, "failed to create sta thread" ); + OSL_FAIL( "failed to create sta thread" ); nRet = sal::static_int_cast< unsigned int >(-1); } diff --git a/fpicker/source/win32/folderpicker/WinFOPImpl.cxx b/fpicker/source/win32/folderpicker/WinFOPImpl.cxx index f03251f5fc..ea8f35dcd5 100644 --- a/fpicker/source/win32/folderpicker/WinFOPImpl.cxx +++ b/fpicker/source/win32/folderpicker/WinFOPImpl.cxx @@ -58,7 +58,7 @@ using osl::FileBase; // //------------------------------------------------------------------------ -const OUString BACKSLASH = OUString::createFromAscii( "\\" ); +const OUString BACKSLASH(RTL_CONSTASCII_USTRINGPARAM( "\\" )); //------------------------------------------------------------------------ // ctor @@ -94,7 +94,7 @@ void SAL_CALL CWinFolderPickerImpl::setDisplayDirectory( const OUString& aDirect if ( ::osl::FileBase::E_None != rc ) throw IllegalArgumentException( - OUString::createFromAscii( "directory is not a valid file url" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "directory is not a valid file url" )), static_cast< XFolderPicker* >( m_pFolderPicker ), 1 ); diff --git a/fpicker/source/win32/folderpicker/makefile.mk b/fpicker/source/win32/folderpicker/makefile.mk index 7f0556d7ce..f42ff9685c 100644 --- a/fpicker/source/win32/folderpicker/makefile.mk +++ b/fpicker/source/win32/folderpicker/makefile.mk @@ -28,7 +28,6 @@ PRJ=..$/..$/.. PRJNAME=fpicker TARGET=fop -#LIBTARGET=NO ENABLE_EXCEPTIONS=TRUE COMP1TYPELIST=$(TARGET) diff --git a/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx b/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx index 160d715e82..d95e9286c1 100644 --- a/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx +++ b/fpicker/source/win32/folderpicker/workbench/Test_fops.cxx @@ -86,27 +86,6 @@ using namespace std ; Reference< XMultiServiceFactory > g_xFactory; -/* -void CreateDeepDirectory( ) -{ - // create a deep directory - - OUString aPathURL( L"file:///d|/Deep" ); - OUString normalizedPath; - - OSL_ASSERT( ::osl::FileBase::E_None == \ - ::osl::FileBase::getNormalizedPathFromFileURL( aPathURL, normalizedPath ) ); - - while( ::osl::FileBase::E_None == osl::Directory::create( normalizedPath ) ) - { - aPathURL += L"/Deep"; - OSL_ASSERT( ::osl::FileBase::E_None == \ - ::osl::FileBase::getNormalizedPathFromFileURL( aPathURL, normalizedPath ) ); - } - -} -*/ - //-------------------------------------------------------------- // main //-------------------------------------------------------------- @@ -128,10 +107,10 @@ int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ ) OUString rdbName = OUString( RTL_CONSTASCII_USTRINGPARAM( RDB_SYSPATH ) ); Reference< XMultiServiceFactory > g_xFactory( createRegistryServiceFactory( rdbName ) ); - // Print a message if an error occured. + // Print a message if an error occurred. if ( g_xFactory.is() == sal_False ) { - OSL_ENSURE(sal_False, "Can't create RegistryServiceFactory"); + OSL_FAIL("Can't create RegistryServiceFactory"); return(-1); } @@ -148,7 +127,7 @@ int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ ) if ( xFolderPicker.is() == sal_False ) { - OSL_ENSURE( sal_False, "Error creating FolderPicker Service" ); + OSL_FAIL( "Error creating FolderPicker Service" ); return(-1); } @@ -179,10 +158,10 @@ int SAL_CALL main(int /*nArgc*/, char* /*Argv[]*/, char* /*Env[]*/ ) // Cast factory to XComponent Reference< XComponent > xComponent( g_xFactory, UNO_QUERY ); - // Print a message if an error occured. + // Print a message if an error occurred. if ( xComponent.is() == sal_False ) { - OSL_ENSURE(sal_False, "Error shuting down"); + OSL_FAIL("Error shuting down"); } // Dispose and clear factory diff --git a/fpicker/source/win32/folderpicker/workbench/makefile.mk b/fpicker/source/win32/folderpicker/workbench/makefile.mk index bfdf840989..666751f277 100644 --- a/fpicker/source/win32/folderpicker/workbench/makefile.mk +++ b/fpicker/source/win32/folderpicker/workbench/makefile.mk @@ -32,9 +32,7 @@ TARGET= testfops LIBTARGET= NO TARGETTYPE= CUI - # --- Settings ----------------------------------------------------- -#.INCLUDE : $(PRJ)$/util$/makefile.pmk .INCLUDE : settings.mk @@ -58,5 +56,6 @@ APP1STDLIBS+= $(CPPULIB) \ APP1DEF= $(MISC)$/$(APP1TARGET).def # --- Targets ------------------------------------------------------ + .INCLUDE : target.mk diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx index b7f8076f21..cdcd45d523 100644 --- a/fpicker/source/win32/misc/WinImplHelper.cxx +++ b/fpicker/source/win32/misc/WinImplHelper.cxx @@ -54,9 +54,9 @@ using ::com::sun::star::uno::Sequence; // //------------------------------------------------------------ -const rtl::OUString TILDE = OUString::createFromAscii( "~" ); +const rtl::OUString TILDE(RTL_CONSTASCII_USTRINGPARAM( "~" )); const sal_Unicode TILDE_SIGN = L'~'; -const rtl::OUString AMPERSAND = OUString::createFromAscii( "&" ); +const rtl::OUString AMPERSAND(RTL_CONSTASCII_USTRINGPARAM( "&" )); const sal_Unicode AMPERSAND_SIGN = L'&'; //------------------------------------------------------------ @@ -248,7 +248,7 @@ void SAL_CALL ListboxAddItem( HWND hwnd, const Any& aItem, const Reference< XInt if ( !aItem.hasValue( ) || aItem.getValueType( ) != getCppuType((OUString*)0) ) throw IllegalArgumentException( - OUString::createFromAscii( "invalid value type or any has no value" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )), rXInterface, aArgPos ); @@ -270,7 +270,7 @@ void SAL_CALL ListboxAddItems( HWND hwnd, const Any& aItemList, const Reference< if ( !aItemList.hasValue( ) || aItemList.getValueType( ) != getCppuType((Sequence<OUString>*)0) ) throw IllegalArgumentException( - OUString::createFromAscii( "invalid value type or any has no value" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )), rXInterface, aArgPos ); @@ -298,7 +298,7 @@ void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Referenc (aPosition.getValueType( ) != getCppuType((sal_Int16*)0)) && (aPosition.getValueType( ) != getCppuType((sal_Int8*)0)) ) ) throw IllegalArgumentException( - OUString::createFromAscii( "invalid value type or any has no value" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )), rXInterface, aArgPos ); @@ -311,7 +311,7 @@ void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Referenc // index was not correct if ( CB_ERR == lRet ) throw IllegalArgumentException( - OUString::createFromAscii( "inavlid item position" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid item position" )), rXInterface, aArgPos ); } @@ -350,7 +350,7 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref (aPosition.getValueType( ) != getCppuType((sal_Int16*)0)) && (aPosition.getValueType( ) != getCppuType((sal_Int8*)0)) ) ) throw IllegalArgumentException( - OUString::createFromAscii( "invalid value type or any has no value" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )), rXInterface, aArgPos ); @@ -359,7 +359,7 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref if ( nPos < -1 ) throw IllegalArgumentException( - OUString::createFromAscii("invalid index"), + OUString(RTL_CONSTASCII_USTRINGPARAM("invalid index")), rXInterface, aArgPos ); @@ -367,7 +367,7 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref if ( (CB_ERR == lRet) && (-1 != nPos) ) throw IllegalArgumentException( - OUString::createFromAscii("invalid index"), + OUString(RTL_CONSTASCII_USTRINGPARAM("invalid index")), rXInterface, aArgPos ); } @@ -460,7 +460,7 @@ void SAL_CALL CheckboxSetState( if ( !aState.hasValue( ) || aState.getValueType( ) != getCppuType((sal_Bool*)0) ) throw IllegalArgumentException( - OUString::createFromAscii( "invalid value type or any has no value" ), + OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid value type or any has no value" )), rXInterface, aArgPos ); diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx index 4b500d7d04..9e46dc010f 100644 --- a/fpicker/source/win32/misc/resourceprovider.cxx +++ b/fpicker/source/win32/misc/resourceprovider.cxx @@ -85,7 +85,7 @@ _Entry CtrlIdToResIdTable[] = { { FOLDER_PICKER_DEF_DESCRIPTION, STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION } }; -const sal_Int32 SIZE_TABLE = sizeof( CtrlIdToResIdTable ) / sizeof( _Entry ); +const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable ); //------------------------------------------------------------ // |