mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-03-18 14:37:12 +08:00
Compare commits
47 Commits
core-win-3
...
core-win-3
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a4cf11c62 | |||
| 9b9d7df4e2 | |||
| c9330ee0f1 | |||
| 2214362426 | |||
| bdce91fccf | |||
| dd65f70fcb | |||
| bf600c6eb0 | |||
| 0db6728463 | |||
| 03bccc6b10 | |||
| 09c43b1179 | |||
| e6134405cb | |||
| 0499c6ff4f | |||
| 1860c19539 | |||
| 2d5015bcf2 | |||
| 390ab3bcc8 | |||
| c0d16ed7c3 | |||
| 075f70c220 | |||
| 6abf1613ec | |||
| 0abc21d4ee | |||
| 7a7cdab770 | |||
| 7c6218ccb5 | |||
| 34c5a4b3af | |||
| 9256b0f9a3 | |||
| ce370581a8 | |||
| 39647894a8 | |||
| 3d456bcc80 | |||
| 7ae3c6f2ea | |||
| 404058354e | |||
| d398488f3d | |||
| 35bd2803a4 | |||
| c312a2b868 | |||
| 08f75771b9 | |||
| 060f695fb1 | |||
| de3261521e | |||
| e7bf661432 | |||
| 6470a3a8a4 | |||
| 14aed88307 | |||
| 132f770d28 | |||
| 8f5318a9a2 | |||
| 635265eaa2 | |||
| 038a687d01 | |||
| 69e8ea6f4b | |||
| 7636ff79cc | |||
| cabf6ab32a | |||
| 688d5972ea | |||
| 81176e851c | |||
| 564b7f9c29 |
@ -62,6 +62,8 @@ public:
|
||||
std::wstring pgBorders;
|
||||
std::wstring footnotePr;
|
||||
std::wstring endnotePr;
|
||||
bool RtlGutter;
|
||||
long Gutter;
|
||||
|
||||
bool bW;
|
||||
bool bH;
|
||||
@ -76,6 +78,8 @@ public:
|
||||
bool bEvenAndOddHeaders;
|
||||
bool bSectionType;
|
||||
bool bPageNumStart;
|
||||
bool bRtlGutter;
|
||||
bool bGutter;
|
||||
SectPr()
|
||||
{
|
||||
sHeaderFooterReference = _T("");
|
||||
@ -94,6 +98,7 @@ public:
|
||||
bEvenAndOddHeaders = false;
|
||||
bSectionType = false;
|
||||
bPageNumStart = false;
|
||||
bRtlGutter = false;
|
||||
}
|
||||
std::wstring Write()
|
||||
{
|
||||
@ -152,7 +157,9 @@ public:
|
||||
sRes += L" w:header=\"" + std::to_wstring(Header) + L"\"";
|
||||
if(bFooter)
|
||||
sRes += L" w:footer=\"" + std::to_wstring(Footer) + L"\"";
|
||||
sRes += L" w:gutter=\"0\"/>";
|
||||
if(bGutter)
|
||||
sRes += L" w:gutter=\"" + std::to_wstring(Gutter) + L"\"";
|
||||
sRes += L"/>";
|
||||
}
|
||||
if(!pgBorders.empty())
|
||||
sRes += pgBorders;
|
||||
@ -160,6 +167,14 @@ public:
|
||||
if(bPageNumStart)
|
||||
sRes += L"<w:pgNumType w:start=\"" + std::to_wstring(PageNumStart) + L"\"/>";
|
||||
|
||||
if(bRtlGutter)
|
||||
{
|
||||
if(RtlGutter)
|
||||
sRes += L"<w:rtlGutter/>";
|
||||
else
|
||||
sRes += L"<w:rtlGutter w:val=\"0\"/>";
|
||||
}
|
||||
|
||||
if(!cols.empty())
|
||||
sRes += cols;
|
||||
sRes += L"<w:docGrid w:linePitch=\"360\"/>";
|
||||
@ -1481,14 +1496,25 @@ public:
|
||||
std::wstring sFormat;
|
||||
switch(Format)
|
||||
{
|
||||
case numbering_numfmt_None:sFormat = _T("none");break;
|
||||
case numbering_numfmt_Bullet:sFormat = _T("bullet");break;
|
||||
case numbering_numfmt_Decimal:sFormat = _T("decimal");break;
|
||||
case numbering_numfmt_LowerRoman:sFormat = _T("lowerRoman");break;
|
||||
case numbering_numfmt_UpperRoman:sFormat = _T("upperRoman");break;
|
||||
case numbering_numfmt_LowerLetter:sFormat = _T("lowerLetter");break;
|
||||
case numbering_numfmt_UpperLetter:sFormat = _T("upperLetter");break;
|
||||
case numbering_numfmt_DecimalZero:sFormat = _T("decimalZero");break;
|
||||
case numbering_numfmt_None: sFormat = L"none"; break;
|
||||
case numbering_numfmt_Bullet: sFormat = L"bullet"; break;
|
||||
case numbering_numfmt_Decimal: sFormat = L"decimal"; break;
|
||||
case numbering_numfmt_LowerRoman: sFormat = L"lowerRoman"; break;
|
||||
case numbering_numfmt_UpperRoman: sFormat = L"upperRoman"; break;
|
||||
case numbering_numfmt_LowerLetter: sFormat = L"lowerLetter"; break;
|
||||
case numbering_numfmt_UpperLetter: sFormat = L"upperLetter"; break;
|
||||
case numbering_numfmt_DecimalZero: sFormat = L"decimalZero"; break;
|
||||
default:
|
||||
{
|
||||
Format -= 0x2008;
|
||||
if (Format >= 0)
|
||||
{
|
||||
SimpleTypes::CNumberFormat<> numFormat;
|
||||
numFormat.SetValue((SimpleTypes::ENumberFormat)Format);
|
||||
|
||||
sFormat = numFormat.ToString();
|
||||
}
|
||||
}break;
|
||||
}
|
||||
if(!sFormat.empty())
|
||||
{
|
||||
|
||||
@ -1397,6 +1397,11 @@ int Binary_pPrReader::Read_SecPr(BYTE type, long length, void* poResult)
|
||||
READ1_DEF(length, res, this->ReadEndnotePr, &oEdnProps);
|
||||
pSectPr->endnotePr = oEdnProps.toXML();
|
||||
}
|
||||
else if( c_oSerProp_secPrType::rtlGutter == type )
|
||||
{
|
||||
pSectPr->bRtlGutter = true;
|
||||
pSectPr->RtlGutter = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -1592,6 +1597,11 @@ int Binary_pPrReader::Read_pgMar(BYTE type, long length, void* poResult)
|
||||
pSectPr->bFooter = true;
|
||||
pSectPr->Footer = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::GutterTwips == type )
|
||||
{
|
||||
pSectPr->bGutter = true;
|
||||
pSectPr->Gutter = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3518,6 +3528,50 @@ int Binary_SettingsTableReader::ReadSettings(BYTE type, long length, void* poRes
|
||||
std::wstring sListSeparator = m_oBufferedStream.GetString3(length);
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:listSeparator w:val=\"" + XmlUtils::EncodeXmlString(sListSeparator) + L"\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::GutterAtTop == type )
|
||||
{
|
||||
bool bGutterAtTop = m_oBufferedStream.GetBool();
|
||||
if (bGutterAtTop)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:gutterAtTop/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:gutterAtTop w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::MirrorMargins == type )
|
||||
{
|
||||
bool bMirrorMargins = m_oBufferedStream.GetBool();
|
||||
if (bMirrorMargins)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:mirrorMargins/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:mirrorMargins w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::PrintTwoOnOne == type )
|
||||
{
|
||||
bool bPrintTwoOnOne = m_oBufferedStream.GetBool();
|
||||
if (bPrintTwoOnOne)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:printTwoOnOne/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:printTwoOnOne w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::BookFoldPrinting == type )
|
||||
{
|
||||
bool bBookFoldPrinting = m_oBufferedStream.GetBool();
|
||||
if (bBookFoldPrinting)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldPrinting/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldPrinting w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::BookFoldPrintingSheets == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldPrintingSheets w:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::BookFoldRevPrinting == type )
|
||||
{
|
||||
bool bBookFoldRevPrinting = m_oBufferedStream.GetBool();
|
||||
if (bBookFoldRevPrinting)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldRevPrinting/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldRevPrinting w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::SdtGlobalColor == type )
|
||||
{
|
||||
rPr oRPr(m_oFileWriter.m_oFontTableWriter.m_mapFonts);
|
||||
|
||||
@ -467,7 +467,8 @@ extern int g_nCurFormatVersion;
|
||||
cols = 8,
|
||||
pgBorders = 9,
|
||||
footnotePr = 10,
|
||||
endnotePr = 11
|
||||
endnotePr = 11,
|
||||
rtlGutter = 12
|
||||
};}
|
||||
namespace c_oSerProp_secPrSettingsType{enum c_oSerProp_secPrSettingsType
|
||||
{
|
||||
@ -782,7 +783,8 @@ extern int g_nCurFormatVersion;
|
||||
RightTwips = 8,
|
||||
BottomTwips = 9,
|
||||
HeaderTwips = 10,
|
||||
FooterTwips = 11
|
||||
FooterTwips = 11,
|
||||
GutterTwips = 12
|
||||
};}
|
||||
namespace c_oSer_ColorType{enum c_oSer_ColorType
|
||||
{
|
||||
@ -816,7 +818,13 @@ extern int g_nCurFormatVersion;
|
||||
Compat = 8,
|
||||
DefaultTabStopTwips = 9,
|
||||
DecimalSymbol = 10,
|
||||
ListSeparator = 11
|
||||
ListSeparator = 11,
|
||||
GutterAtTop = 12,
|
||||
MirrorMargins = 13,
|
||||
PrintTwoOnOne = 14,
|
||||
BookFoldPrinting = 15,
|
||||
BookFoldPrintingSheets = 16,
|
||||
BookFoldRevPrinting = 17
|
||||
};}
|
||||
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
|
||||
{
|
||||
|
||||
@ -1313,6 +1313,12 @@ void Binary_pPrWriter::WriteSectPr (OOX::Logic::CSectionProperty* pSectPr)
|
||||
NULL, &pSectPr->m_oEndnotePr->m_oPos, NULL);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(pSectPr->m_oRtlGutter.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_secPrType::rtlGutter);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(pSectPr->m_oRtlGutter->m_oVal.ToBool());
|
||||
}
|
||||
}
|
||||
void Binary_pPrWriter::WritePageSettings(OOX::Logic::CSectionProperty* pSectPr)
|
||||
{
|
||||
@ -1411,6 +1417,12 @@ void Binary_pPrWriter::WritePageMargin(OOX::Logic::CSectionProperty* pSectPr)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oFooter->ToTwips());
|
||||
}
|
||||
if(pMar.m_oGutter.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::GutterTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oGutter->ToTwips());
|
||||
}
|
||||
}
|
||||
}
|
||||
void Binary_pPrWriter::WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr, std::vector<ComplexTypes::Word::CHdrFtrRef*>& aRefs, bool bHdr)
|
||||
@ -2757,15 +2769,16 @@ void BinaryNumberingTableWriter::WriteLevel(const OOX::Numbering::CLvl& lvl)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
switch(oNumberFormat.GetValue())
|
||||
{
|
||||
case SimpleTypes::numberformatNone: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_None);break;
|
||||
case SimpleTypes::numberformatBullet: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Bullet);break;
|
||||
case SimpleTypes::numberformatDecimal: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Decimal);break;
|
||||
case SimpleTypes::numberformatLowerRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerRoman);break;
|
||||
case SimpleTypes::numberformatUpperRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperRoman);break;
|
||||
case SimpleTypes::numberformatLowerLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerLetter);break;
|
||||
case SimpleTypes::numberformatUpperLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperLetter);break;
|
||||
case SimpleTypes::numberformatDecimalZero: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_DecimalZero);break;
|
||||
default: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Decimal);break;
|
||||
case SimpleTypes::numberformatNone: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_None);break;
|
||||
case SimpleTypes::numberformatBullet: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Bullet);break;
|
||||
case SimpleTypes::numberformatDecimal: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Decimal);break;
|
||||
case SimpleTypes::numberformatLowerRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerRoman);break;
|
||||
case SimpleTypes::numberformatUpperRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperRoman);break;
|
||||
case SimpleTypes::numberformatLowerLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerLetter);break;
|
||||
case SimpleTypes::numberformatUpperLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperLetter);break;
|
||||
case SimpleTypes::numberformatDecimalZero: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_DecimalZero);break;
|
||||
default:
|
||||
m_oBcw.m_oStream.WriteLONG(oNumberFormat.GetValue() + 0x2008);break; //max our numbering
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7545,6 +7558,42 @@ void BinarySettingsTableWriter::WriteSettingsContent(OOX::CSettings& oSettings,
|
||||
m_oBcw.m_oStream.WriteStringW3(oSettings.m_oListSeparator->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oGutterAtTop.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::GutterAtTop);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oGutterAtTop->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oMirrorMargins.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::MirrorMargins);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oMirrorMargins->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oPrintTwoOnOne.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::PrintTwoOnOne);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oPrintTwoOnOne->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oBookFoldPrinting.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::BookFoldPrinting);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oBookFoldPrinting->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oBookFoldPrintingSheets.IsInit() && oSettings.m_oBookFoldPrintingSheets->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::BookFoldPrintingSheets);
|
||||
m_oBcw.m_oStream.WriteLONG(oSettings.m_oBookFoldPrintingSheets->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oBookFoldRevPrinting.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::BookFoldRevPrinting);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oBookFoldRevPrinting->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettingsCustom.m_oSdtGlobalColor.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::SdtGlobalColor);
|
||||
|
||||
@ -342,6 +342,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17E17ED31AC453F800BEA2EA;
|
||||
@ -384,7 +385,7 @@
|
||||
17C1FEC01ACC42C4006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -416,7 +417,7 @@
|
||||
17C1FEC11ACC42C4006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -133,6 +133,7 @@ public:
|
||||
}
|
||||
static void oox_replace_tmp_back(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"MINYS", L"-");
|
||||
XmlUtils::replace_all( expr, L"ТОСHKA", L".");
|
||||
XmlUtils::replace_all( expr, L"VOSKL", L"!");
|
||||
|
||||
@ -149,6 +150,7 @@ public:
|
||||
|
||||
static void oox_replace_tmp(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"-", L"MINYS");
|
||||
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
|
||||
|
||||
@ -82,6 +82,7 @@ public:
|
||||
{
|
||||
CP_XML_ATTR(L"ref", c.ref_);
|
||||
CP_XML_ATTR(L"authorId", c.author_);
|
||||
CP_XML_ATTR(L"shapeId", 0);
|
||||
|
||||
CP_XML_NODE(L"text")
|
||||
{
|
||||
|
||||
@ -55,10 +55,17 @@ struct xlsx_dataValidation
|
||||
std::wstring formula1;
|
||||
std::wstring formula2;
|
||||
std::wstring operator_;
|
||||
|
||||
bool showErrorMessage = false;
|
||||
bool showInputMessage = false;
|
||||
bool showDropDown = false;
|
||||
bool allowBlank = false;
|
||||
|
||||
std::wstring error_text;
|
||||
std::wstring error_title;
|
||||
|
||||
std::wstring promt_text;
|
||||
std::wstring promt_title;
|
||||
};
|
||||
typedef shared_ptr<xlsx_dataValidation>::Type xlsx_dataValidation_ptr;
|
||||
|
||||
@ -103,24 +110,23 @@ public:
|
||||
if (jt2_next == mapCells.end() || jt2->first + 1 != jt2_next->first)
|
||||
break;
|
||||
|
||||
size_t j = 0; bool bFound = false;
|
||||
for (size_t j = 0; j < jt2_next->second.size(); j++)
|
||||
//size_t j = 0;
|
||||
bool bFound = false;
|
||||
|
||||
for (std::vector<std::pair<int, int>>::iterator v_jt2 = jt2_next->second.begin();
|
||||
v_jt2 != jt2_next->second.end(); ++v_jt2)
|
||||
{
|
||||
if (jt1->second[i].first == jt2_next->second[j].first ||
|
||||
jt1->second[i].second == jt2_next->second[j].second)
|
||||
if (jt1->second[i].first == v_jt2->first ||
|
||||
jt1->second[i].second == v_jt2->second)
|
||||
{
|
||||
bFound = true;
|
||||
jt2_next->second.erase(v_jt2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFound)
|
||||
{
|
||||
jt2_next->second.erase(jt2_next->second.begin() + j, jt2_next->second.begin() + j + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (false == bFound)
|
||||
break;
|
||||
}
|
||||
|
||||
jt2 = jt2_next;
|
||||
}
|
||||
if (!activate_ref.empty()) activate_ref += L" ";
|
||||
@ -135,11 +141,33 @@ public:
|
||||
{
|
||||
CP_XML_ATTR(L"sqref", activate_ref);
|
||||
CP_XML_ATTR(L"allowBlank", it->second->allowBlank);
|
||||
CP_XML_ATTR(L"operator", it->second->operator_);
|
||||
if (!it->second->operator_.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"operator", it->second->operator_);
|
||||
}
|
||||
CP_XML_ATTR(L"showDropDown", it->second->showDropDown);
|
||||
CP_XML_ATTR(L"showErrorMessage", it->second->showErrorMessage);
|
||||
CP_XML_ATTR(L"showInputMessage", it->second->showInputMessage);
|
||||
CP_XML_ATTR(L"type", it->second->type);
|
||||
if (!it->second->type.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"type", it->second->type);
|
||||
}
|
||||
if (!it->second->error_title.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"errorTitle", it->second->error_title);
|
||||
}
|
||||
if (!it->second->error_text.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"error", it->second->error_text);
|
||||
}
|
||||
if (!it->second->promt_title.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"promptTitle", it->second->promt_title);
|
||||
}
|
||||
if (!it->second->promt_text.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"prompt", it->second->promt_text);
|
||||
}
|
||||
|
||||
if (!it->second->formula1.empty())
|
||||
{
|
||||
@ -237,22 +265,26 @@ void xlsx_dataValidations_context::add(const std::wstring & name, const std::wst
|
||||
|
||||
impl_->mapDataValidations.insert(std::make_pair(name, _new));
|
||||
}
|
||||
void xlsx_dataValidations_context::add_help_msg(const std::wstring & name, bool val)
|
||||
void xlsx_dataValidations_context::add_help_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
pFind->second->showInputMessage = val;
|
||||
pFind->second->showInputMessage = display;
|
||||
pFind->second->promt_title = title;
|
||||
pFind->second->promt_text = content;
|
||||
}
|
||||
|
||||
void xlsx_dataValidations_context::add_error_msg(const std::wstring & name, bool val)
|
||||
void xlsx_dataValidations_context::add_error_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
pFind->second->showErrorMessage = val;
|
||||
pFind->second->showErrorMessage = display;
|
||||
pFind->second->error_title = title;
|
||||
pFind->second->error_text = content;
|
||||
}
|
||||
void xlsx_dataValidations_context::add_formula(const std::wstring & name, const std::wstring & f) // todooo пооптимальней
|
||||
{
|
||||
@ -261,10 +293,10 @@ void xlsx_dataValidations_context::add_formula(const std::wstring & name, const
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
int pos = -1;
|
||||
std::wstring val;
|
||||
size_t pos;
|
||||
std::wstring val, val2;
|
||||
|
||||
if ( 0 <= (pos = f.find(L"cell-content-is-in-list"))) //oooc: , of:
|
||||
if ( std::wstring::npos != (pos = f.find(L"cell-content-is-in-list"))) //oooc: , of:
|
||||
{
|
||||
pFind->second->type = L"list";
|
||||
val = f.substr(24 + pos, f.size() - 25 - pos);
|
||||
@ -287,6 +319,108 @@ void xlsx_dataValidations_context::add_formula(const std::wstring & name, const
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
}
|
||||
}
|
||||
else if ( std::wstring::npos != (pos = f.find(L"is-true-formula")))
|
||||
{
|
||||
pFind->second->type = L"custom";
|
||||
val = f.substr(16 + pos, f.size() - 17 - pos);
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (std::wstring::npos != (pos = f.find(L"cell-content-is-date")))
|
||||
{
|
||||
pFind->second->type = L"date";
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-decimal-number")))
|
||||
{
|
||||
pFind->second->type = L"decimal";
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-time")))
|
||||
{
|
||||
pFind->second->type = L"time";
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-whole-number")))
|
||||
{
|
||||
pFind->second->type = L"whole";
|
||||
}
|
||||
|
||||
if (std::wstring::npos != (pos = f.find(L"cell-content()==")))
|
||||
{
|
||||
pFind->second->operator_ = L"equal";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()<>")))
|
||||
{
|
||||
pFind->second->operator_ = L"notEqual";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()<=")))
|
||||
{
|
||||
pFind->second->operator_ = L"lessThanOrEqual";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()<")))
|
||||
{
|
||||
pFind->second->operator_ = L"lessThan";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 15);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 15, pos2 - pos - 15);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()>=")))
|
||||
{
|
||||
pFind->second->operator_ = L"greaterThanOrEqual";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()>")))
|
||||
{
|
||||
pFind->second->operator_ = L"greaterThan";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 15);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 15, pos2 - pos - 15);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-not-between(")))
|
||||
{
|
||||
pFind->second->operator_ = L"greaterThanOrEqual";
|
||||
|
||||
size_t pos2 = f.find(L",", pos + 27);
|
||||
size_t pos3 = f.rfind(L")");
|
||||
|
||||
val = f.substr(pos + 27, pos2 - pos - 27);
|
||||
val2 = f.substr(pos2 + 1, pos3 - pos2 - 1);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-between(")))
|
||||
{
|
||||
pFind->second->operator_ = L"between";
|
||||
|
||||
size_t pos2 = f.find(L",", pos + 24);
|
||||
size_t pos3 = f.rfind(L")");
|
||||
|
||||
val = f.substr(pos + 24, pos2 - pos - 24);
|
||||
val2 = f.substr(pos2 + 1, pos3 - pos2 - 1);
|
||||
}
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
pFind->second->formula2 = converter.convert(val2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -46,8 +46,8 @@ public:
|
||||
|
||||
void add(const std::wstring & name, /*int col, int row*/const std::wstring & ref);
|
||||
void add_formula(const std::wstring & name, const std::wstring & f);
|
||||
void add_help_msg(const std::wstring & name, bool val);
|
||||
void add_error_msg(const std::wstring & name, bool val);
|
||||
void add_help_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display);
|
||||
void add_error_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display);
|
||||
|
||||
void activate(const std::wstring & name, int col, int row/*const std::wstring & ref*/);
|
||||
|
||||
|
||||
@ -466,7 +466,7 @@ void _xlsx_drawing::serialize_vml(std::wostream & strm)
|
||||
CP_XML_NODE(L"v:shape")
|
||||
{
|
||||
CP_XML_ATTR(L"id", L"_x0000_s" + std::to_wstring(id));
|
||||
CP_XML_ATTR(L"type", sub_type == 9 ? L"#_x0000_t202" : L"#_x0000_t201");
|
||||
CP_XML_ATTR(L"type", sub_type == OBJ_Note ? L"#_x0000_t202" : L"#_x0000_t201");
|
||||
|
||||
std::wstring color;
|
||||
|
||||
@ -488,10 +488,10 @@ void _xlsx_drawing::serialize_vml(std::wostream & strm)
|
||||
CP_XML_ATTR(L"obscured", L"t");
|
||||
CP_XML_ATTR(L"color", L"black");
|
||||
}
|
||||
CP_XML_NODE(L"w10:wrap")
|
||||
{
|
||||
CP_XML_ATTR(L"type", L"none");
|
||||
}
|
||||
//CP_XML_NODE(L"w10:wrap")
|
||||
//{
|
||||
// CP_XML_ATTR(L"type", L"none");
|
||||
//}
|
||||
vml_serialize_fill(CP_XML_STREAM(), fill);
|
||||
|
||||
vml_serialize_ln(CP_XML_STREAM(), additional);
|
||||
@ -555,15 +555,18 @@ void _xlsx_drawing::serialize_vml(std::wostream & strm)
|
||||
}
|
||||
_CP_OPT(bool) visible;
|
||||
GetProperty(additional, L"visible", visible);
|
||||
if ((visible) && (*visible == false))
|
||||
if (visible)
|
||||
{
|
||||
CP_XML_NODE(L"x:Visible")
|
||||
if (*visible == false)
|
||||
{
|
||||
CP_XML_STREAM() << L"False";
|
||||
CP_XML_NODE(L"x:Visible")
|
||||
{
|
||||
CP_XML_STREAM() << L"False";
|
||||
}
|
||||
}
|
||||
else
|
||||
CP_XML_NODE(L"x:Visible");
|
||||
}
|
||||
else
|
||||
CP_XML_NODE(L"x:Visible");
|
||||
|
||||
_CP_OPT(int) nVal;
|
||||
GetProperty(additional, L"min_value", nVal);
|
||||
|
||||
@ -310,7 +310,7 @@ void xlsx_drawing_context::end_shape()
|
||||
void xlsx_drawing_context::start_comment(int base_col, int base_row)
|
||||
{
|
||||
impl_->object_description_.type_ = typeComment;
|
||||
impl_->object_description_.shape_type_ = 19; // OBJ_Note object type for vml
|
||||
impl_->object_description_.shape_type_ = 0x0019; // OBJ_Note object type for vml
|
||||
|
||||
set_property(odf_reader::_property(L"base_col", base_col));
|
||||
set_property(odf_reader::_property(L"base_row", base_row));
|
||||
|
||||
@ -340,6 +340,12 @@ void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels &
|
||||
|
||||
// из за дебелизма мсофис которому ОБЯЗАТЕЛЬНО нужно прописывать имена колонок таблицы (и они должны быть еще
|
||||
// прописаны и в самих данных таблицы !!
|
||||
|
||||
while (xlsx_data_ranges_[it->second]->header_values.size() > xlsx_data_ranges_[it->second]->cell_end.first -
|
||||
xlsx_data_ranges_[it->second]->cell_start.first + 1)
|
||||
{
|
||||
xlsx_data_ranges_[it->second]->header_values.pop_back();
|
||||
}
|
||||
int i = xlsx_data_ranges_[it->second]->header_values.size() - 1;
|
||||
for (; i >= 0; i--)
|
||||
{
|
||||
|
||||
@ -74,7 +74,10 @@ public:
|
||||
void start_drawing_content();
|
||||
std::wstring end_drawing_content();
|
||||
|
||||
void serialize_shared_strings(std::wostream & strm);
|
||||
void start_only_text();
|
||||
std::wstring end_only_text();
|
||||
|
||||
void serialize_shared_strings(std::wostream & strm);
|
||||
|
||||
void ApplyTextProperties (std::wstring style, std::wstring para_style, odf_reader::text_format_properties_content & propertiesOut);
|
||||
void ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut);
|
||||
@ -94,6 +97,7 @@ private:
|
||||
bool in_span;
|
||||
bool in_paragraph;
|
||||
bool in_cell_content;
|
||||
bool only_text;
|
||||
|
||||
odf_reader::styles_container & styles_;
|
||||
odf_reader::text_format_properties_content * text_properties_cell_;
|
||||
@ -126,7 +130,7 @@ void xlsx_text_context::Impl::serialize_shared_strings(std::wostream & strm)
|
||||
|
||||
|
||||
xlsx_text_context::Impl::Impl(odf_reader::styles_container & styles): paragraphs_cout_(0),styles_(styles),
|
||||
in_comment(false),in_draw(false),in_paragraph(false),in_span(false),in_cell_content(false)
|
||||
in_comment(false),in_draw(false),in_paragraph(false),in_span(false),in_cell_content(false),only_text(false)
|
||||
{
|
||||
local_styles_ptr_ = NULL;
|
||||
text_properties_cell_ = NULL;
|
||||
@ -136,7 +140,7 @@ void xlsx_text_context::Impl::add_text(const std::wstring & text)
|
||||
{
|
||||
text_ << text;
|
||||
|
||||
if (!in_comment && !in_draw)
|
||||
if (!in_comment && !in_draw && !only_text)
|
||||
dump_run();
|
||||
}
|
||||
|
||||
@ -149,7 +153,7 @@ void xlsx_text_context::Impl::start_paragraph(const std::wstring & styleName)
|
||||
{
|
||||
if (paragraphs_cout_++ > 0)
|
||||
{
|
||||
if ( in_comment == true )
|
||||
if ( in_comment || only_text)
|
||||
{
|
||||
// конец предыдущего абзаца и начало следующего
|
||||
//text_ << L" ";
|
||||
@ -169,7 +173,7 @@ void xlsx_text_context::Impl::start_paragraph(const std::wstring & styleName)
|
||||
|
||||
void xlsx_text_context::Impl::end_paragraph()
|
||||
{
|
||||
if (!in_comment && !in_draw)
|
||||
if (!in_comment && !in_draw && !only_text)
|
||||
{
|
||||
dump_run();
|
||||
paragraph_style_name_ = L"";
|
||||
@ -181,7 +185,7 @@ void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кус
|
||||
{
|
||||
int text_size = text_.str().length();
|
||||
|
||||
if (in_comment || in_draw)
|
||||
if (in_comment || in_draw || only_text)
|
||||
{
|
||||
if (( span_style_name_ != styleName && text_size > 0 ) || in_span)
|
||||
{
|
||||
@ -202,12 +206,12 @@ void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кус
|
||||
void xlsx_text_context::Impl::end_span() //odf корявенько написан - возможны повторы стилей в последовательных кусках текста
|
||||
//пока с анализом стилей тока комменты - остальные текстовые куски как есть.. с охрененным возможно дубляжом
|
||||
{
|
||||
if (!in_comment)
|
||||
if (!in_comment && !only_text)
|
||||
{
|
||||
dump_run();
|
||||
span_style_name_=L"";
|
||||
span_style_name_ = L"";
|
||||
}
|
||||
in_span=false;
|
||||
in_span = false;
|
||||
}
|
||||
|
||||
std::wstring xlsx_text_context::Impl::end_span2()
|
||||
@ -375,7 +379,9 @@ std::wstring xlsx_text_context::Impl::dump_paragraph(/*bool last*/)
|
||||
|
||||
std::wstring str_run = run_.str();
|
||||
|
||||
if (str_run.length() > 0 || paragraph_style_name_.length() > 0)
|
||||
if (only_text) return str_run;
|
||||
|
||||
if (false == str_run.empty() || false == paragraph_style_name_.empty())
|
||||
{
|
||||
CP_XML_WRITER(paragraph_)
|
||||
{
|
||||
@ -402,8 +408,7 @@ std::wstring xlsx_text_context::Impl::dump_run()
|
||||
{
|
||||
const std::wstring content = xml::utils::replace_text_to_xml(text_.str());
|
||||
|
||||
if (content.empty())
|
||||
return L"";
|
||||
if (content.empty()) return L"";
|
||||
|
||||
std::wstring prefix_draw;
|
||||
if (in_draw) prefix_draw = L"a:";
|
||||
@ -449,7 +454,35 @@ void xlsx_text_context::Impl::start_cell_content()
|
||||
|
||||
text_properties_cell_ = NULL;
|
||||
}
|
||||
void xlsx_text_context::Impl::start_only_text()
|
||||
{
|
||||
paragraphs_cout_ = 0;
|
||||
|
||||
run_.str(std::wstring());
|
||||
paragraph_.str(std::wstring());
|
||||
text_.str(std::wstring());
|
||||
|
||||
paragraph_style_name_ = L"";
|
||||
span_style_name_ = L"";
|
||||
|
||||
only_text = true;
|
||||
}
|
||||
std::wstring xlsx_text_context::Impl::end_only_text()
|
||||
{
|
||||
std::wstring message = dump_run();
|
||||
|
||||
paragraphs_cout_ = 0;
|
||||
|
||||
run_.str(std::wstring());
|
||||
paragraph_.str(std::wstring());
|
||||
text_.str(std::wstring());
|
||||
|
||||
paragraph_style_name_ = L"";
|
||||
span_style_name_ = L"";
|
||||
|
||||
only_text = false;
|
||||
return message;
|
||||
}
|
||||
void xlsx_text_context::Impl::start_comment_content()
|
||||
{
|
||||
paragraphs_cout_ = 0;
|
||||
@ -585,26 +618,30 @@ bool xlsx_text_context::is_drawing_context()
|
||||
{
|
||||
return impl_->is_drawing_context();
|
||||
}
|
||||
|
||||
void xlsx_text_context::start_cell_content()
|
||||
{
|
||||
return impl_->start_cell_content();
|
||||
}
|
||||
|
||||
int xlsx_text_context::end_cell_content()
|
||||
{
|
||||
return impl_->end_cell_content();
|
||||
}
|
||||
|
||||
void xlsx_text_context::start_comment_content()
|
||||
{
|
||||
return impl_->start_comment_content();
|
||||
}
|
||||
|
||||
std::wstring xlsx_text_context::end_comment_content()
|
||||
{
|
||||
return impl_->end_comment_content();
|
||||
}
|
||||
void xlsx_text_context::start_only_text()
|
||||
{
|
||||
return impl_->start_only_text();
|
||||
}
|
||||
std::wstring xlsx_text_context::end_only_text()
|
||||
{
|
||||
return impl_->end_only_text();
|
||||
}
|
||||
void xlsx_text_context::start_drawing_content()
|
||||
{
|
||||
return impl_->start_drawing_content();
|
||||
|
||||
@ -70,6 +70,9 @@ public:
|
||||
void start_cell_content();
|
||||
int end_cell_content();
|
||||
|
||||
void start_only_text();
|
||||
std::wstring end_only_text();
|
||||
|
||||
void start_comment_content();
|
||||
std::wstring end_comment_content();
|
||||
|
||||
|
||||
@ -777,7 +777,6 @@ public:
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
@ -802,7 +801,6 @@ public:
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
|
||||
@ -1249,11 +1249,31 @@ void table_content_validation::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
{
|
||||
if (content_[i]->get_type() == typeTableErrorMassage)
|
||||
{
|
||||
Context.get_dataValidations_context().add_error_msg(name, true);
|
||||
table_error_message* error = dynamic_cast<table_error_message*>(content_[i].get());
|
||||
|
||||
Context.get_text_context().start_only_text();
|
||||
for (size_t j = 0 ; j < error->content_.size(); j++)
|
||||
{
|
||||
error->content_[j]->xlsx_convert(Context);
|
||||
}
|
||||
std::wstring content = Context.get_text_context().end_only_text();
|
||||
|
||||
Context.get_dataValidations_context().add_error_msg(name, error->table_title_.get_value_or(L""), content,
|
||||
error->table_display_ ? error->table_display_->get() : true);
|
||||
}
|
||||
else if (content_[i]->get_type() == typeTableErrorMassage)
|
||||
else if (content_[i]->get_type() == typeTableHelpMassage)
|
||||
{
|
||||
Context.get_dataValidations_context().add_help_msg(name, true);
|
||||
table_help_message* help = dynamic_cast<table_help_message*>(content_[i].get());
|
||||
|
||||
Context.get_text_context().start_only_text();
|
||||
for (size_t j = 0 ; j < help->content_.size(); j++)
|
||||
{
|
||||
help->content_[j]->xlsx_convert(Context);
|
||||
}
|
||||
std::wstring content = Context.get_text_context().end_only_text();
|
||||
|
||||
Context.get_dataValidations_context().add_help_msg(name, help->table_title_.get_value_or(L""), content,
|
||||
help->table_display_ ? help->table_display_->get() : true);
|
||||
}
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
|
||||
@ -361,13 +361,13 @@ void ods_conversion_context::set_data_validation_operator(int val)
|
||||
{
|
||||
table_context_.set_data_validation_operator(val);
|
||||
}
|
||||
void ods_conversion_context::set_data_validation_error(const std::wstring &title, const std::wstring &content)
|
||||
void ods_conversion_context::set_data_validation_error(const std::wstring &title, const std::wstring &content, bool display)
|
||||
{
|
||||
table_context_.set_data_validation_error(title, content);
|
||||
table_context_.set_data_validation_error(title, content, display);
|
||||
}
|
||||
void ods_conversion_context::set_data_validation_promt(const std::wstring &title, const std::wstring &content)
|
||||
void ods_conversion_context::set_data_validation_promt(const std::wstring &title, const std::wstring &content, bool display)
|
||||
{
|
||||
table_context_.set_data_validation_promt(title, content);
|
||||
table_context_.set_data_validation_promt(title, content, display);
|
||||
}
|
||||
void ods_conversion_context::add_merge_cells(const std::wstring & ref)
|
||||
{
|
||||
|
||||
@ -105,8 +105,8 @@ public:
|
||||
void set_data_validation_operator(int val);
|
||||
void set_data_validation_content(const std::wstring &val1, const std::wstring &val2);
|
||||
void set_data_validation_allow_empty(bool val);
|
||||
void set_data_validation_error(const std::wstring &title, const std::wstring &content);
|
||||
void set_data_validation_promt(const std::wstring &title, const std::wstring &content);
|
||||
void set_data_validation_error(const std::wstring &title, const std::wstring &content, bool display);
|
||||
void set_data_validation_promt(const std::wstring &title, const std::wstring &content, bool display);
|
||||
void end_data_validation();
|
||||
//-----------------------------------------------------------------------
|
||||
ods_table_state & current_table() { return table_context_.state();}
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
|
||||
#include "ods_table_context.h"
|
||||
#include "table.h"
|
||||
#include "text_elements.h"
|
||||
|
||||
#include "ods_conversion_context.h"
|
||||
#include "logging.h"
|
||||
@ -75,7 +76,7 @@ std::wstring getCellAddress(size_t col, size_t row)
|
||||
return getColAddress(col) + getRowAddress(row);
|
||||
}
|
||||
|
||||
ods_table_context::ods_table_context(ods_conversion_context & Context): context_(Context)
|
||||
ods_table_context::ods_table_context(ods_conversion_context & Context): context_(Context), count_validations_(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -188,7 +189,7 @@ bool ods_table_context::start_data_validation( const std::wstring &strRef, int t
|
||||
boost::algorithm::split(arRefs, strRef, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
data_validation_state validation_state;
|
||||
validation_state.name = L"DataValidation_" + std::to_wstring(state().data_validations_.size() + 1);
|
||||
validation_state.name = L"DataValidation_" + std::to_wstring(++count_validations_);
|
||||
validation_state.elm = elm;
|
||||
validation_state.type = type;
|
||||
|
||||
@ -215,7 +216,7 @@ bool ods_table_context::start_data_validation( const std::wstring &strRef, int t
|
||||
|
||||
if (validation_state.refs.empty()) return false;
|
||||
|
||||
validation->table_base_cell_address_ = state().office_table_name_ + L"." + getCellAddress(validation_state.refs[0].col_start, validation_state.refs[0].row_start);
|
||||
validation->table_base_cell_address_ = state().office_table_name_ + L"." + getCellAddress(validation_state.refs[0].col_start - 1, validation_state.refs[0].row_start - 1);
|
||||
validation->table_name_ = validation_state.name;
|
||||
|
||||
table_content_validations_.root->add_child_element(elm);
|
||||
@ -298,50 +299,39 @@ void ods_table_context::set_data_validation_content( std::wstring oox_formula1,
|
||||
std::wstring odf_condition;
|
||||
switch(state().data_validations_.back().operator_)
|
||||
{
|
||||
case 0: // SimpleTypes::spreadsheet::operatorBetween
|
||||
odf_condition = L" and cell-content-between(" + odf_formula1 + L"," + odf_formula1 + L")"; break;
|
||||
case 1: // SimpleTypes::spreadsheet::operatorNotBetween
|
||||
odf_condition = L" and cell-content--not-between(" + odf_formula1 + L"," + odf_formula1 + L")"; break;
|
||||
odf_condition = L" and cell-content-is-not-between(" + odf_formula1 + L"," + odf_formula2 + L")"; break;
|
||||
case 2: // SimpleTypes::spreadsheet::operatorEqual
|
||||
odf_condition = L" and cell-content() == " + odf_formula1; break;
|
||||
odf_condition = L" and cell-content()==" + odf_formula1; break;
|
||||
case 3: // SimpleTypes::spreadsheet::operatorNotEqual
|
||||
odf_condition = L" and cell-content() <> " + odf_formula1; break;
|
||||
odf_condition = L" and cell-content()<>" + odf_formula1; break;
|
||||
case 4: // SimpleTypes::spreadsheet::operatorLessThan
|
||||
odf_condition = L" and cell-content() < " + odf_formula1; break;
|
||||
odf_condition = L" and cell-content()<" + odf_formula1; break;
|
||||
case 5: // SimpleTypes::spreadsheet::operatorLessThanOrEqual
|
||||
odf_condition = L" and cell-content() <= " + odf_formula1; break;
|
||||
odf_condition = L" and cell-content()<=" + odf_formula1; break;
|
||||
case 6: // SimpleTypes::spreadsheet::operatorGreaterThan
|
||||
odf_condition = L" and cell-content() > " + odf_formula1; break;
|
||||
odf_condition = L" and cell-content()>" + odf_formula1; break;
|
||||
case 7: // SimpleTypes::spreadsheet::operatorGreaterThanOrEqual
|
||||
odf_condition = L" and cell-content() >= " + odf_formula1; break;
|
||||
odf_condition = L" and cell-content()>=" + odf_formula1; break;
|
||||
case 0: // SimpleTypes::spreadsheet::operatorBetween
|
||||
default:
|
||||
odf_condition = L" and cell-content-is-between(" + odf_formula1 + L"," + odf_formula2 + L")"; break;
|
||||
}
|
||||
switch (state().data_validations_.back().type)
|
||||
{
|
||||
case 0://SimpleTypes::spreadsheet::validationTypeNone:
|
||||
odf_condition.clear();
|
||||
break;
|
||||
case 1://SimpleTypes::spreadsheet::validationTypeCustom:
|
||||
odf_condition = L"of:is-true-formula(" + odf_formula1 + L")";
|
||||
break;
|
||||
case 2://SimpleTypes::spreadsheet::validationTypeDate:
|
||||
{
|
||||
if (state().data_validations_.back().operator_ >= 0)
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-date()" + odf_condition;
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-date(" + odf_formula1 + L")";
|
||||
}
|
||||
odf_condition = L"of:cell-content-is-date()" + odf_condition;
|
||||
}break;
|
||||
case 3://SimpleTypes::spreadsheet::validationTypeDecimal:
|
||||
{
|
||||
if (state().data_validations_.back().operator_ >= 0)
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-decimal-number()" + odf_condition;
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-decimal-number(" + odf_formula1 + L")";
|
||||
}
|
||||
odf_condition = L"of:cell-content-is-decimal-number()" + odf_condition;
|
||||
}break;
|
||||
case 4://SimpleTypes::spreadsheet::validationTypeList:
|
||||
{
|
||||
@ -351,32 +341,18 @@ void ods_table_context::set_data_validation_content( std::wstring oox_formula1,
|
||||
break;
|
||||
case 6://SimpleTypes::spreadsheet::validationTypeTime:
|
||||
{
|
||||
if (state().data_validations_.back().operator_ >= 0)
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-time()" + odf_condition;
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-time(" + odf_formula1 + L")";
|
||||
}
|
||||
odf_condition = L"of:cell-content-is-time()" + odf_condition;
|
||||
}break;
|
||||
case 7://SimpleTypes::spreadsheet::validationTypeWhole:
|
||||
{
|
||||
if (state().data_validations_.back().operator_ >= 0)
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-whole-number()" + odf_condition;
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_condition = L"of:cell-content-is-whole-number(" + odf_formula1 + L")";
|
||||
}
|
||||
odf_condition = L"of:cell-content-is-whole-number()" + odf_condition;
|
||||
}break;
|
||||
}
|
||||
state().data_validations_.back().condition = odf_condition;
|
||||
|
||||
validation->table_condition_ = odf_condition;
|
||||
}
|
||||
void ods_table_context::set_data_validation_error(const std::wstring &title, const std::wstring &content)
|
||||
void ods_table_context::set_data_validation_error(const std::wstring &title, const std::wstring &content, bool display)
|
||||
{
|
||||
if (state().data_validations_.empty()) return;
|
||||
|
||||
@ -389,15 +365,23 @@ void ods_table_context::set_data_validation_error(const std::wstring &title, con
|
||||
|
||||
if (error_message)
|
||||
{
|
||||
error_message->table_display_ = true;
|
||||
error_message->table_display_ = display;
|
||||
if (false == title.empty()) error_message->table_title_ = title;
|
||||
|
||||
//error_message->message_type_
|
||||
|
||||
if (false == content.empty())
|
||||
{
|
||||
error_message->create_child_element(L"text", L"p");
|
||||
text_p *p = dynamic_cast<text_p*>(error_message->content_.back().get());
|
||||
if (p)
|
||||
{
|
||||
p->paragraph_.add_text(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void ods_table_context::set_data_validation_promt(const std::wstring &title, const std::wstring &content)
|
||||
void ods_table_context::set_data_validation_promt(const std::wstring &title, const std::wstring &content, bool display)
|
||||
{
|
||||
if (state().data_validations_.empty()) return;
|
||||
|
||||
@ -410,10 +394,18 @@ void ods_table_context::set_data_validation_promt(const std::wstring &title, con
|
||||
|
||||
if (help_message)
|
||||
{
|
||||
help_message->table_display_ = true;
|
||||
help_message->table_display_ = display;
|
||||
|
||||
if (false == title.empty()) help_message->table_title_ = title;
|
||||
|
||||
if (false == content.empty())
|
||||
{
|
||||
help_message->create_child_element(L"text", L"p");
|
||||
text_p *p = dynamic_cast<text_p*>(help_message->content_.back().get());
|
||||
if (p)
|
||||
{
|
||||
p->paragraph_.add_text(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,6 @@ class ods_table_context
|
||||
public:
|
||||
ods_table_context(ods_conversion_context & Context/*, ods_text_context & textCotnext*/);
|
||||
|
||||
public:
|
||||
void start_table(office_element_ptr & elm);
|
||||
void end_table();
|
||||
|
||||
@ -78,8 +77,8 @@ public:
|
||||
void set_data_validation_operator(int val);
|
||||
void set_data_validation_content(std::wstring val1, std::wstring val2);
|
||||
void set_data_validation_allow_empty(bool val);
|
||||
void set_data_validation_error(const std::wstring &title, const std::wstring &content);
|
||||
void set_data_validation_promt(const std::wstring &title, const std::wstring &content);
|
||||
void set_data_validation_error(const std::wstring &title, const std::wstring &content, bool display);
|
||||
void set_data_validation_promt(const std::wstring &title, const std::wstring &content, bool display);
|
||||
void end_data_validation();
|
||||
private:
|
||||
|
||||
@ -91,6 +90,8 @@ private:
|
||||
table_additional_elements_state table_database_ranges_;
|
||||
table_additional_elements_state table_content_validations_;
|
||||
|
||||
size_t count_validations_;
|
||||
|
||||
friend class ods_conversion_context;
|
||||
|
||||
};
|
||||
|
||||
@ -323,9 +323,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
|
||||
{
|
||||
convert(oox_sheet->m_oSheetData->m_arrItems[row], row > 0 ? oox_sheet->m_oSheetData->m_arrItems[row - 1] : NULL);
|
||||
|
||||
if ( oox_sheet->m_oSheetData->m_arrItems[row] )
|
||||
delete oox_sheet->m_oSheetData->m_arrItems[row];
|
||||
oox_sheet->m_oSheetData->m_arrItems[row] = NULL;
|
||||
if ( (row > 0) && (oox_sheet->m_oSheetData->m_arrItems[row - 1] ))
|
||||
{
|
||||
delete oox_sheet->m_oSheetData->m_arrItems[row - 1];
|
||||
oox_sheet->m_oSheetData->m_arrItems[row - 1] = NULL;
|
||||
}
|
||||
}
|
||||
ods_context->end_rows();
|
||||
oox_sheet->m_oSheetData.reset();
|
||||
@ -441,16 +443,13 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDataValidation *oox_validation)
|
||||
|
||||
ods_context->set_data_validation_content(formula_1, formula_2);
|
||||
|
||||
if (oox_validation->m_oShowErrorMessage.IsInit() && oox_validation->m_oShowErrorMessage->ToBool())
|
||||
{
|
||||
ods_context->set_data_validation_error(oox_validation->m_oErrorTitle.IsInit() ? *oox_validation->m_oErrorTitle : L"",
|
||||
oox_validation->m_oError.IsInit() ? *oox_validation->m_oError : L"");
|
||||
}
|
||||
if (oox_validation->m_oShowInputMessage.IsInit() && oox_validation->m_oShowInputMessage->ToBool())
|
||||
{
|
||||
ods_context->set_data_validation_promt(oox_validation->m_oPromptTitle.IsInit() ? *oox_validation->m_oPromptTitle : L"",
|
||||
oox_validation->m_oPromt.IsInit() ? *oox_validation->m_oPromt : L"");
|
||||
}
|
||||
ods_context->set_data_validation_error(oox_validation->m_oErrorTitle.IsInit() ? *oox_validation->m_oErrorTitle : L"",
|
||||
oox_validation->m_oError.IsInit() ? *oox_validation->m_oError : L"",
|
||||
oox_validation->m_oShowErrorMessage.IsInit() ? oox_validation->m_oShowErrorMessage->ToBool() : true);
|
||||
|
||||
ods_context->set_data_validation_promt(oox_validation->m_oPromptTitle.IsInit() ? *oox_validation->m_oPromptTitle : L"",
|
||||
oox_validation->m_oPrompt.IsInit() ? *oox_validation->m_oPrompt : L"",
|
||||
oox_validation->m_oShowInputMessage.IsInit() ? oox_validation->m_oShowInputMessage->ToBool() : true);
|
||||
ods_context->end_data_validation();
|
||||
}
|
||||
|
||||
@ -700,7 +699,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRow *oox_row, OOX::Spreadsheet::C
|
||||
|
||||
if (bEqual)
|
||||
{
|
||||
if (false == ods_context->current_table().is_row_comment(row_number, 1))
|
||||
if ( ods_context->current_table().is_row_comment(row_number, 1) < 0)
|
||||
{
|
||||
ods_context->add_row_repeated();
|
||||
return;
|
||||
|
||||
@ -726,6 +726,17 @@ namespace NSBinPptxRW
|
||||
m_lPosition += UINT16_SIZEOF;
|
||||
m_pStreamCur += UINT16_SIZEOF;
|
||||
}
|
||||
void CBinaryFileWriter::WriteSHORT(const _INT16& lValue)
|
||||
{
|
||||
CheckBufferSize(INT16_SIZEOF);
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
memcpy(m_pStreamCur, &lValue, sizeof(_INT16));
|
||||
#else
|
||||
*((_INT16*)m_pStreamCur) = lValue; // EXC_ARM_DA_ALIGN on ios
|
||||
#endif
|
||||
m_lPosition += INT16_SIZEOF;
|
||||
m_pStreamCur += INT16_SIZEOF;
|
||||
}
|
||||
void CBinaryFileWriter::WriteULONG(const _UINT32& lValue)
|
||||
{
|
||||
CheckBufferSize(UINT32_SIZEOF);
|
||||
@ -1144,6 +1155,84 @@ namespace NSBinPptxRW
|
||||
m_lPosition += lSizeMem;
|
||||
m_pStreamCur += lSizeMem;
|
||||
}
|
||||
|
||||
CStreamBinaryWriter::CStreamBinaryWriter(size_t bufferSize)
|
||||
{
|
||||
m_lSize = bufferSize;
|
||||
m_pStreamData = new BYTE[bufferSize];
|
||||
|
||||
m_lPosition = 0;
|
||||
m_pStreamCur = m_pStreamData;
|
||||
|
||||
m_lPositionFlushed = 0;
|
||||
}
|
||||
void CStreamBinaryWriter::CheckBufferSize(_UINT32 lPlus)
|
||||
{
|
||||
if ((m_lPosition + lPlus) > m_lSize)
|
||||
{
|
||||
Flush();
|
||||
if ((m_lPosition + lPlus) > m_lSize)
|
||||
{
|
||||
CBinaryFileWriter::CheckBufferSize(lPlus);
|
||||
}
|
||||
}
|
||||
}
|
||||
_UINT32 CStreamBinaryWriter::GetPosition()
|
||||
{
|
||||
return m_lPosition + m_lPositionFlushed;
|
||||
}
|
||||
void CStreamBinaryWriter::CloseFile()
|
||||
{
|
||||
Flush();
|
||||
CFileBinary::CloseFile();
|
||||
}
|
||||
void CStreamBinaryWriter::Flush()
|
||||
{
|
||||
if (m_lPosition > 0)
|
||||
{
|
||||
CFileBinary::WriteFile(m_pStreamData, m_lPosition);
|
||||
}
|
||||
m_lPositionFlushed += m_lPosition;
|
||||
m_lPosition = 0;
|
||||
m_pStreamCur = m_pStreamData;
|
||||
}
|
||||
|
||||
CXlsbBinaryWriter::CXlsbBinaryWriter(size_t bufferSize) : CStreamBinaryWriter(bufferSize)
|
||||
{
|
||||
}
|
||||
void CXlsbBinaryWriter::XlsbStartRecord(_INT16 lType, _INT32 nLen)
|
||||
{
|
||||
//Type
|
||||
if (lType < 0x80)
|
||||
{
|
||||
WriteBYTE(lType);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteBYTE((lType & 0x7F) | 0x80);
|
||||
WriteBYTE(lType >> 7);
|
||||
}
|
||||
//Len
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
BYTE nPart = nLen & 0x7F;
|
||||
nLen = nLen >> 7;
|
||||
if(nLen == 0)
|
||||
{
|
||||
WriteBYTE(nPart);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteBYTE(nPart | 0x80);
|
||||
}
|
||||
}
|
||||
}
|
||||
void CXlsbBinaryWriter::XlsbEndRecord()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
CRelsGenerator::CRelsGenerator(CImageManager2* pManager) : m_lNextRelsID(1), m_mapImages()
|
||||
{
|
||||
m_pManager = pManager;
|
||||
@ -1671,6 +1760,20 @@ namespace NSBinPptxRW
|
||||
m_pDataCur += 2;
|
||||
return res;
|
||||
}
|
||||
_INT16 CBinaryFileReader::GetShort()
|
||||
{
|
||||
if (m_lPos + 1 >= m_lSize)
|
||||
return 0;
|
||||
#if defined(_IOS) || defined(__ANDROID__)
|
||||
_INT16 res = 0;
|
||||
memcpy(&res, m_pDataCur, sizeof(_INT16));
|
||||
#else
|
||||
_INT16 res = *((_INT16*)m_pDataCur); // EXC_ARM_DA_ALIGN on ios
|
||||
#endif
|
||||
m_lPos += 2;
|
||||
m_pDataCur += 2;
|
||||
return res;
|
||||
}
|
||||
|
||||
// 4 byte
|
||||
_UINT32 CBinaryFileReader::GetULong()
|
||||
@ -1869,4 +1972,32 @@ namespace NSBinPptxRW
|
||||
m_pDataCur += nSize;
|
||||
return res;
|
||||
}
|
||||
_UINT16 CBinaryFileReader::XlsbReadRecordType()
|
||||
{
|
||||
_UINT16 nValue = GetUChar();
|
||||
if(0 != (nValue & 0x80))
|
||||
{
|
||||
BYTE nPart = GetUChar();
|
||||
nValue = (nValue & 0x7F) | ((nPart & 0x7F) << 7);
|
||||
}
|
||||
return nValue;
|
||||
}
|
||||
void CBinaryFileReader::XlsbSkipRecord()
|
||||
{
|
||||
Skip(XlsbReadRecordLength());
|
||||
}
|
||||
_UINT32 CBinaryFileReader::XlsbReadRecordLength()
|
||||
{
|
||||
_UINT16 nValue = 0;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
BYTE nPart = GetUChar();
|
||||
nValue |= (nPart & 0x7F) << (7 * i);
|
||||
if(0 == (nPart & 0x80))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return nValue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#endif
|
||||
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
#include <vector>
|
||||
@ -66,6 +67,10 @@ namespace NSStringUtils
|
||||
{
|
||||
class CStringBuilder;
|
||||
}
|
||||
namespace NSFile
|
||||
{
|
||||
class CFileBinary;
|
||||
}
|
||||
namespace PPTX
|
||||
{
|
||||
class Theme;
|
||||
@ -241,7 +246,7 @@ namespace NSBinPptxRW
|
||||
|
||||
NSCommon::smart_ptr<PPTX::Theme>* m_pTheme;
|
||||
NSCommon::smart_ptr<PPTX::Logic::ClrMap>* m_pClrMap;
|
||||
private:
|
||||
protected:
|
||||
BYTE* m_pStreamData;
|
||||
BYTE* m_pStreamCur;
|
||||
_UINT32 m_lSize;
|
||||
@ -260,7 +265,7 @@ namespace NSBinPptxRW
|
||||
_INT32 m_lYCurShape;
|
||||
|
||||
BYTE* GetBuffer();
|
||||
_UINT32 GetPosition();
|
||||
virtual _UINT32 GetPosition();
|
||||
void SetPosition(const _UINT32& lPosition);
|
||||
void Skip(const _UINT32& lSize);
|
||||
|
||||
@ -277,12 +282,13 @@ namespace NSBinPptxRW
|
||||
|
||||
void ClearNoAttack();
|
||||
|
||||
void CheckBufferSize(_UINT32 lPlus);
|
||||
virtual void CheckBufferSize(_UINT32 lPlus);
|
||||
|
||||
void WriteBYTE (const BYTE& lValue);
|
||||
void WriteSBYTE (const signed char& lValue);
|
||||
void WriteBOOL (const bool& bValue);
|
||||
void WriteUSHORT(const _UINT16& lValue);
|
||||
void WriteSHORT(const _INT16& lValue);
|
||||
|
||||
void WriteULONG (const _UINT32& lValue);
|
||||
void WriteLONG (const _INT32& lValue);
|
||||
@ -310,7 +316,7 @@ namespace NSBinPptxRW
|
||||
// --------------------------------------------------------
|
||||
|
||||
CBinaryFileWriter();
|
||||
~CBinaryFileWriter();
|
||||
virtual ~CBinaryFileWriter();
|
||||
|
||||
void StartRecord(_INT32 lType);
|
||||
void EndRecord();
|
||||
@ -400,6 +406,29 @@ namespace NSBinPptxRW
|
||||
_INT32 _WriteString(const WCHAR* sBuffer, _UINT32 lCount);
|
||||
void _WriteStringWithLength(const WCHAR* sBuffer, _UINT32 lCount, bool bByte);
|
||||
};
|
||||
|
||||
|
||||
class CStreamBinaryWriter : public NSFile::CFileBinary, public CBinaryFileWriter
|
||||
{
|
||||
protected:
|
||||
_UINT32 m_lPositionFlushed;
|
||||
public:
|
||||
CStreamBinaryWriter(size_t bufferSize = 16777216);
|
||||
|
||||
void CheckBufferSize(_UINT32 lPlus);
|
||||
_UINT32 GetPosition();
|
||||
void CloseFile();
|
||||
virtual void Flush();
|
||||
};
|
||||
class CXlsbBinaryWriter : public CStreamBinaryWriter
|
||||
{
|
||||
public:
|
||||
CXlsbBinaryWriter(size_t bufferSize = 16777216);
|
||||
|
||||
void XlsbStartRecord(_INT16 lType, _INT32 nLen);
|
||||
void XlsbEndRecord();
|
||||
};
|
||||
|
||||
class CRelsGenerator
|
||||
{
|
||||
private:
|
||||
@ -489,6 +518,7 @@ namespace NSBinPptxRW
|
||||
|
||||
// 2 byte
|
||||
_UINT16 GetUShort();
|
||||
_INT16 GetShort();
|
||||
|
||||
// 4 byte
|
||||
_UINT32 GetULong();
|
||||
@ -517,5 +547,9 @@ namespace NSBinPptxRW
|
||||
|
||||
BYTE* GetData();
|
||||
BYTE* GetPointer(int nSize);
|
||||
|
||||
_UINT16 XlsbReadRecordType();
|
||||
void XlsbSkipRecord();
|
||||
_UINT32 XlsbReadRecordLength();
|
||||
};
|
||||
}
|
||||
|
||||
@ -44,7 +44,6 @@ namespace PPTX
|
||||
public:
|
||||
PPTX_LOGIC_BASE(HF)
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
XmlMacroReadAttributeBase(node, L"dt", dt);
|
||||
@ -55,12 +54,12 @@ namespace PPTX
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("dt"), dt);
|
||||
oAttr.Write(_T("ftr"), ftr);
|
||||
oAttr.Write(_T("hdr"), hdr);
|
||||
oAttr.Write(_T("sldNum"), sldNum);
|
||||
oAttr.Write(L"dt", dt);
|
||||
oAttr.Write(L"ftr", ftr);
|
||||
oAttr.Write(L"hdr", hdr);
|
||||
oAttr.Write(L"sldNum", sldNum);
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:hf"), oAttr);
|
||||
return XmlUtils::CreateNode(L"p:hf", oAttr);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
@ -74,16 +73,16 @@ namespace PPTX
|
||||
}
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:hf"));
|
||||
pWriter->StartNode(L"p:hf");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("dt"), dt.get_value_or(false));
|
||||
pWriter->WriteAttribute(_T("ftr"), ftr.get_value_or(false));
|
||||
pWriter->WriteAttribute(_T("hdr"), hdr.get_value_or(false));
|
||||
pWriter->WriteAttribute(_T("sldNum"), sldNum.get_value_or(false));
|
||||
pWriter->WriteAttribute(L"dt", dt);
|
||||
pWriter->WriteAttribute(L"ftr", ftr);
|
||||
pWriter->WriteAttribute(L"hdr", hdr);
|
||||
pWriter->WriteAttribute(L"sldNum", sldNum);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->EndNode(_T("p:hf"));
|
||||
pWriter->EndNode(L"p:hf");
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
@ -109,7 +108,6 @@ namespace PPTX
|
||||
pReader->Seek(_e);
|
||||
}
|
||||
|
||||
public:
|
||||
nullable_bool dt;
|
||||
nullable_bool ftr;
|
||||
nullable_bool hdr;
|
||||
|
||||
@ -3592,6 +3592,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17063B5A1AC5708E0056A3F1;
|
||||
@ -3771,7 +3772,7 @@
|
||||
17C1FE891ACC429D006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -3802,7 +3803,7 @@
|
||||
17C1FE8A1ACC429D006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -217,7 +217,6 @@ int CELLTABLE::serialize(std::wostream & stream)
|
||||
|
||||
CP_XML_WRITER(stream)
|
||||
{
|
||||
|
||||
for (std::map<int, GlobalWorkbookInfo::_row_info>::iterator it_row = sheet_info.mapRows.begin(); it_row != sheet_info.mapRows.end(); it_row++)
|
||||
{
|
||||
Row* row = dynamic_cast<Row*>(it_row->second.row_info.get());
|
||||
@ -275,7 +274,7 @@ int CELLTABLE::serialize(std::wostream & stream)
|
||||
}
|
||||
for ( std::map<int, BaseObjectPtr>::iterator it_cell = it_row->second.mapCells.begin(); it_cell != it_row->second.mapCells.end(); it_cell++)
|
||||
{
|
||||
if (isConcatinate_)
|
||||
//if (isConcatinate_)
|
||||
{
|
||||
CELL* cell = dynamic_cast<CELL*>((it_cell->second).get());
|
||||
|
||||
|
||||
@ -72,6 +72,12 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
|
||||
if (proc.optional<Palette>())
|
||||
{
|
||||
m_Palette = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
count = proc.repeated<Font>(0, 510); // Wrong records sequence workaround (originally at least one Font is mandatory)
|
||||
while(count > 0)
|
||||
|
||||
@ -329,6 +329,7 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
|
||||
}break;
|
||||
case rt_UsesELFs: proc.optional<UsesELFs>(); break;
|
||||
case rt_RecalcId: proc.optional<RecalcId>(); break;
|
||||
case rt_Palette:
|
||||
case rt_Font:
|
||||
case rt_XFCRC:
|
||||
{
|
||||
|
||||
@ -31,9 +31,9 @@ NO_FRAMEWORK=
|
||||
BOOST_VERSION=1.58.0
|
||||
BOOST_VERSION2=1_58_0
|
||||
MIN_IOS_VERSION=8.0
|
||||
IOS_SDK_VERSION=`xcodebuild -showsdks | grep iphoneos | \
|
||||
IOS_SDK_VERSION=`xcodebuild BITCODE_GENERATION_MODE="bitcode" ENABLE_BITCODE="YES" OTHER_CFLAGS="-fembed-bitcode" -showsdks | grep iphoneos | \
|
||||
egrep "[[:digit:]]+\.[[:digit:]]+" -o | tail -1`
|
||||
OSX_SDK_VERSION=`xcodebuild -showsdks | grep macosx | \
|
||||
OSX_SDK_VERSION=`xcodebuild BITCODE_GENERATION_MODE="bitcode" ENABLE_BITCODE="YES" OTHER_CFLAGS="-fembed-bitcode" -showsdks | grep macosx | \
|
||||
egrep "[[:digit:]]+\.[[:digit:]]+" -o | tail -1`
|
||||
|
||||
XCODE_ROOT=`xcode-select -print-path`
|
||||
@ -46,7 +46,7 @@ XCODE_ROOT=`xcode-select -print-path`
|
||||
#
|
||||
# Should perhaps also consider/use instead: -BOOST_SP_USE_PTHREADS
|
||||
EXTRA_CPPFLAGS="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG \
|
||||
-std=c++11 -stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden"
|
||||
-std=c++11 -stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden -fembed-bitcode"
|
||||
EXTRA_IOS_CPPFLAGS="$EXTRA_CPPFLAGS -mios-version-min=$MIN_IOS_VERSION"
|
||||
EXTRA_OSX_CPPFLAGS="$EXTRA_CPPFLAGS"
|
||||
|
||||
@ -342,17 +342,20 @@ buildBoost()
|
||||
echo Building Boost for iPhone
|
||||
# Install this one so we can copy the headers for the frameworks...
|
||||
./b2 -j16 --build-dir=iphone-build --stagedir=iphone-build/stage \
|
||||
cxxflags="-fembed-bitcode" \
|
||||
--prefix=$PREFIXDIR toolset=darwin architecture=arm target-os=iphone \
|
||||
macosx-version=iphone-${IOS_SDK_VERSION} define=_LITTLE_ENDIAN \
|
||||
link=static stage
|
||||
./b2 -j16 --build-dir=iphone-build --stagedir=iphone-build/stage \
|
||||
--prefix=$PREFIXDIR toolset=darwin architecture=arm \
|
||||
cxxflags="-fembed-bitcode" \
|
||||
target-os=iphone macosx-version=iphone-${IOS_SDK_VERSION} \
|
||||
define=_LITTLE_ENDIAN link=static install
|
||||
doneSection
|
||||
|
||||
echo Building Boost for iPhoneSimulator
|
||||
./b2 -j16 --build-dir=iphonesim-build --stagedir=iphonesim-build/stage \
|
||||
cxxflags="-fembed-bitcode" \
|
||||
toolset=darwin-${IOS_SDK_VERSION}~iphonesim architecture=x86 \
|
||||
target-os=iphone macosx-version=iphonesim-${IOS_SDK_VERSION} \
|
||||
link=static stage
|
||||
|
||||
@ -26,15 +26,15 @@ if not exist "%folder%" (
|
||||
md %folder%\shared
|
||||
|
||||
.\b2.exe --clean
|
||||
.\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET%
|
||||
.\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET% || goto :error
|
||||
XCOPY /Y stage\lib\* "%folder%\static\"
|
||||
|
||||
.\b2.exe --clean
|
||||
.\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET%
|
||||
.\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET% || goto :error
|
||||
XCOPY /Y stage\lib\* "%folder%\static_fpic\"
|
||||
|
||||
.\b2.exe --clean
|
||||
.\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET%
|
||||
.\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex --toolset=%TOOLSET% || goto :error
|
||||
XCOPY /Y stage\lib\* "%folder%\shared\"
|
||||
)
|
||||
|
||||
@ -54,14 +54,20 @@ if not exist "%folder%" (
|
||||
md %folder%\shared
|
||||
|
||||
.\b2.exe --clean
|
||||
.\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET%
|
||||
.\bjam.exe link=static --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET% || goto :error
|
||||
XCOPY /Y stage\lib\* "%folder%\static\"
|
||||
|
||||
.\b2.exe --clean
|
||||
.\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET%
|
||||
.\bjam.exe link=static cxxflags=-fPIC --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET% || goto :error
|
||||
XCOPY /Y stage\lib\* "%folder%\static_fpic\"
|
||||
|
||||
.\b2.exe --clean
|
||||
.\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET%
|
||||
.\bjam.exe link=shared --with-filesystem --with-system --with-date_time --with-regex address-model=64 --toolset=%TOOLSET% || goto :error
|
||||
XCOPY /Y stage\lib\* "%folder%\shared\"
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
|
||||
:error
|
||||
echo "Failed with error #%errorlevel%."
|
||||
exit /b %errorlevel%
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
os=$(uname -s)
|
||||
platform=""
|
||||
|
||||
@ -4,7 +4,7 @@ CD /D %~dp0
|
||||
if exist "%SCRIPTPATH%boost_1_58_0.7z" (
|
||||
echo "boost already downloaded"
|
||||
) else (
|
||||
Powershell.exe Invoke-WebRequest -OutFile boost_1_58_0.7z http://freefr.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z
|
||||
Powershell.exe Invoke-WebRequest -OutFile boost_1_58_0.7z https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z
|
||||
)
|
||||
|
||||
SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
BOOST_URL=https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z
|
||||
|
||||
os=$(uname -s)
|
||||
platform=""
|
||||
@ -12,21 +11,11 @@ case "$os" in
|
||||
*) exit ;;
|
||||
esac
|
||||
|
||||
if [[ "$platform" == *"mac"* ]]
|
||||
then
|
||||
if [[ -f "$SCRIPTPATH/7zX_1.7.1.dmg" ]]
|
||||
then
|
||||
echo "7z already downloaded"
|
||||
else
|
||||
wget http://static.updatestar.net/dl/7zX/7zX_1.7.1.dmg
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -f "$SCRIPTPATH/boost_1_58_0.7z" ]]
|
||||
then
|
||||
echo "boost already downloaded"
|
||||
else
|
||||
wget http://freefr.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.7z
|
||||
wget $BOOST_URL || curl -O $BOOST_URL
|
||||
fi
|
||||
|
||||
if [ -d "$SCRIPTPATH/boost_1_58_0" ]; then
|
||||
@ -36,8 +25,6 @@ if [[ "$platform" == *"linux"* ]]
|
||||
then
|
||||
7z x -y "$SCRIPTPATH/boost_1_58_0.7z" -o"$SCRIPTPATH/"
|
||||
else
|
||||
hdiutil mount "$SCRIPTPATH/7zX_1.7.1.dmg"
|
||||
/Volumes/7zX/7zX.app/Contents/Resources/7za x "$SCRIPTPATH/boost_1_58_0.7z" -o"$SCRIPTPATH/"
|
||||
hdiutil unmount /Volumes/7zX
|
||||
7za x "$SCRIPTPATH/boost_1_58_0.7z" -o"$SCRIPTPATH/"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1,18 +1,9 @@
|
||||
@echo off
|
||||
|
||||
SET SCRIPTPATH=%~dp0
|
||||
CD /D %~dp0
|
||||
SET PLATFORM=win_32
|
||||
if defined ProgramFiles(x86) (
|
||||
SET PLATFORM=win_64
|
||||
)
|
||||
|
||||
if defined TARGET (
|
||||
SET PLATFORM=%TARGET%
|
||||
)
|
||||
|
||||
mkdir "%SCRIPTPATH%%PLATFORM%"
|
||||
cd "%SCRIPTPATH%%PLATFORM%"
|
||||
|
||||
Powershell.exe -executionpolicy remotesigned -file %SCRIPTPATH%download.ps1 http://d2ettrnqo7v976.cloudfront.net/cef/3163/%PLATFORM%/cef_binary.7z cef_binary.7z cef_binary
|
||||
setlocal
|
||||
|
||||
SET UNSIP_PROGRAMM="%ProgramFiles%\7-Zip\7z.exe"
|
||||
SET UNSIP_PROGRAMM2="%ProgramFiles(x86)%\7-Zip\7z.exe"
|
||||
@ -20,11 +11,48 @@ if exist %UNSIP_PROGRAMM2% (
|
||||
SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
|
||||
)
|
||||
|
||||
if exist "cef_binary" (
|
||||
echo "cef_binary.7z already extracted"
|
||||
) else (
|
||||
call %UNSIP_PROGRAMM% x "cef_binary.7z"
|
||||
mkdir build
|
||||
xcopy /Y /S cef_binary\Release\* build\
|
||||
xcopy /Y /S cef_binary\Resources\* build\
|
||||
if defined BUILD_PLATFORM (
|
||||
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
|
||||
SET "BUILD_PLATFORMS=win_64 win_32 winxp_64 winxp_32"
|
||||
GOTO :found
|
||||
)
|
||||
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:all=%" (
|
||||
SET "BUILD_PLATFORMS=win_64 win_32"
|
||||
GOTO :found
|
||||
)
|
||||
)
|
||||
|
||||
SET "BUILD_PLATFORMS=win_32"
|
||||
if defined ProgramFiles(x86) (
|
||||
SET "BUILD_PLATFORMS=win_64"
|
||||
GOTO :found
|
||||
)
|
||||
if defined TARGET (
|
||||
SET "BUILD_PLATFORMS=%TARGET%"
|
||||
GOTO :found
|
||||
)
|
||||
|
||||
echo "error"
|
||||
GOTO :end
|
||||
|
||||
:found
|
||||
for %%a in (%BUILD_PLATFORMS%) do (
|
||||
echo "platform: %%a"
|
||||
mkdir "%SCRIPTPATH%%%a"
|
||||
cd "%SCRIPTPATH%%%a"
|
||||
Powershell.exe -executionpolicy remotesigned -file %SCRIPTPATH%download.ps1 http://d2ettrnqo7v976.cloudfront.net/cef/3163/%%a/cef_binary.7z cef_binary.7z cef_binary
|
||||
|
||||
if exist "cef_binary" (
|
||||
echo "cef_binary.7z already extracted"
|
||||
) else (
|
||||
call %UNSIP_PROGRAMM% x "cef_binary.7z"
|
||||
mkdir build
|
||||
xcopy /Y /S cef_binary\Release\* build\
|
||||
xcopy /Y /S cef_binary\Resources\* build\
|
||||
)
|
||||
)
|
||||
|
||||
:end
|
||||
endlocal
|
||||
|
||||
@echo on
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
os=$(uname -s)
|
||||
platform=""
|
||||
@ -42,9 +40,10 @@ cef_version="3163"
|
||||
if [[ "$platform" == *"linux"* ]]
|
||||
then
|
||||
cef_version="3202"
|
||||
fi
|
||||
|
||||
cef_url=http://d2ettrnqo7v976.cloudfront.net/cef/$cef_version/$platform$arch/$cef_arch
|
||||
else
|
||||
cef_url=http://d2ettrnqo7v976.cloudfront.net/cef/$cef_version/$platform/$cef_arch
|
||||
fi
|
||||
|
||||
if [[ "$platform" == *"linux"* ]]
|
||||
then
|
||||
@ -75,3 +74,15 @@ then
|
||||
cp -r -t build/ ./$cef_binary/Release/* ./$cef_binary/Resources/*
|
||||
chmod a+xr build/locales
|
||||
fi
|
||||
|
||||
if [[ "$platform" == *"mac"* ]]
|
||||
then
|
||||
if [ -d "build/Chromium Embedded Framework.framework" ]
|
||||
then
|
||||
echo "cef_binary already extracted"
|
||||
else
|
||||
wget $cef_url || curl -O $cef_url
|
||||
7za x $cef_arch
|
||||
mv "$cef_binary" "build/Chromium Embedded Framework.framework"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
SET SCRIPTPATH=%~dp0
|
||||
CD /D %~dp0
|
||||
SET MACHINE=x86
|
||||
if defined ProgramFiles(x86) (
|
||||
SET MACHINE=x64
|
||||
)
|
||||
|
||||
if "%TARGET%" == "win-32" (
|
||||
SET MACHINE=x86
|
||||
)
|
||||
|
||||
if "%TARGET%" == "win-64" (
|
||||
SET MACHINE=x64
|
||||
)
|
||||
|
||||
if "%MACHINE%" == "x86" (
|
||||
SET OUTPUT=win_32
|
||||
)
|
||||
|
||||
if "%MACHINE%" == "x64" (
|
||||
SET OUTPUT=win_64
|
||||
)
|
||||
|
||||
SET VC=%ProgramFiles%\Microsoft Visual Studio 12.0\VC
|
||||
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC
|
||||
if exist %VC64% (
|
||||
SET VC=%VC64%
|
||||
)
|
||||
|
||||
call "%VC%\vcvarsall.bat" %MACHINE%
|
||||
|
||||
cd curl
|
||||
call buildconf.bat
|
||||
cd winbuild
|
||||
nmake /f Makefile.vc mode=static ENABLE_WINSSL=yes MACHINE=%MACHINE% VC=12
|
||||
|
||||
if not exist "%SCRIPTPATH%%OUTPUT%" (
|
||||
md %SCRIPTPATH%%OUTPUT%\build
|
||||
xcopy /Y /S ..\builds\libcurl-vc12-%MACHINE%-release-static-ipv6-sspi-winssl\lib\libcurl_a.lib %SCRIPTPATH%%OUTPUT%\build\
|
||||
move %SCRIPTPATH%%OUTPUT%\build\libcurl_a.lib %SCRIPTPATH%%OUTPUT%\build\curl.lib
|
||||
)
|
||||
|
||||
cd ..\..
|
||||
@ -1,73 +0,0 @@
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
|
||||
os=$(uname -s)
|
||||
platform=""
|
||||
|
||||
case "$os" in
|
||||
Linux*)
|
||||
platform="linux"
|
||||
BUILD_PLATFORM=Linux
|
||||
;;
|
||||
Darwin*)
|
||||
platform="mac"
|
||||
BUILD_PLATFORM=MacOSX
|
||||
;;
|
||||
*) exit ;;
|
||||
esac
|
||||
|
||||
|
||||
architecture=$(uname -m)
|
||||
arch=""
|
||||
|
||||
case "$architecture" in
|
||||
x86_64*) arch="_64" ;;
|
||||
*) arch="_32" ;;
|
||||
esac
|
||||
|
||||
if [[ -d "$SCRIPTPATH/$platform$arch" ]]
|
||||
then
|
||||
echo
|
||||
else
|
||||
mkdir "$SCRIPTPATH/$platform$arch"
|
||||
fi
|
||||
|
||||
CURL_FOLDER=curl
|
||||
cd ${CURL_FOLDER}
|
||||
|
||||
if [[ ! -f configure ]]
|
||||
then
|
||||
./buildconf
|
||||
fi
|
||||
|
||||
if [[ ! -f Makefile ]]
|
||||
then
|
||||
./configure \
|
||||
--disable-shared \
|
||||
--enable-static \
|
||||
--disable-ldap \
|
||||
--disable-sspi \
|
||||
--without-librtmp \
|
||||
--disable-ftp \
|
||||
--disable-file \
|
||||
--disable-dict \
|
||||
--disable-telnet \
|
||||
--disable-tftp \
|
||||
--disable-rtsp \
|
||||
--disable-pop3 \
|
||||
--disable-imap \
|
||||
--disable-smtp \
|
||||
--disable-gopher \
|
||||
--disable-smb \
|
||||
--without-libidn
|
||||
fi
|
||||
|
||||
make
|
||||
|
||||
if [ ! -d "$SCRIPTPATH/$platform$arch/build" ]
|
||||
then
|
||||
DESTDIR="$SCRIPTPATH/$platform$arch" make install
|
||||
mkdir -p "$SCRIPTPATH/$platform$arch/build"
|
||||
cp "$SCRIPTPATH/$platform$arch/usr/local/lib/libcurl.a" "$SCRIPTPATH/$platform$arch/build/"
|
||||
fi
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
core_linux {
|
||||
INCLUDEPATH += $$PWD/$$CORE_BUILDS_PLATFORM_PREFIX/usr/local/include
|
||||
|
||||
LIBS += -lcurl
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
CD /D %~dp0
|
||||
SET CURL_FOLDER=curl
|
||||
IF NOT EXIST %CURL_FOLDER% CALL git clone https://github.com/curl/curl.git %CURL_FOLDER%
|
||||
CD %CURL_FOLDER%
|
||||
CALL git fetch
|
||||
CALL git checkout curl-7_54_1
|
||||
CD ..
|
||||
@ -1,8 +0,0 @@
|
||||
CURL_FOLDER=curl
|
||||
if [ ! -d ${CURL_FOLDER} ]; then
|
||||
git clone https://github.com/curl/curl.git ${CURL_FOLDER}
|
||||
fi
|
||||
cd ${CURL_FOLDER}
|
||||
git fetch
|
||||
git checkout curl-7_54_1
|
||||
cd ..
|
||||
@ -1,64 +1,80 @@
|
||||
@echo off
|
||||
|
||||
SET SCRIPTPATH=%~dp0
|
||||
CD /D %~dp0
|
||||
|
||||
setlocal
|
||||
|
||||
SET ICU_MAJOR_VER=58
|
||||
SET ICU_MINOR_VER=2
|
||||
|
||||
SET build_platform=win_32
|
||||
if defined ProgramFiles(x86) (
|
||||
SET build_platform=win_64
|
||||
)
|
||||
|
||||
if defined TARGET (
|
||||
SET build_platform=%TARGET%
|
||||
)
|
||||
|
||||
if "%build_platform%" == "win_32" (
|
||||
SET MACHINE=x86
|
||||
)
|
||||
|
||||
if "%build_platform%" == "win_64" (
|
||||
SET MACHINE=x64
|
||||
)
|
||||
|
||||
if not exist "%build_platform%" (
|
||||
md "%build_platform%"
|
||||
)
|
||||
|
||||
if not exist "%build_platform%\build" (
|
||||
md "%build_platform%\build"
|
||||
)
|
||||
|
||||
cd "%SCRIPTPATH%%build_platform%"
|
||||
|
||||
if exist "%SCRIPTPATH%%build_platform%\icu\" (
|
||||
echo "icu already exported"
|
||||
) else (
|
||||
svn export http://source.icu-project.org/repos/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
|
||||
)
|
||||
|
||||
SET VC=%ProgramFiles%\Microsoft Visual Studio 14.0\VC
|
||||
SET VC64=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC
|
||||
if exist %VC64% (
|
||||
SET VC=%VC64%
|
||||
)
|
||||
|
||||
call "%VC%\vcvarsall.bat" %MACHINE%
|
||||
|
||||
if "%build_platform%" == "win_64" (
|
||||
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="X64"
|
||||
) else (
|
||||
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="Win32"
|
||||
SET UNSIP_PROGRAMM="%ProgramFiles%\7-Zip\7z.exe"
|
||||
SET UNSIP_PROGRAMM2="%ProgramFiles(x86)%\7-Zip\7z.exe"
|
||||
if exist %UNSIP_PROGRAMM2% (
|
||||
SET UNSIP_PROGRAMM=%UNSIP_PROGRAMM2%
|
||||
)
|
||||
|
||||
if "%build_platform%" == "win_64" (
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin64\icudt%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin64\icuuc%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib64\icudt.lib" "%SCRIPTPATH%%build_platform%\build\"
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib64\icuuc.lib" "%SCRIPTPATH%%build_platform%\build\"
|
||||
) else (
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin\icudt%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\bin\icuuc%ICU_MAJOR_VER%.dll" "%SCRIPTPATH%%build_platform%\build\"
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib\icudt.lib" "%SCRIPTPATH%%build_platform%\build\"
|
||||
XCOPY /Y "%SCRIPTPATH%%build_platform%\icu\lib\icuuc.lib" "%SCRIPTPATH%%build_platform%\build\"
|
||||
if defined BUILD_PLATFORM (
|
||||
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:all=%" (
|
||||
SET "BUILD_PLATFORMS=win_64 win_32"
|
||||
GOTO :found
|
||||
)
|
||||
)
|
||||
|
||||
SET "BUILD_PLATFORMS=win_32"
|
||||
if defined ProgramFiles(x86) (
|
||||
SET "BUILD_PLATFORMS=win_64"
|
||||
GOTO :found
|
||||
)
|
||||
if defined TARGET (
|
||||
SET "BUILD_PLATFORMS=%TARGET%"
|
||||
GOTO :found
|
||||
)
|
||||
|
||||
echo "error"
|
||||
GOTO :end
|
||||
|
||||
:found
|
||||
for %%a in (%BUILD_PLATFORMS%) do (
|
||||
cd "%SCRIPTPATH%"
|
||||
if not exist "%%a" (
|
||||
md "%%a"
|
||||
)
|
||||
if not exist "%%a\build" (
|
||||
md "%%a\build"
|
||||
)
|
||||
cd "%SCRIPTPATH%%%a"
|
||||
if exist "icu" (
|
||||
echo "icu already exported"
|
||||
) else (
|
||||
svn export http://source.icu-project.org/repos/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
|
||||
)
|
||||
|
||||
if "%%a" == "win_64" (
|
||||
call "%VC%\vcvarsall.bat" x64
|
||||
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="X64"
|
||||
XCOPY /Y "icu\bin64\icudt%ICU_MAJOR_VER%.dll" "build\"
|
||||
XCOPY /Y "icu\bin64\icuuc%ICU_MAJOR_VER%.dll" "build\"
|
||||
XCOPY /Y "icu\lib64\icudt.lib" "build\"
|
||||
XCOPY /Y "icu\lib64\icuuc.lib" "build\"
|
||||
) else (
|
||||
call "%VC%\vcvarsall.bat" x86
|
||||
MSBuild.exe icu\source\allinone\allinone.sln /p:Configuration=Release /p:PlatformToolset=v140 /p:Platform="Win32"
|
||||
XCOPY /Y "icu\bin\icudt%ICU_MAJOR_VER%.dll" "build\"
|
||||
XCOPY /Y "icu\bin\icuuc%ICU_MAJOR_VER%.dll" "build\"
|
||||
XCOPY /Y "icu\lib\icudt.lib" "build\"
|
||||
XCOPY /Y "icu\lib\icuuc.lib" "build\"
|
||||
)
|
||||
)
|
||||
cd "%SCRIPTPATH%"
|
||||
|
||||
:end
|
||||
endlocal
|
||||
|
||||
@echo on
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
ICU_MAJOR_VER=58
|
||||
ICU_MINOR_VER=2
|
||||
@ -59,11 +57,19 @@ else
|
||||
svn export http://source.icu-project.org/repos/icu/tags/release-$ICU_MAJOR_VER-$ICU_MINOR_VER/icu4c ./icu
|
||||
fi
|
||||
|
||||
# Workaround for building icu older than 60.0
|
||||
# on systems without xlocale.h (removed from glibc since 2.26)
|
||||
# See https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
|
||||
# See https://bugs.archlinux.org/task/55246
|
||||
sed -i 's/xlocale/locale/' ./icu/source/i18n/digitlst.cpp
|
||||
if [[ "$platform" == *"linux"* ]]
|
||||
then
|
||||
# Workaround for building icu older than 60.0
|
||||
# on systems without xlocale.h (removed from glibc since 2.26)
|
||||
# See https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
|
||||
# See https://bugs.archlinux.org/task/55246
|
||||
sed -i 's/xlocale/locale/' ./icu/source/i18n/digitlst.cpp
|
||||
fi
|
||||
|
||||
if [[ "$platform" == *"mac"* ]]
|
||||
then
|
||||
sed -i -e 's/cmd\, \"%s %s -o %s%s %s %s%s %s %s\"\,/cmd\, \"%s %s -o %s%s %s %s %s %s %s\"\,/' ./icu/source/tools/pkgdata/pkgdata.cpp
|
||||
fi
|
||||
|
||||
cd ./icu/source/
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
ICU_MAJOR_VER=62
|
||||
ICU_MINOR_VER=1
|
||||
|
||||
@ -14,7 +14,13 @@ FOR /f "tokens=*" %%i in ('DIR /a:d /b *') DO (
|
||||
ECHO %%i
|
||||
|
||||
if exist %%i/build.bat (
|
||||
call %%i/build.bat
|
||||
call %%i/build.bat || goto :error
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
|
||||
:error
|
||||
echo "Failed with error #%errorlevel%."
|
||||
exit /b %errorlevel%
|
||||
@ -1,8 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
cd "$SCRIPTPATH"
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
cd "$SCRIPTPATH"/openssl
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
cd "$SCRIPTPATH"
|
||||
|
||||
|
||||
@ -387,6 +387,9 @@ void Header::load( const unsigned char* buffer ) {
|
||||
num_sbat = readU32( buffer + 0x40 ); // [40H,04] number of SECTs in the MiniFAT chain
|
||||
mbat_start = readU32( buffer + 0x44 ); // [44H,04] first SECT in the DIFAT chain
|
||||
num_mbat = readU32( buffer + 0x48 ); // [48H,04] number of SECTs in the DIFAT chain
|
||||
|
||||
if (threshold == 0)
|
||||
threshold = 4096; //поле не задано ... файл xls от полльзователя
|
||||
|
||||
for( unsigned int i = 0; i < 8; i++ )
|
||||
id[i] = buffer[i];
|
||||
|
||||
@ -9,15 +9,25 @@ call powershell -File .\fix-static_crt.ps1
|
||||
cd v8
|
||||
|
||||
call gn gen out.gn/win_64/release --args="is_debug=false target_cpu=\"x64\" v8_target_cpu=\"x64\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
|
||||
call ninja -C out.gn/win_64/release
|
||||
call ninja -C out.gn/win_64/release || goto :error
|
||||
|
||||
call gn gen out.gn/win_64/debug --args="is_debug=true target_cpu=\"x64\" v8_target_cpu=\"x64\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
|
||||
call ninja -C out.gn/win_64/debug
|
||||
call ninja -C out.gn/win_64/debug || goto :error
|
||||
|
||||
call gn gen out.gn/win_32/release --args="is_debug=false target_cpu=\"x86\" v8_target_cpu=\"x86\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
|
||||
call ninja -C out.gn/win_32/release
|
||||
call ninja -C out.gn/win_32/release || goto :error
|
||||
|
||||
call gn gen out.gn/win_32/debug --args="is_debug=true target_cpu=\"x86\" v8_target_cpu=\"x86\" v8_static_library=true is_component_build=false v8_use_snapshot=false is_clang=false"
|
||||
call ninja -C out.gn/win_32/debug
|
||||
call ninja -C out.gn/win_32/debug || goto :error
|
||||
|
||||
rem v8_use_snapshot=true v8_use_external_startup_data=true
|
||||
rem v8_use_snapshot=true v8_use_external_startup_data=true
|
||||
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
|
||||
call %~dp0v8_xp\build.bat || goto :error
|
||||
cd %~dp0
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
|
||||
:error
|
||||
echo "Failed with error #%errorlevel%."
|
||||
exit /b %errorlevel%
|
||||
@ -2,8 +2,7 @@
|
||||
|
||||
export PATH=`pwd`/depot_tools:"$PATH"
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
os=$(uname -s)
|
||||
platform=""
|
||||
@ -38,6 +37,7 @@ fi
|
||||
|
||||
if [[ "$platform" == "mac" ]]
|
||||
then
|
||||
sed -i -e "s/if (mac_sdk_version != mac_sdk_min_build_override/if (false \&\& mac_sdk_version != mac_sdk_min_build_override/g" build/config/mac/mac_sdk.gni
|
||||
# for new macOS!!!
|
||||
#sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||
gn gen out.gn/mac_64 --args='is_debug=false target_cpu="x64" v8_static_library=true is_component_build=false v8_use_snapshot=false'
|
||||
|
||||
@ -24,3 +24,8 @@ call git checkout -b 6.0 -t branch-heads/6.0
|
||||
cd ../
|
||||
|
||||
call gclient sync --no-history
|
||||
|
||||
if not "%BUILD_PLATFORM%"=="%BUILD_PLATFORM:xp=%" (
|
||||
call v8_xp\fetch.bat
|
||||
cd %~dp0
|
||||
)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0" || grealpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
cd "$SCRIPTPATH"
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
export PATH=`pwd`/depot_tools:"$PATH"
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
SET SCRIPTPATH=%~dp0
|
||||
CD /D %~dp0
|
||||
|
||||
SET PATH=%SCRIPTPATH%depot_tools;%SCRIPTPATH%depot_tools\win_tools-2_7_6_bin\python\bin;%PATH%
|
||||
SET PATH=%SCRIPTPATH%depot_tools;%SCRIPTPATH%depot_tools\win_tools-2_7_13_chromium7_bin\python\bin;%PATH%
|
||||
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
SET GYP_MSVS_VERSION=2015
|
||||
|
||||
@ -27,8 +27,8 @@ if not exist "win_32" (
|
||||
|
||||
cd "%SCRIPTPATH%v8\tools\gyp"
|
||||
|
||||
call devenv v8.sln /Rebuild "Release"
|
||||
call devenv v8.sln /Rebuild "Debug"
|
||||
call devenv v8.sln /Rebuild "Release" || goto :error
|
||||
call devenv v8.sln /Rebuild "Debug" || goto :error
|
||||
|
||||
cd "%SCRIPTPATH%"
|
||||
|
||||
@ -51,8 +51,8 @@ if not exist "win_64" (
|
||||
|
||||
cd "%SCRIPTPATH%v8\tools\gyp"
|
||||
|
||||
call devenv v8.sln /Rebuild "Release"
|
||||
call devenv v8.sln /Rebuild "Debug"
|
||||
call devenv v8.sln /Rebuild "Release" || goto :error
|
||||
call devenv v8.sln /Rebuild "Debug" || goto :error
|
||||
|
||||
cd "%SCRIPTPATH%"
|
||||
|
||||
@ -62,3 +62,9 @@ if not exist "win_64" (
|
||||
XCOPY /Y "v8\build\Debug\lib\*" "win_64\debug\"
|
||||
XCOPY /Y "v8\build\Debug\icudt.dll" "win_64\debug\"
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
|
||||
:error
|
||||
echo "Failed with error #%errorlevel%."
|
||||
exit /b %errorlevel%
|
||||
@ -8,7 +8,7 @@ if exist "depot_tools" (
|
||||
call powershell -File .\fix-depot_tools.ps1
|
||||
)
|
||||
|
||||
SET PATH=%SCRIPTPATH%depot_tools;%SCRIPTPATH%depot_tools\python276_bin;%PATH%
|
||||
SET PATH=%SCRIPTPATH%depot_tools;%SCRIPTPATH%depot_tools\win_tools-2_7_13_chromium7_bin\python\bin;%PATH%
|
||||
SET DEPOT_TOOLS_WIN_TOOLCHAIN=0
|
||||
SET GYP_MSVS_VERSION=2015
|
||||
|
||||
|
||||
@ -78,7 +78,10 @@ SOURCES += \
|
||||
../Source/Common/Wrap.cpp \
|
||||
../Source/Common/ZIndex.cpp \
|
||||
../Source/Common/SimpleTypes_Word.cpp \
|
||||
../Source/SystemUtility/SystemUtility.cpp
|
||||
../Source/SystemUtility/SystemUtility.cpp \
|
||||
../Source/XlsxFormat/Styles/rPr.cpp \
|
||||
../Source/XlsxFormat/SharedStrings/Si.cpp \
|
||||
../Source/XlsxFormat/SharedStrings/Text.cpp
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,3 +41,6 @@
|
||||
#include "../Source/XlsxFormat/Worksheets/DataValidation.cpp"
|
||||
#include "../Source/XlsxFormat/Table/Tables.cpp"
|
||||
#include "../Source/XlsxFormat/Controls/Controls.cpp"
|
||||
#include "../Source/XlsxFormat/Styles/rPr.cpp"
|
||||
#include "../Source/XlsxFormat/SharedStrings/Si.cpp"
|
||||
#include "../Source/XlsxFormat/SharedStrings/Text.cpp"
|
||||
|
||||
@ -232,6 +232,9 @@
|
||||
8A5B8FD5226F5AF20093271E /* ActiveX.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A5B8FD3226F5AF20093271E /* ActiveX.h */; };
|
||||
8A5B8FD6226F5AF20093271E /* ActiveX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A5B8FD4226F5AF20093271E /* ActiveX.cpp */; };
|
||||
8A5B8FD8226F61010093271E /* VmlDrawing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A5B8FD7226F61000093271E /* VmlDrawing.cpp */; };
|
||||
8ADF9DA222BB9C4800918F34 /* Si.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ADF9DA122BB9C4700918F34 /* Si.cpp */; };
|
||||
8ADF9DA422BB9C4F00918F34 /* Text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ADF9DA322BB9C4F00918F34 /* Text.cpp */; };
|
||||
8ADF9DA622BBA07D00918F34 /* rPr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8ADF9DA522BBA07D00918F34 /* rPr.cpp */; };
|
||||
8AE10E722228255A00A542DE /* Comments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E712228255900A542DE /* Comments.cpp */; };
|
||||
8AE10E742228257E00A542DE /* ConditionalFormatting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E732228257D00A542DE /* ConditionalFormatting.cpp */; };
|
||||
8AECC18F218C991900DEE19A /* App.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AECC18E218C991900DEE19A /* App.cpp */; };
|
||||
@ -476,6 +479,9 @@
|
||||
8A5B8FD3226F5AF20093271E /* ActiveX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveX.h; sourceTree = "<group>"; };
|
||||
8A5B8FD4226F5AF20093271E /* ActiveX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveX.cpp; sourceTree = "<group>"; };
|
||||
8A5B8FD7226F61000093271E /* VmlDrawing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VmlDrawing.cpp; sourceTree = "<group>"; };
|
||||
8ADF9DA122BB9C4700918F34 /* Si.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Si.cpp; sourceTree = "<group>"; };
|
||||
8ADF9DA322BB9C4F00918F34 /* Text.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Text.cpp; sourceTree = "<group>"; };
|
||||
8ADF9DA522BBA07D00918F34 /* rPr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rPr.cpp; sourceTree = "<group>"; };
|
||||
8AE10E712228255900A542DE /* Comments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Comments.cpp; sourceTree = "<group>"; };
|
||||
8AE10E732228257D00A542DE /* ConditionalFormatting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConditionalFormatting.cpp; sourceTree = "<group>"; };
|
||||
8AECC18E218C991900DEE19A /* App.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = App.cpp; sourceTree = "<group>"; };
|
||||
@ -891,7 +897,9 @@
|
||||
17E6A16B1AC4262800F28F8B /* Run.h */,
|
||||
17E6A16C1AC4262800F28F8B /* SharedStrings.h */,
|
||||
17E6A16D1AC4262800F28F8B /* Si.h */,
|
||||
8ADF9DA122BB9C4700918F34 /* Si.cpp */,
|
||||
17E6A16E1AC4262800F28F8B /* Text.h */,
|
||||
8ADF9DA322BB9C4F00918F34 /* Text.cpp */,
|
||||
);
|
||||
path = SharedStrings;
|
||||
sourceTree = "<group>";
|
||||
@ -907,6 +915,7 @@
|
||||
17E6A1761AC4262800F28F8B /* Fonts.h */,
|
||||
17E6A1771AC4262800F28F8B /* NumFmts.h */,
|
||||
17E6A1781AC4262800F28F8B /* rPr.h */,
|
||||
8ADF9DA522BBA07D00918F34 /* rPr.cpp */,
|
||||
17E6A1791AC4262800F28F8B /* Styles.h */,
|
||||
17E6A17A1AC4262800F28F8B /* TableStyles.h */,
|
||||
17E6A17B1AC4262800F28F8B /* Xfs.h */,
|
||||
@ -1254,6 +1263,7 @@
|
||||
17C1FBA41ACC4250006B99B3 /* Docx.cpp in Sources */,
|
||||
17C1FBA51ACC4250006B99B3 /* ZIndex.cpp in Sources */,
|
||||
8A404FCC2089FFE700F2D5CF /* Directory.cpp in Sources */,
|
||||
8ADF9DA422BB9C4F00918F34 /* Text.cpp in Sources */,
|
||||
17C1FBA61ACC4250006B99B3 /* ParagraphProperty.cpp in Sources */,
|
||||
17C1FBA71ACC4250006B99B3 /* NumFormat.cpp in Sources */,
|
||||
17C1FBA81ACC4250006B99B3 /* SystemUtility.cpp in Sources */,
|
||||
@ -1268,11 +1278,13 @@
|
||||
17C1FBAF1ACC4250006B99B3 /* ChartSerialize.cpp in Sources */,
|
||||
17C1FBB11ACC4250006B99B3 /* Position.cpp in Sources */,
|
||||
69E6AC8C2031ACA900795D9D /* VbaProject.cpp in Sources */,
|
||||
8ADF9DA222BB9C4800918F34 /* Si.cpp in Sources */,
|
||||
8A404FCE208A001E00F2D5CF /* Path.cpp in Sources */,
|
||||
8AE10E742228257E00A542DE /* ConditionalFormatting.cpp in Sources */,
|
||||
691C3E131F20C3D500F1775E /* File.cpp in Sources */,
|
||||
17C1FBB21ACC4250006B99B3 /* Vml.cpp in Sources */,
|
||||
8A5B8FD8226F61010093271E /* VmlDrawing.cpp in Sources */,
|
||||
8ADF9DA622BBA07D00918F34 /* rPr.cpp in Sources */,
|
||||
17C1FBB31ACC4250006B99B3 /* unicode_util.cpp in Sources */,
|
||||
17C1FBB41ACC4250006B99B3 /* FldSimple.cpp in Sources */,
|
||||
69DE2217206E24A700A07A0E /* JsaProject.cpp in Sources */,
|
||||
@ -1301,7 +1313,7 @@
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -1339,7 +1351,7 @@
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -37,6 +37,37 @@
|
||||
// Здесь представлены все простые типы SharedML из спецификации Office Open Xml (22.8)
|
||||
namespace SimpleTypes
|
||||
{
|
||||
const static int shemeDefaultColor[] =
|
||||
{
|
||||
0x00000000, 0x00FFFFFF, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00FFFF00, 0x00FF00FF, 0x0000FFFF,
|
||||
0x00000000, 0x00FFFFFF, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00FFFF00, 0x00FF00FF, 0x0000FFFF,
|
||||
0x00800000, 0x00008000, 0x00000080, 0x00808000, 0x00800080, 0x00008080, 0x00C0C0C0, 0x00808080,
|
||||
0x009999FF, 0x00993366, 0x00FFFFCC, 0x00CCFFFF, 0x00660066, 0x00FF8080, 0x000066CC, 0x00CCCCFF,
|
||||
0x00000080, 0x00FF00FF, 0x00FFFF00, 0x0000FFFF, 0x00800080, 0x00800000, 0x00008080, 0x000000FF,
|
||||
0x0000CCFF, 0x00CCFFFF, 0x00CCFFCC, 0x00FFFF99, 0x0099CCFF, 0x00FF99CC, 0x00CC99FF, 0x00FFCC99,
|
||||
0x003366FF, 0x0033CCCC, 0x0099CC00, 0x00FFCC00, 0x00FF9900, 0x00FF6600, 0x00666699, 0x00969696,
|
||||
0x00003366, 0x00339966, 0x00003300, 0x00333300, 0x00993300, 0x00993366, 0x00333399, 0x00333333
|
||||
};
|
||||
const static int controlPanelColors2[] =
|
||||
{
|
||||
0x00000000, 0x00FFFFFF, 0x00000000, 0x00FFFFFF,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00FFFFFF,
|
||||
0x00FFFFFF, 0x00000000, 0x00FFFFFF, 0x00FFFFFF,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00000000,
|
||||
0x00FFFFFF, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00FFFFFF, 0x00FFFFFF
|
||||
};
|
||||
const static int controlPanelColors1[] =
|
||||
{
|
||||
0x00FFFFFF, 0x00CCCCCC, 0x00FFFFFF, 0x006363CE,
|
||||
0x00DDDDDD, 0x00DDDDDD, 0x00888888, 0x00000000,
|
||||
0x00000000, 0x00808080, 0x00B5D5FF, 0x00000000,
|
||||
0x00FFFFFF, 0x00FFFFFF, 0x007F7F7F, 0x00FBFCC5,
|
||||
0x00000000, 0x00F7F7F7, 0x00000000, 0x00FFFFFF,
|
||||
0x00666666, 0x00C0C0C0, 0x00DDDDDD, 0x00C0C0C0,
|
||||
0x00888888, 0x00FFFFFF, 0x00CCCCCC, 0x00000000
|
||||
};
|
||||
//--------------------------------------------------------------------------------
|
||||
// RelationshipId 22.8.2.1 (Part 1)
|
||||
//--------------------------------------------------------------------------------
|
||||
@ -533,6 +564,22 @@ namespace SimpleTypes
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
virtual EOnOff FromStringA(const char* sValue)
|
||||
{
|
||||
if (strcmp("1", sValue) == 0) this->m_eValue = onoffTrue;
|
||||
else if (strcmp("0", sValue) == 0) this->m_eValue = onoffFalse;
|
||||
else if (strcmp("true", sValue) == 0) this->m_eValue = onoffTrue;
|
||||
else if (strcmp("True", sValue) == 0) this->m_eValue = onoffTrue;
|
||||
else if (strcmp("t", sValue) == 0) this->m_eValue = onoffTrue;
|
||||
else if (strcmp("on", sValue) == 0) this->m_eValue = onoffTrue;
|
||||
else if (strcmp("f", sValue) == 0) this->m_eValue = onoffFalse;
|
||||
else if (strcmp("false", sValue) == 0) this->m_eValue = onoffFalse;
|
||||
else if (strcmp("False", sValue) == 0) this->m_eValue = onoffFalse;
|
||||
else if (strcmp("off", sValue) == 0) this->m_eValue = onoffFalse;
|
||||
else this->m_eValue = eDefValue;
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
|
||||
virtual std::wstring ToString () const
|
||||
{
|
||||
@ -1081,6 +1128,8 @@ namespace SimpleTypes
|
||||
}
|
||||
void SetRGB()
|
||||
{
|
||||
if (this->m_eValue == colortypeRGB) return;
|
||||
|
||||
switch(this->m_eValue)
|
||||
{
|
||||
case colortypeAqua:
|
||||
@ -1190,6 +1239,8 @@ namespace SimpleTypes
|
||||
}
|
||||
void ByColorName(std::wstring& sValue)
|
||||
{
|
||||
this->m_eValue = colortypeNone;
|
||||
|
||||
if (std::wstring::npos != sValue.find(L"aqua")) this->m_eValue = colortypeAqua;
|
||||
else if (std::wstring::npos != sValue.find(L"black")) this->m_eValue = colortypeBlack;
|
||||
else if (std::wstring::npos != sValue.find(L"blue")) this->m_eValue = colortypeBlue;
|
||||
@ -1206,7 +1257,30 @@ namespace SimpleTypes
|
||||
else if (std::wstring::npos != sValue.find(L"teal")) this->m_eValue = colortypeTeal;
|
||||
else if (std::wstring::npos != sValue.find(L"white")) this->m_eValue = colortypeWhite;
|
||||
else if (std::wstring::npos != sValue.find(L"yellow")) this->m_eValue = colortypeYellow;
|
||||
else this->m_eValue = colortypeNone;
|
||||
else if (std::wstring::npos != sValue.find(L"[") && std::wstring::npos != sValue.find(L"]"))
|
||||
{
|
||||
size_t p1 = sValue.find(L"[");
|
||||
size_t p2 = sValue.find(L"]");
|
||||
std::wstring sIndex = p2 > p1 ? sValue.substr(p1 + 1, p2 - p1 - 1) : L"";
|
||||
|
||||
if (!sIndex.empty())
|
||||
{
|
||||
int index = XmlUtils::GetInteger(sIndex);
|
||||
int nRGB = 0;
|
||||
if (index < 64)
|
||||
{
|
||||
nRGB = shemeDefaultColor[index];
|
||||
}
|
||||
else if (index > 64 && index < 92)
|
||||
{
|
||||
nRGB = controlPanelColors1[index - 65];
|
||||
}
|
||||
m_unR = static_cast<unsigned char>((nRGB >> 16) & 0xff);
|
||||
m_unG = static_cast<unsigned char>((nRGB >> 8) & 0xff);
|
||||
m_unB = static_cast<unsigned char>(nRGB & 0xff);
|
||||
this->m_eValue = colortypeRGB;
|
||||
}
|
||||
}
|
||||
|
||||
SetRGB();
|
||||
}
|
||||
|
||||
@ -6736,6 +6736,14 @@ namespace SimpleTypes
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
EXmlSpace FromStringA(const char* pValue)
|
||||
{
|
||||
if ( strcmp("default", pValue) == 0 ) this->m_eValue = xmlspaceDefault;
|
||||
else if ( strcmp("preserve", pValue) == 0 ) this->m_eValue = xmlspacePreserve;
|
||||
else this->m_eValue = eDefValue;
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
|
||||
virtual std::wstring ToString () const
|
||||
{
|
||||
|
||||
@ -91,6 +91,15 @@ namespace OOX
|
||||
while( !wsName.empty() )\
|
||||
{
|
||||
|
||||
#define WritingElement_ReadAttributes_StartChar(Reader) \
|
||||
if ( Reader.GetAttributesCount() <= 0 )\
|
||||
return;\
|
||||
if ( !Reader.MoveToFirstAttribute() )\
|
||||
return;\
|
||||
const char* wsName = Reader.GetNameChar();\
|
||||
while( strlen(wsName) != 0 )\
|
||||
{
|
||||
|
||||
#define WritingElement_ReadAttributes_Start_No_NS(Reader) \
|
||||
if ( Reader.GetAttributesCount() <= 0 )\
|
||||
return;\
|
||||
@ -106,10 +115,20 @@ namespace OOX
|
||||
Value = Reader.GetText();\
|
||||
}
|
||||
|
||||
#define WritingElement_ReadAttributes_Read_ifChar(Reader, AttrName, Value) \
|
||||
if ( strcmp(AttrName, wsName) == 0 )\
|
||||
{\
|
||||
Value = Reader.GetText();\
|
||||
}
|
||||
|
||||
#define WritingElement_ReadAttributes_Read_else_if(Reader, AttrName, Value) \
|
||||
else if ( AttrName == wsName )\
|
||||
Value = Reader.GetText();
|
||||
|
||||
#define WritingElement_ReadAttributes_Read_else_ifChar(Reader, AttrName, Value) \
|
||||
else if ( strcmp(AttrName, wsName) == 0 )\
|
||||
Value = Reader.GetText();
|
||||
|
||||
#define WritingElement_ReadAttributes_ReadSingle(Reader, AttrName, Value) \
|
||||
if ( AttrName == wsName )\
|
||||
{\
|
||||
@ -124,6 +143,13 @@ namespace OOX
|
||||
}\
|
||||
Reader.MoveToElement();
|
||||
|
||||
#define WritingElement_ReadAttributes_EndChar(Reader) \
|
||||
if ( !Reader.MoveToNextAttribute() ) \
|
||||
break;\
|
||||
wsName = Reader.GetNameChar();\
|
||||
}\
|
||||
Reader.MoveToElement();
|
||||
|
||||
#define WritingElement_ReadAttributes_End_No_NS(Reader) \
|
||||
if ( !Reader.MoveToNextAttribute() ) \
|
||||
break;\
|
||||
|
||||
@ -85,6 +85,10 @@ namespace ComplexTypes
|
||||
{
|
||||
m_oVal.FromBool(bVal);
|
||||
}
|
||||
bool ToBool()
|
||||
{
|
||||
return m_oVal.ToBool();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
156
Common/DocxFormat/Source/XlsxFormat/SharedStrings/Si.cpp
Normal file
156
Common/DocxFormat/Source/XlsxFormat/SharedStrings/Si.cpp
Normal file
@ -0,0 +1,156 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "Si.h"
|
||||
|
||||
#include "../../../../../ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
void CSi::fromXLSBExt (NSBinPptxRW::CBinaryFileReader& oStream)
|
||||
{
|
||||
_UINT32 nCount = oStream.GetULong();
|
||||
while(nCount-- > 0)
|
||||
{
|
||||
BYTE nTypeRun = oStream.GetUChar();
|
||||
if(0x1 == nTypeRun)
|
||||
{
|
||||
OOX::Spreadsheet::CRun* pRun = new OOX::Spreadsheet::CRun();
|
||||
if(oStream.GetBool())
|
||||
{
|
||||
pRun->m_oRPr.Init();
|
||||
pRun->m_oRPr->fromXLSB(oStream, XLSB::rt_FONT);
|
||||
}
|
||||
_UINT32 nTextCount = oStream.GetULong();
|
||||
while(nTextCount-- > 0)
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = new OOX::Spreadsheet::CText();
|
||||
pText->m_sText.append(oStream.GetString2());
|
||||
pRun->m_arrItems.push_back(pText);
|
||||
}
|
||||
m_arrItems.push_back(pRun);
|
||||
}
|
||||
else if(0x2 == nTypeRun)
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = new OOX::Spreadsheet::CText();
|
||||
pText->m_sText.append(oStream.GetString2());
|
||||
m_arrItems.push_back(pText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSi::toXLSBExt (NSBinPptxRW::CXlsbBinaryWriter& oStream)
|
||||
{
|
||||
//it's not by XLSB format
|
||||
oStream.WriteULONG(m_arrItems.size());
|
||||
for(size_t i = 0; i < m_arrItems.size(); ++i)
|
||||
{
|
||||
OOX::Spreadsheet::WritingElement* we = m_arrItems[i];
|
||||
if(OOX::et_x_r == we->getType())
|
||||
{
|
||||
oStream.WriteBYTE(0x1);
|
||||
OOX::Spreadsheet::CRun* pRun = static_cast<OOX::Spreadsheet::CRun*>(we);
|
||||
oStream.WriteBOOL(pRun->m_oRPr.IsInit());
|
||||
if(pRun->m_oRPr.IsInit())
|
||||
{
|
||||
pRun->m_oRPr->toXLSB(oStream);
|
||||
}
|
||||
oStream.WriteULONG(pRun->m_arrItems.size());
|
||||
for(size_t j = 0, length = pRun->m_arrItems.size(); j < length; ++j)
|
||||
{
|
||||
OOX::Spreadsheet::WritingElement* we = pRun->m_arrItems[j];
|
||||
if(OOX::et_x_t == we->getType())
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = static_cast<OOX::Spreadsheet::CText*>(we);
|
||||
oStream.WriteString(pText->m_sText);
|
||||
}
|
||||
else
|
||||
{
|
||||
oStream.WriteString(L"");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(OOX::et_x_t == we->getType())
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = static_cast<OOX::Spreadsheet::CText*>(we);
|
||||
oStream.WriteBYTE(0x2);
|
||||
oStream.WriteString(pText->m_sText);
|
||||
}
|
||||
else
|
||||
{
|
||||
oStream.WriteBYTE(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
_UINT32 CSi::getXLSBSize() const
|
||||
{
|
||||
_UINT32 nLen = 4;
|
||||
for(size_t i = 0; i < m_arrItems.size(); ++i)
|
||||
{
|
||||
nLen += 1;
|
||||
OOX::Spreadsheet::WritingElement* we = m_arrItems[i];
|
||||
if(OOX::et_x_r == we->getType())
|
||||
{
|
||||
nLen += 1;
|
||||
OOX::Spreadsheet::CRun* pRun = static_cast<OOX::Spreadsheet::CRun*>(we);
|
||||
if(pRun->m_oRPr.IsInit())
|
||||
{
|
||||
nLen += pRun->m_oRPr->getXLSBSize();
|
||||
}
|
||||
nLen += 4;
|
||||
for(size_t j = 0, length = pRun->m_arrItems.size(); j < length; ++j)
|
||||
{
|
||||
OOX::Spreadsheet::WritingElement* we = pRun->m_arrItems[j];
|
||||
if(OOX::et_x_t == we->getType())
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = static_cast<OOX::Spreadsheet::CText*>(we);
|
||||
nLen += 4 + 2 * pText->m_sText.length();
|
||||
}
|
||||
else
|
||||
{
|
||||
nLen += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(OOX::et_x_t == we->getType())
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = static_cast<OOX::Spreadsheet::CText*>(we);
|
||||
nLen += 4 + 2 * pText->m_sText.length();
|
||||
}
|
||||
}
|
||||
return nLen;
|
||||
}
|
||||
|
||||
} //Spreadsheet
|
||||
} // OOX
|
||||
@ -38,6 +38,12 @@
|
||||
#include "PhoneticPr.h"
|
||||
#include "Run.h"
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CBinaryFileReader;
|
||||
class CXlsbBinaryWriter;
|
||||
}
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
@ -141,6 +147,10 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
|
||||
void fromXLSBExt (NSBinPptxRW::CBinaryFileReader& oStream);
|
||||
void toXLSBExt (NSBinPptxRW::CXlsbBinaryWriter& oStream);
|
||||
_UINT32 getXLSBSize() const;
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_x_Si;
|
||||
|
||||
210
Common/DocxFormat/Source/XlsxFormat/SharedStrings/Text.cpp
Normal file
210
Common/DocxFormat/Source/XlsxFormat/SharedStrings/Text.cpp
Normal file
@ -0,0 +1,210 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "Text.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
void CText::fromXMLToXLSB(XmlUtils::CXmlLiteReader& oReader, SimpleTypes::Spreadsheet::ECellTypeType eType, _UINT16& nType, double& dValue, unsigned int& nValue, BYTE& bValue, std::wstring** psValue, bool& bForceFormula)
|
||||
{
|
||||
SimpleTypes::EXmlSpace eSpace = SimpleTypes::xmlspaceDefault;
|
||||
ReadAttributesToXLSB( oReader, eSpace );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
if(SimpleTypes::Spreadsheet::celltypeStr == eType || SimpleTypes::Spreadsheet::celltypeInlineStr == eType)
|
||||
{
|
||||
std::string sVal = oReader.GetText2A();
|
||||
fromXMLToXLSB(sVal.c_str(), eSpace, eType, nType, dValue, nValue, bValue, psValue, bForceFormula);
|
||||
}
|
||||
else
|
||||
{
|
||||
int nDepth = oReader.GetDepth();
|
||||
XmlUtils::XmlNodeType eNodeType = XmlUtils::XmlNodeType_EndElement;
|
||||
while (oReader.Read(eNodeType) && oReader.GetDepth() >= nDepth && XmlUtils::XmlNodeType_EndElement != eNodeType)
|
||||
{
|
||||
if (eNodeType == XmlUtils::XmlNodeType_Text)
|
||||
{
|
||||
fromXMLToXLSB(oReader.GetTextChar(), eSpace, eType, nType, dValue, nValue, bValue, psValue, bForceFormula);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void CText::fromXMLToXLSB(const char* pVal, SimpleTypes::EXmlSpace eSpace, SimpleTypes::Spreadsheet::ECellTypeType eType, _UINT16& nType, double& dValue, unsigned int& nValue, BYTE& bValue, std::wstring** psValue, bool& bForceFormula)
|
||||
{
|
||||
if(pVal[0] == '\0')
|
||||
return;
|
||||
if(SimpleTypes::Spreadsheet::celltypeNumber == eType)
|
||||
{
|
||||
//todo RkNumber
|
||||
nType = XLSB::rt_CELL_REAL;
|
||||
try
|
||||
{
|
||||
dValue = atof(pVal);
|
||||
}
|
||||
catch(...)
|
||||
{ //1.3912059045063478e-310
|
||||
//Lighting Load Calculation.xls
|
||||
}
|
||||
}
|
||||
else if(SimpleTypes::Spreadsheet::celltypeSharedString == eType)
|
||||
{
|
||||
nType = XLSB::rt_CELL_ISST;
|
||||
try
|
||||
{
|
||||
nValue = atoi(pVal);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
}
|
||||
else if(SimpleTypes::Spreadsheet::celltypeError == eType)
|
||||
{
|
||||
nType = XLSB::rt_CELL_ERROR;
|
||||
if(strcmp("#NULL!", pVal) == 0)
|
||||
{
|
||||
bValue = 0x00;
|
||||
}
|
||||
else if(strcmp("#DIV/0!", pVal) == 0)
|
||||
{
|
||||
bValue = 0x07;
|
||||
}
|
||||
else if(strcmp("#VALUE!", pVal) == 0)
|
||||
{
|
||||
bValue = 0x0F;
|
||||
}
|
||||
else if(strcmp("#REF!", pVal) == 0)
|
||||
{
|
||||
bValue = 0x17;
|
||||
}
|
||||
else if(strcmp("#NAME?", pVal) == 0)
|
||||
{
|
||||
bValue = 0x1D;
|
||||
}
|
||||
else if(strcmp("#NUM!", pVal) == 0)
|
||||
{
|
||||
bValue = 0x24;
|
||||
}
|
||||
else if(strcmp("#N/A", pVal) == 0)
|
||||
{
|
||||
bValue = 0x2A;
|
||||
}
|
||||
else if(strcmp("#GETTING_DATA", pVal) == 0)
|
||||
{
|
||||
bValue = 0x2B;
|
||||
}
|
||||
}
|
||||
else if(SimpleTypes::Spreadsheet::celltypeBool == eType)
|
||||
{
|
||||
nType = XLSB::rt_CELL_BOOL;
|
||||
SimpleTypes::COnOff<> oOnOff;
|
||||
oOnOff.FromStringA(pVal);
|
||||
bValue = oOnOff.ToBool() ? 1 : 0;
|
||||
}
|
||||
else if(SimpleTypes::Spreadsheet::celltypeInlineStr == eType)
|
||||
{
|
||||
nType = XLSB::rt_CELL_ST;
|
||||
if(NULL == (*psValue))
|
||||
{
|
||||
(*psValue) = new std::wstring();
|
||||
}
|
||||
(*psValue)->append(NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)pVal, (LONG)strlen(pVal)));
|
||||
trimString(**psValue, eSpace);
|
||||
}
|
||||
else if(SimpleTypes::Spreadsheet::celltypeStr == eType)
|
||||
{
|
||||
bForceFormula = true;
|
||||
nType = XLSB::rt_CELL_ST;
|
||||
if(NULL == (*psValue))
|
||||
{
|
||||
(*psValue) = new std::wstring();
|
||||
}
|
||||
(*psValue)->append(NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)pVal, (LONG)strlen(pVal)));
|
||||
trimString(**psValue, eSpace);
|
||||
}
|
||||
}
|
||||
void CText::ReadAttributesToXLSB(XmlUtils::CXmlLiteReader& oReader, SimpleTypes::EXmlSpace& eSpace)
|
||||
{
|
||||
WritingElement_ReadAttributes_StartChar( oReader )
|
||||
if ( strcmp("space", wsName) == 0 )
|
||||
{
|
||||
SimpleTypes::CXmlSpace<> oSpace;
|
||||
oSpace.FromStringA(oReader.GetTextChar());
|
||||
eSpace = oSpace.GetValue();
|
||||
break;
|
||||
}
|
||||
|
||||
WritingElement_ReadAttributes_EndChar( oReader )
|
||||
}
|
||||
void CText::trimString(std::wstring& sVal, SimpleTypes::EXmlSpace eSpace)
|
||||
{
|
||||
NSStringExt::Replace(sVal, L"\t", L"");
|
||||
if(SimpleTypes::xmlspacePreserve == eSpace)
|
||||
{
|
||||
//trim ' ', '\r', '\n'
|
||||
int nLength = (int)sVal.length();
|
||||
int nStartIndex = 0;
|
||||
int nEndIndex = nLength - 1;
|
||||
|
||||
for(int i = nStartIndex; i < nLength; ++i)
|
||||
{
|
||||
wchar_t cElem = sVal[i];
|
||||
if(' ' == cElem || '\n' == cElem || '\r' == cElem)
|
||||
nStartIndex++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
for(int i = nEndIndex; i > nStartIndex; --i)
|
||||
{
|
||||
wchar_t cElem = sVal[i];
|
||||
if(' ' == cElem || '\n' == cElem || '\r' == cElem)
|
||||
nEndIndex--;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if(0 != nStartIndex || nLength - 1 != nEndIndex)
|
||||
{
|
||||
if (nStartIndex <= nEndIndex)
|
||||
sVal = sVal.substr(nStartIndex, nEndIndex - nStartIndex + 1);
|
||||
else
|
||||
sVal.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
SimpleTypes::EXmlSpace CText::GetSpace() const
|
||||
{
|
||||
return m_oSpace.IsInit() ? m_oSpace->GetValue() : SimpleTypes::xmlspaceDefault;
|
||||
}
|
||||
} //Spreadsheet
|
||||
} // OOX
|
||||
@ -61,7 +61,7 @@ namespace OOX
|
||||
if(std::wstring::npos != m_sText.find(' ') || std::wstring::npos != m_sText.find('\n'))
|
||||
writer.WriteString(_T(" xml:space=\"preserve\""));
|
||||
writer.WriteString(_T(">"));
|
||||
writer.WriteEncodeXmlString(m_sText);
|
||||
writer.WriteEncodeXmlStringHHHH(m_sText);
|
||||
writer.WriteString(_T("</t>"));
|
||||
}
|
||||
virtual void toXML2(NSStringUtils::CStringBuilder& writer, const wchar_t* name) const
|
||||
@ -71,7 +71,7 @@ namespace OOX
|
||||
if(std::wstring::npos != m_sText.find(' ') || std::wstring::npos != m_sText.find('\n'))
|
||||
writer.WriteString(_T(" xml:space=\"preserve\""));
|
||||
writer.WriteString(_T(">"));
|
||||
writer.WriteEncodeXmlString(m_sText);
|
||||
writer.WriteEncodeXmlStringHHHH(m_sText);
|
||||
writer.WriteString(_T("</"));
|
||||
writer.WriteString(name);
|
||||
writer.WriteString(_T(">"));
|
||||
@ -83,44 +83,32 @@ namespace OOX
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
m_sText = oReader.GetText3();
|
||||
NSStringExt::Replace(m_sText, L"\t", L"");
|
||||
if(!(m_oSpace.IsInit() && SimpleTypes::xmlspacePreserve == m_oSpace->GetValue()))
|
||||
int nDepth = oReader.GetDepth();
|
||||
XmlUtils::XmlNodeType eNodeType = XmlUtils::XmlNodeType_EndElement;
|
||||
while (oReader.Read(eNodeType) && oReader.GetDepth() >= nDepth && XmlUtils::XmlNodeType_EndElement != eNodeType)
|
||||
{
|
||||
//trim ' ', '\r', '\n'
|
||||
int nLength = (int)m_sText.length();
|
||||
int nStartIndex = 0;
|
||||
int nEndIndex = nLength - 1;
|
||||
|
||||
for(int i = nStartIndex; i < nLength; ++i)
|
||||
if (eNodeType == XmlUtils::XmlNodeType_Text || eNodeType == XmlUtils::XmlNodeType_Whitespace || eNodeType == XmlUtils::XmlNodeType_SIGNIFICANT_WHITESPACE)
|
||||
{
|
||||
wchar_t cElem = m_sText[i];
|
||||
if(' ' == cElem || '\n' == cElem || '\r' == cElem)
|
||||
nStartIndex++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
for(int i = nEndIndex; i > nStartIndex; --i)
|
||||
{
|
||||
wchar_t cElem = m_sText[i];
|
||||
if(' ' == cElem || '\n' == cElem || '\r' == cElem)
|
||||
nEndIndex--;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if(0 != nStartIndex || nLength - 1 != nEndIndex)
|
||||
{
|
||||
if (nStartIndex <= nEndIndex)
|
||||
m_sText = m_sText.substr(nStartIndex, nEndIndex - nStartIndex + 1);
|
||||
else
|
||||
m_sText.clear();
|
||||
std::string sTemp = oReader.GetTextA();
|
||||
wchar_t* pUnicodes = NULL;
|
||||
LONG lOutputCount = 0;
|
||||
NSFile::CUtf8Converter::GetUnicodeStringFromUTF8WithHHHH((BYTE*)sTemp.c_str(), sTemp.length(), pUnicodes, lOutputCount);
|
||||
m_sText.append(pUnicodes);
|
||||
RELEASEARRAYOBJECTS(pUnicodes);
|
||||
}
|
||||
}
|
||||
|
||||
trimString(m_sText, GetSpace());
|
||||
}
|
||||
static void fromXMLToXLSB(XmlUtils::CXmlLiteReader& oReader, SimpleTypes::Spreadsheet::ECellTypeType eType, _UINT16& nType, double& dValue, unsigned int& nValue, BYTE& bValue, std::wstring** psValue, bool& bForceFormula);
|
||||
static void fromXMLToXLSB(const char* pVal, SimpleTypes::EXmlSpace eSpace, SimpleTypes::Spreadsheet::ECellTypeType eType, _UINT16& nType, double& dValue, unsigned int& nValue, BYTE& bValue, std::wstring** psValue, bool& bForceFormula);
|
||||
|
||||
static void trimString(std::wstring& sVal, SimpleTypes::EXmlSpace eSpace);
|
||||
std::wstring ToString() const
|
||||
{
|
||||
return m_sText;
|
||||
}
|
||||
SimpleTypes::EXmlSpace GetSpace() const;
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_x_t;
|
||||
@ -152,6 +140,7 @@ namespace OOX
|
||||
|
||||
oReader.MoveToElement();
|
||||
}
|
||||
static void ReadAttributesToXLSB(XmlUtils::CXmlLiteReader& oReader, SimpleTypes::EXmlSpace& eSpace);
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -1536,6 +1536,26 @@ namespace SimpleTypes
|
||||
this->m_eValue = eDefValue;
|
||||
return this->m_eValue;
|
||||
}
|
||||
ECellTypeType FromStringA(const char* sValue)
|
||||
{
|
||||
if(strcmp("s", sValue) == 0)
|
||||
this->m_eValue = celltypeSharedString;
|
||||
else if(strcmp("str", sValue) == 0)
|
||||
this->m_eValue = celltypeStr;
|
||||
else if(strcmp("n", sValue) == 0)
|
||||
this->m_eValue = celltypeNumber;
|
||||
else if(strcmp("e", sValue) == 0)
|
||||
this->m_eValue = celltypeError;
|
||||
else if(strcmp("b", sValue) == 0)
|
||||
this->m_eValue = celltypeBool;
|
||||
else if(strcmp("inlineStr", sValue) == 0)
|
||||
this->m_eValue = celltypeInlineStr;
|
||||
else if(strcmp("d", sValue) == 0)
|
||||
this->m_eValue = celltypeDate;
|
||||
else
|
||||
this->m_eValue = eDefValue;
|
||||
return this->m_eValue;
|
||||
}
|
||||
|
||||
virtual std::wstring ToString () const
|
||||
{
|
||||
@ -2090,6 +2110,120 @@ namespace SimpleTypes
|
||||
SimpleType_FromString (EPageUnits)
|
||||
SimpleType_Operator_Equal (CPageUnits)
|
||||
};
|
||||
|
||||
enum ECellComments
|
||||
{
|
||||
cellcommentsNone = 0,
|
||||
cellcommentsAsDisplayed = 1,
|
||||
cellcommentsAtEnd = 2
|
||||
};
|
||||
|
||||
template<ECellComments eDefValue = cellcommentsNone>
|
||||
class CCellComments : public CSimpleType<ECellComments, eDefValue>
|
||||
{
|
||||
public:
|
||||
CCellComments() {}
|
||||
|
||||
virtual ECellComments FromString(std::wstring &sValue)
|
||||
{
|
||||
if ( (L"asDisplayed") == sValue ) this->m_eValue = cellcommentsAsDisplayed;
|
||||
else if ( (L"atEnd") == sValue ) this->m_eValue = cellcommentsAtEnd;
|
||||
else if ( (L"none") == sValue ) this->m_eValue = cellcommentsNone;
|
||||
else this->m_eValue = eDefValue;
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
|
||||
virtual std::wstring ToString () const
|
||||
{
|
||||
switch(this->m_eValue)
|
||||
{
|
||||
case cellcommentsAsDisplayed : return (L"asDisplayed");
|
||||
case cellcommentsAtEnd : return (L"atEnd");
|
||||
case cellcommentsNone : return (L"none");
|
||||
default : return (L"none");
|
||||
}
|
||||
}
|
||||
|
||||
SimpleType_FromString (ECellComments)
|
||||
SimpleType_Operator_Equal (CCellComments)
|
||||
};
|
||||
|
||||
enum EPrintError
|
||||
{
|
||||
printerrorDisplayed = 0,
|
||||
printerrorBlank = 1,
|
||||
printerrorDash = 2,
|
||||
printerrorNA = 3
|
||||
};
|
||||
|
||||
template<EPrintError eDefValue = printerrorDisplayed>
|
||||
class CPrintError : public CSimpleType<EPrintError, eDefValue>
|
||||
{
|
||||
public:
|
||||
CPrintError() {}
|
||||
|
||||
virtual EPrintError FromString(std::wstring &sValue)
|
||||
{
|
||||
if ( (L"blank") == sValue ) this->m_eValue = printerrorBlank;
|
||||
else if ( (L"dash") == sValue ) this->m_eValue = printerrorDash;
|
||||
else if ( (L"displayed") == sValue ) this->m_eValue = printerrorDisplayed;
|
||||
else if ( (L"NA") == sValue ) this->m_eValue = printerrorNA;
|
||||
else this->m_eValue = eDefValue;
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
|
||||
virtual std::wstring ToString () const
|
||||
{
|
||||
switch(this->m_eValue)
|
||||
{
|
||||
case printerrorBlank : return (L"blank");
|
||||
case printerrorDash : return (L"dash");
|
||||
case printerrorDisplayed : return (L"displayed");
|
||||
case printerrorNA : return (L"NA");
|
||||
default : return (L"displayed");
|
||||
}
|
||||
}
|
||||
|
||||
SimpleType_FromString (EPrintError)
|
||||
SimpleType_Operator_Equal (CPrintError)
|
||||
};
|
||||
|
||||
enum EPageOrder
|
||||
{
|
||||
pageorderDownThenOver = 0,
|
||||
pageorderOverThenDown = 1
|
||||
};
|
||||
|
||||
template<EPageOrder eDefValue = pageorderDownThenOver>
|
||||
class CPageOrder : public CSimpleType<EPageOrder, eDefValue>
|
||||
{
|
||||
public:
|
||||
CPageOrder() {}
|
||||
|
||||
virtual EPageOrder FromString(std::wstring &sValue)
|
||||
{
|
||||
if ( (L"downThenOver") == sValue ) this->m_eValue = pageorderDownThenOver;
|
||||
else if ( (L"overThenDown") == sValue ) this->m_eValue = pageorderOverThenDown;
|
||||
else this->m_eValue = eDefValue;
|
||||
|
||||
return this->m_eValue;
|
||||
}
|
||||
|
||||
virtual std::wstring ToString () const
|
||||
{
|
||||
switch(this->m_eValue)
|
||||
{
|
||||
case pageorderDownThenOver : return (L"downThenOver");
|
||||
case pageorderOverThenDown : return (L"overThenDown");
|
||||
default : return (L"downThenOver");
|
||||
}
|
||||
}
|
||||
|
||||
SimpleType_FromString (EPageOrder)
|
||||
SimpleType_Operator_Equal (CPageOrder)
|
||||
};
|
||||
enum ETotalsRowFunction
|
||||
{
|
||||
totalrowfunctionAverage = 1,
|
||||
|
||||
430
Common/DocxFormat/Source/XlsxFormat/Styles/rPr.cpp
Normal file
430
Common/DocxFormat/Source/XlsxFormat/Styles/rPr.cpp
Normal file
@ -0,0 +1,430 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "rPr.h"
|
||||
|
||||
#include "../../../../../ASCOfficePPTXFile/Editor/BinaryFileReaderWriter.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
void CRPr::fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nType)
|
||||
{
|
||||
//LONG nEnd = oStream.XlsbReadRecordLength() + oStream.GetPos();
|
||||
|
||||
_UINT16 dyHeight = oStream.GetUShort();
|
||||
if(dyHeight >= 0x0014)
|
||||
{
|
||||
m_oSz.Init();
|
||||
m_oSz->m_oVal.Init();
|
||||
m_oSz->m_oVal->SetValue(dyHeight / 20);
|
||||
}
|
||||
_UINT16 grbit = oStream.GetUShort();
|
||||
if(0 != (grbit & 0x2))
|
||||
{
|
||||
m_oItalic.Init();
|
||||
m_oItalic->FromBool(true);
|
||||
}
|
||||
if(0 != (grbit & 0x8))
|
||||
{
|
||||
m_oStrike.Init();
|
||||
m_oStrike->FromBool(true);
|
||||
}
|
||||
if(0 != (grbit & 0x10))
|
||||
{
|
||||
m_oOutline.Init();
|
||||
m_oOutline->FromBool(true);
|
||||
}
|
||||
if(0 != (grbit & 0x20))
|
||||
{
|
||||
m_oShadow.Init();
|
||||
m_oShadow->FromBool(true);
|
||||
}
|
||||
if(0 != (grbit & 0x40))
|
||||
{
|
||||
m_oCondense.Init();
|
||||
m_oCondense->FromBool(true);
|
||||
}
|
||||
if(0 != (grbit & 0x80))
|
||||
{
|
||||
m_oExtend.Init();
|
||||
m_oExtend->FromBool(true);
|
||||
}
|
||||
_UINT16 bls = oStream.GetUShort();
|
||||
if(0x02BC == bls)
|
||||
{
|
||||
m_oBold.Init();
|
||||
m_oBold->FromBool(true);
|
||||
}
|
||||
_UINT16 sss = oStream.GetUShort();
|
||||
if(sss > 0)
|
||||
{
|
||||
m_oVertAlign.Init();
|
||||
m_oVertAlign->m_oVerticalAlign.Init();
|
||||
switch(sss)
|
||||
{
|
||||
case 0x0001:
|
||||
m_oVertAlign->m_oVerticalAlign->SetValue(SimpleTypes::verticalalignrunSuperscript);
|
||||
break;
|
||||
case 0x0002:
|
||||
m_oVertAlign->m_oVerticalAlign->SetValue(SimpleTypes::verticalalignrunSubscript);
|
||||
break;
|
||||
}
|
||||
}
|
||||
_UINT16 uls = oStream.GetUChar();
|
||||
if(uls > 0)
|
||||
{
|
||||
m_oUnderline.Init();
|
||||
m_oUnderline->m_oUnderline.Init();
|
||||
switch(uls)
|
||||
{
|
||||
case 0x01:
|
||||
m_oUnderline->m_oUnderline->SetValue(SimpleTypes::Spreadsheet::underlineSingle);
|
||||
break;
|
||||
case 0x02:
|
||||
m_oUnderline->m_oUnderline->SetValue(SimpleTypes::Spreadsheet::underlineDouble);
|
||||
break;
|
||||
case 0x21:
|
||||
m_oUnderline->m_oUnderline->SetValue(SimpleTypes::Spreadsheet::underlineSingleAccounting);
|
||||
break;
|
||||
case 0x22:
|
||||
m_oUnderline->m_oUnderline->SetValue(SimpleTypes::Spreadsheet::underlineDoubleAccounting);
|
||||
break;
|
||||
}
|
||||
}
|
||||
_UINT16 bFamily = oStream.GetUChar();
|
||||
if(bFamily > 0)
|
||||
{
|
||||
m_oFamily.Init();
|
||||
m_oFamily->m_oFontFamily.Init();
|
||||
m_oFamily->m_oFontFamily->SetValue((SimpleTypes::Spreadsheet::EFontFamily)bFamily);
|
||||
}
|
||||
_UINT16 bCharSet = oStream.GetUChar();
|
||||
if(bCharSet > 0)
|
||||
{
|
||||
m_oCharset.Init();
|
||||
m_oCharset->m_oCharset.Init();
|
||||
m_oCharset->m_oCharset->SetValue((SimpleTypes::Spreadsheet::EFontCharset)bCharSet);
|
||||
}
|
||||
oStream.Skip(1);
|
||||
|
||||
BYTE xColorType = oStream.GetUChar();
|
||||
BYTE index = oStream.GetUChar();
|
||||
_INT16 nTintAndShade = oStream.GetShort();
|
||||
_UINT32 rgba = oStream.GetULong();
|
||||
m_oColor.Init();
|
||||
if(0 != (xColorType & 0x1))
|
||||
{
|
||||
m_oColor->m_oRgb.Init();
|
||||
m_oColor->m_oRgb->Set_R((unsigned char)(rgba & 0xFF));
|
||||
m_oColor->m_oRgb->Set_G((unsigned char)((rgba & 0xFF00)>>8));
|
||||
m_oColor->m_oRgb->Set_B((unsigned char)((rgba & 0xFF0000)>>16));
|
||||
m_oColor->m_oRgb->Set_A((unsigned char)((rgba & 0xFF000000)>>24));
|
||||
}
|
||||
xColorType &= 0xFE;
|
||||
if(0x2 == xColorType)
|
||||
{
|
||||
m_oColor->m_oIndexed.Init();
|
||||
m_oColor->m_oIndexed->SetValue(index);
|
||||
}
|
||||
else if(0x6 == xColorType)
|
||||
{
|
||||
m_oColor->m_oThemeColor.Init();
|
||||
SimpleTypes::Spreadsheet::EThemeColor eColor = SimpleTypes::Spreadsheet::themecolorDark1;
|
||||
switch(index)
|
||||
{
|
||||
case 0x01:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorLight1;
|
||||
break;
|
||||
case 0x00:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorDark1;
|
||||
break;
|
||||
case 0x03:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorLight2;
|
||||
break;
|
||||
case 0x02:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorDark2;
|
||||
break;
|
||||
case 0x04:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorAccent1;
|
||||
break;
|
||||
case 0x05:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorAccent2;
|
||||
break;
|
||||
case 0x06:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorAccent3;
|
||||
break;
|
||||
case 0x07:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorAccent4;
|
||||
break;
|
||||
case 0x08:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorAccent5;
|
||||
break;
|
||||
case 0x09:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorAccent6;
|
||||
break;
|
||||
case 0x0A:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorHyperlink;
|
||||
break;
|
||||
case 0x0B:
|
||||
eColor = SimpleTypes::Spreadsheet::themecolorFollowedHyperlink;
|
||||
break;
|
||||
}
|
||||
m_oColor->m_oThemeColor->SetValue(eColor);
|
||||
}
|
||||
if(0 != nTintAndShade)
|
||||
{
|
||||
m_oColor->m_oTint.Init();
|
||||
m_oColor->m_oTint->SetValue(((double)nTintAndShade) / 0x7FFF);
|
||||
}
|
||||
if(!m_oColor->m_oThemeColor.IsInit() && !m_oColor->m_oRgb.IsInit() && !m_oColor->m_oIndexed.IsInit())
|
||||
{
|
||||
m_oColor->m_oAuto.Init();
|
||||
m_oColor->m_oAuto->FromBool(true);
|
||||
}
|
||||
|
||||
_UINT16 bFontScheme = oStream.GetUChar();
|
||||
if(bFontScheme > 0)
|
||||
{
|
||||
m_oScheme.Init();
|
||||
m_oScheme->m_oFontScheme.Init();
|
||||
switch(bFontScheme)
|
||||
{
|
||||
case 0x01:
|
||||
m_oScheme->m_oFontScheme->SetValue(SimpleTypes::Spreadsheet::fontschemeMajor);
|
||||
break;
|
||||
case 0x02:
|
||||
m_oScheme->m_oFontScheme->SetValue(SimpleTypes::Spreadsheet::fontschemeMinor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_oRFont.Init();
|
||||
m_oRFont->m_sVal.Init();
|
||||
m_oRFont->m_sVal->append(oStream.GetString2());
|
||||
|
||||
//oStream.Seek(nEnd);
|
||||
}
|
||||
void CRPr::toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream) const
|
||||
{
|
||||
//oStream.XlsbStartRecord();
|
||||
|
||||
_UINT16 dyHeight = 0;
|
||||
if(m_oSz.IsInit() && m_oSz->m_oVal.IsInit())
|
||||
{
|
||||
dyHeight = (_UINT16)((m_oSz->m_oVal->GetValue() * 20)) & 0x1FFF;
|
||||
}
|
||||
oStream.WriteUSHORT(dyHeight);
|
||||
_UINT16 grbit = 0;
|
||||
if(m_oItalic.IsInit() && m_oItalic->ToBool())
|
||||
{
|
||||
grbit |= 0x2;
|
||||
}
|
||||
if(m_oStrike.IsInit() && m_oStrike->ToBool())
|
||||
{
|
||||
grbit |= 0x8;
|
||||
}
|
||||
if(m_oOutline.IsInit() && m_oOutline->ToBool())
|
||||
{
|
||||
grbit |= 0x10;
|
||||
}
|
||||
if(m_oShadow.IsInit() && m_oShadow->ToBool())
|
||||
{
|
||||
grbit |= 0x20;
|
||||
}
|
||||
if(m_oCondense.IsInit() && m_oCondense->ToBool())
|
||||
{
|
||||
grbit |= 0x40;
|
||||
}
|
||||
if(m_oExtend.IsInit() && m_oExtend->ToBool())
|
||||
{
|
||||
grbit |= 0x80;
|
||||
}
|
||||
oStream.WriteUSHORT(grbit);
|
||||
_UINT16 bls = m_oBold.IsInit() && m_oBold->ToBool() ? 0x02BC : 0x0190;
|
||||
oStream.WriteUSHORT(bls);
|
||||
_UINT16 sss = 0;
|
||||
if(m_oVertAlign.IsInit() && m_oVertAlign->m_oVerticalAlign.IsInit())
|
||||
{
|
||||
if(SimpleTypes::verticalalignrunSuperscript == m_oVertAlign->m_oVerticalAlign->GetValue())
|
||||
{
|
||||
sss = 0x0001;
|
||||
}
|
||||
else if(SimpleTypes::verticalalignrunSubscript == m_oVertAlign->m_oVerticalAlign->GetValue())
|
||||
{
|
||||
sss = 0x0002;
|
||||
}
|
||||
}
|
||||
oStream.WriteUSHORT(sss);
|
||||
BYTE uls = 0;
|
||||
if(m_oUnderline.IsInit())
|
||||
{
|
||||
SimpleTypes::Spreadsheet::EUnderline eType = SimpleTypes::Spreadsheet::underlineSingle;
|
||||
if(m_oUnderline->m_oUnderline.IsInit())
|
||||
eType = m_oUnderline->m_oUnderline->GetValue();
|
||||
|
||||
switch(eType)
|
||||
{
|
||||
case SimpleTypes::Spreadsheet::underlineSingle:
|
||||
uls = 0x01;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::underlineDouble:
|
||||
uls = 0x02;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::underlineSingleAccounting:
|
||||
uls = 0x21;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::underlineDoubleAccounting:
|
||||
uls = 0x22;
|
||||
break;
|
||||
}
|
||||
}
|
||||
oStream.WriteBYTE(uls);
|
||||
BYTE bFamily = 0;
|
||||
if(m_oFamily.IsInit() && m_oFamily->m_oFontFamily.IsInit())
|
||||
{
|
||||
bFamily = m_oFamily->m_oFontFamily->GetValue();
|
||||
}
|
||||
oStream.WriteBYTE(bFamily);
|
||||
BYTE bCharSet = 0;
|
||||
if(m_oCharset.IsInit() && m_oCharset->m_oCharset.IsInit())
|
||||
{
|
||||
bCharSet = m_oCharset->m_oCharset->GetValue();
|
||||
}
|
||||
oStream.WriteBYTE(bCharSet);
|
||||
oStream.WriteBYTE(0);
|
||||
BYTE xColorType = 0;
|
||||
_UINT32 rgba = 0;
|
||||
BYTE index = 0;
|
||||
_INT16 nTintAndShade = 0;
|
||||
if(m_oColor.IsInit())
|
||||
{
|
||||
if(m_oColor->m_oRgb.IsInit())
|
||||
{
|
||||
xColorType |= 0x1;
|
||||
xColorType |= 0x4;
|
||||
rgba = m_oColor->m_oRgb->Get_R() | (m_oColor->m_oRgb->Get_G() << 8) | (m_oColor->m_oRgb->Get_B() << 16) | (m_oColor->m_oRgb->Get_A() << 24);
|
||||
}
|
||||
else if(m_oColor->m_oIndexed.IsInit())
|
||||
{
|
||||
BYTE ucA;
|
||||
BYTE ucR;
|
||||
BYTE ucG;
|
||||
BYTE ucB;
|
||||
if(OOX::Spreadsheet::CIndexedColors::GetDefaultRGBAByIndex(m_oColor->m_oIndexed->GetValue(), ucR, ucG, ucB, ucA))
|
||||
{
|
||||
xColorType |= 0x1;
|
||||
xColorType |= 0x4;
|
||||
rgba = ucR | (ucG << 8) | (ucB << 16) | (ucA << 24);
|
||||
}
|
||||
}
|
||||
else if(m_oColor->m_oThemeColor.IsInit())
|
||||
{
|
||||
xColorType |= 0x6;
|
||||
switch(m_oColor->m_oThemeColor->GetValue())
|
||||
{
|
||||
case SimpleTypes::Spreadsheet::themecolorLight1:
|
||||
index = 0x01;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorDark1:
|
||||
index = 0x00;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorLight2:
|
||||
index = 0x03;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorDark2:
|
||||
index = 0x02;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorAccent1:
|
||||
index = 0x04;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorAccent2:
|
||||
index = 0x05;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorAccent3:
|
||||
index = 0x06;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorAccent4:
|
||||
index = 0x07;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorAccent5:
|
||||
index = 0x08;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorAccent6:
|
||||
index = 0x09;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorHyperlink:
|
||||
index = 0x0A;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::themecolorFollowedHyperlink:
|
||||
index = 0x0B;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(m_oColor->m_oTint.IsInit())
|
||||
{
|
||||
nTintAndShade = _INT16(0x7FFF * m_oColor->m_oTint->GetValue());
|
||||
}
|
||||
}
|
||||
oStream.WriteBYTE(xColorType);
|
||||
oStream.WriteBYTE(index);
|
||||
oStream.WriteSHORT(nTintAndShade);
|
||||
oStream.WriteULONG(rgba);
|
||||
BYTE bFontScheme = 0;
|
||||
if(m_oScheme.IsInit() && m_oScheme->m_oFontScheme.IsInit())
|
||||
{
|
||||
switch(m_oScheme->m_oFontScheme->GetValue())
|
||||
{
|
||||
case SimpleTypes::Spreadsheet::fontschemeNone:
|
||||
bFontScheme = 0x00;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::fontschemeMajor:
|
||||
bFontScheme = 0x01;
|
||||
break;
|
||||
case SimpleTypes::Spreadsheet::fontschemeMinor:
|
||||
bFontScheme = 0x02;
|
||||
break;
|
||||
}
|
||||
}
|
||||
oStream.WriteBYTE(bFontScheme);
|
||||
oStream.WriteString(m_oRFont.IsInit() && m_oRFont->m_sVal.IsInit() ? m_oRFont->m_sVal.get() : L"");
|
||||
|
||||
//oStream.XlsbEndRecord(XLSB::rt_FONT);
|
||||
}
|
||||
_UINT32 CRPr::getXLSBSize() const
|
||||
{
|
||||
_UINT32 nLen = 2 + 2 + 2 + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 2 + 4 + 1;
|
||||
nLen += 4 + 2 * (m_oRFont.IsInit() && m_oRFont->m_sVal.IsInit() ? m_oRFont->m_sVal->length() : 0);
|
||||
return nLen;
|
||||
}
|
||||
|
||||
} //Spreadsheet
|
||||
} // OOX
|
||||
@ -35,6 +35,12 @@
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CBinaryFileReader;
|
||||
class CXlsbBinaryWriter;
|
||||
}
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
@ -391,7 +397,7 @@ namespace OOX
|
||||
writer.WriteString(sName);
|
||||
WritingStringNullableAttrBool(L"auto", m_oAuto);
|
||||
WritingStringNullableAttrInt(L"indexed", m_oIndexed, m_oIndexed->GetValue());
|
||||
if(m_oRgb.IsInit())
|
||||
if(m_oRgb.IsInit() && !m_oIndexed.IsInit())
|
||||
{
|
||||
int nIndex = OOX::Spreadsheet::CIndexedColors::GetDefaultIndexByRGBA(m_oRgb->Get_R(), m_oRgb->Get_G(), m_oRgb->Get_B(), m_oRgb->Get_A());
|
||||
if(-1 == nIndex)
|
||||
@ -681,12 +687,45 @@ namespace OOX
|
||||
else
|
||||
writer.WriteString(_T("<b val=\"false\"/>"));
|
||||
}
|
||||
if(m_oCharset.IsInit() && m_oCharset->m_oCharset.IsInit())
|
||||
if(m_oItalic.IsInit())
|
||||
{
|
||||
WritingStringValAttrString(L"charset", m_oCharset->m_oCharset->ToString());
|
||||
if(SimpleTypes::onoffTrue == m_oItalic->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<i/>"));
|
||||
else
|
||||
writer.WriteString(_T("<i val=\"false\"/>"));
|
||||
}
|
||||
if(m_oStrike.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oStrike->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<strike/>"));
|
||||
else
|
||||
writer.WriteString(_T("<strike val=\"false\"/>"));
|
||||
}
|
||||
if(m_oUnderline.IsInit() && m_oUnderline->m_oUnderline.IsInit())
|
||||
{
|
||||
if( SimpleTypes::underlineSingle != m_oUnderline->m_oUnderline->GetValue())
|
||||
{
|
||||
WritingStringValAttrString(L"u", m_oUnderline->m_oUnderline->ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteString(L"<u/>");
|
||||
}
|
||||
}
|
||||
if(m_oOutline.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oOutline->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<outline/>"));
|
||||
else
|
||||
writer.WriteString(_T("<outline val=\"false\"/>"));
|
||||
}
|
||||
if(m_oShadow.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oShadow->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<shadow/>"));
|
||||
else
|
||||
writer.WriteString(_T("<shadow val=\"false\"/>"));
|
||||
}
|
||||
if(m_oColor.IsInit())
|
||||
m_oColor->toXML2(writer, _T("color"));
|
||||
if(m_oCondense.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oCondense->m_oVal.GetValue())
|
||||
@ -701,67 +740,35 @@ namespace OOX
|
||||
else
|
||||
writer.WriteString(_T("<extend val=\"false\"/>"));
|
||||
}
|
||||
if(m_oFamily.IsInit() && m_oFamily->m_oFontFamily.IsInit())
|
||||
if(m_oVertAlign.IsInit() && m_oVertAlign->m_oVerticalAlign.IsInit())
|
||||
{
|
||||
WritingStringValAttrString(L"family", m_oFamily->m_oFontFamily->ToString());
|
||||
}
|
||||
if(m_oItalic.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oItalic->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<i/>"));
|
||||
else
|
||||
writer.WriteString(_T("<i val=\"false\"/>"));
|
||||
}
|
||||
if(m_oOutline.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oOutline->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<outline/>"));
|
||||
else
|
||||
writer.WriteString(_T("<outline val=\"false\"/>"));
|
||||
}
|
||||
if(m_oRFont.IsInit() && m_oRFont->m_sVal.IsInit())
|
||||
{
|
||||
WritingStringValAttrEncodeXmlString(L"rFont", m_oRFont->m_sVal.get());
|
||||
}
|
||||
if(m_oScheme.IsInit() && m_oScheme->m_oFontScheme.IsInit())
|
||||
{
|
||||
WritingStringValAttrString(L"scheme", m_oScheme->m_oFontScheme->ToString());
|
||||
}
|
||||
if(m_oShadow.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oShadow->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<shadow/>"));
|
||||
else
|
||||
writer.WriteString(_T("<shadow val=\"false\"/>"));
|
||||
}
|
||||
if(m_oStrike.IsInit())
|
||||
{
|
||||
if(SimpleTypes::onoffTrue == m_oStrike->m_oVal.GetValue())
|
||||
writer.WriteString(_T("<strike/>"));
|
||||
else
|
||||
writer.WriteString(_T("<strike val=\"false\"/>"));
|
||||
std::wstring sVerticalAlign = m_oVertAlign->m_oVerticalAlign->ToString();
|
||||
writer.WriteString(L"<vertAlign val=\"");
|
||||
writer.WriteString(sVerticalAlign);
|
||||
writer.WriteString(L"\"/>");
|
||||
}
|
||||
if(m_oSz.IsInit() && m_oSz->m_oVal.IsInit())
|
||||
{
|
||||
WritingStringValAttrDouble(L"sz", m_oSz->m_oVal->GetValue());
|
||||
}
|
||||
if(m_oUnderline.IsInit() && m_oUnderline->m_oUnderline.IsInit())
|
||||
if(m_oColor.IsInit())
|
||||
m_oColor->toXML2(writer, _T("color"));
|
||||
|
||||
if(m_oRFont.IsInit() && m_oRFont->m_sVal.IsInit())
|
||||
{
|
||||
if( SimpleTypes::underlineSingle != m_oUnderline->m_oUnderline->GetValue())
|
||||
{
|
||||
WritingStringValAttrString(L"u", m_oUnderline->m_oUnderline->ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.WriteString(L"<u/>");
|
||||
}
|
||||
WritingStringValAttrEncodeXmlString(L"rFont", m_oRFont->m_sVal.get());
|
||||
}
|
||||
if(m_oVertAlign.IsInit() && m_oVertAlign->m_oVerticalAlign.IsInit())
|
||||
if(m_oFamily.IsInit() && m_oFamily->m_oFontFamily.IsInit())
|
||||
{
|
||||
std::wstring sVerticalAlign = m_oVertAlign->m_oVerticalAlign->ToString();
|
||||
writer.WriteString(L"<vertAlign val=\"");
|
||||
writer.WriteString(sVerticalAlign);
|
||||
writer.WriteString(L"\"/>");
|
||||
WritingStringValAttrString(L"family", m_oFamily->m_oFontFamily->ToString());
|
||||
}
|
||||
if(m_oCharset.IsInit() && m_oCharset->m_oCharset.IsInit())
|
||||
{
|
||||
WritingStringValAttrString(L"charset", m_oCharset->m_oCharset->ToString());
|
||||
}
|
||||
if(m_oScheme.IsInit() && m_oScheme->m_oFontScheme.IsInit())
|
||||
{
|
||||
WritingStringValAttrString(L"scheme", m_oScheme->m_oFontScheme->ToString());
|
||||
}
|
||||
writer.WriteString(_T("</rPr>"));
|
||||
}
|
||||
@ -811,6 +818,10 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
|
||||
void fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nType);
|
||||
void toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream) const;
|
||||
_UINT32 getXLSBSize() const;
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_x_rPr;
|
||||
|
||||
@ -78,7 +78,7 @@ void CDataValidation::toXML2(NSStringUtils::CStringBuilder& writer, bool bExtend
|
||||
WritingStringNullableAttrString (L"errorTitle", m_oErrorTitle, m_oErrorTitle.get());
|
||||
WritingStringNullableAttrString (L"imeMode", m_oImeMode, m_oImeMode->ToString());
|
||||
WritingStringNullableAttrString (L"operator", m_oOperator, m_oOperator->ToString());
|
||||
WritingStringNullableAttrString (L"promt", m_oPromt, m_oPromt.get());
|
||||
WritingStringNullableAttrString (L"promt", m_oPrompt, m_oPrompt.get());
|
||||
WritingStringNullableAttrString (L"promptTitle", m_oPromptTitle, m_oPromptTitle.get());
|
||||
WritingStringNullableAttrInt (L"showDropDown", m_oShowDropDown, m_oShowDropDown->GetValue());
|
||||
WritingStringNullableAttrInt (L"showErrorMessage",m_oShowErrorMessage,m_oShowErrorMessage->GetValue());
|
||||
@ -171,7 +171,7 @@ void CDataValidation::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("errorTitle"), m_oErrorTitle)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("imeMode"), m_oImeMode)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("operator"), m_oOperator)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("promt"), m_oPromt)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("prompt"), m_oPrompt)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("promptTitle"), m_oPromptTitle)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("showDropDown"), m_oShowDropDown)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("showErrorMessage"),m_oShowErrorMessage)
|
||||
|
||||
@ -110,7 +110,7 @@ namespace OOX
|
||||
nullable<SimpleTypes::Spreadsheet::CDataValidationErrorStyle<>> m_oErrorStyle;
|
||||
nullable<SimpleTypes::Spreadsheet::CDataValidationImeMode<>> m_oImeMode;
|
||||
nullable<SimpleTypes::Spreadsheet::CDataValidationOperator<>> m_oOperator;
|
||||
nullable_string m_oPromt;
|
||||
nullable_string m_oPrompt;
|
||||
nullable_string m_oPromptTitle;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowDropDown;
|
||||
nullable<SimpleTypes::COnOff<>> m_oShowErrorMessage;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -37,6 +37,20 @@
|
||||
|
||||
#include "../SharedStrings/Si.h"
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CBinaryFileReader;
|
||||
class CXlsbBinaryWriter;
|
||||
}
|
||||
namespace CSVWriter
|
||||
{
|
||||
class CCSVWriter;
|
||||
}
|
||||
namespace NSFile
|
||||
{
|
||||
class CStreamWriter;
|
||||
}
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
@ -58,25 +72,7 @@ namespace OOX
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
|
||||
{
|
||||
writer.WriteString(_T("<f"));
|
||||
WritingStringNullableAttrBool(L"aca", m_oAca);
|
||||
WritingStringNullableAttrBool(L"bx", m_oBx);
|
||||
WritingStringNullableAttrBool(L"ca", m_oCa);
|
||||
WritingStringNullableAttrBool(L"del1", m_oDel1);
|
||||
WritingStringNullableAttrBool(L"del2", m_oDel2);
|
||||
WritingStringNullableAttrBool(L"dt2D", m_oDt2D);
|
||||
WritingStringNullableAttrBool(L"dtr", m_oDtr);
|
||||
WritingStringNullableAttrString(L"r1", m_oR1, m_oR1.get());
|
||||
WritingStringNullableAttrString(L"r2", m_oR2, m_oR2.get());
|
||||
WritingStringNullableAttrString(L"ref", m_oRef, m_oRef.get());
|
||||
WritingStringNullableAttrInt(L"si", m_oSi, m_oSi->GetValue());
|
||||
WritingStringNullableAttrString(L"t", m_oT, m_oT->ToString());
|
||||
writer.WriteString(_T(">"));
|
||||
writer.WriteEncodeXmlString(m_sText);
|
||||
writer.WriteString(_T("</f>"));
|
||||
}
|
||||
virtual void toXML(NSStringUtils::CStringBuilder& writer) const;
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
@ -86,6 +82,11 @@ namespace OOX
|
||||
|
||||
m_sText = oReader.GetText3();
|
||||
}
|
||||
void fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream);
|
||||
_UINT16 toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream);
|
||||
void fromXLSBExt (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nFlags);
|
||||
void toXLSBExt (NSBinPptxRW::CXlsbBinaryWriter& oStream);
|
||||
_UINT32 getXLSBSize() const;
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
@ -96,22 +97,23 @@ namespace OOX
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_StartChar( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("aca"), m_oAca )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("bx"), m_oBx )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("ca"), m_oCa )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("del1"), m_oDel1 )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("del2"), m_oDel2 )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("dt2D"), m_oDt2D )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("dtr"), m_oDtr )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r1"), m_oR1 )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r2"), m_oR2 )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("si"), m_oSi )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("t"), m_oT )
|
||||
WritingElement_ReadAttributes_Read_ifChar ( oReader, "t", m_oT )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "si", m_oSi )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "aca", m_oAca )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "bx", m_oBx )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "ca", m_oCa )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "del1", m_oDel1 )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "del2", m_oDel2 )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "dt2D", m_oDt2D )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "dtr", m_oDtr )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "r1", m_oR1 )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "r2", m_oR2 )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "ref", m_oRef )
|
||||
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "si", m_oSi )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
WritingElement_ReadAttributes_EndChar( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
@ -149,27 +151,10 @@ namespace OOX
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(NSStringUtils::CStringBuilder& writer) const;
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if ( _T("f") == sName )
|
||||
m_oFormula = oReader;
|
||||
else if ( _T("is") == sName )
|
||||
m_oRichText = oReader;
|
||||
else if ( _T("v") == sName )
|
||||
m_oValue = oReader;
|
||||
}
|
||||
PrepareForBinaryWriter();
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void fromXMLtoXLSB(XmlUtils::CXmlLiteReader& oReader, NSBinPptxRW::CXlsbBinaryWriter& oStream);
|
||||
void fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nType, _UINT32 nRow);
|
||||
void toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream) const;
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
@ -184,7 +169,8 @@ namespace OOX
|
||||
{
|
||||
if (m_oRef.IsInit())
|
||||
{
|
||||
return m_oRef.get();
|
||||
const std::string& s = m_oRef.get();
|
||||
return std::wstring(s.begin(), s.end());
|
||||
}
|
||||
else if (m_oRow.IsInit() && m_oCol.IsInit())
|
||||
{
|
||||
@ -197,28 +183,27 @@ namespace OOX
|
||||
}
|
||||
void setRef(const std::wstring& sRef)
|
||||
{
|
||||
m_oRef = sRef;
|
||||
m_oRef = std::string(sRef.begin(), sRef.end());
|
||||
}
|
||||
bool getRowCol(int& nRow, int& nCol) const
|
||||
{
|
||||
bool bRes = false;
|
||||
nRow = 0;
|
||||
nCol = 0;
|
||||
if (m_oRef.IsInit())
|
||||
if (m_oRow.IsInit() && m_oCol.IsInit())
|
||||
{
|
||||
if (parseRef(m_oRef.get(), nRow, nCol))
|
||||
bRes = true;
|
||||
nRow = m_oRow->GetValue();
|
||||
nCol = m_oCol->GetValue();
|
||||
}
|
||||
else if (m_oRef.IsInit())
|
||||
{
|
||||
if (parseRefA(m_oRef->c_str(), nRow, nCol))
|
||||
{
|
||||
bRes = true;
|
||||
nRow--;
|
||||
nCol--;
|
||||
}
|
||||
|
||||
}
|
||||
else if (m_oRow.IsInit() && m_oCol.IsInit())
|
||||
{
|
||||
bRes = true;
|
||||
nRow = m_oRow->GetValue();
|
||||
nCol = m_oCol->GetValue();
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
@ -283,59 +268,17 @@ namespace OOX
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
static bool parseRef(std::wstring sRef, int& nRow, int& nCol)
|
||||
{
|
||||
bool bRes = false;
|
||||
|
||||
nRow = 0;
|
||||
nCol = 0;
|
||||
int nLegnth = (int)sRef.length();
|
||||
if (nLegnth > 0)
|
||||
{
|
||||
int nIndex = 0;
|
||||
NSStringExt::ToUpper(sRef);
|
||||
wchar_t cCurLetter = sRef[nIndex];
|
||||
while ('A' <= cCurLetter && cCurLetter <= 'Z' && nIndex < nLegnth)
|
||||
{
|
||||
nIndex++;
|
||||
cCurLetter = sRef[nIndex];
|
||||
}
|
||||
if (nIndex > 0)
|
||||
{
|
||||
std::wstring sAdd = sRef.substr(0, nIndex);
|
||||
std::wstring sDig = sRef.substr(nIndex, nLegnth - nIndex);
|
||||
for (size_t i = 0, length = sAdd.length(); i < length; ++i)
|
||||
{
|
||||
nCol = nCol * 26 + sAdd[i] - 'A' + 1;
|
||||
}
|
||||
if (!sDig.empty())
|
||||
{
|
||||
nRow = _wtoi(sDig.c_str());
|
||||
bRes = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
static bool parseRef(std::wstring sRef, int& nRow, int& nCol);
|
||||
static bool parseRefA(const char* sRef, int& nRow, int& nCol);
|
||||
static bool parseRefColA(const char* sRef, int& nCol);
|
||||
static std::wstring combineRef(int nRow, int nCol);
|
||||
private:
|
||||
void PrepareForBinaryWriter();
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
|
||||
void ReadAttributesToXLSB(XmlUtils::CXmlLiteReader& oReader, int& nCol, unsigned int& nStyle, SimpleTypes::Spreadsheet::CCellTypeType<>& oType, bool& bShowPhonetic);
|
||||
void toXLSB2 (NSBinPptxRW::CXlsbBinaryWriter& oStream, int nCol, unsigned int nStyle, bool bShowPhonetic, _UINT16 nType, double dValue, unsigned int nValue, BYTE bValue, std::wstring** psValue, bool bForceFormula, const nullable<CFormula>& oFormula, const nullable<CSi>& oRichText) const;
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("cm"), m_oCellMetadata )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("ph"), m_oShowPhonetic )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r"), m_oRef )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("s"), m_oStyle )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("t"), m_oType )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("vm"), m_oValueMetadata )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
nullable<std::wstring> m_oRef;
|
||||
nullable<std::string> m_oRef;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oRow;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCol;
|
||||
public:
|
||||
@ -383,51 +326,11 @@ namespace OOX
|
||||
|
||||
toXMLEnd(writer);
|
||||
}
|
||||
virtual void toXMLStart(NSStringUtils::CStringBuilder& writer) const
|
||||
{
|
||||
writer.WriteString(_T("<row"));
|
||||
WritingStringNullableAttrBool(L"collapsed", m_oCollapsed);
|
||||
WritingStringNullableAttrBool(L"customFormat", m_oCustomFormat);
|
||||
WritingStringNullableAttrDouble(L"ht", m_oHt, m_oHt->GetValue());
|
||||
WritingStringNullableAttrBool(L"customHeight", m_oCustomHeight);
|
||||
WritingStringNullableAttrBool(L"hidden", m_oHidden);
|
||||
WritingStringNullableAttrInt(L"outlineLevel", m_oOutlineLevel, m_oOutlineLevel->GetValue());
|
||||
WritingStringNullableAttrBool(L"ph", m_oPh);
|
||||
WritingStringNullableAttrInt(L"r", m_oR, m_oR->GetValue());
|
||||
WritingStringNullableAttrInt(L"s", m_oS, m_oS->GetValue());
|
||||
WritingStringNullableAttrBool(L"thickBot", m_oThickBot);
|
||||
WritingStringNullableAttrBool(L"thickTop", m_oThickTop);
|
||||
writer.WriteString(_T(">"));
|
||||
}
|
||||
virtual void toXMLEnd(NSStringUtils::CStringBuilder& writer) const
|
||||
{
|
||||
writer.WriteString(_T("</row>"));
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if ( _T("c") == sName )
|
||||
{
|
||||
CCell *pCell = new CCell();
|
||||
if (pCell)
|
||||
{
|
||||
pCell->m_pMainDocument = m_pMainDocument;
|
||||
pCell->fromXML(oReader);
|
||||
m_arrItems.push_back(pCell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void toXMLStart(NSStringUtils::CStringBuilder& writer) const;
|
||||
void toXMLEnd(NSStringUtils::CStringBuilder& writer) const;
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nType);
|
||||
void toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream) const;
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_x_Row;
|
||||
@ -435,23 +338,8 @@ namespace OOX
|
||||
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("collapsed"), m_oCollapsed )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("customFormat"), m_oCustomFormat )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("customHeight"), m_oCustomHeight )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("hidden"), m_oHidden )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("ht"), m_oHt )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("outlineLevel"), m_oOutlineLevel )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("ph"), m_oPh )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r"), m_oR )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("s"), m_oS )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("thickBot"), m_oThickBot )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("thickTop"), m_oThickTop )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("x14ac:dyDescent"), m_oDyDescent )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
|
||||
void CheckIndex();
|
||||
|
||||
public:
|
||||
nullable<SimpleTypes::COnOff<>> m_oCollapsed;
|
||||
@ -506,37 +394,20 @@ namespace OOX
|
||||
{
|
||||
writer.WriteString(_T("</sheetData>"));
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
|
||||
|
||||
if ( _T("row") == sName )
|
||||
{
|
||||
CRow *pRow = new CRow();
|
||||
if (pRow)
|
||||
{
|
||||
pRow->m_pMainDocument = m_pMainDocument;
|
||||
pRow->fromXML(oReader);
|
||||
m_arrItems.push_back(pRow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
void fromXLSB (NSBinPptxRW::CBinaryFileReader& oStream, _UINT16 nType, CSVWriter::CCSVWriter* pCSVWriter, NSFile::CStreamWriter& oStreamWriter);
|
||||
void toXLSB (NSBinPptxRW::CXlsbBinaryWriter& oStream) const;
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_x_SheetData;
|
||||
}
|
||||
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oXlsbPos;
|
||||
private:
|
||||
void fromXLSBToXmlCell (CCell& pCell, CSVWriter::CCSVWriter* pCSVWriter, NSFile::CStreamWriter& oStreamWriter);
|
||||
void fromXLSBToXmlRowStart (CRow* pRow, CSVWriter::CCSVWriter* pCSVWriter, NSFile::CStreamWriter& oStreamWriter);
|
||||
void fromXLSBToXmlRowEnd (CRow* pRow, CSVWriter::CCSVWriter* pCSVWriter, NSFile::CStreamWriter& oStreamWriter);
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
|
||||
@ -125,18 +125,26 @@ namespace OOX
|
||||
if(m_oPaperSize.IsInit() || m_oOrientation.IsInit())
|
||||
{
|
||||
writer.WriteString(L"<pageSetup");
|
||||
WritingStringNullableAttrBool(L"blackAndWhite", m_oBlackAndWhite);
|
||||
WritingStringNullableAttrString(L"cellComments", m_oCellComments, m_oCellComments->ToString());
|
||||
WritingStringNullableAttrInt(L"copies", m_oCopies, m_oCopies->GetValue());
|
||||
WritingStringNullableAttrBool(L"draft", m_oDraft);
|
||||
WritingStringNullableAttrString(L"errors", m_oErrors, m_oErrors->ToString());
|
||||
WritingStringNullableAttrInt(L"firstPageNumber", m_oFirstPageNumber, m_oFirstPageNumber->GetValue());
|
||||
WritingStringNullableAttrInt(L"fitToHeight", m_oFitToHeight, m_oFitToHeight->GetValue());
|
||||
WritingStringNullableAttrInt(L"fitToWidth", m_oFitToWidth, m_oFitToWidth->GetValue());
|
||||
WritingStringNullableAttrInt(L"horizontalDpi", m_oHorizontalDpi, m_oHorizontalDpi->GetValue());
|
||||
WritingStringNullableAttrString(L"r:id", m_oRId, m_oRId->ToString());
|
||||
WritingStringNullableAttrString(L"orientation", m_oOrientation, m_oOrientation->ToString());
|
||||
WritingStringNullableAttrString(L"pageOrder", m_oPageOrder, m_oPageOrder->ToString());
|
||||
WritingStringNullableAttrDouble(L"paperHeight", m_oPaperHeight, m_oPaperHeight->GetValue());
|
||||
WritingStringNullableAttrString(L"paperSize", m_oPaperSize, m_oPaperSize->ToString());
|
||||
if (m_oOrientation.IsInit())
|
||||
{
|
||||
std::wstring sOrientation = m_oOrientation->ToString();
|
||||
writer.WriteString(L" orientation=\"");
|
||||
writer.WriteString(sOrientation.c_str());
|
||||
writer.WriteString(L"\"");
|
||||
}
|
||||
if (m_oRId.IsInit())
|
||||
{
|
||||
WritingStringAttrString(L"r:id", m_oRId->ToString());
|
||||
}
|
||||
WritingStringNullableAttrDouble(L"paperWidth", m_oPaperWidth, m_oPaperWidth->GetValue());
|
||||
WritingStringNullableAttrString(L"paperUnits", m_oPaperUnits, m_oPaperUnits->ToString());
|
||||
WritingStringNullableAttrInt(L"scale", m_oScale, m_oScale->GetValue());
|
||||
WritingStringNullableAttrBool(L"useFirstPageNumber", m_oUseFirstPageNumber);
|
||||
WritingStringNullableAttrBool(L"usePrinterDefaults", m_oUsePrinterDefaults);
|
||||
WritingStringNullableAttrInt(L"verticalDpi", m_oVerticalDpi, m_oVerticalDpi->GetValue());
|
||||
writer.WriteString(L"/>");
|
||||
}
|
||||
}
|
||||
@ -155,20 +163,48 @@ namespace OOX
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("orientation"), m_oOrientation)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperSize"), m_oPaperSize)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperUnits"), m_oPaperUnits)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperWidth"), m_oPaperWidth)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperHeight"), m_oPaperHeight)
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("blackAndWhite"), m_oBlackAndWhite)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("cellComments"), m_oCellComments)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("copies"), m_oCopies)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("draft"), m_oDraft)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("errors"), m_oErrors)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("firstPageNumber"), m_oFirstPageNumber)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fitToHeight"), m_oFitToHeight)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fitToWidth"), m_oFitToWidth)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("horizontalDpi"), m_oHorizontalDpi)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("r:id"), m_oRId)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("orientation"), m_oOrientation)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("pageOrder"), m_oPageOrder)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperHeight"), m_oPaperHeight)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperSize"), m_oPaperSize)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperWidth"), m_oPaperWidth)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("paperUnits"), m_oPaperUnits)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("scale"), m_oScale)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("useFirstPageNumber"), m_oUseFirstPageNumber)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("usePrinterDefaults"), m_oUsePrinterDefaults)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("verticalDpi"), m_oVerticalDpi)
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
nullable<SimpleTypes::CRelationshipId> m_oRId;
|
||||
nullable<SimpleTypes::CPageOrientation<>> m_oOrientation;
|
||||
nullable<SimpleTypes::Spreadsheet::CPageSize<>> m_oPaperSize;
|
||||
nullable<SimpleTypes::Spreadsheet::CPageUnits<>> m_oPaperUnits;
|
||||
nullable<SimpleTypes::CDouble> m_oPaperWidth;
|
||||
nullable<SimpleTypes::CDouble> m_oPaperHeight;
|
||||
nullable<SimpleTypes::COnOff<>> m_oBlackAndWhite;
|
||||
nullable<SimpleTypes::Spreadsheet::CCellComments<>> m_oCellComments;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCopies;
|
||||
nullable<SimpleTypes::COnOff<>> m_oDraft;
|
||||
nullable<SimpleTypes::Spreadsheet::CPrintError<>> m_oErrors;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oFirstPageNumber;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oFitToHeight;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oFitToWidth;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oHorizontalDpi;
|
||||
nullable<SimpleTypes::CRelationshipId> m_oRId;
|
||||
nullable<SimpleTypes::CPageOrientation<>> m_oOrientation;
|
||||
nullable<SimpleTypes::Spreadsheet::CPageOrder<>> m_oPageOrder;
|
||||
nullable<SimpleTypes::CDouble> m_oPaperHeight;
|
||||
nullable<SimpleTypes::Spreadsheet::CPageSize<>> m_oPaperSize;
|
||||
nullable<SimpleTypes::CDouble> m_oPaperWidth;
|
||||
nullable<SimpleTypes::Spreadsheet::CPageUnits<>> m_oPaperUnits;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oScale;
|
||||
nullable<SimpleTypes::COnOff<>> m_oUseFirstPageNumber;
|
||||
nullable<SimpleTypes::COnOff<>> m_oUsePrinterDefaults;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oVerticalDpi;
|
||||
};
|
||||
class CPrintOptions : public WritingElement
|
||||
{
|
||||
|
||||
@ -147,3 +147,783 @@ namespace Spreadsheet
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace XLSB
|
||||
{
|
||||
typedef enum CF_RECORD_TYPE
|
||||
{
|
||||
rt_ROW_HDR = 0,
|
||||
rt_CELL_BLANK = 1,
|
||||
rt_CELL_RK = 2,
|
||||
rt_CELL_ERROR = 3,
|
||||
rt_CELL_BOOL = 4,
|
||||
rt_CELL_REAL = 5,
|
||||
rt_CELL_ST = 6,
|
||||
rt_CELL_ISST = 7,
|
||||
rt_FMLA_STRING = 8,
|
||||
rt_FMLA_NUM = 9,
|
||||
rt_FMLA_BOOL = 10,
|
||||
rt_FMLA_ERROR = 11,
|
||||
rt_SST_ITEM = 19,
|
||||
rt_PCDI_MISSING = 20,
|
||||
rt_PCDI_NUMBER = 21,
|
||||
rt_PCDI_BOOLEAN = 22,
|
||||
rt_PCDI_ERROR = 23,
|
||||
rt_PCDI_STRING = 24,
|
||||
rt_PCDI_DATETIME = 25,
|
||||
rt_PCDI_INDEX = 26,
|
||||
rt_PCDIA_MISSING = 27,
|
||||
rt_PCDIA_NUMBER = 28,
|
||||
rt_PCDIA_BOOLEAN = 29,
|
||||
rt_PCDIA_ERROR = 30,
|
||||
rt_PCDIA_STRING = 31,
|
||||
rt_PCDIA_DATETIME = 32,
|
||||
rt_PCR_RECORD = 33,
|
||||
rt_PCR_RECORD_DT = 34,
|
||||
rt_FRT_BEGIN = 35,
|
||||
rt_FRT_END = 36,
|
||||
rt_AC_BEGIN = 37,
|
||||
rt_AC_END = 38,
|
||||
rt_NAME = 39,
|
||||
rt_INDEX_ROW_BLOCK = 40,
|
||||
rt_INDEX_BLOCK = 42,
|
||||
rt_FONT = 43,
|
||||
rt_FMT = 44,
|
||||
rt_FILL = 45,
|
||||
rt_BORDER = 46,
|
||||
rt_XF = 47,
|
||||
rt_STYLE = 48,
|
||||
rt_CELL_META = 49,
|
||||
rt_VALUE_META = 50,
|
||||
rt_MDB = 51,
|
||||
rt_BEGIN_FMD = 52,
|
||||
rt_END_FMD = 53,
|
||||
rt_BEGIN_MDX = 54,
|
||||
rt_END_MDX = 55,
|
||||
rt_BEGIN_MDX_TUPLE = 56,
|
||||
rt_END_MDX_TUPLE = 57,
|
||||
rt_MDX_MBR_ISTR = 58,
|
||||
rt_STR = 59,
|
||||
rt_COL_INFO = 60,
|
||||
rt_CELL_R_STRING = 62,
|
||||
rt_D_VAL = 64,
|
||||
rt_SXVCELL_NUM = 65,
|
||||
rt_SXVCELL_STR = 66,
|
||||
rt_SXVCELL_BOOL = 67,
|
||||
rt_SXVCELL_ERR = 68,
|
||||
rt_SXVCELL_DATE = 69,
|
||||
rt_SXVCELL_NIL = 70,
|
||||
rt_FILE_VERSION = 128,
|
||||
rt_BEGIN_SHEET = 129,
|
||||
rt_END_SHEET = 130,
|
||||
rt_BEGIN_BOOK = 131,
|
||||
rt_END_BOOK = 132,
|
||||
rt_BEGIN_WS_VIEWS = 133,
|
||||
rt_END_WS_VIEWS = 134,
|
||||
rt_BEGIN_BOOK_VIEWS = 135,
|
||||
rt_END_BOOK_VIEWS = 136,
|
||||
rt_BEGIN_WS_VIEW = 137,
|
||||
rt_END_WS_VIEW = 138,
|
||||
rt_BEGIN_CS_VIEWS = 139,
|
||||
rt_END_CS_VIEWS = 140,
|
||||
rt_BEGIN_CS_VIEW = 141,
|
||||
rt_END_CS_VIEW = 142,
|
||||
rt_BEGIN_BUNDLE_SHS = 143,
|
||||
rt_END_BUNDLE_SHS = 144,
|
||||
rt_BEGIN_SHEET_DATA = 145,
|
||||
rt_END_SHEET_DATA = 146,
|
||||
rt_WS_PROP = 147,
|
||||
rt_WS_DIM = 148,
|
||||
rt_PANE = 151,
|
||||
rt_SEL = 152,
|
||||
rt_WB_PROP = 153,
|
||||
rt_WB_FACTOID = 154,
|
||||
rt_FILE_RECOVER = 155,
|
||||
rt_BUNDLE_SH = 156,
|
||||
rt_CALC_PROP = 157,
|
||||
rt_BOOK_VIEW = 158,
|
||||
rt_BEGIN_SST = 159,
|
||||
rt_END_SST = 160,
|
||||
rt_BEGIN_A_FILTER = 161,
|
||||
rt_END_A_FILTER = 162,
|
||||
rt_BEGIN_FILTER_COLUMN = 163,
|
||||
rt_END_FILTER_COLUMN = 164,
|
||||
rt_BEGIN_FILTERS = 165,
|
||||
rt_END_FILTERS = 166,
|
||||
rt_FILTER = 167,
|
||||
rt_COLOR_FILTER = 168,
|
||||
rt_ICON_FILTER = 169,
|
||||
rt_TOP10_FILTER = 170,
|
||||
rt_DYNAMIC_FILTER = 171,
|
||||
rt_BEGIN_CUSTOM_FILTERS = 172,
|
||||
rt_END_CUSTOM_FILTERS = 173,
|
||||
rt_CUSTOM_FILTER = 174,
|
||||
rt_A_FILTER_DATE_GROUP_ITEM = 175,
|
||||
rt_MERGE_CELL = 176,
|
||||
rt_BEGIN_MERGE_CELLS = 177,
|
||||
rt_END_MERGE_CELLS = 178,
|
||||
rt_BEGIN_PIVOT_CACHE_DEF = 179,
|
||||
rt_END_PIVOT_CACHE_DEF = 180,
|
||||
rt_BEGIN_PCD_FIELDS = 181,
|
||||
rt_END_PCD_FIELDS = 182,
|
||||
rt_BEGIN_PCD_FIELD = 183,
|
||||
rt_END_PCD_FIELD = 184,
|
||||
rt_BEGIN_PCD_SOURCE = 185,
|
||||
rt_END_PCD_SOURCE = 186,
|
||||
rt_BEGIN_PCDS_RANGE = 187,
|
||||
rt_END_PCDS_RANGE = 188,
|
||||
rt_BEGIN_PCDF_ATBL = 189,
|
||||
rt_END_PCDF_ATBL = 190,
|
||||
rt_BEGIN_PCDI_RUN = 191,
|
||||
rt_END_PCDI_RUN = 192,
|
||||
rt_END_PIVOT_CACHE_RECORDS = 194,
|
||||
rt_BEGIN_PCD_HIERARCHIES = 195,
|
||||
rt_END_PCD_HIERARCHIES = 196,
|
||||
rt_BEGIN_PCD_HIERARCHY = 197,
|
||||
rt_END_PCD_HIERARCHY = 198,
|
||||
rt_BEGIN_PCDH_FIELDS_USAGE = 199,
|
||||
rt_END_PCDH_FIELDS_USAGE = 200,
|
||||
rt_BEGIN_EXT_CONNECTION = 201,
|
||||
rt_END_EXT_CONNECTION = 202,
|
||||
rt_BEGIN_EC_DB_PROPS = 203,
|
||||
rt_END_EC_DB_PROPS = 204,
|
||||
rt_BEGIN_EC_OLAP_PROPS = 205,
|
||||
rt_END_EC_OLAP_PROPS = 206,
|
||||
rt_BEGIN_PCDS_CONSOL = 207,
|
||||
rt_END_PCDS_CONSOL = 208,
|
||||
rt_BEGIN_PCDSC_PAGES = 209,
|
||||
rt_END_PCDSC_PAGES = 210,
|
||||
rt_BEGIN_PCDSC_PAGE = 211,
|
||||
rt_END_PCDSC_PAGE = 212,
|
||||
rt_BEGIN_PCDSCP_ITEM = 213,
|
||||
rt_END_PCDSCP_ITEM = 214,
|
||||
rt_BEGIN_PCDSC_SETS = 215,
|
||||
rt_END_PCDSC_SETS = 216,
|
||||
rt_BEGIN_PCDSC_SET = 217,
|
||||
rt_END_PCDSC_SET = 218,
|
||||
rt_BEGIN_PCDF_GROUP = 219,
|
||||
rt_END_PCDF_GROUP = 220,
|
||||
rt_BEGIN_PCDFG_ITEMS = 221,
|
||||
rt_END_PCDFG_ITEMS = 222,
|
||||
rt_BEGIN_PCDFG_RANGE = 223,
|
||||
rt_END_PCDFG_RANGE = 224,
|
||||
rt_BEGIN_PCDFG_DISCRETE = 225,
|
||||
rt_END_PCDFG_DISCRETE = 226,
|
||||
rt_END_PCDSD_TUPLE_CACHE = 228,
|
||||
rt_BEGIN_PCDSDTC_ENTRIES = 229,
|
||||
rt_END_PCDSDTC_ENTRIES = 230,
|
||||
rt_END_PCDSDTCE_MEMBER = 234,
|
||||
rt_BEGIN_PCDSDTC_QUERIES = 235,
|
||||
rt_END_PCDSDTC_QUERIES = 236,
|
||||
rt_BEGIN_PCDSDTC_QUERY = 237,
|
||||
rt_END_PCDSDTC_QUERY = 238,
|
||||
rt_BEGIN_PCDSDTC_SETS = 239,
|
||||
rt_END_PCDSDTC_SETS = 240,
|
||||
rt_BEGIN_PCDSDTC_SET = 241,
|
||||
rt_END_PCDSDTC_SET = 242,
|
||||
rt_BEGIN_PCD_CALC_ITEMS = 243,
|
||||
rt_END_PCD_CALC_ITEMS = 244,
|
||||
rt_BEGIN_PCD_CALC_ITEM = 245,
|
||||
rt_END_PCD_CALC_ITEM = 246,
|
||||
rt_BEGIN_P_RULE = 247,
|
||||
rt_END_P_RULE = 248,
|
||||
rt_BEGIN_PR_FILTERS = 249,
|
||||
rt_END_PR_FILTERS = 250,
|
||||
rt_BEGIN_PR_FILTER = 251,
|
||||
rt_END_PR_FILTER = 252,
|
||||
rt_BEGIN_P_NAMES = 253,
|
||||
rt_END_P_NAMES = 254,
|
||||
rt_BEGIN_P_NAME = 255,
|
||||
rt_END_P_NAME = 256,
|
||||
rt_BEGIN_PN_PAIRS = 257,
|
||||
rt_END_PN_PAIRS = 258,
|
||||
rt_BEGIN_PN_PAIR = 259,
|
||||
rt_END_PN_PAIR = 260,
|
||||
rt_BEGIN_EC_WEB_PROPS = 261,
|
||||
rt_END_EC_WEB_PROPS = 262,
|
||||
rt_BEGIN_EC_WP_TABLES = 263,
|
||||
rt_END_ECWP_TABLES = 264,
|
||||
rt_BEGIN_EC_PARAMS = 265,
|
||||
rt_END_EC_PARAMS = 266,
|
||||
rt_BEGIN_EC_PARAM = 267,
|
||||
rt_END_EC_PARAM = 268,
|
||||
rt_BEGIN_PCDKPIS = 269,
|
||||
rt_END_PCDKPIS = 270,
|
||||
rt_BEGIN_PCDKPI = 271,
|
||||
rt_END_PCDKPI = 272,
|
||||
rt_BEGIN_DIMS = 273,
|
||||
rt_END_DIMS = 274,
|
||||
rt_BEGIN_DIM = 275,
|
||||
rt_END_DIM = 276,
|
||||
rt_INDEX_PART_END = 277,
|
||||
rt_BEGIN_STYLE_SHEET = 278,
|
||||
rt_END_STYLE_SHEET = 279,
|
||||
rt_BEGIN_SX_VIEW = 280,
|
||||
rt_END_SXVI = 281,
|
||||
rt_BEGIN_SXVI = 282,
|
||||
rt_BEGIN_SXVIS = 283,
|
||||
rt_END_SXVIS = 284,
|
||||
rt_BEGIN_SXVD = 285,
|
||||
rt_END_SXVD = 286,
|
||||
rt_BEGIN_SXVDS = 287,
|
||||
rt_END_SXVDS = 288,
|
||||
rt_BEGIN_SXPI = 289,
|
||||
rt_END_SXPI = 290,
|
||||
rt_BEGIN_SXPIS = 291,
|
||||
rt_END_SXPIS = 292,
|
||||
rt_BEGIN_SXDI = 293,
|
||||
rt_END_SXDI = 294,
|
||||
rt_BEGIN_SXDIS = 295,
|
||||
rt_END_SXDIS = 296,
|
||||
rt_BEGIN_SXLI = 297,
|
||||
rt_END_SXLI = 298,
|
||||
rt_BEGIN_SXLI_RWS = 299,
|
||||
rt_END_SXLI_RWS = 300,
|
||||
rt_BEGIN_SXLI_COLS = 301,
|
||||
rt_END_SXLI_COLS = 302,
|
||||
rt_BEGIN_SX_FORMAT = 303,
|
||||
rt_END_SX_FORMAT = 304,
|
||||
rt_BEGIN_SX_FORMATS = 305,
|
||||
rt_END_SX_FORMATS = 306,
|
||||
rt_BEGIN_SX_SELECT = 307,
|
||||
rt_END_SX_SELECT = 308,
|
||||
rt_BEGIN_ISXVD_RWS = 309,
|
||||
rt_END_ISXVD_RWS = 310,
|
||||
rt_BEGIN_ISXVD_COLS = 311,
|
||||
rt_END_ISXVD_COLS = 312,
|
||||
rt_END_SX_LOCATION = 313,
|
||||
rt_BEGIN_SX_LOCATION = 314,
|
||||
rt_END_SX_VIEW = 315,
|
||||
rt_BEGIN_SXTHS = 316,
|
||||
rt_END_SXTHS = 317,
|
||||
rt_BEGIN_SXTH = 318,
|
||||
rt_END_SXTH = 319,
|
||||
rt_BEGIN_ISXTH_RWS = 320,
|
||||
rt_END_ISXTH_RWS = 321,
|
||||
rt_BEGIN_ISXTH_COLS = 322,
|
||||
rt_END_ISXTH_COLS = 323,
|
||||
rt_BEGIN_SXTDMPS = 324,
|
||||
rt_END_SXTDMPS = 325,
|
||||
rt_BEGIN_SXTDMP = 326,
|
||||
rt_END_SXTDMP = 327,
|
||||
rt_BEGIN_SXTH_ITEMS = 328,
|
||||
rt_END_SXTH_ITEMS = 329,
|
||||
rt_BEGIN_SXTH_ITEM = 330,
|
||||
rt_END_SXTH_ITEM = 331,
|
||||
rt_BEGIN_METADATA = 332,
|
||||
rt_END_METADATA = 333,
|
||||
rt_BEGIN_ESMDTINFO = 334,
|
||||
rt_MDTINFO = 335,
|
||||
rt_END_ESMDTINFO = 336,
|
||||
rt_BEGIN_ESMDB = 337,
|
||||
rt_END_ESMDB = 338,
|
||||
rt_BEGIN_ESFMD = 339,
|
||||
rt_END_ESFMD = 340,
|
||||
rt_BEGIN_SINGLE_CELLS = 341,
|
||||
rt_END_SINGLE_CELLS = 342,
|
||||
rt_BEGIN_LIST = 343,
|
||||
rt_END_LIST = 344,
|
||||
rt_BEGIN_LIST_COLS = 345,
|
||||
rt_END_LIST_COLS = 346,
|
||||
rt_BEGIN_LIST_COL = 347,
|
||||
rt_END_LIST_COL = 348,
|
||||
rt_BEGIN_LIST_XML_C_PR = 349,
|
||||
rt_END_LIST_XML_C_PR = 350,
|
||||
rt_LIST_CC_FMLA = 351,
|
||||
rt_LIST_TR_FMLA = 352,
|
||||
rt_BEGIN_EXTERNALS = 353,
|
||||
rt_END_EXTERNALS = 354,
|
||||
rt_SUP_BOOK_SRC = 355,
|
||||
rt_SUP_SELF = 357,
|
||||
rt_SUP_SAME = 358,
|
||||
rt_SUP_TABS = 359,
|
||||
rt_BEGIN_SUP_BOOK = 360,
|
||||
rt_PLACEHOLDER_NAME = 361,
|
||||
rt_EXTERN_SHEET = 362,
|
||||
rt_EXTERN_TABLE_START = 363,
|
||||
rt_EXTERN_TABLE_END = 364,
|
||||
rt_EXTERN_ROW_HDR = 366,
|
||||
rt_EXTERN_CELL_BLANK = 367,
|
||||
rt_EXTERN_CELL_REAL = 368,
|
||||
rt_EXTERN_CELL_BOOL = 369,
|
||||
rt_EXTERN_CELL_ERROR = 370,
|
||||
rt_EXTERN_CELL_STRING = 371,
|
||||
rt_BEGIN_ESMDX = 372,
|
||||
rt_END_ESMDX = 373,
|
||||
rt_BEGIN_MDX_SET = 374,
|
||||
rt_END_MDX_SET = 375,
|
||||
rt_BEGIN_MDX_MBR_PROP = 376,
|
||||
rt_END_MDX_MBR_PROP = 377,
|
||||
rt_BEGIN_MDX_KPI = 378,
|
||||
rt_END_MDX_KPI = 379,
|
||||
rt_BEGIN_ESSTR = 380,
|
||||
rt_END_ESSTR = 381,
|
||||
rt_BEGIN_PRF_ITEM = 382,
|
||||
rt_END_PRF_ITEM = 383,
|
||||
rt_BEGIN_PIVOT_CACHE_IDS = 384,
|
||||
rt_END_PIVOT_CACHE_IDS = 385,
|
||||
rt_BEGIN_PIVOT_CACHE_ID = 386,
|
||||
rt_END_PIVOT_CACHE_ID = 387,
|
||||
rt_BEGIN_ISXVIS = 388,
|
||||
rt_END_ISXVIS = 389,
|
||||
rt_BEGIN_COL_INFOS = 390,
|
||||
rt_END_COL_INFOS = 391,
|
||||
rt_BEGIN_RW_BRK = 392,
|
||||
rt_END_RW_BRK = 393,
|
||||
rt_BEGIN_COL_BRK = 394,
|
||||
rt_END_COL_BRK = 395,
|
||||
rt_BRK = 396,
|
||||
rt_USER_BOOK_VIEW = 397,
|
||||
rt_INFO = 398,
|
||||
rt_C_USR = 399,
|
||||
rt_USR = 400,
|
||||
rt_BEGIN_USERS = 401,
|
||||
rt_EOF = 403,
|
||||
rt_UCR = 404,
|
||||
rt_RR_INS_DEL = 405,
|
||||
rt_RR_END_INS_DEL = 406,
|
||||
rt_RR_MOVE = 407,
|
||||
rt_RR_END_MOVE = 408,
|
||||
rt_RR_CHG_CELL = 409,
|
||||
rt_RR_END_CHG_CELL = 410,
|
||||
rt_RR_HEADER = 411,
|
||||
rt_RR_USER_VIEW = 412,
|
||||
rt_RR_REN_SHEET = 413,
|
||||
rt_RR_INSERT_SH = 414,
|
||||
rt_RR_DEF_NAME = 415,
|
||||
rt_RR_NOTE = 416,
|
||||
rt_RR_CONFLICT = 417,
|
||||
rt_RRTQSIF = 418,
|
||||
rt_RR_FORMAT = 419,
|
||||
rt_RR_END_FORMAT = 420,
|
||||
rt_RR_AUTO_FMT = 421,
|
||||
rt_BEGIN_USER_SH_VIEWS = 422,
|
||||
rt_BEGIN_USER_SH_VIEW = 423,
|
||||
rt_END_USER_SH_VIEW = 424,
|
||||
rt_END_USER_SH_VIEWS = 425,
|
||||
rt_ARR_FMLA = 426,
|
||||
rt_SHR_FMLA = 427,
|
||||
rt_TABLE = 428,
|
||||
rt_BEGIN_EXT_CONNECTIONS = 429,
|
||||
rt_END_EXT_CONNECTIONS = 430,
|
||||
rt_BEGIN_PCD_CALC_MEMS = 431,
|
||||
rt_END_PCD_CALC_MEMS = 432,
|
||||
rt_BEGIN_PCD_CALC_MEM = 433,
|
||||
rt_END_PCD_CALC_MEM = 434,
|
||||
rt_BEGIN_PCDHG_LEVELS = 435,
|
||||
rt_END_PCDHG_LEVELS = 436,
|
||||
rt_BEGIN_PCDHG_LEVEL = 437,
|
||||
rt_END_PCDHG_LEVEL = 438,
|
||||
rt_BEGIN_PCDHGL_GROUPS = 439,
|
||||
rt_END_PCDHGL_GROUPS = 440,
|
||||
rt_BEGIN_PCDHGL_GROUP = 441,
|
||||
rt_END_PCDHGL_GROUP = 442,
|
||||
rt_END_PCDHGLG_MEMBERS = 444,
|
||||
rt_BEGIN_PCDHGLG_MEMBER = 445,
|
||||
rt_END_PCDHGLG_MEMBER = 446,
|
||||
rt_BEGIN_QSI = 447,
|
||||
rt_END_QSI = 448,
|
||||
rt_BEGIN_QSIR = 449,
|
||||
rt_END_QSIR = 450,
|
||||
rt_BEGIN_DELETED_NAMES = 451,
|
||||
rt_END_DELETED_NAMES = 452,
|
||||
rt_BEGIN_DELETED_NAME = 453,
|
||||
rt_END_DELETED_NAME = 454,
|
||||
rt_BEGIN_QSIFS = 455,
|
||||
rt_END_QSIFS = 456,
|
||||
rt_BEGIN_QSIF = 457,
|
||||
rt_END_QSIF = 458,
|
||||
rt_BEGIN_AUTO_SORT_SCOPE = 459,
|
||||
rt_END_AUTO_SORT_SCOPE = 460,
|
||||
rt_BEGIN_CF_RULE = 463,
|
||||
rt_END_CF_RULE = 464,
|
||||
rt_BEGIN_ICON_SET = 465,
|
||||
rt_END_ICON_SET = 466,
|
||||
rt_BEGIN_DATABAR = 467,
|
||||
rt_END_DATABAR = 468,
|
||||
rt_BEGIN_COLOR_SCALE = 469,
|
||||
rt_END_COLOR_SCALE = 470,
|
||||
rt_CFVO = 471,
|
||||
rt_EXTERN_VALUE_META = 472,
|
||||
rt_BEGIN_COLOR_PALETTE = 473,
|
||||
rt_END_COLOR_PALETTE = 474,
|
||||
rt_INDEXED_COLOR = 475,
|
||||
rt_MARGINS = 476,
|
||||
rt_PRINT_OPTIONS = 477,
|
||||
rt_PAGE_SETUP = 478,
|
||||
rt_BEGIN_HEADER_FOOTER = 479,
|
||||
rt_END_HEADER_FOOTER = 480,
|
||||
rt_BEGIN_SX_CRT_FORMAT = 481,
|
||||
rt_END_SX_CRT_FORMAT = 482,
|
||||
rt_BEGIN_SX_CRT_FORMATS = 483,
|
||||
rt_END_SX_CRT_FORMATS = 484,
|
||||
rt_WS_FMT_INFO = 485,
|
||||
rt_BEGIN_MGS = 486,
|
||||
rt_END_MGS = 487,
|
||||
rt_BEGIN_MG_MAPS = 488,
|
||||
rt_END_MG_MAPS = 489,
|
||||
rt_BEGIN_MG = 490,
|
||||
rt_END_MG = 491,
|
||||
rt_BEGIN_MAP = 492,
|
||||
rt_END_MAP = 493,
|
||||
rt_H_LINK = 494,
|
||||
rt_BEGIN_D_CON = 495,
|
||||
rt_END_D_CON = 496,
|
||||
rt_BEGIN_D_REFS = 497,
|
||||
rt_END_D_REFS = 498,
|
||||
rt_D_REF = 499,
|
||||
rt_BEGIN_SCEN_MAN = 500,
|
||||
rt_END_SCEN_MAN = 501,
|
||||
rt_BEGIN_SCT = 502,
|
||||
rt_END_SCT = 503,
|
||||
rt_SLC = 504,
|
||||
rt_BEGIN_DXFS = 505,
|
||||
rt_END_DXFS = 506,
|
||||
rt_DXF = 507,
|
||||
rt_BEGIN_TABLE_STYLES = 508,
|
||||
rt_END_TABLE_STYLES = 509,
|
||||
rt_BEGIN_TABLE_STYLE = 510,
|
||||
rt_END_TABLE_STYLE = 511,
|
||||
rt_TABLE_STYLE_ELEMENT = 512,
|
||||
rt_TABLE_STYLE_CLIENT = 513,
|
||||
rt_BEGIN_VOL_DEPS = 514,
|
||||
rt_END_VOL_DEPS = 515,
|
||||
rt_BEGIN_VOL_TYPE = 516,
|
||||
rt_END_VOL_TYPE = 517,
|
||||
rt_BEGIN_VOL_MAIN = 518,
|
||||
rt_END_VOL_MAIN = 519,
|
||||
rt_BEGIN_VOL_TOPIC = 520,
|
||||
rt_END_VOL_TOPIC = 521,
|
||||
rt_VOL_SUBTOPIC = 522,
|
||||
rt_VOL_REF = 523,
|
||||
rt_VOL_NUM = 524,
|
||||
rt_VOL_ERR = 525,
|
||||
rt_VOL_STR = 526,
|
||||
rt_VOL_BOOL = 527,
|
||||
rt_BEGIN_SORT_STATE = 530,
|
||||
rt_END_SORT_STATE = 531,
|
||||
rt_BEGIN_SORT_COND = 532,
|
||||
rt_END_SORT_COND = 533,
|
||||
rt_BOOK_PROTECTION = 534,
|
||||
rt_SHEET_PROTECTION = 535,
|
||||
rt_RANGE_PROTECTION = 536,
|
||||
rt_PHONETIC_INFO = 537,
|
||||
rt_BEGIN_EC_TXT_WIZ = 538,
|
||||
rt_END_EC_TXT_WIZ = 539,
|
||||
rt_BEGIN_ECTW_FLD_INFO_LST = 540,
|
||||
rt_END_ECTW_FLD_INFO_LST = 541,
|
||||
rt_BEGIN_EC_TW_FLD_INFO = 542,
|
||||
rt_FILE_SHARING = 548,
|
||||
rt_OLE_SIZE = 549,
|
||||
rt_DRAWING = 550,
|
||||
rt_LEGACY_DRAWING = 551,
|
||||
rt_LEGACY_DRAWING_HF = 552,
|
||||
rt_WEB_OPT = 553,
|
||||
rt_BEGIN_WEB_PUB_ITEMS = 554,
|
||||
rt_END_WEB_PUB_ITEMS = 555,
|
||||
rt_BEGIN_WEB_PUB_ITEM = 556,
|
||||
rt_END_WEB_PUB_ITEM = 557,
|
||||
rt_BEGIN_SX_COND_FMT = 558,
|
||||
rt_END_SX_COND_FMT = 559,
|
||||
rt_BEGIN_SX_COND_FMTS = 560,
|
||||
rt_END_SX_COND_FMTS = 561,
|
||||
rt_BK_HIM = 562,
|
||||
rt_COLOR = 564,
|
||||
rt_BEGIN_INDEXED_COLORS = 565,
|
||||
rt_END_INDEXED_COLORS = 566,
|
||||
rt_BEGIN_MRU_COLORS = 569,
|
||||
rt_END_MRU_COLORS = 570,
|
||||
rt_MRU_COLOR = 572,
|
||||
rt_BEGIN_D_VALS = 573,
|
||||
rt_END_D_VALS = 574,
|
||||
rt_SUP_NAME_START = 577,
|
||||
rt_SUP_NAME_VALUE_START = 578,
|
||||
rt_SUP_NAME_VALUE_END = 579,
|
||||
rt_SUP_NAME_NUM = 580,
|
||||
rt_SUP_NAME_ERR = 581,
|
||||
rt_SUP_NAME_ST = 582,
|
||||
rt_SUP_NAME_NIL = 583,
|
||||
rt_SUP_NAME_BOOL = 584,
|
||||
rt_SUP_NAME_FMLA = 585,
|
||||
rt_SUP_NAME_BITS = 586,
|
||||
rt_SUP_NAME_END = 587,
|
||||
rt_END_SUP_BOOK = 588,
|
||||
rt_CELL_SMART_TAG_PROPERTY = 589,
|
||||
rt_BEGIN_CELL_SMART_TAG = 590,
|
||||
rt_END_CELL_SMART_TAG = 591,
|
||||
rt_BEGIN_CELL_SMART_TAGS = 592,
|
||||
rt_END_CELL_SMART_TAGS = 593,
|
||||
rt_BEGIN_SMART_TAGS = 594,
|
||||
rt_END_SMART_TAGS = 595,
|
||||
rt_SMART_TAG_TYPE = 596,
|
||||
rt_BEGIN_SMART_TAG_TYPES = 597,
|
||||
rt_END_SMART_TAG_TYPES = 598,
|
||||
rt_BEGIN_SX_FILTERS = 599,
|
||||
rt_END_SX_FILTERS = 600,
|
||||
rt_BEGIN_SXFILTER = 601,
|
||||
rt_END_SX_FILTER = 602,
|
||||
rt_BEGIN_FILLS = 603,
|
||||
rt_END_FILLS = 604,
|
||||
rt_BEGIN_CELL_WATCHES = 605,
|
||||
rt_END_CELL_WATCHES = 606,
|
||||
rt_CELL_WATCH = 607,
|
||||
rt_BEGIN_CR_ERRS = 608,
|
||||
rt_END_CR_ERRS = 609,
|
||||
rt_CRASH_REC_ERR = 610,
|
||||
rt_BEGIN_FONTS = 611,
|
||||
rt_END_FONTS = 612,
|
||||
rt_BEGIN_BORDERS = 613,
|
||||
rt_END_BORDERS = 614,
|
||||
rt_BEGIN_FMTS = 615,
|
||||
rt_END_FMTS = 616,
|
||||
rt_BEGIN_CELL_XFS = 617,
|
||||
rt_END_CELL_XFS = 618,
|
||||
rt_BEGIN_STYLES = 619,
|
||||
rt_END_STYLES = 620,
|
||||
rt_BIG_NAME = 625,
|
||||
rt_BEGIN_CELL_STYLE_XFS = 626,
|
||||
rt_END_CELL_STYLE_XFS = 627,
|
||||
rt_BEGIN_COMMENTS = 628,
|
||||
rt_END_COMMENTS = 629,
|
||||
rt_BEGIN_COMMENT_AUTHORS = 630,
|
||||
rt_END_COMMENT_AUTHORS = 631,
|
||||
rt_COMMENT_AUTHOR = 632,
|
||||
rt_BEGIN_COMMENT_LIST = 633,
|
||||
rt_END_COMMENT_LIST = 634,
|
||||
rt_BEGIN_COMMENT = 635,
|
||||
rt_END_COMMENT = 636,
|
||||
rt_COMMENT_TEXT = 637,
|
||||
rt_BEGIN_OLE_OBJECTS = 638,
|
||||
rt_OLE_OBJECT = 639,
|
||||
rt_END_OLE_OBJECTS = 640,
|
||||
rt_BEGIN_SXRULES = 641,
|
||||
rt_END_SX_RULES = 642,
|
||||
rt_BEGIN_ACTIVE_X_CONTROLS = 643,
|
||||
rt_ACTIVE_X = 644,
|
||||
rt_END_ACTIVE_X_CONTROLS = 645,
|
||||
rt_BEGIN_PCDSDTCE_MEMBERS_SORT_BY = 646,
|
||||
rt_BEGIN_CELL_IGNORE_ECS = 648,
|
||||
rt_CELL_IGNORE_EC = 649,
|
||||
rt_END_CELL_IGNORE_ECS = 650,
|
||||
rt_CS_PROP = 651,
|
||||
rt_CS_PAGE_SETUP = 652,
|
||||
rt_BEGIN_USER_CS_VIEWS = 653,
|
||||
rt_END_USER_CS_VIEWS = 654,
|
||||
rt_BEGIN_USER_CS_VIEW = 655,
|
||||
rt_END_USER_CS_VIEW = 656,
|
||||
rt_BEGIN_PCD_SFCI_ENTRIES = 657,
|
||||
rt_END_PCDSFCI_ENTRIES = 658,
|
||||
rt_PCDSFCI_ENTRY = 659,
|
||||
rt_BEGIN_LIST_PARTS = 660,
|
||||
rt_LIST_PART = 661,
|
||||
rt_END_LIST_PARTS = 662,
|
||||
rt_SHEET_CALC_PROP = 663,
|
||||
rt_BEGIN_FN_GROUP = 664,
|
||||
rt_FN_GROUP = 665,
|
||||
rt_END_FN_GROUP = 666,
|
||||
rt_SUP_ADDIN = 667,
|
||||
rt_SXTDMP_ORDER = 668,
|
||||
rt_CS_PROTECTION = 669,
|
||||
rt_BEGIN_WS_SORT_MAP = 671,
|
||||
rt_END_WS_SORT_MAP = 672,
|
||||
rt_BEGIN_RR_SORT = 673,
|
||||
rt_END_RR_SORT = 674,
|
||||
rt_RR_SORT_ITEM = 675,
|
||||
rt_FILE_SHARING_ISO = 676,
|
||||
rt_BOOK_PROTECTION_ISO = 677,
|
||||
rt_SHEET_PROTECTION_ISO = 678,
|
||||
rt_CS_PROTECTION_ISO = 679,
|
||||
rt_RANGE_PROTECTION_ISO = 680,
|
||||
rt_RW_DESCENT = 1024,
|
||||
rt_KNOWN_FONTS = 1025,
|
||||
rt_BEGIN_SX_TUPLE_SET = 1026,
|
||||
rt_END_SX_TUPLE_SET = 1027,
|
||||
rt_END_SX_TUPLE_SET_HEADER = 1029,
|
||||
rt_BEGIN_SX_TUPLE_SET_DATA = 1031,
|
||||
rt_END_SX_TUPLE_SET_DATA = 1032,
|
||||
rt_BEGIN_SX_TUPLE_SET_ROW = 1033,
|
||||
rt_END_SX_TUPLE_SET_ROW = 1034,
|
||||
rt_SX_TUPLE_SET_ROW_ITEM = 1035,
|
||||
rt_NAME_EXT = 1036,
|
||||
rt_PCDH14 = 1037,
|
||||
rt_BEGIN_PCD_CALC_MEM14 = 1038,
|
||||
rt_END_PCD_CALC_MEM14 = 1039,
|
||||
rt_SXTH14 = 1040,
|
||||
rt_BEGIN_SPARKLINE_GROUP = 1041,
|
||||
rt_END_SPARKLINE_GROUP = 1042,
|
||||
rt_SPARKLINE = 1043,
|
||||
rt_SXDI14 = 1044,
|
||||
rt_WS_FMT_INFO_EX14 = 1045,
|
||||
rt_BEGIN_CF_RULE14 = 1048,
|
||||
rt_END_CF_RULE14 = 1049,
|
||||
rt_CFVO14 = 1050,
|
||||
rt_BEGIN_DATABAR14 = 1051,
|
||||
rt_BEGIN_ICON_SET14 = 1052,
|
||||
rt_D_VAL14 = 1053,
|
||||
rt_BEGIN_D_VALS14 = 1054,
|
||||
rt_COLOR14 = 1055,
|
||||
rt_BEGIN_SPARKLINES = 1056,
|
||||
rt_END_SPARKLINES = 1057,
|
||||
rt_BEGIN_SPARKLINE_GROUPS = 1058,
|
||||
rt_END_SPARKLINE_GROUPS = 1059,
|
||||
rt_SXVD14 = 1061,
|
||||
rt_BEGIN_SX_VIEW14 = 1062,
|
||||
rt_END_SX_VIEW14 = 1063,
|
||||
rt_BEGIN_SX_VIEW16 = 1064,
|
||||
rt_END_SX_VIEW16 = 1065,
|
||||
rt_BEGIN_PCD14 = 1066,
|
||||
rt_END_PCD14 = 1067,
|
||||
rt_BEGIN_EXT_CONN14 = 1068,
|
||||
rt_END_EXT_CONN14 = 1069,
|
||||
rt_BEGIN_SLICER_CACHE_IDS = 1070,
|
||||
rt_END_SLICER_CACHE_IDS = 1071,
|
||||
rt_BEGIN_SLICER_CACHE_ID = 1072,
|
||||
rt_END_SLICER_CACHE_ID = 1073,
|
||||
rt_BEGIN_SLICER_CACHE = 1075,
|
||||
rt_END_SLICER_CACHE = 1076,
|
||||
rt_BEGIN_SLICER_CACHE_DEF = 1077,
|
||||
rt_END_SLICER_CACHE_DEF = 1078,
|
||||
rt_BEGIN_SLICERS_EX = 1079,
|
||||
rt_END_SLICERS_EX = 1080,
|
||||
rt_BEGIN_SLICER_EX = 1081,
|
||||
rt_END_SLICER_EX = 1082,
|
||||
rt_BEGIN_SLICER = 1083,
|
||||
rt_END_SLICER = 1084,
|
||||
rt_SLICER_CACHE_PIVOT_TABLES = 1085,
|
||||
rt_SLICER_CACHE_OLAP_ITEM = 1096,
|
||||
rt_SLICER_CACHE_SELECTION = 1098,
|
||||
rt_END_SLICER_CACHE_NATIVE = 1101,
|
||||
rt_SLICER_CACHE_NATIVE_ITEM = 1102,
|
||||
rt_RANGE_PROTECTION14 = 1103,
|
||||
rt_RANGE_PROTECTION_ISO14 = 1104,
|
||||
rt_CELL_IGNORE_EC14 = 1105,
|
||||
rt_LIST14 = 1111,
|
||||
rt_CF_ICON = 1112,
|
||||
rt_BEGIN_SLICER_CACHES_PIVOT_CACHE_IDS = 1113,
|
||||
rt_BEGIN_SLICERS = 1115,
|
||||
rt_END_SLICERS = 1116,
|
||||
rt_WB_PROP14 = 1117,
|
||||
rt_BEGIN_SX_EDIT = 1118,
|
||||
rt_END_SX_EDIT = 1119,
|
||||
rt_BEGIN_SX_EDITS = 1120,
|
||||
rt_END_SX_EDITS = 1121,
|
||||
rt_BEGIN_SX_CHANGE = 1122,
|
||||
rt_END_SX_CHANGE = 1123,
|
||||
rt_BEGIN_SX_CHANGES = 1124,
|
||||
rt_END_SX_CHANGES = 1125,
|
||||
rt_SX_TUPLE_ITEMS = 1126,
|
||||
rt_BEGIN_SLICER_STYLE = 1128,
|
||||
rt_END_SLICER_STYLE = 1129,
|
||||
rt_SLICER_STYLE_ELEMENT = 1130,
|
||||
rt_BEGIN_STYLE_SHEET_EXT14 = 1131,
|
||||
rt_END_STYLE_SHEET_EXT14 = 1132,
|
||||
rt_BEGIN_SLICER_CACHES_PIVOT_CACHE_ID = 1133,
|
||||
rt_BEGIN_PCD_CALC_MEM_EXT = 1137,
|
||||
rt_END_PCD_CALC_MEM_EXT = 1138,
|
||||
rt_BEGIN_PCD_CALC_MEMS_EXT = 1139,
|
||||
rt_END_PCD_CALC_MEMS_EXT = 1140,
|
||||
rt_PCD_FIELD14 = 1141,
|
||||
rt_BEGIN_SLICER_STYLES = 1142,
|
||||
rt_END_SLICER_STYLES = 1143,
|
||||
rt_CF_RULE_EXT = 1146,
|
||||
rt_BEGIN_SX_COND_FMT14 = 1147,
|
||||
rt_END_SX_COND_FMT14 = 1148,
|
||||
rt_BEGIN_SX_COND_FMTS14 = 1149,
|
||||
rt_END_SX_COND_FMTS14 = 1150,
|
||||
rt_BEGIN_SORT_COND14 = 1152,
|
||||
rt_END_SORT_COND14 = 1153,
|
||||
rt_END_D_VALS14 = 1154,
|
||||
rt_END_ICON_SET14 = 1155,
|
||||
rt_END_DATABAR14 = 1156,
|
||||
rt_BEGIN_COLOR_SCALE14 = 1157,
|
||||
rt_END_COLOR_SCALE14 = 1158,
|
||||
rt_BEGIN_SXRULES14 = 1159,
|
||||
rt_END_SXRULES14 = 1160,
|
||||
rt_BEGIN_P_RULE14 = 1161,
|
||||
rt_END_P_RULE14 = 1162,
|
||||
rt_BEGIN_PR_FILTERS14 = 1163,
|
||||
rt_END_PR_FILTERS14 = 1164,
|
||||
rt_BEGIN_PR_FILTER14 = 1165,
|
||||
rt_END_PR_FILTER14 = 1166,
|
||||
rt_BEGIN_PRF_ITEM14 = 1167,
|
||||
rt_END_PRF_ITEM14 = 1168,
|
||||
rt_BEGIN_CELL_IGNORE_ECS14 = 1169,
|
||||
rt_END_CELL_IGNORE_ECS14 = 1170,
|
||||
rt_DXF14 = 1171,
|
||||
rt_BEGIN_DX_F14S = 1172,
|
||||
rt_END_DXF14S = 1173,
|
||||
rt_FILTER14 = 1177,
|
||||
rt_BEGIN_CUSTOM_FILTERS14 = 1178,
|
||||
rt_CUSTOM_FILTER14 = 1180,
|
||||
rt_ICON_FILTER14 = 1181,
|
||||
rt_BEGIN_PIVOT_TABLE_REFS = 2051,
|
||||
rt_END_PIVOT_TABLE_REFS = 2052,
|
||||
rt_PIVOT_TABLE_REF = 2053,
|
||||
rt_BEGIN_SXVCELLS = 2055,
|
||||
rt_END_SXVCELLS = 2056,
|
||||
rt_BEGIN_SX_ROW = 2057,
|
||||
rt_END_SX_ROW = 2058,
|
||||
rt_PCD_CALC_MEM15 = 2060,
|
||||
rt_QSI15 = 2067,
|
||||
rt_BEGIN_WEB_EXTENSIONS = 2068,
|
||||
rt_END_WEB_EXTENSIONS = 2069,
|
||||
rt_WEB_EXTENSION = 2070,
|
||||
rt_ABS_PATH15 = 2071,
|
||||
rt_TABLE_SLICER_CACHE_IDS = 2075,
|
||||
rt_TABLE_SLICER_CACHE_ID = 2076,
|
||||
rt_BEGIN_TABLE_SLICER_CACHE = 2077,
|
||||
rt_END_TABLE_SLICER_CACHE = 2078,
|
||||
rt_SX_FILTER15 = 2079,
|
||||
rt_BEGIN_TIMELINE_CACHE_PIVOT_CACHE_IDS = 2080,
|
||||
rt_END_TIMELINE_CACHE_PIVOT_CACHE_IDS = 2081,
|
||||
rt_END_TIMELINE_CACHE_IDS = 2084,
|
||||
rt_BEGIN_TIMELINE_CACHE_ID = 2085,
|
||||
rt_END_TIMELINE_CACHE_ID = 2086,
|
||||
rt_BEGIN_TIMELINES_EX = 2087,
|
||||
rt_END_TIMELINES_EX = 2088,
|
||||
rt_BEGIN_TIMELINE_EX = 2089,
|
||||
rt_END_TIMELINE_EX = 2090,
|
||||
rt_WORK_BOOK_PR15 = 2091,
|
||||
rt_PCDH15 = 2092,
|
||||
rt_BEGIN_TIMELINE_STYLE = 2093,
|
||||
rt_END_TIMELINE_STYLE = 2094,
|
||||
rt_TIMELINE_STYLE_ELEMENT = 2095,
|
||||
rt_BEGIN_TIMELINE_STYLES = 2098,
|
||||
rt_END_TIMELINE_STYLES = 2099,
|
||||
rt_DXF15 = 2102,
|
||||
rt_BEGIN_DXFS15 = 2103,
|
||||
rt_END_DXFS15 = 2104,
|
||||
rt_SLICER_CACHE_HIDE_ITEMS_WITH_NO_DATA = 2105,
|
||||
rt_BEGIN_ITEM_UNIQUE_NAMES = 2106,
|
||||
rt_END_ITEM_UNIQUE_NAMES = 2107,
|
||||
rt_ITEM_UNIQUE_NAME = 2108,
|
||||
rt_BEGIN_EXT_CONN15 = 2109,
|
||||
rt_END_EXT_CONN15 = 2110,
|
||||
rt_BEGIN_OLEDB_PR15 = 2111,
|
||||
rt_END_OLEDB_PR15 = 2112,
|
||||
rt_BEGIN_DATA_FEED_PR15 = 2113,
|
||||
rt_END_DATA_FEED_PR15 = 2114,
|
||||
rt_TEXT_PR15 = 2115,
|
||||
rt_RANGE_PR15 = 2116,
|
||||
rt_DB_COMMAND15 = 2117,
|
||||
rt_BEGIN_DB_TABLES15 = 2118,
|
||||
rt_END_DB_TABLES15 = 2119,
|
||||
rt_DB_TABLE15 = 2120,
|
||||
rt_BEGIN_DATA_MODEL = 2121,
|
||||
rt_END_DATA_MODEL = 2122,
|
||||
rt_BEGIN_MODEL_TABLES = 2123,
|
||||
rt_END_MODEL_TABLES = 2124,
|
||||
rt_MODEL_TABLE = 2125,
|
||||
rt_END_MODEL_RELATIONSHIPS = 2127,
|
||||
rt_MODEL_RELATIONSHIP = 2128,
|
||||
rt_BEGIN_EC_TXT_WIZ15 = 2129,
|
||||
rt_END_EC_TXT_WIZ15 = 2130,
|
||||
rt_BEGIN_ECTW_FLD_INFO_LST15 = 2131,
|
||||
rt_END_ECTW_FLD_INFO_LST15 = 2132,
|
||||
rt_BEGIN_ECTW_FLD_INFO15 = 2133,
|
||||
rt_FIELD_LIST_ACTIVE_ITEM = 2134,
|
||||
rt_PIVOT_CACHE_ID_VERSION = 2135,
|
||||
rt_SXDI15 = 2136,
|
||||
rt_REVISION_PTR = 3073,
|
||||
rt_UNKNOWN = 0xFFFF
|
||||
} RecordType;
|
||||
}
|
||||
|
||||
@ -99,6 +99,9 @@ namespace OOX
|
||||
OOX::JsaProject* m_pJsaProject;
|
||||
|
||||
WorkbookComments* m_pWorkbookComments;
|
||||
NSBinPptxRW::CXlsbBinaryWriter* m_pXlsbWriter;
|
||||
int m_nLastReadRow;
|
||||
int m_nLastReadCol;
|
||||
|
||||
std::vector<CWorksheet*> m_arWorksheets; //order as is
|
||||
std::map<std::wstring, OOX::Spreadsheet::CWorksheet*> m_mapWorksheets; //copy, for fast find - order by rId(name)
|
||||
@ -118,6 +121,9 @@ namespace OOX
|
||||
m_pVbaProject = NULL;
|
||||
m_pJsaProject = NULL;
|
||||
m_pWorkbookComments = NULL;
|
||||
m_pXlsbWriter = NULL;
|
||||
m_nLastReadRow = 0;
|
||||
m_nLastReadCol = -1;
|
||||
|
||||
bDeleteWorkbook = false;
|
||||
bDeleteSharedStrings = false;
|
||||
|
||||
@ -121,6 +121,10 @@ namespace NSFile
|
||||
std::wstring CUtf8Converter::GetUnicodeFromCharPtr(const std::string& sParam, INT bIsUtf8)
|
||||
{
|
||||
return GetUnicodeFromCharPtr(sParam.c_str(), (LONG)sParam.length(), bIsUtf8);
|
||||
}
|
||||
LONG CUtf8Converter::GetUnicodeStringFromUTF8BufferSize(LONG lCount)
|
||||
{
|
||||
return lCount + 1;
|
||||
}
|
||||
std::wstring CUtf8Converter::GetUnicodeStringFromUTF8_4bytes( BYTE* pBuffer, LONG lCount )
|
||||
{
|
||||
@ -305,6 +309,249 @@ namespace NSFile
|
||||
return GetUnicodeStringFromUTF8_4bytes(pBuffer, lCount);
|
||||
}
|
||||
|
||||
#define CHECK_HHHH(pBuffer) \
|
||||
wchar_t code = 0; \
|
||||
if('_' == pBuffer[0] && 'x' == pBuffer[1] && 0 != pBuffer[2] && 0 != pBuffer[3] && 0 != pBuffer[4] && 0 != pBuffer[5] && '_' == pBuffer[6]) \
|
||||
{ \
|
||||
int i = 2; \
|
||||
for(; i < 6; ++i) \
|
||||
{ \
|
||||
code *= 16; \
|
||||
if('0' <= pBuffer[i] && pBuffer[i] <= '9') \
|
||||
{ \
|
||||
code += pBuffer[i] - '0'; \
|
||||
} \
|
||||
else if('A' <= pBuffer[i] && pBuffer[i] <= 'F') \
|
||||
{ \
|
||||
code += pBuffer[i] - 'A' + 10; \
|
||||
} \
|
||||
else if('a' <= pBuffer[i] && pBuffer[i] <= 'f') \
|
||||
{ \
|
||||
code += pBuffer[i] - 'a' + 10; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
if(i == 6) \
|
||||
{ \
|
||||
if(0x005F == code) \
|
||||
{ \
|
||||
code = '_'; \
|
||||
} \
|
||||
return code; \
|
||||
} \
|
||||
} \
|
||||
return -1;
|
||||
|
||||
long CUtf8Converter::CheckHHHHChar(const BYTE* pBuffer)
|
||||
{
|
||||
CHECK_HHHH(pBuffer);
|
||||
}
|
||||
long CUtf8Converter::CheckHHHHChar(const wchar_t* pBuffer)
|
||||
{
|
||||
CHECK_HHHH(pBuffer);
|
||||
}
|
||||
|
||||
void CUtf8Converter::GetUnicodeStringFromUTF8WithHHHH_4bytes( const BYTE* pBuffer, LONG lCount, wchar_t*& pUnicodes, LONG& lOutputCount )
|
||||
{
|
||||
if (NULL == pUnicodes)
|
||||
{
|
||||
pUnicodes = new wchar_t[GetUnicodeStringFromUTF8BufferSize(lCount)];
|
||||
}
|
||||
WCHAR* pUnicodeString = pUnicodes;
|
||||
LONG lIndexUnicode = 0;
|
||||
|
||||
LONG lIndex = 0;
|
||||
while (lIndex < lCount)
|
||||
{
|
||||
BYTE byteMain = pBuffer[lIndex];
|
||||
if (0x00 == (byteMain & 0x80))
|
||||
{
|
||||
// 1 byte
|
||||
long code = CheckHHHHChar(pBuffer + lIndex);
|
||||
if(code < 0)
|
||||
{
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)byteMain;
|
||||
++lIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)code;
|
||||
lIndex += 7;
|
||||
}
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x20))
|
||||
{
|
||||
// 2 byte
|
||||
int val = (int)(((byteMain & 0x1F) << 6) |
|
||||
(pBuffer[lIndex + 1] & 0x3F));
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
|
||||
lIndex += 2;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x10))
|
||||
{
|
||||
// 3 byte
|
||||
int val = (int)(((byteMain & 0x0F) << 12) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 2] & 0x3F));
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
|
||||
lIndex += 3;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x0F))
|
||||
{
|
||||
// 4 byte
|
||||
int val = (int)(((byteMain & 0x07) << 18) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 3] & 0x3F));
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
|
||||
lIndex += 4;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x08))
|
||||
{
|
||||
// 4 byte
|
||||
int val = (int)(((byteMain & 0x07) << 18) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 3] & 0x3F));
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
|
||||
lIndex += 4;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x04))
|
||||
{
|
||||
// 5 byte
|
||||
int val = (int)(((byteMain & 0x03) << 24) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 18) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 3] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 4] & 0x3F));
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
|
||||
lIndex += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 6 byte
|
||||
int val = (int)(((byteMain & 0x01) << 30) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 24) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 18) |
|
||||
((pBuffer[lIndex + 3] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 4] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 5] & 0x3F));
|
||||
pUnicodeString[lIndexUnicode++] = (WCHAR)(val);
|
||||
lIndex += 5;
|
||||
}
|
||||
}
|
||||
|
||||
pUnicodeString[lIndexUnicode] = 0;
|
||||
lOutputCount = lIndexUnicode;
|
||||
}
|
||||
void CUtf8Converter::GetUnicodeStringFromUTF8WithHHHH_2bytes( const BYTE* pBuffer, LONG lCount, wchar_t*& pUnicodes, LONG& lOutputCount )
|
||||
{
|
||||
if (NULL == pUnicodes)
|
||||
{
|
||||
pUnicodes = new wchar_t[GetUnicodeStringFromUTF8BufferSize(lCount)];
|
||||
}
|
||||
WCHAR* pUnicodeString = pUnicodes;
|
||||
WCHAR* pStart = pUnicodeString;
|
||||
LONG lIndex = 0;
|
||||
while (lIndex < lCount)
|
||||
{
|
||||
BYTE byteMain = pBuffer[lIndex];
|
||||
if (0x00 == (byteMain & 0x80))
|
||||
{
|
||||
// 1 byte
|
||||
long code = CheckHHHHChar(pBuffer + lIndex);
|
||||
if(code < 0)
|
||||
{
|
||||
*pUnicodeString++ = (WCHAR)byteMain;
|
||||
++lIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pUnicodeString++ = (WCHAR)code;
|
||||
lIndex += 7;
|
||||
}
|
||||
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x20))
|
||||
{
|
||||
// 2 byte
|
||||
int val = (int)(((byteMain & 0x1F) << 6) |
|
||||
(pBuffer[lIndex + 1] & 0x3F));
|
||||
*pUnicodeString++ = (WCHAR)(val);
|
||||
lIndex += 2;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x10))
|
||||
{
|
||||
// 3 byte
|
||||
int val = (int)(((byteMain & 0x0F) << 12) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 2] & 0x3F));
|
||||
|
||||
WriteUtf16_WCHAR(val, pUnicodeString);
|
||||
lIndex += 3;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x0F))
|
||||
{
|
||||
// 4 byte
|
||||
int val = (int)(((byteMain & 0x07) << 18) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 3] & 0x3F));
|
||||
|
||||
WriteUtf16_WCHAR(val, pUnicodeString);
|
||||
lIndex += 4;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x08))
|
||||
{
|
||||
// 4 byte
|
||||
int val = (int)(((byteMain & 0x07) << 18) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 3] & 0x3F));
|
||||
|
||||
WriteUtf16_WCHAR(val, pUnicodeString);
|
||||
lIndex += 4;
|
||||
}
|
||||
else if (0x00 == (byteMain & 0x04))
|
||||
{
|
||||
// 5 byte
|
||||
int val = (int)(((byteMain & 0x03) << 24) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 18) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 3] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 4] & 0x3F));
|
||||
|
||||
WriteUtf16_WCHAR(val, pUnicodeString);
|
||||
lIndex += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 6 byte
|
||||
int val = (int)(((byteMain & 0x01) << 30) |
|
||||
((pBuffer[lIndex + 1] & 0x3F) << 24) |
|
||||
((pBuffer[lIndex + 2] & 0x3F) << 18) |
|
||||
((pBuffer[lIndex + 3] & 0x3F) << 12) |
|
||||
((pBuffer[lIndex + 4] & 0x3F) << 6) |
|
||||
(pBuffer[lIndex + 5] & 0x3F));
|
||||
|
||||
WriteUtf16_WCHAR(val, pUnicodeString);
|
||||
lIndex += 5;
|
||||
}
|
||||
}
|
||||
|
||||
*pUnicodeString++ = 0;
|
||||
lOutputCount = pUnicodeString - pStart;
|
||||
}
|
||||
void CUtf8Converter::GetUnicodeStringFromUTF8WithHHHH( const BYTE* pBuffer, LONG lCount, wchar_t*& pUnicodes, LONG& lOutputCount )
|
||||
{
|
||||
if (sizeof(WCHAR) == 2)
|
||||
return GetUnicodeStringFromUTF8WithHHHH_2bytes(pBuffer, lCount, pUnicodes, lOutputCount);
|
||||
return GetUnicodeStringFromUTF8WithHHHH_4bytes(pBuffer, lCount, pUnicodes, lOutputCount);
|
||||
}
|
||||
|
||||
void CUtf8Converter::GetUtf8StringFromUnicode_4bytes(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM)
|
||||
{
|
||||
if (NULL == pData)
|
||||
|
||||
@ -100,11 +100,17 @@ namespace NSFile
|
||||
|
||||
static std::wstring GetUnicodeFromCharPtr(const char* pData, LONG lCount, INT bIsUtf8 = FALSE);
|
||||
static std::wstring GetUnicodeFromCharPtr(const std::string& sParam, INT bIsUtf8 = FALSE);
|
||||
|
||||
static std::wstring GetUnicodeStringFromUTF8_4bytes( BYTE* pBuffer, LONG lCount );
|
||||
static std::wstring GetUnicodeStringFromUTF8_2bytes( BYTE* pBuffer, LONG lCount );
|
||||
|
||||
static std::wstring GetUnicodeStringFromUTF8( BYTE* pBuffer, LONG lCount );
|
||||
|
||||
static void GetUnicodeStringFromUTF8WithHHHH_4bytes( const BYTE* pBuffer, LONG lCount, wchar_t*& pUnicodes, LONG& lOutputCount );
|
||||
static void GetUnicodeStringFromUTF8WithHHHH_2bytes( const BYTE* pBuffer, LONG lCount, wchar_t*& pUnicodes, LONG& lOutputCount );
|
||||
static void GetUnicodeStringFromUTF8WithHHHH( const BYTE* pBuffer, LONG lCount, wchar_t*& pUnicodes, LONG& lOutputCount );
|
||||
|
||||
static inline LONG GetUnicodeStringFromUTF8BufferSize( LONG lCount );
|
||||
|
||||
static void GetUtf8StringFromUnicode_4bytes(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM = false);
|
||||
static void GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM = false);
|
||||
static void GetUtf8StringFromUnicode(const wchar_t* pUnicodes, LONG lCount, BYTE*& pData, LONG& lOutputCount, bool bIsBOM = false);
|
||||
@ -118,6 +124,9 @@ namespace NSFile
|
||||
|
||||
static std::wstring GetWStringFromUTF16(const CStringUtf16& data);
|
||||
static std::wstring GetWStringFromUTF16(const unsigned short* pUtf16, LONG lCount);
|
||||
|
||||
static inline long CheckHHHHChar(const BYTE* pBuffer);
|
||||
static inline long CheckHHHHChar(const wchar_t* pBuffer);
|
||||
};
|
||||
|
||||
class KERNEL_DECL CFileBinary
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
*
|
||||
*/
|
||||
#include "StringBuilder.h"
|
||||
#include "File.h"
|
||||
|
||||
namespace NSStringUtils
|
||||
{
|
||||
@ -301,6 +302,18 @@ namespace NSStringUtils
|
||||
else
|
||||
WriteEncodeXmlString_4bytes(pString, nCount);
|
||||
}
|
||||
void CStringBuilder::WriteEncodeXmlStringHHHH(const std::wstring& sString)
|
||||
{
|
||||
WriteEncodeXmlStringHHHH(sString.c_str(), (int)sString.length());
|
||||
}
|
||||
|
||||
void CStringBuilder::WriteEncodeXmlStringHHHH(const wchar_t* pString, int nCount)
|
||||
{
|
||||
if (sizeof(wchar_t) == 2)
|
||||
WriteEncodeXmlStringHHHH_2bytes(pString, nCount);
|
||||
else
|
||||
WriteEncodeXmlStringHHHH_4bytes(pString, nCount);
|
||||
}
|
||||
inline void CStringBuilder::WriteEncodeXmlString_4bytes(const wchar_t* pString, int nCount)
|
||||
{
|
||||
const wchar_t* pData = pString;
|
||||
@ -354,6 +367,59 @@ namespace NSStringUtils
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void CStringBuilder::WriteEncodeXmlStringHHHH_4bytes(const wchar_t* pString, int nCount)
|
||||
{
|
||||
const wchar_t* pData = pString;
|
||||
int nCounter = 0;
|
||||
unsigned int code;
|
||||
while (*pData != 0)
|
||||
{
|
||||
code = (unsigned int)*pData;
|
||||
WriteEncodeXmlChar(*pData, CheckXmlCodeHHHH(code, pData));
|
||||
|
||||
++pData;
|
||||
if (-1 != nCount)
|
||||
{
|
||||
++nCounter;
|
||||
if (nCounter >= nCount)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void CStringBuilder::WriteEncodeXmlStringHHHH_2bytes(const wchar_t* pString, int nCount)
|
||||
{
|
||||
const wchar_t* pData = pString;
|
||||
int nCounter = 0;
|
||||
unsigned int code;
|
||||
BYTE type;
|
||||
while (*pData != 0)
|
||||
{
|
||||
code = (unsigned int)*pData;
|
||||
if (code >= 0xD800 && code <= 0xDFFF && *(pData + 1) != 0)
|
||||
{
|
||||
code = 0x10000 + (((code & 0x3FF) << 10) | (0x03FF & *(pData + 1)));
|
||||
type = CheckXmlCodeHHHH(code, pData);
|
||||
if(0 != type)
|
||||
{
|
||||
WriteEncodeXmlChar(*pData, type);
|
||||
++pData;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
type = CheckXmlCodeHHHH(code, pData);
|
||||
}
|
||||
WriteEncodeXmlChar(*pData, type);
|
||||
|
||||
++pData;
|
||||
if (-1 != nCount)
|
||||
{
|
||||
++nCounter;
|
||||
if (nCounter >= nCount)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
inline void CStringBuilder::WriteEncodeXmlChar(wchar_t code, BYTE type)
|
||||
{
|
||||
switch (type)
|
||||
@ -436,6 +502,27 @@ namespace NSStringUtils
|
||||
*m_pDataCur++ = (wchar_t)(';');
|
||||
m_lSizeCur += 5;
|
||||
break;
|
||||
case 10:
|
||||
AddSize(7);
|
||||
*m_pDataCur++ = (wchar_t)('_');
|
||||
*m_pDataCur++ = (wchar_t)('x');
|
||||
*m_pDataCur++ = (wchar_t)('0');
|
||||
*m_pDataCur++ = (wchar_t)('0');
|
||||
*m_pDataCur++ = (wchar_t)('5');
|
||||
*m_pDataCur++ = (wchar_t)('F');
|
||||
*m_pDataCur++ = (wchar_t)('_');
|
||||
m_lSizeCur += 7;
|
||||
break;
|
||||
case 11:
|
||||
AddSize(7);
|
||||
*m_pDataCur++ = (wchar_t)('_');
|
||||
*m_pDataCur++ = (wchar_t)('x');
|
||||
m_lSizeCur += 2;
|
||||
WriteHexByteNoSafe((code >> 8) & 0xFF);
|
||||
WriteHexByteNoSafe(code & 0xFF);
|
||||
*m_pDataCur++ = (wchar_t)('_');
|
||||
++m_lSizeCur;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -751,6 +838,35 @@ namespace NSStringUtils
|
||||
|
||||
return 0;
|
||||
}
|
||||
unsigned char CStringBuilder::CheckXmlCodeHHHH(unsigned int c, const wchar_t* pData)
|
||||
{
|
||||
if ('&' == c)
|
||||
return 2;
|
||||
if ('\'' == c)
|
||||
return 3;
|
||||
if ('<' == c)
|
||||
return 4;
|
||||
if ('>' == c)
|
||||
return 5;
|
||||
if ('\"' == c)
|
||||
return 6;
|
||||
if ('\n' == c)//when reading from the attributes is replaced by a space.
|
||||
return 7;
|
||||
if ('\r' == c)//when reading from the attributes is replaced by a space.
|
||||
return 8;
|
||||
if ('\t' == c)//when reading from the attributes is replaced by a space.
|
||||
return 9;
|
||||
if (NSFile::CUtf8Converter::CheckHHHHChar(pData) >= 0)
|
||||
return 10;
|
||||
|
||||
//xml 1.0 Character Range https://www.w3.org/TR/xml/#charsets
|
||||
if ((0x20 <= c && c <= 0xD7FF) || (0xE000 <= c && c <= 0xFFFD) || (0x10000 <= c && c <= 0x10FFFF))
|
||||
return 1;
|
||||
else if(c <= 0xFFFF)
|
||||
return 11;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void string_replace(std::wstring& text, const std::wstring& replaceFrom, const std::wstring& replaceTo)
|
||||
{
|
||||
|
||||
@ -109,9 +109,11 @@ namespace NSStringUtils
|
||||
void AddChar2Safe(const wchar_t _c1, const wchar_t& _c2);
|
||||
|
||||
void WriteEncodeXmlString(const std::wstring& sString);
|
||||
|
||||
void WriteEncodeXmlString(const wchar_t* pString, int nCount = -1);
|
||||
|
||||
void WriteEncodeXmlStringHHHH(const std::wstring& sString);
|
||||
void WriteEncodeXmlStringHHHH(const wchar_t* pString, int nCount = -1);
|
||||
|
||||
size_t GetCurSize();
|
||||
void SetCurSize(size_t lCurSize);
|
||||
size_t GetSize();
|
||||
@ -147,8 +149,11 @@ namespace NSStringUtils
|
||||
protected:
|
||||
inline void WriteEncodeXmlString_4bytes(const wchar_t* pString, int nCount);
|
||||
inline void WriteEncodeXmlString_2bytes(const wchar_t* pString, int nCount);
|
||||
inline void WriteEncodeXmlStringHHHH_4bytes(const wchar_t* pString, int nCount);
|
||||
inline void WriteEncodeXmlStringHHHH_2bytes(const wchar_t* pString, int nCount);
|
||||
inline void WriteEncodeXmlChar(wchar_t code, unsigned char type);
|
||||
inline unsigned char CheckXmlCode(unsigned int c);
|
||||
inline unsigned char CheckXmlCodeHHHH(unsigned int c, const wchar_t* pData);
|
||||
};
|
||||
|
||||
KERNEL_DECL void string_replace(std::wstring& text, const std::wstring& replaceFrom, const std::wstring& replaceTo);
|
||||
|
||||
@ -25,6 +25,10 @@ LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter -lkernel -lgraphics
|
||||
} else {
|
||||
DEFINES += V8_OS_XP
|
||||
DESTDIR=$$DESTDIR/xp
|
||||
OBJECTS_DIR = $$OBJECTS_DIR/xp
|
||||
MOC_DIR = $$MOC_DIR/xp
|
||||
RCC_DIR = $$RCC_DIR/xp
|
||||
UI_DIR = $$UI_DIR/xp
|
||||
include(../../Common/3dParty/v8/v8_xp/v8.pri)
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -290,6 +290,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 7C560F661AA71A91000E5860;
|
||||
@ -466,7 +467,7 @@
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
_UNICODE,
|
||||
@ -506,7 +507,7 @@
|
||||
buildSettings = {
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
_UNICODE,
|
||||
|
||||
@ -735,6 +735,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17D918621AC5A19D0096D788;
|
||||
@ -795,7 +796,7 @@
|
||||
17C1FFC71ACC4B21006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -821,7 +822,7 @@
|
||||
17C1FFC81ACC4B21006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -286,6 +286,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17D91A331AC5A7C20096D788;
|
||||
@ -345,7 +346,7 @@
|
||||
17C100201ACC4B40006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -371,7 +372,7 @@
|
||||
17C100211ACC4B40006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -465,6 +465,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CBDA31AC93C09007D7DEC;
|
||||
@ -641,7 +642,7 @@
|
||||
17C100EC1ACC4D64006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -665,7 +666,7 @@
|
||||
17C100ED1ACC4D64006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -101,6 +101,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CBE921AC9458E007D7DEC;
|
||||
@ -228,7 +229,7 @@
|
||||
17C100F71ACC4DCC006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -248,7 +249,7 @@
|
||||
17C100F81ACC4DCC006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -343,6 +343,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CBEBE1AC94658007D7DEC;
|
||||
@ -536,7 +537,7 @@
|
||||
17C1014F1ACC4DFA006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -551,7 +552,7 @@
|
||||
17C101501ACC4DFA006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -289,6 +289,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CBF991AC948D9007D7DEC;
|
||||
@ -464,7 +465,7 @@
|
||||
17C101961ACC4EF9006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -483,7 +484,7 @@
|
||||
17C101971ACC4EF9006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -236,6 +236,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CC0441AC949B4007D7DEC;
|
||||
@ -380,7 +381,7 @@
|
||||
17C1022B1ACC4FE0006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -407,7 +408,7 @@
|
||||
17C1022C1ACC4FE0006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -167,6 +167,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CC1781AC9569C007D7DEC;
|
||||
@ -308,7 +309,7 @@
|
||||
17C101FA1ACC4FB7006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -327,7 +328,7 @@
|
||||
17C101FB1ACC4FB7006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -98,6 +98,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CC14C1AC9560E007D7DEC;
|
||||
@ -224,7 +225,7 @@
|
||||
17C101DB1ACC4F80006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -238,7 +239,7 @@
|
||||
17C101DC1ACC4F80006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -257,6 +257,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 175CC0AD1AC94D62007D7DEC;
|
||||
@ -420,7 +421,7 @@
|
||||
17C101D11ACC4F45006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -438,7 +439,7 @@
|
||||
17C101D21ACC4F45006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -207,6 +207,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17D9182C1AC5A0870096D788;
|
||||
@ -246,7 +247,7 @@
|
||||
17C1FF1E1ACC4AF7006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -271,7 +272,7 @@
|
||||
17C1FF1F1ACC4AF7006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -503,6 +503,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17D913FC1AC59C860096D788;
|
||||
@ -585,7 +586,7 @@
|
||||
17C100881ACC4BC4006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -609,7 +610,7 @@
|
||||
17C100891ACC4BC4006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -295,6 +295,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17D9130C1AC58E750096D788;
|
||||
@ -343,7 +344,7 @@
|
||||
17C1FEFC1ACC4A67006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -372,7 +373,7 @@
|
||||
17C1FEFD1ACC4A67006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -173,8 +173,8 @@
|
||||
17A7F02B1B13154500760AFB /* SvmPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17A7F0221B13154500760AFB /* SvmPlayer.cpp */; };
|
||||
17DD67B71B7E2778000F800F /* lepton_utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17DD67B51B7E2778000F800F /* lepton_utils.cpp */; };
|
||||
697B72D41E3B78D90054C17C /* EmfFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 697B72D31E3B78D90054C17C /* EmfFile.cpp */; };
|
||||
8AA0EB9B229BE96B00297DE5 /* SVGTransformer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AA0EB99229BE96B00297DE5 /* SVGTransformer.cpp */; };
|
||||
8AA0EB9C229BE96B00297DE5 /* SVGFramework.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AA0EB9A229BE96B00297DE5 /* SVGFramework.cpp */; };
|
||||
8A2EE9BB22AFBAC200E8AB1A /* SVGTransformer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A2EE9B922AFBAC200E8AB1A /* SVGTransformer.cpp */; };
|
||||
8A2EE9BC22AFBAC200E8AB1A /* SVGFramework.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A2EE9BA22AFBAC200E8AB1A /* SVGFramework.cpp */; };
|
||||
8AC2819D2195A582006FA3D7 /* StringExt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AC2819B2195A582006FA3D7 /* StringExt.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@ -438,10 +438,10 @@
|
||||
17A7F0231B13154500760AFB /* SvmPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SvmPlayer.h; sourceTree = "<group>"; };
|
||||
17DD67B51B7E2778000F800F /* lepton_utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lepton_utils.cpp; sourceTree = "<group>"; };
|
||||
697B72D31E3B78D90054C17C /* EmfFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmfFile.cpp; sourceTree = "<group>"; };
|
||||
8AA0EB97229BE96B00297DE5 /* SVGFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFramework.h; sourceTree = "<group>"; };
|
||||
8AA0EB98229BE96B00297DE5 /* SVGTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformer.h; sourceTree = "<group>"; };
|
||||
8AA0EB99229BE96B00297DE5 /* SVGTransformer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformer.cpp; sourceTree = "<group>"; };
|
||||
8AA0EB9A229BE96B00297DE5 /* SVGFramework.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFramework.cpp; sourceTree = "<group>"; };
|
||||
8A2EE9B722AFBAC200E8AB1A /* SVGFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFramework.h; sourceTree = "<group>"; };
|
||||
8A2EE9B822AFBAC200E8AB1A /* SVGTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformer.h; sourceTree = "<group>"; };
|
||||
8A2EE9B922AFBAC200E8AB1A /* SVGTransformer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformer.cpp; sourceTree = "<group>"; };
|
||||
8A2EE9BA22AFBAC200E8AB1A /* SVGFramework.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFramework.cpp; sourceTree = "<group>"; };
|
||||
8AC2819B2195A582006FA3D7 /* StringExt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExt.cpp; path = ../../../common/StringExt.cpp; sourceTree = "<group>"; };
|
||||
8AC2819C2195A582006FA3D7 /* StringExt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringExt.h; path = ../../../common/StringExt.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@ -476,7 +476,7 @@
|
||||
17A762BC1B0F35320046BC0B /* metafile */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8AA0EB96229BE96B00297DE5 /* svg */,
|
||||
8A2EE9B622AFBAC200E8AB1A /* svg */,
|
||||
17A7F0191B13154500760AFB /* StarView */,
|
||||
17A765081B0F3A3E0046BC0B /* Jp2 */,
|
||||
17A7631F1B0F38FE0046BC0B /* JBig2 */,
|
||||
@ -800,13 +800,13 @@
|
||||
path = ../../../raster/Metafile/StarView;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8AA0EB96229BE96B00297DE5 /* svg */ = {
|
||||
8A2EE9B622AFBAC200E8AB1A /* svg */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8AA0EB97229BE96B00297DE5 /* SVGFramework.h */,
|
||||
8AA0EB98229BE96B00297DE5 /* SVGTransformer.h */,
|
||||
8AA0EB99229BE96B00297DE5 /* SVGTransformer.cpp */,
|
||||
8AA0EB9A229BE96B00297DE5 /* SVGFramework.cpp */,
|
||||
8A2EE9B722AFBAC200E8AB1A /* SVGFramework.h */,
|
||||
8A2EE9B822AFBAC200E8AB1A /* SVGTransformer.h */,
|
||||
8A2EE9B922AFBAC200E8AB1A /* SVGTransformer.cpp */,
|
||||
8A2EE9BA22AFBAC200E8AB1A /* SVGFramework.cpp */,
|
||||
);
|
||||
name = svg;
|
||||
path = ../../../raster/Metafile/svg;
|
||||
@ -1022,8 +1022,8 @@
|
||||
17A763EF1B0F39370046BC0B /* bardecode.cpp in Sources */,
|
||||
17A7631E1B0F389C0046BC0B /* MetaFileUtils.cpp in Sources */,
|
||||
17A763231B0F39120046BC0B /* JBig2File.cpp in Sources */,
|
||||
8AA0EB9C229BE96B00297DE5 /* SVGFramework.cpp in Sources */,
|
||||
8AA0EB9B229BE96B00297DE5 /* SVGTransformer.cpp in Sources */,
|
||||
8A2EE9BC22AFBAC200E8AB1A /* SVGFramework.cpp in Sources */,
|
||||
8A2EE9BB22AFBAC200E8AB1A /* SVGTransformer.cpp in Sources */,
|
||||
17A765031B0F39370046BC0B /* writefile.cpp in Sources */,
|
||||
17A764B11B0F39370046BC0B /* psio2stub.cpp in Sources */,
|
||||
17A764FF1B0F39370046BC0B /* webpio.cpp in Sources */,
|
||||
@ -1139,7 +1139,7 @@
|
||||
17A762D91B0F355E0046BC0B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = _IOS;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -1157,7 +1157,7 @@
|
||||
17A762DA1B0F355E0046BC0B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = _IOS;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
||||
@ -105,6 +105,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17D913D41AC59B6E0096D788;
|
||||
@ -133,7 +134,7 @@
|
||||
17C1FF081ACC4AB0006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -153,7 +154,7 @@
|
||||
17C1FF091ACC4AB0006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -107,6 +107,17 @@ namespace MetaFile
|
||||
|
||||
void Begin()
|
||||
{
|
||||
if (m_pFile)
|
||||
{
|
||||
TRect* pBounds = m_pFile->GetDCBounds();
|
||||
int nL = pBounds->nLeft;
|
||||
int nR = pBounds->nRight;
|
||||
int nT = pBounds->nTop;
|
||||
int nB = pBounds->nBottom;
|
||||
|
||||
m_dScaleX = (nR - nL <= 0) ? 1 : m_dW / (double)(nR - nL);
|
||||
m_dScaleY = (nB - nT <= 0) ? 1 : m_dH / (double)(nB - nT);
|
||||
}
|
||||
}
|
||||
void End()
|
||||
{
|
||||
|
||||
@ -144,7 +144,7 @@ namespace MetaFile
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
bool CMetaFile::DrawOnRenderer(IRenderer* pRenderer, double dX, double dY, double dWidth, double dHeight)
|
||||
{
|
||||
if (NULL == pRenderer)
|
||||
@ -176,7 +176,7 @@ namespace MetaFile
|
||||
}
|
||||
pRenderer->EndCommand(c_nImageType);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
void CMetaFile::Close()
|
||||
{
|
||||
m_oWmfFile.Close();
|
||||
@ -185,7 +185,7 @@ namespace MetaFile
|
||||
m_oSvgFile.Close();
|
||||
|
||||
m_lType = 0;
|
||||
};
|
||||
}
|
||||
int CMetaFile::GetType()
|
||||
{
|
||||
return m_lType;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user