⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 label.cpp

📁 xls文件格式分析基础库
💻 CPP
字号:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2004-2006 Yeico S. A. de C. V. * Copyright (C) 2007 David Hoerl * xlsLib -- A multiplatform, C++ library for dynamic generation of Excel (TM)  * files. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *   * $Source: /cvsroot/xlslib/xlslib/src/xlslib/label.cpp,v $ * $Revision: 1.1.1.1 $ * $Author: darioglz $ * $Date: 2004/08/27 16:31:53 $ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * File description: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */#include "label.h"using namespace std;using namespace xlslib_core;/*******************************CLabel class implementation*******************************/CLabel::CLabel(unsigned16_t row,	  	       unsigned16_t col,	  	       string& strlabel,	  	       xf_t* pxfval){   SetRecordType(RECTYPE_LABEL);   AddValue16(row);   AddValue16(col);   unsigned16_t xfindex;   if(pxfval != NULL)      xfindex = pxfval->GetIndex();   else      xfindex = 0x000f;   AddValue16(xfindex);	     signed16_t labelsize = strlabel.size();   AddValue16((unsigned16_t)labelsize);   AddDataArray((unsigned8_t*)strlabel.c_str(), strlabel.size());	   SetRecordLength(GetDataSize()-4);}CLabel::CLabel(label_t& labeldef){   SetRecordType(RECTYPE_LABEL);   AddValue16(labeldef.GetRow());   AddValue16(labeldef.GetCol());   AddValue16(labeldef.GetXFIndex());	   signed16_t labelsize = labeldef.GetStrLabelSize() ;   AddValue16((unsigned16_t)labelsize);   AddDataArray(labeldef.GetStrLabelBuffer(), labelsize);	   SetRecordLength(GetDataSize()-4);}CLabel::~CLabel(){}/*******************************label_t class implementation*******************************/xlslib_core::label_t::label_t(unsigned16_t rowval, unsigned16_t colval,  		 string& labelstrval, xf_t* pxfval){   row = rowval;   col = colval;   if(pxfval != NULL)      pxfval->MarkUsed();   pxf = pxfval;   if(labelstrval.size() > 255)   {      labelstrval.resize(255);      labelstrval[252] = '.';       labelstrval[253] = '.';       labelstrval[254] = '.';    }   strlabel = labelstrval;}/**************************************************************/unsigned16_t xlslib_core::label_t::GetSize() {   unsigned16_t size = 0;   size += 12; // Minimal label's size   size += strlabel.size();	     return size;}/**************************************************************/CUnit* xlslib_core::label_t::GetData(){   CUnit* datalabel =       (CUnit*)( new CLabel(row,col,strlabel,pxf));   return datalabel; // NOTE: this pointer HAS to be deleted elsewhere.}/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $Log: label.cpp,v $ * Revision 1.1.1.1  2004/08/27 16:31:53  darioglz * Initial Import. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -