mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
add pivot cache records conversion
This commit is contained in:
@ -55,5 +55,12 @@ void SxBool::readFields(CFRecord& record)
|
||||
|
||||
val = (flags != 0);
|
||||
}
|
||||
|
||||
void SxBool::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = val;
|
||||
record << flags;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,10 +47,11 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSxBool;
|
||||
|
||||
bool val;
|
||||
bool val = false;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -54,5 +54,10 @@ void SxErr::readFields(CFRecord& record)
|
||||
record >> wbe;
|
||||
}
|
||||
|
||||
void SxErr::writeFields(CFRecord& record)
|
||||
{
|
||||
record << wbe;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,10 +47,11 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSxErr;
|
||||
|
||||
unsigned short wbe;
|
||||
unsigned short wbe = 0;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -85,9 +85,8 @@ const bool DBB::loadContent(BinProcessor& proc)
|
||||
|
||||
const bool DBB::saveContent(BinProcessor& proc)
|
||||
{
|
||||
if(m_SXDBB == nullptr)
|
||||
return false;
|
||||
proc.mandatory(*m_SXDBB);
|
||||
if(m_SXDBB != nullptr)
|
||||
proc.mandatory(*m_SXDBB);
|
||||
for(auto i : m_arSXOPER)
|
||||
if(i != nullptr)
|
||||
proc.mandatory(*i);
|
||||
|
||||
@ -130,7 +130,6 @@ const bool SXOPER::loadContent(BinProcessor& proc)
|
||||
m_element = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
const bool SXOPER::saveContent(BinProcessor& proc)
|
||||
@ -141,12 +140,38 @@ const bool SXOPER::saveContent(BinProcessor& proc)
|
||||
number.num.data.value = std::stod(value);
|
||||
proc.mandatory(number);
|
||||
}
|
||||
else if (bBool)
|
||||
{
|
||||
SxBool boolVal;
|
||||
boolVal.val = value == L"1";
|
||||
proc.mandatory(boolVal);
|
||||
}
|
||||
else if(bString)
|
||||
{
|
||||
SXString string;
|
||||
string.segment = value;
|
||||
proc.mandatory(string);
|
||||
}
|
||||
else if(bErr)
|
||||
{
|
||||
SxErr err;
|
||||
if(value == L"NULL!")
|
||||
err.wbe = 0;
|
||||
else if(value == L"#DIV/0!")
|
||||
err.wbe = 0x07;
|
||||
else if(value == L"#VALUE!")
|
||||
err.wbe = 0x0F;
|
||||
else if(value == L"#REF!")
|
||||
err.wbe = 0x17;
|
||||
else if(value == L"#NAME?")
|
||||
err.wbe = 0x1D;
|
||||
else if(value == L"#NUM!")
|
||||
err.wbe = 0x24;
|
||||
else if(value == L"#N/A")
|
||||
err.wbe = 0x2A;
|
||||
proc.mandatory(err);
|
||||
|
||||
}
|
||||
else if(bDate)
|
||||
{
|
||||
//todo date parsing
|
||||
|
||||
@ -63,6 +63,7 @@ public:
|
||||
bool bEmpty = false;
|
||||
bool bInteger = false;
|
||||
bool bBool = false;
|
||||
bool bErr = false;
|
||||
|
||||
std::wstring value = L"";
|
||||
std::wstring node = L"";
|
||||
|
||||
Reference in New Issue
Block a user