diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-11-10 15:06:12 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-11-10 15:06:12 +0000 |
commit | 7e6737cc865d9f0ba44a88b4be0c8460325d7b84 (patch) | |
tree | 1a77c19de7eb263e582261883c19c36a2032e9ec /fpicker | |
parent | 72339a084c6879c8437aee34a1f9daac50d2366e (diff) |
CWS-TOOLING: integrate CWS cmcfixes50
2008-11-10 13:31:50 +0100 cmc r263517 : gio doesn't do anything useful for remote stuff wrt info
2008-11-06 00:11:47 +0100 cmc r263359 : #i93436# pile of other 64bit new gcc warnings
2008-11-05 00:39:03 +0100 cmc r263340 : i95856 let a ppc64 vanilla build succeed
2008-11-04 14:00:25 +0100 cmc r263320 : #i93436# useless const
2008-11-04 11:53:10 +0100 cmc r263314 : #i93436# ambiguous
2008-11-04 11:48:05 +0100 cmc r263313 : #i93436# add some braces
2008-11-04 11:29:24 +0100 cmc r263312 : #i93436# ambiguous
2008-11-04 10:53:46 +0100 cmc r263311 :
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 12 | ||||
-rw-r--r-- | fpicker/source/unx/gnome/SalGtkFolderPicker.cxx | 6 | ||||
-rw-r--r-- | fpicker/source/unx/gnome/SalGtkPicker.cxx | 29 | ||||
-rw-r--r-- | fpicker/source/unx/gnome/SalGtkPicker.hxx | 8 |
4 files changed, 16 insertions, 39 deletions
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index 8e6ee1c376d3..d576a61b10df 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -999,13 +999,13 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) uno::Reference< awt::XExtendedToolkit > xToolkit( m_xServiceMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY); - RunDialog* pRunInMain = new RunDialog(m_pDialog, xToolkit); - uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunInMain); + RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit); + uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog); while( GTK_RESPONSE_NO == btn ) { btn = GTK_RESPONSE_YES; // we dont want to repeat unless user clicks NO for file save. - gint nStatus = pRunInMain->runandwaitforresult(); + gint nStatus = pRunDialog->run(); switch( nStatus ) { case GTK_RESPONSE_ACCEPT: @@ -1032,9 +1032,9 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) OUStringToOString(aResProvider.getResString(FILE_PICKER_TITLE_SAVE ), RTL_TEXTENCODING_UTF8 ).getStr() ); - RunDialog* pAnotherRunInMain = new RunDialog(dlg, xToolkit); - uno::Reference < awt::XTopWindowListener > xAnotherLifeCycle(pAnotherRunInMain); - btn = pAnotherRunInMain->runandwaitforresult(); + RunDialog* pAnotherDialog = new RunDialog(dlg, xToolkit); + uno::Reference < awt::XTopWindowListener > xAnotherLifeCycle(pAnotherDialog); + btn = pAnotherDialog->run(); gtk_widget_destroy( dlg ); } diff --git a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx index c5f2f7ee7911..753d6b8eb32f 100644 --- a/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFolderPicker.cxx @@ -176,9 +176,9 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute() throw( uno::RuntimeException ) uno::Reference< awt::XExtendedToolkit > xToolkit( m_xServiceMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY); - RunDialog* pRunInMain = new RunDialog(m_pDialog, xToolkit); - uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunInMain); - gint nStatus = pRunInMain->runandwaitforresult(); + RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit); + uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog); + gint nStatus = pRunDialog->run(); switch( nStatus ) { case GTK_RESPONSE_ACCEPT: diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx index 6cf3b4451418..3ed92ff8d718 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx @@ -124,7 +124,7 @@ extern "C" RunDialog::RunDialog( GtkWidget *pDialog, uno::Reference< awt::XExtendedToolkit >& rToolkit ) : cppu::WeakComponentImplHelper1< awt::XTopWindowListener >( maLock ), - mbFinished(false), mpDialog(pDialog), mpCreatedParent(NULL), mxToolkit(rToolkit) + mpDialog(pDialog), mpCreatedParent(NULL), mxToolkit(rToolkit) { awt::SystemDependentXWindow aWindowHandle; @@ -178,39 +178,20 @@ void RunDialog::cancel() gtk_widget_hide( mpDialog ); } -void RunDialog::run() +gint RunDialog::run() { if (mxToolkit.is()) mxToolkit->addTopWindowListener(this); - mnStatus = gtk_dialog_run( GTK_DIALOG( mpDialog ) ); + gint nStatus = gtk_dialog_run( GTK_DIALOG( mpDialog ) ); if (mxToolkit.is()) mxToolkit->removeTopWindowListener(this); - - if (mnStatus != 1) //PLAY + if (nStatus != 1) //PLAY gtk_widget_hide( mpDialog ); - maLock.acquire(); - mbFinished = true; - maLock.release(); - - Application::EndYield(); -} - -gint RunDialog::runandwaitforresult() -{ - g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, (GSourceFunc)rundialog, this, NULL); - while (1) - { - maLock.acquire(); - if (mbFinished) - break; - maLock.release(); - Application::Yield(); - } - return mnStatus; + return nStatus; } SalGtkPicker::~SalGtkPicker() diff --git a/fpicker/source/unx/gnome/SalGtkPicker.hxx b/fpicker/source/unx/gnome/SalGtkPicker.hxx index ed246ad3248d..2cc910b7adff 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.hxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.hxx @@ -74,8 +74,7 @@ class SalGtkPicker static rtl::OString unicodetouri(const rtl::OUString &rURL); }; -//Run the Gtk Dialog in the "Main Thread" for us to avoid threading conflict and -//report back to this thread. Watch for any "new windows" created while we're +//Run the Gtk Dialog. Watch for any "new windows" created while we're //executing and consider that a CANCEL event to avoid e.g. "file cannot be opened" //modal dialogs and this one getting locked if some other API call causes this //to happen while we're opened waiting for user input, e.g. @@ -84,9 +83,7 @@ class RunDialog : public cppu::WeakComponentImplHelper1< ::com::sun::star::awt::XTopWindowListener > { private: - bool mbFinished; osl::Mutex maLock; - gint mnStatus; GtkWidget *mpDialog; GdkWindow *mpCreatedParent; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit> mxToolkit; @@ -112,8 +109,7 @@ public: throw (::com::sun::star::uno::RuntimeException) {} public: RunDialog(GtkWidget *pDialog, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit > &rToolkit); - gint runandwaitforresult(); - void run(); + gint run(); void cancel(); ~RunDialog(); }; |