From: Nick Burch Date: Mon, 12 Nov 2007 21:49:37 +0000 (+0000) Subject: Add support for Chart Title Format records (bug #43721) X-Git-Tag: REL_3_0_2_BETA1~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9f606116cbe5c5db1d90b03ce7f9703f7fdb2e82;p=poi.git Add support for Chart Title Format records (bug #43721) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@594307 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index f88c1582f6..ca6a475253 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -36,6 +36,7 @@ + 43721 - [PATCH] Support for Chart Title Format records 42794 - [PATCH] Fix for BOF records from things like Access 43648 - Fix for IntPtg and short vs int 43751 - [PATCH] - Fix for handling rotated text in HSSFSheet.autoSizeColumn diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 1dc3b60bcd..2b561f5549 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -33,6 +33,7 @@ + 43721 - [PATCH] Support for Chart Title Format records 42794 - [PATCH] Fix for BOF records from things like Access 43648 - Fix for IntPtg and short vs int 43751 - [PATCH] - Fix for handling rotated text in HSSFSheet.autoSizeColumn diff --git a/src/java/org/apache/poi/hssf/record/ChartTitleFormatRecord.java b/src/java/org/apache/poi/hssf/record/ChartTitleFormatRecord.java new file mode 100644 index 0000000000..a9ec81e97a --- /dev/null +++ b/src/java/org/apache/poi/hssf/record/ChartTitleFormatRecord.java @@ -0,0 +1,146 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (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.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +/* + * HSSF Chart Title Format Record Type + */ +package org.apache.poi.hssf.record; + +import org.apache.poi.util.LittleEndian; + +import java.util.ArrayList; + +/** + * Describes the formatting runs associated with a chart title. + */ +public class ChartTitleFormatRecord extends Record { + public static final short sid = 0x1050; + + private int m_recs; + + private class CTFormat { + private short m_offset; + private short m_fontIndex; + + protected CTFormat(short offset,short fontIdx){ + m_offset = offset; + m_fontIndex = fontIdx; + } + + public short getOffset(){ + return m_offset; + } + public void setOffset(short newOff){ + m_offset = newOff; + } + public short getFontIndex() { + return m_fontIndex; + } + } + + private ArrayList m_formats; + + public ChartTitleFormatRecord() { + super(); + } + + public ChartTitleFormatRecord(RecordInputStream in) { + super(in); + } + + protected void validateSid(short id) { + if (id != sid) + { + throw new RecordFormatException("NOT A CHARTTITLEFORMAT RECORD"); + } + } + + protected void fillFields(RecordInputStream in) { + m_recs = in.readUShort(); + int idx; + CTFormat ctf; + if (m_formats == null){ + m_formats = new ArrayList(m_recs); + } + for(idx=0;idx