Hi,
I added some new functions in automation module in order to support
Java GUI Test Library (vclauto). I am not a committer. Anybody can
help me to patch it?
My first contribution here... If I don't follow the correct process,
pls correct me.
I created the patch in the directory ${SRC_ROOT}/automation.

-- 
Best Regards
>From [email protected]
Index: source/server/statemnt.cxx
===================================================================
--- source/server/statemnt.cxx	(revision 1292703)
+++ source/server/statemnt.cxx	(working copy)
@@ -3955,6 +3955,34 @@
 					ValueOK(aUId, MethodString( nMethodId ),nNr1,CountWinByRT( pControl, WINDOW_FIXEDTEXT, sal_True ) );
             }
 			break;
+		// Enhencement from 3.4 begin
+		case M_HasFocus:
+			{
+				pRet->GenReturn ( RET_Value, aUId, pControl->HasFocus() );
+			break;
+			}
+		case M_GetScreenRectangle:
+			{
+				Rectangle aRect =  bBool1 ? pControl->GetClientWindowExtentsRelative(NULL) : pControl->GetWindowExtentsRelative( NULL );
+                pRet->GenReturn ( RET_Value, aUId, 
+					UniString::CreateFromInt32(aRect.Left()).
+					AppendAscii(",").Append(UniString::CreateFromInt32(aRect.Top())).
+					AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetWidth())).
+					AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetHeight()))
+					);
+			}
+			break;
+		case M_GetHelpText:
+			{
+				pRet->GenReturn ( RET_Value, aUId, pControl->GetHelpText());
+			}
+			break;
+		case M_GetQuickHelpText:
+			{
+				pRet->GenReturn ( RET_Value, aUId,pControl->GetQuickHelpText());
+			}
+			break;
+		// Enhencement from 3.4 end
 		default:
 			return sal_False;
 		}
@@ -5422,6 +5450,26 @@
 								            case 3:
 									            pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTB->GetItemId(nItemPos));
 									            break;
+									//Enhencement from 3.4 begin
+									case 11:
+										pRet->GenReturn ( RET_Value, aUId, (comm_ULONG) nItemPos + 1);
+										break;
+									case 12:
+										pRet->GenReturn ( RET_Value, aUId, Id2Str(pTB->GetHelpId())); // The toolbox's help id
+										break;
+										case 13:
+										{
+										Rectangle aRect = pTB->GetItemPosRect( nItemPos );
+										Rectangle aTBRect = pTB->GetWindowExtentsRelative( NULL );
+										pRet->GenReturn ( RET_Value, aUId, 
+											UniString::CreateFromInt32(aRect.Left()+aTBRect.Left()).
+											AppendAscii(",").Append(UniString::CreateFromInt32(aRect.Top()+aTBRect.Top())).
+											AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetWidth())).
+											AppendAscii(",").Append(UniString::CreateFromInt32(aRect.GetHeight()))
+											);
+										break;
+										}
+									//Enhencement from 3.4 end
 								            default:
 									            ReportError( aUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
                                                 pRet->GenReturn ( RET_Value, aUId, comm_ULONG(0));
@@ -5430,6 +5478,20 @@
 									}
 								}
 								break;
+							//Enhencement from 3.4 begin
+							case M_GetItemHelpText :
+								if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTB->GetItemCount() ))
+									pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetHelpText(pTB->GetItemId(nNr1-1)));
+								break;
+							case M_GetItemQuickHelpText :
+								if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTB->GetItemCount() ))
+									pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetQuickHelpText(pTB->GetItemId(nNr1-1)));
+								break;
+							case M_GetItemText2:
+								if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTB->GetItemCount() ))
+									pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetItemText(pTB->GetItemId(nNr1-1)));
+								break;
+							//Enhencement from 3.4 end
 							case M_GetItemText :
 								pRet->GenReturn ( RET_Value, aUId, (String)pTB->GetItemText(nNr1));
 								break;
Index: source/server/server.cxx
===================================================================
--- source/server/server.cxx	(revision 1292703)
+++ source/server/server.cxx	(working copy)
@@ -187,7 +187,20 @@
                 break;
             }
         }
-
+	// Get port from command line
+	if (bAutomate) 
+	{
+		for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ )
+		{
+			if ( Application::GetCommandLineParam( i ).Copy(0,16).EqualsIgnoreCaseAscii("/automationport=") 
+				|| Application::GetCommandLineParam( i ).Copy(0,16).EqualsIgnoreCaseAscii("-automationport="))
+			{
+                		nPortIs = Application::GetCommandLineParam( i ).Copy(16).ToInt32();
+                		return nPortIs;
+			}
+           	}
+	}
+	//
 // if started within Portal determin location of testtool.ini/rc by analysing the commandline
 // /userid:demo1[/export/home/user/demo1]
 // -userid:demo1[/export/home/user/demo1]
Index: source/inc/rcontrol.hxx
===================================================================
--- source/inc/rcontrol.hxx	(revision 1292703)
+++ source/inc/rcontrol.hxx	(working copy)
@@ -288,6 +288,14 @@
 //#define M_SOFFICE           0x0800  // Command valid for Star/Open Office
 //#define M_MOZILLA           0x1000  // Command valid for Mozilla
 
+// Enhencement
+#define M_GetHelpText  ( M_WITH_RETURN |  90 )
+#define M_GetQuickHelpText  ( M_WITH_RETURN |  91 )
+#define M_GetScreenRectangle ( M_WITH_RETURN |  92 )
+#define M_HasFocus ( M_WITH_RETURN |  93 )
+#define M_GetItemHelpText ( M_WITH_RETURN |  94 )
+#define M_GetItemQuickHelpText ( M_WITH_RETURN |  95 )
+#define M_GetItemText2 ( M_WITH_RETURN |  96 )
 
 // RemoteCommands
 #define RC_AppAbort			( M_SOFFICE | M_MOZILLA | 1 )

Reply via email to