diff options
Diffstat (limited to 'fpicker/source/win32/filepicker/FilePicker.cxx')
-rw-r--r-- | fpicker/source/win32/filepicker/FilePicker.cxx | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 2021e8c93794..322c4ae2f2ab 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.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 @@ -69,10 +69,10 @@ using namespace ::com::sun::star::ui::dialogs::TemplateDescription; namespace { - // controling event notifications + // controling event notifications const bool STARTUP_SUSPENDED = true; const bool STARTUP_ALIVE = false; - + uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(2); @@ -83,12 +83,12 @@ namespace } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) : +CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) : cppu::WeakComponentImplHelper10< - XFilterManager, + XFilterManager, XFilterGroupManager, XFilePickerControlAccess, XFilePickerNotifier, @@ -96,21 +96,21 @@ CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xSer XFilePicker2, lang::XInitialization, util::XCancellable, - lang::XEventListener, + lang::XEventListener, lang::XServiceInfo>(m_rbHelperMtx), m_xServiceMgr(xServiceMgr), m_aAsyncEventNotifier(rBHelper) -{ +{ HINSTANCE hInstance = GetModuleHandle(FILE_PICKER_DLL_NAME); OSL_POSTCOND( hInstance, "The name of the service dll must have changed" ); - // create a default FileOpen dialog without any additional ui elements - m_pImpl = std::auto_ptr< CWinFileOpenImpl >( - new CWinFileOpenImpl( + // create a default FileOpen dialog without any additional ui elements + m_pImpl = std::auto_ptr< CWinFileOpenImpl >( + new CWinFileOpenImpl( this, - true, - 0, - 0, + true, + 0, + 0, hInstance ) ); } @@ -118,11 +118,11 @@ CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xSer // XFPEventListenerManager //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener) +void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener) throw(uno::RuntimeException) { if ( rBHelper.bDisposed ) - throw lang::DisposedException( + throw lang::DisposedException( rtl::OUString::createFromAscii( "object is already disposed" ), static_cast< XFilePicker2* >( this ) ); @@ -131,14 +131,14 @@ void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePicke } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>& xListener ) +void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>& xListener ) throw(uno::RuntimeException) { if ( rBHelper.bDisposed ) - throw lang::DisposedException( + throw lang::DisposedException( rtl::OUString::createFromAscii( "object is already disposed" ), static_cast< XFilePicker2* >( this ) ); @@ -158,10 +158,10 @@ void SAL_CALL CFilePicker::disposing(const lang::EventObject& aEvent) throw(uno: } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) +void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) { aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this)); m_aAsyncEventNotifier.notifyEvent( @@ -169,10 +169,10 @@ void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) +void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) { aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this)); m_aAsyncEventNotifier.notifyEvent( @@ -180,21 +180,21 @@ void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent) -{ +void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent) +{ aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this)); m_aAsyncEventNotifier.notifyEvent( new CFilePickerParamEventNotification(&XFilePickerListener::controlStateChanged,aEvent)); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::dialogSizeChanged() +void SAL_CALL CFilePicker::dialogSizeChanged() { m_aAsyncEventNotifier.notifyEvent( new CFilePickerEventNotification(&XFilePickerListener::dialogSizeChanged)); @@ -208,7 +208,7 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const { rtl::OUString aHelpText; - ::cppu::OInterfaceContainerHelper* pICHelper = + ::cppu::OInterfaceContainerHelper* pICHelper = rBHelper.getContainer( getCppuType((uno::Reference<XFilePickerListener>*)0)); if (pICHelper) @@ -220,8 +220,8 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const try { /* - if there are multiple listeners responding - to this notification the next response + if there are multiple listeners responding + to this notification the next response overwrittes the one before if it is not empty */ @@ -235,28 +235,28 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const aHelpText = temp; } - } + } catch(uno::RuntimeException&) { OSL_ENSURE( false, "RuntimeException during event dispatching" ); } - } + } } return aHelpText; } //------------------------------------- -// +// //------------------------------------- -bool CFilePicker::startupEventNotification(bool bStartupSuspended) +bool CFilePicker::startupEventNotification(bool bStartupSuspended) { return m_aAsyncEventNotifier.startup(bStartupSuspended); } //------------------------------------- -// +// //------------------------------------- void CFilePicker::shutdownEventNotification() @@ -265,7 +265,7 @@ void CFilePicker::shutdownEventNotification() } //------------------------------------- -// +// //------------------------------------- void CFilePicker::suspendEventNotification() @@ -274,14 +274,14 @@ void CFilePicker::suspendEventNotification() } //------------------------------------- -// +// //------------------------------------- void CFilePicker::resumeEventNotification() { m_aAsyncEventNotifier.resume(); } - + //------------------------------------------------------------------------------------ // XFilePicker functions //------------------------------------------------------------------------------------ @@ -294,7 +294,7 @@ void SAL_CALL CFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(uno::Runt } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void SAL_CALL CFilePicker::setTitle(const rtl::OUString& aTitle) throw(uno::RuntimeException) @@ -305,10 +305,10 @@ void SAL_CALL CFilePicker::setTitle(const rtl::OUString& aTitle) throw(uno::Runt } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter) +void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter) throw(lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -317,10 +317,10 @@ void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl:: } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle) +void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle) throw(lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -329,7 +329,7 @@ void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- rtl::OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException) @@ -340,10 +340,10 @@ rtl::OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeExcepti } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) +void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) throw (lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -352,10 +352,10 @@ void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, c } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName) +void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -364,10 +364,10 @@ void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory) +void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory) throw(lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -376,7 +376,7 @@ void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- rtl::OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeException) @@ -387,7 +387,7 @@ rtl::OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeExce } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeException) @@ -398,7 +398,7 @@ uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getFiles() throw(uno::Runtime } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException) { @@ -409,7 +409,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw const ::sal_Int32 c = lSource.getLength(); if (c < 2) return lSource; - + const ::rtl::OUString sPath = lSource[0]; ::comphelper::SequenceAsVector< ::rtl::OUString > lTarget; ::sal_Int32 i = 1; @@ -425,26 +425,26 @@ uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw { // b) file is relative to given path ::rtl::OUStringBuffer sFull(256); - + sFull.append (sPath); sFull.appendAscii("/" ); sFull.append (sFile); - + lTarget.push_back(sFull.makeStringAndClear()); } } - + return lTarget.getAsConstList(); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); - + sal_Int16 ret; if (startupEventNotification(STARTUP_SUSPENDED)) @@ -461,7 +461,7 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) { OSL_ENSURE(sal_False, "Could not start event notifier thread!"); - throw uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString::createFromAscii("Error executing dialog"), static_cast<XFilePicker2*>(this)); } @@ -473,20 +473,20 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) // XFilePicker functions //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) +void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); - + osl::MutexGuard aGuard(m_aMutex); m_pImpl->setValue(aControlId, aControlAction, aValue); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) +uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -496,10 +496,10 @@ uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControl } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable) +void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable) throw(uno::RuntimeException) { OSL_ASSERT( 0 != m_pImpl.get( ) ); @@ -509,10 +509,10 @@ throw(uno::RuntimeException) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& aLabel) +void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& aLabel) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -522,10 +522,10 @@ void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) +rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -535,7 +535,7 @@ rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw (uno::RuntimeException) @@ -547,7 +547,7 @@ uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeException) @@ -559,7 +559,7 @@ sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeExcepti } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException) @@ -571,7 +571,7 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeException) @@ -583,10 +583,10 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeExceptio } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) +void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) throw (lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -596,19 +596,19 @@ void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aIma } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Bool SAL_CALL CFilePicker::setShowState(sal_Bool bShowState) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); - osl::MutexGuard aGuard(m_aMutex); + osl::MutexGuard aGuard(m_aMutex); return m_pImpl->setShowState(bShowState); } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) @@ -620,19 +620,19 @@ sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) +void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) throw( uno::Exception, uno::RuntimeException) { - // parameter checking + // parameter checking uno::Any aAny; if ( 0 == aArguments.getLength( ) ) throw lang::IllegalArgumentException( rtl::OUString::createFromAscii( "no arguments" ), static_cast<XFilePicker2*>(this), 1); - + aAny = aArguments[0]; if ( (aAny.getValueType() != ::getCppuType((sal_Int16*)0)) && @@ -697,7 +697,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID; break; - case FILEOPEN_PLAY: + case FILEOPEN_PLAY: if ( bIsWin2000 ) winResTemplateId = TMPL2000_PLAY_PUSHBUTTON; else @@ -732,19 +732,19 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) static_cast< XFilePicker2* >( this ), 1 ); } - + HINSTANCE hInstance = GetModuleHandle( FILE_PICKER_DLL_NAME ); OSL_POSTCOND( hInstance, "The name of the service dll must have changed" ); - // create a new impl-class here based on the + // create a new impl-class here based on the // given string, if the given string is empty // we do nothing - m_pImpl = std::auto_ptr< CWinFileOpenImpl >( - new CWinFileOpenImpl( - this, - bFileOpenDialog, - 0, - winResTemplateId, + m_pImpl = std::auto_ptr< CWinFileOpenImpl >( + new CWinFileOpenImpl( + this, + bFileOpenDialog, + 0, + winResTemplateId, hInstance ) ); } @@ -758,24 +758,24 @@ void SAL_CALL CFilePicker::cancel() OSL_ASSERT(m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); - m_pImpl->cancel(); + m_pImpl->cancel(); } // ------------------------------------------------- // XServiceInfo // ------------------------------------------------- -rtl::OUString SAL_CALL CFilePicker::getImplementationName() +rtl::OUString SAL_CALL CFilePicker::getImplementationName() throw(uno::RuntimeException) { return rtl::OUString::createFromAscii(FILE_PICKER_IMPL_NAME); } // ------------------------------------------------- -// XServiceInfo +// XServiceInfo // ------------------------------------------------- -sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName) +sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName) throw(uno::RuntimeException ) { uno::Sequence <rtl::OUString> SupportedServicesNames = FilePicker_getSupportedServiceNames(); @@ -788,10 +788,10 @@ sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName) } // ------------------------------------------------- -// XServiceInfo +// XServiceInfo // ------------------------------------------------- -uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getSupportedServiceNames() +uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getSupportedServiceNames() throw(uno::RuntimeException) { return FilePicker_getSupportedServiceNames(); |