mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
348 Commits
v9.2.0.103
...
v9.3.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 57984ca8a2 | |||
| a30f7dfdf4 | |||
| b369c32e9e | |||
| 40a4fa1a92 | |||
| 2779542061 | |||
| 3209c8e42e | |||
| 037057ea7a | |||
| d373a8cc4c | |||
| 13e2efe724 | |||
| b09d441987 | |||
| 9e835d5cc1 | |||
| f75df05824 | |||
| d7a1642a62 | |||
| d74899a116 | |||
| d0dfd6737c | |||
| 3623b0970b | |||
| 9fedabc0e2 | |||
| fa46455e74 | |||
| 9dacd4a548 | |||
| fb8a72cd6b | |||
| 61311457be | |||
| e15391ea35 | |||
| fefeb483e5 | |||
| 5c7ef5a6eb | |||
| fc110a004d | |||
| 12d33fad53 | |||
| 2534d2b5c9 | |||
| 7019b192bd | |||
| ac97a5680b | |||
| bebb39a619 | |||
| d014383a6d | |||
| f2023f626b | |||
| 6ea64599bd | |||
| d1d94f481d | |||
| 82eb921f05 | |||
| 84847f1e74 | |||
| 8391667147 | |||
| 39da47bc21 | |||
| 3a201b8b28 | |||
| bbfbe4a149 | |||
| 0c1c57ccb3 | |||
| fa532edad6 | |||
| df82306306 | |||
| 7a3464b985 | |||
| 49924e23ac | |||
| 1eaac39e48 | |||
| 7624e24027 | |||
| 44ffa4b72e | |||
| 10bdf2703a | |||
| c488384dbc | |||
| b1b3e1fb7c | |||
| d78487e0f5 | |||
| 5069b68247 | |||
| 86d0d2113e | |||
| 8f2b4e4153 | |||
| 0be867c47d | |||
| 78aae7e9d0 | |||
| 10e63543dc | |||
| 900cf01902 | |||
| f6a52876ce | |||
| 45ad566eb1 | |||
| 5bbea51848 | |||
| 28a1828000 | |||
| 816430e0e2 | |||
| bf66c1d9c0 | |||
| 2a3982a884 | |||
| b5fb8a34dc | |||
| 11f0c937f4 | |||
| 5e435d322f | |||
| 842d17f79e | |||
| d48a28fe1d | |||
| 2a22c5e1f3 | |||
| 629a35213e | |||
| a056b2e4a9 | |||
| 2dd35a7d81 | |||
| 080d89c8a0 | |||
| 1809f7f4c2 | |||
| 4bfd4f0a08 | |||
| 3ef5651dfd | |||
| 8231809ef0 | |||
| 7f3d073d63 | |||
| 5f09e91944 | |||
| f4359e0b7f | |||
| ca9cf4ee61 | |||
| f52538f66a | |||
| 15359be125 | |||
| fc2a12c6f2 | |||
| 42030372fe | |||
| bbf6c2d8e9 | |||
| cb15cc18eb | |||
| 389bf976a9 | |||
| 4d1b516cc9 | |||
| 600a59c966 | |||
| 66b2f3c828 | |||
| 64e077da19 | |||
| 499fe52b8c | |||
| 6f9c376040 | |||
| 1e18352e77 | |||
| c3f4f32702 | |||
| 6df7a7e01e | |||
| 6167f23a08 | |||
| 7c544729bc | |||
| d60c102dbb | |||
| d709598563 | |||
| 7afad1fe49 | |||
| aa53d6302f | |||
| 7f665b96a5 | |||
| 8926c15908 | |||
| 033c45b7a0 | |||
| 16d75fe498 | |||
| fe2e1568fa | |||
| 7e057bab6e | |||
| 4bf8308bff | |||
| 6af3f2fe35 | |||
| b61d8df484 | |||
| fc3748e516 | |||
| 468dcd7ba4 | |||
| 7048f132c6 | |||
| 238cdc8084 | |||
| 580283ef45 | |||
| fd648a7dd3 | |||
| 4d4f3be717 | |||
| 6e481f6a34 | |||
| 2059e4bb95 | |||
| 6a5186c411 | |||
| b5ea9d68e2 | |||
| 71e96930c9 | |||
| d9be0df8fb | |||
| 3cee4b0212 | |||
| cfb62d599d | |||
| 919d117a1f | |||
| d4b289d0ca | |||
| 270e8e41dd | |||
| 751b82dc51 | |||
| 320e30c857 | |||
| a6898c8235 | |||
| 463ca05404 | |||
| 548cee436a | |||
| b1a36d546b | |||
| 07d3f371a2 | |||
| 278cac8a61 | |||
| 07fd1e87d7 | |||
| 817ee4dde0 | |||
| d93bd27896 | |||
| be56209baf | |||
| 6a573d0da7 | |||
| e936e330d9 | |||
| bda95fc03d | |||
| c0c0289ffb | |||
| 5c110799a6 | |||
| 1b6c81407b | |||
| 1e0d662838 | |||
| ae2680c419 | |||
| 1b61353b2e | |||
| 7777048790 | |||
| fd6c0907bd | |||
| 2aef5daf12 | |||
| 317e21af6a | |||
| 4f6daaae67 | |||
| 8203492999 | |||
| 910f453ce8 | |||
| 54fb5a7891 | |||
| 93b96e5555 | |||
| 9e57f8c3b1 | |||
| 57221c0e32 | |||
| 76b7099a37 | |||
| 85f428fda6 | |||
| d97a62442f | |||
| 41fb12d58b | |||
| ed0811d8ab | |||
| 84cc97f035 | |||
| 984807d611 | |||
| dbd92bfdfa | |||
| 2796fbed8b | |||
| 9ccbb25acd | |||
| 954d86ed0f | |||
| 1dd5eb3368 | |||
| 47e0a0c9e7 | |||
| 5a491aea3e | |||
| 2d7c5ec2df | |||
| 38079e8692 | |||
| ac75675367 | |||
| a0fc634f5f | |||
| 2ebade4413 | |||
| 5e9f99e960 | |||
| a67935908a | |||
| da1bc5d2d6 | |||
| 9d5388a7bf | |||
| 2cdb04656d | |||
| 3934c28eb8 | |||
| f6337bb12c | |||
| 1d88830b38 | |||
| 9737038776 | |||
| 915c3497e4 | |||
| 53c4f320f6 | |||
| 1aec69965d | |||
| afdac778b0 | |||
| fbc42a514f | |||
| c567c9739c | |||
| 686b719bff | |||
| f05fa7c0ee | |||
| 0d646a32c4 | |||
| 917c33e76d | |||
| 1937895a56 | |||
| 01fbf07c9e | |||
| d208215814 | |||
| c45c63f914 | |||
| 5c5a18de0d | |||
| 9f24bda011 | |||
| fdb9eaa2a5 | |||
| 3e9b0ffbda | |||
| eb2ba042ef | |||
| 1111f421d9 | |||
| e2bda52737 | |||
| 6c9c2cf538 | |||
| 62d826d8c6 | |||
| dfbdb869d7 | |||
| ed7a50855e | |||
| 526a21da57 | |||
| fb6bda209b | |||
| 4b0f79a1ab | |||
| e5946892c9 | |||
| d399027127 | |||
| 2e732ce62f | |||
| 44e6774c5a | |||
| 7ddb363d60 | |||
| ecd333e238 | |||
| b377493ecb | |||
| afeeeab564 | |||
| 460abc0d55 | |||
| 01b2aaedb2 | |||
| 580c896b72 | |||
| 03a1d9fa4c | |||
| 61d199a0c1 | |||
| 4ea31dcb00 | |||
| 54a0c7f231 | |||
| a4d60a1ae1 | |||
| b7b3e0dd65 | |||
| c28a6bf1ea | |||
| 9f24254cc7 | |||
| e105eca426 | |||
| 02a923afb4 | |||
| c7a0996a6c | |||
| 6d27231e15 | |||
| a2a5ef8fcd | |||
| 1c877ebe59 | |||
| f03248ca86 | |||
| a4005412a7 | |||
| e50016259a | |||
| d5a6c935e5 | |||
| aa3d4cb3ce | |||
| 73fa9b6aac | |||
| c9a0d6e4e5 | |||
| 130de28e4b | |||
| cd53c06be3 | |||
| 122a54f510 | |||
| b425405744 | |||
| 28ffd27fca | |||
| 9bc9d86dd6 | |||
| a1891b597f | |||
| bf9ce4f535 | |||
| 508d8f25db | |||
| efbfcaed37 | |||
| d1fc31ac28 | |||
| b8efe6c554 | |||
| 13410f8467 | |||
| 3a389147dd | |||
| ba203f734d | |||
| 758454747d | |||
| bf175e92a3 | |||
| 0c9b5821e7 | |||
| 98dae842ae | |||
| ff53c1b474 | |||
| 334f9602b4 | |||
| fed94358fe | |||
| 89b669e319 | |||
| db213d3ae4 | |||
| 79df81301f | |||
| 197bbf7027 | |||
| a466592bc2 | |||
| 4bce73d81d | |||
| ed13e54d26 | |||
| e371f7ccf1 | |||
| 14a0e4713c | |||
| 74b9a426c2 | |||
| 43c7e2c9a8 | |||
| 39b9c28607 | |||
| 6e57d7e4e7 | |||
| f831d9a22d | |||
| 7f54430813 | |||
| ea42899b9e | |||
| b420fd731f | |||
| dbbf4d04f9 | |||
| 62132c27bd | |||
| e4449d7aa9 | |||
| cb304293b7 | |||
| ffb62243a9 | |||
| 63a80580cc | |||
| fed142690b | |||
| 8d368ca91c | |||
| 2cc2434982 | |||
| f5989b979a | |||
| 62955d5f6e | |||
| 9fc3fcabcb | |||
| 6af0b89c1d | |||
| c34b9e00e5 | |||
| e715da8680 | |||
| 7a26c345c5 | |||
| 2a6e76a2bc | |||
| adfc79938d | |||
| c3ce1d2756 | |||
| cf5208d6a5 | |||
| 56e6a0a3b8 | |||
| 0a7ad2f560 | |||
| fede5921e1 | |||
| 897ea781b7 | |||
| f95014f46f | |||
| 92fae52a6d | |||
| afb0f44af2 | |||
| af20b1f63d | |||
| c779654a58 | |||
| d1c99891c6 | |||
| ffc94bf455 | |||
| 680c83853a | |||
| 33e698242c | |||
| e8ad643a0e | |||
| 609e3bc158 | |||
| 7e51dd143a | |||
| 31d65dea7c | |||
| 89172a9047 | |||
| 0103717241 | |||
| c012662402 | |||
| 00c3085a90 | |||
| f1fa861c8a | |||
| c37f96da2d | |||
| 89473c5ba0 | |||
| 07afc6e4c3 | |||
| 34c34018a0 | |||
| 05dd636a1c | |||
| e6158043b9 | |||
| cfd1dcc3ee | |||
| 7a2944ce58 | |||
| 8a11fa5aac | |||
| aa2127b55f | |||
| 86a2d66d83 | |||
| d6ed01e1df | |||
| 0fcf29eddc | |||
| 474a500819 |
@ -90,7 +90,7 @@ static std::wstring convertUtf16ToWString(const UTF16 * Data, int nLength)
|
||||
return std::wstring();
|
||||
}
|
||||
|
||||
std::wstring wstr ((wchar_t *) pStrUtf32);
|
||||
std::wstring wstr ((wchar_t *) pStrUtf32, nLength);
|
||||
|
||||
delete [] pStrUtf32;
|
||||
return wstr;
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
<<<<<<<
|
||||
if((c >= 'a' && c <= 'z') || (c>= 'A' && c<= 'Z') || (c >= '0' && c<= '9')){
|
||||
=======
|
||||
if((c >= 'a' && c <= 'z') || (c>= 'A' && c<= 'Z') || (c >= '0' && c<= '9') || ('-' == c) || ('_' == c) || ('.' == c) || ('~' == c)){
|
||||
>>>>>>>
|
||||
@ -74,6 +74,7 @@ public:
|
||||
bool isDocFormatFile(const std::wstring& fileName);
|
||||
bool isXlsFormatFile(const std::wstring& fileName);
|
||||
|
||||
bool isCompoundFile (POLE::Storage* storage);
|
||||
bool isOleObjectFile(POLE::Storage* storage);
|
||||
bool isDocFormatFile(POLE::Storage* storage);
|
||||
bool isXlsFormatFile(POLE::Storage* storage);
|
||||
|
||||
@ -552,6 +552,15 @@ bool COfficeFileFormatChecker::isPptFormatFile(POLE::Storage *storage)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COfficeFileFormatChecker::isCompoundFile(POLE::Storage* storage)
|
||||
{
|
||||
if (storage == NULL) return false;
|
||||
|
||||
if (storage->GetAllStreams(L"/").size() == 1) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::wstring COfficeFileFormatChecker::getDocumentID(const std::wstring &_fileName)
|
||||
{
|
||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(_WIN64)
|
||||
@ -749,6 +758,11 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_OTHER_MS_VBAPROJECT;
|
||||
return true;
|
||||
}
|
||||
else if (isCompoundFile(&storage))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_OTHER_COMPOUND;
|
||||
return true;
|
||||
}
|
||||
else if (isHwpFile(&storage))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWP;
|
||||
|
||||
@ -136,6 +136,7 @@
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_MS_MITCRYPTO AVS_OFFICESTUDIO_FILE_OTHER + 0x000b
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_MS_VBAPROJECT AVS_OFFICESTUDIO_FILE_OTHER + 0x000c
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_PACKAGE_IN_OLE AVS_OFFICESTUDIO_FILE_OTHER + 0x000d
|
||||
#define AVS_OFFICESTUDIO_FILE_OTHER_COMPOUND AVS_OFFICESTUDIO_FILE_OTHER + 0x000e
|
||||
|
||||
#define AVS_OFFICESTUDIO_FILE_TEAMLAB 0x1000
|
||||
#define AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY AVS_OFFICESTUDIO_FILE_TEAMLAB + 0x0001
|
||||
|
||||
@ -60,6 +60,7 @@ namespace NSSystemUtils
|
||||
static const wchar_t* gc_EnvModified = L"MODIFIED";
|
||||
static const wchar_t* gc_EnvMemoryLimit = L"X2T_MEMORY_LIMIT";
|
||||
static const wchar_t* gc_EnvMemoryLimitDefault = L"4GiB";
|
||||
static const wchar_t* gc_EnvSigningKeystorePassphrase = L"SIGNING_KEYSTORE_PASSPHRASE";
|
||||
|
||||
KERNEL_DECL std::string GetEnvVariableA(const std::wstring& strName);
|
||||
KERNEL_DECL std::wstring GetEnvVariable(const std::wstring& strName);
|
||||
|
||||
@ -245,7 +245,18 @@ public:
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CheckOwnerPassword(const std::wstring& sPassword)
|
||||
{
|
||||
if (m_nType == 0)
|
||||
return ((CPdfFile*)m_pFile)->CheckOwnerPassword(sPassword);
|
||||
return true;
|
||||
}
|
||||
bool CheckPerm(int nPerm)
|
||||
{
|
||||
if (m_nType == 0)
|
||||
return ((CPdfFile*)m_pFile)->CheckPerm(nPerm);
|
||||
return true;
|
||||
}
|
||||
BYTE* GetInfo()
|
||||
{
|
||||
NSWasm::CData oRes;
|
||||
|
||||
@ -737,11 +737,13 @@ CBooleanOperations::CBooleanOperations(const CGraphicsPath& path1,
|
||||
const CGraphicsPath& path2,
|
||||
BooleanOpType op,
|
||||
long fillType,
|
||||
bool isLuminosity) :
|
||||
bool isLuminosity,
|
||||
bool isSelf) :
|
||||
Op(op),
|
||||
Close1(path1.Is_poly_closed()),
|
||||
Close2(path2.Is_poly_closed()),
|
||||
IsLuminosity(isLuminosity),
|
||||
IsSelf(isSelf),
|
||||
FillType(fillType),
|
||||
Path1(path1),
|
||||
Path2(path2)
|
||||
@ -784,10 +786,9 @@ bool CBooleanOperations::IsSelfInters(const CGraphicsPath& p)
|
||||
void CBooleanOperations::TraceBoolean()
|
||||
{
|
||||
bool reverse = false;
|
||||
bool self = Path1 == Path2;
|
||||
if (((Op == Subtraction || Op == Exclusion) ^
|
||||
Path1.IsClockwise() ^
|
||||
Path2.IsClockwise()) && !self)
|
||||
Path2.IsClockwise()) && !IsSelf)
|
||||
reverse = true;
|
||||
|
||||
PreparePath(Path1, 1, Segments1, Curves1);
|
||||
@ -798,7 +799,7 @@ void CBooleanOperations::TraceBoolean()
|
||||
|
||||
GetIntersection();
|
||||
|
||||
if (self)
|
||||
if (IsSelf)
|
||||
{
|
||||
if (Op == Subtraction)
|
||||
return;
|
||||
@ -823,6 +824,11 @@ void CBooleanOperations::TraceBoolean()
|
||||
CreateNewPath(adj_matr);
|
||||
return;
|
||||
}
|
||||
else if (Path1 == Path2)
|
||||
{
|
||||
Result = std::move(Path1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Locations.empty())
|
||||
{
|
||||
@ -2355,7 +2361,7 @@ CGraphicsPath CalcBooleanOperation(const CGraphicsPath& path1,
|
||||
CBooleanOperations o;
|
||||
if (i > skip_end2 && o.IsSelfInters(paths2[i]))
|
||||
{
|
||||
CBooleanOperations operation(paths2[i], paths2[i], Intersection, fillType, isLuminosity);
|
||||
CBooleanOperations operation(paths2[i], paths2[i], Intersection, fillType, isLuminosity, true);
|
||||
CGraphicsPath p = std::move(operation.GetResult());
|
||||
|
||||
std::vector<CGraphicsPath> tmp_paths = p.GetSubPaths();
|
||||
@ -2370,7 +2376,7 @@ CGraphicsPath CalcBooleanOperation(const CGraphicsPath& path1,
|
||||
CBooleanOperations o2;
|
||||
if (j > skip_end1 && o2.IsSelfInters(paths1[j]))
|
||||
{
|
||||
CBooleanOperations operation(paths1[j], paths1[j], Intersection, fillType, isLuminosity);
|
||||
CBooleanOperations operation(paths1[j], paths1[j], Intersection, fillType, isLuminosity, true);
|
||||
CGraphicsPath p = std::move(operation.GetResult());
|
||||
|
||||
std::vector<CGraphicsPath> tmp_paths = p.GetSubPaths();
|
||||
@ -2380,7 +2386,7 @@ CGraphicsPath CalcBooleanOperation(const CGraphicsPath& path1,
|
||||
paths1.insert(paths1.begin() + i + k, tmp_paths[k]);
|
||||
}
|
||||
|
||||
CBooleanOperations operation(paths1[j], paths2[i], op, fillType, isLuminosity);
|
||||
CBooleanOperations operation(paths1[j], paths2[i], op, fillType, isLuminosity, false);
|
||||
paths.push_back(operation.GetResult());
|
||||
}
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ namespace Aggplus
|
||||
{
|
||||
public:
|
||||
CBooleanOperations() {};
|
||||
CBooleanOperations(const CGraphicsPath& path1, const CGraphicsPath& path2, BooleanOpType op, long fillType, bool isLuminosity);
|
||||
CBooleanOperations(const CGraphicsPath& path1, const CGraphicsPath& path2, BooleanOpType op, long fillType, bool isLuminosity, bool isSelf);
|
||||
~CBooleanOperations();
|
||||
CGraphicsPath&& GetResult();
|
||||
bool IsSelfInters(const CGraphicsPath& p);
|
||||
@ -166,6 +166,7 @@ namespace Aggplus
|
||||
bool Close1 = true;
|
||||
bool Close2 = true;
|
||||
bool IsLuminosity = false;
|
||||
bool IsSelf = false;
|
||||
|
||||
// c_nStroke, c_nWindingFillMode, c_nEvenOddFillMode
|
||||
long FillType = c_nWindingFillMode;
|
||||
|
||||
@ -886,17 +886,17 @@ namespace Aggplus
|
||||
if (isCurve)
|
||||
{
|
||||
std::vector<PointD> points = GetPoints(idx, 4);
|
||||
area = (points[3].Y - points[0].Y) * (points[1].X + points[2].X)
|
||||
- (points[3].X - points[0].X) * (points[1].Y + points[2].Y)
|
||||
+ points[1].Y * (points[0].X - points[2].X)
|
||||
- points[1].X * (points[0].Y - points[2].Y)
|
||||
+ points[3].Y * (points[2].X + points[0].X / 3.0)
|
||||
- points[3].X * (points[2].Y + points[0].Y / 3.0);
|
||||
area = 3.0 * (points[3].Y - points[0].Y) * (points[1].X + points[2].X)
|
||||
- (points[3].X - points[0].X) * (points[1].Y + points[2].Y)
|
||||
+ points[1].Y * (points[0].X - points[2].X)
|
||||
- points[1].X * (points[0].Y - points[2].Y)
|
||||
+ points[3].Y * (points[2].X + points[0].X / 3.0)
|
||||
- points[3].X * (points[2].Y + points[0].Y / 3.0) / 20.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<PointD> points = GetPoints(idx, 2);
|
||||
area = 4.0 * (points[1].Y * points[0].X - points[1].X * points[0].Y) / 3.0;
|
||||
area = (points[1].Y * points[0].X - points[1].X * points[0].Y) / 2.0;
|
||||
}
|
||||
|
||||
return area;
|
||||
|
||||
@ -46,6 +46,92 @@
|
||||
// void Set(const std::wstring& ws) { m_ws = ws; }
|
||||
// const std::wstring& Get() { return m_ws; }
|
||||
|
||||
CAnnotFieldInfo::CActionFieldPr* ReadAction(NSOnlineOfficeBinToPdf::CBufferReader* pReader)
|
||||
{
|
||||
CAnnotFieldInfo::CActionFieldPr* pRes = new CAnnotFieldInfo::CActionFieldPr();
|
||||
|
||||
pRes->nActionType = pReader->ReadByte();
|
||||
switch (pRes->nActionType)
|
||||
{
|
||||
case 14: // JavaScript
|
||||
{
|
||||
pRes->wsStr1 = pReader->ReadString();
|
||||
break;
|
||||
}
|
||||
case 1: // GoTo
|
||||
{
|
||||
pRes->nInt1 = pReader->ReadInt();
|
||||
pRes->nKind = pReader->ReadByte();
|
||||
switch (pRes->nKind)
|
||||
{
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
{
|
||||
pRes->nFlags = pReader->ReadByte();
|
||||
if (pRes->nFlags & (1 << 0))
|
||||
pRes->dD[0] = pReader->ReadDouble();
|
||||
if (pRes->nFlags & (1 << 1))
|
||||
pRes->dD[1] = pReader->ReadDouble();
|
||||
if (pRes->nFlags & (1 << 2))
|
||||
pRes->dD[2] = pReader->ReadDouble();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
pRes->dD[0] = pReader->ReadDouble();
|
||||
pRes->dD[1] = pReader->ReadDouble();
|
||||
pRes->dD[2] = pReader->ReadDouble();
|
||||
pRes->dD[3] = pReader->ReadDouble();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 5:
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: // Named
|
||||
{
|
||||
pRes->wsStr1 = pReader->ReadString();
|
||||
break;
|
||||
}
|
||||
case 6: // URI
|
||||
{
|
||||
pRes->wsStr1 = pReader->ReadString();
|
||||
break;
|
||||
}
|
||||
case 9: // Hide
|
||||
{
|
||||
pRes->nKind = pReader->ReadByte();
|
||||
int n = pReader->ReadInt();
|
||||
pRes->arrStr.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
pRes->arrStr.push_back(pReader->ReadString());
|
||||
break;
|
||||
}
|
||||
case 12: // ResetForm
|
||||
{
|
||||
pRes->nInt1 = pReader->ReadInt();
|
||||
int n = pReader->ReadInt();
|
||||
pRes->arrStr.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
pRes->arrStr.push_back(pReader->ReadString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pReader->ReadByte())
|
||||
pRes->pNext = ReadAction(pReader);
|
||||
|
||||
return pRes;
|
||||
}
|
||||
|
||||
CAnnotFieldInfo::CAnnotFieldInfo() : IAdvancedCommand(AdvancedCommandType::Annotaion)
|
||||
{
|
||||
m_nType = EAnnotType::Unknown;
|
||||
@ -77,6 +163,7 @@ CAnnotFieldInfo::CAnnotFieldInfo() : IAdvancedCommand(AdvancedCommandType::Annot
|
||||
m_pCaretPr = NULL;
|
||||
m_pStampPr = NULL;
|
||||
m_pRedactPr = NULL;
|
||||
m_pLinkPr = NULL;
|
||||
m_pWidgetPr = NULL;
|
||||
}
|
||||
CAnnotFieldInfo::~CAnnotFieldInfo()
|
||||
@ -93,6 +180,7 @@ CAnnotFieldInfo::~CAnnotFieldInfo()
|
||||
RELEASEOBJECT(m_pCaretPr);
|
||||
RELEASEOBJECT(m_pStampPr);
|
||||
RELEASEOBJECT(m_pRedactPr);
|
||||
RELEASEOBJECT(m_pLinkPr);
|
||||
RELEASEOBJECT(m_pWidgetPr);
|
||||
}
|
||||
|
||||
@ -113,6 +201,12 @@ void CAnnotFieldInfo::SetType(int nType)
|
||||
m_pTextPr = new CAnnotFieldInfo::CTextAnnotPr();
|
||||
break;
|
||||
}
|
||||
case EAnnotType::Link:
|
||||
{
|
||||
RELEASEOBJECT(m_pLinkPr);
|
||||
m_pLinkPr = new CAnnotFieldInfo::CLinkAnnotPr();
|
||||
break;
|
||||
}
|
||||
case EAnnotType::FreeText:
|
||||
{
|
||||
CreateMarkup();
|
||||
@ -305,6 +399,10 @@ bool CAnnotFieldInfo::IsRedact() const
|
||||
{
|
||||
return (m_nType == 25);
|
||||
}
|
||||
bool CAnnotFieldInfo::IsLink() const
|
||||
{
|
||||
return (m_nType == 1);
|
||||
}
|
||||
|
||||
CAnnotFieldInfo::CMarkupAnnotPr* CAnnotFieldInfo::GetMarkupAnnotPr() { return m_pMarkupPr; }
|
||||
CAnnotFieldInfo::CTextAnnotPr* CAnnotFieldInfo::GetTextAnnotPr() { return m_pTextPr; }
|
||||
@ -318,6 +416,7 @@ CAnnotFieldInfo::CFreeTextAnnotPr* CAnnotFieldInfo::GetFreeTextAnnotPr()
|
||||
CAnnotFieldInfo::CCaretAnnotPr* CAnnotFieldInfo::GetCaretAnnotPr() { return m_pCaretPr; }
|
||||
CAnnotFieldInfo::CStampAnnotPr* CAnnotFieldInfo::GetStampAnnotPr() { return m_pStampPr; }
|
||||
CAnnotFieldInfo::CRedactAnnotPr* CAnnotFieldInfo::GetRedactAnnotPr() { return m_pRedactPr; }
|
||||
CAnnotFieldInfo::CLinkAnnotPr* CAnnotFieldInfo::GetLinkAnnotPr() { return m_pLinkPr; }
|
||||
CAnnotFieldInfo::CWidgetAnnotPr* CAnnotFieldInfo::GetWidgetAnnotPr() { return m_pWidgetPr; }
|
||||
|
||||
bool CAnnotFieldInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
|
||||
@ -412,6 +511,8 @@ bool CAnnotFieldInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMeta
|
||||
m_pPopupPr->Read(pReader);
|
||||
else if (IsWidget())
|
||||
m_pWidgetPr->Read(pReader, nType);
|
||||
else if (IsLink())
|
||||
m_pLinkPr->Read(pReader);
|
||||
|
||||
return m_nType != -1;
|
||||
}
|
||||
@ -721,6 +822,45 @@ void CAnnotFieldInfo::CRedactAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader
|
||||
}
|
||||
}
|
||||
|
||||
CAnnotFieldInfo::CLinkAnnotPr::CLinkAnnotPr()
|
||||
{
|
||||
m_pAction = NULL;
|
||||
m_pPA = NULL;
|
||||
}
|
||||
CAnnotFieldInfo::CLinkAnnotPr::~CLinkAnnotPr()
|
||||
{
|
||||
RELEASEOBJECT(m_pAction);
|
||||
RELEASEOBJECT(m_pPA);
|
||||
}
|
||||
BYTE CAnnotFieldInfo::CLinkAnnotPr::GetH() const { return m_nH; }
|
||||
int CAnnotFieldInfo::CLinkAnnotPr::GetFlags() const { return m_nFlags; }
|
||||
const std::vector<double>& CAnnotFieldInfo::CLinkAnnotPr::GetQuadPoints() { return m_arrQuadPoints; }
|
||||
CAnnotFieldInfo::CActionFieldPr* CAnnotFieldInfo::CLinkAnnotPr::GetA() { return m_pAction; }
|
||||
CAnnotFieldInfo::CActionFieldPr* CAnnotFieldInfo::CLinkAnnotPr::GetPA() { return m_pPA; }
|
||||
void CAnnotFieldInfo::CLinkAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader)
|
||||
{
|
||||
m_nFlags = pReader->ReadInt();
|
||||
if (m_nFlags & (1 << 0))
|
||||
{
|
||||
pReader->ReadString();
|
||||
m_pAction = ReadAction(pReader);
|
||||
}
|
||||
if (m_nFlags & (1 << 1))
|
||||
{
|
||||
pReader->ReadString();
|
||||
m_pPA = ReadAction(pReader);
|
||||
}
|
||||
if (m_nFlags & (1 << 2))
|
||||
m_nH = pReader->ReadByte();
|
||||
if (m_nFlags & (1 << 3))
|
||||
{
|
||||
int n = pReader->ReadInt();
|
||||
m_arrQuadPoints.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
m_arrQuadPoints.push_back(pReader->ReadDouble());
|
||||
}
|
||||
}
|
||||
|
||||
bool CAnnotFieldInfo::CPopupAnnotPr::IsOpen() const { return m_bOpen; }
|
||||
int CAnnotFieldInfo::CPopupAnnotPr::GetFlag() const { return m_nFlag; }
|
||||
int CAnnotFieldInfo::CPopupAnnotPr::GetParentID() const { return m_nParentID; }
|
||||
@ -752,7 +892,7 @@ const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::GetFontKey() { return m_w
|
||||
const std::vector<double>& CAnnotFieldInfo::CWidgetAnnotPr::GetTC() { return m_arrTC; }
|
||||
const std::vector<double>& CAnnotFieldInfo::CWidgetAnnotPr::GetBC() { return m_arrBC; }
|
||||
const std::vector<double>& CAnnotFieldInfo::CWidgetAnnotPr::GetBG() { return m_arrBG; }
|
||||
const std::vector<CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget*>& CAnnotFieldInfo::CWidgetAnnotPr::GetActions() { return m_arrAction; }
|
||||
const std::vector<CAnnotFieldInfo::CActionFieldPr*>& CAnnotFieldInfo::CWidgetAnnotPr::GetActions() { return m_arrAction; }
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr* CAnnotFieldInfo::CWidgetAnnotPr::GetButtonWidgetPr() { return m_pButtonPr; }
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CTextWidgetPr* CAnnotFieldInfo::CWidgetAnnotPr::GetTextWidgetPr() { return m_pTextPr; }
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CChoiceWidgetPr* CAnnotFieldInfo::CWidgetAnnotPr::GetChoiceWidgetPr() { return m_pChoicePr; }
|
||||
@ -812,93 +952,8 @@ CAnnotFieldInfo::CWidgetAnnotPr::~CWidgetAnnotPr()
|
||||
RELEASEOBJECT(m_arrAction[i]);
|
||||
}
|
||||
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget::CActionWidget() : pNext(NULL) {}
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget::~CActionWidget() { RELEASEOBJECT(pNext); }
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* ReadAction(NSOnlineOfficeBinToPdf::CBufferReader* pReader)
|
||||
{
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* pRes = new CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget();
|
||||
|
||||
pRes->nActionType = pReader->ReadByte();
|
||||
switch (pRes->nActionType)
|
||||
{
|
||||
case 14: // JavaScript
|
||||
{
|
||||
pRes->wsStr1 = pReader->ReadString();
|
||||
break;
|
||||
}
|
||||
case 1: // GoTo
|
||||
{
|
||||
pRes->nInt1 = pReader->ReadInt();
|
||||
pRes->nKind = pReader->ReadByte();
|
||||
switch (pRes->nKind)
|
||||
{
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
case 6:
|
||||
case 7:
|
||||
{
|
||||
pRes->nFlags = pReader->ReadByte();
|
||||
if (pRes->nFlags & (1 << 0))
|
||||
pRes->dD[0] = pReader->ReadDouble();
|
||||
if (pRes->nFlags & (1 << 1))
|
||||
pRes->dD[1] = pReader->ReadDouble();
|
||||
if (pRes->nFlags & (1 << 2))
|
||||
pRes->dD[2] = pReader->ReadDouble();
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
pRes->dD[0] = pReader->ReadDouble();
|
||||
pRes->dD[1] = pReader->ReadDouble();
|
||||
pRes->dD[2] = pReader->ReadDouble();
|
||||
pRes->dD[3] = pReader->ReadDouble();
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 5:
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: // Named
|
||||
{
|
||||
pRes->wsStr1 = pReader->ReadString();
|
||||
break;
|
||||
}
|
||||
case 6: // URI
|
||||
{
|
||||
pRes->wsStr1 = pReader->ReadString();
|
||||
break;
|
||||
}
|
||||
case 9: // Hide
|
||||
{
|
||||
pRes->nKind = pReader->ReadByte();
|
||||
int n = pReader->ReadInt();
|
||||
pRes->arrStr.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
pRes->arrStr.push_back(pReader->ReadString());
|
||||
break;
|
||||
}
|
||||
case 12: // ResetForm
|
||||
{
|
||||
pRes->nInt1 = pReader->ReadInt();
|
||||
int n = pReader->ReadInt();
|
||||
pRes->arrStr.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
pRes->arrStr.push_back(pReader->ReadString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pReader->ReadByte())
|
||||
pRes->pNext = ReadAction(pReader);
|
||||
|
||||
return pRes;
|
||||
}
|
||||
CAnnotFieldInfo::CActionFieldPr::CActionFieldPr() : pNext(NULL) {}
|
||||
CAnnotFieldInfo::CActionFieldPr::~CActionFieldPr() { RELEASEOBJECT(pNext); }
|
||||
void CAnnotFieldInfo::CWidgetAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, BYTE nType)
|
||||
{
|
||||
m_wsFN = pReader->ReadString();
|
||||
@ -957,7 +1012,7 @@ void CAnnotFieldInfo::CWidgetAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader
|
||||
for (int i = 0; i < nAction; ++i)
|
||||
{
|
||||
std::wstring wsType = pReader->ReadString();
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* pA = ReadAction(pReader);
|
||||
CAnnotFieldInfo::CActionFieldPr* pA = ReadAction(pReader);
|
||||
if (pA)
|
||||
{
|
||||
pA->wsType = wsType;
|
||||
@ -987,6 +1042,7 @@ const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetCA() {
|
||||
const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetRC() { return m_wsRC; }
|
||||
const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetAC() { return m_wsAC; }
|
||||
const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetAP_N_Yes() { return m_wsAP_N_Yes; }
|
||||
const std::vector< std::pair<std::wstring, std::wstring> >& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetOpt() { return m_arrOpt; }
|
||||
void CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, BYTE nType, int nFlags)
|
||||
{
|
||||
if (nType == 27)
|
||||
@ -1027,6 +1083,17 @@ void CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::Read(NSOnlineOfficeBinToP
|
||||
if (nFlags & (1 << 9))
|
||||
m_wsV = pReader->ReadString();
|
||||
m_nStyle = pReader->ReadByte();
|
||||
if (nFlags & (1 << 10))
|
||||
{
|
||||
int n = pReader->ReadInt();
|
||||
m_arrOpt.reserve(n);
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
std::wstring s1 = pReader->ReadString();
|
||||
std::wstring s2 = pReader->ReadString();
|
||||
m_arrOpt.push_back(std::make_pair(s1, s2));
|
||||
}
|
||||
}
|
||||
if (nFlags & (1 << 14))
|
||||
m_wsAP_N_Yes = pReader->ReadString();
|
||||
}
|
||||
@ -1192,7 +1259,7 @@ bool CWidgetsInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafil
|
||||
for (int i = 0; i < nAction; ++i)
|
||||
{
|
||||
std::wstring wsType = pReader->ReadString();
|
||||
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* pA = ReadAction(pReader);
|
||||
CAnnotFieldInfo::CActionFieldPr* pA = ReadAction(pReader);
|
||||
if (pA)
|
||||
{
|
||||
pA->wsType = wsType;
|
||||
|
||||
@ -70,6 +70,23 @@ public:
|
||||
WidgetSignature = 33
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CActionFieldPr
|
||||
{
|
||||
public:
|
||||
CActionFieldPr();
|
||||
~CActionFieldPr();
|
||||
|
||||
BYTE nKind;
|
||||
BYTE nFlags;
|
||||
BYTE nActionType;
|
||||
int nInt1;
|
||||
double dD[4]{};
|
||||
std::wstring wsType;
|
||||
std::wstring wsStr1;
|
||||
std::vector<std::wstring> arrStr;
|
||||
CActionFieldPr* pNext;
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CWidgetAnnotPr
|
||||
{
|
||||
public:
|
||||
@ -90,6 +107,7 @@ public:
|
||||
const std::wstring& GetRC();
|
||||
const std::wstring& GetAC();
|
||||
const std::wstring& GetAP_N_Yes();
|
||||
const std::vector< std::pair<std::wstring, std::wstring> >& GetOpt();
|
||||
|
||||
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, BYTE nType, int nFlags);
|
||||
|
||||
@ -108,6 +126,7 @@ public:
|
||||
std::wstring m_wsRC;
|
||||
std::wstring m_wsAC;
|
||||
std::wstring m_wsAP_N_Yes;
|
||||
std::vector< std::pair<std::wstring, std::wstring> > m_arrOpt;
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CTextWidgetPr
|
||||
@ -159,23 +178,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CActionWidget
|
||||
{
|
||||
public:
|
||||
CActionWidget();
|
||||
~CActionWidget();
|
||||
|
||||
BYTE nKind;
|
||||
BYTE nFlags;
|
||||
BYTE nActionType;
|
||||
int nInt1;
|
||||
double dD[4]{};
|
||||
std::wstring wsType;
|
||||
std::wstring wsStr1;
|
||||
std::vector<std::wstring> arrStr;
|
||||
CActionWidget* pNext;
|
||||
};
|
||||
|
||||
CWidgetAnnotPr(BYTE nType);
|
||||
~CWidgetAnnotPr();
|
||||
|
||||
@ -199,7 +201,7 @@ public:
|
||||
const std::vector<double>& GetTC();
|
||||
const std::vector<double>& GetBC();
|
||||
const std::vector<double>& GetBG();
|
||||
const std::vector<CActionWidget*>& GetActions();
|
||||
const std::vector<CActionFieldPr*>& GetActions();
|
||||
|
||||
CButtonWidgetPr* GetButtonWidgetPr();
|
||||
CTextWidgetPr* GetTextWidgetPr();
|
||||
@ -229,7 +231,7 @@ public:
|
||||
std::vector<double> m_arrTC;
|
||||
std::vector<double> m_arrBC;
|
||||
std::vector<double> m_arrBG;
|
||||
std::vector<CActionWidget*> m_arrAction;
|
||||
std::vector<CActionFieldPr*> m_arrAction;
|
||||
|
||||
CButtonWidgetPr* m_pButtonPr;
|
||||
CTextWidgetPr* m_pTextPr;
|
||||
@ -389,7 +391,7 @@ public:
|
||||
{
|
||||
public:
|
||||
bool IsOpen() const;
|
||||
int GetFlag() const;
|
||||
int GetFlag() const;
|
||||
int GetParentID() const;
|
||||
|
||||
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader);
|
||||
@ -478,6 +480,28 @@ public:
|
||||
std::vector<double> m_arrQuadPoints;
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CLinkAnnotPr
|
||||
{
|
||||
public:
|
||||
CLinkAnnotPr();
|
||||
~CLinkAnnotPr();
|
||||
|
||||
BYTE GetH() const;
|
||||
int GetFlags() const;
|
||||
const std::vector<double>& GetQuadPoints();
|
||||
CActionFieldPr* GetA();
|
||||
CActionFieldPr* GetPA();
|
||||
|
||||
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader);
|
||||
|
||||
private:
|
||||
BYTE m_nH;
|
||||
int m_nFlags;
|
||||
std::vector<double> m_arrQuadPoints;
|
||||
CActionFieldPr* m_pAction;
|
||||
CActionFieldPr* m_pPA;
|
||||
};
|
||||
|
||||
CAnnotFieldInfo();
|
||||
virtual ~CAnnotFieldInfo();
|
||||
|
||||
@ -518,6 +542,7 @@ public:
|
||||
bool IsCaret() const;
|
||||
bool IsStamp() const;
|
||||
bool IsRedact() const;
|
||||
bool IsLink() const;
|
||||
|
||||
CMarkupAnnotPr* GetMarkupAnnotPr();
|
||||
CTextAnnotPr* GetTextAnnotPr();
|
||||
@ -531,6 +556,7 @@ public:
|
||||
CCaretAnnotPr* GetCaretAnnotPr();
|
||||
CStampAnnotPr* GetStampAnnotPr();
|
||||
CRedactAnnotPr* GetRedactAnnotPr();
|
||||
CLinkAnnotPr* GetLinkAnnotPr();
|
||||
CWidgetAnnotPr* GetWidgetAnnotPr();
|
||||
|
||||
bool Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector);
|
||||
@ -576,6 +602,7 @@ private:
|
||||
CCaretAnnotPr* m_pCaretPr;
|
||||
CStampAnnotPr* m_pStampPr;
|
||||
CRedactAnnotPr* m_pRedactPr;
|
||||
CLinkAnnotPr* m_pLinkPr;
|
||||
CWidgetAnnotPr* m_pWidgetPr;
|
||||
};
|
||||
|
||||
@ -610,7 +637,7 @@ public:
|
||||
std::wstring sTU;
|
||||
std::vector<int> arrI;
|
||||
std::vector<std::wstring> arrV;
|
||||
std::vector<CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget*> arrAction;
|
||||
std::vector<CAnnotFieldInfo::CActionFieldPr*> arrAction;
|
||||
std::vector< std::pair<std::wstring, std::wstring> > arrOpt;
|
||||
};
|
||||
|
||||
|
||||
@ -179,7 +179,6 @@ CHeadings::CHeading::CHeading()
|
||||
nPage = 0;
|
||||
dX = 0.0;
|
||||
dY = 0.0;
|
||||
pParent = NULL;
|
||||
}
|
||||
CHeadings::CHeading::~CHeading()
|
||||
{
|
||||
@ -196,35 +195,26 @@ CHeadings::~CHeadings()
|
||||
const std::vector<CHeadings::CHeading*>& CHeadings::GetHeading() { return m_arrHeading; }
|
||||
bool CHeadings::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
|
||||
{
|
||||
int nPredLevel = 0, nHeaderLevel = 0;
|
||||
std::vector<CHeading*>* arrHeading = &m_arrHeading;
|
||||
CHeading* pParent = NULL;
|
||||
std::vector<CHeading*> arrParentStack;
|
||||
int nHeadings = pReader->ReadInt();
|
||||
for (int i = 0; i < nHeadings; ++i)
|
||||
{
|
||||
int nLevel = pReader->ReadInt();
|
||||
if (nLevel > nPredLevel && i > 0)
|
||||
{
|
||||
nHeaderLevel = nPredLevel;
|
||||
pParent = arrHeading->back();
|
||||
arrHeading = &pParent->arrHeading;
|
||||
}
|
||||
else if (nLevel < nPredLevel && nLevel <= nHeaderLevel)
|
||||
{
|
||||
nHeaderLevel = nLevel;
|
||||
pParent = pParent ? pParent->pParent : NULL;
|
||||
arrHeading = pParent ? &pParent->arrHeading : &m_arrHeading;
|
||||
}
|
||||
nPredLevel = nLevel;
|
||||
|
||||
CHeading* pHeading = new CHeading();
|
||||
pHeading->nPage = pReader->ReadInt();
|
||||
pHeading->dX = pReader->ReadDouble();
|
||||
pHeading->dY = pReader->ReadDouble();
|
||||
pHeading->wsTitle = pReader->ReadString();
|
||||
pHeading->pParent = pParent;
|
||||
|
||||
arrHeading->push_back(pHeading);
|
||||
while (arrParentStack.size() > nLevel)
|
||||
arrParentStack.pop_back();
|
||||
|
||||
if (arrParentStack.empty())
|
||||
m_arrHeading.push_back(pHeading);
|
||||
else
|
||||
arrParentStack.back()->arrHeading.push_back(pHeading);
|
||||
|
||||
arrParentStack.push_back(pHeading);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -181,7 +181,6 @@ public:
|
||||
int nPage;
|
||||
double dX;
|
||||
double dY;
|
||||
CHeading* pParent;
|
||||
std::vector<CHeading*> arrHeading;
|
||||
|
||||
CHeading();
|
||||
|
||||
@ -56,6 +56,8 @@
|
||||
"_UnmergePages",
|
||||
"_RedactPage",
|
||||
"_UndoRedact",
|
||||
"_CheckOwnerPassword",
|
||||
"_CheckPerm",
|
||||
"_GetImageBase64",
|
||||
"_GetImageBase64Len",
|
||||
"_GetImageBase64Ptr",
|
||||
|
||||
@ -145,6 +145,14 @@ CFile.prototype["isNeedPassword"] = function()
|
||||
{
|
||||
return this._isNeedPassword;
|
||||
};
|
||||
CFile.prototype["CheckOwnerPassword"] = function(password)
|
||||
{
|
||||
return this._CheckOwnerPassword(password);
|
||||
};
|
||||
CFile.prototype["CheckPerm"] = function(perm)
|
||||
{
|
||||
return this._CheckPerm(perm);
|
||||
};
|
||||
CFile.prototype["SplitPages"] = function(arrOriginIndex, arrayBufferChanges)
|
||||
{
|
||||
let ptr = this._SplitPages(arrOriginIndex, arrayBufferChanges);
|
||||
@ -413,9 +421,9 @@ function readAction(reader, rec, readDoubleFunc, readStringFunc)
|
||||
case 4:
|
||||
{
|
||||
rec["left"] = readDoubleFunc.call(reader);
|
||||
rec["bottom"] = readDoubleFunc.call(reader);
|
||||
rec["top"] = readDoubleFunc.call(reader);
|
||||
rec["right"] = readDoubleFunc.call(reader);
|
||||
rec["top"] = readDoubleFunc.call(reader);
|
||||
rec["bottom"] = readDoubleFunc.call(reader);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
@ -1027,6 +1035,33 @@ function readAnnotType(reader, rec, readDoubleFunc, readDouble2Func, readStringF
|
||||
rec["font"]["style"] = reader.readInt();
|
||||
}
|
||||
}
|
||||
// Link
|
||||
else if (rec["type"] == 1)
|
||||
{
|
||||
flags = reader.readInt();
|
||||
if (flags & (1 << 0))
|
||||
{
|
||||
rec["A"] = {};
|
||||
readAction(reader, rec["A"], readDoubleFunc, readStringFunc);
|
||||
}
|
||||
if (flags & (1 << 1))
|
||||
{
|
||||
rec["PA"] = {};
|
||||
readAction(reader, rec["PA"], readDoubleFunc, readStringFunc);
|
||||
}
|
||||
// Selection mode - H
|
||||
// 0 - none, 1 - invert, 2 - push, 3 - outline
|
||||
if (flags & (1 << 2))
|
||||
rec["highlight"] = reader.readByte();
|
||||
// QuadPoints
|
||||
if (flags & (1 << 3))
|
||||
{
|
||||
let n = reader.readInt();
|
||||
rec["QuadPoints"] = [];
|
||||
for (let i = 0; i < n; ++i)
|
||||
rec["QuadPoints"].push(readDoubleFunc.call(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
function readWidgetType(reader, rec, readDoubleFunc, readDouble2Func, readStringFunc, isRead = false)
|
||||
{
|
||||
@ -1171,6 +1206,20 @@ function readWidgetType(reader, rec, readDoubleFunc, readDouble2Func, readString
|
||||
rec["value"] = readStringFunc.call(reader);
|
||||
// 0 - check, 1 - cross, 2 - diamond, 3 - circle, 4 - star, 5 - square
|
||||
rec["style"] = reader.readByte();
|
||||
if (flags & (1 << 10))
|
||||
{
|
||||
let n = reader.readInt();
|
||||
rec["opt"] = [];
|
||||
for (let i = 0; i < n; ++i)
|
||||
{
|
||||
let opt1 = readStringFunc.call(reader);
|
||||
let opt2 = readStringFunc.call(reader);
|
||||
if (opt1 == "")
|
||||
rec["opt"].push(opt2);
|
||||
else
|
||||
rec["opt"].push([opt2, opt1]);
|
||||
}
|
||||
}
|
||||
if (flags & (1 << 14))
|
||||
rec["ExportValue"] = readStringFunc.call(reader);
|
||||
// 12.7.4.2.1
|
||||
|
||||
@ -146,6 +146,16 @@ CFile.prototype._UndoRedact = function()
|
||||
return g_native_drawing_file["UndoRedact"]();
|
||||
};
|
||||
|
||||
CFile.prototype._CheckOwnerPassword = function(password)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CFile.prototype._CheckPerm = function(perm)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// FONTS
|
||||
CFile.prototype._isNeedCMap = function()
|
||||
{
|
||||
|
||||
@ -224,6 +224,29 @@ CFile.prototype._UndoRedact = function()
|
||||
return Module["_UndoRedact"](this.nativeFile) == 1;
|
||||
};
|
||||
|
||||
CFile.prototype._CheckOwnerPassword = function(password)
|
||||
{
|
||||
let passwordPtr = 0;
|
||||
if (password)
|
||||
{
|
||||
let passwordBuf = password.toUtf8();
|
||||
passwordPtr = Module["_malloc"](passwordBuf.length);
|
||||
Module["HEAP8"].set(passwordBuf, passwordPtr);
|
||||
}
|
||||
|
||||
let bRes = Module["_CheckOwnerPassword"](this.nativeFile, passwordPtr);
|
||||
|
||||
if (passwordPtr)
|
||||
Module["_free"](passwordPtr);
|
||||
|
||||
return bRes == 1;
|
||||
}
|
||||
|
||||
CFile.prototype._CheckPerm = function(perm)
|
||||
{
|
||||
return Module["_CheckPerm"](this.nativeFile, perm) == 1;
|
||||
}
|
||||
|
||||
// FONTS
|
||||
CFile.prototype._isNeedCMap = function()
|
||||
{
|
||||
|
||||
@ -191,6 +191,17 @@ WASM_EXPORT int UndoRedact(CDrawingFile* pFile)
|
||||
{
|
||||
return pFile->UndoRedact() ? 1 : 0;
|
||||
}
|
||||
WASM_EXPORT int CheckOwnerPassword(CDrawingFile* pFile, const char* password)
|
||||
{
|
||||
std::wstring sPassword = L"";
|
||||
if (NULL != password)
|
||||
sPassword = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)password, strlen(password));
|
||||
return pFile->CheckOwnerPassword(sPassword) ? 1 : 0;
|
||||
}
|
||||
WASM_EXPORT int CheckPerm(CDrawingFile* pFile, int nPermFlag)
|
||||
{
|
||||
return pFile->CheckPerm(nPermFlag) ? 1 : 0;
|
||||
}
|
||||
|
||||
WASM_EXPORT void* GetImageBase64(CDrawingFile* pFile, int rId)
|
||||
{
|
||||
|
||||
@ -704,6 +704,23 @@ void ReadInteractiveForms(BYTE* pWidgets, int& i)
|
||||
i += 1;
|
||||
std::cout << "Style " << arrStyle[nPathLength] << ", ";
|
||||
|
||||
if (nFlags & (1 << 10))
|
||||
{
|
||||
int nOptLength = READ_INT(pWidgets + i);
|
||||
i += 4;
|
||||
for (int j = 0; j < nOptLength; ++j)
|
||||
{
|
||||
nPathLength = READ_INT(pWidgets + i);
|
||||
i += 4;
|
||||
std::cout << std::to_string(j) << " Opt1 " << std::string((char*)(pWidgets + i), nPathLength) << ", ";
|
||||
i += nPathLength;
|
||||
|
||||
nPathLength = READ_INT(pWidgets + i);
|
||||
i += 4;
|
||||
std::cout << std::to_string(j) << " Opt2 " << std::string((char*)(pWidgets + i), nPathLength) << ", ";
|
||||
i += nPathLength;
|
||||
}
|
||||
}
|
||||
if (nFlags & (1 << 14))
|
||||
{
|
||||
nPathLength = READ_INT(pWidgets + i);
|
||||
@ -1125,6 +1142,18 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// OWNER PASSWORD
|
||||
if (false)
|
||||
{
|
||||
std::string sPassword = "gfhjkmgfhjkm";
|
||||
std::cout << "CheckPerm 4 Edit " << CheckPerm(pGrFile, 4) << std::endl;
|
||||
std::cout << "CheckPerm 4 Print " << CheckPerm(pGrFile, 3) << std::endl;
|
||||
|
||||
std::cout << "CheckOwnerPassword " << CheckOwnerPassword(pGrFile, sPassword.c_str()) << std::endl;
|
||||
std::cout << "CheckPerm 4 Edit " << CheckPerm(pGrFile, 4) << std::endl;
|
||||
std::cout << "CheckPerm 4 Print " << CheckPerm(pGrFile, 3) << std::endl;
|
||||
}
|
||||
|
||||
BYTE* pColor = new BYTE[12] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
// REDACT
|
||||
if (false)
|
||||
@ -1164,7 +1193,7 @@ int main(int argc, char* argv[])
|
||||
free(pInfo);
|
||||
|
||||
// LINKS
|
||||
if (true && nPagesCount > 0)
|
||||
if (false && nPagesCount > 0)
|
||||
{
|
||||
BYTE* pLinks = GetLinks(pGrFile, nTestPage);
|
||||
nLength = READ_INT(pLinks);
|
||||
@ -1200,7 +1229,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
|
||||
// STRUCTURE
|
||||
if (true)
|
||||
if (false)
|
||||
{
|
||||
BYTE* pStructure = GetStructure(pGrFile);
|
||||
nLength = READ_INT(pStructure);
|
||||
@ -2132,6 +2161,44 @@ int main(int argc, char* argv[])
|
||||
std::cout << nPathLength << ", ";
|
||||
}
|
||||
}
|
||||
else if (sType == "Link")
|
||||
{
|
||||
nFlags = READ_INT(pAnnots + i);
|
||||
i += 4;
|
||||
if (nFlags & (1 << 0))
|
||||
{
|
||||
std::cout << std::endl << "A ";
|
||||
ReadAction(pAnnots, i);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
if (nFlags & (1 << 1))
|
||||
{
|
||||
std::cout << std::endl << "PA ";
|
||||
ReadAction(pAnnots, i);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
if (nFlags & (1 << 2))
|
||||
{
|
||||
std::string arrHighlighting[] = {"none", "invert", "push", "outline"};
|
||||
nPathLength = READ_BYTE(pAnnots + i);
|
||||
i += 1;
|
||||
std::cout << "Highlight " << arrHighlighting[nPathLength] << ", ";
|
||||
}
|
||||
if (nFlags & (1 << 3))
|
||||
{
|
||||
std::cout << "QuadPoints";
|
||||
int nQuadPointsLength = READ_INT(pAnnots + i);
|
||||
i += 4;
|
||||
|
||||
for (int j = 0; j < nQuadPointsLength; ++j)
|
||||
{
|
||||
nPathLength = READ_INT(pAnnots + i);
|
||||
i += 4;
|
||||
std::cout << " " << (double)nPathLength / 100.0;
|
||||
}
|
||||
std::cout << ", ";
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << std::endl << "]" << std::endl;
|
||||
}
|
||||
|
||||
@ -202,6 +202,19 @@ bool CImageFileFormatChecker::isWbcFile(BYTE* pBuffer,DWORD dwBytes)
|
||||
|
||||
return false;
|
||||
}
|
||||
//raster graphics file format developed by Google
|
||||
bool CImageFileFormatChecker::isWebPFile(BYTE* pBuffer, DWORD dwBytes)
|
||||
{
|
||||
if (eFileType)return false;
|
||||
|
||||
if ((20 <= dwBytes) && ('R' == pBuffer[0] && 'I' == pBuffer[1] && 'F' == pBuffer[2] && 'F' == pBuffer[3]
|
||||
//4–7 length + 12
|
||||
&& 'W' == pBuffer[8] && 'E' == pBuffer[9] && 'B' == pBuffer[10] && 'P' == pBuffer[11])
|
||||
&& 'V' == pBuffer[12] && 'P' == pBuffer[13] && '8' == pBuffer[14])
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
//webshot(wb ver 1) HEX 57 57 42 42 31 31 31 31
|
||||
//webshot (wb ver 2) HEX 00 00 02 00 02 10 c9 00 02 00 c8 06 4c 00 02 00
|
||||
bool CImageFileFormatChecker::isWbFile(BYTE* pBuffer,DWORD dwBytes)
|
||||
@ -509,6 +522,10 @@ bool CImageFileFormatChecker::isImageFile(const std::wstring& fileName)
|
||||
{
|
||||
eFileType = _CXIMAGE_FORMAT_WB;
|
||||
}
|
||||
else if (isWebPFile(buffer, sizeRead))
|
||||
{
|
||||
eFileType = _CXIMAGE_FORMAT_WEBP;
|
||||
}
|
||||
else if (isPsdFile(buffer,sizeRead))
|
||||
{
|
||||
eFileType = _CXIMAGE_FORMAT_PSD;
|
||||
|
||||
@ -64,6 +64,7 @@ enum __ENUM_CXIMAGE_FORMATS
|
||||
_CXIMAGE_FORMAT_SVG = 24,
|
||||
_CXIMAGE_FORMAT_PIC = 25,
|
||||
_CXIMAGE_FORMAT_HEIF = 26,
|
||||
_CXIMAGE_FORMAT_WEBP = 27
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CImageFileFormatChecker
|
||||
@ -96,6 +97,7 @@ public:
|
||||
bool isTiffFile(BYTE* pBuffer,DWORD dwBytes);
|
||||
bool isJpgFile(BYTE* pBuffer,DWORD dwBytes);
|
||||
bool isWbFile(BYTE* pBuffer,DWORD dwBytes);
|
||||
bool isWebPFile(BYTE* pBuffer, DWORD dwBytes);
|
||||
|
||||
bool isIcoFile(BYTE* pBuffer,DWORD dwBytes);
|
||||
bool isRasFile(BYTE* pBuffer,DWORD dwBytes);
|
||||
|
||||
@ -88,6 +88,8 @@ namespace DocFileFormat
|
||||
|
||||
BorderCode( unsigned char* bytes, int size );
|
||||
BorderCode( const BorderCode& bc );
|
||||
unsigned char GetType() const { return brcType; }
|
||||
bool GetNil() {return fNil;}
|
||||
|
||||
bool operator == ( const BorderCode& bc );
|
||||
bool operator != ( const BorderCode& bc );
|
||||
|
||||
@ -606,6 +606,7 @@ namespace DocFileFormat
|
||||
std::wstring PAGE ( L"PAGE" );
|
||||
std::wstring SHAPE ( L"SHAPE" );
|
||||
std::wstring NREF ( L"NREF");
|
||||
std::wstring Tocn (L"Toc");
|
||||
|
||||
if (arField.empty() == false)
|
||||
f = arField[0];
|
||||
@ -629,14 +630,16 @@ namespace DocFileFormat
|
||||
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
|
||||
bool bNREF = search( f.begin(), f.end(), NREF.begin(), NREF.end()) != f.end();
|
||||
|
||||
bool bPAGEREF = false;
|
||||
bool bPAGEREF = false;
|
||||
bool bTocn = false;
|
||||
if (bHYPERLINK && arField.size() > 1)
|
||||
{
|
||||
std::wstring f1 = arField[1];
|
||||
bPAGEREF = search( f1.begin(), f1.end(), PAGEREF.begin(), PAGEREF.end()) != f1.end();
|
||||
bTocn = search( f1.begin(), f1.end(), Tocn.begin(), Tocn.end()) != f1.end();
|
||||
}
|
||||
|
||||
if (bTOC)
|
||||
if (bTOC || bTocn)
|
||||
_bContentWrite = true;
|
||||
|
||||
if ( bFORM )
|
||||
@ -710,12 +713,13 @@ namespace DocFileFormat
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 1; i < arField.size(); i++)
|
||||
//for (size_t i = 1; i < arField.size(); i++)
|
||||
if (arField.size() > 1)
|
||||
{
|
||||
std::wstring f1 = arField[1];
|
||||
int d = (int)f1.find(PAGEREF);
|
||||
size_t d = f1.find(PAGEREF);
|
||||
|
||||
if (d > 0)
|
||||
if (d != std::wstring::npos)
|
||||
{
|
||||
_writeWebHidden = true;
|
||||
std::wstring _writeTocLink =f1.substr(d + 9);
|
||||
@ -726,10 +730,8 @@ namespace DocFileFormat
|
||||
_writeAfterRun += XmlUtils::EncodeXmlString(_writeTocLink);
|
||||
_writeAfterRun += std::wstring (L"\" w:history=\"1\">");
|
||||
|
||||
break;
|
||||
//cp = cpFieldSep1;
|
||||
//break;
|
||||
}
|
||||
//cpFieldSep1 = cpFieldSep2;
|
||||
}
|
||||
_skipRuns = 5; //with separator
|
||||
}
|
||||
@ -781,6 +783,7 @@ namespace DocFileFormat
|
||||
else
|
||||
{
|
||||
PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->nWordVersion);
|
||||
bPict = false;
|
||||
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ) );
|
||||
@ -1066,85 +1069,90 @@ namespace DocFileFormat
|
||||
}
|
||||
else if (TextMark::Picture == code && fSpec)
|
||||
{
|
||||
PictureDescriptor oPicture (chpx, m_document->nWordVersion > 0 ? m_document->WordDocumentStream : m_document->DataStream, 0x7fffffff, m_document->nWordVersion);
|
||||
if (bPict)
|
||||
{
|
||||
PictureDescriptor oPicture (chpx, m_document->nWordVersion > 0 ? m_document->WordDocumentStream : m_document->DataStream, 0x7fffffff, m_document->nWordVersion);
|
||||
|
||||
bool isInline = _isTextBoxContent;
|
||||
bool isInline = _isTextBoxContent;
|
||||
|
||||
if (oPicture.embeddedData && oPicture.embeddedDataSize > 0)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin (L"w:pict");
|
||||
if (oPicture.embeddedData && oPicture.embeddedDataSize > 0)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin (L"w:pict");
|
||||
|
||||
VMLPictureMapping oVmlMapper(m_context, m_pXmlWriter, false, _caller, isInline);
|
||||
oPicture.Convert (&oVmlMapper);
|
||||
VMLPictureMapping oVmlMapper(m_context, m_pXmlWriter, false, _caller, isInline);
|
||||
oPicture.Convert (&oVmlMapper);
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:pict");
|
||||
}
|
||||
else if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer)/* && (false == oPicture.shapeContainer->isLastIdentify())*/)
|
||||
{
|
||||
bool bPicture = true;
|
||||
bool m_bSkip = false;
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:pict");
|
||||
}
|
||||
else if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer)/* && (false == oPicture.shapeContainer->isLastIdentify())*/)
|
||||
{
|
||||
bool bPicture = true;
|
||||
bool m_bSkip = false;
|
||||
|
||||
if (oPicture.shapeContainer)
|
||||
{
|
||||
if (oPicture.shapeContainer->m_nShapeType != msosptPictureFrame)
|
||||
bPicture = false;//шаблон 1.doc картинка в колонтитуле
|
||||
if (oPicture.shapeContainer)
|
||||
{
|
||||
if (oPicture.shapeContainer->m_nShapeType != msosptPictureFrame)
|
||||
bPicture = false;//шаблон 1.doc картинка в колонтитуле
|
||||
|
||||
m_bSkip = oPicture.shapeContainer->m_bSkip;
|
||||
}
|
||||
if (!m_bSkip)
|
||||
{
|
||||
bool bFormula = false;
|
||||
XMLTools::CStringXmlWriter pictWriter;
|
||||
pictWriter.WriteNodeBegin (L"w:pict");
|
||||
m_bSkip = oPicture.shapeContainer->m_bSkip;
|
||||
}
|
||||
if (!m_bSkip)
|
||||
{
|
||||
bool bFormula = false;
|
||||
XMLTools::CStringXmlWriter pictWriter;
|
||||
pictWriter.WriteNodeBegin (L"w:pict");
|
||||
|
||||
if (bPicture)
|
||||
{
|
||||
VMLPictureMapping oVmlMapper(m_context, &pictWriter, false, _caller, isInline);
|
||||
oPicture.Convert (&oVmlMapper);
|
||||
if (bPicture)
|
||||
{
|
||||
VMLPictureMapping oVmlMapper(m_context, &pictWriter, false, _caller, isInline);
|
||||
oPicture.Convert (&oVmlMapper);
|
||||
|
||||
if (oVmlMapper.m_isEmbedded)
|
||||
{
|
||||
OleObject ole ( chpx, m_document);
|
||||
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.m_shapeId );
|
||||
if (oVmlMapper.m_isEmbedded)
|
||||
{
|
||||
OleObject ole ( chpx, m_document);
|
||||
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.m_shapeId );
|
||||
|
||||
ole.isEquation = oVmlMapper.m_isEquation;
|
||||
ole.isEmbedded = oVmlMapper.m_isEmbedded;
|
||||
ole.embeddedData = oVmlMapper.m_embeddedData;
|
||||
ole.isEquation = oVmlMapper.m_isEquation;
|
||||
ole.isEmbedded = oVmlMapper.m_isEmbedded;
|
||||
ole.embeddedData = oVmlMapper.m_embeddedData;
|
||||
|
||||
ole.Convert( &oleObjectMapping );
|
||||
}
|
||||
else if (oVmlMapper.m_isEquation)
|
||||
{
|
||||
//нельзя в Run писать oMath
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
bFormula = true;
|
||||
}
|
||||
else if (oVmlMapper.m_isBlob)
|
||||
{
|
||||
_writeAfterRun = oVmlMapper.m_blobXml;
|
||||
bFormula = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VMLShapeMapping oVmlMapper(m_context, &pictWriter, NULL, &oPicture, _caller, isInline, false);
|
||||
oPicture.shapeContainer->Convert(&oVmlMapper);
|
||||
}
|
||||
ole.Convert( &oleObjectMapping );
|
||||
}
|
||||
else if (oVmlMapper.m_isEquation)
|
||||
{
|
||||
//нельзя в Run писать oMath
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
bFormula = true;
|
||||
}
|
||||
else if (oVmlMapper.m_isBlob)
|
||||
{
|
||||
_writeAfterRun = oVmlMapper.m_blobXml;
|
||||
bFormula = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VMLShapeMapping oVmlMapper(m_context, &pictWriter, NULL, &oPicture, _caller, isInline, false);
|
||||
oPicture.shapeContainer->Convert(&oVmlMapper);
|
||||
}
|
||||
|
||||
pictWriter.WriteNodeEnd (L"w:pict");
|
||||
pictWriter.WriteNodeEnd (L"w:pict");
|
||||
|
||||
if (!bFormula)
|
||||
{
|
||||
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
|
||||
if (!bFormula)
|
||||
{
|
||||
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
|
||||
|
||||
if ((false == _fieldLevels.empty()) && (_fieldLevels.back().bSeparate && !_fieldLevels.back().bResult)) //ege15.doc
|
||||
{
|
||||
_fieldLevels.back().bResult = true;
|
||||
}//imrtemplate(endnotes).doc
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((false == _fieldLevels.empty()) && (_fieldLevels.back().bSeparate && !_fieldLevels.back().bResult)) //ege15.doc
|
||||
{
|
||||
_fieldLevels.back().bResult = true;
|
||||
}//imrtemplate(endnotes).doc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
bPict = true;
|
||||
}
|
||||
else if ((TextMark::AutoNumberedFootnoteReference == code) && fSpec)
|
||||
{
|
||||
|
||||
@ -84,6 +84,7 @@ namespace DocFileFormat
|
||||
std::wstring m_shapeIdOwner;
|
||||
std::wstring getOLEObject() { return _lastOLEObject; }
|
||||
bool m_bOleInPicture = false;
|
||||
bool bPict = true;
|
||||
protected:
|
||||
|
||||
int getListNumCache (int fc, int fc_end);
|
||||
|
||||
@ -66,7 +66,19 @@ namespace DocFileFormat
|
||||
if (structureLength > 0)
|
||||
{
|
||||
// this PLEX contains CPs and Elements
|
||||
n = ((int)lcb - CP_LENGTH) / (structureLength + CP_LENGTH);
|
||||
//n = ((int)lcb - CP_LENGTH) / (structureLength + CP_LENGTH);
|
||||
int totalSize = (int)lcb - CP_LENGTH;
|
||||
int elementSize = structureLength + CP_LENGTH;
|
||||
|
||||
if (elementSize > 0)
|
||||
{
|
||||
n = totalSize / elementSize;
|
||||
|
||||
if (totalSize % elementSize != 0)
|
||||
{
|
||||
n += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -99,6 +99,7 @@ namespace DocFileFormat
|
||||
XMLTools::XMLElement pgNumType (L"w:pgNumType");
|
||||
|
||||
HeaderAndFooterTable* pTable = _ctx->_doc->headerAndFooterTable;
|
||||
bool bHasEndnoteNumFmt = false;
|
||||
|
||||
if (pTable)
|
||||
{
|
||||
@ -327,8 +328,11 @@ namespace DocFileFormat
|
||||
break;
|
||||
|
||||
case sprmSNfcEdnRef:
|
||||
{
|
||||
appendValueElement( &endnotePr, L"numFmt", NumberingMapping::GetNumberFormatWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
break;
|
||||
bHasEndnoteNumFmt = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmSNFtn:
|
||||
appendValueElement( &footnotePr, L"numStart", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
@ -488,6 +492,10 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!bHasEndnoteNumFmt)
|
||||
{
|
||||
appendValueElement( &endnotePr, L"numFmt", L"decimal", true );
|
||||
}
|
||||
|
||||
if (bWasSprmSFPgnRestart && false == wsSprmSPgnStart.empty() )
|
||||
appendValueAttribute( &pgNumType, L"w:start", wsSprmSPgnStart );
|
||||
|
||||
@ -190,7 +190,7 @@ namespace DocFileFormat
|
||||
|
||||
}
|
||||
|
||||
if (!IsTableBordersDefined(tapx->grpprl))
|
||||
if (!IsTableBordersDefined(tapx->grpprl) || ( _tcDef.brcTop->GetType() != 0) || ( _tcDef.brcLeft->GetType() != 0) ||( _tcDef.brcRight->GetType() != 0) ||( _tcDef.brcBottom->GetType() != 0))
|
||||
{
|
||||
_brcTop = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcTop));
|
||||
_brcLeft = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcLeft));
|
||||
@ -443,28 +443,28 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//append borders
|
||||
if (_brcTop)
|
||||
if ((_brcTop && _brcTop->GetType() != 0) || (_brcTop && _brcTop->GetNil()))
|
||||
{
|
||||
XMLTools::XMLElement topBorder( L"w:top" );
|
||||
appendBorderAttributes(_brcTop.get(), &topBorder);
|
||||
addOrSetBorder(_tcBorders, &topBorder );
|
||||
}
|
||||
|
||||
if (_brcLeft )
|
||||
if ((_brcLeft && _brcLeft->GetType() != 0) || (_brcLeft && _brcLeft->GetNil()))
|
||||
{
|
||||
XMLTools::XMLElement leftBorder( L"w:left" );
|
||||
appendBorderAttributes(_brcLeft.get(), &leftBorder);
|
||||
addOrSetBorder(_tcBorders, &leftBorder);
|
||||
}
|
||||
|
||||
if (_brcBottom)
|
||||
if ((_brcBottom && _brcBottom->GetType() != 0) || (_brcBottom && _brcBottom->GetNil()))
|
||||
{
|
||||
XMLTools::XMLElement bottomBorder( L"w:bottom" );
|
||||
appendBorderAttributes(_brcBottom.get(), &bottomBorder);
|
||||
addOrSetBorder(_tcBorders, &bottomBorder);
|
||||
}
|
||||
|
||||
if (_brcRight)
|
||||
if ((_brcRight && _brcRight->GetType() != 0) || (_brcRight && _brcRight->GetNil()))
|
||||
{
|
||||
XMLTools::XMLElement rightBorder( L"w:right" );
|
||||
appendBorderAttributes( _brcRight.get(), &rightBorder );
|
||||
|
||||
@ -23,6 +23,31 @@
|
||||
<ClCompile Include="..\..\..\Common\SummaryInformation\PropertyFactory.cpp" />
|
||||
<ClCompile Include="..\..\..\Common\SummaryInformation\PropertySet.cpp" />
|
||||
<ClCompile Include="..\..\..\Common\SummaryInformation\PropertySetStream.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\ConvertXls2Xlsx.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\external_items.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\mediaitems_utils.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\namespaces.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\oox_content_type.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\oox_package.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\oox_rels.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\XlsConverter.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_activeX_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_chart_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_comments.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_comments_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_conversion_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_drawings.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_drawing_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_external_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_hyperlinks.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_output_xml.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_package.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_pivots_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_protection.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_sheet_context.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_tablecontext.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_textcontext.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xls_writer.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Auxiliary\HelpFunc.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Binary\CFRecord.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Binary\CFRecordType.cpp" />
|
||||
@ -415,6 +440,7 @@
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFDatabar.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFExNonCF12.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFExTemplateParams.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFFilter.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFGradient.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFMStateItem.cpp" />
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFMultistate.cpp" />
|
||||
@ -827,6 +853,33 @@
|
||||
<ClInclude Include="..\..\..\Common\SummaryInformation\PropertyFactory.h" />
|
||||
<ClInclude Include="..\..\..\Common\SummaryInformation\PropertySet.h" />
|
||||
<ClInclude Include="..\..\..\Common\SummaryInformation\PropertySetStream.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\ConvertXls2Xlsx.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\external_items.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\mediaitems_utils.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\namespaces.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\oox_content_type.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\oox_package.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\oox_rels.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\progressCallback.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\ShapeType.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\XlsConverter.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_activeX_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_chart_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_comments.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_comments_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_conversion_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_drawings.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_drawing_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_external_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_hyperlinks.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_output_xml.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_package.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_pivots_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_protection.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_sheet_context.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_tablecontext.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_textcontext.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xls_writer.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Auxiliary\HelpFunc.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Binary\BinSmartPointers.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Binary\CFRecord.h" />
|
||||
@ -1230,6 +1283,7 @@
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFDatabar.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFExNonCF12.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFExTemplateParams.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFFilter.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFGradient.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFMStateItem.h" />
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFMultistate.h" />
|
||||
|
||||
@ -2443,6 +2443,84 @@
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\FutureFunctionParser.cpp">
|
||||
<Filter>Logic\Biff_structures</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFFilter.cpp">
|
||||
<Filter>Logic\Biff_structures</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\ConvertXls2Xlsx.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\external_items.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\mediaitems_utils.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\namespaces.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\oox_content_type.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\oox_package.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\oox_rels.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xls_writer.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\XlsConverter.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_activeX_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_chart_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_comments.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_comments_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_conversion_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_drawing_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_drawings.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_external_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_hyperlinks.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_output_xml.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_package.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_pivots_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_protection.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_sheet_context.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_tablecontext.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\XlsFile\Converter\xlsx_textcontext.cpp">
|
||||
<Filter>Binary</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logging\Log.h">
|
||||
@ -4899,5 +4977,89 @@
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\FutureFunctionParser.h">
|
||||
<Filter>Logic\Biff_structures</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Format\Logic\Biff_structures\CFFilter.h">
|
||||
<Filter>Logic\Biff_structures</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\ConvertXls2Xlsx.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\external_items.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\mediaitems_utils.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\namespaces.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\oox_content_type.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\oox_package.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\oox_rels.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\progressCallback.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\ShapeType.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xls_writer.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\XlsConverter.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_activeX_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_chart_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_comments.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_comments_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_conversion_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_drawing_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_drawings.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_external_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_hyperlinks.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_output_xml.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_package.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_pivots_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_protection.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_sheet_context.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_tablecontext.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\XlsFile\Converter\xlsx_textcontext.h">
|
||||
<Filter>Binary</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -34,6 +34,7 @@
|
||||
#include "../Format/Binary/CompoundFile.h"
|
||||
#include "../Format/Binary/CFStreamCacheWriter.h"
|
||||
#include "../Format/Logic/WorkbookStreamObject.h"
|
||||
#include <iomanip>
|
||||
|
||||
bool XlsWriter::Open(const std::wstring &fileName)
|
||||
{
|
||||
@ -45,18 +46,19 @@ bool XlsWriter::Open(const std::wstring &fileName)
|
||||
bool XlsWriter::WriteWorkbook(XLS::BaseObjectPtr streamObject)
|
||||
{
|
||||
auto WokrkbokStreamName = L"Workbook";
|
||||
auto xls_global_info = boost::shared_ptr<XLS::GlobalWorkbookInfo>(new XLS::GlobalWorkbookInfo(XLS::WorkbookStreamObject::DefaultCodePage, nullptr));
|
||||
if(globalInfoPtr == nullptr)
|
||||
globalInfoPtr = boost::shared_ptr<XLS::GlobalWorkbookInfo>(new XLS::GlobalWorkbookInfo(XLS::WorkbookStreamObject::DefaultCodePage, nullptr));
|
||||
auto BookStream = xls_file->createNamedStream(WokrkbokStreamName);
|
||||
if(BookStream == nullptr)
|
||||
return false;
|
||||
XLS::StreamCacheWriterPtr cacheWriter(new XLS::CFStreamCacheWriter(BookStream, xls_global_info));
|
||||
XLS::StreamCacheWriterPtr cacheWriter(new XLS::CFStreamCacheWriter(BookStream, globalInfoPtr));
|
||||
XLS::BinWriterProcessor stream_proc(cacheWriter, nullptr);
|
||||
stream_proc.mandatory(*streamObject);
|
||||
|
||||
//writing fileptrs
|
||||
{
|
||||
auto filePos = BookStream->getStreamPointer();
|
||||
for(auto sheet : xls_global_info->sheets_info)
|
||||
for(auto sheet : globalInfoPtr->sheets_info)
|
||||
{
|
||||
//bof of worksheet
|
||||
BookStream->seekFromBegin(sheet.BoundSheetPos);
|
||||
@ -69,10 +71,20 @@ bool XlsWriter::WriteWorkbook(XLS::BaseObjectPtr streamObject)
|
||||
}
|
||||
bool XlsWriter::WriteStreamObject(std::wstring &streamName, XLS::BaseObjectPtr streamObject)
|
||||
{
|
||||
auto xls_global_info = boost::shared_ptr<XLS::GlobalWorkbookInfo>(new XLS::GlobalWorkbookInfo(XLS::WorkbookStreamObject::DefaultCodePage, nullptr));
|
||||
XLS::StreamCacheWriterPtr cacheWriter(new XLS::CFStreamCacheWriter(xls_file->createNamedStream(streamName), xls_global_info));
|
||||
if(globalInfoPtr == nullptr)
|
||||
globalInfoPtr = boost::shared_ptr<XLS::GlobalWorkbookInfo>(new XLS::GlobalWorkbookInfo(XLS::WorkbookStreamObject::DefaultCodePage, nullptr));
|
||||
XLS::StreamCacheWriterPtr cacheWriter(new XLS::CFStreamCacheWriter(xls_file->createNamedStream(streamName), globalInfoPtr));
|
||||
|
||||
XLS::BinWriterProcessor stream_proc(cacheWriter, nullptr);
|
||||
stream_proc.mandatory(*streamObject);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XlsWriter::WritePivotCache(XLS::BaseObjectPtr streamObject, _UINT32 cacheId)
|
||||
{
|
||||
auto DirectoryName = L"_SX_DB_CUR/";
|
||||
std::wstringstream ss;
|
||||
ss << std::hex << std::setw(4) << std::setfill(L'0') << std::uppercase << cacheId;
|
||||
std::wstring streamName = DirectoryName + ss.str();
|
||||
return WriteStreamObject(streamName, streamObject);
|
||||
}
|
||||
|
||||
@ -44,7 +44,10 @@ class XlsWriter
|
||||
public:
|
||||
bool Open(const std::wstring &fileName);
|
||||
bool WriteWorkbook(XLS::BaseObjectPtr streamObject);
|
||||
bool WritePivotCache(XLS::BaseObjectPtr streamObject, _UINT32 cacheId);
|
||||
bool WriteStreamObject(std::wstring &streamName, XLS::BaseObjectPtr streamObject);
|
||||
|
||||
boost::shared_ptr<XLS::GlobalWorkbookInfo> globalInfoPtr;
|
||||
private:
|
||||
std::wstring fileName_ = L"";
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
|
||||
Ref ref_;
|
||||
ArrayParsedFormula formula;
|
||||
bool fAlwaysCalc;
|
||||
bool fAlwaysCalc = false;
|
||||
|
||||
RFX rfx; //biff12
|
||||
};
|
||||
|
||||
@ -72,7 +72,14 @@ void AutoFilter::readFields(CFRecord& record)
|
||||
{
|
||||
size_t pos_record = record.getRdPtr();
|
||||
|
||||
if (size == 0xffffffff) size = record.getDataSize() - pos_record;
|
||||
|
||||
if (size == 0xffffffff)
|
||||
size = record.getDataSize() - pos_record;
|
||||
else if(record.getDataSize() < pos_record + size)
|
||||
{
|
||||
//size error
|
||||
return;
|
||||
}
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
|
||||
@ -112,6 +112,7 @@ void AutoFilter12::readFields(CFRecord& record)
|
||||
void AutoFilter12::writeFields(CFRecord& record)
|
||||
{
|
||||
_UINT16 flags = 0;
|
||||
frtRefHeader.rt = 0x087E;
|
||||
record << frtRefHeader << iEntry << fHideArrow << ft << cft << cCriteria << cDateGroupings;
|
||||
bool fWorksheetAutoFilter = false;
|
||||
if(idList == 0xFFFFFFFF)
|
||||
@ -122,7 +123,8 @@ void AutoFilter12::writeFields(CFRecord& record)
|
||||
record << idList;
|
||||
|
||||
_GUID_ guid_num;
|
||||
STR::bstr2guid(guidSview, guid_num);
|
||||
if(!guidSview.empty())
|
||||
STR::bstr2guid(guidSview, guid_num);
|
||||
record << guid_num;
|
||||
if(rgb != nullptr)
|
||||
rgb->save(record);
|
||||
|
||||
@ -36,6 +36,15 @@
|
||||
#include "../Biff_structures/CFMultistate.h"
|
||||
#include "../Biff_structures/CFDatabar.h"
|
||||
#include "../Biff_structures/CFGradient.h"
|
||||
#include "../Biff_structures/CFFilter.h"
|
||||
|
||||
#include "../../../../../OOXML/XlsxFormat/ComplexTypes_Spreadsheet.h"
|
||||
#include "../../../../../OOXML/XlsxFormat/Styles/dxf.h"
|
||||
#include "../../../../../OOXML/XlsxFormat/Styles/Xfs.h"
|
||||
#include "../../../../../OOXML/XlsxFormat/Styles/NumFmts.h"
|
||||
#include "../../../../../OOXML/XlsxFormat/Styles/Fonts.h"
|
||||
#include "../../../../../OOXML/XlsxFormat/Styles/Fills.h"
|
||||
#include "../../../../../OOXML/XlsxFormat/Styles/Borders.h"
|
||||
#include "../../../../../OOXML/Base/Unit.h"
|
||||
|
||||
namespace XLS
|
||||
@ -100,9 +109,8 @@ void CF12::readFields(CFRecord& record)
|
||||
rgbCT->load(record);
|
||||
break;
|
||||
case 0x05:
|
||||
//todooo
|
||||
//rgbCT = BiffStructurePtr(new CFFilter);
|
||||
//rgbCT->load(record);
|
||||
rgbCT = BiffStructurePtr(new CFFilter);
|
||||
rgbCT->load(record);
|
||||
break;
|
||||
case 0x06:
|
||||
rgbCT = BiffStructurePtr(new CFMultistate);
|
||||
@ -117,13 +125,356 @@ void CF12::readFields(CFRecord& record)
|
||||
|
||||
dxfId_ = global_info->RegistrDxfn(strm.str());
|
||||
}
|
||||
void ProcessBorderProp( OOX::Spreadsheet::CBorderProp* prop, unsigned char& DgPtr, unsigned char& icvPtr)
|
||||
{
|
||||
if(prop->m_oStyle.IsInit())
|
||||
{
|
||||
switch(prop->m_oStyle->GetValue())
|
||||
{
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleNone:
|
||||
{
|
||||
DgPtr = 0;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleThin:
|
||||
{
|
||||
DgPtr = 1;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleMedium:
|
||||
{
|
||||
DgPtr = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleDashed:
|
||||
{
|
||||
DgPtr = 3;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleDotted:
|
||||
{
|
||||
DgPtr = 4;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleThick:
|
||||
{
|
||||
DgPtr = 5;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleDouble:
|
||||
{
|
||||
DgPtr = 6;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleHair:
|
||||
{
|
||||
DgPtr = 7;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleMediumDashed:
|
||||
{
|
||||
DgPtr = 8;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleDashDot:
|
||||
{
|
||||
DgPtr = 9;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleMediumDashDot:
|
||||
{
|
||||
DgPtr = 10;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleDashDotDot:
|
||||
{
|
||||
DgPtr = 11;
|
||||
break;
|
||||
}
|
||||
case SimpleTypes::Spreadsheet::EBorderStyle::borderstyleSlantDashDot:
|
||||
{
|
||||
DgPtr = 13;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(prop->m_oColor.IsInit() && prop->m_oColor->m_oIndexed.IsInit())
|
||||
icvPtr = prop->m_oColor->m_oIndexed->GetValue();
|
||||
}
|
||||
|
||||
void CF12::writeFields(CFRecord& record)
|
||||
{ frtRefHeader.rt = 0x087A;
|
||||
{
|
||||
GlobalWorkbookInfoPtr global_info = record.getGlobalWorkbookInfo();
|
||||
frtRefHeader.rt = 0x087A;
|
||||
record << frtRefHeader;
|
||||
record << ct << cp;
|
||||
|
||||
record.reserveNunBytes(4);
|
||||
auto ccePos = record.getRdPtr();
|
||||
if(dxf.dxfn != nullptr)
|
||||
{
|
||||
//todo dxf conversion from global info
|
||||
if(dxfId_ >= 0 && global_info->arrUserDxfs.size() > dxfId_)
|
||||
{
|
||||
OOX::Spreadsheet::CDxf dxfObj;
|
||||
XmlUtils::CXmlLiteReader oReader;
|
||||
if(oReader.FromString(global_info->arrUserDxfs.at(dxfId_)))
|
||||
{
|
||||
if(oReader.ReadNextNode())
|
||||
{
|
||||
dxfObj.fromXML(oReader);
|
||||
if(dxfObj.m_oFill.IsInit() && dxfObj.m_oFill->m_oPatternFill.IsInit())
|
||||
{
|
||||
dxf.dxfn->flsNinch = false;
|
||||
dxf.dxfn->ibitAtrPat = true;
|
||||
dxf.dxfn->dxfpat.fls = 1;
|
||||
if(dxfObj.m_oFill->m_oPatternFill->m_oFgColor.IsInit() && dxfObj.m_oFill->m_oPatternFill->m_oFgColor->m_oIndexed.IsInit())
|
||||
{
|
||||
dxf.dxfn->icvFNinch = false;
|
||||
dxf.dxfn->dxfpat.icvForeground = dxfObj.m_oFill->m_oPatternFill->m_oFgColor->m_oIndexed->GetValue();
|
||||
}
|
||||
else if(dxfObj.m_oFill->m_oPatternFill->m_oFgColor.IsInit())
|
||||
{
|
||||
dxf.dxfn->icvFNinch= false;
|
||||
ExtProp fgColor;
|
||||
if(dxf.dxfn->xfext == nullptr)
|
||||
{
|
||||
auto Ext = new XFExtNoFRT;
|
||||
dxf.dxfn->xfext = XFExtNoFRTPtr(Ext);
|
||||
}
|
||||
if(dxfObj.m_oFill->m_oPatternFill->m_oFgColor->m_oThemeColor.IsInit())
|
||||
{
|
||||
fgColor.extType = ExtProp::ForeColor;
|
||||
fgColor.extPropData.color.xclrType = 3;
|
||||
fgColor.extPropData.color.xclrValue = dxfObj.m_oFill->m_oPatternFill->m_oFgColor->m_oThemeColor->GetValue();
|
||||
|
||||
}
|
||||
else if(dxfObj.m_oFill->m_oPatternFill->m_oFgColor->m_oRgb.IsInit())
|
||||
{
|
||||
fgColor.extType = ExtProp::ForeColor;
|
||||
fgColor.extPropData.color.xclrType = 2;
|
||||
fgColor.extPropData.color.xclrValue = dxfObj.m_oFill->m_oPatternFill->m_oFgColor->m_oRgb->ToInt();
|
||||
}
|
||||
|
||||
dxf.dxfn->xfext->mapRgExt.emplace(ExtProp::ForeColor, fgColor);
|
||||
}
|
||||
if(dxfObj.m_oFill->m_oPatternFill->m_oBgColor.IsInit() && dxfObj.m_oFill->m_oPatternFill->m_oBgColor->m_oIndexed.IsInit())
|
||||
{
|
||||
dxf.dxfn->icvBNinch = false;
|
||||
dxf.dxfn->dxfpat.icvBackground = dxfObj.m_oFill->m_oPatternFill->m_oBgColor->m_oIndexed->GetValue();
|
||||
}
|
||||
else if(dxfObj.m_oFill->m_oPatternFill->m_oBgColor.IsInit())
|
||||
{
|
||||
ExtProp bgColor;
|
||||
dxf.dxfn->icvBNinch = false;
|
||||
if(dxf.dxfn->xfext == nullptr)
|
||||
{
|
||||
auto Ext = new XFExtNoFRT;
|
||||
dxf.dxfn->xfext = XFExtNoFRTPtr(Ext);
|
||||
}
|
||||
if(dxfObj.m_oFill->m_oPatternFill->m_oBgColor->m_oThemeColor.IsInit())
|
||||
{
|
||||
bgColor.extType = ExtProp::BackColor;
|
||||
bgColor.extPropData.color.xclrType = 3;
|
||||
bgColor.extPropData.color.xclrValue = dxfObj.m_oFill->m_oPatternFill->m_oBgColor->m_oThemeColor->GetValue();
|
||||
|
||||
}
|
||||
else if(dxfObj.m_oFill->m_oPatternFill->m_oBgColor->m_oRgb.IsInit())
|
||||
{
|
||||
bgColor.extType = ExtProp::BackColor;
|
||||
bgColor.extPropData.color.xclrType = 2;
|
||||
bgColor.extPropData.color.xclrValue = dxfObj.m_oFill->m_oPatternFill->m_oBgColor->m_oRgb->ToInt();
|
||||
}
|
||||
|
||||
dxf.dxfn->xfext->mapRgExt.emplace(ExtProp::BackColor, bgColor);
|
||||
}
|
||||
}
|
||||
if(dxfObj.m_oFont.IsInit())
|
||||
{
|
||||
dxf.dxfn->ibitAtrFnt = true;
|
||||
if(dxfObj.m_oFont->m_oBold.IsInit() && dxfObj.m_oFont->m_oBold->m_oVal.GetValue())
|
||||
{ dxf.dxfn->dxffntd.fBlsNinch = false;
|
||||
dxf.dxfn->dxffntd.stxp.bls = 0x02BC;
|
||||
}
|
||||
if(dxfObj.m_oFont->m_oStrike.IsInit() && dxfObj.m_oFont->m_oStrike->m_oVal.GetValue())
|
||||
{
|
||||
dxf.dxfn->dxffntd.stxp.ts.ftsStrikeout = true;
|
||||
dxf.dxfn->dxffntd.tsNinch.ftsStrikeout = false;
|
||||
}
|
||||
if(dxfObj.m_oFont->m_oItalic.IsInit() && dxfObj.m_oFont->m_oItalic->m_oVal.GetValue())
|
||||
{
|
||||
dxf.dxfn->dxffntd.stxp.ts.ftsItalic = true;
|
||||
dxf.dxfn->dxffntd.tsNinch.ftsItalic = false;
|
||||
}
|
||||
if(dxfObj.m_oFont->m_oSz.IsInit())
|
||||
dxf.dxfn->dxffntd.stxp.twpHeight = dxfObj.m_oFont->m_oSz->m_oVal->GetValue() * 20;
|
||||
if(dxfObj.m_oFont->m_oUnderline.IsInit())
|
||||
{
|
||||
dxf.dxfn->dxffntd.fUlsNinch = false;
|
||||
if(dxfObj.m_oFont->m_oUnderline->m_oUnderline->GetValue() == SimpleTypes::Spreadsheet::EUnderline::underlineSingle)
|
||||
dxf.dxfn->dxffntd.stxp.uls = 1;
|
||||
else if(dxfObj.m_oFont->m_oUnderline->m_oUnderline->GetValue() == SimpleTypes::Spreadsheet::EUnderline::underlineDouble)
|
||||
dxf.dxfn->dxffntd.stxp.uls = 2;
|
||||
else if(dxfObj.m_oFont->m_oUnderline->m_oUnderline->GetValue() == SimpleTypes::Spreadsheet::EUnderline::underlineSingleAccounting)
|
||||
dxf.dxfn->dxffntd.stxp.uls = 0x21;
|
||||
else if(dxfObj.m_oFont->m_oUnderline->m_oUnderline->GetValue() == SimpleTypes::Spreadsheet::EUnderline::underlineDoubleAccounting)
|
||||
dxf.dxfn->dxffntd.stxp.uls = 0x22;
|
||||
}
|
||||
if(dxfObj.m_oFont->m_oColor.IsInit() && dxfObj.m_oFont->m_oColor->m_oIndexed.IsInit())
|
||||
dxf.dxfn->dxffntd.icvFore = dxfObj.m_oFont->m_oColor->m_oIndexed->GetValue();
|
||||
}
|
||||
if(dxfObj.m_oBorder.IsInit())
|
||||
{
|
||||
dxf.dxfn->ibitAtrBdr = true;
|
||||
if(dxfObj.m_oBorder->m_oBottom.IsInit())
|
||||
{
|
||||
dxf.dxfn->glBottomNinch = false;
|
||||
ProcessBorderProp(dxfObj.m_oBorder->m_oBottom.GetPointer(), dxf.dxfn->dxfbdr.dgBottom, dxf.dxfn->dxfbdr.icvBottom);
|
||||
}
|
||||
if(dxfObj.m_oBorder->m_oTop.IsInit())
|
||||
{
|
||||
dxf.dxfn->glTopNinch = false;
|
||||
ProcessBorderProp(dxfObj.m_oBorder->m_oTop.GetPointer(), dxf.dxfn->dxfbdr.dgTop, dxf.dxfn->dxfbdr.icvTop);
|
||||
}
|
||||
if(dxfObj.m_oBorder->m_oStart.IsInit())
|
||||
{
|
||||
dxf.dxfn->glLeftNinch = false;
|
||||
ProcessBorderProp(dxfObj.m_oBorder->m_oStart.GetPointer(), dxf.dxfn->dxfbdr.dgLeft, dxf.dxfn->dxfbdr.icvLeft);
|
||||
}
|
||||
if(dxfObj.m_oBorder->m_oEnd.IsInit())
|
||||
{
|
||||
dxf.dxfn->glRightNinch = false;
|
||||
ProcessBorderProp(dxfObj.m_oBorder->m_oEnd.GetPointer(), dxf.dxfn->dxfbdr.dgRight, dxf.dxfn->dxfbdr.icvRight);
|
||||
}
|
||||
if(dxfObj.m_oBorder->m_oDiagonal.IsInit())
|
||||
{
|
||||
dxf.dxfn->glDiagDownNinch = false;
|
||||
dxf.dxfn->glDiagUpNinch = false;
|
||||
if(dxfObj.m_oBorder->m_oDiagonalDown.IsInit() && dxfObj.m_oBorder->m_oDiagonalDown->GetValue())
|
||||
dxf.dxfn->dxfbdr.bitDiagDown = true;
|
||||
if(dxfObj.m_oBorder->m_oDiagonalUp.IsInit() && dxfObj.m_oBorder->m_oDiagonalUp->GetValue())
|
||||
dxf.dxfn->dxfbdr.bitDiagUp = true;
|
||||
ProcessBorderProp(dxfObj.m_oBorder->m_oDiagonal.GetPointer(), dxf.dxfn->dxfbdr.dgDiag, dxf.dxfn->dxfbdr.icvDiag);
|
||||
}
|
||||
}
|
||||
if(dxfObj.m_oNumFmt.IsInit())
|
||||
{
|
||||
dxf.dxfn->ibitAtrNum = true;
|
||||
if(dxfObj.m_oNumFmt->m_oNumFmtId.IsInit())
|
||||
{
|
||||
dxf.dxfn->fIfmtUser = false;
|
||||
dxf.dxfn->ifmtNinch = false;
|
||||
dxf.dxfn->dxfnum.fmt_id.ifmt = dxfObj.m_oNumFmt->m_oNumFmtId->m_eValue;
|
||||
}
|
||||
else if (dxfObj.m_oNumFmt->m_oFormatCode.IsInit())
|
||||
{
|
||||
dxf.dxfn->fIfmtUser = true;
|
||||
dxf.dxfn->dxfnum.user_defined.fmt = dxfObj.m_oNumFmt->m_oFormatCode.get();
|
||||
}
|
||||
}
|
||||
if(dxfObj.m_oProtection.IsInit())
|
||||
{
|
||||
dxf.dxfn->ibitAtrProt = true;
|
||||
dxf.dxfn->lockedNinch = false;
|
||||
dxf.dxfn->hiddenNinch = false;
|
||||
if(dxfObj.m_oProtection->m_oHidden.IsInit() && dxfObj.m_oProtection->m_oHidden->GetValue())
|
||||
dxf.dxfn->dxfprot.fHidden = true;
|
||||
if(dxfObj.m_oProtection->m_oLocked.IsInit() && dxfObj.m_oProtection->m_oLocked->GetValue())
|
||||
dxf.dxfn->dxfprot.fLocked = true;
|
||||
}
|
||||
if(dxfObj.m_oAlignment.IsInit())
|
||||
{
|
||||
dxf.dxfn->ibitAtrAlc = true;
|
||||
if(dxfObj.m_oAlignment->m_oHorizontal.IsInit())
|
||||
{
|
||||
dxf.dxfn->alchNinch = false;
|
||||
if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentGeneral)
|
||||
dxf.dxfn->dxfalc.alc = 0;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentLeft)
|
||||
dxf.dxfn->dxfalc.alc = 1;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentCenter)
|
||||
dxf.dxfn->dxfalc.alc = 2;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentRight)
|
||||
dxf.dxfn->dxfalc.alc = 3;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentFill)
|
||||
dxf.dxfn->dxfalc.alc = 4;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentJustify)
|
||||
dxf.dxfn->dxfalc.alc = 5;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentCenterContinuous)
|
||||
dxf.dxfn->dxfalc.alc = 6;
|
||||
else if(dxfObj.m_oAlignment->m_oHorizontal->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EHorizontalAlignment::horizontalalignmentDistributed)
|
||||
dxf.dxfn->dxfalc.alc = 7;
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oWrapText.IsInit())
|
||||
{
|
||||
dxf.dxfn->wrapNinch = false;
|
||||
dxf.dxfn->dxfalc.fWrap = dxfObj.m_oAlignment->m_oWrapText->GetValue();
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oVertical.IsInit())
|
||||
{
|
||||
dxf.dxfn->alcvNinch = false;
|
||||
if(dxfObj.m_oAlignment->m_oVertical->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EVerticalAlignment::verticalalignmentTop)
|
||||
dxf.dxfn->dxfalc.alcv = 0;
|
||||
else if(dxfObj.m_oAlignment->m_oVertical->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EVerticalAlignment::verticalalignmentCenter)
|
||||
dxf.dxfn->dxfalc.alcv = 1;
|
||||
else if(dxfObj.m_oAlignment->m_oVertical->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EVerticalAlignment::verticalalignmentBottom)
|
||||
dxf.dxfn->dxfalc.alcv = 2;
|
||||
else if(dxfObj.m_oAlignment->m_oVertical->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EVerticalAlignment::verticalalignmentJustify)
|
||||
dxf.dxfn->dxfalc.alcv = 3;
|
||||
else if(dxfObj.m_oAlignment->m_oVertical->GetValue()
|
||||
== SimpleTypes::Spreadsheet::EVerticalAlignment::verticalalignmentDistributed)
|
||||
dxf.dxfn->dxfalc.alcv = 4;
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oJustifyLastLine.IsInit())
|
||||
{
|
||||
dxf.dxfn->kintoNinch = false;
|
||||
dxf.dxfn->dxfalc.fJustLast = dxfObj.m_oAlignment->m_oJustifyLastLine->GetValue();
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oTextRotation.IsInit())
|
||||
{
|
||||
dxf.dxfn->trotNinch = false;
|
||||
dxf.dxfn->dxfalc.trot = dxfObj.m_oAlignment->m_oTextRotation.get();
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oIndent.IsInit())
|
||||
{
|
||||
dxf.dxfn->cIndentNinch = false;
|
||||
dxf.dxfn->dxfalc.cIndent = dxfObj.m_oAlignment->m_oIndent.get();
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oRelativeIndent.IsInit())
|
||||
{
|
||||
dxf.dxfn->cIndentNinch = false;
|
||||
dxf.dxfn->dxfalc.iIndent = dxfObj.m_oAlignment->m_oRelativeIndent.get();
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oShrinkToFit.IsInit())
|
||||
{
|
||||
dxf.dxfn->fShrinkNinch = false;
|
||||
dxf.dxfn->dxfalc.fShrinkToFit = dxfObj.m_oAlignment->m_oShrinkToFit->GetValue();
|
||||
}
|
||||
if(dxfObj.m_oAlignment->m_oReadingOrder.IsInit())
|
||||
{
|
||||
dxf.dxfn->iReadingOrderNinch = false;
|
||||
dxf.dxfn->dxfalc.iReadingOrder = dxfObj.m_oAlignment->m_oReadingOrder.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
record << dxf;
|
||||
auto rgce1pos = record.getRdPtr();
|
||||
auto dxfSize = rgce1pos - ccePos;
|
||||
|
||||
@ -72,7 +72,7 @@ public:
|
||||
|
||||
CFParsedFormula fmlaActive;
|
||||
_UINT16 ipriority = 0;
|
||||
_UINT16 icfTemplate = 0;
|
||||
_UINT16 icfTemplate = 1;
|
||||
CFExTemplateParams rgbTemplateParms;
|
||||
|
||||
BiffStructurePtr rgbCT;
|
||||
@ -80,7 +80,7 @@ public:
|
||||
//-----------------------------
|
||||
bool fStopIfTrue = 0;
|
||||
int ipriority_ = 0;
|
||||
int dxfId_ = 0;
|
||||
int dxfId_ = -1;
|
||||
|
||||
BaseObjectPtr m_CFEx;
|
||||
BaseObjectPtr m_CF12_2;
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
_UINT32 colFirst = 0;
|
||||
_UINT32 colLast = 0;
|
||||
_UINT32 coldx = 0;
|
||||
IXFCell ixfe = 0xffff;
|
||||
IXFCell ixfe = 0;
|
||||
_UINT32 ixfeXLSB = 0xffffffff;
|
||||
|
||||
bool fHidden = false;
|
||||
|
||||
@ -120,11 +120,19 @@ void DConRef::readFields(CFRecord& record)
|
||||
|
||||
void DConRef::writeFields(CFRecord& record)
|
||||
{
|
||||
if(cchFile == 0 && stFile== L"")
|
||||
{
|
||||
stFile = L'\x0002' + sheet_name;
|
||||
cchFile = stFile.size();
|
||||
|
||||
}
|
||||
record << ref << cchFile;
|
||||
if (cchFile > 0 && cchFile < 0xffff)
|
||||
{
|
||||
record << stFile;
|
||||
record.reserveNunBytes(2);
|
||||
XLUnicodeStringNoCch file;
|
||||
file = stFile;
|
||||
record << file;
|
||||
//record.reserveNunBytes(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,8 +55,8 @@ public:
|
||||
static const ElementType type = typeDConRef;
|
||||
|
||||
RefU ref;
|
||||
unsigned short cchFile;
|
||||
std::wstring stFile;
|
||||
unsigned short cchFile = 0;
|
||||
std::wstring stFile = L"";
|
||||
|
||||
std::vector<std::wstring> path;
|
||||
std::wstring file_name;
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
bool fWnClosed = 0;
|
||||
_UINT32 xLeft = 0;
|
||||
_UINT32 yTop = 0;
|
||||
_INT32 idObj = 0;
|
||||
_INT32 idObj = -1;
|
||||
_UINT32 idvMac = 0;
|
||||
|
||||
};
|
||||
|
||||
@ -75,9 +75,10 @@ void DXF::writeFields(CFRecord& record)
|
||||
{
|
||||
if (record.getGlobalWorkbookInfo()->Version < 0x0800)
|
||||
{
|
||||
frtRefHeaderU.rt = 2189;
|
||||
record << frtRefHeaderU;
|
||||
_UINT16 flags = 0;
|
||||
|
||||
SETBIT(flags, 0, 1)
|
||||
SETBIT(flags, 1, xfprops.fNewBorder)
|
||||
record << flags << xfprops;
|
||||
}
|
||||
|
||||
@ -55,6 +55,8 @@ void DataFormat::readFields(CFRecord& record)
|
||||
unsigned short flags;
|
||||
record >> xi >> yi >> iss >> flags;
|
||||
fUnknown = GETBIT(flags, 0);
|
||||
if(iss > 1000)
|
||||
iss = 0;
|
||||
}
|
||||
|
||||
void DataFormat::writeFields(CFRecord& record)
|
||||
|
||||
@ -56,9 +56,9 @@ public:
|
||||
std::wstring ref_ = L"";
|
||||
//-----------------------------
|
||||
_UINT32 rwMic = 0;
|
||||
_UINT32 rwMac = 0;
|
||||
_UINT32 rwMac = 0x00010000;
|
||||
_UINT16 colMic = 0;
|
||||
_UINT16 colMac = 0;
|
||||
_UINT16 colMac = 0x0100;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -154,8 +154,8 @@ void Dv::writeFields(CFRecord& record)
|
||||
SETBIT(flags, 18, fShowInputMsg)
|
||||
SETBIT(flags, 19, fShowErrorMsg)
|
||||
SETBITS(flags, 20, 23, typOperator)
|
||||
SETBIT(flags, 24, fDVMinFmla)
|
||||
SETBIT(flags, 25, fDVMaxFmla)
|
||||
//SETBIT(flags, 24, fDVMinFmla)
|
||||
//SETBIT(flags, 25, fDVMaxFmla)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -51,7 +51,7 @@ enum _typOperatorDv
|
||||
operatorDvGreaterThanOrEqual,
|
||||
operatorDvLessThanOrEqual
|
||||
};
|
||||
enum _valTypeDv
|
||||
enum _valTypeDv
|
||||
{
|
||||
typeDvNone = 0,
|
||||
typeDvWhole = 1,
|
||||
@ -81,12 +81,12 @@ public:
|
||||
_valTypeDv valType;
|
||||
unsigned char errStyle;
|
||||
|
||||
bool fStrLookup;
|
||||
bool fAllowBlank;
|
||||
bool fSuppressCombo;
|
||||
unsigned char mdImeMode;
|
||||
bool fShowInputMsg;
|
||||
bool fShowErrorMsg;
|
||||
bool fStrLookup = false;
|
||||
bool fAllowBlank = false;
|
||||
bool fSuppressCombo = false;
|
||||
unsigned char mdImeMode = 0;
|
||||
bool fShowInputMsg = false;
|
||||
bool fShowErrorMsg = false;
|
||||
_typOperatorDv typOperator;
|
||||
|
||||
std::wstring PromptTitle;//XLUnicodeString
|
||||
|
||||
@ -111,7 +111,7 @@ void ExternSheet::writeFields(CFRecord& record)
|
||||
}
|
||||
else if (record.getGlobalWorkbookInfo()->Version < 0x0800)
|
||||
{
|
||||
_UINT16 cXTI_2b = cXTI;
|
||||
_UINT16 cXTI_2b = rgXTI.size();
|
||||
record << cXTI_2b;
|
||||
for (int i = 0; i < cXTI_2b; ++i)
|
||||
{
|
||||
|
||||
@ -67,5 +67,15 @@ void FeatHdr11::readFields(CFRecord& record)
|
||||
record.skipNunBytes(2); // reserved4
|
||||
}
|
||||
|
||||
void FeatHdr11::writeFields(CFRecord& record)
|
||||
{
|
||||
frt.rt = 0x0871;
|
||||
record << frt << isf;
|
||||
unsigned char reserved1 = 1;
|
||||
unsigned int reserved2 = 0xFFFFFFFF;
|
||||
record << reserved1 << reserved2 << reserved2 << idListNext;
|
||||
record.reserveNunBytes(2);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,12 +48,13 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFeatHdr11;
|
||||
|
||||
FrtHeader frt;
|
||||
_UINT16 isf;
|
||||
_UINT32 idListNext;
|
||||
_UINT16 isf = 0x0005;
|
||||
_UINT32 idListNext = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -90,5 +90,33 @@ void Feature11::readFields(CFRecord& record)
|
||||
record >> rgbFeat;
|
||||
}
|
||||
|
||||
void Feature11::writeFields(CFRecord& record)
|
||||
{
|
||||
frtRefHeaderU.grbitFrt.fFrtRef = true;
|
||||
if(!bFeature12)
|
||||
{
|
||||
frtRefHeaderU.rt = 0x0872;
|
||||
}
|
||||
else
|
||||
frtRefHeaderU.rt = 0x0878;
|
||||
record << frtRefHeaderU << isf;
|
||||
record.reserveNunBytes(5);
|
||||
cref2 = refs2.size();
|
||||
record << cref2;
|
||||
//auto cbFeatDataPos = record.getRdPtr();
|
||||
record.reserveNunBytes(4); //cbFeatData
|
||||
record.reserveNunBytes(2);
|
||||
for(auto i : refs2)
|
||||
i->save(record);
|
||||
//auto beginRgb = record.getRdPtr();
|
||||
rgbFeat.save(record);
|
||||
//auto endrgb = record.getRdPtr();
|
||||
//cbFeatData = endrgb - beginRgb;
|
||||
//record.RollRdPtrBack(endrgb - cbFeatDataPos);
|
||||
//record << cbFeatData;
|
||||
//record.skipNunBytes(endrgb - record.getRdPtr());
|
||||
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -51,19 +51,20 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeFeature11;
|
||||
|
||||
FrtRefHeaderU frtRefHeaderU;
|
||||
_UINT16 isf;
|
||||
_UINT16 cref2;
|
||||
_UINT32 cbFeatData;
|
||||
_UINT16 isf = 0x0005;
|
||||
_UINT16 cref2 = 0;
|
||||
_UINT32 cbFeatData = 0;
|
||||
BiffStructurePtrVector refs2;
|
||||
std::wstring sqref;
|
||||
|
||||
TableFeatureType rgbFeat;
|
||||
|
||||
bool bFeature12;
|
||||
bool bFeature12 = false;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -72,7 +72,7 @@ public:
|
||||
bool fCondense = false;
|
||||
bool fExtend = false;
|
||||
|
||||
_UINT16 icv = 8;
|
||||
_UINT16 icv = 0;
|
||||
_UINT16 bls = 400;
|
||||
_UINT16 sss = 0;
|
||||
unsigned char uls = 0;
|
||||
|
||||
@ -61,8 +61,9 @@ void HLink::readFields(CFRecord& record)
|
||||
void HLink::writeFields(CFRecord& record)
|
||||
{
|
||||
record << ref8;
|
||||
_GUID_ guid_num(0, 0, 0, 0);
|
||||
STR::bstr2guid(hlinkClsid, guid_num);
|
||||
_GUID_ guid_num;
|
||||
if(!hlinkClsid.empty())
|
||||
STR::bstr2guid(hlinkClsid, guid_num);
|
||||
record << guid_num << hyperlink;
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ public:
|
||||
|
||||
//-----------------------------
|
||||
Ref8U ref8;
|
||||
std::wstring hlinkClsid;
|
||||
std::wstring hlinkClsid = L"{79EAC9D0-BAF9-11CE-8C82-00AA004BA90B}";
|
||||
OSHARED::HyperlinkObject hyperlink;
|
||||
|
||||
|
||||
|
||||
@ -219,6 +219,8 @@ void Lbl::writeFields(CFRecord& record)
|
||||
SETBIT(flags, 14, fWorkbookParam)
|
||||
|
||||
unsigned char cch = Name_bin.getSize();
|
||||
if(!cch)
|
||||
Name_bin = L"";
|
||||
record << flags << chKey << cch;
|
||||
auto ccePos = record.getRdPtr();
|
||||
record.reserveNunBytes(4);
|
||||
@ -226,7 +228,8 @@ void Lbl::writeFields(CFRecord& record)
|
||||
_UINT16 itab_2b = itab;
|
||||
record << itab_2b;
|
||||
record.reserveNunBytes(4);
|
||||
record << Name_bin;
|
||||
if(cch)
|
||||
record << Name_bin;
|
||||
auto rgceStart = record.getRdPtr();
|
||||
rgce.save(record);
|
||||
|
||||
|
||||
@ -74,5 +74,14 @@ void List12::readFields(CFRecord& record)
|
||||
rgbList12->load(record);
|
||||
}
|
||||
|
||||
void List12::writeFields(CFRecord& record)
|
||||
{
|
||||
frtHeader.rt = 0x0877;
|
||||
record << frtHeader << lsd << idList;
|
||||
|
||||
if(rgbList12 != nullptr)
|
||||
rgbList12->save(record);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -49,12 +49,13 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeList12;
|
||||
|
||||
FrtHeader frtHeader;
|
||||
_UINT16 lsd;
|
||||
_UINT32 idList;
|
||||
_UINT16 lsd = 0;
|
||||
_UINT32 idList = 1;
|
||||
|
||||
BiffStructurePtr rgbList12;
|
||||
};
|
||||
|
||||
@ -148,7 +148,7 @@ int MarkerFormat::serialize(std::wostream & _stream, int index, BaseObjectPtr _G
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (false == fAuto || index < 0) ? rgbBack.strRGB : default_marker_color[index]);
|
||||
CP_XML_ATTR(L"val", (false == fAuto || index < 0 || index > default_marker_color->size()) ? rgbBack.strRGB : default_marker_color[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -158,7 +158,7 @@ int MarkerFormat::serialize(std::wostream & _stream, int index, BaseObjectPtr _G
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (false == fAuto || index < 0) ? rgbFore.strRGB : default_marker_color[index]);
|
||||
CP_XML_ATTR(L"val", (false == fAuto || index < 0 || index > default_marker_color->size()) ? rgbFore.strRGB : default_marker_color[index]);
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"a:prstDash") { CP_XML_ATTR(L"val", L"solid"); }
|
||||
|
||||
@ -65,6 +65,7 @@ void MergeCells::readFields(CFRecord& record)
|
||||
void MergeCells::writeFields(CFRecord& record)
|
||||
{
|
||||
cmcs = rgref.size();
|
||||
record << cmcs;
|
||||
for(auto i : rgref)
|
||||
record << *i;
|
||||
}
|
||||
|
||||
@ -32,6 +32,11 @@
|
||||
|
||||
#include "MsoDrawing.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtRecord.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFDG.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFSP.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFSPGR.h"
|
||||
#include "../Biff_structures/ODRAW/SimpleOfficeArtContainers.h"
|
||||
#include "../Biff_structures/ODRAW/OfficeArtFOPT.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -100,6 +105,12 @@ void MsoDrawing::readFields(CFRecord& record)
|
||||
}
|
||||
}
|
||||
|
||||
void MsoDrawing::writeFields(CFRecord& record)
|
||||
{
|
||||
rgChildRec.save(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MsoDrawing::useContinueRecords(CFRecord& record)
|
||||
{
|
||||
@ -123,6 +134,50 @@ const bool MsoDrawing::isEndingRecord(CFRecord& record)
|
||||
return ODRAW::OfficeArtDgContainer::CheckIfContainerSizeOK(record);
|
||||
}
|
||||
|
||||
void MsoDrawing::prepareComment(const unsigned int CommentId)
|
||||
{
|
||||
|
||||
auto spgrContainer = new ODRAW::OfficeArtSpgrContainer(ODRAW::OfficeArtRecord::CA_Sheet);
|
||||
rgChildRec.m_OfficeArtSpgrContainer = ODRAW::OfficeArtRecordPtr(spgrContainer);
|
||||
|
||||
{
|
||||
auto ShapeGroup = new ODRAW::OfficeArtSpContainer(ODRAW::OfficeArtRecord::CA_Sheet);
|
||||
auto groupFsp = new ODRAW::OfficeArtFSP;
|
||||
ShapeGroup->m_OfficeArtFSP = ODRAW::OfficeArtRecordPtr(groupFsp);
|
||||
groupFsp->shape_id = 0;
|
||||
groupFsp->fGroup = true;
|
||||
groupFsp->fPatriarch = true;
|
||||
groupFsp->spid = CommentId;
|
||||
|
||||
auto groupFSPGR = new ODRAW::OfficeArtFSPGR;
|
||||
ShapeGroup->m_OfficeArtFSPGR = ODRAW::OfficeArtRecordPtr(groupFSPGR);
|
||||
|
||||
spgrContainer->m_OfficeArtSpgrContainerFileBlock.push_back(ODRAW::OfficeArtContainerPtr(ShapeGroup));
|
||||
}
|
||||
|
||||
auto TextboxContainer = new ODRAW::OfficeArtSpContainer(ODRAW::OfficeArtRecord::CA_Sheet);
|
||||
|
||||
|
||||
auto fdgPtr = new ODRAW::OfficeArtFDG;
|
||||
fdgPtr->rh_own.recInstance = CommentId;
|
||||
fdgPtr->csp = 2;
|
||||
fdgPtr->spidCur = CommentId+1;
|
||||
rgChildRec.m_OfficeArtFDG = ODRAW::OfficeArtRecordPtr(fdgPtr);
|
||||
spgrContainer->m_OfficeArtSpgrContainerFileBlock.push_back(ODRAW::OfficeArtContainerPtr(TextboxContainer));
|
||||
|
||||
auto fsprPtr = new ODRAW::OfficeArtFSP;
|
||||
TextboxContainer->m_OfficeArtFSP = ODRAW::OfficeArtRecordPtr(fsprPtr);
|
||||
fsprPtr->shape_id = 0xCA;
|
||||
fsprPtr->spid = CommentId+1;
|
||||
fsprPtr->fHaveAnchor = true;
|
||||
fsprPtr->fHaveSpt = true;
|
||||
|
||||
|
||||
{
|
||||
//todo add mandatory optrions writing
|
||||
//auto textboxOpt = new ODRAW::OfficeArtFOPT;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -50,6 +50,7 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields (CFRecord& record);
|
||||
void writeFields (CFRecord& record);
|
||||
void readFields ();
|
||||
|
||||
void resetToBegin ();
|
||||
@ -60,6 +61,8 @@ public:
|
||||
virtual const bool isEndingRecord (CFRecord& record);
|
||||
virtual void useContinueRecords (CFRecord& record);
|
||||
|
||||
void prepareComment (const unsigned int CommentId);
|
||||
|
||||
//-----------------------------
|
||||
ODRAW::OfficeArtDgContainer rgChildRec;
|
||||
|
||||
|
||||
@ -332,5 +332,39 @@ void Obj::readFields(CFRecord& record)
|
||||
|
||||
}
|
||||
|
||||
void Obj::writeFields(CFRecord& record)
|
||||
{
|
||||
record << cmo;
|
||||
if(cmo.ot == 0x08)
|
||||
record << pictFormat << pictFlags;
|
||||
else if((cmo.ot >= 0x10 && cmo.ot <= 0x12) || cmo.ot == 0x14)
|
||||
record << sbs;
|
||||
else if(cmo.ot == 0x19)
|
||||
record << nts;
|
||||
record << macro;
|
||||
if(cmo.ot == 0x08)
|
||||
record << pictFmla;
|
||||
if(cmo.ot== 0x0B || cmo.ot == 0x0C || (cmo.ot >= 0x10 && cmo.ot <= 0x12) || cmo.ot == 0x14)
|
||||
{
|
||||
if(cmo.ot== 0x0B || cmo.ot == 0x0C)
|
||||
linkFmla.ft = 0x0B;
|
||||
else
|
||||
linkFmla.ft = 0x0E;
|
||||
record << linkFmla;
|
||||
}
|
||||
if(cmo.ot== 0x0B || cmo.ot == 0x0C)
|
||||
record << checkBox;
|
||||
if(cmo.ot == 0x0C)
|
||||
record << radioButton;
|
||||
else if(cmo.ot == 0x0D)
|
||||
record << edit;
|
||||
else if(cmo.ot == 0x12 || cmo.ot == 0x14)
|
||||
list.save(record, cmo.ot);
|
||||
else if(cmo.ot == 0x13)
|
||||
record << gbo;
|
||||
if(cmo.ot != 0x12 && cmo.ot != 0x14)
|
||||
record.reserveNunBytes(4);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -65,6 +65,7 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeObj;
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ void Palette::writeFields(CFRecord& record)
|
||||
record << ccv;
|
||||
for(auto i: rgColor)
|
||||
if(i != nullptr)
|
||||
record << i;
|
||||
i->save(record);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -55,12 +55,12 @@ public:
|
||||
|
||||
static const ElementType type = typePane;
|
||||
|
||||
_UINT16 x;
|
||||
_UINT16 y;
|
||||
_UINT16 x = 0;
|
||||
_UINT16 y = 0;
|
||||
//_UINT16 rwTop;
|
||||
UncheckedRw rwTop;
|
||||
UncheckedRw rwTop = 0;
|
||||
//_UINT16 colLeft;
|
||||
UncheckedCol colLeft;
|
||||
UncheckedCol colLeft = 0;
|
||||
PaneType pnnAcct; //4 byte in biff12
|
||||
|
||||
std::wstring topLeftCell;
|
||||
@ -68,9 +68,9 @@ public:
|
||||
//biff12
|
||||
Xnum xnumXSplit;
|
||||
Xnum xnumYSplit;
|
||||
bool fFrozen;
|
||||
bool fFrozenNoSplit;
|
||||
_UINT32 pnnAcct_xlsb;
|
||||
bool fFrozen = false;
|
||||
bool fFrozenNoSplit = false;
|
||||
_UINT32 pnnAcct_xlsb = 0;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -54,14 +54,14 @@ public:
|
||||
static const ElementType type = typeQsiSXTag;
|
||||
|
||||
FrtHeaderOld frtHeaderOld;
|
||||
unsigned short fSx = 0;
|
||||
unsigned short fSx = 1;
|
||||
|
||||
bool fEnableRefresh = false;
|
||||
bool fEnableRefresh = true;
|
||||
bool fInvalid = false;
|
||||
bool fTensorEx = false;
|
||||
|
||||
_UINT32 dwQsiFuture = 0;
|
||||
unsigned char verSxLastUpdated = 0;
|
||||
unsigned char verSxLastUpdated = 1;
|
||||
unsigned char verSxUpdatableMin = 0;
|
||||
|
||||
unsigned char obCchName = 0x10;
|
||||
|
||||
@ -151,6 +151,10 @@ void Row::writeFields(CFRecord& record)
|
||||
_UINT16 rel_offset = 0xffff, flags1 = 0, flags2 = 0;
|
||||
record.reserveNunBytes(2);// unused1
|
||||
|
||||
if(ixfe_val != 0)
|
||||
{
|
||||
ixfe_val += global_info_->cellStyleXfs_count;
|
||||
}
|
||||
if (ixfe_val != 0xffff)
|
||||
ixfe_val_2b = ixfe_val;
|
||||
|
||||
|
||||
@ -46,6 +46,15 @@ void XLUnicodeStringSegmentedSXADDL::load(CFRecord& record)
|
||||
|
||||
record >> string;
|
||||
}
|
||||
|
||||
void XLUnicodeStringSegmentedSXADDL::save(CFRecord& record)
|
||||
{
|
||||
cchTotal = string.getSize();
|
||||
record << cchTotal;
|
||||
record.reserveNunBytes(2);
|
||||
record << string;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
SXAddl::SXAddl() : bEndElement(false), bStartElement(false)
|
||||
@ -103,6 +112,15 @@ void SXAddl::readFields(CFRecord& record)
|
||||
}
|
||||
|
||||
}
|
||||
void SXAddl::writeFields(CFRecord& record)
|
||||
{
|
||||
record << frtHeaderOld << sxc << sxd;
|
||||
if(content != nullptr)
|
||||
content->save(record);
|
||||
else if(bEndElement)
|
||||
record.reserveNunBytes(6);
|
||||
}
|
||||
|
||||
BiffStructurePtr SXAddl::createSxcView(CFRecord& record)
|
||||
{
|
||||
BiffStructurePtr result;
|
||||
@ -383,6 +401,11 @@ void SXAddl_SXCView_SXDId::load(CFRecord& record)
|
||||
{
|
||||
record >> stName;
|
||||
}
|
||||
void SXAddl_SXCView_SXDId::save(CFRecord& record)
|
||||
{
|
||||
record << stName;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCQsi_SXDId::clone()
|
||||
{
|
||||
@ -416,6 +439,25 @@ void SXAddl_SXCView_SXDVer10Info::load(CFRecord& record)
|
||||
fTensorFillCv = GETBIT(flags, 7);
|
||||
fHideDDData = GETBIT(flags, 8);
|
||||
}
|
||||
|
||||
void SXAddl_SXCView_SXDVer10Info::save(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
|
||||
SETBIT(flags, 0, fDisplayImmediateItems)
|
||||
SETBIT(flags, 1, fEnableDataEd)
|
||||
SETBIT(flags, 2, fDisableFList)
|
||||
SETBIT(flags, 3, fReenterOnLoadOnce)
|
||||
SETBIT(flags, 4, fNotViewCalculatedMembers)
|
||||
SETBIT(flags, 5, fNotVisualTotals)
|
||||
SETBIT(flags, 6, fPageMultipleItemLabel)
|
||||
SETBIT(flags, 7, fTensorFillCv)
|
||||
SETBIT(flags, 8, fHideDDData)
|
||||
|
||||
record << bVerSxMacro << flags;
|
||||
record.reserveNunBytes(3);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCView_SXDVer12Info::clone()
|
||||
{
|
||||
@ -538,6 +580,14 @@ void SXAddl_SXCCache_SXDVer10Info::load(CFRecord& record)
|
||||
|
||||
record >> reserved2;
|
||||
}
|
||||
void SXAddl_SXCCache_SXDVer10Info::save(CFRecord& record)
|
||||
{
|
||||
record.reserveNunBytes(6);
|
||||
record << citmGhostMax << bVerCacheLastRefresh << bVerCacheRefreshableMin;
|
||||
for (int i = 0; i < 8; i++)
|
||||
record << numDateCopy[i];
|
||||
record.reserveNunBytes(2);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCache_SXDVerUpdInv::clone()
|
||||
{
|
||||
@ -634,6 +684,20 @@ void SXAddl_SXCView_SXDTableStyleClient::load(CFRecord& record)
|
||||
fColumnHeaders = GETBIT(flags, 5);
|
||||
fDefaultStyle = GETBIT(flags, 6);
|
||||
}
|
||||
|
||||
void SXAddl_SXCView_SXDTableStyleClient::save(CFRecord& record)
|
||||
{
|
||||
record.reserveNunBytes(6);
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 1, fLastColumn)
|
||||
SETBIT(flags, 2, fRowStrips)
|
||||
SETBIT(flags, 3, fColumnStrips)
|
||||
SETBIT(flags, 4, fRowHeaders)
|
||||
SETBIT(flags, 5, fColumnHeaders)
|
||||
SETBIT(flags, 6, fDefaultStyle)
|
||||
record << flags << stName;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCacheField_SXDSxrmitmCount::clone()
|
||||
{
|
||||
|
||||
@ -49,10 +49,11 @@ public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeStringSegmentedSXADDL;
|
||||
|
||||
_UINT32 cchTotal;
|
||||
_UINT32 cchTotal = 0;
|
||||
XLUnicodeString string;
|
||||
};
|
||||
|
||||
@ -66,15 +67,16 @@ public:
|
||||
|
||||
virtual BaseObjectPtr clone();
|
||||
virtual void readFields(CFRecord& record);
|
||||
virtual void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
bool bStartElement;
|
||||
bool bEndElement;
|
||||
bool bStartElement = false;
|
||||
bool bEndElement = false;
|
||||
|
||||
_UINT32 frtHeaderOld;
|
||||
unsigned char sxc;
|
||||
unsigned char sxd;
|
||||
_UINT32 frtHeaderOld = 0x0864;
|
||||
unsigned char sxc = 0;
|
||||
unsigned char sxd = 0;
|
||||
BiffStructurePtr content;
|
||||
private:
|
||||
BiffStructurePtr createSxcView (CFRecord& record);
|
||||
@ -171,6 +173,7 @@ public:
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stName;
|
||||
};
|
||||
@ -199,15 +202,16 @@ public:
|
||||
~SXAddl_SXCView_SXDTableStyleClient(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
bool fLastColumn;
|
||||
bool fRowStrips;
|
||||
bool fColumnStrips;
|
||||
bool fRowHeaders;
|
||||
bool fColumnHeaders;
|
||||
bool fDefaultStyle;
|
||||
bool fLastColumn = false;
|
||||
bool fRowStrips = false;
|
||||
bool fColumnStrips = false;
|
||||
bool fRowHeaders = false;
|
||||
bool fColumnHeaders = false;
|
||||
bool fDefaultStyle = false;
|
||||
|
||||
LPWideString stName;
|
||||
};
|
||||
@ -289,12 +293,13 @@ public:
|
||||
~SXAddl_SXCCache_SXDVer10Info(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
_INT32 citmGhostMax;
|
||||
unsigned char bVerCacheLastRefresh;
|
||||
unsigned char bVerCacheRefreshableMin;
|
||||
_INT32 citmGhostMax = 0;
|
||||
unsigned char bVerCacheLastRefresh = 0;
|
||||
unsigned char bVerCacheRefreshableMin = 0;
|
||||
|
||||
unsigned char numDateCopy[8];
|
||||
};
|
||||
@ -464,19 +469,20 @@ public:
|
||||
~SXAddl_SXCView_SXDVer10Info(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
virtual void save(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
unsigned char bVerSxMacro;
|
||||
bool fDisplayImmediateItems;
|
||||
bool fEnableDataEd;
|
||||
bool fDisableFList;
|
||||
bool fReenterOnLoadOnce;
|
||||
bool fNotViewCalculatedMembers;
|
||||
bool fNotVisualTotals;
|
||||
bool fPageMultipleItemLabel;
|
||||
bool fTensorFillCv;
|
||||
bool fHideDDData;
|
||||
unsigned char bVerSxMacro = 0;
|
||||
bool fDisplayImmediateItems = false;
|
||||
bool fEnableDataEd = false;
|
||||
bool fDisableFList = false;
|
||||
bool fReenterOnLoadOnce = false;
|
||||
bool fNotViewCalculatedMembers = false;
|
||||
bool fNotVisualTotals = false;
|
||||
bool fPageMultipleItemLabel = false;
|
||||
bool fTensorFillCv = false;
|
||||
bool fHideDDData = false;
|
||||
};
|
||||
class SXAddl_SXCView_SXDVer12Info: public BiffStructure
|
||||
{
|
||||
|
||||
@ -67,5 +67,27 @@ void SXDB::readFields(CFRecord& record)
|
||||
fEnableRefresh = GETBIT(flags, 5);
|
||||
}
|
||||
|
||||
void SXDB::writeFields(CFRecord& record)
|
||||
{
|
||||
cchWho = rgb.getSize();
|
||||
if(!cchWho)
|
||||
cchWho = 0xFFFF;
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fSaveData)
|
||||
SETBIT(flags, 1, fInvalid)
|
||||
SETBIT(flags, 2, fRefreshOnLoad)
|
||||
SETBIT(flags, 3, fOptimizeCache)
|
||||
SETBIT(flags, 4, fBackgroundQuery)
|
||||
SETBIT(flags, 5, fEnableRefresh)
|
||||
record << crdbdb << idstm << flags;
|
||||
record.reserveNunBytes(2);
|
||||
record << cfdbdb << cfdbTot << crdbUsed << vsType << cchWho;
|
||||
|
||||
if (cchWho > 0 && cchWho < 0xffff)
|
||||
{
|
||||
record << rgb;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,23 +48,24 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXDB;
|
||||
|
||||
_INT32 crdbdb;
|
||||
unsigned short idstm;
|
||||
bool fSaveData;
|
||||
bool fInvalid;
|
||||
bool fRefreshOnLoad;
|
||||
bool fOptimizeCache;
|
||||
bool fBackgroundQuery;
|
||||
bool fEnableRefresh;
|
||||
_INT32 crdbdb = 0;
|
||||
unsigned short idstm = 0;
|
||||
bool fSaveData = false;
|
||||
bool fInvalid = false;
|
||||
bool fRefreshOnLoad = false;
|
||||
bool fOptimizeCache = false;
|
||||
bool fBackgroundQuery = false;
|
||||
bool fEnableRefresh = false;
|
||||
|
||||
short cfdbdb;
|
||||
short cfdbTot;
|
||||
unsigned short crdbUsed;
|
||||
short vsType;
|
||||
unsigned short cchWho;
|
||||
short cfdbdb = 0;
|
||||
short cfdbTot = 0;
|
||||
unsigned short crdbUsed = 0;
|
||||
short vsType = 1;
|
||||
unsigned short cchWho = 0xFFFF;
|
||||
XLUnicodeStringNoCch rgb;
|
||||
|
||||
};
|
||||
|
||||
@ -61,5 +61,11 @@ void SXDBB::readFields(CFRecord& record)
|
||||
record.skipNunBytes(size);
|
||||
}
|
||||
|
||||
void SXDBB::writeFields(CFRecord& record)
|
||||
{
|
||||
if(size && blob)
|
||||
record.appendRawDataToStatic(blob.get(), size);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,11 +47,12 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXDBB;
|
||||
|
||||
boost::shared_array<unsigned char> blob;
|
||||
unsigned int size;
|
||||
unsigned int size = 0;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -54,5 +54,10 @@ void SXDBEx::readFields(CFRecord& record)
|
||||
record >> numDate >> cSxFormula;
|
||||
}
|
||||
|
||||
void SXDBEx::writeFields(CFRecord& record)
|
||||
{
|
||||
record << numDate << cSxFormula;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,11 +48,12 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXDBEx;
|
||||
|
||||
DateAsNum numDate;
|
||||
_UINT32 cSxFormula; //count formulas
|
||||
_UINT32 cSxFormula = 0; //count formulas
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "SXDtr.h"
|
||||
#include "../../../../../OOXML/Binary/Sheets/Reader/CellFormatController/DateReader.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -52,6 +53,11 @@ void SXDtr::readFields(CFRecord& record)
|
||||
{
|
||||
record >> yr >> mon >> dom >> hr >> min >> sec;
|
||||
}
|
||||
|
||||
void SXDtr::writeFields(CFRecord& record)
|
||||
{
|
||||
record << yr << mon << dom << hr << min << sec;
|
||||
}
|
||||
|
||||
std::wstring SXDtr::value()
|
||||
{
|
||||
@ -67,5 +73,20 @@ std::wstring SXDtr::value()
|
||||
return s.str();
|
||||
}
|
||||
|
||||
void SXDtr::fromString(const std::wstring &strDate)
|
||||
{
|
||||
DateReader reader;
|
||||
tm dateTime;
|
||||
if(reader.parseIsoDate(strDate, dateTime))
|
||||
{
|
||||
yr = dateTime.tm_year + 1900;
|
||||
mon = dateTime.tm_mon + 1;
|
||||
dom = dateTime.tm_mday + 1;
|
||||
hr = dateTime.tm_hour;
|
||||
min = dateTime.tm_min;
|
||||
sec = dateTime.tm_sec;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,17 +47,19 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXDtr;
|
||||
|
||||
unsigned short yr;
|
||||
unsigned short mon;
|
||||
unsigned char dom;
|
||||
unsigned char hr;
|
||||
unsigned char min;
|
||||
unsigned char sec;
|
||||
unsigned short yr = 0;
|
||||
unsigned short mon = 0;
|
||||
unsigned char dom = 0;
|
||||
unsigned char hr = 0;
|
||||
unsigned char min = 0;
|
||||
unsigned char sec = 0;
|
||||
|
||||
std::wstring value();
|
||||
void fromString(const std::wstring &strDate);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -108,9 +108,12 @@ void SXEx::readFields(CFRecord& record)
|
||||
|
||||
void SXEx::writeFields(CFRecord& record)
|
||||
{
|
||||
cchErrorString = stError.getSize();
|
||||
cchNullString = stDisplayNull.getSize();
|
||||
cchTag = stTag.getSize();
|
||||
if(stError.getSize())
|
||||
cchErrorString = stError.getSize();
|
||||
if(stDisplayNull.getSize())
|
||||
cchNullString = stDisplayNull.getSize();
|
||||
if(stTag.getSize())
|
||||
cchTag = stTag.getSize();
|
||||
record << csxformat << cchErrorString << cchNullString << cchTag << csxselect;
|
||||
_UINT32 flags = 0;
|
||||
SETBIT(flags, 0, fAcrossPageLay)
|
||||
@ -124,10 +127,12 @@ void SXEx::writeFields(CFRecord& record)
|
||||
SETBIT(flags, 22, fDisplayNullString)
|
||||
SETBIT(flags, 23, fSubtotalHiddenPageItems)
|
||||
record << crwPage << ccolPage << flags;
|
||||
|
||||
cchPageFieldStyle = stPageFieldStyle.getSize();
|
||||
cchTableStyle = stTableStyle.getSize();
|
||||
cchVacateStyle = stVacateStyle.getSize();
|
||||
if(stPageFieldStyle.getSize())
|
||||
cchPageFieldStyle = stPageFieldStyle.getSize();
|
||||
if(stTableStyle.getSize())
|
||||
cchTableStyle = stTableStyle.getSize();
|
||||
if(stVacateStyle.getSize())
|
||||
cchVacateStyle = stVacateStyle.getSize();
|
||||
record << cchPageFieldStyle << cchTableStyle << cchVacateStyle;
|
||||
if (cchErrorString > 0 && cchErrorString != 0xffff)
|
||||
{
|
||||
|
||||
@ -64,18 +64,18 @@ public:
|
||||
|
||||
bool fAcrossPageLay = false;
|
||||
unsigned char cWrapPage = 0;
|
||||
bool fEnableWizard = false;
|
||||
bool fEnableDrilldown = false;
|
||||
bool fEnableFieldDialog = false;
|
||||
bool fPreserveFormatting = false;
|
||||
bool fMergeLabels = false;
|
||||
bool fDisplayErrorString = false;
|
||||
bool fDisplayNullString = false;
|
||||
bool fSubtotalHiddenPageItems = false;
|
||||
bool fEnableWizard = true;
|
||||
bool fEnableDrilldown = true;
|
||||
bool fEnableFieldDialog = true;
|
||||
bool fPreserveFormatting = true;
|
||||
bool fMergeLabels = false;
|
||||
bool fDisplayErrorString = false;
|
||||
bool fDisplayNullString = true;
|
||||
bool fSubtotalHiddenPageItems = false;
|
||||
|
||||
unsigned short cchPageFieldStyle = 0;
|
||||
unsigned short cchTableStyle = 0;
|
||||
unsigned short cchVacateStyle = 0;
|
||||
unsigned short cchPageFieldStyle = 0xFFFF;
|
||||
unsigned short cchTableStyle = 0xFFFF;
|
||||
unsigned short cchVacateStyle = 0xFFFF;
|
||||
|
||||
XLUnicodeStringNoCch stError;
|
||||
XLUnicodeStringNoCch stDisplayNull;
|
||||
|
||||
@ -76,5 +76,28 @@ void SXFDB::readFields(CFRecord& record)
|
||||
global_info->arPivotCacheFields.push_back(fAllAtoms);
|
||||
}
|
||||
|
||||
void SXFDB::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
|
||||
SETBIT(flags, 0, fAllAtoms)
|
||||
SETBIT(flags, 1, fSomeUnhashed)
|
||||
SETBIT(flags, 2, fUsed)
|
||||
SETBIT(flags, 3, fHasParent)
|
||||
SETBIT(flags, 4, fRangeGroup)
|
||||
SETBIT(flags, 5, fNumField)
|
||||
SETBIT(flags, 7, fTextEtcField)
|
||||
SETBIT(flags, 8, fnumMinMaxValid)
|
||||
SETBIT(flags, 9, fShortIitms)
|
||||
SETBIT(flags, 10, fNonDates)
|
||||
SETBIT(flags, 11, fDateInField)
|
||||
SETBIT(flags, 13, fServerBased)
|
||||
SETBIT(flags, 14, fCantGetUniqueItems)
|
||||
SETBIT(flags, 15, fCalculatedField)
|
||||
|
||||
record << flags << ifdbParent << ifdbBase << citmUnq << csxoper << cisxoper << catm;
|
||||
record << stFieldName;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,29 +48,30 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXFDB;
|
||||
|
||||
bool fAllAtoms;
|
||||
bool fSomeUnhashed;
|
||||
bool fUsed;
|
||||
bool fHasParent;
|
||||
bool fRangeGroup;
|
||||
bool fNumField;
|
||||
bool fTextEtcField;
|
||||
bool fnumMinMaxValid;
|
||||
bool fShortIitms;
|
||||
bool fNonDates;
|
||||
bool fDateInField;
|
||||
bool fServerBased;
|
||||
bool fCantGetUniqueItems;
|
||||
bool fCalculatedField;
|
||||
unsigned short ifdbParent;
|
||||
unsigned short ifdbBase;
|
||||
unsigned short citmUnq;
|
||||
unsigned short csxoper;
|
||||
unsigned short cisxoper;
|
||||
unsigned short catm;
|
||||
bool fAllAtoms = false;
|
||||
bool fSomeUnhashed = false;
|
||||
bool fUsed = false;
|
||||
bool fHasParent = false;
|
||||
bool fRangeGroup = false;
|
||||
bool fNumField = false;
|
||||
bool fTextEtcField = false;
|
||||
bool fnumMinMaxValid = false;
|
||||
bool fShortIitms = false;
|
||||
bool fNonDates = false;
|
||||
bool fDateInField = false;
|
||||
bool fServerBased = false;
|
||||
bool fCantGetUniqueItems = false;
|
||||
bool fCalculatedField = false;
|
||||
unsigned short ifdbParent = 0;
|
||||
unsigned short ifdbBase = 0;
|
||||
unsigned short citmUnq = 0;
|
||||
unsigned short csxoper = 0;
|
||||
unsigned short cisxoper = 0;
|
||||
unsigned short catm = 0;
|
||||
XLUnicodeString stFieldName;
|
||||
};
|
||||
|
||||
|
||||
@ -54,5 +54,10 @@ void SXFDBType::readFields(CFRecord& record)
|
||||
record >> wTypeSql;
|
||||
}
|
||||
|
||||
void SXFDBType::writeFields(CFRecord& record)
|
||||
{
|
||||
record << wTypeSql;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,10 +47,11 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXFDBType;
|
||||
|
||||
short wTypeSql; //ODBCType enum
|
||||
short wTypeSql = 0; //ODBCType enum
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -56,5 +56,11 @@ void SXFormula::readFields(CFRecord& record)
|
||||
record >> reserved >> ifdb;
|
||||
}
|
||||
|
||||
void SXFormula::writeFields(CFRecord& record)
|
||||
{
|
||||
record.reserveNunBytes(2);
|
||||
record << ifdb;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -47,10 +47,11 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXFormula;
|
||||
|
||||
short ifdb;
|
||||
short ifdb = 0;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -104,7 +104,6 @@ void SXLIItem::save(CFRecord& record)
|
||||
SETBIT(flags, 10, fBlock)
|
||||
SETBIT(flags, 11, fGrand)
|
||||
SETBIT(flags, 12, fMultiDataOnAxis)
|
||||
cSic = rgisxvi.size();
|
||||
if (fGrand)
|
||||
isxviMac = 1;
|
||||
record << cSic << itmType << isxviMac << flags;
|
||||
|
||||
@ -47,7 +47,7 @@ namespace XLS
|
||||
bool fSbt = 0;
|
||||
bool fBlock = 0;
|
||||
bool fGrand = 0;
|
||||
bool fMultiDataOnAxis = 0;
|
||||
bool fMultiDataOnAxis = true;
|
||||
|
||||
std::vector<short> rgisxvi;
|
||||
};
|
||||
|
||||
@ -53,5 +53,10 @@ void SXNum::readFields(CFRecord& record)
|
||||
record >> num;
|
||||
}
|
||||
|
||||
void SXNum::writeFields(CFRecord& record)
|
||||
{
|
||||
record << num;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXNum;
|
||||
|
||||
|
||||
@ -60,5 +60,16 @@ void SXPair::readFields(CFRecord& record)
|
||||
fRelative = GETBIT(flags, 4);
|
||||
}
|
||||
|
||||
void SXPair::writeFields(CFRecord& record)
|
||||
{
|
||||
record << isxvd << iCache;
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fFormula)
|
||||
SETBIT(flags, 3, fPhysical)
|
||||
SETBIT(flags, 4, fRelative)
|
||||
record.reserveNunBytes(2);
|
||||
record << flags;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,15 +48,16 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXPair;
|
||||
|
||||
unsigned short isxvd;
|
||||
short iCache;
|
||||
unsigned short isxvd = 0;
|
||||
short iCache = 0;
|
||||
|
||||
bool fFormula;
|
||||
bool fPhysical;
|
||||
bool fRelative;
|
||||
bool fFormula = false;
|
||||
bool fPhysical = false;
|
||||
bool fRelative = false;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -60,5 +60,14 @@ void SXRng::readFields(CFRecord& record)
|
||||
iByType = GETBITS(flags, 2, 4);
|
||||
}
|
||||
|
||||
void SXRng::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
SETBIT(flags, 0, fAutoStart)
|
||||
SETBIT(flags, 1, fAutoEnd)
|
||||
SETBITS(flags, 2, 4, iByType)
|
||||
record << flags;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,12 +48,13 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXRng;
|
||||
|
||||
bool fAutoStart;
|
||||
bool fAutoEnd;
|
||||
unsigned char iByType;
|
||||
bool fAutoStart = false;
|
||||
bool fAutoEnd = false;
|
||||
unsigned char iByType = 0;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -51,7 +51,7 @@ public:
|
||||
|
||||
static const ElementType type = typeSXStreamID;
|
||||
|
||||
short idStm = 0;
|
||||
short idStm = 1;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -122,6 +122,12 @@ void SXVDEx::writeFields(CFRecord& record)
|
||||
record.reserveNunBytes(8);
|
||||
record << stSubName;
|
||||
}
|
||||
else
|
||||
{
|
||||
cchSubName = 0xffff;
|
||||
record << cchSubName;
|
||||
record.reserveNunBytes(8);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,26 +53,26 @@ public:
|
||||
static const ElementType type = typeSXVDEx;
|
||||
|
||||
bool fShowAllItems = false;
|
||||
bool fDragToRow = false;
|
||||
bool fDragToColumn = false;
|
||||
bool fDragToPage = false;
|
||||
bool fDragToHide = false;
|
||||
bool fDragToRow = true;
|
||||
bool fDragToColumn = true;
|
||||
bool fDragToPage = true;
|
||||
bool fDragToHide = true;
|
||||
bool fNotDragToData = false;
|
||||
bool fServerBased = false;
|
||||
bool fAutoSort = false;
|
||||
bool fAscendSort = false;
|
||||
bool fAutoShow = false;
|
||||
bool fTopAutoShow = false;
|
||||
bool fTopAutoShow = true;
|
||||
bool fCalculatedField = false;
|
||||
bool fPageBreaksBetweenItems = false;
|
||||
bool fHideNewItems = false;
|
||||
bool fOutline = false;
|
||||
bool fOutline = true;
|
||||
bool fInsertBlankRow = false;
|
||||
bool fSubtotalAtTop = false;
|
||||
bool fSubtotalAtTop = true;
|
||||
|
||||
unsigned char citmAutoShow = 0;
|
||||
short isxdiAutoSort = 0;
|
||||
short isxdiAutoShow = 0;
|
||||
unsigned char citmAutoShow = 10;
|
||||
short isxdiAutoSort = -1;
|
||||
short isxdiAutoShow = -1;
|
||||
unsigned short ifmt = 0;
|
||||
unsigned short cchSubName = 0;
|
||||
XLUnicodeStringNoCch stSubName;
|
||||
|
||||
@ -76,6 +76,8 @@ void SXVI::writeFields(CFRecord& record)
|
||||
SETBIT(flags, 3, fFormula)
|
||||
SETBIT(flags, 4, fMissing)
|
||||
cchName = stName.getSize();
|
||||
if(cchName == 0)
|
||||
cchName = 0xFFFF;
|
||||
|
||||
record << itmType << flags << iCache << cchName;
|
||||
if (cchName > 0 && cchName < 0xFFFF)
|
||||
|
||||
@ -73,7 +73,7 @@ public:
|
||||
bool fFormula = false;
|
||||
bool fMissing = false;
|
||||
|
||||
short iCache = 0;
|
||||
short iCache = -1;
|
||||
unsigned short cchName = 0;
|
||||
XLUnicodeStringNoCch stName;
|
||||
|
||||
|
||||
@ -64,5 +64,18 @@ void SXViewEx9::readFields(CFRecord& record)
|
||||
fRepeatItemsOnEachPrintedPage = GETBIT(flags2, 5);
|
||||
}
|
||||
|
||||
void SXViewEx9::writeFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags = 0;
|
||||
_UINT32 flags2 = 0;
|
||||
SETBIT(flags, 1, fFrtAlert)
|
||||
SETBIT(flags2, 1, fPrintTitles)
|
||||
SETBIT(flags2, 2, fLineMode)
|
||||
SETBIT(flags2, 5, fRepeatItemsOnEachPrintedPage)
|
||||
record << rt << flags;
|
||||
record.reserveNunBytes(4);
|
||||
record << flags2 << itblAutoFmt << chGrand;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -48,15 +48,16 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
void writeFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXViewEx9;
|
||||
|
||||
unsigned short rt;
|
||||
bool fFrtAlert;
|
||||
bool fPrintTitles;
|
||||
bool fLineMode;
|
||||
bool fRepeatItemsOnEachPrintedPage;
|
||||
unsigned short itblAutoFmt;
|
||||
unsigned short rt = 0x0810;
|
||||
bool fFrtAlert = true;
|
||||
bool fPrintTitles = false;
|
||||
bool fLineMode = false;
|
||||
bool fRepeatItemsOnEachPrintedPage = false;
|
||||
unsigned short itblAutoFmt = 1;
|
||||
XLUnicodeString chGrand;
|
||||
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user