01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: ==================================================================== */
17:
18: package org.apache.poi.hwpf.usermodel;
19:
20: import org.apache.poi.hwpf.model.ListFormatOverride;
21: import org.apache.poi.hwpf.model.ListFormatOverrideLevel;
22: import org.apache.poi.hwpf.model.ListLevel;
23: import org.apache.poi.hwpf.model.ListTables;
24: import org.apache.poi.hwpf.model.PAPX;
25: import org.apache.poi.util.POILogFactory;
26: import org.apache.poi.util.POILogger;
27:
28: public class ListEntry extends Paragraph {
29: private static POILogger log = POILogFactory
30: .getLogger(ListEntry.class);
31:
32: ListLevel _level;
33: ListFormatOverrideLevel _overrideLevel;
34:
35: ListEntry(PAPX papx, Range parent, ListTables tables) {
36: super (papx, parent);
37:
38: if (tables != null) {
39: ListFormatOverride override = tables.getOverride(_props
40: .getIlfo());
41: _overrideLevel = override
42: .getOverrideLevel(_props.getIlvl());
43: _level = tables.getLevel(override.getLsid(), _props
44: .getIlvl());
45: } else {
46: log
47: .log(
48: POILogger.WARN,
49: "No ListTables found for ListEntry - document probably partly corrupt, and you may experience problems");
50: }
51: }
52:
53: public int type() {
54: return TYPE_LISTENTRY;
55: }
56: }
|