summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-01-23 07:08:52 +0000
committerOliver Bolte <obo@openoffice.org>2007-01-23 07:08:52 +0000
commit92af84b28669752f9c58bef5721d30e795cb57d0 (patch)
tree6e2f40353d713b6341d5c024eb60f2de47d5a6f7 /uui
parent697dfdda54487535639eaed6da630be34b720b30 (diff)
INTEGRATION: CWS updchk03 (1.55.2); FILE MERGED
2006/12/21 13:37:48 dv 1.55.2.1: getStringFromRequest can't get strings when not in main thread
Diffstat (limited to 'uui')
-rw-r--r--uui/source/iahndl.cxx45
1 files changed, 41 insertions, 4 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 2bfffc2e610e..7012ca023fc1 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: iahndl.cxx,v $
*
- * $Revision: 1.55 $
+ * $Revision: 1.56 $
*
- * last change: $Author: kz $ $Date: 2006-12-13 16:24:21 $
+ * last change: $Author: obo $ $Date: 2007-01-23 08:08:52 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -346,8 +346,8 @@ public:
m_rRequest(rRequest)
{
}
-
star::uno::Reference< star::task::XInteractionRequest > m_rRequest;
+ star::beans::Optional< rtl::OUString > m_aResult;
};
long UUIInteractionHelper::handlerequest(
@@ -387,8 +387,18 @@ UUIInteractionHelper::handleRequest(
handle_impl(rRequest);
}
+long UUIInteractionHelper::getstringfromrequest(
+ void* pHandleData,void* pInteractionHelper)
+{
+ HandleData* pHND = (HandleData*) pHandleData;
+ UUIInteractionHelper* pUUI = (UUIInteractionHelper*) pInteractionHelper;
+ pHND->m_aResult = pUUI->getStringFromRequest_impl(pHND->m_rRequest);
+ pHND->set();
+ return 0;
+}
+
star::beans::Optional< rtl::OUString >
-UUIInteractionHelper::getStringFromRequest(
+UUIInteractionHelper::getStringFromRequest_impl(
star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
throw (star::uno::RuntimeException)
{
@@ -402,6 +412,33 @@ UUIInteractionHelper::getStringFromRequest(
return star::beans::Optional< rtl::OUString >(bSuccess, aMessage);
}
+star::beans::Optional< rtl::OUString >
+UUIInteractionHelper::getStringFromRequest(
+ star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
+ throw (star::uno::RuntimeException)
+{
+ Application* pApp = 0;
+ if(
+ // be aware,it is the same type
+ ((oslThreadIdentifier) Application::GetMainThreadIdentifier())
+ != osl_getThreadIdentifier(NULL)
+ &&
+ (pApp = GetpApp())
+ != 0
+ ) {
+ // we are not in the main thread, let it handle that stuff
+ HandleData aHD(rRequest);
+ Link aLink(&aHD,getstringfromrequest);
+ pApp->PostUserEvent(aLink,this);
+ ULONG locks = Application::ReleaseSolarMutex();
+ aHD.wait();
+ Application::AcquireSolarMutex(locks);
+ return aHD.m_aResult;
+ }
+ else
+ return getStringFromRequest_impl(rRequest);
+}
+
void UUIInteractionHelper::handleMessageboxRequests(
star::uno::Reference< star::task::XInteractionRequest > const & rRequest,
bool bObtainErrorStringOnly,