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

......

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67960 954022d7-b5bf-4e40-9824-e11837661b57
parent a27866f7
......@@ -3,6 +3,7 @@
namespace XLS
{
extern int cellStyleXfs_count;
Label::Label()
{
......@@ -33,7 +34,7 @@ void Label::readFields(CFRecord& record)
record >> cell >> st;
isst_ = pGlobalWorkbookInfoPtr->startAddedSharedStrings + pGlobalWorkbookInfoPtr->arAddedSharedStrings.size() + 1;
isst_ = pGlobalWorkbookInfoPtr->startAddedSharedStrings + pGlobalWorkbookInfoPtr->arAddedSharedStrings.size() ;
pGlobalWorkbookInfoPtr->arAddedSharedStrings.push_back(st.value());
}
......@@ -48,6 +49,12 @@ int Label::serialize(std::wostream & stream)
{
CP_XML_ATTR(L"r", ref);
int st = (int)cell.ixfe - cellStyleXfs_count;
if ((cell.ixfe.value()) && (cell.ixfe > cellStyleXfs_count))
{
CP_XML_ATTR(L"s", cell.ixfe - cellStyleXfs_count);
}
CP_XML_ATTR(L"t", L"s");
CP_XML_NODE(L"v")
......
......@@ -31,6 +31,12 @@ void Number::writeFields(CFRecord& record)
void Number::readFields(CFRecord& record)
{
record >> cell >> num;
_INT32 val = 0;
if (record.getDataSize() >= 18)//SchetPrintForm.xls
{
record >> val;
}
}
const CellRef Number::getLocation() const
......
......@@ -25,10 +25,6 @@ public:
//-----------------------------
BiffStructurePtrVector sheet_ids;
public:
//BO_ATTRIB_MARKUP_BEGIN
//BO_ATTRIB_MARKUP_VECTOR_COMPLEX(sheet_ids, SheetId)
//BO_ATTRIB_MARKUP_END
};
......
......@@ -24,6 +24,7 @@ public:
static const ElementType type = typeCELL;
int RowNumber;
int ColumnNumber;
std::vector<CellRangeRef>& shared_formulas_locations_ref_;
};
......
......@@ -79,17 +79,25 @@ private:
std::vector<CellRangeRef>& shared_formulas_locations_ref_;
};
bool compare_row_in_cell(const XLS::BaseObjectPtr& first, const XLS::BaseObjectPtr& second)
struct _CompareRowCell
{
bool operator()(XLS::BaseObjectPtr & first, XLS::BaseObjectPtr & second)
{
CELL * cell_1 = dynamic_cast<CELL *>(first.get());
CELL * cell_2 = dynamic_cast<CELL *>(second.get());
if (cell_1->RowNumber <= cell_2->RowNumber)
if (!cell_1 || !cell_2)
return true;
if (cell_1->RowNumber < cell_2->RowNumber)
return true;
else
return false;
}
struct _CompareRowNumber
}
}CompareRowCell;
struct _CompareColumnCell
{
bool operator()(XLS::BaseObjectPtr & first, XLS::BaseObjectPtr & second)
{
......@@ -99,18 +107,16 @@ struct _CompareRowNumber
if (!cell_1 || !cell_2)
return true;
if (cell_1->RowNumber < cell_2->RowNumber)
if (cell_1->ColumnNumber < cell_2->ColumnNumber)
return true;
else
return false;
}
}CompareRowNumber;
}CompareColumCell;
int CELL_GROUP::serialize(std::wostream & stream)
{
elements_.sort(CompareRowNumber);
elements_.sort(CompareRowCell);// .. todooo (rownumb, list<cells> - )
CP_XML_WRITER(stream)
{
std::list<XLS::BaseObjectPtr>::iterator current_cell_start = elements_.begin();
......
......@@ -15,6 +15,8 @@ namespace XLS
CELL::CELL(std::vector<CellRangeRef>& shared_formulas_locations_ref) : shared_formulas_locations_ref_(shared_formulas_locations_ref)
{
ColumnNumber = -1;
RowNumber = -1;
}
......@@ -46,38 +48,47 @@ const bool CELL::loadContent(BinProcessor& proc)
if(proc.optional(formula_union))
{
RowNumber = formula_union.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(blank))
{
RowNumber = blank.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(mulblank))
{
RowNumber = mulblank.GetRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(rk))
{
RowNumber = rk.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(mulrk))
{
RowNumber = mulrk.GetRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(boolerr))
{
RowNumber = boolerr.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(number))
{
RowNumber = number.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(label))//
{
RowNumber = label.cell.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else if(proc.optional(labelsst))
{
RowNumber = labelsst.getLocation().getRow();
ColumnNumber = formula_union.getLocation().getColumn();
}
else
{
......
......@@ -98,7 +98,13 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
m_Dimensions = elements_.back();
elements_.pop_back();
}
count = proc.repeated<WINDOW>(1, 0);
count = proc.repeated<WINDOW>(0, 0);
while(count > 0)
{
m_arWINDOW.insert(m_arWINDOW.begin(), elements_.back());
elements_.pop_back();
count--;
}
//----------------------------------------------
// OpenOffice Calc stored files workaround (DefColWidth is mandatory and located inside COLUMNS according to [MS-XLS])
......@@ -170,23 +176,26 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
}
proc.repeated<HFPicture>(0, 0);
proc.repeated<Note>(0, 0);
proc.repeated<Note> (0, 0);
proc.repeated<PIVOTVIEW>(0, 0);
proc.optional<DCON>();
proc.optional<DCON> ();
count = proc.repeated<WINDOW>(1, 0);
while(count > 0)
{
if (elements_.back()->get_type() == typeWINDOW)
{
m_arWINDOW.insert(m_arWINDOW.begin(), elements_.back());
elements_.pop_back();
}
count--;
}
proc.optional<SheetExt>(); //BulletinSearch.xls ???
proc.repeated<CUSTOMVIEW>(0, 0);
proc.repeated<SORT>(0, 2);
proc.optional<DxGCol>();
proc.repeated<CUSTOMVIEW> (0, 0);
proc.repeated<SORT> (0, 2);
proc.optional<DxGCol> ();
count = proc.repeated<MergeCells>(0, 0);
while(count > 0)
......@@ -196,10 +205,10 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
count--;
}
proc.optional<LRng>();
proc.repeated<QUERYTABLE>(0, 0);
proc.optional<PHONETICINFO>();
proc.optional<CONDFMTS>(); // Let it be optional
proc.optional<LRng> ();
proc.repeated<QUERYTABLE> (0, 0);
proc.optional<PHONETICINFO> ();
proc.optional<CONDFMTS> (); // Let it be optional
count = proc.repeated<HLINK>(0, 0) ;
while(count > 0)
......@@ -209,14 +218,14 @@ const bool WorksheetSubstream::loadContent(BinProcessor& proc)
count--;
}
proc.optional<DVAL>();
proc.optional<CodeName>();
proc.repeated<WebPub>(0, 0);
proc.optional<DVAL> ();
proc.optional<CodeName> ();
proc.repeated<WebPub> (0, 0);
proc.repeated<CellWatch>(0, 0);
proc.optional<SheetExt>();
proc.repeated<FEAT>(0, 0);
proc.repeated<FEAT11>(0, 0);
proc.repeated<RECORD12>(0, 0);
proc.optional<SheetExt> ();
proc.repeated<FEAT> (0, 0);
proc.repeated<FEAT11> (0, 0);
proc.repeated<RECORD12> (0, 0);
#pragma message("####################### Some trash records may be skipped here")
proc.SeekToEOF(); // Thus we skip problems with the trash at the end of the stream (found in Domens.xls)
......
......@@ -186,7 +186,7 @@ public:
struct _line
{
_line() { fill.color.SetRGB(0, 0, 0);}
_line() { fill.color.SetRGB(0, 0, 0); width = 0;}
std::wstring style;
int width;
_line_typeDash typeDash;
......
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