'************************************************************************* '* '* $RCSfile: style_ParagraphProperties.xba,v $ '* '* $Revision: 1.1 $ '* '* last change:$Date: 2003-01-27 17:53:21 $ '* '* The Contents of this file are made available subject to the terms of '* either of the following licenses '* '* - GNU Lesser General Public License Version 2.1 '* - Sun Industry Standards Source License Version 1.1 '* '* Sun Microsystems Inc., October, 2000 '* '* GNU Lesser General Public License Version 2.1 '* ============================================= '* Copyright 2000 by Sun Microsystems, Inc. '* 901 San Antonio Road, Palo Alto, CA 94303, USA '* '* This library is free software; you can redistribute it and/or '* modify it under the terms of the GNU Lesser General Public '* License version 2.1, as published by the Free Software Foundation. '* '* This library is distributed in the hope that it will be useful, '* but WITHOUT ANY WARRANTY; without even the implied warranty of '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU '* Lesser General Public License for more details. '* '* You should have received a copy of the GNU Lesser General Public '* License along with this library; if not, write to the Free Software '* Foundation, Inc., 59 Temple Place, Suite 330, Boston, '* MA 02111-1307 USA '* '* '* Sun Industry Standards Source License Version 1.1 '* ================================================= '* The contents of this file are subject to the Sun Industry Standards '* Source License Version 1.1 (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.openoffice.org/license.html. '* '* Software provided under this License is provided on an "AS IS" basis, '* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, '* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, '* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. '* See the License for the specific provisions governing your rights and '* obligations concerning the Software. '* '* The Initial Developer of the Original Code is: Sun Microsystems, Inc. '* '* Copyright: 2000 by Sun Microsystems, Inc. '* '* All Rights Reserved. '* '* Contributor(s): _______________________________________ '* '* '************************************************************************* '*************************************************************************

' Be sure that all variables are dimensioned: option explicit

Sub RunTest()

'************************************************************************* ' SERVICE: ' com.sun.star.style.ParagraphProperties '************************************************************************* On Error Goto ErrHndl Dim bOK As Boolean

if hasUnoInterfaces(oObj, "com.sun.star.text.XTextRange") then oObj.String = "This is an example string from ParagraphProperties..." end if

Dim nParaAdjust(3) As Integer nParaAdjust(0) = com.sun.star.style.ParagraphAdjust.LEFT nParaAdjust(1) = com.sun.star.style.ParagraphAdjust.RIGHT nParaAdjust(2) = com.sun.star.style.ParagraphAdjust.BLOCK nParaAdjust(3) = com.sun.star.style.ParagraphAdjust.CENTER ' STRETCH????

Dim nLastLineAdjust(2) As Integer nLastLineAdjust(0) = com.sun.star.style.ParagraphAdjust.LEFT nLastLineAdjust(1) = com.sun.star.style.ParagraphAdjust.BLOCK nLastLineAdjust(2) = com.sun.star.style.ParagraphAdjust.CENTER ' STRETCH????

Out.Log("Starting ...")

PropertyTester.TestProperty("ParaAdjust",nParaAdjust())

PropertyTester.TestProperty("ParaLineSpacing")

PropertyTester.TestProperty("ParaBackColor")

PropertyTester.TestProperty("ParaBackTransparent")

PropertyTester.TestProperty("ParaBackGraphicURL")

PropertyTester.TestProperty("ParaBackGraphicFilter")

PropertyTester.TestProperty("ParaBackGraphicLocation")

Out.Log("set ParaAdjust to com.sun.star.style.ParagraphAdjust.BLOCK") oObj.ParaAdjust = com.sun.star.style.ParagraphAdjust.BLOCK PropertyTester.TestProperty("ParaLastLineAdjust",nLastLineAdjust()) oObj.ParaAdjust = com.sun.star.style.ParagraphAdjust.LEFT

PropertyTester.TestProperty("ParaExpandSingleWord")

Dim margins(2) As Integer margins(0) = 0 margins(1) = 50 margins(2) = 100

PropertyTester.TestProperty("ParaLeftMargin",margins())

PropertyTester.TestProperty("ParaRightMargin",margins())

PropertyTester.TestProperty("ParaTopMargin",margins())

PropertyTester.TestProperty("ParaBottomMargin",margins())

PropertyTester.TestProperty("ParaLineNumberCount")

PropertyTester.TestProperty("ParaLineNumberStartValue")

Dim cPageDescName(0 To 1) As String cPageDescName(0) = "HTML" cPageDescName(1) = "Standard" PropertyTester.TestProperty("PageDescName",cPageDescName())

PropertyTester.TestProperty("PageNumberOffset")

PropertyTester.TestProperty("ParaRegisterModeActive")

PropertyTester.TestProperty("ParaTabStops")

Dim cParaStyleName(0 to 3) As String cParaStyleName(0) = "Heading 1" cParaStyleName(1) = "First line indent" cParaStyleName(2) = "Text body" cParaStyleName(3) = "Standard" PropertyTester.TestProperty("ParaStyleName",cParaStyleName())

PropertyTester.TestProperty("DropCapFormat")

PropertyTester.TestProperty("DropCapWholeWord")

PropertyTester.TestProperty("ParaKeepTogether")

PropertyTester.TestProperty("ParaSplit")

Dim nLevel(0 to 1) As Integer nLevel(0) = 3 nLevel(1) = 0 Out.Log("Set NumberingStyleName to 'List 2' " if PropertyTester.isAvailable("NumberingStyleName") then oObj.NumberingStyleName = "List 2" end if PropertyTester.TestProperty("NumberingLevel",nLevel())

PropertyTester.TestProperty("NumberingRules")

PropertyTester.TestProperty("NumberingStartValue")

PropertyTester.TestProperty("ParaIsNumberingRestart")

Dim cStyleName(0 to 1) As String cStyleName(0) = "List 1" cStyleName(1) = "Numbering 2" PropertyTester.TestProperty("NumberingStyleName",cStyleName())

PropertyTester.TestProperty("ParaOrphans")

PropertyTester.TestProperty("ParaWidows")

PropertyTester.TestProperty("ParaShadowFormat")

PropertyTester.TestProperty("LeftBorder")

PropertyTester.TestProperty("RightBorder")

PropertyTester.TestProperty("TopBorder")

PropertyTester.TestProperty("BottomBorder")

PropertyTester.TestProperty("BorderDistance")

PropertyTester.TestProperty("LeftBorderDistance")

PropertyTester.TestProperty("RightBorderDistance")

PropertyTester.TestProperty("TopBorderDistance")

PropertyTester.TestProperty("BottomBorderDistance")

PropertyTester.TestProperty("BreakType")

Dim cCharStyles(1) as String cCharStyles(0) = "Emphasis" CCharStyles(1) = "Teletype"

PropertyTester.TestProperty("DropCapCharStyleName",cCharStyles())

PropertyTester.TestProperty("ParaFirstLineIndent")

PropertyTester.TestProperty("ParaIsAutoFirstLineIndent")

PropertyTester.TestProperty("ParaHyphenationMaxHyphens")

PropertyTester.TestProperty("ParaHyphenationMaxLeadingChars")

PropertyTester.TestProperty("ParaHyphenationMaxTrailingChars")

Dim VertAlign(0 to 4) as Integer Dim nCount as Integer for nCount = 0 to uBound(VertAlign()) VertAlign(nCount) = nCount next nCount PropertyTester.TestProperty("ParaVertAlignment", VertAlign())

PropertyTester.TestProperty("ParaUserDefinedAttributes")

PropertyTester.TestProperty("ParaIsHyphenation")

Exit Sub ErrHndl: Test.Exception() bOK = false resume next End Sub