/***************************************************************************
                          SIMPLY POWERFUL TOOLKIT (SPTK)
                          CExcelStyle.cpp  -  description
                             -------------------
    begin                : Tue Apr 6 2004
    copyright            : (C) 2000-2005 by Alexey S.Parshin
    email                : alexeyp@gmail.com
 ***************************************************************************/

/***************************************************************************
   This library is free software; you can redistribute it and/or modify it 
   under the terms of the GNU Library General Public License as published by
   the Free Software Foundation; either version 2 of the License, or (at 
   your option) any later version.

   This library 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 Library
   General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; if not, write to the Free Software Foundation, 
   Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

   Please report all bugs and problems to "alexeyp@gmail.com"
 ***************************************************************************/

#include <string.h>

#include <sptk3/excel/CExcelRecord.h>
#include <sptk3/excel/CExcelStyle.h>

CExcelStyle::CExcelStyle(const char *buffer) {
   if (!buffer)
      memset(m_buffer,0,4);
   else memcpy(m_buffer,buffer,4); 
}

CExcelStyle::CExcelStyle(const CExcelStyle& st) {
   memcpy(m_buffer,st.m_buffer,4); 
}

void CExcelStyle::set(const char *buffer) { 
   memcpy(m_buffer,buffer,4); 
}

void CExcelStyle::ixfe(unsigned index) {
   CExcelRecord::setshort(m_buffer,0,index);
}

unsigned CExcelStyle::ixfe() const {
   return CExcelRecord::getshort(m_buffer,0);
}

void CExcelStyles::init() {
   clear();
#ifdef _DEBUG
   push_back(CExcelStyle("\x10\x80\x3\xFF"));
   push_back(CExcelStyle("\x11\x80\x6\xFF"));
   push_back(CExcelStyle("\x12\x80\x4\xFF"));
   push_back(CExcelStyle("\x13\x80\x7\xFF"));
   push_back(CExcelStyle("\x0\x80\x0\xFF"));
   push_back(CExcelStyle("\x14\x80\x5\xFF"));
#endif
}
