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

📄 globalrec.cpp

📁 xls文件格式分析基础库
💻 CPP
📖 第 1 页 / 共 3 页
字号:
/**********************************************************************************/CGlobalRecords::~CGlobalRecords(){   // Delete dinamically created lists elements      if(!m_Fonts.empty())   {      for(Font_Set_Itor_t fnt = m_Fonts.begin(); fnt != m_Fonts.end(); fnt++)         delete *fnt;      m_Fonts.clear();   }   if(!m_DefaultFonts.empty())   {      do      {	 delete m_DefaultFonts.front();	 m_DefaultFonts.pop_front();            }while(!m_DefaultFonts.empty());   }   if(!m_Formats.empty())   {      do      {         delete m_Formats.front();         m_Formats.pop_front();               }while(!m_Formats.empty());   }   if(!m_DefaultXFs.empty())      {      do      {	 delete m_DefaultXFs.front();	 m_DefaultXFs.pop_front();            }while(!m_DefaultXFs.empty());   }   if(!m_XFs.empty())   {      for(XF_Set_Itor_t xf = m_XFs.begin(); xf != m_XFs.end(); xf++)         delete *xf;      m_XFs.clear();   }   if(!m_Styles.empty())   {      do      {	 delete m_Styles.front();	 m_Styles.pop_front();            }while(!m_Styles.empty());   }   if(!m_BoundSheets.empty())   {      do      {	 delete m_BoundSheets.front();	 m_BoundSheets.pop_front();            }while(!m_BoundSheets.empty());   }}/**********************************************************************************/CUnit* CGlobalRecords::DumpData(bool reset){   if(reset)   {      m_DumpState = GLOBAL_INIT;      //Delete_Pointer(m_pCurrentData);   }   XTRACE("CGlobalRecords::DumpData");   bool repeat = false;   do   {         switch(m_DumpState)      {         case GLOBAL_INIT:            font = m_Fonts.begin();                    font_dflt = m_DefaultFonts.begin();                    format = m_Formats.begin();                xf = m_XFs.begin();                        xf_dflt = m_DefaultXFs.begin();                        next_xfindex = 0;            next_formatindex = 0;            next_fontindex = 0;            style = m_Styles.begin();                  bsheet = m_BoundSheets.begin();            m_DumpState = GLOBAL_BOF;            repeat = true;            break;         case GLOBAL_BOF: // ********** STATE 1 *************            XTRACE("\tBOF");            repeat = false;            //MSVC            // Delete_Pointer(m_pCurrentData);            m_pCurrentData = (CUnit*)(new CBof(BOF_TYPE_WBGLOBALS));            m_DumpState = GLOBAL_WINDOW1;            break;         case GLOBAL_WINDOW1: // ********** STATE 2 *************            XTRACE("\tWINFOW1");            //Delete_Pointer(m_pCurrentData);            m_pCurrentData = (CUnit*)(new CWindow1());            m_DumpState = GLOBAL_DEFAULTFONTS;            break;         case GLOBAL_DEFAULTFONTS:// ********** STATE 3A *************         {            repeat = false;            XTRACE("\tDEFAULTFONTS");                        // According documentation, for backwards            // compatibility, there is no index 4.            if(next_fontindex==4) next_fontindex++;            (*font_dflt)->SetIndex(next_fontindex);            next_fontindex++;            m_pCurrentData = (CUnit*)(new CFont(*font_dflt));            if(font_dflt != (--m_DefaultFonts.end()))            {// if it was'nt the last font from the list, increment to get the next one               font_dflt++;            }            else            {// if it was the last from the list, change the DumpState               m_DumpState = GLOBAL_FONTS;               font_dflt = m_DefaultFonts.begin();            }            break;         }         case GLOBAL_FONTS:// ********** STATE 3B *************         {            repeat = false;            XTRACE("\tFONTS");            if(!m_Fonts.empty())            {// First check if the list of fonts is not empty...                           if((*font)->IsUsed())               {                  // According documentation, for backwards                  // compatibility, there is no index 4.                  if(next_fontindex==4) next_fontindex++;                  (*font)->SetIndex(next_fontindex);                  next_fontindex++;                  m_pCurrentData = (CUnit*)(new CFont(*font));               }               else               {                  repeat = true;               }               if(font != (--m_Fonts.end()))               {// if it was'nt the last font from the list, increment to get the next one                  font++;               }               else               {// if it was the last from the list, change the DumpState                  m_DumpState = GLOBAL_FORMATS;                  font = m_Fonts.begin();               }            }            else            {// if the list is empty, change the dump state.               m_DumpState = GLOBAL_FORMATS;               //font = m_Fonts.begin();               repeat = true;            }            break;         }         case GLOBAL_FORMATS: // ********** STATE 4 *************         {            repeat = false;            XTRACE("\tFORMATS");            if(!m_Formats.empty())            {// First check if the list of fonts is not empty...                           if(/*(*format)->IsUsed()*/true)               {                  if((*format)->GetIndex()!=0)                     next_formatindex = (*format)->GetIndex();                  (*format)->SetIndex(next_formatindex);                  next_formatindex++;                  m_pCurrentData = (CUnit*)(new CFormat(*format));               }               else               {                  repeat = true;               }                                    if(format != (--m_Formats.end()))               {// if it was'nt the last font from the list, increment to get the next one                  format++;               }               else               {// if it was the last from the list, change the DumpState                  m_DumpState = GLOBAL_DEFAULTXFS;                  format = m_Formats.begin();               }            }            else            {// if the list is empty, change the dump state.               m_DumpState = GLOBAL_DEFAULTXFS;               // format = m_Formats.begin();               repeat = true;            }            break;         }         case GLOBAL_DEFAULTXFS: // ********** STATE 5a *************         {            repeat = false;            XTRACE("\tXDEFAULTFS");            (*xf_dflt)->SetIndex(next_xfindex);            next_xfindex++;            m_pCurrentData = (CUnit*)(new CExtFormat(*xf_dflt));            if(xf_dflt != (--m_DefaultXFs.end()))            {// if it was'nt the last font from the list, increment to get the next one               xf_dflt++;            }            else            {// if it was the last from the list, change the DumpState               m_DumpState = GLOBAL_XFS;               xf_dflt = m_DefaultXFs.begin();            }            break;         }         case GLOBAL_XFS: // ********** STATE 5b *************         {            repeat = false;            XTRACE("\tXFS");            if(!m_XFs.empty())            {// First check if the list of fonts is not empty...               if((*xf)->IsUsed())               {                  (*xf)->SetIndex(next_xfindex);                  next_xfindex++;                  m_pCurrentData = (CUnit*)(new CExtFormat(*xf));               }               else               {                  repeat = true;               }               if(xf != (--m_XFs.end()))               {// if it was'nt the last font from the list, increment to get the next one                  xf++;               }               else               {// if it was the last from the list, change the DumpState                  m_DumpState = GLOBAL_STYLES;                  xf = m_XFs.begin();               }            }            else            {// if the list is empty, change the dump state.               m_DumpState = GLOBAL_STYLES;               //xf = m_XFs.begin();               repeat = true;            }            break;         }         case GLOBAL_STYLES: // ********** STATE 6 *************         {            XTRACE("\tSTYLES");            repeat = false;            if(!m_Styles.empty())            {// First check if the list of fonts is not empty...

⌨️ 快捷键说明

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