Compare commits

..

53 Commits

Author SHA1 Message Date
2206b3b366 Remove unused code 2017-12-18 16:43:12 +03:00
a2d37e8a22 OdfFormaReader - fix 3d charts with 2 axis 2017-12-16 16:24:51 +03:00
b13eba5f01 x2t optimization rels 2017-12-15 17:05:47 +03:00
a48058c7d5 merge from 5.0.7 2017-12-15 14:52:11 +03:00
ab76aff379 . 2017-12-15 14:49:54 +03:00
b8b8a14268 fix bug 36524 (fix MathType equation) 2017-12-15 14:47:57 +03:00
e5ef749718 . 2017-12-15 12:24:35 +03:00
5d524369b8 . 2017-12-14 19:31:33 +03:00
e78fc0befc x2t - fix users files 2017-12-14 16:46:29 +03:00
d9986d09cd x2t - fix users file 2017-12-13 19:15:13 +03:00
bd67f4bf1c . 2017-12-13 15:13:37 +03:00
475bfaf93d Merge remote-tracking branch 'origin/hotfix/v5.0.7' into develop 2017-12-13 15:12:19 +03:00
1a8af4d8ed x2t - fix users file 2017-12-13 15:11:16 +03:00
cdf8dc7a4c Changed cef update condition 2017-12-13 12:55:54 +03:00
d71552bddd Merge remote-tracking branch 'origin/hotfix/v5.0.7' into develop
# Conflicts:
#	ASCOfficeDocFile/DocFormatTest/DocFormatTest.cpp
2017-12-13 12:40:08 +03:00
548c5ab608 x2t - fix users files 2017-12-13 11:59:49 +03:00
6a01384023 . 2017-12-13 00:01:15 +03:00
d70f36e36d DocFormat - fix users files 2017-12-12 19:41:50 +03:00
f65984f079 . 2017-12-12 19:41:16 +03:00
5b48a7a330 DocFormat - fix users file, add data form field 2017-12-12 19:10:08 +03:00
1496aece57 v8 (mac os) 2017-12-12 19:06:09 +03:00
60cf51ad0d Move ASCDOCUMENTSCORE to separated target 2017-12-12 16:30:44 +03:00
8e7231b322 removed unused code 2017-12-12 12:43:33 +03:00
2b339b6842 Cherrypick from develop 2017-12-12 12:43:03 +03:00
fb0dbfc231 Cherrypick from develop 2017-12-12 12:40:28 +03:00
756613e883 Merge pull request #56 from ONLYOFFICE/hotfix/v5.0.7
for b599a6bc43 to fix build error
2017-12-11 20:17:01 +03:00
ede03fafea for b599a6bc43 to fix build error 2017-12-11 19:52:44 +03:00
bdec91bfd5 Merge remote-tracking branch 'origin/hotfix/v5.0.7' into develop 2017-12-11 18:44:50 +03:00
260c2edd21 . 2017-12-11 18:42:11 +03:00
3eeec8fc67 RtfFormat - fix users file 2017-12-11 18:39:37 +03:00
ba6c7e8151 Merge remote-tracking branch 'origin/feature/v5.0.7.1' into develop 2017-12-11 14:05:03 +03:00
41a213491e fix image content type 2017-12-11 13:45:28 +03:00
b599a6bc43 Add open/save JsaProject.bin for OnlyOffice Macros 2017-12-11 13:31:48 +03:00
a0fd139027 Merge pull request #55 from ONLYOFFICE/feature/v5.0.7.1
Feature/v5.0.7.1
2017-12-06 18:54:01 +03:00
48852bc618 removed unused code 2017-12-06 18:51:58 +03:00
20b781cb7e pdf checker bug 2017-12-06 18:50:09 +03:00
704b3b709f update cef if newer version exist 2017-12-06 18:21:58 +03:00
e4674915c2 Update cef if exist newer version 2017-12-06 17:19:46 +03:00
51fe936e5f ... 2017-12-06 12:18:06 +03:00
d8b177411f x2t - options for check macro in file 2017-12-05 16:56:50 +03:00
717b628055 ... 2017-12-05 14:37:10 +03:00
e4f94646b6 x2t version up 2017-12-05 10:54:43 +03:00
dcec7447e4 XlsFormat - apply theme style from format office 2010 and later 2017-12-04 19:24:27 +03:00
5f12552f78 XlsFormat - theme 2017-12-03 16:09:35 +03:00
d293769c1f XlsFormat .. 2017-12-02 17:31:10 +03:00
b45e772a50 remove stub for hyperlink without link 2017-12-01 18:34:04 +03:00
fdb7716abc builder error (save to pdf & open file by url) 2017-12-01 14:23:21 +03:00
f72d6dfe0e XlsFormat-... 2017-11-30 20:04:08 +03:00
23029a6a92 Change cef number 2017-11-30 16:28:48 +03:00
eda8e4d13f add c_oSerCellTypes::ValueText for cell value; Read1 error with empty length 2017-11-30 14:18:46 +03:00
64f578e59f XlsFormat - ... 2017-11-29 19:32:21 +03:00
16c57b50cc XlsFormat - table parts 2017-11-29 14:48:02 +03:00
e7bbbec0de v5.0.5 2017-11-27 17:06:49 +03:00
254 changed files with 14527 additions and 2245 deletions

View File

