summaryrefslogtreecommitdiff
path: root/automation
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-12-10 16:14:13 +0000
committerRüdiger Timm <rt@openoffice.org>2004-12-10 16:14:13 +0000
commit025f236afb0cd3cc37e29ff15da52890f1e69768 (patch)
treee21b8cdafc1cb00887904300315c19b41b2745cc /automation
parentb07fa35acdcbee19be2006d5d5f3143a32859902 (diff)
INTEGRATION: CWS gh9 (1.14.12); FILE MERGED
2004/11/17 09:43:33 gh 1.14.12.2: #i36848# fix highlighting od methods ID and Name 2004/11/16 16:59:32 gh 1.14.12.1: #i36848#fix passing of controls (objects) to subroutines
Diffstat (limited to 'automation')
-rw-r--r--automation/source/testtool/objtest.cxx53
1 files changed, 31 insertions, 22 deletions
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 4ef341d694f5..39ca760b33cb 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: objtest.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: rt $ $Date: 2004-09-20 12:25:43 $
+ * last change: $Author: rt $ $Date: 2004-12-10 17:14:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -740,7 +740,7 @@ void TestToolObj::InitTestToolObj()
// StartListening( pMyVars[i]->GetBroadcaster(), TRUE );
pImpl->pControlsObj = new Controls( CUniString("ControlDummy").Append(String::CreateFromInt32(i) ) );
- pImpl->pControlsObj -> SetType( SbxVARIANT );
+ pImpl->pControlsObj -> SetType( SbxOBJECT );
Insert( pImpl->pControlsObj ); // Hier so umstndlich wegen Compilerfehlers
pImpl->pControlsObj->ChangeListener();
pImpl->pControlsObjs[i] = pImpl->pControlsObj;
@@ -2133,7 +2133,7 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
SbxVariable *pMember;
if ( ! (pMember = ((Controls*)pVar)->Find(CUniString("ID"),SbxCLASS_DONTCARE)) )
{
- pMember = new SbxProperty(CUniString("ID"),SbxULONG);
+ pMember = new SbxProperty(CUniString("ID"),SbxVARIANT);
((Controls*)pVar)->Insert(pMember);
}
pMember->PutULong(((Controls*)pVar)->pMethodVar->nValue);
@@ -2222,20 +2222,27 @@ void TestToolObj::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
}
if ( !IsError() )
{
- if ( nUserData == ID_Control )
+ SbxVariable *pMember;
+ if ( ! (pMember = pVar->GetParent()->Find(CUniString("ID"),SbxCLASS_DONTCARE)) )
{
- In->GenCmdControl (pVar->GetParent()->GetULong(),
- (USHORT)((SbxTransportMethod*)pVar)->nValue, rPar);
- aNextReturnId = SmartId( pVar->GetParent()->GetULong() );
+ SetError( SbxERR_NAMED_NOT_FOUND );
}
else
{
- In->GenCmdControl (pVar->GetParent()->GetString(),
- (USHORT)((SbxTransportMethod*)pVar)->nValue, rPar);
- aNextReturnId = SmartId( pVar->GetParent()->GetString() );
+ if ( nUserData == ID_Control )
+ {
+ In->GenCmdControl (pMember->GetULong(),
+ (USHORT)((SbxTransportMethod*)pVar)->nValue, rPar);
+ aNextReturnId = SmartId( pMember->GetULong() );
+ }
+ else
+ {
+ In->GenCmdControl (pMember->GetString(),
+ (USHORT)((SbxTransportMethod*)pVar)->nValue, rPar);
+ aNextReturnId = SmartId( pMember->GetString() );
+ }
}
-
if ( !IsError() && ((SbxTransportMethod*)pVar)->nValue & M_WITH_RETURN )
{
pImpl->pNextReturn = ((SbxTransportMethod*)pVar);
@@ -2748,18 +2755,21 @@ SbxVariable* TestToolObj::Find( const String& Str, SbxClassType Type)
pImpl->pControlsObj = pImpl->pControlsObjs[nControlsObj++];
pImpl->pControlsObj->SetName(pWhatName->pData->Kurzname);
+ // Will be set on method-child further down
if ( pWhatName->pData->aUId.HasNumeric() )
- pImpl->pControlsObj->PutULong(pWhatName->pData->aUId.GetNum());
+ pImpl->pControlsObj->SetUserData( ID_Control );
else
- pImpl->pControlsObj->PutString(pWhatName->pData->aUId.GetStr());
+ pImpl->pControlsObj->SetUserData( ID_StringControl );
pShortNames->Insert(pWhatName->pData->Kurzname,pWhatName->pData->aUId,nSequence);
SbxVariable *pMember;
if ( ! (pMember = pImpl->pControlsObj->Find(CUniString("ID"),SbxCLASS_DONTCARE)) )
{
- pMember = new SbxProperty(CUniString("ID"),SbxULONG);
- pImpl->pControlsObj->Insert(pMember);
+ SbxProperty* pID = new SbxProperty(CUniString("ID"),SbxVARIANT);
+ pImpl->pControlsObj->Insert(pID);
+ pImpl->pControlsObj->SetDfltProperty(pID);
+ pMember = pID;
}
if ( pWhatName->pData->aUId.HasNumeric() )
pMember->PutULong(pWhatName->pData->aUId.GetNum());
@@ -2836,7 +2846,7 @@ SbxVariable* TestToolObj::Find( const String& Str, SbxClassType Type)
String TestToolObj::GetRevision( String const &aSourceIn )
{
- // search $Revision: 1.14 $
+ // search $Revision: 1.15 $
xub_StrLen nPos;
if ( ( nPos = aSourceIn.SearchAscii( "$Revision:" ) ) != STRING_NOTFOUND )
return aSourceIn.Copy( nPos+ 10, aSourceIn.SearchAscii( "$", nPos+10 ) -nPos-10);
@@ -4042,7 +4052,9 @@ SbTextType TestToolObj::GetSymbolType( const String &rSymbol, BOOL bWasControl )
if ( !Controls::pClasses ) // Ist static, wird also nur einmal geladen
ReadFlatArray( Controls::arClasses, Controls::pClasses );
- if ( Controls::pClasses && Controls::pClasses->Seek_Entry( &WhatName ) )
+ if ( Controls::pClasses && Controls::pClasses->Seek_Entry( &WhatName )
+ || rSymbol.EqualsIgnoreCaseAscii( "ID" )
+ || rSymbol.EqualsIgnoreCaseAscii( "Name" ) )
return TT_METHOD;
else
return TT_NOMETHOD;
@@ -4131,10 +4143,7 @@ SbxVariable* Controls::Find( const String& Str, SbxClassType Type)
ULONG nUId = pClasses->GetObject(nElement)->pData->aUId.GetNum();
pMethodVar->nValue = nUId;
- if ( SbxValue::GetType() == SbxSTRING )
- pMethodVar->SetUserData( ID_StringControl );
- else
- pMethodVar->SetUserData( ID_Control );
+ pMethodVar->SetUserData( GetUserData() );
return pMethodVar;
}
else