Commit 0485b9ebff809a6a32b494a12d184f79fca91ecb

Authored by perry.werneck@gmail.com
1 parent ebfa69d7

Ajustando configuração de sessão no objeto openoffice

src/oxt/actions.cxx
@@ -83,10 +83,10 @@ @@ -83,10 +83,10 @@
83 { 83 {
84 time_t end = time(0) + seconds; 84 time_t end = time(0) + seconds;
85 85
86 - osl_yieldThread();  
87 -  
88 while(time(0) < end) 86 while(time(0) < end)
89 { 87 {
  88 + osl_yieldThread();
  89 +
90 switch(hSession->get_state()) 90 switch(hSession->get_state())
91 { 91 {
92 case LIB3270_MESSAGE_NONE: 92 case LIB3270_MESSAGE_NONE:
src/oxt/main.cxx
@@ -313,10 +313,18 @@ void pw3270::uno_impl::failed(const char *fmt, ...) throw( ::com::sun::star::uno @@ -313,10 +313,18 @@ void pw3270::uno_impl::failed(const char *fmt, ...) throw( ::com::sun::star::uno
313 313
314 ::sal_Int16 SAL_CALL pw3270::uno_impl::setSession( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException) 314 ::sal_Int16 SAL_CALL pw3270::uno_impl::setSession( const ::rtl::OUString& name ) throw (::com::sun::star::uno::RuntimeException)
315 { 315 {
  316 + const char *ptr;
  317 +
316 OString str = rtl::OUStringToOString( name , hSession->get_encoding() ); 318 OString str = rtl::OUStringToOString( name , hSession->get_encoding() );
317 319
318 delete this->hSession; 320 delete this->hSession;
319 - this->hSession = new ipc3270_session(this,str.getStr()); 321 +
  322 + ptr = str.getStr();
  323 +
  324 + if(ptr && *ptr)
  325 + this->hSession = new ipc3270_session(this,str.getStr());
  326 + else
  327 + this->hSession = new lib3270_session(this);
320 328
321 return 0; 329 return 0;
322 } 330 }
src/oxt/testprogram.cxx
@@ -110,7 +110,7 @@ int SAL_CALL main(int argc, char **argv) @@ -110,7 +110,7 @@ int SAL_CALL main(int argc, char **argv)
110 try 110 try
111 { 111 {
112 112
113 - srv->setSession(OUString::createFromAscii("pw3270:a")); 113 + srv->setSession(OUString::createFromAscii("pw3270:a"));
114 114
115 } 115 }
116 catch( RuntimeException & e ) 116 catch( RuntimeException & e )