@ -559,7 +559,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteString(elem.GetXMLString());
}
else if (TextMark::FieldBeginMark == code)
{
{//todooo в отдельный mapping
int cpFieldStart = initialCp + i;
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
@ -599,20 +599,38 @@ namespace DocFileFormat
if ( bFORM )
{
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
std::wstring FORMTEXT ( L" FORMTEXT" );
std::wstring FORMCHECKBOX ( L" FORMCHECKBOX" );
std::wstring FORMDROPDOWN ( L" FORMDROPDOWN" );
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
m_pXmlWriter->WriteAttribute( L"w:fldCharType" , L"begin" );
m_pXmlWriter->WriteNodeEnd( L"", true, false );
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
bool bFORMTEXT = search( f.begin(), f.end(), FORMTEXT.begin(), FORMTEXT.end()) != f.end();
bool bFORMCHECKBOX = search( f.begin(), f.end(), FORMCHECKBOX.begin(), FORMCHECKBOX.end()) != f.end();
bool bFORMDROPDOWN = search( f.begin(), f.end(), FORMDROPDOWN.begin(), FORMDROPDOWN.end()) != f.end();
/*if (cpPic < cpFieldEnd)
if (bFORMTEXT || bFORMCHECKBOX || bFORMDROPDOWN)
{
int fcPic = _doc.PieceTable.FileCharacterPositions[cpPic];
CharacterPropertyExceptions chpxPic = _doc.GetCharacterPropertyExceptions(fcPic, fcPic + 1)[0];
NilPicfAndBinData npbd = new NilPicfAndBinData(chpxPic, _doc.DataStream);
FormFieldData ffdata = new FormFieldData(npbd.binData);
ffdata.Convert(new FormFieldDataMapping(m_pXmlWriter));
}*/
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
if (cpPic < cpFieldEnd)
{
int fcPic = m_document->FindFileCharPos( cpPic );
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
if (chpxs)
{
CharacterPropertyExceptions* chpxSep = chpxs->front();
FormFieldData ffdata (2, chpxSep, m_document->DataStream, false);
FormFieldDataMapping data_mapping(m_pXmlWriter, m_context, _caller);
ffdata.Convert(&data_mapping);
RELEASEOBJECT( chpxs );
}
}
}
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
@ -809,6 +827,13 @@ namespace DocFileFormat
{
if (_fldCharCounter > 0)
{
if (_writeInstrText == true && !text.empty())
{
writeTextElement(text, textType);
text.clear();
}
_writeInstrText = false;
XMLTools::XMLElement elem( L"w:fldChar" );
elem.AppendAttribute( L"w:fldCharType", L"end" );
@ -1257,20 +1282,20 @@ namespace DocFileFormat
{
case sprmTDefTable:
case sprmOldTDefTable:
{
unsigned char itcMac = iter->Arguments[0];
{
unsigned char itcMac = iter->Arguments[0];
while(boundaries.size() < itcMac + 1)
boundaries.push_back(-0x7fff);
short boundary0 = -0x7fff;
for (unsigned char i = 0; i < itcMac; i++)
{
short boundary1 = FormatUtils::BytesToInt16( iter->Arguments, 1 + ( i * 2 ), iter->argumentsSize );
{
short boundary1 = FormatUtils::BytesToInt16( iter->Arguments, 1 + ( i * 2 ), iter->argumentsSize );
short boundary2 = FormatUtils::BytesToInt16( iter->Arguments, 1 + ( ( i + 1 ) * 2 ), iter->argumentsSize );
if (boundary2 - boundary1 > 1 && boundary1 - boundary0 > 1)
{
{
if ( boundaries[i] == -0x7fff || boundaries[i+1] == -0x7fff)
{
boundaries[i] = boundary1;
@ -1280,12 +1305,12 @@ namespace DocFileFormat
if ( find( boundaries_all.begin(), boundaries_all.end(), boundary1 ) == boundaries_all.end() )
{
boundaries_all.push_back( boundary1 );
}
}
if ( find( boundaries_all.begin(), boundaries_all.end(), boundary2 ) == boundaries_all.end() )
{
{
boundaries_all.push_back( boundary2 );
}
}
boundary0 = boundary1;
}break;
}
@ -1513,11 +1538,11 @@ namespace DocFileFormat
/// Writes the table cell that starts at the given cp value and ends at the next cell end mark
int DocumentMapping::writeTableCell(int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, std::vector<short>* grid_write, int& gridIndex, int cellIndex, unsigned int nestingLevel )
{
int cp = initialCp;
int cp = initialCp;
int cpCellEnd = findCellEndCp( initialCp, nestingLevel );
//start w:tc
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
//start w:tc
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
TableCellPropertiesMapping* tcpMapping = new TableCellPropertiesMapping( m_pXmlWriter, grid, grid_write, gridIndex, cellIndex );
@ -1530,7 +1555,7 @@ namespace DocFileFormat
RELEASEOBJECT( tcpMapping );
//write the paragraphs of the cell
//write the paragraphs of the cell
while ( cp < cpCellEnd )
{
//cp = writeParagraph(cp);
@ -1561,7 +1586,7 @@ namespace DocFileFormat
}
}
//end w:tc
//end w:tc
m_pXmlWriter->WriteNodeEnd( L"w:tc" );
return cp;

View File

@ -48,6 +48,8 @@
#include "OleObjectMapping.h"
#include "ConversionContext.h"
#include "IMapping.h"
#include "FormFieldData.h"
#include "FormFieldDataMapping.h"
namespace DocFileFormat
{

View File

@ -0,0 +1,170 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "FormFieldData.h"
#include "../../Common/DocxFormat/Source/Base/unicode_util.h"
namespace DocFileFormat
{
std::wstring readXstz(VirtualStreamReader *reader)
{
if (!reader) return L"";
unsigned short flags, cch, chTerm;
cch = reader->ReadUInt16();
std::wstring ret;
if (cch > 0)
{
std::shared_ptr<unsigned char>data = std::shared_ptr<unsigned char>(reader->ReadBytes(cch * 2, true));
#if defined(_WIN32) || defined(_WIN64)
ret = std::wstring((wchar_t*)data.get(), cch );
#else
ret = convertUtf16ToWString((UTF16*)data.get(), cch );
#endif
}
chTerm = reader->ReadUInt16();
return ret;
};
void FormFieldData::_HFD::read(VirtualStreamReader *reader)
{
if (!reader) return;
}
void FormFieldData::_FFData::read(VirtualStreamReader *reader)
{
if (!reader) return;
bExist = true;
unsigned short flags;
version = reader->ReadUInt32();
flags = reader->ReadUInt16();
iType = GETBITS(flags, 0, 1);
iRes = GETBITS(flags, 2, 6);
fOwnHelp = GETBIT(flags, 7);
fOwnStat = GETBIT(flags, 8);
fProt = GETBIT(flags, 9);
iSize = GETBIT(flags, 10);
iTypeTxt = GETBITS(flags, 11, 13);
fRecalc = GETBIT(flags, 14);
fHasListBox = GETBIT(flags, 15);
cch_field = reader->ReadUInt16();
hps = reader->ReadUInt16();
xstzName = readXstz(reader);
xstzTextDef = readXstz(reader);
wDef = reader->ReadUInt16();
xstzTextFormat = readXstz(reader);
xstzHelpText = readXstz(reader);
xstzStatText = readXstz(reader);
xstzEntryMcr = readXstz(reader);
xstzExitMcr = readXstz(reader);
}
FormFieldData::FormFieldData( int type, const CharacterPropertyExceptions* chpx, POLE::Stream* stream, bool bOlderVersion_ )
{
binary_data_size = 0;
if (!chpx) return;
int fc = -1;
bool bNilPICFAndBinData = false;
for ( std::list<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
switch ( iter->OpCode)
{
case sprmCFSpec:
{
}
break;
case sprmCFFldVanish:
{
}
break;
case sprmCPicLocation:
{
fc = FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize );
}
break;
case sprmCRsidText:
{
rsid = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
}
break;
case sprmCFData:
{
bNilPICFAndBinData = true; // or bPICFAndOfficeArtData - shape, pic, ole
}
break;
}
}
if (fc >= 0 && bNilPICFAndBinData)
{
VirtualStreamReader reader(stream, fc, bOlderVersion_);
int sz_stream = reader.GetSize();
int lcb = reader.ReadUInt32();
int cbHeader = reader.ReadUInt16();
if (cbHeader != 0x44) return;
//ignored
reader.ReadBytes(62, false);
switch(type)
{
case 1:
HFD.read(&reader);
case 2:
FFData.read(&reader);
break;
default:
binary_data_size = lcb - cbHeader;
binary_data = std::shared_ptr<unsigned char>(reader.ReadBytes(binary_data_size, true));
break;
}
}
}
}

View File

@ -0,0 +1,126 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "IVisitable.h"
#include "CharacterPropertyExceptions.h"
#include "StructuredStorageReader.h"
#include "VirtualStreamReader.h"
namespace DocFileFormat
{
class FormFieldData : public IVisitable
{
public:
struct _HFD
{
bool bExist = false;
bool fNew = false;
bool fNoHist = false;
bool fImageMap = false;
bool fLocation = false;
bool fTooltip = false;
std::wstring clsid;
_UINT32 streamVersion = 0;
bool hlstmfHasMoniker = false;
bool hlstmfIsAbsolute = false;
bool hlstmfSiteGaveDisplayName = false;
bool hlstmfHasLocationStr = false;
bool hlstmfHasDisplayName = false;
bool hlstmfHasGUID = false;
bool hlstmfHasCreationTime = false;
bool hlstmfHasFrameName = false;
bool hlstmfMonikerSavedAsStr = false;
bool hlstmfAbsFromGetdataRel = false;
std::wstring displayName;
std::wstring targetFrameName;
std::wstring moniker;
std::wstring oleMoniker_clsid;
std::wstring oleMoniker_data;
std::wstring location;
std::wstring guid;
_UINT64 fileTime = 0;
void read(VirtualStreamReader* reader);
};
struct _FFData
{
bool bExist = false;
_UINT32 version = 0;
unsigned char iType = 0;
unsigned char iRes = 0;
bool fOwnHelp = false;
bool fOwnStat = false;
bool fProt = false;
bool iSize = false;
unsigned char iTypeTxt = 0;
bool fRecalc = false;
bool fHasListBox = false;
unsigned short cch_field = 0;
unsigned short hps = 0;
std::wstring xstzName;
std::wstring xstzTextDef;
unsigned short wDef = 0;
std::wstring xstzTextFormat;
std::wstring xstzHelpText;
std::wstring xstzStatText;
std::wstring xstzEntryMcr;
std::wstring xstzExitMcr;
//STTB hsttbDropList;
void read(VirtualStreamReader* reader);
};
FormFieldData( int type, const CharacterPropertyExceptions* chpx, POLE::Stream* stream, bool bOlderVersion );
virtual ~FormFieldData() {}
private:
friend class FormFieldDataMapping;
std::wstring name;
std::wstring rsid;
_FFData FFData;
_HFD HFD;
std::shared_ptr<unsigned char> binary_data;
int binary_data_size;
};
}

View File

@ -0,0 +1,87 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "ConversionContext.h"
#include "FormFieldData.h"
#include "AbstractOpenXmlMapping.h"
#include "IMapping.h"
namespace DocFileFormat
{
class FormFieldDataMapping: public AbstractOpenXmlMapping, public IMapping
{
public:
FormFieldDataMapping(XMLTools::CStringXmlWriter* writer, ConversionContext* context, IMapping* caller)
: AbstractOpenXmlMapping(writer), m_context(NULL),_caller(NULL)
{
m_context = context;
_caller = caller;
}
virtual void Apply(IVisitable* visited)
{
FormFieldData* ffData = static_cast<FormFieldData*>(visited);
if ( ffData == NULL ) return;
if (ffData->FFData.bExist)
{
m_pXmlWriter->WriteNodeBegin( L"w:ffData");
m_pXmlWriter->WriteNodeBegin( L"w:name", true);
m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzName);
m_pXmlWriter->WriteNodeEnd(L"w:name", true, true );
m_pXmlWriter->WriteNodeBegin( L"w:calcOnExit", true);
m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.fRecalc);
m_pXmlWriter->WriteNodeEnd(L"w:calcOnExit", true, true );
m_pXmlWriter->WriteNodeBegin( L"w:textInput");
m_pXmlWriter->WriteNodeBegin( L"w:maxLength", true);
m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.cch_field);
m_pXmlWriter->WriteNodeEnd(L"w:maxLength", true, true );
m_pXmlWriter->WriteNodeEnd( L"w:textInput" );
m_pXmlWriter->WriteNodeEnd( L"w:ffData" );
}
}
private:
ConversionContext* m_context;
IMapping* _caller;
};
}

View File

@ -34,6 +34,7 @@
#include "IMapping.h"
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
#define GETBIT(from, num) ((from & (1 << num)) != 0)
namespace DocFileFormat
{

View File

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

View File

@ -597,16 +597,12 @@ namespace DocFileFormat
virtual ~ShapeOptions()
{
//for (std::vector<OptionEntry>::iterator iter = Options.begin(); iter != Options.end(); ++iter)
// RELEASEARRAYOBJECTS( iter->opComplex );
}
ShapeOptions (IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance) : Record (_reader, size, typeCode, version, instance)
{
long pos = Reader->GetPosition();
//instance is the count of properties stored in this record
//parse the flags and the simple values
for (unsigned int i = 0; i < instance; ++i)
{
@ -621,9 +617,7 @@ namespace DocFileFormat
Options.push_back( entry );
}
//parse the complex values
//these values are stored directly at the end
//of the OptionEntry arry, sorted by pid
//parse the complex values & sorted by pid
for (unsigned int i = 0; i < instance; ++i)
{
if (Options[i]->fComplex && Options[i]->op > 0)

View File

@ -43,6 +43,7 @@
#include "MainDocumentMapping.h"
#include "OleObjectMapping.h"
#include "VMLPictureMapping.h"
#include "FormFieldDataMapping.h"
#include "../../DesktopEditor/common/File.h"
#include "../../DesktopEditor/common/Directory.h"
@ -144,9 +145,9 @@ namespace DocFileFormat
{
if (docFile == NULL) return S_FALSE;
POLE::Storage *storageOut = new POLE::Storage(fileName.c_str());
POLE::Storage *storageOut = new POLE::Storage(fileName.c_str());
if (storageOut == NULL) return S_FALSE;
if (storageOut->open(true, true)==false)
{
delete storageOut;

View File

@ -40,19 +40,13 @@ namespace DocFileFormat
RELEASEOBJECT( Changes );
}
/*========================================================================================================*/
RevisionData::RevisionData():
Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
{
this->Changes = new std::list<SinglePropertyModifier>();
}
/*========================================================================================================*/
/// Collects the revision data of a CHPX
RevisionData::RevisionData( CharacterPropertyExceptions* chpx ):
Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
RevisionData::RevisionData( CharacterPropertyExceptions* chpx ) : Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
{
bool collectRevisionData = true;
this->Changes = new std::list<SinglePropertyModifier>();

View File

@ -288,6 +288,7 @@ namespace DocFileFormat
int ndyTextBottom = -1;
bool bHavePath = false;
int nShapePath = -1;
int nAdjValues = 0;
int nLTxID = -1;
@ -361,6 +362,7 @@ namespace DocFileFormat
case shapePath :
{
bHavePath = true;
nShapePath = iter->op;
}break;
case pVertices:
{
@ -1653,7 +1655,7 @@ namespace DocFileFormat
}
if (!bRelV && m_pSpa)
{
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->bx));
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->by));
}
if (!m_isInlineShape && !bZIndex)
{
@ -2165,7 +2167,7 @@ namespace DocFileFormat
//todooo нарисовать кастомный шейп
}
else
WritePrimitiveProps(primitive, (index==0 ? true : false));
WritePrimitiveProps(primitive, (index==0?true:false));
if (primitive->type == 0x0000)

View File

@ -94,6 +94,7 @@ SOURCES += \
../../DocDocxConverter/VMLShapeTypeMapping.cpp \
../../DocDocxConverter/WordDocument.cpp \
../../DocDocxConverter/WordprocessingDocument.cpp \
../../DocDocxConverter/FormFieldData.cpp \
../../DocDocxConverter/OfficeDrawing/Record.cpp \
../../DocDocxConverter/OfficeDrawing/RecordFactory.cpp \
../../DocDocxConverter/OfficeDrawing/ShapeTypeFactory.cpp

View File

@ -74,6 +74,7 @@
#include "../../DocDocxConverter/VMLShapeTypeMapping.cpp"
#include "../../DocDocxConverter/WordDocument.cpp"
#include "../../DocDocxConverter/WordprocessingDocument.cpp"
#include "../../DocDocxConverter/FormFieldData.cpp"
#include "../../DocDocxConverter/OfficeDrawing/Record.cpp"
#include "../../DocDocxConverter/OfficeDrawing/RecordFactory.cpp"
#include "../../DocDocxConverter/OfficeDrawing/ShapeTypeFactory.cpp"

View File

@ -44,10 +44,10 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
@ -479,6 +479,14 @@
RelativePath="..\..\DocDocxConverter\FormattedDiskPagePAPX.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\FormFieldData.cpp"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\FormFieldData.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\Global.h"
>
@ -1090,6 +1098,10 @@
RelativePath="..\..\DocDocxConverter\FootnotesMapping.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\FormFieldDataMapping.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\HeaderMapping.cpp"
>

View File

@ -29,19 +29,17 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
// DocFormatTest.cpp : Defines the entry point for the console application.
//
#include "../DocFormatLib/DocFormatLib.h"
#include "../../OfficeUtils/src/ASCOfficeCriticalSection.h"
#include <iostream>
#include "../../Common/DocxFormat/Source/Base/Base.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../DocFormatLib/DocFormatLib.h"
#include <string>
#include <windows.h>
#include <tchar.h>
#pragma comment(lib,"Shell32.lib")
#pragma comment(lib,"Advapi32.lib")
#pragma comment(lib,"Rpcrt4.lib")
#if defined(_WIN64)
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
@ -49,36 +47,34 @@
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
#endif
#pragma comment(lib, "Rpcrt4.lib")
HRESULT convert_single(std::wstring sSrcDoc)
HRESULT convert_single(std::wstring srcFileName)
{
HRESULT hr = S_OK;
std::wstring outputDir = NSDirectory::GetFolderPath(sSrcDoc);
std::wstring outputDir = NSDirectory::GetFolderPath(srcFileName);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstPath;
COfficeDocFile docFile;
docFile.m_sTempFolder = outputDir;
bool bMacros = true;
HRESULT hRes = docFile.LoadFromFile( sSrcDoc, dstTempPath, L"password", bMacros, NULL);
HRESULT hRes = docFile.LoadFromFile( srcFileName, dstTempPath, L"password", bMacros, NULL);
std::wstring sDstDocx;
if (bMacros)
{
sDstDocx = sSrcDoc + L"-my.docm";
dstPath = srcFileName + L"-my.docm";
}
else
{
sDstDocx = sSrcDoc + L"-my.docx";
dstPath = srcFileName + L"-my.docx";
}
if (hRes == S_OK)
{
COfficeUtils oCOfficeUtils(NULL);
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstDocx, -1);
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath, -1);
}
NSDirectory::DeleteDirectory(dstTempPath);

View File

@ -442,6 +442,10 @@
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
>
</File>
<File
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
>
</File>
<File
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
>

View File

@ -61,6 +61,13 @@ enum ETblStyleOverrideType
tblstyleoverridetypeSwCell = 11,
tblstyleoverridetypeWholeTable = 12
};
struct RowHeight
{
unsigned char HRule = 0;
long nHeight = 0;
};
class SdtWraper
{
public:
@ -2111,7 +2118,17 @@ public:
}
else if( c_oSerProp_rowPrType::Height == type )
{
res = Read2(length, &Binary_tblPrReader::ReadHeight, this, poResult);
RowHeight val;
res = Read2(length, &Binary_tblPrReader::ReadHeight, this, &val);
pCStringWriter->WriteString(L"<w:trHeight w:val=\"" + std::to_wstring(val.nHeight) + L"\"");
switch (val.HRule)
{
case 1: pCStringWriter->WriteString(L" w:hRule=\"auto\""); break;
case 2: pCStringWriter->WriteString(L" w:hRule=\"exact\""); break;
}
pCStringWriter->WriteString(L"/>");
}
else if( c_oSerProp_rowPrType::TableHeader == type )
{
@ -2180,17 +2197,17 @@ public:
int ReadHeight(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
XmlUtils::CStringWriter* pCStringWriter = static_cast<XmlUtils::CStringWriter*>(poResult);
/*if( c_oSerProp_rowPrType::Height_Rule == type )
RowHeight* pHeight = static_cast<RowHeight*>(poResult);
if( c_oSerProp_rowPrType::Height_Rule == type )
{
Height.HRule = this.stream.GetUChar();
pHeight->HRule = m_oBufferedStream.GetUChar();
}
else */if( c_oSerProp_rowPrType::Height_Value == type )
else if( c_oSerProp_rowPrType::Height_Value == type )
{
double dHeight = m_oBufferedStream.GetDouble();
long nHeight = SerializeCommon::Round( g_dKoef_mm_to_twips * dHeight);
pCStringWriter->WriteString(L"<w:trHeight w:val=\"" + std::to_wstring(nHeight) + L"\"/>");
pHeight->nHeight = SerializeCommon::Round( g_dKoef_mm_to_twips * dHeight);
}
else
res = c_oSerConstants::ReadUnknown;
@ -3746,6 +3763,21 @@ public:
res = Read1(length, &Binary_DocumentTableReader::ReadBookmarkEnd, this, &oBookmarkEnd);
m_oDocumentWriter.m_oContent.WriteString(oBookmarkEnd.toXML());
}
else if(c_oSerParType::JsaProject == type)
{
BYTE* pData = m_oBufferedStream.GetPointer(length);
OOX::CPath sJsaProject = OOX::FileTypes::JsaProject.DefaultFileName();
std::wstring filePath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word"+ FILE_SEPARATOR_STR + sJsaProject.GetPath();
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath);
oFile.WriteFile(pData, length);
oFile.CloseFile();
long lId;
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::JsaProject.RelationType(), sJsaProject.GetPath(), L"", &lId);
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(sJsaProject.GetExtention(false));
}
else
res = c_oSerConstants::ReadUnknown;
return res;

View File

@ -618,7 +618,7 @@ namespace MathEquation
nRows = m_aRowsCounter.top();
m_aRowsCounter.pop();
}
int nPos = 0;
int nPos = m_oStream.GetPosition();
if (!m_aRowsPosCounter.empty())
{
nPos = m_aRowsPosCounter.top();

View File

@ -477,8 +477,10 @@ extern int g_nCurFormatVersion;
MoveFromRangeEnd = 19,
MoveToRangeStart = 20,
MoveToRangeEnd = 21,
BookmarkStart = 22,
BookmarkEnd = 23
JsaProject = 22,
BookmarkStart = 23,
BookmarkEnd = 24
};}
namespace c_oSerDocTableType{enum c_oSerDocTableType
{

View File

@ -2104,14 +2104,11 @@ namespace BinDocxRW
SimpleTypes::EHeightRule eHRule = SimpleTypes::heightruleAtLeast;
if(rowHeight.m_oHRule.IsInit())
eHRule = rowHeight.m_oHRule->GetValue();
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rowPrType::Height_Rule);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
switch(eHRule)
{
case SimpleTypes::heightruleAtLeast :
case SimpleTypes::heightruleExact :m_oBcw.m_oStream.WriteBYTE(heightrule_AtLeast);break;
default :m_oBcw.m_oStream.WriteBYTE(heightrule_Auto);break;
}
m_oBcw.m_oStream.WriteBYTE(eHRule);
//Value
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rowPrType::Height_Value);
@ -2992,6 +2989,7 @@ namespace BinDocxRW
Binary_tblPrWriter btblPrs;
OOX::Logic::CSectionProperty* pSectPr;
OOX::Logic::CBackground * pBackground;
OOX::CDocument* poDocument;
bool m_bWriteSectPr;//Записывать ли свойства верхнего уровня в данном экземпляре BinaryOtherTableWriter
//---------------------------------
@ -3000,6 +2998,7 @@ namespace BinDocxRW
{
pBackground = NULL;
pSectPr = NULL;
poDocument = NULL;
m_bWriteSectPr = false;
}
void prepareOfficeDrawingConverter(NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, OOX::IFileContainer *rels, std::vector<std::wstring>& aShapeTypes)
@ -3110,6 +3109,23 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
}
}
//Write JsaProject
if (NULL != poDocument)
{
smart_ptr<OOX::File> pFile = poDocument->Get(OOX::FileTypes::JsaProject);
if (pFile.IsInit() && OOX::FileTypes::JsaProject == pFile->type())
{
OOX::JsaProject& jsaProject = pFile.as<OOX::JsaProject>();
BYTE* pData = NULL;
DWORD nBytesCount;
if(NSFile::CFileBinary::ReadAllBytes(jsaProject.filename().GetPath(), &pData, nBytesCount))
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::JsaProject);
m_oBcw.m_oStream.WriteBYTEArray(pData, nBytesCount);
m_oBcw.WriteItemEnd(nCurPos);
}
}
}
}
void WriteBackground (OOX::Logic::CBackground* pBackground)
{
@ -3744,7 +3760,6 @@ namespace BinDocxRW
void WriteHyperlink(OOX::Logic::CHyperlink* pHyperlink)
{
int nCurPos = 0;
std::wstring sField;
std::wstring sLink;
if(pHyperlink->m_oId.IsInit())
{
@ -3757,24 +3772,20 @@ namespace BinDocxRW
}
}
if(!sLink.empty())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Hyperlink);
WriteHyperlinkContent(sLink, pHyperlink);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
else
{
WriteParagraphContent(pHyperlink->m_arrItems, true);
}
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Hyperlink);
WriteHyperlinkContent(sLink, pHyperlink);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
void WriteHyperlinkContent(std::wstring& sLink, OOX::Logic::CHyperlink* pHyperlink)
{
int nCurPos = 0;
//Link
nCurPos = m_oBcw.WriteItemStart(c_oSer_HyperlinkType::Link);
m_oBcw.m_oStream.WriteStringW3(sLink);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
if(!sLink.empty())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_HyperlinkType::Link);
m_oBcw.m_oStream.WriteStringW3(sLink);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
//Anchor
if(pHyperlink->m_sAnchor.IsInit())
{
@ -7898,6 +7909,7 @@ namespace BinDocxRW
oBinaryDocumentTableWriter.pSectPr = pFirstSectPr;
oBinaryDocumentTableWriter.pBackground = poDocument->m_oBackground.GetPointer();
oBinaryDocumentTableWriter.poDocument = poDocument;
oBinaryDocumentTableWriter.m_bWriteSectPr = true;
//Write Vba

View File

@ -47,7 +47,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"

View File

@ -48,13 +48,19 @@ _CP_PTR(oox_axis_content) oox_axis_content::create(int type)
oox_axis_content::oox_axis_content(int type/*,std::wstring name*/)
{
//id_ = abs((int)*((_UINT32*)this));
id_ = abs((long)this);
type_=type; //dimension
if (type == 0)
{
id_ = 0;
}
else
{
id_ = abs((long)this);
}
type_ = type;
}
void oox_axis_content::oox_serialize(std::wostream & _Wostream)
{
if (id_ <0 )return;//not activate
if (id_ < 1 )return; //not activate, blank axis
CP_XML_WRITER(_Wostream)
{

View File

@ -153,7 +153,7 @@ void oox_chart_context::serialize(std::wostream & strm)
}
CP_XML_NODE(L"c:dispBlanksAs")
{
CP_XML_ATTR(L"val", L"zero");
CP_XML_ATTR(L"val", plot_area_.current_chart_->dispBlanksAs_);
}
CP_XML_NODE(L"c:showDLblsOverMax")
{

View File

@ -250,7 +250,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
CP_XML_CONTENT(values_[i].numRef_.formula);
}
if (values_[i].numRef_.num_cache_count>0)
if (values_[i].numRef_.num_cache_count > 0)
{
CP_XML_NODE(L"c:numCache")
{

View File

@ -31,10 +31,10 @@
*/
#include "oox_plot_area.h"
#include <boost/foreach.hpp>
#include <boost/functional.hpp>
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/style_text_properties.h"
#include "oox_chart_shape.h"
@ -90,7 +90,7 @@ void oox_plot_area::add_chart(int type)
void oox_plot_area::add_axis(int type, odf_reader::chart::axis & content)
{
oox_axis_content_ptr ax=oox_axis_content::create(type);
oox_axis_content_ptr ax = oox_axis_content::create(type);
ax->content_ = content;
axis_.push_back(ax);
@ -98,21 +98,25 @@ void oox_plot_area::add_axis(int type, odf_reader::chart::axis & content)
void oox_plot_area::reset_cross_axis()//обязательно после всех добавлений
{
BOOST_FOREACH(oox_axis_content_ptr const & ax, axis_)
for (size_t i = 0; i < axis_.size(); i++)
{
BOOST_FOREACH(oox_chart_ptr const & ch, charts_)
for (size_t j = 0; j < charts_.size(); j++)
{
ch->add_axis(ax->get_Id());
charts_[j]->add_axis(axis_[i]->get_Id());
}
}
BOOST_FOREACH(oox_axis_content_ptr const & a, axis_)
{
int curr_id = a->get_Id();
BOOST_FOREACH(oox_axis_content_ptr const & b, axis_)
{
if (b->get_Id()==curr_id)continue;
b->add_CrossedId(curr_id);
for (size_t i = 0; i < axis_.size(); i++)
{
int curr_id = axis_[i]->get_Id();
if (curr_id < 1) continue;
for (size_t j = 0; j < axis_.size(); j++)
{
if (axis_[j]->get_Id() == curr_id)continue;
axis_[j]->add_CrossedId(curr_id);
}
}
}
@ -130,18 +134,18 @@ void oox_plot_area::oox_serialize(std::wostream & _Wostream)
//CP_XML_NODE(L"c:layout"){}
bool axisPresent = true;
BOOST_FOREACH(oox_chart_ptr const & ch, charts_)
{
ch->oox_serialize(CP_XML_STREAM());
for (size_t i = 0; i < charts_.size(); i++)
{
charts_[i]->oox_serialize(CP_XML_STREAM());
if (ch->type_ == CHART_TYPE_PIE ||
ch->type_ == CHART_TYPE_DOUGHNUT) axisPresent = false;
if (charts_[i]->type_ == CHART_TYPE_PIE ||
charts_[i]->type_ == CHART_TYPE_DOUGHNUT) axisPresent = false;
}
if (axisPresent)
{
BOOST_FOREACH(oox_axis_content_ptr const & a, axis_)
{
a->oox_serialize(CP_XML_STREAM());
for (size_t i = 0; i < axis_.size(); i++)
{
axis_[i]->oox_serialize(CP_XML_STREAM());
}
}
shape.oox_serialize(CP_XML_STREAM());

View File

@ -63,7 +63,7 @@ void oox_chart::set_content_series(odf_reader::chart::series & content)
}
void oox_chart::set_values_series(int ind, std::vector<std::wstring> & val)
{
if (val.size()<1)return;
if (val.empty())return;
oox_series_ptr & current_ptr = series_.back();
current_ptr->setValues (ind, val);
@ -74,9 +74,11 @@ void oox_chart::set_properties(std::vector<odf_reader::_property> g)
_CP_OPT(bool) bStacked;
_CP_OPT(bool) bPercent;
_CP_OPT(int) iGapWidth;
odf_reader::GetProperty(g, L"stacked",bStacked);
odf_reader::GetProperty(g, L"percentage",bPercent);
odf_reader::GetProperty(g, L"stacked", bStacked);
odf_reader::GetProperty(g, L"percentage", bPercent);
odf_reader::GetProperty(g, L"gap-width", iGapWidth);
if ( (bStacked) && (bStacked.get()))
{
@ -87,6 +89,10 @@ void oox_chart::set_properties(std::vector<odf_reader::_property> g)
{
grouping_ = L"percentStacked";
}
if (iGapWidth)
{
dispBlanksAs_ = L"gap";
}
//solid-type - трехмерные
}
void oox_chart::oox_serialize_common(std::wostream & _Wostream)
@ -128,17 +134,15 @@ void oox_bar_chart::set_properties(std::vector<odf_reader::_property> g)
{
oox_chart::set_properties(g);
odf_reader::GetProperty(g, L"vertical",bVertical);
odf_reader::GetProperty(g, L"connect-bars",bConnectBars);
odf_reader::GetProperty(g, L"vertical", bVertical);
odf_reader::GetProperty(g, L"connect-bars", bConnectBars);
odf_reader::GetProperty(g, L"gap-width",iGapWidth);
odf_reader::GetProperty(g, L"overlap",iOverlap);
odf_reader::GetProperty(g, L"gap-width", iGapWidth);
odf_reader::GetProperty(g, L"overlap", iOverlap);
}
void oox_bar_chart::set_additional_properties(std::vector<odf_reader::_property> g)
{
odf_reader::GetProperty(g, L"gap-width",iGapWidth);
odf_reader::GetProperty(g, L"overlap",iOverlap);
}
void oox_bar_chart::oox_serialize(std::wostream & _Wostream)
@ -169,13 +173,13 @@ void oox_bar_chart::oox_serialize(std::wostream & _Wostream)
}
CP_XML_NODE(L"c:overlap")//-100 to 100
{
CP_XML_ATTR(L"val",Overlap);
CP_XML_ATTR(L"val", Overlap);
}
if (iGapWidth)
{
CP_XML_NODE(L"c:gapWidth")
{
CP_XML_ATTR(L"val",iGapWidth.get());
CP_XML_ATTR(L"val", iGapWidth.get());
}
}
CP_XML_NODE(L"c:varyColors")

View File

@ -63,9 +63,10 @@ public:
oox_chart()
{
grouping_ = L"standard";
is3D_ = false;
type_ = 0;
grouping_ = L"standard";
is3D_ = false;
type_ = 0;
dispBlanksAs_ = L"zero";
}
~oox_chart(){}
@ -98,9 +99,10 @@ public:
int type_;
bool is3D_;
std::vector<int> axisId_; //axId (Axis ID) §21.2.2.9
std::wstring dispBlanksAs_;
std::vector<int> axisId_; // axId (Axis ID) §21.2.2.9
std::wstring grouping_; // clustered | percentStacked | stacked | standard
std::vector<oox_series_ptr> series_; //ser (Bar Chart Series) §21.2.2.170
std::vector<oox_series_ptr> series_; // ser (Bar Chart Series) §21.2.2.170
virtual void set_properties(std::vector<odf_reader::_property> g);
virtual void set_additional_properties(std::vector<odf_reader::_property> g){}

View File

@ -401,7 +401,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
std::vector<std::wstring> cell_cash;
std::vector<std::wstring> cat_cash;
calc_cache_series (domain_cell_range_adress_, domain_cash);
calc_cache_series (domain_cell_range_adress_, domain_cash);
calc_cache_series (series_[i].cell_range_address_, cell_cash);
if (categories_.size() >0)
@ -462,10 +462,19 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
std::sort(axises_.begin(), axises_.end(), axises_sort());//file_1_ (1).odp
bool x_enabled = false;
bool y_enabled = false;
bool z_enabled = false;
bool x_enabled = false;
bool y_enabled = false;
bool z_enabled = false;
bool is3D = false;
_CP_OPT(bool) boolVal;
odf_reader::GetProperty(plot_area_.properties_, L"three-dimensional", boolVal);
if ((boolVal) && (*boolVal))
{
is3D = true;
}
for (int i = 0; i < axises_.size(); i++)
{
axis & a = axises_[i];
@ -481,6 +490,8 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
if (class_ == chart_stock && a.type_ == 3 )
a.type_ = 4; //шкала дат.
if (is3D) a.type_ = 1; // шкала категорий
x_enabled = true;
}
@ -499,7 +510,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
}
else if (a.dimension_ == L"z")
{
chart_context.set_3D_chart (true);
is3D = true;
continue;
a.type_ = 2;
z_enabled = true;
@ -507,6 +518,18 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
chart_context.add_axis(a.type_, a);
}
if (is3D)
{
if (!z_enabled)
{
chart::axis a;
a.type_ = 0; // blank
chart_context.add_axis(a.type_, a);
}
chart_context.set_3D_chart (true);
}
}
//----------------------------------------------------------------------------------------

View File

@ -88,8 +88,8 @@ void style_chart_properties::add_attributes( const xml::attributes_wc_ptr & Attr
_CP_OPT(int) iVal;
//CP_APPLY_ATTR(L"chart:symbol-type", iVal); if (iVal)content_.push_back(_property(L"symbol-type", iVal.get()));
CP_APPLY_ATTR(L"chart:gap-width", iVal); if (iVal)content_.push_back(_property(L"gap-width", iVal.get()));
//CP_APPLY_ATTR(L"chart:symbol-type", iVal); if (iVal)content_.push_back(_property(L"symbol-type", iVal.get()));
CP_APPLY_ATTR(L"chart:gap-width", iVal); if (iVal)content_.push_back(_property(L"gap-width", iVal.get()));
CP_APPLY_ATTR(L"chart:overlap", iVal); if (iVal)content_.push_back(_property(L"overlap", iVal.get()));
CP_APPLY_ATTR(L"chart:spline-order", iVal); if (iVal)content_.push_back(_property(L"spline-order", iVal.get()));
CP_APPLY_ATTR(L"chart:spline-resolution",iVal); if (iVal)content_.push_back(_property(L"spline-resolution", iVal.get()));
@ -100,8 +100,8 @@ void style_chart_properties::add_attributes( const xml::attributes_wc_ptr & Attr
CP_APPLY_ATTR(L"chart:maximum", dVal); if (dVal)content_.push_back(_property(L"maximum", dVal.get()));
CP_APPLY_ATTR(L"chart:minimum", dVal); if (dVal)content_.push_back(_property(L"minimum", dVal.get()));
CP_APPLY_ATTR(L"chart:origin", dVal); if (dVal)content_.push_back(_property(L"origin", dVal.get()));
CP_APPLY_ATTR(L"chart:interval-major", dVal); if (dVal)content_.push_back(_property(L"interval-major", dVal.get()));
CP_APPLY_ATTR(L"chart:origin", dVal); if (dVal)content_.push_back(_property(L"origin", dVal.get()));
CP_APPLY_ATTR(L"chart:interval-major", dVal); if (dVal)content_.push_back(_property(L"interval-major", dVal.get()));
CP_APPLY_ATTR(L"chart:error-percentage",dVal); if (dVal)content_.push_back(_property(L"error-percentage", dVal.get()));
CP_APPLY_ATTR(L"chart:error-margin", dVal); if (dVal)content_.push_back(_property(L"error-margin", dVal.get()));
CP_APPLY_ATTR(L"chart:error-lower-limit",dVal); if (dVal)content_.push_back(_property(L"error-lower-limit", dVal.get()));

View File

@ -47,7 +47,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
WarningLevel="3"

View File

@ -47,7 +47,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
WarningLevel="3"

View File

@ -47,7 +47,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
WarningLevel="3"

View File

@ -45,7 +45,7 @@
AdditionalIncludeDirectories=""
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"

View File

@ -47,7 +47,7 @@
PreprocessorDefinitions="_DEBUG;_LIB;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough=""
WarningLevel="3"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="Oox2OdfConverter"
ProjectGUID="{BEE01B53-244A-44E6-8947-ED9342D9247E}"
RootNamespace="Oox2OdfConverter"
@ -47,7 +47,7 @@
PreprocessorDefinitions="NDEBUG;_LIB;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"

View File

@ -67,7 +67,9 @@ public:
}
HRESULT LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password, bool &bMacros);
long OpenFile(const std::wstring & fileName, const std::wstring & password, bool &bMacros);
bool CloseFile();
private:
int m_Status;
@ -76,8 +78,7 @@ private:
std::wstring m_strTempDirectory;
std::wstring m_sTempDecryptFileName;
long OpenFile(const std::wstring & fileName, const std::wstring & password, bool &bMacros);
bool CloseFile();
std::wstring GetDirectory(std::wstring strFileName);
};

View File

@ -59,7 +59,7 @@
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
@ -429,6 +429,14 @@
<File
RelativePath="..\..\..\ASCOfficeDocxFile2\DocWrapper\XlsxSerializer.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>

File diff suppressed because it is too large Load Diff

View File

@ -276,8 +276,8 @@ namespace NSBinPptxRW
std::wstring GetVMLShapeXml (CPPTShape* pPPTShape);
std::wstring GetVMLShapeXml (PPTX::Logic::SpTreeElem& oElem);
void CheckBrushShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
void CheckPenShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
void CheckBrushShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, CPPTShape* pPPTShape);
void CheckPenShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, CPPTShape* pPPTShape);
void LoadCoordSize (XmlUtils::CXmlNode& oNode, ::CShapePtr pShape);
void LoadCoordPos (XmlUtils::CXmlNode& oNode, ::CShapePtr pShape);

View File

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

View File

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

View File

@ -591,7 +591,7 @@ namespace NSPresentationEditor
#else
std::wstring ConvertPPTtoPPTX(CPPTShape* pPPTShape, const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
{
if (pPPTShape->m_eType == PPTShapes::sptCRect || pPPTShape->m_eType == PPTShapes::sptCFrame)
if (pPPTShape->m_eType == PPTShapes::sptCRect || pPPTShape->m_eType == PPTShapes::sptCFrame || pPPTShape->m_eType == PPTShapes::sptCTextBox)
{
if (bIsNamespace)
{

View File

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

View File

@ -103,11 +103,9 @@ namespace PPTX
pSrcFile->type() == OOX::Presentation::FileTypes::NotesSlide) ? true : false;
}
size_t nCount = rels.m_arrRelations.size();
for (size_t i = 0; i < nCount; ++i)
{
OOX::Rels::CRelationShip* pRelation = rels.m_arrRelations[i];
for (std::map<std::wstring, OOX::Rels::CRelationShip*>::const_iterator it = rels.m_mapRelations.begin(); it != rels.m_mapRelations.end(); it++)
{
OOX::Rels::CRelationShip* pRelation = it->second;
OOX::CPath normPath = CorrectPathRels(path, pRelation);

View File

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

View File

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

View File

@ -295,6 +295,12 @@ namespace PPTX
oNode.ReadAttributeBase(L"spid", vmlSpid);
result = true;
}
else
{
element.fromXML( oNode );
if (element.is_init())
result = true;
}
}
}
return result;

View File

@ -123,18 +123,18 @@ namespace PPTX
oWriter.StartNode(_T("w:ind"));
oWriter.StartAttributes();
if (oPar.pPr->marL.is_init())
oWriter.WriteAttribute(_T("w:left"), (int)((double)(*pPr->marL) / 635));
oWriter.WriteAttribute(_T("w:left"), (int)((double)(*pPr->marL) / 635.) + 0.5);
if (oPar.pPr->marR.is_init())
oWriter.WriteAttribute(_T("w:right"), (int)((double)(*pPr->marR) / 635));
oWriter.WriteAttribute(_T("w:right"), (int)((double)(*pPr->marR) / 635.) + 0.5);
if (oPar.pPr->indent.is_init())
oWriter.WriteAttribute(_T("w:firstLine"), (int)((double)(*pPr->indent) / 635));
oWriter.WriteAttribute(_T("w:firstLine"), (int)((double)(*pPr->indent) / 635.) + 0.5);
oWriter.EndAttributes();
oWriter.EndNode(_T("w:ind"));
}
if (true)
{
oWriter.WriteString(_T("<w:spacing w:before=\"0\" w:after=\"0\" />"));
oWriter.WriteString(_T("<w:spacing w:before=\"0\" w:after=\"0\"/>"));
}
if (pPr->algn.is_init())

View File

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

View File

@ -48,7 +48,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"

View File

@ -46,7 +46,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"

View File

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

View File

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

View File

@ -47,7 +47,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"

View File

@ -60,7 +60,7 @@ HRESULT convert_single(std::wstring srcFileName)
std::wstring dstPath;
bool bMacros = true;
hr = ConvertXls2Xlsx(srcFileName, dstTempPath, L"password", L"C:\\Windows\\Fonts", NULL, bMacros);
hr = ConvertXls2Xlsx(srcFileName, dstTempPath, L"password", L"C:\\Windows\\Fonts", L"C:\\Windows\\Temp", NULL, bMacros);
if (bMacros)
{

View File

@ -57,6 +57,8 @@ namespace writer
static const char colon = ':';
static const char amp = '&';
static const char apos = '\'';
static const char a = '\x0a';
static const char * cdata_open() { return "<![CDATA["; }
static const char * cdata_close() { return "]]>"; }
static const char * amp_str(){ return "&amp;"; }
@ -64,6 +66,7 @@ namespace writer
static const char * right_brocket_str() { return "&gt;"; }
static const char * apos_str() { return "&apos;"; }
static const char * quote_str() { return "&quot;"; }
static const char * a_str() { return "&#10;"; }
};
template <>
@ -78,14 +81,17 @@ namespace writer
static const wchar_t colon = L':';
static const wchar_t amp = L'&';
static const wchar_t apos = L'\'';
static const wchar_t * cdata_open() { return L"<![CDATA["; }
static const wchar_t a = L'\x0a';
static const wchar_t * cdata_open() { return L"<![CDATA["; }
static const wchar_t * cdata_close() { return L"]]>"; }
static const wchar_t * amp_str(){ return L"&amp;"; }
static const wchar_t * left_brocket_str() { return L"&lt;"; }
static const wchar_t * right_brocket_str() { return L"&gt;"; }
static const wchar_t * apos_str() { return L"&apos;"; }
static const wchar_t * quote_str() { return L"&quot;"; }
};
static const wchar_t * a_str() { return L"&#10;"; }
};
template <class V>
class element;
@ -279,7 +285,9 @@ namespace writer
case chars<T>::quote:
wr_.puts(chars<T>::quote_str()); break;
default:
case chars<T>::a:
wr_.puts(chars<T>::a_str()); break;
default:
wr_.putc(*str); break;
}
}

