mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-28 00:01:54 +08:00
Compare commits
35 Commits
core-win-6
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 97b4311e95 | |||
| 228b3a52e9 | |||
| 2f2236646d | |||
| 30603d0561 | |||
| 933af771b7 | |||
| c04a537d69 | |||
| e49d78db47 | |||
| 99ec420ee5 | |||
| f764b034a1 | |||
| 73fe023460 | |||
| 242af3c80e | |||
| 7756e4b8bd | |||
| 56a1d1f627 | |||
| 11bd4ff61d | |||
| 93a06d7f86 | |||
| 76d2d429b7 | |||
| c6de37dbad | |||
| d022e669f0 | |||
| 184e79bae1 | |||
| e6581671c8 | |||
| e0a1c688bf | |||
| 9e0b301179 | |||
| 8680fb2e0e | |||
| c7c605a970 | |||
| 23d648d92d | |||
| b098c98dbb | |||
| b88726beaf | |||
| b2d3e5e194 | |||
| a8315efae0 | |||
| 3781cf6774 | |||
| 7e36d47991 | |||
| 419a01bd09 | |||
| 804a01cab3 | |||
| 931d6aa17c | |||
| 2861539949 |
@ -69,8 +69,13 @@ namespace OpenXmlContentTypes
|
||||
static const wchar_t* Tiff = L"image/tiff";
|
||||
static const wchar_t* Wmf = L"image/x-wmf";
|
||||
static const wchar_t* Bmp = L"image/bmp";
|
||||
static const wchar_t* Pcz = L"image/x-pcz";
|
||||
}
|
||||
namespace DocPrContentTypes
|
||||
{
|
||||
static const wchar_t* App = L"application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
||||
static const wchar_t* Core = L"application/vnd.openxmlformats-package.core-properties+xml";
|
||||
}
|
||||
|
||||
namespace WordprocessingMLContentTypes
|
||||
{
|
||||
// WordprocessingML content types
|
||||
@ -136,7 +141,7 @@ namespace OpenXmlNamespaces
|
||||
|
||||
namespace OpenXmlRelationshipTypes
|
||||
{
|
||||
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||
static const wchar_t* ExtendedProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
|
||||
|
||||
static const wchar_t* Theme = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
||||
|
||||
@ -110,6 +110,11 @@ namespace DocFileFormat
|
||||
unused2 = Reader->ReadByte();
|
||||
unused3 = Reader->ReadByte();
|
||||
|
||||
if (btMacOS != btWin32)
|
||||
{
|
||||
btWin32 = btMacOS = (Global::BlipType)this->Instance;
|
||||
}
|
||||
|
||||
if (BodySize > 0x24)
|
||||
{
|
||||
Blip = RecordFactory::ReadRecord(Reader, 0);
|
||||
|
||||
@ -192,14 +192,14 @@ public:
|
||||
{
|
||||
if (!bIsCompressed)
|
||||
{
|
||||
m_pMetaFile = pCompress;
|
||||
m_lMetaFileSize = lUncompressSize;
|
||||
m_pMetaFile = new BYTE[lCompressSize];
|
||||
m_lMetaFileSize = lCompressSize;
|
||||
memcpy(m_pMetaFile, pCompress, lCompressSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
ULONG lSize = lUncompressSize;
|
||||
m_pMetaFile = new BYTE[lUncompressSize];
|
||||
//bool bRes = NSZLib::Decompress(pCompress, (ULONG)lCompressSize, m_pMetaFile, lSize);
|
||||
|
||||
HRESULT res = S_OK;
|
||||
COfficeUtils* pOfficeUtils = new COfficeUtils(NULL);
|
||||
@ -340,6 +340,8 @@ typedef enum _BlipCompression
|
||||
|
||||
if (typeCode == 0xf01b)
|
||||
{
|
||||
oMetaFile.m_sExtension = L".wmf";
|
||||
|
||||
WmfPlaceableFileHeader oWmfHeader = {};
|
||||
oMetaHeader.ToWMFHeader(&oWmfHeader);
|
||||
|
||||
@ -349,24 +351,12 @@ typedef enum _BlipCompression
|
||||
|
||||
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
|
||||
}
|
||||
|
||||
if (typeCode == 0xf01c)
|
||||
{
|
||||
oMetaFile.m_sExtension = L".pcz";
|
||||
//decompress???
|
||||
}
|
||||
oMetaFile.SetData(m_pvBits, oMetaHeader.cbSave, oMetaHeader.cbSize, 0 == oMetaHeader.compression);
|
||||
|
||||
//if (pos < sz)
|
||||
//{
|
||||
// NSFile::CFileBinary oFile;
|
||||
|
||||
// if (oFile.CreateFile(L"d:\\blop.dat"))
|
||||
// {
|
||||
// BYTE * d = Reader->ReadBytes( sz - pos, true );
|
||||
// if (d)
|
||||
// {
|
||||
// oFile.WriteFile (d, sz - pos);
|
||||
// delete []d;
|
||||
// oFile.CloseFile();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
virtual ~MetafilePictBlip()
|
||||
|
||||
@ -64,6 +64,8 @@ namespace DocFileFormat
|
||||
DocumentContentTypesFile._defaultTypes.insert( make_pair( L"xml", std::wstring( OpenXmlContentTypes::Xml ) ) );
|
||||
|
||||
MainRelationshipsFile.Relationships.push_back( Relationship( std::wstring( L"rId1"), OpenXmlRelationshipTypes::OfficeDocument, L"word/document.xml") );
|
||||
MainRelationshipsFile.Relationships.push_back( Relationship( std::wstring( L"rId2"), OpenXmlRelationshipTypes::CoreProperties, L"docProps/core.xml") );
|
||||
MainRelationshipsFile.Relationships.push_back( Relationship( std::wstring( L"rId3"), OpenXmlRelationshipTypes::ExtendedProperties, L"docProps/app.xml") );
|
||||
}
|
||||
|
||||
|
||||
@ -195,14 +197,18 @@ namespace DocFileFormat
|
||||
delete storageOut;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int OpenXmlPackage::RegisterDocument()
|
||||
void OpenXmlPackage::RegisterDocPr()
|
||||
{
|
||||
return AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocument, L"");
|
||||
AddPart( L"docProps", L"app.xml", DocPrContentTypes::App, L"");
|
||||
AddPart( L"docProps", L"core.xml", DocPrContentTypes::Core, L"");
|
||||
}
|
||||
int OpenXmlPackage::RegisterDocumentMacros()
|
||||
void OpenXmlPackage::RegisterDocument()
|
||||
{
|
||||
return AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocumentMacro, L"");
|
||||
AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocument, L"");
|
||||
}
|
||||
void OpenXmlPackage::RegisterDocumentMacros()
|
||||
{
|
||||
AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocumentMacro, L"");
|
||||
}
|
||||
int OpenXmlPackage::RegisterVbaProject()
|
||||
{
|
||||
|
||||
@ -165,8 +165,9 @@ namespace DocFileFormat
|
||||
HRESULT SaveOLEObject ( const std::wstring& fileName, const OleObjectFileStructure& oleObjectFileStructure );
|
||||
HRESULT SaveEmbeddedObject ( const std::wstring& fileName, const std::string& data );
|
||||
|
||||
int RegisterDocument();
|
||||
int RegisterDocumentMacros();
|
||||
void RegisterDocPr();
|
||||
void RegisterDocument();
|
||||
void RegisterDocumentMacros();
|
||||
int RegisterFontTable();
|
||||
int RegisterNumbering();
|
||||
int RegisterSettings();
|
||||
|
||||
@ -500,6 +500,7 @@ namespace DocFileFormat
|
||||
{
|
||||
case Global::msoblipEMF:
|
||||
case Global::msoblipWMF:
|
||||
case Global::msoblipPICT:
|
||||
{
|
||||
MetafilePictBlip* metaBlip = static_cast<MetafilePictBlip*>(oBlipEntry->Blip);
|
||||
if (metaBlip)
|
||||
@ -567,6 +568,9 @@ namespace DocFileFormat
|
||||
case Global::msoblipWMF:
|
||||
return std::wstring(L".wmf");
|
||||
|
||||
case Global::msoblipPICT:
|
||||
return std::wstring(L".pcz");
|
||||
|
||||
default:
|
||||
return std::wstring(L".png");
|
||||
}
|
||||
@ -601,6 +605,9 @@ namespace DocFileFormat
|
||||
case Global::msoblipWMF:
|
||||
return std::wstring(OpenXmlContentTypes::Wmf);
|
||||
|
||||
case Global::msoblipPICT:
|
||||
return std::wstring(OpenXmlContentTypes::Pcz);
|
||||
|
||||
case Global::msoblipDIB:
|
||||
return std::wstring(OpenXmlContentTypes::Bmp);
|
||||
|
||||
|
||||
@ -1287,6 +1287,7 @@ namespace DocFileFormat
|
||||
{
|
||||
case Global::msoblipEMF:
|
||||
case Global::msoblipWMF:
|
||||
case Global::msoblipPICT:
|
||||
{
|
||||
//it's a meta image
|
||||
MetafilePictBlip* metaBlip = static_cast<MetafilePictBlip*>(RecordFactory::ReadRecord(&reader, 0));
|
||||
@ -1373,6 +1374,9 @@ namespace DocFileFormat
|
||||
case Global::msoblipWMF:
|
||||
return std::wstring( L".wmf" );
|
||||
|
||||
case Global::msoblipPICT:
|
||||
return std::wstring( L".pcz" );
|
||||
|
||||
default:
|
||||
return std::wstring( L".png" );
|
||||
}
|
||||
|
||||
@ -35,6 +35,10 @@
|
||||
#include "../../DesktopEditor/raster/BgraFrame.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/ContentTypes.h"
|
||||
|
||||
namespace ImageHelper
|
||||
{
|
||||
struct __BITMAPINFOHEADER
|
||||
@ -211,6 +215,37 @@ namespace DocFileFormat
|
||||
{
|
||||
RegisterDocument();
|
||||
}
|
||||
OOX::CContentTypes oContentTypes;
|
||||
OOX::CPath pathDocProps = m_strOutputPath + FILE_SEPARATOR_STR + _T("docProps");
|
||||
NSDirectory::CreateDirectory(pathDocProps.GetPath());
|
||||
|
||||
OOX::CPath DocProps = std::wstring(_T("docProps"));
|
||||
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, oContentTypes);
|
||||
delete pApp;
|
||||
}
|
||||
OOX::CCore* pCore = new OOX::CCore(NULL);
|
||||
if (pCore)
|
||||
{
|
||||
pCore->SetCreator(_T(""));
|
||||
pCore->SetLastModifiedBy(_T(""));
|
||||
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, oContentTypes);
|
||||
delete pCore;
|
||||
}
|
||||
RegisterDocPr();
|
||||
|
||||
WritePackage();
|
||||
|
||||
|
||||
@ -7449,6 +7449,8 @@ public:
|
||||
{
|
||||
PPTX::Logic::CNvPr pNonVisualDrawingProps(L"wp");
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDocPr, this, &pNonVisualDrawingProps);
|
||||
|
||||
pNonVisualDrawingProps.id = pDrawingProperty->m_nDocPr;
|
||||
pDrawingProperty->sDocPr = pNonVisualDrawingProps.toXML2(L"wp:docPr");
|
||||
}
|
||||
else
|
||||
|
||||
@ -146,7 +146,8 @@ namespace BinXlsxRW{
|
||||
void ChartWriter::toXlsx(OOX::Spreadsheet::CXlsx& oXlsx)
|
||||
{
|
||||
std::vector<std::wstring> aSharedStrings;
|
||||
//Sheet
|
||||
|
||||
oXlsx.CreateWorkbook();
|
||||
oXlsx.m_pWorkbook->m_oSheets.Init();
|
||||
|
||||
int nSheetId = 1;
|
||||
|
||||
@ -298,8 +298,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
pApp->SetApplication(_T("OnlyOffice"));
|
||||
pApp->SetAppVersion(_T("5.0"));
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
|
||||
@ -288,6 +288,7 @@ SOURCES += \
|
||||
../src/docx/xlsx_table_state.cpp \
|
||||
../src/docx/xlsx_textcontext.cpp \
|
||||
../src/docx/xlsx_pivots_context.cpp \
|
||||
../src/docx/xlsx_data_validation.cpp \
|
||||
../src/docx/xlsx_utils.cpp \
|
||||
../src/docx/xlsx_xf.cpp
|
||||
}
|
||||
@ -551,6 +552,7 @@ HEADERS += \
|
||||
../src/docx/xlsx_table_position.h \
|
||||
../src/docx/xlsx_table_state.h \
|
||||
../src/docx/xlsx_textcontext.h \
|
||||
../src/docx/xlsx_data_validation.h \
|
||||
../src/docx/xlsx_utils.h \
|
||||
../src/docx/xlsx_xf.h \
|
||||
../include/logging.h \
|
||||
|
||||
@ -101,3 +101,4 @@
|
||||
#include "../src/docx/xlsx_utils.cpp"
|
||||
#include "../src/docx/xlsx_xf.cpp"
|
||||
#include "../src/docx/xlsx_pivots_context.cpp"
|
||||
#include "../src/docx/xlsx_data_validation.cpp""
|
||||
|
||||
@ -40,6 +40,7 @@
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/raster/Metafile/MetaFile.h"
|
||||
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Base.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -284,8 +285,8 @@ void core_file::write(const std::wstring & RootPath)
|
||||
L"xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" "
|
||||
L"xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" >";
|
||||
|
||||
//resStream << L"<dc:creator>ONLYOFFICE Online Editor</dc:creator>";
|
||||
//resStream << L"<cp:lastModifiedBy>ONLYOFFICE Online Editor</cp:lastModifiedBy>";
|
||||
//resStream << L"<dc:creator>ONLYOFFICE</dc:creator>";
|
||||
//resStream << L"<cp:lastModifiedBy>ONLYOFFICE</cp:lastModifiedBy>";
|
||||
resStream << L"<cp:revision>1</cp:revision>";
|
||||
resStream << L"</cp:coreProperties>";
|
||||
|
||||
@ -300,8 +301,12 @@ void app_file::write(const std::wstring & RootPath)
|
||||
resStream << L"<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" "
|
||||
L"xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\" >";
|
||||
|
||||
resStream << L"<Application>OnlyOffice</Application>";
|
||||
resStream << L"</Properties>";
|
||||
resStream << L"<Application>ONLYOFFICE";
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
resStream << L"/" << std::wstring(s.begin(), s.end()) ;
|
||||
#endif
|
||||
resStream << L"</Application></Properties>";
|
||||
|
||||
simple_element elm(L"app.xml", resStream.str());
|
||||
elm.write(RootPath);
|
||||
|
||||
@ -116,7 +116,7 @@ public:
|
||||
int priority = 1;
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
for (int i = 0 ; i < conditionalFormattings_.size(); i++)
|
||||
for (size_t i = 0 ; i < conditionalFormattings_.size(); i++)
|
||||
{
|
||||
conditionalFormatting & c = conditionalFormattings_[i];
|
||||
|
||||
@ -126,7 +126,7 @@ public:
|
||||
{
|
||||
CP_XML_ATTR(L"sqref", c.ref);
|
||||
|
||||
for (int j = 0 ; j < c.rules.size(); j++)
|
||||
for (size_t j = 0 ; j < c.rules.size(); j++)
|
||||
{
|
||||
if (c.rules[j].type < 1 || c.rules[j].type > 5) continue;
|
||||
|
||||
@ -171,7 +171,7 @@ public:
|
||||
if (c.rules[j].minLength) CP_XML_ATTR(L"minLength", *c.rules[j].minLength);
|
||||
if (c.rules[j].maxLength) CP_XML_ATTR(L"maxLength", *c.rules[j].maxLength);
|
||||
|
||||
for (int k = 0; k < c.rules[j].cfvo.size(); k++)
|
||||
for (size_t k = 0; k < c.rules[j].cfvo.size(); k++)
|
||||
{
|
||||
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
|
||||
}
|
||||
@ -189,11 +189,11 @@ public:
|
||||
CP_XML_ATTR(L"type", L"colorScale");
|
||||
CP_XML_NODE(L"colorScale")
|
||||
{
|
||||
for (int k = 0; k < c.rules[j].cfvo.size(); k++)
|
||||
for (size_t k = 0; k < c.rules[j].cfvo.size(); k++)
|
||||
{
|
||||
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
|
||||
}
|
||||
for (int k = 0; k < c.rules[j].color.size(); k++)
|
||||
for (size_t k = 0; k < c.rules[j].color.size(); k++)
|
||||
{
|
||||
CP_XML_NODE(L"color")
|
||||
{
|
||||
@ -209,7 +209,7 @@ public:
|
||||
{
|
||||
if (c.rules[j].showValue) CP_XML_ATTR(L"showValue", *c.rules[j].showValue);
|
||||
|
||||
for (int k = 0; k < c.rules[j].cfvo.size(); k++)
|
||||
for (size_t k = 0; k < c.rules[j].cfvo.size(); k++)
|
||||
{
|
||||
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
212
ASCOfficeOdfFile/src/docx/xlsx_data_validation.cpp
Normal file
212
ASCOfficeOdfFile/src/docx/xlsx_data_validation.cpp
Normal file
@ -0,0 +1,212 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsx_data_validation.h"
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
|
||||
#include "../formulasconvert/formulasconvert.h"
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
class xlsx_dataValidation
|
||||
{
|
||||
public:
|
||||
xlsx_dataValidation() : showErrorMessage(false), showInputMessage(false), showDropDown(false), allowBlank(false) {}
|
||||
|
||||
std::wstring ref;
|
||||
std::wstring activate_ref;
|
||||
std::wstring type;
|
||||
std::wstring formula1;
|
||||
std::wstring formula2;
|
||||
std::wstring operator_;
|
||||
bool showErrorMessage;
|
||||
bool showInputMessage;
|
||||
bool showDropDown;
|
||||
bool allowBlank;
|
||||
};
|
||||
typedef shared_ptr<xlsx_dataValidation>::Type xlsx_dataValidation_ptr;
|
||||
|
||||
class xlsx_dataValidations_context::Impl
|
||||
{
|
||||
public:
|
||||
|
||||
void serialize(std::wostream & _Wostream)
|
||||
{
|
||||
if (mapActivateDataValidations.empty()) return;
|
||||
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"dataValidations")
|
||||
{
|
||||
CP_XML_ATTR(L"count", mapActivateDataValidations.size());
|
||||
|
||||
for (std::map<std::wstring, xlsx_dataValidation_ptr>::iterator it = mapActivateDataValidations.begin();
|
||||
it != mapActivateDataValidations.end(); ++it)
|
||||
{
|
||||
CP_XML_NODE(L"dataValidation")
|
||||
{
|
||||
CP_XML_ATTR(L"sqref", it->second->activate_ref);
|
||||
CP_XML_ATTR(L"allowBlank", it->second->allowBlank);
|
||||
CP_XML_ATTR(L"operator", it->second->operator_);
|
||||
CP_XML_ATTR(L"showDropDown", it->second->showDropDown);
|
||||
CP_XML_ATTR(L"showErrorMessage", it->second->showErrorMessage);
|
||||
CP_XML_ATTR(L"showInputMessage", it->second->showInputMessage);
|
||||
CP_XML_ATTR(L"type", it->second->type);
|
||||
|
||||
if (!it->second->formula1.empty())
|
||||
{
|
||||
CP_XML_NODE(L"formula1")
|
||||
{
|
||||
CP_XML_STREAM() << it->second->formula1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!it->second->formula2.empty())
|
||||
{
|
||||
CP_XML_NODE(L"formula2")
|
||||
{
|
||||
CP_XML_STREAM() << it->second->formula2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mapActivateDataValidations.clear();
|
||||
}
|
||||
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr> mapDataValidations; //for all tables
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr> mapActivateDataValidations; //in current table
|
||||
};
|
||||
|
||||
xlsx_dataValidations_context::xlsx_dataValidations_context() :
|
||||
impl_(new xlsx_dataValidations_context::Impl())
|
||||
{}
|
||||
|
||||
xlsx_dataValidations_context::~xlsx_dataValidations_context()
|
||||
{
|
||||
}
|
||||
void xlsx_dataValidations_context::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
return impl_->serialize(_Wostream);
|
||||
}
|
||||
void xlsx_dataValidations_context::activate(const std::wstring & name, const std::wstring & ref)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFindActivate = impl_->mapActivateDataValidations.find(name);
|
||||
|
||||
if (pFindActivate != impl_->mapActivateDataValidations.end())
|
||||
{
|
||||
pFindActivate->second->activate_ref += L" " + ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind != impl_->mapDataValidations.end())
|
||||
{
|
||||
pFind->second->activate_ref = ref;
|
||||
impl_->mapActivateDataValidations.insert(std::make_pair(name, pFind->second));
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_dataValidations_context::add_help_msg(const std::wstring & name, bool val)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
pFind->second->showInputMessage = val;
|
||||
}
|
||||
|
||||
void xlsx_dataValidations_context::add_error_msg(const std::wstring & name, bool val)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
pFind->second->showErrorMessage = val;
|
||||
}
|
||||
|
||||
void xlsx_dataValidations_context::add(const std::wstring & name, const std::wstring &ref)
|
||||
{
|
||||
xlsx_dataValidation_ptr _new = xlsx_dataValidation_ptr(new xlsx_dataValidation());
|
||||
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
_new->ref = converter.convert_named_ref(ref, false, L";");
|
||||
|
||||
impl_->mapDataValidations.insert(std::make_pair(name, _new));
|
||||
}
|
||||
|
||||
void xlsx_dataValidations_context::add_formula(const std::wstring & name, const std::wstring & f) // todooo пооптимальней
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
int pos = -1;
|
||||
std::wstring val;
|
||||
|
||||
if ( 0 <= (pos = f.find(L"cell-content-is-in-list"))) //oooc: , of:
|
||||
{
|
||||
pFind->second->type = L"list";
|
||||
val = f.substr(24 + pos, f.size() - 25 - pos);
|
||||
|
||||
if ( val.substr(0, 1) == L"\"")
|
||||
{
|
||||
XmlUtils::replace_all(val, L"\"", L"");
|
||||
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
|
||||
if ( std::wstring::npos != val.find(L";") )//convert formula replacing ; on ,
|
||||
{
|
||||
pFind->second->formula1 = L"\"" + pFind->second->formula1 + L"\"";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
61
ASCOfficeOdfFile/src/docx/xlsx_data_validation.h
Normal file
61
ASCOfficeOdfFile/src/docx/xlsx_data_validation.h
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* (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 <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
class xlsx_dataValidations_context
|
||||
{
|
||||
public:
|
||||
xlsx_dataValidations_context();
|
||||
~xlsx_dataValidations_context();
|
||||
|
||||
void add(const std::wstring & name, const std::wstring & ref);
|
||||
void add_formula(const std::wstring & name, const std::wstring & f);
|
||||
void add_help_msg(const std::wstring & name, bool val);
|
||||
void add_error_msg(const std::wstring & name, bool val);
|
||||
|
||||
void activate(const std::wstring & name, const std::wstring & ref);
|
||||
|
||||
void serialize(std::wostream & _Wostream);
|
||||
private:
|
||||
class Impl;
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
@ -54,6 +54,8 @@ public:
|
||||
std::wstringstream sort_;
|
||||
std::wstringstream autofilter_;
|
||||
std::wstringstream conditionalFormatting_;
|
||||
std::wstringstream picture_background_;
|
||||
std::wstringstream dataValidations_;
|
||||
std::wstringstream ole_objects_;
|
||||
std::wstringstream page_props_;
|
||||
|
||||
@ -138,7 +140,14 @@ std::wostream & xlsx_xml_worksheet::page_properties()
|
||||
{
|
||||
return impl_->page_props_;
|
||||
}
|
||||
|
||||
std::wostream & xlsx_xml_worksheet::picture_background()
|
||||
{
|
||||
return impl_->picture_background_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::dataValidations()
|
||||
{
|
||||
return impl_->dataValidations_;
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
rels & xlsx_xml_worksheet::sheet_rels()
|
||||
{
|
||||
@ -178,6 +187,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
|
||||
CP_XML_STREAM() << impl_->conditionalFormatting_.str();
|
||||
|
||||
CP_XML_STREAM() << impl_->dataValidations_.str();
|
||||
if (!impl_->hyperlinks_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"hyperlinks")
|
||||
@ -207,6 +217,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << impl_->picture_background_.str();
|
||||
|
||||
//CP_XML_NODE(L"headerFooter){}
|
||||
|
||||
|
||||
@ -61,6 +61,8 @@ public:
|
||||
std::wostream & comments();
|
||||
std::wostream & autofilter();
|
||||
std::wostream & conditionalFormatting();
|
||||
std::wostream & picture_background();
|
||||
std::wostream & dataValidations();
|
||||
std::wostream & sort();
|
||||
std::wostream & ole_objects();
|
||||
std::wostream & page_properties();
|
||||
|
||||
@ -120,7 +120,7 @@ public:
|
||||
xlsx_table_metrics & get_table_metrics() { return xlsx_table_metrics_; }
|
||||
xlsx_drawing_context & get_drawing_context() { return xlsx_drawing_context_; }
|
||||
xlsx_comments_context & get_comments_context() { return xlsx_comments_context_; }
|
||||
xlsx_conditionalFormatting_context & get_conditionalFormatting_context() {return xlsx_conditionalFormatting_context_;}
|
||||
xlsx_conditionalFormatting_context & get_conditionalFormatting_context() { return xlsx_conditionalFormatting_context_;}
|
||||
|
||||
void table_column_last_width(double w) { table_column_last_width_ = w; }
|
||||
double table_column_last_width() const { return table_column_last_width_; };
|
||||
|
||||
@ -324,6 +324,10 @@ void xlsx_table_context::serialize_background(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_background(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_data_validation(std::wostream & _Wostream)
|
||||
{
|
||||
return xlsx_conversion_context_->get_dataValidations_context().serialize(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_hyperlinks(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_hyperlinks(_Wostream);
|
||||
|
||||
@ -91,6 +91,7 @@ public:
|
||||
void serialize_ole_objects (std::wostream & _Wostream);
|
||||
void serialize_page_properties (std::wostream & _Wostream);
|
||||
void serialize_background (std::wostream & _Wostream);
|
||||
void serialize_data_validation (std::wostream & _Wostream);
|
||||
|
||||
xlsx_table_metrics & get_table_metrics();
|
||||
|
||||
|
||||
@ -49,13 +49,6 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
void removeCharsFromString( std::wstring &str, std::wstring charsToRemove )
|
||||
{
|
||||
for ( unsigned int i = 0; i < charsToRemove.length(); ++i )
|
||||
{
|
||||
str.erase( std::remove(str.begin(), str.end(), charsToRemove[i]), str.end() );
|
||||
}
|
||||
}
|
||||
|
||||
class xlsx_text_context::Impl: boost::noncopyable
|
||||
{
|
||||
|
||||
@ -437,6 +437,7 @@ void xlsx_conversion_context::end_table()
|
||||
get_table_context().serialize_autofilter (current_sheet().autofilter());
|
||||
get_table_context().serialize_sort (current_sheet().sort());
|
||||
get_table_context().serialize_merge_cells (current_sheet().mergeCells());
|
||||
get_table_context().serialize_data_validation (current_sheet().dataValidations());
|
||||
|
||||
get_drawing_context().set_odf_packet_path (root()->get_folder());
|
||||
get_drawing_context().process_objects (get_table_metrics());
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
#include "xlsx_defined_names.h"
|
||||
#include "xlsx_table_metrics.h"
|
||||
#include "xlsx_pivots_context.h"
|
||||
#include "xlsx_data_validation.h"
|
||||
#include "oox_chart_context.h"
|
||||
|
||||
#include "mediaitems.h"
|
||||
@ -179,6 +180,7 @@ public:
|
||||
xlsx_drawing_context_handle & get_drawing_context_handle();
|
||||
xlsx_comments_context & get_comments_context();
|
||||
xlsx_comments_context_handle & get_comments_context_handle();
|
||||
xlsx_dataValidations_context& get_dataValidations_context() { return xlsx_dataValidations_context_;}
|
||||
|
||||
mediaitems & get_mediaitems() { return mediaitems_; }
|
||||
|
||||
@ -212,6 +214,7 @@ private:
|
||||
xlsx_pivots_context xlsx_pivots_context_;
|
||||
xlsx_drawing_context_handle xlsx_drawing_context_handle_;
|
||||
xlsx_comments_context_handle xlsx_comments_context_handle_;
|
||||
xlsx_dataValidations_context xlsx_dataValidations_context_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -41,9 +41,10 @@ std::wostream & operator << (std::wostream & _Wostream, const chart_data_label_n
|
||||
{
|
||||
switch(_Val.get_type())
|
||||
{
|
||||
case chart_data_label_number::none: _Wostream << L"none"; break;
|
||||
case chart_data_label_number::value: _Wostream << L"value"; break;
|
||||
case chart_data_label_number::percentage : _Wostream << L"percentage"; break;
|
||||
case chart_data_label_number::none: _Wostream << L"none"; break;
|
||||
case chart_data_label_number::value: _Wostream << L"value"; break;
|
||||
case chart_data_label_number::percentage : _Wostream << L"percentage"; break;
|
||||
case chart_data_label_number::value_and_percentage: _Wostream << L"value-and-percentage"; break;
|
||||
}
|
||||
return _Wostream;
|
||||
}
|
||||
@ -59,9 +60,10 @@ chart_data_label_number chart_data_label_number::parse(const std::wstring & Str)
|
||||
return chart_data_label_number( value );
|
||||
else if (tmp == L"percentage")
|
||||
return chart_data_label_number( percentage );
|
||||
else
|
||||
else if (tmp == L"value-and-percentage")
|
||||
return chart_data_label_number( value_and_percentage );
|
||||
else
|
||||
{
|
||||
BOOST_THROW_EXCEPTION( errors::invalid_attribute() );
|
||||
return chart_data_label_number( none );
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,8 @@ public:
|
||||
{
|
||||
none,
|
||||
value,
|
||||
percentage
|
||||
percentage,
|
||||
value_and_percentage
|
||||
};
|
||||
|
||||
chart_data_label_number() {}
|
||||
|
||||
@ -144,7 +144,6 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_name);
|
||||
|
||||
// svg:definition-src
|
||||
@ -164,10 +163,8 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(svg_definition_src);
|
||||
|
||||
|
||||
// style:font-face
|
||||
class style_font_face : public office_element_impl<style_font_face>
|
||||
{
|
||||
@ -233,7 +230,6 @@ public:
|
||||
|
||||
friend class odf_document;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_font_face);
|
||||
|
||||
// office-font-face-decls
|
||||
@ -257,7 +253,6 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(office_font_face_decls);
|
||||
|
||||
}
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "paragraph_elements.h"
|
||||
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/CPColorUtils.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
@ -81,7 +80,16 @@ void chart_chart::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
|
||||
void chart_chart::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
if CP_CHECK_NAME(L"text", L"tracked-changes")
|
||||
{
|
||||
CP_CREATE_ELEMENT(tracked_changes_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"table", L"content-validations")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_validations_);
|
||||
}
|
||||
else
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
void chart_title_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
|
||||
@ -60,7 +60,10 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr tracked_changes_;
|
||||
office_element_ptr content_validations_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
|
||||
@ -105,6 +108,10 @@ private:
|
||||
|
||||
public:
|
||||
chart_chart_attlist attlist_;
|
||||
|
||||
office_element_ptr tracked_changes_;
|
||||
office_element_ptr content_validations_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
|
||||
|
||||
@ -69,8 +69,14 @@ enum ElementType
|
||||
typeTextTime,
|
||||
typeTextModificationTime,
|
||||
typeTextFileName,
|
||||
typeTextSequence,
|
||||
typeTextSheetName,
|
||||
typeTextTemplateName,
|
||||
typeTextDropDown,
|
||||
typeTextLabel,
|
||||
|
||||
typeTextSequenceDecls,
|
||||
typeTextSequenceDecl,
|
||||
typeTextSequence,
|
||||
|
||||
typePresentationFooter,
|
||||
typePresentationDateTime,
|
||||
@ -78,6 +84,8 @@ enum ElementType
|
||||
typeDcCreator,
|
||||
typeDcDate,
|
||||
|
||||
typeDrawA,
|
||||
|
||||
typeTextH,
|
||||
typeTextP,
|
||||
|
||||
@ -90,28 +98,42 @@ enum ElementType
|
||||
typeTextSectionSource,
|
||||
typeTextIndexTitle,
|
||||
typeTextIndexBody,
|
||||
|
||||
typeTextNumberedParagraph,
|
||||
|
||||
typeDrawA,
|
||||
typeTextNumberedParagraph,
|
||||
typeTextExpression,
|
||||
|
||||
typeTextTableOfContent,
|
||||
typeTextIllustrationIndex,
|
||||
typeTextTableIndex,
|
||||
typeTextObjectIndex,
|
||||
typeTextUserIndex,
|
||||
typeTextAlphabeticalIndex,
|
||||
typeTextBibliography,
|
||||
|
||||
typeTextBibliographyMark,
|
||||
|
||||
typeTextTableOfContentSource,
|
||||
|
||||
typeTextIllustrationIndex,
|
||||
typeTextIllustrationIndexSource,
|
||||
|
||||
typeTextTableIndex,
|
||||
typeTextTableIndexSource,
|
||||
|
||||
typeTextObjectIndex,
|
||||
typeTextObjectIndexSource,
|
||||
|
||||
typeTextUserIndex,
|
||||
typeTextUserIndexSource,
|
||||
|
||||
typeTextAlphabeticalIndex,
|
||||
typeTextAlphabeticalIndexSource,
|
||||
typeTextBibliographySource,
|
||||
|
||||
typeTextBibliography,
|
||||
typeTextBibliographyMark,
|
||||
typeTextBibliographySource,
|
||||
|
||||
typeTextVariableInput,
|
||||
typeTextVariableGet,
|
||||
typeTextVariableSet,
|
||||
typeTextVariableDecl,
|
||||
typeTextVariableDecls,
|
||||
|
||||
typeTextUserFieldDecls,
|
||||
typeTextUserFieldDecl,
|
||||
typeTextUserFieldGet,
|
||||
typeTextUserFieldSet,
|
||||
typeTextUserFieldInput,
|
||||
|
||||
typeTextTrackedChanges,
|
||||
typeTextChangedRegion,
|
||||
@ -125,6 +147,11 @@ enum ElementType
|
||||
typeTextFormatChange,
|
||||
typeTextInsertion,
|
||||
|
||||
typeTextMeta,
|
||||
typeTextMetaField,
|
||||
|
||||
typeTextTextInput,
|
||||
|
||||
typeShape,
|
||||
typeChangeMarks,
|
||||
|
||||
@ -206,6 +233,14 @@ enum ElementType
|
||||
typeTableDatabaseRange,
|
||||
typeTableSort,
|
||||
typeTableSortBy,
|
||||
typeTableCalculationSettings,
|
||||
typeTableNullDate,
|
||||
typeTableShapes,
|
||||
typeTableContentValidation,
|
||||
typeTableContentValidations,
|
||||
typeTableHelpMassage,
|
||||
typeTableErrorMassage,
|
||||
typeTableErrorMacro,
|
||||
|
||||
typeTableFilter,
|
||||
typeTableFilterAnd,
|
||||
@ -384,9 +419,6 @@ enum ElementType
|
||||
|
||||
typeScriptEventListener,
|
||||
|
||||
typeTableCalculationSettings,
|
||||
typeTableNullDate,
|
||||
|
||||
typeNumberNumberStyle,
|
||||
typeNumberDataStyle,
|
||||
typeNumberText,
|
||||
@ -409,7 +441,6 @@ enum ElementType
|
||||
typeNumberMinutes,
|
||||
typeNumberSeconds,
|
||||
typeNumberAmPm,
|
||||
typeTableShapes,
|
||||
|
||||
typeChartChart,
|
||||
typeChartTitle,
|
||||
|
||||
@ -54,11 +54,25 @@ const wchar_t * office_presentation::name = L"presentation";
|
||||
void office_presentation::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"draw", L"page")
|
||||
{
|
||||
CP_CREATE_ELEMENT(pages_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"table", L"tracked-changes")
|
||||
{
|
||||
CP_CREATE_ELEMENT(tracked_changes_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"table", L"content-validations")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_validations_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"presentation", L"footer-decl")
|
||||
{
|
||||
CP_CREATE_ELEMENT(footer_decls_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"presentation", L"date-time-decl")
|
||||
{
|
||||
CP_CREATE_ELEMENT(date_time_decls_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -62,10 +62,13 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
office_element_ptr_array date_time_decls_;
|
||||
office_element_ptr_array footer_decls_;
|
||||
office_element_ptr tracked_changes_;
|
||||
office_element_ptr content_validations_;
|
||||
|
||||
office_element_ptr_array date_time_decls_;
|
||||
office_element_ptr_array footer_decls_;
|
||||
|
||||
office_element_ptr_array pages_;
|
||||
office_element_ptr_array pages_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
|
||||
@ -63,6 +63,10 @@ void office_spreadsheet::add_child_element( xml::sax * Reader, const std::wstrin
|
||||
{
|
||||
CP_CREATE_ELEMENT(tracked_changes_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"table", L"content-validations")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_validations_);
|
||||
}
|
||||
else
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
@ -88,6 +92,9 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if (database_ranges_)
|
||||
database_ranges_->xlsx_convert(Context);
|
||||
|
||||
if (content_validations_)
|
||||
content_validations_->xlsx_convert(Context);
|
||||
|
||||
if (data_pilot_tables_)
|
||||
data_pilot_tables_->xlsx_convert(Context);
|
||||
|
||||
|
||||
@ -62,12 +62,12 @@ public:
|
||||
office_element_ptr database_ranges_;
|
||||
office_element_ptr data_pilot_tables_;
|
||||
office_element_ptr tracked_changes_;
|
||||
|
||||
office_element_ptr content_validations_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
// table:calculation-settings
|
||||
// table:consolidation
|
||||
// table:content-validations
|
||||
// table:dde-links
|
||||
// table:label-ranges
|
||||
|
||||
|
||||
@ -101,6 +101,10 @@ void office_text::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
||||
{
|
||||
CP_CREATE_ELEMENT(tracked_changes_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"table", L"content-validations")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_validations_);
|
||||
}
|
||||
else if (is_text_content(Ns, Name))
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
|
||||
@ -67,7 +67,9 @@ private:
|
||||
// TODO: table-decls
|
||||
|
||||
office_element_ptr tracked_changes_;
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr content_validations_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
// TODO: text-page-sequence
|
||||
// TODO: office-text-content-epilogue:
|
||||
// TODO: table-functions
|
||||
|
||||
@ -39,7 +39,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <cpdoccore/common/readstring.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
@ -742,7 +741,7 @@ std::wostream & title::text_to_stream(std::wostream & _Wostream) const
|
||||
|
||||
void title::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
common_field_fixed_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void title::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -806,7 +805,7 @@ std::wostream & subject::text_to_stream(std::wostream & _Wostream) const
|
||||
|
||||
void subject::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
common_field_fixed_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void subject::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -823,8 +822,8 @@ void subject::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
Context.finish_run();
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\" /></w:r>";
|
||||
strm << L"<w:r><w:instrText>SUBJECT</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"separate\" /></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
|
||||
strm << L"<w:r><w:instrText>SUBJECT</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
|
||||
Context.add_new_run();
|
||||
|
||||
std::wstring textNode = L"w:t";
|
||||
@ -838,7 +837,7 @@ void subject::docx_convert(oox::docx_conversion_context & Context)
|
||||
strm << L"</" << textNode << L">";
|
||||
|
||||
Context.finish_run();
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"end\" /></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
|
||||
}
|
||||
|
||||
void subject::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
@ -869,7 +868,7 @@ std::wostream & chapter::text_to_stream(std::wostream & _Wostream) const
|
||||
|
||||
void chapter::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
common_field_fixed_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void chapter::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -1379,9 +1378,77 @@ void sequence::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
text_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:drop-down
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_drop_down::ns = L"text";
|
||||
const wchar_t * text_drop_down::name = L"drop-down";
|
||||
|
||||
// text:sequesheet-namence
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void text_drop_down::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"text:name", text_name_);
|
||||
}
|
||||
|
||||
void text_drop_down::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"text", L"label")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void text_drop_down::add_text(const std::wstring & Text)
|
||||
{
|
||||
text_ = Text;
|
||||
}
|
||||
std::wostream & text_drop_down::text_to_stream(std::wostream & _Wostream) const
|
||||
{
|
||||
_Wostream << xml::utils::replace_text_to_xml( text_ );
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
void text_drop_down::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
Context.finish_run();
|
||||
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"><w:ffData><w:name w:val=\"" << text_name_.get_value_or(L"") << L"\"/><w:enabled/>";
|
||||
|
||||
strm << L"<w:ddList><w:result w:val=\"0\"/>";
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
strm << L"</w:ddList></w:ffData>";
|
||||
|
||||
strm << L"</w:fldChar></w:r>";
|
||||
strm << L"<w:r><w:instrText>FORMDROPDOWN</w:instrText></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
|
||||
strm << L"<w:r><w:t>" << text_ << L"</w:t></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:label
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_label::ns = L"text";
|
||||
const wchar_t * text_label::name = L"label";
|
||||
|
||||
void text_label::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"text:value", text_value_);
|
||||
}
|
||||
void text_label::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
|
||||
strm << L"<w:listEntry w:val=\"" << text_value_.get_value_or(L"") << L"\"/>";
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sheet-name
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * sheet_name::ns = L"text";
|
||||
const wchar_t * sheet_name::name = L"sheet-name";
|
||||
|
||||
|
||||
@ -122,7 +122,6 @@ private:
|
||||
_CP_OPT(unsigned int) text_c_;
|
||||
_CP_OPT(std::wstring) content_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(s);
|
||||
|
||||
// text:tab
|
||||
@ -431,7 +430,6 @@ CP_REGISTER_OFFICE_ELEMENT2(a);
|
||||
|
||||
// text:note
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class note : public paragraph_content_element<note>
|
||||
{
|
||||
public:
|
||||
@ -452,18 +450,16 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
std::wstring text_id_;
|
||||
odf_types::noteclass text_note_class_;
|
||||
office_element_ptr text_note_citation_;
|
||||
office_element_ptr text_note_body_;
|
||||
std::wstring text_id_;
|
||||
odf_types::noteclass text_note_class_;
|
||||
office_element_ptr text_note_citation_;
|
||||
office_element_ptr text_note_body_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(note);
|
||||
|
||||
// text:ruby
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ruby : public paragraph_content_element<ruby>
|
||||
{
|
||||
public:
|
||||
@ -485,7 +481,6 @@ private:
|
||||
office_element_ptr text_ruby_text_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(ruby);
|
||||
|
||||
class common_field_fixed_attlist
|
||||
@ -521,8 +516,8 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
common_field_fixed_attlist common_field_fixed_attlist_;
|
||||
office_element_ptr_array content_;
|
||||
common_field_fixed_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
|
||||
@ -549,7 +544,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
common_field_fixed_attlist common_field_fixed_attlist_;
|
||||
common_field_fixed_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
@ -577,7 +572,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
common_field_fixed_attlist common_field_fixed_attlist_;
|
||||
common_field_fixed_attlist attlist_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
@ -687,7 +682,7 @@ public:
|
||||
_CP_OPT(bool) text_fixed_;
|
||||
_CP_OPT(std::wstring) text_date_value_;//with format
|
||||
|
||||
office_element_ptr_array text_;
|
||||
office_element_ptr_array text_;
|
||||
|
||||
private:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
@ -715,8 +710,9 @@ public:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_modification_date);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:time
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_time : public paragraph_content_element<text_time>
|
||||
{
|
||||
public:
|
||||
@ -745,8 +741,9 @@ private:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_time);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:modification-date
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_modification_time : public text_time
|
||||
{
|
||||
public:
|
||||
@ -762,8 +759,9 @@ public:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_modification_time);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:file-name
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_file_name : public paragraph_content_element<text_file_name>
|
||||
{
|
||||
public:
|
||||
@ -787,11 +785,11 @@ private:
|
||||
office_element_ptr_array text_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_file_name);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sequence
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sequence : public paragraph_content_element<sequence>
|
||||
{
|
||||
public:
|
||||
@ -815,11 +813,58 @@ private:
|
||||
office_element_ptr_array text_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(sequence);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:drop-down
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_drop_down : public paragraph_content_element<text_drop_down>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextDropDown;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
_CP_OPT(std::wstring) text_name_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
std::wstring text_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_drop_down);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:drop-down
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_label : public paragraph_content_element<text_label>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextLabel;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
_CP_OPT(std::wstring) text_value_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_label);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sheet-name
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sheet_name : public paragraph_content_element<sheet_name>
|
||||
{
|
||||
public:
|
||||
@ -837,11 +882,11 @@ private:
|
||||
office_element_ptr_array text_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(sheet_name);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//presentation:footer
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class presentation_footer : public paragraph_content_element<presentation_footer>
|
||||
{
|
||||
public:
|
||||
@ -861,8 +906,9 @@ private:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_footer);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//presentation:date-time
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class presentation_date_time: public paragraph_content_element<presentation_date_time>
|
||||
{
|
||||
public:
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
|
||||
#include "ruby.h"
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ namespace odf_reader {
|
||||
|
||||
void removeCharsFromString( std::wstring &str, std::wstring charsToRemove )
|
||||
{
|
||||
for ( unsigned int i = 0; i < charsToRemove.length(); ++i )
|
||||
for ( size_t i = 0; i < charsToRemove.length(); ++i )
|
||||
{
|
||||
str.erase( std::remove(str.begin(), str.end(), charsToRemove[i]), str.end() );
|
||||
}
|
||||
@ -292,14 +292,14 @@ void text_format_properties_content::pptx_convert_as_list(oox::pptx_conversion_c
|
||||
w_font = font->name();
|
||||
|
||||
//'Arial' глючит
|
||||
removeCharsFromString(w_font, _T("'"));
|
||||
removeCharsFromString(w_font, L"'");
|
||||
}
|
||||
|
||||
if (w_font.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"a:buFont")
|
||||
{
|
||||
removeCharsFromString(w_font, _T("'"));
|
||||
removeCharsFromString(w_font, L"'");
|
||||
CP_XML_ATTR(L"typeface", w_font);
|
||||
if ((style_font_charset_))
|
||||
{
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
#include "styles.h"
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
@ -729,7 +728,61 @@ void table_shapes::add_child_element( xml::sax * Reader, const std::wstring & Ns
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// table:content-validations
|
||||
const wchar_t * table_content_validations::ns = L"table";
|
||||
const wchar_t * table_content_validations::name = L"content-validations";
|
||||
|
||||
void table_content_validations::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// table:content-validation
|
||||
const wchar_t * table_content_validation::ns = L"table";
|
||||
const wchar_t * table_content_validation::name = L"content-validation";
|
||||
|
||||
void table_content_validation::add_attributes(xml::attributes_wc_ptr const & Attributes)
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:name", table_name_);
|
||||
CP_APPLY_ATTR(L"table:condition", table_condition_);
|
||||
CP_APPLY_ATTR(L"table:display-list", table_display_list_);
|
||||
CP_APPLY_ATTR(L"table:allowempty-cell", table_allowempty_cell_);
|
||||
CP_APPLY_ATTR(L"table:base-cell-address", table_base_cell_address_);
|
||||
}
|
||||
void table_content_validation::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// table:content-validation
|
||||
const wchar_t * table_error_message::ns = L"table";
|
||||
const wchar_t * table_error_message::name = L"error-message";
|
||||
|
||||
void table_error_message::add_attributes(xml::attributes_wc_ptr const & Attributes)
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:title", table_title_);
|
||||
CP_APPLY_ATTR(L"table:message-type", table_message_type_);
|
||||
CP_APPLY_ATTR(L"table:display", table_display_);
|
||||
}
|
||||
void table_error_message::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// table:content-validation
|
||||
const wchar_t * table_help_message::ns = L"table";
|
||||
const wchar_t * table_help_message::name = L"help-message";
|
||||
|
||||
void table_help_message::add_attributes(xml::attributes_wc_ptr const & Attributes)
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:title", table_title_);
|
||||
CP_APPLY_ATTR(L"table:message-type", table_message_type_);
|
||||
CP_APPLY_ATTR(L"table:display", table_display_);
|
||||
}
|
||||
void table_help_message::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -653,6 +653,7 @@ public:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_table);
|
||||
|
||||
//table:content-shapes
|
||||
class table_shapes : public office_element_impl<table_shapes>
|
||||
{
|
||||
public:
|
||||
@ -676,5 +677,105 @@ private:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_shapes);
|
||||
|
||||
//table:content-validations
|
||||
class table_content_validations : public office_element_impl<table_content_validations>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableContentValidations;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_content_validations);
|
||||
|
||||
//table:content-validation
|
||||
class table_content_validation : public office_element_impl<table_content_validation>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableContentValidation;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
_CP_OPT(std::wstring) table_name_;
|
||||
_CP_OPT(odf_types::Bool) table_allowempty_cell_;
|
||||
_CP_OPT(std::wstring) table_display_list_;
|
||||
_CP_OPT(std::wstring) table_condition_;
|
||||
_CP_OPT(std::wstring) table_base_cell_address_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_content_validation);
|
||||
|
||||
//table:error-message
|
||||
class table_error_message : public office_element_impl<table_error_message>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableErrorMassage;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
_CP_OPT(std::wstring) table_title_;
|
||||
_CP_OPT(odf_types::Bool) table_display_;
|
||||
_CP_OPT(std::wstring) table_message_type_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_error_message);
|
||||
|
||||
//table:help-message
|
||||
class table_help_message : public office_element_impl<table_help_message>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableHelpMassage;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
_CP_OPT(std::wstring) table_title_;
|
||||
_CP_OPT(odf_types::Bool) table_display_;
|
||||
_CP_OPT(std::wstring) table_message_type_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_help_message);
|
||||
|
||||
//table:error-macro
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include "odfcontext.h"
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
@ -34,7 +34,6 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
@ -804,11 +803,13 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
is_style_visible = (!cellStyleName.empty() || defaultColumnCellStyle) ? true : false;
|
||||
|
||||
if ( content_.elements_.size() > 0 ||
|
||||
!formula.empty() ||
|
||||
if ( content_.elements_.size() > 0 || attlist_.table_content_validation_name_ || !formula.empty() ||
|
||||
( t_val == oox::XlsxCellType::n && !number_val.empty()) ||
|
||||
( t_val == oox::XlsxCellType::b && bool_val) ||
|
||||
(( t_val == oox::XlsxCellType::str || oox::XlsxCellType::inlineStr) && str_val)) is_data_visible = true;
|
||||
(( t_val == oox::XlsxCellType::str || oox::XlsxCellType::inlineStr) && str_val))
|
||||
{
|
||||
is_data_visible = true;
|
||||
}
|
||||
|
||||
if (attlist_.table_number_columns_repeated_ < 199 && last_cell_) last_cell_ = false;
|
||||
|
||||
@ -838,15 +839,20 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
t_val = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение
|
||||
|
||||
if (skip_next_cell)break;
|
||||
|
||||
// пустые ячейки пропускаем.
|
||||
|
||||
// пустые ячейки пропускаем.
|
||||
if ( is_data_visible || ((cellStyle || defaultColumnCellStyle) && is_style_visible))
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
std::wstring ref = oox::getCellAddress(Context.current_table_column(), Context.current_table_row());
|
||||
if (attlist_.table_content_validation_name_)
|
||||
{
|
||||
Context.get_dataValidations_context().activate(*attlist_.table_content_validation_name_, ref);
|
||||
}
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"c")
|
||||
{
|
||||
CP_XML_ATTR(L"r", oox::getCellAddress(Context.current_table_column(), Context.current_table_row()));
|
||||
CP_XML_ATTR(L"r", ref);
|
||||
CP_XML_ATTR(L"t", oox::cellType2Str(t_val));
|
||||
CP_XML_ATTR(L"s", xfId_last_set);
|
||||
|
||||
@ -888,6 +894,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_NODE(L"v") { CP_XML_CONTENT((int)(bool_val.get())); }
|
||||
}
|
||||
|
||||
}
|
||||
if ( is_data_visible || (cellStyle && is_style_visible && !last_cell_))
|
||||
{
|
||||
@ -1180,5 +1187,38 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
}
|
||||
}
|
||||
|
||||
void table_content_validations::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0 ; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
void table_content_validation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
std::wstring name = table_name_.get_value_or(L"");
|
||||
|
||||
Context.get_dataValidations_context().add(name, table_base_cell_address_.get_value_or(L""));
|
||||
Context.get_dataValidations_context().add_formula(name, table_condition_.get_value_or(L""));
|
||||
|
||||
for (size_t i = 0 ; i < content_.size(); i++)
|
||||
{
|
||||
if (content_[i]->get_type() == typeTableErrorMassage)
|
||||
{
|
||||
Context.get_dataValidations_context().add_error_msg(name, true);
|
||||
}
|
||||
else if (content_[i]->get_type() == typeTableErrorMassage)
|
||||
{
|
||||
Context.get_dataValidations_context().add_help_msg(name, true);
|
||||
}
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
void table_error_message::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
}
|
||||
void table_help_message::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
|
||||
#include "paragraph_elements.h"
|
||||
#include "serialize_elements.h"
|
||||
@ -341,13 +341,13 @@ void paragraph::drop_cap_text_docx_convert(office_element_ptr first_text_element
|
||||
int textStyle = process_paragraph_attr(attrs_, Context);
|
||||
first_text_paragraph->docx_convert(Context);
|
||||
|
||||
int str_start = Context.get_drop_cap_context().Length;
|
||||
int str_size = store_str.length()-Context.get_drop_cap_context().Length;
|
||||
size_t str_start = Context.get_drop_cap_context().Length;
|
||||
size_t str_size = store_str.length() - Context.get_drop_cap_context().Length;
|
||||
|
||||
if (str_size < 0) str_size = 0; // это если на буквы в буквице разные стили
|
||||
if (str_start > store_str.length()) str_start = store_str.length(); // это если на буквы в буквице разные стили
|
||||
|
||||
str=store_str.substr(str_start, str_size);
|
||||
str = store_str.substr(str_start, str_size);
|
||||
}
|
||||
|
||||
size_t paragraph::drop_cap_docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -1424,7 +1424,119 @@ void text_change_end::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.end_text_changes (*text_change_id_);
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_variable_input::ns = L"text";
|
||||
const wchar_t * text_variable_input::name = L"variable-input";
|
||||
|
||||
void text_variable_input::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
|
||||
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
|
||||
CP_APPLY_ATTR(L"text:description", text_description_);
|
||||
CP_APPLY_ATTR(L"text:display", text_display_);
|
||||
CP_APPLY_ATTR(L"text:name", text_name_);
|
||||
}
|
||||
void text_variable_input::add_text(const std::wstring & Text)
|
||||
{
|
||||
text_ = Text;
|
||||
}
|
||||
std::wostream & text_variable_input::text_to_stream(std::wostream & _Wostream) const
|
||||
{
|
||||
_Wostream << xml::utils::replace_text_to_xml( text_ );
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
void text_variable_input::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
Context.finish_run();
|
||||
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
|
||||
strm << L"<w:r><w:instrText>ASK "" << text_name_.get_value_or(L"") << L"" " << text_description_.get_value_or(L"") << L" \\d ";
|
||||
strm << text_;
|
||||
strm << L"</w:instrText></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
|
||||
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
|
||||
strm << L"<w:r><w:instrText>REF "" << text_name_.get_value_or(L"") << L"" </w:instrText></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
|
||||
strm << L"<w:r><w:t>" << text_ << L"</w:t></w:r>";
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_variable_get::ns = L"text";
|
||||
const wchar_t * text_variable_get::name = L"variable-get";
|
||||
|
||||
void text_variable_get::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
|
||||
CP_APPLY_ATTR(L"text:display", text_display_);
|
||||
CP_APPLY_ATTR(L"text:name", text_name_);
|
||||
}
|
||||
void text_variable_get::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_variable_set::ns = L"text";
|
||||
const wchar_t * text_variable_set::name = L"variable-set";
|
||||
|
||||
void text_variable_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
|
||||
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
|
||||
CP_APPLY_ATTR(L"text:display", text_display_);
|
||||
CP_APPLY_ATTR(L"text:name", text_name_);
|
||||
|
||||
CP_APPLY_ATTR(L"office:value", office_value_);
|
||||
CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_);
|
||||
CP_APPLY_ATTR(L"office:date-value", office_date_value_);
|
||||
CP_APPLY_ATTR(L"office:time-value", office_time_value_);
|
||||
CP_APPLY_ATTR(L"office:string-value", office_string_value_);
|
||||
CP_APPLY_ATTR(L"office:currency", office_currency_);
|
||||
CP_APPLY_ATTR(L"office:formula", office_formula_);
|
||||
}
|
||||
void text_variable_set::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_variable_decl::ns = L"text";
|
||||
const wchar_t * text_variable_decl::name = L"variable-decl";
|
||||
|
||||
void text_variable_decl::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
|
||||
CP_APPLY_ATTR(L"text:display", text_display_);
|
||||
CP_APPLY_ATTR(L"text:name", text_name_);
|
||||
}
|
||||
void text_variable_decl::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text_variable_decls::ns = L"text";
|
||||
const wchar_t * text_variable_decls::name = L"variable-decls";
|
||||
|
||||
void text_variable_decls::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"text", L"variable-decl")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
void text_variable_decls::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -535,8 +535,6 @@ public:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_index_title);
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_unknown_base_change : public office_element_impl<text_unknown_base_change>
|
||||
{
|
||||
@ -717,8 +715,137 @@ public:
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_change_end);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:variable-input
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_variable_input : public office_element_impl<text_variable_input>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextVariableInput;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
_CP_OPT(odf_types::office_value_type) office_value_type_;
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(std::wstring) text_description_;
|
||||
_CP_OPT(std::wstring) text_display_;
|
||||
_CP_OPT(std::wstring) text_name_;
|
||||
|
||||
std::wstring text_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_variable_input);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:variable-get
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_variable_get : public office_element_impl<text_variable_get>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextVariableGet;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(std::wstring) text_display_;
|
||||
_CP_OPT(std::wstring) text_name_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_variable_get);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:variable-set
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_variable_set : public office_element_impl<text_variable_set>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextVariableSet;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
_CP_OPT(odf_types::office_value_type) office_value_type_;
|
||||
|
||||
_CP_OPT(std::wstring) office_boolean_value_;
|
||||
_CP_OPT(std::wstring) office_date_value_;
|
||||
_CP_OPT(std::wstring) office_time_value_;
|
||||
_CP_OPT(std::wstring) office_string_value_;
|
||||
_CP_OPT(std::wstring) office_value_;
|
||||
_CP_OPT(std::wstring) office_currency_;
|
||||
_CP_OPT(std::wstring) office_formula_;
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(std::wstring) text_display_;
|
||||
_CP_OPT(std::wstring) text_name_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_variable_set);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:variable-decl
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_variable_decl : public office_element_impl<text_variable_decl>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextVariableDecl;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
_CP_OPT(odf_types::office_value_type) office_value_type_;
|
||||
_CP_OPT(std::wstring) text_display_;
|
||||
_CP_OPT(std::wstring) text_name_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_variable_decl);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:variable-decls
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_variable_decls : public office_element_impl<text_variable_decls>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextVariableDecls;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(text_variable_decls);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -642,6 +642,14 @@
|
||||
RelativePath="..\src\docx\xlsx_conditionalFormatting.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\docx\xlsx_data_validation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\docx\xlsx_data_validation.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\docx\xlsx_defined_names.cpp"
|
||||
>
|
||||
|
||||
@ -151,13 +151,17 @@ namespace odf_writer
|
||||
CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
|
||||
CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0");
|
||||
CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart");
|
||||
CP_XML_ATTR(L"office:version", L"1.2");
|
||||
CP_XML_ATTR(L"office:version", L"1.2");
|
||||
|
||||
CP_XML_NODE(L"office:meta")
|
||||
{
|
||||
CP_XML_NODE(L"meta:generator")
|
||||
{
|
||||
CP_XML_STREAM() << L"ONLYOFFICE Online Editor";
|
||||
CP_XML_STREAM() << L"ONLYOFFICE";
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
CP_XML_STREAM() << L"/" << std::wstring (s.begin(), s.end() );
|
||||
#endif
|
||||
}
|
||||
CP_XML_NODE(L"meta:initial-creator");
|
||||
CP_XML_NODE(L"meta:creation-date");
|
||||
|
||||
@ -2992,7 +2992,10 @@ void DocxConverter::convert_styles()
|
||||
{
|
||||
if (docx_styles->m_arrStyle[i] == NULL) continue;
|
||||
|
||||
current_font_size.erase(current_font_size.begin() + 1, current_font_size.end());
|
||||
if (!current_font_size.empty())
|
||||
{
|
||||
current_font_size.erase(current_font_size.begin() + 1, current_font_size.end());
|
||||
}
|
||||
|
||||
convert(docx_styles->m_arrStyle[i]);
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
#include "../../../ASCOfficePPTXFile/Editor/DefaultNotesTheme.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
|
||||
#include "../../../ASCOfficeXlsFile2/source/Common/simple_xml_writer.h"
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
|
||||
#include "../Reader/PPTDocumentInfo.h"
|
||||
@ -60,8 +61,6 @@ namespace NSPresentationEditor
|
||||
static std::wstring g_string_core = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\
|
||||
<dc:title>Slide 1</dc:title>\
|
||||
<dc:creator>OnlyOffice</dc:creator>\
|
||||
<cp:lastModifiedBy>OnlyOffice</cp:lastModifiedBy>\
|
||||
<cp:revision>1</cp:revision>\
|
||||
</cp:coreProperties>");
|
||||
}
|
||||
@ -278,60 +277,127 @@ void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
|
||||
|
||||
void NSPresentationEditor::CPPTXWriter::WriteApp(CFile& oFile)
|
||||
{
|
||||
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\
|
||||
<TotalTime>0</TotalTime>\
|
||||
<Words>0</Words>\
|
||||
<Application>OnlyOffice</Application>\
|
||||
<PresentationFormat>On-screen Show (4:3)</PresentationFormat>\
|
||||
<Paragraphs>0</Paragraphs>");
|
||||
std::wstringstream strm;
|
||||
|
||||
oFile.WriteStringUTF8(str1);
|
||||
|
||||
oFile.WriteStringUTF8(L"<Slides>" + std::to_wstring(m_pDocument->m_arSlides.size()) + L"</Slides>");
|
||||
oFile.WriteStringUTF8(L"<Notes>" + std::to_wstring(m_pDocument->m_arNotes.size()) + L"</Notes>");
|
||||
|
||||
oFile.WriteStringUTF8(L"<HiddenSlides>0</HiddenSlides>\
|
||||
<MMClips>2</MMClips>\
|
||||
<ScaleCrop>false</ScaleCrop>\
|
||||
<HeadingPairs>\
|
||||
<vt:vector size=\"4\" baseType=\"variant\">");
|
||||
|
||||
int nCountThemes = (int)m_pDocument->m_arThemes.size();
|
||||
int nCountSlides = (int)m_pDocument->m_arSlides.size();
|
||||
|
||||
std::wstring strThemes = L"<vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant><vt:variant><vt:i4>" +std::to_wstring(nCountThemes) +
|
||||
L"</vt:i4></vt:variant>";
|
||||
|
||||
std::wstring strSlides = L"<vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant><vt:variant><vt:i4>" +
|
||||
std::to_wstring(nCountSlides) + L"</vt:i4></vt:variant></vt:vector></HeadingPairs>";
|
||||
|
||||
std::wstring strTitles = L"<TitlesOfParts><vt:vector size=\"" + std::to_wstring(nCountSlides + nCountThemes) + L"\" baseType=\"lpstr\">";
|
||||
|
||||
oFile.WriteStringUTF8(strThemes + strSlides + strTitles);
|
||||
|
||||
std::wstring strMemory = _T("");
|
||||
for (int i = 1; i <= nCountThemes; ++i)
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
strMemory += L"<vt:lpstr>Theme " + std::to_wstring(i) + L"</vt:lpstr>";
|
||||
CP_XML_NODE(L"Properties")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties");
|
||||
CP_XML_ATTR(L"xmlns:vt", L"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypess");
|
||||
}
|
||||
CP_XML_NODE(L"Application")
|
||||
{
|
||||
CP_XML_STREAM() << 0;
|
||||
}
|
||||
#if defined(INTVER)
|
||||
CP_XML_NODE(L"AppVersion")
|
||||
{
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
CP_XML_STREAM() << std::wstring(s.begin(), s.end());
|
||||
}
|
||||
#endif
|
||||
CP_XML_NODE(L"TotalTime")
|
||||
{
|
||||
CP_XML_STREAM() << 0;
|
||||
}
|
||||
CP_XML_NODE(L"Words")
|
||||
{
|
||||
CP_XML_STREAM() << 0;
|
||||
}
|
||||
CP_XML_NODE(L"PresentationFormat")
|
||||
{
|
||||
CP_XML_STREAM() << L"On-screen Show (4:3)";
|
||||
}
|
||||
CP_XML_NODE(L"Paragraphs")
|
||||
{
|
||||
CP_XML_STREAM() << 0;
|
||||
}
|
||||
CP_XML_NODE(L"Slides")
|
||||
{
|
||||
CP_XML_STREAM() << m_pDocument->m_arSlides.size();
|
||||
}
|
||||
CP_XML_NODE(L"Notes")
|
||||
{
|
||||
CP_XML_STREAM() << m_pDocument->m_arNotes.size();
|
||||
}
|
||||
CP_XML_NODE(L"HiddenSlides")
|
||||
{
|
||||
CP_XML_STREAM() << 0;
|
||||
}
|
||||
CP_XML_NODE(L"MMClips")
|
||||
{
|
||||
CP_XML_STREAM() << 2;
|
||||
}
|
||||
CP_XML_NODE(L"ScaleCrop")
|
||||
{
|
||||
CP_XML_STREAM() << L"false";
|
||||
}
|
||||
CP_XML_NODE(L"HeadingPairs")
|
||||
{
|
||||
CP_XML_NODE(L"vt:vector")
|
||||
{
|
||||
CP_XML_ATTR(L"size", 4);
|
||||
CP_XML_ATTR(L"baseType", L"variant");
|
||||
|
||||
CP_XML_NODE(L"vt:variant")
|
||||
{
|
||||
CP_XML_ATTR(L"vt:lpstr", L"Theme");
|
||||
}
|
||||
CP_XML_NODE(L"vt:variant")
|
||||
{
|
||||
CP_XML_ATTR(L"vt:i4", m_pDocument->m_arThemes.size());
|
||||
}
|
||||
CP_XML_NODE(L"vt:variant")
|
||||
{
|
||||
CP_XML_ATTR(L"vt:lpstr", L"Slide Titles");
|
||||
}
|
||||
CP_XML_NODE(L"vt:variant")
|
||||
{
|
||||
CP_XML_ATTR(L"vt:i4", m_pDocument->m_arSlides.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"TitlesOfParts")
|
||||
{
|
||||
CP_XML_NODE(L"vt:vector")
|
||||
{
|
||||
CP_XML_ATTR(L"size", m_pDocument->m_arSlides.size() + m_pDocument->m_arThemes.size());
|
||||
CP_XML_ATTR(L"baseType", L"lpstr");
|
||||
|
||||
for (size_t i = 1; i <= m_pDocument->m_arThemes.size(); ++i)
|
||||
{
|
||||
CP_XML_NODE(L"vt:lpstr")
|
||||
{
|
||||
CP_XML_STREAM() << L"Theme " << i;
|
||||
}
|
||||
}
|
||||
for (size_t i = 1; i <= m_pDocument->m_arSlides.size(); ++i)
|
||||
{
|
||||
CP_XML_NODE(L"vt:lpstr")
|
||||
{
|
||||
CP_XML_STREAM() << L"Slide " << i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"Company");
|
||||
CP_XML_NODE(L"LinksUpToDate")
|
||||
{
|
||||
CP_XML_STREAM() << L"false";
|
||||
}
|
||||
CP_XML_NODE(L"SharedDoc")
|
||||
{
|
||||
CP_XML_STREAM() << L"false";
|
||||
}
|
||||
CP_XML_NODE(L"HyperlinksChanged")
|
||||
{
|
||||
CP_XML_STREAM() << L"false";
|
||||
}
|
||||
}
|
||||
for (int i = 1; i <= nCountSlides; ++i)
|
||||
{
|
||||
strMemory += L"<vt:lpstr>Slide " + std::to_wstring(i) + L"</vt:lpstr>";
|
||||
}
|
||||
|
||||
std::wstring str5 = _T("</vt:vector>\
|
||||
</TitlesOfParts>\
|
||||
<Company></Company>\
|
||||
<LinksUpToDate>false</LinksUpToDate>\
|
||||
<SharedDoc>false</SharedDoc>\
|
||||
<HyperlinksChanged>false</HyperlinksChanged>\
|
||||
<AppVersion>4.4000</AppVersion>\
|
||||
</Properties>");
|
||||
|
||||
strMemory += str5;
|
||||
|
||||
oFile.WriteStringUTF8(strMemory);
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
|
||||
oFile.WriteStringUTF8(strm.str());
|
||||
}
|
||||
|
||||
void NSPresentationEditor::CPPTXWriter::WritePresInfo()
|
||||
|
||||
@ -247,7 +247,7 @@ void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLe
|
||||
else if ((pCF->FontProperties.is_init()) && (!pCF->FontProperties->strFontName.empty()))
|
||||
{
|
||||
oWriter.WriteString(L"<a:latin typeface=\"" + pCF->FontProperties->strFontName + L"\"/>");
|
||||
}
|
||||
}
|
||||
if (pCF->FontPropertiesEA.is_init())
|
||||
{
|
||||
oWriter.WriteString(L"<a:ea typeface=\"" + pCF->FontPropertiesEA->strFontName + L"\"/>");
|
||||
@ -1172,13 +1172,11 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
{
|
||||
if (0 == pCF->Typeface.get())
|
||||
{
|
||||
std::wstring strProp = _T("<a:latin typeface=\"+mj-lt\"/>");
|
||||
m_oWriter.WriteString(strProp);
|
||||
m_oWriter.WriteString(L"<a:latin typeface=\"+mj-lt\"/>");
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring strProp = _T("<a:latin typeface=\"+mn-lt\"/>");
|
||||
m_oWriter.WriteString(strProp);
|
||||
m_oWriter.WriteString(L"<a:latin typeface=\"+mn-lt\"/>");
|
||||
}
|
||||
}
|
||||
else if (pCF->FontProperties.is_init())
|
||||
|
||||
@ -1002,11 +1002,12 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
CElementPtr pElement = oArrayShapes[nShape]->GetElement(&m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
|
||||
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
|
||||
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
|
||||
if (NULL != pElement)
|
||||
{
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor && !bMasterBackGround)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(pSlide, pTheme, pLayout);
|
||||
@ -1019,6 +1020,9 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
}else
|
||||
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElement );
|
||||
|
||||
if (NULL != pShape)
|
||||
pShape->SetupProperties(pSlide, pTheme, pLayout);
|
||||
|
||||
if (pElement->m_bHaveAnchor)
|
||||
{
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
|
||||
@ -803,11 +803,11 @@ HRESULT CElementProps::GetProperty(LONG lId, ASC_VARIANT* pProp)
|
||||
if (NULL == pProp)
|
||||
return S_FALSE;
|
||||
|
||||
std::map<LONG, ASC_VARIANT>::iterator pPair = m_Properties.find(lId);
|
||||
if (m_Properties.end() == pPair)
|
||||
std::map<LONG, ASC_VARIANT>::iterator pFind = m_Properties.find(lId);
|
||||
if (m_Properties.end() == pFind)
|
||||
return S_FALSE;
|
||||
|
||||
bool bIsSupportProp = CopyProperty(*pProp, pPair->second);
|
||||
bool bIsSupportProp = CopyProperty(*pProp, pFind->second);
|
||||
|
||||
if (!bIsSupportProp)
|
||||
{
|
||||
@ -965,7 +965,7 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
|
||||
|
||||
strXml += L">";
|
||||
|
||||
strXml += (std::wstring)bsXml;
|
||||
strXml += bsXml;
|
||||
|
||||
strXml += L"</main>";
|
||||
|
||||
@ -1540,9 +1540,10 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p
|
||||
pPicture->oleObject.reset(pOle);
|
||||
pOle = NULL;
|
||||
}
|
||||
if (pElem)
|
||||
m_pBinaryWriter->WriteRecord1(1, *pElem);
|
||||
}
|
||||
if (pElem)
|
||||
m_pBinaryWriter->WriteRecord1(1, *pElem);
|
||||
|
||||
RELEASEOBJECT(pElem)
|
||||
RELEASEOBJECT(pOle)
|
||||
}
|
||||
@ -1838,10 +1839,10 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
{
|
||||
strType = strType.substr(1);
|
||||
|
||||
std::map<std::wstring, CShapePtr>::iterator pPair = m_mapShapeTypes.find(strType);
|
||||
if (m_mapShapeTypes.end() != pPair)
|
||||
std::map<std::wstring, CShapePtr>::iterator pFind = m_mapShapeTypes.find(strType);
|
||||
if (m_mapShapeTypes.end() != pFind)
|
||||
{
|
||||
CBaseShapePtr base_shape_type = pPair->second->getBaseShape();
|
||||
CBaseShapePtr base_shape_type = pFind->second->getBaseShape();
|
||||
CPPTShape* ppt_shape_type = dynamic_cast<CPPTShape*>(base_shape_type.get());
|
||||
|
||||
pPPTShape = new CPPTShape();
|
||||
@ -2111,16 +2112,16 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
std::wstring strStyle = oNodeP.GetAttribute(L"style");
|
||||
PPTX::CCSS oCSSParser;
|
||||
oCSSParser.LoadFromString2(strStyle);
|
||||
std::map<std::wstring, std::wstring>::iterator pPair = oCSSParser.m_mapSettings.find(L"font-family");
|
||||
if (pPair != oCSSParser.m_mapSettings.end())
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"font-family");
|
||||
if (pFind != oCSSParser.m_mapSettings.end())
|
||||
{
|
||||
sFont = pPair->second;
|
||||
sFont = pFind->second;
|
||||
XmlUtils::replace_all(sFont, L"\"", L"");
|
||||
}
|
||||
pPair = oCSSParser.m_mapSettings.find(L"font-size");
|
||||
if (pPair != oCSSParser.m_mapSettings.end())
|
||||
pFind = oCSSParser.m_mapSettings.find(L"font-size");
|
||||
if (pFind != oCSSParser.m_mapSettings.end())
|
||||
{
|
||||
nFontSize = _wtoi(pPair->second.c_str()) * 2;
|
||||
nFontSize = _wtoi(pFind->second.c_str()) * 2;
|
||||
}
|
||||
|
||||
nullable_string sFitPath;
|
||||
@ -2572,21 +2573,21 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
|
||||
if (oCSSParser.m_mapSettings.size() > 0)
|
||||
{
|
||||
std::map<std::wstring, std::wstring>::iterator pPair = oCSSParser.m_mapSettings.find(L"layout-flow");
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"layout-flow");
|
||||
|
||||
if (pPair != oCSSParser.m_mapSettings.end())
|
||||
if (pFind != oCSSParser.m_mapSettings.end())
|
||||
{
|
||||
if (pPair->second == L"vertical")
|
||||
if (pFind->second == L"vertical")
|
||||
{
|
||||
pShape->oTextBoxBodyPr->vert = new PPTX::Limit::TextVerticalType();
|
||||
pShape->oTextBoxBodyPr->vert->set(L"vert");
|
||||
}
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"mso-layout-flow-alt");
|
||||
if (pPair != oCSSParser.m_mapSettings.end())
|
||||
pFind = oCSSParser.m_mapSettings.find(L"mso-layout-flow-alt");
|
||||
if (pFind != oCSSParser.m_mapSettings.end())
|
||||
{
|
||||
if (pPair->second == L"bottom-to-top")
|
||||
if (pFind->second == L"bottom-to-top")
|
||||
{
|
||||
if (pShape->oTextBoxBodyPr->vert.IsInit() == false)
|
||||
pShape->oTextBoxBodyPr->vert = new PPTX::Limit::TextVerticalType();
|
||||
@ -2604,12 +2605,12 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
pShape->txBody->bodyPr->vert = pShape->oTextBoxBodyPr->vert;
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"mso-rotate");
|
||||
if (pPair != oCSSParser.m_mapSettings.end())
|
||||
pFind = oCSSParser.m_mapSettings.find(L"mso-rotate");
|
||||
if (pFind != oCSSParser.m_mapSettings.end())
|
||||
{
|
||||
try
|
||||
{
|
||||
pShape->oTextBoxBodyPr->rot = _wtoi(pPair->second.c_str()) * 60000; //для docx, xlsx
|
||||
pShape->oTextBoxBodyPr->rot = _wtoi(pFind->second.c_str()) * 60000; //для docx, xlsx
|
||||
if (pShape->txBody.IsInit() == false) //для pptx
|
||||
pShape->txBody = new PPTX::Logic::TxBody();
|
||||
|
||||
@ -2685,25 +2686,25 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
if (pShape && oCSSParser.m_mapSettings.size() > 0)
|
||||
{
|
||||
std::map<std::wstring, std::wstring>::iterator pPair = oCSSParser.m_mapSettings.find(L"v-text-anchor");
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"v-text-anchor");
|
||||
|
||||
if (pPair != oCSSParser.m_mapSettings.end())
|
||||
if (pFind != oCSSParser.m_mapSettings.end())
|
||||
{
|
||||
if (pPair->second == L"middle") pShape->oTextBoxBodyPr->anchor = L"ctr";
|
||||
if (pPair->second == L"bottom") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pPair->second == L"top-center") pShape->oTextBoxBodyPr->anchor = L"t";
|
||||
if (pPair->second == L"middle-center") pShape->oTextBoxBodyPr->anchor = L"ctr";
|
||||
if (pPair->second == L"bottom-center") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pPair->second == L"top-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
|
||||
if (pPair->second == L"bottom-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pPair->second == L"top-center-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
|
||||
if (pPair->second == L"bottom-center-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pFind->second == L"middle") pShape->oTextBoxBodyPr->anchor = L"ctr";
|
||||
if (pFind->second == L"bottom") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pFind->second == L"top-center") pShape->oTextBoxBodyPr->anchor = L"t";
|
||||
if (pFind->second == L"middle-center") pShape->oTextBoxBodyPr->anchor = L"ctr";
|
||||
if (pFind->second == L"bottom-center") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pFind->second == L"top-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
|
||||
if (pFind->second == L"bottom-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
if (pFind->second == L"top-center-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
|
||||
if (pFind->second == L"bottom-center-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"mso-wrap-style");
|
||||
if (pPair != oCSSParser.m_mapSettings.end() )
|
||||
pFind = oCSSParser.m_mapSettings.find(L"mso-wrap-style");
|
||||
if (pFind != oCSSParser.m_mapSettings.end() )
|
||||
{
|
||||
if (pPair->second == L"none")
|
||||
if (pFind->second == L"none")
|
||||
pShape->oTextBoxBodyPr->wrap = L"none";
|
||||
else
|
||||
pShape->oTextBoxBodyPr->wrap = L"wrap";
|
||||
@ -2730,26 +2731,24 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
pSpPr->xfrm->extY = oProps.Height;
|
||||
}
|
||||
|
||||
std::map<std::wstring, std::wstring>::iterator pPair;
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
if (pPair->second == L"x")
|
||||
if (pFind->second == L"x")
|
||||
pSpPr->xfrm->flipH = true;
|
||||
else if (pPair->second == L"y")
|
||||
else if (pFind->second == L"y")
|
||||
pSpPr->xfrm->flipV = true;
|
||||
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
|
||||
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
|
||||
{
|
||||
pSpPr->xfrm->flipH = true;
|
||||
pSpPr->xfrm->flipV = true;
|
||||
}
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
pFind = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
|
||||
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2766,26 +2765,24 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
pSpPr->xfrm->extX = oProps.Width;
|
||||
pSpPr->xfrm->extY = oProps.Height;
|
||||
|
||||
std::map<std::wstring, std::wstring>::iterator pPair;
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
if (pPair->second == L"x")
|
||||
if (pFind->second == L"x")
|
||||
pSpPr->xfrm->flipH = true;
|
||||
else if (pPair->second == L"y")
|
||||
else if (pFind->second == L"y")
|
||||
pSpPr->xfrm->flipV = true;
|
||||
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
|
||||
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
|
||||
{
|
||||
pSpPr->xfrm->flipH = true;
|
||||
pSpPr->xfrm->flipV = true;
|
||||
}
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
pFind = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
|
||||
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2946,26 +2943,24 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
|
||||
pTree->grpSpPr.xfrm->chExtY = lCoordSizeH;
|
||||
}
|
||||
|
||||
std::map<std::wstring, std::wstring>::iterator pPair;
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
if (pPair->second == L"x")
|
||||
if (pFind->second == L"x")
|
||||
pTree->grpSpPr.xfrm->flipH = true;
|
||||
else if (pPair->second == L"y")
|
||||
else if (pFind->second == L"y")
|
||||
pTree->grpSpPr.xfrm->flipV = true;
|
||||
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
|
||||
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
|
||||
{
|
||||
pTree->grpSpPr.xfrm->flipH = true;
|
||||
pTree->grpSpPr.xfrm->flipV = true;
|
||||
}
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
pFind = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
|
||||
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2988,26 +2983,24 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
|
||||
pTree->grpSpPr.xfrm->chExtY = lCoordSizeH;
|
||||
}
|
||||
|
||||
std::map<std::wstring, std::wstring>::iterator pPair;
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
if (pPair->second == L"x")
|
||||
if (pFind->second == L"x")
|
||||
pTree->grpSpPr.xfrm->flipH = true;
|
||||
else if (pPair->second == L"y")
|
||||
else if (pFind->second == L"y")
|
||||
pTree->grpSpPr.xfrm->flipV = true;
|
||||
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
|
||||
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
|
||||
{
|
||||
pTree->grpSpPr.xfrm->flipH = true;
|
||||
pTree->grpSpPr.xfrm->flipV = true;
|
||||
}
|
||||
}
|
||||
|
||||
pPair = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pPair)
|
||||
pFind = oCSSParser.m_mapSettings.find(L"rotation");
|
||||
if (oCSSParser.m_mapSettings.end() != pFind)
|
||||
{
|
||||
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
|
||||
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3110,7 +3103,7 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShapePtr pShap
|
||||
|
||||
std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps)
|
||||
{
|
||||
std::map<std::wstring, std::wstring>::iterator pPair;
|
||||
std::map<std::wstring, std::wstring>::iterator pFind;
|
||||
|
||||
bool bIsInline = false;
|
||||
|
||||
@ -3124,8 +3117,8 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
if (!bIsInline)
|
||||
{
|
||||
pPair = oCssStyles.m_mapSettings.find(L"position");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair && pPair->second == L"static")
|
||||
pFind = oCssStyles.m_mapSettings.find(L"position");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind && pFind->second == L"static")
|
||||
{
|
||||
bIsInline = true;
|
||||
}
|
||||
@ -3140,55 +3133,55 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
LONG width = 0;
|
||||
LONG height = 0;
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"polyline_correct");
|
||||
bool bIsPolyCorrect = (oCssStyles.m_mapSettings.end() != pPair) ? true : false;
|
||||
pFind = oCssStyles.m_mapSettings.find(L"polyline_correct");
|
||||
bool bIsPolyCorrect = (oCssStyles.m_mapSettings.end() != pFind) ? true : false;
|
||||
if (bIsPolyCorrect)
|
||||
dKoefSize = 1;
|
||||
|
||||
if (!bIsInline)
|
||||
{
|
||||
pPair = oCssStyles.m_mapSettings.find(L"margin-left");
|
||||
if (oCssStyles.m_mapSettings.end() == pPair)
|
||||
pPair = oCssStyles.m_mapSettings.find(L"left");
|
||||
pFind = oCssStyles.m_mapSettings.find(L"margin-left");
|
||||
if (oCssStyles.m_mapSettings.end() == pFind)
|
||||
pFind = oCssStyles.m_mapSettings.find(L"left");
|
||||
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
left = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
|
||||
left = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
|
||||
}
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"margin-top");
|
||||
pFind = oCssStyles.m_mapSettings.find(L"margin-top");
|
||||
|
||||
if (oCssStyles.m_mapSettings.end() == pPair)
|
||||
pPair = oCssStyles.m_mapSettings.find(L"top");
|
||||
if (oCssStyles.m_mapSettings.end() == pFind)
|
||||
pFind = oCssStyles.m_mapSettings.find(L"top");
|
||||
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
top = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
|
||||
top = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"width");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
pFind = oCssStyles.m_mapSettings.find(L"width");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
width = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
|
||||
width = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPair = oCssStyles.m_mapSettings.find(L"margin-right");
|
||||
pFind = oCssStyles.m_mapSettings.find(L"margin-right");
|
||||
if (oCssStyles.m_mapSettings.end() != oCssStyles.m_mapSettings.end())
|
||||
width = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5) - left;
|
||||
width = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5) - left;
|
||||
}
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"height");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
pFind = oCssStyles.m_mapSettings.find(L"height");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
height = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
|
||||
height = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPair = oCssStyles.m_mapSettings.find(L"margin-bottom");
|
||||
pFind = oCssStyles.m_mapSettings.find(L"margin-bottom");
|
||||
if (oCssStyles.m_mapSettings.end() != oCssStyles.m_mapSettings.end())
|
||||
height = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5) - top;
|
||||
height = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5) - top;
|
||||
}
|
||||
|
||||
unsigned long margL = (unsigned long)(9 * dKoef + 0.5);
|
||||
@ -3196,21 +3189,47 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
unsigned long margR = (unsigned long)(9 * dKoef + 0.5);
|
||||
unsigned long margB = 0;
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-left");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
margL = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-left");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
margL = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-top");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
margT = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-top");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
margT = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-right");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
margR = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-right");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
margR = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-bottom");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
margB = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-bottom");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
margB = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
|
||||
|
||||
nullable_double rel_width;
|
||||
nullable_double rel_height;
|
||||
nullable_double rel_top;
|
||||
nullable_double rel_left;
|
||||
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-width-percent");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
rel_width = parserPoint.FromString(pFind->second) / 1000.;
|
||||
}
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-height-percent");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
rel_height = parserPoint.FromString(pFind->second) / 1000.;
|
||||
}
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-top-percent");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
rel_top = parserPoint.FromString(pFind->second) / 1000.;
|
||||
}
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-left-percent");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
rel_left = parserPoint.FromString(pFind->second) / 1000.;
|
||||
}
|
||||
|
||||
oProps.X = left;
|
||||
oProps.Y = top;
|
||||
@ -3229,7 +3248,7 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
oWriter.StartNode(L"wp:inline");
|
||||
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"xmlns:wp", (std::wstring)L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
oWriter.WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
oWriter.WriteAttribute(L"distT", margT);
|
||||
oWriter.WriteAttribute(L"distB", margB);
|
||||
oWriter.WriteAttribute(L"distL", margL);
|
||||
@ -3238,8 +3257,8 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
oWriter.StartNode(L"wp:extent");
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"cx", width);
|
||||
oWriter.WriteAttribute(L"cy", height);
|
||||
oWriter.WriteAttribute(L"cx", width );
|
||||
oWriter.WriteAttribute(L"cy", height );
|
||||
oWriter.EndAttributes();
|
||||
oWriter.EndNode(L"wp:extent");
|
||||
|
||||
@ -3252,6 +3271,35 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
oWriter.EndAttributes();
|
||||
oWriter.EndNode(L"wp:effectExtent");
|
||||
|
||||
if (rel_width.is_init())
|
||||
{
|
||||
oWriter.StartNode(L"wp14:sizeRelH");
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"relativeFrom", L"page");
|
||||
oWriter.EndAttributes();
|
||||
oWriter.StartNode(L"wp14:pctWidth");
|
||||
oWriter.EndAttributes();
|
||||
|
||||
oWriter.WriteString(std::to_wstring((INT)(*rel_width * 100000)));
|
||||
|
||||
oWriter.EndNode(L"wp14:pctWidth");
|
||||
oWriter.EndNode(L"wp14:sizeRelH");
|
||||
}
|
||||
if (rel_height.is_init())
|
||||
{
|
||||
oWriter.StartNode(L"wp14:sizeRelV");
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"relativeFrom", L"page");
|
||||
oWriter.EndAttributes();
|
||||
oWriter.StartNode(L"wp14:pctHeight");
|
||||
oWriter.EndAttributes();
|
||||
|
||||
oWriter.WriteString(std::to_wstring((INT)(*rel_height * 100000)));
|
||||
|
||||
oWriter.EndNode(L"wp14:pctHeight");
|
||||
oWriter.EndNode(L"wp14:sizeRelV");
|
||||
}
|
||||
|
||||
std::wstring strId = L"<wp:docPr id=\"" + std::to_wstring(m_lNextId) + L"\" name=\"\"/>";
|
||||
m_lNextId++;
|
||||
|
||||
@ -3267,27 +3315,25 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
oWriter.StartAttributes();
|
||||
|
||||
oWriter.WriteAttribute(L"xmlns:wp", (std::wstring)L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
oWriter.WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
oWriter.WriteAttribute(L"distT", margT);
|
||||
oWriter.WriteAttribute(L"distB", margB);
|
||||
oWriter.WriteAttribute(L"distL", margL);
|
||||
oWriter.WriteAttribute(L"distR", margR);
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"z-index");
|
||||
nullable_int zIndex;
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
pFind = oCssStyles.m_mapSettings.find(L"z-index");
|
||||
nullable_int64 zIndex;
|
||||
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
zIndex = (int)parserPoint.FromString(pPair->second);
|
||||
|
||||
if (*zIndex >= 0)
|
||||
{
|
||||
oWriter.WriteAttribute(L"relativeHeight", *zIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// DWORD dwIndex = (DWORD)(*zIndex);
|
||||
oWriter.WriteAttribute(L"relativeHeight", -(*zIndex));
|
||||
}
|
||||
zIndex = parserPoint.FromString(pFind->second);
|
||||
|
||||
_INT64 zIndex_ = *zIndex >= 0 ? *zIndex : -*zIndex;
|
||||
|
||||
if (zIndex_ < 0xF000000 && zIndex_ > 0x80000 )
|
||||
zIndex_ = 0xF000000 - 0x80000 + zIndex_;
|
||||
|
||||
oWriter.WriteAttribute(L"relativeHeight", std::to_wstring(zIndex_));
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeWrap = oNode.ReadNode(L"w10:wrap");
|
||||
@ -3311,6 +3357,7 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
nullable_bool isAllowInCell;
|
||||
nullable_string sAllowInCell;
|
||||
|
||||
oNode.ReadAttributeBase(L"o:allowincell", sAllowInCell);
|
||||
if (sAllowInCell.is_init())
|
||||
{
|
||||
@ -3319,7 +3366,17 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
if ((L"t" == *sAllowInCell) || (L"true"== *sAllowInCell))
|
||||
isAllowInCell = true;
|
||||
}
|
||||
|
||||
nullable_bool isAllowOverlap;
|
||||
nullable_string sAllowOverlap;
|
||||
|
||||
oNode.ReadAttributeBase(L"o:allowoverlap", sAllowOverlap);
|
||||
if (sAllowOverlap.is_init())
|
||||
{
|
||||
if ((L"f" == *sAllowOverlap) || (L"false"== *sAllowOverlap))
|
||||
isAllowOverlap = false;
|
||||
if ((L"t" == *sAllowOverlap) || (L"true"== *sAllowOverlap))
|
||||
isAllowOverlap = true;
|
||||
}
|
||||
std::wstring strWrapPoints = oNode.GetAttribute(L"wrapcoords");
|
||||
std::wstring strWrapPointsResult;
|
||||
if (!strWrapPoints.empty())
|
||||
@ -3352,20 +3409,26 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
{
|
||||
if (*zIndex > 0)
|
||||
{
|
||||
oWriter.WriteAttribute(L"allowOverlap", (std::wstring)L"1");
|
||||
oWriter.WriteAttribute(L"behindDoc", L"0");
|
||||
}
|
||||
else if (*zIndex < 0)
|
||||
{
|
||||
oWriter.WriteAttribute(L"behindDoc", (std::wstring)L"1");
|
||||
oWriter.WriteAttribute(L"behindDoc", L"1");
|
||||
}
|
||||
}
|
||||
|
||||
if (isAllowOverlap.is_init())
|
||||
{
|
||||
if (*isAllowOverlap)
|
||||
oWriter.WriteAttribute(L"allowOverlap", L"1");
|
||||
else
|
||||
oWriter.WriteAttribute(L"allowOverlap", L"0");
|
||||
}
|
||||
if (isAllowInCell.is_init())
|
||||
{
|
||||
if (*isAllowInCell)
|
||||
oWriter.WriteAttribute(L"layoutInCell", (std::wstring)L"1");
|
||||
oWriter.WriteAttribute(L"layoutInCell", L"1");
|
||||
else
|
||||
oWriter.WriteAttribute(L"layoutInCell", (std::wstring)L"0");
|
||||
oWriter.WriteAttribute(L"layoutInCell", L"0");
|
||||
}
|
||||
|
||||
oWriter.EndAttributes();
|
||||
@ -3374,43 +3437,50 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
oWriter.StartAttributes();
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-position-horizontal-relative");
|
||||
if (pPair != oCssStyles.m_mapSettings.end())
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-position-horizontal-relative");
|
||||
|
||||
nullable_string sHRelativeFrom;
|
||||
nullable_string sVRelativeFrom;
|
||||
|
||||
if (pFind != oCssStyles.m_mapSettings.end())
|
||||
{
|
||||
if (L"char" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"character");
|
||||
else if (L"page" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"page");
|
||||
else if (L"margin" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"margin");
|
||||
else if (L"left-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"leftMargin");
|
||||
else if (L"right-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"rightMargin");
|
||||
else if (L"inner-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"insideMargin");
|
||||
else if (L"outer-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"outsideMargin");
|
||||
if (L"char" == pFind->second) sHRelativeFrom = L"character";
|
||||
else if (L"page" == pFind->second) sHRelativeFrom = L"page";
|
||||
else if (L"margin" == pFind->second) sHRelativeFrom = L"margin";
|
||||
else if (L"left-margin-area" == pFind->second) sHRelativeFrom = L"leftMargin";
|
||||
else if (L"right-margin-area" == pFind->second) sHRelativeFrom = L"rightMargin";
|
||||
else if (L"inner-margin-area" == pFind->second) sHRelativeFrom = L"insideMargin";
|
||||
else if (L"outer-margin-area" == pFind->second) sHRelativeFrom = L"outsideMargin";
|
||||
else
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"column");
|
||||
sHRelativeFrom = L"column";
|
||||
}
|
||||
else
|
||||
{
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"column");
|
||||
sHRelativeFrom = L"column";
|
||||
}
|
||||
oWriter.WriteAttribute(L"relativeFrom", *sHRelativeFrom);
|
||||
|
||||
oWriter.EndAttributes();
|
||||
|
||||
std::wstring strPosH = L"absolute";
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-position-horizontal");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
strPosH = pPair->second;
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-position-horizontal");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
strPosH = pFind->second;
|
||||
|
||||
if (strPosH == L"absolute")
|
||||
{
|
||||
oWriter.WriteString(L"<wp:posOffset>");
|
||||
oWriter.WriteLONG(left);
|
||||
oWriter.WriteString(L"</wp:posOffset>");
|
||||
if (rel_left.is_init())
|
||||
{
|
||||
oWriter.WriteString(L"<wp14:pctPosHOffset>");
|
||||
oWriter.WriteLONG((INT)(*rel_left * 100000));
|
||||
oWriter.WriteString(L"</wp14:pctPosHOffset>");
|
||||
}
|
||||
else
|
||||
{
|
||||
oWriter.WriteString(L"<wp:posOffset>");
|
||||
oWriter.WriteLONG(left);
|
||||
oWriter.WriteString(L"</wp:posOffset>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3425,43 +3495,46 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
oWriter.StartAttributes();
|
||||
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-position-vertical-relative");
|
||||
if (pPair != oCssStyles.m_mapSettings.end())
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-position-vertical-relative");
|
||||
if (pFind != oCssStyles.m_mapSettings.end())
|
||||
{
|
||||
if (L"margin" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"margin");
|
||||
else if (L"text" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"paragraph");
|
||||
else if (L"page" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"page");
|
||||
else if (L"top-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"topMargin");
|
||||
else if (L"bottom-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"bottomMargin");
|
||||
else if (L"inner-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"insideMargin");
|
||||
else if (L"outer-margin-area" == pPair->second)
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"outsideMargin");
|
||||
if (L"margin" == pFind->second) sVRelativeFrom = L"margin";
|
||||
else if (L"text" == pFind->second) sVRelativeFrom = L"paragraph";
|
||||
else if (L"page" == pFind->second) sVRelativeFrom = L"page";
|
||||
else if (L"top-margin-area" == pFind->second) sVRelativeFrom = L"topMargin";
|
||||
else if (L"bottom-margin-area" == pFind->second) sVRelativeFrom = L"bottomMargin";
|
||||
else if (L"inner-margin-area" == pFind->second) sVRelativeFrom = L"insideMargin";
|
||||
else if (L"outer-margin-area" == pFind->second) sVRelativeFrom = L"outsideMargin";
|
||||
else
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"line");
|
||||
sVRelativeFrom = L"line";
|
||||
}
|
||||
else
|
||||
{
|
||||
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"paragraph");
|
||||
sVRelativeFrom = L"paragraph";
|
||||
}
|
||||
oWriter.WriteAttribute(L"relativeFrom", *sVRelativeFrom);
|
||||
|
||||
oWriter.EndAttributes();
|
||||
|
||||
std::wstring strPosV = L"absolute";
|
||||
pPair = oCssStyles.m_mapSettings.find(L"mso-position-vertical");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
strPosV = pPair->second;
|
||||
pFind = oCssStyles.m_mapSettings.find(L"mso-position-vertical");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
strPosV = pFind->second;
|
||||
|
||||
if (strPosV == L"absolute")
|
||||
{
|
||||
oWriter.WriteString(L"<wp:posOffset>");
|
||||
oWriter.WriteLONG(top);
|
||||
oWriter.WriteString(L"</wp:posOffset>");
|
||||
if (rel_top.is_init())
|
||||
{
|
||||
oWriter.WriteString(L"<wp14:pctPosVOffset>");
|
||||
oWriter.WriteLONG((INT)(*rel_top * 100000));
|
||||
oWriter.WriteString(L"</wp14:pctPosVOffset>");
|
||||
}
|
||||
else
|
||||
{
|
||||
oWriter.WriteString(L"<wp:posOffset>");
|
||||
oWriter.WriteLONG(top);
|
||||
oWriter.WriteString(L"</wp:posOffset>");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3474,7 +3547,7 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
|
||||
oWriter.StartNode(L"wp:extent");
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"cx", width);
|
||||
oWriter.WriteAttribute(L"cx", width );
|
||||
oWriter.WriteAttribute(L"cy", height);
|
||||
oWriter.EndAttributes();
|
||||
oWriter.EndNode(L"wp:extent");
|
||||
@ -3521,12 +3594,40 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
|
||||
oWriter.WriteString(L"<wp:wrapNone/>");
|
||||
}
|
||||
bool bHidden = false;
|
||||
pPair = oCssStyles.m_mapSettings.find(L"visibility");
|
||||
if (oCssStyles.m_mapSettings.end() != pPair)
|
||||
pFind = oCssStyles.m_mapSettings.find(L"visibility");
|
||||
if (oCssStyles.m_mapSettings.end() != pFind)
|
||||
{
|
||||
if (L"hidden" == pPair->second)
|
||||
if (L"hidden" == pFind->second)
|
||||
bHidden = true;
|
||||
}
|
||||
if (rel_width.is_init())
|
||||
{
|
||||
oWriter.StartNode(L"wp14:sizeRelH");
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"relativeFrom", *sHRelativeFrom);
|
||||
oWriter.EndAttributes();
|
||||
oWriter.StartNode(L"wp14:pctWidth");
|
||||
oWriter.EndAttributes();
|
||||
|
||||
oWriter.WriteString(std::to_wstring((INT)(*rel_width * 100000)));
|
||||
|
||||
oWriter.EndNode(L"wp14:pctWidth");
|
||||
oWriter.EndNode(L"wp14:sizeRelH");
|
||||
}
|
||||
if (rel_height.is_init())
|
||||
{
|
||||
oWriter.StartNode(L"wp14:sizeRelV");
|
||||
oWriter.StartAttributes();
|
||||
oWriter.WriteAttribute(L"relativeFrom", *sVRelativeFrom);
|
||||
oWriter.EndAttributes();
|
||||
oWriter.StartNode(L"wp14:pctHeight");
|
||||
oWriter.EndAttributes();
|
||||
|
||||
oWriter.WriteString(std::to_wstring((INT)(*rel_height * 100000)));
|
||||
|
||||
oWriter.EndNode(L"wp14:pctHeight");
|
||||
oWriter.EndNode(L"wp14:sizeRelV");
|
||||
}
|
||||
|
||||
std::wstring strId = L"<wp:docPr id=\"" + std::to_wstring(m_lNextId) + L"\" name=\"\"" + (bHidden ? L" hidden=\"true\"" : L"") + L"/>";
|
||||
m_lNextId++;
|
||||
@ -3894,6 +3995,10 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem* oElem, XmlUtils
|
||||
{
|
||||
pBlipFill->tile = new PPTX::Logic::Tile();
|
||||
}
|
||||
else
|
||||
{
|
||||
pBlipFill->stretch = new PPTX::Logic::Stretch();
|
||||
}
|
||||
|
||||
pSpPr->Fill.m_type = PPTX::Logic::UniFill::blipFill;
|
||||
pSpPr->Fill.Fill = pBlipFill;
|
||||
@ -4390,7 +4495,7 @@ HRESULT CDrawingConverter::LoadClrMap(const std::wstring& bsXml)
|
||||
{
|
||||
smart_ptr<PPTX::Logic::ClrMap> pClrMap = new PPTX::Logic::ClrMap();
|
||||
|
||||
std::wstring strXml = L"<main xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">" + (std::wstring)bsXml + L"</main>";
|
||||
std::wstring strXml = L"<main xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">" + bsXml + L"</main>";
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNode.FromXmlString(strXml);
|
||||
|
||||
@ -4845,6 +4950,10 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
|
||||
nullable_int margL; oNode.ReadAttributeBase(L"distL", margL);
|
||||
nullable_int margR; oNode.ReadAttributeBase(L"distR", margR);
|
||||
|
||||
nullable_bool behindDoc; oNode.ReadAttributeBase(L"behindDoc", behindDoc);
|
||||
nullable_bool allowOverlap; oNode.ReadAttributeBase(L"allowOverlap", allowOverlap);
|
||||
nullable_bool layoutInCell; oNode.ReadAttributeBase(L"layoutInCell", layoutInCell);
|
||||
|
||||
if (margL.is_init())
|
||||
oWriter.WriteAttributeCSS_double1_pt(L"mso-wrap-distance-left", dKoef * (*margL));
|
||||
if (margT.is_init())
|
||||
@ -4854,9 +4963,27 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
|
||||
if (margB.is_init())
|
||||
oWriter.WriteAttributeCSS_double1_pt(L"mso-wrap-distance-bottom", dKoef * (*margB));
|
||||
|
||||
nullable_int zIndex; oNode.ReadAttributeBase(L"relativeHeight", zIndex);
|
||||
nullable_int64 zIndex; oNode.ReadAttributeBase(L"relativeHeight", zIndex);
|
||||
if (zIndex.is_init())
|
||||
oWriter.WriteAttributeCSS_int(L"z-index", *zIndex);
|
||||
{
|
||||
_INT64 z_index = *zIndex;
|
||||
|
||||
if ((behindDoc.IsInit()) && (*behindDoc == true))
|
||||
{
|
||||
z_index = -z_index;
|
||||
}
|
||||
oWriter.WriteAttributeCSS(L"z-index", std::to_wstring(z_index));
|
||||
}
|
||||
|
||||
if (allowOverlap.is_init())
|
||||
{
|
||||
oWriter.WriteAttributeCSS(L"o:allowoverlap", *allowOverlap ? L"true" : L"false");
|
||||
}
|
||||
|
||||
if (layoutInCell.is_init())
|
||||
{
|
||||
oWriter.WriteAttributeCSS(L"o:allowincell", *layoutInCell ? L"true" : L"false");
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeHorP;
|
||||
if (oNode.GetNode(L"wp:positionH", oNodeHorP))
|
||||
@ -5077,7 +5204,7 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
|
||||
|
||||
HRESULT CDrawingConverter::SetFontDir(const std::wstring& bsFontDir)
|
||||
{
|
||||
m_strFontDirectory = (std::wstring)bsFontDir;
|
||||
m_strFontDirectory = bsFontDir;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -5273,7 +5400,7 @@ HRESULT CDrawingConverter::SetDstContentRels()
|
||||
HRESULT CDrawingConverter::SaveDstContentRels(const std::wstring& bsRelsPath)
|
||||
{
|
||||
m_pReader->m_pRels->CloseRels();
|
||||
m_pReader->m_pRels->SaveRels((std::wstring)bsRelsPath);
|
||||
m_pReader->m_pRels->SaveRels(bsRelsPath);
|
||||
|
||||
--m_pReader->m_nCurrentRelsStack;
|
||||
if (-1 > m_pReader->m_nCurrentRelsStack)
|
||||
@ -5318,7 +5445,7 @@ HRESULT CDrawingConverter::SetFontPicker(COfficeFontPicker* pFontPicker)
|
||||
|
||||
HRESULT CDrawingConverter::SetAdditionalParam(const std::wstring& ParamName, BYTE *pArray, size_t szCount)
|
||||
{
|
||||
std::wstring name = (std::wstring)ParamName;
|
||||
std::wstring name = ParamName;
|
||||
if (name == L"xfrm_override" && pArray)
|
||||
{
|
||||
PPTX::Logic::Xfrm *pXfrm = (PPTX::Logic::Xfrm*)pArray;
|
||||
@ -5330,7 +5457,7 @@ HRESULT CDrawingConverter::SetAdditionalParam(const std::wstring& ParamName, BYT
|
||||
}
|
||||
HRESULT CDrawingConverter::GetAdditionalParam(const std::wstring& ParamName, BYTE **pArray, size_t& szCount)
|
||||
{
|
||||
//std::wstring name = (std::wstring)ParamName;
|
||||
//std::wstring name = ParamName;
|
||||
//if (name == L"SerializeImageManager")
|
||||
//{
|
||||
// NSBinPptxRW::CBinaryFileWriter oWriter;
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
#include "DefaultNotesMaster.h"
|
||||
#include "DefaultNotesTheme.h"
|
||||
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CPPTXWriter
|
||||
@ -1012,8 +1011,13 @@ namespace NSBinPptxRW
|
||||
{
|
||||
m_oApp.TotalTime = 0;
|
||||
m_oApp.Words = 0;
|
||||
m_oApp.Application = _T("OnlyOffice");
|
||||
m_oApp.PresentationFormat = _T("On-screen Show (4:3)");
|
||||
std::wstring sApplication = L"ONLYOFFICE";
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
sApplication += L"/" + std::wstring(s.begin(), s.end());
|
||||
#endif
|
||||
m_oApp.Application = sApplication;
|
||||
m_oApp.PresentationFormat = L"On-screen Show (4:3)";
|
||||
m_oApp.Paragraphs = 0;
|
||||
m_oApp.Slides = (int)m_arSlides.size();
|
||||
m_oApp.Notes = (int)m_arSlides.size();
|
||||
@ -1054,7 +1058,6 @@ namespace NSBinPptxRW
|
||||
m_oApp.LinksUpToDate = false;
|
||||
m_oApp.SharedDoc = false;
|
||||
m_oApp.HyperlinksChanged = false;
|
||||
m_oApp.AppVersion = _T("3.0000");
|
||||
}
|
||||
void CreateDefaultCore()
|
||||
{
|
||||
|
||||
@ -356,7 +356,15 @@ namespace NSBinPptxRW
|
||||
m_oWriter.WriteString(val);
|
||||
m_oWriter.AddCharNoCheck(WCHAR(';'));
|
||||
}
|
||||
AVSINLINE void WriteAttributeCSS_int(const std::wstring& strAttributeName, const int& val)
|
||||
AVSINLINE void WriteAttributeCSS(const std::wstring& strAttributeName, const wchar_t* val)
|
||||
{
|
||||
m_oWriter.WriteString(strAttributeName);
|
||||
m_oWriter.AddSize(15);
|
||||
m_oWriter.AddCharNoCheck(WCHAR(':'));
|
||||
m_oWriter.WriteString(val);
|
||||
m_oWriter.AddCharNoCheck(WCHAR(';'));
|
||||
}
|
||||
AVSINLINE void WriteAttributeCSS_int(const std::wstring& strAttributeName, const int& val)
|
||||
{
|
||||
m_oWriter.WriteString(strAttributeName);
|
||||
m_oWriter.AddSize(15);
|
||||
@ -404,7 +412,16 @@ namespace NSBinPptxRW
|
||||
m_oWriter.WriteString(val);
|
||||
m_oWriter.WriteString(g_bstr_node_quote);
|
||||
}
|
||||
AVSINLINE void WriteAttribute2(const std::wstring& strAttributeName, const std::wstring& val)
|
||||
AVSINLINE void WriteAttribute(const std::wstring& strAttributeName, const wchar_t* val)
|
||||
{
|
||||
m_oWriter.WriteString(g_bstr_node_space);
|
||||
m_oWriter.WriteString(strAttributeName);
|
||||
m_oWriter.WriteString(g_bstr_node_equal);
|
||||
m_oWriter.WriteString(g_bstr_node_quote);
|
||||
m_oWriter.WriteString(val);
|
||||
m_oWriter.WriteString(g_bstr_node_quote);
|
||||
}
|
||||
AVSINLINE void WriteAttribute2(const std::wstring& strAttributeName, const std::wstring& val)
|
||||
{
|
||||
m_oWriter.WriteString(g_bstr_node_space);
|
||||
m_oWriter.WriteString(strAttributeName);
|
||||
|
||||
@ -178,9 +178,11 @@ namespace PPTX
|
||||
void FileContainer::write(OOX::CRels& rels, const OOX::CPath& curdir, const OOX::CPath& directory, OOX::CContentTypes& content) const
|
||||
{
|
||||
std::map<std::wstring, size_t> mNamePair;
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
|
||||
|
||||
for (boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mapContainer.begin(); pPair != m_mapContainer.end(); ++pPair)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = pPair->second;
|
||||
smart_ptr<OOX::File> pFile = pPair->second;
|
||||
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<OOX::Media> pMedia = pFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
@ -217,6 +219,7 @@ namespace PPTX
|
||||
|
||||
OOX::CSystemUtility::CreateDirectories(directory / defdir);
|
||||
pFile->write(directory / defdir / name, directory, content);
|
||||
|
||||
rels.Registration(pPair->first, pFile->type(), defdir / name);
|
||||
}
|
||||
}
|
||||
@ -229,9 +232,9 @@ namespace PPTX
|
||||
|
||||
void FileContainer::WrittenSetFalse()
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
|
||||
for (size_t i = 0; i < m_arContainer.size(); i++)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = pPair->second;
|
||||
smart_ptr<OOX::File> &pFile = m_arContainer[i];
|
||||
|
||||
smart_ptr<PPTX::WrapperFile> pWrapFile = pFile.smart_dynamic_cast<PPTX::WrapperFile>();
|
||||
smart_ptr<PPTX::FileContainer> pWrapCont = pFile.smart_dynamic_cast<PPTX::FileContainer>();
|
||||
|
||||
@ -33,9 +33,12 @@
|
||||
#ifndef PPTX_IFILE_CONTAINER_INCLUDE_H_
|
||||
#define PPTX_IFILE_CONTAINER_INCLUDE_H_
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/IFileContainer.h"
|
||||
#include "FileMap.h"
|
||||
#include "PPTXEvent.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/IFileContainer.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
@ -52,7 +55,32 @@ namespace PPTX
|
||||
virtual ~FileContainer()
|
||||
{
|
||||
}
|
||||
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename;
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
return _T("");
|
||||
}
|
||||
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
protected:
|
||||
void read(const OOX::CPath& filename);
|
||||
void read(const OOX::CRels& rels, const OOX::CPath& path);
|
||||
|
||||
@ -162,6 +162,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(_T("p:controls"));
|
||||
pWriter->EndAttributes();
|
||||
|
||||
for (size_t i = 0; i < arrControls.size(); ++i)
|
||||
arrControls[i].toXmlWriter(pWriter);
|
||||
|
||||
@ -110,11 +110,9 @@ namespace PPTX
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
|
||||
if(parentFileIs<Slide>()) return parentFileAs<Slide>().GetImagePathNameFromRId(*embed);
|
||||
else if(parentFileIs<SlideLayout>()) return parentFileAs<SlideLayout>().GetImagePathNameFromRId(*embed);
|
||||
else if(parentFileIs<SlideMaster>()) return parentFileAs<SlideMaster>().GetImagePathNameFromRId(*embed);
|
||||
else if(parentFileIs<Theme>()) return parentFileAs<Theme>().GetImagePathNameFromRId(*embed);
|
||||
else if(parentFileIs<NotesSlide>()) return parentFileAs<NotesSlide>().GetImagePathNameFromRId(*embed);
|
||||
if(parentFileIs<FileContainer>())
|
||||
return parentFileAs<FileContainer>().GetImagePathNameFromRId(*embed);
|
||||
|
||||
return _T("");
|
||||
}
|
||||
else if(link.IsInit())
|
||||
@ -126,11 +124,9 @@ namespace PPTX
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
|
||||
if(parentFileIs<Slide>()) return parentFileAs<Slide>().GetImagePathNameFromRId(*link);
|
||||
else if(parentFileIs<SlideLayout>()) return parentFileAs<SlideLayout>().GetImagePathNameFromRId(*link);
|
||||
else if(parentFileIs<SlideMaster>()) return parentFileAs<SlideMaster>().GetImagePathNameFromRId(*link);
|
||||
else if(parentFileIs<Theme>()) return parentFileAs<Theme>().GetImagePathNameFromRId(*link);
|
||||
else if(parentFileIs<NotesSlide>()) return parentFileAs<NotesSlide>().GetImagePathNameFromRId(*link);
|
||||
if(parentFileIs<FileContainer>())
|
||||
return parentFileAs<FileContainer>().GetImagePathNameFromRId(*link);
|
||||
|
||||
return _T("");
|
||||
}
|
||||
return _T("");
|
||||
@ -140,12 +136,7 @@ namespace PPTX
|
||||
smart_ptr<OOX::OleObject> pOleObject;
|
||||
|
||||
if (pRels != NULL) pOleObject = pRels->Get<OOX::OleObject>(oRId);
|
||||
|
||||
else if(parentFileIs<Slide>()) pOleObject = parentFileAs<Slide>().Get<OOX::OleObject>(oRId);
|
||||
else if(parentFileIs<SlideLayout>()) pOleObject = parentFileAs<SlideLayout>().Get<OOX::OleObject>(oRId);
|
||||
else if(parentFileIs<SlideMaster>()) pOleObject = parentFileAs<SlideMaster>().Get<OOX::OleObject>(oRId);
|
||||
else if(parentFileIs<Theme>()) pOleObject = parentFileAs<Theme>().Get<OOX::OleObject>(oRId);
|
||||
else if(parentFileIs<NotesSlide>()) pOleObject = parentFileAs<NotesSlide>().Get<OOX::OleObject>(oRId);
|
||||
else if(parentFileIs<FileContainer>()) pOleObject = parentFileAs<FileContainer>().Get<OOX::OleObject>(oRId);
|
||||
|
||||
if (pOleObject.IsInit())
|
||||
return pOleObject->filename().m_strFilename;
|
||||
|
||||
@ -58,11 +58,8 @@ namespace PPTX
|
||||
}
|
||||
if(sLink.empty())
|
||||
{
|
||||
if(parentFileIs<Slide>()) sLink = parentFileAs<Slide>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<SlideLayout>()) sLink = parentFileAs<SlideLayout>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<SlideMaster>()) sLink = parentFileAs<SlideMaster>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<Theme>()) sLink = parentFileAs<Theme>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<NotesSlide>()) sLink = parentFileAs<NotesSlide>().GetLinkFromRId(rid);
|
||||
if(parentFileIs<FileContainer>())
|
||||
sLink = parentFileAs<FileContainer>().GetLinkFromRId(rid);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all(sLink, L"\\", L"/");
|
||||
|
||||
@ -57,11 +57,8 @@ namespace PPTX
|
||||
}
|
||||
if(sLink.empty())
|
||||
{
|
||||
if(parentFileIs<Slide>()) sLink = parentFileAs<Slide>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<SlideLayout>()) sLink = parentFileAs<SlideLayout>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<SlideMaster>()) sLink = parentFileAs<SlideMaster>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<Theme>()) sLink = parentFileAs<Theme>().GetLinkFromRId(rid);
|
||||
else if(parentFileIs<NotesSlide>()) sLink = parentFileAs<NotesSlide>().GetLinkFromRId(rid);
|
||||
if(parentFileIs<FileContainer>())
|
||||
sLink = parentFileAs<FileContainer>().GetLinkFromRId(rid);
|
||||
}
|
||||
|
||||
return sLink;
|
||||
|
||||
@ -385,8 +385,10 @@ namespace PPTX
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
pApp->SetApplication(_T("OnlyOffice"));
|
||||
pApp->SetAppVersion(_T("5.0"));
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
@ -438,9 +440,10 @@ namespace PPTX
|
||||
std::wstring sXmlOptions, sMediaPath, sEmbedPath;
|
||||
BinXlsxRW::CXlsxSerializer::CreateXlsxFolders (sXmlOptions, sDstEmbeddedTemp, sMediaPath, sEmbedPath);
|
||||
|
||||
std::map<std::wstring, size_t> old_enum_map = oXlsx.m_mapEnumeratedGlobal;
|
||||
NSBinPptxRW::CBinaryFileReader* old_reader = oDrawingConverter.m_pReader;
|
||||
NSBinPptxRW::CRelsGenerator* old_rels = pReader->m_pRels;
|
||||
boost::unordered_map<std::wstring, size_t> old_enum_map = oXlsx.m_mapEnumeratedGlobal;
|
||||
|
||||
NSBinPptxRW::CBinaryFileReader* old_reader = oDrawingConverter.m_pReader;
|
||||
NSBinPptxRW::CRelsGenerator* old_rels = pReader->m_pRels;
|
||||
|
||||
oXlsx.m_mapEnumeratedGlobal.clear();
|
||||
|
||||
@ -658,12 +661,12 @@ namespace PPTX
|
||||
}
|
||||
if (oleObject->m_sShapeId.IsInit() && pVml && !blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty())
|
||||
{
|
||||
boost::unordered_map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
|
||||
boost::unordered_map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pFind = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
|
||||
|
||||
if (pVml->m_mapShapes.end() != pPair)
|
||||
if (pVml->m_mapShapes.end() != pFind)
|
||||
{
|
||||
pPair->second.bUsed = true;
|
||||
OOX::Vml::CVmlCommonElements* pShape = dynamic_cast<OOX::Vml::CVmlCommonElements*>(pPair->second.pElement);
|
||||
pFind->second.bUsed = true;
|
||||
OOX::Vml::CVmlCommonElements* pShape = dynamic_cast<OOX::Vml::CVmlCommonElements*>(pFind->second.pElement);
|
||||
|
||||
if (pShape)
|
||||
{
|
||||
@ -1148,7 +1151,7 @@ namespace PPTX
|
||||
{
|
||||
double trim = 0.0;
|
||||
|
||||
if (parentFileIs<Slide>())
|
||||
if (parentFileIs<FileContainer>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
@ -1156,7 +1159,7 @@ namespace PPTX
|
||||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")) ||
|
||||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile")) )
|
||||
{
|
||||
if (std::wstring (_T("NULL")) == parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get()) ) // HAVE TRIM
|
||||
if (std::wstring (_T("NULL")) == parentFileAs<FileContainer>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get()) ) // HAVE TRIM
|
||||
{
|
||||
if(nvPicPr.nvPr.extLst.size())
|
||||
{
|
||||
@ -1175,15 +1178,15 @@ namespace PPTX
|
||||
{
|
||||
double trim = -1.0;
|
||||
|
||||
if (parentFileIs<Slide>())
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
if ((nvPicPr.nvPr.media.as<MediaFile>().name == _T("videoFile")) ||
|
||||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")) ||
|
||||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile")) )
|
||||
{
|
||||
if ((nvPicPr.nvPr.media.as<MediaFile>().name == _T("videoFile")) ||
|
||||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")) ||
|
||||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile")) )
|
||||
if (parentFileIs<FileContainer>())
|
||||
{
|
||||
if (std::wstring (_T("NULL")) == parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get())) // HAVE TRIM
|
||||
if (std::wstring (_T("NULL")) == parentFileAs<FileContainer>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get())) // HAVE TRIM
|
||||
{
|
||||
if(nvPicPr.nvPr.extLst.size())
|
||||
{
|
||||
|
||||
@ -153,6 +153,18 @@ namespace PPTX
|
||||
|
||||
pReader->Skip(1); // start attributes
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
@ -161,12 +173,10 @@ namespace PPTX
|
||||
case 0:
|
||||
{
|
||||
Fill.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
pReader->Seek(_end_rec);
|
||||
@ -175,6 +185,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(m_name);
|
||||
pWriter->EndAttributes();
|
||||
Fill.toXmlWriter(pWriter);
|
||||
pWriter->EndNode(m_name);
|
||||
}
|
||||
@ -244,6 +255,18 @@ namespace PPTX
|
||||
|
||||
pReader->Skip(1); // start attributes
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
switch (_at)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (pReader->GetPos() < _end_rec)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar();
|
||||
@ -252,12 +275,10 @@ namespace PPTX
|
||||
case 0:
|
||||
{
|
||||
Color.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
pReader->Seek(_end_rec);
|
||||
@ -266,6 +287,7 @@ namespace PPTX
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(L"a:highlight");
|
||||
pWriter->EndAttributes();
|
||||
Color.toXmlWriter(pWriter);
|
||||
pWriter->EndNode(L"a:highlight");
|
||||
}
|
||||
@ -479,7 +501,6 @@ namespace PPTX
|
||||
pWriter->Write(rtl);
|
||||
pWriter->Write(uFill);
|
||||
pWriter->Write(uFillTx);
|
||||
pWriter->Write(uFillTx);
|
||||
pWriter->Write(highlight);
|
||||
|
||||
pWriter->EndNode(m_name);
|
||||
@ -599,101 +620,82 @@ namespace PPTX
|
||||
case 0:
|
||||
{
|
||||
altLang = pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
b = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
baseline = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 3:
|
||||
{
|
||||
bmk = pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 4:
|
||||
{
|
||||
cap = new Limit::TextCaps();
|
||||
cap->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 5:
|
||||
{
|
||||
dirty = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 6:
|
||||
{
|
||||
err = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 7:
|
||||
{
|
||||
i = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 8:
|
||||
{
|
||||
kern = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 9:
|
||||
{
|
||||
kumimoji = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 10:
|
||||
{
|
||||
lang = pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 11:
|
||||
{
|
||||
noProof = pReader->GetBool(); // noproof
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 12:
|
||||
{
|
||||
normalizeH = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 13:
|
||||
{
|
||||
smtClean = pReader->GetBool();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 14:
|
||||
{
|
||||
smtId = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 15:
|
||||
{
|
||||
spc = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 16:
|
||||
{
|
||||
strike = new Limit::TextStrike();
|
||||
strike->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 17:
|
||||
{
|
||||
sz = pReader->GetLong();
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 18:
|
||||
{
|
||||
u = new Limit::TextUnderline();
|
||||
u->SetBYTECode(pReader->GetUChar());
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -708,77 +710,69 @@ namespace PPTX
|
||||
{
|
||||
ln = new Logic::Ln();
|
||||
ln->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
Fill.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
EffectList.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 3:
|
||||
{
|
||||
latin = new Logic::TextFont();
|
||||
latin->m_name = L"a:latin";
|
||||
latin->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 4:
|
||||
{
|
||||
ea = new Logic::TextFont();
|
||||
ea->m_name = L"a:ea";
|
||||
ea->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 5:
|
||||
{
|
||||
cs = new Logic::TextFont();
|
||||
cs->m_name = L"a:cs";
|
||||
cs->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 6:
|
||||
{
|
||||
sym = new Logic::TextFont();
|
||||
sym->m_name = L"a:sym";
|
||||
sym->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case 7:
|
||||
{
|
||||
hlinkClick = new Logic::Hyperlink(L"hlinkClick");
|
||||
hlinkClick->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
hlinkClick->fromPPTY(pReader);
|
||||
}break;
|
||||
case 8:
|
||||
{
|
||||
hlinkMouseOver = new Logic::Hyperlink(L"hlinkMouseOver");
|
||||
hlinkMouseOver->fromPPTY(pReader);
|
||||
}
|
||||
}break;
|
||||
case 9:
|
||||
{
|
||||
rtl = new Logic::Rtl();
|
||||
rtl->fromPPTY(pReader);
|
||||
}
|
||||
}break;
|
||||
case 10:
|
||||
{
|
||||
uFill = new Logic::UFillTx(L"a:uFill");
|
||||
uFill->fromPPTY(pReader);
|
||||
}
|
||||
}break;
|
||||
case 11:
|
||||
{
|
||||
uFillTx = new Logic::UFillTx(L"a:uFillTx");
|
||||
uFillTx->fromPPTY(pReader);
|
||||
}
|
||||
}break;
|
||||
case 12:
|
||||
{
|
||||
highlight = new Logic::Highlight();
|
||||
highlight->fromPPTY(pReader);
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
|
||||
@ -88,25 +88,6 @@ namespace PPTX
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename; //??? целесообразность ??
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
return _T("");
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartRecord(NSBinPptxRW::NSMainTables::NotesSlides);
|
||||
|
||||
@ -49,9 +49,6 @@
|
||||
#include "NotesSlide.h"
|
||||
#include "TableStyles.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/VmlDrawing.h"
|
||||
|
||||
@ -144,33 +141,6 @@ namespace PPTX
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
//-------------------------------------------------
|
||||
|
||||
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename;
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
return _T("");
|
||||
}
|
||||
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual DWORD GetRGBAFromMap(const std::wstring& str)const
|
||||
{
|
||||
if(!(clrMapOvr.is_init()))
|
||||
|
||||
@ -185,32 +185,6 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename;
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
return _T("");
|
||||
}
|
||||
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual DWORD GetRGBAFromMap(const std::wstring& str)const
|
||||
{
|
||||
if(!(clrMapOvr.is_init()))
|
||||
|
||||
@ -51,8 +51,6 @@
|
||||
#include "Theme.h"
|
||||
#include "TableStyles.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/VmlDrawing.h"
|
||||
|
||||
@ -172,32 +170,6 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename;
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
return _T("");
|
||||
}
|
||||
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
|
||||
//---------------------Colors from map---------------------------------------
|
||||
DWORD GetRGBAFromMap(const std::wstring& str)const
|
||||
|
||||
@ -334,33 +334,6 @@ namespace PPTX
|
||||
{
|
||||
return GetABGRFromScheme(m_map->GetColorSchemeIndex(str));
|
||||
}
|
||||
|
||||
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
|
||||
if (pExt.IsInit())
|
||||
return pExt->Uri().m_strFilename;
|
||||
|
||||
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
|
||||
if (pMedia.IsInit())
|
||||
return pMedia->filename().m_strFilename;
|
||||
|
||||
return _T("");
|
||||
}
|
||||
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
|
||||
{
|
||||
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
|
||||
if (!p.is_init())
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
void GetLineStyle(int number, Logic::Ln& lnStyle)const
|
||||
{
|
||||
themeElements.fmtScheme.GetLineStyle(number, lnStyle);
|
||||
|
||||
@ -147,9 +147,10 @@ bool OOXWriter::SaveByItemEnd()
|
||||
|
||||
if (m_poDocPropsApp)
|
||||
{
|
||||
((OOX::CApp*)m_poDocPropsApp)->SetApplication ( L"OnlyOffice" );
|
||||
((OOX::CApp*)m_poDocPropsApp)->SetAppVersion ( L"5.0" );
|
||||
|
||||
((OOX::CApp*)m_poDocPropsApp)->SetApplication ( L"ONLYOFFICE" );
|
||||
#if defined(INTVER)
|
||||
((OOX::CApp*)m_poDocPropsApp)->SetAppVersion ( VALUE2STR(INTVER) );
|
||||
#endif
|
||||
((OOX::CApp*)m_poDocPropsApp)->write(pathDocProps + FILE_SEPARATOR_STR + L"app.xml", pathDocProps.GetDirectory(), oContentTypes);
|
||||
|
||||
m_oRels.AddRelationship( L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", L"docProps/app.xml" );
|
||||
|
||||
@ -218,8 +218,10 @@ void CTxtXmlFile::CreateDocxEmpty(const std::wstring & _strDirectory, Writers::F
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
pApp->SetApplication(_T("OnlyOffice"));
|
||||
pApp->SetAppVersion(_T("5.07"));
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
|
||||
@ -149,6 +149,7 @@ void OfficeArtBStoreContainerFileBlock::load(XLS::CFRecord& record)
|
||||
break;
|
||||
case OfficeArtRecord::BlipPICT:
|
||||
{
|
||||
pict_type = L".pcz";
|
||||
if (rc_header.recInstance == 0x542)
|
||||
rgbUid1 = ReadMD4Digest(record);
|
||||
else
|
||||
@ -165,7 +166,6 @@ void OfficeArtBStoreContainerFileBlock::load(XLS::CFRecord& record)
|
||||
isCompressed = true;
|
||||
readCompressedData(record, metafileHeader);
|
||||
}
|
||||
pict_type = L".pic";///???? todooo
|
||||
}
|
||||
break;
|
||||
case OfficeArtRecord::BlipJPEG:
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
#include "../../../ASCOfficeOdfFile/include/cpdoccore/utf8cpp/utf8.h"
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
|
||||
#include "external_items.h"
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
@ -235,8 +236,8 @@ void core_file::write(const std::wstring & RootPath)
|
||||
L"xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" "
|
||||
L"xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" >";
|
||||
|
||||
resStream << L"<dc:creator>ONLYOFFICE</dc:creator>";
|
||||
resStream << L"<cp:lastModifiedBy>ONLYOFFICE</cp:lastModifiedBy>";
|
||||
//resStream << L"<dc:creator>ONLYOFFICE</dc:creator>";
|
||||
//resStream << L"<cp:lastModifiedBy>ONLYOFFICE</cp:lastModifiedBy>";
|
||||
resStream << L"<cp:revision>1</cp:revision>";
|
||||
resStream << L"</cp:coreProperties>";
|
||||
|
||||
@ -251,8 +252,12 @@ void app_file::write(const std::wstring & RootPath)
|
||||
resStream << L"<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" "
|
||||
L"xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\" >";
|
||||
|
||||
resStream << L"<Application>ONLYOFFICE Editor</Application>";
|
||||
resStream << L"</Properties>";
|
||||
resStream << L"<Application>ONLYOFFICE";
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
resStream << L"/" << std::wstring(s.begin(), s.end());
|
||||
#endif
|
||||
resStream << L"</Application></Properties>";
|
||||
|
||||
simple_element elm(L"app.xml", resStream.str());
|
||||
elm.write(RootPath);
|
||||
|
||||
@ -42,6 +42,9 @@
|
||||
#define _T(x) __T(x)
|
||||
#define __T(x) L##x
|
||||
|
||||
#define VALUE_TO_STRING(x) #x
|
||||
#define VALUE2STR(x) VALUE_TO_STRING(x)
|
||||
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
#include <TCHAR.H>
|
||||
// windows-stype separator for paths i.e. 'c:\home\documents\file.ext'
|
||||
|
||||
@ -62,8 +62,6 @@ namespace NSCommon
|
||||
{
|
||||
RELEASEOBJECT(m_pPointer);
|
||||
}
|
||||
|
||||
public:
|
||||
Type& operator*() { return *m_pPointer; }
|
||||
Type* operator->() { return m_pPointer; }
|
||||
|
||||
@ -73,7 +71,6 @@ namespace NSCommon
|
||||
const Type& get()const { return *m_pPointer; }
|
||||
Type& get() { return *m_pPointer; }
|
||||
|
||||
public:
|
||||
nullable_base<Type>& operator=(const nullable_base<Type> &oOther)
|
||||
{
|
||||
RELEASEOBJECT(m_pPointer);
|
||||
@ -95,8 +92,6 @@ namespace NSCommon
|
||||
m_pPointer = new Type(oSrc);
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
bool IsInit() const
|
||||
{
|
||||
return (NULL != m_pPointer);
|
||||
@ -167,20 +162,6 @@ namespace NSCommon
|
||||
return *this;
|
||||
}
|
||||
|
||||
//nullable<Type>& operator=(std::wstring& cwsValue)
|
||||
//{
|
||||
// RELEASEOBJECT(this->m_pPointer);
|
||||
// this->m_pPointer = new Type( cwsValue.c_str() );
|
||||
// return *this;
|
||||
//}
|
||||
|
||||
//nullable<Type>& operator=(const std::wstring& cwsValue)
|
||||
//{
|
||||
// RELEASEOBJECT(this->m_pPointer);
|
||||
// this->m_pPointer = new Type( cwsValue.c_str() );
|
||||
// return *this;
|
||||
//}
|
||||
|
||||
nullable<Type>& operator=(const nullable<Type> &oOther)
|
||||
{
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
@ -283,8 +264,6 @@ namespace NSCommon
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void operator=(const std::wstring& value)
|
||||
{
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
@ -296,17 +275,6 @@ namespace NSCommon
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
this->m_pPointer = pType;
|
||||
}
|
||||
//#if defined(_WIN32) || defined (_WIN64)
|
||||
// void operator=(const BSTR& value)
|
||||
// {
|
||||
// RELEASEOBJECT(this->m_pPointer);
|
||||
// if (NULL != value)
|
||||
// {
|
||||
// this->m_pPointer = new Type();
|
||||
// this->m_pPointer->_set((std::wstring)value);
|
||||
// }
|
||||
// }
|
||||
//#endif
|
||||
void operator=(const BYTE& value)
|
||||
{
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
@ -343,7 +311,6 @@ namespace NSCommon
|
||||
return this->m_pPointer->get();
|
||||
}
|
||||
|
||||
public:
|
||||
Type& operator*() { return *this->m_pPointer; }
|
||||
Type* operator->() { return this->m_pPointer; }
|
||||
|
||||
@ -387,15 +354,6 @@ namespace NSCommon
|
||||
|
||||
return *this;
|
||||
}
|
||||
//#if defined(_WIN32) || defined (_WIN64)
|
||||
// void operator=(const BSTR& value)
|
||||
// {
|
||||
// RELEASEOBJECT(this->m_pPointer);
|
||||
//
|
||||
// if (NULL != value)
|
||||
// this->m_pPointer = new int(XmlUtils::GetInteger(value));
|
||||
// }
|
||||
//#endif
|
||||
void operator=(const std::wstring& value)
|
||||
{
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
@ -425,8 +383,6 @@ namespace NSCommon
|
||||
}
|
||||
return *m_pPointer;
|
||||
}
|
||||
|
||||
public:
|
||||
int& operator*() { return *m_pPointer; }
|
||||
int* operator->() { return m_pPointer; }
|
||||
|
||||
@ -434,15 +390,77 @@ namespace NSCommon
|
||||
int* operator->() const { return m_pPointer; }
|
||||
|
||||
const int& get()const { return *m_pPointer; }
|
||||
};
|
||||
class nullable_int64 : public nullable_base<_INT64>
|
||||
{
|
||||
public:
|
||||
std::wstring toString() const
|
||||
nullable_int64() : nullable_base<_INT64>()
|
||||
{
|
||||
std::wstring result;
|
||||
//if (IsInit())
|
||||
// result = std::to_wstring( get());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void normalize(const _INT64& min, const _INT64& max)
|
||||
{
|
||||
if (IsInit())
|
||||
{
|
||||
if (*m_pPointer < min)
|
||||
*m_pPointer = min;
|
||||
else if (*m_pPointer > max)
|
||||
*m_pPointer = max;
|
||||
}
|
||||
}
|
||||
void normalize_positive()
|
||||
{
|
||||
if (IsInit())
|
||||
{
|
||||
if (*m_pPointer < 0)
|
||||
*m_pPointer = 0;
|
||||
}
|
||||
}
|
||||
nullable_int64& operator=(const wchar_t* cwsValue)
|
||||
{
|
||||
RELEASEOBJECT(m_pPointer);
|
||||
|
||||
if ( NULL != cwsValue )
|
||||
m_pPointer = new _INT64(XmlUtils::GetInteger64(cwsValue));
|
||||
|
||||
return *this;
|
||||
}
|
||||
void operator=(const std::wstring& value)
|
||||
{
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
this->m_pPointer = new _INT64(XmlUtils::GetInteger64(value));
|
||||
}
|
||||
void operator=(const _INT64& value)
|
||||
{
|
||||
RELEASEOBJECT(this->m_pPointer);
|
||||
this->m_pPointer = new _INT64(value);
|
||||
}
|
||||
|
||||
nullable_int64& operator=(const nullable_int64& oSrc)
|
||||
{
|
||||
RELEASEOBJECT(m_pPointer);
|
||||
|
||||
if (NULL != oSrc.m_pPointer )
|
||||
m_pPointer = new _INT64(*oSrc);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_INT64 get_value_or(const _INT64& value) const
|
||||
{
|
||||
if (NULL == m_pPointer)
|
||||
{
|
||||
int ret = value;
|
||||
return ret;
|
||||
}
|
||||
return *m_pPointer;
|
||||
}
|
||||
_INT64& operator*() { return *m_pPointer; }
|
||||
_INT64* operator->() { return m_pPointer; }
|
||||
|
||||
_INT64& operator*() const { return *m_pPointer; }
|
||||
_INT64* operator->() const { return m_pPointer; }
|
||||
|
||||
const _INT64& get()const { return *m_pPointer; }
|
||||
};
|
||||
class nullable_sizet : public nullable_base<size_t>
|
||||
{
|
||||
@ -494,7 +512,6 @@ namespace NSCommon
|
||||
}
|
||||
return *m_pPointer;
|
||||
}
|
||||
public:
|
||||
size_t& operator*() { return *m_pPointer; }
|
||||
size_t* operator->() { return m_pPointer; }
|
||||
|
||||
@ -630,12 +647,6 @@ namespace NSCommon
|
||||
|
||||
const bool& get()const { return *m_pPointer; }
|
||||
|
||||
std::wstring toString() const
|
||||
{
|
||||
std::wstring result;
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
class nullable_string : public nullable_base<std::wstring>
|
||||
{
|
||||
@ -679,8 +690,6 @@ namespace NSCommon
|
||||
}
|
||||
return *m_pPointer;
|
||||
}
|
||||
|
||||
public:
|
||||
std::wstring& operator*() { return *m_pPointer; }
|
||||
std::wstring* operator->() { return m_pPointer; }
|
||||
|
||||
|
||||
@ -192,15 +192,20 @@ namespace OOX
|
||||
{
|
||||
sXml += _T("<Application>");
|
||||
sXml += m_sApplication.get();
|
||||
if ( m_sAppVersion.IsInit() )
|
||||
{
|
||||
sXml += L"/";
|
||||
sXml += m_sAppVersion.get();
|
||||
}
|
||||
sXml += _T("</Application>");
|
||||
}
|
||||
|
||||
if ( m_sAppVersion.IsInit() )
|
||||
{
|
||||
sXml += _T("<AppVersion>");
|
||||
sXml += m_sAppVersion.get();
|
||||
sXml += _T("</AppVersion>");
|
||||
}
|
||||
//if ( m_sAppVersion.IsInit() ) - only for ms editors versions
|
||||
//{
|
||||
// sXml += _T("<AppVersion>");
|
||||
// sXml += m_sAppVersion.get(); // error in ms editors - "2.4.510.0"
|
||||
// sXml += _T("</AppVersion>");
|
||||
//}
|
||||
|
||||
if ( m_nCharacters.IsInit() )
|
||||
{
|
||||
@ -416,7 +421,11 @@ namespace OOX
|
||||
{
|
||||
m_sAppVersion = sVal;
|
||||
}
|
||||
void SetDocSecurity(int nVal)
|
||||
void SetAppVersion(const std::string& sVal)
|
||||
{
|
||||
m_sAppVersion = std::wstring(sVal.begin(), sVal.end());
|
||||
}
|
||||
void SetDocSecurity(int nVal)
|
||||
{
|
||||
m_nDocSecurity = nVal;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
std::map<std::wstring, size_t> IFileContainer::m_mapEnumeratedGlobal;
|
||||
boost::unordered_map<std::wstring, size_t> IFileContainer::m_mapEnumeratedGlobal;
|
||||
|
||||
UnknowTypeFile IFileContainer::Unknown(NULL);
|
||||
|
||||
@ -99,9 +99,10 @@ namespace OOX
|
||||
}
|
||||
void IFileContainer::Write(OOX::CRels& oRels, const OOX::CPath& oCurrent, const OOX::CPath& oDir, OOX::CContentTypes& oContent) const
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
|
||||
for (boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mapContainer.begin(); pPair != m_mapContainer.end(); ++pPair)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = pPair->second;
|
||||
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<OOX::Media> pMedia = pFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
@ -114,7 +115,7 @@ namespace OOX
|
||||
if(false == pFile->m_sOutputFilename.empty())
|
||||
oName.SetName(pFile->m_sOutputFilename, false);
|
||||
|
||||
std::map<std::wstring, std::wstring>::const_iterator itFind = m_mNoWriteContainer.find(pPair->first);
|
||||
boost::unordered_map<std::wstring, std::wstring>::const_iterator itFind = m_mNoWriteContainer.find(pPair->first);
|
||||
if(m_mNoWriteContainer.end() == itFind)
|
||||
{
|
||||
OOX::CSystemUtility::CreateDirectories( oCurrent / oDefDir );
|
||||
@ -124,13 +125,13 @@ namespace OOX
|
||||
{
|
||||
oDefDir = itFind->second;
|
||||
}
|
||||
if(true != pFile->m_bDoNotAddRels)
|
||||
{
|
||||
if (oDefDir.GetPath().length() > 0)//todooo перенести в CPath
|
||||
oRels.Registration( pPair->first, pFile->type(), oDefDir / oName );
|
||||
else
|
||||
oRels.Registration( pPair->first, pFile->type(), oName );
|
||||
}
|
||||
if(true != pFile->m_bDoNotAddRels)
|
||||
{
|
||||
if (oDefDir.GetPath().length() > 0)//todooo перенести в CPath
|
||||
oRels.Registration( pPair->first, pFile->type(), oDefDir / oName );
|
||||
else
|
||||
oRels.Registration( pPair->first, pFile->type(), oName );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -144,9 +145,10 @@ namespace OOX
|
||||
{
|
||||
std::map<std::wstring, size_t> mNamepair;
|
||||
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.begin(); it != m_mContainer.end(); ++it)
|
||||
for (size_t i = 0; i < m_arContainer.size(); ++i)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = it->second;
|
||||
smart_ptr<OOX::File> &pFile = m_arContainer[i];
|
||||
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<OOX::Media> pMedia = pFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
@ -167,7 +169,8 @@ namespace OOX
|
||||
|
||||
OOX::CSystemUtility::CreateDirectories( oPath / oDefDir );
|
||||
|
||||
smart_ptr<OOX::IFileBuilder> pFileBuilder = it->second.smart_dynamic_cast<OOX::IFileBuilder>();
|
||||
smart_ptr<OOX::IFileBuilder> pFileBuilder = pFile.smart_dynamic_cast<OOX::IFileBuilder>();
|
||||
|
||||
if ( pFileBuilder.is_init() )
|
||||
pFileBuilder->Commit( oPath / oDefDir / oName );
|
||||
}
|
||||
@ -187,9 +190,10 @@ namespace OOX
|
||||
{
|
||||
std::map<std::wstring, size_t> mNamepair;
|
||||
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.begin(); it != m_mContainer.end(); ++it)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = it->second;
|
||||
for (boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mapContainer.begin(); pPair != m_mapContainer.end(); ++pPair)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = pPair->second;
|
||||
|
||||
smart_ptr<OOX::External> pExt = pFile.smart_dynamic_cast<OOX::External>();
|
||||
smart_ptr<OOX::Media> pMedia = pFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
@ -205,7 +209,7 @@ namespace OOX
|
||||
else
|
||||
oName = oName + pNamePair->first;
|
||||
|
||||
std::map<std::wstring, std::wstring>::const_iterator itFind = m_mNoWriteContainer.find(it->first);
|
||||
boost::unordered_map<std::wstring, std::wstring>::const_iterator itFind = m_mNoWriteContainer.find(pPair->first);
|
||||
|
||||
if(m_mNoWriteContainer.end() == itFind)
|
||||
{
|
||||
@ -225,22 +229,22 @@ namespace OOX
|
||||
oDefDir = itFind->second;
|
||||
}
|
||||
|
||||
oRels.Registration( it->first, pFile->type(), oDefDir / oName );
|
||||
oRels.Registration( pPair->first, pFile->type(), oDefDir / oName );
|
||||
}
|
||||
else
|
||||
{
|
||||
oRels.Registration( it->first, pExt );
|
||||
oRels.Registration( pPair->first, pExt );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IFileContainer::ExtractPictures (const OOX::CPath& oPath) const
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.begin(); it != m_mContainer.end(); ++it)
|
||||
for (size_t i = 0; i < m_arContainer.size(); ++i)
|
||||
{
|
||||
smart_ptr<OOX::File> pFile = it->second;
|
||||
smart_ptr<OOX::File> pFile = m_arContainer[i];
|
||||
|
||||
smart_ptr<Image> pImage = pFile.smart_dynamic_cast<Image>();
|
||||
smart_ptr<Image> pImage = pFile.smart_dynamic_cast<Image>();
|
||||
if ( pImage.is_init() )
|
||||
{
|
||||
pImage->copy_to( oPath );
|
||||
@ -257,9 +261,11 @@ namespace OOX
|
||||
}
|
||||
const bool IFileContainer::IsExist(const FileType& oType) const
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.begin(); it != m_mContainer.end(); ++it)
|
||||
for (size_t i = 0; i < m_arContainer.size(); ++i)
|
||||
{
|
||||
if (oType == it->second->type())
|
||||
smart_ptr<OOX::File> pFile = m_arContainer[i];
|
||||
|
||||
if (oType == pFile->type())
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -267,8 +273,8 @@ namespace OOX
|
||||
}
|
||||
const bool IFileContainer::IsExist(const RId& rId) const
|
||||
{
|
||||
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.find(rId.get());
|
||||
return (it != m_mContainer.end());
|
||||
boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pFind = m_mapContainer.find(rId.get());
|
||||
return (pFind != m_mapContainer.end());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@ -279,7 +285,7 @@ namespace OOX
|
||||
}
|
||||
std::wstring IFileContainer::IsExistHyperlink(smart_ptr<OOX::HyperLink>& pHyperLink)
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
|
||||
for ( boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mapContainer.begin(); pPair != m_mapContainer.end(); ++pPair)
|
||||
{
|
||||
if(OOX::FileTypes::HyperLink == pPair->second->type())
|
||||
{
|
||||
@ -292,9 +298,9 @@ namespace OOX
|
||||
}
|
||||
const bool IFileContainer::IsExternal(const OOX::RId& rId) const
|
||||
{
|
||||
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pFind = m_mContainer.find(rId.get());
|
||||
boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pFind = m_mapContainer.find(rId.get());
|
||||
|
||||
if (pFind != m_mContainer.end())
|
||||
if (pFind != m_mapContainer.end())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = pFind->second.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
@ -312,10 +318,11 @@ namespace OOX
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::Get(const FileType& oType)
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator it = m_mContainer.begin(); it != m_mContainer.end(); ++it)
|
||||
for (size_t i = 0; i < m_arContainer.size(); ++i)
|
||||
{
|
||||
if (oType == it->second->type())
|
||||
return it->second;
|
||||
smart_ptr<OOX::File> &pFile = m_arContainer[i];
|
||||
if (oType == pFile->type())
|
||||
return pFile;
|
||||
}
|
||||
|
||||
return smart_ptr<OOX::File>(new UnknowTypeFile( Unknown ));
|
||||
@ -323,10 +330,12 @@ namespace OOX
|
||||
|
||||
void IFileContainer::Get(const FileType& oType, std::vector<smart_ptr<OOX::File>> & files)
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
|
||||
for (size_t i = 0; i < m_arContainer.size(); ++i)
|
||||
{
|
||||
if ( oType == pPair->second->type() )
|
||||
files.push_back(pPair->second);
|
||||
smart_ptr<OOX::File> &pFile = m_arContainer[i];
|
||||
|
||||
if ( oType == pFile->type() )
|
||||
files.push_back(pFile);
|
||||
}
|
||||
}
|
||||
const RId IFileContainer::Add(smart_ptr<OOX::File>& pFile)
|
||||
@ -347,13 +356,13 @@ namespace OOX
|
||||
|
||||
if(true == bEnumeratedGlobal)
|
||||
{
|
||||
std::map<std::wstring, size_t>::const_iterator pNamePair = m_mapEnumeratedGlobal.find (pFile->type().OverrideType());
|
||||
boost::unordered_map<std::wstring, size_t>::const_iterator pNamePair = m_mapEnumeratedGlobal.find (pFile->type().OverrideType());
|
||||
if (pNamePair != m_mapEnumeratedGlobal.end())
|
||||
nIndex = pNamePair->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::map<std::wstring, size_t>::const_iterator pNamePair = m_mapAddNamePair.find (pFile->type().OverrideType());
|
||||
boost::unordered_map<std::wstring, size_t>::const_iterator pNamePair = m_mapAddNamePair.find (pFile->type().OverrideType());
|
||||
if (pNamePair != m_mapAddNamePair.end())
|
||||
nIndex = pNamePair->second;
|
||||
}
|
||||
@ -384,7 +393,9 @@ namespace OOX
|
||||
}
|
||||
|
||||
m_lMaxRid = (std::max)( m_lMaxRid, rId.getNumber() );
|
||||
m_mContainer [rId.get()] = pFile;
|
||||
|
||||
m_arContainer.push_back(pFile);
|
||||
m_mapContainer [rId.get()] = pFile;
|
||||
}
|
||||
|
||||
const RId IFileContainer::AddNoWrite(const smart_ptr<OOX::File>& pFile, const std::wstring& oDefDir)
|
||||
@ -397,26 +408,29 @@ namespace OOX
|
||||
void IFileContainer::AddNoWrite (const OOX::RId& rId, const smart_ptr<OOX::File>& pFile, const std::wstring& oDefDir)
|
||||
{
|
||||
m_lMaxRid = (std::max)( m_lMaxRid, rId.getNumber() );
|
||||
m_mContainer [rId.get()] = pFile;
|
||||
|
||||
m_arContainer.push_back(pFile);
|
||||
m_mapContainer [rId.get()] = pFile;
|
||||
|
||||
m_mNoWriteContainer[rId.get()] = oDefDir;
|
||||
}
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::Find(const FileType& oType) const
|
||||
{
|
||||
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.begin(); pPair != m_mContainer.end(); ++pPair)
|
||||
for (size_t i = 0; i < m_arContainer.size(); ++i)
|
||||
{
|
||||
if ( oType == pPair->second->type() )
|
||||
return pPair->second;
|
||||
if ( oType == m_arContainer[i]->type() )
|
||||
return m_arContainer[i];
|
||||
}
|
||||
return smart_ptr<OOX::File>( (OOX::File*)new UnknowTypeFile(m_pMainDocument) );
|
||||
}
|
||||
|
||||
smart_ptr<OOX::File> IFileContainer::Find(const OOX::RId& rId) const
|
||||
{
|
||||
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.find(rId.get());
|
||||
boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mapContainer.find(rId.get());
|
||||
|
||||
if ( pPair != m_mContainer.end())
|
||||
return pPair->second;
|
||||
if ( pPair != m_mapContainer.end())
|
||||
return pPair->second;
|
||||
|
||||
return smart_ptr<OOX::File>( (OOX::File*)new UnknowTypeFile(m_pMainDocument) );
|
||||
}
|
||||
@ -429,9 +443,9 @@ namespace OOX
|
||||
}
|
||||
smart_ptr<OOX::File> IFileContainer::operator [](const OOX::RId rId)
|
||||
{
|
||||
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.find(rId.get());
|
||||
if ( pPair != m_mContainer.end())
|
||||
return pPair->second;
|
||||
boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pFind = m_mapContainer.find(rId.get());
|
||||
if ( pFind != m_mapContainer.end())
|
||||
return pFind->second;
|
||||
|
||||
return smart_ptr<OOX::File>( (OOX::File*)new UnknowTypeFile(m_pMainDocument) );
|
||||
}
|
||||
@ -451,7 +465,7 @@ namespace OOX
|
||||
}
|
||||
int IFileContainer::GetGlobalNumberByType(const std::wstring& sOverrideType)
|
||||
{
|
||||
std::map<std::wstring, size_t>::const_iterator pNamePair = m_mapEnumeratedGlobal.find( sOverrideType );
|
||||
boost::unordered_map<std::wstring, size_t>::const_iterator pNamePair = m_mapEnumeratedGlobal.find( sOverrideType );
|
||||
int nRes = 0;
|
||||
if(pNamePair != m_mapEnumeratedGlobal.end())
|
||||
nRes = pNamePair->second;
|
||||
|
||||
@ -60,14 +60,16 @@ namespace OOX
|
||||
IFileContainer(OOX::Document* pMain);
|
||||
virtual ~IFileContainer();
|
||||
|
||||
bool m_bSpreadsheets;
|
||||
static std::map<std::wstring, size_t> m_mapEnumeratedGlobal;
|
||||
OOX::Document* m_pMainDocument;
|
||||
smart_ptr<OOX::CRels> m_pCurRels;
|
||||
bool m_bSpreadsheets;
|
||||
static boost::unordered_map<std::wstring, size_t> m_mapEnumeratedGlobal;
|
||||
OOX::Document* m_pMainDocument;
|
||||
smart_ptr<OOX::CRels> m_pCurRels;
|
||||
protected:
|
||||
std::map<std::wstring, smart_ptr<OOX::File>> m_mContainer;
|
||||
std::map<std::wstring, std::wstring> m_mNoWriteContainer;
|
||||
size_t m_lMaxRid;
|
||||
std::vector<smart_ptr<OOX::File>> m_arContainer;
|
||||
boost::unordered_map<std::wstring, smart_ptr<OOX::File>> m_mapContainer;
|
||||
|
||||
boost::unordered_map<std::wstring, std::wstring> m_mNoWriteContainer;
|
||||
size_t m_lMaxRid;
|
||||
|
||||
void Read (const OOX::CRels& oRels, const OOX::CPath& oRootPath, const CPath& oPath);
|
||||
void Write (const OOX::CPath& oFileName, const CPath& oDir, OOX::CContentTypes& oContent) const;
|
||||
@ -84,10 +86,10 @@ namespace OOX
|
||||
template<class TypeOut>
|
||||
smart_ptr<TypeOut> Get (const RId& rId) const
|
||||
{
|
||||
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = m_mContainer.find(rId.get());
|
||||
if (pPair == m_mContainer.end ())
|
||||
boost::unordered_map<std::wstring, smart_ptr<OOX::File>>::const_iterator pFind = m_mapContainer.find(rId.get());
|
||||
if (pFind == m_mapContainer.end ())
|
||||
return smart_ptr<TypeOut>();
|
||||
return pPair->second.smart_dynamic_cast<TypeOut>();
|
||||
return pFind->second.smart_dynamic_cast<TypeOut>();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@ -120,9 +122,9 @@ namespace OOX
|
||||
protected:
|
||||
static UnknowTypeFile Unknown;
|
||||
private:
|
||||
std::map<std::wstring, size_t> m_mapAddNamePair;
|
||||
boost::unordered_map<std::wstring, size_t> m_mapAddNamePair;
|
||||
|
||||
const RId GetMaxRId();
|
||||
const RId GetMaxRId();
|
||||
};
|
||||
|
||||
} // namespace OOX
|
||||
|
||||
@ -189,6 +189,12 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((m_oRunProperty) && (m_oRunProperty->m_pText))
|
||||
{
|
||||
m_arrItems.push_back( m_oRunProperty->m_pText);
|
||||
m_oRunProperty->m_pText = NULL;
|
||||
}
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -279,6 +285,11 @@ namespace OOX
|
||||
if ( pItem )
|
||||
m_arrItems.push_back( pItem );
|
||||
}
|
||||
if ((m_oRunProperty) && (m_oRunProperty->m_pText))
|
||||
{
|
||||
m_arrItems.push_back( m_oRunProperty->m_pText);
|
||||
m_oRunProperty->m_pText = NULL;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
|
||||
@ -776,15 +776,13 @@ namespace OOX
|
||||
CText() {}
|
||||
virtual ~CText() {}
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("xml:space"), m_oSpace );
|
||||
|
||||
m_sText = oNode.GetText();
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
@ -793,7 +791,7 @@ namespace OOX
|
||||
|
||||
m_sText = oReader.GetText2();
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
*
|
||||
*/
|
||||
#include "RunProperty.h"
|
||||
#include "RunContent.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
@ -164,7 +165,26 @@ namespace OOX
|
||||
if ( _T("w:b") == sName )
|
||||
m_oBold = oReader;
|
||||
else if ( _T("w:bCs") == sName )
|
||||
m_oBoldCs = oReader;
|
||||
{
|
||||
if (!oReader.IsEmptyNode())
|
||||
{
|
||||
m_oBoldCs.Init();
|
||||
|
||||
int nParentDepth1 = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
|
||||
{
|
||||
std::wstring sName1 = oReader.GetName();
|
||||
|
||||
if ( _T("w:t") == sName1 )
|
||||
{
|
||||
m_pText = new CText( oReader );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
m_oBoldCs = oReader;
|
||||
}
|
||||
else if ( _T("w:bdr") == sName )
|
||||
m_oBdr = oReader;
|
||||
else if ( _T("w:caps") == sName )
|
||||
@ -269,6 +289,159 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CRunProperty::fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
if ( _T("w:rPr") != oNode.GetName() )
|
||||
return;
|
||||
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:b"), oChild ) )
|
||||
m_oBold = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:bCs"), oChild ) )
|
||||
{
|
||||
m_oBoldCs = oChild;
|
||||
|
||||
XmlUtils::CXmlNode oChild1;
|
||||
if (oChild.GetNode(L"w:t", oChild1))
|
||||
{
|
||||
m_pText = new CText(oChild1); //XpertdocOnlineDemoEn.docx
|
||||
}
|
||||
}
|
||||
if ( oNode.GetNode( _T("w:bdr"), oChild ) )
|
||||
m_oBdr = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:caps"), oChild ) )
|
||||
m_oCaps = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:color"), oChild ) )
|
||||
m_oColor = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:cs"), oChild ) )
|
||||
m_oCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:del"), oChild ) )
|
||||
m_oDel = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:dstrike"), oChild ) )
|
||||
m_oDStrike = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:eastAsianLayout"), oChild ) )
|
||||
m_oEastAsianLayout = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:effect"), oChild ) )
|
||||
m_oEffect = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:em"), oChild ) )
|
||||
m_oEm = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:emboss"), oChild ) )
|
||||
m_oEmboss = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:fitText"), oChild ) )
|
||||
m_oFitText = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:highlight"), oChild ) )
|
||||
m_oHighlight = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:ins"), oChild ) )
|
||||
m_oIns = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:i"), oChild ) )
|
||||
m_oItalic = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:iCs"), oChild ) )
|
||||
m_oItalicCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:imprint"), oChild ) )
|
||||
m_oImprint = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:kern"), oChild ) )
|
||||
m_oKern = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:lang"), oChild ) )
|
||||
m_oLang = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:noProof"), oChild ) )
|
||||
m_oNoProof = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("m:oMath"), oChild ) )
|
||||
m_oMath = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:outline"), oChild ) )
|
||||
m_oOutline = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:position"), oChild ) )
|
||||
m_oPosition = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:rFonts"), oChild ) )
|
||||
m_oRFonts = oChild;
|
||||
|
||||
if ( !m_bRPRChange && oNode.GetNode( _T("w:rPrChange"), oChild ) )
|
||||
m_oRPrChange = oChild;
|
||||
|
||||
// В спецификации почему-то написано pStyle, хотя по смыслы, по ссылке в самой
|
||||
// же спецификации и, в конце концов, по алфавиту тут толжно быть rStyle
|
||||
if ( oNode.GetNode( _T("w:rStyle"), oChild ) )
|
||||
m_oRStyle = oChild;
|
||||
|
||||
if ( !m_oRStyle.IsInit() && oNode.GetNode( _T("w:pStyle"), oChild ) )
|
||||
m_oRStyle = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:rtl"), oChild ) )
|
||||
m_oRtL = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:shadow"), oChild ) )
|
||||
m_oShadow = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:shd"), oChild ) )
|
||||
m_oShd = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:smallCaps"), oChild ) )
|
||||
m_oSmallCaps = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:snapToGrid"), oChild ) )
|
||||
m_oSnapToGrid = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:spacing"), oChild ) )
|
||||
m_oSpacing = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:specVanish"), oChild ) )
|
||||
m_oSpecVanish = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:strike"), oChild ) )
|
||||
m_oStrike = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:sz"), oChild ) )
|
||||
m_oSz = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:szCs"), oChild ) )
|
||||
m_oSzCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:u"), oChild ) )
|
||||
m_oU = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:vanish"), oChild ) )
|
||||
m_oVanish = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:vertAlign"), oChild ) )
|
||||
m_oVertAlign = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:w"), oChild ) )
|
||||
m_oW = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:webHidden"), oChild ) )
|
||||
m_oWebHidden = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:moveFrom"), oChild ) )
|
||||
m_oMoveFrom = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:moveTo"), oChild ) )
|
||||
m_oMoveTo = oChild;
|
||||
}
|
||||
|
||||
} // Logic
|
||||
} // ComplexTypes
|
||||
|
||||
|
||||
@ -737,18 +737,22 @@ namespace OOX
|
||||
public:
|
||||
CRunProperty()
|
||||
{
|
||||
m_pText = NULL;
|
||||
m_bRPRChange = false;
|
||||
}
|
||||
virtual ~CRunProperty()
|
||||
{
|
||||
RELEASEOBJECT(m_pText);
|
||||
}
|
||||
CRunProperty(const XmlUtils::CXmlNode &oNode)
|
||||
{
|
||||
m_pText = NULL;
|
||||
m_bRPRChange = false;
|
||||
fromXML( (XmlUtils::CXmlNode &)oNode );
|
||||
}
|
||||
CRunProperty(const XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
m_pText = NULL;
|
||||
m_bRPRChange = false;
|
||||
fromXML( (XmlUtils::CXmlLiteReader&)oReader );
|
||||
}
|
||||
@ -764,152 +768,8 @@ namespace OOX
|
||||
}
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
if ( _T("w:rPr") != oNode.GetName() )
|
||||
return;
|
||||
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:b"), oChild ) )
|
||||
m_oBold = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:bCs"), oChild ) )
|
||||
m_oBoldCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:bdr"), oChild ) )
|
||||
m_oBdr = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:caps"), oChild ) )
|
||||
m_oCaps = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:color"), oChild ) )
|
||||
m_oColor = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:cs"), oChild ) )
|
||||
m_oCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:del"), oChild ) )
|
||||
m_oDel = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:dstrike"), oChild ) )
|
||||
m_oDStrike = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:eastAsianLayout"), oChild ) )
|
||||
m_oEastAsianLayout = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:effect"), oChild ) )
|
||||
m_oEffect = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:em"), oChild ) )
|
||||
m_oEm = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:emboss"), oChild ) )
|
||||
m_oEmboss = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:fitText"), oChild ) )
|
||||
m_oFitText = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:highlight"), oChild ) )
|
||||
m_oHighlight = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:ins"), oChild ) )
|
||||
m_oIns = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:i"), oChild ) )
|
||||
m_oItalic = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:iCs"), oChild ) )
|
||||
m_oItalicCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:imprint"), oChild ) )
|
||||
m_oImprint = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:kern"), oChild ) )
|
||||
m_oKern = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:lang"), oChild ) )
|
||||
m_oLang = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:noProof"), oChild ) )
|
||||
m_oNoProof = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("m:oMath"), oChild ) )
|
||||
m_oMath = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:outline"), oChild ) )
|
||||
m_oOutline = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:position"), oChild ) )
|
||||
m_oPosition = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:rFonts"), oChild ) )
|
||||
m_oRFonts = oChild;
|
||||
|
||||
if ( !m_bRPRChange && oNode.GetNode( _T("w:rPrChange"), oChild ) )
|
||||
m_oRPrChange = oChild;
|
||||
|
||||
// В спецификации почему-то написано pStyle, хотя по смыслы, по ссылке в самой
|
||||
// же спецификации и, в конце концов, по алфавиту тут толжно быть rStyle
|
||||
if ( oNode.GetNode( _T("w:rStyle"), oChild ) )
|
||||
m_oRStyle = oChild;
|
||||
|
||||
if ( !m_oRStyle.IsInit() && oNode.GetNode( _T("w:pStyle"), oChild ) )
|
||||
m_oRStyle = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:rtl"), oChild ) )
|
||||
m_oRtL = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:shadow"), oChild ) )
|
||||
m_oShadow = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:shd"), oChild ) )
|
||||
m_oShd = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:smallCaps"), oChild ) )
|
||||
m_oSmallCaps = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:snapToGrid"), oChild ) )
|
||||
m_oSnapToGrid = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:spacing"), oChild ) )
|
||||
m_oSpacing = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:specVanish"), oChild ) )
|
||||
m_oSpecVanish = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:strike"), oChild ) )
|
||||
m_oStrike = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:sz"), oChild ) )
|
||||
m_oSz = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:szCs"), oChild ) )
|
||||
m_oSzCs = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:u"), oChild ) )
|
||||
m_oU = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:vanish"), oChild ) )
|
||||
m_oVanish = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:vertAlign"), oChild ) )
|
||||
m_oVertAlign = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:w"), oChild ) )
|
||||
m_oW = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:webHidden"), oChild ) )
|
||||
m_oWebHidden = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:moveFrom"), oChild ) )
|
||||
m_oMoveFrom = oChild;
|
||||
|
||||
if ( oNode.GetNode( _T("w:moveTo"), oChild ) )
|
||||
m_oMoveTo = oChild;
|
||||
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:rPr>");
|
||||
@ -1228,9 +1088,6 @@ namespace OOX
|
||||
{
|
||||
return et_w_rPr;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
static const CRunProperty Merge(const CRunProperty& oPrev, const CRunProperty& oCurrent)
|
||||
{
|
||||
CRunProperty oProperties;
|
||||
@ -1292,8 +1149,7 @@ namespace OOX
|
||||
|
||||
return oResult;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
const bool IsSimple() const
|
||||
{
|
||||
if ( m_oBold.IsInit() )
|
||||
@ -1428,9 +1284,6 @@ namespace OOX
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
bool m_bRPRChange; // Является ли данный w:rPr дочерним по отношению к w:rPrChange
|
||||
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oBold;
|
||||
@ -1480,6 +1333,7 @@ namespace OOX
|
||||
PPTX::Logic::UniFill m_oTextFill;
|
||||
nullable<PPTX::Logic::Ln> m_oTextOutline;
|
||||
|
||||
OOX::WritingElement* m_pText; //temp ... for Run object -> XpertdocOnlineDemoEn.docx
|
||||
};
|
||||
|
||||
} // namespace Logic
|
||||
|
||||
@ -54,12 +54,12 @@ namespace ComplexTypes
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:displayText"), m_sDisplayText );
|
||||
oNode.ReadAttributeBase( _T("w:value"), m_sValue );
|
||||
}
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
@ -91,7 +91,6 @@ namespace ComplexTypes
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("w:displayText"), m_sDisplayText )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:value"), m_sValue )
|
||||
@ -118,13 +117,13 @@ namespace ComplexTypes
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:prefixMappings"), m_sPrefixMappings );
|
||||
oNode.ReadAttributeBase( _T("w:storeItemID"), m_sStoreItemID );
|
||||
oNode.ReadAttributeBase( _T("w:xpath"), m_sXPath );
|
||||
}
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
@ -142,13 +141,6 @@ namespace ComplexTypes
|
||||
sResult += _T("\" ");
|
||||
}
|
||||
|
||||
if ( m_sStoreItemID.IsInit() )
|
||||
{
|
||||
sResult += _T("w:storeItemID=\"");
|
||||
sResult += m_sStoreItemID.get2();
|
||||
sResult += _T("\" ");
|
||||
}
|
||||
|
||||
if ( m_sXPath.IsInit() )
|
||||
{
|
||||
sResult += _T("w:xpath=\"");
|
||||
@ -156,13 +148,18 @@ namespace ComplexTypes
|
||||
sResult += _T("\" ");
|
||||
}
|
||||
|
||||
if ( m_sStoreItemID.IsInit() )
|
||||
{
|
||||
sResult += _T("w:storeItemID=\"");
|
||||
sResult += m_sStoreItemID.get2();
|
||||
sResult += _T("\" ");
|
||||
}
|
||||
return sResult;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("w:prefixMappings"), m_sPrefixMappings )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:storeItemID"), m_sStoreItemID )
|
||||
@ -191,11 +188,11 @@ namespace ComplexTypes
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:val"), m_oVal );
|
||||
}
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
@ -236,11 +233,11 @@ namespace ComplexTypes
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:val"), m_oVal );
|
||||
}
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
@ -256,7 +253,6 @@ namespace ComplexTypes
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:val"), m_oVal )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
@ -281,11 +277,11 @@ namespace ComplexTypes
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:val"), m_oVal );
|
||||
}
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
@ -302,7 +298,6 @@ namespace ComplexTypes
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:val"), m_oVal )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
@ -327,11 +322,11 @@ namespace ComplexTypes
|
||||
{
|
||||
}
|
||||
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:multiLine"), m_oMultiLine );
|
||||
}
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
@ -352,7 +347,6 @@ namespace ComplexTypes
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:multiLine"), m_oMultiLine )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
@ -382,7 +376,7 @@ namespace OOX
|
||||
}
|
||||
virtual ~CSdtComboBox()
|
||||
{
|
||||
for ( unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
for ( size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
{
|
||||
if ( m_arrListItem[nIndex] )
|
||||
delete m_arrListItem[nIndex];
|
||||
@ -395,7 +389,7 @@ namespace OOX
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:lastValue"), m_sLastValue );
|
||||
|
||||
@ -414,7 +408,7 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
@ -432,7 +426,7 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
@ -445,7 +439,7 @@ namespace OOX
|
||||
else
|
||||
sResult = _T("<w:comboBox>");
|
||||
|
||||
for (unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
for (size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
{
|
||||
sResult += _T("<w:listItem ");
|
||||
if (m_arrListItem[nIndex])
|
||||
@ -467,7 +461,6 @@ namespace OOX
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:lastValue"), m_sLastValue )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
@ -498,7 +491,7 @@ namespace OOX
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:fullDate"), m_oFullDate );
|
||||
|
||||
@ -510,7 +503,7 @@ namespace OOX
|
||||
WritingElement_ReadNode( oNode, oChild, _T("w:storeMappedDateAs"), m_oStoreMappedDateAs );
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
@ -531,7 +524,7 @@ namespace OOX
|
||||
m_oStoreMappedDateAs = oReader;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
@ -562,7 +555,6 @@ namespace OOX
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:fullDate"), m_oFullDate )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
@ -596,7 +588,7 @@ namespace OOX
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
@ -605,7 +597,7 @@ namespace OOX
|
||||
WritingElement_ReadNode( oNode, oChild, _T("w:docPartUnique"), m_oDocPartUnique );
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
@ -622,7 +614,7 @@ namespace OOX
|
||||
m_oDocPartUnique = oReader;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:docPartList>");
|
||||
|
||||
@ -634,7 +626,7 @@ namespace OOX
|
||||
|
||||
return sResult;
|
||||
}
|
||||
std::wstring toXML2(const std::wstring& sName) const
|
||||
std::wstring toXML2(const std::wstring& sName) const
|
||||
{
|
||||
std::wstring sResult = L"<" + sName + L">";
|
||||
|
||||
@ -670,7 +662,7 @@ namespace OOX
|
||||
}
|
||||
virtual ~CSdtDropDownList()
|
||||
{
|
||||
for ( unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
for ( size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
{
|
||||
if ( m_arrListItem[nIndex] )
|
||||
delete m_arrListItem[nIndex];
|
||||
@ -681,9 +673,7 @@ namespace OOX
|
||||
m_arrListItem.clear();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
oNode.ReadAttributeBase( _T("w:lastValue"), m_sLastValue );
|
||||
|
||||
@ -702,7 +692,7 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
@ -720,7 +710,7 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
@ -733,7 +723,7 @@ namespace OOX
|
||||
else
|
||||
sResult = _T("<w:dropDownList>");
|
||||
|
||||
for (unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
for (size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
|
||||
{
|
||||
sResult += _T("<w:listItem ");
|
||||
if (m_arrListItem[nIndex])
|
||||
@ -754,7 +744,6 @@ namespace OOX
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
// Читаем атрибуты
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:lastValue"), m_sLastValue )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
@ -782,16 +771,14 @@ namespace OOX
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
WritingElement_ReadNode( oNode, oChild, _T("w:docPart"), m_oDocPart );
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
@ -804,7 +791,7 @@ namespace OOX
|
||||
m_oDocPart = oReader;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:placeholder>");
|
||||
|
||||
@ -841,7 +828,7 @@ namespace OOX
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
@ -849,7 +836,7 @@ namespace OOX
|
||||
m_oRPr = oChild;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
@ -862,7 +849,7 @@ namespace OOX
|
||||
m_oRPr = oReader;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:sdtEndPr>");
|
||||
|
||||
@ -917,7 +904,7 @@ namespace OOX
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
m_eType = sdttypeUnknown;
|
||||
|
||||
@ -932,7 +919,7 @@ namespace OOX
|
||||
if ( sdttypeUnknown == m_eType && oNode.GetNode( _T("w:citation"), oChild ) )
|
||||
m_eType = sdttypeCitation;
|
||||
|
||||
if ( sdttypeUnknown == m_eType && oNode.GetNode( _T("w:alias"), oChild ) )
|
||||
if ( sdttypeUnknown == m_eType && oNode.GetNode( _T("w:comboBox"), oChild ) )
|
||||
{
|
||||
m_oComboBox = oChild;
|
||||
m_eType = sdttypeComboBox;
|
||||
@ -1011,7 +998,7 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
m_eType = sdttypeUnknown;
|
||||
|
||||
@ -1089,21 +1076,21 @@ namespace OOX
|
||||
}
|
||||
}
|
||||
}
|
||||
std::wstring toXMLStart() const
|
||||
std::wstring toXMLStart() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:sdtPr>");
|
||||
|
||||
WritingElement_WriteNode_2( m_oRPr );
|
||||
WritingElement_WriteNode_1( _T("<w:alias "), m_oAlias );
|
||||
WritingElement_WriteNode_1( _T("<w:label "), m_oLabel );
|
||||
WritingElement_WriteNode_1( _T("<w:tabIndex "), m_oTabIndex );
|
||||
WritingElement_WriteNode_1( _T("<w:lock "), m_oLock );
|
||||
WritingElement_WriteNode_1( L"<w:alias ", m_oAlias );
|
||||
WritingElement_WriteNode_1( L"<w:id ", m_oId );
|
||||
WritingElement_WriteNode_1( L"<w:label ", m_oLabel );
|
||||
WritingElement_WriteNode_1( L"<w:tabIndex ", m_oTabIndex );
|
||||
WritingElement_WriteNode_1( L"<w:lock ", m_oLock );
|
||||
WritingElement_WriteNode_2( m_oPlaceHolder );
|
||||
WritingElement_WriteNode_1( _T("<w:showingPlcHdr "), m_oShowingPlcHdr );
|
||||
WritingElement_WriteNode_1( _T("<w:dataBinding "), m_oDataBinding );
|
||||
WritingElement_WriteNode_1( _T("<w:temporary "), m_oTemporary );
|
||||
WritingElement_WriteNode_1( _T("<w:id "), m_oId );
|
||||
WritingElement_WriteNode_1( _T("<w:tag "), m_oTag );
|
||||
WritingElement_WriteNode_1( L"<w:showingPlcHdr ", m_oShowingPlcHdr );
|
||||
WritingElement_WriteNode_1( L"<w:dataBinding ", m_oDataBinding );
|
||||
WritingElement_WriteNode_1( L"<w:temporary ", m_oTemporary );
|
||||
WritingElement_WriteNode_1( L"<w:tag ", m_oTag );
|
||||
|
||||
switch(m_eType)
|
||||
{
|
||||
@ -1186,12 +1173,12 @@ namespace OOX
|
||||
|
||||
return sResult;
|
||||
}
|
||||
std::wstring toXMLEnd() const
|
||||
std::wstring toXMLEnd() const
|
||||
{
|
||||
return _T("</w:sdtPr>");
|
||||
}
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
return toXMLStart() + toXMLEnd();
|
||||
}
|
||||
@ -1233,8 +1220,8 @@ namespace OOX
|
||||
{
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
virtual std::wstring toXML() const;
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
@ -1261,7 +1248,7 @@ namespace OOX
|
||||
|
||||
public:
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
virtual void fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
@ -1275,7 +1262,7 @@ namespace OOX
|
||||
m_oSdtPr = oChild;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
@ -1292,7 +1279,7 @@ namespace OOX
|
||||
m_oSdtPr = oReader;
|
||||
}
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:sdt>");
|
||||
|
||||
|
||||
@ -45,6 +45,8 @@
|
||||
|
||||
#include "../../../../DesktopEditor/common/File.h"
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Rels
|
||||
@ -313,7 +315,7 @@ namespace OOX
|
||||
{
|
||||
(*ppRelationShip) = NULL;
|
||||
|
||||
std::map<std::wstring, Rels::CRelationShip*>::iterator pFind = m_mapRelations.find(rId.get());
|
||||
boost::unordered_map<std::wstring, Rels::CRelationShip*>::iterator pFind = m_mapRelations.find(rId.get());
|
||||
if (pFind != m_mapRelations.end())
|
||||
{
|
||||
(*ppRelationShip) = pFind->second;
|
||||
@ -336,7 +338,7 @@ namespace OOX
|
||||
public:
|
||||
|
||||
std::vector<Rels::CRelationShip*> m_arRelations;
|
||||
std::map<std::wstring, Rels::CRelationShip*> m_mapRelations;
|
||||
boost::unordered_map<std::wstring, Rels::CRelationShip*> m_mapRelations;
|
||||
};
|
||||
|
||||
} // namespace OOX
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
|
||||
#include "../Base/Base.h"
|
||||
#include "../Base/SmartPtr.h"
|
||||
#include "../Base/Types_32.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
@ -77,9 +78,9 @@ namespace XmlUtils
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
AVSINLINE static __int64 GetHex (const std::wstring& string)
|
||||
AVSINLINE static _INT64 GetHex (const std::wstring& string)
|
||||
{
|
||||
__int64 nResult = 0;
|
||||
_INT64 nResult = 0;
|
||||
size_t nLen = string.length();
|
||||
for (size_t nIndex = 0; nIndex < nLen; ++nIndex )
|
||||
{
|
||||
@ -88,9 +89,9 @@ namespace XmlUtils
|
||||
|
||||
return nResult;
|
||||
}
|
||||
AVSINLINE static __int64 GetHex (const std::string& string)
|
||||
AVSINLINE static _INT64 GetHex (const std::string& string)
|
||||
{
|
||||
__int64 nResult = 0;
|
||||
_INT64 nResult = 0;
|
||||
size_t nLen = string.length();
|
||||
for (size_t nIndex = 0; nIndex < nLen; ++nIndex )
|
||||
{
|
||||
@ -169,7 +170,20 @@ namespace XmlUtils
|
||||
|
||||
return ( L"true" == sTemp || L"1" == sTemp || L"t" == sTemp || L"on" == sTemp );
|
||||
}
|
||||
AVSINLINE static int GetInteger (const std::wstring& string)
|
||||
AVSINLINE static _INT64 GetInteger64 (const std::wstring& string)
|
||||
{
|
||||
if (string.empty()) return 0;
|
||||
|
||||
try
|
||||
{
|
||||
return _wtoi64(string.c_str());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
AVSINLINE static int GetInteger (const std::wstring& string)
|
||||
{
|
||||
if (string.empty()) return 0;
|
||||
|
||||
|
||||
@ -52,7 +52,8 @@ namespace OOX
|
||||
m_bSpreadsheets = true;
|
||||
|
||||
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
|
||||
if (xlsx) xlsx->m_pSharedStrings = this;
|
||||
if ((xlsx) && (!xlsx->m_pSharedStrings))
|
||||
xlsx->m_pSharedStrings = this;
|
||||
}
|
||||
CSharedStrings(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::File(pMain), OOX::IFileContainer(pMain)
|
||||
{
|
||||
@ -60,7 +61,8 @@ namespace OOX
|
||||
m_bSpreadsheets = true;
|
||||
|
||||
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
|
||||
if (xlsx) xlsx->m_pSharedStrings = this;
|
||||
if ((xlsx) && (!xlsx->m_pSharedStrings))
|
||||
xlsx->m_pSharedStrings = this;
|
||||
|
||||
read( oRootPath, oPath );
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ namespace OOX
|
||||
m_bSpreadsheets = true;
|
||||
|
||||
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
|
||||
if (xlsx)
|
||||
if ((xlsx) && (!xlsx->m_pWorkbook))
|
||||
{
|
||||
xlsx->m_pWorkbook = this;
|
||||
}
|
||||
@ -82,7 +82,7 @@ namespace OOX
|
||||
m_bSpreadsheets = true;
|
||||
|
||||
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
|
||||
if (xlsx)
|
||||
if ((xlsx) && (!xlsx->m_pWorkbook))
|
||||
{
|
||||
xlsx->m_pWorkbook = this;
|
||||
}
|
||||
|
||||
@ -118,8 +118,11 @@ bool OOX::Spreadsheet::CXlsx::Write(const CPath& oDirPath, OOX::CContentTypes &o
|
||||
//CApp
|
||||
OOX::CApp* pApp = new OOX::CApp(this);
|
||||
|
||||
pApp->SetApplication(_T("OnlyOffice"));
|
||||
pApp->SetAppVersion(_T("5.0"));
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
@ -455,4 +458,4 @@ void OOX::Spreadsheet::CXlsx::PrepareWorksheet(CWorksheet* pWorksheet)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
VERSION = 2.4.511.0
|
||||
DEFINES += INTVER=$$VERSION
|
||||
|
||||
# CONFIGURATION
|
||||
CONFIG(debug, debug|release) {
|
||||
CONFIG += core_debug
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user