org.ttzero.excel.entity.e3.LabelParser Maven / Gradle / Ivy
/*
* Copyright (c) 2019-2020, [email protected] All Rights Reserved.
*
* Licensed 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.
*/
package org.ttzero.excel.entity.e3;
import org.ttzero.excel.reader.AllInOneCell;
/**
* 5.63 LABEL
*
* This record represents a cell that contains a string.
* In BIFF8 it is usually replaced by the LABELSST record
* (➜5.65).
* Excel still uses this record, if it copies unformatted text
* cells to the clipboard.
*
* @author guanquan.wang at 2019-04-18 22:27
*/
public class LabelParser {
public static void get(Block block, AllInOneCell cell) {
block.skip(2);
// Index to row
cell.row = block.nextUnsignedShort();
// Index to column
cell.column = block.nextShort();
// Index to XF record (➜5.115)
cell.xf = block.nextShort();
// Unicode string, 16-bit string length (➜2.5.3)
cell.sValue = StringParser.get16Bit(block);
}
public static short getId() {
return ParserIdentifier.LABEL;
}
}