View File

@ -35,8 +35,7 @@
namespace XLS
{
Array::Array(const CellRef& cell_base_ref_init)
: formula(false, cell_base_ref_init)
Array::Array(const CellRef& cell_base_ref_init) :formula(false, cell_base_ref_init)
{
}

View File

@ -32,8 +32,8 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/CellRangeRef.h>
#include <Logic/Biff_structures/ArrayParsedFormula.h>
#include "../Biff_structures/CellRangeRef.h"
#include "../Biff_structures/ArrayParsedFormula.h"
namespace XLS
{
@ -49,7 +49,6 @@ public:
~Array();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -53,6 +53,8 @@ static inline void trim(std::wstring &s)
AutoFilter::AutoFilter()
{
wTopN = wJoin = 0;
size = 0xffffffff;
bExist = false;
}
@ -68,6 +70,15 @@ BaseObjectPtr AutoFilter::clone()
void AutoFilter::readFields(CFRecord& record)
{
size_t pos_record = record.getRdPtr();
if (size == 0xffffffff) size = record.getDataSize() - pos_record;
if (size > 0)
{
bExist = true;
}
m_bAutoFilter12 = false;
unsigned short flags;
@ -119,9 +130,9 @@ void AutoFilter::readFields(CFRecord& record)
trim(str2);
}
if (record.getRdPtr() < record.getDataSize())
if (record.getRdPtr() - pos_record < size)
{
int sz = record.getDataSize() - record.getRdPtr();
int sz = size - (record.getRdPtr() - pos_record);
char *dd = new char [sz];
memcpy(dd, record.getCurData<char>(), sz);

View File

@ -32,13 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/AFDOper.h>
#include "../Biff_structures/AFDOper.h"
namespace XLS
{
// Logical representation of AutoFilter record in BIFF8
class AutoFilter: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(AutoFilter)
@ -74,6 +72,9 @@ public:
std::wstring str1;
std::wstring str2;
//----------------------------------------
bool bExist;
_UINT32 size;
};
} // namespace XLS

View File

@ -31,6 +31,13 @@
*/
#include "AutoFilter12.h"
#include "../Biff_structures/DXFN12List.h"
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/AFDOper.h"
#include "../Biff_structures/AF12Criteria.h"
#include "../Biff_structures/AF12CellIcon.h"
namespace XLS
{
@ -58,12 +65,29 @@ void AutoFilter12::readFields(CFRecord& record)
record >> frtRefHeader >> iEntry >> fHideArrow >> ft >> cft >> cCriteria >> cDateGroupings >> flags >> unused2 >> idList;
// TODO доделать
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
_GUID_ guid_num;
record >> guid_num;
guidSview = STR::guid2bstr(guid_num);
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
//-------------------------------------------------------------------------------------------------------
std::list<CFRecordPtr>& recs = continue_records[rt_ContinueFrt12];
size_t size = recs.size();
switch(ft)
{
case 0x00000000://not exist
break;
case 0x00000001: rgb = BiffStructurePtr(new DXFN12List); //color
break;
case 0x00000002: rgb = BiffStructurePtr(new DXFN12List); //font
break;
case 0x00000003: rgb = BiffStructurePtr(new AF12CellIcon); //icon
break;
}
if (rgb)
rgb->load(record);
while( !recs.empty() )
{
record.appendRawData(recs.front());

View File

@ -34,10 +34,7 @@
#include "BiffRecordContinued.h"
#include "../Biff_structures/FrtRefHeader.h"
#include "../Biff_structures/BiffString.h"
#include "../Biff_structures/FrtRefHeader.h"
#include "../Biff_structures/AFDOper.h"
#include "../Biff_structures/AF12Criteria.h"
namespace XLS
{
@ -65,6 +62,9 @@ public:
_UINT32 cCriteria;
_UINT32 cDateGroupings;
_UINT32 idList;
std::wstring guidSview;
BiffStructurePtr rgb;
BiffStructurePtrVector arAF12Criteries;
};

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of AxisLine record in BIFF8
class AxisLine: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(AxisLine)

View File

@ -33,8 +33,8 @@
#include "BiffRecord.h"
#include <Logic/Biff_structures/ChartParsedFormula.h>
#include <Logic/Biff_structures/CellRangeRef.h>
#include "../Biff_structures/ChartParsedFormula.h"
#include "../Biff_structures/CellRangeRef.h"
namespace XLS
{

View File

@ -32,6 +32,7 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
@ -54,13 +55,13 @@ public:
//-----------------------------
unsigned char pst;
bool fAutoSplit;
unsigned char fAutoSplit;
_UINT16 split;
_INT16 iSplitPos;
_INT16 pcSplitPercent;
_INT16 pcPie2Size;
_INT16 pcGap;
BIFF_DOUBLE numSplitValue;
Xnum numSplitValue;
bool fHasShadow;

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of BottomMargin record in BIFF8
class BottomMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(BottomMargin)
@ -54,7 +53,7 @@ public:
static const ElementType type = typeBottomMargin;
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};

View File

@ -32,14 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/DXFN.h>
#include <Logic/Biff_structures/CFParsedFormulaNoCCE.h>
#include "../Biff_structures/DXFN.h"
#include "../Biff_structures/CFParsedFormulaNoCCE.h"
namespace XLS
{
// Logical representation of CF record in BIFF8
class CF: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CF)
@ -50,7 +48,6 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeCF;
@ -69,6 +66,7 @@ public:
CFParsedFormulaNoCCE rgce2;
BaseObjectPtr m_CFEx;
BaseObjectPtr m_CF12;
GlobalWorkbookInfoPtr global_info_;
};

View File

@ -32,18 +32,16 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/FrtRefHeader.h>
#include <Logic/Biff_structures/DXFN12.h>
#include <Logic/Biff_structures/CFParsedFormulaNoCCE.h>
#include <Logic/Biff_structures/CFParsedFormula.h>
#include <Logic/Biff_structures/CFExTemplateParams.h>
#include "../Biff_structures/FrtRefHeader.h"
#include "../Biff_structures/DXFN12.h"
#include "../Biff_structures/CFParsedFormulaNoCCE.h"
#include "../Biff_structures/CFParsedFormula.h"
#include "../Biff_structures/CFExTemplateParams.h"
namespace XLS
{
// Logical representation of CF12 record in BIFF8
class CF12: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CF12)
@ -84,6 +82,7 @@ public:
int dxfId_;
BaseObjectPtr m_CFEx;
BaseObjectPtr m_CF12_2;
};
typedef boost::shared_ptr<CF12> CF12Ptr;

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of CalcDelta record in BIFF8
class CalcDelta: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CalcDelta)
@ -54,7 +53,7 @@ public:
static const ElementType type = typeCalcDelta;
//-----------------------------
BIFF_DOUBLE numDelta;
Xnum numDelta;
};

