diff options
Diffstat (limited to 'testautomation/global/tools/includes/optional/t_ole.inc')
-rwxr-xr-x | testautomation/global/tools/includes/optional/t_ole.inc | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/testautomation/global/tools/includes/optional/t_ole.inc b/testautomation/global/tools/includes/optional/t_ole.inc index 457704f20b13..10a913102a18 100755 --- a/testautomation/global/tools/includes/optional/t_ole.inc +++ b/testautomation/global/tools/includes/optional/t_ole.inc @@ -65,15 +65,15 @@ end function '******************************************************************************* -function hGetOleObjectName( ObjectType as string ) as string
-
- dim oUnoOfficeConnection as object
- dim oUnoConfigurationAccess as object
- dim aPropertyValue(1) as new com.sun.star.beans.PropertyValue
+function hGetOleObjectName( ObjectType as string ) as string + + dim oUnoOfficeConnection as object + dim oUnoConfigurationAccess as object + dim aPropertyValue(1) as new com.sun.star.beans.PropertyValue dim xViewRoot as object dim cConfigString as string - dim cString as string
-
+ dim cString as string + const CFN = "global::tools::includes::optional::t_ole.inc::hGetOleObjectName(): " ' Test function parameters. They are <> gApplication as the API is case sensitive @@ -94,22 +94,22 @@ function hGetOleObjectName( ObjectType as string ) as string if ( VERBOSE ) then printlog( CFN & "Retrieving OLE name for: " & ObjectType ) - ' ...Embedding is physical path, ObjectNames the top node
- aPropertyValue( 0 ).Name = "nodepath"
+ ' ...Embedding is physical path, ObjectNames the top node + aPropertyValue( 0 ).Name = "nodepath" aPropertyValue( 0 ).Value = "/org.openoffice.Office.Embedding/ObjectNames/" & ObjectType - ' Connect to remote UNO
- oUnoOfficeConnection = hGetUnoService( TRUE )
-
- if ( isNull( oUnoOfficeConnection )) then
- warnlog( CFN & "Failed to establish UNO connection, hGetUnoService failed" )
- hGetOleObjectName() = ""
+ ' Connect to remote UNO + oUnoOfficeConnection = hGetUnoService( TRUE ) + + if ( isNull( oUnoOfficeConnection )) then + warnlog( CFN & "Failed to establish UNO connection, hGetUnoService failed" ) + hGetOleObjectName() = "" else - ' Get a configuration provider
+ ' Get a configuration provider oUnoConfigurationAccess = oUnoOfficeConnection.createInstance( "com.sun.star.configuration.ConfigurationProvider" ) ' Get access - xViewRoot = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() )
+ xViewRoot = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() ) cConfigString = xViewRoot.getByName( "ObjectUIName" ) ' The string contains placeholders %PRODUCTNAME and %PRODUCTVERSION which have to be replaced @@ -119,11 +119,11 @@ function hGetOleObjectName( ObjectType as string ) as string else cString = gProductName & " " & gOfficeVersion & " " & right( cConfigString, len( cConfigString ) - 29 ) endif -
+ endif - hGetOleObjectName() = cString
-
+ hGetOleObjectName() = cString + end function '******************************************************************************* @@ -139,7 +139,7 @@ function GetOleDefaultNames() gOLEChart = hGetOleObjectName( "Chart" ) gOLEImpress = hGetOleObjectName( "Impress" ) gOLEDraw = hGetOleObjectName( "Draw" ) - gOLEMath = hGetOleObjectName( "Math" )
+ gOLEMath = hGetOleObjectName( "Math" ) end function |