mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-27 15:51:51 +08:00
Compare commits
35 Commits
core-linux
...
core-win-3
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d524369b8 | |||
| e78fc0befc | |||
| d9986d09cd | |||
| bd67f4bf1c | |||
| 475bfaf93d | |||
| 1a8af4d8ed | |||
| cdf8dc7a4c | |||
| d71552bddd | |||
| 548c5ab608 | |||
| 6a01384023 | |||
| d70f36e36d | |||
| f65984f079 | |||
| 5b48a7a330 | |||
| 1496aece57 | |||
| 60cf51ad0d | |||
| 8e7231b322 | |||
| 2b339b6842 | |||
| fb0dbfc231 | |||
| 756613e883 | |||
| ede03fafea | |||
| bdec91bfd5 | |||
| 260c2edd21 | |||
| 3eeec8fc67 | |||
| ba6c7e8151 | |||
| 41a213491e | |||
| b599a6bc43 | |||
| a0fd139027 | |||
| 48852bc618 | |||
| 20b781cb7e | |||
| 704b3b709f | |||
| e4674915c2 | |||
| 51fe936e5f | |||
| d8b177411f | |||
| 717b628055 | |||
| e7bbbec0de |
@ -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;
|
||||
|
||||
@ -48,6 +48,8 @@
|
||||
#include "OleObjectMapping.h"
|
||||
#include "ConversionContext.h"
|
||||
#include "IMapping.h"
|
||||
#include "FormFieldData.h"
|
||||
#include "FormFieldDataMapping.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
|
||||
170
ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp
Normal file
170
ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
126
ASCOfficeDocFile/DocDocxConverter/FormFieldData.h
Normal file
126
ASCOfficeDocFile/DocDocxConverter/FormFieldData.h
Normal 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;
|
||||
|
||||
};
|
||||
}
|
||||
87
ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h
Normal file
87
ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h
Normal 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;
|
||||
};
|
||||
}
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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>();
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
>
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -442,6 +442,10 @@
|
||||
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
|
||||
>
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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)
|
||||
{
|
||||
@ -7893,6 +7909,7 @@ namespace BinDocxRW
|
||||
|
||||
oBinaryDocumentTableWriter.pSectPr = pFirstSectPr;
|
||||
oBinaryDocumentTableWriter.pBackground = poDocument->m_oBackground.GetPointer();
|
||||
oBinaryDocumentTableWriter.poDocument = poDocument;
|
||||
|
||||
oBinaryDocumentTableWriter.m_bWriteSectPr = true;
|
||||
//Write Vba
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough=""
|
||||
WarningLevel="3"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
AdditionalIncludeDirectories=""
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;_LIB;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough=""
|
||||
WarningLevel="3"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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);
|
||||
};
|
||||
|
||||
@ -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
@ -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);
|
||||
|
||||
@ -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()
|
||||
{
|
||||
|
||||
@ -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 ();
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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());
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;}
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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"
|
||||
>
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of AxisLine record in BIFF8
|
||||
class AxisLine: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(AxisLine)
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -184,9 +184,9 @@ int TxO::serialize_vml (std::wostream & _stream)
|
||||
{
|
||||
iFmt = run->formatRun.ifnt;
|
||||
Font *font = NULL;
|
||||
if ((global_info->m_arFonts) && (iFmt >=0 && iFmt < global_info->m_arFonts->size()))
|
||||
if (iFmt >= 0 && iFmt < global_info->m_arFonts.size())
|
||||
{
|
||||
font = dynamic_cast<Font *>(global_info->m_arFonts->at(iFmt).get());
|
||||
font = dynamic_cast<Font *>(global_info->m_arFonts[iFmt].get());
|
||||
}
|
||||
if (font)
|
||||
{
|
||||
@ -281,12 +281,11 @@ int TxO::serialize (std::wostream & _stream)
|
||||
int TxO::serialize_rPr (std::wostream & _stream, int iFmt, std::wstring namespace_)
|
||||
{
|
||||
if (!global_info) return 0;
|
||||
if (!global_info->m_arFonts) return 0;
|
||||
|
||||
int sz = global_info->m_arFonts->size();
|
||||
int sz = global_info->m_arFonts.size();
|
||||
if (iFmt - 1 >= sz || iFmt < 1) return 0;
|
||||
|
||||
Font * font = dynamic_cast<Font*>(global_info->m_arFonts->at(iFmt-1).get());
|
||||
Font * font = dynamic_cast<Font*>(global_info->m_arFonts[iFmt-1].get());
|
||||
|
||||
if (!font) return 0;
|
||||
|
||||
|
||||
@ -240,9 +240,9 @@ void StyleXF::Update(XFProp* xfProp)
|
||||
case 0x0025:
|
||||
{
|
||||
font_id = *byte_->value();
|
||||
if ((global_info->m_arFonts) && (font_id >=0 && font_id < global_info->m_arFonts->size()))
|
||||
if (font_id >=0 && font_id < global_info->m_arFonts.size())
|
||||
{
|
||||
font = dynamic_cast<Font*>(global_info->m_arFonts->at(font_id).get());
|
||||
font = dynamic_cast<Font*>(global_info->m_arFonts[font_id].get());
|
||||
}
|
||||
|
||||
}break;
|
||||
|
||||
@ -150,16 +150,15 @@ int XLUnicodeRichExtendedString::serialize (std::wostream & _stream)
|
||||
int XLUnicodeRichExtendedString::serialize_rPr (std::wostream & _stream, int iFmt)
|
||||
{
|
||||
if (!pGlobalWorkbookInfoPtr) return 0;
|
||||
if (!pGlobalWorkbookInfoPtr->m_arFonts) return 0;
|
||||
|
||||
int sz = pGlobalWorkbookInfoPtr->m_arFonts->size();
|
||||
int sz = pGlobalWorkbookInfoPtr->m_arFonts.size();
|
||||
if (iFmt -1 > sz || iFmt < 1) return 0;
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"rPr")
|
||||
{
|
||||
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts->at(iFmt-1).get());
|
||||
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts[iFmt-1].get());
|
||||
|
||||
if (font) font->serialize_properties(CP_XML_STREAM(), true);
|
||||
}
|
||||
|
||||
@ -347,12 +347,11 @@ int ATTACHEDLABEL::serialize(std::wostream & _stream, bool isPosition)
|
||||
int ATTACHEDLABEL::serialize_rPr (std::wostream & _stream, int iFmt, bool rtl, bool defRPr)
|
||||
{
|
||||
if (!pGlobalWorkbookInfoPtr) return 0;
|
||||
if (!pGlobalWorkbookInfoPtr->m_arFonts) return 0;
|
||||
|
||||
int sz = pGlobalWorkbookInfoPtr->m_arFonts->size();
|
||||
int sz = pGlobalWorkbookInfoPtr->m_arFonts.size();
|
||||
if (iFmt -1 > sz || iFmt < 1) return 0;
|
||||
|
||||
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts->at(iFmt-1).get());
|
||||
Font * font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts[iFmt-1].get());
|
||||
|
||||
Text * text_props = dynamic_cast<Text*>(m_TextProperties.get());
|
||||
|
||||
|
||||
@ -259,14 +259,13 @@ int AXS::serialize(std::wostream & _stream)
|
||||
|
||||
int AXS::serialize_rPr (std::wostream & _stream, int iFmt, _CP_OPT(unsigned int) color, bool rtl, bool defRPr)
|
||||
{
|
||||
if (!pGlobalWorkbookInfoPtr) return 0;
|
||||
if (!pGlobalWorkbookInfoPtr->m_arFonts) return 0;
|
||||
if (!pGlobalWorkbookInfoPtr) return 0;
|
||||
|
||||
Font * font = NULL;
|
||||
int sz = pGlobalWorkbookInfoPtr->m_arFonts->size();
|
||||
int sz = pGlobalWorkbookInfoPtr->m_arFonts.size();
|
||||
|
||||
if (iFmt > 0 && iFmt <= sz)
|
||||
font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts->at(iFmt-1).get());
|
||||
font = dynamic_cast<Font*>(pGlobalWorkbookInfoPtr->m_arFonts.at(iFmt-1).get());
|
||||
|
||||
if (font)
|
||||
{
|
||||
|
||||
@ -31,6 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "CRT.h"
|
||||
#include "LD.h"
|
||||
#include "DROPBAR.h"
|
||||
#include "SS.h"
|
||||
#include "SHAPEPROPS.h"
|
||||
#include "DFTTEXT.h"
|
||||
|
||||
#include "../Biff_records/ChartFormat.h"
|
||||
#include "../Biff_records/Begin.h"
|
||||
#include "../Biff_records/Bar.h"
|
||||
@ -46,14 +52,9 @@
|
||||
#include "../Biff_records/CrtLink.h"
|
||||
#include "../Biff_records/SeriesList.h"
|
||||
#include "../Biff_records/Chart3d.h"
|
||||
#include "../Biff_unions/LD.h"
|
||||
#include "../Biff_unions/DROPBAR.h"
|
||||
#include "../Biff_records/CrtLine.h"
|
||||
#include "../Biff_records/LineFormat.h"
|
||||
#include "../Biff_unions/DFTTEXT.h"
|
||||
#include "../Biff_records/DataLabExtContents.h"
|
||||
#include "../Biff_unions/SS.h"
|
||||
#include "../Biff_unions/SHAPEPROPS.h"
|
||||
#include "../Biff_records/End.h"
|
||||
#include "../Biff_records/ValueRange.h"
|
||||
#include "../Biff_records/Tick.h"
|
||||
@ -65,6 +66,7 @@
|
||||
#include "../Biff_records/PlotArea.h"
|
||||
#include "../Biff_records/DropBar.h"
|
||||
#include "../Biff_records/CrtMlFrt.h"
|
||||
#include "../Biff_records/DataFormat.h"
|
||||
|
||||
#include "../Biff_records/StartObject.h"
|
||||
#include "../Biff_records/EndObject.h"
|
||||
|
||||
@ -76,11 +76,16 @@ const bool DFTTEXT::loadContent(BinProcessor& proc)
|
||||
m_DefaultText = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
if (proc.optional<DataLabExtContents>())
|
||||
{
|
||||
m_DataLabExtContents = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
if (!m_DefaultText && !m_DataLabExtContents)
|
||||
return false;
|
||||
|
||||
if (proc.mandatory<ATTACHEDLABEL>())
|
||||
{
|
||||
m_ATTACHEDLABEL = elements_.back();
|
||||
@ -89,10 +94,7 @@ const bool DFTTEXT::loadContent(BinProcessor& proc)
|
||||
|
||||
if (proc.optional<EndObject>()) elements_.pop_back();
|
||||
|
||||
if (m_DefaultText || m_DataLabExtContents)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DROPBAR union of records
|
||||
class DROPBAR: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DROPBAR)
|
||||
|
||||
@ -31,15 +31,17 @@
|
||||
*/
|
||||
|
||||
#include "DROPBAR.h"
|
||||
#include <Logic/Biff_records/DropBar.h>
|
||||
#include <Logic/Biff_records/Begin.h>
|
||||
#include <Logic/Biff_records/LineFormat.h>
|
||||
#include <Logic/Biff_records/AreaFormat.h>
|
||||
#include <Logic/Biff_unions/GELFRAME.h>
|
||||
#include <Logic/Biff_unions/SHAPEPROPS.h>
|
||||
#include <Logic/Biff_records/End.h>
|
||||
#include <Logic/Biff_records/StartObject.h>
|
||||
#include <Logic/Biff_records/EndObject.h>
|
||||
#include "GELFRAME.h"
|
||||
#include "SHAPEPROPS.h"
|
||||
|
||||
#include "../Biff_records/DropBar.h"
|
||||
#include "../Biff_records/LineFormat.h"
|
||||
#include "../Biff_records/AreaFormat.h"
|
||||
|
||||
#include "../Biff_records/Begin.h"
|
||||
#include "../Biff_records/End.h"
|
||||
#include "../Biff_records/StartObject.h"
|
||||
#include "../Biff_records/EndObject.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -72,7 +74,7 @@ const bool DROPBAR::loadContent(BinProcessor& proc)
|
||||
|
||||
if (proc.mandatory<Begin>()) elements_.pop_back();
|
||||
|
||||
if (proc.mandatory<LineFormat>())
|
||||
if (proc.optional<LineFormat>())
|
||||
{
|
||||
m_LineFormat = elements_.back(); elements_.pop_back();
|
||||
}
|
||||
@ -81,11 +83,10 @@ const bool DROPBAR::loadContent(BinProcessor& proc)
|
||||
elements_.pop_back();
|
||||
if (proc.mandatory<EndObject>()) elements_.pop_back();
|
||||
}
|
||||
if (proc.mandatory<AreaFormat>())
|
||||
if (proc.optional<AreaFormat>())
|
||||
{
|
||||
m_AreaFormat = elements_.back(); elements_.pop_back();
|
||||
}
|
||||
|
||||
if (proc.optional<GELFRAME>())
|
||||
{
|
||||
m_GELFRAME = elements_.back(); elements_.pop_back();
|
||||
|
||||
@ -71,7 +71,6 @@ BaseObjectPtr FORMATTING::clone()
|
||||
const bool FORMATTING::loadContent(BinProcessor& proc)
|
||||
{
|
||||
global_info = proc.getGlobalWorkbookInfo();
|
||||
global_info->m_arFonts = &m_arFonts;
|
||||
|
||||
int count = 0;
|
||||
count = proc.repeated<Font>(0, 510); // Wrong records sequence workaround (originally at least one Font is mandatory)
|
||||
@ -80,7 +79,7 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
|
||||
Font *font = dynamic_cast<Font *>(elements_.front().get());
|
||||
if ((font) && (font->correct))
|
||||
{
|
||||
m_arFonts.push_back(elements_.front());
|
||||
global_info->m_arFonts.push_back(elements_.front());
|
||||
}
|
||||
elements_.pop_front();
|
||||
count--;
|
||||
@ -95,10 +94,10 @@ const bool FORMATTING::loadContent(BinProcessor& proc)
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
count = proc.repeated<Font>(0, 510); // Wrong records sequence workaround (originally Font follows by Format)
|
||||
int countFonts = m_arFonts.size();
|
||||
int countFonts = global_info->m_arFonts.size();
|
||||
while(count > 0)
|
||||
{
|
||||
m_arFonts.insert(m_arFonts.begin()+countFonts, elements_.back());
|
||||
global_info->m_arFonts.insert(global_info->m_arFonts.begin() + countFonts, elements_.back());
|
||||
elements_.pop_back();
|
||||
count--;
|
||||
}
|
||||
@ -235,20 +234,23 @@ int FORMATTING::serialize1(std::wostream & stream)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_arFonts.size() > 0)
|
||||
if (!global_info->m_arFonts.empty())
|
||||
{
|
||||
CP_XML_NODE(L"fonts")
|
||||
{
|
||||
CP_XML_ATTR(L"count", m_arFonts.size());
|
||||
for (size_t i = 0 ; i < m_arFonts.size(); i++)
|
||||
CP_XML_ATTR(L"count", global_info->m_arFonts.size());
|
||||
|
||||
for (size_t i = 0; i < global_info->m_arFonts.size(); i++)
|
||||
{
|
||||
Font * font = dynamic_cast<Font*>(m_arFonts[i].get());
|
||||
Font * font = dynamic_cast<Font*>(global_info->m_arFonts[i].get());
|
||||
|
||||
std::map<int, FillInfoExt>::iterator it = global_info->fonts_color_ext.find(i);
|
||||
if (font && (it!=global_info->fonts_color_ext.end()))
|
||||
|
||||
if (font && (it != global_info->fonts_color_ext.end()))
|
||||
{
|
||||
font->set_color_ext(it->second);
|
||||
}
|
||||
m_arFonts[i]->serialize(CP_XML_STREAM());
|
||||
global_info->m_arFonts[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public:
|
||||
BaseObjectPtr m_Styles;
|
||||
BaseObjectPtr m_XFS;
|
||||
std::vector<BaseObjectPtr> m_arFormats;
|
||||
std::vector<BaseObjectPtr> m_arFonts;
|
||||
//std::vector<BaseObjectPtr> m_arFonts; in global
|
||||
BaseObjectPtr m_Palette;
|
||||
BaseObjectPtr m_ClrtClient;
|
||||
std::vector<BaseObjectPtr> m_arDXF;
|
||||
|
||||
@ -186,9 +186,9 @@ void GlobalWorkbookInfo::GetDigitFontSizePixels()
|
||||
}
|
||||
|
||||
defaultDigitFontSize = std::pair<float, float>(7,8);
|
||||
if (m_arFonts->size() < 1) return;
|
||||
if (m_arFonts.empty()) return;
|
||||
|
||||
Font * font = dynamic_cast<Font*>(m_arFonts->at(0).get());
|
||||
Font * font = dynamic_cast<Font*>(m_arFonts[0].get());
|
||||
if (!font) return;
|
||||
|
||||
std::wstring fontName = font->fontName.value();
|
||||
|
||||
@ -97,7 +97,7 @@ public:
|
||||
std::map<int, int> fonts_charsets;
|
||||
std::map<int, std::wstring> colors_palette;
|
||||
|
||||
std::vector<BaseObjectPtr> *m_arFonts;
|
||||
std::vector<BaseObjectPtr> m_arFonts;
|
||||
|
||||
unsigned int current_sheet;
|
||||
|
||||
|
||||
@ -333,7 +333,6 @@ const bool GlobalsSubstream::loadContent(BinProcessor& proc)
|
||||
if (fmts)
|
||||
{
|
||||
global_info_->cellStyleDxfs_count = fmts->m_arDXF.size();
|
||||
global_info_->m_arFonts = &fmts->m_arFonts;
|
||||
}
|
||||
}
|
||||
//else
|
||||
@ -626,9 +625,7 @@ void GlobalsSubstream::UpdateXti()
|
||||
|
||||
ExternSheet* extern_sheet = dynamic_cast<ExternSheet*>(SUPP->m_ExternSheet.get());
|
||||
|
||||
if (!extern_sheet) continue;
|
||||
|
||||
for (size_t i = 0; i < extern_sheet->rgXTI.size(); i++)
|
||||
for (size_t i = 0; extern_sheet && i < extern_sheet->rgXTI.size(); i++)
|
||||
{
|
||||
XTI* xti = dynamic_cast<XTI*>(extern_sheet->rgXTI[i].get());
|
||||
if (!xti) continue;
|
||||
@ -672,9 +669,17 @@ void GlobalsSubstream::UpdateXti()
|
||||
val.link = XMLSTUFF::xti_indexes2sheet_name(xti->itabFirst, xti->itabLast, info->rgst, val.link);
|
||||
}
|
||||
}
|
||||
|
||||
global_info_->arXti.push_back(val);
|
||||
}
|
||||
if (!extern_sheet && !SUPP->m_arExternName.empty())
|
||||
{
|
||||
GlobalWorkbookInfo::_xti val;
|
||||
|
||||
val.iSup = s;
|
||||
val.pNames = &SUPP->arNames;
|
||||
|
||||
global_info_->arXti.push_back(val);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
|
||||
62
Common/3dParty/cef/download.ps1
Normal file
62
Common/3dParty/cef/download.ps1
Normal file
@ -0,0 +1,62 @@
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
# download a file
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
function Download-File
|
||||
{
|
||||
param ([string]$url,[string]$file)
|
||||
|
||||
$downloadRequired = $true
|
||||
if (Test-Path $file)
|
||||
{
|
||||
$localModified = (Get-Item $file).CreationTime
|
||||
$webRequest = [System.Net.HttpWebRequest]::Create($url)
|
||||
$webRequest.Method = "HEAD"
|
||||
$webResponse = $webRequest.GetResponse()
|
||||
$remoteLastModified = ($webResponse.LastModified) -as [DateTime]
|
||||
$webResponse.Close()
|
||||
|
||||
if ($remoteLastModified -gt $localModified)
|
||||
{
|
||||
Write-Host "$file is out of date"
|
||||
}
|
||||
else
|
||||
{
|
||||
$downloadRequired = $false
|
||||
}
|
||||
}
|
||||
|
||||
if ($downloadRequired)
|
||||
{
|
||||
$clnt = new-object System.Net.WebClient
|
||||
Write-Host "Downloading from $url to $file"
|
||||
$clnt.DownloadFile($url, $file)
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "$file is up to date."
|
||||
}
|
||||
|
||||
return $downloadRequired
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
# unzip a file
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
function RemoveCef
|
||||
{
|
||||
param([string]$outpath)
|
||||
|
||||
if (Test-Path $outpath)
|
||||
{
|
||||
Write-Host "Remove folder $outpath"
|
||||
Remove-Item $outpath -Force -Recurse
|
||||
}
|
||||
}
|
||||
|
||||
$output = Download-File -url $args[0] -file $args[1]
|
||||
if ($output)
|
||||
{
|
||||
RemoveCef -outpath $args[2]
|
||||
}
|
||||
@ -12,11 +12,7 @@ if defined TARGET (
|
||||
mkdir "%SCRIPTPATH%%PLATFORM%"
|
||||
cd "%SCRIPTPATH%%PLATFORM%"
|
||||
|
||||
if exist "cef_binary.7z" (
|
||||
echo "cef_binary.7z already downloaded"
|
||||
) else (
|
||||
Powershell.exe Invoke-WebRequest -OutFile cef_binary.7z http://d2ettrnqo7v976.cloudfront.net/cef/3163/%PLATFORM%/cef_binary.7z
|
||||
)
|
||||
Powershell.exe -executionpolicy remotesigned -file %SCRIPTPATH%download.ps1 http://d2ettrnqo7v976.cloudfront.net/cef/3163/%PLATFORM%/cef_binary.7z cef_binary.7z cef_binary
|
||||
|
||||
SET UNSIP_PROGRAMM="%ProgramFiles%\7-Zip\7z.exe"
|
||||
SET UNSIP_PROGRAMM2="%ProgramFiles(x86)%\7-Zip\7z.exe"
|
||||
|
||||
@ -8,7 +8,7 @@ platform=""
|
||||
|
||||
case "$os" in
|
||||
Linux*) platform="linux" ;;
|
||||
Darwin*) platform="mac" ;;
|
||||
Darwin*) platform="mac" ;;
|
||||
*) exit ;;
|
||||
esac
|
||||
|
||||
@ -35,22 +35,36 @@ echo ""
|
||||
else
|
||||
mkdir "build"
|
||||
fi
|
||||
cef_binary=cef_binary
|
||||
cef_arch=$cef_binary.7z
|
||||
cef_url=http://d2ettrnqo7v976.cloudfront.net/cef/3163/$platform$arch/$cef_arch
|
||||
|
||||
if [[ "$platform" == *"linux"* ]]
|
||||
then
|
||||
if [[ -f "cef_binary.7z" ]]
|
||||
then
|
||||
echo "cef_binary already downloaded"
|
||||
else
|
||||
wget http://d2ettrnqo7v976.cloudfront.net/cef/3163/$platform$arch/cef_binary.7z
|
||||
fi
|
||||
if [ -d cef_binary ]
|
||||
then
|
||||
echo "cef_binary already extracted"
|
||||
else
|
||||
|
||||
7z x -y cef_binary.7z
|
||||
fi
|
||||
cp -r -t build/ ./cef_binary/Release/* ./cef_binary/Resources/*
|
||||
chmod a+xr build/locales
|
||||
if [[ -f $cef_arch ]]
|
||||
then
|
||||
cef_mod_time=$(date -d"$(curl -sI $cef_url | awk '/Last-Modified/ {print ($3, $4, $5, $6, $7, $8)}')" +"%s")
|
||||
local_mod_time=$(stat -c %Y $cef_arch)
|
||||
if [[ $cef_mod_time -eq $local_mod_time ]]
|
||||
then
|
||||
echo "cef_binary already downloaded"
|
||||
else
|
||||
wget $cef_url -O $cef_arch
|
||||
rm -fr $cef_binary/
|
||||
fi
|
||||
else
|
||||
wget $cef_url
|
||||
rm -fr $cef_binary/
|
||||
fi
|
||||
|
||||
if [ -d $cef_binary ]
|
||||
then
|
||||
echo "cef_binary already extracted"
|
||||
else
|
||||
7z x -y $cef_arch
|
||||
fi
|
||||
|
||||
cp -r -t build/ ./$cef_binary/Release/* ./$cef_binary/Resources/*
|
||||
chmod a+xr build/locales
|
||||
fi
|
||||
|
||||
9678
Common/3dParty/cryptopp/cryptlib.vcproj
Normal file
9678
Common/3dParty/cryptopp/cryptlib.vcproj
Normal file
File diff suppressed because it is too large
Load Diff
22
Common/3dParty/v8/build.sh
Normal file → Executable file
22
Common/3dParty/v8/build.sh
Normal file → Executable file
@ -45,8 +45,6 @@ cp "./out/native/obj.target/third_party/icu/libicui18n.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/third_party/icu/libicuuc.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/third_party/icu/libicudata.a" "./../$platform$arch/"
|
||||
|
||||
cp "./third_party/icu/linux/icudtl_dat.S" "./../$platform$arch/"
|
||||
|
||||
cp "./third_party/icu/source/data/in/icudtl.dat" "./../$platform$arch/"
|
||||
fi
|
||||
|
||||
@ -54,17 +52,15 @@ if [[ "$platform" == *"mac"* ]]
|
||||
then
|
||||
CFLAGS="-fPIC" CXXFLAGS="-fPIC -stdlib=libc++" LDFLAGS="-stdlib=libc++" make native
|
||||
|
||||
cp "./out/native/libv8_base.a" "./../$platform$arch/"
|
||||
cp "./out/native/libv8_libbase.a" "./../$platform$arch/"
|
||||
cp "./out/native/libv8_libplatform.a" "./../$platform$arch/"
|
||||
cp "./out/native/libv8_nosnapshot.a" "./../$platform$arch/"
|
||||
cp "./out/native/libv8_external_snapshot.a" "./../$platform$arch/"
|
||||
ccp "./out/native/obj.target/tools/gyp/libv8_base.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/tools/gyp/libv8_libbase.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/tools/gyp/libv8_libplatform.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/tools/gyp/libv8_nosnapshot.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/tools/gyp/libv8_external_snapshot.a" "./../$platform$arch/"
|
||||
|
||||
cp "./out/native/libicui18n.a" "./../$platform$arch/"
|
||||
cp "./out/native/libicuuc.a" "./../$platform$arch/"
|
||||
cp "./out/native/icudtl.dat" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/third_party/icu/libicui18n.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/third_party/icu/libicuuc.a" "./../$platform$arch/"
|
||||
cp "./out/native/obj.target/third_party/icu/libicudata.a" "./../$platform$arch/"
|
||||
|
||||
cp "./out/native/libv8_libsampler.a" "./../$platform$arch/"
|
||||
|
||||
cp "./third_party/icu/mac/icudtl_dat.S" "./../$platform$arch/"
|
||||
cp "./third_party/icu/source/data/in/icudtl.dat" "./../$platform$arch/"
|
||||
fi
|
||||
|
||||
0
Common/3dParty/v8/fetch.sh
Normal file → Executable file
0
Common/3dParty/v8/fetch.sh
Normal file → Executable file
@ -22,8 +22,8 @@ core_linux {
|
||||
}
|
||||
|
||||
core_mac {
|
||||
LIBS += -L$$CORE_V8_PATH_LIBS -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
|
||||
LIBS += -L$$CORE_V8_PATH_LIBS -licui18n -licuuc -lv8_libsampler
|
||||
LIBS += -L$$CORE_V8_PATH_LIBS -lv8_base -lv8_libplatform -lv8_libbase -lv8_nosnapshot -lv8_external_snapshot
|
||||
LIBS += -L$$CORE_V8_PATH_LIBS -licui18n -licuuc -licudata
|
||||
|
||||
QMAKE_CXXFLAGS += -Wall -Wno-inconsistent-missing-override
|
||||
QMAKE_CFLAGS += -Wall -Wno-inconsistent-missing-override
|
||||
|
||||
@ -147,6 +147,7 @@ HEADERS += docxformatlib.h \
|
||||
../Source/DocxFormat/Media/Media.h \
|
||||
../Source/DocxFormat/Media/OleObject.h \
|
||||
../Source/DocxFormat/Media/Video.h \
|
||||
../Source/DocxFormat/Media/JsaProject.h \
|
||||
../Source/DocxFormat/Settings/Settings.h \
|
||||
../Source/DocxFormat/Settings/WebSettings.h \
|
||||
../Source/DocxFormat/App.h \
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
ProgramDataBaseFileName="$(IntDir)\DocxFormat.pdb"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
#include "Media/OleObject.h"
|
||||
#include "Media/ActiveX.h"
|
||||
#include "Media/VbaProject.h"
|
||||
#include "Media/JsaProject.h"
|
||||
#include "HeaderFooter.h"
|
||||
|
||||
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Theme.h"
|
||||
|
||||
@ -92,7 +92,6 @@ namespace OOX
|
||||
{
|
||||
return OOX::et_wp_effectExtent;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
@ -103,7 +102,6 @@ namespace OOX
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("b"), m_oB )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
public:
|
||||
SimpleTypes::CCoordinate m_oB;
|
||||
SimpleTypes::CCoordinate m_oL;
|
||||
SimpleTypes::CCoordinate m_oR;
|
||||
@ -122,9 +120,38 @@ namespace OOX
|
||||
virtual ~CPosH()
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"relativeFrom", m_oRelativeFrom );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("align") == sName )
|
||||
{
|
||||
m_oAlign = oNode.GetText();
|
||||
m_bAlign = true;
|
||||
}
|
||||
else if ( _T("posOffset") == sName )
|
||||
{
|
||||
m_oPosOffset = oNode.GetText();
|
||||
m_bAlign = false;
|
||||
}
|
||||
else if ( _T("pctPosHOffset") == sName )
|
||||
{
|
||||
m_oPctOffset = oNode.GetText();
|
||||
m_bAlign = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -179,7 +206,6 @@ namespace OOX
|
||||
{
|
||||
return OOX::et_wp_positionH;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
@ -187,7 +213,6 @@ namespace OOX
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("relativeFrom"), m_oRelativeFrom )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
public:
|
||||
bool IsAlign() const
|
||||
{
|
||||
return m_bAlign;
|
||||
@ -218,11 +243,38 @@ namespace OOX
|
||||
virtual ~CPosV()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"relativeFrom", m_oRelativeFrom );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("align") == sName )
|
||||
{
|
||||
m_oAlign = oNode.GetText();
|
||||
m_bAlign = true;
|
||||
}
|
||||
else if ( _T("posOffset") == sName )
|
||||
{
|
||||
m_oPosOffset = oNode.GetText();
|
||||
m_bAlign = false;
|
||||
}
|
||||
else if ( _T("pctPosVOffset") == sName )
|
||||
{
|
||||
m_oPctOffset = oNode.GetText();
|
||||
m_bAlign = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -276,16 +328,12 @@ namespace OOX
|
||||
{
|
||||
return OOX::et_wp_positionV;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("relativeFrom"), m_oRelativeFrom )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
bool IsAlign() const
|
||||
{
|
||||
return m_bAlign;
|
||||
@ -314,10 +362,27 @@ namespace OOX
|
||||
virtual ~CSizeRelH()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"relativeFrom", m_oRelativeFrom );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("pctHeight") == sName )
|
||||
{
|
||||
m_oPctWidth = oNode.GetText();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -382,10 +447,27 @@ namespace OOX
|
||||
virtual ~CSizeRelV()
|
||||
{
|
||||
}
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"relativeFrom", m_oRelativeFrom );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("pctHeight") == sName )
|
||||
{
|
||||
m_oPctHeight = oNode.GetText();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -482,11 +564,29 @@ namespace OOX
|
||||
virtual ~CWrapSquare()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"distB", m_oDistB );
|
||||
node.ReadAttributeBase( L"distL", m_oDistL );
|
||||
node.ReadAttributeBase( L"distR", m_oDistR );
|
||||
node.ReadAttributeBase( L"distT", m_oDistT );
|
||||
node.ReadAttributeBase( L"wrapText", m_oWrapText );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("effectExtents") == sName )
|
||||
m_oEffectExtent = oNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -503,7 +603,7 @@ namespace OOX
|
||||
m_oEffectExtent = oReader;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<wp:wrapSquare ");
|
||||
if(m_oWrapText.IsInit())
|
||||
@ -566,12 +666,35 @@ namespace OOX
|
||||
}
|
||||
m_arrLineTo.clear();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"edited", m_oEdited );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
|
||||
bool bStart = false;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("start") == sName )
|
||||
{
|
||||
m_oStart = oNode;
|
||||
bStart = true;
|
||||
}
|
||||
else if ( bStart && _T("lineTo") == sName )
|
||||
{
|
||||
ComplexTypes::Drawing::CPoint2D *oPoint = new ComplexTypes::Drawing::CPoint2D(oNode);
|
||||
if (oPoint) m_arrLineTo.push_back( oPoint );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -646,12 +769,29 @@ namespace OOX
|
||||
virtual ~CWrapThrough()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"distL", m_oDistL );
|
||||
node.ReadAttributeBase( L"distR", m_oDistR );
|
||||
node.ReadAttributeBase( L"wrapText", m_oWrapText );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("wrapPolygon") == sName )
|
||||
{
|
||||
m_oWrapPolygon = oNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -717,9 +857,25 @@ namespace OOX
|
||||
virtual ~CWrapTight()
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("wrapPolygon") == sName )
|
||||
{
|
||||
m_oWrapPolygon = oNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -785,9 +941,26 @@ namespace OOX
|
||||
virtual ~CWrapTopBottom()
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
node.ReadAttributeBase( L"distB", m_oDistB );
|
||||
node.ReadAttributeBase( L"distT", m_oDistT );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("effectExtents") == sName )
|
||||
m_oEffectExtent = oNode;
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -862,11 +1035,69 @@ namespace OOX
|
||||
virtual ~CAnchor()
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
ReadAttributes(node);
|
||||
m_eWrapType = anchorwrapUnknown;
|
||||
|
||||
// TO DO: Реализовать
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("docPr") == sName )
|
||||
m_oDocPr = oNode;
|
||||
else if ( _T("effectExtent") == sName )
|
||||
m_oEffectExtent = oNode;
|
||||
else if ( _T("extent") == sName )
|
||||
m_oExtent = oNode;
|
||||
else if ( _T("positionH") == sName )
|
||||
m_oPositionH = oNode;
|
||||
else if ( _T("positionV") == sName )
|
||||
m_oPositionV = oNode;
|
||||
else if ( _T("simplePos") == sName )
|
||||
m_oSimplePos = oNode;
|
||||
else if ( _T("sizeRelH") == sName )
|
||||
m_oSizeRelH = oNode;
|
||||
else if ( _T("sizeRelV") == sName )
|
||||
m_oSizeRelV = oNode;
|
||||
else if ( false == m_eWrapType.IsInit() )
|
||||
{
|
||||
if ( _T("wrapNone") == sName )
|
||||
{
|
||||
m_oWrapNone = oNode;
|
||||
m_eWrapType = anchorwrapNone;
|
||||
}
|
||||
else if ( _T("wrapSquare") == sName )
|
||||
{
|
||||
m_oWrapSquare = oNode;
|
||||
m_eWrapType = anchorwrapSquare;
|
||||
}
|
||||
else if ( _T("wrapThrough") == sName )
|
||||
{
|
||||
m_oWrapThrough = oNode;
|
||||
m_eWrapType = anchorwrapThrough;
|
||||
}
|
||||
else if ( _T("wrapTight") == sName )
|
||||
{
|
||||
m_oWrapTight = oNode;
|
||||
m_eWrapType = anchorwrapTight;
|
||||
}
|
||||
else if ( _T("wrapTopAndBottom") == sName )
|
||||
{
|
||||
m_oWrapTopAndBottom = oNode;
|
||||
m_eWrapType = anchorwrapTopAndBottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_oGraphic.fromXML(node);
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -985,6 +1216,20 @@ namespace OOX
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("simplePos"), m_bSimplePos )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
void ReadAttributes(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( L"allowOverlap", m_oAllowOverlap );
|
||||
oNode.ReadAttributeBase( L"behindDoc", m_oBehindDoc );
|
||||
oNode.ReadAttributeBase( L"distB", m_oDistB );
|
||||
oNode.ReadAttributeBase( L"distL", m_oDistL );
|
||||
oNode.ReadAttributeBase( L"distR", m_oDistR );
|
||||
oNode.ReadAttributeBase( L"distT", m_oDistT );
|
||||
oNode.ReadAttributeBase( L"hidden", m_oHidden );
|
||||
oNode.ReadAttributeBase( L"layoutInCell", m_oLayoutInCell );
|
||||
oNode.ReadAttributeBase( L"locked", m_oLocked );
|
||||
oNode.ReadAttributeBase( L"relativeHeight", m_oRelativeHeight );
|
||||
oNode.ReadAttributeBase( L"simplePos", m_bSimplePos );
|
||||
}
|
||||
public:
|
||||
nullable<EAnchorWrapType> m_eWrapType;
|
||||
|
||||
@ -1031,9 +1276,30 @@ namespace OOX
|
||||
virtual ~CInline()
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
ReadAttributes( node );
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring sName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if ( _T("docPr") == sName )
|
||||
m_oDocPr = oNode;
|
||||
else if ( _T("effectExtent") == sName )
|
||||
m_oEffectExtent = oNode;
|
||||
else if ( _T("extent") == sName )
|
||||
m_oExtent = oNode;
|
||||
}
|
||||
m_oGraphic.fromXML(node);
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -1090,6 +1356,13 @@ namespace OOX
|
||||
return OOX::et_wp_inline;
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( L"distB", m_oDistB );
|
||||
oNode.ReadAttributeBase( L"distL", m_oDistL );
|
||||
oNode.ReadAttributeBase( L"distR", m_oDistR );
|
||||
oNode.ReadAttributeBase( L"distT", m_oDistT );
|
||||
}
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
@ -1148,9 +1421,31 @@ namespace OOX
|
||||
fromXML( (XmlUtils::CXmlLiteReader&)oReader );
|
||||
return *this;
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
{
|
||||
// TO DO: Реализовать
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (node.GetNodes(_T("*"), oNodes))
|
||||
{
|
||||
int nCount = oNodes.GetCount();
|
||||
for (int i = 0; i < nCount; ++i)
|
||||
{
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNodes.GetAt(i, oNode);
|
||||
|
||||
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
|
||||
|
||||
if (_T("inline") == strName)
|
||||
{
|
||||
m_oInline = oNode;
|
||||
m_bAnchor = false;
|
||||
}
|
||||
else if (_T("anchor") == strName)
|
||||
{
|
||||
m_oAnchor = oNode;
|
||||
m_bAnchor = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
#include "Media/Audio.h"
|
||||
#include "Media/Video.h"
|
||||
#include "Media/VbaProject.h"
|
||||
#include "Media/JsaProject.h"
|
||||
#include "External/HyperLink.h"
|
||||
#include "External/ExternalVideo.h"
|
||||
#include "External/ExternalAudio.h"
|
||||
@ -146,6 +147,8 @@ namespace OOX
|
||||
return smart_ptr<OOX::File>(new OOX::VbaProject( oRootPath, oFileName ));
|
||||
//else if ( oRelation.Type() == OOX::FileTypes::VbaData)
|
||||
// return smart_ptr<OOX::File>(new OOX::VbaData( oFileName ));
|
||||
else if ( oRelation.Type() == FileTypes::JsaProject)
|
||||
return smart_ptr<OOX::File>(new JsaProject( oFileName ));
|
||||
|
||||
return smart_ptr<OOX::File>( new UnknowTypeFile() );
|
||||
}
|
||||
@ -238,6 +241,8 @@ namespace OOX
|
||||
return smart_ptr<OOX::File>(new OOX::VbaProject( oRootPath, oFileName ));
|
||||
//else if ( pRelation->Type() == FileTypes::VbaData)
|
||||
// return smart_ptr<OOX::File>(new OOX::VbaData( oFileName ));
|
||||
else if ( pRelation->Type() == FileTypes::JsaProject)
|
||||
return smart_ptr<OOX::File>(new JsaProject( oFileName ));
|
||||
|
||||
return smart_ptr<OOX::File>( new UnknowTypeFile() );
|
||||
}
|
||||
|
||||
@ -192,6 +192,10 @@ namespace OOX
|
||||
_T("application/vnd.ms-word.vbaData+xml"),
|
||||
_T("http://schemas.microsoft.com/office/2006/relationships/wordVbaData"));
|
||||
|
||||
const FileType JsaProject(L"", L"jsaProject.bin",
|
||||
_T(""),
|
||||
_T("http://schemas.onlyoffice.com/jsaProject"));
|
||||
|
||||
const FileType MicrosoftOfficeUnknown(L"embeddings", L"",
|
||||
_T(""),
|
||||
_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"));
|
||||
|
||||
@ -142,7 +142,13 @@ namespace OOX
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode &oNode)
|
||||
{
|
||||
// TO DO: Реализовать CPicture::fromXML(XmlUtils::CXmlNode &oNode)
|
||||
if ( oNode.IsValid() == false)
|
||||
return;
|
||||
|
||||
m_sXml.Init();
|
||||
*m_sXml = oNode.GetXml(); //для pptx dll
|
||||
|
||||
fromStringXML(m_sXml.get());
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
@ -152,11 +158,15 @@ namespace OOX
|
||||
|
||||
m_sXml.Init();
|
||||
*m_sXml = oReader.GetOuterXml(); //для pptx dll
|
||||
|
||||
|
||||
fromStringXML(m_sXml.get());
|
||||
}
|
||||
void fromStringXML(const std::wstring & xml_string)
|
||||
{
|
||||
std::wstring sBegin(L"<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">");
|
||||
|
||||
std::wstring sEnd(L"</root>");
|
||||
std::wstring sXml = sBegin + m_sXml.get() + sEnd;
|
||||
std::wstring sXml = sBegin + xml_string + sEnd;
|
||||
|
||||
XmlUtils::CXmlLiteReader oSubReader;
|
||||
|
||||
|
||||
99
Common/DocxFormat/Source/DocxFormat/Media/JsaProject.h
Normal file
99
Common/DocxFormat/Source/DocxFormat/Media/JsaProject.h
Normal file
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* (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
|
||||
#ifndef OOX_ONLY_JSA_PROJECT_INCLUDE_H_
|
||||
#define OOX_ONLY_JSA_PROJECT_INCLUDE_H_
|
||||
|
||||
#include "Media.h"
|
||||
#include "../../XlsxFormat/FileTypes_Spreadsheet.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
class JsaProject : public Media
|
||||
{
|
||||
public:
|
||||
JsaProject()
|
||||
{
|
||||
}
|
||||
JsaProject(const CPath& filename)
|
||||
{
|
||||
read(filename);
|
||||
}
|
||||
virtual ~JsaProject()
|
||||
{
|
||||
}
|
||||
virtual const FileType type() const
|
||||
{
|
||||
return FileTypes::JsaProject;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
BYTE* pData = NULL;
|
||||
DWORD nBytesCount;
|
||||
if(NSFile::CFileBinary::ReadAllBytes(m_filename.GetPath(), &pData, nBytesCount))
|
||||
{
|
||||
pWriter->WriteBYTEArray(pData, nBytesCount);
|
||||
}
|
||||
}
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _length = pReader->GetLong();
|
||||
LONG _end_rec = pReader->GetPos() + _length;
|
||||
|
||||
if (_length > 0)
|
||||
{
|
||||
BYTE* pData = pReader->GetPointer(_length);
|
||||
std::wstring filePath = pReader->m_pRels->m_pManager->GetDstFolder() + FILE_SEPARATOR_STR + OOX::FileTypes::JsaProject.DefaultFileName().GetPath();
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath);
|
||||
oFile.WriteFile(pData, _length);
|
||||
oFile.CloseFile();
|
||||
|
||||
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(OOX::FileTypes::JsaProject.DefaultFileName().GetExtention(false));
|
||||
|
||||
set_filename(filePath);
|
||||
}
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
};
|
||||
} // namespace OOX
|
||||
|
||||
#endif // OOX_ONLY_JSA_PROJECT_INCLUDE_H_
|
||||
@ -44,6 +44,7 @@
|
||||
#define AVS_ERROR_FILEFORMAT (AVS_ERROR_FIRST + 0x0004)
|
||||
#define AVS_ERROR_PASSWORD (AVS_ERROR_FIRST + 0x0005)
|
||||
#define AVS_ERROR_DRM (AVS_ERROR_FIRST + 0x0006)
|
||||
#define AVS_ERROR_MACRO (AVS_ERROR_FIRST + 0x0007)
|
||||
|
||||
// AVSOfficeUniversalConverter 0x0050 - 0x0075
|
||||
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST (AVS_ERROR_FIRST + 0x0050)
|
||||
|
||||
@ -42,11 +42,13 @@ namespace POLE
|
||||
class COfficeFileFormatChecker
|
||||
{
|
||||
public:
|
||||
int nFileType;
|
||||
int nFileType;
|
||||
bool bMacroEnabled;
|
||||
|
||||
COfficeFileFormatChecker()
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_UNKNOWN;
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_UNKNOWN;
|
||||
bMacroEnabled = false;
|
||||
}
|
||||
COfficeFileFormatChecker(std::wstring sFileName)
|
||||
{
|
||||
|
||||
@ -34,6 +34,10 @@
|
||||
#include "../DesktopEditor/common/File.h"
|
||||
#include "../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
#include "../ASCOfficePPTFile/PPTFormatLib/PPTFormatLib.h"
|
||||
#endif
|
||||
|
||||
#include "3dParty/pole/pole.h"
|
||||
#include <algorithm>
|
||||
|
||||
@ -118,6 +122,9 @@ bool COfficeFileFormatChecker::isPdfFormatFile (unsigned char* pBuffer,int dwByt
|
||||
if (pBuffer == NULL) return false;
|
||||
|
||||
int nTempBufferSize = dwBytes < 20 ? dwBytes : 20;
|
||||
if (nTempBufferSize < 1)
|
||||
return false;
|
||||
|
||||
char* pTempBuffer = new char[nTempBufferSize];
|
||||
|
||||
memcpy ( pTempBuffer, pBuffer, nTempBufferSize );
|
||||
@ -145,6 +152,12 @@ bool COfficeFileFormatChecker::isDocFormatFile (POLE::Storage * storage)
|
||||
if (entries.size() > 0)
|
||||
return false;
|
||||
|
||||
#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
if (storage->isDirectory(L"Macros"))
|
||||
{
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -158,31 +171,37 @@ bool COfficeFileFormatChecker::isXlsFormatFile (POLE::Storage * storage)
|
||||
|
||||
POLE::Stream stream(storage, L"Workbook");
|
||||
|
||||
if (stream.read(buffer,10) >0)
|
||||
return true;
|
||||
if (stream.read(buffer,10) < 1)
|
||||
{
|
||||
POLE::Stream stream2(storage, L"Book");
|
||||
|
||||
POLE::Stream stream2(storage, L"Book");
|
||||
if (stream2.read(buffer,10) < 1)
|
||||
{
|
||||
POLE::Stream stream3(storage, L"WORKBOOK");
|
||||
|
||||
if (stream2.read(buffer,10) > 0)
|
||||
return true;
|
||||
if (stream3.read(buffer,10) < 1)
|
||||
{
|
||||
POLE::Stream stream4(storage, L"BOOK");
|
||||
|
||||
POLE::Stream stream3(storage, L"WORKBOOK");
|
||||
if (stream4.read(buffer,10) < 1)
|
||||
{
|
||||
POLE::Stream stream5(storage, L"book");
|
||||
|
||||
if (stream3.read(buffer,10) > 0)
|
||||
return true;
|
||||
|
||||
POLE::Stream stream4(storage, L"BOOK");
|
||||
|
||||
if (stream4.read(buffer,10) > 0)
|
||||
return true;
|
||||
|
||||
POLE::Stream stream5(storage, L"book");
|
||||
|
||||
if (stream5.read(buffer,10) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
if (stream5.read(buffer,10) < 1)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
if (storage->isDirectory(L"_VBA_PROJECT_CUR"))
|
||||
{
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COfficeFileFormatChecker::isPptFormatFile (POLE::Storage * storage)
|
||||
{
|
||||
if (storage == NULL) return false;
|
||||
@ -190,10 +209,10 @@ bool COfficeFileFormatChecker::isPptFormatFile (POLE::Storage * storage)
|
||||
POLE::Stream stream(storage, L"PowerPoint Document");
|
||||
|
||||
unsigned char buffer[10];
|
||||
if (stream.read(buffer,10) >0)
|
||||
return true;
|
||||
if (stream.read(buffer,10) < 1)
|
||||
return false;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
bool COfficeFileFormatChecker::isMS_OFFCRYPTOFormatFile (POLE::Storage * storage)
|
||||
{
|
||||
@ -227,7 +246,18 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring & fileName)
|
||||
}
|
||||
else if ( isPptFormatFile(&storage) )
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT;
|
||||
#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
COfficePPTFile pptFile;
|
||||
|
||||
bMacroEnabled = true;
|
||||
long nResult = pptFile.OpenFile(fileName, L"", bMacroEnabled);
|
||||
if (nResult != S_OK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pptFile.CloseFile();
|
||||
#endif
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT;
|
||||
return true;
|
||||
}
|
||||
else if ( isMS_OFFCRYPTOFormatFile(&storage) )
|
||||
@ -380,6 +410,7 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
|
||||
else if (std::string::npos != strContentTypes.find(docmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
else if (std::string::npos != strContentTypes.find(dotxFormatLine))
|
||||
{
|
||||
@ -388,6 +419,7 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
|
||||
else if (std::string::npos != strContentTypes.find(dotmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
else if (std::string::npos != strContentTypes.find(xlsxFormatLine))
|
||||
{
|
||||
@ -396,6 +428,7 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
|
||||
else if (std::string::npos != strContentTypes.find(xlsmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
else if (std::string::npos != strContentTypes.find(xltxFormatLine))
|
||||
{
|
||||
@ -404,6 +437,7 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
|
||||
else if (std::string::npos != strContentTypes.find(xltmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
else if (std::string::npos != strContentTypes.find(pptxFormatLine))
|
||||
{
|
||||
@ -412,10 +446,12 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
|
||||
else if (std::string::npos != strContentTypes.find(pptmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
else if (std::string::npos != strContentTypes.find(ppsmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPSM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
else if (std::string::npos != strContentTypes.find(ppsxFormatLine))
|
||||
{
|
||||
@ -428,6 +464,7 @@ bool COfficeFileFormatChecker::isOOXFormatFile(const std::wstring & fileName)
|
||||
else if (std::string::npos != strContentTypes.find(potmFormatLine))
|
||||
{
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM;
|
||||
bMacroEnabled = true;
|
||||
}
|
||||
delete []pBuffer;
|
||||
pBuffer = NULL;
|
||||
|
||||
@ -501,7 +501,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;JAS_WIN_MSVC_BUILD;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;JAS_WIN_MSVC_BUILD;_CRT_SECURE_NO_DEPRECATE;EXCLUDE_JPG_SUPPORT"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -338,7 +338,7 @@
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -344,7 +344,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;MNG_SUPPORT_DISPLAY;MNG_SUPPORT_READ;MNG_SUPPORT_WRITE;MNG_ACCESS_CHUNKS;MNG_STORE_CHUNKS;_CRT_SECURE_NO_DEPRECATE;MNG_ERROR_TELLTALE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(IntDir)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
AdditionalIncludeDirectories="..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -195,7 +195,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -198,7 +198,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -500,7 +500,7 @@
|
||||
AdditionalIncludeDirectories="..\..\..\include"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;FT_DEBUG_LEVEL_ERROR;FT_DEBUG_LEVEL_TRACE;FT2_BUILD_LIBRARY"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
DisableLanguageExtensions="true"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)/"
|
||||
|
||||
@ -214,7 +214,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;$(NOINHERIT)"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
StructMemberAlignment="0"
|
||||
DisableLanguageExtensions="false"
|
||||
PrecompiledHeaderFile=""
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
ObjectFile="$(IntDir)\"
|
||||
ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
|
||||
|
||||
@ -495,7 +495,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;$(NOINHERIT)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=""
|
||||
AssemblerListingLocation="$(ConfigurationName)\"
|
||||
ObjectFile="$(IntDir)\"
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
QT -= core
|
||||
QT -= gui
|
||||
|
||||
VERSION = 2.4.490.0
|
||||
VERSION = 2.4.492.0
|
||||
DEFINES += INTVER=$$VERSION
|
||||
|
||||
TARGET = x2t
|
||||
@ -60,6 +60,7 @@ DEFINES += DJVU_USE_DYNAMIC_LIBRARY
|
||||
DEFINES += HTMLRENDERER_USE_DYNAMIC_LIBRARY
|
||||
DEFINES += HTMLFILE_USE_DYNAMIC_LIBRARY
|
||||
DEFINES += UNICODECONVERTER_USE_DYNAMIC_LIBRARY
|
||||
DEFINES += FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
|
||||
core_windows {
|
||||
INCLUDEPATH += ../../../OfficeUtils/src/zlib-1.2.3
|
||||
|
||||
@ -3801,6 +3801,23 @@ namespace NExtractTools
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
int detectMacroInFile(InputParams& oInputParams)
|
||||
{
|
||||
int nRes = 0;// no macro
|
||||
std::wstring sFileFrom = *oInputParams.m_sFileFrom;
|
||||
|
||||
COfficeFileFormatChecker OfficeFileFormatChecker;
|
||||
|
||||
if (OfficeFileFormatChecker.isOfficeFile(sFileFrom))
|
||||
{
|
||||
if (OfficeFileFormatChecker.bMacroEnabled)
|
||||
{
|
||||
nRes = AVS_ERROR_MACRO;
|
||||
}
|
||||
}
|
||||
|
||||
return nRes;
|
||||
}
|
||||
int fromInputParams(InputParams& oInputParams)
|
||||
{
|
||||
TConversionDirection conversion = oInputParams.getConversionDirection();
|
||||
|
||||
@ -199,6 +199,7 @@ namespace NExtractTools
|
||||
int fromCanvasPdf(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
|
||||
int fromInputParams(InputParams& oInputParams);
|
||||
int detectMacroInFile(InputParams& oInputParams);
|
||||
|
||||
X2T_DECL_EXPORT int FromFile(const std::wstring& file);
|
||||
X2T_DECL_EXPORT int FromXml(const std::wstring& xml);
|
||||
|
||||
@ -118,7 +118,7 @@ static std::wstring utf8_to_unicode(const char *src)
|
||||
|
||||
int result = 0;
|
||||
std::wstring sXmlExt = _T(".xml");
|
||||
if(sXmlExt == sArg1.substr(sArg1.length() - sXmlExt.length(), sXmlExt.length()))
|
||||
if((sArg1.length() > 3) && (sXmlExt == sArg1.substr(sArg1.length() - sXmlExt.length(), sXmlExt.length())))
|
||||
{
|
||||
NExtractTools::InputParams oInputParams;
|
||||
if (oInputParams.FromXmlFile(sArg1) && (sArg2.empty() || oInputParams.FromXml(sArg2)))
|
||||
@ -143,20 +143,30 @@ static std::wstring utf8_to_unicode(const char *src)
|
||||
if (argc >= 5) sArg4 = std::wstring(argv [4]);
|
||||
if (argc >= 6) sArg5 = std::wstring(argv [5]);
|
||||
#endif
|
||||
InputParams oInputParams;
|
||||
oInputParams.m_sFileFrom = new std::wstring(sArg1);
|
||||
oInputParams.m_sFileTo = new std::wstring(sArg2);
|
||||
if (sArg1 == L"-detectmacro")
|
||||
{
|
||||
InputParams oInputParams;
|
||||
oInputParams.m_sFileFrom = new std::wstring(sArg2);
|
||||
|
||||
result = NExtractTools::detectMacroInFile(oInputParams);
|
||||
}
|
||||
else
|
||||
{
|
||||
InputParams oInputParams;
|
||||
oInputParams.m_sFileFrom = new std::wstring(sArg1);
|
||||
oInputParams.m_sFileTo = new std::wstring(sArg2);
|
||||
|
||||
if (argc > 3)
|
||||
{
|
||||
oInputParams.m_sFontDir = new std::wstring(sArg3);
|
||||
if (argc > 3)
|
||||
{
|
||||
oInputParams.m_sFontDir = new std::wstring(sArg3);
|
||||
}
|
||||
if (argc > 4)
|
||||
{
|
||||
oInputParams.m_sPassword = new std::wstring(sArg4);
|
||||
oInputParams.m_sSavePassword = new std::wstring(sArg4);
|
||||
}
|
||||
result = NExtractTools::fromInputParams(oInputParams);
|
||||
}
|
||||
if (argc > 4)
|
||||
{
|
||||
oInputParams.m_sPassword = new std::wstring(sArg4);
|
||||
oInputParams.m_sSavePassword = new std::wstring(sArg4);
|
||||
}
|
||||
result = NExtractTools::fromInputParams(oInputParams);
|
||||
}
|
||||
|
||||
return getReturnErrorCode(result);
|
||||
|
||||
@ -44,10 +44,10 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""../../../DesktopEditor/agg-2.4/include";../../../DesktopEditor/xml/build/vs2005;../../../DesktopEditor/xml/libxml2/include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_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;_CONSOLE;FILE_FORMAT_CHECKER_WITH_MACRO;_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"
|
||||
@ -336,6 +336,7 @@
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/bigobj"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user