View File

@ -32,6 +32,7 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
@ -44,7 +45,6 @@ public:
~CrtLayout12();
BaseObjectPtr clone();
void readFields(CFRecord& record);
@ -59,10 +59,10 @@ public:
CrtLayout12Mode wWidthMode;
CrtLayout12Mode wHeightMode;
BIFF_DOUBLE x;
BIFF_DOUBLE y;
BIFF_DOUBLE dx;
BIFF_DOUBLE dy;
Xnum x;
Xnum y;
Xnum dx;
Xnum dy;
};
} // namespace XLS

View File

@ -35,9 +35,6 @@
namespace XLS
{
// Logical representation of DataFormat record in BIFF8
class DataFormat: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(DataFormat)
@ -47,11 +44,10 @@ public:
~DataFormat();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeDataFormat;
static const ElementType type = typeDataFormat;
_UINT16 xi;
_UINT16 yi;

View File

@ -31,8 +31,8 @@
*/
#include "ExternSheet.h"
#include <Logic/Biff_structures/XTI.h>
#include <Logic/Biff_structures/BiffString.h>
#include "../Biff_structures/XTI.h"
#include "../Biff_structures/BiffString.h"
namespace XLS
{

View File

@ -45,11 +45,14 @@ Feat::~Feat()
{
}
BaseObjectPtr Feat::clone()
{
return BaseObjectPtr(new Feat(*this));
}
// ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
// ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
// ISFFACTOID = 0x0004, // Specifies the smart tag type.
// ISFLIST = 0x0005, // Specifies the list type.
void Feat::readFields(CFRecord& record)
{
@ -72,17 +75,18 @@ void Feat::readFields(CFRecord& record)
switch(isf)
{
case SharedFeatureType::ISFPROTECTION:
record >> protection;
case 0x0002://ISFPROTECTION:
is_object = BiffStructurePtr(new FeatProtection);
break;
case SharedFeatureType::ISFFEC2:
record >> formula_err;
case 0x0003://ISFFEC2:
is_object = BiffStructurePtr(new FeatFormulaErr2);
break;
case SharedFeatureType::ISFFACTOID:
record >> smart_tag;
case 0x0004://ISFFACTOID:
is_object = BiffStructurePtr(new FeatSmartTag);
break;
}
if (is_object)
is_object->load(record);
}
} // namespace XLS

View File

@ -54,16 +54,13 @@ public:
static const ElementType type = typeFeat;
SharedFeatureType isf;
_UINT16 isf;
_UINT16 cref;
_UINT32 cbFeatData;
BiffStructurePtrVector refs;
std::wstring sqref;
FeatProtection protection;
FeatFormulaErr2 formula_err;
FeatSmartTag smart_tag;
BiffStructurePtr is_object;
};
} // namespace XLS

