1*9d1279ecSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*9d1279ecSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*9d1279ecSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*9d1279ecSAndrew Rist * distributed with this work for additional information 6*9d1279ecSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*9d1279ecSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*9d1279ecSAndrew Rist * "License"); you may not use this file except in compliance 9*9d1279ecSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*9d1279ecSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*9d1279ecSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*9d1279ecSAndrew Rist * software distributed under the License is distributed on an 15*9d1279ecSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*9d1279ecSAndrew Rist * KIND, either express or implied. See the License for the 17*9d1279ecSAndrew Rist * specific language governing permissions and limitations 18*9d1279ecSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*9d1279ecSAndrew Rist *************************************************************/ 21*9d1279ecSAndrew Rist 22*9d1279ecSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_automation.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir // do not use Application Idle but AutoTimer instead 28cdf0e10cSrcweir #define TIMERIDLE 29cdf0e10cSrcweir 30cdf0e10cSrcweir #define NO_JPEG 31cdf0e10cSrcweir 32cdf0e10cSrcweir #ifndef NO_JPEG 33cdf0e10cSrcweir #include <svtools/jpeg.hxx> 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir #include <vcl/timer.hxx> 36cdf0e10cSrcweir #include <vcl/wrkwin.hxx> 37cdf0e10cSrcweir #include <osl/diagnose.h> 38cdf0e10cSrcweir #include <osl/mutex.hxx> 39cdf0e10cSrcweir 40cdf0e10cSrcweir #ifndef _DIALOG_HXX //autogen 41cdf0e10cSrcweir #include <vcl/dialog.hxx> 42cdf0e10cSrcweir #endif 43cdf0e10cSrcweir #include <tools/stream.hxx> 44cdf0e10cSrcweir #include <tools/config.hxx> 45cdf0e10cSrcweir 46cdf0e10cSrcweir #include <vos/socket.hxx> 47cdf0e10cSrcweir 48cdf0e10cSrcweir #if 1 49cdf0e10cSrcweir #include <svtools/ttprops.hxx> 50cdf0e10cSrcweir #include <basic/ttstrhlp.hxx> 51cdf0e10cSrcweir #include <svl/stritem.hxx> 52cdf0e10cSrcweir #include <svtools/stringtransfer.hxx> 53cdf0e10cSrcweir #include <vcl/sound.hxx> 54cdf0e10cSrcweir #include "testtool.hrc" 55cdf0e10cSrcweir #include <vcl/bitmap.hxx> 56cdf0e10cSrcweir // Hat keinen Includeschutz 57cdf0e10cSrcweir #include <svtools/svtdata.hxx> 58cdf0e10cSrcweir //#ifndef _DTRANS_HXX //autogen 59cdf0e10cSrcweir //#include <so2/dtrans.hxx> 60cdf0e10cSrcweir //#endif 61cdf0e10cSrcweir #endif // 1 62cdf0e10cSrcweir #include <rtl/textenc.h> 63cdf0e10cSrcweir #include <rtl/uri.h> 64cdf0e10cSrcweir #include <rtl/uri.hxx> 65cdf0e10cSrcweir #include "statemnt.hxx" 66cdf0e10cSrcweir #include "scmdstrm.hxx" 67cdf0e10cSrcweir #include "rcontrol.hxx" 68cdf0e10cSrcweir #include "server.hxx" 69cdf0e10cSrcweir #include "testtool.hxx" 70cdf0e10cSrcweir #include "automation/automation.hxx" 71cdf0e10cSrcweir #include "recorder.hxx" 72cdf0e10cSrcweir 73cdf0e10cSrcweir #include "basic/svtmsg.hrc" 74cdf0e10cSrcweir 75cdf0e10cSrcweir #ifdef DBG_UTIL 76cdf0e10cSrcweir void TestToolDebugPrint( const sal_Char *pString ) 77cdf0e10cSrcweir { 78cdf0e10cSrcweir if ( !DbgFilterMessage( pString ) ) 79cdf0e10cSrcweir StatementList::DirectLog( S_AssertError, UniString( pString, RTL_TEXTENCODING_UTF8 ) ); 80cdf0e10cSrcweir } 81cdf0e10cSrcweir void SAL_CALL osl_TestToolDebugPrint( const sal_Char *pString ) 82cdf0e10cSrcweir { 83cdf0e10cSrcweir TestToolDebugPrint( pString ); 84cdf0e10cSrcweir } 85cdf0e10cSrcweir #endif 86cdf0e10cSrcweir 87cdf0e10cSrcweir 88cdf0e10cSrcweir sal_uLong RemoteControlCommunicationManager::nPortIs = TT_PORT_NOT_INITIALIZED; 89cdf0e10cSrcweir sal_uInt16 RemoteControlCommunicationManager::nComm = 0; 90cdf0e10cSrcweir sal_Bool RemoteControlCommunicationManager::bQuiet = sal_False; 91cdf0e10cSrcweir 92cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 93cdf0e10cSrcweir RemoteControlCommunicationManager::RemoteControlCommunicationManager( EditWindow * pDbgWin ) 94cdf0e10cSrcweir #else 95cdf0e10cSrcweir RemoteControlCommunicationManager::RemoteControlCommunicationManager() 96cdf0e10cSrcweir #endif 97cdf0e10cSrcweir : CommunicationManagerServerViaSocket( GetPort(), 1, sal_True ) 98cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 99cdf0e10cSrcweir , m_pDbgWin( pDbgWin ) 100cdf0e10cSrcweir #endif 101cdf0e10cSrcweir , pTimer( NULL ) 102cdf0e10cSrcweir { 103cdf0e10cSrcweir bIsPortValid = ( GetPort() != 0 ); 104cdf0e10cSrcweir if ( bQuiet ) 105cdf0e10cSrcweir { 106cdf0e10cSrcweir SetInfoType( CM_NO_TEXT ); 107cdf0e10cSrcweir } 108cdf0e10cSrcweir else 109cdf0e10cSrcweir { 110cdf0e10cSrcweir SetInfoType( CM_SHORT_TEXT | CM_ALL ); 111cdf0e10cSrcweir ByteString aByteString; 112cdf0e10cSrcweir InfoMsg( InfoString( aByteString, CM_ALL ) ); // Anzeigen, da� wir da sind 113cdf0e10cSrcweir } 114cdf0e10cSrcweir } 115cdf0e10cSrcweir 116cdf0e10cSrcweir RemoteControlCommunicationManager::~RemoteControlCommunicationManager() 117cdf0e10cSrcweir { 118cdf0e10cSrcweir if ( pTimer ) 119cdf0e10cSrcweir delete pTimer; 120cdf0e10cSrcweir DoQuickShutdown(); 121cdf0e10cSrcweir } 122cdf0e10cSrcweir 123cdf0e10cSrcweir void RemoteControlCommunicationManager::ConnectionOpened( CommunicationLink* pCL ) 124cdf0e10cSrcweir { 125cdf0e10cSrcweir StatementFlow::pCommLink = pCL; 126cdf0e10cSrcweir CommunicationManagerServerViaSocket::ConnectionOpened( pCL ); 127cdf0e10cSrcweir } 128cdf0e10cSrcweir 129cdf0e10cSrcweir 130cdf0e10cSrcweir void RemoteControlCommunicationManager::ConnectionClosed( CommunicationLink* pCL ) 131cdf0e10cSrcweir { 132cdf0e10cSrcweir StatementFlow::pCommLink = NULL; 133cdf0e10cSrcweir CommunicationManagerServerViaSocket::ConnectionClosed( pCL ); 134cdf0e10cSrcweir } 135cdf0e10cSrcweir 136cdf0e10cSrcweir 137cdf0e10cSrcweir IMPL_LINK( RemoteControlCommunicationManager, SetWinCaption, Timer*, EMPTYARG ) 138cdf0e10cSrcweir { 139cdf0e10cSrcweir if ( pTimer ) 140cdf0e10cSrcweir { 141cdf0e10cSrcweir delete pTimer; 142cdf0e10cSrcweir pTimer = NULL; 143cdf0e10cSrcweir } 144cdf0e10cSrcweir 145cdf0e10cSrcweir if ( StatementList::GetFirstDocFrame() ) 146cdf0e10cSrcweir { 147cdf0e10cSrcweir if ( !aOriginalWinCaption.Len() ) 148cdf0e10cSrcweir aOriginalWinCaption = StatementList::GetFirstDocFrame()->GetText(); 149cdf0e10cSrcweir StatementList::GetFirstDocFrame()->SetText(String(aOriginalWinCaption).AppendAscii(" TT").Append(aAdditionalWinCaption).AppendAscii("[").Append(UniString::CreateFromInt32(nPortToListen)).AppendAscii("]")); 150cdf0e10cSrcweir } 151cdf0e10cSrcweir else 152cdf0e10cSrcweir { // Dann Probieren wir es eben in 1 Sekunde nochmal 153cdf0e10cSrcweir pTimer = new Timer(); // Wird im Link gel�scht 154cdf0e10cSrcweir pTimer->SetTimeout( 1000 ); 155cdf0e10cSrcweir pTimer->SetTimeoutHdl( LINK( this, RemoteControlCommunicationManager, SetWinCaption ) ); 156cdf0e10cSrcweir pTimer->Start(); 157cdf0e10cSrcweir } 158cdf0e10cSrcweir return 0; 159cdf0e10cSrcweir } 160cdf0e10cSrcweir 161cdf0e10cSrcweir void RemoteControlCommunicationManager::InfoMsg( InfoString aMsg ) 162cdf0e10cSrcweir { 163cdf0e10cSrcweir if ( !bIsPortValid ) 164cdf0e10cSrcweir return; 165cdf0e10cSrcweir aAdditionalWinCaption = UniString( aMsg, RTL_TEXTENCODING_ASCII_US ); 166cdf0e10cSrcweir SetWinCaption(); 167cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 168cdf0e10cSrcweir m_pDbgWin->AddText( UniString( (ByteString)aMsg, RTL_TEXTENCODING_ASCII_US ) ); 169cdf0e10cSrcweir m_pDbgWin->AddText( "\n" ); 170cdf0e10cSrcweir #endif 171cdf0e10cSrcweir } 172cdf0e10cSrcweir 173cdf0e10cSrcweir sal_uLong RemoteControlCommunicationManager::GetPort() 174cdf0e10cSrcweir { 175cdf0e10cSrcweir if ( TT_PORT_NOT_INITIALIZED == nPortIs ) 176cdf0e10cSrcweir { // Read Config 177cdf0e10cSrcweir 178cdf0e10cSrcweir sal_uInt16 i; 179cdf0e10cSrcweir // are we to be automated at all? 180cdf0e10cSrcweir sal_Bool bAutomate = sal_False; 181cdf0e10cSrcweir for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) 182cdf0e10cSrcweir { 183cdf0e10cSrcweir if ( Application::GetCommandLineParam( i ).EqualsIgnoreCaseAscii("/enableautomation") 184cdf0e10cSrcweir || Application::GetCommandLineParam( i ).EqualsIgnoreCaseAscii("-enableautomation")) 185cdf0e10cSrcweir { 186cdf0e10cSrcweir bAutomate = sal_True; 187cdf0e10cSrcweir break; 188cdf0e10cSrcweir } 189cdf0e10cSrcweir } 190cdf0e10cSrcweir 191cdf0e10cSrcweir // if started within Portal determin location of testtool.ini/rc by analysing the commandline 192cdf0e10cSrcweir // /userid:demo1[/export/home/user/demo1] 193cdf0e10cSrcweir // -userid:demo1[/export/home/user/demo1] 194cdf0e10cSrcweir String aIniFileDir; 195cdf0e10cSrcweir for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) 196cdf0e10cSrcweir { 197cdf0e10cSrcweir if ( Application::GetCommandLineParam( i ).Copy(0,8).EqualsIgnoreCaseAscii("/userid:") 198cdf0e10cSrcweir || Application::GetCommandLineParam( i ).Copy(0,8).EqualsIgnoreCaseAscii("-userid:") ) 199cdf0e10cSrcweir { 200cdf0e10cSrcweir rtl::OUString aEncHome 201cdf0e10cSrcweir = Application::GetCommandLineParam(i).GetBuffer(); 202cdf0e10cSrcweir 203cdf0e10cSrcweir rtl::OUString aDecHome = rtl::Uri::decode(aEncHome, 204cdf0e10cSrcweir rtl_UriDecodeWithCharset, 205cdf0e10cSrcweir RTL_TEXTENCODING_UTF8); 206cdf0e10cSrcweir 207cdf0e10cSrcweir aIniFileDir = aDecHome; 208cdf0e10cSrcweir aIniFileDir.Erase( 0, aIniFileDir.Search('[')+1 ); 209cdf0e10cSrcweir aIniFileDir.Erase( aIniFileDir.Search(']') ); 210cdf0e10cSrcweir } 211cdf0e10cSrcweir } 212cdf0e10cSrcweir 213cdf0e10cSrcweir if ( ! aIniFileDir.Len() ) 214cdf0e10cSrcweir aIniFileDir = Config::GetDefDirectory(); 215cdf0e10cSrcweir 216cdf0e10cSrcweir Config aConf(Config::GetConfigName( aIniFileDir, CUniString("testtool") )); 217cdf0e10cSrcweir aConf.SetGroup("Communication"); 218cdf0e10cSrcweir 219cdf0e10cSrcweir ByteString aNoTesttoolKey( ByteString("Exclude_").Append( ByteString( Application::GetAppFileName(), RTL_TEXTENCODING_UTF8 ) ) ); 220cdf0e10cSrcweir // -notesttool 221cdf0e10cSrcweir for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) 222cdf0e10cSrcweir { 223cdf0e10cSrcweir if ( Application::GetCommandLineParam( i ).CompareIgnoreCaseToAscii("-notesttool") == COMPARE_EQUAL ) 224cdf0e10cSrcweir aConf.WriteKey( aNoTesttoolKey, "something" ); 225cdf0e10cSrcweir } 226cdf0e10cSrcweir 227cdf0e10cSrcweir nPortIs = aConf.ReadKey("TTPort","0").ToInt32(); 228cdf0e10cSrcweir 229cdf0e10cSrcweir // noch pr�fen ob dieses Office getestet werden soll. 230cdf0e10cSrcweir if ( !bAutomate || aConf.ReadKey( aNoTesttoolKey, "" ) != "" ) 231cdf0e10cSrcweir nPortIs = 0; 232cdf0e10cSrcweir 233cdf0e10cSrcweir nComm = (sal_uInt16)aConf.ReadKey("Comm","0").ToInt32(); 234cdf0e10cSrcweir if ( nComm ) 235cdf0e10cSrcweir aConf.DeleteKey("Comm"); 236cdf0e10cSrcweir 237cdf0e10cSrcweir bQuiet = ( aConf.ReadKey("Quiet","no").CompareIgnoreCaseToAscii("yes") == COMPARE_EQUAL ); 238cdf0e10cSrcweir } 239cdf0e10cSrcweir return nPortIs; 240cdf0e10cSrcweir } 241cdf0e10cSrcweir 242cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 243cdf0e10cSrcweir #define MIN_IDLE 10000 // Ruhe vor dem Sturm min 10 Sekunden 244cdf0e10cSrcweir #else 245cdf0e10cSrcweir #define MIN_IDLE 60000 // Ruhe vor dem Sturm min 1 Minuten 246cdf0e10cSrcweir #endif 247cdf0e10cSrcweir 248cdf0e10cSrcweir class ExtraIdle : public AutoTimer 249cdf0e10cSrcweir { 250cdf0e10cSrcweir virtual void Timeout(); 251cdf0e10cSrcweir 252cdf0e10cSrcweir sal_uInt16 nStep; 253cdf0e10cSrcweir ImplRemoteControl *pRemoteControl; 254cdf0e10cSrcweir public: 255cdf0e10cSrcweir ExtraIdle( ImplRemoteControl *pRC ); 256cdf0e10cSrcweir }; 257cdf0e10cSrcweir 258cdf0e10cSrcweir 259cdf0e10cSrcweir ExtraIdle::ExtraIdle( ImplRemoteControl *pRC ) 260cdf0e10cSrcweir : nStep( 0 ) 261cdf0e10cSrcweir , pRemoteControl (pRC ) 262cdf0e10cSrcweir { 263cdf0e10cSrcweir SetTimeout( 120000 ); // 2 Minuten 264cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 265cdf0e10cSrcweir SetTimeout( 40000 ); // 40 Sekunden 266cdf0e10cSrcweir #endif 267cdf0e10cSrcweir Start(); 268cdf0e10cSrcweir } 269cdf0e10cSrcweir 270cdf0e10cSrcweir void ExtraIdle::Timeout() 271cdf0e10cSrcweir { 272cdf0e10cSrcweir if ( !StatementList::pTTProperties ) 273cdf0e10cSrcweir StatementList::pTTProperties = new TTProperties(); 274cdf0e10cSrcweir 275cdf0e10cSrcweir if ( !StatementList::pTTProperties->GetSlots() ) 276cdf0e10cSrcweir { 277cdf0e10cSrcweir delete this; 278cdf0e10cSrcweir return; 279cdf0e10cSrcweir } 280cdf0e10cSrcweir 281cdf0e10cSrcweir // M�ssen wir selbst idlen? 282cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 283cdf0e10cSrcweir sal_uLong nLastInputInterval = Application::GetLastInputInterval(); 284cdf0e10cSrcweir sal_Bool bIsInModalMode = Application::IsInModalMode(); 285cdf0e10cSrcweir if ( bIsInModalMode || nLastInputInterval < MIN_IDLE ) 286cdf0e10cSrcweir #else 287cdf0e10cSrcweir if ( Application::IsInModalMode() || Application::GetLastInputInterval() < MIN_IDLE ) 288cdf0e10cSrcweir #endif 289cdf0e10cSrcweir { 290cdf0e10cSrcweir if ( nStep ) // Schon angefangen? dann abbrechen, sonst sp�ter nochmal 291cdf0e10cSrcweir { 292cdf0e10cSrcweir if ( nStep < 15 ) 293cdf0e10cSrcweir { 294cdf0e10cSrcweir Sound::Beep(); 295cdf0e10cSrcweir Sound::Beep(); 296cdf0e10cSrcweir } 297cdf0e10cSrcweir #if OSL_DEBUG_LEVEL < 2 298cdf0e10cSrcweir delete this; 299cdf0e10cSrcweir #endif 300cdf0e10cSrcweir } 301cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 302cdf0e10cSrcweir if ( nStep < 15 ) 303cdf0e10cSrcweir { 304cdf0e10cSrcweir Sound::Beep(); 305cdf0e10cSrcweir Sound::Beep(); 306cdf0e10cSrcweir } 307cdf0e10cSrcweir #endif 308cdf0e10cSrcweir return; 309cdf0e10cSrcweir } 310cdf0e10cSrcweir 311cdf0e10cSrcweir if ( StatementList::pFirst ) // Verarbeitung neu aufsetzen 312cdf0e10cSrcweir { 313cdf0e10cSrcweir GetpApp()->PostUserEvent( LINK( pRemoteControl, ImplRemoteControl, CommandHdl ) ); 314cdf0e10cSrcweir return; 315cdf0e10cSrcweir } 316cdf0e10cSrcweir 317cdf0e10cSrcweir 318cdf0e10cSrcweir switch ( nStep++ ) // Probieren ob wir noch was machen k�nnen 319cdf0e10cSrcweir { 320cdf0e10cSrcweir case 0: 321cdf0e10cSrcweir { 322cdf0e10cSrcweir SfxPoolItem *pItem = new SfxStringItem((sal_uInt16)StatementList::pTTProperties->nSidNewDocDirect, CUniString("swriter/web") ); 323cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidNewDocDirect, pItem ); 324cdf0e10cSrcweir SetTimeout(30000); 325cdf0e10cSrcweir return; 326cdf0e10cSrcweir } 327cdf0e10cSrcweir case 1: 328cdf0e10cSrcweir { 329cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidSourceView ); 330cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 331cdf0e10cSrcweir SetTimeout(7000); 332cdf0e10cSrcweir #else 333cdf0e10cSrcweir SetTimeout(1500); 334cdf0e10cSrcweir #endif 335cdf0e10cSrcweir return; 336cdf0e10cSrcweir } 337cdf0e10cSrcweir case 2: 338cdf0e10cSrcweir { 339cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidSelectAll ); 340cdf0e10cSrcweir return; 341cdf0e10cSrcweir } 342cdf0e10cSrcweir case 3: 343cdf0e10cSrcweir { 344cdf0e10cSrcweir 345cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 346cdf0e10cSrcweir //#define TT_NO_DECRYPT 347cdf0e10cSrcweir #define TT_CODE 348cdf0e10cSrcweir #else 349cdf0e10cSrcweir #define TT_CODE 350cdf0e10cSrcweir #endif 351cdf0e10cSrcweir 352cdf0e10cSrcweir #ifdef TT_NO_DECRYPT 353cdf0e10cSrcweir String aStr = 354cdf0e10cSrcweir "" 355cdf0e10cSrcweir ; 356cdf0e10cSrcweir 357cdf0e10cSrcweir #else 358cdf0e10cSrcweir ByteString aStr = 359cdf0e10cSrcweir "\n" 360cdf0e10cSrcweir "VRQJ`ob\n" 361cdf0e10cSrcweir "YEZO\n" 362cdf0e10cSrcweir "ob\n" 363cdf0e10cSrcweir "UmRo`\n" 364cdf0e10cSrcweir "5J~O2o5+90~5,6xW$+5:c9o0UXRm`Y UQ~JP~X]`Y\\|%Y`Yo]~O||2[pP0Y1J,|V),,7:,+|JS+U*[/O|K\n" 365cdf0e10cSrcweir "|KaLYNV~]]2W/]*Y9|`*Y,P=[5P|U\n" 366cdf0e10cSrcweir "]}mqbw`zZU\\L\n" 367cdf0e10cSrcweir "LZdYWo9\n" 368cdf0e10cSrcweir "/J\n" 369cdf0e10cSrcweir "U~[QoZ\n" 370cdf0e10cSrcweir "Rqd~V\n" 371cdf0e10cSrcweir ",)1~00\n" 372cdf0e10cSrcweir "\n" 373cdf0e10cSrcweir ")0~*2=\n" 374cdf0e10cSrcweir "++2\\5&K|~5n9r~9/*9<*~051*Q|0~0rY|~./97~Q*7,Z9<|KY0:=K*<=w~qY`IbOKzLwN,`7b,V~]E`]b\\ORE~\n" 375cdf0e10cSrcweir "\n" 376cdf0e10cSrcweir "Vq~bR`W;a+Y\\J=LKJa+W*I/PbR~JLUX[|b~`Z2P/R*[9a~W=9~/9p8=a*P=J0OZ~7L`JbL=P<WbaLQbPO]JYKbD\n" 377cdf0e10cSrcweir "aY`J5J:b~7=2~+9)9W1,50b9X3P0`YbYVJ`Jb \\`Z]`Vb\n" 378cdf0e10cSrcweir "VRQJ`b" 379cdf0e10cSrcweir ; 380cdf0e10cSrcweir #endif 381cdf0e10cSrcweir 382cdf0e10cSrcweir #ifdef TT_CODE 383cdf0e10cSrcweir for ( sal_uInt16 i = 0 ; i < aStr.Len() ; i++ ) 384cdf0e10cSrcweir { 385cdf0e10cSrcweir if ( aStr.GetChar(i) < 32 || aStr.GetChar(i) > 126 ) 386cdf0e10cSrcweir { 387cdf0e10cSrcweir // do nothing 388cdf0e10cSrcweir } 389cdf0e10cSrcweir else 390cdf0e10cSrcweir { 391cdf0e10cSrcweir aStr.SetChar( i, aStr.GetChar(i) - 32 ); 392cdf0e10cSrcweir aStr.SetChar( i, 126 - aStr.GetChar(i) ); 393cdf0e10cSrcweir } 394cdf0e10cSrcweir 395cdf0e10cSrcweir if ( i > (aStr.Len() / 2) && (i&1) ) 396cdf0e10cSrcweir { 397cdf0e10cSrcweir sal_Char c = aStr.GetChar(i); 398cdf0e10cSrcweir aStr.SetChar( i, aStr.GetChar(aStr.Len()-i-1) ); 399cdf0e10cSrcweir aStr.SetChar( aStr.Len()-i-1, c ); 400cdf0e10cSrcweir } 401cdf0e10cSrcweir } 402cdf0e10cSrcweir #endif 403cdf0e10cSrcweir 404cdf0e10cSrcweir ::svt::OStringTransfer::CopyString( UniString( aStr, RTL_TEXTENCODING_ASCII_US ), StatementList::GetFirstDocFrame() ); 405cdf0e10cSrcweir 406cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidPaste ); 407cdf0e10cSrcweir return; 408cdf0e10cSrcweir } 409cdf0e10cSrcweir case 4: 410cdf0e10cSrcweir { 411cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidSourceView ); 412cdf0e10cSrcweir return; 413cdf0e10cSrcweir } 414cdf0e10cSrcweir case 5: 415cdf0e10cSrcweir { 416cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidSelectAll ); 417cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidCopy ); 418cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidPaste ); 419cdf0e10cSrcweir return; 420cdf0e10cSrcweir } 421cdf0e10cSrcweir case 6: 422cdf0e10cSrcweir { 423cdf0e10cSrcweir ByteString aTr("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-"); 424cdf0e10cSrcweir ByteString aData = 425cdf0e10cSrcweir "P-S-0U04Fihixh00l0004b0b300-PS0g30428333y243q334j44426a6a65576c8k97aJecf7feccedg2inj3ghlshde5krk+lno" 426cdf0e10cSrcweir "PpqpBfjsgusp1unp-po-PS0gm044x465e6b6L6boygeg-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo-ooo" 427cdf0e10cSrcweir "-ooo-ooo-oo-1M04020Y30J0o080B040R040M-N0M700l010l000k000000000006000N011I112r222M-N0gJ40D000U001R011" 428cdf0e10cSrcweir "0110500vr0001014p148mcg1R4koV18s95cwkAE2V8gImM5kgQY9WcosCw22I556p669I99aoaadrddd6eeeNghhIhhiriik6lll" 429cdf0e10cSrcweir "NlmmImoprppp6qqqNsttItturuuw6xxxNxyyHyAA6BBBNBCCHCEE6FFFNFGGHGII6JJJNJKKHKMM6NNNNNOOHOQQ6RRRNRSSCSUU" 430cdf0e10cSrcweir "NUVVIVVWpWWYIYYZrZZZ6+++M-N0Q700R000l000l000g00000006000N011I112r222M-N0kJ40C0003110d1110110r00t6000" 431cdf0e10cSrcweir "Q041l18cF14gtk1ous48Acw295gAlEIMv28cxkY5FosQE2595dU9sY56q669N9aaCaddNdeeIeghrhhh6iiiNkllIllmrmmo6ppp" 432cdf0e10cSrcweir "NpqqIqstrttt6uuuIwwxrxxx6yyyIAABrBBB6CCCIEEFrFFF6GGGIIIJrJJJ6KKKIMMNrNNN6OOOIQQRrRRR6SSSIUUVrVVV6WWW" 433cdf0e10cSrcweir "IYYZrZZZ6+++U-S0d3009004Q040Of0TPU5QGjFCdPoji85WiqEopkCag321kP8dW4yO4KRlNi9iwzeTKup+Yk0lrdcicCEeLtVQ" 434cdf0e10cSrcweir "z1IFeROmSJBa7VYMYY-0EWGkJWH6LpAVdrUepM7ScEpkTBkenX3YGuoFVU0IGk+dSzPpv0N6U07eTPFgid-YtvOD2ws5C96qDgIL" 435cdf0e10cSrcweir "vhsoWmBPAozc+KgPjiVuW0TJnrt6PqF63p2VJEJ6A+l33JqESWh0G4yn1JkcaaEBnw17xmaf0q4BGkVy40Jj+FAyioG3KEukCtP1" 436cdf0e10cSrcweir "OAdOe4ASVCPuUrQDFsqBoRWN6jqxOBfH-30WbgyZy+HtyI6xNVvt3M0lnfscjA8rBUeoRXifTPCceY6t46AR9ooG2jVzdmo+PQ6R" 437cdf0e10cSrcweir "cAEDd7VE3GvUyDJzn2e0yyzypEdnCzUZorT029pk4LHJYsRQmR5smaW9EuCbt2A2s2Nd9ZKAkcJSWoTGPV5p6d1PZCiYt6kVETBB" 438cdf0e10cSrcweir "K7zNWhRK7kMBCag7zELQ2e6HWHM+BwO4nJA-30uF2a2WgcgndWuk6gPbha0D5WFPq902KmjNwyg5xkVQvgd9W9SCfiFd95Ndh9yj" 439cdf0e10cSrcweir "Odd7k38da3xWqtwcHPOEb7AvIPqAdRbz3XNNEYFu7bS9Iz-0UVQJc-gtgPCQ7cledmoGTULsGpjeu0TzkJi2tusMDnR4cisDw2rz" 440cdf0e10cSrcweir "Vhs36hPC0oSH7V-UMAjVIC3dRFwNoc20a0+Culnm3q9QQJsgt00IeEoRXCh3jUg3eO8yGBOpFwYap5OrpoAfMeR6Q8L0sUIgI7B3" 441cdf0e10cSrcweir "Oy9q5WMBAxg5PYnBSxZlywhwDlb45Il6Y+F-NaH62MEoByaq02d2aaEz5Bwx45DqfEC4ACqd4FYjI9IbAgqH7uFopm+JQRSHrSNd" 442cdf0e10cSrcweir "ct0dwNo+FAUaD926b3wtUoRIPJ-MTLLiQcC92bTBue9RkDqqYRcXxn06S9Jm6Qhpk9IjH8JLyIinJj3EAF7bTH9jkf170OvzuO2j" 443cdf0e10cSrcweir "I2jenHhQvnKoDSHSmWenEhfEHkVgekpfIOhkBhqLVaEvb83EyfD2Awrbk5+lwyvOne6yBA36rdrmna4xFOsvqGxRcgcJy-lXnjCn" 444cdf0e10cSrcweir "eeWhGvqAbmSf7LcDwqykK9jqADpRqkXSq7MB7ZOHSgJhNitiw3i6y9LYjRNlq4Lc-00zCNL3CThC65Ajjlw8550bAbqa0d0Jz3BT" 445cdf0e10cSrcweir "kH6EDgQhRUhjtyK9y9CjraNEw9ERUq6MmYa989nsRqsPxo+zi2IbOfxy9q3lFL-QSWn5qwp7nTFUwVe-XaDxnGfWOIYXXfIkILs-" 446cdf0e10cSrcweir "lWPSm51tjj967w11u-YylxUO++EfuLsmr1c3jLdgcDYmK9roIAmz1t1vAalje3oyXDp335xkQ24rS1JhdokOn5cWpizqiE5bsbg4" 447cdf0e10cSrcweir "4gWkfJ2IEVnSoWmj8eNeAFuoT0wzWWm9UgmDKRH2INGJy6OHTwn7zawsiPo796yQd6OsPORlTrUR-bEMLPj8nZdMwyX-Jb8npd2-" 448cdf0e10cSrcweir "zV9JMRdNarUy1aF0tiihB0o+kQh5iy9r9BMqhPjf+WckJ9WWqmSQTEqAl+zwgw-+vH5WomSNVjbDLchO9Ae-ggdQGPcb+7Dq0X-d" 449cdf0e10cSrcweir "XsFHj76-a0eUqKlN6cgHMKgKSmv8xcMVnCIPAnqR0SsThTWe8GSgo3pTGWTgBrtb1X2OfHMHsi8D3gkpPwKvoxoEuSJcTmD2kiAS" 450cdf0e10cSrcweir "Pk3wl5C5NZDe9OrZMdDg6VQpDybXJ7EWLCdwsPoTGqhcGOGvrJ2WgFuuem+wP1ZGhkpee9rU7CTad9q9DxVgNzGWk+lGid6rKswa" 451cdf0e10cSrcweir "1+Uc57RmFASpo3qbaGvuMReTLCWXsocM6lvXmSZHAhhaaV7EHH9sJglnrUlniII4I0gVZHFLys8VKKb2yKbAYHeSY3VlmgRywmqd" 452cdf0e10cSrcweir "UXugq90wSsh0poya0qEAF9CjjadQumckue1unyK1sdcUwyxQOcARlHjLWYd3lS2ozCTQ48zZXesU66bAUfTdoXoOInm7MpPgwiDp" 453cdf0e10cSrcweir "XDqJrEMEChxb747KzIHfxSdi++EwdRNK7RHEmgVhqiZkW1WqBEnjst6Oz08ztIPVknfPjq8NDB4h9g1sD+l1xQNzHNg+Jb1Vmii6" 454cdf0e10cSrcweir "1dP-57LPdOhlWSTKYaCmzwAhGqyOlPrY9zXZodpZuoL2kjTBLBxaeGcM+NONZcN7GqIqFcNlhVgMXKHsd-WEBBR957ZZn7hk-mbb" 455cdf0e10cSrcweir "FGxWLzaiHE6t48mXupNDlxi6d1w-yaPlmczA0gTsEhqRrsEbj48ProNvyivlaY06bdYSvGN7IOBc1ezBJiFd5OTz+RbzIsqJpCsJ" 456cdf0e10cSrcweir "BOTSLjAdwXCzq-XExGbygb3X2oURVXxTB4q0e6euBRnXkIJuTM7SfQfQkdEEjN7J56t3oxP6B0cA4lgSDhURzsDzrkk0ECxfwaU3" 457cdf0e10cSrcweir "ovagJuvzx07aksPdxkQ8aqEy618F-4wjCr3hZq8gq3gu7RJ4ovXa86R7ZskSYJC01o2OpfvJh0WqpYiIuE0zBqpI3kTJQZ0Or5ku" 458cdf0e10cSrcweir "9RzhbzbV1AU0BzJ5vPTOBRIOIAiJiBiOdI8fR3dcWle3xCder+W6QELyr6NaldJipQCeAMwRr5mpzZESGAhuU3BDdkCh5ENgMUE-" 459cdf0e10cSrcweir "sWotoCfnOwT7tJlXLHODk8K7Z4zYCG9Dh2fQazDE0JqBDruomfatotGADn25BCDpk6GI6SSftpUd71Qr1JBrgOr33aWswl983Uk7" 460cdf0e10cSrcweir "cq9Em7vGtACekHlvOOVJfbdh76nNHzuQ1Z1oBvuU9l-dAg+-QWWFQ18D8U+zmYn1jypyarIXSrcIb67wLDTFXWm8F9XPmFWRBD3d" 461cdf0e10cSrcweir "WukVJwhGNV5ZHVE1wCudY07ZIEAd1kgzgPcRSxFhRhFpXsnESjJhUNCA3DlrARwzz+llg0xpVHrJiddYT36P453qxpOmIE9e6-qJ" 462cdf0e10cSrcweir "h4ipfTTt8f2Kq4mdWniErPtI+wrN-edvCQFtPdrL+tpV6EpPRXgmHnjRhV0eWWzqxdRZacX98CME3pvwDYWkO8TOUlcNQSKTU1iF" 463cdf0e10cSrcweir "FC9WIBA8PulsCFVNH1qJwZxYYcaX6CGNnR7vHiIBDsTE51J4b4fYucNYFG9V5mCUdrJT57tHk9eghSOfgeHZDxuvQt8619pwKma7" 464cdf0e10cSrcweir "3Nl00EFklZOk+APRmKviL+iyiG1sWfA3E0xUPznlQgvsHJRzD9u0TzHsB6tIMKLmOxvVHG9knpHerjAXNqIp7jwZzvYXIyW8kw8g" 465cdf0e10cSrcweir "3ycECFaB2Y2U0l00NE7l2Aca2y5uhk+QJygN0857SQMVSEXjy+Q84nQjkTh1GAtFACtdHRhwQ6FhQMLjFu6zyxuFycbQA7qNSsiy" 466cdf0e10cSrcweir "90wlAaUBBtFhxMV0TPd8DbVScjJoMSAYMh6GhAHnKOZsbdqvwtHKdZWZ9HQbdmVOt0xnnK5Ju9KfwhuHMZIoPt73BqspII6qBobB" 467cdf0e10cSrcweir "5kfcwm183j4fwapcs50EoGgz2UZGuK88agfskePeYt9DOQD3qxxfuJ5lZUFHa8aqFJIT6MG2Kwtwuu0zBqTz8x5DYM7PDh29F9FU" 468cdf0e10cSrcweir "1ge-wqqIMqmXlpbO65sila1be1yRGABAbw2njF5txZEAaqEyEo9FUPqnKQ4y1NQqSXkCpsqpO06UUCyBBzaDjawwoHkKOT1-zqpz" 469cdf0e10cSrcweir "FU7JNudONE3fuYk83U9thALoAIeG6FKizOLgU4AcDcszCmGZgylUI-Edd9mAKL9nJe+YdiYxl7uX4mATdO30KcuDrRoTxBbiHbuA" 470cdf0e10cSrcweir "qlorQn1D0opRuIhzVLm8+z8QRFlNA0683M1QYE+Lhka+kaIDvE8RHQHel4bOsMFp6lmV6D3cNhQvpG1sECm02a5tgF52reEBaYEw" 471cdf0e10cSrcweir "OhD+RQiFedTm3OQg5iq2c04kidOoDgaPNGs1VitbrhIvAuzStaWksap3jp9UrAN1O-0nAECIfSP0QHVkGWtduz6XSmJ7MsLPmPJ3" 472cdf0e10cSrcweir "hRjY7DtZXWjvtHcj9ooAXcPsI+3YgG951n7urnyB1kbQV+ZdlAbI11Y3orBMB+le8goi66fWyEX9FHpFEL32jNqSghzvyEC1227-" 473cdf0e10cSrcweir "p5t8vx19mYHbOghy5K7voWUAXsjX2gwzicmKiNJR9OrHppAbVEVzVjOuYWmwCpGWFW1DlaoOc03PWkgqvVeezQY8IiM9Rptnniwf" 474cdf0e10cSrcweir "Xa1XnMPo6ES0MHE5nwC8tT65VVw3C2peCu720i6oVvevcoMGeP3PVgvBkudifs0GNH7AaOGVFhrbE68B8sq6AH8BFvXhZfzdhb1f" 475cdf0e10cSrcweir "Y1p-GVyr3qECy393zFEq0wHg2Vls4OiVD-J0d7JFKsuhUPgdykTCWhbqkdvwUUyg7qXPvdeC09AUAszRcVsk5iihIr1+N-0ATkGU" 476cdf0e10cSrcweir "i6GPwTlzw-dALNmjbVjHOSAsWaihe303RxAmD4akSPWkjgtot17BTZfaSgaNH+ESoUGJ3GgPJqD8UBsAShIF-X0wwyFpDkTwESHg" 477cdf0e10cSrcweir "jNwUF9EpszCwj1myzqZG9hIp76G1ymz7BuZF0T5pdA1GMG8AGuRbXEtJMkHsDJoztG06Jqm-khFPydXg-VB1k+l9AMwzzvtCDacK" 478cdf0e10cSrcweir "k22WU1fByYcDpmW0Y9YF-zeZDDcQJVF8tT8cNNjt9GdIF3103ZFP8oulWCfnXETCKz3YQFsm3qOUu6GJ-lb2foo1WJqGpcCbyPmy" 479cdf0e10cSrcweir "Ib95rQLJnk56YC1KmN5zMJ831cVsERyvdPOSW8kg-2uk8m3J4zgAWAhvvBOofIjFb5yNf0shVv-JJ9f49ZFcQ+LKDFKX3iNV1E-G" 480cdf0e10cSrcweir "MxeEwbi-uGP8BGO4vGgV0IFbgswumfhk14OF3q+1qwRFpq4hr1s6zQEAgoVAW3QE4tsQpYW3JkcqDcnSOjbePZeFrFMor-o3UG2F" 481cdf0e10cSrcweir "jmw8667eXk3UiM9vq5EpyrbQxexsJ3tKy7w6lGsumfMWIlcSglkLUzicysuPgqT5Wuzn8MkGvTYve2UyunErUnD-+Qwr0rDo1tOG" 482cdf0e10cSrcweir "bbtcNNeFInx5rDK3DHahjTON3d3oTpePxioVK3sRLDh185yKMzTQv812ADCFcwvFHbetPF41f7kot00O2OMUkw4OPvuTRkhdAhgd" 483cdf0e10cSrcweir "il2SM9bunNaNHqh9Ov8Qv3SKEl1O-BwzjYF0VWjkxycswQFqQotUPw+Q-6FrCPFWvaF2CP2F319stMfD-8bHsd87KZfQ9ChereG4" 484cdf0e10cSrcweir "Z8XP8dNMipn-evkOVVFqfgN16dO8Ya9nqGFIpIW1Ljv7wOAzdZFsm5C1EuQoKzwyXDO0BDjceBsyTt40H0upG8D1N1ZP66OPIeQy" 485cdf0e10cSrcweir "oXQwI63e+NnuYA0687-d6N6rDscj+VHn2R0RUXQFZ2+EANqcqvan4y0Erpl01fAfmLaI8pmOgsRUDvuF5e9YnWNhxtSzS4fsjj1J" 486cdf0e10cSrcweir "1EIGpcw0WfiaOul1s19ZIECoLBx-#S"; 487cdf0e10cSrcweir 488cdf0e10cSrcweir 489cdf0e10cSrcweir //#if OSL_DEBUG_LEVEL > 1 490cdf0e10cSrcweir // SvFileStream aStream( "d:\\gh_writeback.jpg" , STREAM_STD_READWRITE | STREAM_TRUNC ); 491cdf0e10cSrcweir //#else 492cdf0e10cSrcweir SvMemoryStream aStream; 493cdf0e10cSrcweir //#endif 494cdf0e10cSrcweir xub_StrLen c; 495cdf0e10cSrcweir xub_StrLen cRest = 0; 496cdf0e10cSrcweir 497cdf0e10cSrcweir xub_StrLen nIndex; 498cdf0e10cSrcweir for ( nIndex = 0 ; nIndex < aData.Len() ; nIndex++ ) 499cdf0e10cSrcweir { 500cdf0e10cSrcweir if ( ( nIndex & 3 ) == 0 ) 501cdf0e10cSrcweir { 502cdf0e10cSrcweir cRest = aData.GetChar( nIndex ); 503cdf0e10cSrcweir cRest = aTr.Search( (sal_Char)cRest ); 504cdf0e10cSrcweir } 505cdf0e10cSrcweir else 506cdf0e10cSrcweir { 507cdf0e10cSrcweir c = aData.GetChar( nIndex ); 508cdf0e10cSrcweir c = aTr.Search( (sal_Char)c ); 509cdf0e10cSrcweir 510cdf0e10cSrcweir c <<= 2; 511cdf0e10cSrcweir c |= ( ( cRest & 0x30 ) >> 4 ); 512cdf0e10cSrcweir cRest <<= 2; 513cdf0e10cSrcweir 514cdf0e10cSrcweir aStream << sal_Char(c); 515cdf0e10cSrcweir } 516cdf0e10cSrcweir } 517cdf0e10cSrcweir 518cdf0e10cSrcweir aStream.Seek(0); 519cdf0e10cSrcweir #ifndef NO_JPEG 520cdf0e10cSrcweir Graphic aGraphic; 521cdf0e10cSrcweir if ( ImportJPEG( aStream, aGraphic, NULL ) ) 522cdf0e10cSrcweir { 523cdf0e10cSrcweir Bitmap *pBmp = new Bitmap( aGraphic.GetBitmap() ); 524cdf0e10cSrcweir StatementList::pTTProperties->Img( pBmp ); 525cdf0e10cSrcweir delete pBmp; 526cdf0e10cSrcweir } 527cdf0e10cSrcweir else 528cdf0e10cSrcweir #endif 529cdf0e10cSrcweir { 530cdf0e10cSrcweir ::svt::OStringTransfer::CopyString( CUniString("\nSorry! no bitmap"), StatementList::GetFirstDocFrame() ); 531cdf0e10cSrcweir } 532cdf0e10cSrcweir 533cdf0e10cSrcweir /*********************************************************************** 534cdf0e10cSrcweir // sal_uInt16 nBC = pBmp->GetBitCount(); 535cdf0e10cSrcweir // pBmp->Scale( 0.02, 0.02 ); 536cdf0e10cSrcweir // nBC = pBmp->GetBitCount(); 537cdf0e10cSrcweir // SvMemoryStream aStream; 538cdf0e10cSrcweir SvFileStream aStream( "d:\gh_small50.jpg", STREAM_STD_READ ); 539cdf0e10cSrcweir 540cdf0e10cSrcweir aStream.Seek( 0 ); 541cdf0e10cSrcweir xub_StrLen c; 542cdf0e10cSrcweir String aOut; 543cdf0e10cSrcweir String aDreierGruppe; 544cdf0e10cSrcweir xub_StrLen cRest=0; 545cdf0e10cSrcweir aStream >> c; 546cdf0e10cSrcweir while ( !aStream.IsEof() ) 547cdf0e10cSrcweir { 548cdf0e10cSrcweir cRest <<= 2; // Im ersten Durchgang egal, da immer 0 549cdf0e10cSrcweir cRest |= ( c & 0x03 ); 550cdf0e10cSrcweir c >>= 2; 551cdf0e10cSrcweir aDreierGruppe += aTr.GetChar( c ); 552cdf0e10cSrcweir 553cdf0e10cSrcweir if ( aDreierGruppe.Len() == 3 ) 554cdf0e10cSrcweir { 555cdf0e10cSrcweir aOut += aTr.GetChar( cRest ); 556cdf0e10cSrcweir aOut += aDreierGruppe; 557cdf0e10cSrcweir cRest = 0; 558cdf0e10cSrcweir aDreierGruppe = ""; 559cdf0e10cSrcweir } 560cdf0e10cSrcweir aStream >> c; 561cdf0e10cSrcweir } 562cdf0e10cSrcweir if ( aDreierGruppe.Len() ) 563cdf0e10cSrcweir { 564cdf0e10cSrcweir aOut += cRest; 565cdf0e10cSrcweir aOut += aDreierGruppe; 566cdf0e10cSrcweir } 567cdf0e10cSrcweir ::svt::OStringTransfer::CopyString( aOut ); 568cdf0e10cSrcweir **********************************************************************************/ 569cdf0e10cSrcweir 570cdf0e10cSrcweir new StatementSlot( StatementList::pTTProperties->nSidPaste ); 571cdf0e10cSrcweir return; 572cdf0e10cSrcweir } 573cdf0e10cSrcweir case 7: 574cdf0e10cSrcweir { 575cdf0e10cSrcweir new StatementSlot( 20384 ); // FN_TOOL_ANKER_CHAR aus SW? 576cdf0e10cSrcweir return; 577cdf0e10cSrcweir } 578cdf0e10cSrcweir } 579cdf0e10cSrcweir 580cdf0e10cSrcweir // Wir sind am Ende 581cdf0e10cSrcweir 582cdf0e10cSrcweir #if OSL_DEBUG_LEVEL < 2 583cdf0e10cSrcweir delete this; 584cdf0e10cSrcweir #endif 585cdf0e10cSrcweir } 586cdf0e10cSrcweir 587cdf0e10cSrcweir IMPL_LINK( ImplRemoteControl, IdleHdl, Application*, EMPTYARG ) 588cdf0e10cSrcweir { 589cdf0e10cSrcweir if( StatementList::pFirst ) 590cdf0e10cSrcweir { 591cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 592cdf0e10cSrcweir m_pDbgWin->AddText( "* " ); 593cdf0e10cSrcweir #endif 594cdf0e10cSrcweir GetpApp()->PostUserEvent( LINK( this, ImplRemoteControl, CommandHdl ) ); 595cdf0e10cSrcweir } 596cdf0e10cSrcweir return 0; 597cdf0e10cSrcweir } 598cdf0e10cSrcweir 599cdf0e10cSrcweir 600cdf0e10cSrcweir 601cdf0e10cSrcweir IMPL_LINK( ImplRemoteControl, CommandHdl, Application*, EMPTYARG ) 602cdf0e10cSrcweir { 603cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 604cdf0e10cSrcweir m_pDbgWin->AddText( "Entering CommandHdl\n" ); 605cdf0e10cSrcweir #endif 606cdf0e10cSrcweir 607cdf0e10cSrcweir if ( StatementList::MaybeResetSafeReschedule() ) 608cdf0e10cSrcweir { 609cdf0e10cSrcweir StatementList::bExecuting = sal_False; // Wird nacher im SafeReschedule wieder zur�ckgesetzt 610cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 611cdf0e10cSrcweir m_pDbgWin->AddText( "SafeReschedule has been reset\n" ); 612cdf0e10cSrcweir #endif 613cdf0e10cSrcweir } 614cdf0e10cSrcweir 615cdf0e10cSrcweir if ( ( StatementList::bReadingCommands && !StatementList::bDying ) || 616cdf0e10cSrcweir ( StatementList::bExecuting ) || 617cdf0e10cSrcweir ( StatementList::IsInReschedule() ) ) 618cdf0e10cSrcweir { 619cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 620cdf0e10cSrcweir if ( StatementList::bReadingCommands ) 621cdf0e10cSrcweir m_pDbgWin->AddText( "Reading Commands " ); 622cdf0e10cSrcweir if ( StatementList::bExecuting ) 623cdf0e10cSrcweir m_pDbgWin->AddText( "In Execute " ); 624cdf0e10cSrcweir if ( StatementList::IsInReschedule() ) 625cdf0e10cSrcweir { 626cdf0e10cSrcweir m_pDbgWin->AddText( "In Reschedule FocusWindow: 0x" ); 627cdf0e10cSrcweir m_pDbgWin->AddText( 628cdf0e10cSrcweir String::CreateFromInt64( 629cdf0e10cSrcweir sal::static_int_cast< sal_Int64 >( 630cdf0e10cSrcweir reinterpret_cast< sal_IntPtr >(GetpApp()->GetFocusWindow())), 631cdf0e10cSrcweir 16 )); 632cdf0e10cSrcweir m_pDbgWin->AddText( " " ); 633cdf0e10cSrcweir } 634cdf0e10cSrcweir m_pDbgWin->AddText( "Leaving CommandHdl\n" ); 635cdf0e10cSrcweir #endif 636cdf0e10cSrcweir return 0; // Garnicht erst irgendwelchen bl�dsinn machen 637cdf0e10cSrcweir } 638cdf0e10cSrcweir 639cdf0e10cSrcweir while( StatementList::pFirst && ( !StatementList::bReadingCommands || StatementList::bDying ) ) 640cdf0e10cSrcweir // Schleift hier bis Befehl nicht zur�ckkommt, 641cdf0e10cSrcweir // Wird dann rekursiv �ber IdleHdl und PostUserEvent aufgerufen. 642cdf0e10cSrcweir { 643cdf0e10cSrcweir m_bInsideExecutionLoop = sal_True; 644cdf0e10cSrcweir #ifdef TIMERIDLE 645cdf0e10cSrcweir m_aIdleTimer.Stop(); 646cdf0e10cSrcweir m_aIdleTimer.Start(); 647cdf0e10cSrcweir #endif 648cdf0e10cSrcweir StatementList *pC = StatementList::pFirst; 649cdf0e10cSrcweir 650cdf0e10cSrcweir // MessBox MB( pMainWin, WB_DEF_OK|WB_OK, "Pause ...", "... und Weiter" ); 651cdf0e10cSrcweir // MB.Execute(); 652cdf0e10cSrcweir 653cdf0e10cSrcweir if ( !StatementList::bCatchGPF ) 654cdf0e10cSrcweir { 655cdf0e10cSrcweir if (!pC->CheckWindowWait() || !pC->Execute()) 656cdf0e10cSrcweir { 657cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 658cdf0e10cSrcweir m_pDbgWin->AddText( "Leaving CommandHdl\n" ); 659cdf0e10cSrcweir #endif 660cdf0e10cSrcweir return 0; // So dass die App nochmal �ne chance bekommt 661cdf0e10cSrcweir } 662cdf0e10cSrcweir } 663cdf0e10cSrcweir else 664cdf0e10cSrcweir { 665cdf0e10cSrcweir try 666cdf0e10cSrcweir { 667cdf0e10cSrcweir if (!pC->CheckWindowWait() || !pC->Execute()) 668cdf0e10cSrcweir { 669cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 670cdf0e10cSrcweir m_pDbgWin->AddText( "Leaving CommandHdl\n" ); 671cdf0e10cSrcweir #endif 672cdf0e10cSrcweir return 0; // So dass die App nochmal �ne chance bekommt 673cdf0e10cSrcweir } 674cdf0e10cSrcweir } 675cdf0e10cSrcweir catch( ... ) 676cdf0e10cSrcweir { 677cdf0e10cSrcweir if ( !StatementFlow::bUseIPC ) 678cdf0e10cSrcweir throw; // aus der Hilfe heraus nicht leise abbrechen 679cdf0e10cSrcweir 680cdf0e10cSrcweir try 681cdf0e10cSrcweir { 682cdf0e10cSrcweir ModelessDialog *pDlg = new ModelessDialog(NULL); 683cdf0e10cSrcweir pDlg->SetOutputSizePixel(Size(150,0)); 684cdf0e10cSrcweir pDlg->SetText( String ( TTProperties::GetSvtResId( TT_GPF ) ) ); 685cdf0e10cSrcweir pDlg->Show(); 686cdf0e10cSrcweir DBG_ERROR("GPF"); 687cdf0e10cSrcweir pC->ReportError( GEN_RES_STR0( S_GPF_ABORT ) ); 688cdf0e10cSrcweir StatementList::bDying = sal_True; 689cdf0e10cSrcweir while ( StatementList::pFirst ) // Kommandos werden �bersprungen 690cdf0e10cSrcweir StatementList::NormalReschedule(); 691cdf0e10cSrcweir delete pDlg; 692cdf0e10cSrcweir } 693cdf0e10cSrcweir catch ( ... ) 694cdf0e10cSrcweir { 695cdf0e10cSrcweir Application::Quit(); 696cdf0e10cSrcweir } 697cdf0e10cSrcweir Application::Quit(); 698cdf0e10cSrcweir } 699cdf0e10cSrcweir } 700cdf0e10cSrcweir 701cdf0e10cSrcweir /* #i46293# remove reschedules 702cdf0e10cSrcweir for (int xx = 1;xx < 20;xx++) 703cdf0e10cSrcweir StatementList::NormalReschedule(); 704cdf0e10cSrcweir */ 705cdf0e10cSrcweir m_bInsideExecutionLoop = sal_False; 706cdf0e10cSrcweir } 707cdf0e10cSrcweir 708cdf0e10cSrcweir StatementList::aWindowWaitUId = rtl::OString(); // Warten r�cksetzen, da handler sowieso verlassen wird 709cdf0e10cSrcweir 710cdf0e10cSrcweir /* if( StatementList::pFirst && !StatementList::bReadingCommands ) 711cdf0e10cSrcweir // Abfrage n�tig, da andere CommandHdl aktiv sein k�nnen oder 712cdf0e10cSrcweir // neue Commands gelesen werden k�nnen 713cdf0e10cSrcweir { 714cdf0e10cSrcweir delete StatementList::pFirst; // L�scht die gesamte Liste !! 715cdf0e10cSrcweir StatementList::pFirst = NULL; 716cdf0e10cSrcweir StatementList::pCurrent = NULL; // Nur zur Sicherheit, sollte hier sowieso NULL sein 717cdf0e10cSrcweir }*/ 718cdf0e10cSrcweir 719cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 720cdf0e10cSrcweir m_pDbgWin->AddText( "Leaving CommandHdl\n" ); 721cdf0e10cSrcweir #endif 722cdf0e10cSrcweir return 0; 723cdf0e10cSrcweir } 724cdf0e10cSrcweir 725cdf0e10cSrcweir IMPL_LINK( ImplRemoteControl, QueCommandsEvent, CommunicationLink*, pCL ) 726cdf0e10cSrcweir { 727cdf0e10cSrcweir SvStream *pTemp = pCL->GetServiceData(); 728cdf0e10cSrcweir QueCommands( SI_IPCCommandBlock, pTemp ); 729cdf0e10cSrcweir delete pTemp; 730cdf0e10cSrcweir return 0; 731cdf0e10cSrcweir } 732cdf0e10cSrcweir 733cdf0e10cSrcweir sal_Bool ImplRemoteControl::QueCommands( sal_uLong nServiceId, SvStream *pIn ) 734cdf0e10cSrcweir { 735cdf0e10cSrcweir // return sal_True; 736cdf0e10cSrcweir sal_uInt16 nId; 737cdf0e10cSrcweir 738cdf0e10cSrcweir if( !m_bIdleInserted ) 739cdf0e10cSrcweir { 740cdf0e10cSrcweir #ifdef TIMERIDLE 741cdf0e10cSrcweir m_aIdleTimer.SetTimeoutHdl( LINK( this, ImplRemoteControl, IdleHdl ) ); 742cdf0e10cSrcweir m_aIdleTimer.SetTimeout( 500 ); 743cdf0e10cSrcweir m_aIdleTimer.Start(); 744cdf0e10cSrcweir #else 745cdf0e10cSrcweir GetpApp()->InsertIdleHdl( LINK( this, ImplRemoteControl, IdleHdl ), 1 ); 746cdf0e10cSrcweir #endif 747cdf0e10cSrcweir m_bIdleInserted = sal_True; 748cdf0e10cSrcweir } 749cdf0e10cSrcweir 750cdf0e10cSrcweir 751cdf0e10cSrcweir StatementList::bReadingCommands = sal_True; 752cdf0e10cSrcweir 753cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 754cdf0e10cSrcweir if (!m_pDbgWin->bQuiet) 755cdf0e10cSrcweir m_pDbgWin->Show(); 756cdf0e10cSrcweir m_pDbgWin->AddText( "Reading " ); 757cdf0e10cSrcweir m_pDbgWin->AddText( String::CreateFromInt64( nServiceId ) ); 758cdf0e10cSrcweir m_pDbgWin->AddText( " :\n" ); 759cdf0e10cSrcweir #endif 760cdf0e10cSrcweir 761cdf0e10cSrcweir if( nServiceId != SI_IPCCommandBlock && nServiceId != SI_DirectCommandBlock ) 762cdf0e10cSrcweir { 763cdf0e10cSrcweir DBG_ERROR1( "Ung�ltiger Request :%i", (int)nServiceId ); 764cdf0e10cSrcweir return sal_False; 765cdf0e10cSrcweir } 766cdf0e10cSrcweir 767cdf0e10cSrcweir SCmdStream *pCmdStream = new SCmdStream(pIn); 768cdf0e10cSrcweir 769cdf0e10cSrcweir pCmdStream->Read( nId ); 770cdf0e10cSrcweir while( !pIn->IsEof() ) 771cdf0e10cSrcweir { 772cdf0e10cSrcweir switch( nId ) 773cdf0e10cSrcweir { 774cdf0e10cSrcweir case SICommand: 775cdf0e10cSrcweir { 776cdf0e10cSrcweir new StatementCommand( pCmdStream ); // Wird im Konstruktor an Liste angeh�ngt 777cdf0e10cSrcweir break; 778cdf0e10cSrcweir } 779cdf0e10cSrcweir case SIControl: 780cdf0e10cSrcweir case SIStringControl: 781cdf0e10cSrcweir { 782cdf0e10cSrcweir new StatementControl( pCmdStream, nId ); // Wird im Konstruktor an Liste angeh�ngt 783cdf0e10cSrcweir break; 784cdf0e10cSrcweir } 785cdf0e10cSrcweir case SISlot: 786cdf0e10cSrcweir { 787cdf0e10cSrcweir new StatementSlot( pCmdStream ); // Wird im Konstruktor an Liste angeh�ngt 788cdf0e10cSrcweir break; 789cdf0e10cSrcweir } 790cdf0e10cSrcweir case SIUnoSlot: 791cdf0e10cSrcweir { 792cdf0e10cSrcweir new StatementUnoSlot( pCmdStream ); // Wird im Konstruktor an Liste angeh�ngt 793cdf0e10cSrcweir break; 794cdf0e10cSrcweir } 795cdf0e10cSrcweir case SIFlow: 796cdf0e10cSrcweir { 797cdf0e10cSrcweir new StatementFlow( nServiceId, pCmdStream, this ); // Wird im Konstruktor an Liste angeh�ngt 798cdf0e10cSrcweir break; 799cdf0e10cSrcweir } 800cdf0e10cSrcweir default: 801cdf0e10cSrcweir DBG_ERROR1( "Unbekannter Request Nr:%i", nId ); 802cdf0e10cSrcweir break; 803cdf0e10cSrcweir } 804cdf0e10cSrcweir if( !pIn->IsEof() ) 805cdf0e10cSrcweir pCmdStream->Read( nId ); 806cdf0e10cSrcweir else { 807cdf0e10cSrcweir DBG_ERROR( "truncated input stream" ); 808cdf0e10cSrcweir } 809cdf0e10cSrcweir } 810cdf0e10cSrcweir 811cdf0e10cSrcweir StatementList::bReadingCommands = sal_False; 812cdf0e10cSrcweir 813cdf0e10cSrcweir delete pCmdStream; 814cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 815cdf0e10cSrcweir m_pDbgWin->AddText( "Done Reading " ); 816cdf0e10cSrcweir m_pDbgWin->AddText( String::CreateFromInt64( nServiceId ) ); 817cdf0e10cSrcweir m_pDbgWin->AddText( " :\n" ); 818cdf0e10cSrcweir #endif 819cdf0e10cSrcweir if ( !m_bInsideExecutionLoop ) 820cdf0e10cSrcweir { 821cdf0e10cSrcweir #ifdef DEBUG 822cdf0e10cSrcweir m_pDbgWin->AddText( "Posting Event for CommandHdl.\n" ); 823cdf0e10cSrcweir #endif 824cdf0e10cSrcweir 825cdf0e10cSrcweir GetpApp()->PostUserEvent( LINK( this, ImplRemoteControl, CommandHdl ) ); 826cdf0e10cSrcweir } 827cdf0e10cSrcweir #ifdef DEBUG 828cdf0e10cSrcweir else 829cdf0e10cSrcweir m_bInsideExecutionLoop = sal_True; 830cdf0e10cSrcweir #endif 831cdf0e10cSrcweir return sal_True; 832cdf0e10cSrcweir } // sal_Bool ImplRemoteControl::QueCommands( sal_uLong nServiceId, SvStream *pIn ) 833cdf0e10cSrcweir 834cdf0e10cSrcweir 835cdf0e10cSrcweir SvStream* ImplRemoteControl::GetReturnStream() 836cdf0e10cSrcweir { 837cdf0e10cSrcweir SvStream* pTemp = pRetStream; 838cdf0e10cSrcweir pRetStream = NULL; 839cdf0e10cSrcweir return pTemp; 840cdf0e10cSrcweir } 841cdf0e10cSrcweir 842cdf0e10cSrcweir ImplRemoteControl::ImplRemoteControl() 843cdf0e10cSrcweir : m_bIdleInserted( sal_False ) 844cdf0e10cSrcweir , m_bInsideExecutionLoop( sal_False ) 845cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 846cdf0e10cSrcweir , m_pDbgWin(NULL) 847cdf0e10cSrcweir #endif 848cdf0e10cSrcweir , pRetStream(NULL) 849cdf0e10cSrcweir { 850cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 851cdf0e10cSrcweir if ( RemoteControlCommunicationManager::GetPort() != TT_NO_PORT_DEFINED || RemoteControlCommunicationManager::nComm ) 852cdf0e10cSrcweir { 853cdf0e10cSrcweir m_pDbgWin = new EditWindow( NULL, CUniString("Debug Window"), WB_VSCROLL ); 854cdf0e10cSrcweir m_pDbgWin->bQuiet = sal_True; 855cdf0e10cSrcweir m_pDbgWin->Hide(); 856cdf0e10cSrcweir m_pDbgWin->bQuiet = sal_False; 857cdf0e10cSrcweir m_pDbgWin->Show(); 858cdf0e10cSrcweir 859cdf0e10cSrcweir StatementList::m_pDbgWin = m_pDbgWin; 860cdf0e10cSrcweir } 861cdf0e10cSrcweir #endif 862cdf0e10cSrcweir if ( RemoteControlCommunicationManager::GetPort() == TT_NO_PORT_DEFINED ) 863cdf0e10cSrcweir pServiceMgr = NULL; 864cdf0e10cSrcweir else 865cdf0e10cSrcweir { 866cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 867cdf0e10cSrcweir pServiceMgr = new RemoteControlCommunicationManager( m_pDbgWin ); 868cdf0e10cSrcweir #else 869cdf0e10cSrcweir pServiceMgr = new RemoteControlCommunicationManager(); 870cdf0e10cSrcweir #endif 871cdf0e10cSrcweir pServiceMgr->SetDataReceivedHdl( LINK( this, ImplRemoteControl, QueCommandsEvent ) ); 872cdf0e10cSrcweir pServiceMgr->StartCommunication(); 873cdf0e10cSrcweir 874cdf0e10cSrcweir #ifdef DBG_UTIL 875cdf0e10cSrcweir DbgSetPrintTestTool( TestToolDebugPrint ); 876cdf0e10cSrcweir // first change it, so we get the original Pointer 877cdf0e10cSrcweir StatementCommand::pOriginal_osl_DebugMessageFunc = osl_setDebugMessageFunc( osl_TestToolDebugPrint ); 878cdf0e10cSrcweir if ( DbgGetErrorOut() != DBG_OUT_TESTTOOL ) 879cdf0e10cSrcweir osl_setDebugMessageFunc( StatementCommand::pOriginal_osl_DebugMessageFunc ); 880cdf0e10cSrcweir #endif 881cdf0e10cSrcweir } 882cdf0e10cSrcweir if ( RemoteControlCommunicationManager::nComm ) 883cdf0e10cSrcweir new ExtraIdle( this ); // Setzt die Bearbeitung wieder auf 884cdf0e10cSrcweir } 885cdf0e10cSrcweir 886cdf0e10cSrcweir ImplRemoteControl::~ImplRemoteControl() 887cdf0e10cSrcweir { 888cdf0e10cSrcweir if ( MacroRecorder::HasMacroRecorder() ) 889cdf0e10cSrcweir MacroRecorder::GetMacroRecorder()->SetActionRecord( sal_False ); // Will delete MacroRecorder if necessary 890cdf0e10cSrcweir 891cdf0e10cSrcweir 892cdf0e10cSrcweir StatementList::bDying = sal_True; 893cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 894cdf0e10cSrcweir if ( m_pDbgWin ) 895cdf0e10cSrcweir m_pDbgWin->bQuiet = sal_True; // Keine Ausgabe mehr im Debugwindow 896cdf0e10cSrcweir #endif 897cdf0e10cSrcweir 898cdf0e10cSrcweir #ifdef DBG_UTIL 899cdf0e10cSrcweir // Zur�cksetzen, so da� nachfolgende Assertions nicht verloren gehen 900cdf0e10cSrcweir DbgSetPrintTestTool( NULL ); 901cdf0e10cSrcweir osl_setDebugMessageFunc( StatementCommand::pOriginal_osl_DebugMessageFunc ); 902cdf0e10cSrcweir #endif 903cdf0e10cSrcweir 904cdf0e10cSrcweir if ( StatementList::pFirst ) 905cdf0e10cSrcweir { // Es sind noch Kommandos da, also auch eine M�glichkeit zur�ckzusenden. 906cdf0e10cSrcweir StatementList::pFirst->ReportError( GEN_RES_STR0( S_APP_SHUTDOWN ) ); 907cdf0e10cSrcweir while ( StatementList::pFirst ) // Kommandos werden �bersprungen 908cdf0e10cSrcweir StatementList::NormalReschedule(); // Fehler zur�ckgeschickt 909cdf0e10cSrcweir } 910cdf0e10cSrcweir 911cdf0e10cSrcweir if ( pServiceMgr ) 912cdf0e10cSrcweir pServiceMgr->StopCommunication(); 913cdf0e10cSrcweir 914cdf0e10cSrcweir if ( GetTTSettings()->pDisplayHidWin ) 915cdf0e10cSrcweir { 916cdf0e10cSrcweir delete (Window*)(GetTTSettings()->pDisplayHidWin); 917cdf0e10cSrcweir GetTTSettings()->pDisplayHidWin = NULL; 918cdf0e10cSrcweir } 919cdf0e10cSrcweir if ( GetTTSettings()->pTranslateWin ) 920cdf0e10cSrcweir { 921cdf0e10cSrcweir delete (Window*)(GetTTSettings()->pTranslateWin); 922cdf0e10cSrcweir GetTTSettings()->pTranslateWin = NULL; 923cdf0e10cSrcweir } 924cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 1 925cdf0e10cSrcweir delete m_pDbgWin; 926cdf0e10cSrcweir #endif 927cdf0e10cSrcweir if( m_bIdleInserted ) 928cdf0e10cSrcweir { 929cdf0e10cSrcweir #ifdef TIMERIDLE 930cdf0e10cSrcweir m_aIdleTimer.Stop(); 931cdf0e10cSrcweir #else 932cdf0e10cSrcweir GetpApp()->RemoveIdleHdl( LINK( this, ImplRemoteControl, IdleHdl ) ); 933cdf0e10cSrcweir #endif 934cdf0e10cSrcweir m_bIdleInserted = sal_False; 935cdf0e10cSrcweir } 936cdf0e10cSrcweir delete pServiceMgr; 937cdf0e10cSrcweir } 938cdf0e10cSrcweir 939cdf0e10cSrcweir RemoteControl::RemoteControl() 940cdf0e10cSrcweir { 941cdf0e10cSrcweir pImpl = new ImplRemoteControl; 942cdf0e10cSrcweir } 943cdf0e10cSrcweir 944cdf0e10cSrcweir RemoteControl::~RemoteControl() 945cdf0e10cSrcweir { 946cdf0e10cSrcweir delete pImpl; 947cdf0e10cSrcweir } 948cdf0e10cSrcweir 949cdf0e10cSrcweir static ::osl::Mutex aMutex; 950cdf0e10cSrcweir static RemoteControl* pRemoteControl = 0; 951cdf0e10cSrcweir extern "C" void CreateRemoteControl() 952cdf0e10cSrcweir { 953cdf0e10cSrcweir if ( !pRemoteControl ) 954cdf0e10cSrcweir { 955cdf0e10cSrcweir ::osl::MutexGuard aGuard( aMutex ); 956cdf0e10cSrcweir if ( !pRemoteControl ) 957cdf0e10cSrcweir pRemoteControl = new RemoteControl(); 958cdf0e10cSrcweir } 959cdf0e10cSrcweir } 960cdf0e10cSrcweir 961cdf0e10cSrcweir extern "C" void DestroyRemoteControl() 962cdf0e10cSrcweir { 963cdf0e10cSrcweir ::osl::MutexGuard aGuard( aMutex ); 964cdf0e10cSrcweir delete pRemoteControl; 965cdf0e10cSrcweir pRemoteControl = 0; 966cdf0e10cSrcweir } 967cdf0e10cSrcweir 968cdf0e10cSrcweir extern "C" void CreateEventLogger() 969cdf0e10cSrcweir { 970cdf0e10cSrcweir MacroRecorder::GetMacroRecorder()->SetActionLog(); 971cdf0e10cSrcweir } 972cdf0e10cSrcweir 973cdf0e10cSrcweir extern "C" void DestroyEventLogger() 974cdf0e10cSrcweir { 975cdf0e10cSrcweir MacroRecorder::GetMacroRecorder()->SetActionLog( sal_False ); // Will delete MacroRecorder if necessary 976cdf0e10cSrcweir } 977cdf0e10cSrcweir 978