blob: 1de258223427a509df8acae47b4ba0eda2a28ddb [file] [log] [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="sheet_XViewSplitable" script:language="StarBasic">
'*************************************************************************
'
' Licensed to the Apache Software Foundation (ASF) under one
' or more contributor license agreements. See the NOTICE file
' distributed with this work for additional information
' regarding copyright ownership. The ASF licenses this file
' to you under the Apache License, Version 2.0 (the
' "License"); you may not use this file except in compliance
' with the License. You may obtain a copy of the License at
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing,
' software distributed under the License is distributed on an
' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
' KIND, either express or implied. See the License for the
' specific language governing permissions and limitations
' under the License.
'
'*************************************************************************
' Be sure that all variables are dimensioned:
option explicit
Dim XSplitPos As Long
Dim YSplitPos As Long
Sub RunTest()
'*************************************************************************
' INTERFACE:
' com.sun.star.sheet.XViewSplitable
'*************************************************************************
On Error Goto ErrHndl
Dim bOK As Boolean
Test.StartMethod("splitAtPosition()")
bOK = true
' Only one of XViewSplitable::getIsWindowSplit() and
' XViewFreezable::hasFrozenPanes() can be true
oObj.freezeAtPosition(10, 10)
bOK = bOK AND oObj.hasFrozenPanes()
SplitAt(100, 200)
bOK = bOK AND NOT oObj.hasFrozenPanes()
Test.MethodTested("splitAtPosition()", bOK)
Test.StartMethod("getIsWindowSplit()")
bOK = true
SplitAt(0, 0)
bOK = bOK AND NOT oObj.getIsWindowSplit()
SplitAt(50, 50)
bOK = bOK AND oObj.getIsWindowSplit()
Test.MethodTested("getIsWindowSplit()", bOK)
Test.StartMethod("getSplitHorizontal()")
bOK = true
SplitAt(0, 0)
bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos
SplitAt(0, 100)
bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos
SplitAt(100, 0)
bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos
SplitAt(100, 100)
bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos
Test.MethodTested("getSplitHorizontal()", bOK)
Test.StartMethod("getSplitVertical()")
bOK = true
SplitAt(0, 0)
bOK = bOK AND oObj.getSplitVertical() = YSplitPos
SplitAt(100, 0)
bOK = bOK AND oObj.getSplitVertical() = YSplitPos
SplitAt(100, 100)
bOK = bOK AND oObj.getSplitVertical() = YSplitPos
SplitAt(0, 100)
bOK = bOK AND oObj.getSplitVertical() = YSplitPos
Test.MethodTested("getSplitVertical()", bOK)
Test.StartMethod("getSplitColumn()")
bOK = true
SplitAt(0, 0)
bOK = bOK AND oObj.getSplitColumn() = 0
SplitAt(0, 100)
bOK = bOK AND oObj.getSplitColumn() = 0
SplitAt(100, 100)
bOK = bOK AND oObj.getSplitColumn() &lt;&gt; 0
SplitAt(100, 0)
bOK = bOK AND oObj.getSplitColumn() &lt;&gt; 0
Test.MethodTested("getSplitColumn()", bOK)
Test.StartMethod("getSplitRow()")
bOK = true
SplitAt(0, 0)
bOK = bOK AND oObj.getSplitRow() = 0
SplitAt(100, 0)
bOK = bOK AND oObj.getSplitRow() = 0
SplitAt(100, 100)
bOK = bOK AND oObj.getSplitRow() &lt;&gt; 0
SplitAt(0, 100)
bOK = bOK AND oObj.getSplitRow() &lt;&gt; 0
Test.MethodTested("getSplitRow()", bOK)
Exit Sub
ErrHndl:
Test.Exception()
bOK = false
resume next
End Sub
Sub SplitAt(x As Long, y As Long)
Out.Log("Spliting At position (" &amp; x &amp; ", " &amp; y &amp; ")")
oObj.SplitAtPosition(x, y)
XSplitPos = x
YSplitPos = y
End Sub
</script:module>