View File

@ -63,10 +63,10 @@ void FeatHdr::readFields(CFRecord& record)
{
switch(isf)
{
case SharedFeatureType::ISFPROTECTION:
case 0x0002://ISFPROTECTION:
record >> protection;
break;
case SharedFeatureType::ISFFACTOID:
case 0x0004://ISFFACTOID:
if(is_contained_in_Globals)
{
record >> prop;

View File

@ -55,12 +55,13 @@ public:
static const ElementType type = typeFeatHdr;
_UINT16 isf;
_UINT32 cbHdrData;
EnhancedProtection protection;
OSHARED::PropertyBagStore prop;
//-----------------------------
bool is_contained_in_Globals;
SharedFeatureType isf;
_UINT32 cbHdrData;
EnhancedProtection protection;
OSHARED::PropertyBagStore prop;
};
} // namespace XLS

View File

@ -54,6 +54,12 @@ void FeatHdr11::readFields(CFRecord& record)
{
record >> frt;
record >> isf;
// ISFPROTECTION = 0x0002, // Specifies the enhanced protection type.
// ISFFEC2 = 0x0003, // Specifies the ignored formula errors type.
// ISFFACTOID = 0x0004, // Specifies the smart tag type.
// ISFLIST = 0x0005, // Specifies the list type.
record.skipNunBytes(1); // reserved1
record.skipNunBytes(4); // reserved2
record.skipNunBytes(4); // reserved3

View File

@ -32,13 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/FrtHeader.h>
#include "../Biff_structures/FrtHeader.h"
namespace XLS
{
// Logical representation of FeatHdr11 record in BIFF8
class FeatHdr11: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(FeatHdr11)
@ -48,18 +46,14 @@ public:
~FeatHdr11();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeFeatHdr11;
public:
FrtHeader frt;
SharedFeatureType isf;
_UINT32 idListNext;
FrtHeader frt;
_UINT16 isf;
_UINT32 idListNext;
};

View File

@ -39,12 +39,10 @@ Feature11::Feature11()
{
}
Feature11::~Feature11()
{
}
BaseObjectPtr Feature11::clone()
{
return BaseObjectPtr(new Feature11(*this));
@ -54,25 +52,21 @@ void Feature11::readFields(CFRecord& record)
{
record >> frtRefHeaderU;
record >> isf;
record.skipNunBytes(1); // reserved1
record.skipNunBytes(4); // reserved2
record >> cref2;
record >> cbFeatData;
record.skipNunBytes(2); // reserved3
unsigned short _isf = isf;
unsigned short _cref2 = cref2;
unsigned int _cbFeatData = cbFeatData;
std::wstring sqref_str;
for (int i = 0; i < cref2 ; ++i)
{
Ref8U reff;
record >> reff;
refs2.push_back(BiffStructurePtr(new Ref8U(reff)));
sqref_str += std::wstring (reff.toString().c_str()) + ((i == cref2 - 1) ? L"" : L" ");
sqref += reff.toString() + ((i == cref2 - 1) ? L"" : L" ");
}
sqref = sqref_str;
record >> rgbFeat;
}

View File

@ -32,15 +32,14 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/FrtRefHeaderU.h>
#include <Logic/Biff_structures/CellRangeRef.h>
#include <Logic/Biff_structures/TableFeatureType.h>
#include "../Biff_structures/FrtRefHeaderU.h"
#include "../Biff_structures/CellRangeRef.h"
#include "../Biff_structures/TableFeatureType.h"
namespace XLS
{
// Logical representation of Feature11 record in BIFF8
class Feature11: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Feature11)
@ -53,7 +52,7 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeFeature11;
static const ElementType type = typeFeature11;
FrtRefHeaderU frtRefHeaderU;
_UINT16 isf;
@ -62,7 +61,7 @@ public:
BiffStructurePtrVector refs2;
std::wstring sqref;
TableFeatureType rgbFeat;
TableFeatureType rgbFeat;
};
} // namespace XLS

View File

@ -39,12 +39,10 @@ Feature12::Feature12()
{
}
Feature12::~Feature12()
{
}
BaseObjectPtr Feature12::clone()
{
return BaseObjectPtr(new Feature12(*this));
@ -53,6 +51,7 @@ BaseObjectPtr Feature12::clone()
void Feature12::readFields(CFRecord& record)
{
feature11.readFields(record);
}

View File

@ -32,12 +32,12 @@
#pragma once
#include "BiffRecordContinued.h"
#include "Feature11.h"
namespace XLS
{
// Logical representation of Feature12 record in BIFF8
class Feature12: public BiffRecordContinued
{
BIFF_RECORD_DEFINE_TYPE_INFO(Feature12)
@ -47,12 +47,12 @@ public:
~Feature12();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeFeature12;
static const ElementType type = typeFeature12;
Feature11 feature11;
};
} // namespace XLS

View File

@ -138,30 +138,13 @@ int Font::serialize_rPr(std::wostream & stream, bool rtl, bool defRPr, std::wstr
}
else
CP_XML_ATTR(L"i", false);
//if (bCharSet.value())
//{
// CP_XML_NODE(L"charset")
// {
// CP_XML_ATTR(L"val", bCharSet);
// }
//}
switch(sss)
{
case 1: CP_XML_ATTR(L"cap", L"all");break;
case 2: CP_XML_ATTR(L"cap", L"small");break;
}
//if ((fCondense.value()) && (*fCondense.value()))
//{
// CP_XML_NODE(L"condense")
// {
// CP_XML_ATTR(L"val", (int)(*fCondense.value()));
// }
//}
//if ((fExtend.value()) && (fExtend))
// {
// CP_XML_NODE(L"extend")
// {
// CP_XML_ATTR(L"val", fExtend);
// }
// }
if ( (icv < 0x7fff) || color_ext.enabled )
{
if (color_ext.enabled )
@ -236,66 +219,7 @@ int Font::serialize_rPr(std::wostream & stream, bool rtl, bool defRPr, std::wstr
{
CP_XML_NODE(namespace_ + L"rtl");
}
//if ((fOutline.value()) && (fOutline))
// {
// CP_XML_NODE(L"outline")
// {
// CP_XML_ATTR(L"val", fOutline);
// }
// }
//if (font.scheme)
//{
// CP_XML_NODE(L"scheme")
// {
// CP_XML_ATTR(L"val", *font.scheme);
// }
//}
//if ((fShadow.value()) && (fShadow))
// {
// CP_XML_NODE(L"shadow")
// {
// CP_XML_ATTR(L"val", fShadow);
// }
// }
//if ((fStrikeOut.value()) && (fStrikeOut))
//{
// CP_XML_NODE(L"strike")
// {
// CP_XML_ATTR(L"val", fStrikeOut);
// }
//}
// if ((uls.value()) && (*uls.value() > 0))
// {
// CP_XML_NODE(L"u")
// {
//switch(uls)
//{
// case 1: CP_XML_ATTR(L"val", "single");break;
// case 2: CP_XML_ATTR(L"val", "double");break;
// case 33: CP_XML_ATTR(L"val", "singleAccounting");break;
// case 34: CP_XML_ATTR(L"val", "doubleAccounting");break;
//}
// }
// }
// if ((sss.value()) && (*sss.value() > 0))
// {
// CP_XML_NODE(L"vertAlign")
// {
//switch(*sss.value())
//{
// case 1: CP_XML_ATTR(L"val", L"superscript");break;
// case 2: CP_XML_ATTR(L"val", L"subscript");break;
//}
//
// }
// }
}
}
return 0;

View File

@ -36,7 +36,6 @@
namespace XLS
{
// Logical representation of InterfaceEnd record in BIFF8
class InterfaceEnd: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(InterfaceEnd)
@ -47,6 +46,7 @@ public:
BaseObjectPtr clone();
static const ElementType type = typeInterfaceEnd;
void readFields(CFRecord& record);

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of LeftMargin record in BIFF8
class LeftMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(LeftMargin)
@ -50,10 +49,9 @@ public:
static const ElementType type = typeLeftMargin;
void readFields(CFRecord& record);
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};

View File

@ -43,12 +43,10 @@ List12::List12()
{
}
List12::~List12()
{
}
BaseObjectPtr List12::clone()
{
return BaseObjectPtr(new List12(*this));

View File

@ -31,6 +31,7 @@
*/
#include "MsoDrawing.h"
#include "../Biff_structures/ODRAW/OfficeArtRecord.h"
namespace XLS
{
@ -78,13 +79,24 @@ void MsoDrawing::readFields()
void MsoDrawing::readFields(CFRecord& record)
{
record >> rgChildRec;
isReading = true;
if (record.getRdPtr() < record.getDataSize())
ODRAW::OfficeArtRecordHeader rh_test;
record >> rh_test;
record.RollRdPtrBack(8);//sizeof(OfficeArtRecordHeader)
if (rh_test.recType == 0xF002) //OfficeArtDgContainer
{
record >> rgChildRec;
isReading = true;
}
else if ((rh_test.recType & 0xF000) == 0xF000)
{
//074_JKH.OPEN.INFO.PRICE.VO_зПТПДУЛЙЕ ПЛТХЗБ юЕМСВЙОУЛПК ПВМБУФЙ_пбп юЕМСВЙОУЛПЕ БЧЙБРТЕДРТЙСФЙЕ.xls
rgChildRec.rh_own.recLen = record.getDataSize();
rgChildRec.loadFields(record);
isReading = true;
}
else
{
int g = 0;
}
}

View File

@ -32,7 +32,7 @@
#pragma once
#include "BiffRecordSplit.h"
#include <Logic/Biff_structures/ODRAW/OfficeArtDgContainer.h>
#include "../Biff_structures/ODRAW/OfficeArtDgContainer.h"
namespace XLS
{

View File

@ -83,12 +83,9 @@ int Number::serialize(std::wostream & stream)
{
CP_XML_ATTR(L"s", cell.ixfe - global_info_->cellStyleXfs_count);
}
if (num.value())
CP_XML_NODE(L"v")
{
CP_XML_NODE(L"v")
{
CP_XML_STREAM() << STR::double2str(num);
}
CP_XML_STREAM() << std::to_wstring(num.data.value);
}
}
}

View File

@ -32,14 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/CellOffsetResender.h>
#include <Logic/Biff_structures/Cell.h>
#include "../Biff_structures/CellOffsetResender.h"
#include "../Biff_structures/Cell.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of Number record in BIFF8
class Number: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Number)
@ -59,13 +58,11 @@ public:
const CellRef getLocation() const;
//-----------------------------
GlobalWorkbookInfoPtr global_info_;
CellOffsetResender resender;
Cell cell;
BIFF_DOUBLE num;
Xnum num;
//-----------------------------
GlobalWorkbookInfoPtr global_info_;
};
} // namespace XLS

