From 0485b9ebff809a6a32b494a12d184f79fca91ecb Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 25 Apr 2013 18:30:09 +0000 Subject: [PATCH] Ajustando configuração de sessão no objeto openoffice --- src/oxt/actions.cxx | 4 ++-- src/oxt/main.cxx | 10 +++++++++- src/oxt/testprogram.cxx | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/oxt/actions.cxx b/src/oxt/actions.cxx index db8cf0f..bd6b9c4 100644 --- a/src/oxt/actions.cxx +++ b/src/oxt/actions.cxx @@ -83,10 +83,10 @@ { time_t end = time(0) + seconds; - osl_yieldThread(); - while(time(0) < end) { + osl_yieldThread(); + switch(hSession->get_state()) { case LIB3270_MESSAGE_NONE: diff --git a/src/oxt/main.cxx b/src/oxt/main.cxx index 523b1cc..4f31bb0 100644 --- a/src/oxt/main.cxx +++ b/src/oxt/main.cxx @@ -313,10 +313,18 @@ void pw3270::uno_impl::failed(const char *fmt, ...) throw( ::com::sun::star::uno ::sal_Int16 SAL_CALL pw3270::uno_impl::setSession( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException) { + const char *ptr; + OString str = rtl::OUStringToOString( name , hSession->get_encoding() ); delete this->hSession; - this->hSession = new ipc3270_session(this,str.getStr()); + + ptr = str.getStr(); + + if(ptr && *ptr) + this->hSession = new ipc3270_session(this,str.getStr()); + else + this->hSession = new lib3270_session(this); return 0; } diff --git a/src/oxt/testprogram.cxx b/src/oxt/testprogram.cxx index 886b9b0..4bf09ad 100644 --- a/src/oxt/testprogram.cxx +++ b/src/oxt/testprogram.cxx @@ -110,7 +110,7 @@ int SAL_CALL main(int argc, char **argv) try { - srv->setSession(OUString::createFromAscii("pw3270:a")); + srv->setSession(OUString::createFromAscii("pw3270:a")); } catch( RuntimeException & e ) -- libgit2 0.21.2