summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-11-10 15:06:12 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-11-10 15:06:12 +0000
commitf62287f17796d08d34b0099b9e89b388de5169ae (patch)
tree6e45a0108112686df5c94b708c2be3c2f5325035 /fpicker
parent568308cc6c84ed198ddd58c4a478c68ddf216daa (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.cxx12
-rw-r--r--fpicker/source/unx/gnome/SalGtkFolderPicker.cxx6
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.cxx29
-rw-r--r--fpicker/source/unx/gnome/SalGtkPicker.hxx8
4 files changed, 16 insertions, 39 deletions
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx
index 38c3bdddad..2a47da4c0d 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 0abce004f6..a19f1cc29d 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 71c9fab41a..d517e465a5 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 a9dfca150f..a520117c0e 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();
};