diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-09-12 23:08:14 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-09-12 23:29:32 +0300 |
commit | 01755200f6c01afc5c5970141501aea084e8b770 (patch) | |
tree | 188839c69a1b40be80c1e4e841a270f4ffdcc24f /fpicker | |
parent | 5177666536f65915c3ca07090a4b561b57ae6f63 (diff) |
Bin some noise comments and superfluous vertical whitespace
Change-Id: I3c19457bb29cd1392f14598fc8798aed4b1a1a7f
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/aqua/SalAquaFilePicker.mm | 42 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaFolderPicker.mm | 24 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaPicker.mm | 5 | ||||
-rw-r--r-- | fpicker/source/aqua/resourceprovider.mm | 44 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/FPentry.cxx | 16 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/FilePicker.cxx | 64 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/FilterContainer.cxx | 34 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/PreviewCtrl.cxx | 44 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.cxx | 45 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/WinFileOpenImpl.cxx | 75 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/controlaccess.cxx | 18 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/filepickereventnotification.cxx | 14 | ||||
-rw-r--r-- | fpicker/source/win32/folderpicker/FolderPicker.cxx | 26 | ||||
-rw-r--r-- | fpicker/source/win32/folderpicker/WinFOPImpl.cxx | 16 | ||||
-rw-r--r-- | fpicker/source/win32/misc/WinImplHelper.cxx | 24 | ||||
-rw-r--r-- | fpicker/source/win32/misc/resourceprovider.cxx | 12 |
16 files changed, 13 insertions, 490 deletions
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index 5ef1b40e0594..5240db3d65ca 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -51,9 +51,6 @@ #pragma mark DEFINES -// namespace directives - - using namespace ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::ui::dialogs::TemplateDescription; @@ -63,10 +60,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; - -// helper functions - - namespace { uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() @@ -81,9 +74,6 @@ namespace #pragma mark Constructor -// constructor - - SalAquaFilePicker::SalAquaFilePicker() : SalAquaFilePicker_Base( m_rbHelperMtx ) , m_pFilterHelper( nullptr ) @@ -103,9 +93,6 @@ SalAquaFilePicker::~SalAquaFilePicker() #pragma mark XFilePickerNotifier -// XFilePickerNotifier - - void SAL_CALL SalAquaFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener ) throw( uno::RuntimeException ) { @@ -122,8 +109,6 @@ void SAL_CALL SalAquaFilePicker::removeFilePickerListener( const uno::Reference< #pragma mark XAsynchronousExecutableDialog -// XExecutableDialog functions - void SAL_CALL SalAquaFilePicker::setTitle( const rtl::OUString& aTitle ) throw( uno::RuntimeException ) { SolarMutexGuard aGuard; @@ -215,9 +200,6 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException ) #pragma mark XFilePicker -// XFilePicker functions - - void SAL_CALL SalAquaFilePicker::setMultiSelectionMode( sal_Bool /* bMode */ ) throw( uno::RuntimeException ) { SolarMutexGuard aGuard; @@ -327,9 +309,6 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles() thro #pragma mark XFilterManager -// XFilterManager functions - - void SAL_CALL SalAquaFilePicker::appendFilter( const rtl::OUString& aTitle, const rtl::OUString& aFilter ) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -363,9 +342,6 @@ rtl::OUString SAL_CALL SalAquaFilePicker::getCurrentFilter() throw( uno::Runtime #pragma mark XFilterGroupManager -// XFilterGroupManager functions - - void SAL_CALL SalAquaFilePicker::appendFilterGroup( const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters ) throw( lang::IllegalArgumentException, uno::RuntimeException ) { @@ -378,9 +354,6 @@ throw( lang::IllegalArgumentException, uno::RuntimeException ) #pragma mark XFilePickerControlAccess -// XFilePickerControlAccess functions - - void SAL_CALL SalAquaFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any& rValue ) throw( uno::RuntimeException ) { @@ -424,9 +397,6 @@ throw( uno::RuntimeException ) #pragma mark XInitialization -// XInitialization - - void SAL_CALL SalAquaFilePicker::initialize( const uno::Sequence<uno::Any>& aArguments ) throw( uno::Exception, uno::RuntimeException ) { @@ -502,9 +472,6 @@ throw( uno::Exception, uno::RuntimeException ) #pragma mark XCancellable -// XCancellable - - void SAL_CALL SalAquaFilePicker::cancel() throw( uno::RuntimeException ) { SolarMutexGuard aGuard; @@ -516,9 +483,6 @@ void SAL_CALL SalAquaFilePicker::cancel() throw( uno::RuntimeException ) #pragma mark XEventListener -// XEventListener - - void SAL_CALL SalAquaFilePicker::disposing( const lang::EventObject& aEvent ) throw( uno::RuntimeException ) { SolarMutexGuard aGuard; @@ -531,9 +495,6 @@ void SAL_CALL SalAquaFilePicker::disposing( const lang::EventObject& aEvent ) th #pragma mark XServiceInfo -// XServiceInfo - - rtl::OUString SAL_CALL SalAquaFilePicker::getImplementationName() throw( uno::RuntimeException ) { @@ -556,9 +517,6 @@ throw( uno::RuntimeException ) #pragma mark Misc/Private -// FilePicker Event functions - - void SAL_CALL SalAquaFilePicker::fileSelectionChanged( FilePickerEvent aEvent ) { if (m_xListener.is()) diff --git a/fpicker/source/aqua/SalAquaFolderPicker.mm b/fpicker/source/aqua/SalAquaFolderPicker.mm index 0de50e03b8f2..24c1817c2084 100644 --- a/fpicker/source/aqua/SalAquaFolderPicker.mm +++ b/fpicker/source/aqua/SalAquaFolderPicker.mm @@ -42,18 +42,11 @@ #pragma mark DEFINES -// namespace directives - - using namespace ::com::sun::star; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; - -// helper functions - - namespace { // controlling event notifications @@ -66,18 +59,13 @@ namespace } } - -// constructor - SalAquaFolderPicker::SalAquaFolderPicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr ) : m_xServiceMgr( xServiceMgr ) { m_nDialogType = NAVIGATIONSERVICES_DIRECTORY; } - -// XExecutableDialog functions - +// XExecutableDialog void SAL_CALL SalAquaFolderPicker::setTitle( const rtl::OUString& aTitle ) throw( uno::RuntimeException ) { @@ -120,9 +108,7 @@ sal_Int16 SAL_CALL SalAquaFolderPicker::execute() throw( uno::RuntimeException ) return retVal; } - -// XFolderPicker functions - +// XFolderPicker void SAL_CALL SalAquaFolderPicker::setDisplayDirectory( const rtl::OUString& aDirectory ) throw( lang::IllegalArgumentException, uno::RuntimeException ) @@ -174,10 +160,8 @@ void SAL_CALL SalAquaFolderPicker::setDescription( const rtl::OUString& rDescrip [m_pDialog setMessage:[NSString stringWithOUString:rDescription]]; } - // XServiceInfo - rtl::OUString SAL_CALL SalAquaFolderPicker::getImplementationName() throw( uno::RuntimeException ) { @@ -198,10 +182,8 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFolderPicker::getSupportedServiceNa return FolderPicker_getSupportedServiceNames(); } - // XCancellable - void SAL_CALL SalAquaFolderPicker::cancel() throw( uno::RuntimeException ) { SolarMutexGuard aGuard; @@ -209,10 +191,8 @@ void SAL_CALL SalAquaFolderPicker::cancel() throw( uno::RuntimeException ) [m_pDialog cancel:nil]; } - // XEventListener - void SAL_CALL SalAquaFolderPicker::disposing( const lang::EventObject& ) throw( uno::RuntimeException ) { diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm index 602850954e25..4452f6506968 100644 --- a/fpicker/source/aqua/SalAquaPicker.mm +++ b/fpicker/source/aqua/SalAquaPicker.mm @@ -40,15 +40,10 @@ #pragma mark DEFINES #define kSetHideExtensionStateKey @"NSNavLastUserSetHideExtensionButtonState" - -// namespace directives - - using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; -// constructor SalAquaPicker::SalAquaPicker() : m_pDialog(nullptr) , m_pControlHelper(new ControlHelper()) diff --git a/fpicker/source/aqua/resourceprovider.mm b/fpicker/source/aqua/resourceprovider.mm index e687809f768b..f7531cc34bb5 100644 --- a/fpicker/source/aqua/resourceprovider.mm +++ b/fpicker/source/aqua/resourceprovider.mm @@ -31,25 +31,15 @@ #include "resourceprovider.hxx" - -// namespace directives - - using rtl::OUString; using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds; using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; - - - - static const char* RES_NAME = "fps_office"; static const char* OTHER_RES_NAME = "svt"; - // we have to translate control ids to resource ids - struct Entry { sal_Int32 ctrlId; @@ -80,14 +70,9 @@ Entry OtherCtrlIdToResIdTable[] = { { FILE_PICKER_FILE_TYPE, STR_FILEDLG_TYPE } }; - const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable ); const sal_Int32 OTHER_SIZE_TABLE = SAL_N_ELEMENTS( OtherCtrlIdToResIdTable ); - - - - sal_Int16 CtrlIdToResId( sal_Int32 aControlId ) { sal_Int16 aResId = -1; @@ -120,38 +105,21 @@ sal_Int16 OtherCtrlIdToResId( sal_Int32 aControlId ) return aResId; } - - - - class CResourceProvider_Impl { public: - - - - - CResourceProvider_Impl( ) { m_ResMgr = ResMgr::CreateResMgr( RES_NAME ); m_OtherResMgr = ResMgr::CreateResMgr( OTHER_RES_NAME ); } - - - - ~CResourceProvider_Impl( ) { delete m_ResMgr; delete m_OtherResMgr; } - - - - NSString* getResString( sal_Int16 aId ) { OUString aResString; @@ -186,28 +154,16 @@ public: ResMgr* m_OtherResMgr; }; - - - - CResourceProvider::CResourceProvider( ) : m_pImpl( new CResourceProvider_Impl() ) { } - - - - CResourceProvider::~CResourceProvider( ) { delete m_pImpl; } - - - - NSString* CResourceProvider::getResString( sal_Int32 aId ) { NSString* sImmutable = m_pImpl->getResString( aId ); diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx index ff8891983c62..665007c47006 100644 --- a/fpicker/source/win32/filepicker/FPentry.cxx +++ b/fpicker/source/win32/filepicker/FPentry.cxx @@ -34,18 +34,13 @@ #include "../folderpicker/FOPServiceInfo.hxx" #include "../folderpicker/WinFOPImpl.hxx" - -// namespace directives - - -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 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::XFilePicker2; - static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) { @@ -79,7 +74,6 @@ createInstance_fop( const Reference< XMultiServiceFactory >& rServiceManager ) return Reference< XInterface >( static_cast< cppu::OWeakObject * >( new CFolderPicker( rServiceManager ) ) ); } - extern "C" { diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 3644f3f6303f..4acf64f0bc00 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -33,21 +33,12 @@ #include <comphelper/sequence.hxx> - -// namespace directives - - using namespace com::sun::star; - using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::ui::dialogs::TemplateDescription; #define FILE_PICKER_DLL_NAME L"fps.dll" - -// helper functions - - namespace { // controlling event notifications @@ -62,7 +53,6 @@ namespace } } - CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) : CFilePicker_Base(m_rbHelperMtx), m_xServiceMgr(xServiceMgr), @@ -81,10 +71,8 @@ CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xSer hInstance ) ); } - // XFPEventListenerManager - void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener) throw(uno::RuntimeException) { @@ -97,7 +85,6 @@ void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePicke rBHelper.aLC.addInterface(cppu::UnoType<decltype(xListener)>::get(), xListener ); } - void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>& xListener ) throw(uno::RuntimeException) { @@ -109,10 +96,8 @@ void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePi rBHelper.aLC.removeInterface(cppu::UnoType<decltype(xListener)>::get(), xListener ); } - // XEventListener - void SAL_CALL CFilePicker::disposing(const lang::EventObject& aEvent) throw(uno::RuntimeException) { uno::Reference<XFilePickerListener> xFilePickerListener(aEvent.Source, css::uno::UNO_QUERY); @@ -121,7 +106,6 @@ void SAL_CALL CFilePicker::disposing(const lang::EventObject& aEvent) throw(uno: removeFilePickerListener(xFilePickerListener); } - void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) { aEvent.Source.set(static_cast<XFilePickerNotifier*>(this)); @@ -129,7 +113,6 @@ void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) new CFilePickerParamEventNotification(&XFilePickerListener::fileSelectionChanged,aEvent)); } - void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) { aEvent.Source.set(static_cast<XFilePickerNotifier*>(this)); @@ -137,7 +120,6 @@ void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) new CFilePickerParamEventNotification(&XFilePickerListener::directoryChanged,aEvent)); } - void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent) { aEvent.Source.set(static_cast<XFilePickerNotifier*>(this)); @@ -145,17 +127,14 @@ void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent) new CFilePickerParamEventNotification(&XFilePickerListener::controlStateChanged,aEvent)); } - void SAL_CALL CFilePicker::dialogSizeChanged() { m_aAsyncEventNotifier.notifyEvent( new CFilePickerEventNotification(&XFilePickerListener::dialogSizeChanged)); } - // If there are more than one listener the return value of the last one wins - OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const { OUString aHelpText; @@ -198,33 +177,27 @@ OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const return aHelpText; } - bool CFilePicker::startupEventNotification(bool bStartupSuspended) { return m_aAsyncEventNotifier.startup(bStartupSuspended); } - void CFilePicker::shutdownEventNotification() { m_aAsyncEventNotifier.shutdown(); } - void CFilePicker::suspendEventNotification() { m_aAsyncEventNotifier.suspend(); } - void CFilePicker::resumeEventNotification() { m_aAsyncEventNotifier.resume(); } - -// XFilePicker functions - +// XFilePicker void SAL_CALL CFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(uno::RuntimeException) { @@ -233,7 +206,6 @@ void SAL_CALL CFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(uno::Runt m_pImpl->setMultiSelectionMode(bMode); } - void SAL_CALL CFilePicker::setTitle(const OUString& aTitle) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -241,7 +213,6 @@ void SAL_CALL CFilePicker::setTitle(const OUString& aTitle) throw(uno::RuntimeEx m_pImpl->setTitle(aTitle); } - void SAL_CALL CFilePicker::appendFilter(const OUString& aTitle, const OUString& aFilter) throw(lang::IllegalArgumentException, uno::RuntimeException) { @@ -250,7 +221,6 @@ void SAL_CALL CFilePicker::appendFilter(const OUString& aTitle, const OUString& m_pImpl->appendFilter(aTitle, aFilter); } - void SAL_CALL CFilePicker::setCurrentFilter(const OUString& aTitle) throw(lang::IllegalArgumentException, uno::RuntimeException) { @@ -259,7 +229,6 @@ void SAL_CALL CFilePicker::setCurrentFilter(const OUString& aTitle) m_pImpl->setCurrentFilter(aTitle); } - OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -267,7 +236,6 @@ OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException) return m_pImpl->getCurrentFilter(); } - void SAL_CALL CFilePicker::appendFilterGroup(const OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) throw (lang::IllegalArgumentException, uno::RuntimeException) { @@ -276,7 +244,6 @@ void SAL_CALL CFilePicker::appendFilterGroup(const OUString& sGroupTitle, const m_pImpl->appendFilterGroup(sGroupTitle, aFilters); } - void SAL_CALL CFilePicker::setDefaultName(const OUString& aName) throw(uno::RuntimeException) { @@ -285,7 +252,6 @@ void SAL_CALL CFilePicker::setDefaultName(const OUString& aName) m_pImpl->setDefaultName(aName); } - void SAL_CALL CFilePicker::setDisplayDirectory(const OUString& aDirectory) throw(lang::IllegalArgumentException, uno::RuntimeException) { @@ -294,7 +260,6 @@ void SAL_CALL CFilePicker::setDisplayDirectory(const OUString& aDirectory) m_pImpl->setDisplayDirectory(aDirectory); } - OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -302,7 +267,6 @@ OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeException return m_pImpl->getDisplayDirectory(); } - uno::Sequence<OUString> SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -310,7 +274,6 @@ uno::Sequence<OUString> SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeExcep return m_pImpl->getFiles(); } - uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException, std::exception) { OSL_ASSERT(0 != m_pImpl.get()); @@ -348,7 +311,6 @@ uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::R return comphelper::containerToSequence(lTarget); } - sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -377,10 +339,6 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) return ret; } - -// XFilePicker functions - - void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) throw(uno::RuntimeException) { @@ -390,7 +348,6 @@ void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlActi m_pImpl->setValue(aControlId, aControlAction, aValue); } - uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) throw(uno::RuntimeException) { @@ -400,7 +357,6 @@ uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControl return m_pImpl->getValue(aControlId, aControlAction); } - void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable) throw(uno::RuntimeException) { @@ -410,7 +366,6 @@ throw(uno::RuntimeException) m_pImpl->enableControl( aControlId, bEnable ); } - void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const OUString& aLabel) throw (uno::RuntimeException) { @@ -420,7 +375,6 @@ void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const OUString& aLabel m_pImpl->setLabel(aControlId, aLabel); } - OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) throw (uno::RuntimeException) { @@ -430,7 +384,6 @@ OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) return m_pImpl->getLabel(aControlId); } - uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -439,7 +392,6 @@ uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw return m_pImpl->getSupportedImageFormats(); } - sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -448,7 +400,6 @@ sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeExcepti return m_pImpl->getTargetColorDepth(); } - sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -457,7 +408,6 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException return m_pImpl->getAvailableWidth(); } - sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -466,7 +416,6 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeExceptio return m_pImpl->getAvailableHeight(); } - void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) throw (lang::IllegalArgumentException, uno::RuntimeException) { @@ -476,7 +425,6 @@ void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aIma m_pImpl->setImage(aImageFormat, aImage); } - sal_Bool SAL_CALL CFilePicker::setShowState(sal_Bool bShowState) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -485,7 +433,6 @@ sal_Bool SAL_CALL CFilePicker::setShowState(sal_Bool bShowState) throw (uno::Run return m_pImpl->setShowState(bShowState); } - sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -494,7 +441,6 @@ sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) return m_pImpl->getShowState(); } - void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) throw( uno::Exception, uno::RuntimeException) { @@ -594,7 +540,6 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) hInstance ) ); } - void SAL_CALL CFilePicker::cancel() throw(uno::RuntimeException) { @@ -604,27 +549,20 @@ void SAL_CALL CFilePicker::cancel() m_pImpl->cancel(); } - // XServiceInfo - OUString SAL_CALL CFilePicker::getImplementationName() throw(uno::RuntimeException) { return OUString(FILE_PICKER_IMPL_NAME); } -// XServiceInfo sal_Bool SAL_CALL CFilePicker::supportsService(const OUString& ServiceName) throw(uno::RuntimeException ) { return cppu::supportsService(this, ServiceName); } - -// XServiceInfo - - uno::Sequence<OUString> SAL_CALL CFilePicker::getSupportedServiceNames() throw(uno::RuntimeException) { diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index a76afac50cc8..c23c2443f4ee 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -31,23 +31,14 @@ #pragma warning(pop) #endif - -// namespace directives - - -// ctor - - CFilterContainer::CFilterContainer( sal_Int32 initSize ) : m_vFilters( initSize ), m_bIterInitialized( sal_False ) { } - // add a name/filter pair - sal_Bool SAL_CALL CFilterContainer::addFilter( const OUString& aName, const OUString& aFilter, sal_Bool bAllowDuplicates ) { @@ -72,12 +63,10 @@ sal_Bool SAL_CALL CFilterContainer::addFilter( return ( pos < 0 ) ? sal_True : sal_False; } - // delete a filter // Precondition: the container is not empty // there is a filter identified by the given name - sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) { OSL_ASSERT( !m_vFilters.empty() ); @@ -92,30 +81,24 @@ sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) return ( pos > -1 ) ? sal_True : sal_False; } - // return the number of filters currently in the container - sal_Int32 SAL_CALL CFilterContainer::numFilter( ) { return m_vFilters.size( ); } - // clear all entries - void SAL_CALL CFilterContainer::empty() { m_vFilters.clear( ); } - // get a filter by name // Precondition: the container is not empty // there is a filter identified by the name - sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const { OSL_PRECOND( !m_vFilters.empty() , "Empty filter container" ); @@ -136,7 +119,6 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& return (pos > -1 ) ? sal_True : sal_False; } - sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const { sal_Bool bRet = sal_True; @@ -154,16 +136,13 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi return bRet; } - sal_Int32 SAL_CALL CFilterContainer::getFilterPos( const OUString& aName ) const { return getFilterTagPos( aName ); } - // returns the index of the filter identified by name - sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) const { if ( !m_vFilters.empty() ) @@ -180,20 +159,16 @@ sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) co return -1; } - // starts enumerating the filter in the container - void SAL_CALL CFilterContainer::beginEnumFilter( ) { m_iter = m_vFilters.begin( ); m_bIterInitialized = sal_True; } - // returns true if another filter has been retrieved - sal_Bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEntry ) { OSL_ASSERT( m_bIterInitialized ); @@ -208,24 +183,20 @@ sal_Bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEnt return bRet; } - void SAL_CALL CFilterContainer::setCurrentFilter( const OUString& aName ) { m_sCurrentFilter = aName; } - OUString SAL_CALL CFilterContainer::getCurrentFilter() const { return m_sCurrentFilter; } - // calculates the length of a '\0' separated filter, that means // length of the name + '\0' + length of the filter string + // a trailing '\0' - static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) { return ( @@ -233,10 +204,8 @@ static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntr aFilterEntry.second.getLength( ) + 1 ); } - // calculates the length of all filters currently in the container - static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) { CFilterContainer::FILTER_ENTRY_T nextFilter; @@ -250,19 +219,16 @@ static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) return ( totalLength > 0 ) ? totalLength + 1 : totalLength; } - inline void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) { memcpy( pDest, pSrc, nLength * sizeof( sal_Unicode ) ); } - // a helper trivial helper function to create a filter buffer in the // format the Win32 API requires, // e.g. "Text\0*.txt\0Doc\0*.doc;*xls\0\0" - OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) { // calculate the required buffer size diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.cxx b/fpicker/source/win32/filepicker/PreviewCtrl.cxx index a8ffc837b776..18bea27ed4dd 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.cxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.cxx @@ -40,18 +40,10 @@ // means 3 pixel top and 3 pixel bottom #define VERT_BORDER_SPACE 6 - -// static member initialization - - CFilePreview* CFilePreview::s_FilePreviewInst = NULL; CFilePreview::FILEPREVIEW_SINGLETON_DESTROYER_T CFilePreview::s_SingletonDestroyer; - -// some useful helper functions - - -namespace // private +namespace { class CPreviewException { @@ -59,42 +51,35 @@ namespace // private // of the preview window failed }; - inline sal_Int32 SubDiv( sal_Int32 nNumber, sal_Int32 nMinuend, sal_Int32 nDenominator ) { return ( static_cast<sal_Int32>( ( nNumber - nMinuend ) / nDenominator ) ); } - // convert himetric to pixel - inline sal_Int32 Himetric2Pixel( HDC hDC, sal_Int32 hmSize, sal_Int32 nIndex ) { return MulDiv( hmSize, GetDeviceCaps( hDC, nIndex), HIMETRIC_INCH ); } - inline sal_uInt32 _getWidthRect( const RECT& aRect ) { return ( aRect.right - aRect.left ); } - inline sal_uInt32 _getHeightRect( const RECT& aRect ) { return ( aRect.bottom - aRect.top ); } - // calc the upper left corner so that a given window will be // displayed centered within the given window - inline POINT _calcULCorner( HWND hwnd, const CDimension& aPicSize ) { @@ -111,12 +96,10 @@ namespace // private return ulCorner; } - // test if a picture with the given dimensions fits into an // arbitrary window // we expect the width and height to be in pixel - inline sal_Bool _pictureSizeFitsWindowSize( HWND hwnd, const CDimension& aPicSize ) { @@ -130,12 +113,10 @@ namespace // private ( ( nHeightWnd - VERT_BORDER_SPACE ) >= aPicSize.m_cy ) ); } - // calc the dimensions so that a given picture fits into a // given window, if the picture fits into the given window // the original CDimension will be returned - inline CDimension _scalePictureSize( HWND hwnd, const CDimension& aPicSize ) { @@ -169,13 +150,10 @@ namespace // private return scaledPicSize; } - -} // end namespace - +} // unnamed namespace // to ensure only one instance (singleton) - CFilePreview* CFilePreview::createInstance( HWND aParent, POINT ulCorner, @@ -207,7 +185,6 @@ CFilePreview* CFilePreview::createInstance( return s_FilePreviewInst; } - CFilePreview::CFilePreview( HWND aParent, POINT ulCorner, @@ -258,7 +235,6 @@ CFilePreview::CFilePreview( throw CPreviewException( ); } - CFilePreview::~CFilePreview( ) { // unregister preview window class @@ -268,10 +244,8 @@ CFilePreview::~CFilePreview( ) SAL_WARN_IF( !bRet, "fpicker", "Unregister preview window class failed" ); } - // sets the size of the preview window - sal_Bool SAL_CALL CFilePreview::setSize( const CDimension& aSize ) { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); @@ -287,10 +261,8 @@ sal_Bool SAL_CALL CFilePreview::setSize( const CDimension& aSize ) SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); } - // returns the dimension of the preview - sal_Bool SAL_CALL CFilePreview::getSize( CDimension& theSize ) const { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); @@ -304,12 +276,10 @@ sal_Bool SAL_CALL CFilePreview::getSize( CDimension& theSize ) const return bRet; } - // sets the position of the upper left corner // of the preview window relative to the // upper left corner of the parent window - sal_Bool SAL_CALL CFilePreview::setPos( POINT ulCorner ) { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); @@ -325,12 +295,10 @@ sal_Bool SAL_CALL CFilePreview::setPos( POINT ulCorner ) SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); } - // returns the current position of the preview // relative to the upper left corner of the // parent window - sal_Bool SAL_CALL CFilePreview::getPos( POINT& ulCorner ) const { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); @@ -348,7 +316,6 @@ sal_Bool SAL_CALL CFilePreview::getPos( POINT& ulCorner ) const return bRet; } - void SAL_CALL CFilePreview::enable( sal_Bool bEnable ) { m_bEnabled = bEnable; @@ -358,7 +325,6 @@ void SAL_CALL CFilePreview::enable( sal_Bool bEnable ) UpdateWindow( m_hwnd ); } - // shows the preview window // possible values see SHOW_STATE // SS_SHOW - make the window visible @@ -366,7 +332,6 @@ void SAL_CALL CFilePreview::enable( sal_Bool bEnable ) // SS_ENABLED - enable the window // SS_DISABLED - disable the window - sal_Bool SAL_CALL CFilePreview::show( sal_Bool bShow ) { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); @@ -375,7 +340,6 @@ sal_Bool SAL_CALL CFilePreview::show( sal_Bool bShow ) return ShowWindow( m_hwnd, showState ); } - // if the preview is shown and enabled // preview of the given file will be shown // returns true on success or false if an error @@ -405,7 +369,6 @@ sal_Bool SAL_CALL CFilePreview::update( const OUString& aFileName ) return sal_True; } - void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC ) { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); @@ -455,7 +418,6 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC ) } } - sal_Bool CFilePreview::loadFile( const OUString& aFileName ) { HANDLE hFile = 0; @@ -523,7 +485,6 @@ CLEANUP_AND_EXIT: return ( SUCCEEDED( hr ) ); } - LRESULT CALLBACK CFilePreview::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { @@ -561,5 +522,4 @@ LRESULT CALLBACK CFilePreview::WndProc( return lResult; } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index 3297949a6aaf..5ac4647b52e0 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -53,10 +53,6 @@ #pragma warning (pop) #endif - -// namespace directives - - namespace fpicker{ namespace win32{ namespace vista{ @@ -72,7 +68,6 @@ namespace } } - VistaFilePicker::VistaFilePicker(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) : TVistaFilePickerBase (m_aMutex ) , m_xSMGR (xSMGR ) @@ -83,12 +78,10 @@ VistaFilePicker::VistaFilePicker(const css::uno::Reference< css::lang::XMultiSer { } - VistaFilePicker::~VistaFilePicker() { } - void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener) throw(css::uno::RuntimeException) { @@ -99,7 +92,6 @@ void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::removeFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw(css::uno::RuntimeException) { @@ -110,13 +102,11 @@ void SAL_CALL VistaFilePicker::removeFilePickerListener(const css::uno::Referenc m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::disposing(const css::lang::EventObject& /*aEvent*/) throw(css::uno::RuntimeException) { } - void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(css::uno::RuntimeException) { @@ -127,7 +117,6 @@ void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode) m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::setTitle(const OUString& sTitle) throw(css::uno::RuntimeException) { @@ -138,7 +127,6 @@ void SAL_CALL VistaFilePicker::setTitle(const OUString& sTitle) m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::appendFilter(const OUString& sTitle , const OUString& sFilter) throw(css::lang::IllegalArgumentException, @@ -152,7 +140,6 @@ void SAL_CALL VistaFilePicker::appendFilter(const OUString& sTitle , m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::setCurrentFilter(const OUString& sTitle) throw(css::lang::IllegalArgumentException, css::uno::RuntimeException ) @@ -164,7 +151,6 @@ void SAL_CALL VistaFilePicker::setCurrentFilter(const OUString& sTitle) m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - OUString SAL_CALL VistaFilePicker::getCurrentFilter() throw(css::uno::RuntimeException) { @@ -177,7 +163,6 @@ OUString SAL_CALL VistaFilePicker::getCurrentFilter() return sTitle; } - void SAL_CALL VistaFilePicker::appendFilterGroup(const OUString& /*sGroupTitle*/, const css::uno::Sequence< css::beans::StringPair >& rFilters ) throw (css::lang::IllegalArgumentException, @@ -190,7 +175,6 @@ void SAL_CALL VistaFilePicker::appendFilterGroup(const OUString& m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::setDefaultName(const OUString& sName ) throw(css::uno::RuntimeException) { @@ -201,7 +185,6 @@ void SAL_CALL VistaFilePicker::setDefaultName(const OUString& sName ) m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) @@ -226,7 +209,6 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory) m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - OUString SAL_CALL VistaFilePicker::getDisplayDirectory() throw(css::uno::RuntimeException) { @@ -238,7 +220,6 @@ OUString SAL_CALL VistaFilePicker::getDisplayDirectory() return sDirectory; } - // @deprecated can't be supported any longer ... see IDL description for further details css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles() throw(css::uno::RuntimeException) @@ -252,7 +233,6 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles() return lFiles; } - css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles() throw(css::uno::RuntimeException, std::exception) { @@ -266,7 +246,6 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles() return lFiles; } - ::sal_Int16 SAL_CALL VistaFilePicker::execute() throw(css::uno::RuntimeException) { @@ -299,9 +278,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles() return nResult; } - -// XFilePicker functions - +// XFilePicker void SAL_CALL VistaFilePicker::setValue( ::sal_Int16 nControlId , ::sal_Int16 nControlAction, @@ -317,7 +294,6 @@ void SAL_CALL VistaFilePicker::setValue( ::sal_Int16 nControlId , m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - css::uno::Any SAL_CALL VistaFilePicker::getValue(::sal_Int16 nControlId , ::sal_Int16 nControlAction) throw(css::uno::RuntimeException) @@ -332,7 +308,6 @@ css::uno::Any SAL_CALL VistaFilePicker::getValue(::sal_Int16 nControlId , return aValue; } - void SAL_CALL VistaFilePicker::enableControl(::sal_Int16 nControlId, sal_Bool bEnable ) throw(css::uno::RuntimeException) @@ -345,7 +320,6 @@ void SAL_CALL VistaFilePicker::enableControl(::sal_Int16 nControlId, m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, const OUString& sLabel ) throw (css::uno::RuntimeException) @@ -358,7 +332,6 @@ void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); } - OUString SAL_CALL VistaFilePicker::getLabel(::sal_Int16 nControlId) throw (css::uno::RuntimeException) { @@ -371,35 +344,30 @@ OUString SAL_CALL VistaFilePicker::getLabel(::sal_Int16 nControlId) return sLabel; } - css::uno::Sequence< ::sal_Int16 > SAL_CALL VistaFilePicker::getSupportedImageFormats() throw (css::uno::RuntimeException) { return css::uno::Sequence< sal_Int16 >(); } - sal_Int32 SAL_CALL VistaFilePicker::getTargetColorDepth() throw (css::uno::RuntimeException) { return 0; } - sal_Int32 SAL_CALL VistaFilePicker::getAvailableWidth() throw (css::uno::RuntimeException) { return 0; } - sal_Int32 SAL_CALL VistaFilePicker::getAvailableHeight() throw (css::uno::RuntimeException) { return 0; } - void SAL_CALL VistaFilePicker::setImage( sal_Int16 /*nImageFormat*/, const css::uno::Any& /*aImage */) throw (css::lang::IllegalArgumentException, @@ -407,21 +375,18 @@ void SAL_CALL VistaFilePicker::setImage( sal_Int16 /*nImageFormat*/, { } - sal_Bool SAL_CALL VistaFilePicker::setShowState(sal_Bool /*bShowState*/) throw (css::uno::RuntimeException) { return sal_False; } - sal_Bool SAL_CALL VistaFilePicker::getShowState() throw (css::uno::RuntimeException) { return sal_False; } - void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::Any >& lArguments) throw(css::uno::Exception , css::uno::RuntimeException) @@ -563,33 +528,25 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An } } - void SAL_CALL VistaFilePicker::cancel() throw(css::uno::RuntimeException) { } - // XServiceInfo - OUString SAL_CALL VistaFilePicker::getImplementationName() throw(css::uno::RuntimeException) { return OUString("com.sun.star.comp.fpicker.VistaFileDialog"); } -// XServiceInfo sal_Bool SAL_CALL VistaFilePicker::supportsService(const OUString& sServiceName) throw(css::uno::RuntimeException ) { return cppu::supportsService(this, sServiceName); } - -// XServiceInfo - - css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSupportedServiceNames() throw(css::uno::RuntimeException) { diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index c226fc415ca7..479fadb3ce8e 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -37,10 +37,6 @@ #include <osl/thread.hxx> #include "filepickerstate.hxx" - -// namespace directives - - using namespace com::sun::star; using com::sun::star::ui::dialogs::FilePickerEvent; @@ -51,10 +47,8 @@ using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds; using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; using namespace ::com::sun::star::ui::dialogs::ListboxControlActions; - // to distinguish what to do in the enum child window callback function - enum ECW_ACTION_T { INIT_CUSTOM_CONTROLS, @@ -72,10 +66,6 @@ struct EnumParam {} }; - -// ctor - - CWinFileOpenImpl::CWinFileOpenImpl( CFilePicker* aFilePicker, sal_Bool bFileOpenDialog, @@ -95,20 +85,14 @@ CWinFileOpenImpl::CWinFileOpenImpl( m_FilePickerState = m_NonExecuteFilePickerState; } - -// dtor - - CWinFileOpenImpl::~CWinFileOpenImpl() { delete m_ExecuteFilePickerState; delete m_NonExecuteFilePickerState; } - // we expect the directory in URL format - void CWinFileOpenImpl::setDisplayDirectory(const OUString& aDirectory) throw( IllegalArgumentException, uno::RuntimeException ) { @@ -135,16 +119,13 @@ void CWinFileOpenImpl::setDisplayDirectory(const OUString& aDirectory) CFileOpenDialog::setDisplayDirectory(aSysDirectory); } - // we return the directory in URL format - OUString CWinFileOpenImpl::getDisplayDirectory() throw(uno::RuntimeException) { return m_FilePickerState->getDisplayDirectory(this); } - void SAL_CALL CWinFileOpenImpl::setDefaultName(const OUString& aName) throw( IllegalArgumentException, uno::RuntimeException ) { @@ -158,24 +139,20 @@ void SAL_CALL CWinFileOpenImpl::setDefaultName(const OUString& aName) m_defaultName = aName; } - // return format: URL // if multiselection is allowed there are two different cases // 1. one file selected: the sequence contains one entry path\filename.ext // 2. multiple files selected: the sequence contains multiple entries // the first entry is the path url, all other entries are file names - uno::Sequence<OUString> SAL_CALL CWinFileOpenImpl::getFiles() throw(uno::RuntimeException) { return m_FilePickerState->getFiles(this); } - // shows the FileOpen/FileSave dialog - sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException) { sal_Int16 rc = CFileOpenDialog::doModal(); @@ -192,12 +169,10 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException) return rc; } - // appends a new filter // returns false if the title (aTitle) was already added or the title or the filter are // empty - void SAL_CALL CWinFileOpenImpl::appendFilter(const OUString& aTitle, const OUString& aFilter) throw(IllegalArgumentException, uno::RuntimeException) { @@ -219,10 +194,8 @@ void SAL_CALL CWinFileOpenImpl::appendFilter(const OUString& aTitle, const OUStr CFileOpenDialog::setFilterIndex(1); } - // sets a current filter - void SAL_CALL CWinFileOpenImpl::setCurrentFilter(const OUString& aTitle) throw( IllegalArgumentException, uno::RuntimeException) { @@ -237,10 +210,8 @@ void SAL_CALL CWinFileOpenImpl::setCurrentFilter(const OUString& aTitle) CFileOpenDialog::setFilterIndex(filterPos + 1); } - // returns the currently selected filter - OUString SAL_CALL CWinFileOpenImpl::getCurrentFilter() throw(uno::RuntimeException) { sal_uInt32 nIndex = getSelectedFilterIndex(); @@ -257,16 +228,13 @@ OUString SAL_CALL CWinFileOpenImpl::getCurrentFilter() throw(uno::RuntimeExcepti return currentFilter; } - inline void SAL_CALL CWinFileOpenImpl::appendFilterGroupSeparator() { m_filterContainer->addFilter(FILTER_SEPARATOR, ALL_FILES_WILDCARD, ALLOW_DUPLICATES); } - // XFilterGroupManager - void SAL_CALL CWinFileOpenImpl::appendFilterGroup(const OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) throw (IllegalArgumentException, uno::RuntimeException) { @@ -289,10 +257,8 @@ void SAL_CALL CWinFileOpenImpl::appendFilterGroup(const OUString& sGroupTitle, c } } - // XExtendedFilePicker - // #i90917: Due to a different feature set for the system-dependent file pickers // it's possible that generic code (e.g. sfx2) provides control ids // (see ExtendedFilePickerElementIds::LISTBOX_FILTER_SELECTOR) which are NOT @@ -313,11 +279,9 @@ void SAL_CALL CWinFileOpenImpl::setValue(sal_Int16 aControlId, sal_Int16 aContro m_FilePickerState->setValue(aControlId, aControlAction, aValue); } - // returns the value of an custom template element // we assume that there are only checkboxes or comboboxes - uno::Any SAL_CALL CWinFileOpenImpl::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) throw(uno::RuntimeException) { @@ -328,10 +292,8 @@ uno::Any SAL_CALL CWinFileOpenImpl::getValue(sal_Int16 aControlId, sal_Int16 aCo return uno::Any(); } - // enables a custom template element - void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEnable) throw(uno::RuntimeException) { @@ -340,7 +302,6 @@ void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEna m_FilePickerState->enableControl(ControlID, bEnable); } - void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const OUString& aLabel ) throw (uno::RuntimeException) { @@ -349,7 +310,6 @@ void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const OUString& m_FilePickerState->setLabel(aControlId, aLabel); } - OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId ) throw (uno::RuntimeException) { @@ -360,56 +320,48 @@ OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId ) return OUString(); } - uno::Sequence<sal_Int16> SAL_CALL CWinFileOpenImpl::getSupportedImageFormats() throw (uno::RuntimeException) { return m_Preview->getSupportedImageFormats(); } - sal_Int32 SAL_CALL CWinFileOpenImpl::getTargetColorDepth() throw (uno::RuntimeException) { return m_Preview->getTargetColorDepth(); } - sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableWidth() throw (uno::RuntimeException) { return m_Preview->getAvailableWidth(); } - sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableHeight() throw (uno::RuntimeException) { return m_Preview->getAvailableHeight(); } - void SAL_CALL CWinFileOpenImpl::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) throw (IllegalArgumentException, uno::RuntimeException) { m_Preview->setImage(aImageFormat,aImage); } - sal_Bool SAL_CALL CWinFileOpenImpl::setShowState(sal_Bool bShowState) throw (uno::RuntimeException) { return m_Preview->setShowState(bShowState); } - sal_Bool SAL_CALL CWinFileOpenImpl::getShowState() throw (uno::RuntimeException) { return m_Preview->getShowState(); } - void SAL_CALL CWinFileOpenImpl::cancel() { if (IsWindow(m_hwndFileOpenDlg)) @@ -425,10 +377,8 @@ void SAL_CALL CWinFileOpenImpl::cancel() } } - // returns the id of a custom template element - sal_Int16 SAL_CALL CWinFileOpenImpl::getFocused() { int nID = GetDlgCtrlID(GetFocus()); @@ -442,18 +392,15 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::getFocused() return sal::static_int_cast< sal_Int16 >(nID); } - inline sal_Bool SAL_CALL CWinFileOpenImpl::IsCustomControlHelpRequested(LPHELPINFO lphi) const { return ((lphi->iCtrlId != IDOK) && (lphi->iCtrlId != IDCANCEL) && (lphi->iCtrlId < ctlFirst)); } - // our own DlgProc because we do subclass the dialog // we catch the WM_NCDESTROY message in order to erase an entry in our static map // if one instance dies - LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam) { @@ -521,7 +468,6 @@ LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( return lResult; } - void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd) { @@ -534,7 +480,6 @@ void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd) setLabel(aCtrlId, aLabel); } - // There may be problems with the layout of our custom controls, // so that they are not aligned with the standard controls of the // FileOpen dialog. @@ -547,21 +492,18 @@ void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd) // and all push buttons will be left aligned with the standard // "OK" button - void SAL_CALL CWinFileOpenImpl::InitCustomControlContainer(HWND hCustomControl) { m_CustomControls->AddControl( CCustomControlFactory::CreateCustomControl(hCustomControl,m_hwndFileOpenDlg)); } - void SAL_CALL CWinFileOpenImpl::CacheControlState(HWND hWnd) { OSL_ASSERT(m_FilePickerState && m_NonExecuteFilePickerState); m_ExecuteFilePickerState->cacheControlState(hWnd, m_NonExecuteFilePickerState); } - BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) { EnumParam* enumParam = (EnumParam*)lParam; @@ -590,7 +532,6 @@ BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) return bRet; } - sal_uInt32 SAL_CALL CWinFileOpenImpl::onFileOk() { m_NonExecuteFilePickerState->reset(); @@ -605,7 +546,6 @@ sal_uInt32 SAL_CALL CWinFileOpenImpl::onFileOk() return 0; } - void SAL_CALL CWinFileOpenImpl::onSelChanged(HWND) { // the windows file open dialog sends an initial @@ -740,14 +680,12 @@ void SAL_CALL CWinFileOpenImpl::onInitDone() CFileOpenDialog::onInitDone(); } - void SAL_CALL CWinFileOpenImpl::onFolderChanged() { FilePickerEvent evt; m_FilePicker->directoryChanged(evt); } - void SAL_CALL CWinFileOpenImpl::onTypeChanged(sal_uInt32) { SetDefaultExtension(); @@ -757,10 +695,8 @@ void SAL_CALL CWinFileOpenImpl::onTypeChanged(sal_uInt32) m_FilePicker->controlStateChanged(evt); } - // onMessageCommand handler - sal_uInt32 SAL_CALL CWinFileOpenImpl::onCtrlCommand( HWND, sal_uInt16 ctrlId, sal_uInt16) { @@ -776,7 +712,6 @@ sal_uInt32 SAL_CALL CWinFileOpenImpl::onCtrlCommand( return 0; } - void CWinFileOpenImpl::onWMSize() { m_Preview->notifyParentSizeChanged(); @@ -784,19 +719,16 @@ void CWinFileOpenImpl::onWMSize() m_FilePicker->dialogSizeChanged(); } - void CWinFileOpenImpl::onWMShow(sal_Bool bShow) { m_Preview->notifyParentShow(bShow); } - void CWinFileOpenImpl::onWMWindowPosChanged() { m_Preview->notifyParentWindowPosChanged(); } - void CWinFileOpenImpl::onCustomControlHelpRequest(LPHELPINFO lphi) { FilePickerEvent evt; @@ -813,7 +745,6 @@ void CWinFileOpenImpl::onCustomControlHelpRequest(LPHELPINFO lphi) } } - void SAL_CALL CWinFileOpenImpl::onInitDialog(HWND hwndDlg) { // subclass the dialog window @@ -823,10 +754,8 @@ void SAL_CALL CWinFileOpenImpl::onInitDialog(HWND hwndDlg) reinterpret_cast<LONG_PTR>(SubClassFunc))); } - // processing before showing the dialog - bool SAL_CALL CWinFileOpenImpl::preModal() { CFileOpenDialog::setFilter( @@ -835,10 +764,8 @@ bool SAL_CALL CWinFileOpenImpl::preModal() return true; } - // processing after showing the dialog - void CWinFileOpenImpl::postModal(sal_Int16 nDialogResult) { CFileOpenDialog::postModal(nDialogResult); @@ -851,7 +778,6 @@ void CWinFileOpenImpl::postModal(sal_Int16 nDialogResult) m_FilePickerState = m_NonExecuteFilePickerState; } - void SAL_CALL CWinFileOpenImpl::SetDefaultExtension() { HWND hwndChkSaveWithExt = GetDlgItem(m_hwndFileOpenDlgChild, 100); @@ -898,7 +824,6 @@ void SAL_CALL CWinFileOpenImpl::SetDefaultExtension() // !!! HACK !!! } - void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName() { // manually setting the file name that appears diff --git a/fpicker/source/win32/filepicker/controlaccess.cxx b/fpicker/source/win32/filepicker/controlaccess.cxx index 64ada1c5f134..451c6caad3bd 100644 --- a/fpicker/source/win32/filepicker/controlaccess.cxx +++ b/fpicker/source/win32/filepicker/controlaccess.cxx @@ -22,23 +22,15 @@ #include "controlaccess.hxx" #include "../misc/WinImplHelper.hxx" - // we are using a table based algorithm to dispatch control // actions there is one table containing one action table for // each control class and one action table per control class // which contains function pointer to control action functions - -// namespace directives - - -namespace // private +namespace { - - // table setup - CTRL_SETVALUE_FUNCTION_T CheckboxSetValueFunctionTable[] = { CheckboxSetState @@ -104,7 +96,6 @@ namespace // private { NULL, 0 } }; - CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_SETVALUE_FUNCTION_T* aCtrlSetValueFunctionTable, size_t aTableSize, sal_Int16 aCtrlAction ) { @@ -116,7 +107,6 @@ namespace // private return aCtrlSetValueFunctionTable[aCtrlAction]; } - CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_GETVALUE_FUNCTION_T* aCtrlGetValueFunctionTable, size_t aTableSize, sal_Int16 aCtrlAction ) { @@ -128,14 +118,12 @@ namespace // private return aCtrlGetValueFunctionTable[aCtrlAction]; } - inline _ENTRY SAL_CALL GetCtrlClassSetValueFunctionTable( CTRL_CLASS aCtrlClass ) { return CtrlClassSetValueFunctionTable[aCtrlClass]; } - inline _ENTRY SAL_CALL GetCtrlClassGetValueFunctionTable( CTRL_CLASS aCtrlClass ) { @@ -157,7 +145,6 @@ namespace // private }; // end namespace - CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction ) { _ENTRY aEntry = @@ -169,7 +156,6 @@ CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass aCtrlAction ); } - CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction ) { _ENTRY aEntry = @@ -181,7 +167,6 @@ CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass aCtrlAction ); } - CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl ) { CTRL_CLASS aCtrlClass = UNKNOWN; @@ -208,7 +193,6 @@ CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl ) return aCtrlClass; } - int SAL_CALL CommonFilePickerCtrlIdToWinFileOpenCtrlId( sal_Int16 aControlId ) { if ( aControlId < 0 || aControlId > SIZE_WINDOWS_FILEOPEN_CTRL_IDS ) diff --git a/fpicker/source/win32/filepicker/filepickereventnotification.cxx b/fpicker/source/win32/filepicker/filepickereventnotification.cxx index a93fa5a0ce76..04d463758725 100644 --- a/fpicker/source/win32/filepicker/filepickereventnotification.cxx +++ b/fpicker/source/win32/filepicker/filepickereventnotification.cxx @@ -20,24 +20,16 @@ #include "filepickereventnotification.hxx" #include <sal/types.h> - -// namespace directives - - using namespace com::sun::star::uno; using namespace com::sun::star::ui::dialogs; - -// A FilePicker event without -// parameter - +// A FilePicker event without parameter CFilePickerEventNotification::CFilePickerEventNotification(EventListenerMethod_t EventListenerMethod) : m_EventListenerMethod(EventListenerMethod) { } - void SAL_CALL CFilePickerEventNotification::notifyEventListener( Reference< XInterface > xListener ) { Reference<XFilePickerListener> xFilePickerListener(xListener,UNO_QUERY); @@ -45,20 +37,16 @@ void SAL_CALL CFilePickerEventNotification::notifyEventListener( Reference< XInt (xFilePickerListener.get()->*m_EventListenerMethod)(); } - // A FilePicker event with parameter - CFilePickerParamEventNotification::CFilePickerParamEventNotification(EventListenerMethod_t EventListenerMethod, const FilePickerEvent& FilePickerEvent) : m_EventListenerMethod(EventListenerMethod), m_FilePickerEvent(FilePickerEvent) { } - // A FilePicker event with parameter - void SAL_CALL CFilePickerParamEventNotification::notifyEventListener( Reference< XInterface > xListener ) { Reference<XFilePickerListener> xFilePickerListener(xListener,UNO_QUERY); diff --git a/fpicker/source/win32/folderpicker/FolderPicker.cxx b/fpicker/source/win32/folderpicker/FolderPicker.cxx index 11010296f8b9..28f4a257e7fa 100644 --- a/fpicker/source/win32/folderpicker/FolderPicker.cxx +++ b/fpicker/source/win32/folderpicker/FolderPicker.cxx @@ -23,10 +23,6 @@ #include <cppuhelper/supportsservice.hxx> #include "WinFOPImpl.hxx" - -// namespace directives - - using com::sun::star::uno::Reference; using com::sun::star::uno::RuntimeException; using com::sun::star::uno::Sequence; @@ -40,10 +36,6 @@ using namespace com::sun::star::ui::dialogs; #define FOLDERPICKER_IMPL_NAME "com.sun.star.ui.dialogs.Win32FolderPicker" - -// helper functions - - namespace { Sequence< OUString > SAL_CALL FolderPicker_getSupportedServiceNames() @@ -53,14 +45,12 @@ namespace } } - CFolderPicker::CFolderPicker( const Reference< XMultiServiceFactory >& xServiceMgr ) : m_xServiceMgr( xServiceMgr ) { m_pFolderPickerImpl = std::unique_ptr< CWinFolderPickerImpl > ( new CWinFolderPickerImpl( this ) ); } - void SAL_CALL CFolderPicker::setTitle( const OUString& aTitle ) throw( RuntimeException ) { OSL_ASSERT( m_pFolderPickerImpl.get( ) ); @@ -68,7 +58,6 @@ void SAL_CALL CFolderPicker::setTitle( const OUString& aTitle ) throw( RuntimeEx m_pFolderPickerImpl->setTitle( aTitle ); } - void SAL_CALL CFolderPicker::setDisplayDirectory( const OUString& aDirectory ) throw( IllegalArgumentException, RuntimeException ) { @@ -77,7 +66,6 @@ void SAL_CALL CFolderPicker::setDisplayDirectory( const OUString& aDirectory ) m_pFolderPickerImpl->setDisplayDirectory( aDirectory ); } - OUString SAL_CALL CFolderPicker::getDisplayDirectory( ) throw( RuntimeException ) { @@ -86,7 +74,6 @@ OUString SAL_CALL CFolderPicker::getDisplayDirectory( ) return m_pFolderPickerImpl->getDisplayDirectory( ); } - OUString SAL_CALL CFolderPicker::getDirectory( ) throw( RuntimeException ) { OSL_ASSERT( m_pFolderPickerImpl.get( ) ); @@ -94,7 +81,6 @@ OUString SAL_CALL CFolderPicker::getDirectory( ) throw( RuntimeException ) return m_pFolderPickerImpl->getDirectory( ); } - void SAL_CALL CFolderPicker::setDescription( const OUString& aDescription ) throw( RuntimeException ) { OSL_ASSERT( m_pFolderPickerImpl.get( ) ); @@ -102,7 +88,6 @@ void SAL_CALL CFolderPicker::setDescription( const OUString& aDescription ) thro m_pFolderPickerImpl->setDescription( aDescription ); } - sal_Int16 SAL_CALL CFolderPicker::execute( ) throw( RuntimeException ) { @@ -115,37 +100,28 @@ sal_Int16 SAL_CALL CFolderPicker::execute( ) return m_pFolderPickerImpl->execute( ); } - // XServiceInfo - OUString SAL_CALL CFolderPicker::getImplementationName( ) throw( RuntimeException ) { return OUString( FOLDERPICKER_IMPL_NAME ); } -// XServiceInfo sal_Bool SAL_CALL CFolderPicker::supportsService( const OUString& ServiceName ) throw( RuntimeException ) { return cppu::supportsService(this, ServiceName); } - -// XServiceInfo - - Sequence< OUString > SAL_CALL CFolderPicker::getSupportedServiceNames( ) throw( RuntimeException ) { return FolderPicker_getSupportedServiceNames(); } - // XCancellable - void SAL_CALL CFolderPicker::cancel( ) throw(RuntimeException) { @@ -154,11 +130,9 @@ void SAL_CALL CFolderPicker::cancel( ) m_pFolderPickerImpl->cancel( ); } - // overwrite base class method, which is called // by base class dispose function - void SAL_CALL CFolderPicker::disposing() { } diff --git a/fpicker/source/win32/folderpicker/WinFOPImpl.cxx b/fpicker/source/win32/folderpicker/WinFOPImpl.cxx index 9c6d100135af..c5dd9b5ab6d5 100644 --- a/fpicker/source/win32/folderpicker/WinFOPImpl.cxx +++ b/fpicker/source/win32/folderpicker/WinFOPImpl.cxx @@ -25,23 +25,14 @@ #include <osl/file.hxx> #include "FolderPicker.hxx" - -// namespace directives - - using com::sun::star::uno::RuntimeException; using com::sun::star::lang::IllegalArgumentException; using namespace com::sun::star::ui::dialogs; using osl::FileBase; - const OUString BACKSLASH( "\\" ); - -// ctor - - CWinFolderPickerImpl::CWinFolderPickerImpl( CFolderPicker* aFolderPicker ) : CMtaFolderPicker( BIF_RETURNONLYFSDIRS | BIF_RETURNFSANCESTORS | BIF_EDITBOX | BIF_VALIDATE ), m_pFolderPicker( aFolderPicker ), @@ -49,7 +40,6 @@ CWinFolderPickerImpl::CWinFolderPickerImpl( CFolderPicker* aFolderPicker ) : { } - // get directory in URL format, convert it to system format and set the // member variable // If the given URL for the directory is invalid the function throws an @@ -57,7 +47,6 @@ CWinFolderPickerImpl::CWinFolderPickerImpl( CFolderPicker* aFolderPicker ) : // If the specified path is well formed but invalid for the underlying // OS the FolderPicker starts in the root of the file system hierarchy - void SAL_CALL CWinFolderPickerImpl::setDisplayDirectory( const OUString& aDirectory ) throw( IllegalArgumentException, RuntimeException ) { @@ -90,10 +79,8 @@ void SAL_CALL CWinFolderPickerImpl::setDisplayDirectory( const OUString& aDirect CMtaFolderPicker::setDisplayDirectory( sysDir ); } - // we return the directory in URL format - OUString CWinFolderPickerImpl::getDisplayDirectory( ) throw( RuntimeException ) { @@ -107,7 +94,6 @@ OUString CWinFolderPickerImpl::getDisplayDirectory( ) return displayDirectoryURL; } - OUString SAL_CALL CWinFolderPickerImpl::getDirectory( ) throw( RuntimeException ) { OUString sysDir = CMtaFolderPicker::getDirectory( ); @@ -119,7 +105,6 @@ OUString SAL_CALL CWinFolderPickerImpl::getDirectory( ) throw( RuntimeException return dirURL; } - sal_Int16 SAL_CALL CWinFolderPickerImpl::execute( ) throw( RuntimeException ) { return m_nLastDlgResult = CMtaFolderPicker::browseForFolder( ) ? @@ -127,7 +112,6 @@ sal_Int16 SAL_CALL CWinFolderPickerImpl::execute( ) throw( RuntimeException ) css::ui::dialogs::ExecutableDialogResults::CANCEL; } - void CWinFolderPickerImpl::onSelChanged( const OUString& aNewPath ) { setStatusText( aNewPath ); diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx index 785e755ba9e0..2f06476b573f 100644 --- a/fpicker/source/win32/misc/WinImplHelper.cxx +++ b/fpicker/source/win32/misc/WinImplHelper.cxx @@ -28,22 +28,17 @@ #include <VersionHelpers.h> #endif -// namespace directives - - using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Sequence; - const OUString TILDE( "~" ); const sal_Unicode TILDE_SIGN = L'~'; const OUString AMPERSAND( "&" ); const sal_Unicode AMPERSAND_SIGN = L'&'; - // OS NAME Platform Major Minor // Windows NT 3.51 VER_PLATFORM_WIN32_NT 3 51 @@ -59,7 +54,6 @@ const sal_Unicode AMPERSAND_SIGN = L'&'; // determine if we are running under Vista or newer OS - bool SAL_CALL IsWindowsVistaOrNewer() { // the Win32 SDK 8.1 deprecates GetVersionEx() @@ -83,7 +77,6 @@ bool SAL_CALL IsWindowsVistaOrNewer() #endif } - void SAL_CALL ListboxAddString( HWND hwnd, const OUString& aString ) { LRESULT rc = SendMessageW( @@ -92,7 +85,6 @@ void SAL_CALL ListboxAddString( HWND hwnd, const OUString& aString ) OSL_ASSERT( (CB_ERR != rc) && (CB_ERRSPACE != rc) ); } - OUString SAL_CALL ListboxGetString( HWND hwnd, sal_Int32 aPosition ) { OSL_ASSERT( IsWindow( hwnd ) ); @@ -124,7 +116,6 @@ OUString SAL_CALL ListboxGetString( HWND hwnd, sal_Int32 aPosition ) return aString; } - void SAL_CALL ListboxAddItem( HWND hwnd, const Any& aItem, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) throw( IllegalArgumentException ) { @@ -143,7 +134,6 @@ void SAL_CALL ListboxAddItem( HWND hwnd, const Any& aItem, const Reference< XInt ListboxAddString( hwnd, cbItem ); } - void SAL_CALL ListboxAddItems( HWND hwnd, const Any& aItemList, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) throw( IllegalArgumentException ) { @@ -166,7 +156,6 @@ void SAL_CALL ListboxAddItems( HWND hwnd, const Any& aItemList, const Reference< } } - void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) throw( IllegalArgumentException ) { @@ -195,7 +184,6 @@ void SAL_CALL ListboxDeleteItem( HWND hwnd, const Any& aPosition, const Referenc aArgPos ); } - void SAL_CALL ListboxDeleteItems( HWND hwnd, const Any&, const Reference< XInterface >&, sal_Int16 ) throw( IllegalArgumentException ) { @@ -212,7 +200,6 @@ void SAL_CALL ListboxDeleteItems( HWND hwnd, const Any&, const Reference< XInter while ( (lRet != CB_ERR) && (lRet > 0) ); } - void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) throw( IllegalArgumentException ) { @@ -245,7 +232,6 @@ void SAL_CALL ListboxSetSelectedItem( HWND hwnd, const Any& aPosition, const Ref aArgPos ); } - Any SAL_CALL ListboxGetItems( HWND hwnd ) { OSL_ASSERT( IsWindow( hwnd ) ); @@ -267,7 +253,6 @@ Any SAL_CALL ListboxGetItems( HWND hwnd ) return Any(aItemList); } - Any SAL_CALL ListboxGetSelectedItem( HWND hwnd ) { OSL_ASSERT( IsWindow( hwnd ) ); @@ -277,7 +262,6 @@ Any SAL_CALL ListboxGetSelectedItem( HWND hwnd ) return Any( ListboxGetString( hwnd, idxItem ) ); } - Any SAL_CALL ListboxGetSelectedItemIndex( HWND hwnd ) { OSL_ASSERT( IsWindow( hwnd ) ); @@ -287,7 +271,6 @@ Any SAL_CALL ListboxGetSelectedItemIndex( HWND hwnd ) return Any( static_cast< sal_Int32 >( idxItem ) ); } - Any SAL_CALL CheckboxGetState( HWND hwnd ) { OSL_ASSERT( IsWindow( hwnd ) ); @@ -297,7 +280,6 @@ Any SAL_CALL CheckboxGetState( HWND hwnd ) return Any(bChkState); } - void SAL_CALL CheckboxSetState( HWND hwnd, const css::uno::Any& aState, const Reference< XInterface >& rXInterface, sal_Int16 aArgPos ) throw( IllegalArgumentException ) @@ -316,7 +298,6 @@ void SAL_CALL CheckboxSetState( SendMessageW( hwnd, BM_SETCHECK, wParam, 0 ); } - sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr ) { if ( !pStr ) @@ -333,7 +314,6 @@ sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr ) return strLen; } - void Replace( const OUString& aLabel, sal_Unicode OldChar, sal_Unicode NewChar, OUStringBuffer& aBuffer ) { OSL_ASSERT( aLabel.getLength( ) ); @@ -388,7 +368,6 @@ void Replace( const OUString& aLabel, sal_Unicode OldChar, sal_Unicode NewChar, } } - // converts a soffice label to a windows label // the following rules for character replacements // will be done: @@ -396,7 +375,6 @@ void Replace( const OUString& aLabel, sal_Unicode OldChar, sal_Unicode NewChar, // '~~' -> '~' // '&' -> '&&' - OUString SOfficeToWindowsLabel( const OUString& aSOLabel ) { OUString aWinLabel = aSOLabel; @@ -419,7 +397,6 @@ OUString SOfficeToWindowsLabel( const OUString& aSOLabel ) return aWinLabel; } - // converts a windows label to a soffice label // the following rules for character replacements // will be done: @@ -427,7 +404,6 @@ OUString SOfficeToWindowsLabel( const OUString& aSOLabel ) // '&&' -> '&' // '~' -> '~~' - OUString WindowsToSOfficeLabel( const OUString& aWinLabel ) { OUString aSOLabel = aWinLabel; diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx index 55abde0239e6..25778aac84cf 100644 --- a/fpicker/source/win32/misc/resourceprovider.cxx +++ b/fpicker/source/win32/misc/resourceprovider.cxx @@ -29,21 +29,14 @@ #include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> - -// namespace directives - - using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds; using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; - #define FOLDERPICKER_TITLE 500 #define FOLDER_PICKER_DEF_DESCRIPTION 501 - // we have to translate control ids to resource ids - struct _Entry { sal_Int32 ctrlId; @@ -68,7 +61,6 @@ _Entry CtrlIdToResIdTable[] = { const sal_Int32 SIZE_TABLE = SAL_N_ELEMENTS( CtrlIdToResIdTable ); - sal_Int16 CtrlIdToResId( sal_Int32 aControlId ) { sal_Int16 aResId = -1; @@ -85,7 +77,6 @@ sal_Int16 CtrlIdToResId( sal_Int32 aControlId ) return aResId; } - class CResourceProvider_Impl { public: @@ -130,19 +121,16 @@ public: SimpleResMgr* m_ResMgr; }; - CResourceProvider::CResourceProvider( ) : m_pImpl( new CResourceProvider_Impl() ) { } - CResourceProvider::~CResourceProvider( ) { delete m_pImpl; } - OUString CResourceProvider::getResString( sal_Int16 aId ) { return m_pImpl->getResString( aId ); |