View File

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

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of Password record in BIFF8
class Password: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Password)
@ -47,7 +45,6 @@ public:
~Password();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -32,12 +32,10 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of RightMargin record in BIFF8
class RightMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(RightMargin)
@ -48,14 +46,12 @@ public:
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeRightMargin;
static const ElementType type = typeRightMargin;
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};
} // namespace XLS

View File

@ -81,7 +81,7 @@ int SIIndex::serialize(std::wostream & _stream, int idx, const CellRef & in_ref)
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", idx++);
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num; }
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num.data.value; }
}
res = 1;
}
@ -122,7 +122,7 @@ int SIIndex::serialize(std::wostream & _stream, ChartParsedFormula & in_ref)
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", idx++);
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << number->num; }
CP_XML_NODE(L"c:v") { CP_XML_STREAM() << std::to_wstring(number->num.data.value); }
}
}
}

View File

@ -63,7 +63,7 @@ void SXVI::readFields(CFRecord& record)
if (cchName > 0 && cchName < 0xFFFF)
{
stName.setSize(cchName);
stName.load(record);
record >> stName;
}
}
@ -79,6 +79,11 @@ int SXVI::serialize(std::wostream & strm)
if (fHideDetail)CP_XML_ATTR(L"sd", 0);
if (fFormula) CP_XML_ATTR(L"f", 1);
if (!stName.value().empty())
{
CP_XML_ATTR(L"n", stName.value());
}
if (itmType == 0)
{
CP_XML_ATTR(L"x", iCache);

View File

@ -32,6 +32,7 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
@ -55,7 +56,7 @@ public:
unsigned char sertm;
unsigned char ebsrc;
unsigned char fTeeTop;
BIFF_DOUBLE numValue;
Xnum numValue;
_UINT16 cnum;
};

