Compare commits

..

38 Commits

Author SHA1 Message Date
e48be100ed [x2t] Change tab type format in Editor.bin 2019-09-17 19:51:02 +03:00
429b4f1245 DocFormatReader - fix bullet picture(dib with pallete) 2019-09-17 13:08:14 +03:00
cc7dee211a Merge remote-tracking branch 'origin/hotfix/v5.4.1' into develop 2019-09-17 12:41:37 +03:00
ec440d0bd3 [ios][x2t] fixed build 2019-09-13 16:48:44 +03:00
2d094ae872 Merge pull request #193 from ONLYOFFICE/feature/v8_7.0
.
2019-09-13 14:03:34 +03:00
839c180d8c . 2019-09-13 14:02:39 +03:00
3f55d6d4ff Merge pull request #192 from ONLYOFFICE/feature/v8_7.0
Feature/v8 7.0
2019-09-13 12:36:56 +03:00
d67a4b9f6e Merge remote-tracking branch 'remotes/origin/hotfix/v5.4.1' into develop
# Conflicts:
#	Common/DocxFormat/Source/XlsxFormat/Worksheets/DataValidation.cpp
2019-09-13 12:33:14 +03:00
eb9242cba0 developing 2019-09-13 11:55:09 +03:00
11eb11e502 developing 2019-09-12 18:39:45 +03:00
cf4451e60f [x2t] Fix table shd reading from Editor.bin 2019-09-12 15:04:05 +03:00
5405763b05 Merge pull request #189 from ONLYOFFICE/hotfix/v5.4.1
Hotfix/v5.4.1
2019-09-11 16:55:11 +03:00
f57e9718b9 Merge pull request #187 from ONLYOFFICE/hotfix/v5.4.1
Hotfix/v5.4.1
2019-09-11 11:15:24 +03:00
148d6b01ef [x2t] Extend lvl Format in Editor.bin
(cherry picked from commit 41920875ff)
2019-09-05 13:17:09 +03:00
54dbe697f1 Merge remote-tracking branch 'origin/hotfix/v5.4.1' into develop 2019-09-05 12:55:32 +03:00
66d534a415 [x2t] For c215344550. Fix memory leak 2019-09-04 10:34:33 +03:00
c215344550 [x2t] Fix _xHHHH_ chars in dataValidation attributes. Fix bug 42663. 2019-09-03 17:41:04 +03:00
9fb9fd3511 Merge remote-tracking branch 'origin/feature/fix_errors2_v5.4.0' into develop 2019-09-03 11:52:25 +03:00
246474a2f7 Merge branch 'feature/fix_errors3_v.5.4.0' into feature/fix_errors2_v5.4.0 2019-09-03 11:47:23 +03:00
af0f878de2 [ios] refactoring 2019-09-03 10:53:09 +03:00
fc8d16196d Fixed project of OdfReaderFormat library for ios 2019-09-03 09:45:01 +03:00
41fc3eb8c1 x2t - fix after testing 2019-09-02 17:52:47 +03:00
53878c9d88 OdfFormatWriter - fix bug #42654 2019-09-02 16:00:46 +03:00
677982b4ce OdfFormatWriter - fix error in headers/footers 2019-09-02 12:58:53 +03:00
e7290f5ad9 XlsFormatReader - fix bug #42239 2019-09-02 11:43:54 +03:00
816c43bffe [android][de] fix emf 2019-09-02 08:56:17 +03:00
8dd58a2050 [android][de] fix emf 2019-08-31 11:32:27 +03:00
e96221c83b DocFormatReader - fix extended comments 2019-08-30 13:00:48 +03:00
2a4ee72059 [ios][x2t] fixed build 2019-08-29 18:14:37 +03:00
9a3e9a9851 [ios][x2t] fixed build 2019-08-29 18:07:34 +03:00
41920875ff [x2t] Extend lvl Format in Editor.bin 2019-08-29 14:18:10 +03:00
0ae9b97774 [ios][x2t] fixed build 2019-08-28 14:41:00 +03:00
c644c419ec Merge remote-tracking branch 'origin/release/v5.4.0' into develop 2019-08-28 13:45:01 +03:00
3874b56289 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-08-27 15:24:44 +03:00
29df40407e [android][se] fix crash 2019-08-27 14:57:13 +03:00
e3ff8912f0 [ios][de] update file utils 2019-08-26 17:12:06 +03:00
ae6d231acc OdfFormatW - fix after testing 2019-08-26 14:31:43 +03:00
98114aa7a5 fix bug #42542 2019-08-26 13:18:55 +03:00
61 changed files with 2047 additions and 2366 deletions

View File

@ -45,7 +45,7 @@
namespace ImageHelper
{
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, std::wstring& file_name)//without ext
{
Global::_BlipType result = Global::msoblipERROR;
@ -99,14 +99,21 @@ namespace ImageHelper
//if (header->biWidth % 2 != 0 && sz_bitmap < size -offset)
// header->biWidth++;
if (header->biClrUsed > 0)
{
oFrame.put_Palette((unsigned char*)data + offset, header->biClrUsed);
offset += header->biClrUsed * 4;
}
int stride = -(size - offset) / header->biHeight;
if (-stride >= header->biWidth && header->biBitCount >= 24)
if (-stride >= header->biWidth/* && header->biBitCount >= 24*/)
{
result = Global::msoblipPNG;
}
oFrame.put_Stride (stride/*header->biBitCount * header->biWidth /8*/);
oFrame.put_Stride(stride);
biSizeImage = header->biSizeImage > 0 ? header->biSizeImage : (size - offset);
}
@ -117,24 +124,28 @@ namespace ImageHelper
{
oFrame.put_Data((unsigned char*)data + offset);
if (!oFrame.SaveFile(file_name + L".png", 4/*CXIMAGE_FORMAT_PNG*/))
result = Global::msoblipERROR;
file_name += L".png";
if (!oFrame.SaveFile(file_name, 4/*CXIMAGE_FORMAT_PNG*/))
{
result = Global::msoblipDIB;
}
oFrame.put_Data(NULL);
}
else if (result == Global::msoblipWMF)
{
file_name += L".wmf";
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".wmf"))
if (file.CreateFileW(file_name))
{
file.WriteFile((BYTE*)data, size);
file.CloseFile();
}
}
else if (biSizeImage > 0)
if (biSizeImage > 0 && result == Global::msoblipDIB)
{
file_name += L".bmp";
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".bmp"))
if (file.CreateFileW(file_name))
{
_UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
_UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);

View File

@ -162,6 +162,6 @@ namespace ImageHelper
_UINT16 bcBitCount;
};
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name);
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, std::wstring& file_name);
}

View File

@ -589,22 +589,20 @@ namespace DocFileFormat
BitmapBlip* bitBlip = static_cast<BitmapBlip*>(oBlipEntry->Blip);
if (bitBlip)
{
std::wstring file_name = m_context->_doc->m_sTempFolder + L"tmp_image";
std::wstring file_name = m_context->_doc->m_sTempFolder + FILE_SEPARATOR_STR + L"tmp_image";
oBlipEntry->btWin32 = ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name);
if (oBlipEntry->btWin32 == Global::msoblipPNG)
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(Global::msoblipPNG),
boost::shared_array<unsigned char>(pData), nData, Global::msoblipPNG));
break;
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32),
boost::shared_array<unsigned char>(pData), nData, oBlipEntry->btWin32));
break;
}
}
}//в случае ошибки конвертации -храним оригинальный dib
}
case Global::msoblipJPEG:
case Global::msoblipCMYKJPEG:
case Global::msoblipPNG:

View File

@ -1326,8 +1326,7 @@ namespace DocFileFormat
RELEASEOBJECT(metaBlip);
}
}
break;
}break;
case Global::msoblipJPEG:
case Global::msoblipCMYKJPEG:
case Global::msoblipPNG:
@ -1341,25 +1340,22 @@ namespace DocFileFormat
{
std::wstring file_name = m_context->_doc->m_sTempFolder + L"tmp_image";
if (Global::msoblipPNG == ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name))
oBlip->btWin32 = ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name);
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
oBlip->btWin32 = Global::msoblipPNG;
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(Global::msoblipPNG),
boost::shared_array<unsigned char>(pData), nData, Global::msoblipPNG));
break;
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32),
boost::shared_array<unsigned char>(pData), nData, oBlip->btWin32));
break;
}//в случае ошибки конвертации -храним оригинальный dib
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32),
bitBlip->m_pvBits, bitBlip->pvBitsSize, oBlip->btWin32));
RELEASEOBJECT (bitBlip);
}
}break;
}
default:
{
result = false;
@ -1368,9 +1364,8 @@ namespace DocFileFormat
break;
}
m_nImageId = m_context->_docx->RegisterImage (m_pCaller, oBlip->btWin32);
result = true;
m_nImageId = m_context->_docx->RegisterImage (m_pCaller, oBlip->btWin32);
result = true;
}
return result;

View File

@ -35,6 +35,7 @@
#define READER_CLASSES
#include "../../Common/DocxFormat/Source/XML/Utils.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
#include <boost/algorithm/string.hpp>
@ -439,13 +440,12 @@ public:
class Tab
{
public:
BYTE Val;
SimpleTypes::CTabJc<> Val;
long Pos;
BYTE Leader;
bool bLeader;
Tab()
{
Val = shd_Nil;
Pos = 0;
bLeader = false;
}
@ -1406,7 +1406,9 @@ class docLvl
public:
long ILvl;
long Format;
std::wstring sFormat;
BYTE Jc;
std::wstring sJc;
std::vector<docLvlText*> Text;
long Restart;
long Start;
@ -1491,7 +1493,11 @@ public:
{
oWriter.WriteString(L"<w:start w:val=\"" + std::to_wstring(Start) + L"\"/>");
}
if(bFormat)
if(!sFormat.empty())
{
oWriter.WriteString(sFormat);
}
else if(bFormat)
{
std::wstring sFormat;
switch(Format)
@ -1599,19 +1605,23 @@ public:
}
oWriter.WriteString(L"/>");
}
if(bJc)
if(!sJc.empty())
{
std::wstring sJc;
oWriter.WriteString(sJc);
}
else if(bJc)
{
std::wstring sJcType;
switch(Jc)
{
case align_Right:sJc = _T("right");break;
case align_Left:sJc = _T("left");break;
case align_Center:sJc = _T("center");break;
case align_Justify:sJc = _T("distribute");break;
case align_Right:sJcType = _T("right");break;
case align_Left:sJcType = _T("left");break;
case align_Center:sJcType = _T("center");break;
case align_Justify:sJcType = _T("distribute");break;
}
if(!sJc.empty())
if(!sJcType.empty())
{
oWriter.WriteString(L"<w:lvlJc w:val=\"" + sJc + L"\"/>");
oWriter.WriteString(L"<w:lvlJc w:val=\"" + sJcType + L"\"/>");
}
}
if(bParaPr)

View File

