Compare commits

..

7 Commits

Author SHA1 Message Date
ee4167ec8c Merge remote-tracking branch 'origin/hotfix/v5.2.3' into develop 2018-10-25 17:48:00 +03:00
e436c13fcc [x2t] Fix bug 39456 2018-10-25 17:45:03 +03:00
8e2c980152 OdfFormat - fix after testing (#118)
OdfFormat - fix after testing
2018-10-25 17:43:11 +03:00
658bfbc348 Merge remote-tracking branch 'origin/hotfix/v5.2.3' into develop 2018-10-23 13:35:31 +03:00
ff9ef8f941 PptFormatReader - fix users files 2018-10-23 13:19:30 +03:00
0a2401471e [x2t] Fix bug 39391
Fix writing only last ConditionalFormatting from Editor.bin
2018-10-23 11:37:06 +03:00
e55dc5ea75 . 2018-10-22 15:47:09 +03:00
15 changed files with 167 additions and 71 deletions

View File

@ -95,7 +95,7 @@ namespace formulasconvert {
bool odf2oox_converter::Impl::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)
{
boost::wregex re(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.([a-zA-Z\\$]+\\d+)(?::\\.([a-zA-Z]+\\d+)){0,1}\\]");
boost::wregex re(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.([\\w^0-9\\$]+\\d+)(?::\\.([\\w^0-9]+\\d+)){0,1}\\]");
boost::wsmatch result;
bool b = boost::regex_search(expr, result, re);
@ -211,7 +211,7 @@ namespace formulasconvert {
}
std::wstring odf2oox_converter::Impl::replace_named_ref_formater1(boost::wsmatch const & what)
{
boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]+\\${0,1}\\d+)(?::\\.(\\${0,1}[\\w^0-9]+\\${0,1}\\d+)){0,1}");
std::wstring expr = what[1].str();
const std::wstring res = boost::regex_replace(
@ -235,7 +235,7 @@ namespace formulasconvert {
{
convert_with_TableName = withTableName;
boost::wregex complexRef(L"\\[(?:\$)?([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}\\]");
boost::wregex complexRef(L"\\[(?:\$)?([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]");
/*
[ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
*/
@ -252,7 +252,7 @@ namespace formulasconvert {
convert_with_TableName = withTableName;
//boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
boost::wregex complexRef(L"\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}");
boost::wregex complexRef(L"\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}");
const std::wstring res = boost::regex_replace(
expr,
@ -492,9 +492,9 @@ namespace formulasconvert {
XmlUtils::replace_all( workstr, L"FDIST(", L"_xlfn.F.DIST(");
// ROUNDUP( - тут в oox 2 параметра - разрядность нужно - ,0) - EV Requirements v2.2.3.ods
int res_find=0;
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
if (std::wstring::npos != workstr.find(L"CONCATINATE"))
{
bool l = true;
//могут быть частично заданы диапазоны
//todooo
}

View File

@ -79,7 +79,7 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
if (b)
{
boost::wregex re1(L"(\\$?\\w+\\!)?([a-zA-Z$]*\\d*)\\:?([a-zA-Z$]*\\d*)?");
boost::wregex re1(L"(\\$?\\w+\\!)?([\\w^0-9$]*\\d*)\\:?([\\w^0-9$]*\\d*)?");
// $ Sheet2 ! $ A1 : $ B5
// $ Sheet2 ! $ A : $ A
// $ Sheet2 ! $ 1 : $ 1
@ -106,9 +106,21 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
if (sz > 3)
{
std::wstring prev;
std::wstring s;
std::wstring sheet = what[1].matched ? what[1].str() : L"";
if (sheet == L"KAVYCHKA!") //todooo переделать ... временно
{
prev = L"KAVYCHKA";
sheet = L"!";
}
if (sheet == L"APOSTROF!") //todooo переделать ... временно
{
prev = L"APOSTROF";
sheet = L"!";
}
std::wstring c1 = what[2].str();
std::wstring c2 = what[3].str();
@ -122,7 +134,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
}
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
s = std::wstring(L"[") + sheet + L"." +
s = prev + L"[" + sheet + L"." +
c1 +
(c2.empty() ? L"" : (L":" + sheet + L"." + c2) ) + std::wstring(L"]");
}
@ -444,13 +456,13 @@ std::wstring oox2odf_converter::Impl::convert(const std::wstring& expr)
if (is_forbidden1(expr))
return L"NULLFORMULA";
std::wstring workstr = expr;
std::wstring workstr = expr;
replace_cells_range(workstr);
replace_vertical(workstr);
replace_semicolons(workstr);
return workstr;
}
// of:=(Formula) -> (Formula)
// (Formula) -> of:=(Formula)
std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
{
std::wstring workstr = expr;
@ -462,7 +474,7 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
std::wstring res = boost::regex_replace(
res1,
boost::wregex(L"(?!([a-zA-Z]+\\d*\\())(([a-zA-Z]+\\!)?\\$?[a-zA-Z]*\\$?\\d*(\\:\\$?[a-zA-Z]*\\$?\\d*){0,1})"),
boost::wregex(L"(?!([\\w^0-9]+\\d*\\())(([\\w^0-9]+\\!)?\\$?[\\w^0-9]*\\$?\\d*(\\:\\$?[\\w^0-9]*\\$?\\d*){0,1})"),
&oox2odf_converter::Impl::replace_arguments, boost::match_default | boost::format_all);
//SUBTOTAL(109,Expense31[Amount])

View File

@ -148,7 +148,10 @@ public:
//CP_XML_ATTR(L"aboveAverage" , 0);
if (c.rules[j].type == 1)
{
CP_XML_ATTR(L"type", *c.rules[j].formula_type);
if (c.rules[j].formula_type)
CP_XML_ATTR(L"type", *c.rules[j].formula_type);
else
CP_XML_ATTR(L"type", L"cellIs");
if ((c.rules[j].formula) && (!c.rules[j].formula->empty()))
{
CP_XML_NODE(L"formula")
@ -177,13 +180,11 @@ public:
{
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
}
if (c.rules[j].color.size() > 0)
CP_XML_NODE(L"color")
{
CP_XML_NODE(L"color")
{
CP_XML_ATTR(L"rgb", c.rules[j].color[0]);
}
}
CP_XML_ATTR(L"rgb", !c.rules[j].color.empty() ? c.rules[j].color[0] : L"FF000000");
}
}
}
else if (c.rules[j].type == 3)
@ -245,7 +246,7 @@ void xlsx_conditionalFormatting_context::add(std::wstring ref)
formulasconvert::odf2oox_converter converter;
impl_->conditionalFormattings_.push_back(conditionalFormatting());
impl_->conditionalFormattings_.back().ref = converter.convert_named_ref(ref, false, L";");
impl_->conditionalFormattings_.back().ref = converter.convert_named_ref(ref, false, L" ");
}
void xlsx_conditionalFormatting_context::add_rule(int type)
@ -260,7 +261,17 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
int pos = -1;
std::wstring val;
if ( 0 <= (pos = f.find(L"formula-is(")))
if ( f == L"unique")
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"uniqueValues";
impl_->conditionalFormattings_.back().rules.back().formula = L"0";
}
else if ( f == L"duplicate")
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"duplicateValues";
impl_->conditionalFormattings_.back().rules.back().formula = L"0";
}
else if ( 0 <= (pos = f.find(L"formula-is(")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"expression";
val = f.substr(11, f.size() - 12);
@ -292,6 +303,26 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"duplicateValues";
}
else if (0 <= (pos = f.find(L"contains-text")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"containsText";
std::wstring text = f.substr(14, f.length() - 15);
if (std::wstring::npos != text.find(L"IF(") ||
std::wstring::npos != text.find(L"AND(") ||
std::wstring::npos != text.find(L"NOT(") ||
std::wstring::npos != text.find(L"LEN(") ||
std::wstring::npos != text.find(L"TRIM(") ||
std::wstring::npos != text.find(L"ISERROR(") ||
std::wstring::npos != text.find(L"SEARCH("))
{
impl_->conditionalFormattings_.back().rules.back().text = L"";
impl_->conditionalFormattings_.back().rules.back().formula = converter.convert(text);
}
else
impl_->conditionalFormattings_.back().rules.back().text = text;
}
else if (0 <= (pos = f.find(L"top")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"top10";
@ -302,14 +333,10 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
if (0 <= (pos = f.find(L"(")))
{
val = f.substr(pos + 1, f.length() - pos - 2);
impl_->conditionalFormattings_.back().rules.back().rank = boost::lexical_cast<int>(val);
if (!val.empty())
impl_->conditionalFormattings_.back().rules.back().rank = boost::lexical_cast<int>(val);
}
}
else if (0 <= (pos = f.find(L"contains-text")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"containsText";
impl_->conditionalFormattings_.back().rules.back().text = f.substr(15, f.length() - 17);
}
else
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"cellIs";
@ -398,7 +425,11 @@ void xlsx_conditionalFormatting_context::add_sfv(int type, std::wstring value)
impl_->conditionalFormattings_.back().rules.back().formula.reset();
}
else if (!value.empty()) cfvo.val = value;
else
{
if (!value.empty()) cfvo.val = value;
else cfvo.val = L"0";
}
impl_->conditionalFormattings_.back().rules.back().cfvo.push_back(cfvo);
}

View File

@ -134,10 +134,21 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
xlsx_comments_context_ (Context->get_comments_context_handle()),
table_column_last_width_(0.0),
in_cell(false),
bEndTable(false)
bEndTable_(false),
bRTL_(false)
{
memset(&group_row_,0,sizeof(_group_row));
odf_reader::style_table_properties * table_prop = NULL;
odf_reader::style_instance * tableStyle = context_->root()->odf_context().styleContainer().style_by_name(table_style_, odf_types::style_family::Table, false);
if ((tableStyle) && (tableStyle->content()))
table_prop = tableStyle->content()->get_style_table_properties();
if ((table_prop) && (table_prop->content().common_writing_mode_attlist_.style_writing_mode_))
{
if (table_prop->content().common_writing_mode_attlist_.style_writing_mode_->get_type() == odf_types::writing_mode::RlTb)
bRTL_ = true;
}
}
void xlsx_table_state::start_column(unsigned int repeated, const std::wstring & defaultCellStyleName)
@ -149,6 +160,11 @@ void xlsx_table_state::start_column(unsigned int repeated, const std::wstring &
columns_.push_back(repeated);
}
void xlsx_table_state::set_rtl(bool val)
{
bRTL_ = val;
}
unsigned int xlsx_table_state::columns_count() const
{
return columns_count_;
@ -421,6 +437,9 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
{
CP_XML_ATTR(L"workbookViewId", 0);
if (bRTL_)
CP_XML_ATTR(L"rightToLeft", 1);
std::wstring s_col, s_row;
for (int i = 0; i < odfContext.Settings().get_table_view_count(0, tableName_); i++)
{
@ -458,7 +477,6 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
}
}
// -showRowColHeaders
// -rightToLeft
}
double default_height = (2 * context_->getMaxDigitSize().second * 72. / 96. * 100.) /100.;//in point size.

View File

@ -82,6 +82,8 @@ public:
xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName, int tableId);
std::wstring current_style() const { return table_style_; }
void set_rtl(bool val);
void start_column (unsigned int repeated, const std::wstring & defaultCellStyleName);
void start_row (const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
@ -92,8 +94,8 @@ public:
void add_empty_row(int count);
void set_end_table(){ bEndTable = true; }
bool get_end_table(){ return bEndTable; }
void set_end_table(){ bEndTable_ = true; }
bool get_end_table(){ return bEndTable_; }
std::wstring current_row_style () const;
std::wstring default_row_cell_style () const;
@ -147,17 +149,18 @@ public:
struct _group_row
{
bool enabled;
int count;
int level;
bool collapsed;
bool enabled = false;
int count = 0;
int level = 0;
bool collapsed = false;
}group_row_;
friend class xlsx_conversion_context;
friend class xlsx_table_context;
private:
bool bEndTable;
bool bRTL_;
bool bEndTable_;
xlsx_conversion_context * context_;
std::wstring tableName_;

View File

@ -744,6 +744,9 @@ void process_build_object::visit(chart_title& val)
if (val.attlist_.common_draw_position_attlist_.svg_x_)
{
t.pos_x = val.attlist_.common_draw_position_attlist_.svg_x_->get_value_unit(length::pt);
}
if (val.attlist_.common_draw_position_attlist_.svg_y_)
{
t.pos_y = val.attlist_.common_draw_position_attlist_.svg_y_->get_value_unit(length::pt);
}
t.bEnabled = true;

View File

@ -1430,17 +1430,21 @@ void ods_table_state::set_conditional_formula(std::wstring formula)
std::wstring operator_;
bool s = false;
bool split = false;
if (condition->attr_.calcext_value_)//есть опреатор
{
operator_ = *condition->attr_.calcext_value_;
int f = operator_.find(L"(");
if (f > 0)
int f_start = operator_.find(L"(");
int f_end = operator_.rfind(L")");
if (f_start > 0)
{
s= true;
operator_ = operator_.substr(0,operator_.length() - 2);
if (f_start < f_end - 1) split = true;
s = true;
operator_ = operator_.substr(0, f_end);
}
}
condition->attr_.calcext_value_= operator_ + (s ? L"(": L"") + odfFormula + (s ? L")": L"");
operator_ += (split ? L"," : L"") + odfFormula + (s ? L")" : L"");
condition->attr_.calcext_value_= operator_;
}
}
void ods_table_state::set_conditional_style_name(std::wstring style_name)

View File

@ -297,6 +297,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
}
ods_context->end_columns();
//мержи
for (size_t mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
{
if (oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.IsInit())
ods_context->add_merge_cells(oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.get());
}
//строки
if (oox_sheet->m_oSheetData.IsInit() )
{
@ -313,12 +319,6 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
oox_sheet->m_oSheetData.reset();
}
//мержи
for (size_t mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
{
if (oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.IsInit())
ods_context->add_merge_cells(oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.get());
}
if (oox_sheet->m_oDrawing.IsInit() && oox_sheet->m_oDrawing->m_oId.IsInit())
{
smart_ptr<OOX::File> oFile = oox_sheet->Find(oox_sheet->m_oDrawing->m_oId->GetValue());
@ -1504,12 +1504,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFill * fill, odf_writer::style_ta
convert(fill->m_oPatternFill->m_oFgColor.GetPointer(),
cell_properties->style_table_cell_properties_attlist_.common_background_color_attlist_.fo_background_color_);
}
else if (fill->m_oPatternFill->m_oBgColor.IsInit())
if (fill->m_oPatternFill->m_oBgColor.IsInit() && !cell_properties->style_table_cell_properties_attlist_.common_background_color_attlist_.fo_background_color_)
{
convert(fill->m_oPatternFill->m_oBgColor.GetPointer(),
cell_properties->style_table_cell_properties_attlist_.common_background_color_attlist_.fo_background_color_);
}
else if (fill->m_oPatternFill->m_oPatternType.IsInit())
if (fill->m_oPatternFill->m_oPatternType.IsInit() && !cell_properties->style_table_cell_properties_attlist_.common_background_color_attlist_.fo_background_color_)
{
switch(fill->m_oPatternFill->m_oPatternType->GetValue())
{
@ -1765,12 +1765,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::
if(color->m_oThemeColor.IsInit() && xlsx_document->m_pTheme.IsInit())
{
DWORD argb = xlsx_document->m_pTheme->themeElements.clrScheme.GetARGBFromScheme(color->m_oThemeColor->ToString());
DWORD bgra = xlsx_document->m_pTheme->themeElements.clrScheme.GetARGBFromScheme(color->m_oThemeColor->ToString());
ucR = (argb & 0x0000FF);
ucB = (argb & 0x00FF00) >> 8;
ucG = (argb & 0xFF0000) >> 16;
ucA = argb >> 24;
ucB = (bgra & 0x0000FF);
ucG = (bgra & 0x00FF00) >> 8;
ucR = (bgra & 0xFF0000) >> 16;
ucA = bgra >> 24;
result = true;
}

View File

@ -2015,7 +2015,7 @@ void CPPTUserInfo::LoadNoMainMaster(_UINT32 dwMasterID)
if (pGroup)
{
LoadGroupShapeContainer(pGroup, NULL, NULL, pLayout, pThemeWrapper, pMasterWrapper);
LoadGroupShapeContainer(pGroup, NULL, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
}
else
{

View File

@ -377,6 +377,10 @@
RelativePath="..\..\XlsxSerializerCom\Writer\CSVWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\CustormXmlWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\DocxSerializer.cpp"
>

View File

@ -98,6 +98,8 @@ namespace PPTX
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
pReader->Skip(4); // len
BYTE _type = pReader->GetUChar();
LONG _e = pReader->GetPos() + pReader->GetLong() + 4;
ULONG count = pReader->GetULong();

View File

@ -100,6 +100,8 @@ namespace PPTX
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
pReader->Skip(4); // len
BYTE _type = pReader->GetUChar();
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes

View File

@ -126,6 +126,8 @@ namespace PPTX
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
pReader->Skip(4); // len
BYTE _type = pReader->GetUChar();
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes

View File

@ -1 +1 @@
2.4.551.0
2.4.552.0

View File

@ -72,17 +72,22 @@
namespace BinXlsxRW
{
#define SEEK_TO_POS_START(type) \
nPos = aSeekPositions[2 * type - 1]; \
length = aSeekPositions[2 * type]; \
if (nPos > 0) \
pFind = mapPos.find(type); \
if (pFind != mapPos.end()) \
{ \
m_oBufferedStream.Seek(nPos); \
for (size_t i = 0; i < pFind->second.size() - 1; i+=2) \
{ \
nPos = pFind->second[i]; \
length = pFind->second[i + 1]; \
m_oBufferedStream.Seek(nPos); \
#define SEEK_TO_POS_END(elem) \
elem.toXML(oStreamWriter); \
elem.toXML(oStreamWriter); \
} \
}
#define SEEK_TO_POS_END2() \
} \
}
class ImageObject
@ -2571,10 +2576,8 @@ namespace BinXlsxRW
m_lObjectIdVML = m_pCurVmlDrawing->m_lObjectIdVML = (long)(1024 * (m_oWorkbook.m_oSheets->m_arrItems.size() + 1) + 1);
//todo bigger then last int c_oSerWorksheetsTypes::
_UINT32 aSeekPositions[2 * 256];
memset(aSeekPositions, 0, (2 * 256) * sizeof(_UINT32));
READ1_DEF(length, res, this->ReadWorksheetSeekPositions, aSeekPositions);
boost::unordered_map<BYTE, std::vector<unsigned int>> mapPos;
READ1_DEF(length, res, this->ReadWorksheetSeekPositions, &mapPos);
m_pCurWorksheet->m_bWriteDirectlyToFile = true;
m_oWorkbook.AssignOutputFilename(oCurWorksheetFile);
@ -2584,7 +2587,7 @@ namespace BinXlsxRW
NSFile::CStreamWriter oStreamWriter;
oStreamWriter.CreateFileW(sWsPath);
m_pCurStreamWriter = &oStreamWriter;
res = ReadWorksheet(aSeekPositions, oStreamWriter, poResult);
res = ReadWorksheet(mapPos, oStreamWriter, poResult);
oStreamWriter.CloseFile();
if(m_pCurSheet->m_oName.IsInit())
@ -2606,16 +2609,28 @@ namespace BinXlsxRW
}
int ReadWorksheetSeekPositions(BYTE type, long length, void* poResult)
{
_UINT32* aSeekPositions = static_cast<_UINT32*>(poResult);
aSeekPositions[2 * type - 1] = m_oBufferedStream.GetPos();
aSeekPositions[2 * type] = length;
boost::unordered_map<BYTE, std::vector<unsigned int>>* mapPos = static_cast<boost::unordered_map<BYTE, std::vector<unsigned int>>*>(poResult);
boost::unordered_map<BYTE, std::vector<unsigned int>>::iterator pFind = mapPos->find(type);
if(pFind != mapPos->end())
{
pFind->second.push_back(m_oBufferedStream.GetPos());
pFind->second.push_back(length);
}
else
{
std::vector<unsigned int> data;
data.push_back(m_oBufferedStream.GetPos());
data.push_back(length);
(*mapPos)[type] = data;
}
return c_oSerConstants::ReadUnknown;
}
int ReadWorksheet(_UINT32* aSeekPositions, NSFile::CStreamWriter& oStreamWriter, void* poResult)
int ReadWorksheet(boost::unordered_map<BYTE, std::vector<unsigned int>>& mapPos, NSFile::CStreamWriter& oStreamWriter, void* poResult)
{
int res = c_oSerConstants::ReadOk;
m_pCurWorksheet->toXMLStart(oStreamWriter);
LONG nOldPos = m_oBufferedStream.GetPos();
boost::unordered_map<BYTE, std::vector<unsigned int>>::iterator pFind;
LONG nPos;
LONG length;
SEEK_TO_POS_START(c_oSerWorksheetsTypes::SheetPr);