Subversion

HaExcel

?curdirlinks? - Rev 236

?prevdifflink? - Blame


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Tests" script:language="StarBasic">REM  *****  BASIC  *****

Option Explicit

&apos; =====================================

Sub Init
        BasicLibraries.loadLibrary( &quot;HaExcelDev&quot; )
End Sub

&apos; =====================================

Sub Test_StringToRange_001
  Dim str As String
  Dim addr As Object
  str = &quot;$Folha2.$A$4:$C$10&quot;
  addr = StringToRange( ThisComponent, str )
End Sub

&apos; =====================================

Sub Test_GetClasses_001
  Dim oDoc As Object
  oDoc = ThisComponent
  classes = GetClasses( oDoc )
End Sub

&apos; =====================================

Sub Test_GetRootClasses_001
  Dim oDoc As Object
  oDoc = ThisComponent
  classes = GetRootClasses( oDoc )
End Sub

&apos; =====================================

Sub Test_InstantiateCell_001
  oDoc = ThisComponent
  oSheet = oDoc.getCurrentController.getActiveSheet
  oCell = oSheet.getCellByPosition( 0, 0 )
  oDest = oSheet.getCellByPosition( 1, 0 )
  InstantiateCell( oCell, oDest )
End Sub

&apos; =====================================

&apos; FIXME two forms with same name can be added
Sub Test_InstantiateExpansion_001
  Dim oDoc As Object
  Dim exp As String
  Dim dataSheet As Integer
  oDoc = ThisComponent
  exp = &quot;name,$Folha1.$A$7:$E$7,1&quot;
  dataSheet = 1

  InstantiateExpansion( oDoc, exp, dataSheet )
End Sub

&apos; =====================================

Sub Test_InstantiateClass_001
  Dim oDoc As Object
  Dim class As String
  Dim dataSheet As Integer
  oDoc = ThisComponent
  class = &quot;MyClass,$Folha1.$A$1:$F$7,0,0&quot;
  dataSheet = 1
  InstantiateClass( oDoc, class, dataSheet )
End Sub

&apos; =====================================

Sub Test_InstantiateModel_001
  Dim oDoc As Object
  Dim dataSheet As Integer
  oDoc = ThisComponent
  dataSheet = 1
  InstantiateModel( oDoc, dataSheet )
End Sub

&apos; =====================================

Sub Test_FormExists_001
  Dim oDoc   As Object
  Dim oSheet As Object
  Dim str    As String
  Dim result As Boolean
  
  oDoc   = ThisComponent
  oSheet = oDoc.Sheets(0)
  str    = &quot;MyForm&quot;
  
  result = FormExists(oDoc, oSheet, str)
  
  If result Then
        msgbox &quot;Form &apos;&quot; &amp; str &amp; &quot;&apos; exists.&quot;
  Else
        msgbox &quot;Form &apos;&quot; &amp; str &amp; &quot;&apos; does not exist.&quot;
  End If
End Sub

&apos; =====================================
</script:module>

Generated by GNU Enscript 1.6.5.90.

Theme by Vikram Singh | Powered by WebSVN v2.3.3