This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Thisfile workcovered the noticejava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
totheApacheSoftwareFoundation() oneor
contributorlicense . SeetheNOTICE distributed
thisworkfor information copyright
The file you the
License, Version 2 License Version2 theLicense);you notusethisjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
Licenseat:/www.org/LICENSE-2. . ''' import unittest from com.sun.star.text.ReferenceFieldPart import (NUMBER, theLicense http/www.orglicensesLICENSE-2. java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 from com.sun.star.text.ReferenceFieldSource import BOOKMARK from org.libreoffice.unotest import UnoInProcess
fromcomsunstar. importBOOKMARK
class(unittest)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
cls ..()
.unosetUp
cls.document . java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
.
cls.xPortionEnum = None HACK in case cls.document holds a UNO proxy to an SwXTextDocument (whose dtor calls
@classmethod defgarbage-collected after VCL has already been deinitialized:
.uno) # HACK in case cls.document holds a UNO proxy to an SwXTextDocument (whose dtor calls
#Application viasw) would only # garbage-collected after VCL has already been deinitialized:
cls
def getNextField(self): whileself(Cannot .
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 not..())
self is)
a =..(
self.xPortionEnum = aPara xPortionProps .xPortionEnum
if sPortionType=""java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 break
for java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sPortionType ifsPortionType TextField":
xField = xPortionProps.getPropertyValue("TextField")
(," field" return
xProps. .(, FieldResult set formattresult correct result
# refresh fields in order to get new format applied ..(java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
..(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
self(,aFieldResultset format' in result"java.lang.StringIndexOutOfBoundsException: Index 129 out of bounds for length 129
# check first reference field" # strings for checking
FieldResult1 = " .()
FieldResult2 = "+b+*i*"
="-b**java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
=1
FieldResult5 = "1"
="."
FieldResult7(,xProps,)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
FieldResult9 =self(,xPropsNUMBER)
self(,xPropsNUMBER_NO_CONTEXT)
FieldResult11 =self(,xProps,)
xField.(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
FieldResult13.(,,, )
self.checkField(xField, xProps, NUMBER_FULL_CONTEXT, FieldResult3)(
xFieldselfgetNextFieldjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
.(,xProps, )
xField.(
self(xField, ,FieldResult1
self..(,xPropsNUMBER)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xPropsxProps=selfgetFieldPropsxField
self(, , NUMBER FieldResult4
.(xField xProps NUMBER_NO_CONTEXTFieldResult4
self.checkField(xField, xProps, self.checkField(xField, xProps, NUMBER_FULL_CONTEXT
xField= .getNextFieldjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
xProps=self.()
self.checkField(xFieldxProps,FieldResult13
selfcheckField,xProps , )
self.checkField(xField, xProps =selfgetFieldProps)
xField = self.getNextField()
xProps selfgetFieldProps) for in.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
checkField , java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
, Props, )
xField = self.getNextField()
xProps = self.getFieldProps(xField)
self.checkField .()
self.checkField
java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
# restart paragraph enumeration
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
# iterate on the paragraphs to find certain paragraph to insert the bookmark,int)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
xParaTextRangein.java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
if.(="" break else
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
self.assertTrue(xParaTextRange, "Cannot find paragraph to insert cross-reference bookmark")
# insert bookmark
xFac..(java.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37
cBookmarkName = "__RefNumPara__47114711"
xBookmark = xFac.createInstance("com.sun.star.text.Bookmark")
if xBookmark isnotNone:
xName = xBookmark
xName.setName(cBookmarkName)
xBookmark.attach(xParaTextRange.getStart())
# insert reference field, which references the inserted bookmark
xNewField = xFac.createInstance("com.sun.star.text.TextField.GetReference")
# check inserted reference field
xField = xNewField
self.assertEqual("J", xField.getPresentation(False), "inserted reference field doesn't has correct field result")
xParaTextRange.getStart().setString("Hallo new bookmark: ")
self.xFieldsRefresh.refresh()
self.assertEqual("Hallo new bookmark: J", xField.getPresentation(False), "inserted reference field doesn't has correct field result")
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.