Commit 9fe16b8e authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

OfficeXlsFile2 linux build - complete

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64139 954022d7-b5bf-4e40-9824-e11837661b57
parent 72af6e0f
...@@ -14,6 +14,11 @@ DEFINES += UNICODE \ ...@@ -14,6 +14,11 @@ DEFINES += UNICODE \
_LINUX_QT \ _LINUX_QT \
LINUX LINUX
CONFIG(debug, debug|release){
message(Debug)
DEFINES += _DEBUG
}
TARGET = ASCXlsConverter TARGET = ASCXlsConverter
CONFIG += console CONFIG += console
......
#pragma once #pragma once
#include <string> #include <string>
#include <string.h>
#include "../../../Common/DocxFormat/Source/Base/unicode_util.h"
static std::wstring convertUtf16ToWString(const UTF16 * Data, int nLength)
{
UTF32 *pStrUtf32 = new UTF32 [nLength + 1];
memset ((void *) pStrUtf32, 0, sizeof (UTF32) * (nLength + 1));
// this values will be modificated
const UTF16 *pStrUtf16_Conv = Data;
UTF32 *pStrUtf32_Conv = pStrUtf32;
ConversionResult eUnicodeConversionResult =
ConvertUTF16toUTF32 (&pStrUtf16_Conv,
&Data[nLength]
, &pStrUtf32_Conv
, &pStrUtf32 [nLength]
, strictConversion);
if (conversionOK != eUnicodeConversionResult)
{
delete [] pStrUtf32;
return std::wstring();
}
std::wstring wstr ((wchar_t *) pStrUtf32);
delete [] pStrUtf32;
return wstr;
}
namespace xml { namespace xml {
......
...@@ -70,7 +70,7 @@ const std::wstring row2str(const int row) ...@@ -70,7 +70,7 @@ const std::wstring row2str(const int row)
} }
const std::wstring loc2str(const long row, const bool row_rel, const long column, const bool col_rel) const std::wstring loc2str(const int row, const bool row_rel, const int column, const bool col_rel)
{ {
return (col_rel ? L"" : L"$") + column2str(column) + (row_rel ? L"" : L"$") + row2str(row); return (col_rel ? L"" : L"$") + column2str(column) + (row_rel ? L"" : L"$") + row2str(row);
} }
...@@ -131,7 +131,7 @@ const bool str2rel(std::wstring::const_iterator& str_begin, std::wstring::const_ ...@@ -131,7 +131,7 @@ const bool str2rel(std::wstring::const_iterator& str_begin, std::wstring::const_
return true; 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) void str2loc(std::wstring::const_iterator& str_begin, std::wstring::const_iterator& str_end, int& row, bool& row_rel, int& column, bool& col_rel)
{ {
col_rel = str2rel (str_begin, str_end); col_rel = str2rel (str_begin, str_end);
column = str2column (str_begin, str_end); column = str2column (str_begin, str_end);
...@@ -139,7 +139,7 @@ void str2loc(std::wstring::const_iterator& str_begin, std::wstring::const_iterat ...@@ -139,7 +139,7 @@ void str2loc(std::wstring::const_iterator& str_begin, std::wstring::const_iterat
row = str2row (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) void str2loc(const std::wstring& str, int& row, bool& row_rel, int& column, bool& col_rel)
{ {
std::wstring::const_iterator str_begin = str.begin(); std::wstring::const_iterator str_begin = str.begin();
std::wstring::const_iterator str_end = str.end(); std::wstring::const_iterator str_end = str.end();
...@@ -279,14 +279,19 @@ const std::wstring int2hex_wstr(const int val, const size_t size_of) ...@@ -279,14 +279,19 @@ const std::wstring int2hex_wstr(const int val, const size_t size_of)
{ {
if(size_of > 4) return L""; if(size_of > 4) return L"";
static wchar_t num_buf[10]={};
#if defined(_WIN64) || defined(_WIN64) #if defined(_WIN64) || defined(_WIN64)
swprintf_s(num_buf, 9, (L"%0" + STR::int2wstr(size_of << 1, 10) + L"X").c_str(), val); static wchar_t num_buf[10]={};
std::wstring wstr = STR::int2wstr(size_of << 1, 10);
swprintf_s(num_buf, 9, (L"%0" + wstr + L"X").c_str(), val);
return std::wstring(num_buf);
#else #else
//todooooo char num_buf[10]={};
std::string str = STR::int2str(size_of << 1, 10);
snprintf(num_buf, 9, ("%0" + str + "X").c_str(), val);
std::string res(num_buf);
return std::wstring(res.begin(), res.end());
#endif #endif
return std::wstring(num_buf);
} }
...@@ -421,7 +426,7 @@ const size_t hex_str2int(const std::wstring::const_iterator& it_begin, const std ...@@ -421,7 +426,7 @@ const size_t hex_str2int(const std::wstring::const_iterator& it_begin, const std
return numeric; return numeric;
} }
const std::string toStdString(const std::wstring& wide_string, const unsigned int code_page) const std::string toStdString(std::wstring wide_string, const unsigned int code_page)
{ {
#if defined (_WIN32) || defined (_WIN64) #if defined (_WIN32) || defined (_WIN64)
const int nSize = WideCharToMultiByte(code_page, 0, wide_string.c_str(), wide_string.length(), NULL, 0, NULL, NULL); const int nSize = WideCharToMultiByte(code_page, 0, wide_string.c_str(), wide_string.length(), NULL, 0, NULL, NULL);
...@@ -469,7 +474,7 @@ const std::string toStdString(const std::wstring& wide_string, const unsigned in ...@@ -469,7 +474,7 @@ const std::string toStdString(const std::wstring& wide_string, const unsigned in
} }
const std::wstring toStdWString(const std::string& ansi_string, const unsigned int code_page) const std::wstring toStdWString(std::string ansi_string, const unsigned int code_page)
{ {
#if defined (_WIN32) || defined (_WIN64) #if defined (_WIN32) || defined (_WIN64)
const int nSize = MultiByteToWideChar(code_page, 0, ansi_string.c_str(), ansi_string.size(), NULL, 0); const int nSize = MultiByteToWideChar(code_page, 0, ansi_string.c_str(), ansi_string.size(), NULL, 0);
...@@ -490,10 +495,7 @@ const std::wstring toStdWString(const std::string& ansi_string, const unsigned i ...@@ -490,10 +495,7 @@ const std::wstring toStdWString(const std::string& ansi_string, const unsigned i
size_t insize = ansi_string.length(); size_t insize = ansi_string.length();
std::wstring w_out; std::wstring w_out;
w_out.reserve(insize);
char *inptr = (char*)ansi_string.c_str(); char *inptr = (char*)ansi_string.c_str();
char* outptr = (char*)w_out.c_str();
if (code_page >= 0) if (code_page >= 0)
{ {
...@@ -502,14 +504,21 @@ const std::wstring toStdWString(const std::string& ansi_string, const unsigned i ...@@ -502,14 +504,21 @@ const std::wstring toStdWString(const std::string& ansi_string, const unsigned i
iconv_t ic= iconv_open("WCHAR_T", sCodepage.c_str()); iconv_t ic= iconv_open("WCHAR_T", sCodepage.c_str());
if (ic != (iconv_t) -1) if (ic != (iconv_t) -1)
{ {
size_t nconv = 0, avail = (insize) * sizeof(wchar_t); size_t nconv = 0, avail = (insize + 1) * sizeof(wchar_t);
char* out_str = new char[avail];
char* outptr = out_str;
nconv = iconv (ic, &inptr, &insize, &outptr, &avail); nconv = iconv (ic, &inptr, &insize, &outptr, &avail);
if (nconv == 0) if (nconv == 0)
{ {
insize = ansi_string.length();
((wchar_t*)out_str)[insize] = 0;
w_out = std::wstring((wchar_t*)out_str, insize);
ansi = false; ansi = false;
} }
iconv_close(ic); iconv_close(ic);
delete []out_str;
} }
} }
if (ansi) if (ansi)
......
...@@ -23,9 +23,9 @@ namespace AUX ...@@ -23,9 +23,9 @@ namespace AUX
const int normalizeRow(const int row); const int normalizeRow(const int row);
const std::wstring column2str(const int column); const std::wstring column2str(const int column);
const std::wstring row2str(const int row); const std::wstring row2str(const int row);
const std::wstring loc2str(const long row, const bool row_rel, const long column, const bool col_rel); const std::wstring loc2str(const int row, const bool row_rel, const int column, const bool col_rel);
void str2loc(const std::wstring& str, long& row, bool& row_rel, long& column, bool& col_rel); void str2loc(const std::wstring& str, int& row, bool& row_rel, int& column, bool& 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); void str2loc(std::wstring::const_iterator& str_begin, std::wstring::const_iterator& str_end, int& row, bool& row_rel, int& column, bool& col_rel);
void str2refs(const std::wstring& str, std::vector<XLS::CellRangeRef>& vec); void str2refs(const std::wstring& str, std::vector<XLS::CellRangeRef>& vec);
}; };
...@@ -51,8 +51,8 @@ namespace STR ...@@ -51,8 +51,8 @@ namespace STR
const size_t hex_str2int(const std::wstring::const_iterator& it_begin, const std::wstring::const_iterator& it_end); const size_t hex_str2int(const std::wstring::const_iterator& it_begin, const std::wstring::const_iterator& it_end);
//const std::string hres2wstr(const HRESULT hres); //const std::string hres2wstr(const HRESULT hres);
const std::string toStdString(const std::wstring& wide_string, const unsigned int code_page); const std::string toStdString(std::wstring wide_string, const unsigned int code_page);
const std::wstring toStdWString(const std::string& ansi_string, const unsigned int code_page); const std::wstring toStdWString(std::string ansi_string, const unsigned int code_page);
}; };
namespace XMLSTUFF namespace XMLSTUFF
......
...@@ -114,10 +114,9 @@ public: ...@@ -114,10 +114,9 @@ public:
CFRecord& operator>>(unsigned 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 short& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; } CFRecord& operator>>(unsigned int& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(long& val) { loadAnyData(val); return *this; } CFRecord& operator>>(int& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(double& val) { loadAnyData(val); return *this; } CFRecord& operator>>(double& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(_GUID_& 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>>(short& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(char& val) { loadAnyData(val); return *this; } CFRecord& operator>>(char& val) { loadAnyData(val); return *this; }
CFRecord& operator>>(bool& val); CFRecord& operator>>(bool& val);
...@@ -125,10 +124,9 @@ public: ...@@ -125,10 +124,9 @@ public:
CFRecord& operator<<(unsigned char& 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 short& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; } CFRecord& operator<<(unsigned int& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(long& val) { storeAnyData(val); return *this; } CFRecord& operator<<(int& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(double& val) { storeAnyData(val); return *this; } CFRecord& operator<<(double& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(_GUID_& 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<<(short& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(char& val) { storeAnyData(val); return *this; } CFRecord& operator<<(char& val) { storeAnyData(val); return *this; }
CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; } CFRecord& operator<<(wchar_t& val) { storeAnyData(val); return *this; }
......
...@@ -48,7 +48,7 @@ int MergeCells::serialize(std::wostream & stream) ...@@ -48,7 +48,7 @@ int MergeCells::serialize(std::wostream & stream)
CP_XML_WRITER(stream) CP_XML_WRITER(stream)
{ {
for (long i = 0 ; i < rgref.size(); i++) for (int i = 0 ; i < rgref.size(); i++)
{ {
Ref8* ref = dynamic_cast<Ref8*>(rgref[i].get()); Ref8* ref = dynamic_cast<Ref8*>(rgref[i].get());
CP_XML_NODE(L"mergeCell") CP_XML_NODE(L"mergeCell")
......
...@@ -77,7 +77,7 @@ void MulBlank::readFields(CFRecord& record) ...@@ -77,7 +77,7 @@ void MulBlank::readFields(CFRecord& record)
record.skipNunBytes(sizeof(unsigned short)); record.skipNunBytes(sizeof(unsigned short));
} }
const long MulBlank::GetRow() const const int MulBlank::GetRow() const
{ {
return static_cast<unsigned short>(rw); return static_cast<unsigned short>(rw);
} }
......
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
void writeFields(CFRecord& record); void writeFields(CFRecord& record);
void readFields(CFRecord& record); void readFields(CFRecord& record);
const long GetRow() const; const int GetRow() const;
int serialize(std::wostream & stream); int serialize(std::wostream & stream);
......
...@@ -50,7 +50,7 @@ void MulRk::readFields(CFRecord& record) ...@@ -50,7 +50,7 @@ void MulRk::readFields(CFRecord& record)
record.skipNunBytes(sizeof(unsigned short)); record.skipNunBytes(sizeof(unsigned short));
} }
const long MulRk::GetRow() const const int MulRk::GetRow() const
{ {
return static_cast<unsigned short>(rw); return static_cast<unsigned short>(rw);
} }
...@@ -61,7 +61,7 @@ int MulRk::serialize(std::wostream & stream) ...@@ -61,7 +61,7 @@ int MulRk::serialize(std::wostream & stream)
{ {
int row = GetRow(); int row = GetRow();
for (long i = 0; i < cells.size(); i++) for (int i = 0; i < cells.size(); i++)
{ {
Cell * cell = dynamic_cast<Cell *>(cells[i].get()); Cell * cell = dynamic_cast<Cell *>(cells[i].get());
RkRec * rkrec = dynamic_cast<RkRec *>(rgrkrec[i].get()); RkRec * rkrec = dynamic_cast<RkRec *>(rgrkrec[i].get());
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
void writeFields(CFRecord& record); void writeFields(CFRecord& record);
void readFields(CFRecord& record); void readFields(CFRecord& record);
const long GetRow() const; const int GetRow() const;
int serialize(std::wostream & stream); int serialize(std::wostream & stream);
//----------------------------- //-----------------------------
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
typedef struct tagPOINT typedef struct tagPOINT
{ {
long x; _INT32 x;
long y; _INT32 y;
} POINT; } POINT;
typedef struct _devicemodeW typedef struct _devicemodeW
......
...@@ -86,7 +86,7 @@ int SST::serialize(std::wostream & stream) ...@@ -86,7 +86,7 @@ int SST::serialize(std::wostream & stream)
CP_XML_ATTR(L"uniqueCount", rgb.size()); CP_XML_ATTR(L"uniqueCount", rgb.size());
CP_XML_ATTR(L"xmlns", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); CP_XML_ATTR(L"xmlns", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
for (long i=0; i < rgb.size(); i++) for (int i=0; i < rgb.size(); i++)
{ {
CP_XML_NODE(L"si") CP_XML_NODE(L"si")
{ {
......
#include "BiffString.h" #include "BiffString.h"
#include <utils.h>
namespace XLS namespace XLS
{ {
...@@ -72,9 +73,12 @@ void BiffString::load(CFRecord& record, const size_t cch, const bool is_wide) ...@@ -72,9 +73,12 @@ void BiffString::load(CFRecord& record, const size_t cch, const bool is_wide)
if(is_wide) if(is_wide)
{ {
//todoooo wchar_t = 4 !!!! #if defined(_WIN32) || defined(_WIN64)
std::wstring int_str(record.getCurData<wchar_t>(), cch); std::wstring int_str(record.getCurData<wchar_t>(), cch);
str_ = int_str.c_str(); str_ = int_str.c_str();
#else
str_= convertUtf16ToWString(record.getCurData<UTF16>(), cch);
#endif
} }
else else
{ {
......
...@@ -94,10 +94,10 @@ const std::wstring CellRangeRef::toString(const bool useShortForm) const ...@@ -94,10 +94,10 @@ const std::wstring CellRangeRef::toString(const bool useShortForm) const
{ {
if(to_string_cache.empty()) if(to_string_cache.empty())
{ {
long rowLast_norm = AUX::normalizeRow(rowLast); int rowLast_norm = AUX::normalizeRow(rowLast);
long rowFirst_norm = AUX::normalizeRow(rowFirst); int rowFirst_norm = AUX::normalizeRow(rowFirst);
long columnFirst_norm = AUX::normalizeColumn(columnFirst); int columnFirst_norm = AUX::normalizeColumn(columnFirst);
long columnLast_norm = AUX::normalizeColumn(columnLast); int columnLast_norm = AUX::normalizeColumn(columnLast);
if(0 == rowFirst_norm && 65535 == rowLast_norm ) // whole column or range of columns if(0 == rowFirst_norm && 65535 == rowLast_norm ) // whole column or range of columns
{ {
if(useShortForm) if(useShortForm)
......
...@@ -33,12 +33,12 @@ public: ...@@ -33,12 +33,12 @@ public:
const CellRef getTopLeftCell() const; const CellRef getTopLeftCell() const;
const long getRowFirst() const { return rowFirst; } const int getRowFirst() const { return rowFirst; }
const long getRowLast() const { return rowLast; } const int getRowLast() const { return rowLast; }
const bool getRowFirstRelative() const { return rowFirstRelative; } const bool getRowFirstRelative() const { return rowFirstRelative; }
const bool getRowLastRelative() const { return rowLastRelative; } const bool getRowLastRelative() const { return rowLastRelative; }
const long getColumnFirst() const { return columnFirst; } const int getColumnFirst() const { return columnFirst; }
const long getColumnLast() const { return columnLast; } const int getColumnLast() const { return columnLast; }
const bool getColumnFirstRelative() const { return columnFirstRelative; } const bool getColumnFirstRelative() const { return columnFirstRelative; }
const bool getColumnLastRelative() const { return columnLastRelative; } const bool getColumnLastRelative() const { return columnLastRelative; }
void setColumnRelativity(const bool is_relative); void setColumnRelativity(const bool is_relative);
...@@ -50,12 +50,12 @@ public: ...@@ -50,12 +50,12 @@ public:
virtual void load(CFRecord& record) {} virtual void load(CFRecord& record) {}
virtual void store(CFRecord& record) {} virtual void store(CFRecord& record) {}
long rowFirst; int rowFirst;
long rowLast; int rowLast;
bool rowFirstRelative; bool rowFirstRelative;
bool rowLastRelative; bool rowLastRelative;
long columnFirst; int columnFirst;
long columnLast; int columnLast;
bool columnFirstRelative; bool columnFirstRelative;
bool columnLastRelative; bool columnLastRelative;
...@@ -175,7 +175,7 @@ typedef CellRangeRef_T<Ref8_name, unsigned short, unsigned short, rel_Absent> Re ...@@ -175,7 +175,7 @@ typedef CellRangeRef_T<Ref8_name, unsigned short, unsigned short, rel_Absent> Re
typedef CellRangeRef_T<Ref8U_name, unsigned short, unsigned short, rel_Absent> Ref8U; typedef CellRangeRef_T<Ref8U_name, unsigned short, unsigned short, rel_Absent> Ref8U;
typedef CellRangeRef_T<RefU_name, unsigned short, unsigned char, rel_Absent> RefU; typedef CellRangeRef_T<RefU_name, unsigned short, unsigned char, rel_Absent> RefU;
typedef CellRangeRef_T<Ref8U2007_name, unsigned int, unsigned int, rel_Absent> Ref8U2007; typedef CellRangeRef_T<Ref8U2007_name, unsigned int, unsigned int, rel_Absent> Ref8U2007;
typedef CellRangeRef_T<RFX_name, long, long, rel_Absent> RFX; typedef CellRangeRef_T<RFX_name, int, int, rel_Absent> RFX;
typedef CellRangeRef_T<RgceArea_name, unsigned short, unsigned short, rel_Present> RgceArea; typedef CellRangeRef_T<RgceArea_name, unsigned short, unsigned short, rel_Present> RgceArea;
typedef CellRangeRef_T<RgceAreaRel_name, short, short, rel_Present> RgceAreaRel; typedef CellRangeRef_T<RgceAreaRel_name, short, short, rel_Present> RgceAreaRel;
......
...@@ -27,7 +27,7 @@ CellRef::CellRef(const std::wstring str_ref) ...@@ -27,7 +27,7 @@ CellRef::CellRef(const std::wstring str_ref)
} }
CellRef::CellRef(const long row_init, const long column_init, const bool row_relative_init, const bool col_relative_init) CellRef::CellRef(const int row_init, const int column_init, const bool row_relative_init, const bool col_relative_init)
: row(row_init), : row(row_init),
column(column_init), column(column_init),
rowRelative(row_relative_init), rowRelative(row_relative_init),
...@@ -80,11 +80,11 @@ CellRef::operator const std::wstring () const ...@@ -80,11 +80,11 @@ CellRef::operator const std::wstring () const
} }
const long CellRef::getRow() const const int CellRef::getRow() const
{ {
return row; return row;
} }
const long CellRef::getColumn() const const int CellRef::getColumn() const
{ {
return column; return column;
} }
......
...@@ -12,7 +12,7 @@ public: ...@@ -12,7 +12,7 @@ public:
CellRef(); CellRef();
CellRef(const std::wstring str); CellRef(const std::wstring str);
CellRef(const long row_init, const long column_init, const bool row_relative_init, const bool col_relative_init); CellRef(const int row_init, const int column_init, const bool row_relative_init, const bool col_relative_init);
BiffStructurePtr clone(); BiffStructurePtr clone();
...@@ -27,18 +27,18 @@ public: ...@@ -27,18 +27,18 @@ public:
void operator-=(const CellRef& subtracted_ref); void operator-=(const CellRef& subtracted_ref);
private: private:
virtual void load(CFRecord& record) {}; virtual void load(CFRecord& record) {}
virtual void store(CFRecord& record) {}; virtual void store(CFRecord& record) {}
public: public:
const long getRow() const; const int getRow() const;
const long getColumn() const; const int getColumn() const;
const bool getRowRelative() const; const bool getRowRelative() const;
const bool getColumnRelative() const; const bool getColumnRelative() const;
protected: protected:
long row; int row;
long column; int column;
bool rowRelative; bool rowRelative;
bool colRelative; bool colRelative;
bool fQuoted; bool fQuoted;
...@@ -80,7 +80,7 @@ class CellRef_T : public CellRef ...@@ -80,7 +80,7 @@ class CellRef_T : public CellRef
public: public:
CellRef_T(const std::wstring & str_ref) : CellRef(str_ref) {} CellRef_T(const std::wstring & str_ref) : CellRef(str_ref) {}
CellRef_T() {} CellRef_T() {}
CellRef_T(const long row_init, const long column_init, const bool row_relative_init, const bool col_relative_init) CellRef_T(const int row_init, const int column_init, const bool row_relative_init, const bool col_relative_init)
: CellRef(row_init, column_init, row_relative_init, col_relative_init) {} : CellRef(row_init, column_init, row_relative_init, col_relative_init) {}
template<class otherNameProducer, class otherRwType, class otherColType, RELATIVE_INFO otherRel_info> template<class otherNameProducer, class otherRwType, class otherColType, RELATIVE_INFO otherRel_info>
......
...@@ -114,7 +114,7 @@ void CellXF::load(CFRecord& record) ...@@ -114,7 +114,7 @@ void CellXF::load(CFRecord& record)
void CellXF::RegisterFillBorder() void CellXF::RegisterFillBorder()
{ {
for (long i = 0; i < ext_props.size(); i++ ) for (int i = 0; i < ext_props.size(); i++ )
{ {
ExtProp* ext_prop = dynamic_cast<ExtProp*>(ext_props[i].get()); ExtProp* ext_prop = dynamic_cast<ExtProp*>(ext_props[i].get());
......
...@@ -23,13 +23,13 @@ public: ...@@ -23,13 +23,13 @@ public:
XLUnicodeStringNoCch stFontName; XLUnicodeStringNoCch stFontName;
Stxp stxp; Stxp stxp;
long icvFore; int icvFore;
Ts tsNinch; Ts tsNinch;
Boolean<unsigned int> fSssNinch; Boolean<unsigned int> fSssNinch;
Boolean<unsigned int> fUlsNinch; Boolean<unsigned int> fUlsNinch;
Boolean<unsigned int> fBlsNinch; Boolean<unsigned int> fBlsNinch;
long ich; int ich;
long cch; int cch;
unsigned short iFnt; unsigned short iFnt;
}; };
......
...@@ -20,8 +20,8 @@ public: ...@@ -20,8 +20,8 @@ public:
virtual void store(XLS::CFRecord& record); virtual void store(XLS::CFRecord& record);
EncryptionHeaderFlags Flags; EncryptionHeaderFlags Flags;
long AlgID; int AlgID;
long AlgIDHash; int AlgIDHash;
unsigned int KeySize; unsigned int KeySize;
unsigned int ProviderType; unsigned int ProviderType;
std::wstring CSPName; std::wstring CSPName;
......
#include "FileMoniker.h" #include "FileMoniker.h"
#include <Binary/CFRecord.h> #include <Binary/CFRecord.h>
#include <utils.h>
namespace OSHARED namespace OSHARED
{ {
...@@ -41,7 +42,12 @@ void FileMoniker::load(XLS::CFRecord& record) ...@@ -41,7 +42,12 @@ void FileMoniker::load(XLS::CFRecord& record)
{ {
unsigned int cbUnicodePathBytes; unsigned int cbUnicodePathBytes;
record >> cbUnicodePathBytes >> usKeyValue; record >> cbUnicodePathBytes >> usKeyValue;
#if defined(_WIN32) || defined(_WIN64)
unicodePath = std::wstring(record.getCurData<wchar_t>(), cbUnicodePathBytes / 2); unicodePath = std::wstring(record.getCurData<wchar_t>(), cbUnicodePathBytes / 2);
#else
unicodePath = convertUtf16ToWString(record.getCurData<UTF16>(), cbUnicodePathBytes / 2);
#endif
record.skipNunBytes(cbUnicodePathBytes); record.skipNunBytes(cbUnicodePathBytes);
} }
} }
......
...@@ -12,7 +12,7 @@ FixedPoint::FixedPoint() ...@@ -12,7 +12,7 @@ FixedPoint::FixedPoint()
} }
FixedPoint::FixedPoint(const long raw_data) FixedPoint::FixedPoint(const int raw_data)
{ {
Fractional = static_cast<unsigned char>(raw_data & 0xFFFF); Fractional = static_cast<unsigned char>(raw_data & 0xFFFF);
Integral = static_cast<unsigned char>(raw_data >> 16); Integral = static_cast<unsigned char>(raw_data >> 16);
......
...@@ -11,7 +11,7 @@ class FixedPoint : public XLS::BiffAttribute ...@@ -11,7 +11,7 @@ class FixedPoint : public XLS::BiffAttribute
{ {
public: public:
FixedPoint(); FixedPoint();
FixedPoint(const long raw_data); FixedPoint(const int raw_data);
XLS::BiffStructurePtr clone(); XLS::BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent, const std::wstring & attrib_name); //virtual void toXML(BiffStructurePtr & parent, const std::wstring & attrib_name);
......
...@@ -805,7 +805,7 @@ const std::wstring Ftab_Cetab::ValuesDetermination::getName(const unsigned short ...@@ -805,7 +805,7 @@ const std::wstring Ftab_Cetab::ValuesDetermination::getName(const unsigned short
// static // static
const long Ftab_Cetab::ValuesDetermination::getParamsNum(const unsigned short iftab) const int Ftab_Cetab::ValuesDetermination::getParamsNum(const unsigned short iftab)
{ {
const ParamsFixedSet::index<sort_by_iftab>::type& iftab_index = getInst().params_fixed.get<sort_by_iftab>(); const ParamsFixedSet::index<sort_by_iftab>::type& iftab_index = getInst().params_fixed.get<sort_by_iftab>();
const ParamsFixedSet::index<sort_by_iftab>::type::iterator found = iftab_index.find(iftab); const ParamsFixedSet::index<sort_by_iftab>::type::iterator found = iftab_index.find(iftab);
...@@ -831,7 +831,7 @@ const unsigned short Ftab_Cetab::ValuesDetermination::getIndex(const std::wstrin ...@@ -831,7 +831,7 @@ const unsigned short Ftab_Cetab::ValuesDetermination::getIndex(const std::wstrin
// static // static
const long Ftab_Cetab::ValuesDetermination::getParamsNum(const std::wstring& func_name) const int Ftab_Cetab::ValuesDetermination::getParamsNum(const std::wstring& func_name)
{ {
const ParamsFixedSet::index<sort_by_name>::type& name_index = getInst().params_fixed.get<sort_by_name>(); const ParamsFixedSet::index<sort_by_name>::type& name_index = getInst().params_fixed.get<sort_by_name>();
const ParamsFixedSet::index<sort_by_name>::type::iterator found = name_index.find(func_name); const ParamsFixedSet::index<sort_by_name>::type::iterator found = name_index.find(func_name);
...@@ -849,7 +849,7 @@ const std::wstring Ftab_Cetab::getFuncName() const ...@@ -849,7 +849,7 @@ const std::wstring Ftab_Cetab::getFuncName() const
} }
const long Ftab_Cetab::getParamsNum() const const int Ftab_Cetab::getParamsNum() const
{ {
return ValuesDetermination::getParamsNum(func_index); return ValuesDetermination::getParamsNum(func_index);
} }
......
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
Ftab_Cetab(const unsigned short func_index_init); Ftab_Cetab(const unsigned short func_index_init);
const std::wstring getFuncName() const; const std::wstring getFuncName() const;
const long getParamsNum() const; const int getParamsNum() const;
const unsigned short getIndex() const; const unsigned short getIndex() const;
const bool isMacro() const; const bool isMacro() const;
...@@ -27,21 +27,22 @@ public: ...@@ -27,21 +27,22 @@ public:
{ {
public: public:
static const std::wstring getName(const unsigned short iftab); static const std::wstring getName(const unsigned short iftab);
static const long getParamsNum(const unsigned short iftab); static const int getParamsNum(const unsigned short iftab);
static const unsigned short getIndex(const std::wstring& func_name); static const unsigned short getIndex(const std::wstring& func_name);
static const long getParamsNum(const std::wstring& func_name); static const int getParamsNum(const std::wstring& func_name);
ValuesDetermination(); ValuesDetermination();
static ValuesDetermination& getInst() static ValuesDetermination& getInst()
{ {
static ValuesDetermination inst; static ValuesDetermination inst;
return inst; return inst;
}; }
struct ParamsFixed{ struct ParamsFixed{
ParamsFixed(const unsigned short iftab_, const long params_num_, const std::wstring& name_): name(name_), iftab(iftab_), params_num(params_num_) {}; ParamsFixed(const unsigned short iftab_, const int params_num_, const std::wstring& name_):
name(name_), iftab(iftab_), params_num(params_num_) {}
std::wstring name; std::wstring name;
unsigned short iftab; unsigned short iftab;
long params_num; int params_num;
}; };
struct sort_by_name {}; struct sort_by_name {};
struct sort_by_iftab {}; struct sort_by_iftab {};
......
#include "ItemMoniker.h" #include "ItemMoniker.h"
#include <Binary/CFRecord.h> #include <Binary/CFRecord.h>
#include <utils.h>
namespace OSHARED namespace OSHARED
{ {
...@@ -52,18 +53,28 @@ void ItemMoniker::load(XLS::CFRecord& record) ...@@ -52,18 +53,28 @@ void ItemMoniker::load(XLS::CFRecord& record)
unsigned int delimiterLength; unsigned int delimiterLength;
record >> delimiterLength >> delimiterAnsi; record >> delimiterLength >> delimiterAnsi;
int sizeof_delimiterUnicode = delimiterLength - (delimiterAnsi.length() + 1); int sizeof_delimiterUnicode = delimiterLength - (delimiterAnsi.length() + 1);
if(sizeof_delimiterUnicode > 0) if(sizeof_delimiterUnicode > 0)
{ {
#if defined(_WIN32) || defined(_WIN64)
delimiterUnicode = std::wstring(record.getCurData<wchar_t>(), sizeof_delimiterUnicode / 2); delimiterUnicode = std::wstring(record.getCurData<wchar_t>(), sizeof_delimiterUnicode / 2);
#else
delimiterUnicode = convertUtf16ToWString(record.getCurData<UTF16>(), sizeof_delimiterUnicode / 2);
#endif
record.skipNunBytes(sizeof_delimiterUnicode); record.skipNunBytes(sizeof_delimiterUnicode);
} }
unsigned int itemLength; unsigned int itemLength;
record >> itemLength >> itemAnsi; record >> itemLength >> itemAnsi;
int sizeof_itemUnicode = itemLength - (itemAnsi.length() + 1); int sizeof_itemUnicode = itemLength - (itemAnsi.length() + 1);
if(sizeof_itemUnicode > 0) if(sizeof_itemUnicode > 0)
{ {
#if defined(_WIN32) || defined(_WIN64)
itemUnicode = std::wstring(record.getCurData<wchar_t>(), sizeof_itemUnicode / 2); itemUnicode = std::wstring(record.getCurData<wchar_t>(), sizeof_itemUnicode / 2);
#else
itemUnicode = convertUtf16ToWString(record.getCurData<UTF16>(), sizeof_itemUnicode / 2);
#endif
record.skipNunBytes(sizeof_itemUnicode); record.skipNunBytes(sizeof_itemUnicode);
} }
......
...@@ -18,7 +18,7 @@ public: ...@@ -18,7 +18,7 @@ public:
virtual void load(CFRecord& record); virtual void load(CFRecord& record);
virtual void store(CFRecord& record); virtual void store(CFRecord& record);
long imdt; int imdt;
unsigned short mdd; unsigned short mdd;
}; };
......
...@@ -23,7 +23,7 @@ void MSOSHADECOLOR::store(XLS::CFRecord& record) ...@@ -23,7 +23,7 @@ void MSOSHADECOLOR::store(XLS::CFRecord& record)
void MSOSHADECOLOR::load(XLS::CFRecord& record) void MSOSHADECOLOR::load(XLS::CFRecord& record)
{ {
long raw_color; int raw_color;
record >> raw_color >> position; record >> raw_color >> position;
color = OfficeArtCOLORREF(raw_color); color = OfficeArtCOLORREF(raw_color);
} }
......
...@@ -16,7 +16,7 @@ namespace ODRAW ...@@ -16,7 +16,7 @@ namespace ODRAW
class MSOLINEDASHING class MSOLINEDASHING
{ {
public: public:
static const std::wstring ToString(const long raw_data) static const std::wstring ToString(const int raw_data)
{ {
switch (raw_data) switch (raw_data)
{ {
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
class MSOLINESTYLE class MSOLINESTYLE
{ {
public: public:
static const std::wstring ToString(const long raw_data) static const std::wstring ToString(const int raw_data)
{ {
switch (raw_data) switch (raw_data)
{ {
......
...@@ -11,7 +11,7 @@ OfficeArtCOLORREF::OfficeArtCOLORREF() ...@@ -11,7 +11,7 @@ OfficeArtCOLORREF::OfficeArtCOLORREF()
index = -1; index = -1;
} }
OfficeArtCOLORREF::OfficeArtCOLORREF(const long raw_data) OfficeArtCOLORREF::OfficeArtCOLORREF(const int raw_data)
{ {
red = static_cast<unsigned char>(GETBITS(raw_data, 0, 7)); red = static_cast<unsigned char>(GETBITS(raw_data, 0, 7));
green = static_cast<unsigned char>(GETBITS(raw_data, 8, 15)); green = static_cast<unsigned char>(GETBITS(raw_data, 8, 15));
......
...@@ -15,13 +15,13 @@ class OfficeArtCOLORREF : public XLS::BiffStructure ...@@ -15,13 +15,13 @@ class OfficeArtCOLORREF : public XLS::BiffStructure
BASE_STRUCTURE_DEFINE_CLASS_NAME(OfficeArtCOLORREF) BASE_STRUCTURE_DEFINE_CLASS_NAME(OfficeArtCOLORREF)
public: public:
OfficeArtCOLORREF(); OfficeArtCOLORREF();
OfficeArtCOLORREF(const long raw_data); OfficeArtCOLORREF(const int raw_data);
XLS::BiffStructurePtr clone(); XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtCOLORREF; static const XLS::ElementType type = XLS::typeOfficeArtCOLORREF;
virtual void load(XLS::CFRecord& record) {}; virtual void load(XLS::CFRecord& record) {}
virtual void store(XLS::CFRecord& record) {}; virtual void store(XLS::CFRecord& record) {}
unsigned char red; unsigned char red;
unsigned char green; unsigned char green;
......
...@@ -27,10 +27,10 @@ public: ...@@ -27,10 +27,10 @@ public:
// bool fMove; // This attribute is ignored for chart sheets // bool fMove; // This attribute is ignored for chart sheets
bool fSize; bool fSize;
long lx1; int lx1;
long ly1; int ly1;
long lx2; int lx2;
long ly2; int ly2;
}; };
typedef boost::shared_ptr<OfficeArtClientAnchorChart> OfficeArtClientAnchorChartPtr; typedef boost::shared_ptr<OfficeArtClientAnchorChart> OfficeArtClientAnchorChartPtr;
......
...@@ -23,8 +23,8 @@ public: ...@@ -23,8 +23,8 @@ public:
virtual void loadFields(XLS::CFRecord& record); virtual void loadFields(XLS::CFRecord& record);
virtual void storeFields(XLS::CFRecord& record); virtual void storeFields(XLS::CFRecord& record);
long width; int width;
long height; int height;
}; };
typedef boost::shared_ptr<OfficeArtClientAnchorHF> OfficeArtClientAnchorHFPtr; typedef boost::shared_ptr<OfficeArtClientAnchorHF> OfficeArtClientAnchorHFPtr;
......
...@@ -28,20 +28,6 @@ OfficeArtContainer::OfficeArtContainer(const unsigned char recVer, const unsigne ...@@ -28,20 +28,6 @@ OfficeArtContainer::OfficeArtContainer(const unsigned char recVer, const unsigne
{ {
} }
//void OfficeArtContainer::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
// std::for_each(child_records.begin(), child_records.end(), boost::bind(&OfficeArtRecord::toXML, _1, xml_tag));
//}
//
//
//void OfficeArtContainer::getXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
//#pragma message("####################### OfficeArtContainer composite has no BiffStructure::getXMLAttributes() implemented")
// Log::error(" Error!!! OfficeArtContainer composite has no BiffStructure::getXMLAttributes() implemented.");
//}
void OfficeArtContainer::loadFields(XLS::CFRecord& record) void OfficeArtContainer::loadFields(XLS::CFRecord& record)
{ {
size_t container_beginning_ptr = record.getRdPtr(); size_t container_beginning_ptr = record.getRdPtr();
......
...@@ -47,7 +47,7 @@ void OfficeArtDgContainer::loadFields(XLS::CFRecord& record) ...@@ -47,7 +47,7 @@ void OfficeArtDgContainer::loadFields(XLS::CFRecord& record)
{ {
} }
for (long i = 0 ; i < child_records.size(); i++) for (int i = 0 ; i < child_records.size(); i++)
{ {
switch(child_records[i]->rh_own.recType) switch(child_records[i]->rh_own.recType)
{ {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <Binary/CFRecord.h> #include <Binary/CFRecord.h>
#include "OfficeArtBlip.h" #include "OfficeArtBlip.h"
#include <bitset> #include <bitset>
#include <utils.h>
namespace ODRAW namespace ODRAW
{ {
...@@ -389,7 +390,11 @@ void fillBlip::ReadComplexData(XLS::CFRecord& record) ...@@ -389,7 +390,11 @@ void fillBlip::ReadComplexData(XLS::CFRecord& record)
void anyString::ReadComplexData(XLS::CFRecord& record) void anyString::ReadComplexData(XLS::CFRecord& record)
{ {
#if defined(_WIN32) || defined(_WIN64)
string_ = std::wstring(record.getCurData<wchar_t>(), op); string_ = std::wstring(record.getCurData<wchar_t>(), op);
#else
string_ = convertUtf16ToWString(record.getCurData<UTF16>(), op);
#endif
record.skipNunBytes(op); record.skipNunBytes(op);
} }
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
unsigned short opid; unsigned short opid;
bool fBid; bool fBid;
bool fComplex; bool fComplex;
long op; _INT32 op;
}; };
...@@ -515,8 +515,8 @@ class MSOPOINT : public XLS::BiffStructure ...@@ -515,8 +515,8 @@ class MSOPOINT : public XLS::BiffStructure
static const XLS::ElementType type = XLS::typeOfficeArtRecord; static const XLS::ElementType type = XLS::typeOfficeArtRecord;
long x; int x;
long y; int y;
}; };
class MSOPATHINFO : public XLS::BiffStructure class MSOPATHINFO : public XLS::BiffStructure
......
...@@ -23,10 +23,10 @@ public: ...@@ -23,10 +23,10 @@ public:
virtual void loadFields(XLS::CFRecord& record); virtual void loadFields(XLS::CFRecord& record);
virtual void storeFields(XLS::CFRecord& record); virtual void storeFields(XLS::CFRecord& record);
long xLeft; int xLeft;
long yTop; int yTop;
long xRight; int xRight;
long yBottom; int yBottom;
}; };
typedef boost::shared_ptr<OfficeArtFSPGR> OfficeArtFSPGRPtr; typedef boost::shared_ptr<OfficeArtFSPGR> OfficeArtFSPGRPtr;
......
...@@ -8,16 +8,16 @@ ...@@ -8,16 +8,16 @@
typedef struct tagPOINT typedef struct tagPOINT
{ {
long x; _INT32 x;
long y; _INT32 y;
} POINT; } POINT;
typedef struct tagRECT typedef struct tagRECT
{ {
long left; _INT32 left;
long top; _INT32 top;
long right; _INT32 right;
long bottom; _INT32 bottom;
} RECT; } RECT;
#else #else
#include <windows.h> #include <windows.h>
......
...@@ -14,7 +14,7 @@ void OfficeArtDggContainer::loadFields(XLS::CFRecord& record) ...@@ -14,7 +14,7 @@ void OfficeArtDggContainer::loadFields(XLS::CFRecord& record)
{ {
OfficeArtContainer::loadFields(record); OfficeArtContainer::loadFields(record);
for (long i = 0 ; i < child_records.size(); i++) for (int i = 0 ; i < child_records.size(); i++)
{ {
switch(child_records[i]->rh_own.recType) switch(child_records[i]->rh_own.recType)
{ {
...@@ -52,7 +52,7 @@ void OfficeArtSpgrContainer::loadFields(XLS::CFRecord& record) ...@@ -52,7 +52,7 @@ void OfficeArtSpgrContainer::loadFields(XLS::CFRecord& record)
{ {
OfficeArtContainer::loadFields(record); OfficeArtContainer::loadFields(record);
//for (long i = 0 ; i < child_records.size(); i++) //for (int i = 0 ; i < child_records.size(); i++)
//{ //{
// switch(child_records[i]->rh_own.recType) // switch(child_records[i]->rh_own.recType)
// { // {
......
...@@ -44,14 +44,14 @@ void PtgFunc::loadFields(CFRecord& record) ...@@ -44,14 +44,14 @@ void PtgFunc::loadFields(CFRecord& record)
void PtgFunc::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data) void PtgFunc::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{ {
long num_params = iftab.getParamsNum(); int num_params = iftab.getParamsNum();
std::wstring arguments; std::wstring arguments;
if(num_params && ptg_stack.size() > 0) if(num_params && ptg_stack.size() > 0)
{ {
arguments += ptg_stack.top(); arguments += ptg_stack.top();
ptg_stack.pop(); ptg_stack.pop();
for(long i = 0; i < num_params - 1 && ptg_stack.size() > 0; ++i) for(int i = 0; i < num_params - 1 && ptg_stack.size() > 0; ++i)
{ {
arguments = ptg_stack.top() + L',' + arguments; arguments = ptg_stack.top() + L',' + arguments;
ptg_stack.pop(); ptg_stack.pop();
...@@ -78,7 +78,7 @@ PtgPtr PtgFunc::create(const std::wstring& word, const unsigned char data_type) ...@@ -78,7 +78,7 @@ PtgPtr PtgFunc::create(const std::wstring& word, const unsigned char data_type)
} }
const long PtgFunc::getParametersNum() const const int PtgFunc::getParametersNum() const
{ {
return iftab.getParamsNum(); return iftab.getParamsNum();
} }
......
...@@ -24,7 +24,7 @@ public: ...@@ -24,7 +24,7 @@ public:
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data); virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
const long getParametersNum() const; const int getParametersNum() const;
static const unsigned short fixed_id = 0x01; static const unsigned short fixed_id = 0x01;
private: private:
......
...@@ -113,31 +113,31 @@ const std::wstring PtgParam::getClearLine() const ...@@ -113,31 +113,31 @@ const std::wstring PtgParam::getClearLine() const
} }
const long PtgParam::getFirstParam() const const int PtgParam::getFirstParam() const
{ {
return params[0]; return params[0];
} }
const long PtgParam::getSecondParam() const const int PtgParam::getSecondParam() const
{ {
return params[1]; return params[1];
} }
const long PtgParam::getParam(const size_t pos) const const int PtgParam::getParam(const size_t pos) const
{ {
return params[pos]; return params[pos];
} }
const long PtgParam::getParamsNum() const const int PtgParam::getParamsNum() const
{ {
return params.size(); return params.size();
} }
void PtgParam::addParam(const long param) void PtgParam::addParam(const int param)
{ {
params.push_back(param); params.push_back(param);
} }
...@@ -149,7 +149,7 @@ const std::wstring PtgParam::toString() const ...@@ -149,7 +149,7 @@ const std::wstring PtgParam::toString() const
if(!params.empty()) if(!params.empty())
{ {
result += L'('; result += L'(';
for(std::vector<long>::const_iterator it = params.begin(), itEnd = --params.end(); it != itEnd; ++it) for(std::vector<int>::const_iterator it = params.begin(), itEnd = --params.end(); it != itEnd; ++it)
{ {
result += STR::int2wstr(*it) + L','; result += STR::int2wstr(*it) + L',';
} }
......
...@@ -21,13 +21,13 @@ public: ...@@ -21,13 +21,13 @@ public:
const ParamType getType() const; const ParamType getType() const;
const std::wstring getClearLine() const; const std::wstring getClearLine() const;
const long getFirstParam() const; const int getFirstParam() const;
const long getSecondParam() const; const int getSecondParam() const;
const long getParam(const size_t pos) const; const int getParam(const size_t pos) const;
const long getParamsNum() const; const int getParamsNum() const;
const std::wstring toString() const; const std::wstring toString() const;
void addParam(const long param); void addParam(const int param);
...@@ -37,7 +37,7 @@ private: ...@@ -37,7 +37,7 @@ private:
private: private:
ParamType type_; ParamType type_;
std::vector<long> params; std::vector<int> params;
std::wstring clear_line_; std::wstring clear_line_;
}; };
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
virtual void store(CFRecord& record); virtual void store(CFRecord& record);
unsigned int cbMemory; unsigned int cbMemory;
long revid; int revid;
RevisionType revt; RevisionType revt;
bool fAccepted; bool fAccepted;
bool fUndoAction; bool fUndoAction;
......
...@@ -26,6 +26,8 @@ public: ...@@ -26,6 +26,8 @@ public:
virtual const std::wstring toString() const = 0; virtual const std::wstring toString() const = 0;
static const ElementType type = typeSerAr; static const ElementType type = typeSerAr;
SerType fixed_type;
}; };
typedef boost::shared_ptr<SerAr> SerArPtr; typedef boost::shared_ptr<SerAr> SerArPtr;
......
...@@ -8,6 +8,7 @@ namespace XLS ...@@ -8,6 +8,7 @@ namespace XLS
SerBool::SerBool() SerBool::SerBool()
{ {
fixed_type = typeSerBool;
} }
......
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
virtual const std::wstring toString() const; virtual const std::wstring toString() const;
private: private:
const static SerType fixed_type = typeSerBool;
unsigned char f; unsigned char f;
}; };
......
...@@ -8,6 +8,7 @@ namespace XLS ...@@ -8,6 +8,7 @@ namespace XLS
SerErr::SerErr() SerErr::SerErr()
{ {
fixed_type= typeSerErr;
} }
......
...@@ -18,7 +18,6 @@ public: ...@@ -18,7 +18,6 @@ public:
virtual const std::wstring toString() const; virtual const std::wstring toString() const;
private: private:
const static SerType fixed_type = typeSerErr;
BErr err; BErr err;
}; };
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
namespace XLS namespace XLS
{ {
SerNil::SerNil()
{
fixed_type = typeSerNil;
}
BiffStructurePtr SerNil::clone() BiffStructurePtr SerNil::clone()
{ {
......
...@@ -9,13 +9,12 @@ class SerNil : public SerAr ...@@ -9,13 +9,12 @@ class SerNil : public SerAr
{ {
BASE_STRUCTURE_DEFINE_CLASS_NAME(SerNil) BASE_STRUCTURE_DEFINE_CLASS_NAME(SerNil)
public: public:
SerNil();
BiffStructurePtr clone(); BiffStructurePtr clone();
virtual void load(CFRecord& record); virtual void load(CFRecord& record);
virtual void store(CFRecord& record); virtual void store(CFRecord& record);
virtual const std::wstring toString() const; virtual const std::wstring toString() const;
private:
const static SerType fixed_type = typeSerNil;
}; };
} // namespace XLS } // namespace XLS
...@@ -8,6 +8,7 @@ namespace XLS ...@@ -8,6 +8,7 @@ namespace XLS
SerNum::SerNum() SerNum::SerNum()
{ {
fixed_type = typeSerNum;
} }
......
...@@ -17,7 +17,6 @@ public: ...@@ -17,7 +17,6 @@ public:
virtual const std::wstring toString() const; virtual const std::wstring toString() const;
private: private:
const static SerType fixed_type = typeSerNum;
double xnum; double xnum;
}; };
......
...@@ -10,6 +10,7 @@ namespace XLS ...@@ -10,6 +10,7 @@ namespace XLS
SerStr::SerStr() SerStr::SerStr()
{ {
fixed_type = typeSerStr;
} }
......
...@@ -17,8 +17,6 @@ public: ...@@ -17,8 +17,6 @@ public:
virtual void store(CFRecord& record); virtual void store(CFRecord& record);
virtual const std::wstring toString() const; virtual const std::wstring toString() const;
private:
const static SerType fixed_type = typeSerStr;
XLUnicodeString string_; XLUnicodeString string_;
}; };
......
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
CondDataValue condDataValue; CondDataValue condDataValue;
CFFlag cfflag; CFFlag cfflag;
long cchSt; int cchSt;
XLUnicodeStringNoCch stSslist; XLUnicodeStringNoCch stSslist;
}; };
......
...@@ -19,7 +19,7 @@ public: ...@@ -19,7 +19,7 @@ public:
virtual void load(CFRecord& record); virtual void load(CFRecord& record);
virtual void store(CFRecord& record); virtual void store(CFRecord& record);
long twpHeight; int twpHeight;
Ts ts; Ts ts;
short bls; short bls;
short sss; short sss;
......
...@@ -102,7 +102,7 @@ void StyleXF::load(CFRecord& record) ...@@ -102,7 +102,7 @@ void StyleXF::load(CFRecord& record)
void StyleXF::RegisterFillBorder() void StyleXF::RegisterFillBorder()
{ {
for (long i = 0; i < ext_props.size(); i++ ) for (int i = 0; i < ext_props.size(); i++ )
{ {
ExtProp* ext_prop = dynamic_cast<ExtProp*>(ext_props[i].get()); ExtProp* ext_prop = dynamic_cast<ExtProp*>(ext_props[i].get());
......
...@@ -125,7 +125,7 @@ void XLUnicodeRichExtendedString::store(CFRecord& record) ...@@ -125,7 +125,7 @@ void XLUnicodeRichExtendedString::store(CFRecord& record)
} }
if(fExtSt) if(fExtSt)
{ {
long cbExtRst = extRst.getSize(); int cbExtRst = extRst.getSize();
record << cbExtRst; record << cbExtRst;
} }
...@@ -185,7 +185,7 @@ void XLUnicodeRichExtendedString::load(CFRecord& record) ...@@ -185,7 +185,7 @@ void XLUnicodeRichExtendedString::load(CFRecord& record)
{ {
record >> cRun; record >> cRun;
} }
long cbExtRst = 0; int cbExtRst = 0;
if(fExtSt) if(fExtSt)
{ {
record >> cbExtRst; record >> cbExtRst;
...@@ -232,8 +232,12 @@ void XLUnicodeRichExtendedString::loadSymbols(CFRecord& record, const size_t cch ...@@ -232,8 +232,12 @@ void XLUnicodeRichExtendedString::loadSymbols(CFRecord& record, const size_t cch
if(is_wide) if(is_wide)
{ {
#if defined(_WIN32) || defined(_WIN64)
std::wstring int_str(record.getCurData<wchar_t>(), cch); std::wstring int_str(record.getCurData<wchar_t>(), cch);
str_ = int_str.c_str(); str_ = int_str.c_str();
#else
str_ = convertUtf16ToWString(record.getCurData<UTF16>(), cch);
#endif
} }
else else
{ {
...@@ -284,11 +288,11 @@ const size_t XLUnicodeRichExtendedString::getNonVariablePartSize() const ...@@ -284,11 +288,11 @@ const size_t XLUnicodeRichExtendedString::getNonVariablePartSize() const
unsigned short size = sizeof(unsigned short)/*cch*/ + sizeof(unsigned char)/*flags*/; unsigned short size = sizeof(unsigned short)/*cch*/ + sizeof(unsigned char)/*flags*/;
if(fRichSt) if(fRichSt)
{ {
size += sizeof(unsigned short)/*cRun*/; size += sizeof(unsigned short)/*cRun*/; //2 !!!!
} }
if(fExtSt) if(fExtSt)
{ {
size += sizeof(long)/*cbExtRst*/; size += sizeof(int)/*cbExtRst*/; // ??? 4!!!
} }
return size; return size;
} }
......
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
static const ElementType type = typeCELL; static const ElementType type = typeCELL;
long RowNumber; int RowNumber;
std::vector<CellRef>& shared_formulas_locations_ref_; std::vector<CellRef>& shared_formulas_locations_ref_;
}; };
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
std::vector<CellRef>& shared_formulas_locations_ref_; std::vector<CellRef>& shared_formulas_locations_ref_;
long m_count_CELL_GROUP; int m_count_CELL_GROUP;
}; };
} // namespace XLS } // namespace XLS
......
...@@ -101,7 +101,7 @@ int FORMATTING::serialize1(std::wostream & stream) ...@@ -101,7 +101,7 @@ int FORMATTING::serialize1(std::wostream & stream)
CP_XML_NODE(L"numFmts") CP_XML_NODE(L"numFmts")
{ {
CP_XML_ATTR(L"count", m_Formats.size()); CP_XML_ATTR(L"count", m_Formats.size());
for (long i = 0 ; i < m_Formats.size(); i++) for (int i = 0 ; i < m_Formats.size(); i++)
{ {
m_Formats[i]->serialize(CP_XML_STREAM()); m_Formats[i]->serialize(CP_XML_STREAM());
} }
...@@ -112,7 +112,7 @@ int FORMATTING::serialize1(std::wostream & stream) ...@@ -112,7 +112,7 @@ int FORMATTING::serialize1(std::wostream & stream)
CP_XML_NODE(L"fonts") CP_XML_NODE(L"fonts")
{ {
CP_XML_ATTR(L"count", m_Fonts.size()); CP_XML_ATTR(L"count", m_Fonts.size());
for (long i = 0 ; i < m_Fonts.size(); i++) for (int i = 0 ; i < m_Fonts.size(); i++)
{ {
Font * font = dynamic_cast<Font*>(m_Fonts[i].get()); Font * font = dynamic_cast<Font*>(m_Fonts[i].get());
std::map<int, FillInfoExt>::iterator it = global_info->fonts_color_ext.find(i); std::map<int, FillInfoExt>::iterator it = global_info->fonts_color_ext.find(i);
......
...@@ -87,7 +87,7 @@ int STYLES::serialize(std::wostream & stream) ...@@ -87,7 +87,7 @@ int STYLES::serialize(std::wostream & stream)
} }
} }
for (long i = 0; i < styleExt->xfProps.xfPropArray.size(); i++) for (int i = 0; i < styleExt->xfProps.xfPropArray.size(); i++)
{ {
} }
} }
......
...@@ -115,7 +115,7 @@ const bool XFS::loadContent(BinProcessor& proc) ...@@ -115,7 +115,7 @@ const bool XFS::loadContent(BinProcessor& proc)
}*/ }*/
} }
for (long i = 0 ; i < m_cell_xfs.size(); i++) for (int i = 0 ; i < m_cell_xfs.size(); i++)
{ {
XF *xfs = dynamic_cast<XF*>(m_cell_xfs[i].get()); XF *xfs = dynamic_cast<XF*>(m_cell_xfs[i].get());
...@@ -151,7 +151,7 @@ int XFS::serialize(std::wostream & stream) ...@@ -151,7 +151,7 @@ int XFS::serialize(std::wostream & stream)
CP_XML_NODE(L"cellStyleXfs") CP_XML_NODE(L"cellStyleXfs")
{ {
CP_XML_ATTR(L"count", m_cell_styles.size()); CP_XML_ATTR(L"count", m_cell_styles.size());
for (long i = 0; i < m_cell_styles.size(); i++) for (int i = 0; i < m_cell_styles.size(); i++)
{ {
m_cell_styles[i]->serialize(CP_XML_STREAM()); m_cell_styles[i]->serialize(CP_XML_STREAM());
} }
...@@ -159,7 +159,7 @@ int XFS::serialize(std::wostream & stream) ...@@ -159,7 +159,7 @@ int XFS::serialize(std::wostream & stream)
CP_XML_NODE(L"cellXfs") CP_XML_NODE(L"cellXfs")
{ {
CP_XML_ATTR(L"count", m_cell_xfs.size()); CP_XML_ATTR(L"count", m_cell_xfs.size());
for (long i = 0; i < m_cell_xfs.size(); i++) for (int i = 0; i < m_cell_xfs.size(); i++)
{ {
m_cell_xfs[i]->serialize(CP_XML_STREAM()); m_cell_xfs[i]->serialize(CP_XML_STREAM());
} }
......
...@@ -225,7 +225,7 @@ void XlsConverter::convert(XLS::WorkbookStreamObject* woorkbook) ...@@ -225,7 +225,7 @@ void XlsConverter::convert(XLS::WorkbookStreamObject* woorkbook)
convert((XLS::GlobalsSubstream*)woorkbook->m_GlobalsSubstream.get()); convert((XLS::GlobalsSubstream*)woorkbook->m_GlobalsSubstream.get());
for (long i=0 ; i < woorkbook->m_WorksheetSubstream.size(); i++) for (int i=0 ; i < woorkbook->m_WorksheetSubstream.size(); i++)
{ {
xlsx_context->start_table(xls_global_info->sheets_names[i]); xlsx_context->start_table(xls_global_info->sheets_names[i]);
convert((XLS::WorksheetSubstream*)woorkbook->m_WorksheetSubstream[i].get()); convert((XLS::WorksheetSubstream*)woorkbook->m_WorksheetSubstream[i].get());
...@@ -271,14 +271,14 @@ void XlsConverter::convert(XLS::WorksheetSubstream* sheet) ...@@ -271,14 +271,14 @@ void XlsConverter::convert(XLS::WorksheetSubstream* sheet)
{ {
CP_XML_NODE(L"mergeCells") CP_XML_NODE(L"mergeCells")
{ {
for (long i = 0 ; i < sheet->m_MergeCells.size(); i++) for (int i = 0 ; i < sheet->m_MergeCells.size(); i++)
{ {
sheet->m_MergeCells[i]->serialize(CP_XML_STREAM()); sheet->m_MergeCells[i]->serialize(CP_XML_STREAM());
} }
} }
} }
} }
for (long i = 0 ; i < sheet->m_HLINK.size(); i++) for (int i = 0 ; i < sheet->m_HLINK.size(); i++)
{ {
convert((XLS::HLINK*)sheet->m_HLINK[i].get()); convert((XLS::HLINK*)sheet->m_HLINK[i].get());
} }
...@@ -300,12 +300,12 @@ void XlsConverter::convert(XLS::GlobalsSubstream* global) ...@@ -300,12 +300,12 @@ void XlsConverter::convert(XLS::GlobalsSubstream* global)
convert((XLS::SHAREDSTRINGS*)global->m_SHAREDSTRINGS.get()); convert((XLS::SHAREDSTRINGS*)global->m_SHAREDSTRINGS.get());
for (long i = 0 ; i < global->m_LBL.size(); i++) for (int i = 0 ; i < global->m_LBL.size(); i++)
{ {
convert((XLS::LBL*)global->m_LBL[i].get()); convert((XLS::LBL*)global->m_LBL[i].get());
} }
for (long i = 0 ; i < global->m_MSODRAWINGGROUP.size(); i++) for (int i = 0 ; i < global->m_MSODRAWINGGROUP.size(); i++)
{ {
convert((XLS::MSODRAWINGGROUP*)global->m_MSODRAWINGGROUP[i].get()); convert((XLS::MSODRAWINGGROUP*)global->m_MSODRAWINGGROUP[i].get());
} }
...@@ -410,7 +410,7 @@ void XlsConverter::convert(ODRAW::OfficeArtBStoreContainer* art_bstore) ...@@ -410,7 +410,7 @@ void XlsConverter::convert(ODRAW::OfficeArtBStoreContainer* art_bstore)
FileSystem::Directory::CreateDirectory((xl_path + FILE_SEPARATOR_STR + L"media").c_str()); FileSystem::Directory::CreateDirectory((xl_path + FILE_SEPARATOR_STR + L"media").c_str());
for (long i =0 ; i < art_bstore->rgfb.size(); i++) for (int i =0 ; i < art_bstore->rgfb.size(); i++)
{ {
int bin_id = i + 1; int bin_id = i + 1;
if (art_bstore->rgfb[i]->data_size > 0 && art_bstore->rgfb[i]->pict_data) if (art_bstore->rgfb[i]->data_size > 0 && art_bstore->rgfb[i]->pict_data)
...@@ -489,7 +489,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects) ...@@ -489,7 +489,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects)
ODRAW::OfficeArtSpgrContainer *spgr = dynamic_cast<ODRAW::OfficeArtSpgrContainer*>(objects->m_MsoDrawing.get()->rgChildRec.m_OfficeArtSpgrContainer.get()); ODRAW::OfficeArtSpgrContainer *spgr = dynamic_cast<ODRAW::OfficeArtSpgrContainer*>(objects->m_MsoDrawing.get()->rgChildRec.m_OfficeArtSpgrContainer.get());
for (long i = 0 ; i < objects->m_OBJs.size(); i++) for (int i = 0 ; i < objects->m_OBJs.size(); i++)
{ {
int ind = objects->m_OBJs[i].second; int ind = objects->m_OBJs[i].second;
XLS::OBJ* OBJ = dynamic_cast<XLS::OBJ*>(objects->m_OBJs[i].first.get()); XLS::OBJ* OBJ = dynamic_cast<XLS::OBJ*>(objects->m_OBJs[i].first.get());
...@@ -516,7 +516,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects) ...@@ -516,7 +516,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects)
} }
} }
for (long i = 0; i <objects->m_TEXTOBJECTs.size(); i++) for (int i = 0; i <objects->m_TEXTOBJECTs.size(); i++)
{ {
int ind = objects->m_OBJs[i].second; int ind = objects->m_OBJs[i].second;
XLS::TEXTOBJECT* textObject = dynamic_cast<XLS::TEXTOBJECT*>(objects->m_TEXTOBJECTs[i].first.get()); XLS::TEXTOBJECT* textObject = dynamic_cast<XLS::TEXTOBJECT*>(objects->m_TEXTOBJECTs[i].first.get());
...@@ -544,7 +544,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects) ...@@ -544,7 +544,7 @@ void XlsConverter::convert(XLS::OBJECTS* objects)
} }
} }
for (long i = 0 ; i < objects->m_CHARTs.size(); i++) for (int i = 0 ; i < objects->m_CHARTs.size(); i++)
{ {
int ind = objects->m_OBJs[i].second; int ind = objects->m_OBJs[i].second;
//xlsx_context->get_chart_context().start_drawing(); //xlsx_context->get_chart_context().start_drawing();
......
...@@ -75,7 +75,7 @@ std::wstring external_items::add_image(const std::wstring & image, int bin_id) ...@@ -75,7 +75,7 @@ std::wstring external_items::add_image(const std::wstring & image, int bin_id)
std::wstring external_items::find_image(int _id, std::wstring & target, bool & isInternal) std::wstring external_items::find_image(int _id, std::wstring & target, bool & isInternal)
{ {
for (long i=0 ; i <items_.size(); i ++) for (int i=0 ; i <items_.size(); i ++)
{ {
if (items_[i].type == typeImage && items_[i].id == _id) if (items_[i].type == typeImage && items_[i].id == _id)
{ {
...@@ -88,7 +88,7 @@ std::wstring external_items::find_image(int _id, std::wstring & target, bool & i ...@@ -88,7 +88,7 @@ std::wstring external_items::find_image(int _id, std::wstring & target, bool & i
} }
std::wstring external_items::find_image(const std::wstring & target, bool & isInternal) std::wstring external_items::find_image(const std::wstring & target, bool & isInternal)
{ {
for (long i=0 ; i <items_.size(); i ++) for (int i=0 ; i <items_.size(); i ++)
{ {
if (items_[i].type == typeImage && items_[i].uri == target) if (items_[i].type == typeImage && items_[i].uri == target)
{ {
......
...@@ -75,7 +75,11 @@ void content_types_file::set_media(external_items & _Mediaitems) ...@@ -75,7 +75,11 @@ void content_types_file::set_media(external_items & _Mediaitems)
simple_element::simple_element(const std::wstring & FileName, const std::wstring & Content) : file_name_(FileName) simple_element::simple_element(const std::wstring & FileName, const std::wstring & Content) : file_name_(FileName)
{ {
utf8::utf16to8(Content.begin(), Content.end(), std::back_inserter(content_utf8_)); //utf8::utf16to8(Content.begin(), Content.end(), std::back_inserter(content_utf8_));
//падает на спец символах
content = Content;
} }
void simple_element::write(const std::wstring & RootPath) void simple_element::write(const std::wstring & RootPath)
...@@ -87,7 +91,8 @@ void simple_element::write(const std::wstring & RootPath) ...@@ -87,7 +91,8 @@ void simple_element::write(const std::wstring & RootPath)
{ {
std::string root = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"; std::string root = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
file.WriteFile((BYTE*)root.c_str(), root.length()); file.WriteFile((BYTE*)root.c_str(), root.length());
file.WriteFile((BYTE*)content_utf8_.c_str(), content_utf8_.length()); //file.WriteFile((BYTE*)content_utf8_.c_str(), content_utf8_.length());
file.WriteStringUTF8(content);
file.CloseFile(); file.CloseFile();
} }
} }
......
...@@ -72,7 +72,8 @@ public: ...@@ -72,7 +72,8 @@ public:
private: private:
std::wstring file_name_; std::wstring file_name_;
std::string content_utf8_; //std::string content_utf8_;
std::wstring content;
}; };
......
...@@ -143,7 +143,7 @@ void xlsx_drawing_context::start_shape(int type) ...@@ -143,7 +143,7 @@ void xlsx_drawing_context::start_shape(int type)
count_object++; count_object++;
} }
void xlsx_drawing_context::set_id(long id) void xlsx_drawing_context::set_id(int id)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
drawing_state.back().id = id; drawing_state.back().id = id;
...@@ -528,27 +528,27 @@ void xlsx_drawing_context::set_image(const std::wstring & str) ...@@ -528,27 +528,27 @@ void xlsx_drawing_context::set_image(const std::wstring & str)
drawing_state.back().image_target = str; drawing_state.back().image_target = str;
} }
void xlsx_drawing_context::set_crop_top (long val) void xlsx_drawing_context::set_crop_top (int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
drawing_state.back().image_crop[1] = val * 1.5; drawing_state.back().image_crop[1] = val * 1.5;
} }
void xlsx_drawing_context::set_crop_bottom(long val) void xlsx_drawing_context::set_crop_bottom(int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
drawing_state.back().image_crop[3] = val* 1.5; drawing_state.back().image_crop[3] = val* 1.5;
} }
void xlsx_drawing_context::set_crop_left (long val) void xlsx_drawing_context::set_crop_left (int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
drawing_state.back().image_crop[0]= val* 1.5; drawing_state.back().image_crop[0]= val* 1.5;
} }
void xlsx_drawing_context::set_crop_right (long val) void xlsx_drawing_context::set_crop_right (int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
drawing_state.back().image_crop[2] = val* 1.5; drawing_state.back().image_crop[2] = val* 1.5;
} }
void xlsx_drawing_context::set_rotation (long val) void xlsx_drawing_context::set_rotation (int val)
{ {
if (drawing_state.size() < 1 )return;//in degrees if (drawing_state.size() < 1 )return;//in degrees
drawing_state.back().rotation = val; drawing_state.back().rotation = val;
...@@ -567,7 +567,7 @@ void xlsx_drawing_context::set_line_color (int index, int type) ...@@ -567,7 +567,7 @@ void xlsx_drawing_context::set_line_color (int index, int type)
else if (type == 2) drawing_state.back().line.color.bPalette = true; else if (type == 2) drawing_state.back().line.color.bPalette = true;
} }
void xlsx_drawing_context::set_line_type (long val) void xlsx_drawing_context::set_line_type (int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
switch(val) switch(val)
...@@ -577,7 +577,7 @@ void xlsx_drawing_context::set_line_type (long val) ...@@ -577,7 +577,7 @@ void xlsx_drawing_context::set_line_type (long val)
case 2: drawing_state.back().line.type = L"blipFill"; break; case 2: drawing_state.back().line.type = L"blipFill"; break;
} }
} }
void xlsx_drawing_context::set_line_style (long val) void xlsx_drawing_context::set_line_style (int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
switch(val) switch(val)
...@@ -590,7 +590,7 @@ void xlsx_drawing_context::set_line_style (long val) ...@@ -590,7 +590,7 @@ void xlsx_drawing_context::set_line_style (long val)
} }
} }
void xlsx_drawing_context::set_line_width (long val) void xlsx_drawing_context::set_line_width (int val)
{ {
if (drawing_state.size() < 1 )return; if (drawing_state.size() < 1 )return;
drawing_state.back().line.width = val; drawing_state.back().line.width = val;
......
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
int opacity; int opacity;
std::wstring type; std::wstring type;
std::wstring style; std::wstring style;
long width; int width;
}line; }line;
}; };
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
void start_image(); void start_image();
void start_shape(int type); void start_shape(int type);
void set_id (long id); void set_id (int id);
void set_FlipH (); void set_FlipH ();
void set_FlipV (); void set_FlipV ();
void set_shape_id (int id); void set_shape_id (int id);
...@@ -123,18 +123,18 @@ public: ...@@ -123,18 +123,18 @@ public:
void set_name (const std::wstring & str); void set_name (const std::wstring & str);
void set_description(const std::wstring & str); void set_description(const std::wstring & str);
void set_crop_top (long val); void set_crop_top (int val);
void set_crop_bottom(long val); void set_crop_bottom(int val);
void set_crop_left (long val); void set_crop_left (int val);
void set_crop_right (long val); void set_crop_right (int val);
void set_rotation (long val); void set_rotation (int val);
void set_line_color (const std::wstring & color); void set_line_color (const std::wstring & color);
void set_line_color (int index, int type); void set_line_color (int index, int type);
void set_line_type (long val); void set_line_type (int val);
void set_line_style (long val); void set_line_style (int val);
void set_line_width (long val); void set_line_width (int val);
void set_image (const std::wstring & str); void set_image (const std::wstring & str);
void set_anchor (const std::wstring & str); void set_anchor (const std::wstring & str);
......
...@@ -44,7 +44,11 @@ linux-g++:!contains(QMAKE_HOST.arch, x86_64):{ ...@@ -44,7 +44,11 @@ linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DEFINES += UNICODE \ DEFINES += UNICODE \
_UNICODE _UNICODE
CONFIG(debug, debug|release){
message(Debug)
DEFINES += _DEBUG
}
#################### WINDOWS ##################### #################### WINDOWS #####################
win32 { win32 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment