From da50f1355f4cc7cdec8fac460a80cb36291beddb Mon Sep 17 00:00:00 2001 From: "Elen.Subbotina" Date: Tue, 18 Aug 2015 11:18:03 +0000 Subject: [PATCH] XlsFile2 linux build git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64120 954022d7-b5bf-4e40-9824-e11837661b57 --- ASCOfficeXlsFile2/linux/XlsFileConverter.cpp | 23 +- ASCOfficeXlsFile2/linux/XlsFileConverter.pro | 25 +- .../source/XlsFormat/Auxiliary/HelpFunc.cpp | 242 ++++++++++++------ .../source/XlsFormat/Auxiliary/HelpFunc.h | 1 - .../source/XlsFormat/Binary/CFRecord.cpp | 34 --- .../source/XlsFormat/Binary/CFRecord.h | 75 ++++-- .../XlsFormat/Logic/Biff_records/CodePage.h | 4 - .../source/XlsFormat/Logic/Biff_records/DSF.h | 7 - .../XlsFormat/Logic/Biff_records/SupBook.cpp | 2 +- .../Logic/Biff_structures/BiffString.cpp | 19 -- .../Logic/Biff_structures/BiffString.h | 3 - .../Logic/Biff_structures/ExtRst.cpp | 28 +- .../Logic/Biff_structures/FileMoniker.cpp | 21 -- .../ODRAW/OfficeArtColorMRUContainer.cpp | 20 +- .../Logic/Biff_structures/PropertyBag.cpp | 24 +- .../Logic/Biff_structures/PropertyBag.h | 7 +- .../XlsFormat/Logic/Biff_structures/SerAr.cpp | 17 +- .../XlsFormat/Logic/Biff_structures/SerAr.h | 9 + .../XlsFormat/Logic/Biff_structures/SerBool.h | 6 +- .../Logic/Biff_structures/SerErr.cpp | 2 +- .../XlsFormat/Logic/Biff_structures/SerErr.h | 5 +- .../Logic/Biff_structures/SerNil.cpp | 2 +- .../XlsFormat/Logic/Biff_structures/SerNil.h | 6 +- .../Logic/Biff_structures/SerNum.cpp | 2 +- .../XlsFormat/Logic/Biff_structures/SerNum.h | 7 +- .../Logic/Biff_structures/SerStr.cpp | 2 +- .../XlsFormat/Logic/Biff_structures/SerStr.h | 8 +- .../source/XlsFormat/Logic/BinProcessor.h | 2 +- .../Structures/PropertyFactory.cpp | 6 +- .../Structures/PropertySet.cpp | 6 +- .../XlsFormat/Logic/WorkbookStreamObject.h | 4 +- .../source/linux/XlsFormatLib.pro | 16 +- 32 files changed, 308 insertions(+), 327 deletions(-) diff --git a/ASCOfficeXlsFile2/linux/XlsFileConverter.cpp b/ASCOfficeXlsFile2/linux/XlsFileConverter.cpp index 8b8247988c..a6da74d26c 100644 --- a/ASCOfficeXlsFile2/linux/XlsFileConverter.cpp +++ b/ASCOfficeXlsFile2/linux/XlsFileConverter.cpp @@ -1,9 +1,13 @@ -#include "../DocFormatLib/DocFormatLib.h" +#include "../source/XlsXlsxConverter/ConvertXls2Xlsx.h" -#include "../Win32/ASCOfficeCriticalSection.h" +#if defined(_WIN32) || defined(_WIN64) + #include +#else + #include "../../DesktopEditor/common/ASCVariant.h" +#endif #include -#include "../Win32/version.h" +#include "../version.h" static std::wstring utf8_to_unicode(const char *src) { @@ -39,7 +43,6 @@ static std::wstring utf8_to_unicode(const char *src) return wsEntryName; } -ASCOfficeCriticalSection g_oCriticalSection; int main(int argc, char *argv[]) { @@ -51,28 +54,26 @@ int main(int argc, char *argv[]) std::cout << std::endl; std::cout << std::endl; std::cout << "-------------------------------------------------------------------------------" << std::endl; - std::cout << "\t\tDoc/Docx file converter. Version: " << STRVER << std::endl; + std::cout << "\t\tXls/Xlsx file converter. Version: " << STRVER << std::endl; std::cout << "-------------------------------------------------------------------------------" << std::endl; std::cout << std::endl; - std::cout << "USAGE: ASCDocConverter \"path_to_file_1\" \"path_to_file_2\" " << std::endl; + std::cout << "USAGE: ASCXlsConverter \"path_to_file_1\" \"path_to_file_2\" " << std::endl; std::cout << "WHERE:" << std::endl; std::cout << "\t\"path_to_file_1\" is a path to file to be converted" << std::endl; std::cout << "\t\"path_to_file_2\" is a path to the corresponding output file" << std::endl << std::endl; return 1; } - CString sArg1, sArg2, sExePath; + std::wstring sArg1, sArg2, sExePath; sExePath = utf8_to_unicode(argv [0]); sArg1 = utf8_to_unicode(argv [1]); sArg2 = utf8_to_unicode(argv [2]); - CString sXMLOptions = _T(""); + {// xls->xlsx - {// doc->docx - COfficeDocFile docFile; - HRESULT hRes = docFile.LoadFromFile(sArg1, sArg2, sXMLOptions); + HRESULT hRes = ConvertXls2Xlsx(sArg1, sArg2, NULL); if (hRes != S_OK)return 2; diff --git a/ASCOfficeXlsFile2/linux/XlsFileConverter.pro b/ASCOfficeXlsFile2/linux/XlsFileConverter.pro index 242c4c82a2..c70f418201 100644 --- a/ASCOfficeXlsFile2/linux/XlsFileConverter.pro +++ b/ASCOfficeXlsFile2/linux/XlsFileConverter.pro @@ -5,7 +5,6 @@ #------------------------------------------------- QT -= core - QT -= gui QMAKE_CXXFLAGS += -std=c++11 -Wall -Wno-ignored-qualifiers @@ -17,8 +16,9 @@ DEFINES += UNICODE \ TARGET = ASCXlsConverter -CONFIG += console -CONFIG -= app_bundle +CONFIG += console +CONFIG -= app_bundle +CONFIG += c++11 TEMPLATE = app @@ -26,7 +26,12 @@ INCLUDEPATH += \ /usr/include/libxml2 SOURCES += \ - XlsFileConverter.cpp + XlsFileConverter.cpp \ + ../../Common/DocxFormat/Source/Base/unicode_util.cpp \ + ../../Common/3dParty/pole/pole.cpp \ + ../../Common/DocxFormat/Source/SystemUtility/FileSystem/FilePosix.cpp \ + ../../Common/DocxFormat/Source/SystemUtility/FileSystem/DirectoryPosix.cpp \ + ../../Common/DocxFormat/Source/XML/stringcommon.cpp linux-g++{ @@ -36,8 +41,8 @@ linux-g++{ unix:!macx: LIBS += -L$$PWD/../../SDK/lib/linux_64/ -lXlsFormatLib unix:!macx: PRE_TARGETDEPS += $$PWD/../../SDK/lib/linux_64/libXlsFormatLib.a - unix:!macx: LIBS += -L$$PWD/../../SDK/lib/linux_64/ -lgraphics - unix:!macx: PRE_TARGETDEPS += $$PWD/../../SDK/lib/linux_64/libgraphics.a + LIBS += -L$$PWD/../../SDK/lib/linux_64/ -lgraphics + LIBS += -L$$PWD/../../SDK/lib/linux_64/ -lASCOfficeUtilsLib } else{ @@ -47,8 +52,12 @@ else{ unix:!macx: LIBS += -L$$PWD/../../SDK/lib/linux_32/ -lXlsFormatLib unix:!macx: PRE_TARGETDEPS += $$PWD/../../SDK/lib/linux_32/libXlsFormatLib.a - unix:!macx: LIBS += -L$$PWD/../../SDK/lib/linux_32/ -lgraphics - unix:!macx: PRE_TARGETDEPS += $$PWD/../../SDK/lib/linux_32/libgraphics.a + LIBS += -L$$PWD/../../SDK/lib/linux_32/ -lgraphics + LIBS += -L$$PWD/../../SDK/lib/linux_32/ -lASCOfficeUtilsLib } +LIBS += -lboost_regex +LIBS += -lz +LIBS += -lxml2 +LIBS += -lcurl diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp index 7ebce7b46f..21023c0f04 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.cpp @@ -1,15 +1,21 @@ #include "HelpFunc.h" -#include "shlwapi.h" + +#if defined (_WIN32) || defined (_WIN64) + #include "shlwapi.h" +#else + #include +#endif #include + #include #include #include namespace AUX -{; +{ const int normalizeColumn(const int column) { @@ -125,20 +131,23 @@ const bool str2rel(std::wstring::const_iterator& str_begin, std::wstring::const_ return true; } +void str2loc(std::wstring::const_iterator& str_begin, std::wstring::const_iterator& str_end, long& row, bool& row_rel, long& column, bool& col_rel) +{ + col_rel = str2rel (str_begin, str_end); + column = str2column (str_begin, str_end); + row_rel = str2rel (str_begin, str_end); + row = str2row (str_begin, str_end); +} void str2loc(const std::wstring& str, long& row, bool& row_rel, long& column, bool& col_rel) { - str2loc(str.begin(), str.end(), row, row_rel, column, col_rel); + std::wstring::const_iterator str_begin = str.begin(); + std::wstring::const_iterator str_end = str.end(); + + str2loc(str_begin, str_end, row, row_rel, column, col_rel); } -void str2loc(std::wstring::const_iterator& str_begin, std::wstring::const_iterator& str_end, long& row, bool& row_rel, long& column, bool& col_rel) -{ - col_rel = str2rel(str_begin, str_end); - column = str2column(str_begin, str_end); - row_rel = str2rel(str_begin, str_end); - row = str2row(str_begin, str_end); -} void str2refs(const std::wstring& str, std::vector& vec) @@ -167,16 +176,24 @@ namespace STR const std::string int2str(const int val, const int radix) { - static char num_buf[10]; - _itoa_s(val, num_buf, 9, radix); - return num_buf; + static char num_buf[10]={}; +#if defined(_WIN64) || defined(_WIN64) + _itoa_s(val, num_buf, 9, radix); +#else + sprintf( num_buf, "%d", val); +#endif + return num_buf; } const std::wstring int2wstr(const int val, const int radix) { - static wchar_t num_buf[10]; - _itow_s(val, num_buf, 9, radix); + static wchar_t num_buf[10]={}; +#if defined(_WIN64) || defined(_WIN64) + _itow_s(val, num_buf, 9, radix); +#else + wprintf( num_buf, "%d", val); +#endif return num_buf; } @@ -205,16 +222,20 @@ const std::string bin2str(const char* buf, const size_t nbuf) const std::wstring guid2bstr(const _GUID_ guid) { - //todooooo + std::wstring guid_ret; +#if defined(_WIN64) || defined(_WIN64) + LPOLESTR guid_str; + if(S_OK != StringFromIID(guid, &guid_str)) + { + // The only case is E_OUTOFMEMORY, so just throw anything + throw;// EXCEPT::LE::WhatIsTheFuck("StringFromIID failed.", "guid2bstr"); + } + guid_ret = guid_str; + CoTaskMemFree(guid_str); +#else + //todooooo - //LPOLESTR guid_str; - //if(S_OK != StringFromIID(guid, &guid_str)) - //{ - // // The only case is E_OUTOFMEMORY, so just throw anything - // throw;// EXCEPT::LE::WhatIsTheFuck("StringFromIID failed.", "guid2bstr"); - //} - std::wstring guid_ret;// = guid_str; - //CoTaskMemFree(guid_str); +#endif return guid_ret; } @@ -228,30 +249,38 @@ const std::string guid2str(const _GUID_ guid) const bool bstr2guid(const std::wstring & guid_str, _GUID_& guid) { - //todoooo - //HRESULT res = IIDFromString((LPWSTR)(guid_str.c_str()), &guid); - //if(S_OK != res) - //{ - // switch(res) - // { - // case E_INVALIDARG: - // return false; - // case E_OUTOFMEMORY: - // throw;// EXCEPT::LE::WhatIsTheFuck("IIDFromString failed.", "bstr2guid"); - // } - //} +#if defined(_WIN64) || defined(_WIN64) + HRESULT res = IIDFromString((LPWSTR)(guid_str.c_str()), &guid); + if(S_OK != res) + { + switch(res) + { + case E_INVALIDARG: + return false; + case E_OUTOFMEMORY: + throw;// EXCEPT::LE::WhatIsTheFuck("IIDFromString failed.", "bstr2guid"); + } + } +#else + //todooooo + +#endif + return true; } const std::wstring int2hex_wstr(const int val, const size_t size_of) { - static wchar_t num_buf[10]; - if(size_of > 4) - { - return L""; - } - swprintf_s(num_buf, 9, (L"%0" + STR::int2wstr(size_of << 1, 10) + L"X").c_str(), val); + if(size_of > 4) return L""; + + static wchar_t num_buf[10]={}; +#if defined(_WIN64) || defined(_WIN64) + swprintf_s(num_buf, 9, (L"%0" + STR::int2wstr(size_of << 1, 10) + L"X").c_str(), val); +#else + //todooooo + +#endif return std::wstring(num_buf); } @@ -270,25 +299,6 @@ const std::wstring wchar_t2hex_str(const wchar_t val) } -const std::wstring escapeUrlW(const std::wstring& str) -{ - wchar_t dumb[2]; - DWORD buffer_size = 1; - HRESULT res = UrlEscapeW(str.c_str(), dumb, &buffer_size, 0); - if (0 == buffer_size) - { - return L""; - } - - wchar_t* buffer = new wchar_t[buffer_size + 1]; - res = UrlEscapeW(str.c_str(), buffer, &buffer_size, 0); - - std::wstring ret_val(buffer); - delete[] buffer; - return ret_val; -} - - static boost::wregex match_hex(L"^_x[0-9A-F]{4}_"); const std::wstring escape_ST_Xstring(const std::wstring& wstr) { @@ -321,9 +331,14 @@ const std::wstring unescape_ST_Xstring(const std::wstring& wstr) std::wstring::const_iterator x_pos_next;// = wstr.begin(); std::wstring::const_iterator wstr_end = wstr.end(); std::wstring ret_val = L""; - while(wstr_end != (x_pos_next = boost::algorithm::find_first(boost::make_iterator_range(x_pos_noncopied, wstr_end), L"_x").begin())) + + while(true) { - if(!boost::regex_search(x_pos_next, wstr_end, match_hex)) + const auto it_range = boost::make_iterator_range(x_pos_noncopied, wstr_end); + x_pos_next = boost::algorithm::find_first(it_range, L"_x").begin(); + + if ( wstr_end == x_pos_next) break; + if(!boost::regex_search(x_pos_next, wstr_end, match_hex)) { x_pos_next += 2; ret_val.append(x_pos_noncopied, x_pos_next); @@ -400,25 +415,100 @@ const size_t hex_str2int(const std::wstring::const_iterator& it_begin, const std const std::string toStdString(const std::wstring& wide_string, const unsigned int code_page) { - //todooo linux - e !!! - unsigned int bufferSize = (unsigned int)wide_string.length() + 1; - boost::scoped_array pBuffer(new char[bufferSize]); - WideCharToMultiByte(code_page, 0, wide_string.c_str(), (int)wide_string.length(), pBuffer.get(), bufferSize, NULL, NULL); - pBuffer[bufferSize - 1] = '\0'; - return pBuffer.get(); +#if defined (_WIN32) || defined (_WIN64) + const int nSize = WideCharToMultiByte(code_page, 0, wide_string.c_str(), wide_string.length(), NULL, 0, NULL, NULL); + char *sTemp = new char[nSize]; + if (!sTemp) + return std::string(); + + int size = WideCharToMultiByte(code_page, 0, wide_string.c_str(), wide_string.length(), sTemp, nSize, NULL, NULL); + + std::string sResult(sTemp, size); + delete []sTemp; + + return sResult; +#else + std::string out; + bool ansi = true; + + size_t insize = wide_string.length(); + out.reserve(insize); + + char *inptr = (char*)wide_string.c_str(); + char* outptr = (char*)out.c_str(); + + if (code_page >= 0) + { + std::string sCodepage = "CP" + std::to_string(code_page); + + iconv_t ic= iconv_open(sCodepage.c_str(), "WCHAR_T"); + if (ic != (iconv_t) -1) + { + size_t nconv = 0, avail = insize * sizeof(wchar_t); + + nconv = iconv (ic, &inptr, &insize, &outptr, &avail); + if (nconv == 0) ansi = false; + iconv_close(ic); + } + } + + if (ansi) + out = std::string(wide_string.begin(), wide_string.end()); + + return out; + +#endif } const std::wstring toStdWString(const std::string& ansi_string, const unsigned int code_page) { - //todooo linux - e !!! - unsigned int bufferSize = (unsigned int)ansi_string.length() + 1; - boost::scoped_array pBuffer(new wchar_t[bufferSize]); - unsigned int code = code_page == 1251 ? 1252 : code_page ; +#if defined (_WIN32) || defined (_WIN64) + const int nSize = MultiByteToWideChar(code_page, 0, ansi_string.c_str(), ansi_string.size(), NULL, 0); - MultiByteToWideChar(/*code_page*/code, 0, ansi_string.c_str(), (int)ansi_string.length(), pBuffer.get(), bufferSize); - pBuffer[bufferSize - 1] = L'\0'; - return pBuffer.get(); + wchar_t *sTemp = new wchar_t[nSize]; + if (!sTemp) + return std::wstring(); + + int size = MultiByteToWideChar(code_page, 0, ansi_string.c_str(), ansi_string.size(), sTemp, nSize); + + std::wstring sResult(sTemp, size); + delete []sTemp; + + return sResult; +#else + bool ansi = true; + + size_t insize = ansi_string.length(); + std::wstring w_out; + + w_out.reserve(insize); + + char *inptr = (char*)ansi_string.c_str(); + char* outptr = (char*)w_out.c_str(); + + if (code_page >= 0) + { + std::string sCodepage = "CP" + std::to_string(code_page); + + iconv_t ic= iconv_open("WCHAR_T", sCodepage.c_str()); + if (ic != (iconv_t) -1) + { + size_t nconv = 0, avail = (insize) * sizeof(wchar_t); + + nconv = iconv (ic, &inptr, &insize, &outptr, &avail); + if (nconv == 0) + { + ansi = false; + } + iconv_close(ic); + } + } + if (ansi) + w_out = std::wstring(ansi_string.begin(), ansi_string.end()); + + return w_out; +#endif } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.h b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.h index ad360a2957..793b9f9770 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Auxiliary/HelpFunc.h @@ -41,7 +41,6 @@ namespace STR const bool bstr2guid(const std::wstring & guid_str, _GUID_& guid); const std::wstring int2hex_wstr(const int val, const size_t size_of = 4); const std::wstring wchar_t2hex_str(const wchar_t val); - const std::wstring escapeUrlW(const std::wstring& str); const std::wstring escape_ST_Xstring(const std::wstring& str); const std::wstring unescape_ST_Xstring(const std::wstring& str); const std::wstring toARGB(const unsigned int rgba); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.cpp index 2c1cb61339..223c6f6235 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.cpp @@ -9,40 +9,6 @@ namespace XLS { - template - CFRecord& operator<<(CFRecord& record, std::vector& vec) - { - for(typename std::vector::iterator it = vec.begin(); it != vec.end(); ++it) - { - record << *it; - } - return record; - } - - template - CFRecord& operator>>(CFRecord & record, std::basic_string, std::allocator >& str) - { - str.clear(); - T symbol; - do - { - record.loadAnyData(symbol); - str += symbol; - } while (symbol); - return record; - } - - template - CFRecord& operator<<(CFRecord & record, std::basic_string, std::allocator >& str) - { - for(typename std::basic_string, std::allocator >::iterator it = str.begin(); it != str.end(); ++it) - { - record << *it; - } - record.storeAnyData(static_cast(0)); - return record; - } - char CFRecord::intData[MAX_RECORD_SIZE]; // Create a record and read its data from the stream diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.h b/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.h index d483a4f27e..054c4f64ad 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Binary/CFRecord.h @@ -111,27 +111,27 @@ public: GlobalWorkbookInfoPtr getGlobalWorkbookInfo() { return global_info_; } - CFRecord& operator>>(unsigned char& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(unsigned short& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(long& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(double& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(_GUID_& val) { loadAnyData(val); return *this; }; - //CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(short& val) { loadAnyData(val); return *this; }; - CFRecord& operator>>(char& val) { loadAnyData(val); return *this; }; + CFRecord& operator>>(unsigned char& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(unsigned short& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(long& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(double& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(_GUID_& val) { loadAnyData(val); return *this; } + //CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(short& val) { loadAnyData(val); return *this; } + CFRecord& operator>>(char& val) { loadAnyData(val); return *this; } CFRecord& operator>>(bool& val); - CFRecord& operator<<(unsigned char& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(unsigned short& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(long& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(double& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(_GUID_& val) { storeAnyData(val); return *this; }; - //CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(short& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(char& val) { storeAnyData(val); return *this; }; - CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; }; + CFRecord& operator<<(unsigned char& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(unsigned short& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(long& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(double& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(_GUID_& val) { storeAnyData(val); return *this; } + //CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(short& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(char& val) { storeAnyData(val); return *this; } + CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; } CFRecord& operator<<(bool& val); private: @@ -153,7 +153,6 @@ private: GlobalWorkbookInfoPtr global_info_; }; -// moved out of the class to be higher in priority than the universal operator template CFRecord& operator>>(CFRecord& record, std::vector& vec) { @@ -166,17 +165,41 @@ CFRecord& operator>>(CFRecord& record, std::vector& vec) return record; } +template +CFRecord& operator<<(CFRecord& record, std::vector& vec) +{ + for(typename std::vector::iterator it = vec.begin(), itEnd = vec.end(); it != itEnd; ++it) + { + record << *it; + } + return record; +} template -CFRecord& operator<<(CFRecord& record, std::vector& vec); +CFRecord& operator>>(CFRecord & record, std::basic_string, std::allocator >& str) +{ + str.clear(); + T symbol; + do + { + record.loadAnyData(symbol); + str += symbol; + } while (symbol); + return record; +} + template -CFRecord& operator>>(CFRecord & record, std::basic_string, std::allocator >& str); - -template -CFRecord& operator<<(CFRecord & record, std::basic_string, std::allocator >& str); - +CFRecord& operator<<(CFRecord & record, std::basic_string, std::allocator >& str) +{ + for(typename std::basic_string, std::allocator >::iterator it = str.begin(), itEnd = str.end(); it != itEnd; ++it) + { + record << *it; + } + record.storeAnyData(static_cast(0)); + return record; +} template CFRecord& operator>>(CFRecord & record, _CP_OPT(T)& val) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CodePage.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CodePage.h index 4c00a09499..4881cf1d5c 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CodePage.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/CodePage.h @@ -21,10 +21,6 @@ public: void readFields(CFRecord& record); //----------------------------- BIFF_WORD cv; -public: - //BO_ATTRIB_MARKUP_BEGIN - //BO_ATTRIB_MARKUP_ATTRIB(cv) - //BO_ATTRIB_MARKUP_END }; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DSF.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DSF.h index f5c22ab3bb..74d7644ef7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DSF.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/DSF.h @@ -22,13 +22,6 @@ public: static const ElementType type = typeDSF; -//----------------------------- -// XLUnicodeString userName; -public: - //BO_ATTRIB_MARKUP_BEGIN -// //BO_ATTRIB_MARKUP_ATTRIB(userName) - //BO_ATTRIB_MARKUP_END - }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SupBook.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SupBook.cpp index c65449c70d..84e020543c 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SupBook.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_records/SupBook.cpp @@ -42,7 +42,7 @@ void SupBook::readFields(CFRecord& record) { virtPath.setSize(cch); record >> virtPath; - virtPath.EscapeUrlW(); + //virtPath.EscapeUrlW(); //todooo проверить спец символы !!! //if(virtPath.isConformToVirtPath() && !virtPath.isConformToOleLink()) { record >> rgst; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp index 39e8daf7a0..e1230e8908 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.cpp @@ -160,25 +160,6 @@ const bool BiffString::isConformToVirtPath() const return true; } - - -const std::wstring BiffString::getEscapedUrlW() const -{ - if(!str_.length()) - { - return str_; - } - std::wstring copy_str(str_); - return STR::escapeUrlW(copy_str).c_str(); -} - - -void BiffString::EscapeUrlW() -{ - str_ = getEscapedUrlW(); -} - - const std::wstring BiffString::getEscaped_ST_Xstring() const { if(!str_.length()) diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.h index 73338b844c..54d86f14cc 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/BiffString.h @@ -54,9 +54,6 @@ public: const bool isConformToOleLink() const; const bool isConformToVirtPath() const; - const std::wstring getEscapedUrlW() const; - void EscapeUrlW(); - const std::wstring getEscaped_ST_Xstring() const; void Escape_ST_Xstring(); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExtRst.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExtRst.cpp index 94270ba5a6..80a0f8aa2a 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExtRst.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ExtRst.cpp @@ -11,34 +11,10 @@ BiffStructurePtr ExtRst::clone() return BiffStructurePtr(new ExtRst(*this)); } - -//void ExtRst::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag) -//{ -// xml_tag->setAttribute(L"cb", cb); -// phs.toXML(xml_tag); -// rphssub.toXML(xml_tag); -// std::for_each(rgphruns.begin(), rgphruns.end(), boost::bind(&PhRuns::toXML, _1, xml_tag)); -//} - -//void ExtRst::getXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag) -//{ -// cb = getStructAttribute(xml_tag, L"cb"); -// phs.fromXML(xml_tag); -// rphssub.fromXML(xml_tag); -// -// PhRuns runs; -// size_t number = 0; -// while(runs.fromXML(xml_tag, ++number, false)) -// { -// rgphruns.push_back(runs); -// } -//} -// - void ExtRst::store(CFRecord& record) { - unsigned short reserved = 1; - record << reserved << cb << phs << rphssub << rgphruns; +// unsigned short reserved = 1; +// record << reserved << cb << phs << rphssub << rgphruns; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp index a2b748a88b..1ed132f1e2 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/FileMoniker.cpp @@ -22,27 +22,6 @@ XLS::BiffStructurePtr FileMoniker::clone() return XLS::BiffStructurePtr(new FileMoniker(*this)); } -// -//void FileMoniker::setXMLAttributes(BiffStructurePtr & xml_tag) -//{ -// xml_tag->setAttribute(L"cAnti", cAnti); -// xml_tag->setAttribute(L"ansiPath", ansiPath.c_str()); -// xml_tag->setAttribute(L"endServer", endServer); -// xml_tag->setAttribute(L"versionNumber", versionNumber); -// if(cbUnicodePathSize) -// { -// xml_tag->setAttribute(L"usKeyValue", usKeyValue); -// xml_tag->setAttribute(L"unicodePath", STR::escapeUrlW(unicodePath).c_str()); -// } -//} - - -//void FileMoniker::getXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag) -//{ -//#pragma message("####################### FileMoniker record has no BiffStructure::fromXML() implemented") -// Log::error(" Error!!! FileMoniker record has no BiffStructure::fromXML() implemented."); -//} - void FileMoniker::store(XLS::CFRecord& record) { diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtColorMRUContainer.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtColorMRUContainer.cpp index aa92fccd09..1edbe20135 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtColorMRUContainer.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtColorMRUContainer.cpp @@ -17,27 +17,9 @@ XLS::BiffStructurePtr OfficeArtSplitMenuColorContainer::clone() return XLS::BiffStructurePtr(new OfficeArtSplitMenuColorContainer(*this)); } -// -//void OfficeArtSplitMenuColorContainer::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag) -//{ -// std::for_each(smca.begin(), smca.end(), boost::bind(&MSOCR::toXML, _1, xml_tag)); -//} -// -// -//void OfficeArtSplitMenuColorContainer::getXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag) -//{ -// MSOCR color; -// size_t number = 0; -// while(color.fromXML(xml_tag, ++number, false)) -// { -// smca.push_back(color); -// } -//} - - void OfficeArtSplitMenuColorContainer::storeFields(XLS::CFRecord& record) { - record << smca; +// record << smca; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.cpp index 8e0b5cee95..cc0ca15725 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.cpp @@ -5,29 +5,15 @@ namespace OSHARED { +PropertyBag::PropertyBag() +{ +} XLS::BiffStructurePtr PropertyBag::clone() { return XLS::BiffStructurePtr(new PropertyBag(*this)); } -// -//void PropertyBag::toXML(BiffStructurePtr & parent) -//{ -// MSXML2::IXMLDOMElementPtr own_tag = XMLSTUFF::createElement(getClassName(), parent); -// -// own_tag->setAttribute(L"id", id); -// std::for_each(properties.begin(), properties.end(), boost::bind(&Property::toXML, _1, own_tag)); -//} -// -// -//const bool PropertyBag::fromXML(BiffStructurePtr & parent) -//{ -//#pragma message("####################### PropertyBag record has no BiffStructure::fromXML() implemented") -// Log::error(" Error!!! PropertyBag record has no BiffStructure::fromXML() implemented."); -// return false; -//} - void PropertyBag::store(XLS::CFRecord& record) { @@ -44,8 +30,8 @@ void PropertyBag::load(XLS::CFRecord& record) record.skipNunBytes(2); // ignored for (int i = 0; i < cProp ; i++) { - Property prop; - record >> prop; + OSHARED::SharedProperty prop; + record >> prop; properties.push_back(prop); } } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.h index 25b9d2b086..653c3e6a8d 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/PropertyBag.h @@ -1,7 +1,6 @@ #pragma once -#include "BiffStructure.h" -#include +#include "SharedProperty.h" namespace OSHARED { @@ -12,6 +11,8 @@ class PropertyBag : public XLS::BiffStructure { BASE_STRUCTURE_DEFINE_CLASS_NAME(PropertyBag) public: + PropertyBag(); + XLS::BiffStructurePtr clone(); static const XLS::ElementType type = XLS::typePropertyBag; @@ -20,7 +21,7 @@ public: virtual void store(XLS::CFRecord& record); unsigned short id; - std::vector properties; + std::vector properties; }; } // namespace OSHARED diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp index 53da66aee1..b5530763ae 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.cpp @@ -11,31 +11,24 @@ namespace XLS { - -//void SerAr::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag) -//{ -// xml_tag->Puttext(toString().c_str()); -//} - - // static SerArPtr SerAr::createSerAr(const unsigned char type) { switch(type) { - case SerBool::fixed_type: + case typeSerBool: return SerArPtr(new SerBool); break; - case SerErr::fixed_type: + case typeSerErr: return SerArPtr(new SerErr); break; - case SerNil::fixed_type: + case typeSerNil: return SerArPtr(new SerNil); break; - case SerNum::fixed_type: + case typeSerNum: return SerArPtr(new SerNum); break; - case SerStr::fixed_type: + case typeSerStr: return SerArPtr(new SerStr); break; default: diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.h index a99bdee1d6..6cd140cff9 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerAr.h @@ -11,6 +11,15 @@ typedef boost::shared_ptr SerArPtr; class SerAr : public BiffStructure { public: + enum SerType + { + typeSerNil = 0x00, + typeSerNum = 0x01, + typeSerStr = 0x02, + typeSerBool = 0x04, + typeSerErr = 0x10 + + }; static SerArPtr createSerAr(const unsigned char type); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerBool.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerBool.h index 0b4e18a41d..11e5fcb318 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerBool.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerBool.h @@ -5,8 +5,6 @@ namespace XLS { -class CFRecord; - class SerBool : public SerAr { BASE_STRUCTURE_DEFINE_CLASS_NAME(SerBool) @@ -18,9 +16,9 @@ public: virtual void store(CFRecord& record); virtual const std::wstring toString() const; - static const unsigned char fixed_type = 0x04; private: - unsigned char f; + const SerType fixed_type = typeSerBool; + unsigned char f; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.cpp index 62fd187cee..7bd5e32e6b 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.cpp @@ -25,7 +25,7 @@ BiffStructurePtr SerErr::clone() void SerErr::store(CFRecord& record) { - record.storeAnyData(fixed_type); + record.storeAnyData(fixed_type); record << err; record.reserveNunBytes(7); // reserved/unused } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.h index 7776050532..e6191339d7 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerErr.h @@ -6,8 +6,6 @@ namespace XLS { -class CFRecord; - class SerErr : public SerAr { BASE_STRUCTURE_DEFINE_CLASS_NAME(SerErr) @@ -19,9 +17,10 @@ public: virtual void store(CFRecord& record); virtual const std::wstring toString() const; - static const unsigned char fixed_type = 0x10; private: + const SerType fixed_type = typeSerErr; BErr err; }; + } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.cpp index 048769450b..6dcc706c13 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.cpp @@ -14,7 +14,7 @@ BiffStructurePtr SerNil::clone() void SerNil::store(CFRecord& record) { - record.storeAnyData(fixed_type); + record.storeAnyData(fixed_type); record.skipNunBytes(8); // reserved/unused } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.h index 2d9803392a..68363d82ef 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNil.h @@ -5,8 +5,6 @@ namespace XLS { -class CFRecord; - class SerNil : public SerAr { BASE_STRUCTURE_DEFINE_CLASS_NAME(SerNil) @@ -15,7 +13,9 @@ public: virtual void load(CFRecord& record); virtual void store(CFRecord& record); virtual const std::wstring toString() const; - static const unsigned char fixed_type = 0x00; + +private: + const SerType fixed_type = typeSerNil; }; } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.cpp index 9588ec731e..dc099b8454 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.cpp @@ -30,7 +30,7 @@ BiffStructurePtr SerNum::clone() void SerNum::store(CFRecord& record) { - record.storeAnyData(fixed_type); + record.storeAnyData(fixed_type); record << xnum; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.h index 85497fca24..838ee1a398 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerNum.h @@ -5,8 +5,6 @@ namespace XLS { -class CFRecord; - class SerNum : public SerAr { BASE_STRUCTURE_DEFINE_CLASS_NAME(SerNum) @@ -18,9 +16,10 @@ public: virtual void store(CFRecord& record); virtual const std::wstring toString() const; - static const unsigned char fixed_type = 0x01; private: - double xnum; + const SerType fixed_type = typeSerNum; + double xnum; }; + } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.cpp index 925d14b2a6..dac8b478fe 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.cpp @@ -27,7 +27,7 @@ BiffStructurePtr SerStr::clone() void SerStr::store(CFRecord& record) { - record.storeAnyData(fixed_type); + record.storeAnyData(fixed_type); record << string_; } diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.h index 936d0c5d2e..1783a6eb46 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/SerStr.h @@ -6,8 +6,6 @@ namespace XLS { -class CFRecord; - class SerStr : public SerAr { BASE_STRUCTURE_DEFINE_CLASS_NAME(SerStr) @@ -19,9 +17,11 @@ public: virtual void store(CFRecord& record); virtual const std::wstring toString() const; - static const unsigned char fixed_type = 0x02; private: - XLUnicodeString string_; + const SerType fixed_type = typeSerStr; + XLUnicodeString string_; }; + + } // namespace XLS diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.h index cf664d1524..f7a32a05ec 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/BinProcessor.h @@ -7,7 +7,7 @@ #include "GlobalWorkbookInfo.h" namespace XLS -{; +{ class BiffString; class CFStreamCacheWriter; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp index 798a731087..8091379b22 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp @@ -2,7 +2,7 @@ #include #include "PropertyFactory.h" -#include "CodePage.h" +#include "CodePageOle.h" namespace OLEPS @@ -21,8 +21,8 @@ PropertyPtr PropertyFactory::ReadProperty(const unsigned int prop_type, XLS::CFS switch(prop_type) { - case CodePage::Type: - return PropertyPtr(new CodePage(value_type, stream)); + case CodePageOle::Type: + return PropertyPtr(new CodePageOle(value_type, stream)); default: return PropertyPtr(); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertySet.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertySet.cpp index ead30b312a..bd0cd7e0bc 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertySet.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/Structures/PropertySet.cpp @@ -3,7 +3,7 @@ #include "PropertySet.h" #include #include "PropertyFactory.h" -#include "CodePage.h" +#include "CodePageOle.h" namespace OLEPS @@ -26,7 +26,7 @@ PropertySet::PropertySet(XLS::CFStreamPtr stream, const unsigned int property_se prop_offsets.push_back(prop_offset); } - code_page = CodePage::DefaultCodePage; + code_page = CodePageOle::DefaultCodePage; for(unsigned int i = 0; i < NumProperties; ++i) { PropertyPtr next_property = PropertyFactory::ReadProperty(prop_offsets[i].PropertyIdentifier, stream, property_set_offset + prop_offsets[i].Offset); @@ -34,7 +34,7 @@ PropertySet::PropertySet(XLS::CFStreamPtr stream, const unsigned int property_se { properties.push_back(next_property); - CodePagePropertyPtr code_page_property = boost::dynamic_pointer_cast(next_property); + CodePagePropertyPtr code_page_property = boost::dynamic_pointer_cast(next_property); if(code_page_property) { code_page = code_page_property->GetCodePage(); diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/WorkbookStreamObject.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/WorkbookStreamObject.h index 678ed34cd7..2944180697 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/WorkbookStreamObject.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/WorkbookStreamObject.h @@ -1,7 +1,7 @@ #pragma once #include "CompositeObject.h" -#include "SummaryInformationStream/Structures/CodePage.h" +#include "SummaryInformationStream/Structures/CodePageOle.h" #include "GlobalWorkbookInfo.h" namespace XLS @@ -21,7 +21,7 @@ public: virtual const bool loadContent(BinProcessor& proc); - static const unsigned short DefaultCodePage = OLEPS::CodePage::DefaultCodePage; + static const unsigned short DefaultCodePage = OLEPS::CodePageOle::DefaultCodePage; void set_code_page(const unsigned short code_page); diff --git a/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro b/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro index 35b016118e..1d1c1933dd 100644 --- a/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro +++ b/ASCOfficeXlsFile2/source/linux/XlsFormatLib.pro @@ -516,7 +516,6 @@ SOURCES += \ ../XlsFormat/Logic/Biff_structures/Phs.cpp \ ../XlsFormat/Logic/Biff_structures/PictFmlaEmbedInfo.cpp \ ../XlsFormat/Logic/Biff_structures/PictFmlaKey.cpp \ - ../XlsFormat/Logic/Biff_structures/Property.cpp \ ../XlsFormat/Logic/Biff_structures/PropertyBag.cpp \ ../XlsFormat/Logic/Biff_structures/PropertyBagStore.cpp \ ../XlsFormat/Logic/Biff_structures/Ptg.cpp \ @@ -777,7 +776,6 @@ SOURCES += \ ../XlsFormat/Logic/Biff_unions/UNKNOWNFRT.cpp \ ../XlsFormat/Logic/Biff_unions/WINDOW.cpp \ ../XlsFormat/Logic/Biff_unions/XFS.cpp \ - ../XlsFormat/Logic/SummaryInformationStream/Structures/CodePage.cpp \ ../XlsFormat/Logic/SummaryInformationStream/Structures/Property.cpp \ ../XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.cpp \ ../XlsFormat/Logic/SummaryInformationStream/Structures/PropertySet.cpp \ @@ -810,7 +808,11 @@ SOURCES += \ ../XlsFormat/Logic/GlobalWorkbookInfo.cpp \ ../XlsFormat/Logic/MacroSheetSubstream.cpp \ ../XlsFormat/Logic/WorkbookStreamObject.cpp \ - ../XlsFormat/Logic/WorksheetSubstream.cpp + ../XlsFormat/Logic/WorksheetSubstream.cpp \ + ../XlsFormat/Auxiliary/HelpersTagsGenerator.cpp \ + ../XlsFormat/Auxiliary/HelpFunc.cpp \ + ../XlsFormat/Logic/SummaryInformationStream/Structures/CodePageOle.cpp \ + ../XlsFormat/Logic/Biff_structures/SharedProperty.cpp @@ -1271,7 +1273,6 @@ HEADERS += \ ../XlsFormat/Logic/Biff_structures/Phs.h \ ../XlsFormat/Logic/Biff_structures/PictFmlaEmbedInfo.h \ ../XlsFormat/Logic/Biff_structures/PictFmlaKey.h \ - ../XlsFormat/Logic/Biff_structures/Property.h \ ../XlsFormat/Logic/Biff_structures/PropertyBag.h \ ../XlsFormat/Logic/Biff_structures/PropertyBagStore.h \ ../XlsFormat/Logic/Biff_structures/Ptg.h \ @@ -1534,7 +1535,6 @@ HEADERS += \ ../XlsFormat/Logic/Biff_unions/UNKNOWNFRT.h \ ../XlsFormat/Logic/Biff_unions/WINDOW.h \ ../XlsFormat/Logic/Biff_unions/XFS.h \ - ../XlsFormat/Logic/SummaryInformationStream/Structures/CodePage.h \ ../XlsFormat/Logic/SummaryInformationStream/Structures/Property.h \ ../XlsFormat/Logic/SummaryInformationStream/Structures/PropertyFactory.h \ ../XlsFormat/Logic/SummaryInformationStream/Structures/PropertySet.h \ @@ -1575,7 +1575,11 @@ HEADERS += \ ../XlsFormat/Logic/WorkbookStreamObject.h \ ../XlsFormat/Logic/WorksheetSubstream.h \ ../XlsFormat/Logic/XlsElementsType.h \ - ../XlsXlsxConverter/ShapeType.h + ../XlsXlsxConverter/ShapeType.h \ + ../XlsFormat/Auxiliary/HelpersTagsGenerator.h \ + ../XlsFormat/Auxiliary/HelpFunc.h \ + ../XlsFormat/Logic/SummaryInformationStream/Structures/CodePageOle.h \ + ../XlsFormat/Logic/Biff_structures/SharedProperty.h