Avoid potential negative array index access to cached text.
[LibreOffice.git] / qadevOOo / tests / java / ifc / drawing / _Text.java
blob9ffffab6ee3ff553425f9a5ccc8ae7c35c6314ef
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package ifc.drawing;
21 import lib.MultiPropertyTest;
23 public class _Text extends MultiPropertyTest {
25 @Override
26 protected boolean compare(Object ob1, Object ob2) {
28 return super.compare(ob1, ob2);
32 public void _NumberingRules() {
33 //This property is readOnly
34 boolean bResult = false;
36 try {
37 Object theRules2 = oObj.getPropertyValue( "NumberingRules" );
38 if (!(theRules2 instanceof com.sun.star.container.XIndexReplace)) {
39 log.println("Property 'NumberingRules' is an instance of "+
40 theRules2.getClass().getName());
41 log.println("Expected was an instance of "+
42 "com.sun.star.container.XIndexReplace");
44 log.println("Trying to cast property 'NumberingRules' "+
45 "to XIndexReplace");
46 oObj.getPropertyValue( "NumberingRules" );
47 bResult = true;
48 } catch( Exception e ) {
49 log.println("Error occurred while trying to get property"+
50 " 'NumberingRules'");
51 e.printStackTrace( log );
52 bResult = false;
55 tRes.tested( "NumberingRules", bResult);
58 } // finish class _Text