diff options
Diffstat (limited to 'automation')
23 files changed, 623 insertions, 500 deletions
diff --git a/automation/inc/automation/commtypes.hxx b/automation/inc/automation/commtypes.hxx index ad8443518e85..72a362e5e052 100644 --- a/automation/inc/automation/commtypes.hxx +++ b/automation/inc/automation/commtypes.hxx @@ -31,7 +31,7 @@ * This file is intended to supply the types and defines for Environment independent * building of the packethandler * Only adaption of this file should be necessary. Else it is a bug! - * Eather including apropriate files or defining the types when not available in the environment + * Ether including apropriate files or defining the types when not available in the environment * ************************************************************************/ @@ -52,6 +52,7 @@ #include <sal/types.h> typedef sal_Unicode comm_UniChar; +#include "rtl/string.hxx" // this is a trick to be sure the SO types are unknown, so the compiler will yell at us in case we use them #ifndef _SOLAR_H @@ -93,7 +94,7 @@ typedef UINT32 comm_UINT32; typedef sal_uInt16 comm_WORD; typedef sal_uInt32 comm_DWORD; -class SmartId; +class rtl::OString; class String; #define comm_String String diff --git a/automation/source/inc/cmdbasestream.hxx b/automation/source/inc/cmdbasestream.hxx index d103dd071e43..408492cd8ac9 100644 --- a/automation/source/inc/cmdbasestream.hxx +++ b/automation/source/inc/cmdbasestream.hxx @@ -48,20 +48,25 @@ protected: public: - void GenError( SmartId *pUId, comm_String *pString ); + void GenError( rtl::OString *pUId, comm_String *pString ); void GenReturn( comm_USHORT nRet, comm_ULONG nNr ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_ULONG nNr ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_String *pString ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_BOOL bBool ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_ULONG nNr, comm_String *pString, comm_BOOL bBool ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_ULONG nNr ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_String *pString ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_BOOL bBool ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_ULONG nNr, comm_String *pString, comm_BOOL bBool ); + + void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_ULONG nNr ); + void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_String *pString ); + void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_BOOL bBool ); + void GenReturn( comm_USHORT nRet, comm_USHORT nMethod, comm_USHORT nNr ); // MacroRecorder - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_String *pString ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_String *pString, comm_BOOL bBool ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_BOOL bBool ); - void GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_ULONG nNr ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod ); // also used outside MacroRecorder + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_String *pString ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_String *pString, comm_BOOL bBool ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_BOOL bBool ); + void GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_ULONG nNr ); void Read ( comm_USHORT &nNr ); void Read ( comm_ULONG &nNr ); @@ -76,10 +81,10 @@ public: // Complex Datatypes to be handled system dependent virtual void Read ( comm_String *&pString ); - virtual void Read ( SmartId* &pId ); + virtual void Read ( rtl::OString* &pId ); virtual void Write( comm_String *pString ); - virtual void Write( SmartId* pId ); + virtual void Write( rtl::OString* pId ); }; #endif diff --git a/automation/source/inc/rcontrol.hxx b/automation/source/inc/rcontrol.hxx index 7313603096b4..cf13fdadd469 100644 --- a/automation/source/inc/rcontrol.hxx +++ b/automation/source/inc/rcontrol.hxx @@ -37,13 +37,13 @@ #define _RCONTROL_HXX -#define UID_ACTIVE 0 +#define UID_ACTIVE "UID_ACTIVE" #define SI_IPCCommandBlock 1 #define SI_SocketCommandBlock SI_IPCCommandBlock // Zumindest erstmal #define SI_DirectCommandBlock 2 -#define SIControl 3 +#define SIControl 3 // remove after numeric HelpIDs are completely removed and no legacy testtool is used anymore #define SISlot 4 #define SIFlow 5 #define SICommand 6 diff --git a/automation/source/inc/testapp.hxx b/automation/source/inc/testapp.hxx index 14b9e30362d0..8393019d1605 100644 --- a/automation/source/inc/testapp.hxx +++ b/automation/source/inc/testapp.hxx @@ -30,7 +30,6 @@ #include <basic/sbmod.hxx> #include <basic/testtool.hxx> -#include <vcl/smartid.hxx> class CommunicationLink; class CommunicationManagerClientViaSocketTT; @@ -129,7 +128,7 @@ private: BOOL bReturnOK; // Bricht WaitForAnswer ab CRevNames *pShortNames; // Aktuell verwendete Controls, zur gewinnung des Namens aus Fehlermeldung ULONG nSequence; // Sequence um Antwort und Anfrage zu syncronisieren - SmartId aNextReturnId; // Id des Returnwertes i.e. UId + rtl::OString aNextReturnId; // Id des Returnwertes i.e. UId void ReplaceNumbers(String &aText); // Zahlen im String mit speziellem Format in Namen umwandeln String aLastRecordedKontext;// Keeps the last kontext recorded by the Macro Recorder diff --git a/automation/source/miniapp/servres.hrc b/automation/source/miniapp/servres.hrc index 2f95a34a60b6..6efd2ce57460 100644 --- a/automation/source/miniapp/servres.hrc +++ b/automation/source/miniapp/servres.hrc @@ -29,9 +29,9 @@ #define IDM_FILE 1 #define IDM_FILE_OPEN_TEST 2 #define IDM_FILE_EXIT 3 -#define IDM_FILE_EXIT_HELP 4 -#define IDM_FILE_OPEN_TEST_HELP 1 -#define IDM_FILE_HELP 3 +#define IDM_FILE_EXIT_HELP "AUTOMATION_IDM_FILE_EXIT_HELP" +#define IDM_FILE_OPEN_TEST_HELP "AUTOMATION_IDM_FILE_OPEN_TEST_HELP" +#define IDM_FILE_HELP "AUTOMATION_IDM_FILE_HELP" #define GROSSER_TEST_DLG 256 #define IDM_TEST 5 #define IDM_TEST_GROSS 6 diff --git a/automation/source/miniapp/servres.src b/automation/source/miniapp/servres.src index 426be8b81532..c1af1caa775a 100644 --- a/automation/source/miniapp/servres.src +++ b/automation/source/miniapp/servres.src @@ -54,7 +54,7 @@ ModalDialog GROSSER_TEST_DLG }; OKButton 1 { - HelpID = 1 ; + HelpID = "hid1" ; Pos = MAP_APPFONT ( 132 , 92 ) ; Size = MAP_APPFONT ( 64 , 12 ) ; TabStop = TRUE ; diff --git a/automation/source/miniapp/servuid.hxx b/automation/source/miniapp/servuid.hxx index 7d66c5473fac..c1ba920f3667 100644 --- a/automation/source/miniapp/servuid.hxx +++ b/automation/source/miniapp/servuid.hxx @@ -24,14 +24,14 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#define UID_GROSSER_TEST_DLG 101 -#define UID_CheckBox 202 -#define UID_TriStateBox 303 -#define UID_OKButton 404 -#define UID_TimeField 505 -#define UID_MultiLineEdit 606 -#define UID_RadioButton1 707 -#define UID_RadioButton2 708 -#define UID_MultiListBox 809 -#define UID_ComboBox 910 -#define UID_DateBox 1011 +#define UID_GROSSER_TEST_DLG "AUTOMATION_UID_GROSSER_TEST_DLG" +#define UID_CheckBox "AUTOMATION_UID_CheckBox" +#define UID_TriStateBox "AUTOMATION_UID_TriStateBox" +#define UID_OKButton "AUTOMATION_UID_OKButton" +#define UID_TimeField "AUTOMATION_UID_TimeField" +#define UID_MultiLineEdit "AUTOMATION_UID_MultiLineEdit" +#define UID_RadioButton1 "AUTOMATION_UID_RadioButton1" +#define UID_RadioButton2 "AUTOMATION_UID_RadioButton2" +#define UID_MultiListBox "AUTOMATION_UID_MultiListBox" +#define UID_ComboBox "AUTOMATION_UID_ComboBox" +#define UID_DateBox "AUTOMATION_UID_DateBox" diff --git a/automation/source/miniapp/testapp.cxx b/automation/source/miniapp/testapp.cxx index 0a29fcc7e6e1..eec1d8ac837b 100644 --- a/automation/source/miniapp/testapp.cxx +++ b/automation/source/miniapp/testapp.cxx @@ -122,7 +122,8 @@ void MainWindow::Tree(GHEditWindow *aEditWin, Window *pBase, USHORT Indent) aText.SearchAndReplaceAllAscii("\n",CUniString("\\n")); aEditWin->AddText(String(sIndent).AppendAscii("Text: ").Append(aText).AppendAscii("\n")); - aEditWin->AddText(String(sIndent).AppendAscii("Help: ").Append(String::CreateFromInt64(pBase->GetHelpId())).AppendAscii(":").Append(pBase->GetQuickHelpText()).AppendAscii(":").Append(pBase->GetHelpText()).AppendAscii("\n")); + // FIXME: HELPID + aEditWin->AddText(String(sIndent).AppendAscii("Help: ").Append(String(rtl::OStringToOUString(pBase->GetHelpId(), RTL_TEXTENCODING_UTF8))).AppendAscii(":").Append(pBase->GetQuickHelpText()).AppendAscii(":").Append(pBase->GetHelpText()).AppendAscii("\n")); USHORT i; for (i = 0 ; i < pBase->GetChildCount() ; i++) diff --git a/automation/source/server/XMLParser.cxx b/automation/source/server/XMLParser.cxx index 6e6c3dc859a7..e07f1654ecd5 100644 --- a/automation/source/server/XMLParser.cxx +++ b/automation/source/server/XMLParser.cxx @@ -458,7 +458,7 @@ void StatementCommand::HandleSAXParser() { if ( !pSAXParser->Parse( PARSE_ONLY ) ) ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) ); - pRet->GenReturn ( RET_Value, aSmartMethodId, pSAXParser->GetErrors() ); + pRet->GenReturn ( RET_Value, nMethodId, pSAXParser->GetErrors() ); } xParserKeepaliveReference.clear(); @@ -488,7 +488,7 @@ void StatementCommand::HandleSAXParser() if ( !pSAXParser->Parse( aAction ) ) ReportError( GEN_RES_STR1( S_NO_SAX_PARSER, RcString( nMethodId ) ) ); - pRet->GenReturn ( RET_Value, aSmartMethodId, pSAXParser->GetErrors() ); + pRet->GenReturn ( RET_Value, nMethodId, pSAXParser->GetErrors() ); } } else @@ -497,7 +497,7 @@ void StatementCommand::HandleSAXParser() break; case RC_SAXGetNodeType: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)pSAXParser->GetCurrentNode()->GetNodeType() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)pSAXParser->GetCurrentNode()->GetNodeType() ); } break; case RC_SAXGetAttributeCount: @@ -512,23 +512,23 @@ void StatementCommand::HandleSAXParser() switch ( nMethodId ) { case RC_SAXGetElementName: - pRet->GenReturn ( RET_Value, aSmartMethodId, pElementNode->GetNodeName() ); + pRet->GenReturn ( RET_Value, nMethodId, pElementNode->GetNodeName() ); break; case RC_SAXGetChildCount: - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)pElementNode->GetChildCount() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)pElementNode->GetChildCount() ); break; case RC_SAXGetAttributeCount: if ( xAttributeList.is() ) - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)xAttributeList->getLength() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)xAttributeList->getLength() ); else - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)0 ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)0 ); break; case RC_SAXGetAttributeName: { - if( (nParams & PARAM_USHORT_1) && ValueOK( aSmartMethodId, RcString( nMethodId ), nNr1, xAttributeList.is()?xAttributeList->getLength():0 ) ) + if( (nParams & PARAM_USHORT_1) && ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, xAttributeList.is()?xAttributeList->getLength():0 ) ) { String aRet( xAttributeList->getNameByIndex( nNr1-1 ) ); - pRet->GenReturn ( RET_Value, aSmartMethodId, aRet ); + pRet->GenReturn ( RET_Value, nMethodId, aRet ); } else ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) ); @@ -537,15 +537,15 @@ void StatementCommand::HandleSAXParser() case RC_SAXGetAttributeValue: // Number or String { - if( (nParams & PARAM_USHORT_1) && ValueOK( aSmartMethodId, RcString( nMethodId ), nNr1, xAttributeList.is()?xAttributeList->getLength():0 ) ) + if( (nParams & PARAM_USHORT_1) && ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, xAttributeList.is()?xAttributeList->getLength():0 ) ) { String aRet( xAttributeList->getValueByIndex( nNr1-1 ) ); - pRet->GenReturn ( RET_Value, aSmartMethodId, aRet ); + pRet->GenReturn ( RET_Value, nMethodId, aRet ); } else if( (nParams & PARAM_STR_1) && xAttributeList.is() ) { String aRet( xAttributeList->getValueByName( aString1 ) ); - pRet->GenReturn ( RET_Value, aSmartMethodId, aRet ); + pRet->GenReturn ( RET_Value, nMethodId, aRet ); } else ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) ); @@ -566,7 +566,7 @@ void StatementCommand::HandleSAXParser() { NodeRef xNode=pSAXParser->GetCurrentNode(); CharacterNode* aCharacterNode = (CharacterNode*)(&xNode); - pRet->GenReturn ( RET_Value, aSmartMethodId, aCharacterNode->GetCharacters() ); + pRet->GenReturn ( RET_Value, nMethodId, aCharacterNode->GetCharacters() ); } else ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) ); @@ -584,15 +584,15 @@ void StatementCommand::HandleSAXParser() if ( nNr1 == 0 ) { if ( bCheckOnly ) - pRet->GenReturn ( RET_Value, aSmartMethodId, pSAXParser->GetCurrentNode()->GetParent().Is() ); + pRet->GenReturn ( RET_Value, nMethodId, pSAXParser->GetCurrentNode()->GetParent().Is() ); else if ( pSAXParser->GetCurrentNode()->GetParent().Is() ) pSAXParser->SetCurrentNode( pSAXParser->GetCurrentNode()->GetParent() ); } else if ( !pElementNode ) ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) ); else if ( bCheckOnly ) - pRet->GenReturn ( RET_Value, aSmartMethodId, ValueOK( aSmartMethodId, String(), nNr1, pElementNode->GetChildCount() ) ); - else if ( ValueOK( aSmartMethodId, RcString( nMethodId ), nNr1, pElementNode->GetChildCount() ) ) + pRet->GenReturn ( RET_Value, nMethodId, ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, pElementNode->GetChildCount() ) ); + else if ( ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, pElementNode->GetChildCount() ) ) pSAXParser->SetCurrentNode( pElementNode->GetChild( nNr1-1 ) ); } else if( (nParams & PARAM_STR_1) ) @@ -600,7 +600,7 @@ void StatementCommand::HandleSAXParser() if ( aString1.EqualsAscii( "/" ) ) { if ( bCheckOnly ) - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)TRUE ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)TRUE ); else pSAXParser->SetCurrentNode( pSAXParser->GetRootNode() ); } @@ -609,7 +609,7 @@ void StatementCommand::HandleSAXParser() ULONG nTimestamp = (ULONG)aString1.GetToken( 1, ':' ).ToInt64(); ULONG nPointer = (ULONG)aString1.GetToken( 2, ':' ).ToInt64(); if ( bCheckOnly ) - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)(pSAXParser->GetTimestamp() == nTimestamp) ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)(pSAXParser->GetTimestamp() == nTimestamp) ); else if ( pSAXParser->GetTimestamp() == nTimestamp ) { @@ -652,7 +652,7 @@ void StatementCommand::HandleSAXParser() xNew.Clear(); } if ( bCheckOnly ) - pRet->GenReturn ( RET_Value, aSmartMethodId, xNew.Is() ); + pRet->GenReturn ( RET_Value, nMethodId, xNew.Is() ); else if ( xNew.Is() ) pSAXParser->SetCurrentNode( xNew ); @@ -661,7 +661,7 @@ void StatementCommand::HandleSAXParser() } else if ( bCheckOnly ) - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)FALSE ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)FALSE ); else ReportError( GEN_RES_STR0( S_INVALID_PARAMETERS ) ); } @@ -679,7 +679,7 @@ void StatementCommand::HandleSAXParser() NodeRef xNode=pSAXParser->GetCurrentNode(); Node* pNode = (Node*)(&xNode); aPath.Append( String::CreateFromInt64( (ULONG)pNode ) ); - pRet->GenReturn ( RET_Value, aSmartMethodId, aPath ); + pRet->GenReturn ( RET_Value, nMethodId, aPath ); } break; diff --git a/automation/source/server/cmdbasestream.cxx b/automation/source/server/cmdbasestream.cxx index 718bc52dad70..7f867c3a997c 100644 --- a/automation/source/server/cmdbasestream.cxx +++ b/automation/source/server/cmdbasestream.cxx @@ -49,7 +49,7 @@ CmdBaseStream::~CmdBaseStream() { } -void CmdBaseStream::GenError (SmartId *pUId, comm_String *pString ) +void CmdBaseStream::GenError (rtl::OString *pUId, comm_String *pString ) { Write(comm_USHORT(SIReturnError)); Write(pUId); @@ -64,46 +64,95 @@ void CmdBaseStream::GenReturn (comm_USHORT nRet, comm_ULONG nUId ) Write(comm_USHORT(PARAM_NONE)); // Typ der folgenden Parameter } -void CmdBaseStream::GenReturn (comm_USHORT nRet, SmartId *pUId, comm_ULONG nNr ) +void CmdBaseStream::GenReturn (comm_USHORT nRet, rtl::OString *pUId, comm_ULONG nNr ) { Write(comm_USHORT(SIReturn)); Write(nRet); - Write(pUId); + if ( pUId->equals( rtl::OString( "UID_ACTIVE" ) ) ) + Write(comm_ULONG(0)); + else + Write(pUId); Write(comm_USHORT(PARAM_ULONG_1)); // Typ der folgenden Parameter Write(nNr); } -void CmdBaseStream::GenReturn (comm_USHORT nRet, SmartId *pUId, comm_String *pString ) +void CmdBaseStream::GenReturn (comm_USHORT nRet, rtl::OString *pUId, comm_String *pString ) { Write(comm_USHORT(SIReturn)); Write(nRet); - Write(pUId); + if ( pUId->equals( rtl::OString( "UID_ACTIVE" ) ) ) + Write(comm_ULONG(0)); + else + Write(pUId); Write(comm_USHORT(PARAM_STR_1)); // Typ der folgenden Parameter Write(pString); } -void CmdBaseStream::GenReturn (comm_USHORT nRet, SmartId *pUId, comm_BOOL bBool ) +void CmdBaseStream::GenReturn (comm_USHORT nRet, rtl::OString *pUId, comm_BOOL bBool ) { Write(comm_USHORT(SIReturn)); Write(nRet); - Write(pUId); + if ( pUId->equals( rtl::OString( "UID_ACTIVE" ) ) ) + Write(comm_ULONG(0)); + else + Write(pUId); Write(comm_USHORT(PARAM_BOOL_1)); // Typ der folgenden Parameter Write(bBool); } -void CmdBaseStream::GenReturn (comm_USHORT nRet, SmartId *pUId, comm_ULONG nNr, comm_String *pString, comm_BOOL bBool ) +void CmdBaseStream::GenReturn (comm_USHORT nRet, rtl::OString *pUId, comm_ULONG nNr, comm_String *pString, comm_BOOL bBool ) { Write(comm_USHORT(SIReturn)); Write(nRet); - Write(pUId); + if ( pUId->equals( rtl::OString( "UID_ACTIVE" ) ) ) + Write(comm_ULONG(0)); + else + Write(pUId); Write(comm_USHORT(PARAM_ULONG_1|PARAM_STR_1|PARAM_BOOL_1)); // Typ der folgenden Parameter Write(nNr); Write(pString); Write(bBool); } +void CmdBaseStream::GenReturn (comm_USHORT nRet, comm_USHORT nMethod, comm_ULONG nNr ) +{ + Write(comm_USHORT(SIReturn)); + Write(nRet); + Write((comm_ULONG)nMethod); //HELPID BACKWARD (no ULONG needed) + Write(comm_USHORT(PARAM_ULONG_1)); // Typ der folgenden Parameter + Write(nNr); +} + +void CmdBaseStream::GenReturn (comm_USHORT nRet, comm_USHORT nMethod, comm_String *pString ) +{ + Write(comm_USHORT(SIReturn)); + Write(nRet); + Write((comm_ULONG)nMethod); //HELPID BACKWARD (no ULONG needed) + Write(comm_USHORT(PARAM_STR_1)); // Typ der folgenden Parameter + Write(pString); +} + +void CmdBaseStream::GenReturn (comm_USHORT nRet, comm_USHORT nMethod, comm_BOOL bBool ) +{ + Write(comm_USHORT(SIReturn)); + Write(nRet); + Write((comm_ULONG)nMethod); //HELPID BACKWARD (no ULONG needed) + Write(comm_USHORT(PARAM_BOOL_1)); // Typ der folgenden Parameter + Write(bBool); +} + +void CmdBaseStream::GenReturn (comm_USHORT nRet, comm_USHORT nMethod, comm_USHORT nNr ) +{ + Write(comm_USHORT(SIReturn)); + Write(nRet); + Write((comm_ULONG)nMethod); //HELPID BACKWARD (no ULONG needed) + Write(comm_USHORT(PARAM_USHORT_1)); // Typ der folgenden Parameter + Write(nNr); +} + + // MacroRecorder -void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod ) +void CmdBaseStream::GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod ) { Write(comm_USHORT(SIReturn)); Write(nRet); @@ -112,7 +161,7 @@ void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMet Write(nMethod); } -void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_String *pString ) +void CmdBaseStream::GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_String *pString ) { Write(comm_USHORT(SIReturn)); Write(nRet); @@ -122,7 +171,7 @@ void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMet Write(pString); } -void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_String *pString, comm_BOOL bBool ) +void CmdBaseStream::GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_String *pString, comm_BOOL bBool ) { Write(comm_USHORT(SIReturn)); Write(nRet); @@ -133,7 +182,7 @@ void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMet Write(bBool); } -void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_BOOL bBool ) +void CmdBaseStream::GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_BOOL bBool ) { Write(comm_USHORT(SIReturn)); Write(nRet); @@ -143,7 +192,7 @@ void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMet Write(bBool); } -void CmdBaseStream::GenReturn( comm_USHORT nRet, SmartId *pUId, comm_USHORT nMethod, comm_ULONG nNr ) +void CmdBaseStream::GenReturn( comm_USHORT nRet, rtl::OString *pUId, comm_USHORT nMethod, comm_ULONG nNr ) { Write(comm_USHORT(SIReturn)); Write(nRet); @@ -282,10 +331,10 @@ void CmdBaseStream::Read ( comm_String* &pString ) (void) pString; /* avoid warning about unused parameter */ DBG_ERROR("Read ( comm_String* &pString ) Not Implemented"); } -void CmdBaseStream::Read ( SmartId* &pId ) +void CmdBaseStream::Read ( rtl::OString* &pId ) { (void) pId; /* avoid warning about unused parameter */ - DBG_ERROR("Read ( SmartId* &pId ) Not Implemented"); + DBG_ERROR("Read ( rtl::OString* &pId ) Not Implemented"); } void CmdBaseStream::Write( comm_String *pString ) @@ -293,9 +342,9 @@ void CmdBaseStream::Write( comm_String *pString ) (void) pString; /* avoid warning about unused parameter */ DBG_ERROR("Write( comm_String *pString ) Not Implemented"); } -void CmdBaseStream::Write( SmartId* pId ) +void CmdBaseStream::Write( rtl::OString* pId ) { (void) pId; /* avoid warning about unused parameter */ - DBG_ERROR("Write( SmartId* pId ) Not Implemented"); + DBG_ERROR("Write( rtl::OString* pId ) Not Implemented"); } diff --git a/automation/source/server/recorder.cxx b/automation/source/server/recorder.cxx index 6c941032f104..ac0b9db9aaf8 100644 --- a/automation/source/server/recorder.cxx +++ b/automation/source/server/recorder.cxx @@ -105,30 +105,30 @@ IMPL_LINK( MacroRecorder, HookRefreshHdl, void*, EMPTYARG ) return 0; } -void MacroRecorder::LogVCL( SmartId aParentID, USHORT nVCLWindowType, SmartId aID, String aMethod, USHORT nParam ) +void MacroRecorder::LogVCL( rtl::OString aParentID, USHORT nVCLWindowType, rtl::OString aID, String aMethod, USHORT nParam ) { - ::comphelper::UiEventsLogger::logVcl( aParentID.GetText(), nVCLWindowType, aID.GetText(), aMethod, nParam ); + ::comphelper::UiEventsLogger::logVcl( Id2Str( aParentID ), nVCLWindowType, Id2Str( aID ), aMethod, nParam ); } -void MacroRecorder::LogVCL( SmartId aParentID, USHORT nVCLWindowType, SmartId aID, String aMethod ) +void MacroRecorder::LogVCL( rtl::OString aParentID, USHORT nVCLWindowType, rtl::OString aID, String aMethod ) { - ::comphelper::UiEventsLogger::logVcl( aParentID.GetText(), nVCLWindowType, aID.GetText(), aMethod ); + ::comphelper::UiEventsLogger::logVcl( Id2Str( aParentID ), nVCLWindowType, Id2Str( aID ), aMethod ); } Window* MacroRecorder::GetParentWithID( Window* pThis ) { Window *pOverlap = pThis->GetWindow( WINDOW_OVERLAP ); - while ( pOverlap != pThis && !pThis->GetSmartUniqueOrHelpId().HasAny() && pThis->GET_REAL_PARENT() ) + while ( pOverlap != pThis && !pThis->GetUniqueOrHelpId().getLength() && pThis->GET_REAL_PARENT() ) pThis = pThis->GET_REAL_PARENT(); return pThis; } -SmartId MacroRecorder::GetParentID( Window* pThis ) +rtl::OString MacroRecorder::GetParentID( Window* pThis ) { if ( pThis->GetParent() ) - return pThis->GetParent()->GetSmartUniqueOrHelpId(); + return pThis->GetParent()->GetUniqueOrHelpId(); else - return SmartId(); + return rtl::OString(); } IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) @@ -177,7 +177,7 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) } if ( m_bLog ) { -// HACK Too many KeyEvents generated LogVCL( SmartId(), 0, aKeyUniqueID, CUniString("TypeKeys"), aKeyString.Len() ); +// HACK Too many KeyEvents generated LogVCL( rtl::OString(), 0, aKeyUniqueID, CUniString("TypeKeys"), aKeyString.Len() ); } // cleanup aKeyString.Erase(); @@ -193,12 +193,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) case VCLEVENT_WINDOW_ACTIVATE: if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, SmartId(), (comm_USHORT)(M_SetPage|M_RET_NUM_CONTROL), static_cast<comm_ULONG>(pWin->GetSmartUniqueOrHelpId().GetNum()) ); //GetNum() ULONG != comm_ULONG on 64bit + StatementList::pRet->GenReturn( RET_MacroRecorder, rtl::OString(), (comm_USHORT)(M_SetPage|M_RET_NUM_CONTROL), Id2Str( pWin->GetUniqueOrHelpId() ) ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( SmartId(), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("SetPage") ); + LogVCL( rtl::OString(), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("SetPage") ); } break; } @@ -213,12 +213,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) { if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), (comm_USHORT)M_Check ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_USHORT)M_Check ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("Check") ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Check") ); } } } @@ -243,12 +243,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) } if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), nMethod ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), nMethod ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), aMethod ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod ); } } break; @@ -277,12 +277,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) case VCLEVENT_LISTBOX_SELECT: if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), (comm_USHORT)M_Select, comm_ULONG( ((ListBox*)pWin)->GetSelectEntryPos() +1 ) ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_USHORT)M_Select, comm_ULONG( ((ListBox*)pWin)->GetSelectEntryPos() +1 ) ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("Select"), ((ListBox*)pWin)->GetSelectEntryPos() ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Select"), ((ListBox*)pWin)->GetSelectEntryPos() ); } break; } @@ -312,13 +312,13 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) Sound::Beep(); else { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), (comm_USHORT)M_Select, (comm_ULONG) nPos+1 ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_USHORT)M_Select, (comm_ULONG) nPos+1 ); bSendData = TRUE; } } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("Select"), nPos ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Select"), nPos ); } } } @@ -334,7 +334,7 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) case VCLEVENT_BUTTON_CLICK: Window* pParent = pWin->GetParent(); BOOL bDone = FALSE; - if ( pParent->IsDialog() && !pWin->GetSmartUniqueOrHelpId().HasAny() ) + if ( pParent->IsDialog() && !pWin->GetUniqueOrHelpId().getLength() ) { switch ( pParent->GetType() ) { @@ -374,17 +374,17 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) if ( m_bRecord ) { if ( nMethod != M_Click ) - StatementList::pRet->GenReturn( RET_MacroRecorder, SmartId( 0 ), nMethod ); + StatementList::pRet->GenReturn( RET_MacroRecorder, UID_ACTIVE, nMethod ); else - StatementList::pRet->GenReturn( RET_MacroRecorder, SmartId( 0 ), nMethod, (comm_ULONG)nCurrentButtonId ); + StatementList::pRet->GenReturn( RET_MacroRecorder, UID_ACTIVE, nMethod, (comm_ULONG)nCurrentButtonId ); bSendData = TRUE; } if ( m_bLog ) { if ( nMethod != M_Click ) - LogVCL( SmartId(), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), aMethod ); + LogVCL( rtl::OString(), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod ); else - LogVCL( SmartId(), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), aMethod, nCurrentButtonId ); + LogVCL( rtl::OString(), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod, nCurrentButtonId ); bDone = TRUE; } } @@ -403,12 +403,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) } if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pParent->GetSmartUniqueOrHelpId(), nMethod ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pParent->GetUniqueOrHelpId(), nMethod ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), aMethod ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod ); bDone = TRUE; } } @@ -417,16 +417,16 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) } if ( m_bRecord ) { - if ( !bSendData && pWin->GetSmartUniqueOrHelpId().HasAny() ) + if ( !bSendData && pWin->GetUniqueOrHelpId().getLength() ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), (comm_USHORT)M_Click ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_USHORT)M_Click ); bSendData = TRUE; } } if ( m_bLog ) { if ( !bDone ) - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("Click") ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Click") ); } } break; @@ -480,12 +480,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) } if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), nMethod ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), nMethod ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), aMethod ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), aMethod ); } } break; @@ -502,12 +502,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) case VCLEVENT_BUTTON_CLICK: if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), (comm_USHORT)M_Click ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), (comm_USHORT)M_Click ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("Click") ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Click") ); } break; /* Keyevent or Timeout @@ -540,12 +540,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) // compare to 1 for floating ToolBoxes if ( m_bRecord ) { - if ( !pWin->GetSmartUniqueOrHelpId().HasAny() || pWin->GetSmartUniqueOrHelpId().Matches( 1 ) ) + if ( !pWin->GetUniqueOrHelpId().getLength() /* || pWin->GetUniqueOrHelpId().Matches( 1 ) */ ) // generate direct Button access - StatementList::pRet->GenReturn( RET_MacroRecorder, SmartId( pTB->GetItemCommand( pTB->GetCurItemId() ) ), (comm_USHORT)(M_Click) ); + StatementList::pRet->GenReturn( RET_MacroRecorder, Str2Id( pTB->GetItemCommand( pTB->GetCurItemId() ) ), (comm_USHORT)(M_Click) ); else // access via Toolbox - StatementList::pRet->GenReturn( RET_MacroRecorder, pTB->GetSmartUniqueOrHelpId(), (comm_USHORT)(M_Click|M_RET_NUM_CONTROL), static_cast<comm_ULONG>(pTB->GetHelpId( pTB->GetCurItemId() )) ); // GetHelpId() ULONG != comm_ULONG on 64bit + StatementList::pRet->GenReturn( RET_MacroRecorder, pTB->GetUniqueOrHelpId(), (comm_USHORT)(M_Click|M_RET_NUM_CONTROL), Id2Str( pTB->GetHelpId( pTB->GetCurItemId() ) ) ); bSendData = TRUE; } /* not needed if ( m_bLog ) @@ -566,7 +566,7 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) // { // if ( !pWin->GetSmartUniqueOrHelpId().HasAny() || pWin->GetSmartUniqueOrHelpId().Matches( 1 ) ) // // generate direct Button access -// StatementList::pRet->GenReturn( RET_MacroRecorder, SmartId( pActionParent->GetHelpId( pActionParent->GetCurItemId() ) ), (comm_USHORT)(M_TearOff) ); +// StatementList::pRet->GenReturn( RET_MacroRecorder, rtl::OString( pActionParent->GetHelpId( pActionParent->GetCurItemId() ) ), (comm_USHORT)(M_TearOff) ); // else // // access via Toolbox // StatementList::pRet->GenReturn( RET_MacroRecorder, pActionParent->GetSmartUniqueOrHelpId(), (comm_USHORT)(M_TearOff|M_RET_NUM_CONTROL), static_cast<comm_ULONG>(pActionParent->GetHelpId( pActionParent->GetCurItemId() )) ); // GetHelpId() ULONG != comm_ULONG on 64bit @@ -574,7 +574,7 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) // } // if ( m_bLog ) // { -// LogVCL( pActionParent->GetSmartUniqueOrHelpId(), pWin->GetType(), SmartId( pActionParent->GetHelpId( pActionParent->GetCurItemId() ) ), CUniString("TearOff") ); +// LogVCL( pActionParent->GetSmartUniqueOrHelpId(), pWin->GetType(), pActionParent->GetHelpId( pActionParent->GetCurItemId() ), CUniString("TearOff") ); // } // } // pActionParent = NULL; @@ -676,11 +676,11 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) Window *pIdWin = GetParentWithID( pWin ); if ( pIdWin != pWin ) bKeyFollowFocus = TRUE; - aKeyUniqueID = pIdWin->GetSmartUniqueOrHelpId(); + aKeyUniqueID = pIdWin->GetUniqueOrHelpId(); if ( m_bLog ) { // HACK Too many KeyEvents generated if ( aKeyString.Len() == 0 ) -// HACK Too many KeyEvents generated LogVCL( SmartId(), 0, aKeyUniqueID, CUniString("TypeKeysStart") ); +// HACK Too many KeyEvents generated LogVCL( rtl::OString(), 0, aKeyUniqueID, CUniString("TypeKeysStart") ); } if ( ( !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) && (( aKeyCode.GetGroup() == KEYGROUP_NUM) || @@ -1024,12 +1024,12 @@ IMPL_LINK( MacroRecorder, EventListener, VclSimpleEvent*, pEvent ) { if ( m_bRecord ) { - StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetSmartUniqueOrHelpId(), M_SetText, aEditModifyString ); + StatementList::pRet->GenReturn( RET_MacroRecorder, pWin->GetUniqueOrHelpId(), M_SetText, aEditModifyString ); bSendData = TRUE; } if ( m_bLog ) { - LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetSmartUniqueOrHelpId(), CUniString("Modify") ); + LogVCL( GetParentID( pWin ), pWin->GetType(), pWin->GetUniqueOrHelpId(), CUniString("Modify") ); } pEditModify = NULL; aEditModifyString.Erase(); //could be somewhat lengthy diff --git a/automation/source/server/recorder.hxx b/automation/source/server/recorder.hxx index baa6355848ff..5a409513cacc 100644 --- a/automation/source/server/recorder.hxx +++ b/automation/source/server/recorder.hxx @@ -27,7 +27,6 @@ #include <tools/string.hxx> #include <tools/link.hxx> -#include <vcl/smartid.hxx> #include <vcl/timer.hxx> class ToolBox; @@ -38,7 +37,7 @@ class MacroRecorder { private: Window* GetParentWithID( Window* pThis ); - SmartId GetParentID( Window* pThis ); + rtl::OString GetParentID( Window* pThis ); Link aEventListenerHdl; DECL_LINK( EventListener, VclSimpleEvent* ); @@ -51,7 +50,7 @@ private: // record keys String aKeyString; - SmartId aKeyUniqueID; // has to be remembered seperately since Window might be gone when needed + rtl::OString aKeyUniqueID; // has to be remembered seperately since Window might be gone when needed Window* pKeyWin; BOOL bKeyFollowFocus; @@ -60,8 +59,8 @@ private: void RemoveEventHooks(); DECL_LINK( HookRefreshHdl, void* ); - void LogVCL( SmartId aParentID, USHORT nVCLWindowType, SmartId aID, String aMethod, USHORT aParam ); - void LogVCL( SmartId aParentID, USHORT nVCLWindowType, SmartId aID, String aMethod ); + void LogVCL( rtl::OString aParentID, USHORT nVCLWindowType, rtl::OString aID, String aMethod, USHORT aParam ); + void LogVCL( rtl::OString aParentID, USHORT nVCLWindowType, rtl::OString aID, String aMethod ); static MacroRecorder *pMacroRecorder; diff --git a/automation/source/server/retstrm.cxx b/automation/source/server/retstrm.cxx index 13a9e9b72258..951237dbcd2f 100644 --- a/automation/source/server/retstrm.cxx +++ b/automation/source/server/retstrm.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_automation.hxx" #include <tools/stream.hxx> +#include <basic/ttstrhlp.hxx> #include "retstrm.hxx" #include "rcontrol.hxx" @@ -47,41 +48,50 @@ RetStream::~RetStream() delete pSammel; } -void RetStream::GenError ( SmartId aUId, String aString ) +void RetStream::GenError ( rtl::OString aUId, String aString ) { CmdBaseStream::GenError ( &aUId, &aString ); } -void RetStream::GenReturn ( USHORT nRet, SmartId aUId, String aString ) +void RetStream::GenReturn ( USHORT nRet, rtl::OString aUId, String aString ) { CmdBaseStream::GenReturn ( nRet, &aUId, &aString ); } -void RetStream::GenReturn ( USHORT nRet, SmartId aUId, SbxValue &aValue ) -{ - Write(USHORT(SIReturn)); - Write(nRet); - Write(&aUId); - Write(USHORT(PARAM_SBXVALUE_1)); // Typ der folgenden Parameter - Write(aValue); -} - -void RetStream::GenReturn ( USHORT nRet, SmartId aUId, comm_ULONG nNr, String aString, BOOL bBool ) +void RetStream::GenReturn ( USHORT nRet, rtl::OString aUId, comm_ULONG nNr, String aString, BOOL bBool ) { CmdBaseStream::GenReturn ( nRet, &aUId, nNr, &aString, bBool ); } -void RetStream::GenReturn( USHORT nRet, SmartId aUId, comm_USHORT nMethod, String aString ) +// MacroRecorder +void RetStream::GenReturn( USHORT nRet, rtl::OString aUId, comm_USHORT nMethod, String aString ) { CmdBaseStream::GenReturn ( nRet, &aUId, nMethod, &aString ); } -void RetStream::GenReturn( USHORT nRet, SmartId aUId, comm_USHORT nMethod, String aString, BOOL bBool ) +void RetStream::GenReturn( USHORT nRet, rtl::OString aUId, comm_USHORT nMethod, String aString, BOOL bBool ) { CmdBaseStream::GenReturn ( nRet, &aUId, nMethod, &aString, bBool ); } +void RetStream::GenReturn ( USHORT nRet, USHORT nMethod, SbxValue &aValue ) +{ + Write(USHORT(SIReturn)); + Write(nRet); + Write((comm_ULONG)nMethod); //HELPID BACKWARD (no ULONG needed) + Write(USHORT(PARAM_SBXVALUE_1)); // Typ der folgenden Parameter + Write(aValue); +} + +void RetStream::GenReturn( USHORT nRet, USHORT nMethod, String aString ) +{ + CmdBaseStream::GenReturn ( nRet, nMethod, &aString ); +} + + + + void RetStream::Write( String *pString ) { CmdBaseStream::Write( pString->GetBuffer(), pString->Len() ); @@ -93,16 +103,11 @@ void RetStream::Write( SbxValue &aValue ) aValue.Store( *pSammel ); } -void RetStream::Write( SmartId* pId ) +void RetStream::Write( rtl::OString* pId ) { - DBG_ASSERT( !pId->HasString() || !pId->HasNumeric(), "SmartId contains Number and String. using String only." ); - if ( pId->HasString() ) - { - String aTmp( pId->GetStr() ); - Write( &aTmp ); - } - else - Write( static_cast<comm_ULONG>(pId->GetNum()) ); ////GetNum() ULONG != comm_ULONG on 64bit + //HELPID BACKWARD (should use ByteString or OString) + String aTmp( Id2Str( *pId ) ); + Write( &aTmp ); } diff --git a/automation/source/server/retstrm.hxx b/automation/source/server/retstrm.hxx index 888d1717422c..a7033714ba6d 100644 --- a/automation/source/server/retstrm.hxx +++ b/automation/source/server/retstrm.hxx @@ -28,7 +28,6 @@ #define _RETSTRM_HXX #include <basic/sbxvar.hxx> -#include <vcl/smartid.hxx> #include "cmdbasestream.hxx" class SvStream; @@ -41,26 +40,30 @@ public: ~RetStream(); using CmdBaseStream::GenError; -// void GenError( comm_ULONG nError, const comm_UniChar* aString, comm_USHORT nLenInChars ){CmdBaseStream::GenError( nError, aString, nLenInChars );} // new - void GenError( SmartId aUId, String aString ); + void GenError( rtl::OString aUId, String aString ); using CmdBaseStream::GenReturn; void GenReturn( comm_USHORT nRet, comm_ULONG nNr ){CmdBaseStream::GenReturn( nRet, nNr );} - void GenReturn( comm_USHORT nRet, SmartId aUId, comm_ULONG nNr ){CmdBaseStream::GenReturn( nRet, &aUId, nNr );} - void GenReturn( comm_USHORT nRet, SmartId aUId, comm_BOOL bBool ){CmdBaseStream::GenReturn( nRet, &aUId, bBool );} + void GenReturn( comm_USHORT nRet, rtl::OString aUId, comm_ULONG nNr ){CmdBaseStream::GenReturn( nRet, &aUId, nNr );} + void GenReturn( comm_USHORT nRet, rtl::OString aUId, comm_BOOL bBool ){CmdBaseStream::GenReturn( nRet, &aUId, bBool );} + // MacroRecorder - void GenReturn( comm_USHORT nRet, SmartId aUId, comm_USHORT nMethod ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod );} - void GenReturn( comm_USHORT nRet, SmartId aUId, comm_USHORT nMethod, comm_BOOL bBool ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod, bBool );} - void GenReturn( comm_USHORT nRet, SmartId aUId, comm_USHORT nMethod, comm_ULONG nNr ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod, nNr );} + void GenReturn( comm_USHORT nRet, rtl::OString aUId, comm_USHORT nMethod ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod );} // also used outside MacroRecorder + void GenReturn( comm_USHORT nRet, rtl::OString aUId, comm_USHORT nMethod, comm_BOOL bBool ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod, bBool );} + void GenReturn( comm_USHORT nRet, rtl::OString aUId, comm_USHORT nMethod, comm_ULONG nNr ){CmdBaseStream::GenReturn( nRet, &aUId, nMethod, nNr );} // new - void GenReturn( USHORT nRet, SmartId aUId, String aString ); - void GenReturn( USHORT nRet, SmartId aUId, SbxValue &aValue ); - void GenReturn( USHORT nRet, SmartId aUId, comm_ULONG nNr, String aString, BOOL bBool ); + void GenReturn( USHORT nRet, rtl::OString aUId, String aString ); + void GenReturn( USHORT nRet, rtl::OString aUId, comm_ULONG nNr, String aString, BOOL bBool ); + +// needed for RemoteCommand and Profiling + void GenReturn( USHORT nRet, USHORT nMethod, SbxValue &aValue ); + void GenReturn( USHORT nRet, USHORT nMethod, String aString ); + // MacroRecorder - void GenReturn( USHORT nRet, SmartId aUId, comm_USHORT nMethod, String aString ); - void GenReturn( USHORT nRet, SmartId aUId, comm_USHORT nMethod, String aString, BOOL bBool ); + void GenReturn( USHORT nRet, rtl::OString aUId, comm_USHORT nMethod, String aString ); + void GenReturn( USHORT nRet, rtl::OString aUId, comm_USHORT nMethod, String aString, BOOL bBool ); void Reset(); SvStream* GetStream(); @@ -75,7 +78,7 @@ public: void Write( SbxValue &aValue ); // Complex Datatypes to be handled system dependent - virtual void Write( SmartId* pId ); + virtual void Write( rtl::OString* pId ); virtual void Write( String *pString ); SvStream *pSammel; diff --git a/automation/source/server/server.cxx b/automation/source/server/server.cxx index e4e59251dd63..00d2aaabd197 100644 --- a/automation/source/server/server.cxx +++ b/automation/source/server/server.cxx @@ -709,7 +709,7 @@ IMPL_LINK( ImplRemoteControl, CommandHdl, Application*, EMPTYARG ) m_bInsideExecutionLoop = FALSE; } - StatementList::aWindowWaitUId = SmartId(); // Warten rücksetzen, da handler sowieso verlassen wird + StatementList::aWindowWaitUId = rtl::OString(); // Warten rücksetzen, da handler sowieso verlassen wird /* if( StatementList::pFirst && !StatementList::bReadingCommands ) // Abfrage nötig, da andere CommandHdl aktiv sein können oder @@ -857,6 +857,9 @@ ImplRemoteControl::ImplRemoteControl() m_pDbgWin = new EditWindow( NULL, CUniString("Debug Window"), WB_VSCROLL ); m_pDbgWin->bQuiet = TRUE; m_pDbgWin->Hide(); + m_pDbgWin->bQuiet = FALSE; + m_pDbgWin->Show(); + StatementList::m_pDbgWin = m_pDbgWin; } #endif diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx index c0abcb057f8b..f663665c20b6 100644 --- a/automation/source/server/sta_list.cxx +++ b/automation/source/server/sta_list.cxx @@ -78,15 +78,15 @@ EditWindow *StatementList::m_pDbgWin; #endif -SmartId StatementList::aWindowWaitUId = SmartId(); +rtl::OString StatementList::aWindowWaitUId = rtl::OString(); Window *StatementList::pWindowWaitPointer = NULL; -SmartId StatementList::aWindowWaitOldHelpId = SmartId(); -SmartId StatementList::aWindowWaitOldUniqueId = SmartId(); +rtl::OString StatementList::aWindowWaitOldHelpId = rtl::OString(); +rtl::OString StatementList::aWindowWaitOldUniqueId = rtl::OString(); USHORT StatementList::nUseBindings = 0; -SmartId StatementList::aSubMenuId1 = SmartId(); // Untermenüs bei PopupMenus -SmartId StatementList::aSubMenuId2 = SmartId(); // erstmal 2-Stufig -SmartId StatementList::aSubMenuId3 = SmartId(); // and now even 3 levels #i31512# +USHORT StatementList::aSubMenuId1 = 0; // Untermenüs bei PopupMenus +USHORT StatementList::aSubMenuId2 = 0; // erstmal 2-Stufig +USHORT StatementList::aSubMenuId3 = 0; // and now even 3 levels #i31512# SystemWindow *StatementList::pMenuWindow = NULL; TTProperties *StatementList::pTTProperties = NULL; @@ -130,7 +130,8 @@ TTSettings* GetTTSettings() -#define IS_WINP_CLOSING(pWin) (pWin->GetSmartHelpId().Matches( 4321 ) && pWin->GetSmartUniqueId().Matches( 1234 )) +// FIXME: HELPID +#define IS_WINP_CLOSING(pWin) (pWin->GetHelpId().equals( "TT_Win_is_closing_HID" ) && pWin->GetUniqueId().equals( "TT_Win_is_closing_UID" )) /* UniString GEN_RES_STR0( ULONG nResId ) { return ResString( nResId ); } @@ -155,7 +156,7 @@ void StatementList::InitProfile() #if OSL_DEBUG_LEVEL > 1 if ( pCurrentProfileStatement != NULL && pCurrentProfileStatement != this ) - pRet->GenReturn( RET_ProfileInfo, SmartId(), CUniString("InitProfile von anderem Statement gerufen ohne SendProfile\n") ); + pRet->GenReturn( RET_ProfileInfo, 0, CUniString("InitProfile von anderem Statement gerufen ohne SendProfile\n") ); #endif pCurrentProfileStatement = this; } @@ -171,18 +172,19 @@ void StatementList::SendProfile( String aText ) pProfiler->EndProfileInterval(); if ( pProfiler->IsProfilingPerCommand() ) - pRet->GenReturn( RET_ProfileInfo, SmartId(), pProfiler->GetProfileLine( aText ) ); + pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetProfileLine( aText ) ); if ( pProfiler->IsPartitioning() ) - pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileTime ), static_cast<comm_ULONG>(pProfiler->GetPartitioningTime()) ); // GetPartitioningTime() ULONG != comm_ULONG on 64bit + // FIXME: HELPID + pRet->GenReturn( RET_ProfileInfo, S_ProfileTime, static_cast<comm_ULONG>(pProfiler->GetPartitioningTime()) ); // GetPartitioningTime() ULONG != comm_ULONG on 64bit } if ( pProfiler->IsAutoProfiling() ) - pRet->GenReturn( RET_ProfileInfo, SmartId(), pProfiler->GetAutoProfiling() ); + pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetAutoProfiling() ); #if OSL_DEBUG_LEVEL > 1 if ( pCurrentProfileStatement == NULL ) - pRet->GenReturn( RET_ProfileInfo, SmartId(), CUniString("SendProfile ohne InitProfile\n") ); + pRet->GenReturn( RET_ProfileInfo, 0, CUniString("SendProfile ohne InitProfile\n") ); #endif pCurrentProfileStatement = NULL; } @@ -390,7 +392,7 @@ Window* StatementList::SearchClientWin( Window *pBase, Search &aSearch, BOOL May BOOL SearchUID::IsWinOK( Window *pWin ) { - if ( aUId.Matches( pWin->GetSmartUniqueOrHelpId() ) ) + if ( aUId.equals( pWin->GetUniqueOrHelpId() ) ) { if ( ( pWin->IsEnabled() || HasSearchFlag( SEARCH_FIND_DISABLED ) ) && pWin->IsVisible() ) return TRUE; @@ -407,7 +409,7 @@ BOOL SearchUID::IsWinOK( Window *pWin ) USHORT i; for ( i = 0; i < pTB->GetItemCount() ; i++ ) { - if ( aUId.Matches( pTB->GetItemCommand(pTB->GetItemId( i )) ) || aUId.Matches( pTB->GetHelpId(pTB->GetItemId( i )) ) ) + if ( aUId.equals( Str2Id( pTB->GetItemCommand(pTB->GetItemId( i )) ) ) || aUId.equals( pTB->GetHelpId(pTB->GetItemId( i )) ) ) { // ID matches. Window *pItemWin; pItemWin = pTB->GetItemWindow( pTB->GetItemId( i ) ); @@ -455,7 +457,7 @@ BOOL SearchUID::IsWinOK( Window *pWin ) return FALSE; } -Window* StatementList::SearchTree( SmartId aUId ,BOOL bSearchButtonOnToolbox ) +Window* StatementList::SearchTree( rtl::OString aUId ,BOOL bSearchButtonOnToolbox ) { SearchUID aSearch(aUId,bSearchButtonOnToolbox); @@ -974,7 +976,7 @@ String StatementList::ClientTree(Window *pBase, int Indent) WRITE(sIndent); WRITEc("UId : "); - WRITE(UIdString(pBase->GetSmartUniqueOrHelpId())); + WRITE(Id2Str(pBase->GetUniqueOrHelpId())); WRITEc(":0x"); WRITE( String::CreateFromInt64( @@ -1031,7 +1033,7 @@ BOOL StatementList::CheckWindowWait() if ( WinPtrValid(pWindowWaitPointer) && IS_WINP_CLOSING(pWindowWaitPointer) ) { #if OSL_DEBUG_LEVEL > 1 - m_pDbgWin->AddText( aWindowWaitUId.GetText().AppendAscii(" Still Open. RType=") ); + m_pDbgWin->AddText( Id2Str(aWindowWaitUId).AppendAscii(" Still Open. RType=") ); m_pDbgWin->AddText( String::CreateFromInt32( pWindowWaitPointer->GetType() ).AppendAscii("\n") ); #endif @@ -1041,10 +1043,10 @@ BOOL StatementList::CheckWindowWait() #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Close timed out. Going on!! " ); #endif - pWindowWaitPointer->SetSmartHelpId(aWindowWaitOldHelpId, SMART_SET_ALL); - pWindowWaitPointer->SetSmartUniqueId(aWindowWaitOldUniqueId, SMART_SET_ALL); + pWindowWaitPointer->SetHelpId(aWindowWaitOldHelpId); + pWindowWaitPointer->SetUniqueId(aWindowWaitOldUniqueId); - aWindowWaitUId = SmartId(); + aWindowWaitUId = rtl::OString(); pWindowWaitPointer = NULL; StartTime = Time(0L); return TRUE; @@ -1053,7 +1055,7 @@ BOOL StatementList::CheckWindowWait() return FALSE; } pWindowWaitPointer = NULL; - aWindowWaitUId = SmartId(); + aWindowWaitUId = rtl::OString(); #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Closed, Going on.\n" ); #endif @@ -1064,10 +1066,10 @@ BOOL StatementList::CheckWindowWait() void StatementList::ReportError(String aMessage) { - ReportError ( SmartId(), aMessage ); + ReportError ( rtl::OString(), aMessage ); } -void StatementList::ReportError(SmartId aUId, String aMessage) +void StatementList::ReportError(rtl::OString aUId, String aMessage) { pRet->GenError ( aUId, aMessage ); IsError = TRUE; @@ -1081,7 +1083,7 @@ void StatementList::ReportError(String aMessage, ULONG nWhatever) void StatementList::DirectLog( ULONG nType, String aMessage ) { if ( pRet ) - pRet->GenReturn( RET_DirectLoging, SmartId(nType), aMessage ); + pRet->GenReturn( RET_DirectLoging, (USHORT) nType, aMessage ); } diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index e5ea0ef6f357..a288c3d4d3a7 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -157,11 +157,11 @@ pfunc_osl_printDebugMessage StatementCommand::pOriginal_osl_DebugMessageFunc = N #define SET_WINP_CLOSING(pWin) \ pWindowWaitPointer = pWin; \ - aWindowWaitUId = pControl->GetSmartUniqueOrHelpId(); \ - aWindowWaitOldHelpId = pWin->GetSmartHelpId(); \ - aWindowWaitOldUniqueId = pWin->GetSmartUniqueId(); \ - pWin->SetSmartHelpId( SmartId(4321) ); \ - pWin->SetSmartUniqueId( SmartId(1234) ); + aWindowWaitUId = pControl->GetUniqueOrHelpId(); \ + aWindowWaitOldHelpId = pWin->GetHelpId(); \ + aWindowWaitOldUniqueId = pWin->GetUniqueId(); \ + pWin->SetHelpId( rtl::OString("TT_Win_is_closing_HID") ); \ + pWin->SetUniqueId( rtl::OString("TT_Win_is_closing_UID") ); // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -302,33 +302,9 @@ BOOL StatementFlow::Execute() // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // neue Hilfsfunktion, die stetig erweitert werden muss -static short ImpGetRType( Window *pWin, SmartId aUId ) +static short ImpGetRType( Window *pWin ) { - ULONG nUId = aUId.GetNum(); // GetNum() is always zero if no num is defined - // GGGg gggg::gggg gggg::ggLL LLLl::llll llll - DBG_ASSERT( pWin, "missing Parameter" ); - short nRT; - if( (nUId & 0xE0000000) == 0 ) // keine auto ID - nRT = C_NoType; - else { -// if( (nUId & 0x1F) == 0 ) // globale Resource - if( (nUId & 0x1FF) == 0 ) // globale Resource GH: soweit ich das verstanden habe 1FF - nRT = (short)(C_TabPage - 1 + (nUId >> 29)); - else - nRT = (short)((nUId & 0x00003E00) >> 9); - if ( nRT == C_TabPage ) // wegen TabDialog.UId = TabPage.UId - nRT = C_NoType; - else - { -#ifndef DBG_UTIL - return nRT; -#endif - } - } - -#ifdef DBG_UTIL - short n = nRT; -#endif + short nRT = C_NoType; WindowType eRT = pWin->GetType(); switch( eRT ) { case WINDOW_WINDOW: nRT = C_Window ; break; @@ -394,15 +370,6 @@ static short ImpGetRType( Window *pWin, SmartId aUId ) case WINDOW_DIALOG: nRT = C_Dialog; break; } -#ifdef DBG_UTIL - // Die Werte n sind bei den WindowTypen nicht mehr vergeben, werden aber in der AutoID noch verwendet - // Sie werden jetzt durch den Typ nRT implementiert. - DBG_ASSERT( n == C_NoType || n == nRT - || ( n == C_ImageButton && nRT == C_PushButton ) - || ( n == C_TriStateBox && nRT == C_CheckBox ) - || ( n == C_ImageRadioButton && nRT == C_RadioButton ) - , "error in algorithm" ); -#endif return nRT; } @@ -591,9 +558,9 @@ BOOL StatementSlot::Execute() if ( !bMenuClosed ) { pPopup->EndExecute(0); - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; bMenuClosed = TRUE; #if OSL_DEBUG_LEVEL > 1 @@ -715,12 +682,12 @@ BOOL StatementSlot::Execute() { case TT_PR_ERR_NODISPATCHER: { - ReportError( SmartId(nFunctionId), GEN_RES_STR0( S_SID_EXECUTE_FAILED_NO_DISPATCHER ) ); + ReportError( rtl::OString::valueOf((sal_Int32)nFunctionId), GEN_RES_STR0( S_SID_EXECUTE_FAILED_NO_DISPATCHER ) ); } break; case TT_PR_ERR_NOEXECUTE: { - ReportError(SmartId(nFunctionId), GEN_RES_STR0( S_SID_EXECUTE_FAILED ) ); + ReportError( rtl::OString::valueOf((sal_Int32)nFunctionId), GEN_RES_STR0( S_SID_EXECUTE_FAILED ) ); } break; } @@ -759,7 +726,6 @@ StatementUnoSlot::StatementUnoSlot(SCmdStream *pIn) StatementCommand::StatementCommand( StatementList *pAfterThis, USHORT MethodId, USHORT Params, USHORT Nr1 ) : nMethodId( MethodId ) -, aSmartMethodId() , nParams(Params) , nNr1(Nr1) , nNr2(0) @@ -772,12 +738,11 @@ StatementCommand::StatementCommand( StatementList *pAfterThis, USHORT MethodId, , bBool2(FALSE) { QueStatement( pAfterThis ); - aSmartMethodId = SmartId( nMethodId ); #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Directly adding Conmmand:" ); m_pDbgWin->AddText( " Methode: " ); - m_pDbgWin->AddText( aSmartMethodId.GetText() ); + m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( " Params:" ); if( nParams & PARAM_USHORT_1 ) {m_pDbgWin->AddText( " n1:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr1 ) );} if( nParams & PARAM_USHORT_2 ) {m_pDbgWin->AddText( " n2:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr2 ) );} @@ -795,7 +760,6 @@ StatementCommand::StatementCommand( StatementList *pAfterThis, USHORT MethodId, StatementCommand::StatementCommand( SCmdStream *pCmdIn ) : nMethodId(0) -, aSmartMethodId() , nParams(0) , nNr1(0) , nNr2(0) @@ -809,7 +773,6 @@ StatementCommand::StatementCommand( SCmdStream *pCmdIn ) { QueStatement( NULL ); pCmdIn->Read( nMethodId ); - aSmartMethodId = SmartId( nMethodId ); pCmdIn->Read( nParams ); if( nParams & PARAM_USHORT_1 ) pCmdIn->Read( nNr1 ); @@ -825,7 +788,7 @@ StatementCommand::StatementCommand( SCmdStream *pCmdIn ) #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Reading Conmmand:" ); m_pDbgWin->AddText( " Methode: " ); - m_pDbgWin->AddText( aSmartMethodId.GetText() ); + m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( " Params:" ); if( nParams & PARAM_USHORT_1 ) {m_pDbgWin->AddText( " n1:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr1 ) );} if( nParams & PARAM_USHORT_2 ) {m_pDbgWin->AddText( " n2:" );m_pDbgWin->AddText( String::CreateFromInt32( nNr2 ) );} @@ -866,7 +829,7 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst return; if ( bFirst ) - pRet->GenReturn ( RET_WinInfo, SmartId(), (comm_ULONG)nConf | DH_MODE_DATA_VALID, UniString(), TRUE ); + pRet->GenReturn ( RET_WinInfo, rtl::OString(), (comm_ULONG)nConf | DH_MODE_DATA_VALID, UniString(), TRUE ); if ( bFirst ) { @@ -943,8 +906,9 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst break; default: - if ( pBase->GetSmartUniqueOrHelpId().Equals( SmartId() ) && !( nConf & DH_MODE_ALLWIN ) ) + if ( ( pBase->GetUniqueOrHelpId().getLength() == 0 ) && !( nConf & DH_MODE_ALLWIN ) ) bSkip = TRUE; + break; } if ( !bSkip ) @@ -974,13 +938,9 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst aTypeSuffix.AppendAscii( "/Unknown", 8 ); } - SmartId aId = pBase->GetSmartUniqueOrHelpId(); - if ( aId.HasString() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( aId.GetStr() ), (comm_ULONG)pBase->GetType(), - TypeString(pBase->GetType()).Append(aTypeSuffix).AppendAscii(": ").Append(aName), FALSE ); - if ( !aId.HasString() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( aId.GetNum() ), (comm_ULONG)pBase->GetType(), - TypeString(pBase->GetType()).Append(aTypeSuffix).AppendAscii(": ").Append(aName), FALSE ); + rtl::OString aId = pBase->GetUniqueOrHelpId(); + pRet->GenReturn ( RET_WinInfo, aId, (comm_ULONG)pBase->GetType(), + TypeString(pBase->GetType()).Append(aTypeSuffix).AppendAscii(": ").Append(aName), FALSE ); if ( pBase->GetType() == WINDOW_TOOLBOX ) // Buttons und Controls auf Toolboxen. @@ -1002,10 +962,10 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst if ( pTB->GetItemType( i ) == TOOLBOXITEM_BUTTON && ( !pItemWin || !pItemWin->IsVisible() ) ) { if ( pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pTB->GetItemCommand(pTB->GetItemId( i )) ), (comm_ULONG)WINDOW_BUTTON, + pRet->GenReturn ( RET_WinInfo, Str2Id(pTB->GetItemCommand(pTB->GetItemId( i ))), (comm_ULONG)WINDOW_BUTTON, TypeString(WINDOW_BUTTON).AppendAscii(": ").Append(aName), FALSE ); if ( !pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pTB->GetHelpId(pTB->GetItemId( i )) ), (comm_ULONG)WINDOW_BUTTON, + pRet->GenReturn ( RET_WinInfo, pTB->GetHelpId(pTB->GetItemId( i )), (comm_ULONG)WINDOW_BUTTON, TypeString(WINDOW_BUTTON).AppendAscii(": ").Append(aName), FALSE ); } else @@ -1013,10 +973,10 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst if ( pItemWin ) { if ( pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pTB->GetItemCommand(pTB->GetItemId( i )) ), (comm_ULONG)pItemWin->GetType(), + pRet->GenReturn ( RET_WinInfo, Str2Id(pTB->GetItemCommand(pTB->GetItemId( i ))), (comm_ULONG)pItemWin->GetType(), TypeString(pItemWin->GetType()).AppendAscii(": ").Append(aName), FALSE ); if ( !pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pTB->GetHelpId(pTB->GetItemId( i )) ), (comm_ULONG)pItemWin->GetType(), + pRet->GenReturn ( RET_WinInfo, pTB->GetHelpId(pTB->GetItemId( i )), (comm_ULONG)pItemWin->GetType(), TypeString(pItemWin->GetType()).AppendAscii(": ").Append(aName), FALSE ); USHORT ii; for( ii = 0 ; ii < pItemWin->GetChildCount(); ii++ ) @@ -1048,10 +1008,10 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst DBG_ERROR1( "Unknown TOOLBOXITEM %i", pTB->GetItemType( i ) ); } if ( pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pTB->GetItemCommand(pTB->GetItemId( i )) ), (comm_ULONG)WINDOW_BASE, + pRet->GenReturn ( RET_WinInfo, Str2Id( pTB->GetItemCommand(pTB->GetItemId( i )) ), (comm_ULONG)WINDOW_BASE, aToolBoxItemType.AppendAscii(": ").Append(aName), FALSE ); if ( !pTB->GetItemCommand(pTB->GetItemId( i )).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pTB->GetHelpId(pTB->GetItemId( i )) ), (comm_ULONG)WINDOW_BASE, + pRet->GenReturn ( RET_WinInfo, pTB->GetHelpId(pTB->GetItemId( i )), (comm_ULONG)WINDOW_BASE, aToolBoxItemType.AppendAscii(": ").Append(aName), FALSE ); } } @@ -1076,35 +1036,35 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst aName = String(); if ( aName.Len() == 0 ) aName = pBD->GetPushButton( pBD->GetButtonId(i) )->GetText(); - String aID; + ByteString aID; switch ( pBD->GetButtonId(i) ) { case BUTTONID_OK: - aID.AssignAscii("Ok"); + aID.Assign("Ok"); break; case BUTTONID_CANCEL: - aID.AssignAscii("Cancel"); + aID.Assign("Cancel"); break; case BUTTONID_YES: - aID.AssignAscii("Yes"); + aID.Assign("Yes"); break; case BUTTONID_NO: - aID.AssignAscii("No"); + aID.Assign("No"); break; case BUTTONID_RETRY: - aID.AssignAscii("Retry"); + aID.Assign("Retry"); break; case BUTTONID_HELP: - aID.AssignAscii("Help"); + aID.Assign("Help"); break; default: - aID = UniString::CreateFromInt32( pBD->GetButtonId(i) ); + aID = ByteString::CreateFromInt32( pBD->GetButtonId(i) ); break; } - pRet->GenReturn ( RET_WinInfo, SmartId( aID ), (comm_ULONG)pBD->GetPushButton( pBD->GetButtonId(i) )->GetType(), // So daß der Text angezeigt wird! + pRet->GenReturn ( RET_WinInfo, aID, (comm_ULONG)pBD->GetPushButton( pBD->GetButtonId(i) )->GetType(), // So daß der Text angezeigt wird! TypeString(pBD->GetPushButton( pBD->GetButtonId(i) )->GetType()).AppendAscii(": ").Append(aName) - .AppendAscii(" ButtonId = ").Append(aID), FALSE ); + .AppendAscii(" ButtonId = ").AppendAscii( aID.GetBuffer() ), FALSE ); } return; // ButtonDialog ist hier schon komplett abgehandelt. @@ -1151,10 +1111,10 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst DBG_ERROR1( "Unknown MENUITEM %i", pMenu->GetItemType( i ) ); } if ( pMenu->GetItemCommand(nID).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( pMenu->GetItemCommand(nID) ), (comm_ULONG)0, + pRet->GenReturn ( RET_WinInfo, Str2Id( pMenu->GetItemCommand(nID) ), (comm_ULONG)0, aMenuItemType.AppendAscii(": ").Append(aName), FALSE ); if ( !pMenu->GetItemCommand(nID).Len() || ( nConf & DH_MODE_ALLWIN ) ) - pRet->GenReturn ( RET_WinInfo, SmartId( nID ), (comm_ULONG)0, + pRet->GenReturn ( RET_WinInfo, rtl::OString::valueOf( (sal_Int32)nID ), (comm_ULONG)0, aMenuItemType.AppendAscii(": ").Append(aName), FALSE ); } } @@ -1571,10 +1531,10 @@ BOOL StatementCommand::DisplayHID() if ( GetTTSettings()->Act ) { SET_WIN(GetTTSettings()->Act); - GetTTSettings()->pDisplayHidWin->SetDisplayText(GetTTSettings()->Act->GetSmartUniqueOrHelpId().GetText().AppendAscii(" WinType: ") + GetTTSettings()->pDisplayHidWin->SetDisplayText( Id2Str(GetTTSettings()->Act->GetUniqueOrHelpId()).AppendAscii(" WinType: ") .Append(UniString::CreateFromInt64(GetTTSettings()->Act->GetType())).AppendAscii(" ").Append(GetTTSettings()->Act->GetText())); - if ( GetTTSettings()->Act && !GetTTSettings()->Act->GetSmartUniqueId().Equals( GetTTSettings()->Act->GetSmartHelpId() ) ) - GetTTSettings()->pDisplayHidWin->SetText(UniString( TTProperties::GetSvtResId( TT_ALTERNATE_CAPTION ) ).Append(GetTTSettings()->Act->GetSmartHelpId().GetText())); + if ( GetTTSettings()->Act && !GetTTSettings()->Act->GetUniqueId().equals( GetTTSettings()->Act->GetHelpId() ) ) + GetTTSettings()->pDisplayHidWin->SetText(UniString( TTProperties::GetSvtResId( TT_ALTERNATE_CAPTION ) ).AppendAscii(GetTTSettings()->Act->GetHelpId().getStr())); else GetTTSettings()->pDisplayHidWin->SetText( GetTTSettings()->aOriginalCaption ); } @@ -1584,9 +1544,10 @@ BOOL StatementCommand::DisplayHID() else if ( GetTTSettings()->Act ) { // SET_WIN(GetTTSettings()->Act); - if ( GetTTSettings()->pDisplayHidWin->IsDisplayTextModified() && GetTTSettings()->pDisplayHidWin->GetDisplayText().Len() > 0 ) + // allow setting a HelpID manually (just enter the ID in the displayHID Window and terminate it by | + if ( GetTTSettings()->pDisplayHidWin->IsDisplayTextModified() && GetTTSettings()->pDisplayHidWin->GetDisplayText().GetTokenCount( '|' ) > 1 ) { - GetTTSettings()->Act->SetSmartUniqueId( SmartId( GetTTSettings()->pDisplayHidWin->GetDisplayText().ToInt32() ) ); + GetTTSettings()->Act->SetUniqueId( Str2Id( GetTTSettings()->pDisplayHidWin->GetDisplayText().GetToken( '|' ) ) ); GetTTSettings()->pDisplayHidWin->ClearDisplayTextModified(); } } @@ -2122,16 +2083,16 @@ void TranslateWin::EnableTranslation() void StatementCommand::Translate() { // Es wurde eine initale UniqueId mitgegeben. Dann nur die dopelten Shortcuts liefern - if( (nParams & PARAM_ULONG_1) && nLNr1 ) + if( (nParams & PARAM_STR_1) && nLNr1 ) { String aDouble; - Window *pWin = SearchTree( SmartId( nLNr1 ) ,FALSE ); + Window *pWin = SearchTree( Str2Id( aString1 ) ,FALSE ); if ( pWin ) { pWin = pWin->GetWindow( WINDOW_OVERLAP ); aDouble = TranslateWin::MarkShortcutErrors( pWin, TRUE ); } - pRet->GenReturn ( RET_Value, aSmartMethodId, aDouble ); + pRet->GenReturn ( RET_Value, nMethodId, aDouble ); return; } @@ -2164,14 +2125,14 @@ void StatementCommand::Translate() { Window* pNew = pTranslationWindow->GetWindow( WINDOW_CLIENT ); // Bei Dockingwindoes das kanze Geraffel von Docking Floating überspringen - while ( IsDialog( pNew ) && !pNew->GetSmartUniqueOrHelpId().HasAny() && pNew->GetChildCount() == 1 ) + while ( IsDialog( pNew ) && !pNew->GetUniqueOrHelpId().getLength() && pNew->GetChildCount() == 1 ) pNew = pNew->GetChild( 0 ); pTranslationWindow = pNew; } aTranslation = CUniString("0;"); - aTranslation += pTranslationWindow->GetSmartUniqueOrHelpId().GetText(); + aTranslation += Id2Str( pTranslationWindow->GetUniqueOrHelpId() ); aTranslation += ';'; aTranslation += TypeString( pTranslationWindow->GetType() ); @@ -2185,7 +2146,7 @@ void StatementCommand::Translate() if ( pParentDialog ) { - aTranslation += pParentDialog->GetSmartUniqueOrHelpId().GetText(); + aTranslation += Id2Str(pParentDialog->GetUniqueOrHelpId()); aTranslation += ';'; aTranslation += TypeString( pParentDialog->GetType() ); } @@ -2214,13 +2175,13 @@ void StatementCommand::Translate() // alle TABSs quoten () aTranslation.SearchAndReplaceAll( CUniString("\t"), CUniString("\\t") ); - pRet->GenReturn ( RET_Value, aSmartMethodId, aTranslation ); + pRet->GenReturn ( RET_Value, nMethodId, aTranslation ); GetTTSettings()->pTranslateWin->EnableTranslation(); GetTTSettings()->bToTop = TRUE; } else { - pRet->GenReturn ( RET_Value, aSmartMethodId, String() ); + pRet->GenReturn ( RET_Value, nMethodId, String() ); GetTTSettings()->pTranslateWin->EnableTranslation(); ErrorBox err( GetTTSettings()->pTranslateWin, TTProperties::GetSvtResId( TT_NO_CONTROL )); err.Execute(); @@ -2230,7 +2191,7 @@ void StatementCommand::Translate() } else if ( GetTTSettings()->pTranslateWin->IsNextDialog() ) { - pRet->GenReturn ( RET_Value, aSmartMethodId, CUniString("1") ); + pRet->GenReturn ( RET_Value, nMethodId, CUniString("1") ); GetTTSettings()->pTranslateWin->ResetNextDialog(); GetTTSettings()->pTranslateWin->LoseFocus(); GetTTSettings()->bToTop = TRUE; @@ -2238,7 +2199,7 @@ void StatementCommand::Translate() else { GetTTSettings()->pTranslateWin->EnableTranslation(); - pRet->GenReturn ( RET_Value, aSmartMethodId, String() ); + pRet->GenReturn ( RET_Value, nMethodId, String() ); } } @@ -2326,7 +2287,7 @@ BOOL StatementCommand::Execute() { #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Skipping Command: " ); - m_pDbgWin->AddText( aSmartMethodId.GetText() ); + m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( "\n" ); #endif @@ -2338,7 +2299,7 @@ BOOL StatementCommand::Execute() InitProfile(); #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Executing Command: " ); - m_pDbgWin->AddText( aSmartMethodId.GetText() ); + m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( "\n" ); #endif @@ -2349,7 +2310,7 @@ BOOL StatementCommand::Execute() #if OSL_DEBUG_LEVEL > 1 #define REPORT_WIN_CLOSED(pControl, aInfo) \ _REPORT_WIN_CLOSED(pControl, aInfo) \ - m_pDbgWin->AddText( aInfo.AppendAscii(" \"").Append( pControl->GetText() ).AppendAscii("\" geschlossen, RType = ").Append( TypeString(pControl->GetType()) ).AppendAscii(", UId = ").Append( UIdString(pControl->GetSmartUniqueOrHelpId()) ) ); + m_pDbgWin->AddText( aInfo.AppendAscii(" \"").Append( pControl->GetText() ).AppendAscii("\" geschlossen, RType = ").Append( TypeString(pControl->GetType()) ).AppendAscii(", UId = ").Append( UIdString( pControl->GetUniqueOrHelpId() ) ) ); #else #define REPORT_WIN_CLOSED(pControl, aInfo) _REPORT_WIN_CLOSED(pControl, aInfo) #endif @@ -2366,7 +2327,7 @@ BOOL StatementCommand::Execute() aString1.AppendAscii("\" geschlossen, RType = ");\ aString1 += TypeString(pControl->GetType()); \ aString1.AppendAscii(", UId = "); \ - aString1 += UIdString(pControl->GetSmartUniqueOrHelpId()); + aString1 += UIdString(pControl->GetUniqueOrHelpId()); switch ( nMethodId ) @@ -2399,9 +2360,9 @@ BOOL StatementCommand::Execute() bCatchGPF = TRUE; bUsePostEvents = TRUE; - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; } if ( !nRetryCount ) @@ -2422,12 +2383,12 @@ BOOL StatementCommand::Execute() && pControl->GetType() != WINDOW_BORDERWINDOW && nRetryCount-- ) { - short nRT = ImpGetRType( pControl, pControl->GetSmartUniqueOrHelpId() ); + short nRT = ImpGetRType( pControl ); if ( nRT == C_TabControl && pControl->GET_REAL_PARENT() && pControl->GET_REAL_PARENT()->GetType() == WINDOW_TABDIALOG ) { // Bei Tabcontrol den zugehörigen Tabdialog nehmen pControl = pControl->GET_REAL_PARENT(); - nRT = ImpGetRType( pControl, pControl->GetSmartUniqueOrHelpId() ); + nRT = ImpGetRType( pControl ); } switch( nRT ) @@ -2595,7 +2556,7 @@ BOOL StatementCommand::Execute() if ( Time().GetTime() < long(nLNr1) ) // Aktuelle Zeit kleiner Endzeit return FALSE; else - pRet->GenReturn ( RET_Value, aSmartMethodId, aString1); + pRet->GenReturn ( RET_Value, nMethodId, aString1); } break; case RC_WaitSlot: @@ -2609,12 +2570,12 @@ BOOL StatementCommand::Execute() } if ( !bIsSlotInExecute ) - pRet->GenReturn ( RET_Value, aSmartMethodId, comm_USHORT(CONST_WSFinished) ); + pRet->GenReturn ( RET_Value, nMethodId, comm_USHORT(CONST_WSFinished) ); else { if ( Time().GetTime() < long(nLNr1) ) // Aktuelle Zeit kleiner Endzeit return FALSE; - pRet->GenReturn ( RET_Value, aSmartMethodId, comm_USHORT(CONST_WSTimeout) ); + pRet->GenReturn ( RET_Value, nMethodId, comm_USHORT(CONST_WSTimeout) ); } } break; @@ -2666,21 +2627,21 @@ BOOL StatementCommand::Execute() ReportError( GEN_RES_STR0( S_NO_ACTIVE_WINDOW ) ); // if ( Application::GetAppWindow() ) // bWait = Application::GetAppWindow()->IsWait(); - pRet->GenReturn ( RET_Value, aSmartMethodId, bWait ); + pRet->GenReturn ( RET_Value, nMethodId, bWait ); break; } case RC_GetClipboard: { ::rtl::OUString aTemp; ::svt::OStringTransfer::PasteString( aTemp, GetFirstDocFrame() ); - pRet->GenReturn ( RET_Value, aSmartMethodId, String( aTemp ) ); + pRet->GenReturn ( RET_Value, nMethodId, String( aTemp ) ); } break; case RC_SetClipboard: ::svt::OStringTransfer::CopyString(aString1,GetFirstDocFrame()); break; case RC_WinTree: - pRet->GenReturn ( RET_Value, aSmartMethodId, Tree( NULL, 0)); + pRet->GenReturn ( RET_Value, nMethodId, Tree( NULL, 0)); break; #if OSL_DEBUG_LEVEL > 1 case RC_NoDebug: @@ -2704,7 +2665,9 @@ BOOL StatementCommand::Execute() else if ( !IsDialog(pWin) ) ReportError( GEN_RES_STR0( S_NO_DIALOG_IN_GETACTIVE ) ); else - pRet->GenReturn( RET_Value, aSmartMethodId, static_cast<comm_ULONG>(pWin->GetSmartUniqueOrHelpId().GetNum())); //GetNum() ULONG != comm_ULONG on 64bit + { + pRet->GenReturn( RET_Value, nMethodId, Id2Str(pWin->GetUniqueOrHelpId()) ); + } } break; case RC_UseBindings: @@ -2737,7 +2700,7 @@ BOOL StatementCommand::Execute() pProfiler->StartAutoProfiling( nNr1 ); // Der Header ist abhängig vom Modus - pRet->GenReturn( RET_ProfileInfo, SmartId(), pProfiler->GetProfileHeader() ); + pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetProfileHeader() ); } else if ( nParams & PARAM_USHORT_1 ) { // Partitioning initialisieren: Profile true [,nNr][,nNr][,nNr][,nNr] @@ -2750,32 +2713,32 @@ BOOL StatementCommand::Execute() // Hier werden die Parameter ans Testtool zurück übertragen. // Das ist zwar etwas eigenartig, aber ansonsten müsste man im Testtool // die einfache Struktur der Remotebefehle aufbrechen. - pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileReset ), nAnzahl ); + pRet->GenReturn( RET_ProfileInfo, S_ProfileReset, nAnzahl ); // Und die einzelnen Grenzen - if ( nParams & PARAM_USHORT_1 ) { pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileBorder1 ), (comm_ULONG)nNr1 ); }; - if ( nParams & PARAM_USHORT_2 ) { pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileBorder2 ), (comm_ULONG)nNr2 ); }; - if ( nParams & PARAM_USHORT_3 ) { pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileBorder3 ), (comm_ULONG)nNr3 ); }; - if ( nParams & PARAM_USHORT_4 ) { pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileBorder4 ), (comm_ULONG)nNr4 ); }; + if ( nParams & PARAM_USHORT_1 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder1, (comm_ULONG)nNr1 ); }; + if ( nParams & PARAM_USHORT_2 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder2, (comm_ULONG)nNr2 ); }; + if ( nParams & PARAM_USHORT_3 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder3, (comm_ULONG)nNr3 ); }; + if ( nParams & PARAM_USHORT_4 ) { pRet->GenReturn( RET_ProfileInfo, S_ProfileBorder4, (comm_ULONG)nNr4 ); }; pProfiler->StartPartitioning(); } else if( nParams == PARAM_STR_1 ) // Genau ein String! { // Nur einen String ins Profiling aufnehmen aString1 += '\n'; - pRet->GenReturn( RET_ProfileInfo, SmartId(), aString1 ); + pRet->GenReturn( RET_ProfileInfo, 0, aString1 ); } else { // Normales Profiling je Kommando: profile if ( pProfiler->IsAutoProfiling() ) { - pRet->GenReturn( RET_ProfileInfo, SmartId(), pProfiler->GetAutoProfiling() ); + pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetAutoProfiling() ); pProfiler->StopAutoProfiling(); } pProfiler->StartProfilingPerCommand(); // Der Header ist abhängig vom Modus - pRet->GenReturn( RET_ProfileInfo, SmartId(), pProfiler->GetProfileHeader() ); + pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetProfileHeader() ); } } else // Profiling wieder ausschalten: Profile false @@ -2786,13 +2749,13 @@ BOOL StatementCommand::Execute() if ( pProfiler->IsAutoProfiling() ) { - pRet->GenReturn( RET_ProfileInfo, SmartId(), pProfiler->GetAutoProfiling() ); + pRet->GenReturn( RET_ProfileInfo, 0, pProfiler->GetAutoProfiling() ); pProfiler->StopAutoProfiling(); } if ( pProfiler->IsPartitioning() ) { - pRet->GenReturn( RET_ProfileInfo, SmartId( S_ProfileDump ), (comm_ULONG)0 ); + pRet->GenReturn( RET_ProfileInfo, S_ProfileDump, (comm_ULONG)0 ); pProfiler->StopPartitioning(); } @@ -2890,13 +2853,13 @@ BOOL StatementCommand::Execute() { case RC_MenuGetItemCount: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)nItemCount ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)nItemCount ); } break; case RC_MenuGetItemId: { - if ( ValueOK(aSmartMethodId, RcString( nMethodId ),nNr1,nItemCount) ) - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)pMenu->GetItemId(nPhysicalIndex-1) ); + if ( ValueOK( rtl::OString(), RcString( nMethodId ),nNr1,nItemCount) ) + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)pMenu->GetItemId(nPhysicalIndex-1) ); } break; case RC_MenuGetItemPos: @@ -2918,50 +2881,50 @@ BOOL StatementCommand::Execute() } } } - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)(nLogicalPos+1) ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)(nLogicalPos+1) ); } break; case RC_MenuIsSeperator: { - if ( ValueOK(aSmartMethodId, RcString( nMethodId ),nNr1,nItemCount) ) - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)(pMenu->GetItemType(nPhysicalIndex-1) == MENUITEM_SEPARATOR) ); + if ( ValueOK( rtl::OString(), RcString( nMethodId ),nNr1,nItemCount) ) + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)(pMenu->GetItemType(nPhysicalIndex-1) == MENUITEM_SEPARATOR) ); } break; case RC_MenuIsItemChecked: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)pMenu->IsItemChecked(nNr1) ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)pMenu->IsItemChecked(nNr1) ); } break; case RC_MenuIsItemEnabled: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)pMenu->IsItemEnabled(nNr1) ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)pMenu->IsItemEnabled(nNr1) ); } break; case RC_MenuGetItemText: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (String)pMenu->GetItemText(nNr1) ); + pRet->GenReturn ( RET_Value, nMethodId, (String)pMenu->GetItemText(nNr1) ); } break; case RC_MenuGetItemCommand: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (String)pMenu->GetItemCommand(nNr1) ); + pRet->GenReturn ( RET_Value, nMethodId, (String)pMenu->GetItemCommand(nNr1) ); } break; case RC_MenuHasSubMenu: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (BOOL)(pMenu->GetPopupMenu(nNr1) != NULL) ); + pRet->GenReturn ( RET_Value, nMethodId, (BOOL)(pMenu->GetPopupMenu(nNr1) != NULL) ); } break; case RC_MenuSelect: { if ( pMenu->GetPopupMenu(nNr1) ) { - if ( !aSubMenuId1.GetNum() ) - aSubMenuId1 = SmartId(nNr1); - else if ( !aSubMenuId2.GetNum() ) - aSubMenuId2 = SmartId(nNr1); - else if ( !aSubMenuId3.GetNum() ) - aSubMenuId3 = SmartId(nNr1); + if ( !aSubMenuId1 ) + aSubMenuId1 = nNr1; + else if ( !aSubMenuId2 ) + aSubMenuId2 = nNr1; + else if ( !aSubMenuId3 ) + aSubMenuId3 = nNr1; if ( pPopup ) pPopup->SelectEntry(nNr1); @@ -2973,17 +2936,17 @@ BOOL StatementCommand::Execute() if ( pPopup ) { pPopup->EndExecute(nNr1); - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; } else { pMenuBar->SelectEntry(nNr1); - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; } } @@ -3119,7 +3082,7 @@ BOOL StatementCommand::Execute() } if ( !nErrorcode ) { - pRet->GenReturn ( RET_Value, aSmartMethodId, aPath ); + pRet->GenReturn ( RET_Value, nMethodId, aPath ); } @@ -3151,9 +3114,9 @@ BOOL StatementCommand::Execute() if ( !aFS.IsKind( FSYS_KIND_WILD ) && !aFS.IsKind( FSYS_KIND_DIR ) && aEntry.Exists() ) { // Sonderbehandlung für genau einen Eintrag if ( !aFS.IsKind( FSYS_KIND_DIR ) && ( aDirEntryKind == FSYS_KIND_DIR ) ) - pRet->GenReturn ( RET_Value, aSmartMethodId, String() ); + pRet->GenReturn ( RET_Value, nMethodId, String() ); else - pRet->GenReturn ( RET_Value, aSmartMethodId, (String)(aEntry.GetName()) ); + pRet->GenReturn ( RET_Value, nMethodId, (String)(aEntry.GetName()) ); break; } @@ -3168,12 +3131,12 @@ BOOL StatementCommand::Execute() if ( !pDir ) pDir = new Dir; - if ( !nErrorcode && ValueOK( aSmartMethodId, GEN_RES_STR0( S_NO_MORE_FILES ), nDirPos+1, pDir->Count()+1 ) ) + if ( !nErrorcode && ValueOK( nMethodId, GEN_RES_STR0( S_NO_MORE_FILES ), nDirPos+1, pDir->Count()+1 ) ) { if ( nDirPos == pDir->Count() ) - pRet->GenReturn ( RET_Value, aSmartMethodId, String() ); + pRet->GenReturn ( RET_Value, nMethodId, String() ); else - pRet->GenReturn ( RET_Value, aSmartMethodId, (String)((*pDir)[ nDirPos ].GetName()) ); + pRet->GenReturn ( RET_Value, nMethodId, (String)((*pDir)[ nDirPos ].GetName()) ); nDirPos++; }*/ } @@ -3185,7 +3148,7 @@ BOOL StatementCommand::Execute() if ( FSYS_ERR_OK == nErrorcode ) { FileStat aFS( aFile ); - pRet->GenReturn ( RET_Value, aSmartMethodId, static_cast<comm_ULONG>(aFS.GetSize()) ); //GetSize() ULONG != comm_ULONG on 64bit + pRet->GenReturn ( RET_Value, nMethodId, static_cast<comm_ULONG>(aFS.GetSize()) ); //GetSize() ULONG != comm_ULONG on 64bit nErrorcode = aFS.GetError(); } } @@ -3212,7 +3175,7 @@ BOOL StatementCommand::Execute() SbxValueRef xValue = new SbxValue( SbxDATE ); xValue->PutDate( fSerial ); - pRet->GenReturn ( RET_Value, aSmartMethodId, *xValue ); + pRet->GenReturn ( RET_Value, nMethodId, *xValue ); } } break; @@ -3328,7 +3291,7 @@ BOOL StatementCommand::Execute() aPointer = Pointer( POINTER_NULL ); } } - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_ULONG)aPointer.GetStyle() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_ULONG)aPointer.GetStyle() ); } break; case RC_UnpackStorage: @@ -3397,7 +3360,7 @@ BOOL StatementCommand::Execute() break; case RC_ExistsSysDialog: { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_BOOL)xPicker.is() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_BOOL)xPicker.is() ); } break; default: @@ -3438,14 +3401,14 @@ BOOL StatementCommand::Execute() break; case RC_GetDocumentCount : { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_USHORT)GetDocWinCount() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_USHORT)GetDocWinCount() ); } break; case RC_ActivateDocument : { if( nParams & PARAM_USHORT_1 ) { - if ( ValueOK(aSmartMethodId, RcString( nMethodId ), nNr1, GetDocWinCount() ) ) + if ( ValueOK( rtl::OString(), RcString( nMethodId ), nNr1, GetDocWinCount() ) ) { Window* pWin = GetDocWin( nNr1-1 ); if ( pWin ) @@ -3461,7 +3424,7 @@ BOOL StatementCommand::Execute() break; case RC_GetSystemLanguage : { - pRet->GenReturn ( RET_Value, aSmartMethodId, (comm_USHORT)Application::GetSettings().GetLanguage() ); + pRet->GenReturn ( RET_Value, nMethodId, (comm_USHORT)Application::GetSettings().GetLanguage() ); } break; case RC_CatchGPF : @@ -3480,7 +3443,7 @@ BOOL StatementCommand::Execute() #else bIsProduct = TRUE; #endif - pRet->GenReturn ( RET_Value, aSmartMethodId, (BOOL)bIsProduct ); + pRet->GenReturn ( RET_Value, nMethodId, (BOOL)bIsProduct ); } break; case RC_UsePostEvents : @@ -3559,17 +3522,22 @@ StatementControl::StatementControl( SCmdStream *pCmdIn, USHORT nControlIdType ) , bBool2(FALSE) { QueStatement( NULL ); + //HELPID BACKWARD (SIControl is no longer needed) if ( nControlIdType == SIControl ) { comm_ULONG nId; pCmdIn->Read( nId ); - aUId = SmartId( nId ); + aUId = rtl::OString( nId ); + if ( nId == 0 ) + aUId = UID_ACTIVE; + else + ReportError( aUId, GEN_RES_STR1c( S_INTERNAL_ERROR, "using numeric HelpID from old Testtool" ) ); } else if ( nControlIdType == SIStringControl ) { String aId; pCmdIn->Read( aId ); - aUId = SmartId( aId ); + aUId = Str2Id( aId ); } else { @@ -3591,7 +3559,7 @@ StatementControl::StatementControl( SCmdStream *pCmdIn, USHORT nControlIdType ) #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Reading Control: UId: " ); - m_pDbgWin->AddText( aUId.GetText() ); + m_pDbgWin->AddText( Id2Str( aUId ) ); m_pDbgWin->AddText( " Methode: " ); m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( " Params:" ); @@ -3680,7 +3648,7 @@ BOOL StatementControl::ControlOK( Window *pControl, const sal_Char* cBezeichnung { if ( pControl && ( ( ( IsAccessable(pControl) || (nMethodId & M_WITH_RETURN) ) && pControl->IsVisible() ) || - aUId.Matches( UID_ACTIVE ) ) ) + aUId.equals( UID_ACTIVE ) ) ) return TRUE; else { @@ -3703,7 +3671,7 @@ BOOL StatementControl::ControlOK( Window *pControl, const sal_Char* cBezeichnung } -BOOL StatementList::ValueOK( SmartId aId, String aBezeichnung, ULONG nValue, ULONG nMax ) +BOOL StatementList::ValueOK( rtl::OString aId, String aBezeichnung, ULONG nValue, ULONG nMax ) { if ( nMax < nValue ) @@ -3737,24 +3705,21 @@ USHORT StatementList::GetCurrentMenues( PopupMenu *&pPopup, MenuBar *&pMenuBar, if ( !pMenu ) return 1; - if ( aSubMenuId1.GetNum() ) + if ( aSubMenuId1 ) { - pPopup = pMenu->GetPopupMenu( - sal::static_int_cast< USHORT >(aSubMenuId1.GetNum())); + pPopup = pMenu->GetPopupMenu( aSubMenuId1 ); pMenu = pPopup; } - if ( pMenu && aSubMenuId2.GetNum() ) + if ( pMenu && aSubMenuId2 ) { - pPopup = pMenu->GetPopupMenu( - sal::static_int_cast< USHORT >(aSubMenuId2.GetNum())); + pPopup = pMenu->GetPopupMenu( aSubMenuId2 ); pMenu = pPopup; } - if ( pMenu && aSubMenuId3.GetNum() ) + if ( pMenu && aSubMenuId3 ) { - pPopup = pMenu->GetPopupMenu( - sal::static_int_cast< USHORT >(aSubMenuId3.GetNum())); + pPopup = pMenu->GetPopupMenu( aSubMenuId3 ); pMenu = pPopup; } @@ -4282,9 +4247,9 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl ) break; case M_OpenContextMenu: { - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; Point aPos; ToolBox* pTB = (ToolBox*)pControl; @@ -4318,9 +4283,9 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl ) break; case M_UseMenu: { - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; while ( pControl && !( ( pControl->GetType() == WINDOW_SYSWINDOW || pControl->GetType() == WINDOW_WORKWINDOW ) && ControlOK( pControl, "" ) ) ) @@ -4546,7 +4511,7 @@ BOOL StatementControl::Execute() { #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Skipping Window: " ); - m_pDbgWin->AddText( aUId.GetText() ); + m_pDbgWin->AddText( Id2Str( aUId ) ); m_pDbgWin->AddText( " Method: " ); m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( "\n" ); @@ -4559,14 +4524,14 @@ BOOL StatementControl::Execute() InitProfile(); #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Executing Window: " ); - m_pDbgWin->AddText( aUId.GetText() ); + m_pDbgWin->AddText( Id2Str( aUId ) ); m_pDbgWin->AddText( " Method: " ); m_pDbgWin->AddText( String::CreateFromInt32( nMethodId ) ); m_pDbgWin->AddText( "\n" ); #endif - if ( aUId.Matches( UID_ACTIVE ) ) + if ( aUId.equals( UID_ACTIVE ) ) pControl = GetAnyActive(); else { @@ -4587,7 +4552,7 @@ BOOL StatementControl::Execute() if ( pControl && pControl->GetType() == WINDOW_TOOLBOX ) { - if ( !aUId.Matches( pControl->GetSmartUniqueOrHelpId() ) ) + if ( !aUId.equals( pControl->GetUniqueOrHelpId() ) ) { // Also wenn wir irgendwas auf einer Toolbox gefunden haben switch ( nMethodId ) { @@ -4646,7 +4611,7 @@ BOOL StatementControl::Execute() if( pControl ) // Das Fenster Existiert irgendwo, kann aber auch hidden sein! { - nRT = ImpGetRType( pControl, aUId ); // If not Numeric pControl is used + nRT = ImpGetRType( pControl ); #if OSL_DEBUG_LEVEL > 1 m_pDbgWin->AddText( "Type is: " ); m_pDbgWin->AddText( String::CreateFromInt32( nRT ) ); @@ -4789,42 +4754,44 @@ BOOL StatementControl::Execute() } break; case M_GetPage: - pRet->GenReturn ( RET_Value, aUId, ((TabControl*)pControl)->GetTabPage(((TabControl*)pControl)->GetCurPageId())->GetSmartUniqueOrHelpId().GetText()); + pRet->GenReturn ( RET_Value, aUId, Id2Str( ((TabControl*)pControl)->GetTabPage(((TabControl*)pControl)->GetCurPageId())->GetUniqueOrHelpId() ) ); break; case M_SetPage : { // Wegen lokaler Variablen TabControl *pTControl = ((TabControl*)pControl); USHORT nActive = pTControl->GetCurPageId(); USHORT i,anz; - SmartId aID; - SmartId aWantedID; + rtl::OString aID; + rtl::OString aWantedID; + //HELPID BACKWARD (No numbers please (remove PARAM_ULONG_1 part) if ( (nParams & PARAM_ULONG_1) ) { - aWantedID = SmartId( nLNr1 ); + //aWantedID = rtl::OString( nLNr1 ); + ReportError( aUId, GEN_RES_STR1c( S_INTERNAL_ERROR, "using numeric HelpID from old Testtool" ) ); } else if ( (nParams & PARAM_STR_1) ) { - aWantedID = SmartId( aString1 ); + aWantedID = Str2Id( aString1 ); } else ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) ); i = pTControl->GetPagePos( pTControl->GetCurPageId() ); - for ( anz=0 ; anz < pTControl->GetPageCount() && !aID.Matches( aWantedID ) ; anz++ ) + for ( anz=0 ; anz < pTControl->GetPageCount() && !aID.equals( aWantedID ) ; anz++ ) { pTControl->SelectTabPage( pTControl->GetPageId(i) ); /*if (pTControl->GetCurPageId()) pTControl->DeactivatePage(); pTControl->SetCurPageId( pTControl->GetPageId(i) ); pTControl->ActivatePage();*/ - aID = pTControl->GetTabPage(pTControl->GetCurPageId())->GetSmartUniqueOrHelpId(); + aID = pTControl->GetTabPage(pTControl->GetCurPageId())->GetUniqueOrHelpId(); i++; if ( i >= pTControl->GetPageCount() ) i = 0; if ( !MaybeDoTypeKeysDelay( pTControl ) || !MaybeDoTypeKeysDelay( pTControl ) || !MaybeDoTypeKeysDelay( pTControl ) ) // 3 Mal aufrufen break; } - if ( !aID.Matches( aWantedID ) ) + if ( !aID.equals( aWantedID ) ) { pTControl->SelectTabPage( nActive ); /*if (pTControl->GetCurPageId()) @@ -5260,9 +5227,9 @@ BOOL StatementControl::Execute() ImplMouseButtonUp ( pControl, aMEvnt, FORCE_DIRECT_CALL ); - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; } break; @@ -5274,21 +5241,12 @@ BOOL StatementControl::Execute() case C_ToolBox: { ToolBox *pTB = ((ToolBox*)pControl); - if ( !aUId.Matches( pTB->GetSmartUniqueOrHelpId() ) ) // Also Button auf der ToolBox gefunden + if ( !aUId.equals( pTB->GetUniqueOrHelpId() ) ) // So we found a Button on the ToolBox { if ( (nParams == PARAM_NONE) || (nParams == PARAM_USHORT_1) ) { // Wir fälschen einen Parameter - if ( aUId.HasNumeric() ) - { - nParams |= PARAM_ULONG_1; - nLNr1 = USHORT( aUId.GetNum() ); - DBG_ASSERT( nLNr1 <= 0xFFFF, "ID on ToolBox > 0xFFFF" ); - } - else - { - nParams |= PARAM_STR_1; - aString1 = aUId.GetStr(); - } + nParams |= PARAM_STR_1; + aString1 = Id2Str( aUId ); } else ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) ); @@ -5298,14 +5256,14 @@ BOOL StatementControl::Execute() USHORT nItemPos = 0;\ BOOL bItemFound = FALSE;\ {\ - SmartId aButtonId;\ + rtl::OString aButtonId;\ if( nParams & PARAM_STR_1 )\ - aButtonId = SmartId( aString1 );\ - if( nParams & PARAM_ULONG_1 )\ - aButtonId = SmartId( nLNr1 );\ - for ( nItemPos = 0; nItemPos < pTB->GetItemCount() && !aButtonId.Matches(pTB->GetItemCommand(pTB->GetItemId(nItemPos))) &&\ - !aButtonId.Matches(pTB->GetHelpId(pTB->GetItemId(nItemPos))) ; nItemPos++ ) {}\ - bItemFound = aButtonId.Matches(pTB->GetItemCommand(pTB->GetItemId(nItemPos))) || aButtonId.Matches(pTB->GetHelpId(pTB->GetItemId(nItemPos)));\ + aButtonId = Str2Id( aString1 );\ + else\ + ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );\ + for ( nItemPos = 0; nItemPos < pTB->GetItemCount() && !aButtonId.equals(Str2Id( pTB->GetItemCommand(pTB->GetItemId(nItemPos)) )) &&\ + !aButtonId.equals(pTB->GetHelpId(pTB->GetItemId(nItemPos))) ; nItemPos++ ) {}\ + bItemFound = aButtonId.equals(Str2Id( pTB->GetItemCommand(pTB->GetItemId(nItemPos)) )) || aButtonId.equals(pTB->GetHelpId(pTB->GetItemId(nItemPos)));\ if ( !bItemFound )\ ReportError( aUId, GEN_RES_STR1( S_HELPID_ON_TOOLBOX_NOT_FOUND, MethodString( nMethodId ) ) );\ else\ @@ -5347,7 +5305,7 @@ BOOL StatementControl::Execute() }\ }\ }\ - }\ + } switch( nMethodId ) { @@ -5367,9 +5325,9 @@ BOOL StatementControl::Execute() MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT); ImplMouseButtonDown( pTB, aMEvnt );*/ - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; new StatementCommand( this, RC_MenuSelect, PARAM_USHORT_1, pTB->GetItemId(nItemPos) + TOOLBOX_MENUITEM_START ); @@ -5432,9 +5390,9 @@ BOOL StatementControl::Execute() ImplMouseButtonUp( pTB, aMEvnt); // Das Fenster ist offen. - aSubMenuId1 = SmartId(); - aSubMenuId2 = SmartId(); - aSubMenuId3 = SmartId(); + aSubMenuId1 = 0; + aSubMenuId2 = 0; + aSubMenuId3 = 0; pMenuWindow = NULL; } } @@ -5453,24 +5411,26 @@ BOOL StatementControl::Execute() FIND_ITEM; if ( bItemFound ) // FIND_ITEM Erfolgreich { - switch (nNr1) - { - case 0: - pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetHelpId(pTB->GetItemId(nItemPos))); - break; - case 1: - pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemType(nItemPos)); - break; - case 2: - pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemState(pTB->GetItemId(nItemPos))); - break; - case 3: - pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemId(nItemPos)); - break; - default: - pRet->GenReturn ( RET_Value, aUId, comm_ULONG(0)); - break; - } + if ( ValueOK( aUId, CUniString("GetState"), nNr1, 4 ) ) + switch (nNr1) + { + case 0: + pRet->GenReturn ( RET_Value, aUId, Id2Str( pTB->GetHelpId(pTB->GetItemId(nItemPos)) ) ); + break; + case 1: + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemType(nItemPos)); + break; + case 2: + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemState(pTB->GetItemId(nItemPos))); + break; + case 3: + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemId(nItemPos)); + break; + default: + ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) ); + pRet->GenReturn ( RET_Value, aUId, comm_ULONG(0)); + break; + } } } break; @@ -6345,7 +6305,7 @@ protected: break; case M_Close: //aWindowWaitUId = aUId; - DBG_ASSERT( aUId.Matches( pControl->GetSmartUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); + DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); SET_WINP_CLOSING(pControl); ((DockingWindow*)pControl)->Close(); break; @@ -6421,7 +6381,7 @@ protected: break; } case M_Close: - DBG_ASSERT( aUId.Matches( pControl->GetSmartUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); + DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); SET_WINP_CLOSING(pControl); ((FloatingWindow*)pControl)->Close(); break; @@ -6444,7 +6404,7 @@ protected: AnimateMouse( pControl, MitteOben); break; case M_Close: - DBG_ASSERT( aUId.Matches( pControl->GetSmartUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); + DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); SET_WINP_CLOSING(pControl); ((SystemWindow*)pControl)->Close(); break; @@ -6453,7 +6413,7 @@ protected: Window *pChild = GetWinByRT( pControl, WINDOW_OKBUTTON ); if( ControlOK( pChild, "OK Button" ) ) { - DBG_ASSERT( aUId.Matches( pControl->GetSmartUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); + DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); SET_WINP_CLOSING(pControl); ((Button*)pChild)->Click(); } @@ -6464,7 +6424,7 @@ protected: Window *pChild = GetWinByRT( pControl, WINDOW_CANCELBUTTON ); if( ControlOK( pChild, "Cancel Button" ) ) { - DBG_ASSERT( aUId.Matches( pControl->GetSmartUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); + DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); SET_WINP_CLOSING(pControl); ((Button*)pChild)->Click(); } @@ -6501,7 +6461,7 @@ protected: AnimateMouse( pControl, MitteOben); break; case M_Close: - DBG_ASSERT( aUId.Matches( pControl->GetSmartUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); + DBG_ASSERT( aUId.equals( pControl->GetUniqueOrHelpId() ), "aUID != UniqueOrHelpId"); SET_WINP_CLOSING(pControl); ((WorkWindow*)pControl)->Close(); break; diff --git a/automation/source/server/statemnt.hxx b/automation/source/server/statemnt.hxx index 4e580a09749c..ada6c60a6b35 100644 --- a/automation/source/server/statemnt.hxx +++ b/automation/source/server/statemnt.hxx @@ -54,7 +54,6 @@ #include <basic/sbstar.hxx> #include <vcl/event.hxx> #include <com/sun/star/beans/PropertyValue.hpp> -#include <vcl/smartid.hxx> #include <automation/commtypes.hxx> class Window; @@ -241,7 +240,7 @@ public: protected: static Window* SearchClientWin( Window *pBase, Search &aSearch, BOOL MaybeBase = TRUE ); - Window* SearchTree( SmartId aUId, BOOL bSearchButtonOnToolbox = FALSE ); + Window* SearchTree( rtl::OString aUId, BOOL bSearchButtonOnToolbox = FALSE ); Window* GetActive( WindowType nRT, BOOL MaybeBase = TRUE ); Window* GetFocus( WindowType nRT, BOOL MaybeBase = TRUE ); Window* GetAnyActive( BOOL MaybeBase = TRUE ); @@ -253,7 +252,7 @@ protected: Window* GetDocWin( USHORT nNr ); USHORT GetDocWinCount(); Window* GetFadeSplitWin( Window *pBase, WindowAlign nAlign, BOOL MaybeBase = TRUE ); - BOOL ValueOK(SmartId nId, String aBezeichnung, ULONG nValue, ULONG nMax); + BOOL ValueOK(rtl::OString nId, String aBezeichnung, ULONG nValue, ULONG nMax); USHORT GetCurrentMenues( PopupMenu *&pPopup, MenuBar *&pMenuBar, Menu *&pMenu ); @@ -274,7 +273,7 @@ public: ***************************************************************************/ void ReportError(String aMessage); - void ReportError(SmartId aUId, String aMessage); + void ReportError(rtl::OString aUId, String aMessage); void ReportError(String aMessage, ULONG nWhatever); static void DirectLog( ULONG nType, String aString ); @@ -285,18 +284,18 @@ public: StatementList *pNext; static StatementList /**pCurrent,*/ *pFirst; static BOOL bReadingCommands; - static SmartId aWindowWaitUId; + static rtl::OString aWindowWaitUId; static Window *pWindowWaitPointer; - static SmartId aWindowWaitOldHelpId; - static SmartId aWindowWaitOldUniqueId; + static rtl::OString aWindowWaitOldHelpId; + static rtl::OString aWindowWaitOldUniqueId; static RetStream *pRet; static BOOL IsError; static BOOL bDying; static BOOL bExecuting; // Gesetzt, wenn ein Befehl rescheduled ohne einen neuen Befehl zu erlauben BOOL bWasExecuting; // Wurde bei einem MaybeResetSafeReschedule resettet, so wird der Zustand danach wiederhergestellt - static SmartId aSubMenuId1; // Untermenüs bei PopupMenus - static SmartId aSubMenuId2; // erstmal 2-Stufig - static SmartId aSubMenuId3; // and now even 3 levels #i31512# + static USHORT aSubMenuId1; // Untermenüs bei PopupMenus + static USHORT aSubMenuId2; // erstmal 2-Stufig + static USHORT aSubMenuId3; // and now even 3 levels #i31512# static SystemWindow *pMenuWindow; // when using MenuBar as base for MenuCommands static TTProperties *pTTProperties; // Hier stehen die SlotIDs aus dem SFX drin @@ -350,7 +349,6 @@ class StatementCommand : public StatementList // Befehl ausführen (wintree, re friend class ImplRemoteControl; protected: USHORT nMethodId; - SmartId aSmartMethodId; USHORT nParams; comm_USHORT nNr1,nNr2,nNr3,nNr4; comm_ULONG nLNr1; @@ -385,7 +383,7 @@ enum TTHotSpots { MitteLinks, Mitte, MitteOben }; class StatementControl : public StatementList { protected: - SmartId aUId; + rtl::OString aUId; USHORT nMethodId; USHORT nParams; comm_USHORT nNr1,nNr2,nNr3,nNr4; @@ -436,10 +434,10 @@ class SearchUID : public Search { Window *pMaybeResult; Window *pAlternateResult; - SmartId aUId; + rtl::OString aUId; BOOL bSearchButtonOnToolbox; public: - SearchUID( SmartId aUIdP, BOOL bSearchButtonOnToolboxP ): Search( SEARCH_FOCUS_FIRST ), pMaybeResult(NULL), pAlternateResult(NULL), aUId(aUIdP), bSearchButtonOnToolbox(bSearchButtonOnToolboxP) {} + SearchUID( rtl::OString aUIdP, BOOL bSearchButtonOnToolboxP ): Search( SEARCH_FOCUS_FIRST ), pMaybeResult(NULL), pAlternateResult(NULL), aUId(aUIdP), bSearchButtonOnToolbox(bSearchButtonOnToolboxP) {} virtual BOOL IsWinOK( Window *pWin ); Window* GetMaybeWin() { return pMaybeResult; } Window* GetAlternateResultWin() { return pAlternateResult; } diff --git a/automation/source/testtool/cmdstrm.cxx b/automation/source/testtool/cmdstrm.cxx index 4f6d413f4280..a0e50e912498 100644 --- a/automation/source/testtool/cmdstrm.cxx +++ b/automation/source/testtool/cmdstrm.cxx @@ -98,11 +98,12 @@ String CmdStream::WandleKeyEventString( String aKeys ) { Token = Work.GetToken(0,' '); Work.Erase(0,Token.Len()+1); - ControlDef WhatName(Token,SmartId()); + ControlDef WhatName(Token,rtl::OString()); USHORT nElement; if (pKeyCodes->Seek_Entry(&WhatName,&nElement)) { - USHORT nCode = (USHORT) pKeyCodes->GetObject(nElement)->pData->aUId.GetNum(); + // FIXME: HELPID + USHORT nCode = 0;//(USHORT) pKeyCodes->GetObject(nElement)->pData->aUId.GetNum(); if ( nCode >= KEY_SHIFT ) nModify ^= nCode; else diff --git a/automation/source/testtool/cretstrm.hxx b/automation/source/testtool/cretstrm.hxx index 75229bb32cb7..147b04bc0414 100644 --- a/automation/source/testtool/cretstrm.hxx +++ b/automation/source/testtool/cretstrm.hxx @@ -45,7 +45,7 @@ public: void Read ( comm_USHORT &nNr ){CmdBaseStream::Read ( nNr );} void Read ( comm_ULONG &nNr ){CmdBaseStream::Read ( nNr );} // void Read ( comm_UniChar* &aString, comm_USHORT &nLenInChars ){CmdBaseStream::Read ( aString, nLenInChars );} - virtual void Read ( SmartId* &pId ){CmdBaseStream::Read ( pId );} + virtual void Read ( rtl::OString* &pId ){CmdBaseStream::Read ( pId );} void Read ( comm_BOOL &bBool ){CmdBaseStream::Read ( bBool );} // new void Read( String &aString ); diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 2361361f277f..4f0f5084ad37 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -137,7 +137,7 @@ CErrors *TestToolObj::pFehlerListe = NULL; // Hier werden die Fehler des Te DBG_NAME( ControlItem ) DBG_NAME( ControlDef ) -ControlItem::ControlItem( const sal_Char *Name, SmartId aUIdP ) +ControlItem::ControlItem( const sal_Char *Name, rtl::OString aUIdP ) { DBG_CTOR(ControlItem,0); InitData(); @@ -145,7 +145,7 @@ DBG_CTOR(ControlItem,0); pData->aUId = aUIdP; } -ControlItem::ControlItem( const String &Name, SmartId aUIdP ) +ControlItem::ControlItem( const String &Name, rtl::OString aUIdP ) { DBG_CTOR(ControlItem,0); InitData(); @@ -196,7 +196,7 @@ ControlSon::~ControlSon() } } -ControlItemSon::ControlItemSon(const String &Name, SmartId aUIdP ) +ControlItemSon::ControlItemSon(const String &Name, rtl::OString aUIdP ) : ControlItem( Name, aUIdP ) {} @@ -226,6 +226,8 @@ BOOL ControlDef::operator == (const ControlItem &rPar) void ControlDef::Write( SvStream &aStream ) { + // FIXME: HELPID + #if 0 if ( pSons ) aStream.WriteByteString( String('*').Append( pData->Kurzname ), RTL_TEXTENCODING_UTF8 ); else @@ -238,9 +240,12 @@ void ControlDef::Write( SvStream &aStream ) if ( pSons ) for ( USHORT i = 0 ; pSons->Count() > i ; i++ ) ((ControlDef*)(*pSons)[i])->Write(aStream); + #else + (void)aStream; + #endif } -ControlDef::ControlDef(const String &Name, SmartId aUIdP ) +ControlDef::ControlDef(const String &Name, rtl::OString aUIdP ) : ControlItemSon( Name, aUIdP) { DBG_CTOR(ControlDef,0); @@ -292,7 +297,7 @@ BOOL ControlItemUId::operator == (const ControlItem &rPar) SV_IMPL_OP_PTRARR_SORT( CNames, ControlItem* ) -void CRevNames::Insert( String aName, SmartId aUId, ULONG nSeq ) +void CRevNames::Insert( String aName, rtl::OString aUId, ULONG nSeq ) { ControlItem *pRN = new ReverseName(aName,aUId,nSeq); USHORT nPos; @@ -307,7 +312,7 @@ void CRevNames::Insert( String aName, SmartId aUId, ULONG nSeq ) } -String CRevNames::GetName( SmartId aUId ) +String CRevNames::GetName( rtl::OString aUId ) { ReverseName *pRN = new ReverseName(UniString(),aUId,0); USHORT nPos; @@ -318,10 +323,15 @@ String CRevNames::GetName( SmartId aUId ) return GetObject(nPos)->pData->Kurzname; else { + // FIXME: HELPID + #if 0 if ( aUId.Matches( UID_ACTIVE ) ) return CUniString("Active"); else return GEN_RES_STR1( S_NAME_NOT_THERE, aUId.GetText() ); + #else + return String(); + #endif } } @@ -686,7 +696,12 @@ void TestToolObj::InitTestToolObj() SbxTransportMethod *pMeth = new SbxTransportMethod( SbxVARIANT ); pMeth->SetName( pRCommands->GetObject( i )->pData->Kurzname ); pMeth->SetUserData( ID_RemoteCommand ); + // FIXME: HELPID + #if 0 pMeth->nValue = pRCommands->GetObject( i )->pData->aUId.GetNum(); + #else + pMeth->nValue = 0; + #endif Insert( pMeth ); StartListening( pMeth->GetBroadcaster(), TRUE ); } @@ -866,7 +881,7 @@ void TestToolObj::ReadNames( String Filename, CNames *&pNames, CNames *&pUIds, B SvFileStream Stream; String aLine,aShortname,aLongname; - SmartId aUId; + rtl::OString aUId; xub_StrLen nLineNr; USHORT nElement; ControlDef *pNewDef, *pNewDef2; @@ -884,7 +899,7 @@ void TestToolObj::ReadNames( String Filename, CNames *&pNames, CNames *&pUIds, B ReadFlat( aFileName ,pUIds, TRUE ); if ( !pUIds ) return; - pNewDef = new ControlDef("Active",SmartId(0)); + pNewDef = new ControlDef("Active",rtl::OString()); const ControlItem *pItem = pNewDef; if (! pUIds->Insert(pItem)) { @@ -986,7 +1001,7 @@ void TestToolObj::ReadNames( String Filename, CNames *&pNames, CNames *&pUIds, B if ( aShortname.GetChar(0) == '+' ) // Kompletten Eintrag kopieren { aShortname.Erase(0,1); - ControlDef WhatName(aLongname,SmartId()); + ControlDef WhatName(aLongname,rtl::OString()); ControlDef *OldTree; if (pNames->Seek_Entry(&WhatName,&nElement)) { @@ -1015,11 +1030,15 @@ void TestToolObj::ReadNames( String Filename, CNames *&pNames, CNames *&pUIds, B else { + // FIXME: HELPID + #if 0 if (aShortname.CompareIgnoreCaseToAscii("*Active") == COMPARE_EQUAL) - aUId = SmartId( UID_ACTIVE ); - else if ( !bUnoName && !bMozillaName ) + aUId = rtl::OString( UID_ACTIVE ); + else + #endif + if ( !bUnoName && !bMozillaName ) { // Bestimmen der ID aus der Hid.Lst - ControlDef WhatName(aLongname,SmartId()); + ControlDef WhatName(aLongname,rtl::OString()); if (pUIds->Seek_Entry(&WhatName,&nElement)) aUId = pUIds->GetObject(nElement)->pData->aUId; else @@ -1030,14 +1049,17 @@ void TestToolObj::ReadNames( String Filename, CNames *&pNames, CNames *&pUIds, B } else { + // FIXME: HELPID + #if 0 if ( bUnoName ) - aUId = SmartId( aLongname ); + aUId = rtl::OString( aLongname ); else if ( bMozillaName ) - aUId = SmartId( aLongname ); + aUId = rtl::OString( aLongname ); else { DBG_ERROR("Unknown URL schema"); } + #endif } @@ -1121,7 +1143,7 @@ void TestToolObj::ReadFlat( String Filename, CNames *&pNames, BOOL bSortByName ) { SvFileStream Stream; String aLine,aLongname; - SmartId aUId; + rtl::OString aUId; xub_StrLen nLineNr; ControlItem *pNewItem; USHORT nDoubleCount = 0; @@ -1162,7 +1184,8 @@ void TestToolObj::ReadFlat( String Filename, CNames *&pNames, BOOL bSortByName ) } aLongname = aLine.GetToken(0,cMyDelim); - aUId = SmartId( (ULONG)aLine.GetToken(1,cMyDelim).ToInt64() ); + // FIXME: HELPID + aUId = rtl::OUStringToOString( aLine.GetToken(1,cMyDelim), RTL_TEXTENCODING_UTF8 ); if ( bSortByName ) pNewItem = new ControlDef( aLongname, aUId ); @@ -1211,7 +1234,8 @@ void ReadFlatArray( const ControlDefLoad arWas [], CNames *&pNames ) while ( String::CreateFromAscii(arWas[nIndex].Kurzname).Len() > 0 ) { - SmartId aUId (arWas[nIndex].nUId); + // FIXME: HELPID + rtl::OString aUId;// (arWas[nIndex].nUId); const ControlItem *pX = new ControlDef( arWas[nIndex].Kurzname, aUId); pNames->C40_PTR_INSERT(ControlItem, pX); nIndex++; @@ -1472,7 +1496,7 @@ BOOL TestToolObj::ReadNamesBin( String Filename, CNames *&pSIds, CNames *&pContr { SvFileStream aStream; String aName,aURL; - SmartId aUId; + rtl::OString aUId; ControlDef *pNewDef, *pNewDef2; ControlDef *pFatherDef = NULL; @@ -1510,13 +1534,16 @@ BOOL TestToolObj::ReadNamesBin( String Filename, CNames *&pSIds, CNames *&pContr { String aStrId; aStream.ReadByteString( aStrId, RTL_TEXTENCODING_UTF8 ); - aUId = SmartId( aStrId ); + // FIXME: HELPID + #if 0 + aUId = rtl::OString( aStrId ); + #endif } else { comm_ULONG nUId; aStream >> nUId; - aUId = SmartId( nUId ); + aUId = rtl::OString();// nUId; } if (aName.GetChar(0) == '*' || bIsFlat ) // Globaler Kurzname (Dialogname oder SId) @@ -1661,7 +1688,7 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, USHORT nElement; SbxVariableRef pArg = rPar->Get( 1 ); String aKontext = pArg->GetString(); - ControlDef WhatName(aKontext,SmartId()); + ControlDef WhatName(aKontext,rtl::OString()); if (m_pControls && m_pControls->Seek_Entry(&WhatName,&nElement)) { m_pNameKontext = ((ControlDef*)m_pControls->GetObject(nElement))->GetSons(); @@ -2154,7 +2181,7 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, ((Controls*)pVar)->PutULong( ((Controls*)pVar)->pMethodVar->GetULong() ); ((Controls*)pVar)->pMethodVar->SetUserData(ID_Control); - pShortNames->Insert( CUniString("xxx"), SmartId( ((Controls*)pVar)->pMethodVar->nValue ), nSequence ); + pShortNames->Insert( CUniString("xxx"), rtl::OString( ((Controls*)pVar)->pMethodVar->nValue ), nSequence ); nOldValue = ((Controls*)pVar)->GetULong(); @@ -2193,7 +2220,8 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, if ( !IsError() && ((SbxTransportMethod*)pVar)->nValue & M_WITH_RETURN ) { pImpl->pNextReturn = ((SbxTransportMethod*)pVar); - aNextReturnId = SmartId( ((SbxTransportMethod*)pVar)->nValue ); + // FIXME: HELPID + aNextReturnId = rtl::OString();// ((SbxTransportMethod*)pVar)->nValue ); } if ( SingleCommandBlock ) EndBlock(); @@ -2266,13 +2294,17 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, { In->GenCmdControl (pMember->GetULong(), (USHORT)((SbxTransportMethod*)pVar)->nValue, rPar); - aNextReturnId = SmartId( pMember->GetULong() ); + // FIXME: HELPID + aNextReturnId = rtl::OString();// pMember->GetULong() ); } else { In->GenCmdControl (pMember->GetString(), (USHORT)((SbxTransportMethod*)pVar)->nValue, rPar); - aNextReturnId = SmartId( pMember->GetString() ); + // FIXME: HELPID + #if 0 + aNextReturnId = rtl::OString( pMember->GetString() ); + #endif } } @@ -2283,7 +2315,7 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, else { pImpl->pNextReturn = NULL; - aNextReturnId = SmartId(); + aNextReturnId = rtl::OString(); } } @@ -2839,7 +2871,7 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) { USHORT nElement; - ControlDef *pWhatName = new ControlDef(aStr,SmartId()); + ControlDef *pWhatName = new ControlDef(aStr,rtl::OString()); /// nach Controls suchen if (m_pNameKontext && m_pNameKontext->Seek_Entry(pWhatName,&nElement)) @@ -2854,9 +2886,12 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) // Will be set on method-child further down + // FIXME: HELPID + #if 0 if ( pWhatName->pData->aUId.HasNumeric() ) pImpl->pControlsObj->SetUserData( ID_Control ); else + #endif pImpl->pControlsObj->SetUserData( ID_StringControl ); pShortNames->Insert(pWhatName->pData->Kurzname,pWhatName->pData->aUId,nSequence); @@ -2869,10 +2904,13 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) pImpl->pControlsObj->SetDfltProperty(pID); pMember = pID; } + // FIXME: HELPID + #if 0 if ( pWhatName->pData->aUId.HasNumeric() ) pMember->PutULong(pWhatName->pData->aUId.GetNum()); else pMember->PutString(pWhatName->pData->aUId.GetStr()); + #endif pMember = pImpl->pControlsObj->Find(CUniString("name"),SbxCLASS_DONTCARE); if ( pMember != NULL ) @@ -2892,6 +2930,8 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) pWhatName = ( (ControlDef*)m_pSIds->GetObject( nElement ) ); pMyVar->SetName( pWhatName->pData->Kurzname ); + // FIXME: HELPID + #if 0 if ( pWhatName->pData->aUId.HasNumeric() ) { pMyVar->SetUserData( ID_Dispatch ); @@ -2903,6 +2943,7 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) pMyVar->SetUserData( ID_UNODispatch ); pMyVar->aUnoSlot = pWhatName->pData->aUId.GetStr(); } + #endif return pMyVar; } @@ -2910,7 +2951,7 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) if ( aStr.Copy( aStr.Len()-3, 3 ).CompareIgnoreCaseToAscii("_ID") == COMPARE_EQUAL && m_pSIds ) { delete pWhatName; - pWhatName = new ControlDef( aStr.Copy( 0, aStr.Len()-3 ), SmartId() ); + pWhatName = new ControlDef( aStr.Copy( 0, aStr.Len()-3 ), rtl::OString() ); if ( m_pSIds->Seek_Entry( pWhatName, &nElement ) ) { // Nach slots suchen SbxVariable *pReturn = new SbxVariable; @@ -2918,10 +2959,13 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType) pWhatName = ( (ControlDef*)m_pSIds->GetObject( nElement ) ); pReturn->SetName( pWhatName->pData->Kurzname ); + // FIXME: HELPID + #if 0 if ( pWhatName->pData->aUId.HasNumeric() ) pReturn->PutULong(pWhatName->pData->aUId.GetNum()); else pReturn->PutString(pWhatName->pData->aUId.GetStr()); + #endif return pReturn; } } @@ -3320,7 +3364,8 @@ void TestToolObj::SortControlsByNumber( BOOL bIncludeActive ) } if ( !bIncludeActive ) { - ControlItem *pZeroItem = new ControlItemUId( UniString(), SmartId(0) ); + // FIXME: HELPID + ControlItem *pZeroItem = new ControlItemUId( UniString(), rtl::OString() ); USHORT nNr; if ( m_pReverseControls->Seek_Entry( pZeroItem, &nNr ) ) { @@ -3356,19 +3401,25 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) case SIReturn: { USHORT nRet,nParams; - SmartId aUId; + rtl::OString aUId; pRetStream->Read(nRet); if ( pRetStream->GetNextType() == BinString ) { String aUStrId; // UniqueStringID Used for Mozilla Integration pRetStream->Read( aUStrId ); - aUId = SmartId( aUStrId ); + // FIXME: HELPID + #if 0 + aUId = rtl::OString( aUStrId ); + #endif } else { comm_ULONG nUId; pRetStream->Read( nUId ); // bei Sequence einfach die Sequence - aUId = SmartId( nUId ); + // FIXME: HELPID + #if 0 + aUId = rtl::OString( nUId ); + #endif } pRetStream->Read(nParams); @@ -3397,6 +3448,8 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) { case RET_Sequence: { + // FIXME: HELPID + #if 0 ULONG nUId = aUId.GetNum(); if ( nSequence != nUId ) { @@ -3407,6 +3460,7 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) { nClearSequence = nUId; } + #endif } break; case RET_Value: @@ -3415,9 +3469,9 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) // ULONG nHintUserData = pImpl->pNextReturn->GetParent()->GetUserData(); // pImpl->pNextReturn->GetParent()->SetUserData(0); // if ( nUId == pImpl->pNextReturn->GetParent()->GetULong() ) - if ( aNextReturnId.Matches( aUId ) ) + if ( aNextReturnId.equals( aUId ) ) { - if( nParams & PARAM_ULONG_1 ) + if( nParams & PARAM_ULONG_1 ) // FIXME this is to allow negative numbers, hoping that no large numbers are interpreted wrong. should have new PARAM_LONG_1 instead { if ( nLNr1 > 0x7fffffff ) pImpl->pNextReturn->PutLong( long(nLNr1 - 0xffffffff) -1 ); @@ -3427,7 +3481,7 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) if( nParams & PARAM_USHORT_1 ) pImpl->pNextReturn->PutUShort( nNr1 ); if( nParams & PARAM_STR_1 ) pImpl->pNextReturn->PutString( aString1 ); if( nParams & PARAM_BOOL_1 ) pImpl->pNextReturn->PutBool( bBool1 ); - if( nParams & PARAM_SBXVALUE_1 ) + if( nParams & PARAM_SBXVALUE_1 ) // FIXME: allow generic datatype { SbxValues aValues( SbxDATE ); xValue1->Get( aValues ); @@ -3468,7 +3522,10 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) } WinInfoRec *pWinInfo = new WinInfoRec; + // FIXME: HELPID + #if 0 pWinInfo->aUId = aUId.GetText(); + #endif pWinInfo->nRType = (USHORT)nLNr1; // just ULONG for Transport, data is always USHORT pWinInfo->aRName = aString1; pWinInfo->bIsReset = bBool1; @@ -3504,7 +3561,7 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) ControlItem *pNewItem = new ControlItemUId( String(), aUId ); if ( pReverseControlsKontext->Seek_Entry(pNewItem,&nNr) ) { -// SmartId aID = pReverseControlsKontext->GetObject(nNr)->pData->aUId; +// rtl::OString aID = pReverseControlsKontext->GetObject(nNr)->pData->aUId; pWinInfo->aKurzname += pReverseControlsKontext->GetObject(nNr)->pData->Kurzname; } delete pNewItem; @@ -3521,6 +3578,8 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) } // Langname feststellen + // FIXME: HELPID + #if 0 if ( aUId.HasString() ) { // use the String ID since there is no LongName in hid.lst pWinInfo->aLangname = aUId.GetStr(); @@ -3536,6 +3595,7 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) delete pNewItem; } } + #endif aWinInfoHdl.Call( pWinInfo ); @@ -3544,6 +3604,8 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) break; case RET_ProfileInfo: { + // FIXME: HELPID + #if 0 ULONG nUId = aUId.GetNum(); if ( nParams & PARAM_STR_1 ) { @@ -3672,10 +3734,13 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) break; } } + #endif } break; case RET_DirectLoging: { + // FIXME: HELPID + #if 0 ULONG nUId = aUId.GetNum(); switch ( nUId ) { @@ -3694,6 +3759,7 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) default: ; } + #endif } break; case RET_MacroRecorder: @@ -3724,7 +3790,8 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) if ( m_pReverseControls ) { USHORT nNr; - ControlItem *pNewItem = new ControlItemUId( String(), SmartId( nLNr1 ) ); + // FIXME: HELPID + ControlItem *pNewItem = new ControlItemUId( String(), rtl::OString( /*nLNr1*/ ) ); if ( m_pReverseControls->Seek_Entry(pNewItem,&nNr) ) aULongNames = m_pReverseControls->GetObject(nNr)->pData->Kurzname; delete pNewItem; @@ -3959,18 +4026,24 @@ BOOL TestToolObj::ReturnResults( SvStream *pIn ) case SIReturnError: { String aString; - SmartId aUId; + rtl::OString aUId; if ( pRetStream->GetNextType() == BinString ) { String aUStrId; // UniqueStringID Used for Mozilla Integration pRetStream->Read( aUStrId ); - aUId = SmartId( aUStrId ); + // FIXME: HELPID + #if 0 + aUId = rtl::OString( aUStrId ); + #endif } else { comm_ULONG nUId; pRetStream->Read( nUId ); // bei Sequence einfach die Sequence - aUId = SmartId( nUId ); + // FIXME: HELPID + #if 0 + aUId = rtl::OString( nUId ); + #endif } pRetStream->Read( aString ); ReplaceNumbers (aString); @@ -4016,9 +4089,15 @@ String TestToolObj::GetMethodName( ULONG nMethodId ) ReadFlatArray( Controls::arClasses, Controls::pClasses ); if ( Controls::pClasses ) { + // FIXME: HELPID + #if 0 for ( nElement = 0 ; nElement < Controls::pClasses->Count() ; nElement++ ) if ( Controls::pClasses->GetObject(nElement)->pData->aUId.Matches( nMethodId ) ) return Controls::pClasses->GetObject(nElement)->pData->Kurzname; + #else + (void)nElement; + (void)nMethodId; + #endif } return String(); } @@ -4030,9 +4109,15 @@ String TestToolObj::GetKeyName( USHORT nKeyCode ) ReadFlatArray( CmdStream::arKeyCodes, CmdStream::pKeyCodes ); if ( CmdStream::pKeyCodes ) { + // FIXME: HELPID + #if 0 for ( nElement = 0 ; nElement < CmdStream::pKeyCodes->Count() ; nElement++ ) if ( CmdStream::pKeyCodes->GetObject(nElement)->pData->aUId.Matches( nKeyCode ) ) return CmdStream::pKeyCodes->GetObject(nElement)->pData->Kurzname; + #else + (void)nElement; + (void)nKeyCode; + #endif } return CUniString( "UnknownKeyCode" ); } @@ -4061,7 +4146,8 @@ static ControlDefLoad __READONLY_DATA arRes_Type [] = bFound = FALSE; if ( aType.CompareTo(UIdKenn) == COMPARE_EQUAL ) { - aResult = pShortNames->GetName(SmartId(nNumber)); + // FIXME: HELPID + aResult = pShortNames->GetName(rtl::OString(/*nNumber*/)); bFound = TRUE; } if ( aType.CompareTo(MethodKenn ) == COMPARE_EQUAL ) @@ -4078,12 +4164,17 @@ static ControlDefLoad __READONLY_DATA arRes_Type [] = USHORT nElement; if ( pRCommands ) { + // FIXME: HELPID + #if 0 for ( nElement = 0 ; nElement < pRCommands->Count() ; nElement++ ) if ( pRCommands->GetObject(nElement)->pData->aUId.Matches( nNumber ) ) { aResult = pRCommands->GetObject(nElement)->pData->Kurzname; nElement = pRCommands->Count(); } + #else + (void)nElement; + #endif } } if ( aType.CompareTo(TypeKenn ) == COMPARE_EQUAL ) @@ -4095,17 +4186,23 @@ static ControlDefLoad __READONLY_DATA arRes_Type [] = USHORT nElement; if ( pRTypes ) { + // FIXME: HELPID + #if 0 for ( nElement = 0 ; nElement < pRTypes->Count() ; nElement++ ) if ( pRTypes->GetObject(nElement)->pData->aUId.Matches( nNumber ) ) { aResult = pRTypes->GetObject(nElement)->pData->Kurzname; nElement = pRTypes->Count(); } + #else + (void)nElement; + #endif } } if ( aType.CompareTo(SlotKenn ) == COMPARE_EQUAL ) { - aResult = pShortNames->GetName(SmartId(nNumber)); + // FIXME: HELPID + aResult = pShortNames->GetName(rtl::OString(/*nNumber*/)); bFound = TRUE; } if ( aType.CompareTo(TabKenn ) == COMPARE_EQUAL ) @@ -4142,7 +4239,7 @@ SbTextType TestToolObj::GetSymbolType( const String &rSymbol, BOOL bWasControl ) } - ControlDef WhatName( rSymbol, SmartId() ); + ControlDef WhatName( rSymbol, rtl::OString() ); if ( bWasControl ) { @@ -4233,11 +4330,12 @@ SbxVariable* Controls::Find( const String& aStr, SbxClassType aType) USHORT nElement; - ControlDef WhatName(aStr,SmartId()); + ControlDef WhatName(aStr,rtl::OString()); if (pClasses && pClasses->Seek_Entry(&WhatName,&nElement)) { pMethodVar->SetName(aStr); - ULONG nUId = pClasses->GetObject(nElement)->pData->aUId.GetNum(); + // FIXME: HELPID + ULONG nUId = 0;//pClasses->GetObject(nElement)->pData->aUId.GetNum(); pMethodVar->nValue = nUId; pMethodVar->SetUserData( GetUserData() ); diff --git a/automation/source/testtool/objtest.hxx b/automation/source/testtool/objtest.hxx index d82e4626a4d2..f62d59311024 100644 --- a/automation/source/testtool/objtest.hxx +++ b/automation/source/testtool/objtest.hxx @@ -35,7 +35,6 @@ #include <testtool.hxx> #include "cmdstrm.hxx" #include <basic/basicrt.hxx> -#include <vcl/smartid.hxx> #include "httprequest.hxx" #include <map> @@ -106,7 +105,7 @@ class ControlData { public: String Kurzname; - SmartId aUId; + rtl::OString aUId; }; DBG_NAMEEX( ControlItem ) @@ -118,8 +117,8 @@ private: public: ControlData *pData; - ControlItem( const char *Name, SmartId aUIdP ); - ControlItem( const String &Name, SmartId aUIdP ); + ControlItem( const char *Name, rtl::OString aUIdP ); + ControlItem( const String &Name, rtl::OString aUIdP ); // ControlItem( const String &Name, const String &URL, const URLType aType ); // ControlItem( const String &Name, const String &URL, const ULONG nUId ); // ControlItem( const char *Name, const String &URL, const ULONG nUId ); @@ -158,9 +157,9 @@ public: class ControlItemSon : public ControlItem, public ControlSon { public: - ControlItemSon(const char *Name, SmartId aUIdP ) + ControlItemSon(const char *Name, rtl::OString aUIdP ) : ControlItem( Name, aUIdP ) {} - ControlItemSon(const String &Name, SmartId aUIdP ); + ControlItemSon(const String &Name, rtl::OString aUIdP ); // ControlItemSon(const String &Name, const String &URL, const URLType aType ); // ControlItemSon(const String &Name, const String &URL, const ULONG nUId ); // ControlItemSon(const char *Name, const String &URL, const ULONG nUId ); @@ -170,9 +169,9 @@ public: class ControlDef : public ControlItemSon { public: - ControlDef(const char *Name, SmartId aUIdP ) + ControlDef(const char *Name, rtl::OString aUIdP ) : ControlItemSon( Name, aUIdP ) {DBG_CTOR(ControlDef,0);} - ControlDef(const String &Name, SmartId aUIdP ); + ControlDef(const String &Name, rtl::OString aUIdP ); // ControlDef(const String &Name, const String &URL, const URLType aType ); ControlDef(const String &aOldName, const String &aNewName, ControlDef *pOriginal, BOOL bWithSons = FALSE ); ~ControlDef() {DBG_DTOR(ControlDef,0);} @@ -185,7 +184,7 @@ public: class ControlItemUId : public ControlItem { public: - ControlItemUId(String Name, SmartId aUIdP) + ControlItemUId(String Name, rtl::OString aUIdP) : ControlItem( Name, aUIdP){} virtual BOOL operator < (const ControlItem &rPar); virtual BOOL operator == (const ControlItem &rPar); @@ -194,7 +193,7 @@ public: class ControlItemUIdSon : public ControlItemUId, public ControlSon { public: - ControlItemUIdSon(String Name, SmartId aUIdP) : ControlItemUId( Name, aUIdP) {} + ControlItemUIdSon(String Name, rtl::OString aUIdP) : ControlItemUId( Name, aUIdP) {} MK_SON_ACCESS( ControlItemUId ) }; @@ -203,14 +202,14 @@ class ReverseName : public ControlItemUId public: ULONG LastSequence; - ReverseName(String Name, SmartId aUIdP, ULONG nSeq) : ControlItemUId( Name, aUIdP), LastSequence(nSeq) {} + ReverseName(String Name, rtl::OString aUIdP, ULONG nSeq) : ControlItemUId( Name, aUIdP), LastSequence(nSeq) {} }; class CRevNames: public CNames { public: - void Insert( String aName, SmartId aUId, ULONG nSeq ); - String GetName( SmartId aUId ); + void Insert( String aName, rtl::OString aUId, ULONG nSeq ); + String GetName( rtl::OString aUId ); void Invalidate ( ULONG nSeq ); }; diff --git a/automation/util/manually_added_ids.hid b/automation/util/manually_added_ids.hid index 7372dc0d9879..7372dc0d9879 100755..100644 --- a/automation/util/manually_added_ids.hid +++ b/automation/util/manually_added_ids.hid |