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

XlsFile2 - формулы, именованные диапазоны

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63719 954022d7-b5bf-4e40-9824-e11837661b57
parent 973b6d5c
......@@ -43,8 +43,19 @@ void BkHim::readFields(CFRecord& record)
unsigned int sz = record.getDataSize() - record.getRdPtr();
if (cf == 0x09)
{
//bitmap
}
else
{
//native
}
//imageBlob
if (record.checkFitReadSafe(lcb))
{
record.skipNunBytes(lcb);
}
}
......
......@@ -73,15 +73,15 @@ int Font::serialize(std::wostream & stream)
{
CP_XML_NODE(L"charset")
{
CP_XML_ATTR(L"val", *bCharSet.value());
CP_XML_ATTR(L"val", bCharSet);
}
}
if (icv.value())
if ((icv.value()) && (icv < 0x7fff) )
{
CP_XML_NODE(L"color")
{
CP_XML_ATTR(L"indexed", *icv.value());
CP_XML_ATTR(L"indexed", icv);
}
}
......@@ -93,11 +93,11 @@ int Font::serialize(std::wostream & stream)
}
}
if ((fExtend.value()) && (*fExtend.value()))
if ((fExtend.value()) && (fExtend))
{
CP_XML_NODE(L"extend")
{
CP_XML_ATTR(L"val", (int)(*fExtend.value()));
CP_XML_ATTR(L"val", fExtend);
}
}
......@@ -105,15 +105,15 @@ int Font::serialize(std::wostream & stream)
{
CP_XML_NODE(L"family")
{
CP_XML_ATTR(L"val", (int)(*bFamily.value()));
CP_XML_ATTR(L"val", bFamily);
}
}
if ((fItalic.value()) && (*fItalic.value()))
if ((fItalic.value()) && (fItalic))
{
CP_XML_NODE(L"i")
{
CP_XML_ATTR(L"val", (int)(*fItalic.value()));
CP_XML_ATTR(L"val", fItalic);
}
}
......@@ -125,11 +125,11 @@ int Font::serialize(std::wostream & stream)
}
}
if (fOutline.value())
if ((fOutline.value()) && (fOutline))
{
CP_XML_NODE(L"outline")
{
CP_XML_ATTR(L"val", (int)(*fOutline.value()));
CP_XML_ATTR(L"val", fOutline);
}
}
......@@ -141,19 +141,19 @@ int Font::serialize(std::wostream & stream)
// }
//}
if ((fShadow.value()) && (*fShadow.value()))
if ((fShadow.value()) && (fShadow))
{
CP_XML_NODE(L"shadow")
{
CP_XML_ATTR(L"val", (int)(*fShadow.value()));
CP_XML_ATTR(L"val", fShadow);
}
}
if ((fStrikeOut.value()) && (*fStrikeOut.value()))
if ((fStrikeOut.value()) && (fStrikeOut))
{
CP_XML_NODE(L"strike")
{
CP_XML_ATTR(L"val", (int)(*fStrikeOut.value()));
CP_XML_ATTR(L"val", fStrikeOut);
}
}
......@@ -161,7 +161,7 @@ int Font::serialize(std::wostream & stream)
{
CP_XML_NODE(L"sz")
{
CP_XML_ATTR(L"val", *dyHeight.value()/20);
CP_XML_ATTR(L"val", dyHeight/20);
}
}
......@@ -169,7 +169,7 @@ int Font::serialize(std::wostream & stream)
{
CP_XML_NODE(L"u")
{
switch(*uls.value())
switch(uls)
{
case 1: CP_XML_ATTR(L"val", "single");break;
case 2: CP_XML_ATTR(L"val", "double");break;
......
......@@ -43,23 +43,6 @@ public:
BIFF_BSTR Name;
NameParsedFormula rgce;
public:
//BO_ATTRIB_MARKUP_BEGIN
//BO_ATTRIB_MARKUP_ATTRIB(fHidden)
//BO_ATTRIB_MARKUP_ATTRIB(fFunc)
//BO_ATTRIB_MARKUP_ATTRIB(fOB)
//BO_ATTRIB_MARKUP_ATTRIB(fProc)
//BO_ATTRIB_MARKUP_ATTRIB(fCalcExp)
//BO_ATTRIB_MARKUP_ATTRIB(fBuiltin)
//BO_ATTRIB_MARKUP_ATTRIB(fGrp)
//BO_ATTRIB_MARKUP_ATTRIB(fPublished)
//BO_ATTRIB_MARKUP_ATTRIB(fWorkbookParam)
//BO_ATTRIB_MARKUP_ATTRIB(chKey)
//BO_ATTRIB_MARKUP_ATTRIB(itab)
//BO_ATTRIB_MARKUP_ATTRIB(Name)
//BO_ATTRIB_MARKUP_COMPLEX(rgce)
//BO_ATTRIB_MARKUP_END
};
} // namespace XLS
......
......@@ -64,15 +64,20 @@ int MulRk::serialize(std::wostream & stream)
for (long i = 0; i < cells.size(); i++)
{
Cell * cell = dynamic_cast<Cell *>(cells[i].get());
RkRec * rkrec = dynamic_cast<RkRec *>(rgrkrec[i].get());
std::wstring ref = cell->getLocation().toString();// getColRowRef(i, row);
CP_XML_NODE(L"c")
{
CP_XML_ATTR(L"r", ref);
if (cell->ixfe.value())
if ((cell->ixfe.value()) && (cell->ixfe > cellStyleXfs_count))
{
CP_XML_ATTR(L"s", *(cell->ixfe.value()) - cellStyleXfs_count);
CP_XML_ATTR(L"s", cell->ixfe - cellStyleXfs_count);
}
CP_XML_NODE(L"v")
{
CP_XML_STREAM() << rkrec->RK_.value();
}
}
}
......
......@@ -50,7 +50,7 @@ void ExtPtgArea3D::load(CFRecord& record)
}
void ExtPtgArea3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void ExtPtgArea3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
#pragma message("####################### ExtPtgArea3D record is not implemented")
Log::info("ExtPtgArea3D record is not implemented.");
......
......@@ -16,14 +16,11 @@ public:
ExtPtgArea3D(const CellRef& cell_base_ref_init);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
ExtSheetPair iTabs;
RgceAreaRel area;
const CellRef& cell_base_ref;
......
......@@ -44,7 +44,7 @@ void ExtPtgAreaErr3D::load(CFRecord& record)
}
void ExtPtgAreaErr3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void ExtPtgAreaErr3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
#pragma message("####################### ExtPtgAreaErr3D record is not implemented")
Log::info("ExtPtgAreaErr3D record is not implemented.");
......
......@@ -14,14 +14,11 @@ class ExtPtgAreaErr3D : public Ptg
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
ExtSheetPair iTabs;
};
......
......@@ -40,7 +40,7 @@ void ExtPtgErr::load(CFRecord& record)
}
void ExtPtgErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void ExtPtgErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(err.toString());
}
......
......@@ -14,14 +14,11 @@ class ExtPtgErr : public Ptg
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
BErr err;
};
......
......@@ -48,7 +48,7 @@ void ExtPtgRef3D::load(CFRecord& record)
}
void ExtPtgRef3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void ExtPtgRef3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
#pragma message("####################### ExtPtgRef3D record is not implemented")
Log::info("ExtPtgRef3D record is not implemented.");
......
......@@ -15,14 +15,11 @@ public:
ExtPtgRef3D(const CellRef& cell_base_ref_init);
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
ExtSheetPair iTabs;
RgceLocRel loc;
const CellRef& cell_base_ref;
......
......@@ -44,7 +44,7 @@ void ExtPtgRefErr3D::load(CFRecord& record)
}
void ExtPtgRefErr3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void ExtPtgRefErr3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
#pragma message("####################### ExtPtgRefErr3D record is not implemented")
Log::info("ExtPtgRefErr3D record is not implemented.");
......
......@@ -14,14 +14,11 @@ class ExtPtgRefErr3D : public Ptg
public:
BiffStructurePtr clone();
//virtual void toXML(BiffStructurePtr & parent);
//virtual const bool fromXML(BiffStructurePtr & parent);
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
ExtSheetPair iTabs;
};
......
......@@ -13,82 +13,41 @@ BiffStructurePtr FormulaValue::clone()
}
//void FormulaValue::toXML(BiffStructurePtr & parent, const std::wstring & attrib_name)
//{
// _variant_t result;
// if(0xffff != data.fExprO)
// {
// result = data.xnum;
// }
// else
// {
// switch(data.Byte1)
// {
// case 0x00: // String
// result = ""; // there must a String value follow this Formula record
// break;
// case 0x01: // Boolean
// result = data.Byte3 ? "true" : "false";
// break;
// case 0x02: // Error
// {
// BErr error;
// error.err = data.Byte3;
// result = error;
// break;
// }
// case 0x03: // Blank
// result = "";
// break;
// default:
// throw;// EXCEPT::RT::WrongBiffRecord("Unsupported type of FormulaValue.", "unknown");
// }
// }
// parent->setAttribute(attrib_name, result);
// parent->setAttribute(L"val_type", getType());
//}
//
//
//const bool FormulaValue::fromXML(BiffStructurePtr & parent, const std::wstring & attrib_name)
//{
// unsigned char val_type = getStructAttribute(parent, L"val_type");
//
// switch(val_type)
// {
// case 4:
// data.xnum = getStructAttribute(parent, attrib_name);
// break;
// case 0:
// case 3:
// data.Byte1 = val_type;
// data.fExprO = 0xffff;
// break;
// case 1:
// {
// data.Byte1 = 1;
// Boolean<unsigned char> bool_val;
// bool_val.fromXML(parent, attrib_name);
// data.Byte3 = static_cast<unsigned char>(bool_val);
// data.fExprO = 0xffff;
// break;
// }
// case 2:
// {
// std::wstring str_error = getStructAttribute(parent, attrib_name);
// data.Byte1 = 2;
// BErr error(str_error);
// data.Byte3 = error.err;
// data.fExprO = 0xffff;
// break;
// }
// default:
// throw;// EXCEPT::RT::WrongBiffRecord("Unsupported type of FormulaValue.", "unknown");
//
// }
// return true;
//}
//
std::wstring FormulaValue::getValue()
{
std::wstring result;
if(0xffff != data.fExprO)
{
result = STR::double2str(data.xnum);
}
else
{
switch(data.Byte1)
{
case 0x00: // String
result = L""; // there must a String value follow this Formula record
break;
case 0x01: // Boolean
result = data.Byte3 ? L"true" : L"false";
break;
case 0x02: // Error
{
BErr error;
error.err = data.Byte3;
result = error.toString();
break;
}
case 0x03: // Blank
result = L"";
break;
}
}
return result;
}
//
void FormulaValue::store(CFRecord& record)
{
record << data.xnum;
......@@ -101,7 +60,7 @@ void FormulaValue::load(CFRecord& record)
}
const unsigned char FormulaValue::getType() const
unsigned char FormulaValue::getType()
{
if(0xffff != data.fExprO)
{
......
......@@ -15,8 +15,9 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
const unsigned char getType() const;
unsigned char getType();
std::wstring getValue();
union
{
struct
......
......@@ -17,10 +17,8 @@ public:
virtual void load(CFRecord& record, const size_t cce);
virtual void store(CFRecord& record);
private:
virtual void load(CFRecord& record) {};
private:
bool is_part_of_a_revision_;
};
......
......@@ -23,7 +23,8 @@ class BOperatorPtg_T: public OperatorPtg
{
public:
BOperatorPtg_T() : OperatorPtg(fixedPtgId) {};
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
std::wstring operand2(ptg_stack.top());
ptg_stack.pop();
......@@ -40,7 +41,7 @@ class UOperatorPtg_T: public OperatorPtg
{
public:
UOperatorPtg_T() : OperatorPtg(fixedType) {};
void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.top() = T::getSymbols() + ptg_stack.top();
};
......@@ -301,7 +302,7 @@ public:
static const std::wstring symbols(L"%");
return symbols;
}
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.top() += getOperatorSymbols();
};
......
......@@ -40,7 +40,7 @@ const bool ParsedFormula::HasPtgTbl() const
}
const std::wstring ParsedFormula::getAssembledFormula(BiffStructurePtr & parent) const
const std::wstring ParsedFormula::getAssembledFormula() const
{
const PtgVector& ptgs = rgce.getPtgs();
if(ptgs.empty())
......@@ -51,7 +51,7 @@ const std::wstring ParsedFormula::getAssembledFormula(BiffStructurePtr & parent)
PtgQueue extra_data = rgcb.getPtgs();
for(PtgVectorIterator it = ptgs.begin(), itEnd = ptgs.end(); it != itEnd; ++it)
{
(*it)->assemble(ptg_stack, extra_data, parent);
(*it)->assemble(ptg_stack, extra_data);
}
if(1 != ptg_stack.size())
{
......@@ -61,15 +61,15 @@ const std::wstring ParsedFormula::getAssembledFormula(BiffStructurePtr & parent)
}
const bool ParsedFormula::parseStringFormula(const std::wstring formula, BiffStructurePtr & parent)
{
StringPtgParser parser;
if(parser.parseToPtgs(boost::algorithm::trim_copy(formula), rgce, rgcb, parent))
{
return true;
}
return false;
}
//const bool ParsedFormula::parseStringFormula(const std::wstring formula, const std::wstring & tag_name)
//{
// StringPtgParser parser;
// if(parser.parseToPtgs(boost::algorithm::trim_copy(formula), rgce, rgcb, tag_name))
// {
// return true;
// }
// return false;
//}
} // namespace XLS
......
......@@ -14,16 +14,13 @@ class ParsedFormula : public BiffStructure
public:
ParsedFormula(const CellRef& cell_base_ref);
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
//virtual void getXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
void setCCE(const size_t cce_val); // mandatory to call before any use of "cce"
const size_t getCCE() const;
const bool HasPtgTbl() const;
const std::wstring getAssembledFormula(BiffStructurePtr & parent) const;
const std::wstring getAssembledFormula() const;
const bool parseStringFormula(const std::wstring formula, BiffStructurePtr & parent);
//const bool parseStringFormula(const std::wstring formula, const std::wstring & tag_name);
Rgce rgce;
RgbExtra rgcb;
......
......@@ -42,7 +42,7 @@ void Ptg::addFuncWrapper(AssemblerStack& ptg_stack, const std::wstring& func_nam
}
void Ptg::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void Ptg::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
}
......
......@@ -34,20 +34,19 @@ public:
virtual void storeFields(CFRecord& record) {};
virtual const unsigned short getPtgId() const;// = 0;
const size_t getOffsetInRecord() const;
const size_t getSizeOfStruct() const;
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
protected:
void addFuncWrapper(AssemblerStack& ptg_stack, const std::wstring& func_name);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
_CP_OPT(unsigned short) ptg_id;
_CP_OPT(size_t) offset_in_record;
_CP_OPT(size_t) size_of_struct;
protected:
void addFuncWrapper(AssemblerStack& ptg_stack, const std::wstring& func_name);
};
......
......@@ -44,7 +44,7 @@ void PtgArea::loadFields(CFRecord& record)
}
void PtgArea::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgArea::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
RgceArea range(area);
if(!ptg_stack.empty())
......
......@@ -17,14 +17,13 @@ public:
PtgArea(const std::wstring& word, const PtgDataType data_type);
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x05;
private:
RgceArea area;
};
......
......@@ -55,7 +55,7 @@ void PtgArea3d::loadFields(CFRecord& record)
}
void PtgArea3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgArea3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
RevExternPtr tab_ids;
if(!extra_data.empty() && (tab_ids = boost::dynamic_pointer_cast<RevExtern>(extra_data.front())))
......
......@@ -21,10 +21,9 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x1B;
private:
unsigned short ixti;
RgceAreaRel area_rel;
RgceArea area;
......
......@@ -35,7 +35,7 @@ void PtgAreaErr::loadFields(CFRecord& record)
}
void PtgAreaErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAreaErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
if(!ptg_stack.empty() && 0 == ptg_stack.top().find(L"#PtgElfRadical"))
{
......
......@@ -18,11 +18,10 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
virtual const unsigned short getPtgId() const { return id_fixed | (static_cast<unsigned char>(data_type) << 5);}
private:
static const unsigned short id_fixed = 0x0A;
unsigned char data_type;
};
......
......@@ -34,7 +34,7 @@ void PtgAreaErr3d::loadFields(CFRecord& record)
}
void PtgAreaErr3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAreaErr3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
RevExternPtr tab_ids;
if(!extra_data.empty() && (tab_ids = boost::dynamic_pointer_cast<RevExtern>(extra_data.front())))
......
......@@ -14,13 +14,11 @@ class PtgAreaErr3d: public OperandPtg
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short ixti;
GlobalWorkbookInfoPtr global_info;
};
......
......@@ -46,7 +46,7 @@ void PtgAreaN::loadFields(CFRecord& record)
}
void PtgAreaN::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAreaN::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push((area + cell_base_ref).toString());
}
......
......@@ -16,15 +16,13 @@ public:
PtgAreaN(const std::wstring& word, const PtgDataType data_type, const CellRef cell_base_ref_init);
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x0D;
private:
CellRef cell_base_ref;
RgceAreaRel area;
};
......
......@@ -36,7 +36,7 @@ void PtgArray::loadFields(CFRecord& record)
}
void PtgArray::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgArray::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
std::wstring array_string;
......
......@@ -18,7 +18,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x00;
};
......
......@@ -31,7 +31,7 @@ void PtgAttrBaxcel::loadFields(CFRecord& record)
}
void PtgAttrBaxcel::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrBaxcel::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_datat)
{
// volatile property is not seen in the textual form
}
......
......@@ -13,13 +13,11 @@ class PtgAttrBaxcel : public Ptg
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
bool bitSemi;
};
......
......@@ -44,7 +44,7 @@ void PtgAttrChoose::loadFields(CFRecord& record)
}
void PtgAttrChoose::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrChoose::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// All control tokens shall be skipped
}
......
......@@ -13,13 +13,11 @@ class PtgAttrChoose : public Ptg
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short cOffset;
std::vector<unsigned short> rgOffset;
};
......
......@@ -30,7 +30,7 @@ void PtgAttrGoto::loadFields(CFRecord& record)
}
void PtgAttrGoto::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrGoto::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// All control tokens shall be skipped
}
......
......@@ -13,13 +13,11 @@ class PtgAttrGoto : public Ptg
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short offset;
};
......
......@@ -30,7 +30,7 @@ void PtgAttrIf::loadFields(CFRecord& record)
}
void PtgAttrIf::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrIf::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// All control tokens shall be skipped
}
......
......@@ -13,13 +13,11 @@ class PtgAttrIf : public Ptg
public:
BiffStructurePtr clone();
//virtual void setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag);
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short offset;
};
......
......@@ -24,7 +24,7 @@ void PtgAttrSemi::loadFields(CFRecord& record)
}
void PtgAttrSemi::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrSemi::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// volatile property is not seen in the textual form
}
......
......@@ -15,7 +15,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
};
......
......@@ -24,7 +24,7 @@ void PtgAttrSpace::loadFields(CFRecord& record)
}
void PtgAttrSpace::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrSpace::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// Display token, that shall be skipped
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
};
......
......@@ -24,7 +24,7 @@ void PtgAttrSpaceSemi::loadFields(CFRecord& record)
}
void PtgAttrSpaceSemi::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrSpaceSemi::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// Display token that shall be skipped
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
};
} // namespace XLS
......
......@@ -24,7 +24,7 @@ void PtgAttrSum::loadFields(CFRecord& record)
}
void PtgAttrSum::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgAttrSum::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
addFuncWrapper(ptg_stack, L"SUM");
}
......
......@@ -16,7 +16,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x1019;
};
......
......@@ -58,7 +58,7 @@ void PtgBool::loadFields(CFRecord& record)
}
void PtgBool::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgBool::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(boolean_ ? L"TRUE" : L"FALSE");
}
......
......@@ -20,7 +20,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x1D;
......
......@@ -31,7 +31,7 @@ void PtgElfCol::loadFields(CFRecord& record)
}
void PtgElfCol::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfCol::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(CellRangeRef(loc, CellRangeRef::stColumnBelow).toString());
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
RgceElfLoc loc;
......
......@@ -25,7 +25,7 @@ void PtgElfColS::loadFields(CFRecord& record)
}
void PtgElfColS::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfColS::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
PtgExtraElfPtr range;
Log::message("PtgElfColS found!!! PtgElfColS found!!! PtgElfColS found!!! PtgElfColS found!!!");
......
......@@ -16,7 +16,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
};
......
......@@ -25,7 +25,7 @@ void PtgElfColSV::loadFields(CFRecord& record)
}
void PtgElfColSV::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfColSV::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
PtgExtraElfPtr range;
Log::message("PtgElfColSV found!!! PtgElfColSV found!!! PtgElfColSV found!!! PtgElfColSV found!!!");
......
......@@ -16,7 +16,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
};
......
......@@ -31,7 +31,7 @@ void PtgElfColV::loadFields(CFRecord& record)
}
void PtgElfColV::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfColV::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(CellRangeRef(loc, CellRangeRef::stColumnBelow).toString());
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
RgceElfLoc loc;
......
......@@ -35,7 +35,7 @@ void PtgElfLel::loadFields(CFRecord& record)
}
void PtgElfLel::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfLel::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(L"#NAME?"); // The best decision I think
}
......
......@@ -18,7 +18,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
Ilel ilel;
......
......@@ -31,7 +31,7 @@ void PtgElfRadical::loadFields(CFRecord& record)
}
void PtgElfRadical::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfRadical::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// The significant tag follows (PtgArea or PtgAreaErr)
PtgParam param(PtgParam::ptELF_RADICAL, L"");
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
RgceElfLoc loc;
......
......@@ -35,7 +35,7 @@ void PtgElfRadicalLel::loadFields(CFRecord& record)
}
void PtgElfRadicalLel::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfRadicalLel::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// The significant tag follows (PtgArea or PtgAreaErr)
}
......
......@@ -18,7 +18,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
Ilel ilel;
......
......@@ -24,7 +24,7 @@ void PtgElfRadicalS::loadFields(CFRecord& record)
}
void PtgElfRadicalS::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfRadicalS::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// The significant tag follows (PtgArea or PtgAreaErr)
}
......
......@@ -16,7 +16,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
};
......
......@@ -31,7 +31,7 @@ void PtgElfRw::loadFields(CFRecord& record)
}
void PtgElfRw::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfRw::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(CellRangeRef(loc, CellRangeRef::stRow).toString());
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
RgceElfLoc loc;
......
......@@ -31,7 +31,7 @@ void PtgElfRwV::loadFields(CFRecord& record)
}
void PtgElfRwV::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgElfRwV::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(CellRangeRef(loc, CellRangeRef::stRow).toString());
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
RgceElfLoc loc;
......
......@@ -42,7 +42,7 @@ void PtgErr::loadFields(CFRecord& record)
}
void PtgErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(err.toString());
}
......
......@@ -20,7 +20,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x1C;
......
......@@ -46,7 +46,7 @@ void PtgExp::loadFields(CFRecord& record)
}
void PtgExp::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgExp::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// The reference coordinates shall be obtained from row/column values.
// No textual form need but the empty line.
......
......@@ -19,7 +19,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x01;
......
......@@ -30,13 +30,6 @@ BiffStructurePtr PtgExtraArray::clone()
}
//void PtgExtraArray::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
// xml_tag->setAttribute(L"cols", cols);
// xml_tag->setAttribute(L"rows", rows);
// std::for_each(array_.begin(), array_.end(), boost::bind(&SerAr::toXML, _1, xml_tag));
//}
//
void PtgExtraArray::store(CFRecord& record)
{
......
......@@ -42,15 +42,16 @@ void PtgFunc::loadFields(CFRecord& record)
}
void PtgFunc::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgFunc::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
long num_params = iftab.getParamsNum();
std::wstring arguments;
if(num_params)
if(num_params && ptg_stack.size() > 0)
{
arguments += ptg_stack.top();
ptg_stack.pop();
for(long i = 0; i < num_params - 1; ++i)
for(long i = 0; i < num_params - 1 && ptg_stack.size() > 0; ++i)
{
arguments = ptg_stack.top() + L',' + arguments;
ptg_stack.pop();
......
......@@ -22,7 +22,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
const long getParametersNum() const;
......
......@@ -47,7 +47,7 @@ void PtgFuncVar::loadFields(CFRecord& record)
}
void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
std::wstring arguments;
std::wstring func_name = tab.getFuncName();
......@@ -57,17 +57,20 @@ void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffS
{
--nparams;
}
if(nparams)
int sz = ptg_stack.size();
if(nparams )
{
arguments += ptg_stack.top();
ptg_stack.pop();
for(unsigned char i = 0; i < nparams - 1; ++i)
for(unsigned char i = 0; i < nparams - 1 ; ++i)
{
arguments = ptg_stack.top() + L',' + arguments;
ptg_stack.pop();
}
}
if(0xFF == tab.getIndex()) // user-defined function
if(0xFF == tab.getIndex() && ptg_stack.size() > 0) // user-defined function
{
func_name = ptg_stack.top();
ptg_stack.pop();
......
......@@ -23,7 +23,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
void setParamsNum(const unsigned char num);
......
......@@ -42,7 +42,7 @@ void PtgInt::loadFields(CFRecord& record)
}
void PtgInt::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgInt::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(STR::int2wstr(integer));
}
......
......@@ -19,7 +19,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x1E;
......
......@@ -34,7 +34,7 @@ void PtgMemArea::loadFields(CFRecord& record)
}
void PtgMemArea::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMemArea::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
PtgExtraMemPtr range;
if(extra_data.empty() || !(range = boost::dynamic_pointer_cast<PtgExtraMem>(extra_data.front())))
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short cce;
......
......@@ -31,7 +31,7 @@ void PtgMemAreaN::loadFields(CFRecord& record)
}
void PtgMemAreaN::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMemAreaN::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
PtgExtraMemPtr range;
if(extra_data.empty() || !(range = boost::dynamic_pointer_cast<PtgExtraMem>(extra_data.front())))
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short cce;
......
......@@ -35,7 +35,7 @@ void PtgMemErr::loadFields(CFRecord& record)
}
void PtgMemErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMemErr::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
//ptg_stack.push("#CACHE(" + STR::int2str(getOffsetInRecord() + getSizeOfStruct() + cce, 10) + ")!" + err.toString());
}
......
......@@ -18,7 +18,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
BErr err;
......
......@@ -30,7 +30,7 @@ void PtgMemFunc::loadFields(CFRecord& record)
}
void PtgMemFunc::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMemFunc::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// no textual form
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short cce;
......
......@@ -32,7 +32,7 @@ void PtgMemNoMem::loadFields(CFRecord& record)
}
void PtgMemNoMem::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMemNoMem::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// I assume it doesn't generate an error.
}
......
......@@ -17,7 +17,7 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned short cce;
......
......@@ -45,7 +45,7 @@ void PtgMemNoMemN::load(CFRecord& record)
}
void PtgMemNoMemN::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMemNoMemN::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
// I assume it doesn't generate an error.
}
......
......@@ -18,7 +18,7 @@ public:
virtual void load(CFRecord& record);
virtual void store(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
private:
unsigned char type;
......
......@@ -18,7 +18,7 @@ BiffStructurePtr PtgMissArg::clone()
}
void PtgMissArg::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgMissArg::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
ptg_stack.push(L"");
}
......
......@@ -12,7 +12,7 @@ public:
PtgMissArg();
BiffStructurePtr clone();
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x16;
};
......
......@@ -25,12 +25,6 @@ BiffStructurePtr PtgName::clone()
}
//void PtgName::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
// xml_tag->setAttribute(L"nameindex", nameindex);
//}
void PtgName::storeFields(CFRecord& record)
{
record << nameindex;
......@@ -40,14 +34,17 @@ void PtgName::storeFields(CFRecord& record)
void PtgName::loadFields(CFRecord& record)
{
record >> nameindex;
global_info = record.getGlobalWorkbookInfo();
}
void PtgName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
RevNameTabidPtr tab_id;
if(!extra_data.empty() && (tab_id = boost::dynamic_pointer_cast<RevNameTabid>(extra_data.front())))
{
#pragma message("####################### PtgName struct for revisions is not checked")
Log::info("PtgName struct for revisions is not checked.");
ptg_stack.push(tab_id->toString());
......@@ -55,18 +52,21 @@ void PtgName::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStru
return;
}
//std::wstring query = L"root/WorkbookStreamObject/GlobalsSubstream/LBL[position() = " +
// STR::int2wstr(nameindex, 10) + L"]/Lbl/@Name";
//MSXML2::IXMLDOMNodePtr node = parent->GetownerDocument()->selectSingleNode(query.c_str());
//if(node)
//{
// ptg_stack.push(static_cast<wchar_t*>(node->Gettext()));
//}
//else
//{
// ptg_stack.push(L"#UNDEFINED_NAME(" + STR::int2wstr(nameindex) + L")!");
//}
std::wstring ptg;
if ((global_info) && (nameindex <= global_info->defineNames.size()))
{
ptg = global_info->defineNames[nameindex-1];
}
if(!ptg.empty())
{
ptg_stack.push(ptg);
}
else
{
ptg_stack.push(L"#UNDEFINED_NAME(" + STR::int2wstr(nameindex) + L")!");
}
}
......
......@@ -20,12 +20,13 @@ public:
virtual void loadFields(CFRecord& record);
virtual void storeFields(CFRecord& record);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent);
virtual void assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data);
static const unsigned short fixed_id = 0x03;
private:
unsigned int nameindex;
private:
GlobalWorkbookInfoPtr global_info;
};
} // namespace XLS
......
......@@ -2,7 +2,6 @@
#include "PtgNameX.h"
#include "RevName.h"
#include <Binary/CFRecord.h>
//#include <Exception/WrongIntermediateXMLFormat.h>
namespace XLS
{;
......@@ -13,10 +12,10 @@ PtgNameX::PtgNameX()
}
PtgNameX::PtgNameX(const std::wstring& word, BiffStructurePtr & parent, const PtgDataType data_type)
PtgNameX::PtgNameX(const std::wstring& word, const PtgDataType data_type)
: OperandPtg(fixed_id | (static_cast<unsigned char>(data_type) << 5))
{
fromString(word, parent);
fromString(word);
}
......@@ -26,13 +25,6 @@ BiffStructurePtr PtgNameX::clone()
}
//void PtgNameX::setXMLAttributes(MSXML2::IXMLDOMElementPtr xml_tag)
//{
// xml_tag->setAttribute(L"ixti", ixti);
// xml_tag->setAttribute(L"nameindex", nameindex);
//}
void PtgNameX::storeFields(CFRecord& record)
{
record << ixti << nameindex;
......@@ -46,7 +38,7 @@ void PtgNameX::loadFields(CFRecord& record)
}
void PtgNameX::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStructurePtr & parent)
void PtgNameX::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data)
{
RevNamePtr tab_id;
if(!extra_data.empty() && (tab_id = boost::dynamic_pointer_cast<RevName>(extra_data.front())))
......@@ -77,10 +69,12 @@ void PtgNameX::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, BiffStr
}
void PtgNameX::fromString(const std::wstring& word, BiffStructurePtr & parent)
void PtgNameX::fromString(const std::wstring& word)
{
std::wstring query = L"root/WorkbookStreamObject/GlobalsSubstream/SUPBOOK";
//
//
// parent.get();
// MSXML2::IXMLDOMNodeListPtr nodes = parent->GetownerDocument()->selectNodes(query);
// MSXML2::IXMLDOMElementPtr supbook;
// size_t scounter = 0;
......@@ -114,7 +108,7 @@ void PtgNameX::fromString(const std::wstring& word, BiffStructurePtr & parent)
// }
// ++scounter;
// }
throw;// EXCEPT::LE::WrongIntermediateXMLFormat("Necessary 'ExternName' tag was not found.", __FUNCTION__);
// throw;// EXCEPT::LE::WrongIntermediateXMLFormat("Necessary 'ExternName' tag was not found.", __FUNCTION__);
}
......
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