Commit fb10c56b authored by ElenaSubbotina's avatar ElenaSubbotina

RtfFormatWriter - fix fields, XlsFormatReader - data valdation

parent 4f24ed37
......@@ -6400,6 +6400,7 @@ namespace BinDocxRW
for(int i = 0, length = Content.size(); i < length; i++)
{
OOX::WritingElement* item = Content[i];
if(OOX::et_w_tc == item->getType())
{
OOX::Logic::CTc* tc = static_cast<OOX::Logic::CTc*>(item);
......
......@@ -117,7 +117,10 @@ public:
class RtfFieldInst : public IDocumentElement
{
public:
RtfFieldInst()
{
SetDefault();
}
void SetDefaultRtf()
{
SetDefault();
......
......@@ -70,7 +70,7 @@ void Dv::readFields(CFRecord& record)
_UINT32 flags;
record >> flags;
valType = static_cast<unsigned char>(GETBITS(flags, 0, 3));
valType = static_cast<_valTypeDv>(GETBITS(flags, 0, 3));
errStyle = static_cast<unsigned char>(GETBITS(flags, 4, 6));
fStrLookup = GETBIT(flags, 7);
......@@ -79,7 +79,7 @@ void Dv::readFields(CFRecord& record)
mdImeMode = static_cast<unsigned char>(GETBITS(flags, 10, 17));
fShowInputMsg = GETBIT(flags, 18);
fShowErrorMsg = GETBIT(flags, 19);
typOperator = static_cast<unsigned char>(GETBITS(flags, 20, 23));
typOperator = static_cast<_typOperatorDv>(GETBITS(flags, 20, 23));
record >> PromptTitle >> ErrorTitle >> Prompt >> Error;
......@@ -95,9 +95,49 @@ int Dv::serialize(std::wostream & stream)
{
CP_XML_NODE(L"dataValidation")
{
CP_XML_ATTR(L"sqref", sqref.strValue);
CP_XML_ATTR(L"type", L"list");
CP_XML_ATTR(L"sqref", sqref.strValue);
CP_XML_ATTR(L"showErrorMessage", fShowErrorMsg);
CP_XML_ATTR(L"showInputMessage", fShowInputMsg);
CP_XML_ATTR(L"allowBlank", fAllowBlank);
switch(typOperator)
{
case operatorDvBetween: CP_XML_ATTR(L"operator", L"between"); break;
case operatorDvNotBetween: CP_XML_ATTR(L"operator", L"notBetween"); break;
case operatorDvEquals: CP_XML_ATTR(L"operator", L"equal"); break;
case operatorDvNotEquals: CP_XML_ATTR(L"operator", L"notEqual"); break;
case operatorDvGreaterThan: CP_XML_ATTR(L"operator", L"greaterThan"); break;
case operatorDvLessThan: CP_XML_ATTR(L"operator", L"lessThan"); break;
case operatorDvGreaterThanOrEqual: CP_XML_ATTR(L"operator", L"greaterThanOrEqual");break;
case operatorDvLessThanOrEqual: CP_XML_ATTR(L"operator", L"lessThanOrEqual"); break;
}
switch(valType)
{
case typeDvCustom: CP_XML_ATTR(L"type", L"custom"); break;
case typeDvDate: CP_XML_ATTR(L"type", L"date"); break;
case typeDvDecimal: CP_XML_ATTR(L"type", L"decimal"); break;
case typeDvList: CP_XML_ATTR(L"type", L"list"); break;
case typeDvNone: CP_XML_ATTR(L"type", L"none"); break;
case typeDvTextLength: CP_XML_ATTR(L"type", L"textLength");break;
case typeDvTime: CP_XML_ATTR(L"type", L"time"); break;
case typeDvWhole: CP_XML_ATTR(L"type", L"whole"); break;
}
if (!PromptTitle.value().empty())
{
CP_XML_ATTR(L"promtTitle", PromptTitle.value());
}
if (!Prompt.value().empty())
{
CP_XML_ATTR(L"promt", Prompt.value());
}
if (!ErrorTitle.value().empty())
{
CP_XML_ATTR(L"errorTitle", ErrorTitle.value());
}
if (!Error.value().empty())
{
CP_XML_ATTR(L"error", Error.value());
}
std::wstring sFormula1 = replace_zero(formula1.getAssembledFormula(), L",");
std::wstring sFormula2 = replace_zero(formula2.getAssembledFormula(), L",");
......
......@@ -38,9 +38,28 @@
namespace XLS
{
// Logical representation of Dv record in BIFF8
enum _typOperatorDv
{
operatorDvBetween = 0,
operatorDvNotBetween,
operatorDvEquals,
operatorDvNotEquals,
operatorDvGreaterThan,
operatorDvLessThan,
operatorDvGreaterThanOrEqual,
operatorDvLessThanOrEqual
};
enum _valTypeDv
{
typeDvCustom = 0,
typeDvDate,
typeDvDecimal,
typeDvList,
typeDvNone,
typeDvTextLength,
typeDvTime,
typeDvWhole
};
class Dv: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Dv)
......@@ -55,7 +74,7 @@ public:
int serialize(std::wostream & stream);
//-----------------------------
unsigned char valType;
_valTypeDv valType;
unsigned char errStyle;
bool fStrLookup;
......@@ -64,7 +83,7 @@ public:
unsigned char mdImeMode;
bool fShowInputMsg;
bool fShowErrorMsg;
unsigned char typOperator;
_typOperatorDv typOperator;
XLUnicodeString PromptTitle;
XLUnicodeString ErrorTitle;
......
......@@ -103,9 +103,10 @@ int Pos::serialize(std::wostream & _stream)
{
CP_XML_NODE(L"c:layoutTarget"){CP_XML_ATTR(L"val", m_iLayoutTarget == 1 ? L"outer" : L"inner");}
}
//if (m_iLinkObject == 1) x += 0.5 + (w > 0 ? w : 0);
if (m_iLinkObject == 1 && mdTopLt == 2 && mdBotRt == 2)
x += 0.5 + (w > 0 ? w : 0);
//if (m_iLinkObject == 2) x += 0.5 + (w > 0 ? w : 0);
if (m_iLinkObject == 3) y += 0 + (h > 0 ? h : 0);
//if (m_iLinkObject == 3) y += 0 + (h > 0 ? h : 0);
CP_XML_NODE(L"c:xMode") {CP_XML_ATTR(L"val", L"edge");}
CP_XML_NODE(L"c:yMode") {CP_XML_ATTR(L"val", L"edge");}
......
......@@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.2.424
VERSION = 2.0.2.425
DEFINES += INTVER=$$VERSION
TARGET = x2t
......
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