@ -904,15 +904,7 @@ int Binary_pPrReader::ReadContent( BYTE type, long length, void* poResult)
for(size_t i = 0; i < nLen; ++i)
{
Tab& oTab = oTabs.m_aTabs[i];
std::wstring sVal;
switch(oTab.Val)
{
case g_tabtype_right: sVal = L"right"; break;
case g_tabtype_center: sVal = L"center"; break;
case g_tabtype_clear: sVal = L"clear"; break;
default: sVal = L"left"; break;
}
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(oTab.Pos) + L"\"");
pCStringWriter->WriteString(L"<w:tab w:val=\"" + oTab.Val.ToString() + L"\" w:pos=\"" + std::to_wstring(oTab.Pos) + L"\"");
if (oTab.bLeader)
{
std::wstring sLeader;
@ -1138,7 +1130,17 @@ int Binary_pPrReader::ReadTabItem(BYTE type, long length, void* poResult)
int res = c_oSerConstants::ReadOk;
Tab* poTabItem = static_cast<Tab*>(poResult);
if(c_oSerProp_pPrType::Tab_Item_Val == type)
poTabItem->Val = m_oBufferedStream.GetUChar();
poTabItem->Val.SetValue((SimpleTypes::ETabJc)m_oBufferedStream.GetUChar());
else if(c_oSerProp_pPrType::Tab_Item_Val_deprecated == type)
{
switch(m_oBufferedStream.GetUChar())
{
case 1: poTabItem->Val.SetValue(SimpleTypes::tabjcRight);break;
case 2: poTabItem->Val.SetValue(SimpleTypes::tabjcCenter);break;
case 3: poTabItem->Val.SetValue(SimpleTypes::tabjcClear);break;
default:poTabItem->Val.SetValue(SimpleTypes::tabjcLeft);break;
}
}
else if(c_oSerProp_pPrType::Tab_Item_Pos == type)
poTabItem->Pos = SerializeCommon::Round( g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
else if(c_oSerProp_pPrType::Tab_Item_PosTwips == type)
@ -1935,7 +1937,6 @@ int Binary_tblPrReader::Read_tblPr(BYTE type, long length, void* poResult)
Shd oShd;
READ2_DEF(length, res, oBinary_CommonReader2.ReadShd, &oShd);
pWiterTblPr->Shd = oShd.ToString();
m_sCurTableShd = pWiterTblPr->Shd;
}
else if( c_oSerProp_tblPrType::tblpPr == type )
{
@ -2402,7 +2403,6 @@ int Binary_tblPrReader::Read_CellPr(BYTE type, long length, void* poResult)
}
else if( c_oSerProp_cellPrType::Shd == type )
{
bCellShd = true;
Shd oShd;
READ2_DEF(length, res, oBinary_CommonReader2.ReadShd, &oShd);
pCStringWriter->WriteString(oShd.ToString());
@ -2824,11 +2824,24 @@ int Binary_NumberingTableReader::ReadLevel(BYTE type, long length, void* poResul
odocLvl->bFormat = true;
odocLvl->Format = m_oBufferedStream.GetLong();
}
else if ( c_oSerNumTypes::lvl_Jc == type )
else if ( c_oSerNumTypes::lvl_NumFmt == type )
{
ComplexTypes::Word::CNumFmt oNumFmt;
READ1_DEF(length, res, oBinary_pPrReader.ReadNumFmt, &oNumFmt);
odocLvl->sFormat = L"<w:numFmt " + oNumFmt.ToString() + L"/>";
}
else if ( c_oSerNumTypes::lvl_Jc_deprecated == type )
{
odocLvl->bJc = true;
odocLvl->Jc = m_oBufferedStream.GetUChar();
}
else if ( c_oSerNumTypes::lvl_Jc == type )
{
ComplexTypes::Word::CJc oJc;
oJc.m_oVal.Init();
oJc.m_oVal->SetValue((SimpleTypes::EJc)m_oBufferedStream.GetUChar());
odocLvl->sJc = L"<w:lvlJc " + oJc.ToString() + L"/>";
}
else if ( c_oSerNumTypes::lvl_LvlText == type )
{
odocLvl->bText = true;
@ -4231,13 +4244,9 @@ int Binary_DocumentTableReader::ReadDocumentContent(BYTE type, long length, void
else if(c_oSerParType::Table == type)
{
m_byteLastElemType = c_oSerParType::Table;
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:tbl>")));
READ1_DEF(length, res, this->ReadDocTable, &m_oDocumentWriter.m_oContent);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:tbl>")));
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
}
else if(c_oSerParType::Sdt == type)
{
@ -7356,8 +7365,6 @@ int Binary_DocumentTableReader::ReadRunContent(BYTE type, long length, void* poR
}
else if(c_oSerRunType::table == type)
{
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
//todo
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:p>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:tbl>")));
@ -7371,8 +7378,6 @@ int Binary_DocumentTableReader::ReadRunContent(BYTE type, long length, void* poR
m_oDocumentWriter.m_oContent.Write(m_oCur_pPr);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:pPr>")));
}
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
}
else if(c_oSerRunType::fldstart_deprecated == type)
{
@ -7753,13 +7758,7 @@ int Binary_DocumentTableReader::ReadCell(BYTE type, long length, void* poResult)
if( c_oSerDocTableType::Cell_Pr == type )
{
pCStringWriter->WriteString(std::wstring(_T("<w:tcPr>")));
oBinary_tblPrReader.bCellShd = false;
READ2_DEF(length, res, oBinary_tblPrReader.Read_CellPr, pCStringWriter);
if(false == oBinary_tblPrReader.bCellShd && !oBinary_tblPrReader.m_sCurTableShd.empty())
{
pCStringWriter->WriteString(oBinary_tblPrReader.m_sCurTableShd);
}
oBinary_tblPrReader.bCellShd = false;
pCStringWriter->WriteString(std::wstring(_T("</w:tcPr>")));
}
else if( c_oSerDocTableType::Cell_Content == type )

View File

@ -152,9 +152,7 @@ protected:
Binary_pPrReader oBinary_pPrReader;
Binary_CommonReader2 oBinary_CommonReader2;
public:
std::wstring m_sCurTableShd;
std::vector<double> m_aCurTblGrid;
bool bCellShd;
public:
Binary_tblPrReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
int Read_tblPr(BYTE type, long length, void* poResult);

View File

@ -36,9 +36,6 @@ namespace BinDocxRW
{
const double eps = 0.001;
const int shd_Clear = 0;
const int shd_Nil = 1;
const int g_tabtype_left = 0;
const int g_tabtype_right = 1;
const int g_tabtype_center = 2;
@ -173,7 +170,7 @@ extern int g_nCurFormatVersion;
AbstractNum_Lvls = 4,
Lvl = 5,
lvl_Format = 6,//deprecated (instead use lvl_NumFmt)
lvl_Jc = 7,
lvl_Jc_deprecated = 7,//deprecated
lvl_LvlText = 8,
lvl_LvlTextItem = 9,
lvl_LvlTextItemText = 10,
@ -202,7 +199,8 @@ extern int g_nCurFormatVersion;
LvlLegacy = 33,
Legacy = 34,
LegacyIndent = 35,
LegacySpace = 36
LegacySpace = 36,
lvl_Jc = 37
};}
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
{
@ -345,7 +343,7 @@ extern int g_nCurFormatVersion;
Tab = 17,
Tab_Item = 18,
Tab_Item_Pos = 19,
Tab_Item_Val = 20,
Tab_Item_Val_deprecated = 20,
ParaStyle = 21,
numPr = 22,
numPr_lvl = 23,
@ -367,7 +365,8 @@ extern int g_nCurFormatVersion;
Spacing_LineTwips = 39,
Spacing_BeforeTwips = 40,
Spacing_AfterTwips = 41,
Tab_Item_PosTwips = 42
Tab_Item_PosTwips = 42,
Tab_Item_Val = 43
};}
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
{

View File

@ -1105,21 +1105,7 @@ void Binary_pPrWriter::WriteTabItem(const ComplexTypes::Word::CTabStop& TabItem,
{
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Tab_Item_Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
switch(TabItem.m_oVal.get().GetValue())
{
case SimpleTypes::tabjcEnd:
case SimpleTypes::tabjcRight:
m_oBcw.m_oStream.WriteBYTE(g_tabtype_right);
bRight = true;
break;
case SimpleTypes::tabjcCenter:
m_oBcw.m_oStream.WriteBYTE(g_tabtype_center);
break;
case SimpleTypes::tabjcClear:
m_oBcw.m_oStream.WriteBYTE(g_tabtype_clear);
break;
default: m_oBcw.m_oStream.WriteBYTE(g_tabtype_left);break;
}
m_oBcw.m_oStream.WriteBYTE(TabItem.m_oVal->GetValue());
}
//pos
if(false != TabItem.m_oPos.IsInit())
@ -2771,50 +2757,20 @@ void BinaryNumberingTableWriter::WriteLevel(const OOX::Numbering::CLvl& lvl)
{
int nCurPos = 0;
//Format
if(false != lvl.m_oNumFmt.IsInit())
if(lvl.m_oNumFmt.IsInit())
{
const ComplexTypes::Word::CNumFmt& oNumFmt = lvl.m_oNumFmt.get();
if(false != oNumFmt.m_oVal.IsInit())
{
const SimpleTypes::CNumberFormat<>& oNumberFormat = oNumFmt.m_oVal.get();
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::lvl_Format);
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(oNumberFormat.GetValue() + 0x2008);break; //max our numbering
}
}
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::lvl_NumFmt);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
bpPrs.WriteNumFmt(lvl.m_oNumFmt.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
//Jc
if(false != lvl.m_oLvlJc.IsInit())
if(lvl.m_oLvlJc.IsInit() && lvl.m_oLvlJc->m_oVal.IsInit())
{
const ComplexTypes::Word::CJc& oJc = lvl.m_oLvlJc.get();
if(false != oJc.m_oVal.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::lvl_Jc);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
switch(oJc.m_oVal.get().GetValue())
{
case SimpleTypes::jcCenter: m_oBcw.m_oStream.WriteBYTE(align_Center);break;
case SimpleTypes::jcStart:
case SimpleTypes::jcLeft: m_oBcw.m_oStream.WriteBYTE(align_Left);break;
case SimpleTypes::jcEnd:
case SimpleTypes::jcRight: m_oBcw.m_oStream.WriteBYTE(align_Right);break;
case SimpleTypes::jcBoth:
case SimpleTypes::jcThaiDistribute:
case SimpleTypes::jcDistribute: m_oBcw.m_oStream.WriteBYTE(align_Justify);break;
default: m_oBcw.m_oStream.WriteBYTE(align_Left);break;
}
}
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::lvl_Jc);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBYTE(lvl.m_oLvlJc->m_oVal->GetValue());
}
//LvlText
if(false != lvl.m_oLvlText.IsInit())

View File

@ -385,78 +385,6 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSele
return;
}
size_t getColAddressInv(const std::wstring & a_)
{
std::wstring a = a_;
::boost::algorithm::to_upper(a);
static const size_t r = (L'Z' - L'A' + 1);
size_t mul = 1;
bool f = true;
size_t res = 0;
for (int i = a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
f = false;
else
v += 1;
res += v * mul;
mul *= r;
}
return res;
}
size_t getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
{
return boost::lexical_cast<size_t>(a_)-1;
}
else
return 0;
}
void splitCellAddress(const std::wstring & a_, std::wstring & col, std::wstring & row)
{
std::wstring a = a_;
std::reverse(a.begin(), a.end());
::XmlUtils::replace_all( a, L"$", L"");
//::XmlUtils::replace_all( a, L"'", L"");
::boost::algorithm::to_upper(a);
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
else
col += a[i];
}
std::reverse(col.begin(), col.end());
std::reverse(row.begin(), row.end());
}
void getCellAddressInv(const std::wstring & a_, int & col, int & row)
{
std::wstring colStr=L"", rowStr=L"";
splitCellAddress(a_, colStr, rowStr);
col = getColAddressInv(colStr);
row = getRowAdderssInv(rowStr);
if (col > 16384) col= -1;
}
bool IsRefPresent(const std::wstring& ref_test)
{
int col = -1, row = -1;
getCellAddressInv(ref_test, col, row);
if (col >= 0 && row >=0) return true;
return false;
}
std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmatch const & what)
{
const size_t sz = what.size();
@ -485,21 +413,8 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
if (!c2.empty() && c2.substr(0, 1) == L":")
c2 = c2.substr(1);
bool bRefPresent = true;
if (sheet.empty() && c2.empty())
{
bRefPresent = IsRefPresent(c1);
}
if (bRefPresent)
{
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
}
else
{
s = c1;
}
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
}
return s;
}
@ -941,6 +856,67 @@ std::wstring oox2odf_converter::convert_spacechar(std::wstring expr)
}
return expr;
}
size_t getColAddressInv(const std::wstring & a_)
{
std::wstring a = a_;
::boost::algorithm::to_upper(a);
static const size_t r = (L'Z' - L'A' + 1);
size_t mul = 1;
bool f = true;
size_t res = 0;
for (int i = a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
f = false;
else
v += 1;
res += v * mul;
mul *= r;
}
return res;
}
size_t getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
{
return boost::lexical_cast<size_t>(a_)-1;
}
else
return 0;
}
void splitCellAddress(const std::wstring & a_, std::wstring & col, std::wstring & row)
{
std::wstring a = a_;
std::reverse(a.begin(), a.end());
::XmlUtils::replace_all( a, L"$", L"");
//::XmlUtils::replace_all( a, L"'", L"");
::boost::algorithm::to_upper(a);
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
else
col += a[i];
}
std::reverse(col.begin(), col.end());
std::reverse(row.begin(), row.end());
}
void getCellAddressInv(const std::wstring & a_, int & col, int & row)
{
std::wstring colStr=L"", rowStr=L"";
splitCellAddress(a_, colStr, rowStr);
col = getColAddressInv(colStr);
row = getRowAdderssInv(rowStr);
}
int oox2odf_converter::get_count_value_points(std::wstring expr)
{
int count =0;

View File

@ -2411,8 +2411,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CXfs * xfc_style, int oox_id, bool
odf_writer::style_text_properties * text_properties = ods_context->styles_context()->last_state()->get_text_properties();
odf_writer::style_table_cell_properties * table_cell_properties = ods_context->styles_context()->last_state()->get_table_cell_properties();
bool bApplyFont = xfc_style->m_oApplyFont.IsInit() ? xfc_style->m_oApplyFont->ToBool() : true;
if (xlsx_styles->m_oFonts.IsInit() && font_id >=0 && (id_parent < 0 || bApplyFont))
if (xlsx_styles->m_oFonts.IsInit() && font_id >=0 && (id_parent < 0 || xfc_style->m_oApplyFont.IsInit()))
{
std::map<int, OOX::Spreadsheet::CFont*>::iterator pFind = xlsx_styles->m_oFonts->m_mapFonts.find(font_id);
if (pFind != xlsx_styles->m_oFonts->m_mapFonts.end())
@ -2420,8 +2419,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CXfs * xfc_style, int oox_id, bool
convert(pFind->second, text_properties);
}
}
bool bApplyFill = xfc_style->m_oApplyFill.IsInit() ? xfc_style->m_oApplyFill->ToBool() : true;
if (xlsx_styles->m_oFills.IsInit() && fill_id >= 0 && (id_parent < 0 || bApplyFill))
if (xlsx_styles->m_oFills.IsInit() && fill_id >= 0 && (id_parent < 0 || xfc_style->m_oApplyFill.IsInit()))
{
std::map<int, OOX::Spreadsheet::CFill*>::iterator pFind = xlsx_styles->m_oFills->m_mapFills.find(fill_id);
if (pFind != xlsx_styles->m_oFills->m_mapFills.end())
@ -2429,14 +2427,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CXfs * xfc_style, int oox_id, bool
convert(pFind->second, table_cell_properties);
}
}
bool bApplyNumberFormat = xfc_style->m_oApplyNumberFormat.IsInit() ? xfc_style->m_oApplyNumberFormat->ToBool() : true;
if (numFmt_id >= 0 && (id_parent < 0 || bApplyNumberFormat))
if (numFmt_id >= 0/* && (id_parent < 0 || xfc_style->m_oApplyNumberFormat.IsInit())*/)
{
ods_context->styles_context()->last_state()->set_data_style_name(ods_context->numbers_styles_context()->add_or_find(numFmt_id).style_name);
ods_context->styles_context()->last_state()->set_number_format(numFmt_id);
}
bool bApplyBorder = xfc_style->m_oApplyBorder.IsInit() ? xfc_style->m_oApplyBorder->ToBool() : true;
if (xlsx_styles->m_oBorders.IsInit() && border_id >=0 && (id_parent < 0 || bApplyBorder))
if (xlsx_styles->m_oBorders.IsInit() && border_id >=0 && (id_parent < 0 || xfc_style->m_oApplyBorder.IsInit()))
{
std::map<int, OOX::Spreadsheet::CBorder*>::iterator pFind = xlsx_styles->m_oBorders->m_mapBorders.find(border_id);
if (pFind != xlsx_styles->m_oBorders->m_mapBorders.end())

View File

@ -1018,8 +1018,8 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
//применяем default
oNewProperty = oParam.oRtf->m_oDefaultCharProp;
//применяем внешний стиль (часть свойств не наследуется!!)
oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty, false );
//применяем внешний стиль
oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty );
oNewProperty.Merge( m_oCharProperty );
if( NULL != poStyle && TYPE_RTF_PROPERTY_STYLE_CHAR == poStyle->GetType() )

View File

@ -1142,12 +1142,13 @@ public:
m_pOldCharProp = RtfCharPropertyPtr();
}
void Merge( RtfCharProperty& oCharPr, bool bAll = true )
void Merge( RtfCharProperty& oCharPr )
{
MERGE_PROPERTY( m_nAnimated, oCharPr )
MERGE_PROPERTY( m_bBold, oCharPr )
MERGE_PROPERTY( m_bCaps, oCharPr )
MERGE_PROPERTY( m_nScalex, oCharPr )
MERGE_PROPERTY( m_nCharStyle, oCharPr )
MERGE_PROPERTY( m_nDown, oCharPr )
MERGE_PROPERTY( m_bEmbo, oCharPr )
MERGE_PROPERTY( m_nCharacterSpacing, oCharPr )
@ -1165,9 +1166,12 @@ public:
MERGE_PROPERTY( m_bOutline, oCharPr )
MERGE_PROPERTY( m_bScaps, oCharPr )
MERGE_PROPERTY( m_bShadow, oCharPr )
MERGE_PROPERTY( m_bStrike, oCharPr )
MERGE_PROPERTY( m_nStriked, oCharPr )
MERGE_PROPERTY( m_bSub, oCharPr )
MERGE_PROPERTY( m_bSuper, oCharPr )
MERGE_PROPERTY( m_bHidden, oCharPr )
MERGE_PROPERTY( m_nHightlited, oCharPr )
MERGE_PROPERTY( m_nForeColor, oCharPr )
MERGE_PROPERTY( m_nCrAuth, oCharPr )
MERGE_PROPERTY( m_nCrDate, oCharPr )
@ -1179,18 +1183,11 @@ public:
MERGE_PROPERTY( m_nRevdttmDel, oCharPr )
MERGE_PROPERTY( m_nInsrsid, oCharPr )
if (bAll)
//свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком
if ( uls_none != oCharPr.m_eUnderStyle || PROP_DEF != oCharPr.m_nUnderlineColor )
{
MERGE_PROPERTY( m_nCharStyle, oCharPr )
MERGE_PROPERTY( m_bStrike, oCharPr )
MERGE_PROPERTY( m_nStriked, oCharPr )
MERGE_PROPERTY( m_nHightlited, oCharPr )
//свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком
if ( uls_none != oCharPr.m_eUnderStyle || PROP_DEF != oCharPr.m_nUnderlineColor )
{
m_eUnderStyle = oCharPr.m_eUnderStyle;
m_nUnderlineColor = oCharPr.m_nUnderlineColor;
}
m_eUnderStyle = oCharPr.m_eUnderStyle;
m_nUnderlineColor = oCharPr.m_nUnderlineColor;
}
MERGE_PROPERTY_DEF ( m_bSub, oCharPr, uls_none )
MERGE_PROPERTY ( m_nUp, oCharPr )

View File

@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/xml/build/vs2005;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS;DONT_USED_EXTRA_LIBRARY"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"

View File

@ -37,8 +37,7 @@ namespace XLS
Row::Row()
{
iOutLevel = 0;
ixfe_val = 0;
iOutLevel = ixfe_val = 0;
}
@ -87,10 +86,6 @@ int Row::serialize(std::wostream &stream)
bool xf_set = true;
if (fGhostDirty == false) xf_set = false;
if (colMic >= 0 && colMac > colMic)
{
CP_XML_ATTR(L"spans", std::to_wstring(colMic + 1) + L":" + std::to_wstring(colMac));
}
if (xf_set)
{
int xf = ixfe_val >= global_info_->cellStyleXfs_count ? ixfe_val - global_info_->cellStyleXfs_count : -1/*ixfe_val*/;
@ -101,7 +96,7 @@ int Row::serialize(std::wostream &stream)
CP_XML_ATTR(L"customFormat", true);
}
}
if (miyRw > 0 && miyRw < 0x8000 && fUnsynced/* && std::abs(miyRw/20. - sheet_info.defaultRowHeight) > 0.01*/)
if (miyRw > 0/* && std::abs(miyRw/20. - sheet_info.defaultRowHeight) > 0.01*/)
{
CP_XML_ATTR(L"ht", miyRw / 20.);
CP_XML_ATTR(L"customHeight", true);

View File

@ -56,11 +56,8 @@ public:
//-----------------------------
Rw rw;
//BackwardOnlyParam<unsigned short> colMic;
//BackwardOnlyParam<unsigned short> colMac;
unsigned short colMic;
unsigned short colMac;
BackwardOnlyParam<unsigned short> colMic;
BackwardOnlyParam<unsigned short> colMac;
_UINT16 miyRw;

View File

@ -236,10 +236,6 @@ int CELLTABLE::serialize(std::wostream & stream)
bool xf_set = true;
if (row->fGhostDirty == false) xf_set = false;
if (row->colMic >= 0 && row->colMac > row->colMic)
{
CP_XML_ATTR(L"spans", std::to_wstring(row->colMic + 1) + L":" + std::to_wstring(row->colMac)); //zero based & one based
}
if (xf_set)
{
int xf = row->ixfe_val >= global_info_->cellStyleXfs_count ? row->ixfe_val - global_info_->cellStyleXfs_count : -1/*row->ixfe_val*/;
@ -250,7 +246,7 @@ int CELLTABLE::serialize(std::wostream & stream)
CP_XML_ATTR(L"customFormat", true);
}
}
if (row->miyRw > 0 && row->miyRw < 0x8000 && row->fUnsynced) //v8_14A_1b13.xls //Department_Sales_and_Stock_Monthly_Recap_Store_778_2019-09-03.xls
if (row->miyRw > 0 && row->miyRw < 0x8000) //v8_14A_1b13.xls
{
CP_XML_ATTR(L"ht", row->miyRw / 20.);
CP_XML_ATTR(L"customHeight", true);

View File

@ -57,7 +57,7 @@ for %%a in (%BUILD_PLATFORMS%) do (
if exist "icu" (
echo "icu already exported"
) else (
svn export https://github.com/unicode-org/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
svn export http://source.icu-project.org/repos/icu/tags/release-%ICU_MAJOR_VER%-%ICU_MINOR_VER%/icu4c ./icu
)
if "%%a" == "win_64" (

View File

@ -54,7 +54,7 @@ if [ -d "./icu" ]
then
echo "icu already exported"
else
svn export https://github.com/unicode-org/icu/tags/release-$ICU_MAJOR_VER-$ICU_MINOR_VER/icu4c ./icu
svn export http://source.icu-project.org/repos/icu/tags/release-$ICU_MAJOR_VER-$ICU_MINOR_VER/icu4c ./icu
fi
if [[ "$platform" == *"linux"* ]]

View File

@ -45,4 +45,4 @@ fi
cd "$SCRIPTPATH/$platform$arch"
svn export https://github.com/unicode-org/icu/tags/release-$ICU_MAJOR_VER-$ICU_MINOR_VER/icu4c ./icu
svn export http://source.icu-project.org/repos/icu/tags/release-$ICU_MAJOR_VER-$ICU_MINOR_VER/icu4c ./icu

View File

@ -20,7 +20,12 @@ core_windows {
}
core_linux {
LIBS += -L$$CORE_V8_PATH_LIBS -lv8_base -lv8_libplatform -lv8_libbase -lv8_snapshot -lv8_libsampler
SNAPSHOT_LIB=v8_snapshot
!exists($$CORE_V8_PATH_LIBS/libv8_snapshot.a) {
SNAPSHOT_LIB=v8_nosnapshot
}
LIBS += -L$$CORE_V8_PATH_LIBS -lv8_base -lv8_libplatform -lv8_libbase -l$$SNAPSHOT_LIB -lv8_libsampler
LIBS += -L$$CORE_V8_PATH_LIBS/third_party/icu -licui18n -licuuc
}

View File

@ -338,10 +338,6 @@ namespace SimpleTypes
SimpleType_Operator_Equal (CGuid)
bool IsZero()
{
return 0 == m_oGUID.a && 0 == m_oGUID.b && 0 == m_oGUID.c && 0 == m_oGUID.d && 0 == m_oGUID.e && 0 == m_oGUID.f && 0 == m_oGUID.g && 0 == m_oGUID.h && 0 == m_oGUID.i && 0 == m_oGUID.j && 0 == m_oGUID.k;
}
private:
bool HexToInt(std::wstring& sValue, T_ULONG64& unResult)

View File

@ -311,7 +311,7 @@ namespace XmlUtils
// CoTaskMemFree(guidString);
//#else
std::wstringstream sstream;
sstream << boost::wformat(L"%04X%04X-%04X-%04X-%04X-%04X%04X%04X") % (Rand() & 0xff) % (Rand() & 0xff) % (Rand() & 0xff) % ((Rand() & 0x0fff) | 0x4000) % ((Rand() % 0x3fff) + 0x8000) % (Rand() & 0xff) % (Rand() & 0xff) % (Rand() & 0xff);
sstream << boost::wformat(L"%04X%04X-%04X-%04X-%04X-%04X%04X%04X") % Rand() % Rand() % Rand() % ((Rand() & 0x0fff) | 0x4000) % ((Rand() % 0x3fff) + 0x8000) % Rand() % Rand() % Rand();
result = sstream.str();
//#endif
return result;

View File

@ -463,12 +463,6 @@ namespace OOX
WritingElement_ReadAttributes_End( oReader )
//todo IsZero() is added to fix comments with zero ids(5.4.0)(bug 42947). Remove after few releases
if(id.IsInit() && id->IsZero())
{
id = L"{" + XmlUtils::GenerateGuid() + L"}";
}
}
public:
nullable_string ref;
@ -586,38 +580,16 @@ namespace OOX
m_mapTopLevelThreadedComments[pThreadedComment->id->ToString()] = pThreadedComment;
}
}
//to remove reply duplicates
std::unordered_map<std::wstring, bool> mapUniqueue;
//add Replies
for(size_t i = 0; i < m_arrItems.size(); ++i)
{
CThreadedComment* pThreadedComment = m_arrItems[i];
if(pThreadedComment->parentId.IsInit())
{
//todo IsZero() is added to fix comments with zero ids(5.4.0)(bug 42947). Remove after few releases
if(pThreadedComment->parentId->IsZero() && pThreadedComment->ref.IsInit())
std::unordered_map<std::wstring, CThreadedComment*>::const_iterator oFind = m_mapTopLevelThreadedComments.find(pThreadedComment->parentId->ToString());
if(m_mapTopLevelThreadedComments.end() != oFind)
{
if (pThreadedComment->dT.IsInit() && mapUniqueue.find(pThreadedComment->dT->ToString()) == mapUniqueue.end())
{
mapUniqueue[pThreadedComment->dT->ToString()] = true;
//find parents by ref
for (std::unordered_map<std::wstring, CThreadedComment*>::const_iterator it = m_mapTopLevelThreadedComments.begin(); it != m_mapTopLevelThreadedComments.end(); ++it)
{
if (it->second->ref.IsInit() && pThreadedComment->ref.get() == it->second->ref.get())
{
it->second->m_arrReplies.push_back(pThreadedComment);
break;
}
}
}
}
else
{
std::unordered_map<std::wstring, CThreadedComment*>::const_iterator oFind = m_mapTopLevelThreadedComments.find(pThreadedComment->parentId->ToString());
if(m_mapTopLevelThreadedComments.end() != oFind)
{
oFind->second->m_arrReplies.push_back(pThreadedComment);
}
oFind->second->m_arrReplies.push_back(pThreadedComment);
}
}
}

View File

@ -38,7 +38,6 @@ namespace OOX
namespace SpreadsheetCommon
{
std::wstring WriteDouble(double dVal);
const int MAX_STRING_LEN = 0x7FFF;
}
}
}

View File

@ -73,13 +73,13 @@ void CDataValidation::toXML2(NSStringUtils::CStringBuilder& writer, bool bExtend
}
WritingStringNullableAttrString (L"type", m_oType, m_oType->ToString());
WritingStringNullableAttrInt (L"allowBlank", m_oAllowBlank, m_oAllowBlank->GetValue());
WritingStringNullableAttrEncodeXmlString (L"error", m_oError, m_oError.get());
WritingStringNullableAttrEncodeXmlStringHHHH(L"error", m_oError, m_oError.get());
WritingStringNullableAttrString (L"errorStyle", m_oErrorStyle, m_oErrorStyle->ToString());
WritingStringNullableAttrEncodeXmlString (L"errorTitle", m_oErrorTitle, m_oErrorTitle.get());
WritingStringNullableAttrEncodeXmlStringHHHH(L"errorTitle", m_oErrorTitle, m_oErrorTitle.get());
WritingStringNullableAttrString (L"imeMode", m_oImeMode, m_oImeMode->ToString());
WritingStringNullableAttrString (L"operator", m_oOperator, m_oOperator->ToString());
WritingStringNullableAttrEncodeXmlString (L"prompt", m_oPrompt, m_oPrompt.get());
WritingStringNullableAttrEncodeXmlString (L"promptTitle", m_oPromptTitle, m_oPromptTitle.get());
WritingStringNullableAttrEncodeXmlStringHHHH(L"prompt", m_oPrompt, m_oPrompt.get());
WritingStringNullableAttrEncodeXmlStringHHHH(L"promptTitle", m_oPromptTitle, m_oPromptTitle.get());
WritingStringNullableAttrInt (L"showDropDown", m_oShowDropDown, m_oShowDropDown->GetValue());
WritingStringNullableAttrInt (L"showErrorMessage",m_oShowErrorMessage,m_oShowErrorMessage->GetValue());
WritingStringNullableAttrInt (L"showInputMessage",m_oShowInputMessage,m_oShowInputMessage->GetValue());
@ -164,21 +164,34 @@ bool CDataValidation::IsExtended()
}
void CDataValidation::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("allowBlank"), m_oAllowBlank)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("error"), m_oError)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("errorStyle"), m_oErrorStyle)
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("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)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("showInputMessage"),m_oShowInputMessage)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("sqref"), m_oSqRef)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("type"), m_oType)
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_StartChar( oReader )
WritingElement_ReadAttributes_Read_ifChar ( oReader, "allowBlank", m_oAllowBlank)
else if ( strcmp("error", wsName) == 0 )
{
m_oError = oReader.GetAttributeTextWithHHHH();
}
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "errorStyle", m_oErrorStyle)
else if ( strcmp("errorTitle", wsName) == 0 )
{
m_oErrorTitle = oReader.GetAttributeTextWithHHHH();
}
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "imeMode", m_oImeMode)
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "operator", m_oOperator)
else if ( strcmp("prompt", wsName) == 0 )
{
m_oPrompt = oReader.GetAttributeTextWithHHHH();
}
else if ( strcmp("promptTitle", wsName) == 0 )
{
m_oPromptTitle = oReader.GetAttributeTextWithHHHH();
}
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "showDropDown", m_oShowDropDown)
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "showErrorMessage",m_oShowErrorMessage)
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "showInputMessage",m_oShowInputMessage)
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "sqref", m_oSqRef)
WritingElement_ReadAttributes_Read_else_ifChar ( oReader, "type", m_oType)
WritingElement_ReadAttributes_EndChar( oReader )
}
void CDataValidations::toXML(NSStringUtils::CStringBuilder& writer) const
{

View File

@ -280,22 +280,7 @@ namespace OOX
if(pComment->m_oUid.IsInit())
{
//todo IsZero() is added to fix comments with zero ids(5.4.0)(bug 42947). Remove after few releases
if(pComment->m_oUid->IsZero() && pComment->m_oRef.IsInit())
{
for (std::unordered_map<std::wstring, CThreadedComment*>::iterator it = pThreadedComments->m_mapTopLevelThreadedComments.begin(); it != pThreadedComments->m_mapTopLevelThreadedComments.end(); ++it)
{
if (it->second->ref.IsInit() && pComment->m_oRef->GetValue() == it->second->ref.get())
{
pFind = it;
break;
}
}
}
else
{
pFind = pThreadedComments->m_mapTopLevelThreadedComments.find(pComment->m_oUid->ToString());
}
pFind = pThreadedComments->m_mapTopLevelThreadedComments.find(pComment->m_oUid->ToString());
}
else if(pComment->m_oAuthorId.IsInit())
{

View File

@ -97,6 +97,8 @@ namespace Spreadsheet
WritingStringNullableAttr(name, WriteString, elem, val)
#define WritingStringNullableAttrEncodeXmlString(name, elem, val) \
WritingStringNullableAttr(name, WriteEncodeXmlString, elem, val)
#define WritingStringNullableAttrEncodeXmlStringHHHH(name, elem, val) \
WritingStringNullableAttr(name, WriteEncodeXmlStringHHHH, elem, val)
#define WritingStringNullableAttrInt(name, elem, val) \
WritingStringNullableAttr(name, AddInt, elem, val)
#define WritingStringNullableAttrInt64(name, elem, val) \

View File

@ -36,4 +36,5 @@
- (BOOL)copyFolderAtPath:(NSString *)sourceFolder toDestinationFolderAtPath:(NSString*)destinationFolder;
- (NSString*)createTemporaryDirectory;
- (void)createDirectory:(NSString*)directory;
- (NSString*)createCacheDirectory:(NSString*)prefix;
@end

View File

@ -56,6 +56,7 @@
return YES;
}
- (NSString*)createTemporaryDirectory {
NSError *error = nil;
@ -77,4 +78,24 @@
}
}
- (NSString*)createCacheDirectory:(NSString*)prefix {
NSError *error = nil;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
if (paths) {
NSString *cacheDirectory = [paths objectAtIndex:0];
if (cacheDirectory) {
NSString* path = [NSString stringWithFormat:@"%@/%@", cacheDirectory, prefix];
if(![self createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error])
{
NSLog(@"Could not creat temp path %@. error %@", path, error);
return @"";
}
return path;
}
}
return @"";
}
@end

View File

@ -126,9 +126,9 @@ public:
m_isolate_locker = new v8::Locker(m_isolate);
m_handle_scope = new CScopeWrapper<v8::HandleScope>(m_isolate);
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
global->Set(v8::String::NewFromUtf8(m_isolate, "CreateNativeEngine"), v8::FunctionTemplate::New(m_isolate, CreateNativeObjectBuilder));
global->Set(v8::String::NewFromUtf8(m_isolate, "CreateNativeMemoryStream"), v8::FunctionTemplate::New(m_isolate, CreateNativeMemoryStream));
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(m_isolate);
global->Set(m_isolate, "CreateNativeEngine", v8::FunctionTemplate::New(m_isolate, CreateNativeObjectBuilder));
global->Set(m_isolate, "CreateNativeMemoryStream", v8::FunctionTemplate::New(m_isolate, CreateNativeMemoryStream));
m_context = v8::Context::New(m_isolate, NULL, global);
}
@ -166,17 +166,17 @@ public:
v8::Context::Scope context_scope(m_context);
v8::TryCatch try_catch;
v8::TryCatch try_catch(m_isolate);
v8::Local<v8::String> source = v8::String::NewFromUtf8(m_isolate, commandA.c_str());
v8::Local<v8::Script> script = v8::Script::Compile(source);
v8::Local<v8::Script> script = v8::Script::Compile(m_context, source).FromMaybe(v8::Local<v8::Script>());
LOGGER_SPEED_LAP("compile_command")
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"execute_compile_code", strCode);
_LOGGING_ERROR_(L"execute_compile", strException);
@ -185,12 +185,12 @@ public:
}
else
{
v8::Local<v8::Value> retNativeVal = script->Run();
v8::Local<v8::Value> retNativeVal = script->Run(m_context).FromMaybe(v8::Local<v8::Value>());
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"execute_run_code", strCode);
_LOGGING_ERROR_(L"execute_run", strException);
@ -217,17 +217,17 @@ public:
v8::Context::Scope context_scope(m_context);
v8::TryCatch try_catch;
v8::TryCatch try_catch(m_isolate);
v8::Local<v8::String> source = v8::String::NewFromUtf8(m_isolate, commandA.c_str());
v8::Local<v8::Script> script = v8::Script::Compile(source);
v8::Local<v8::Script> script = v8::Script::Compile(m_context, source).FromMaybe(v8::Local<v8::Script>());
std::string sReturn = "{}";
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"execute_compile_code", strCode);
_LOGGING_ERROR_(L"execute_compile", strException);
@ -236,12 +236,12 @@ public:
}
else
{
v8::Local<v8::Value> _value = script->Run();
v8::Local<v8::Value> _value = script->Run(m_context).FromMaybe(v8::Local<v8::Value>());
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"execute_run_code", strCode);
_LOGGING_ERROR_(L"execute_run", strException);
@ -250,7 +250,7 @@ public:
}
if (_value->IsString())
sReturn = to_cstringA(_value);
sReturn = CV8Convert::ToStringA(_value);
}
return sReturn;
@ -264,15 +264,15 @@ public:
v8::Context::Scope context_scope(m_context);
v8::TryCatch try_catch;
v8::TryCatch try_catch(m_isolate);
v8::Local<v8::String> source = v8::String::NewFromUtf8(m_isolate, commandA.c_str());
v8::Local<v8::Script> script = v8::Script::Compile(source);
v8::Local<v8::Script> script = v8::Script::Compile(m_context, source).FromMaybe(v8::Local<v8::Script>());
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"execute_compile_code", strCode);
_LOGGING_ERROR_(L"execute_compile", strException);
@ -281,12 +281,12 @@ public:
}
else
{
v8::Local<v8::Value> _value = script->Run();
v8::Local<v8::Value> _value = script->Run(m_context).FromMaybe(v8::Local<v8::Value>());
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"execute_run_code", strCode);
_LOGGING_ERROR_(L"execute_run", strException);
@ -295,7 +295,7 @@ public:
}
if (_value->IsString())
return to_cstring(_value);
return CV8Convert::ToString(_value);
}
return L"jsValue(" + sParam + L")";
@ -307,14 +307,14 @@ public:
v8::Context::Scope context_scope(m_context);
v8::TryCatch try_catch;
v8::TryCatch try_catch(m_isolate);
v8::Local<v8::String> source = v8::String::NewFromUtf8(m_isolate, sString.c_str());
v8::Local<v8::Script> script;
CCacheDataScript oCachedScript(sCachePath);
if (sCachePath.empty())
script = v8::Script::Compile(source);
script = v8::Script::Compile(m_context, source).FromMaybe(v8::Local<v8::Script>());
else
{
script = oCachedScript.Compile(m_context, source);
@ -324,8 +324,8 @@ public:
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"sdk_compile_code", strCode);
_LOGGING_ERROR_(L"sdk_compile", strException);
@ -334,12 +334,12 @@ public:
}
else
{
script->Run();
script->Run(m_context);
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"sdk_run_code", strCode);
_LOGGING_ERROR_(L"sdk_run", strException);
@ -359,13 +359,13 @@ public:
std::string sArgument = "var Argument = JSON.parse(\"" + sArg + "\");";
v8::Local<v8::String> _sourceArg = v8::String::NewFromUtf8(m_isolate, sArgument.c_str());
v8::Local<v8::Script> _scriptArg = v8::Script::Compile(_sourceArg);
_scriptArg->Run();
v8::Local<v8::Script> _scriptArg = v8::Script::Compile(m_context, _sourceArg).FromMaybe(v8::Local<v8::Script>());
_scriptArg->Run(m_context);
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"sdk_argument_code", strCode);
_LOGGING_ERROR_(L"sdk_argument", strException);
@ -385,13 +385,13 @@ public:
std::string sScriptVar = "var GlobalVariable = JSON.parse(\"" + sArg + "\");";
v8::Local<v8::String> _sourceArg = v8::String::NewFromUtf8(m_isolate, sScriptVar.c_str());
v8::Local<v8::Script> _scriptArg = v8::Script::Compile(_sourceArg);
_scriptArg->Run();
v8::Local<v8::Script> _scriptArg = v8::Script::Compile(m_context, _sourceArg).FromMaybe(v8::Local<v8::Script>());
_scriptArg->Run(m_context);
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"sdk_global_var_code", strCode);
_LOGGING_ERROR_(L"sdk_global_var", strException);
@ -419,8 +419,8 @@ public:
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"run_code", strCode);
_LOGGING_ERROR_(L"run", strException);
@ -488,8 +488,8 @@ public:
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"open_code", strCode);
_LOGGING_ERROR_(L"open", strException);
@ -520,7 +520,7 @@ public:
_formatDst = NSDoctRenderer::DoctRendererFormat::PDF;
v8::Context::Scope context_scope(m_context);
v8::TryCatch try_catch;
v8::TryCatch try_catch(m_isolate);
CNativeControl* pNative = NULL;
@ -540,8 +540,8 @@ public:
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"run_code", strCode);
_LOGGING_ERROR_(L"run", strException);
@ -657,19 +657,19 @@ namespace NSDoctRenderer
{
if (m_internal->m_value.IsEmpty() || !m_internal->m_value->IsInt32())
return 0;
return m_internal->m_value->ToInt32()->Value();
return CV8Convert::ToInt(m_internal->m_value);
}
double CDocBuilderValue::ToDouble()
{
if (m_internal->m_value.IsEmpty() || !m_internal->m_value->IsNumber())
return 0;
return m_internal->m_value->ToNumber()->Value();
return CV8Convert::ToDouble(m_internal->m_value);
}
wchar_t* CDocBuilderValue::ToString()
{
if (m_internal->m_value.IsEmpty() || !m_internal->m_value->IsString())
return NULL;
std::wstring sValue = to_cstring(m_internal->m_value);
std::wstring sValue = CV8Convert::ToString(m_internal->m_value);
if (sValue.empty())
return NULL;
size_t len = sValue.length();

View File

@ -460,8 +460,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"save_code", strCode);
_LOGGING_ERROR_(L"save", strException);
@ -509,8 +509,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"save_code", strCode);
_LOGGING_ERROR_(L"save", strException);
@ -520,7 +520,7 @@ namespace NSDoctRenderer
}
else
{
std::string sHTML_Utf8 = to_cstringA(js_result2);
std::string sHTML_Utf8 = CV8Convert::ToStringA(js_result2);
NSFile::CFileBinary oFile;
if (true == oFile.CreateFileW(pParams->m_strDstFilePath))
@ -546,8 +546,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"calculate_code", strCode);
_LOGGING_ERROR_(L"calculate", strException);
@ -570,8 +570,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"calculate_code", strCode);
_LOGGING_ERROR_(L"calculate", strException);
@ -581,8 +581,7 @@ namespace NSDoctRenderer
}
else
{
v8::Local<v8::Int32> intValue = js_result1->ToInt32();
lPagesCount = (LONG)intValue->Value();
lPagesCount = (LONG)CV8Convert::ToInt(js_result1);
}
}
}
@ -603,8 +602,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"save_code", strCode);
_LOGGING_ERROR_(L"save", strException);
@ -667,8 +666,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"save_code", strCode);
_LOGGING_ERROR_(L"save", strException);
@ -682,8 +681,8 @@ namespace NSDoctRenderer
{
v8::Local<v8::Object> objNative = js_result2->ToObject();
v8::Local<v8::Uint8Array> pArray = v8::Local<v8::Uint8Array>::Cast(objNative->Get(v8::String::NewFromUtf8(isolate, "data")));
std::wstring sThemeName = to_cstring(objNative->Get(v8::String::NewFromUtf8(isolate, "name")));
int nDataLen = objNative->Get(v8::String::NewFromUtf8(isolate, "dataLen"))->ToInt32()->Value();
std::wstring sThemeName = CV8Convert::ToString(objNative->Get(v8::String::NewFromUtf8(isolate, "name")));
int nDataLen = CV8Convert::ToInt(objNative->Get(v8::String::NewFromUtf8(isolate, "dataLen")));
if (sThemeName.empty())
sThemeName = L"Default";
@ -720,14 +719,14 @@ namespace NSDoctRenderer
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
global->Set(v8::String::NewFromUtf8(isolate, "CreateNativeEngine"), v8::FunctionTemplate::New(isolate, CreateNativeObject));
global->Set(v8::String::NewFromUtf8(isolate, "CreateNativeMemoryStream"), v8::FunctionTemplate::New(isolate, CreateNativeMemoryStream));
v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
global->Set(isolate, "CreateNativeEngine", v8::FunctionTemplate::New(isolate, CreateNativeObject));
global->Set(isolate, "CreateNativeMemoryStream", v8::FunctionTemplate::New(isolate, CreateNativeMemoryStream));
v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
v8::Context::Scope context_scope(context);
v8::TryCatch try_catch;
v8::TryCatch try_catch(isolate);
v8::Local<v8::String> source = v8::String::NewFromUtf8(isolate, strScript.c_str());
v8::Local<v8::Script> script;
@ -735,7 +734,7 @@ namespace NSDoctRenderer
CCacheDataScript oCachedScript(sCachePath);
if (sCachePath.empty())
script = v8::Script::Compile(source);
script = v8::Script::Compile(context, source).FromMaybe(v8::Local<v8::Script>());
else
{
script = oCachedScript.Compile(context, source);
@ -746,8 +745,8 @@ namespace NSDoctRenderer
// COMPILE
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"compile_code", strCode);
_LOGGING_ERROR_(L"compile", strException);
@ -759,12 +758,12 @@ namespace NSDoctRenderer
// RUN
if (!bIsBreak)
{
v8::Local<v8::Value> result = script->Run();
v8::Local<v8::Value> result = script->Run(context).FromMaybe(v8::Local<v8::Value>());
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"run_code", strCode);
_LOGGING_ERROR_(L"run", strException);
@ -780,8 +779,8 @@ namespace NSDoctRenderer
{
v8::Local<v8::String> sourceParams = v8::String::NewFromUtf8(isolate,
"(function(){ if (window && window.SetDoctRendererParams) {window.SetDoctRendererParams({retina:true});} })();");
v8::Local<v8::Script> scriptParams = v8::Script::Compile(sourceParams);
scriptParams->Run();
v8::Local<v8::Script> scriptParams = v8::Script::Compile(context, sourceParams).FromMaybe(v8::Local<v8::Script>());
scriptParams->Run(context);
}
//---------------------------------------------------------------
@ -803,8 +802,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"run_code", strCode);
_LOGGING_ERROR_(L"run", strException);
@ -867,8 +866,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"open_code", strCode);
_LOGGING_ERROR_(L"open", strException);
@ -913,8 +912,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"change_code", strCode);
_LOGGING_ERROR_(L"change", strException);
@ -993,12 +992,12 @@ namespace NSDoctRenderer
v8::Handle<v8::Function> func_mm_start = v8::Handle<v8::Function>::Cast(js_func_mm_start);
v8::Handle<v8::Value> args_changes[1];
args_changes[0] = v8::JSON::Parse(v8::String::NewFromUtf8(isolate, (char*)(pBaseData + nStart)));
args_changes[0] = v8::JSON::Parse(context, v8::String::NewFromUtf8(isolate, (char*)(pBaseData + nStart))).FromMaybe(v8::Local<v8::Value>());
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"change_code", strCode);
_LOGGING_ERROR_(L"change", strException);
@ -1013,8 +1012,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"change_code", strCode);
_LOGGING_ERROR_(L"change", strException);
@ -1051,8 +1050,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"change_code", strCode);
_LOGGING_ERROR_(L"change", strException);
@ -1091,8 +1090,8 @@ namespace NSDoctRenderer
if (try_catch.HasCaught())
{
std::wstring strCode = to_cstring(try_catch.Message()->GetSourceLine());
std::wstring strException = to_cstring(try_catch.Message()->Get());
std::wstring strCode = CV8Convert::GetSourceLine(try_catch.Message());
std::wstring strException = CV8Convert::GetMessage(try_catch.Message());
_LOGGING_ERROR_(L"change_code", strCode);
_LOGGING_ERROR_(L"change", strException);
@ -1101,7 +1100,7 @@ namespace NSDoctRenderer
bIsBreak = true;
}
std::wstring sField = to_cstring(js_result2);
std::wstring sField = CV8Convert::ToString(js_result2);
NSDoctRenderer::replace_for_xml(sField);
NSDoctRenderer::replace_for_xml(sSaveFile);

View File

@ -42,7 +42,7 @@ void _ms_write_byte(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CMemoryStream* pNative = unwrap_memorystream(args.This());
BYTE arg = (BYTE)args[0]->ToInt32()->Value();
BYTE arg = (BYTE)CV8Convert::ToInt(args[0]);
pNative->WriteBYTE(arg);
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
@ -51,7 +51,7 @@ void _ms_write_bool(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CMemoryStream* pNative = unwrap_memorystream(args.This());
BYTE arg = (BYTE)args[0]->BooleanValue();
BYTE arg = (BYTE)CV8Convert::ToBool(args[0]);
pNative->WriteBYTE(arg ? 1 : 0);
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
@ -60,7 +60,7 @@ void _ms_write_long(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CMemoryStream* pNative = unwrap_memorystream(args.This());
LONG arg = (LONG)args[0]->ToInt32()->Value();
LONG arg = (LONG)CV8Convert::ToInt(args[0]);
pNative->WriteLONG(arg);
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
@ -69,7 +69,7 @@ void _ms_write_double(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CMemoryStream* pNative = unwrap_memorystream(args.This());
double arg = args[0]->ToNumber()->Value();
double arg = CV8Convert::ToDouble(args[0]);
pNative->WriteLONG((LONG)(arg * 100000));
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
@ -78,14 +78,14 @@ void _ms_write_double(const v8::FunctionCallbackInfo<v8::Value>& args)
void _ms_writestring1(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CMemoryStream* pNative = unwrap_memorystream(args.This());
v8::String::Value data(args[0]);
v8::String::Value data(ISOLATE_IF_7 args[0]);
pNative->WriteString((wchar_t*)*data, data.length());
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
}
void _ms_writestring2(const v8::FunctionCallbackInfo<v8::Value>& args)
{
CMemoryStream* pNative = unwrap_memorystream(args.This());
v8::String::Value data(args[0]);
v8::String::Value data(ISOLATE_IF_7 args[0]);
pNative->WriteString2((wchar_t*)*data, data.length());
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
}
@ -95,8 +95,8 @@ void _ms_copy(const v8::FunctionCallbackInfo<v8::Value>& args)
CMemoryStream* pNative = unwrap_memorystream(args.This());
CMemoryStream* pNative2 = unwrap_memorystream(args[0]->ToObject());
size_t pos = (size_t)args[1]->ToUint32()->Value();
size_t len = (size_t)args[2]->ToUint32()->Value();
size_t pos = (size_t)CV8Convert::ToUint(args[1]);
size_t len = (size_t)CV8Convert::ToUint(args[2]);
pNative->Copy(pNative2, pos, len);
@ -120,7 +120,7 @@ v8::Handle<v8::ObjectTemplate> CreateMemoryStreamTemplate(v8::Isolate* isolate)
{
//v8::HandleScope handle_scope(isolate);
v8::Local<v8::ObjectTemplate> result = v8::ObjectTemplate::New();
v8::Local<v8::ObjectTemplate> result = v8::ObjectTemplate::New(isolate);
result->SetInternalFieldCount(1); // отводим в нем место для хранения CNativeControl
v8::Isolate* current = v8::Isolate::GetCurrent();
@ -129,14 +129,14 @@ v8::Handle<v8::ObjectTemplate> CreateMemoryStreamTemplate(v8::Isolate* isolate)
result->SetAccessor(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "pos"), _ms_pos); // получить код ошибки
// прописываем функции - методы объекта
result->Set(v8::String::NewFromUtf8(current, "Copy"), v8::FunctionTemplate::New(current, _ms_copy));
result->Set(v8::String::NewFromUtf8(current, "ClearNoAttack"), v8::FunctionTemplate::New(current, _ms_clearnoattack));
result->Set(v8::String::NewFromUtf8(current, "WriteByte"), v8::FunctionTemplate::New(current, _ms_write_byte));
result->Set(v8::String::NewFromUtf8(current, "WriteBool"), v8::FunctionTemplate::New(current, _ms_write_bool));
result->Set(v8::String::NewFromUtf8(current, "WriteLong"), v8::FunctionTemplate::New(current, _ms_write_long));
result->Set(v8::String::NewFromUtf8(current, "WriteDouble"), v8::FunctionTemplate::New(current, _ms_write_double));
result->Set(v8::String::NewFromUtf8(current, "WriteString"), v8::FunctionTemplate::New(current, _ms_writestring1));
result->Set(v8::String::NewFromUtf8(current, "WriteString2"), v8::FunctionTemplate::New(current, _ms_writestring2));
result->Set(current, "Copy", v8::FunctionTemplate::New(current, _ms_copy));
result->Set(current, "ClearNoAttack", v8::FunctionTemplate::New(current, _ms_clearnoattack));
result->Set(current, "WriteByte", v8::FunctionTemplate::New(current, _ms_write_byte));
result->Set(current, "WriteBool", v8::FunctionTemplate::New(current, _ms_write_bool));
result->Set(current, "WriteLong", v8::FunctionTemplate::New(current, _ms_write_long));
result->Set(current, "WriteDouble", v8::FunctionTemplate::New(current, _ms_write_double));
result->Set(current, "WriteString", v8::FunctionTemplate::New(current, _ms_writestring1));
result->Set(current, "WriteString2", v8::FunctionTemplate::New(current, _ms_writestring2));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope

View File

@ -39,6 +39,57 @@
#include "v8.h"
#include "libplatform/libplatform.h"
#if V8_MAJOR_VERSION < 7
#define ISOLATE_IF_7
#else
#define ISOLATE_IF_7 v8::Isolate::GetCurrent(),
#endif
class CV8Convert
{
public:
static int ToInt(const v8::Local<v8::Value>& v)
{
return v->ToInt32(v8::Isolate::GetCurrent()->GetCurrentContext()).FromMaybe(v8::Local<v8::Int32>())->Value();
}
static unsigned int ToUint(const v8::Local<v8::Value>& v)
{
return v->ToUint32(v8::Isolate::GetCurrent()->GetCurrentContext()).FromMaybe(v8::Local<v8::Uint32>())->Value();
}
static double ToDouble(const v8::Local<v8::Value>& v)
{
return v->ToNumber(v8::Isolate::GetCurrent()->GetCurrentContext()).FromMaybe(v8::Local<v8::Number>())->Value();
}
static bool ToBool(const v8::Local<v8::Value>& v)
{
return v->ToBoolean(v8::Isolate::GetCurrent()->GetCurrentContext()).FromMaybe(v8::Local<v8::Boolean>())->Value();
}
static std::wstring ToString(v8::Local<v8::Value> v)
{
v8::String::Utf8Value data(ISOLATE_IF_7 v);
if (NULL == *data)
return L"";
return NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)(*data), data.length());
}
static std::string ToStringA(v8::Local<v8::Value> v)
{
v8::String::Utf8Value data(ISOLATE_IF_7 v);
const char* p = (char*)*data;
if (NULL == p)
return "";
return std::string(p);
}
static std::wstring GetSourceLine(const v8::Local<v8::Message>& m)
{
return ToString(m->GetSourceLine(v8::Isolate::GetCurrent()->GetCurrentContext()).FromMaybe(v8::Local<v8::String>()));
}
static std::wstring GetMessage(const v8::Local<v8::Message>& m)
{
return ToString(m->Get());
}
};
class CMemoryStream
{
private:

View File

@ -31,24 +31,6 @@
*/
#include "nativecontrol.h"
std::wstring to_cstring(v8::Local<v8::Value> v)
{
v8::String::Utf8Value data(v);
if (NULL == *data)
return L"";
return NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)(*data), data.length());
}
std::string to_cstringA(v8::Local<v8::Value> v)
{
v8::String::Utf8Value data(v);
const char* p = (char*)*data;
if (NULL == p)
return "";
return std::string(p);
}
// wrap_methods -------------
CNativeControl* unwrap_nativeobject(v8::Handle<v8::Object> obj)
{
@ -70,7 +52,7 @@ void _SetFilePath(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
pNative->SetFilePath(to_cstring(args[0]));
pNative->SetFilePath(CV8Convert::ToString(args[0]));
}
void _GetFontsDirectory(const v8::FunctionCallbackInfo<v8::Value>& args)
@ -102,9 +84,8 @@ void _GetChangesFile(const v8::FunctionCallbackInfo<v8::Value>& args)
if (args.Length() < 1)
args.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent()));
v8::Local<v8::Int32> intValue = args[0]->ToInt32();
int nIndex = (int)intValue->Value();
int nIndex = CV8Convert::ToInt(args[0]);
std::string strFile = "";
if (pNative->m_pChanges != NULL)
@ -127,7 +108,7 @@ void _SetFileId(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
pNative->SetFileId(to_cstring(args[0]));
pNative->SetFileId(CV8Convert::ToString(args[0]));
}
void _CheckNextChange(const v8::FunctionCallbackInfo<v8::Value>& args)
@ -158,7 +139,7 @@ void _GetFileArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args)
BYTE* pData = NULL;
DWORD len = 0;
pNative->getFileData(to_cstring(args[0]), pData, len);
pNative->getFileData(CV8Convert::ToString(args[0]), pData, len);
v8::Local<v8::ArrayBuffer> _buffer = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), (void*)pData, (size_t)len);
v8::Local<v8::Uint8Array> _array = v8::Uint8Array::New(_buffer, 0, (size_t)len);
@ -184,7 +165,7 @@ void _GetFontArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args)
if (strDir.length() != 0)
{
strDir += L"/";
strDir += to_cstring(args[0]);
strDir += CV8Convert::ToString(args[0]);
}
else
#endif
@ -193,7 +174,7 @@ void _GetFontArrayBuffer(const v8::FunctionCallbackInfo<v8::Value>& args)
// по идее файлы могут совпадать по имени, но лежать в разных директориях.
// и поэтому в AllFonts.js надо бы писать пути полные.
// пока оставим по-старому
std::wstring sFind = to_cstring(args[0]);
std::wstring sFind = CV8Convert::ToString(args[0]);
bool bIsFullFilePath = (std::wstring::npos != sFind.find('\\') || std::wstring::npos != sFind.find('/'));
if (bIsFullFilePath)
{
@ -233,7 +214,7 @@ void _GetFileString(const v8::FunctionCallbackInfo<v8::Value>& args)
BYTE* pData = NULL;
DWORD len = 0;
pNative->getFileData(to_cstring(args[0]), pData, len);
pNative->getFileData(CV8Convert::ToString(args[0]), pData, len);
args.GetReturnValue().Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), (char*)pData, v8::String::kNormalString, len));
}
@ -245,8 +226,7 @@ void _Save_AllocNative(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
v8::Local<v8::Int32> intValue = args[0]->ToInt32();
int nLen = (int)intValue->Value();
int nLen = CV8Convert::ToInt(args[0]);
pNative->Save_Alloc(nLen);
@ -262,8 +242,8 @@ void _Save_ReAllocNative(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
int _pos = args[0]->ToInt32()->Value();
int _len = args[1]->ToInt32()->Value();
int _pos = CV8Convert::ToInt(args[0]);
int _len = CV8Convert::ToInt(args[1]);
pNative->Save_ReAlloc(_pos, _len);
@ -279,8 +259,8 @@ void _Save_End(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
std::string sHeader = to_cstringA(args[0]);
int _len = args[1]->ToInt32()->Value();
std::string sHeader = CV8Convert::ToStringA(args[0]);
int _len = CV8Convert::ToInt(args[1]);
pNative->Save_End(sHeader, _len);
}
@ -292,7 +272,7 @@ void _ConsoleLog(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
pNative->ConsoleLog(to_cstringA(args[0]));
pNative->ConsoleLog(CV8Convert::ToStringA(args[0]));
}
void _SaveChanges(const v8::FunctionCallbackInfo<v8::Value>& args)
@ -302,7 +282,7 @@ void _SaveChanges(const v8::FunctionCallbackInfo<v8::Value>& args)
return;
CNativeControl* pNative = unwrap_nativeobject(args.This());
pNative->DumpChanges(to_cstringA(args[0]), args[1]->ToInt32()->Value(), args[2]->ToInt32()->Value());
pNative->DumpChanges(CV8Convert::ToStringA(args[0]), CV8Convert::ToInt(args[1]), CV8Convert::ToInt(args[2]));
}
/// ZIP -----
@ -315,7 +295,7 @@ void _zipOpenFile(const v8::FunctionCallbackInfo<v8::Value>& args)
}
CNativeControl* pNative = unwrap_nativeobject(args.This());
bool bIsOpen = pNative->m_oZipWorker.Open(to_cstring(args[0]));
bool bIsOpen = pNative->m_oZipWorker.Open(CV8Convert::ToString(args[0]));
if (!bIsOpen)
{
args.GetReturnValue().Set(v8::Null(v8::Isolate::GetCurrent()));
@ -345,7 +325,7 @@ void _zipOpenFileBase64(const v8::FunctionCallbackInfo<v8::Value>& args)
}
CNativeControl* pNative = unwrap_nativeobject(args.This());
bool bIsOpen = pNative->m_oZipWorker.OpenBase64(to_cstringA(args[0]));
bool bIsOpen = pNative->m_oZipWorker.OpenBase64(CV8Convert::ToStringA(args[0]));
if (!bIsOpen)
{
args.GetReturnValue().Set(v8::Null(v8::Isolate::GetCurrent()));
@ -378,7 +358,7 @@ void _zipGetFileAsString(const v8::FunctionCallbackInfo<v8::Value>& args)
BYTE* pData = NULL;
DWORD len = 0;
pNative->m_oZipWorker.GetFileData(to_cstring(args[0]), pData, len);
pNative->m_oZipWorker.GetFileData(CV8Convert::ToString(args[0]), pData, len);
args.GetReturnValue().Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), (char*)pData, v8::String::kNormalString, len));
}
@ -395,7 +375,7 @@ void _zipGetFileAsBinary(const v8::FunctionCallbackInfo<v8::Value>& args)
BYTE* pData = NULL;
DWORD len = 0;
pNative->m_oZipWorker.GetFileData(to_cstring(args[0]), pData, len);
pNative->m_oZipWorker.GetFileData(CV8Convert::ToString(args[0]), pData, len);
v8::Local<v8::ArrayBuffer> _buffer = v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), (void*)pData, (size_t)len);
v8::Local<v8::Uint8Array> _array = v8::Uint8Array::New(_buffer, 0, (size_t)len);
@ -419,7 +399,7 @@ void _AddImageInChanges(const v8::FunctionCallbackInfo<v8::Value>& args)
CNativeControl* pNative = unwrap_nativeobject(args.This());
std::wstring sImage = to_cstring(args[0]);
std::wstring sImage = CV8Convert::ToString(args[0]);
if (sImage.empty())
return;
@ -432,40 +412,40 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate)
{
//v8::HandleScope handle_scope(isolate);
v8::Local<v8::ObjectTemplate> result = v8::ObjectTemplate::New();
v8::Local<v8::ObjectTemplate> result = v8::ObjectTemplate::New(isolate);
result->SetInternalFieldCount(1); // отводим в нем место для хранения CNativeControl
v8::Isolate* current = v8::Isolate::GetCurrent();
// прописываем функции - методы объекта
result->Set(v8::String::NewFromUtf8(current, "SetFilePath"), v8::FunctionTemplate::New(current, _SetFilePath));
result->Set(v8::String::NewFromUtf8(current, "GetFilePath"), v8::FunctionTemplate::New(current, _GetFilePath));
result->Set(v8::String::NewFromUtf8(current, "SetFileId"), v8::FunctionTemplate::New(current, _SetFileId));
result->Set(v8::String::NewFromUtf8(current, "GetFileId"), v8::FunctionTemplate::New(current, _GetFileId));
result->Set(v8::String::NewFromUtf8(current, "GetFileBinary"), v8::FunctionTemplate::New(current, _GetFileArrayBuffer));
result->Set(v8::String::NewFromUtf8(current, "GetFontBinary"), v8::FunctionTemplate::New(current, _GetFontArrayBuffer));
result->Set(v8::String::NewFromUtf8(current, "GetFontsDirectory"), v8::FunctionTemplate::New(current, _GetFontsDirectory));
result->Set(v8::String::NewFromUtf8(current, "GetFileString"), v8::FunctionTemplate::New(current, _GetFileString));
result->Set(current, "SetFilePath", v8::FunctionTemplate::New(current, _SetFilePath));
result->Set(current, "GetFilePath", v8::FunctionTemplate::New(current, _GetFilePath));
result->Set(current, "SetFileId", v8::FunctionTemplate::New(current, _SetFileId));
result->Set(current, "GetFileId", v8::FunctionTemplate::New(current, _GetFileId));
result->Set(current, "GetFileBinary", v8::FunctionTemplate::New(current, _GetFileArrayBuffer));
result->Set(current, "GetFontBinary", v8::FunctionTemplate::New(current, _GetFontArrayBuffer));
result->Set(current, "GetFontsDirectory", v8::FunctionTemplate::New(current, _GetFontsDirectory));
result->Set(current, "GetFileString", v8::FunctionTemplate::New(current, _GetFileString));
result->Set(v8::String::NewFromUtf8(current, "GetEditorType"), v8::FunctionTemplate::New(current, _GetEditorType));
result->Set(v8::String::NewFromUtf8(current, "CheckNextChange"), v8::FunctionTemplate::New(current, _CheckNextChange));
result->Set(current, "GetEditorType", v8::FunctionTemplate::New(current, _GetEditorType));
result->Set(current, "CheckNextChange", v8::FunctionTemplate::New(current, _CheckNextChange));
result->Set(v8::String::NewFromUtf8(current, "GetCountChanges"), v8::FunctionTemplate::New(current, _GetChangesCount));
result->Set(v8::String::NewFromUtf8(current, "GetChangesFile"), v8::FunctionTemplate::New(current, _GetChangesFile));
result->Set(current, "GetCountChanges", v8::FunctionTemplate::New(current, _GetChangesCount));
result->Set(current, "GetChangesFile", v8::FunctionTemplate::New(current, _GetChangesFile));
result->Set(v8::String::NewFromUtf8(current, "Save_AllocNative"), v8::FunctionTemplate::New(current, _Save_AllocNative));
result->Set(v8::String::NewFromUtf8(current, "Save_ReAllocNative"), v8::FunctionTemplate::New(current, _Save_ReAllocNative));
result->Set(v8::String::NewFromUtf8(current, "Save_End"), v8::FunctionTemplate::New(current, _Save_End));
result->Set(current, "Save_AllocNative", v8::FunctionTemplate::New(current, _Save_AllocNative));
result->Set(current, "Save_ReAllocNative", v8::FunctionTemplate::New(current, _Save_ReAllocNative));
result->Set(current, "Save_End", v8::FunctionTemplate::New(current, _Save_End));
result->Set(v8::String::NewFromUtf8(current, "AddImageInChanges"), v8::FunctionTemplate::New(current, _AddImageInChanges));
result->Set(current, "AddImageInChanges", v8::FunctionTemplate::New(current, _AddImageInChanges));
result->Set(v8::String::NewFromUtf8(current, "ConsoleLog"), v8::FunctionTemplate::New(current, _ConsoleLog));
result->Set(current, "ConsoleLog", v8::FunctionTemplate::New(current, _ConsoleLog));
result->Set(v8::String::NewFromUtf8(current, "ZipOpen"), v8::FunctionTemplate::New(current, _zipOpenFile));
result->Set(v8::String::NewFromUtf8(current, "ZipOpenBase64"), v8::FunctionTemplate::New(current, _zipOpenFileBase64));
result->Set(v8::String::NewFromUtf8(current, "ZipFileAsString"), v8::FunctionTemplate::New(current, _zipGetFileAsString));
result->Set(v8::String::NewFromUtf8(current, "ZipFileAsBinary"), v8::FunctionTemplate::New(current, _zipGetFileAsBinary));
result->Set(v8::String::NewFromUtf8(current, "ZipClose"), v8::FunctionTemplate::New(current, _zipCloseFile));
result->Set(current, "ZipOpen", v8::FunctionTemplate::New(current, _zipOpenFile));
result->Set(current, "ZipOpenBase64", v8::FunctionTemplate::New(current, _zipOpenFileBase64));
result->Set(current, "ZipFileAsString", v8::FunctionTemplate::New(current, _zipGetFileAsString));
result->Set(current, "ZipFileAsBinary", v8::FunctionTemplate::New(current, _zipGetFileAsBinary));
result->Set(current, "ZipClose", v8::FunctionTemplate::New(current, _zipCloseFile));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope
@ -478,42 +458,42 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplateBuilder(v8::Isolate* i
{
//v8::HandleScope handle_scope(isolate);
v8::Local<v8::ObjectTemplate> result = v8::ObjectTemplate::New();
v8::Local<v8::ObjectTemplate> result = v8::ObjectTemplate::New(isolate);
result->SetInternalFieldCount(1); // отводим в нем место для хранения CNativeControl
v8::Isolate* current = v8::Isolate::GetCurrent();
// прописываем функции - методы объекта
result->Set(v8::String::NewFromUtf8(current, "SetFilePath"), v8::FunctionTemplate::New(current, _SetFilePath));
result->Set(v8::String::NewFromUtf8(current, "GetFilePath"), v8::FunctionTemplate::New(current, _GetFilePath));
result->Set(v8::String::NewFromUtf8(current, "SetFileId"), v8::FunctionTemplate::New(current, _SetFileId));
result->Set(v8::String::NewFromUtf8(current, "GetFileId"), v8::FunctionTemplate::New(current, _GetFileId));
result->Set(v8::String::NewFromUtf8(current, "GetFileBinary"), v8::FunctionTemplate::New(current, _GetFileArrayBuffer));
result->Set(v8::String::NewFromUtf8(current, "GetFontBinary"), v8::FunctionTemplate::New(current, _GetFontArrayBuffer));
result->Set(v8::String::NewFromUtf8(current, "GetFontsDirectory"), v8::FunctionTemplate::New(current, _GetFontsDirectory));
result->Set(v8::String::NewFromUtf8(current, "GetFileString"), v8::FunctionTemplate::New(current, _GetFileString));
result->Set(current, "SetFilePath", v8::FunctionTemplate::New(current, _SetFilePath));
result->Set(current, "GetFilePath", v8::FunctionTemplate::New(current, _GetFilePath));
result->Set(current, "SetFileId", v8::FunctionTemplate::New(current, _SetFileId));
result->Set(current, "GetFileId", v8::FunctionTemplate::New(current, _GetFileId));
result->Set(current, "GetFileBinary", v8::FunctionTemplate::New(current, _GetFileArrayBuffer));
result->Set(current, "GetFontBinary", v8::FunctionTemplate::New(current, _GetFontArrayBuffer));
result->Set(current, "GetFontsDirectory", v8::FunctionTemplate::New(current, _GetFontsDirectory));
result->Set(current, "GetFileString", v8::FunctionTemplate::New(current, _GetFileString));
result->Set(v8::String::NewFromUtf8(current, "GetEditorType"), v8::FunctionTemplate::New(current, _GetEditorType));
result->Set(v8::String::NewFromUtf8(current, "CheckNextChange"), v8::FunctionTemplate::New(current, _CheckNextChange));
result->Set(current, "GetEditorType", v8::FunctionTemplate::New(current, _GetEditorType));
result->Set(current, "CheckNextChange", v8::FunctionTemplate::New(current, _CheckNextChange));
result->Set(v8::String::NewFromUtf8(current, "GetCountChanges"), v8::FunctionTemplate::New(current, _GetChangesCount));
result->Set(v8::String::NewFromUtf8(current, "GetChangesFile"), v8::FunctionTemplate::New(current, _GetChangesFile));
result->Set(current, "GetCountChanges", v8::FunctionTemplate::New(current, _GetChangesCount));
result->Set(current, "GetChangesFile", v8::FunctionTemplate::New(current, _GetChangesFile));
result->Set(v8::String::NewFromUtf8(current, "Save_AllocNative"), v8::FunctionTemplate::New(current, _Save_AllocNative));
result->Set(v8::String::NewFromUtf8(current, "Save_ReAllocNative"), v8::FunctionTemplate::New(current, _Save_ReAllocNative));
result->Set(v8::String::NewFromUtf8(current, "Save_End"), v8::FunctionTemplate::New(current, _Save_End));
result->Set(current, "Save_AllocNative", v8::FunctionTemplate::New(current, _Save_AllocNative));
result->Set(current, "Save_ReAllocNative", v8::FunctionTemplate::New(current, _Save_ReAllocNative));
result->Set(current, "Save_End", v8::FunctionTemplate::New(current, _Save_End));
result->Set(v8::String::NewFromUtf8(current, "AddImageInChanges"), v8::FunctionTemplate::New(current, _AddImageInChanges));
result->Set(current, "AddImageInChanges", v8::FunctionTemplate::New(current, _AddImageInChanges));
result->Set(v8::String::NewFromUtf8(current, "ConsoleLog"), v8::FunctionTemplate::New(current, _ConsoleLog));
result->Set(current, "ConsoleLog", v8::FunctionTemplate::New(current, _ConsoleLog));
result->Set(v8::String::NewFromUtf8(current, "SaveChanges"), v8::FunctionTemplate::New(current, _SaveChanges));
result->Set(current, "SaveChanges", v8::FunctionTemplate::New(current, _SaveChanges));
result->Set(v8::String::NewFromUtf8(current, "ZipOpen"), v8::FunctionTemplate::New(current, _zipOpenFile));
result->Set(v8::String::NewFromUtf8(current, "ZipOpenBase64"), v8::FunctionTemplate::New(current, _zipOpenFileBase64));
result->Set(v8::String::NewFromUtf8(current, "ZipFileAsString"), v8::FunctionTemplate::New(current, _zipGetFileAsString));
result->Set(v8::String::NewFromUtf8(current, "ZipFileAsBinary"), v8::FunctionTemplate::New(current, _zipGetFileAsBinary));
result->Set(v8::String::NewFromUtf8(current, "ZipClose"), v8::FunctionTemplate::New(current, _zipCloseFile));
result->Set(current, "ZipOpen", v8::FunctionTemplate::New(current, _zipOpenFile));
result->Set(current, "ZipOpenBase64", v8::FunctionTemplate::New(current, _zipOpenFileBase64));
result->Set(current, "ZipFileAsString", v8::FunctionTemplate::New(current, _zipGetFileAsString));
result->Set(current, "ZipFileAsBinary", v8::FunctionTemplate::New(current, _zipGetFileAsBinary));
result->Set(current, "ZipClose", v8::FunctionTemplate::New(current, _zipCloseFile));
// возвращаем временный хэндл хитрым образом, который переносит наш хэндл в предыдущий HandleScope и не дает ему
// уничтожиться при уничтожении "нашего" HandleScope - handle_scope

View File

@ -179,10 +179,6 @@ private:
}
};
// string convert
std::wstring to_cstring(v8::Local<v8::Value> v);
std::string to_cstringA(v8::Local<v8::Value> v);
class CNativeControl
{
private:

View File

@ -646,7 +646,7 @@ void ReadNames(NSFonts::CFontInfo* pInfo, FT_Face pFace)
std::wstring CFontList::GetFontBySymbol(int symbol)
{
for (std::list<CFontRange>::iterator iter = m_listRanges.begin(); iter != m_listRanges.end(); iter++)
for (std::list<CFontRange>::iterator iter = m_listRanges.begin(); iter != m_listRanges.end() && !m_listRanges.empty(); iter++)
{
CFontRange& range = *iter;
if (symbol >= range.Start && symbol <= range.End)
@ -661,7 +661,7 @@ std::wstring CFontList::GetFontBySymbol(int symbol)
int _center = 0;
if (_start > _end)
if (_start > _end || m_pRanges == NULL)
return L"";
while (_start < _end)
@ -1352,9 +1352,17 @@ void CFontList::LoadFromArrayFiles(std::vector<std::wstring>& oArray, int nFlag)
continue;
}
std::wstring wsFamilyName = GetCorrectSfntName(pFace->family_name);
std::wstring wsStyleName = GetCorrectSfntName(pFace->style_name);
std::string sFamilyName = "";
if (NULL != pFace->family_name)
sFamilyName = pFace->family_name;
std::string sStyleName = "";
if (NULL != pFace->style_name)
sStyleName = pFace->style_name;
std::wstring wsFamilyName = NSFile::CUtf8Converter::GetUnicodeFromCharPtr(sFamilyName);
std::wstring wsStyleName = NSFile::CUtf8Converter::GetUnicodeFromCharPtr(sStyleName);
#ifdef _MAC
if (wsFamilyName.find(L".") == 0)
{

View File

@ -682,9 +682,9 @@ void CFontFile::CheckHintsSupport()
return;
}
std::wstring sFamilyName = GetCorrectSfntName(m_pFace->family_name);
std::string sFamilyName((NULL != m_pFace->family_name) ? m_pFace->family_name : "");
if (m_sName == L"MS Mincho" || m_sName == L"Castellar")
if (sFamilyName == "MS Mincho" || sFamilyName == "Castellar")
m_bHintsSupport = FALSE;
}

View File

@ -44,36 +44,6 @@
#include "FontPath.h"
#include "GlyphString.h"
#include "../common/File.h"
static std::wstring GetCorrectSfntName(const char* name)
{
if (NULL == name)
return L"";
const char* name_cur = name;
int name_len = 0;
while (*name_cur++)
++name_len;
name_cur = name;
bool isUtf8 = false;
if (6 < name_len)
{
if ('<' == name[0] || 'u' == name[1] || 't' == name[2] ||
'f' == name[3] || '8' == name[4] || '>' == name[5])
{
name_cur = name + 6;
name_len -= 6;
isUtf8 = true;
}
}
if (isUtf8)
{
return NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)name_cur, (LONG)name_len);
}
return NSFile::CUtf8Converter::GetUnicodeFromCharPtr(name_cur, (LONG)name_len);
}
//-------------------------------------------------------------------------------------------------------------------------------
// TODO: RasterHeep

View File

@ -686,9 +686,9 @@ INT CFontManager::LoadFontFromFile(const std::wstring& sPath, const int& lFaceIn
m_pFont->SetSizeAndDpi(dSize, (UINT)dDpiX, (UINT)dDpiY);
m_sName = L"";
if (m_pFont->m_pFace)
if (m_pFont->m_pFace && m_pFont->m_pFace->family_name)
{
m_pFont->m_sName = GetCorrectSfntName(m_pFont->m_pFace->family_name);
m_pFont->m_sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)m_pFont->m_pFace->family_name, strlen(m_pFont->m_pFace->family_name));
m_sName = m_pFont->m_sName;
}
@ -710,10 +710,9 @@ INT CFontManager::LoadFontFromFile2(NSFonts::IFontsCache* pCache, const std::wst
m_pFont->SetSizeAndDpi(dSize, (UINT)dDpiX, (UINT)dDpiY);
m_sName = L"";
if (m_pFont->m_pFace)
if (m_pFont->m_pFace && m_pFont->m_pFace->family_name)
{
m_pFont->m_sName = GetCorrectSfntName(m_pFont->m_pFace->family_name);
m_sName = m_pFont->m_sName;
m_sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)m_pFont->m_pFace->family_name, strlen(m_pFont->m_pFace->family_name));
}
return TRUE;

View File

@ -561,28 +561,35 @@ namespace NSCommon
}
else if (pFile)
{
// у нас режим "без квадратов"
// но есть шрифты, в которых символы есть, но нулевой ширины.
// только из-за таких шрифтов делаем заглушку
int nFontNameLen = (int)sFontName.length();
bool bIsExistEmpty = false;
bool bIsPresentAll = true;
for (int nC = 0; nC < nFontNameLen; nC++)
{
int nCMapIndex = 0;
int nGid = pFile->SetCMapForCharCode(sFontName.at(nC), &nCMapIndex);
if (0 < nGid && 0.0001 > pFile->GetCharWidth(nGid))
if (0 >= nGid)
{
bIsExistEmpty = true;
bIsPresentAll = false;
break;
}
else
{
double offsetG = pFile->GetCharWidth(nGid);
if (offsetG < 0.0001)
{
bIsPresentAll = false;
break;
}
}
}
if (bIsExistEmpty)
if (!bIsPresentAll)
{
NSFonts::CFontSelectFormat oSelectFormat;
oSelectFormat.wsName = new std::wstring(L"Arial");
NSFonts::CFontInfo* pInfoCur = pManager->GetFontInfoByParams(oSelectFormat);
NSFonts::CFontInfo* pInfoCur = pManager->GetFontInfoByParams(oSelectFormat);
if (NULL != pInfoCur)
{
pManager->LoadFontFromFile(pInfoCur->m_wsFontPath, 0, 14, dDpi, dDpi);

View File

@ -44,138 +44,8 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_sfobjs
#ifdef FT_SUPPORT_UTF8_IN_NAMES
// common funcs
static void tt_name_entry_unicode_from_utf16(FT_Byte* string, FT_UShort len, FT_Int** out, FT_UShort* out_len, FT_Memory memory)
{
FT_Int* unicode = NULL;
FT_UShort alloc_len = len / 2;
FT_UShort n = 0;
FT_UShort cur = 0, cur2 = 0;
FT_UShort out_len_cur = 0;
FT_Error error;
*out = NULL;
*out_len = 0;
if ( FT_NEW_ARRAY( unicode, alloc_len ) )
return;
for ( n = 0; n < alloc_len; n++ )
{
cur = FT_NEXT_USHORT( string );
if ( cur == 0 )
break;
if (cur < 0xD800 || cur > 0xDBFF)
{
unicode[out_len_cur++] = cur;
}
else
{
cur2 = FT_NEXT_USHORT( string );
++n;
unicode[out_len_cur++] = ((((cur - 0xD800) & 0x03FF) << 10) | ((cur2 - 0xDC00) & 0x03FF)) + 0x10000;
}
}
*out = unicode;
*out_len = out_len_cur;
}
static FT_String* tt_name_entry_utf8_from_unicode(FT_Int* unicode, FT_UShort len, FT_Memory memory)
{
FT_String* ret = NULL;
FT_String* retCur = NULL;
FT_UShort index = 0;
FT_UInt alloc_len = 6 * len + 6 + 1;
FT_Int code;
FT_Error error;
if (0 == len)
return ret;
if ( FT_NEW_ARRAY( ret, alloc_len ) )
return ret;
retCur = ret;
*retCur++ = '<';
*retCur++ = 'u';
*retCur++ = 't';
*retCur++ = 'f';
*retCur++ = '8';
*retCur++ = '>';
for ( index = 0; index < len; index++ )
{
code = unicode[index];
if (code < 0x80)
{
*retCur++ = (FT_String)code;
}
else if (code < 0x0800)
{
*retCur++ = (0xC0 | (code >> 6));
*retCur++ = (0x80 | (code & 0x3F));
}
else if (code < 0x10000)
{
*retCur++ = (0xE0 | (code >> 12));
*retCur++ = (0x80 | (code >> 6 & 0x3F));
*retCur++ = (0x80 | (code & 0x3F));
}
else if (code < 0x1FFFFF)
{
*retCur++ = (0xF0 | (code >> 18));
*retCur++ = (0x80 | (code >> 12 & 0x3F));
*retCur++ = (0x80 | (code >> 6 & 0x3F));
*retCur++ = (0x80 | (code & 0x3F));
}
else if (code < 0x3FFFFFF)
{
*retCur++ = (0xF8 | (code >> 24));
*retCur++ = (0x80 | (code >> 18 & 0x3F));
*retCur++ = (0x80 | (code >> 12 & 0x3F));
*retCur++ = (0x80 | (code >> 6 & 0x3F));
*retCur++ = (0x80 | (code & 0x3F));
}
else if (code < 0x7FFFFFFF)
{
*retCur++ = (0xFC | (code >> 30));
*retCur++ = (0x80 | (code >> 24 & 0x3F));
*retCur++ = (0x80 | (code >> 18 & 0x3F));
*retCur++ = (0x80 | (code >> 12 & 0x3F));
*retCur++ = (0x80 | (code >> 6 & 0x3F));
*retCur++ = (0x80 | (code & 0x3F));
}
}
*retCur = 0;
return ret;
}
// ft interface
static FT_String* tt_name_entry_utf8_from_utf16(TT_NameEntry entry,
FT_Memory memory)
{
FT_Int* unicode = NULL;
FT_UShort unicode_len = 0;
FT_String* retValue = NULL;
tt_name_entry_unicode_from_utf16(entry->string, entry->stringLength, &unicode, &unicode_len, memory);
retValue = tt_name_entry_utf8_from_unicode(unicode, unicode_len, memory);
FT_FREE(unicode);
return retValue;
}
/* convert a UTF-16 name entry to ASCII */
static FT_String*
tt_name_entry_ascii_from_utf16( TT_NameEntry entry,
FT_Memory memory )
{
return tt_name_entry_utf8_from_utf16(entry, memory);
}
#else
/* convert a UTF-16 name entry to ASCII */
static FT_String*
tt_name_entry_ascii_from_utf16( TT_NameEntry entry,
@ -209,7 +79,7 @@
return string;
}
#endif
/* convert an Apple Roman or symbol name entry to ASCII */
static FT_String*

View File

@ -39,6 +39,10 @@
#include "../raster/Metafile/MetaFile.h"
#include "../common/File.h"
#ifdef __ANDROID__
#include "../common/Directory.h"
#endif
#if defined (GetTempPath)
#undef GetTempPath
#endif
@ -71,7 +75,16 @@ public:
}
else
{
std::wstring sTempFile = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"AscMetafile_");
std::wstring sTempFile;
#ifdef __ANDROID__
std::wstring sTempDir = NSFile::GetDirectoryName(strFile) + NSFile::CFileBinary::GetTempPath();
NSDirectory::CreateDirectory(sTempDir);
sTempFile = NSFile::CFileBinary::CreateTempFileWithUniqueName(sTempDir, L"AscMetafile_");
#else
sTempFile = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"AscMetafile_");
#endif
oMetafile.ConvertToRaster(sTempFile.c_str(), 4, 1000, -1);
m_oImage.Create(sTempFile);
@ -108,8 +121,7 @@ public:
m_oCS.InitializeCriticalSection();
if (m_pApplicationFonts)
m_pApplicationFonts->AddRef();
ADDREFINTERFACE(m_pApplicationFonts);
}
virtual ~CImageFilesCache()
@ -117,8 +129,7 @@ public:
Clear();
m_oCS.DeleteCriticalSection();
if (m_pApplicationFonts)
m_pApplicationFonts->Release();
RELEASEINTERFACE(m_pApplicationFonts);
}
virtual void Clear()

View File

@ -32,8 +32,6 @@ DEFINES += \
MNG_STORE_CHUNKS\
MNG_ERROR_TELLTALE
DEFINES += FT_SUPPORT_UTF8_IN_NAMES
core_linux {
DEFINES += \
HAVE_UNISTD_H

View File

@ -59,6 +59,8 @@
8A404FC72089FF0800F2D5CF /* MetafileToGraphicsRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FC22089FF0700F2D5CF /* MetafileToGraphicsRenderer.h */; };
8A404FC82089FF0800F2D5CF /* MetafileToRendererCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FC32089FF0700F2D5CF /* MetafileToRendererCheck.h */; };
8A404FD7208A020D00F2D5CF /* BaseThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A404FD6208A020D00F2D5CF /* BaseThread.cpp */; };
8AF08A8323169CC70022678D /* ByteBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AF08A8223169CC70022678D /* ByteBuilder.h */; };
8AF08A8523169CD10022678D /* ByteBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AF08A8423169CD10022678D /* ByteBuilder.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -115,6 +117,8 @@
8A404FC22089FF0700F2D5CF /* MetafileToGraphicsRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MetafileToGraphicsRenderer.h; path = ../../../graphics/MetafileToGraphicsRenderer.h; sourceTree = "<group>"; };
8A404FC32089FF0700F2D5CF /* MetafileToRendererCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MetafileToRendererCheck.h; path = ../../../graphics/MetafileToRendererCheck.h; sourceTree = "<group>"; };
8A404FD6208A020D00F2D5CF /* BaseThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BaseThread.cpp; path = ../../../graphics/BaseThread.cpp; sourceTree = "<group>"; };
8AF08A8223169CC70022678D /* ByteBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ByteBuilder.h; path = ../../../common/ByteBuilder.h; sourceTree = "<group>"; };
8AF08A8423169CD10022678D /* ByteBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ByteBuilder.cpp; path = ../../../common/ByteBuilder.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -157,6 +161,8 @@
8A404FD6208A020D00F2D5CF /* BaseThread.cpp */,
17D913291AC58F000096D788 /* Brush.cpp */,
17D9132A1AC58F000096D788 /* Brush.h */,
8AF08A8223169CC70022678D /* ByteBuilder.h */,
8AF08A8423169CD10022678D /* ByteBuilder.cpp */,
17D9132B1AC58F000096D788 /* Clip.cpp */,
17D9132C1AC58F000096D788 /* Clip.h */,
17D9132D1AC58F000096D788 /* Color.h */,
@ -258,6 +264,7 @@
17C1FEF81ACC4A67006B99B3 /* IRenderer.h in Headers */,
17C1FEF91ACC4A67006B99B3 /* GlyphString.h in Headers */,
17C1FEFA1ACC4A67006B99B3 /* Graphics.h in Headers */,
8AF08A8323169CC70022678D /* ByteBuilder.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -317,6 +324,7 @@
8A404F8A2089F1BB00F2D5CF /* pro_Image.cpp in Sources */,
17C1FED21ACC4A67006B99B3 /* ApplicationFonts.cpp in Sources */,
17C1FED31ACC4A67006B99B3 /* FontFile.cpp in Sources */,
8AF08A8523169CD10022678D /* ByteBuilder.cpp in Sources */,
17C1FED41ACC4A67006B99B3 /* ApplicationFonts_ios.mm in Sources */,
17C1FED51ACC4A67006B99B3 /* ApplicationFontsWorker.cpp in Sources */,
8A404FD7208A020D00F2D5CF /* BaseThread.cpp in Sources */,

View File

@ -327,6 +327,9 @@ void CBgraFrame::Destroy()
if (NULL != m_pData)
delete []m_pData;
if (NULL != m_pPalette)
delete []m_pPalette;
Clear();
}
void CBgraFrame::Clear()
@ -336,6 +339,8 @@ void CBgraFrame::Clear()
m_lHeight = 0;
m_lStride = 0;
m_pData = NULL;
m_pPalette = NULL;
m_lPaletteColors = 0;
m_bIsGrayScale = false;
m_dJpegSaveQuality = -1;
}
@ -387,6 +392,19 @@ void CBgraFrame::SetJpegQuality(const double& value)
m_dJpegSaveQuality = value;
}
void CBgraFrame::put_Palette(BYTE* pDataColors, const int& colors)
{
if (!pDataColors || colors < 1) return;
if (m_pPalette)
delete []m_pPalette;
m_lPaletteColors = colors;
m_pPalette = new BYTE[colors * 4];
memcpy(m_pPalette, pDataColors, colors * 4);
}
bool CBgraFrame::OpenFile(const std::wstring& strFileName, unsigned int nFileType)
{
m_nFileType = nFileType;
@ -442,8 +460,14 @@ bool CBgraFrame::SaveFile(const std::wstring& strFileName, unsigned int nFileTyp
return false;
CxImage img;
if (!img.CreateFromArray(m_pData, m_lWidth, m_lHeight, lBitsPerPixel * 8, lStride, (m_lStride >= 0) ? true : false))
return false;
return false;
if (m_pPalette)
{
img.SetPalette((RGBQUAD*)m_pPalette, m_lPaletteColors);
}
if (!img.Encode(oFile.GetFileNative(), nFileType))
return false;

View File

@ -49,6 +49,9 @@ private:
BYTE* m_pData;
BYTE* m_pPalette;
int m_lPaletteColors;
bool m_bIsGrayScale;
double m_dJpegSaveQuality;
@ -56,25 +59,29 @@ public:
CBgraFrame();
~CBgraFrame();
public:
void Destroy();
void Clear();
public:
void ClearNoAttack();
int get_Width();
int get_Height();
void put_Width(const int& lWidth);
int get_Height();
void put_Height(const int& lHeight);
int get_Stride();
void put_Stride(const int& lStride);
BYTE* get_Data();
void put_Data(BYTE* pData);
void put_Palette(BYTE* pDataColors, const int& colors);
bool IsGrayScale();
void SetJpegQuality(const double& value);
public:
bool OpenFile(const std::wstring& strFileName, unsigned int nFileType = 0); //0 - detect
bool SaveFile(const std::wstring& strFileName, unsigned int nFileType);
bool Encode(BYTE*& pBuffer, int& nSize, unsigned int nFileType);
@ -83,7 +90,6 @@ public:
bool ReColorPatternImage(const std::wstring& strFileName, unsigned int rgbColorBack, unsigned int rgbColorFore);
public:
void FromImage(IGrObject* pGraphics, bool bIsCopy = true);
};

View File

@ -110,12 +110,14 @@ namespace XmlUtils
std::wstring GetText();
std::string GetTextA();
const char* GetTextChar();
std::wstring GetAttributeTextWithHHHH();
std::wstring GetText2();
std::string GetText2A();
std::wstring GetText3();
void GetTextWithHHHH(bool bPreserve, wchar_t*& sBuffer, long& nSize, long& nLen);
std::wstring GetTextWithHHHH(bool bPreserve);
std::wstring GetOuterXml();
std::wstring GetInnerXml();

View File

@ -166,6 +166,10 @@ namespace XmlUtils
{
return m_pInternal->GetTextChar();
}
std::wstring CXmlLiteReader::GetAttributeTextWithHHHH()
{
return m_pInternal->GetAttributeTextWithHHHH();
}
std::wstring CXmlLiteReader::GetText2()
{
@ -183,6 +187,10 @@ namespace XmlUtils
{
return m_pInternal->GetTextWithHHHH(bPreserve, sBuffer, nSize,nLen);
}
std::wstring CXmlLiteReader::GetTextWithHHHH(bool bPreserve)
{
return m_pInternal->GetTextWithHHHH(bPreserve);
}
std::wstring CXmlLiteReader::GetOuterXml()
{

View File

@ -351,6 +351,25 @@ namespace XmlUtils
return (const char*)pValue;
}
inline std::wstring GetAttributeTextWithHHHH()
{
if (!IsValid())
return L"";
const xmlChar* pValue = xmlTextReaderConstValue(reader);
if (NULL == pValue)
return L"";
const char* pValueA = (const char*)pValue;
LONG nLenA = strlen((const char*)pValueA);
LONG nRequired = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8BufferSize(nLenA);
wchar_t* sBuffer = new wchar_t[nRequired];
LONG lOutputCount = 0;
NSFile::CUtf8Converter::GetUnicodeStringFromUTF8WithHHHH((const BYTE*)pValueA, nLenA, sBuffer, lOutputCount);
std::wstring sRes(sBuffer, lOutputCount);
delete[] sBuffer;
return sRes;
}
std::wstring GetText2()
{
@ -471,6 +490,14 @@ namespace XmlUtils
nLen = NSStringExt::FindLastNotOf(sBuffer, nLen, L" \n\r\t") + 1;
}
}
std::wstring GetTextWithHHHH(bool bPreserve)
{
wchar_t* pUnicodes = NULL;
LONG nSize = 0;
LONG nLen = 0;
GetTextWithHHHH(bPreserve, pUnicodes, nSize, nLen);
return std::wstring(pUnicodes, nLen);
}
inline std::wstring GetOuterXml()
{
return GetXml(false);

View File

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17513B032216E721008B45F7"
BuildableName = "libOdfOfficeConverter.a"
BlueprintName = "OdfOfficeConverter"
ReferencedContainer = "container:OdfOfficeConverter.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17513B032216E721008B45F7"
BuildableName = "libOdfOfficeConverter.a"
BlueprintName = "OdfOfficeConverter"
ReferencedContainer = "container:OdfOfficeConverter.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17513B032216E721008B45F7"
BuildableName = "libOdfOfficeConverter.a"
BlueprintName = "OdfOfficeConverter"
ReferencedContainer = "container:OdfOfficeConverter.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -4,7 +4,7 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>OfficeOdfConverter.xcscheme_^#shared#^_</key>
<key>OdfOfficeConverter.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:OdfReadFormat.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -4,19 +4,11 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>x2t_macos.xcscheme</key>
<key>OdfReadFormat.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>7CC743ED1F20E952006A9889</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -1,459 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
7CC743FF1F20E97F006A9889 /* ASCConverters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC743F91F20E97F006A9889 /* ASCConverters.cpp */; };
7CC744001F20E97F006A9889 /* cextracttools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC743FB1F20E97F006A9889 /* cextracttools.cpp */; };
7CC744011F20E97F006A9889 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC743FD1F20E97F006A9889 /* main.cpp */; };
7CC744191F20E9BF006A9889 /* libASCOfficeDocxFile2Lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744031F20E9BF006A9889 /* libASCOfficeDocxFile2Lib.a */; };
7CC7441A1F20E9BF006A9889 /* libCryptoPPLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744041F20E9BF006A9889 /* libCryptoPPLib.a */; };
7CC7441B1F20E9BF006A9889 /* libDjVuFile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744051F20E9BF006A9889 /* libDjVuFile.dylib */; };
7CC7441C1F20E9BF006A9889 /* libDocFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744061F20E9BF006A9889 /* libDocFormatLib.a */; };
7CC7441D1F20E9BF006A9889 /* libdoctrenderer.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744071F20E9BF006A9889 /* libdoctrenderer.dylib */; };
7CC7441E1F20E9BF006A9889 /* libDocxFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744081F20E9BF006A9889 /* libDocxFormatLib.a */; };
7CC7441F1F20E9BF006A9889 /* libgraphics.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744091F20E9BF006A9889 /* libgraphics.a */; };
7CC744201F20E9BF006A9889 /* libHtmlFile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7440A1F20E9BF006A9889 /* libHtmlFile.dylib */; };
7CC744211F20E9BF006A9889 /* libHtmlRenderer.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7440B1F20E9BF006A9889 /* libHtmlRenderer.dylib */; };
7CC744221F20E9BF006A9889 /* liblibxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7440C1F20E9BF006A9889 /* liblibxml.a */; };
7CC744231F20E9BF006A9889 /* libOdfFileReaderLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7440D1F20E9BF006A9889 /* libOdfFileReaderLib.a */; };
7CC744241F20E9BF006A9889 /* libOdfFileWriterLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7440E1F20E9BF006A9889 /* libOdfFileWriterLib.a */; };
7CC744251F20E9BF006A9889 /* libOfficeUtils.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7440F1F20E9BF006A9889 /* libOfficeUtils.a */; };
7CC744261F20E9BF006A9889 /* libPdfReader.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744101F20E9BF006A9889 /* libPdfReader.dylib */; };
7CC744271F20E9BF006A9889 /* libPdfWriter.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744111F20E9BF006A9889 /* libPdfWriter.dylib */; };
7CC744281F20E9BF006A9889 /* libPptFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744121F20E9BF006A9889 /* libPptFormatLib.a */; };
7CC744291F20E9BF006A9889 /* libPPTXFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744131F20E9BF006A9889 /* libPPTXFormatLib.a */; };
7CC7442A1F20E9BF006A9889 /* libRtfFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744141F20E9BF006A9889 /* libRtfFormatLib.a */; };
7CC7442B1F20E9BF006A9889 /* libTxtXmlFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744151F20E9BF006A9889 /* libTxtXmlFormatLib.a */; };
7CC7442C1F20E9BF006A9889 /* libUnicodeConverter.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744161F20E9BF006A9889 /* libUnicodeConverter.dylib */; };
7CC7442D1F20E9BF006A9889 /* libXlsFormatLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744171F20E9BF006A9889 /* libXlsFormatLib.a */; };
7CC7442E1F20E9BF006A9889 /* libXpsFile.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744181F20E9BF006A9889 /* libXpsFile.dylib */; };
7CC744311F20E9D5006A9889 /* libicudata.55.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7442F1F20E9D5006A9889 /* libicudata.55.1.dylib */; };
7CC744321F20E9D5006A9889 /* libicuuc.55.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744301F20E9D5006A9889 /* libicuuc.55.1.dylib */; };
7CC744371F20EAE6006A9889 /* libboost_date_time.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744331F20EAE6006A9889 /* libboost_date_time.a */; };
7CC744381F20EAE6006A9889 /* libboost_filesystem.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744341F20EAE6006A9889 /* libboost_filesystem.a */; };
7CC744391F20EAE6006A9889 /* libboost_regex.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744351F20EAE6006A9889 /* libboost_regex.a */; };
7CC7443A1F20EAE6006A9889 /* libboost_system.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC744361F20EAE6006A9889 /* libboost_system.a */; };
7CC7443C1F20F0A9006A9889 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CC7443B1F20F0A9006A9889 /* AppKit.framework */; };
7CC7443F1F20F114006A9889 /* xmldom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC7443D1F20F114006A9889 /* xmldom.cpp */; };
7CC744401F20F114006A9889 /* xmllight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC7443E1F20F114006A9889 /* xmllight.cpp */; };
7CC744421F20F128006A9889 /* OfficeFileFormatChecker2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC744411F20F128006A9889 /* OfficeFileFormatChecker2.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
7CC743EC1F20E952006A9889 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
7CC743EE1F20E952006A9889 /* x2t_macos */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = x2t_macos; sourceTree = BUILT_PRODUCTS_DIR; };
7CC743F91F20E97F006A9889 /* ASCConverters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASCConverters.cpp; path = ../../../../src/ASCConverters.cpp; sourceTree = "<group>"; };
7CC743FA1F20E97F006A9889 /* ASCConverters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASCConverters.h; path = ../../../../src/ASCConverters.h; sourceTree = "<group>"; };
7CC743FB1F20E97F006A9889 /* cextracttools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cextracttools.cpp; path = ../../../../src/cextracttools.cpp; sourceTree = "<group>"; };
7CC743FC1F20E97F006A9889 /* cextracttools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cextracttools.h; path = ../../../../src/cextracttools.h; sourceTree = "<group>"; };
7CC743FD1F20E97F006A9889 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../../../src/main.cpp; sourceTree = "<group>"; };
7CC744031F20E9BF006A9889 /* libASCOfficeDocxFile2Lib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libASCOfficeDocxFile2Lib.a; path = ../../../../../build/lib/mac_64/libASCOfficeDocxFile2Lib.a; sourceTree = "<group>"; };
7CC744041F20E9BF006A9889 /* libCryptoPPLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCryptoPPLib.a; path = ../../../../../build/lib/mac_64/libCryptoPPLib.a; sourceTree = "<group>"; };
7CC744051F20E9BF006A9889 /* libDjVuFile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libDjVuFile.dylib; path = ../../../../../build/lib/mac_64/libDjVuFile.dylib; sourceTree = "<group>"; };
7CC744061F20E9BF006A9889 /* libDocFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libDocFormatLib.a; path = ../../../../../build/lib/mac_64/libDocFormatLib.a; sourceTree = "<group>"; };
7CC744071F20E9BF006A9889 /* libdoctrenderer.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libdoctrenderer.dylib; path = ../../../../../build/lib/mac_64/libdoctrenderer.dylib; sourceTree = "<group>"; };
7CC744081F20E9BF006A9889 /* libDocxFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libDocxFormatLib.a; path = ../../../../../build/lib/mac_64/libDocxFormatLib.a; sourceTree = "<group>"; };
7CC744091F20E9BF006A9889 /* libgraphics.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgraphics.a; path = ../../../../../build/lib/mac_64/libgraphics.a; sourceTree = "<group>"; };
7CC7440A1F20E9BF006A9889 /* libHtmlFile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libHtmlFile.dylib; path = ../../../../../build/lib/mac_64/libHtmlFile.dylib; sourceTree = "<group>"; };
7CC7440B1F20E9BF006A9889 /* libHtmlRenderer.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libHtmlRenderer.dylib; path = ../../../../../build/lib/mac_64/libHtmlRenderer.dylib; sourceTree = "<group>"; };
7CC7440C1F20E9BF006A9889 /* liblibxml.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblibxml.a; path = ../../../../../build/lib/mac_64/liblibxml.a; sourceTree = "<group>"; };
7CC7440D1F20E9BF006A9889 /* libOdfFileReaderLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOdfFileReaderLib.a; path = ../../../../../build/lib/mac_64/libOdfFileReaderLib.a; sourceTree = "<group>"; };
7CC7440E1F20E9BF006A9889 /* libOdfFileWriterLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOdfFileWriterLib.a; path = ../../../../../build/lib/mac_64/libOdfFileWriterLib.a; sourceTree = "<group>"; };
7CC7440F1F20E9BF006A9889 /* libOfficeUtils.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOfficeUtils.a; path = ../../../../../build/lib/mac_64/libOfficeUtils.a; sourceTree = "<group>"; };
7CC744101F20E9BF006A9889 /* libPdfReader.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libPdfReader.dylib; path = ../../../../../build/lib/mac_64/libPdfReader.dylib; sourceTree = "<group>"; };
7CC744111F20E9BF006A9889 /* libPdfWriter.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libPdfWriter.dylib; path = ../../../../../build/lib/mac_64/libPdfWriter.dylib; sourceTree = "<group>"; };
7CC744121F20E9BF006A9889 /* libPptFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPptFormatLib.a; path = ../../../../../build/lib/mac_64/libPptFormatLib.a; sourceTree = "<group>"; };
7CC744131F20E9BF006A9889 /* libPPTXFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPPTXFormatLib.a; path = ../../../../../build/lib/mac_64/libPPTXFormatLib.a; sourceTree = "<group>"; };
7CC744141F20E9BF006A9889 /* libRtfFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRtfFormatLib.a; path = ../../../../../build/lib/mac_64/libRtfFormatLib.a; sourceTree = "<group>"; };
7CC744151F20E9BF006A9889 /* libTxtXmlFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTxtXmlFormatLib.a; path = ../../../../../build/lib/mac_64/libTxtXmlFormatLib.a; sourceTree = "<group>"; };
7CC744161F20E9BF006A9889 /* libUnicodeConverter.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libUnicodeConverter.dylib; path = ../../../../../build/lib/mac_64/libUnicodeConverter.dylib; sourceTree = "<group>"; };
7CC744171F20E9BF006A9889 /* libXlsFormatLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libXlsFormatLib.a; path = ../../../../../build/lib/mac_64/libXlsFormatLib.a; sourceTree = "<group>"; };
7CC744181F20E9BF006A9889 /* libXpsFile.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libXpsFile.dylib; path = ../../../../../build/lib/mac_64/libXpsFile.dylib; sourceTree = "<group>"; };
7CC7442F1F20E9D5006A9889 /* libicudata.55.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicudata.55.1.dylib; path = ../../../../../build/bin/icu/mac_64/libicudata.55.1.dylib; sourceTree = "<group>"; };
7CC744301F20E9D5006A9889 /* libicuuc.55.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicuuc.55.1.dylib; path = ../../../../../build/bin/icu/mac_64/libicuuc.55.1.dylib; sourceTree = "<group>"; };
7CC744331F20EAE6006A9889 /* libboost_date_time.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_date_time.a; path = ../../../../../Common/3dParty/boost/boost_1_58_0/build/mac_64/static/libboost_date_time.a; sourceTree = "<group>"; };
7CC744341F20EAE6006A9889 /* libboost_filesystem.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_filesystem.a; path = ../../../../../Common/3dParty/boost/boost_1_58_0/build/mac_64/static/libboost_filesystem.a; sourceTree = "<group>"; };
7CC744351F20EAE6006A9889 /* libboost_regex.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_regex.a; path = ../../../../../Common/3dParty/boost/boost_1_58_0/build/mac_64/static/libboost_regex.a; sourceTree = "<group>"; };
7CC744361F20EAE6006A9889 /* libboost_system.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libboost_system.a; path = ../../../../../Common/3dParty/boost/boost_1_58_0/build/mac_64/static/libboost_system.a; sourceTree = "<group>"; };
7CC7443B1F20F0A9006A9889 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
7CC7443D1F20F114006A9889 /* xmldom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmldom.cpp; path = ../../../../../DesktopEditor/xml/src/xmldom.cpp; sourceTree = "<group>"; };
7CC7443E1F20F114006A9889 /* xmllight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmllight.cpp; path = ../../../../../DesktopEditor/xml/src/xmllight.cpp; sourceTree = "<group>"; };
7CC744411F20F128006A9889 /* OfficeFileFormatChecker2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OfficeFileFormatChecker2.cpp; path = ../../../../../Common/OfficeFileFormatChecker2.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7CC743EB1F20E952006A9889 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7CC7443C1F20F0A9006A9889 /* AppKit.framework in Frameworks */,
7CC744371F20EAE6006A9889 /* libboost_date_time.a in Frameworks */,
7CC744381F20EAE6006A9889 /* libboost_filesystem.a in Frameworks */,
7CC744391F20EAE6006A9889 /* libboost_regex.a in Frameworks */,
7CC7443A1F20EAE6006A9889 /* libboost_system.a in Frameworks */,
7CC744311F20E9D5006A9889 /* libicudata.55.1.dylib in Frameworks */,
7CC744321F20E9D5006A9889 /* libicuuc.55.1.dylib in Frameworks */,
7CC744191F20E9BF006A9889 /* libASCOfficeDocxFile2Lib.a in Frameworks */,
7CC7441A1F20E9BF006A9889 /* libCryptoPPLib.a in Frameworks */,
7CC7441B1F20E9BF006A9889 /* libDjVuFile.dylib in Frameworks */,
7CC7441C1F20E9BF006A9889 /* libDocFormatLib.a in Frameworks */,
7CC7441D1F20E9BF006A9889 /* libdoctrenderer.dylib in Frameworks */,
7CC7441E1F20E9BF006A9889 /* libDocxFormatLib.a in Frameworks */,
7CC7441F1F20E9BF006A9889 /* libgraphics.a in Frameworks */,
7CC744201F20E9BF006A9889 /* libHtmlFile.dylib in Frameworks */,
7CC744211F20E9BF006A9889 /* libHtmlRenderer.dylib in Frameworks */,
7CC744221F20E9BF006A9889 /* liblibxml.a in Frameworks */,
7CC744231F20E9BF006A9889 /* libOdfFileReaderLib.a in Frameworks */,
7CC744241F20E9BF006A9889 /* libOdfFileWriterLib.a in Frameworks */,
7CC744251F20E9BF006A9889 /* libOfficeUtils.a in Frameworks */,
7CC744261F20E9BF006A9889 /* libPdfReader.dylib in Frameworks */,
7CC744271F20E9BF006A9889 /* libPdfWriter.dylib in Frameworks */,
7CC744281F20E9BF006A9889 /* libPptFormatLib.a in Frameworks */,
7CC744291F20E9BF006A9889 /* libPPTXFormatLib.a in Frameworks */,
7CC7442A1F20E9BF006A9889 /* libRtfFormatLib.a in Frameworks */,
7CC7442B1F20E9BF006A9889 /* libTxtXmlFormatLib.a in Frameworks */,
7CC7442C1F20E9BF006A9889 /* libUnicodeConverter.dylib in Frameworks */,
7CC7442D1F20E9BF006A9889 /* libXlsFormatLib.a in Frameworks */,
7CC7442E1F20E9BF006A9889 /* libXpsFile.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
7CC743E51F20E952006A9889 = {
isa = PBXGroup;
children = (
7CC744411F20F128006A9889 /* OfficeFileFormatChecker2.cpp */,
7CC7443D1F20F114006A9889 /* xmldom.cpp */,
7CC7443E1F20F114006A9889 /* xmllight.cpp */,
7CC743F91F20E97F006A9889 /* ASCConverters.cpp */,
7CC743FA1F20E97F006A9889 /* ASCConverters.h */,
7CC743FB1F20E97F006A9889 /* cextracttools.cpp */,
7CC743FC1F20E97F006A9889 /* cextracttools.h */,
7CC743FD1F20E97F006A9889 /* main.cpp */,
7CC743F01F20E952006A9889 /* x2t_macos */,
7CC743EF1F20E952006A9889 /* Products */,
7CC744021F20E9BF006A9889 /* Frameworks */,
);
sourceTree = "<group>";
};
7CC743EF1F20E952006A9889 /* Products */ = {
isa = PBXGroup;
children = (
7CC743EE1F20E952006A9889 /* x2t_macos */,
);
name = Products;
sourceTree = "<group>";
};
7CC743F01F20E952006A9889 /* x2t_macos */ = {
isa = PBXGroup;
children = (
);
path = x2t_macos;
sourceTree = "<group>";
};
7CC744021F20E9BF006A9889 /* Frameworks */ = {
isa = PBXGroup;
children = (
7CC7443B1F20F0A9006A9889 /* AppKit.framework */,
7CC744331F20EAE6006A9889 /* libboost_date_time.a */,
7CC744341F20EAE6006A9889 /* libboost_filesystem.a */,
7CC744351F20EAE6006A9889 /* libboost_regex.a */,
7CC744361F20EAE6006A9889 /* libboost_system.a */,
7CC7442F1F20E9D5006A9889 /* libicudata.55.1.dylib */,
7CC744301F20E9D5006A9889 /* libicuuc.55.1.dylib */,
7CC744031F20E9BF006A9889 /* libASCOfficeDocxFile2Lib.a */,
7CC744041F20E9BF006A9889 /* libCryptoPPLib.a */,
7CC744051F20E9BF006A9889 /* libDjVuFile.dylib */,
7CC744061F20E9BF006A9889 /* libDocFormatLib.a */,
7CC744071F20E9BF006A9889 /* libdoctrenderer.dylib */,
7CC744081F20E9BF006A9889 /* libDocxFormatLib.a */,
7CC744091F20E9BF006A9889 /* libgraphics.a */,
7CC7440A1F20E9BF006A9889 /* libHtmlFile.dylib */,
7CC7440B1F20E9BF006A9889 /* libHtmlRenderer.dylib */,
7CC7440C1F20E9BF006A9889 /* liblibxml.a */,
7CC7440D1F20E9BF006A9889 /* libOdfFileReaderLib.a */,
7CC7440E1F20E9BF006A9889 /* libOdfFileWriterLib.a */,
7CC7440F1F20E9BF006A9889 /* libOfficeUtils.a */,
7CC744101F20E9BF006A9889 /* libPdfReader.dylib */,
7CC744111F20E9BF006A9889 /* libPdfWriter.dylib */,
7CC744121F20E9BF006A9889 /* libPptFormatLib.a */,
7CC744131F20E9BF006A9889 /* libPPTXFormatLib.a */,
7CC744141F20E9BF006A9889 /* libRtfFormatLib.a */,
7CC744151F20E9BF006A9889 /* libTxtXmlFormatLib.a */,
7CC744161F20E9BF006A9889 /* libUnicodeConverter.dylib */,
7CC744171F20E9BF006A9889 /* libXlsFormatLib.a */,
7CC744181F20E9BF006A9889 /* libXpsFile.dylib */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7CC743ED1F20E952006A9889 /* x2t_macos */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7CC743F51F20E952006A9889 /* Build configuration list for PBXNativeTarget "x2t_macos" */;
buildPhases = (
7CC743EA1F20E952006A9889 /* Sources */,
7CC743EB1F20E952006A9889 /* Frameworks */,
7CC743EC1F20E952006A9889 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = x2t_macos;
productName = x2t_macos;
productReference = 7CC743EE1F20E952006A9889 /* x2t_macos */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
7CC743E61F20E952006A9889 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Oleg Korshul";
TargetAttributes = {
7CC743ED1F20E952006A9889 = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 7CC743E91F20E952006A9889 /* Build configuration list for PBXProject "x2t_macos" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 7CC743E51F20E952006A9889;
productRefGroup = 7CC743EF1F20E952006A9889 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7CC743ED1F20E952006A9889 /* x2t_macos */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
7CC743EA1F20E952006A9889 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7CC744001F20E97F006A9889 /* cextracttools.cpp in Sources */,
7CC743FF1F20E97F006A9889 /* ASCConverters.cpp in Sources */,
7CC7443F1F20F114006A9889 /* xmldom.cpp in Sources */,
7CC744011F20E97F006A9889 /* main.cpp in Sources */,
7CC744401F20F114006A9889 /* xmllight.cpp in Sources */,
7CC744421F20F128006A9889 /* OfficeFileFormatChecker2.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
7CC743F31F20E952006A9889 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = "@executable_path";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
_MAC,
MAC,
_LINUX,
LINUX,
UNICODE,
_USE_LIBXML2_READER_,
_USE_XMLLITE_READER_,
USE_LITE_READER,
PPTX_DEF,
PPT_DEF,
ENABLE_PPT_TO_PPTX_CONVERT,
FILTER_FLATE_DECODE_ENABLED,
CXIMAGE_DONT_DECLARE_TCHAR,
DONT_WRITE_EMBEDDED_FONTS,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
LIBXML_READER_ENABLED,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LIBRARY_SEARCH_PATHS = (
/Users/Oleg/Desktop/GIT/core/build/lib/mac_64,
/Users/Oleg/Desktop/GIT/core/Common/boost_1_58_0/stage/lib,
/Users/Oleg/Desktop/GIT/core/build/bin/icu/mac_64,
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-I./../../../../../Common/boost_1_58_0",
"-I./../../../../../DesktopEditor/xml/libxml2/include",
"-I./../../../../../DesktopEditor/freetype-2.5.2/include",
"-I./../../../../../DesktopEditor/agg-2.4/include",
"-I./../../../../../DesktopEditor/xml/build/qt",
);
SDKROOT = macosx;
};
name = Debug;
};
7CC743F41F20E952006A9889 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "@executable_path";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
_MAC,
MAC,
_LINUX,
LINUX,
UNICODE,
_USE_LIBXML2_READER_,
_USE_XMLLITE_READER_,
USE_LITE_READER,
PPTX_DEF,
PPT_DEF,
ENABLE_PPT_TO_PPTX_CONVERT,
FILTER_FLATE_DECODE_ENABLED,
CXIMAGE_DONT_DECLARE_TCHAR,
DONT_WRITE_EMBEDDED_FONTS,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
LIBXML_READER_ENABLED,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LIBRARY_SEARCH_PATHS = (
/Users/Oleg/Desktop/GIT/core/build/lib/mac_64,
/Users/Oleg/Desktop/GIT/core/Common/boost_1_58_0/stage/lib,
/Users/Oleg/Desktop/GIT/core/build/bin/icu/mac_64,
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = (
"-I./../../../../../Common/boost_1_58_0",
"-I./../../../../../DesktopEditor/xml/libxml2/include",
"-I./../../../../../DesktopEditor/freetype-2.5.2/include",
"-I./../../../../../DesktopEditor/agg-2.4/include",
"-I./../../../../../DesktopEditor/xml/build/qt",
);
SDKROOT = macosx;
};
name = Release;
};
7CC743F61F20E952006A9889 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
7CC743F71F20E952006A9889 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7CC743E91F20E952006A9889 /* Build configuration list for PBXProject "x2t_macos" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7CC743F31F20E952006A9889 /* Debug */,
7CC743F41F20E952006A9889 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7CC743F51F20E952006A9889 /* Build configuration list for PBXNativeTarget "x2t_macos" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7CC743F61F20E952006A9889 /* Debug */,
7CC743F71F20E952006A9889 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 7CC743E61F20E952006A9889 /* Project object */;
}

View File

@ -3333,11 +3333,6 @@ void BinaryCommentReader::addThreadedComment(OOX::Spreadsheet::CSi& oSi, OOX::Sp
pText->m_sText.append(L"\n\n");
}
}
//Fix Excel recovery error
if (pText->m_sText.length() > OOX::Spreadsheet::SpreadsheetCommon::MAX_STRING_LEN)
{
pText->m_sText.erase(OOX::Spreadsheet::SpreadsheetCommon::MAX_STRING_LEN);
}
oSi.m_arrItems.push_back(pText);
}