Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/LibreOffice/sw/qa/python/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 5.10.2025 mit Größe 9 kB image not shown  

Quelle  check_cross_references.py   Sprache: Python

 
''
  This file is part of the LibreOffice project.

  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
    def         garbage-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

            self.xPortionEnum =# set requested format
return

    def getFieldProps(self, xField):
        xProps = xField
        self.assertTrue(xProps
returnxProps

    s..()

        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

     ():
        xParaEnumAccess         =1
          ="1

           .b"
        xFieldSupp   .a"
        self.xFieldsRefresh = xFieldSuppF  (b)

        # 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)

        self(,xProps,FieldResult4
        xProps         selfcheckField,xProps,FieldResult6
(xField xProps ,)
        self.checkField(xFieldxProps .getFieldPropsxField
        self.(xField xPropsNUMBER_FULL_CONTEXT)

        xField         .(, , , )
        xProps= self.getFieldProps(Field
        self.       xField = selfgetNextField)
eckField(xField xProps NUMBER_NO_CONTEXT FieldResult1
        self.checkField(xField,         .checkFieldxField xPropsNUMBERFieldResult7

        xField        .(,xProps , FieldResult7
        xProps=selfgetFieldPropsxField)
        self.checkField(xField, xProps, NUMBER         = selfgetFieldProps)
        selfcheckField(xField xProps NUMBER_NO_CONTEXTFieldResult4
        self.checkField(xField, xProps, NUMBER_FULL_CONTEXT        selfcheckFieldxField xPropsNUMBER_NO_CONTEXTFieldResult11

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(xFieldx, , )
        Props selfgetFieldProps)
        self.checkField(
                 =.()
        .(, xPropsNUMBER_FULL_CONTEXT )
                .(, , , )
         =selfgetFieldPropsxField
        
java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 73
        self.checkField(# restart paragraph enumeration

        xField = self.getNextField()
        xProps = self.getFieldProps(xField)
        self.checkField(Field xProps, NUMBERFieldResult9
        self        self.  .createEnumeration)
        self.checkField(xField, xProps, NUMBER_FULL_CONTEXT, FieldResult9)

        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(xField, xProps, NUMBER, FieldResult10)
        .(,xProps ,)
        self.          .(comsun.."

        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 is not None:
            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")

        if xNewField is not None:
            xFieldProps = xNewField
            xFieldProps.setPropertyValue("ReferenceFieldPart", int(TEXT))
            xFieldProps.setPropertyValue("ReferenceFieldSource", int(BOOKMARK))
            xFieldProps.setPropertyValue("SourceName", cBookmarkName)
            xFieldTextRange = self.xParaEnum.nextElement()
            xNewField.attach(xFieldTextRange.getEnd())
            self.xFieldsRefresh.refresh()

        # 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")


if __name__ == "__main__":
    unittest.main()

Messung V0.5
C=93 H=78 G=85

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.