public static final Type TextBookmarkAtom = new Type(4007,null);
public static final Type TextBytesAtom = new Type(4008,TextBytesAtom.class);
public static final Type TxSIStyleAtom = new Type(4009,null);
- public static final Type TextSpecInfoAtom = new Type(4010,null);
+ public static final Type TextSpecInfoAtom = new Type(4010, TextSpecInfoAtom.class);
public static final Type DefaultRulerAtom = new Type(4011,null);
public static final Type FontEntityAtom = new Type(4023,FontEntityAtom.class);
public static final Type FontEmbeddedData = new Type(4024,null);
--- /dev/null
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+package org.apache.poi.hslf.record;\r
+\r
+import org.apache.poi.util.LittleEndian;\r
+\r
+import java.io.OutputStream;\r
+import java.io.IOException;\r
+\r
+/**\r
+ * The special info runs contained in this text.\r
+ * Special info runs consist of character properties which don?t follow styles.\r
+ * \r
+ * @author Yegor Kozlov\r
+ */\r
+public class TextSpecInfoAtom extends RecordAtom {\r
+ /**\r
+ * Record header.\r
+ */\r
+ private byte[] _header;\r
+\r
+ /**\r
+ * Record data.\r
+ */\r
+ private byte[] _data;\r
+\r
+ /**\r
+ * Constructs the link related atom record from its\r
+ * source data.\r
+ *\r
+ * @param source the source data as a byte array.\r
+ * @param start the start offset into the byte array.\r
+ * @param len the length of the slice in the byte array.\r
+ */\r
+ protected TextSpecInfoAtom(byte[] source, int start, int len) {\r
+ // Get the header.\r
+ _header = new byte[8];\r
+ System.arraycopy(source,start,_header,0,8);\r
+\r
+ // Get the record data.\r
+ _data = new byte[len-8];\r
+ System.arraycopy(source,start+8,_data,0,len-8);\r
+\r
+ }\r
+ /**\r
+ * Gets the record type.\r
+ * @return the record type.\r
+ */\r
+ public long getRecordType() { return RecordTypes.TextSpecInfoAtom.typeID; }\r
+\r
+ /**\r
+ * Write the contents of the record back, so it can be written\r
+ * to disk\r
+ *\r
+ * @param out the output stream to write to.\r
+ * @throws java.io.IOException if an error occurs.\r
+ */\r
+ public void writeOut(OutputStream out) throws IOException {\r
+ out.write(_header);\r
+ out.write(_data);\r
+ }\r
+\r
+ /**\r
+ * Update the text length\r
+ *\r
+ * @param size the text length\r
+ */\r
+ public void setTextSize(int size){\r
+ LittleEndian.putInt(_data, 0, size);\r
+ }\r
+}\r