fpicker/source/win32/VistaFilePickerEventHandler.cxx | 66 ++++++++----------- 1 file changed, 28 insertions(+), 38 deletions(-)
New commits: commit 1d44b6e877cfc31afcfc8925866407ae8771abad Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Apr 27 08:49:57 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Apr 27 12:06:26 2021 +0200 loplugin:staticmethods (clang-cl) Change-Id: Ib096abfeea6cefb5df562cf75448ef38e432344c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114695 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/fpicker/source/win32/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/VistaFilePickerEventHandler.cxx index 74e7682392c4..1c0650fb9efb 100644 --- a/fpicker/source/win32/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/VistaFilePickerEventHandler.cxx @@ -236,59 +236,49 @@ const OUStringLiteral PROP_PICKER_LISTENER = u"picker_listener"; namespace { -class PickerEvents +void doRequest(Request& rRequest) { -public: + const ::sal_Int32 nEventID = rRequest.getRequest(); + const ::sal_Int16 nControlID = rRequest.getArgumentOrDefault(PROP_CONTROL_ID, ::sal_Int16(0)); + const css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener = rRequest.getArgumentOrDefault(PROP_PICKER_LISTENER, css::uno::Reference< css::ui::dialogs::XFilePickerListener >()); - PickerEvents() - {} - - void doRequest(Request& rRequest) - { - const ::sal_Int32 nEventID = rRequest.getRequest(); - const ::sal_Int16 nControlID = rRequest.getArgumentOrDefault(PROP_CONTROL_ID, ::sal_Int16(0)); - const css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener = rRequest.getArgumentOrDefault(PROP_PICKER_LISTENER, css::uno::Reference< css::ui::dialogs::XFilePickerListener >()); - - if ( ! xListener.is()) - return; + if ( ! xListener.is()) + return; - css::ui::dialogs::FilePickerEvent aEvent; - aEvent.ElementId = nControlID; + css::ui::dialogs::FilePickerEvent aEvent; + aEvent.ElementId = nControlID; - switch (nEventID) - { - case VistaFilePickerEventHandler::E_FILE_SELECTION_CHANGED : - xListener->fileSelectionChanged(aEvent); - break; + switch (nEventID) + { + case VistaFilePickerEventHandler::E_FILE_SELECTION_CHANGED : + xListener->fileSelectionChanged(aEvent); + break; - case VistaFilePickerEventHandler::E_DIRECTORY_CHANGED : - xListener->directoryChanged(aEvent); - break; + case VistaFilePickerEventHandler::E_DIRECTORY_CHANGED : + xListener->directoryChanged(aEvent); + break; - case VistaFilePickerEventHandler::E_HELP_REQUESTED : - xListener->helpRequested(aEvent); - break; + case VistaFilePickerEventHandler::E_HELP_REQUESTED : + xListener->helpRequested(aEvent); + break; - case VistaFilePickerEventHandler::E_CONTROL_STATE_CHANGED : - xListener->controlStateChanged(aEvent); - break; + case VistaFilePickerEventHandler::E_CONTROL_STATE_CHANGED : + xListener->controlStateChanged(aEvent); + break; - case VistaFilePickerEventHandler::E_DIALOG_SIZE_CHANGED : - xListener->dialogSizeChanged(); - break; + case VistaFilePickerEventHandler::E_DIALOG_SIZE_CHANGED : + xListener->dialogSizeChanged(); + break; - // no default here. Let compiler detect changes on enum set ! - } + // no default here. Let compiler detect changes on enum set ! } -}; +} } void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType, ::sal_Int16 nControlID) { - static PickerEvents aNotify; - ::cppu::OInterfaceContainerHelper* pContainer = m_lListener.getContainer( cppu::UnoType<css::ui::dialogs::XFilePickerListener>::get()); if ( ! pContainer) return; @@ -306,7 +296,7 @@ void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType, if ( nControlID ) rRequest.setArgument(PROP_CONTROL_ID, nControlID); - aNotify.doRequest(rRequest); + doRequest(rRequest); } catch(const css::uno::RuntimeException&) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits