Compare commits

..

35 Commits

Author SHA1 Message Date
44491bbbb4 v5.0.7 2018-01-15 15:18:16 +03:00
5039cec847 diagramm save error 2017-12-19 15:09:10 +03:00
b8b8a14268 fix bug 36524 (fix MathType equation) 2017-12-15 14:47:57 +03:00
e5ef749718 . 2017-12-15 12:24:35 +03:00
1a8af4d8ed x2t - fix users file 2017-12-13 15:11:16 +03:00
cdf8dc7a4c Changed cef update condition 2017-12-13 12:55:54 +03:00
548c5ab608 x2t - fix users files 2017-12-13 11:59:49 +03:00
d70f36e36d DocFormat - fix users files 2017-12-12 19:41:50 +03:00
60cf51ad0d Move ASCDOCUMENTSCORE to separated target 2017-12-12 16:30:44 +03:00
8e7231b322 removed unused code 2017-12-12 12:43:33 +03:00
2b339b6842 Cherrypick from develop 2017-12-12 12:43:03 +03:00
fb0dbfc231 Cherrypick from develop 2017-12-12 12:40:28 +03:00
ede03fafea for b599a6bc43 to fix build error 2017-12-11 19:52:44 +03:00
260c2edd21 . 2017-12-11 18:42:11 +03:00
3eeec8fc67 RtfFormat - fix users file 2017-12-11 18:39:37 +03:00
41a213491e fix image content type 2017-12-11 13:45:28 +03:00
b599a6bc43 Add open/save JsaProject.bin for OnlyOffice Macros 2017-12-11 13:31:48 +03:00
20b781cb7e pdf checker bug 2017-12-06 18:50:09 +03:00
e7bbbec0de v5.0.5 2017-11-27 17:06:49 +03:00
875717acd4 Add m_sSavePassword (m_sPassword - only for open) 2017-11-23 18:40:31 +03:00
d1227f7759 x2t - add native commands for crypt file 2017-11-23 17:28:28 +03:00
dce58b628f fix bug #36322 2017-11-21 18:10:05 +03:00
bae854027b fix bug #36380
Problem with picture in footnote
2017-11-17 13:18:20 +03:00
07562a9582 v5.0.4 2017-11-13 17:44:36 +03:00
f53c3d9f50 Merge pull request #51 from ONLYOFFICE/feature/pre5.0.4
pdf reader bug
2017-11-07 10:40:46 +03:00
b0f0f656af Merge pull request #50 from ONLYOFFICE/feature/bug36176
fix bug 36176
2017-11-02 18:00:26 +03:00
e69c1677b2 v5.0.3 2017-10-31 18:49:25 +03:00
e1340c63ec pdf reader bug 2017-10-30 15:06:43 +03:00
867438833b fix bug 36176 2017-10-30 13:40:57 +03:00
4dae8f50fa Merge pull request #47 from ONLYOFFICE/feature/ooxmlsign
Feature/ooxmlsign
2017-10-18 19:08:30 +03:00
9cc5ed1db0 . 2017-10-18 19:03:58 +03:00
6d1dd9c420 ms crypto bug 2017-10-18 18:58:04 +03:00
549e3dc579 Merge pull request #46 from ONLYOFFICE/feature/crypt
crypto fix padding size
2017-10-17 13:01:29 +03:00
8440b18223 crypto fix padding size 2017-10-17 12:57:47 +03:00
470eddf2b1 Merge 2017-10-13 14:43:33 +03:00
648 changed files with 132985 additions and 117367 deletions

View File

@ -501,7 +501,7 @@ namespace DocFileFormat
facet.widen((char*)bytes, (char*)bytes + size, &result[0]);
for (size_t i=0; i < result.length(); i++)
for (long i=0; i < result.length(); i++)
{
STLCollection->push_back(result[i]);
}
@ -536,7 +536,7 @@ namespace DocFileFormat
delete [] pStrUtf16;
return GetSTLCollectionFromLocale(STLCollection, bytes,size);
}
for (unsigned int i = 0; i < nLength; i++)
for (long i=0; i < nLength; i++)
{
STLCollection->push_back(pStrUtf16[i]);
}
@ -566,7 +566,7 @@ namespace DocFileFormat
delete [] pStrUtf32;
return GetSTLCollectionFromLocale(STLCollection, bytes, size);
}
for (unsigned int i = 0; i < nLength; i++)
for (long i=0; i < nLength; i++)
{
STLCollection->push_back(pStrUtf32[i]);
}
@ -652,7 +652,7 @@ namespace DocFileFormat
NSUnicodeConverter::CUnicodeConverter oConverter;
std::wstring unicode_string = oConverter.toUnicode((char*)bytes, size, sCodePage.c_str());
for (size_t i = 0; i < unicode_string.size(); i++)
for (long i=0; i < unicode_string.size(); i++)
{
STLCollection->push_back(unicode_string[i]);
}

View File

@ -809,7 +809,13 @@ namespace DocFileFormat
{
if (_fldCharCounter > 0)
{
XMLTools::XMLElement elem( L"w:fldChar" );
if (_writeInstrText == true && !text.empty())
{
writeTextElement(text, textType);
text.clear();
}
_writeInstrText = false;
XMLTools::XMLElement elem( L"w:fldChar" );
elem.AppendAttribute( L"w:fldCharType", L"end" );
m_pXmlWriter->WriteString( elem.GetXMLString());

View File

@ -33,6 +33,8 @@
#include "IMapping.h"
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
namespace DocFileFormat
{
class IVisitable

View File

@ -53,62 +53,31 @@ namespace DocFileFormat
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize, std::vector<_guides> & guides)
{
int offset = 6;
if ((pSegmentInfo != NULL) && (pSegmentInfoSize > 0))
{
int offset = 6;
unsigned short nElems = FormatUtils::BytesToUInt16(pSegmentInfo, 0, pSegmentInfoSize);
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pSegmentInfo, 2, pSegmentInfoSize);
unsigned short cb = FormatUtils::BytesToUInt16(pSegmentInfo, 4, pSegmentInfoSize);
// видимо без шапки сразу пишутся все элементы
bool headerIs = ((0xfff0 != cb) && (cb > 8) || nElems > nElemsAlloc);
if (headerIs)
{
cb = 2;
offset = 0;
nElems = pSegmentInfoSize / 2;
unsigned short cbElement = 4;
for (unsigned short i = 0; i < nElems; ++i)
{
PathSegment oSegment = PathSegment(FormatUtils::BytesToUInt16(pSegmentInfo + offset, (i * cb), pSegmentInfoSize));
m_arSegments.push_back (oSegment);
}
}
else
if (cb == 0xfff0)
cbElement = 2;
if (nElems == 0)
{
if ((0xfff0 != cb) && (8 != cb) && (4 != cb) && (2 != cb))
{
cb = 0xfff0;
offset = 0;
nElems = pSegmentInfoSize / 2;
}
if (0xfff0 == cb)
{
cb = 4;
for (unsigned short i = 0; i < nElems; ++i)
{
PathSegment oSegment = PathSegment(FormatUtils::BytesToUInt16(pSegmentInfo + offset, (i * cb), pSegmentInfoSize));
m_arSegments.push_back (oSegment);
}
}
else
{
if ((2 != cb) && (1 != cb))
cb = 8;
for (unsigned short i = 0; i < nElems; ++i)
{
PathSegment oSegment = PathSegment(FormatUtils::BytesToInt32(pSegmentInfo + offset, (i * cb), pSegmentInfoSize));
m_arSegments.push_back (oSegment);
}
if ((long)pSegmentInfoSize < (long)(cb*nElems)) // Есть несколько файлов с мусором вместо данных
m_arSegments.clear();
}
nElems = (pSegmentInfoSize - offset) / cbElement;
}
for (unsigned short i = 0; i < nElems; ++i)
{
PathSegment oSegment = PathSegment(FormatUtils::BytesToInt32(pSegmentInfo + offset, (i * cbElement), pSegmentInfoSize - offset));
m_arSegments.push_back (oSegment);
}
if ((long)pSegmentInfoSize < (long)(cb * nElems)) // Есть несколько файлов с мусором вместо данных
m_arSegments.clear();
}
if ((NULL != pVertices) && (pVerticesSize > 0))
@ -117,19 +86,23 @@ namespace DocFileFormat
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pVertices, 2, pVerticesSize);
unsigned short cb = FormatUtils::BytesToUInt16(pVertices, 4, pVerticesSize);
unsigned short cbElement = cb;
if (cb == 0xfff0)
cbElement = 4;
for (unsigned short i = 0; i < nElems; ++i)
{
POINT point;
if (0xfff0 == cb)
if (cbElement == 4)
{
cb = 4;
point.x = FormatUtils::BytesToInt16(pVertices + 6, (i * cb), pVerticesSize);
point.y = FormatUtils::BytesToInt16(pVertices + 6, (i * cb) + (cb / 2), pVerticesSize);
point.x = FormatUtils::BytesToInt16(pVertices + offset, (i * cbElement), pVerticesSize - offset);
point.y = FormatUtils::BytesToInt16(pVertices + offset, (i * cbElement) + (cbElement / 2), pVerticesSize - offset);
}
else
{
point.x = FormatUtils::BytesToInt32(pVertices + 6, (i * cb), pVerticesSize);
point.y = FormatUtils::BytesToInt32(pVertices + 6, (i * cb) + (cb / 2), pVerticesSize);
point.x = FormatUtils::BytesToInt32(pVertices + offset, (i * cbElement), pVerticesSize - offset);
point.y = FormatUtils::BytesToInt32(pVertices + offset, (i * cbElement) + (cbElement / 2), pVerticesSize - offset);
}
LONG lMinF = (LONG)0x80000000;

View File

@ -462,57 +462,60 @@ namespace DocFileFormat
void PropertiesMapping::appendShading( XMLTools::XMLElement* parent, const ShadingDescriptor& desc )
{
std::wstring pattern = getShadingPattern( desc );
if ( ( parent != NULL ) && ( desc.shadingSpecialValue == shadingSpecialValueNormal ))
{
XMLTools::XMLElement shd( L"w:shd" );
//fill color
XMLTools::XMLAttribute fill( L"w:fill" );
if ( desc.shadingType == shadingTypeShd )
{
if ( desc.cvBackAuto )
{
fill.SetValue( L"auto" );
}
else
{
fill.SetValue( RGBColor( (int)desc.cvBack, RedLast ).SixDigitHexCode);
}
}
else
{
fill.SetValue( FormatUtils::MapValueToWideString( desc.icoBack, &Global::ColorIdentifier[0][0], 17, 12 ));
}
shd.AppendAttribute( fill );
//foreground color
XMLTools::XMLAttribute color( L"w:color" );
if ( desc.shadingType == shadingTypeShd )
{
if ( desc.cvForeAuto )
{
color.SetValue( L"auto" );
}
else
{
color.SetValue( RGBColor( (int)desc.cvFore, RedLast ).SixDigitHexCode);
}
}
else
{
color.SetValue( FormatUtils::MapValueToWideString( desc.icoFore, &Global::ColorIdentifier[0][0], 17, 12 ));
}
shd.AppendAttribute( color );
//pattern
XMLTools::XMLAttribute val( L"w:val" );
val.SetValue( getShadingPattern( desc ));
val.SetValue( pattern);
shd.AppendAttribute( val );
if (pattern != L"nil")
{
//fill color
XMLTools::XMLAttribute fill( L"w:fill" );
if ( desc.shadingType == shadingTypeShd )
{
if ( desc.cvBackAuto )
{
fill.SetValue( L"auto" );
}
else
{
fill.SetValue( RGBColor( (int)desc.cvBack, RedLast ).SixDigitHexCode);
}
}
else
{
fill.SetValue( FormatUtils::MapValueToWideString( desc.icoBack, &Global::ColorIdentifier[0][0], 17, 12 ));
}
shd.AppendAttribute( fill );
//foreground color
XMLTools::XMLAttribute color( L"w:color" );
if ( desc.shadingType == shadingTypeShd )
{
if ( desc.cvForeAuto )
{
color.SetValue( L"auto" );
}
else
{
color.SetValue( RGBColor( (int)desc.cvFore, RedLast ).SixDigitHexCode);
}
}
else
{
color.SetValue( FormatUtils::MapValueToWideString( desc.icoFore, &Global::ColorIdentifier[0][0], 17, 12 ));
}
shd.AppendAttribute( color );
}
parent->RemoveChildByName( L"w:shd" );
parent->AppendChild( shd );
}

View File

@ -174,9 +174,9 @@ namespace DocFileFormat
//it's a Word 97 SPRM
short val = FormatUtils::BytesToInt16(bytes, 0, size);
icoFore = (val & 0x1F);
icoBack = ((val >> 5) & 0x1F);
ipat = (ShadingPattern) ((val >> 10) & 0x3F);
icoFore = GETBITS(val, 0, 4);
icoBack = GETBITS(val, 5, 9);
ipat = (ShadingPattern) GETBITS(val, 10, 15);
shadingType = shadingTypeShd80;
@ -209,7 +209,7 @@ namespace DocFileFormat
else if (0x0F == icoFore) { cvFore = RGB2 (0x80, 0x80, 0x80); }
else if (0x10 == icoFore) { cvFore = RGB2 (0xC0, 0xC0, 0xC0); }
if (0x00 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0x00); cvBackAuto = true; }
if (0x00 == icoBack) { cvBack = RGB2 (0xFF, 0xFF, 0xFF); cvBackAuto = true; }
else if (0x01 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0x00); }
else if (0x02 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0xFF); }
else if (0x03 == icoBack) { cvBack = RGB2 (0x00, 0xFF, 0xFF); }

View File

@ -349,7 +349,7 @@ namespace DocFileFormat
void TableCellPropertiesMapping::apppendCellShading (unsigned char* sprmArg, int size, int cellIndex)
{
if (sprmArg)
if (sprmArg && cellIndex >= 0)
{
//shading descriptor can have 10 bytes (Word 2000) or 2 bytes (Word 97)
int shdLength = 2;

View File

@ -288,6 +288,7 @@ namespace DocFileFormat
int ndyTextBottom = -1;
bool bHavePath = false;
int nShapePath = -1;
int nAdjValues = 0;
int nLTxID = -1;
@ -361,6 +362,7 @@ namespace DocFileFormat
case shapePath :
{
bHavePath = true;
nShapePath = iter->op;
}break;
case pVertices:
{
@ -1653,7 +1655,7 @@ namespace DocFileFormat
}
if (!bRelV && m_pSpa)
{
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->bx));
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->by));
}
if (!m_isInlineShape && !bZIndex)
{

View File

@ -29,19 +29,16 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
// DocFormatTest.cpp : Defines the entry point for the console application.
//
#include "../DocFormatLib/DocFormatLib.h"
#include "../../OfficeUtils/src/ASCOfficeCriticalSection.h"
#include <iostream>
#include "../../Common/DocxFormat/Source/Base/Base.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../DocFormatLib/DocFormatLib.h"
#include <string>
#include <windows.h>
#include <tchar.h>
#pragma comment(lib,"Shell32.lib")
#pragma comment(lib,"Advapi32.lib")
#if defined(_WIN64)
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
@ -49,36 +46,34 @@
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
#endif
int _tmain(int argc, _TCHAR* argv[])
HRESULT convert_single(std::wstring srcFileName)
{
if (argc < 2) return 1;
HRESULT hr = S_OK;
std::wstring sSrcDoc = argv[1];
std::wstring sDstDocx;
std::wstring outputDir = NSDirectory::GetFolderPath(sSrcDoc);
std::wstring outputDir = NSDirectory::GetFolderPath(srcFileName);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstPath;
COfficeDocFile docFile;
docFile.m_sTempFolder = outputDir;
bool bMacros = true;
HRESULT hRes = docFile.LoadFromFile( sSrcDoc, dstTempPath, L"password", bMacros, NULL);
HRESULT hRes = docFile.LoadFromFile( srcFileName, dstTempPath, L"password", bMacros, NULL);
if (bMacros)
{
sDstDocx = sSrcDoc + L"-my.docm";
dstPath = srcFileName + L"-my.docm";
}
else
{
sDstDocx = sSrcDoc + L"-my.docx";
dstPath = srcFileName + L"-my.docx";
}
if (hRes == S_OK)
{
COfficeUtils oCOfficeUtils(NULL);
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstDocx, -1);
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath, -1);
}
NSDirectory::DeleteDirectory(dstTempPath);
@ -86,3 +81,33 @@ int _tmain(int argc, _TCHAR* argv[])
return hRes;
}
HRESULT convert_directory(std::wstring pathName)
{
HRESULT hr = S_OK;
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(pathName, false);
for (size_t i = 0; i < arFiles.size(); i++)
{
convert_single(arFiles[i]);
}
return S_OK;
}
int _tmain(int argc, _TCHAR* argv[])
{
if (argc < 2) return 1;
HRESULT hr = -1;
if (NSFile::CFileBinary::Exists(argv[1]))
{
hr = convert_single(argv[1]);
}
else if (NSDirectory::Exists(argv[1]))
{
hr = convert_directory(argv[1]);
}
return hr;
}

View File

@ -66,10 +66,10 @@ namespace Writers
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_ftr_End = _T("</w:ftr>");
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_footnotes_End = _T("</w:footnotes>");
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_endnotes_End = _T("</w:endnotes>");
class HeaderFooterWriter

View File

@ -36,7 +36,7 @@ namespace BinDocxRW {
int Binary_VbaProjectTableReader::Read()
{
m_oFileWriter.m_pVbaProject = new OOX::VbaProject();
m_oFileWriter.m_pVbaProject = new OOX::VbaProject();
m_oFileWriter.m_pVbaProject->fromPPTY(&m_oBufferedStream);
return c_oSerConstants::ReadOk;
@ -118,4 +118,4 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItemContent(BYTE type, long length, void
return pBinary_DocumentTableReader->ReadDocumentContent(type, length, NULL);
}
}
}

View File

@ -285,7 +285,7 @@ public:
}
int Read ();
};
};
class Binary_HdrFtrTableReader : public Binary_CommonReader<Binary_HdrFtrTableReader>
{
@ -885,11 +885,6 @@ public:
pCStringWriter->WriteString(oSectPr.Write());
pCStringWriter->WriteString(std::wstring(_T("</w:sectPr>")));
}break;
case c_oSerProp_pPrType::outlineLvl:
{
long outlineLvl = m_oBufferedStream.GetLong();
pCStringWriter->WriteString(L"<w:outlineLvl w:val=\"" + std::to_wstring(outlineLvl) + L"\"/>");
}break;
default:
res = c_oSerConstants::ReadUnknown;
break;
@ -3713,6 +3708,21 @@ public:
res = Read2(length, &Binary_DocumentTableReader::Read_Background, this, &oBackground);
m_oDocumentWriter.m_oBackground.WriteString(oBackground.Write());
}
else if(c_oSerParType::JsaProject == type)
{
BYTE* pData = m_oBufferedStream.GetPointer(length);
OOX::CPath sJsaProject = OOX::FileTypes::JsaProject.DefaultFileName();
std::wstring filePath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word"+ FILE_SEPARATOR_STR + sJsaProject.GetPath();
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath);
oFile.WriteFile(pData, length);
oFile.CloseFile();
long lId;
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::JsaProject.RelationType(), sJsaProject.GetPath(), L"", &lId);
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(sJsaProject.GetExtention(false));
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -7069,21 +7079,22 @@ public:
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(nChartIndex) + L".xlsx";
std::wstring sXlsxPath = pathChartsWorksheetDir.GetPath() + FILE_SEPARATOR_STR + sXlsxFilename;
BinXlsxRW::CXlsxSerializer oXlsxSerializer;
oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace);
if (oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace))
{
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rIdXlsx;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rIdXlsx;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx);
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(L"xlsx");
pChartSpace->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
pChartSpace->m_oChartSpace.m_externalData->m_id = new std::wstring();
pChartSpace->m_oChartSpace.m_externalData->m_id->append(L"rId");
pChartSpace->m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rIdXlsx));
pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx);
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(L"xlsx");
pChartSpace->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
pChartSpace->m_oChartSpace.m_externalData->m_id = new std::wstring();
pChartSpace->m_oChartSpace.m_externalData->m_id->append(L"rId");
pChartSpace->m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rIdXlsx));
pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
}
//save chart.xml
NSStringUtils::CStringBuilder sw;

View File

@ -144,9 +144,13 @@ namespace MathEquation
void AddAccent (MEMBELTYPE eType)
{
LONG lPos = GetSize() - 1;
if (lPos < 0) return;
EquationRun oRun;
oRun = arrRun[lPos];
RemoveElem(lPos);
oRun.bAccent = true;
oRun.eType = eType;
Add(oRun);
@ -557,11 +561,11 @@ namespace MathEquation
BYTE horAlign;
switch(eHorAlign)
{
case matrixhoralignLeft: horAlign = SimpleTypes::xalignLeft;
case matrixhoralignCenter: horAlign = SimpleTypes::xalignCenter;
case matrixhoralignRight: horAlign = SimpleTypes::xalignRight;
case matrixhoralignEqualSign: horAlign = SimpleTypes::xalignCenter;
case matrixhoralignCommaSign: horAlign = SimpleTypes::xalignCenter;
case matrixhoralignLeft: horAlign = SimpleTypes::xalignLeft; break;
case matrixhoralignCenter: horAlign = SimpleTypes::xalignCenter; break;
case matrixhoralignRight: horAlign = SimpleTypes::xalignRight; break;
case matrixhoralignEqualSign: horAlign = SimpleTypes::xalignCenter; break;
case matrixhoralignCommaSign: horAlign = SimpleTypes::xalignCenter; break;
}
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::McJc, horAlign);
@ -614,7 +618,7 @@ namespace MathEquation
nRows = m_aRowsCounter.top();
m_aRowsCounter.pop();
}
int nPos = 0;
int nPos = m_oStream.GetPosition();
if (!m_aRowsPosCounter.empty())
{
nPos = m_aRowsPosCounter.top();
@ -1675,7 +1679,7 @@ namespace MathEquation
void WriteEndNode(BinaryEquationWriter* pWriter)
{
int nCurPos;
int nCurPos = -1;
if (!m_aBaseStack.empty())
{
nCurPos = m_aBaseStack.top();
@ -1687,14 +1691,20 @@ namespace MathEquation
}
if (bPile && bEqArrayStart)
{
pWriter->WriteItemEnd(nCurPos);
}
else if (!bPile && !bEqArrayStart)
{
pWriter->WriteItemEnd(nCurPos);
}
else if (!bPile && bEqArrayStart)
{
pWriter->m_aRowsCounter.push(nRows);
bEqArrayStart = false;
pWriter->WriteItemEnd(nCurPos);//eqArr
if (nCurPos > 0)
pWriter->WriteItemEnd(nCurPos);//eqArr
if (!m_aBaseStack.empty())
{

View File

@ -344,8 +344,7 @@ extern int g_nCurFormatVersion;
FramePr = 30,
SectPr = 31,
numPr_Ins = 32,
pPrChange = 33,
outlineLvl = 34
pPrChange = 33
};}
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
{
@ -475,7 +474,8 @@ extern int g_nCurFormatVersion;
MoveFromRangeStart = 18,
MoveFromRangeEnd = 19,
MoveToRangeStart = 20,
MoveToRangeEnd = 21
MoveToRangeEnd = 21,
JsaProject = 22
};}
namespace c_oSerDocTableType{enum c_oSerDocTableType
{

View File

@ -1024,12 +1024,6 @@ namespace BinDocxRW
WritePPrChange(pPr.m_oPPrChange.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(pPr.m_oOutlineLvl.IsInit() && pPr.m_oOutlineLvl->m_oVal.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::outlineLvl);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
m_oBcw.m_oStream.WriteLONG(pPr.m_oOutlineLvl->m_oVal->GetValue());
}
//SectPr
if(NULL != m_oBinaryHeaderFooterTableWriter && pPr.m_oSectPr.IsInit())
{
@ -3003,6 +2997,7 @@ namespace BinDocxRW
Binary_tblPrWriter btblPrs;
OOX::Logic::CSectionProperty* pSectPr;
OOX::Logic::CBackground * pBackground;
OOX::CDocument* poDocument;
bool m_bWriteSectPr;//Записывать ли свойства верхнего уровня в данном экземпляре BinaryOtherTableWriter
//---------------------------------
@ -3011,6 +3006,7 @@ namespace BinDocxRW
{
pBackground = NULL;
pSectPr = NULL;
poDocument = NULL;
m_bWriteSectPr = false;
m_eFldState = SimpleTypes::fldchartypeEnd;
}
@ -3115,6 +3111,23 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
}
}
//Write JsaProject
if (NULL != poDocument)
{
smart_ptr<OOX::File> pFile = poDocument->Get(OOX::FileTypes::JsaProject);
if (pFile.IsInit() && OOX::FileTypes::JsaProject == pFile->type())
{
OOX::JsaProject& jsaProject = pFile.as<OOX::JsaProject>();
BYTE* pData = NULL;
DWORD nBytesCount;
if(NSFile::CFileBinary::ReadAllBytes(jsaProject.filename().GetPath(), &pData, nBytesCount))
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::JsaProject);
m_oBcw.m_oStream.WriteBYTEArray(pData, nBytesCount);
m_oBcw.WriteItemEnd(nCurPos);
}
}
}
}
void WriteBackground (OOX::Logic::CBackground* pBackground)
{
@ -7886,6 +7899,7 @@ namespace BinDocxRW
oBinaryDocumentTableWriter.pSectPr = pFirstSectPr;
oBinaryDocumentTableWriter.pBackground = poDocument->m_oBackground.GetPointer();
oBinaryDocumentTableWriter.poDocument = poDocument;
oBinaryDocumentTableWriter.m_bWriteSectPr = true;
//Write Vba

View File

@ -658,8 +658,7 @@ namespace BinXlsxRW{
std::wstring wb, sheetFrom, sheetTo;
int nRow1, nCol1, nRow2, nCol2;
if(OOX::Spreadsheet::CCell::parse3DRef(*pStrRef->m_f, wb, sheetFrom, sheetTo, nRow1, nCol1, nRow2, nCol2) &&
sheetFrom.length() > 0 && 0 == wb.length() && 0 == sheetTo.length() &&
NULL != pStrRef->m_strCache)
sheetFrom.length() > 0 && 0 == sheetTo.length() && NULL != pStrRef->m_strCache)
{
bool bRow = nRow1 == nRow2;
if(bUpdateRange)
@ -727,7 +726,7 @@ namespace BinXlsxRW{
std::wstring wb, sheetFrom, sheetTo;
int nRow1, nCol1, nRow2, nCol2;
if(OOX::Spreadsheet::CCell::parse3DRef(*pNumRef->m_f, wb, sheetFrom, sheetTo, nRow1, nCol1, nRow2, nCol2) &&
sheetFrom.length() > 0 && 0 == wb.length() && 0 == sheetTo.length() && NULL != pNumRef->m_numCache)
sheetFrom.length() > 0 && 0 == sheetTo.length() && NULL != pNumRef->m_numCache)
{
bool bRow = nRow1 == nRow2;
if(bUpdateRange)

View File

@ -95,7 +95,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, co
oDrawingConverter.SetMainDocument(this);
oDrawingConverter.SetDstPath(pathMain.GetDirectory() + FILE_SEPARATOR_STR + L"word");
oDrawingConverter.SetMediaDstPath(pathMedia.GetPath());
oDrawingConverter.SetMediaDstPath(pathMedia.GetPath());
m_pParamsWriter = new ParamsWriter(&oBufferedStream, &fp, &oDrawingConverter, pEmbeddedFontsManager);
@ -265,10 +265,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
if (NULL != pData)
{
oDrawingConverter.SetMainDocument(this);
oDrawingConverter.SetMainDocument(this);
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"word");
oDrawingConverter.SetMediaDstPath(sMediaPath);
oDrawingConverter.SetMediaDstPath(sMediaPath);
oDrawingConverter.SetEmbedDstPath(sEmbedPath);
m_pCurFileWriter = new Writers::FileWriter(sDstPath, m_sFontDir, false, nVersion, m_bSaveChartAsImg, &oDrawingConverter, sThemePath);

View File

@ -88,12 +88,12 @@ namespace BinXlsxRW{
{
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
NSBinPptxRW::CDrawingConverter oDrawingConverter;
NSBinPptxRW::CDrawingConverter oDrawingConverter;
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"xl");
oDrawingConverter.SetSrcPath(strFileInDir, 2);
oDrawingConverter.SetMediaDstPath(sMediaDir);
oDrawingConverter.SetMediaDstPath(sMediaDir);
oDrawingConverter.SetEmbedDstPath(sEmbedDir);
BinXlsxRW::BinaryFileReader oBinaryFileReader;
@ -181,20 +181,22 @@ namespace BinXlsxRW{
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(lChartNumber) + L".xlsx";
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
writeChartXlsx(sXlsxPath, oChartSpace);
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
if (writeChartXlsx(sXlsxPath, oChartSpace))
{
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rId;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rId;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
oChartSpace.m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
oChartSpace.m_oChartSpace.m_externalData->m_id = new std::wstring();
oChartSpace.m_oChartSpace.m_externalData->m_id->append(L"rId");
oChartSpace.m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rId));
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
oChartSpace.m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
oChartSpace.m_oChartSpace.m_externalData->m_id = new std::wstring();
oChartSpace.m_oChartSpace.m_externalData->m_id->append(L"rId");
oChartSpace.m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rId));
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
}
}
std::wstring strFilepath = sFilepath;
@ -233,7 +235,7 @@ namespace BinXlsxRW{
m_bIsNoBase64 = bIsNoBase64;
}
void CXlsxSerializer::writeChartXlsx(const std::wstring& sDstFile, const OOX::Spreadsheet::CChartSpace& oChart)
bool CXlsxSerializer::writeChartXlsx(const std::wstring& sDstFile, const OOX::Spreadsheet::CChartSpace& oChart)
{
//анализируем chart
BinXlsxRW::ChartWriter helper;
@ -252,11 +254,15 @@ namespace BinXlsxRW{
helper.toXlsx(oXlsx);
//write
OOX::CContentTypes oContentTypes;
oXlsx.Write(oPath, oContentTypes);
//zip
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true);
bool res = oXlsx.Write(oPath, oContentTypes);
if (res)
{
//zip
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true);
}
//clean
NSDirectory::DeleteDirectory(sTempDir);
return res;
}
};

View File

@ -72,7 +72,7 @@ namespace BinXlsxRW {
void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter);
void setIsNoBase64 (bool bIsNoBase64);
void writeChartXlsx (const std::wstring& sDstFile ,const OOX::Spreadsheet::CChartSpace& oChart);
bool writeChartXlsx (const std::wstring& sDstFile ,const OOX::Spreadsheet::CChartSpace& oChart);
};
}
#endif // #ifndef XLSX_SERIALIZER

View File

@ -314,7 +314,7 @@
17E17ED41AC453F800BEA2EA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "Ascensio System SIA";
};
buildConfigurationList = 17E17ED71AC453F800BEA2EA /* Build configuration list for PBXProject "ASCOfficeDocxFile2Lib" */;
@ -402,7 +402,6 @@
EXECUTABLE_PREFIX = lib;
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
@ -442,21 +441,13 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
@ -464,7 +455,6 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@ -477,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
@ -493,21 +483,13 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
@ -515,14 +497,13 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
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;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;

View File

@ -154,7 +154,7 @@ namespace cpdoccore
if (val)
{
std::wstring tmp = *val;
tmp = XmlUtils::GetLower(tmp);
XmlUtils::GetLower(tmp);
return optional<bool>::Type((tmp == xml_char_value_type::trueVal));
}
else

View File

@ -55,8 +55,8 @@ public:
void add_format(std::wstring const & condition, std::wstring const & format)
{
std::wstring c = XmlUtils::GetLower(condition);
std::wstring c = condition;
XmlUtils::GetLower(c);
XmlUtils::replace_all( c, L" ", L"");
XmlUtils::replace_all( c, L"\t", L"");

View File

@ -70,22 +70,9 @@ public:
std::wstring sVal;
std::wstring sNode;
};
struct _reference
{
std::wstring name;
int type = -1;
std::wstring member_name;
int member_type = -1;
};
struct _group
{
std::wstring name;
std::vector<_field_value> caches;
};
struct _field
{
std::wstring name;
std::wstring display_name;
int type = -1;
int hierarchy = -1;
int function = -1;
@ -93,20 +80,13 @@ public:
bool data_layout = false;
bool show_empty = false;
bool repeat_item_labels = true;
int type_groups = 0;
int sort = 0;
std::wstring source_groups;
std::vector<int> subtotals;
std::vector<_field_value> caches;
std::vector<_reference> references;
int references_field = -1;
bool used_in_referenes = false;
int type_groups = 0;
int base_group = -1;
std::wstring source_groups;
std::vector<_group> groups;
std::vector<int> groups_discrete;
bool bDataFieldEnabled = false;
bool bString = false;
@ -162,10 +142,8 @@ public:
bool identify_categories = false;
bool drill_enabled = true;
bool ignore_empty_rows = false;
bool data_on_row = false;
bool in_group = false;
}current_;
void sort_fields();
@ -281,162 +259,17 @@ xlsx_pivots_context::xlsx_pivots_context() : impl_(new xlsx_pivots_context::Impl
}
void xlsx_pivots_context::Impl::sort_fields()
{
size_t count_skip = 0;
for (size_t i = 0; i < current_.fields.size() - count_skip; i++)
for (size_t i = 0; i < current_.fields.size(); i++)
{
if (!current_.fields[i].source_groups.empty() && i != current_.fields.size() - count_skip)
{
current_.fields.push_back(current_.fields[i]);
current_.fields.erase(current_.fields.begin() + i , current_.fields.begin() + i + 1);
i--;
count_skip++;
}
}
count_skip = 0;
for (size_t i = 0; i < current_.fields.size() - count_skip; i++)
{
if (current_.fields[i].name.empty() && i != current_.fields.size() - count_skip)
{
current_.fields.push_back(current_.fields[i]);
current_.fields.erase(current_.fields.begin() + i , current_.fields.begin() + i + 1);
i--;
count_skip++;
}
}
bool bEmptyRowCache = false, bAddRepeateCol = false;
bool bEmptyColCache = false, bAddRepeateRow = false;
int index_current = 0;
for (size_t i = 0; i < current_.fields.size(); i++, index_current++)
{
if ( current_.fields[i].type_groups > 0 )
{
current_.fields[i].base_group = 0;
int index_group = 0;
for (size_t k = 0; k < current_.fields.size(); k++)
{
if (current_.fields[k].type == 7) continue;
if (current_.fields[k].name == current_.fields[i].source_groups && !current_.fields[i].source_groups.empty())
{
if (current_.fields[k].type_groups == 0)
current_.fields[k].base_group = index_current; //опорный (если он и базовый - не писать)
current_.fields[i].base_group = index_group;
for (size_t c = 0; !current_.fields[i].groups.empty() && c < current_.fields[k].caches.size(); c++)
{
for (size_t g = 0; g < current_.fields[i].groups.size(); g++)
{
for (size_t h = 0; h < current_.fields[i].groups[g].caches.size(); h++)
{
if (current_.fields[i].groups[g].caches[h].sVal == current_.fields[k].caches[c].sVal)
current_.fields[i].groups_discrete.push_back(g);
}
}
}
break;
}
index_group++;
}
}
if ( current_.fields[i].name.empty() &&
!current_.fields[i].data_layout)
if (current_.fields[i].type == 7)
continue;
switch(current_.fields[i].type)
if (!current_.fields[i].source_groups.empty() && i != current_.fields.size() -1)
{
case 0: // column
{
if (!current_.fields[i].name.empty())
current_.col_fields.push_back(i);
if (current_.fields[i].data_layout)
{
if ((current_.fields[i].name.empty() && (!current_.identify_categories || current_.fields[i].hierarchy >= 0)) ||
current_.fields[i].used_in_referenes )
{
if ((current_.col_fields.empty()) || (current_.col_fields.back() != -2))
{
bAddRepeateCol = true;
}
}
}
if (current_.fields[i].caches.empty())
bEmptyColCache = true;
}break;
case 1: // data
{
int index_field = -1;
for (size_t j = 0; j < i/*current_.fields.size()*/; j++)
{
if ( current_.fields[j].name == current_.fields[i].name )
{
current_.fields[j].bDataFieldEnabled = true;
index_field = j;
break;
}
}
if (index_field >= 0)
{
if (current_.fields[i].caches.empty())
{
current_.fields[i].type = 7; //skip
current_.fields_count--;
index_current--;
}
current_.fields[i].references_field = index_field;
}
index_field = i;
current_.fields[i].bDataFieldEnabled = true;
current_.data_fields.push_back(index_field);
}break;
case 2: // hidden
{
}break;
case 3: // page
{
current_.page_fields.push_back(i);
}break;
case 4: // row
{
if (!current_.fields[i].name.empty())
current_.row_fields.push_back(i);
if (current_.fields[i].data_layout)
{
current_.data_on_row = true;
if ((current_.fields[i].name.empty() && (!current_.identify_categories || current_.fields[i].hierarchy >= 0)) ||
current_.fields[i].used_in_referenes )
{
bAddRepeateRow = true;
}
}
if (current_.fields[i].caches.empty())
bEmptyRowCache = true;
}break;
}
if (current_.fields[i].name.empty())
{
current_.fields.erase(current_.fields.begin() + i, current_.fields.begin() + i + 1);
current_.fields_count--;
current_.fields.push_back(current_.fields[i]);
current_.fields.erase(current_.fields.begin() + i , current_.fields.begin() + i + 1);
i--;
}
}
if (bAddRepeateCol || bEmptyColCache)
current_.col_fields.push_back(-2);
if (bAddRepeateRow)
current_.row_fields.push_back(-2);
}
void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
{
@ -635,38 +468,22 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
}
CP_XML_ATTR(L"defaultSubtotal", 0);
if (current_.fields[i].type != 2)
if (!current_.fields[i].caches.empty() && current_.fields[i].type != 2)
{
if (!current_.fields[i].groups.empty())
{
CP_XML_NODE(L"items")
{
CP_XML_ATTR(L"count", current_.fields[i].groups.size());
for (size_t j = 0; j < current_.fields[i].groups.size(); j++)
{
CP_XML_NODE(L"item")
{
CP_XML_ATTR(L"x", j);
}
}
}
}
else if (!current_.fields[i].caches.empty())
{
CP_XML_NODE(L"items")
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
for (size_t j = 0; j < current_.fields[i].caches.size(); j++)
{
CP_XML_NODE(L"item")
{
CP_XML_ATTR(L"x", j);
}
CP_XML_NODE(L"items")
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
for (size_t j = 0; j < current_.fields[i].caches.size(); j++)
{
CP_XML_NODE(L"item")
{
CP_XML_ATTR(L"x", j);
}
}
}
}
}
//CP_XML_STREAM() << fields_[i].view_;
}
}
if (!current_.row_fields.empty())
@ -720,85 +537,35 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
CP_XML_ATTR(L"count", current_.data_fields.size());
for (size_t i = 0; i < current_.data_fields.size(); i++)
{
int ind_field_dirty = current_.data_fields[i];
CP_XML_NODE(L"dataField")
{
int fld = 0, ind_fld = current_.fields[ind_field_dirty].references_field < 0 ? ind_field_dirty :
current_.fields[ind_field_dirty].references_field;
for (size_t k = 0; k < ind_fld; k++)
{
if (current_.fields[k].type != 7 ) fld++;
}
CP_XML_ATTR(L"fld", fld);
if (current_.fields[ind_field_dirty].references.empty())
{
CP_XML_ATTR(L"baseField", fld);
}
else
{
size_t base_field = 0, base_item = 0;
for (size_t k = 0; k < current_.fields.size(); k++)
{
if (current_.fields[k].type == 7 ) continue;
{
CP_XML_ATTR(L"fld", current_.data_fields[i]);
CP_XML_ATTR(L"baseField", current_.data_fields[i]);
//CP_XML_ATTR(L"baseItem", -1);
//CP_XML_ATTR(L"name", L"");
if (current_.fields[k].name == current_.fields[ind_field_dirty].references[0].name)
{
for (size_t j = 0; j < current_.fields[k].caches.size(); j++)
{
if (current_.fields[k].caches[j].sVal == current_.fields[ind_field_dirty].references[0].member_name)
{
base_item = j;
break;
}
}
break;
}
base_field++;
}
CP_XML_ATTR(L"baseField", base_field);
CP_XML_ATTR(L"baseItem", base_item);
switch(current_.fields[ind_field_dirty].references[0].type)
{
case 1: CP_XML_ATTR(L"showDataAs", L"difference"); break;
case 2: CP_XML_ATTR(L"showDataAs", L"percent"); break;
case 3: CP_XML_ATTR(L"showDataAs", L"percentDiff"); break;
}
}
std::wstring name;
if (ind_field_dirty >= 0 && ind_field_dirty < current_.fields.size())
int ind_field = current_.data_fields[i];
if (ind_field >= 0 && ind_field < current_.fields.size())
{
switch(current_.fields[ind_field_dirty].function)
switch(current_.fields[ind_field].function)
{
case 1: CP_XML_ATTR(L"subtotal", L"average"); name = L"average "; break;
case 2: CP_XML_ATTR(L"subtotal", L"count"); name = L"count "; break;
case 3: CP_XML_ATTR(L"subtotal", L"countNums"); name = L"countNums "; break;
case 4: CP_XML_ATTR(L"subtotal", L"max"); name = L"max "; break;
case 5: CP_XML_ATTR(L"subtotal", L"min"); name = L"min "; break;
case 6: CP_XML_ATTR(L"subtotal", L"product"); name = L"product "; break;
case 7: CP_XML_ATTR(L"subtotal", L"stdDev"); name = L"stdDev Dev "; break;
case 8: CP_XML_ATTR(L"subtotal", L"stdDevp"); name = L"stdDevp "; break;
case 9: CP_XML_ATTR(L"subtotal", L"sum"); name = L"sum by "; break;
case 10: CP_XML_ATTR(L"subtotal", L"var"); name = L"var "; break;
case 11: CP_XML_ATTR(L"subtotal", L"varp"); name = L"varp "; break;
case 1: CP_XML_ATTR(L"subtotal", L"average"); break;
case 2: CP_XML_ATTR(L"subtotal", L"count"); break;
case 3: CP_XML_ATTR(L"subtotal", L"countNums"); break;
case 4: CP_XML_ATTR(L"subtotal", L"max"); break;
case 5: CP_XML_ATTR(L"subtotal", L"min"); break;
case 6: CP_XML_ATTR(L"subtotal", L"product"); break;
case 7: CP_XML_ATTR(L"subtotal", L"stdDev"); break;
case 8: CP_XML_ATTR(L"subtotal", L"stdDevp"); break;
case 9: CP_XML_ATTR(L"subtotal", L"sum"); break;
case 10: CP_XML_ATTR(L"subtotal", L"var"); break;
case 11: CP_XML_ATTR(L"subtotal", L"varp"); break;
case 12:
{
CP_XML_ATTR(L"subtotal", current_.fields[current_.data_fields[i]].user_function);
}break;
default: break;
}
if (current_.fields[ind_field_dirty].display_name.empty())
{
name += current_.fields[ind_field_dirty].name;
}
else
{
name = current_.fields[ind_field_dirty].display_name;
}
CP_XML_ATTR(L"name", name);
}
}
}
@ -941,7 +708,6 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
}
}
}
int index_current = 0;
if (current_.fields.empty() == false)
{
@ -978,12 +744,11 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
}
else if (current_.fields[i].type_groups < 8)
{//group by date
else
{
current_.fields[i].bDate = true;
current_.fields[i].bString = false;
}
//else group by fields
serialize_type_field(CP_GET_XML_NODE(), current_.fields[i]);
if ( current_.fields[i].type_groups == 0 )
@ -1001,78 +766,37 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
}
}
}
if (current_.fields[i].base_group >= 0)
if ( current_.fields[i].type_groups != 0 )
{
CP_XML_NODE(L"fieldGroup")
{
if ( current_.fields[i].type_groups > 0)
{
CP_XML_ATTR(L"base", 0);
CP_XML_NODE(L"rangePr")
{
CP_XML_ATTR(L"base", current_.fields[i].base_group);
}
else
{
CP_XML_ATTR(L"par", current_.fields[i].base_group);
}
if (current_.fields[i].type_groups > 0)
{
if (current_.fields[i].type_groups < 8)
switch(current_.fields[i].type_groups)
{
CP_XML_NODE(L"rangePr")
{
switch(current_.fields[i].type_groups)
{
case 1: CP_XML_ATTR(L"groupBy", L"seconds"); break;
case 2: CP_XML_ATTR(L"groupBy", L"minutes"); break;
case 3: CP_XML_ATTR(L"groupBy", L"hours"); break;
case 4: CP_XML_ATTR(L"groupBy", L"days"); break;
case 5: CP_XML_ATTR(L"groupBy", L"months"); break;
case 6: CP_XML_ATTR(L"groupBy", L"quarters"); break;
case 7: CP_XML_ATTR(L"groupBy", L"years"); break;
}
CP_XML_ATTR(L"startDate", L"1899-12-31T00:00:00");
CP_XML_ATTR(L"endDate", L"1899-12-31T00:00:00");
}
case 1: CP_XML_ATTR(L"groupBy", L"seconds"); break;
case 2: CP_XML_ATTR(L"groupBy", L"minutes"); break;
case 3: CP_XML_ATTR(L"groupBy", L"hours"); break;
case 4: CP_XML_ATTR(L"groupBy", L"days"); break;
case 5: CP_XML_ATTR(L"groupBy", L"months"); break;
case 6: CP_XML_ATTR(L"groupBy", L"quarters"); break;
case 7: CP_XML_ATTR(L"groupBy", L"years"); break;
}
if (!current_.fields[i].groups_discrete.empty())
CP_XML_ATTR(L"startDate", L"1899-12-31T00:00:00");
CP_XML_ATTR(L"endDate", L"1899-12-31T00:00:00");
}
CP_XML_NODE(L"groupItems")
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
for (size_t j = 0; j < current_.fields[i].caches.size(); j++)
{
CP_XML_NODE(L"discretePr")
CP_XML_NODE(current_.fields[i].caches[j].sNode)
{
CP_XML_ATTR(L"count", current_.fields[i].groups_discrete.size());
for (size_t j = 0; j < current_.fields[i].groups_discrete.size(); j++)
if (current_.fields[i].caches[j].sVal.empty() == false)
{
CP_XML_NODE(L"x")
{
CP_XML_ATTR(L"v", current_.fields[i].groups_discrete[j]);
}
}
}
}
CP_XML_NODE(L"groupItems")
{
if (!current_.fields[i].groups.empty())
{
CP_XML_ATTR(L"count", current_.fields[i].groups.size());
for (size_t j = 0; j < current_.fields[i].groups.size(); j++)
{
CP_XML_NODE(L"s")
{
CP_XML_ATTR(L"v", current_.fields[i].groups[j].name);
}
}
}
else
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
for (size_t j = 0; j < current_.fields[i].caches.size(); j++)
{
CP_XML_NODE(current_.fields[i].caches[j].sNode)
{
if (current_.fields[i].caches[j].sVal.empty() == false)
{
CP_XML_ATTR(L"v", current_.fields[i].caches[j].sVal);
}
}
CP_XML_ATTR(L"v", current_.fields[i].caches[j].sVal);
}
}
}
@ -1080,8 +804,6 @@ void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
}
}
}
index_current++;
}
}
}
@ -1218,10 +940,6 @@ void xlsx_pivots_context::set_identify_categories(bool val)
{
impl_->current_.identify_categories = val;
}
void xlsx_pivots_context::set_ignore_empty_rows(bool val)
{
impl_->current_.ignore_empty_rows = val;
}
void xlsx_pivots_context::set_drill(bool val)
{
impl_->current_.drill_enabled = val;
@ -1237,86 +955,75 @@ void xlsx_pivots_context::set_field_name(std::wstring name)
{
impl_->current_.fields.back().name = name;
}
void xlsx_pivots_context::set_field_display(std::wstring name)
{
impl_->current_.fields.back().display_name = name;
}
void xlsx_pivots_context::set_field_type(int type, int hierarchy)
{
impl_->current_.fields.back().type = type;
impl_->current_.fields.back().hierarchy = hierarchy;
//if ( impl_->current_.fields.back().name.empty() &&
// !impl_->current_.fields.back().data_layout)
// return;
if ( impl_->current_.fields.back().name.empty() &&
!impl_->current_.fields.back().data_layout)
return;
//switch(type)
//{
// case 0: // column
// {
// if (impl_->current_.fields.back().data_layout)
// {
// if (impl_->current_.fields.back().name.empty() && (!impl_->current_.identify_categories || hierarchy >= 0))
// //impl_->current_.fields.back().repeat_item_labels )) //????
// impl_->current_.col_fields.push_back(-2);
// }
// else
// impl_->current_.col_fields.push_back(impl_->current_.fields.size() - 1);
// }break;
// case 1: // data
// {
// int index_field = -1;
//
// for (size_t i = 0; i < impl_->current_.fields.size() - 1; i++)
// {
// if (impl_->current_.fields[i].name == impl_->current_.fields.back().name &&
// (impl_->current_.fields[i].type != 1 || !impl_->current_.fields.back().references.empty()))
// {
// impl_->current_.fields[i].bDataFieldEnabled = true;
// index_field = i;
// break;
// }
// }
// if (index_field >= 0)
// {
// impl_->current_.fields.back().type = 7; //skip
// impl_->current_.fields_count--;
//
// if (!impl_->current_.fields.back().references.empty())
// {
// impl_->current_.fields.back().references_field = index_field;
// impl_->current_.fields.back().bDataFieldEnabled = true;
//
// index_field = impl_->current_.fields.size() - 1;
// }
// }
// else
// {
// index_field = impl_->current_.fields.size() - 1;
// impl_->current_.fields.back().bDataFieldEnabled = true;
// }
// impl_->current_.data_fields.push_back(index_field);
// }break;
// case 2: // hidden
// break;
// case 3: // page
// impl_->current_.page_fields.push_back(impl_->current_.fields.size() - 1);
// break;
// case 4: // row
// if (impl_->current_.fields.back().data_layout)
// {
// impl_->current_.data_on_row = true;
switch(type)
{
case 0: // column
{
if (impl_->current_.fields.back().data_layout)
{
if (impl_->current_.fields.back().name.empty() && (!impl_->current_.identify_categories || hierarchy >= 0))
//impl_->current_.fields.back().repeat_item_labels )) //????
impl_->current_.col_fields.push_back(-2);
}
else
impl_->current_.col_fields.push_back(impl_->current_.fields.size() - 1);
}break;
case 1: // data
{
int index_field = -1;
for (size_t i = 0; i < impl_->current_.fields.size(); i++)
{
if (impl_->current_.fields[i].name == impl_->current_.fields.back().name &&
impl_->current_.fields[i].type != 1)
{
impl_->current_.fields[i].bDataFieldEnabled = true;
index_field = i;
break;
}
}
if (index_field >= 0)
{
impl_->current_.fields.back().type = 7;
impl_->current_.fields_count--;
impl_->current_.data_fields.push_back(index_field);
}
else
{
index_field = impl_->current_.fields.size() - 1;
impl_->current_.fields.back().bDataFieldEnabled = true;
impl_->current_.data_fields.push_back(index_field);
}
}break;
case 2: // hidden
break;
case 3: // page
impl_->current_.page_fields.push_back(impl_->current_.fields.size() - 1);
break;
case 4: // row
if (impl_->current_.fields.back().data_layout)
{
impl_->current_.data_on_row = true;
// if (impl_->current_.fields.back().name.empty() && (!impl_->current_.identify_categories || hierarchy >= 0))
// //(impl_->current_.fields.back().repeat_item_labels ||
// // !impl_->current_.identify_categories ))
// impl_->current_.row_fields.push_back(-2);
if (impl_->current_.fields.back().name.empty() && (!impl_->current_.identify_categories || hierarchy >= 0))
//(impl_->current_.fields.back().repeat_item_labels ||
// !impl_->current_.identify_categories ))
impl_->current_.row_fields.push_back(-2);
// }
// else
// impl_->current_.row_fields.push_back(impl_->current_.fields.size() - 1);
// break;
//}
}
else
impl_->current_.row_fields.push_back(impl_->current_.fields.size() - 1);
break;
}
}
void xlsx_pivots_context::set_field_function(int type)
{
@ -1351,56 +1058,10 @@ void xlsx_pivots_context::set_field_groups_source(std::wstring name)
{
impl_->current_.fields.back().source_groups = name;
}
void xlsx_pivots_context::start_field_group()
{
impl_->current_.in_group = true;
Impl::_group group;
impl_->current_.fields.back().groups.push_back(group);
}
void xlsx_pivots_context::set_field_group_name (std::wstring name)
{
impl_->current_.fields.back().groups.back().name = name;
}
void xlsx_pivots_context::end_field_group()
{
impl_->current_.in_group = false;
}
void xlsx_pivots_context::set_field_sort(int type)
{
impl_->current_.fields.back().sort = type + 1;
}
void xlsx_pivots_context::start_field_reference()
{
Impl::_reference ref;
impl_->current_.fields.back().references.push_back(ref);
}
void xlsx_pivots_context::end_field_reference()
{
}
void xlsx_pivots_context::set_field_ref_name(std::wstring name)
{
impl_->current_.fields.back().references.back().name = name;
for (size_t i = 0; i < impl_->current_.fields.size(); i++)
{
if (impl_->current_.fields[i].name == name)
{
impl_->current_.fields[i].used_in_referenes = true;
}
}
}
void xlsx_pivots_context::set_field_ref_type (int type)
{
impl_->current_.fields.back().references.back().type = type;
}
void xlsx_pivots_context::set_field_ref_member_name(std::wstring name)
{
impl_->current_.fields.back().references.back().member_name = name;
}
void xlsx_pivots_context::set_field_ref_member_type(int type)
{
impl_->current_.fields.back().references.back().member_type = type;
}
void xlsx_pivots_context::add_field_cache(int index, std::wstring value)
{
if (index < 0)
@ -1470,20 +1131,14 @@ void xlsx_pivots_context::add_field_cache(int index, std::wstring value)
}
}
impl_->current_.fields.back().caches.push_back(Impl::_field_value(value, node_name));
if (impl_->current_.in_group)
{
impl_->current_.fields.back().groups.back().caches.push_back(impl_->current_.fields.back().caches.back());
}
}
void xlsx_pivots_context::end_field()
{
//if (impl_->current_.fields.back().name.empty())
//{
// impl_->current_.fields_count--;
// impl_->current_.fields.pop_back();
//}
if (impl_->current_.fields.back().name.empty())
{
impl_->current_.fields_count--;
impl_->current_.fields.pop_back();
}
}
void xlsx_pivots_context::set_source_range(std::wstring table_name, std::wstring ref)
{

View File

@ -51,7 +51,6 @@ public:
void start_field ();
void set_field_name (std::wstring name);
void set_field_display (std::wstring name);
void set_field_type (int type, int hierarchy);
void set_field_function (int type);
void set_field_user_function (std::wstring f);
@ -60,22 +59,9 @@ public:
void set_field_show_empty (bool val);
void set_field_data_layout (bool val);
void set_field_sort (int type);
void set_repeat_item_labels(bool val);
void set_field_groups (int type);
void set_field_groups_source(std::wstring name);
void start_field_group();
void set_field_group_name (std::wstring name);
void end_field_group();
void start_field_reference();
void set_field_ref_name(std::wstring name);
void set_field_ref_type (int type);
void set_field_ref_member_name(std::wstring name);
void set_field_ref_member_type(int type);
void end_field_reference();
void set_repeat_item_labels(bool val);
void end_field();
int get_count();
@ -87,7 +73,6 @@ public:
void add_button_header(std::wstring ref);
void set_identify_categories(bool val);
void set_ignore_empty_rows(bool val);
void set_drill(bool val);
void set_source_range(std::wstring table_name, std::wstring ref);
@ -113,6 +98,7 @@ public:
private:
class Impl;
_CP_PTR(Impl) impl_;
};
}

View File

@ -46,7 +46,8 @@ std::wostream & operator << (std::wostream & _Wostream, const Bool & _Val)
}
Bool Bool::parse(const std::wstring & Str)
{
std::wstring tmp = XmlUtils::GetLower(Str);
std::wstring tmp = Str;
XmlUtils::GetLower(tmp);
if (tmp == L"0" || tmp == L"false") return Bool(false);
else return Bool(true);

View File

@ -104,7 +104,8 @@ void styles_container::add_style( const std::wstring & Name,
map_[n] = pos;
// TODO: как правильно??
std::wstring lName = XmlUtils::GetLower(Name);
std::wstring lName = Name;
XmlUtils::GetLower(lName);
//if ( boost::algorithm::contains(lName, L"internet_20_link") )
if (lName == L"internet_20_link")///???????????????
hyperlink_style_pos_ = pos;

View File

@ -123,9 +123,6 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
if (table_identify_categories_)
Context.get_pivots_context().set_identify_categories(table_identify_categories_->get());
if (table_ignore_empty_rows_)
Context.get_pivots_context().set_ignore_empty_rows(table_ignore_empty_rows_->get());
if (table_drill_down_ondouble_click_)
Context.get_pivots_context().set_drill(table_drill_down_ondouble_click_->get());
@ -158,7 +155,6 @@ void table_data_pilot_field::add_attributes( const xml::attributes_wc_ptr & Attr
CP_APPLY_ATTR(L"loext:ignore-selected-page" , loext_ignore_selected_page_);
CP_APPLY_ATTR(L"table:selected-page" , table_selected_page_);
CP_APPLY_ATTR(L"table:is-data-layout-field" , table_is_data_layout_field_);
CP_APPLY_ATTR(L"tableooo:display-name" , table_display_name_);
}
void table_data_pilot_field::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -179,9 +175,6 @@ void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context
Context.get_pivots_context().set_field_name(table_source_field_name_.get_value_or(L""));
if (table_display_name_)
Context.get_pivots_context().set_field_display(*table_display_name_);
if (table_is_data_layout_field_)
Context.get_pivots_context().set_field_data_layout(table_is_data_layout_field_->get());
@ -224,24 +217,7 @@ void table_data_pilot_field_reference::add_attributes( const xml::attributes_wc_
void table_data_pilot_field_reference::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_pivots_context().start_field_reference();
if (table_field_name_)
{
Context.get_pivots_context().set_field_ref_name(*table_field_name_);
}
if (table_type_)
{
Context.get_pivots_context().set_field_ref_type(table_type_->get_type());
}
if (table_member_name_)
{
Context.get_pivots_context().set_field_ref_member_name(*table_member_name_);
}
if (table_member_type_)
{
Context.get_pivots_context().set_field_ref_member_type(table_member_type_->get_type());
}
Context.get_pivots_context().end_field_reference();
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_database_source_table::ns = L"table";
@ -429,8 +405,6 @@ void table_data_pilot_groups::xlsx_convert(oox::xlsx_conversion_context & Contex
{
if (table_grouped_by_)
Context.get_pivots_context().set_field_groups(table_grouped_by_->get_type());
else
Context.get_pivots_context().set_field_groups(7);
if (table_source_field_name_)
Context.get_pivots_context().set_field_groups_source(*table_source_field_name_);
@ -455,16 +429,10 @@ void table_data_pilot_group::add_child_element( xml::sax * Reader, const std::ws
}
void table_data_pilot_group::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_pivots_context().start_field_group();
if (table_name_)
Context.get_pivots_context().set_field_group_name (*table_name_);
for (size_t i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.get_pivots_context().end_field_group();
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_members::ns = L"table";
@ -502,12 +470,12 @@ const wchar_t * table_data_pilot_group_member::name = L"data-pilot-group-member"
void table_data_pilot_group_member::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:name", table_name_);
}
void table_data_pilot_group_member::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_pivots_context().add_field_cache(-1, table_name_.get_value_or(L""));
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_subtotals::ns = L"table";

View File

@ -130,7 +130,6 @@ public:
_CP_OPT(odf_types::Bool) loext_ignore_selected_page_;
_CP_OPT(std::wstring) table_selected_page_;
_CP_OPT(odf_types::Bool) table_is_data_layout_field_;
_CP_OPT(std::wstring) table_display_name_;
office_element_ptr reference_;
office_element_ptr level_;

View File

@ -1000,6 +1000,27 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_DLbls* ser_lbls)
{
bool boolVal = false;
bool bIsFound = false;
switch(*ser_lbls->m_ItemsElementName0[i])
{
case OOX::Spreadsheet::itemschoicetype3DELETE :
case OOX::Spreadsheet::itemschoicetype3SHOWBUBBLESIZE:
case OOX::Spreadsheet::itemschoicetype3SHOWCATNAME:
case OOX::Spreadsheet::itemschoicetype3SHOWLEADERLINES:
case OOX::Spreadsheet::itemschoicetype3SHOWLEGENDKEY:
case OOX::Spreadsheet::itemschoicetype3SHOWPERCENT:
case OOX::Spreadsheet::itemschoicetype3SHOWSERNAME:
case OOX::Spreadsheet::itemschoicetype3SHOWVAL:
bIsFound = true;
break;
default:
break;
}
if (!bIsFound)
continue;
OOX::Spreadsheet::CT_Boolean * ct_boolean = (OOX::Spreadsheet::CT_Boolean*)ser_lbls->m_Items[i];
if (ct_boolean && ct_boolean->m_val) boolVal = * ct_boolean->m_val;

View File

@ -3426,8 +3426,16 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
{
oWriter.WriteString(L"<wp:wrapNone/>");
}
bool bHidden = false;
pPair = oCssStyles.m_mapSettings.find(L"visibility");
if (oCssStyles.m_mapSettings.end() != pPair)
{
if (L"hidden" == pPair->second)
bHidden = true;
}
std::wstring strId = L"<wp:docPr id=\"" + std::to_wstring(m_lNextId) + L"\" name=\"\"/>";
std::wstring strId = L"<wp:docPr id=\"" + std::to_wstring(m_lNextId) + L"\" name=\"\"" + (bHidden ? L" hidden=\"true\"" : L"") + L"/>";
m_lNextId++;
oWriter.WriteString(strId);

View File

@ -40,6 +40,7 @@
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/JsaProject.h"
#include "../../Common/Base64.h"
@ -292,7 +293,7 @@ namespace NSBinPptxRW
}
}
}
else if (!strExts.empty())
if (!strExts.empty())
{
m_pContentTypes->AddDefault(strExts.substr(1));
}
@ -1235,7 +1236,7 @@ namespace NSBinPptxRW
m_pWriter->WriteString(strRels);
}
void CRelsGenerator::EndPresentationRels(bool bIsCommentsAuthors, bool bIsNotesMaster, bool bIsVbaProject)
void CRelsGenerator::EndPresentationRels(bool bIsCommentsAuthors, bool bIsNotesMaster, bool bIsVbaProject, bool bIsJsaProject)
{
if (bIsNotesMaster)
{
@ -1266,6 +1267,12 @@ namespace NSBinPptxRW
L"\" Type=\"http://schemas.microsoft.com/office/2006/relationships/vbaProject\" Target=\"vbaProject.bin\"/>";
m_pWriter->WriteString(strRels4);
}
if (bIsJsaProject)
{
std::wstring strRels5 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"" + OOX::FileTypes::JsaProject.RelationType() + L"\" Target=\"" + OOX::FileTypes::JsaProject.DefaultFileName().GetPath() + L"\"/>";
m_pWriter->WriteString(strRels5);
}
}
int CRelsGenerator::GetNextId()
{

View File

@ -425,7 +425,7 @@ namespace NSBinPptxRW
int WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode);
int WriteHyperlink (const std::wstring& strLink, const bool& bIsActionInit);
void EndPresentationRels (bool bIsCommentsAuthors = false, bool bIsNotesMaster = false, bool bIsVbaProject = false );
void EndPresentationRels (bool bIsCommentsAuthors = false, bool bIsNotesMaster = false, bool bIsVbaProject = false, bool bIsJsaProject = false );
int GetNextId ();
void CloseRels ();

View File

@ -812,7 +812,7 @@ namespace NSBinPptxRW
++nCurrentRels;
}
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init(), bNotesMasterPresent, m_oPresentation.m_pVbaProject.is_init());
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init(), bNotesMasterPresent, m_oPresentation.m_pVbaProject.is_init(), m_oPresentation.m_pJsaProject.is_init());
m_oReader.m_pRels->CloseRels();
oXmlWriter.ClearNoAttack();

View File

@ -63,6 +63,7 @@
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/ActiveX.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/JsaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalImage.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalAudio.h"
@ -144,6 +145,8 @@ namespace PPTX
return smart_ptr<OOX::File>(new OOX::OleObject( filename, true ));
else if (relation.Type() == OOX::FileTypes::VbaProject)
return smart_ptr<OOX::File>(new OOX::VbaProject( filename, filename ));
else if (relation.Type() == OOX::FileTypes::JsaProject)
return smart_ptr<OOX::File>(new OOX::JsaProject( filename ));
return smart_ptr<OOX::File>(new OOX::UnknowTypeFile());
}

View File

@ -81,6 +81,10 @@ namespace PPTX
_presentation->m_bMacroEnabled = true;
_presentation->m_pVbaProject = _presentation->Get(OOX::FileTypes::VbaProject).smart_dynamic_cast<OOX::VbaProject>();
}
if (_presentation->IsExist(OOX::FileTypes::JsaProject))
{
_presentation->m_pJsaProject = _presentation->Get(OOX::FileTypes::JsaProject).smart_dynamic_cast<OOX::JsaProject>();
}
}
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)

View File

@ -112,6 +112,10 @@ namespace PPTX
virtual std::wstring toXML() const
{
std::wstring namespaceLocks = L"a";
std::wstring namespaceLocksLink = PPTX::g_Namespaces.a.m_strLink;
//if (m_namespace == L"wp") namespaceLocks = L"wp";
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
oAttr.Write(_T("noDrilldown"), noDrilldown);
@ -120,21 +124,23 @@ namespace PPTX
oAttr.Write(_T("noResize"), noResize);
oAttr.Write(_T("noSelect"), noSelect);
std::wstring namespaceLocks = L"a";
//if (m_namespace == L"wp") namespaceLocks = L"wp";
bool isAttrEmpty = oAttr.m_strValue.empty();
oAttr.Write(_T("xmlns:") + namespaceLocks, namespaceLocksLink);
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr", oAttr.m_strValue.empty() ? L"" : XmlUtils::CreateNode(namespaceLocks + L":graphicFrameLocks", oAttr));
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr", isAttrEmpty ? L"" : XmlUtils::CreateNode(namespaceLocks + L":graphicFrameLocks", oAttr));
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
std::wstring namespace_ = m_namespace;
std::wstring namespaceLock_ = L"a";
std::wstring namespaceLockLink_ = PPTX::g_Namespaces.a.m_strLink;
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
{
namespaceLock_ = L"a";
namespaceLockLink_ = PPTX::g_Namespaces.a.m_strLink;
namespace_ = L"wp";
}
@ -145,7 +151,7 @@ namespace PPTX
pWriter->StartNode(namespaceLock_ + L":graphicFrameLocks");
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("xmlns:") + namespaceLock_, namespaceLockLink_);
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
pWriter->WriteAttribute(_T("noDrilldown"), noDrilldown);
pWriter->WriteAttribute(_T("noGrp"), noGrp);

View File

@ -743,7 +743,7 @@ namespace PPTX
if(oleObject.IsInit() && oleObject->isValid())
{
bOle = true;
pWriter->WriteString(L"<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"0\" name=\"\"/><p:cNvGraphicFramePr><a:graphicFrameLocks noChangeAspect=\"1\"/></p:cNvGraphicFramePr><p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2157879785\"/></p:ext></p:extLst></p:nvPr></p:nvGraphicFramePr>");
pWriter->WriteString(L"<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"0\" name=\"\"/><p:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" noChangeAspect=\"1\"/></p:cNvGraphicFramePr><p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2157879785\"/></p:ext></p:extLst></p:nvPr></p:nvGraphicFramePr>");
if(spPr.xfrm.IsInit())
{
std::wstring oldNamespace = spPr.xfrm->m_ns;

View File

@ -51,6 +51,7 @@
#include "Theme/ClrScheme.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/JsaProject.h"
namespace PPTX
{
@ -233,6 +234,7 @@ namespace PPTX
}
pWriter->EndRecord();
}
pWriter->WriteRecord2(9, m_pJsaProject);
pWriter->EndRecord();
}
@ -352,9 +354,17 @@ namespace PPTX
m_bMacroEnabled = true;
}break;
case 9:
{
m_pJsaProject = new OOX::JsaProject();
m_pJsaProject->fromPPTY(pReader);
smart_ptr<OOX::File> file = m_pJsaProject.smart_dynamic_cast<OOX::File>();
FileContainer::Add(file);
}break;
default:
{
pReader->Seek(_end_pos);
pReader->SkipRecord();
return;
}
}
@ -468,6 +478,7 @@ namespace PPTX
public:
bool m_bMacroEnabled;
smart_ptr<OOX::VbaProject> m_pVbaProject;
smart_ptr<OOX::JsaProject> m_pJsaProject;
void SetClrMap(Logic::ClrMap map) {m_clrMap = map;}
void SetClrScheme(nsTheme::ClrScheme scheme) {m_clrScheme = scheme;}

View File

@ -1922,7 +1922,7 @@
17063B5B1AC5708E0056A3F1 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "Ascensio System SIA";
};
buildConfigurationList = 17063B5E1AC5708E0056A3F1 /* Build configuration list for PBXProject "PPTXFormatLib" */;
@ -2004,21 +2004,13 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
@ -2026,7 +2018,6 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@ -2039,7 +2030,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
@ -2055,21 +2046,13 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
@ -2077,14 +2060,13 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
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;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;

View File

@ -394,7 +394,7 @@
6967B1211E27B44D00A129E2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = OnlyOffce;
TargetAttributes = {
6967B1281E27B44D00A129E2 = {
@ -468,9 +468,7 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@ -478,11 +476,7 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -505,7 +499,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -521,9 +515,7 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@ -531,11 +523,7 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -552,7 +540,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;

View File

@ -1027,7 +1027,16 @@ bool RtfParagraphPropsCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader&
}
}
COMMAND_RTF_BOOL( "intbl", paragraphProps->m_bInTable, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( "itap", paragraphProps->m_nItap, sCommand, hasParameter, parameter )
else if ( "itap" == sCommand && hasParameter)
{
//if (parameter == 0 && paragraphProps->m_bInTable && paragraphProps->m_nItap > 0)
//{
//
//// paragraphProps->m_bInTable = 0;
//}
//else
paragraphProps->m_nItap = parameter;
}
COMMAND_RTF_BOOL( "keep", paragraphProps->m_bKeep, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( "keepn", paragraphProps->m_bKeepNext, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( "pagebb", paragraphProps->m_bPageBB, sCommand, hasParameter, parameter )
@ -2283,7 +2292,8 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
{
// 1 != oItem->m_oProperty.m_bInTable - параграф не в таблице
// PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap - выставлено свойство,что вложенность - nTargetItap - это не таблица( Нужно для чтения параграфов в таблицах )
if ( 1 != oItem->m_oProperty.m_bInTable || ( PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap ) )
if ( ( 1 != oItem->m_oProperty.m_bInTable || 0 == oItem->m_oProperty.m_nItap ) //Платежное_поручение.rtf
|| ( PROP_DEF != nTargetItap && oItem->m_oProperty.m_nItap <= nTargetItap ) )
{
if ( nCurItap > 0 ) //Если до этого были только параграфы в таблицах - завершаем таблицу
{
@ -2292,15 +2302,13 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
for( int k = (int)aRows.size() - 1; k >= 0 ; k-- )
{
if ( aRowItaps[k] == nCurItap )
{
oNewTable->InsertItem( aRows[k], 0 );
aRows.erase(aRows.begin() + k);
aRowItaps.erase(aRowItaps.begin() + k);
}
else
if ( aRowItaps[k] != nCurItap )
break;
oNewTable->InsertItem( aRows[k], 0 );
aRows.erase(aRows.begin() + k);
aRowItaps.erase(aRowItaps.begin() + k);
}
//вычисляем свойства для OOX
oNewTable->CalculateGridProp();
@ -2339,15 +2347,13 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
for( int k = (int)aRows.size() - 1; k >= 0 ; k-- )
{
if ( aRowItaps[k] == nCurItap )
{
oNewTable->InsertItem( aRows[k], 0 );
aRows.erase(aRows.begin() + k);
aRowItaps.erase(aRowItaps.begin() + k);
}
else
if ( aRowItaps[k] != nCurItap )
break;
oNewTable->InsertItem( aRows[k], 0 );
aRows.erase(aRows.begin() + k);
aRowItaps.erase(aRowItaps.begin() + k);
}
//вычисляем свойства для OOX
oNewTable->CalculateGridProp();
@ -2386,7 +2392,7 @@ void RtfParagraphPropDestination::AddItem( RtfParagraphPtr oItem, RtfReader& oRe
//добавляем параграф во временные cell
aCellRenderables.push_back( oItem ); //содержит все параграфы, не разложенные по cell
aItaps.push_back( nCurItap ); //содержит все номера вложенности параграфов
if ( bEndCell )
{
RtfTableCellPtr oNewTableCell ( new RtfTableCell() );
@ -2456,6 +2462,9 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else if ( "cell" == sCommand || "nestcell" == sCommand )
{
if (oReader.m_oState->m_oParagraphProp.m_bInTable == 1 && 0 == oReader.m_oState->m_oParagraphProp.m_nItap )//Платежное_поручение.rtf (ели по другому сбойная строка заменяется параграфами
oReader.m_oState->m_oParagraphProp.m_nItap = 1;
m_oCurParagraph->m_oProperty = oReader.m_oState->m_oParagraphProp;
m_oCurParagraph->m_oOldList = RtfOldListPtr( new RtfOldList() );
*m_oCurParagraph->m_oOldList = oReader.m_oState->m_oCurOldList;

View File

@ -65,7 +65,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Urlmon.lib"
AdditionalDependencies="Urlmon.lib Rpcrt4.lib"
LinkIncremental="1"
IgnoreDefaultLibraryNames="LIBCMT.lib"
IgnoreEmbeddedIDL="true"
@ -407,6 +407,10 @@
RelativePath="..\..\ASCOfficeOdfFile\src\odf\svg_parser.cpp"
>
</File>
<File
RelativePath="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp"
>
</File>
<File
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
>

View File

@ -148,7 +148,7 @@
6967AFB71E2798B900A129E2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = OnlyOffce;
TargetAttributes = {
6967AFBE1E2798B900A129E2 = {
@ -202,9 +202,7 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@ -212,11 +210,7 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -239,7 +233,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -255,9 +249,7 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
@ -265,11 +257,7 @@
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -286,7 +274,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;

View File

@ -514,31 +514,49 @@ const std::wstring tab2sheet_name(const short tabid, std::vector<std::wstring>&
return L"#REF";
}
const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabLast, std::vector<std::wstring>& names, const std::wstring prefix)
//
const std::wstring xti2sheets(const unsigned short ixti, std::vector<std::wstring>& xti_parsed)
{
if(-1 == tabFirst)
if(ixti >= 0 && static_cast<unsigned short>(ixti) < xti_parsed.size())
{
return xti_parsed[ixti];
}
return L"#REF!";
}
//
const std::wstring xti_indexes2sheet_name(const short itabFirst, const short itabLast, std::vector<std::wstring>& sheets_names)
{
if(-1 == itabFirst)
{
return L"#REF";
}
static boost::wregex correct_sheet_name(L"^\\'.+?\\'$");
static boost::wregex test_sheet_name(L"[\\s)(\\'&:-]+"); //.??? 6442946.xls
std::wstring sheet_first = prefix + tab2sheet_name(tabFirst, names);
static boost::wregex test_sheet_name(L"[\\s)(\\':.-]+");
std::wstring sheet_first = tab2sheet_name(itabFirst, sheets_names);
if(!boost::regex_search(sheet_first.begin(), sheet_first.end(), correct_sheet_name))
{
if(boost::regex_search(sheet_first.begin(), sheet_first.end(), test_sheet_name))
{
sheet_first = boost::algorithm::replace_all_copy(sheet_first, L"'", L"''");
sheet_first = std::wstring(L"'") + sheet_first + std::wstring(L"'");
sheet_first = std::wstring(L"\'") + sheet_first + std::wstring(L"\'");
}
}
else
{
//todooo найти хоть один файл где в апострофах уже есть внутренний не экранированный апостроф
//static boost::wregex test_sheet_name1(L"[\']+");
//if(boost::regex_search(sheet_first.begin() + 1, sheet_first.end() - 1, test_sheet_name1))
//{
// sheet_first = boost::algorithm::replace_all_copy(sheet_first.begin()+1, sheet_first.end() - 1 , L"'", L"''");
// sheet_first = std::wstring(L"\'") + sheet_first + std::wstring(L"\'");
//}
}
std::wstring sheet_last;
if (tabLast != tabFirst)
if (itabLast != itabFirst)
{
sheet_last = prefix + tab2sheet_name(tabLast, names);
sheet_last = tab2sheet_name(itabLast, sheets_names);
if(!boost::regex_search(sheet_last.begin(), sheet_last.end(), correct_sheet_name))
{
@ -554,6 +572,20 @@ const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabL
return sheet_first + sheet_last;
}
const std::wstring make3dRef(const unsigned short ixti, const std::wstring cell_ref, std::vector<std::wstring>& xti_parsed, bool full_ref)
{
std::wstring sheets_prefix = xti2sheets(ixti, xti_parsed);
if(L"#REF!" == sheets_prefix)
{
return sheets_prefix;
}
else if (!sheets_prefix.empty()) sheets_prefix += L"!";
else if (sheets_prefix.empty() && full_ref) sheets_prefix += L"#REF!";
return sheets_prefix + cell_ref;
}
} //namespace XMLSTUFF

View File

@ -95,7 +95,13 @@ namespace STR
namespace XMLSTUFF
{;
const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabLast, std::vector<std::wstring>& names, const std::wstring prefix = L"");
// Makes a new tag and append it to parent (no attributes set)
//BiffStructurePtr createElement(const std::wstring & tag_name, BiffStructurePtr & parent);
const std::wstring make3dRef(const unsigned short ixti, const std::wstring cell_ref, std::vector<std::wstring>& xti_parsed, bool full_ref = false);
//const unsigned short sheetsnames2ixti(const std::wstring str, MSXML2::IXMLDOMDocumentPtr doc);
const std::wstring xti_indexes2sheet_name(const short itabFirst, const short itabLast, std::vector<std::wstring>& sheets_names);
}

View File

@ -245,7 +245,7 @@ const bool CFRecord::isEOF() const
{
if(rdPtr > size_)
{
true;//throw;
throw;// EXCEPT::LE::WrongFormatInterpretation(__FUNCTION__);
}
return rdPtr >= size_;
}

View File

@ -77,8 +77,6 @@ private:
std::map<std::string, CFStreamPtr> streams;
ReadWriteMode rwMode;
};
typedef boost::shared_ptr<CompoundFile> CompoundFilePtr;
} // namespace XLS

View File

@ -32,12 +32,14 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/BookExt_Conditional11.h"
#include "../Biff_structures/BookExt_Conditional12.h"
#include <Logic/Biff_structures/BookExt_Conditional11.h>
#include <Logic/Biff_structures/BookExt_Conditional12.h>
namespace XLS
{
// Logical representation of BookExt record in BIFF8
class BookExt: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(BookExt)
@ -47,11 +49,13 @@ public:
~BookExt();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeBookExt;
static const ElementType type = typeBookExt;
//-----------------------------
_UINT32 cb;
bool fDontAutoRecover;

View File

@ -31,6 +31,7 @@
*/
#include "CRN.h"
#include <Logic/Biff_structures/SerAr.h>
namespace XLS
{
@ -39,10 +40,12 @@ CRN::CRN()
{
}
CRN::~CRN()
{
}
BaseObjectPtr CRN::clone()
{
return BaseObjectPtr(new CRN(*this));
@ -52,12 +55,10 @@ BaseObjectPtr CRN::clone()
void CRN::readFields(CFRecord& record)
{
record >> colLast >> colFirst >> row;
for(int i = 0; i < colLast - colFirst + 1; ++i)
{
unsigned char rec_type;
record >> rec_type;
SerArPtr ser(SerAr::createSerAr(rec_type));
record >> *ser;
crnOper.push_back(ser);

View File

@ -32,11 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/SerAr.h"
#include <Logic/Biff_structures/SerAr.h>
namespace XLS
{
// Logical representation of CRN record in BIFF8
class CRN: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CRN)
@ -46,16 +48,18 @@ public:
~CRN();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeCRN;
static const ElementType type = typeCRN;
//-----------------------------
unsigned char colLast;
unsigned char colFirst;
_UINT16 row;
BiffStructurePtrVector crnOper;
};
} // namespace XLS

View File

@ -53,10 +53,7 @@ BaseObjectPtr CodeName::clone()
void CodeName::readFields(CFRecord& record)
{
XLUnicodeString codeName;
record >> codeName;
value = codeName.value();
}
} // namespace XLS

View File

@ -37,6 +37,8 @@
namespace XLS
{
// Logical representation of CodeName record in BIFF8
class CodeName: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CodeName)
@ -47,11 +49,14 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeCodeName;
static const ElementType type = typeCodeName;
//-----------------------------
XLUnicodeString codeName;
std::wstring value;
};
} // namespace XLS

View File

@ -35,8 +35,8 @@
namespace XLS
{
ExternName::ExternName(const unsigned short supporting_link_type, bool bOle)
: supbook_cch(supporting_link_type), cf(-1), bOleVirtualPath(bOle)
ExternName::ExternName(const unsigned short supporting_link_type)
: supbook_cch(supporting_link_type), cf(0)
{
}
@ -70,40 +70,53 @@ void ExternName::readFields(CFRecord& record)
}
else
{
if(fOle && !fOleLink)
if(fOle && !fOleLink) // DDE data item
{
body = BiffStructurePtr(new ExternDdeLinkNoOper);
}
if(!fOle && fOleLink)
if(!fOle && fOleLink) // DDE data item
{
body = BiffStructurePtr(new ExternOleDdeLink);
}
// Nu i kak ya dolzhen opredelit', DDE eto ili OLE?!!!
// V Mikrosofte vse ebanutye - pust' sami parsyat, debily
if(!fOle && !fOleLink)
{
if (bOleVirtualPath)
{
body = BiffStructurePtr(new ExternOleDdeLink);
}
else
{
body = BiffStructurePtr(new ExternDocName);
}
body = BiffStructurePtr(new ExternDocName);
}
// This fills in the gaps between AddinUdfs if the body is not AddinUdf. The simplest way to maintain indexing from my point of view.
}
body->load(record);
//cache
switch(cf)
if(0x3A01 != supbook_cch)
{
case 0: // is text
break;
case 5: //csv (,)
case 6: //Microsoft Symbolic Link (SYLK).
case 8: //biff8
case 44: //unicode text
case 63: //biff12
break;
std::wstring name;
if(!fOle && !fOleLink)
{
ExternDocName* n = dynamic_cast<ExternDocName*>(body.get());
if (n->ixals > 0)
{
//from SupBook
}
else
{
name = n->nameDefinition.getAssembledFormula();
if (name.empty())
name = n->extName.value();
}
}
if(fOle && !fOleLink) // DDE data item
{
ExternDdeLinkNoOper* n = dynamic_cast<ExternDdeLinkNoOper*>(body.get());
name = n->linkName.value();
}
if(!fOle && fOleLink)
{
ExternOleDdeLink* n = dynamic_cast<ExternOleDdeLink*>(body.get());
name = n->linkName.value();
}
record.getGlobalWorkbookInfo()->arExternalNames.push_back(name);
}
}

View File

@ -48,10 +48,11 @@ class ExternName: public BiffRecord
BIFF_RECORD_DEFINE_TYPE_INFO(ExternName)
BASE_OBJECT_DEFINE_CLASS_NAME(ExternName)
public:
ExternName(const unsigned short supporting_link_type, bool bOle);
ExternName(const unsigned short supporting_link_type);
~ExternName();
BaseObjectPtr clone();
void readFields(CFRecord& record);
@ -63,13 +64,24 @@ public:
bool fWantPict;
bool fOle;
bool fOleLink;
short cf;
_UINT16 cf;
bool fIcon;
BiffStructurePtr body;
//-----------------------------
_UINT16 supbook_cch;
bool bOleVirtualPath;
_UINT16 supbook_cch;
//if(0x3A01 == supbook_cch)
//{
// if(!body)
// {
// body = BiffStructurePtr(new AddinUdf);
// }
//}
//else
//{
//}
};
typedef boost::shared_ptr<ExternName> ExternNamePtr;

View File

@ -58,14 +58,14 @@ void ExternSheet::readFields(CFRecord& record)
if (record.getGlobalWorkbookInfo()->Version < 0x0600)
{
unsigned char type;
//record.skipNunBytes(record.getDataSize() - record.getRdPtr());
ShortXLAnsiString stName;
record >> type >> stName;
name = stName.value();
//int type = stName.value().substr(0, 1).c_str()[0];
//if (!name.empty())
// record.getGlobalWorkbookInfo()->arExternalNames.push_back(name);
std::wstring name = stName.value();
//int type = stName.value().substr(0, 1).c_str()[0];
if (!name.empty())
record.getGlobalWorkbookInfo()->arExternalNames.push_back(name);
}
else

View File

@ -32,11 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/XTI.h"
#include <Logic/Biff_structures/XTI.h>
namespace XLS
{
// Logical representation of ExternSheet record in BIFF8
class ExternSheet: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ExternSheet)
@ -46,15 +48,15 @@ public:
~ExternSheet();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeExternSheet;
static const ElementType type = typeExternSheet;
_UINT16 cXTI;
BiffStructurePtrVector rgXTI;
//------------------------------------------------
std::wstring name; //biff5
//-----------------------------
ForwardOnlyParam<_UINT16> cXTI;
BiffStructurePtrVector rgXTI;
};
} // namespace XLS

View File

@ -67,12 +67,8 @@ void MsoDrawing::readFields()
rgChildRec.rh_own.recLen = stored_record->getDataSize();
rgChildRec.loadFields(*stored_record);
if (stored_record->getRdPtr() < stored_record->getDataSize())
{
int g = 0;
}
}
isReading = true;
}
@ -81,11 +77,6 @@ void MsoDrawing::readFields(CFRecord& record)
record >> rgChildRec;
isReading = true;
if (record.getRdPtr() < record.getDataSize())
{
int g = 0;
}
}

View File

@ -52,7 +52,7 @@ BaseObjectPtr ObProj::clone()
void ObProj::readFields(CFRecord& record)
{
//vba present in file .. выше .. по наличию собствено стороджа
// the tag doesn't contain data
}
} // namespace XLS

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of ObProj record in BIFF8
class ObProj: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ObProj)
@ -45,10 +47,13 @@ public:
~ObProj();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeObProj;
};
} // namespace XLS

View File

@ -57,9 +57,9 @@
#define OBJ_Label 0x000E
#define OBJ_DialogBox 0x000F
#define OBJ_SpinControl 0x0010
#define OBJ_Scrollbar 0x0011
#define OBJ_List 0x0012
#define OBJ_GroupBox 0x0013
#define OBJ_Scrollbar 0x0011
#define OBJ_DropdownList 0x0014
#define OBJ_Note 0x0019
@ -80,6 +80,7 @@ BaseObjectPtr Obj::clone()
void Obj::readFields(CFRecord& record)
{
record >> cmo;
size_t rdPtr = record.getRdPtr();
if (record.getGlobalWorkbookInfo()->Version >= 0x0600)
{
@ -87,74 +88,62 @@ void Obj::readFields(CFRecord& record)
{
record.skipNunBytes(6); // Skip FtGmo (obsolete)
}
if( OBJ_Picture == cmo.ot)
if(OBJ_Picture == cmo.ot)
{
record >> pictFormat;
record >> pictFlags;
}
if( OBJ_CheckBox == cmo.ot ||
OBJ_RadioButton == cmo.ot)
if(0x0B == cmo.ot || 0x0C == cmo.ot)
{
record.skipNunBytes(16); // Skip FtCbls (obsolete)
}
if( OBJ_RadioButton == cmo.ot)
if(0x0C == cmo.ot)
{
record.skipNunBytes(10); // Skip FtRbo (obsolete)
}
if( OBJ_SpinControl == cmo.ot ||
OBJ_Scrollbar == cmo.ot ||
OBJ_List == cmo.ot ||
OBJ_DropdownList == cmo.ot)
if(0x10 == cmo.ot || 0x11 == cmo.ot || 0x12 == cmo.ot || 0x14 == cmo.ot)
{
record >> sbs;
}
if( OBJ_Note == cmo.ot)
if(0x19 == cmo.ot)
{
record >> nts;
}
//if(false) // TODO: Find out the condition
//{
// macro.load(record);
//}
macro.load(record);
if( OBJ_Picture == cmo.ot)
{
pictFmla.load(record, pictFlags);
}
if( OBJ_CheckBox == cmo.ot ||
OBJ_RadioButton == cmo.ot ||
OBJ_SpinControl == cmo.ot ||
OBJ_Scrollbar == cmo.ot ||
OBJ_List == cmo.ot /*|| OBJ_DropdownList == cmo.ot*/)
if(0x0B == cmo.ot || 0x0C == cmo.ot || 0x10 == cmo.ot || 0x11 == cmo.ot || 0x12 == cmo.ot /*|| 0x14 == cmo.ot*/)
{
linkFmla.load(record);
}
if( OBJ_CheckBox == cmo.ot ||
OBJ_RadioButton == cmo.ot)
if(0x0B == cmo.ot || 0x0C == cmo.ot)
{
checkBox.load(record);
}
if( OBJ_RadioButton == cmo.ot)
if(0x0C == cmo.ot)
{
radioButton.load(record);
}
if( OBJ_EditBox == cmo.ot)
if(0x0D == cmo.ot)
{
edit.load(record);
}
if( OBJ_List == cmo.ot ||
OBJ_DropdownList == cmo.ot)
if(0x12 == cmo.ot || 0x14 == cmo.ot)
{
list.load(record, cmo.ot);
}
if( OBJ_GroupBox == cmo.ot)
if(0x13 == cmo.ot)
{
gbo.load(record);
}
if( OBJ_List != cmo.ot && OBJ_DropdownList != cmo.ot)
}
if(0x12 != cmo.ot && 0x14 != cmo.ot)
{
record.skipNunBytes(4); // reserved
}
//------------------------------------------------------------------------------------------------------
if (continue_records.size() > 0)
{
std::list<CFRecordPtr>& recs = continue_records[rt_Continue];

View File

@ -32,25 +32,27 @@
#pragma once
#include "BiffRecordContinued.h"
#include "MsoDrawing.h"
#include "../Biff_structures/FtCmo.h"
#include "../Biff_structures/FtCf.h"
#include "../Biff_structures/FtPioGrbit.h"
#include "../Biff_structures/FtSbs.h"
#include "../Biff_structures/FtNts.h"
#include "../Biff_structures/FtMacro.h"
#include "../Biff_structures/FtPictFmla.h"
#include "../Biff_structures/ObjLinkFmla.h"
#include "../Biff_structures/FtCblsData.h"
#include "../Biff_structures/FtRboData.h"
#include "../Biff_structures/FtEdoData.h"
#include "../Biff_structures/FtLbsData.h"
#include "../Biff_structures/FtGboData.h"
#include <Logic/Biff_structures/FtCmo.h>
#include <Logic/Biff_structures/FtCf.h>
#include <Logic/Biff_structures/FtPioGrbit.h>
#include <Logic/Biff_structures/FtSbs.h>
#include <Logic/Biff_structures/FtNts.h>
#include <Logic/Biff_structures/FtMacro.h>
#include <Logic/Biff_structures/FtPictFmla.h>
#include <Logic/Biff_structures/ObjLinkFmla.h>
#include <Logic/Biff_structures/FtCblsData.h>
#include <Logic/Biff_structures/FtRboData.h>
#include <Logic/Biff_structures/FtEdoData.h>
#include <Logic/Biff_structures/FtLbsData.h>
#include <Logic/Biff_structures/FtGboData.h>
#include <Logic/Biff_records/MsoDrawing.h>
namespace XLS
{
// Logical representation of Obj record in BIFF8
class Obj : public BiffRecordContinued
{
BIFF_RECORD_DEFINE_TYPE_INFO(Obj)
@ -63,10 +65,11 @@ public:
~Obj();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeObj;
static const ElementType type = typeObj;
//-----------------------------
FtCmo cmo;
@ -101,6 +104,8 @@ public:
_UINT16 flag;
_UINT16 flag2;
}old_version;
};
} // namespace XLS

View File

@ -39,10 +39,12 @@ Pls::Pls()
{
}
Pls::~Pls()
{
}
BaseObjectPtr Pls::clone()
{
return BaseObjectPtr(new Pls());
@ -69,9 +71,9 @@ void Pls::readFields(CFRecord& record)
}
int size = record.getDataSize() - 2;
const BYTE* data = (BYTE*)record.getData() + 2;
const char* data = record.getData() + 2;
boost::shared_array<BYTE> buffer(new BYTE[size]);
boost::shared_array<char> buffer(new char[size]);
memcpy(buffer.get(), data, size);
bin_data_id = -1;
@ -79,7 +81,7 @@ void Pls::readFields(CFRecord& record)
GlobalWorkbookInfo* globla_info = record.getGlobalWorkbookInfo().get();
if (globla_info)
{
globla_info->bin_data.push_back(std::pair<boost::shared_array<BYTE>, size_t>(buffer, size));
globla_info->bin_data.push_back(std::pair<boost::shared_array<char>, size_t>(buffer, size));
bin_data_id = globla_info->bin_data.size() - 1;
}

View File

@ -31,7 +31,7 @@
*/
#pragma once
#include "BiffRecordContinued.h"
#include <Logic/Biff_records/BiffRecordContinued.h>
#if !defined(_WIN32) && !defined(_WIN64)
@ -109,7 +109,9 @@
namespace XLS
{
class Pls : public BiffRecordContinued
// Logical representation of Pls record in BIFF8
class Pls : public BiffRecordContinued
{
BIFF_RECORD_DEFINE_TYPE_INFO(Pls)
BASE_OBJECT_DEFINE_CLASS_NAME(Pls)

View File

@ -32,12 +32,14 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/RkRec.h"
#include "../Biff_structures/Cell.h"
#include <Logic/Biff_structures/RkRec.h>
#include <Logic/Biff_structures/Cell.h>
namespace XLS
{
// Logical representation of RK record in BIFF8
class RK: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(RK)
@ -47,6 +49,7 @@ public:
~RK();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -32,10 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/SheetId.h"
#include <Logic/Biff_structures/SheetId.h>
namespace XLS
{
// Logical representation of RRTabId record in BIFF8
class RRTabId: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(RRTabId)
@ -45,6 +48,7 @@ public:
~RRTabId();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of RecalcId record in BIFF8
class RecalcId: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(RecalcId)
@ -45,12 +47,16 @@ public:
~RecalcId();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeRecalcId;
//-----------------------------
_UINT32 dwBuild;
};
} // namespace XLS

View File

@ -35,7 +35,7 @@
namespace XLS
{
SupBook::SupBook() : bOleLink(false), bSimple(false), bPath(false)
SupBook::SupBook()
{
}
@ -55,133 +55,22 @@ void SupBook::readFields(CFRecord& record)
record >> ctab >> cch;
if(0x0001 <= cch && 0x00ff >= cch)
{
XLUnicodeStringNoCch temp;
temp.setSize(cch);
record >> temp;
origin = temp.value();
while(!record.isEOF())
virtPath.setSize(cch);
record >> virtPath;
//virtPath.EscapeUrlW(); //todooo проверить спец символы !!!
//if(virtPath.isConformToVirtPath() && !virtPath.isConformToOleLink())
{
XLUnicodeString temp2;
record >> temp2;
rgst.push_back(temp2.value());
}
}
//virt-path = volume / unc-volume / rel-volume / transfer-protocol / startup / alt-startup / library / simple-file-path / ole-link
//ole-link = path-string %x0003 path-string
//simple-file-path = [%x0001]
//file-path startup = %x0001 %x0006 file-path
//alt-startup = %x0001 %x0007 file-path
//library = %x0001 %x0008 file-path
//transfer-protocol = %x0001 %x0005 count transfer-path
//transfer-path = transfer-base-path / "[" transfer-base-path "]" sheet-name
//transfer-base-path = transfer-type "://" file-path
//transfer-type = "ftp" / "http" / "https"
//rel-volume = %x0001 %x0002 file-path
//...
bool bFilePathType = false;
if (!origin.empty())
{
std::wstring sTmp = origin;
while(true)
{
int pos = sTmp.find(L"\x0001");
if (pos >= 0)
{
if (bSimple)
{
bFilePathType = true;
bPath = true; //xls_result.xls
}
else bSimple = true; //file name or file path
virtPath.push_back(sTmp.substr(0, pos));
sTmp = sTmp.substr(pos + 1);
continue;
}
pos = sTmp.find(L"\x0002");
if (pos >= 0)
{
if (bSimple)
bPath = true;
virtPath.push_back(sTmp.substr(0, pos));
sTmp = sTmp.substr(pos + 1);
continue;
}
pos = sTmp.find(L"\x0003");
if (pos >= 0)
{
if (bPath)
{
if (bFilePathType)
{
virtPath.back() += L"file:///" + sTmp.substr(0, 1) + L":\\" + sTmp.substr(1, pos - 1);
bFilePathType = false;
}
else
virtPath.back() += L"/" + sTmp.substr(0, pos);
}
else
{
bOleLink = true;
virtPath.push_back(sTmp.substr(0, pos));
}
sTmp = sTmp.substr(pos + 1);
continue;
}
pos = sTmp.find(L"\x0004");
if (pos >= 0)
{
virtPath.push_back(sTmp.substr(0, pos));
sTmp = sTmp.substr(pos + 1);
continue;
}
pos = sTmp.find(L"\x0005");
if (pos >= 0)
{
virtPath.push_back(sTmp.substr(0, pos));
//skip http size
sTmp = sTmp.substr(pos + 2);
continue;
}
pos = sTmp.find(L"\x0006");
if (pos >= 0)
{
virtPath.push_back(sTmp.substr(0, pos));
sTmp = sTmp.substr(pos + 1);
continue;
}
pos = sTmp.find(L"\x0007");
if (pos >= 0)
{
virtPath.push_back(sTmp.substr(0, pos));
sTmp = sTmp.substr(pos + 1);
continue;
}
pos = sTmp.find(L"\x0008");
if (pos >= 0)
{
virtPath.push_back(sTmp.substr(0, pos));
sTmp = sTmp.substr(pos + 1);
continue;
}
break;
}
if (bPath)
{
virtPath.back() += L"/" + sTmp;
}
else
{
virtPath.push_back(sTmp);
record >> rgst;
}
}
}
const unsigned short SupBook::getSupportingLinkType() const
{
return cch;
}
} // namespace XLS

View File

@ -37,6 +37,8 @@
namespace XLS
{
// Logical representation of SupBook record in BIFF8
class SupBook: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(SupBook)
@ -45,23 +47,22 @@ public:
SupBook();
~SupBook();
const unsigned short getSupportingLinkType() const;
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeSupBook;
_UINT16 ctab;
_UINT16 cch;
std::wstring origin;
std::vector<std::wstring> rgst;
//-----------------------------
std::vector<std::wstring> virtPath;
_UINT16 ctab;
_UINT16 cch;
XLUnicodeStringNoCch virtPath;
XLUnicodeString rgst;
bool bOleLink;
bool bSimple;
bool bPath;
};
typedef boost::shared_ptr<SupBook> SupBookPtr;

View File

@ -31,7 +31,7 @@
*/
#include "Sync.h"
#include "../Biff_structures/CellRef.h"
#include <Logic/Biff_structures/CellRef.h>
namespace XLS
{

View File

@ -35,6 +35,9 @@
namespace XLS
{
// Logical representation of UsesELFs record in BIFF8
class UsesELFs: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(UsesELFs)
@ -44,12 +47,15 @@ public:
~UsesELFs();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeUsesELFs;
static const ElementType type = typeUsesELFs;
//-----------------------------
Boolean<unsigned short> useselfs;
};
} // namespace XLS

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of XCT record in BIFF8
class XCT: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(XCT)
@ -48,8 +50,9 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeXCT;
static const ElementType type = typeXCT;
//-----------------------------
_UINT16 ccrn;
_UINT16 itab;
bool itab_exist;

View File

@ -46,6 +46,7 @@ void AddinUdf::load(CFRecord& record)
{
record.skipNunBytes(4); // reserved
record >> udfName;
record.getGlobalWorkbookInfo()->AddinUdfs.push_back(udfName);
unsigned short cb;
record >> cb;

View File

@ -32,7 +32,7 @@
#pragma once
#include "BiffStructure.h"
#include "BiffString.h"
#include <Logic/Biff_structures/BiffString.h>
namespace XLS
{
@ -47,7 +47,8 @@ public:
virtual void load(CFRecord& record);
static const ElementType type = typeAddinUdf;
static const ElementType type = typeAddinUdf;
ShortXLUnicodeString udfName;
};

View File

@ -33,7 +33,7 @@
#include "BiffStructure.h"
#include "CellRef.h"
#include "BitMarkedStructs.h"
#include <Logic/Biff_structures/BitMarkedStructs.h>
namespace XLS
{
@ -51,6 +51,7 @@ public:
virtual void load(CFRecord& record);
const CellRef getLocation() const;
static const ElementType type = typeCell;

View File

@ -32,7 +32,7 @@
#pragma once
#include "BiffStructure.h"
#include "BiffString.h"
#include <Logic/Biff_structures/BiffString.h>
namespace XLS
{
@ -47,6 +47,7 @@ public:
virtual void load(CFRecord& record);
static const ElementType type = typeExternDdeLinkNoOper;
ShortXLUnicodeString linkName;

View File

@ -48,7 +48,6 @@ void ExternDocName::load(CFRecord& record)
record >> ixals;
record.skipNunBytes(2); // reserved
record >> extName;
nameDefinition.load(record);
}

View File

@ -31,8 +31,9 @@
*/
#pragma once
#include "ExtNameParsedFormula.h"
#include "BiffString.h"
#include "BiffStructure.h"
#include <Logic/Biff_structures/ExtNameParsedFormula.h>
#include <Logic/Biff_structures/BiffString.h>
namespace XLS
{
@ -49,6 +50,7 @@ public:
virtual void load(CFRecord& record);
unsigned short ixals;
ShortXLUnicodeString extName;
ExtNameParsedFormula nameDefinition;

View File

@ -32,8 +32,8 @@
#pragma once
#include "BiffStructure.h"
#include "MOper.h"
#include "BiffString.h"
#include <Logic/Biff_structures/MOper.h>
#include <Logic/Biff_structures/BiffString.h>
namespace XLS
{
@ -48,6 +48,7 @@ public:
virtual void load(CFRecord& record);
static const ElementType type = typeExternOleDdeLink;
_UINT32 lStgName;

View File

@ -37,22 +37,16 @@
namespace XLS
{
BiffStructurePtr FtCblsData::clone()
{
return BiffStructurePtr(new FtCblsData(*this));
}
void FtCblsData::load(CFRecord& record)
{
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x000a && cb != 0x000c)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record.skipNunBytes(4); // reserved
record >> fChecked >> accel;
record.skipNunBytes(2); // reserved

View File

@ -42,20 +42,16 @@ class FtCblsData : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtCblsData)
public:
FtCblsData() : fExist(false)
{
}
BiffStructurePtr clone();
static const ElementType type = typeFtCblsData;
static const ElementType type = typeFtCblsData;
virtual void load(CFRecord& record);
unsigned short fChecked;
unsigned short accel;
bool fNo3d;
bool fExist;
};
} // namespace XLS

View File

@ -46,7 +46,8 @@ public:
virtual void load(CFRecord& record);
static const ElementType type = typeFtCmo;
static const ElementType type = typeFtCmo;
unsigned short ot;
unsigned short id;
@ -59,6 +60,7 @@ public:
bool fUIObj;
bool fRecalcObj;
bool fRecalcObjAlways;
};
} // namespace XLS

View File

@ -36,22 +36,16 @@
namespace XLS
{
BiffStructurePtr FtEdoData::clone()
{
return BiffStructurePtr(new FtEdoData(*this));
}
void FtEdoData::load(CFRecord& record)
{
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x0010 && cb != 0x0008)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record.skipNunBytes(4); // reserved
record >> ivtEdit >> fMultiLine >> fVScroll >> id;
}

View File

@ -43,21 +43,17 @@ class FtEdoData : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtEdoData)
public:
FtEdoData() : fExist(false)
{
}
BiffStructurePtr clone();
static const ElementType type = typeFtEdoData;
static const ElementType type = typeFtEdoData;
virtual void load(CFRecord& record);
unsigned short ivtEdit;
Boolean<unsigned short> fMultiLine;
unsigned short fVScroll;
unsigned short id;
bool fExist;
};
} // namespace XLS

View File

@ -36,6 +36,7 @@
namespace XLS
{
BiffStructurePtr FtGboData::clone()
{
return BiffStructurePtr(new FtGboData(*this));
@ -43,15 +44,7 @@ BiffStructurePtr FtGboData::clone()
void FtGboData::load(CFRecord& record)
{
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x000F && cb != 0x0006)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record.skipNunBytes(4); // reserved
record >> accel;
record.skipNunBytes(2); // reserved

View File

@ -43,19 +43,15 @@ class FtGboData : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtGboData)
public:
FtGboData() : fExist(false)
{
}
BiffStructurePtr clone();
virtual void load(CFRecord& record);
static const ElementType type = typeFtGboData;
static const ElementType type = typeFtGboData;
unsigned short accel;
bool fNo3d;
bool fExist;
};
} // namespace XLS

View File

@ -36,6 +36,12 @@
namespace XLS
{
FtLbsData::FtLbsData()
: fmla(false)
{
}
BiffStructurePtr FtLbsData::clone()
{
return BiffStructurePtr(new FtLbsData(*this));
@ -43,27 +49,19 @@ BiffStructurePtr FtLbsData::clone()
void FtLbsData::load(CFRecord& record, const unsigned short ot)
{
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x0013)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record.skipNunBytes(4); // reserved
fmla.load(record);
unsigned short flags;
record >> cLines >> iSel >> flags >> idEdit;
fUseCB = GETBIT(flags, 0);
fValidPlex = GETBIT(flags, 1);
fValidIds = GETBIT(flags, 2);
fNo3d = GETBIT(flags, 3);
fUseCB = GETBIT(flags, 0);
fValidPlex = GETBIT(flags, 1);
fValidIds = GETBIT(flags, 2);
fNo3d = GETBIT(flags, 3);
wListSelType = GETBITS(flags, 4, 5);
lct = GETBITS(flags, 8, 15);
lct = GETBITS(flags, 8, 15);
if(0x0014 == ot)
{

View File

@ -46,12 +46,10 @@ class FtLbsData : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtLbsData)
public:
FtLbsData() : fmla(false), fExist(false)
{
}
FtLbsData();
BiffStructurePtr clone();
static const ElementType type = typeFtLbsData;
static const ElementType type = typeFtLbsData;
virtual void load(CFRecord& record, const unsigned short ot);
@ -74,7 +72,6 @@ public:
std::vector<XLUnicodeString> rgLines;
std::vector<Boolean<unsigned char>> bsels;
bool fExist;
};
} // namespace XLS

View File

@ -36,7 +36,9 @@
namespace XLS
{
FtMacro::FtMacro() : fmla(false), fExist(false)
FtMacro::FtMacro()
: fmla(false)
{
}
@ -46,18 +48,14 @@ BiffStructurePtr FtMacro::clone()
}
void FtMacro::load(CFRecord& record)
{
short ft;
record >> ft;
if (ft != 0x0004)
{
record.RollRdPtrBack(2);
return;
}
fExist = true;
record.skipNunBytes(2); // reserved
fmla.load(record);
}
} // namespace XLS

View File

@ -50,8 +50,8 @@ public:
virtual void load(CFRecord& record);
ObjFmla fmla;
bool fExist;
};
} // namespace XLS

View File

@ -37,22 +37,16 @@
namespace XLS
{
BiffStructurePtr FtNts::clone()
{
return BiffStructurePtr(new FtNts(*this));
}
void FtNts::load(CFRecord& record)
{
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x000d && cb != 0x0016)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record.skipNunBytes(4); // reserved
_GUID_ guid_num;
record >> guid_num >> fSharedNote;

View File

@ -43,19 +43,15 @@ class FtNts : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtNts)
public:
FtNts() : fExist(false)
{
}
BiffStructurePtr clone();
static const ElementType type = typeFtNts;
static const ElementType type = typeFtNts;
virtual void load(CFRecord& record);
std::wstring guid;
Boolean<unsigned short> fSharedNote;
bool fExist;
};
} // namespace XLS

View File

@ -36,11 +36,18 @@
namespace XLS
{
FtPictFmla::FtPictFmla()
: fmla(true)
{
}
BiffStructurePtr FtPictFmla::clone()
{
return BiffStructurePtr(new FtPictFmla(*this));
}
void FtPictFmla::load(CFRecord& record, int linkSize)
{
bool bLinked = false;
@ -67,8 +74,11 @@ void FtPictFmla::load(CFRecord& record, int linkSize)
record >> nNameIdx;
record.skipNunBytes(12);
//const ExtName* pExtName = GetOldRoot().pExtNameBuff->GetNameByIndex( nRefIdx, nNameIdx );
// if( pExtName && pExtName->IsOLE() )
// mnStorageId = pExtName->nStorageId;
}
else if( nToken == 2)
else if( nToken == 2)//XclTokenArrayHelper::GetTokenId( EXC_TOKID_TBL, EXC_TOKCLASS_NONE ) )
{
bEmbedded = true;
@ -93,17 +103,7 @@ void FtPictFmla::load(CFRecord& record, int linkSize)
void FtPictFmla::load(CFRecord& record, FtPioGrbit& pictFlags)
{
short ft, size;
record >> ft; // must be
if (ft != 0x0009)
{
record.RollRdPtrBack(2);
return;
}
fExist = true;
record >> size;
if (size < 1) return;
record.skipNunBytes(4); // reserved
fmla.load(record);
@ -111,11 +111,12 @@ void FtPictFmla::load(CFRecord& record, FtPioGrbit& pictFlags)
{
record >> lPosInCtlStm;
}
record >> lPosInCtlStm;
if(pictFlags.fPrstm)
{
record >> cbBufInCtlStm;
}
if(pictFlags.fCtl)
if(pictFlags.fPrstm)
{
key.load(record);
}

View File

@ -45,25 +45,20 @@ class FtPictFmla : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtPictFmla)
public:
FtPictFmla() : fmla(true), cbBufInCtlStm(0xffffffff), lPosInCtlStm(0xffffffff), fExist(false)
{
}
FtPictFmla();
BiffStructurePtr clone();
virtual void load(CFRecord& record){}
//biff5
virtual void load(CFRecord& record, int linkSize);
//biff8
virtual void load(CFRecord& record, FtPioGrbit& pictFlags);
static const ElementType type = typeFtPictFmla;
virtual void load(CFRecord& record){}
ObjFmla fmla;
_UINT32 lPosInCtlStm;
_UINT32 cbBufInCtlStm;
PictFmlaKey key;
ObjFmla fmla;
bool fExist;
PictFmlaKey key;
};
} // namespace XLS

View File

@ -44,28 +44,28 @@ BiffStructurePtr FtPioGrbit::clone()
void FtPioGrbit::load(CFRecord& record)
{
//record.skipNunBytes(4); // reserved
unsigned short ft, cb;
record >> ft >> cb;
record >> ft;
record >> cb;
if ( ft != 0x0008 || cb != 2)
if (record.getDataSize() == record.getRdPtr())
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
unsigned short flags;
record >> flags;
fAutoPict = GETBIT(flags, 0);
fDde = GETBIT(flags, 1);
fPrintCalc = GETBIT(flags, 2);
fIcon = GETBIT(flags, 3);
fCtl = GETBIT(flags, 4);
fPrstm = GETBIT(flags, 5);
fCamera = GETBIT(flags, 7);
fAutoPict = GETBIT(flags, 0);
fDde = GETBIT(flags, 1);
fPrintCalc = GETBIT(flags, 2);
fIcon = GETBIT(flags, 3);
fCtl = GETBIT(flags, 4);
fPrstm = GETBIT(flags, 5);
fCamera = GETBIT(flags, 7);
fDefaultSize = GETBIT(flags, 8);
fAutoLoad = GETBIT(flags, 9);
fAutoLoad = GETBIT(flags, 9);
}

View File

@ -42,15 +42,13 @@ class FtPioGrbit : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtPioGrbit)
public:
FtPioGrbit() : fExist(false)
{
}
BiffStructurePtr clone();
static const ElementType type = typeFtPioGrbit;
virtual void load(CFRecord& record);
bool fAutoPict;
bool fDde;
bool fPrintCalc;
@ -60,8 +58,6 @@ public:
bool fCamera;
bool fDefaultSize;
bool fAutoLoad;
bool fExist;
};
} // namespace XLS

View File

@ -45,15 +45,7 @@ BiffStructurePtr FtRboData::clone()
void FtRboData::load(CFRecord& record)
{
unsigned short ft, cb;
record >> ft >> cb;
if ( ft != 0x000b && cb != 0x0006)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record.skipNunBytes(4); // reserved
record >> idRadNext >> fFirstBtn;
}

View File

@ -43,19 +43,15 @@ class FtRboData : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtRboData)
public:
FtRboData() : fExist(false)
{
}
BiffStructurePtr clone();
static const ElementType type = typeFtRboData;
static const ElementType type = typeFtRboData;
virtual void load(CFRecord& record);
unsigned short idRadNext;
Boolean<unsigned short> fFirstBtn;
bool fExist;
};
} // namespace XLS

View File

@ -36,6 +36,7 @@
namespace XLS
{
BiffStructurePtr FtSbs::clone()
{
return BiffStructurePtr(new FtSbs(*this));
@ -43,15 +44,10 @@ BiffStructurePtr FtSbs::clone()
void FtSbs::load(CFRecord& record)
{
unsigned short ft, cb;
record >> ft >> cb;
//record.skipNunBytes(4); // reserved
if ( ft != 0x000c && cb != 0x0014)
{
record.RollRdPtrBack(4);
return;
}
fExist = true;
record >> ft;
record >> cb;
record.skipNunBytes(4); // unused1
@ -59,10 +55,10 @@ void FtSbs::load(CFRecord& record)
record >> iVal >> iMin >> iMax >> dInc >> dPage >> fHoriz >> dxScroll >> flags;
fDraw = GETBIT(flags, 0);
fDraw = GETBIT(flags, 0);
fDrawSliderOnly = GETBIT(flags, 1);
fTrackElevator = GETBIT(flags, 2);
fNo3d = GETBIT(flags, 3);
fTrackElevator = GETBIT(flags, 2);
fNo3d = GETBIT(flags, 3);
}

View File

@ -43,15 +43,16 @@ class FtSbs : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(FtSbs)
public:
FtSbs() : fExist(false)
{
}
BiffStructurePtr clone();
static const ElementType type = typeFtSbs;
static const ElementType type = typeFtSbs;
virtual void load(CFRecord& record);
unsigned short ft;
unsigned short cb;
short iVal;
short iMin;
short iMax;
@ -64,8 +65,6 @@ public:
bool fDrawSliderOnly;
bool fTrackElevator;
bool fNo3d;
bool fExist;
};
} // namespace XLS

View File

@ -32,11 +32,11 @@
#include "MOper.h"
#include <Binary/CFRecord.h>
#include <simple_xml_writer.h>
namespace XLS
{
BiffStructurePtr MOper::clone()
{
return BiffStructurePtr(new MOper(*this));
@ -45,52 +45,16 @@ BiffStructurePtr MOper::clone()
void MOper::load(CFRecord& record)
{
record >> colLast >> rowLast;
for(int i = 0; i < (colLast + 1) * (rowLast + 1); ++i)
{
unsigned char rec_type;
record >> rec_type;
SerArPtr ser(SerAr::createSerAr(rec_type));
record >> *ser;
extOper.push_back(ser);
}
}
int MOper::serialize(std::wostream & strm)
{
if (extOper.empty()) return 0;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"values")
{
for(size_t i = 0; i < extOper.size(); ++i)
{
CP_XML_NODE(L"value")
{
switch(extOper[i]->fixed_type)
{
case SerAr::typeSerNil: CP_XML_ATTR(L"t", L"nil"); break;
case SerAr::typeSerNum: CP_XML_ATTR(L"t", L"n"); break;
case SerAr::typeSerStr: CP_XML_ATTR(L"t", L"str"); break;
case SerAr::typeSerBool: CP_XML_ATTR(L"t", L"b"); break;
case SerAr::typeSerErr: CP_XML_ATTR(L"t", L"e"); break;
}
CP_XML_NODE(L"val")
{
if (extOper[i]->fixed_type == SerAr::typeSerStr)
{
CP_XML_ATTR(L"xml:space", L"preserve");
}
CP_XML_STREAM() << extOper[i]->toString();
}
}
}
}
}
return 0;
}
} // namespace XLS

Some files were not shown because too many files have changed in this diff Show More