View File

@ -32,13 +32,12 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/ChartNumNillable.h>
#include "../Biff_structures/ChartNumNillable.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of SerAuxTrend record in BIFF8
class SerAuxTrend: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(SerAuxTrend)
@ -48,20 +47,19 @@ public:
~SerAuxTrend();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeSerAuxTrend;
//-----------------------------
unsigned char regt;
unsigned char ordUser;
ChartNumNillable numIntercept;
unsigned char fEquation;
unsigned char fRSquared;
BIFF_DOUBLE numForecast;
BIFF_DOUBLE numBackcast;
unsigned char regt;
unsigned char ordUser;
ChartNumNillable numIntercept;
unsigned char fEquation;
unsigned char fRSquared;
Xnum numForecast;
Xnum numBackcast;
};

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of Setup record in BIFF8
class Setup: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Setup)
@ -73,8 +72,8 @@ public:
_UINT16 iRes;
_UINT16 iVRes;
BIFF_DOUBLE numHdr;
BIFF_DOUBLE numFtr;
Xnum numHdr;
Xnum numFtr;
_UINT16 iCopies;
};

View File

@ -31,8 +31,7 @@
*/
#include "Theme.h"
#include <fstream>
#include <iostream> // endl
#include "../../../DesktopEditor/common/File.h"
namespace XLS
{
@ -59,13 +58,15 @@ void Theme::readFields(CFRecord& record)
{
//default theme
}
else if (dwThemeVersion == 0)
//else if (dwThemeVersion == 0)
else
{
nThemeDataSize = record.getDataSize() - record.getRdPtr();
pThemeData = boost::shared_array<char>(new char[nThemeDataSize]);
memcpy(pThemeData.get(), record.getCurData<char>(), nThemeDataSize);
record.skipNunBytes(nThemeDataSize);
}
}

View File

@ -32,12 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/Xnum.h"
namespace XLS
{
// Logical representation of TopMargin record in BIFF8
class TopMargin: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(TopMargin)
@ -50,10 +49,10 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeTopMargin;
static const ElementType type = typeTopMargin;
//-----------------------------
BIFF_DOUBLE num;
Xnum num;
};

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