Compare commits

..

1 Commits

Author SHA1 Message Date
564b7f9c29 v5.2.8 2019-02-05 16:23:16 +03:00
1266 changed files with 64283 additions and 108038 deletions

3
.gitignore vendored
View File

@ -3,8 +3,6 @@ dictionaries/
LicenceManager/
Common/boost_1_58_0
Common/3dParty/boost/boost_1_58_0
Common/3dParty/boost/ios
Common/3dParty/boost/osx
Common/3dParty/icu/win_64
Common/3dParty/icu/win_32
Common/3dParty/icu/linux_64
@ -64,4 +62,3 @@ X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
*.tar.gz
**/*.build/
*.log

View File

@ -52,7 +52,6 @@
#include <string.h>
#endif
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
#include "../../DesktopEditor/common/Types.h"
#include "../../Common/DocxFormat/Source/Base/unicode_util.h"
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
@ -769,20 +768,12 @@ namespace DocFileFormat
return bytes;
}
#ifndef _WIN32
static inline std::wstring IntToWideString(unsigned int value)
{
return (std::to_wstring(value));
}
#endif
static inline std::wstring IntToWideString(int value)
{
return (std::to_wstring(value));
}
static inline std::wstring IntToWideString(size_t value)
{
return (std::to_wstring((unsigned int)value));
}
static inline std::wstring DoubleToWideString(double value)
{
std::wstringstream src;

View File

@ -87,14 +87,15 @@ namespace DocFileFormat
}
else
{
m_nDTTM = DateAndTime(reader->ReadUInt32());
m_nDTTM = reader->ReadUInt32();
reader->ReadUInt16(); //padding1
m_nDepth = reader->ReadUInt32();
m_nDiatrdParent = reader->ReadUInt32();
unsigned int flag = reader->ReadUInt32();
m_fInkAtn = GETBIT(flag, 1);
}
return static_cast<ByteStructure*>(newObject);
}
}

View File

@ -32,7 +32,6 @@
#pragma once
#include "ByteStructure.h"
#include "DateAndTime.h"
namespace DocFileFormat
{
@ -73,7 +72,7 @@ namespace DocFileFormat
return (nWordVersion > 0) ? STRUCTURE_SIZE_OLD : STRUCTURE_SIZE;
}
AnnotationReferenceExDescriptor() : m_nDepth(0), m_nDiatrdParent(0), m_fInkAtn(false)
AnnotationReferenceExDescriptor() : m_nDTTM(0), m_nDepth(0), m_nDiatrdParent(0), m_fInkAtn(false)
{
}
@ -83,7 +82,7 @@ namespace DocFileFormat
virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length );
DateAndTime m_nDTTM;
unsigned int m_nDTTM;
unsigned int m_nDepth;
unsigned int m_nDiatrdParent;
bool m_fInkAtn;

View File

@ -85,11 +85,9 @@ namespace DocFileFormat
if (author_str)
{
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
rPrChange.AppendAttribute( author );
}
XMLTools::XMLAttribute date( L"w:date", _revisionData->Dttm.getString());
rPrChange.AppendAttribute( date );
//convert revision stack
convertSprms( _revisionData->Changes, &rPrChange );

View File

@ -85,14 +85,10 @@ namespace DocFileFormat
for (size_t index = 0; index < count; ++index)
{
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
AnnotationReferenceExDescriptor* atrdPost10 = NULL;
if ((m_document->AnnotationsReferenceExPlex) && (index < m_document->AnnotationsReferenceExPlex->Elements.size()))
{
atrdPost10 = static_cast<AnnotationReferenceExDescriptor*>(m_document->AnnotationsReferenceExPlex->Elements[index]);
}
AnnotationReferenceExDescriptor* atrdPost10 = m_document->AnnotationsReferenceExPlex ? static_cast<AnnotationReferenceExDescriptor*>(m_document->AnnotationsReferenceExPlex->Elements[index]) : NULL;
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
if (atrdPre10->m_BookmarkId < 0)//-1 - easy ref (not start/end comment ref)
if (atrdPre10->m_BookmarkId < 0)
{
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index + 1 + count + 1024 ));
}
@ -102,14 +98,21 @@ namespace DocFileFormat
}
if (atrdPost10)
{
m_pXmlWriter->WriteAttribute( L"w:date", atrdPost10->m_nDTTM.getString());
//!!!TODO!!!
/*//ATRDpost10 is optional and not saved in all files
if (doc.AnnotationReferenceExtraTable != null &&
doc.AnnotationReferenceExtraTable.Count > index)
{
AnnotationReferenceDescriptorExtra atrdPost10 = doc.AnnotationReferenceExtraTable[index];
atrdPost10.Date.Convert(new DateMapping(_writer));
}*/
}
if (atrdPre10->m_AuthorIndex < m_document->AnnotationOwners->size()) //conv_253l2H1CehgKwsxCtNk__docx.doc
{
m_pXmlWriter->WriteAttribute( L"w:author",
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->m_AuthorIndex ) ));
}
m_pXmlWriter->WriteAttribute( L"w:initials", FormatUtils::XmlEncode(atrdPre10->m_UserInitials));
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->m_UserInitials);

View File

@ -83,14 +83,6 @@ namespace DocFileFormat
//throw new ByteParseException("Cannot parse the struct DTTM, the length of the struct doesn't match");
}
}
std::wstring getString()
{
return std::to_wstring(yr) + L"-" + (mon < 9 ? L"0" : L"" ) + std::to_wstring(mon) + L"-" +
(dom < 9 ? L"0" : L"" ) + std::to_wstring(dom) + L"T" +
(hr < 9 ? L"0" : L"" ) + std::to_wstring(hr) + L":" +
(mint < 9 ? L"0" : L"" )+ std::to_wstring(mint) + L"Z";
}
#if defined(_WIN32) || defined(_WIN64)
SYSTEMTIME ToSYSTEMTIME()
{

View File

@ -406,8 +406,8 @@ namespace DocFileFormat
//if it's a inserted run
m_pXmlWriter->WriteNodeBegin(L"w:ins", true);
m_pXmlWriter->WriteAttribute(L"w:author", FormatUtils::XmlEncode(*author));
m_pXmlWriter->WriteAttribute(L"w:date", FormatUtils::XmlEncode(rev.Dttm.getString()));
m_pXmlWriter->WriteNodeEnd(L"", true, false);
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
}
//start run
@ -716,7 +716,7 @@ namespace DocFileFormat
RELEASEOBJECT( chpxs );
}
}
oleWriter.WriteString( _lastOLEObject ); _lastOLEObject.clear();
oleWriter.WriteString( _lastOLEObject );
oleWriter.WriteNodeEnd( L"w:object" );
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
@ -912,7 +912,6 @@ namespace DocFileFormat
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlexHeader->GetStruct(headerCp));
}
bool bPicture = false;
if (pSpa)
{
PictureDescriptor pictDiscr(chpx, m_document->WordDocumentStream, 0x7fffffff, m_document->nWordVersion);
@ -926,8 +925,6 @@ namespace DocFileFormat
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:pict");
bPicture = true;
}
if (!pSpa->primitives.empty())
@ -936,13 +933,8 @@ namespace DocFileFormat
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
pSpa->primitives.Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:pict");
bPicture = true;
}
}
if ((false == _fieldLevels.empty()) && (_fieldLevels.back().bSeparate))
_fieldLevels.back().bResult = bPicture;
}
else if (TextMark::Picture == code && fSpec)
{
@ -1000,11 +992,6 @@ namespace DocFileFormat
_writeAfterRun = oVmlMapper.m_equationXml;
bFormula = true;
}
else if (oVmlMapper.m_isBlob)
{
_writeAfterRun = oVmlMapper.m_blobXml;
bFormula = true;
}
}
else
{
@ -1012,23 +999,10 @@ namespace DocFileFormat
oPicture.shapeContainer->Convert(&oVmlMapper);
}
pictWriter.WriteNodeEnd (L"w:pict");
pictWriter.WriteNodeEnd (L"w:pict");
if (!bFormula)
{
if (false == _fieldLevels.empty())
{
if (_fieldLevels.back().bSeparate && !_fieldLevels.back().bResult) //ege15.doc
{
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
_fieldLevels.back().bResult = true;
}
}
else
{
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
}
}
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
}
}
@ -1079,15 +1053,7 @@ namespace DocFileFormat
else if ((m_document->AnnotationsReferencePlex) && (_commentNr <= m_document->AnnotationsReferencePlex->Elements.size()))
{
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
int index = _commentNr++;
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index - 1]);
if (atrdPre10->m_BookmarkId < 0)
index += m_document->AnnotationsReferencePlex->Elements.size() + 1024;
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(index));
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr++ ));
m_pXmlWriter->WriteNodeEnd( L"", true );
}
}
@ -1800,7 +1766,7 @@ namespace DocFileFormat
if (m_document->AnnotStartEndCPs[i].second == cp)
{
result = writeAnnotationEnd(i + 1);
//_commentNr = i + 1;
_commentNr = i + 1;
}
}

View File

@ -161,7 +161,6 @@ namespace DocFileFormat
{
bool bBegin = false;
bool bSeparate = false;
bool bResult = false;
//bool bInstrText = false;
bool bEnd = false;
};

View File

@ -31,6 +31,7 @@
*/
#include "MainDocumentMapping.h"
#include "OfficeDrawing/FillStyleBooleanProperties.h"
namespace DocFileFormat
{
@ -87,11 +88,10 @@ namespace DocFileFormat
m_document->DocProperties->bDisplayBackgroundShape = true;
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
ODRAW::OfficeArtFOPTEPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
OptionEntryPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
ODRAW::FillStyleBooleanProperties* booleans = dynamic_cast<ODRAW::FillStyleBooleanProperties*>(boolFill.get());
if (booleans && (booleans->fUsefFilled && !booleans->fFilled))
FillStyleBooleanProperties booleans(boolFill ? boolFill->op : 0);
if (booleans.fUsefFilled && !booleans.fFilled)
{
bFilled = false;
}

View File

@ -217,7 +217,7 @@ public:
private:
unsigned char* m_Data;
unsigned char* m_Data;
unsigned long m_Size;
unsigned long m_Position;
bool bMemoryCopy;

View File

@ -89,7 +89,7 @@ namespace DocFileFormat
GroupContainer* group = static_cast<GroupContainer*>(groupChild);
if (group)
{
group->Index = (int)i;
group->Index = i;
}
}
else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode)

View File

@ -0,0 +1,80 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
// 2.3.7.43 Fill Style Boolean Properties - [MS-ODRAW] — v20130726
class FillStyleBooleanProperties
{
public:
FillStyleBooleanProperties(unsigned int op)
{
fNoFillHitTest = FormatUtils::BitmaskToBool(op, 0x1);
fillUseRect = FormatUtils::BitmaskToBool(op, 0x1 << 1);
fillShape = FormatUtils::BitmaskToBool(op, 0x1 << 2);
fHitTestFill = FormatUtils::BitmaskToBool(op, 0x1 << 3);
fFilled = FormatUtils::BitmaskToBool(op, 0x1 << 4);
fUseShapeAnchor = FormatUtils::BitmaskToBool(op, 0x1 << 5);
fRecolorFillAsPicture = FormatUtils::BitmaskToBool(op, 0x1 << 6);
// 0x1 << 7-15 is ununsed
fUsefNoFillHitTest = FormatUtils::BitmaskToBool(op, 0x1 << 16);
fUsefillUseRect = FormatUtils::BitmaskToBool(op, 0x1 << 17);
fUsefillShape = FormatUtils::BitmaskToBool(op, 0x1 << 18);
fUseHitTestFill = FormatUtils::BitmaskToBool(op, 0x1 << 19);
fUsefFilled = FormatUtils::BitmaskToBool(op, 0x1 << 20);
fUsefUseShapeAnchor = FormatUtils::BitmaskToBool(op, 0x1 << 21);
fUsefRecolorFillAsPicture = FormatUtils::BitmaskToBool(op, 0x1 << 22);
}
public:
bool fNoFillHitTest;
bool fillUseRect;
bool fillShape;
bool fHitTestFill;
bool fFilled;
bool fUseShapeAnchor;
bool fRecolorFillAsPicture;
bool fUsefNoFillHitTest;
bool fUsefillUseRect;
bool fUsefillShape;
bool fUseHitTestFill;
bool fUsefFilled;
bool fUsefUseShapeAnchor;
bool fUsefRecolorFillAsPicture;
};
}

View File

@ -1,39 +1,72 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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 "../Source/XlsxFormat/Chart/ChartSerialize.cpp"
#include "../Source/XlsxFormat/Common.cpp"
#include "../Source/XlsxFormat/FileFactory_Spreadsheet.cpp"
#include "../Source/XlsxFormat/Xlsx.cpp"
#include "../Source/XlsxFormat/Worksheets/SheetData.cpp"
#include "../Source/XlsxFormat/Worksheets/Worksheet.cpp"
#include "../Source/XlsxFormat/Worksheets/ConditionalFormatting.cpp"
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
// 2.3.6.31 Geometry Boolean Properties - [MS-ODRAW] — v20130726
class GeometryBooleanProperties
{
public:
GeometryBooleanProperties(unsigned int op)
{
fUsefShadowOK = GETBIT(op, 8);
fUsef3DOK = GETBIT(op, 9);
fUsefLineOK = GETBIT(op, 10);
fUsefGtextOK = GETBIT(op, 11);
fUsefFillShadeShapeOK = GETBIT(op, 12);
fUsefFillOK = GETBIT(op, 13);
fShadowOK = GETBIT(op, 22);
f3DOK = GETBIT(op, 23);
fLineOK = GETBIT(op, 24);
fGtextOK = GETBIT(op, 25);
fFillShadeShapeOK = GETBIT(op, 26);
fFillOK = GETBIT(op, 27);
}
bool fFillOK;
bool fFillShadeShapeOK;
bool fGtextOK;
bool fLineOK;
bool f3DOK;
bool fShadowOK;
bool fUsefFillOK;
bool fUsefFillShadeShapeOK;
bool fUsefGtextOK;
bool fUsefLineOK;
bool fUsef3DOK;
bool fUsefShadowOK;
};
}

View File

@ -0,0 +1,114 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
// 2.3.6.31 Geometry Boolean Properties - [MS-ODRAW] — v20130726
class GeometryTextBooleanProperties
{
public:
GeometryTextBooleanProperties(unsigned int op)
{
gtextFStrikethrough = FormatUtils::BitmaskToBool(op, 0x1);
gtextFSmallcaps = FormatUtils::BitmaskToBool(op, 0x1 << 1);
gtextFShadow = FormatUtils::BitmaskToBool(op, 0x1 << 2);
gtextFUnderline = FormatUtils::BitmaskToBool(op, 0x1 << 3);
gtextFItalic = FormatUtils::BitmaskToBool(op, 0x1 << 4);
gtextFBold = FormatUtils::BitmaskToBool(op, 0x1 << 5);
gtextFDxMeasure = FormatUtils::BitmaskToBool(op, 0x1 << 6);
gtextFNormalize = FormatUtils::BitmaskToBool(op, 0x1 << 7);
gtextFBestFit = FormatUtils::BitmaskToBool(op, 0x1 << 8);
gtextFShrinkFit = FormatUtils::BitmaskToBool(op, 0x1 << 9);
gtextFStretch = FormatUtils::BitmaskToBool(op, 0x1 << 10);
gtextFTight = FormatUtils::BitmaskToBool(op, 0x1 << 11);
gtextFKern = FormatUtils::BitmaskToBool(op, 0x1 << 12);
gtextFVertical = FormatUtils::BitmaskToBool(op, 0x1 << 13);
fGtext = FormatUtils::BitmaskToBool(op, 0x1 << 14);
gtextFReverseRows = FormatUtils::BitmaskToBool(op, 0x1 << 15);
fUsegtextFSStrikeThrough = FormatUtils::BitmaskToBool(op, 0x1 << 16);
fUsegtextFSmallcaps = FormatUtils::BitmaskToBool(op, 0x1 << 17);
fUsegtextFShadow = FormatUtils::BitmaskToBool(op, 0x1 << 18);
fUsegtextFUnderline = FormatUtils::BitmaskToBool(op, 0x1 << 19);
fUsegtextFItalic = FormatUtils::BitmaskToBool(op, 0x1 << 20);
fUsegtextFBold = FormatUtils::BitmaskToBool(op, 0x1 << 21);
fUsegtextFDxMeasure = FormatUtils::BitmaskToBool(op, 0x1 << 22);
fUsegtextFNormalize = FormatUtils::BitmaskToBool(op, 0x1 << 23);
fUsegtextFBestFit = FormatUtils::BitmaskToBool(op, 0x1 << 24);
fUsegtextFShrinkFit = FormatUtils::BitmaskToBool(op, 0x1 << 25);
fUsegtextFStretch = FormatUtils::BitmaskToBool(op, 0x1 << 26);
fUsegtextFTight = FormatUtils::BitmaskToBool(op, 0x1 << 27);
fUsegtextFKern = FormatUtils::BitmaskToBool(op, 0x1 << 28);
fUsegtextFVertical = FormatUtils::BitmaskToBool(op, 0x1 << 29);
fUsefGtext = FormatUtils::BitmaskToBool(op, 0x1 << 30);
fUsegtextFReverseRows = FormatUtils::BitmaskToBool(op, 0x40000000);
}
public:
bool gtextFStrikethrough;
bool gtextFSmallcaps;
bool gtextFShadow;
bool gtextFUnderline;
bool gtextFItalic;
bool gtextFBold;
bool gtextFDxMeasure;
bool gtextFNormalize;
bool gtextFBestFit;
bool gtextFShrinkFit;
bool gtextFStretch;
bool gtextFTight;
bool gtextFKern;
bool gtextFVertical;
bool fGtext;
bool gtextFReverseRows;
bool fUsegtextFSStrikeThrough;
bool fUsegtextFSmallcaps;
bool fUsegtextFShadow;
bool fUsegtextFUnderline;
bool fUsegtextFItalic;
bool fUsegtextFBold;
bool fUsegtextFDxMeasure;
bool fUsegtextFNormalize;
bool fUsegtextFBestFit;
bool fUsegtextFShrinkFit;
bool fUsegtextFStretch;
bool fUsegtextFTight;
bool fUsegtextFKern;
bool fUsegtextFVertical;
bool fUsefGtext;
bool fUsegtextFReverseRows;
};
}

View File

@ -0,0 +1,126 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
// 2.3.4.44 Group Shape Boolean Properties - [MS-ODRAW] — v20130726
class GroupShapeBooleanProperties
{
public:
GroupShapeBooleanProperties(unsigned int op)
{
fPrint = FormatUtils::BitmaskToBool(op, 0x1);
fHidden = FormatUtils::BitmaskToBool(op, 0x2);
fOneD = FormatUtils::BitmaskToBool(op, 0x4);
fIsButton = FormatUtils::BitmaskToBool(op, 0x8);
fOnDblClickNotify = FormatUtils::BitmaskToBool(op, 0x10);
fBehindDocument = FormatUtils::BitmaskToBool(op, 0x20);
fEditedWrap = FormatUtils::BitmaskToBool(op, 0x40);
fScriptAnchor = FormatUtils::BitmaskToBool(op, 0x80);
fReallyHidden = FormatUtils::BitmaskToBool(op, 0x100);
fAllowOverlap = FormatUtils::BitmaskToBool(op, 0x200);
fUserDrawn = FormatUtils::BitmaskToBool(op, 0x400);
fHorizRule = FormatUtils::BitmaskToBool(op, 0x800);
fNoshadeHR = FormatUtils::BitmaskToBool(op, 0x1000);
fStandardHR = FormatUtils::BitmaskToBool(op, 0x2000);
fIsBullet = FormatUtils::BitmaskToBool(op, 0x4000);
fLayoutInCell = FormatUtils::BitmaskToBool(op, 0x8000);
fUsefPrint = FormatUtils::BitmaskToBool(op, 0x10000);
fUsefHidden = FormatUtils::BitmaskToBool(op, 0x20000);
fUsefOneD = FormatUtils::BitmaskToBool(op, 0x40000);
fUsefIsButton = FormatUtils::BitmaskToBool(op, 0x80000);
fUsefOnDblClickNotify = FormatUtils::BitmaskToBool(op, 0x100000);
fUsefBehindDocument = FormatUtils::BitmaskToBool(op, 0x200000);
fUsefEditedWrap = FormatUtils::BitmaskToBool(op, 0x400000);
fUsefScriptAnchor = FormatUtils::BitmaskToBool(op, 0x800000);
fUsefReallyHidden = FormatUtils::BitmaskToBool(op, 0x1000000);
fUsefAllowOverlap = FormatUtils::BitmaskToBool(op, 0x2000000);
fUsefUserDrawn = FormatUtils::BitmaskToBool(op, 0x4000000);
fUsefHorizRule = FormatUtils::BitmaskToBool(op, 0x8000000);
fUsefNoshadeHR = FormatUtils::BitmaskToBool(op, 0x10000000);
fUsefStandardHR = FormatUtils::BitmaskToBool(op, 0x20000000);
fUsefIsBullet = FormatUtils::BitmaskToBool(op, 0x40000000);
fUsefLayoutInCell = FormatUtils::BitmaskToBool(op, 0x80000000);
}
public:
bool fPrint;
bool fHidden;
bool fOneD;
bool fIsButton;
bool fOnDblClickNotify;
bool fBehindDocument;
bool fEditedWrap;
bool fScriptAnchor;
bool fReallyHidden;
bool fAllowOverlap;
bool fUserDrawn;
bool fHorizRule;
bool fNoshadeHR;
bool fStandardHR;
bool fIsBullet;
bool fLayoutInCell;
bool fUsefPrint;
bool fUsefHidden;
bool fUsefOneD;
bool fUsefIsButton;
bool fUsefOnDblClickNotify;
bool fUsefBehindDocument;
bool fUsefEditedWrap;
bool fUsefScriptAnchor;
bool fUsefReallyHidden;
bool fUsefAllowOverlap;
bool fUsefUserDrawn;
bool fUsefHorizRule;
bool fUsefNoshadeHR;
bool fUsefStandardHR;
bool fUsefIsBullet;
bool fUsefLayoutInCell;
};
}

View File

@ -0,0 +1,91 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
// 2.3.8.38 Line Style Boolean Properties - [MS-ODRAW] — v20130726
class LineStyleBooleanProperties
{
public:
LineStyleBooleanProperties(unsigned int op)
{
fNoLineDrawDash = FormatUtils::BitmaskToBool(op, 0x1);
fLineFillShape = FormatUtils::BitmaskToBool(op, 0x2);
fHitTestLine = FormatUtils::BitmaskToBool(op, 0x4);
fLine = FormatUtils::BitmaskToBool(op, 0x8);
fArrowheadsOK = FormatUtils::BitmaskToBool(op, 0x10);
fInsetPenOK = FormatUtils::BitmaskToBool(op, 0x20);
fInsetPen = FormatUtils::BitmaskToBool(op, 0x40);
//Reserved 0x80 0x100
fLineOpaqueBackColor = FormatUtils::BitmaskToBool(op, 0x200);
//Unused 0x400 0x800 0x1000 0x2000 0x4000 0x8000
fUsefNoLineDrawDash = FormatUtils::BitmaskToBool(op, 0x10000);
fUsefLineFillShape = FormatUtils::BitmaskToBool(op, 0x20000);
fUsefHitTestLine = FormatUtils::BitmaskToBool(op, 0x40000);
fUsefLine = FormatUtils::BitmaskToBool(op, 0x80000);
fUsefArrowheadsOK = FormatUtils::BitmaskToBool(op, 0x100000);
fUsefInsetPenOK = FormatUtils::BitmaskToBool(op, 0x200000);
fUsefInsetPen = FormatUtils::BitmaskToBool(op, 0x400000);
//Reserved 0x800000 0x1000000
fUsefLineOpaqueBackColor = FormatUtils::BitmaskToBool(op, 0x2000000);
}
public:
bool fNoLineDrawDash;
bool fLineFillShape;
bool fHitTestLine;
bool fLine;
bool fArrowheadsOK;
bool fInsetPenOK;
bool fInsetPen;
bool fLineOpaqueBackColor;
bool fUsefNoLineDrawDash;
bool fUsefLineFillShape;
bool fUsefHitTestLine;
bool fUsefLine;
bool fUsefArrowheadsOK;
bool fUsefInsetPenOK;
bool fUsefInsetPen;
bool fUsefLineOpaqueBackColor;
};
}

View File

@ -0,0 +1,280 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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 "PathSegment.h"
namespace DocFileFormat
{
struct _guides
{
unsigned char type;
unsigned char param_type1;
unsigned char param_type2;
unsigned char param_type3;
WORD param1;
WORD param2;
WORD param3;
};
class PathParser
{
public:
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize, std::vector<_guides> & guides)
{
if ((pSegmentInfo != NULL) && (pSegmentInfoSize > 0))
{
unsigned short nElems = FormatUtils::BytesToUInt16(pSegmentInfo, 0, pSegmentInfoSize);
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pSegmentInfo, 2, pSegmentInfoSize);
unsigned short cb = FormatUtils::BytesToUInt16(pSegmentInfo, 4, pSegmentInfoSize);
unsigned short cbElement = 4;
int offset = 6;
if (cb == 0xfff0)
cbElement = 2;
if (nElems == 0)
{
nElems = (pSegmentInfoSize - offset) / cbElement;
}
for (unsigned short i = 0; i < nElems; ++i)
{
PathSegment oSegment = PathSegment(FormatUtils::BytesToInt32(pSegmentInfo + offset, (i * cbElement), pSegmentInfoSize - offset));
m_arSegments.push_back (oSegment);
}
if ((long)pSegmentInfoSize < (long)(cb * nElems)) // Есть несколько файлов с мусором вместо данных
m_arSegments.clear();
}
if ((NULL != pVertices) && (pVerticesSize > 0))
{
unsigned short nElems = FormatUtils::BytesToUInt16(pVertices, 0, pVerticesSize);
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pVertices, 2, pVerticesSize);
unsigned short cb = FormatUtils::BytesToUInt16(pVertices, 4, pVerticesSize);
unsigned short cbElement = 4;
if (cb == 0xfff0)
cbElement = 2;
int offset = 6;
for (unsigned short i = 0; i < nElems; ++i)
{
POINT point;
if (cbElement == 4)
{
point.x = FormatUtils::BytesToInt32(pVertices + offset, 0, pVerticesSize - offset);
point.y = FormatUtils::BytesToInt32(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
}
else
{
point.x = FormatUtils::BytesToInt16(pVertices + offset, 0, pVerticesSize - offset);
point.y = FormatUtils::BytesToInt16(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
}
offset += cbElement * 2;
LONG lMinF = (LONG)0x80000000;
if (lMinF <= point.x)
{
int index = (DWORD)point.x - 0x80000000;
if (index >= 0 && index < (int)guides.size())
{
point.x = guides[index].param3;
}
}
if (lMinF <= point.y)
{
int index = (DWORD)point.y - 0x80000000;
if (index >= 0 && index < (int)guides.size())
{
point.y = guides[index].param3;
}
}
if ((size_t)point.y > 0xffff)
{
point.y &= 0xffff;
}
if ((size_t)point.x > 0xffff)
{
point.x &= 0xffff;
}
m_arPoints.push_back(point);
}
}
}
inline std::wstring GetVmlPath () const
{
if ((0 == m_arSegments.size()) && (0 == m_arPoints.size()))
return std::wstring(L"");
std::wstring strVmlPath;
int valuePointer = 0;
if (0 == m_arSegments.size())
{
for (size_t i = 0; i < m_arPoints.size(); ++i)
{
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[i].x);
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[i].y);
++valuePointer;
}
strVmlPath += L"xe";
return strVmlPath;
}
int cc = 0;
std::vector<PathSegment>::const_iterator end = m_arSegments.end();
for (std::vector<PathSegment>::const_iterator iter = m_arSegments.begin(); iter != end; ++iter, cc++)
{
switch (iter->Type)
{
case PathSegment::msopathLineTo:
{
for (int i = 0; i < iter->Count; ++i)
{
if (valuePointer + 1 > (int)m_arPoints.size())
{
break;
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].x);
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].y);
++valuePointer;
//break;
}
else
{
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
++valuePointer;
}
}
}
break;
case PathSegment::msopathCurveTo:
{
for (int i = 0; i < iter->Count; ++i)
{
if (valuePointer + 3 > (int)m_arPoints.size())
break;
strVmlPath += L"c";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].y );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].y );
valuePointer += 3;
}
}
break;
case PathSegment::msopathMoveTo:
{
if (valuePointer < (int)m_arPoints.size())
{
strVmlPath += L"m";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
++valuePointer;
}
}
break;
case PathSegment::msopathClose:
{
strVmlPath += L"x";
}
break;
case PathSegment::msopathEnd:
{
strVmlPath += L"e";
}
break;
case PathSegment::msopathEscape:
{
if (PathSegment::msopathEscapeNoFill == iter->EscapeCode)
strVmlPath += L"nf";
if (PathSegment::msopathEscapeNoLine == iter->EscapeCode)
strVmlPath += L"ns";
}
case PathSegment::msopathClientEscape:
case PathSegment::msopathInvalid:
{
//ignore escape segments and invalid segments
}
break;
}
}
// end the path
if ( !strVmlPath.empty() && ( strVmlPath[strVmlPath.size() - 1] != L'e' ) )
strVmlPath +=L"e";
return strVmlPath;
}
private:
std::vector<POINT> m_arPoints;
std::vector<PathSegment> m_arSegments;
};
}

View File

@ -0,0 +1,101 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
class PathSegment
{
public:
enum MSOPATHTYPE
{
msopathLineTo,
msopathCurveTo,
msopathMoveTo,
msopathClose,
msopathEnd,
msopathEscape,
msopathClientEscape,
msopathInvalid
};
enum MSOPATHESCAPE
{
msopathEscapeExtension = 0x00000000,
msopathEscapeAngleEllipseTo = 0x00000001,
msopathEscapeAngleEllipse = 0x00000002,
msopathEscapeArcTo = 0x00000003,
msopathEscapeArc = 0x00000004,
msopathEscapeClockwiseArcTo = 0x00000005,
msopathEscapeClockwiseArc = 0x00000006,
msopathEscapeEllipticalQuadrantX = 0x00000007,
msopathEscapeEllipticalQuadrantY = 0x00000008,
msopathEscapeQuadraticBezier = 0x00000009,
msopathEscapeNoFill = 0x0000000A,
msopathEscapeNoLine = 0x0000000B,
msopathEscapeAutoLine = 0x0000000C,
msopathEscapeAutoCurve = 0x0000000D,
msopathEscapeCornerLine = 0x0000000E,
msopathEscapeCornerCurve = 0x0000000F,
msopathEscapeSmoothLine = 0x00000010,
msopathEscapeSmoothCurve = 0x00000011,
msopathEscapeSymmetricLine = 0x00000012,
msopathEscapeSymmetricCurve = 0x00000013,
msopathEscapeFreeform = 0x00000014,
msopathEscapeFillColor = 0x00000015,
msopathEscapeLineColor = 0x00000016
};
PathSegment (unsigned short segment): Type(msopathInvalid), Count(0), EscapeCode(msopathEscapeExtension), VertexCount(0)
{
Type = (MSOPATHTYPE)FormatUtils::BitmaskToInt (segment, 0xE000);
if (msopathEscape == Type)
{
EscapeCode = (MSOPATHESCAPE)FormatUtils::BitmaskToInt (segment, 0x1F00);
VertexCount = FormatUtils::BitmaskToInt (segment, 0x00FF);
}
else
{
Count = FormatUtils::BitmaskToInt (segment, 0x1FFF);
}
}
public:
MSOPATHTYPE Type;
int Count;
int VertexCount;
MSOPATHESCAPE EscapeCode;
};
}

View File

@ -0,0 +1,97 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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 "../../Common/FormatUtils.h"
namespace DocFileFormat
{
// 2.3.20.1 Protection Boolean Properties - [MS-ODRAW] — v20130726
class ProtectionBooleanProperties
{
public:
ProtectionBooleanProperties(unsigned int op)
{
fLockAgainstGrouping = FormatUtils::BitmaskToBool(op,0x1);
fLockAdjustHandles = FormatUtils::BitmaskToBool(op,0x2);
fLockText = FormatUtils::BitmaskToBool(op,0x4);
fLockVertices = FormatUtils::BitmaskToBool(op,0x8);
fLockCropping = FormatUtils::BitmaskToBool(op,0x10);
fLockAgainstSelect = FormatUtils::BitmaskToBool(op,0x20);
fLockPosition = FormatUtils::BitmaskToBool(op,0x30);
fLockAspectRatio = FormatUtils::BitmaskToBool(op,0x40);
fLockRotation = FormatUtils::BitmaskToBool(op,0x100);
fLockAgainstUngrouping = FormatUtils::BitmaskToBool(op,0x200);
//unused 0x400 0x800 0x1000 0x2000 0x4000 0x8000
fUsefLockAgainstGrouping = FormatUtils::BitmaskToBool(op,0x10000);
fUsefLockAdjustHandles = FormatUtils::BitmaskToBool(op,0x20000);
fUsefLockText = FormatUtils::BitmaskToBool(op,0x40000);
fUsefLockVertices = FormatUtils::BitmaskToBool(op,0x80000);
fUsefLockCropping = FormatUtils::BitmaskToBool(op,0x100000);
fUsefLockAgainstSelect = FormatUtils::BitmaskToBool(op,0x200000);
fUsefLockPosition = FormatUtils::BitmaskToBool(op,0x400000);
fUsefLockAspectRatio = FormatUtils::BitmaskToBool(op,0x800000);
fUsefLockRotation = FormatUtils::BitmaskToBool(op,0x1000000);
fUsefLockAgainstUngrouping = FormatUtils::BitmaskToBool(op,0x2000000);
}
bool fLockAgainstGrouping;
bool fLockAdjustHandles;
bool fLockText;
bool fLockVertices;
bool fLockCropping;
bool fLockAgainstSelect;
bool fLockPosition;
bool fLockAspectRatio;
bool fLockRotation;
bool fLockAgainstUngrouping;
bool fUsefLockAgainstGrouping;
bool fUsefLockAdjustHandles;
bool fUsefLockText;
bool fUsefLockVertices;
bool fUsefLockCropping;
bool fUsefLockAgainstSelect;
bool fUsefLockPosition;
bool fUsefLockAspectRatio;
bool fUsefLockRotation;
bool fUsefLockAgainstUngrouping;
};
}

View File

@ -1,41 +1,58 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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 "../Source/Common/Align.cpp"
#include "../Source/Common/Color.cpp"
#include "../Source/Common/Index.cpp"
#include "../Source/Common/NumFormat.cpp"
#include "../Source/Common/Position.cpp"
#include "../Source/Common/Wrap.cpp"
#include "../Source/Common/ZIndex.cpp"
#include "../Source/Common/SimpleTypes_Word.cpp"
#include "../Source/SystemUtility/SystemUtility.cpp"
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* 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 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* 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
namespace DocFileFormat
{
// 2.3.13.23 Shadow Style Boolean Properties - [MS-ODRAW] — v20130726
class ShadowStyleBooleanProperties
{
public:
ShadowStyleBooleanProperties(unsigned int op)
{
fshadowObscured = FormatUtils::BitmaskToBool(op, 0x1);
fShadow = FormatUtils::BitmaskToBool(op, 0x1 << 1);
fUsefshadowObscured = FormatUtils::BitmaskToBool(op, 0x1 << 16);
fUsefShadow = FormatUtils::BitmaskToBool(op, 0x1 << 17);
}
public:
bool fUsefShadow;
bool fUsefshadowObscured;
bool fShadow;
bool fshadowObscured;
};
}

View File

@ -75,9 +75,9 @@ namespace DocFileFormat
}
else
{
for ( size_t j = 0; j < this->Children.size(); ++j)
for ( std::vector<Record*>::const_iterator iter1 = this->Children.begin(); iter1 != this->Children.end(); iter1++ )
{
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( this->Children[j] );
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( *iter1 );
if (sh_options)
{
if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(Pib))
@ -101,17 +101,16 @@ namespace DocFileFormat
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
}
ODRAW::OfficeArtFOPTEPtr ExtractOption(const PropertyId & prop) const
OptionEntryPtr ExtractOption(const PropertyId & prop) const
{
ODRAW::OfficeArtFOPTEPtr ret;
OptionEntryPtr ret;
for ( size_t i = 0; i < this->Children.size(); ++i )
{
ShapeOptions* opt = dynamic_cast<ShapeOptions*>( this->Children[i] );
if ( opt == NULL ) continue;
std::map<PropertyId, ODRAW::OfficeArtFOPTEPtr>::iterator pFind = opt->OptionsByID.find(prop);
std::map<PropertyId, OptionEntryPtr>::iterator pFind = opt->OptionsByID.find(prop);
if (pFind != opt->OptionsByID.end())
{
ret = pFind->second;
@ -120,9 +119,9 @@ namespace DocFileFormat
return ret;
}
std::vector<ODRAW::OfficeArtFOPTEPtr> ExtractOptions() const
std::vector<OptionEntryPtr> ExtractOptions() const
{
std::vector<ODRAW::OfficeArtFOPTEPtr> ret;
std::vector<OptionEntryPtr> ret;
//build the list of all option entries of this shape
for ( size_t i = 0; i < this->Children.size(); ++i )

View File

@ -32,7 +32,6 @@
#pragma once
#include "Record.h"
#include "../../../ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRGFOPTE.h"
namespace DocFileFormat
{
@ -527,6 +526,21 @@ namespace DocFileFormat
LineDashing_LongDashDotDotGEL
} LineDashing;
struct OptionEntry
{
OptionEntry() : pid(PropertyId_left), fBid(false), fComplex(false), op(0)
{
}
PropertyId pid;
bool fBid;
bool fComplex;
unsigned int op;
std::shared_ptr<unsigned char> opComplex;
};
typedef std::shared_ptr<OptionEntry> OptionEntryPtr;
class ShapeOptions: public Record
{
public:
@ -534,9 +548,9 @@ namespace DocFileFormat
static const unsigned short TYPE_CODE_0xF121 = 0xF121;
static const unsigned short TYPE_CODE_0xF122 = 0xF122;
std::vector<ODRAW::OfficeArtFOPTEPtr> Options;
std::map<PropertyId, ODRAW::OfficeArtFOPTEPtr> OptionsByID;
std::vector<OptionEntryPtr> Options;
std::map<PropertyId, OptionEntryPtr> OptionsByID;
ShapeOptions() : Record()
{
}
@ -549,24 +563,41 @@ namespace DocFileFormat
{
long pos = Reader->GetPosition();
// parse the flags and the simple values
//parse the flags and the simple values
for (unsigned int i = 0; i < instance; ++i)
{
ODRAW::OfficeArtFOPTEPtr fopte = ODRAW::OfficeArtFOPTE::load_and_create(Reader);
if (!fopte)continue;
OptionEntryPtr entry = std::shared_ptr<OptionEntry>(new OptionEntry());
unsigned short flag = Reader->ReadUInt16();
entry->pid = (PropertyId)FormatUtils::BitmaskToInt (flag, 0x3FFF);
entry->fBid = FormatUtils::BitmaskToBool (flag, 0x4000);
entry->fComplex = FormatUtils::BitmaskToBool (flag, 0x8000);
entry->op = Reader->ReadUInt32();
Options.push_back(fopte);
Options.push_back( entry );
}
// complex load
for(size_t i = 0; i < Options.size(); ++i)
//parse the complex values & sorted by pid
for (unsigned int i = 0; i < instance; ++i)
{
if(Options[i]->fComplex && Options[i]->op > 0)
{
Options[i]->ReadComplexData(Reader);
if (Options[i]->fComplex && Options[i]->op > 0)
{
unsigned int size = Options[i]->op;
if (Options[i]->pid == 0x0145 ||
Options[i]->pid == 0x0146 ||
Options[i]->pid == 0x0197 ||
Options[i]->pid == 0x0156 ||
Options[i]->pid == 0x0155 ||
Options[i]->pid == 0x0151 ||
Options[i]->pid == 0x0152 ||
Options[i]->pid == 0x0157 ||
Options[i]->pid == 0x0158)//mso arrays
size += 6;
Options[i]->opComplex = std::shared_ptr<unsigned char>(Reader->ReadBytes( size, true ));
}
OptionsByID.insert(std::make_pair((PropertyId)Options[i]->opid, Options[i]));
OptionsByID.insert(std::make_pair(Options[i]->pid, Options[i]));
}
Reader->Seek(( pos + size ), 0/*STREAM_SEEK_SET*/);

View File

@ -31,15 +31,13 @@
*/
#pragma once
#include "ProtectionBooleanProperties.h"
#include "../IVisitable.h"
#include "../../Common/XmlTools.h"
#include <boost/shared_ptr.hpp>
namespace ODRAW
{
class OfficeArtFOPTE;
typedef boost::shared_ptr<OfficeArtFOPTE> OfficeArtFOPTEPtr;
}
#include <list>
namespace DocFileFormat
{
enum MSOSPT
@ -276,6 +274,9 @@ namespace DocFileFormat
position = pos;
xrange = xRange;
}
public:
std::wstring position;
std::wstring xrange;
std::wstring switchHandle;
@ -288,7 +289,7 @@ namespace DocFileFormat
{
public:
ShapeType (unsigned int typeCode) : Filled(true), Stroked(true), TypeCode(typeCode), Joins(miter), ShapeConcentricFill(false)
ShapeType (unsigned int typeCode) : Filled(true), Stroked(true), Lock(0), TypeCode(typeCode), Joins(miter), ShapeConcentricFill(false)
{
}
@ -300,7 +301,8 @@ namespace DocFileFormat
{
return TypeCode;
}
public:
/// This string describes a sequence of commands that define the shapes path.
/// This string describes both the pSegmentInfo array and pVertices array in the shapes geometry properties.
std::wstring Path;
@ -342,7 +344,7 @@ namespace DocFileFormat
bool Stroked;
/// Speicfies the locked properties of teh shape.
/// By default nothing is locked.
ODRAW::OfficeArtFOPTEPtr Lock;
ProtectionBooleanProperties Lock;
///
std::wstring Textpath;

View File

@ -60,9 +60,9 @@ namespace DocFileFormat
this->Filled = false;
this->Stroked = false;
// //pictures have a lock on the aspect ratio by default
//this->Lock.fUsefLockAspectRatio = true;
// this->Lock.fLockAspectRatio = true;
//pictures have a lock on the aspect ratio by default
this->Lock.fUsefLockAspectRatio = true;
this->Lock.fLockAspectRatio = true;
}
void SetType(unsigned int nType)
{

View File

@ -29,39 +29,64 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef BUILDER_WRAPPER_BUILDER
#define BUILDER_WRAPPER_BUILDER
#pragma once
#include "../docbuilder.h"
#include "../nativecontrol.h"
class CBuilderObject
namespace DocFileFormat
{
public:
NSDoctRenderer::CDocBuilder* m_pBuilder;
class ThreeDStyleBooleanProperties
{
public:
ThreeDStyleBooleanProperties(unsigned int op)
{
fUsefc3DConstrainRotation = GETBIT(op, 0);
fUsefc3DRotationCenterAuto = GETBIT(op, 1);
fUsefc3DParallel = GETBIT(op, 2);
fUsefc3DKeyHarsh = GETBIT(op, 3);
fUsefc3DFillHarsh = GETBIT(op, 4);
public:
CBuilderObject()
{
m_pBuilder = NULL;
}
~CBuilderObject()
{
}
};
fc3DConstrainRotation = GETBIT(op, 16);
fc3DRotationCenterAuto = GETBIT(op, 17);
fc3DParallel = GETBIT(op, 18);
fc3DKeyHarsh = GETBIT(op, 19);
fc3DFillHarsh = GETBIT(op, 20);
}
bool fUsefc3DConstrainRotation;
bool fUsefc3DRotationCenterAuto;
bool fUsefc3DParallel;
bool fUsefc3DKeyHarsh;
bool fUsefc3DFillHarsh;
// wrap_methods -------------
CBuilderObject* unwrap_builder(v8::Handle<v8::Object> obj);
bool fc3DConstrainRotation;
bool fc3DRotationCenterAuto;
bool fc3DParallel;
bool fc3DKeyHarsh;
bool fc3DFillHarsh;
};
class ThreeDObjectBooleanProperties
{
public:
ThreeDObjectBooleanProperties(unsigned int op)
{
fUsef3D = GETBIT(op, 0);
fUsefc3DMetallic = GETBIT(op, 1);
fUsefc3DUseExtrusionColor = GETBIT(op, 2);
fUsefc3DLightFace = GETBIT(op, 3);
void _b_openfile(const v8::FunctionCallbackInfo<v8::Value>& args);
void _b_createfile(const v8::FunctionCallbackInfo<v8::Value>& args);
void _b_settmpfolder(const v8::FunctionCallbackInfo<v8::Value>& args);
void _b_savefile(const v8::FunctionCallbackInfo<v8::Value>& args);
void _b_closefile(const v8::FunctionCallbackInfo<v8::Value>& args);
void _b_writefile(const v8::FunctionCallbackInfo<v8::Value>& args);
// 12 unused
v8::Handle<v8::ObjectTemplate> CreateBuilderTemplate(v8::Isolate* isolate);
void CreateBuilderObject(const v8::FunctionCallbackInfo<v8::Value>& args);
#endif // BUILDER_WRAPPER_BUILDER
f3D = GETBIT(op, 16);
fc3DMetallic = GETBIT(op, 17);
fc3DUseExtrusionColor = GETBIT(op, 18);
fc3DLightFace = GETBIT(op, 19);
}
bool fUsef3D;
bool fUsefc3DMetallic;
bool fUsefc3DUseExtrusionColor;
bool fUsefc3DLightFace;
bool f3D;
bool fc3DMetallic;
bool fc3DUseExtrusionColor;
bool fc3DLightFace;
};
}

View File

@ -32,38 +32,9 @@
#include "SettingsMapping.h"
#include "../../OfficeCryptReader/source/CryptTransform.h"
namespace DocFileFormat
{
std::string DecodeBase64(const std::string & value)
{
int nLength = 0;
unsigned char *pData = NULL;
std::string result;
NSFile::CBase64Converter::Decode(value.c_str(), value.length(), pData, nLength);
if (pData)
{
result = std::string((char*)pData, nLength);
delete []pData; pData = NULL;
}
return result;
}
std::wstring EncodeBase64(const std::string & value)
{
int nLength = 0;
char *pData = NULL;
std::string result;
NSFile::CBase64Converter::Encode((BYTE*)value.c_str(), value.length(), pData, nLength, NSBase64::B64_BASE64_FLAG_NOCRLF);
if (pData)
{
result = std::string(pData, nLength);
delete []pData; pData = NULL;
}
return std::wstring(result.begin(), result.end());
}
SettingsMapping::SettingsMapping (ConversionContext* ctx): PropertiesMapping(&m_oXmlWriter)
{
_ctx = ctx;
@ -78,39 +49,11 @@ namespace DocFileFormat
//start w:settings
m_oXmlWriter.WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_oXmlWriter.WriteNodeBegin( L"w:settings", TRUE );
//write namespaces
m_oXmlWriter.WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_oXmlWriter.WriteNodeEnd( L"", TRUE, FALSE );
if (_ctx->_doc->FIB->m_FibBase.fWriteReservation)
{
m_oXmlWriter.WriteNodeBegin( L"w:writeProtection", TRUE );
WideString* passw = static_cast<WideString*>(_ctx->_doc->AssocNames->operator[]( 17 ));
if (passw && false == passw->empty())
{
CRYPT::_ecmaWriteProtectData data;
CRYPT::ECMAWriteProtect protect;
protect.SetCryptData(data);
protect.SetPassword(*passw);
protect.Generate();
protect.GetCryptData(data);
//m_oXmlWriter.WriteAttribute ( L"w:cryptProviderType", L"rsaAES");
//m_oXmlWriter.WriteAttribute ( L"w:cryptAlgorithmSid", 14); //sha-512
//m_oXmlWriter.WriteAttribute ( L"w:cryptAlgorithmType", L"typeAny");
//m_oXmlWriter.WriteAttribute ( L"w:cryptAlgorithmClass", L"hash");
//m_oXmlWriter.WriteAttribute ( L"w:cryptSpinCount", data.spinCount);
//m_oXmlWriter.WriteAttribute ( L"w:hash", EncodeBase64(data.hashValue));
//m_oXmlWriter.WriteAttribute ( L"w:salt", EncodeBase64(data.saltValue));
m_oXmlWriter.WriteAttribute ( L"w:algorithmName", L"SHA-512");
m_oXmlWriter.WriteAttribute ( L"w:spinCount", data.spinCount);
m_oXmlWriter.WriteAttribute ( L"w:hashValue", EncodeBase64(data.hashValue));
m_oXmlWriter.WriteAttribute ( L"w:saltValue", EncodeBase64(data.saltValue));
}
m_oXmlWriter.WriteNodeEnd( L"", TRUE, TRUE );
}
//zoom
m_oXmlWriter.WriteNodeBegin ( L"w:zoom", TRUE );
m_oXmlWriter.WriteAttribute ( L"w:percent", FormatUtils::IntToWideString( dop->wScaleSaved > 0 ? dop->wScaleSaved : 100 ) );

View File

@ -33,18 +33,41 @@
#include "VMLPictureMapping.h"
#include "VMLShapeMapping.h"
#include "OfficeDrawing/GeometryBooleanProperties.h"
#include "OfficeDrawing/GeometryTextBooleanProperties.h"
#include "OfficeDrawing/GroupShapeBooleanProperties.h"
#include "OfficeDrawing/MetafilePictBlip.h"
#include "../../DesktopEditor/common/StringExt.h"
#include "../../DesktopEditor/common/String.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Document.h"
#include "../../DesktopEditor/common/File.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#include "../../ASCOfficePPTFile/PPTFormatLib/Reader/ReadStructures.h"
using namespace DocFileFormat;
typedef struct
{
DWORD iType; // Record type EMR_HEADER
DWORD nSize; // Record size in bytes. This may be greater
// than the sizeof(ENHMETAHEADER).
RECT rclBounds; // Inclusive-inclusive bounds in device units
RECT rclFrame; // Inclusive-inclusive Picture Frame .01mm unit
DWORD dSignature; // Signature. Must be ENHMETA_SIGNATURE.
DWORD nVersion; // Version number
DWORD nBytes; // Size of the metafile in bytes
DWORD nRecords; // Number of records in the metafile
WORD nHandles; // Number of handles in the handle table
// Handle index zero is reserved.
WORD sReserved; // Reserved. Must be zero.
DWORD nDescription; // Number of chars in the unicode desc string
// This is 0 if there is no description string
DWORD offDescription; // Offset to the metafile description record.
// This is 0 if there is no description string
DWORD nPalEntries; // Number of entries in the metafile palette.
SIZE szlDevice; // Size of the reference device in pels
SIZE szlMillimeters; // Size of the reference device in millimeters
} ENHMETAHEADER3;
namespace DocFileFormat
{
@ -115,51 +138,6 @@ namespace DocFileFormat
}
return btWin32;
}
bool VMLPictureMapping::ParseEmbeddedBlob( const std::string & xmlString, std::wstring & newXmlString)
{
newXmlString.clear();
std::wstring sTempFolder = m_context->_doc->m_sTempFolder;
if (sTempFolder.empty())
{
sTempFolder = NSFile::CFileBinary::GetTempPath();
}
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(sTempFolder, L"emb");
NSFile::CFileBinary file;
file.CreateFileW(sTempXmlFile);
file.WriteFile((BYTE*)xmlString.c_str(), xmlString.size());
file.CloseFile();
COfficeUtils officeUtils(NULL);
BYTE *utf8Data = NULL;
ULONG utf8DataSize = 0;
if (S_OK != officeUtils.LoadFileFromArchive(sTempXmlFile, L"drs/shapexml.xml", &utf8Data, utf8DataSize))
{
if (S_OK == officeUtils.IsFileExistInArchive(sTempXmlFile, L"drs/diagrams"))
{
officeUtils.LoadFileFromArchive(sTempXmlFile, L"drs/diagrams/drawing1.xml", &utf8Data, utf8DataSize);
}
else if (S_OK != officeUtils.LoadFileFromArchive(sTempXmlFile, L"drs/e2oDoc.xml", &utf8Data, utf8DataSize))
{
}
}
if (utf8Data && utf8DataSize > 0)
{
newXmlString = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8(utf8Data, utf8DataSize);
delete []utf8Data;
}
NSFile::CFileBinary::Remove(sTempXmlFile);
if (newXmlString.empty()) return false;
return true;
}
bool VMLPictureMapping::ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
{
newXmlString.clear();
@ -220,12 +198,15 @@ namespace DocFileFormat
return res;
}
//---------------------------------------------------------------
void VMLPictureMapping::appendStyleProperty(std::wstring& style, const std::wstring& propName, const std::wstring& propValue) const
void VMLPictureMapping::appendStyleProperty(std::wstring* b, const std::wstring& propName, const std::wstring& propValue) const
{
style += ( propName );
style += ( L":" );
style += ( propValue );
style +=( L";" );
if ( b != NULL )
{
b->operator += ( propName );
b->operator += ( L":" );
b->operator += ( propValue );
b->operator +=( L";" );
}
}
VMLPictureMapping::VMLPictureMapping(ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture) : PropertiesMapping(writer)
@ -240,7 +221,6 @@ namespace DocFileFormat
m_isBullete = false;
m_isEquation = false;
m_isEmbedded = false;
m_isBlob = false;
m_imageData = new XMLTools::XMLElement( L"v:imagedata" );
}
@ -276,7 +256,7 @@ namespace DocFileFormat
std::wstring strHeight = FormatUtils::DoubleToWideString( height.ToPoints() );
std::wstring strStyle;
std::vector<ODRAW::OfficeArtFOPTEPtr> options;
std::vector<OptionEntryPtr> options;
PictureFrameType type;
Shape* pShape = NULL;
@ -292,7 +272,6 @@ namespace DocFileFormat
type.Convert( vmlShapeTypeMapping );
RELEASEOBJECT( vmlShapeTypeMapping );
}
else if (pict->embeddedData)
{
@ -317,37 +296,31 @@ namespace DocFileFormat
for (size_t i = 0; i < options.size(); i++)
{
ODRAW::OfficeArtFOPTEPtr & iter = options[i];
switch ( iter->opid )
OptionEntryPtr & iter = options[i];
switch ( iter->pid )
{
case wzEquationXML:
{
ODRAW::XmlString *pXml = dynamic_cast<ODRAW::XmlString*>(iter.get());
if (pXml)
{
m_isEquation = true;
m_isEmbedded = true;
m_embeddedData = pXml->data;
m_isEquation = true;
m_isEmbedded = true;
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
{
m_isEmbedded = false;
}
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
{
m_isEmbedded = false;
}
}break;
case metroBlob:
{//встроенная неведомая хуйня
ODRAW::MetroBlob* blob = dynamic_cast<ODRAW::MetroBlob*>(iter.get());
if (blob)
{
m_isBlob = true;
m_isEmbedded = true;
//if (ParseEmbeddedBlob( blob->data.first, blob->data.second)) // todoooo
//{
// m_isEmbedded = false;
//}
}
{
//встроенная неведомая хуйня
m_isEmbedded = true;
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
//if (ParseEmbeddedBlob( m_embeddedData, m_blobXml)) // todoooo
//{
// m_isEmbedded = false;
//}
}break;
//BORDERS
case borderBottomColor:
@ -418,41 +391,41 @@ namespace DocFileFormat
std::wstring v = strHeight;
strHeight = strWidth; strWidth = v;
appendStyleProperty(strStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
appendStyleProperty(&strStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
}break;
case posh:
{
appendStyleProperty(strStyle, L"mso-position-horizontal", VMLShapeMapping::mapHorizontalPosition((PositionHorizontal)iter->op));
appendStyleProperty(&strStyle, L"mso-position-horizontal", VMLShapeMapping::mapHorizontalPosition((PositionHorizontal)iter->op));
}break;
case posrelh:
{
appendStyleProperty(strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
appendStyleProperty(&strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
}break;
case posv:
{
appendStyleProperty(strStyle, L"mso-position-vertical", VMLShapeMapping::mapVerticalPosition((PositionVertical)iter->op));
appendStyleProperty(&strStyle, L"mso-position-vertical", VMLShapeMapping::mapVerticalPosition((PositionVertical)iter->op));
}break;
case posrelv:
{
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
appendStyleProperty(&strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
}break;
case groupShapeBooleans:
{
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
GroupShapeBooleanProperties groupShapeBooleans(iter->op);
if (booleans->fUsefBehindDocument && booleans->fBehindDocument)
if (groupShapeBooleans.fUsefBehindDocument && groupShapeBooleans.fBehindDocument)
{
//The shape is behind the text, so the z-index must be negative.
appendStyleProperty(strStyle, L"z-index", L"-1" );
appendStyleProperty(&strStyle, L"z-index", L"-1" );
}
//else if (!m_isInlinePicture)
//{
// appendStyleProperty( &strStyle, L"z-index", FormatUtils::IntToWideString(zIndex + 0x7ffff));
//}
if (booleans->fHidden && booleans->fUsefHidden)
if (groupShapeBooleans.fHidden && groupShapeBooleans.fUsefHidden)
{
appendStyleProperty(strStyle, L"visibility", L"hidden");
appendStyleProperty(&strStyle, L"visibility", L"hidden");
}
}break;
default:
@ -497,8 +470,7 @@ namespace DocFileFormat
appendValueAttribute(m_imageData, L"o:title", L"" );
m_pXmlWriter->WriteString(m_imageData->GetXMLString());
}
else
m_isPictureBroken = true;
{//borders
writePictureBorder( L"bordertop", pict->brcTop );

View File

@ -56,9 +56,8 @@ namespace DocFileFormat
private:
/// Writes a border element
void writePictureBorder (const std::wstring & name, const BorderCode* brc);
void appendStyleProperty( std::wstring& style, const std::wstring& propName, const std::wstring& propValue ) const;
void appendStyleProperty( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
bool ParseEmbeddedBlob(const std::string & xmlString, std::wstring & newXmlString);
std::wstring GetShapeID(const Shape* pShape) const;
protected:
/// Copies the picture from the binary stream to the zip archive
@ -70,14 +69,11 @@ namespace DocFileFormat
static std::wstring GetTargetExt (Global::BlipType nType);
static std::wstring GetContentType (Global::BlipType nType);
bool m_isBlob;
bool m_isBullete;
bool m_isEquation;
bool m_isEmbedded;
bool m_isPictureBroken;
std::string m_embeddedData;
std::wstring m_equationXml;
std::wstring m_blobXml;
std::wstring m_shapeId;
private:

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,7 @@
#include "OfficeDrawing/ChildAnchor.h"
#include "OfficeDrawing/ClientAnchor.h"
#include "OfficeDrawing/Shapetypes/LineType.h"
#include "OfficeDrawing/PathParser.h"
#include "OfficeDrawing/MetafilePictBlip.h"
#include "OfficeDrawing/BitmapBlip.h"
@ -67,7 +68,6 @@ namespace DocFileFormat
static std::wstring mapHorizontalPositionRelative(int hRel );
bool m_isBullete;
bool m_isPictureBroken;
std::wstring m_shapeId;
private:
@ -83,16 +83,15 @@ namespace DocFileFormat
bool copyPicture( const BlipStoreEntry* bse );
std::wstring GetTargetExt( Global::BlipType _type ) const;
void AppendDimensionToStyle ( std::wstring& style, const PictureDescriptor* pict, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring& style, const Spa* pSpa, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring& style, const ChildAnchor* anchor, bool twistDimensions ) const;
void appendStyleProperty ( std::wstring& style, const std::wstring& propName, const std::wstring& propValue ) const;
void appendStylePropertyFirst( std::wstring& style, const std::wstring& propName, const std::wstring& propValue ) const;
void AppendDimensionToStyle ( std::wstring* style, const PictureDescriptor* pict, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring* style, const Spa* pSpa, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring* style, const ChildAnchor* anchor, bool twistDimensions ) const;
void appendStyleProperty ( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
std::wstring getTextboxAnchor( unsigned int anchor ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
void AppendOptionsToStyle ( std::wstring& style, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
void AppendOptionsToStyle ( std::wstring* style, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
int UpdateFromGuides(const int val) const;
@ -101,7 +100,7 @@ namespace DocFileFormat
std::wstring getArrowLength ( unsigned int op ) const;
std::wstring getArrowWidth ( unsigned int op ) const;
std::wstring getFillMethod ( unsigned int p ) const;
std::wstring getFillColorString( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::wstring getFillColorString( const unsigned char* p, unsigned int size ) const;
std::wstring getFillType ( unsigned int p ) const;
std::wstring getShadowType ( unsigned int p ) const;
@ -115,16 +114,16 @@ namespace DocFileFormat
std::wstring GetLineFrom (const ChildAnchor* pAnchor) const;
std::wstring GetLineTo (const ChildAnchor* pAnchor) const;
std::wstring GetWrapCoords ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::vector<std::wstring> GetTextRectangles ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::wstring GetConnectAngles ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::wstring GetConnectLocs ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
void GetGuides ( const ODRAW::OfficeArtFOPTEPtr& pOpt );
std::wstring GetWrapCoords ( const OptionEntryPtr& pOpt ) const;
std::vector<std::wstring> GetTextRectangles ( const OptionEntryPtr& pOpt ) const;
std::wstring GetConnectAngles ( const OptionEntryPtr& pOpt ) const;
std::wstring GetConnectLocs ( const OptionEntryPtr& pOpt ) const;
void GetGuides ( const OptionEntryPtr& pOpt );
int m_nAdjValues[8];
std::vector<ODRAW::MSOSG> m_arrGuides;
std::vector<_guides> m_arrGuides;
mutable bool m_isInlineShape;
bool m_isInlineShape;
Spa* m_pSpa;
IMapping* m_pCaller;
BlipStoreContainer* m_pBlipStore;

View File

@ -33,7 +33,6 @@
#include "VMLShapeTypeMapping.h"
#include "OfficeDrawing/Shapetypes/OvalType.h"
#include "OfficeDrawing/Shapetypes/WordArtText.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h"
namespace DocFileFormat
{
@ -171,18 +170,13 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd( L"", true );
//Lock ???
ODRAW::ProtectionBooleanProperties *prot = dynamic_cast<ODRAW::ProtectionBooleanProperties*>(pShape->Lock.get());
if ((prot) && (prot->fUsefLockAspectRatio))
//Lock
if ( ( pShape->Lock.fUsefLockAspectRatio ) && ( pShape->Lock.fLockAspectRatio ) )
{
appendValueAttribute( _lock, L"aspectratio", prot->fLockAspectRatio ? L"t" : L"f" );
}
else
{
appendValueAttribute( _lock, L"aspectratio", L"t");
appendValueAttribute( _lock, L"aspectratio", L"t" );
}
if ( _lock->GetAttributeCount() > 0 )
if ( _lock->GetAttributeCount() > 1 )
{
m_pXmlWriter->WriteString( _lock->GetXMLString() );
}

View File

@ -84,7 +84,7 @@ namespace DocFileFormat
Text(NULL), RevisionAuthorTable(NULL), FontTable(NULL), BookmarkNames(NULL), AutoTextNames(NULL),
IndividualFootnotesPlex(NULL), FootnoteReferenceCharactersPlex(NULL), IndividualEndnotesPlex(NULL),
EndnoteReferenceCharactersPlex(NULL), FieldsPlex(NULL), FootnoteDocumentFieldsPlex(NULL),
EndnoteDocumentFieldsPlex(NULL), HeadersAndFootersDocumentFieldsPlex(NULL), HeaderStoriesPlex(NULL), AnnotationsFieldsPlex(NULL),
EndnoteDocumentFieldsPlex(NULL), HeadersAndFootersDocumentFieldsPlex(NULL), HeaderStoriesPlex(NULL),
AnnotationsReferencePlex(NULL), AnnotationsReferenceExPlex(NULL), IndividualCommentsPlex(NULL), TextboxBreakPlex(NULL), TextboxBreakPlexHeader(NULL),
TextboxIndividualPlex(NULL),AssocNames(NULL), BookmarkAnnotNames(NULL), Captions(NULL), AutoCaptions(NULL), ListPlex(NULL),
OfficeDrawingPlex(NULL), OfficeDrawingPlexHeader(NULL), SectionPlex(NULL), BookmarkStartPlex(NULL), BookmarkEndPlex(NULL),
@ -353,7 +353,7 @@ namespace DocFileFormat
TextboxIndividualPlex = new Plex<FTXBXS> (FTXBXS::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, nWordVersion);
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcfSed,FIB->m_FibWord97.lcbPlcfSed, nWordVersion);
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, nWordVersion);
BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, nWordVersion);
BookmarkEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkl, FIB->m_FibWord97.lcbPlcfBkl, nWordVersion);
@ -387,13 +387,10 @@ namespace DocFileFormat
}
AutoTextPlex = new Plex<EmptyStructure>(EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfGlsy, FIB->m_FibWord97.lcbPlcfGlsy, nWordVersion);
FieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldMom, FIB->m_FibWord97.lcbPlcfFldMom, nWordVersion);
FootnoteDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldFtn, FIB->m_FibWord97.lcbPlcfFldFtn, nWordVersion);
EndnoteDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldEdn, FIB->m_FibWord97.lcbPlcfFldEdn, nWordVersion);
HeadersAndFootersDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldHdr, FIB->m_FibWord97.lcbPlcfFldHdr, nWordVersion);
AnnotationsFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldAtn, FIB->m_FibWord97.lcbPlcfFldAtn, nWordVersion);
ListPlex = new Plex<ListNumCache> (ListNumCache::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBteLvc, FIB->m_FibWord97.lcbPlcfBteLvc, nWordVersion);
if (m_pCallFunc)
@ -875,7 +872,6 @@ namespace DocFileFormat
RELEASEOBJECT(FootnoteDocumentFieldsPlex);
RELEASEOBJECT(EndnoteDocumentFieldsPlex);
RELEASEOBJECT(HeadersAndFootersDocumentFieldsPlex);
RELEASEOBJECT(AnnotationsFieldsPlex);
RELEASEOBJECT(HeaderStoriesPlex);
RELEASEOBJECT(IndividualCommentsPlex);
RELEASEOBJECT(AnnotationsReferencePlex);

View File

@ -88,7 +88,6 @@ namespace DocFileFormat
friend class VMLPictureMapping;
friend class OpenXmlPackage;
friend class TextboxMapping;
friend class SettingsMapping;
public:
@ -224,7 +223,6 @@ namespace DocFileFormat
Plex<FieldCharacter> *FootnoteDocumentFieldsPlex;
Plex<FieldCharacter> *EndnoteDocumentFieldsPlex;
Plex<FieldCharacter> *HeadersAndFootersDocumentFieldsPlex;
Plex<FieldCharacter> *AnnotationsFieldsPlex;
Plex<AnnotationReferenceDescriptor> *AnnotationsReferencePlex;
Plex<AnnotationReferenceExDescriptor> *AnnotationsReferenceExPlex;
Plex<EmptyStructure> *AutoTextPlex;

View File

@ -208,19 +208,28 @@ HEADERS += \
../../DocDocxConverter/OfficeDrawing/ChildAnchor.h \
../../DocDocxConverter/OfficeDrawing/ClientAnchor.h \
../../DocDocxConverter/OfficeDrawing/ClientData.h \
../../DocDocxConverter/OfficeDrawing/DiagramBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/DrawingContainer.h \
../../DocDocxConverter/OfficeDrawing/DrawingGroup.h \
../../DocDocxConverter/OfficeDrawing/DrawingGroupRecord.h \
../../DocDocxConverter/OfficeDrawing/DrawingRecord.h \
../../DocDocxConverter/OfficeDrawing/FillStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GeometryBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GeometryTextBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GroupContainer.h \
../../DocDocxConverter/OfficeDrawing/GroupShapeBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GroupShapeRecord.h \
../../DocDocxConverter/OfficeDrawing/LineStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/MetafilePictBlip.h \
../../DocDocxConverter/OfficeDrawing/OfficeArtClientTextbox.h \
../../DocDocxConverter/OfficeDrawing/PathParser.h \
../../DocDocxConverter/OfficeDrawing/PathSegment.h \
../../DocDocxConverter/OfficeDrawing/ProtectionBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/Record.h \
../../DocDocxConverter/OfficeDrawing/RecordFactory.h \
../../DocDocxConverter/OfficeDrawing/RegularContainer.h \
../../DocDocxConverter/OfficeDrawing/ShadowStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/threeDBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/Shape.h \
../../DocDocxConverter/OfficeDrawing/ShapeContainer.h \
../../DocDocxConverter/OfficeDrawing/ShapeOptions.h \

View File

@ -775,6 +775,10 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\ClientData.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\DiagramBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\DrawingContainer.h"
>
@ -791,14 +795,34 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\DrawingRecord.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\FillStyleBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GeometryBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GeometryTextBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GroupContainer.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GroupShapeBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GroupShapeRecord.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\LineStyleBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\MetafilePictBlip.h"
>
@ -807,6 +831,18 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\OfficeArtClientTextbox.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\PathParser.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\PathSegment.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\ProtectionBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\Record.cpp"
>
@ -827,6 +863,10 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\RegularContainer.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\ShadowStyleBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\Shape.h"
>

View File

@ -2,17 +2,20 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "..\DocFormatLib\Win32\DocFormatLib.vcproj", "{C5371405-338F-4B70-83BD-2A5CDF64F383}"
ProjectSection(ProjectDependencies) = postProject
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOfficeXlsFile2\source\win32\XlsFormat.vcproj", "{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
ProjectSection(ProjectDependencies) = postProject
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"

View File

@ -345,14 +345,6 @@
RelativePath="..\..\DesktopEditor\common\Base64.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Writer\BinaryReader.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\BinaryWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>

View File

@ -33,7 +33,6 @@
#define COMMENTS_WRITER
#include "../../XlsxSerializerCom/Common/Common.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h"
namespace Writers
{
@ -51,28 +50,21 @@ namespace Writers
std::wstring m_sComment;
std::wstring m_sCommentExt;
std::wstring m_sPeople;
std::wstring m_sDocumentComment;
std::wstring m_sDocumentCommentExt;
std::wstring m_sDocumentPeople;
CommentsWriter(std::wstring sDir) : m_sDir(sDir)
{
}
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentPeople)
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople)
{
m_sComment = sComment;
m_sCommentExt = sCommentExt;
m_sPeople = sPeople;
m_sDocumentComment = sDocumentComment;
m_sDocumentCommentExt = sDocumentCommentExt;
m_sDocumentPeople = sDocumentPeople;
}
void Write()
{
std::wstring sDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR;
if(false == m_sComment.empty())
{
OOX::CPath filePath = sDir + OOX::FileTypes::Comments.DefaultFileName().GetPath();
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("comments.xml");
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath.GetPath());
@ -84,7 +76,7 @@ namespace Writers
if(false == m_sCommentExt.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::CommentsExt.DefaultFileName().GetPath());
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml"));
oFile.WriteStringUTF8(g_string_commentExt_Start);
oFile.WriteStringUTF8(m_sCommentExt);
oFile.WriteStringUTF8(g_string_commentExt_End);
@ -93,43 +85,12 @@ namespace Writers
if(false == m_sPeople.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::People.DefaultFileName().GetPath());
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml"));
oFile.WriteStringUTF8(g_string_people_Start);
oFile.WriteStringUTF8(m_sPeople);
oFile.WriteStringUTF8(g_string_people_End);
oFile.CloseFile();
}
if(false == m_sDocumentComment.empty())
{
OOX::CPath filePath = sDir + OOX::FileTypes::DocumentComments.DefaultFileName().GetPath();
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath.GetPath());
oFile.WriteStringUTF8(g_string_comment_Start);
oFile.WriteStringUTF8(m_sDocumentComment);
oFile.WriteStringUTF8(g_string_comment_End);
oFile.CloseFile();
}
if(false == m_sDocumentCommentExt.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_commentExt_Start);
oFile.WriteStringUTF8(m_sDocumentCommentExt);
oFile.WriteStringUTF8(g_string_commentExt_End);
oFile.CloseFile();
}
if(false == m_sDocumentPeople.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentPeople.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_people_Start);
oFile.WriteStringUTF8(m_sDocumentPeople);
oFile.WriteStringUTF8(g_string_people_End);
oFile.CloseFile();
}
}
};
}

View File

@ -58,11 +58,6 @@ namespace NSBinPptxRW
{
class CDrawingConverter;
}
namespace OOX
{
class CApp;
class CCore;
}
namespace Writers
{
@ -92,8 +87,6 @@ namespace Writers
std::wstring m_sThemePath;
int m_nDocPrIndex;
BinDocxRW::CComments* m_pComments;
OOX::CApp* m_pApp;
OOX::CCore* m_pCore;
FileWriter (std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath)
: m_pDrawingConverter(pDrawingConverter), m_sThemePath(sThemePath), m_bSaveChartAsImg(bSaveChartAsImg),
@ -112,16 +105,9 @@ namespace Writers
m_oWebSettingsWriter (sDirOutput),
m_nDocPrIndex(0),
m_pComments(NULL),
m_oCustomXmlWriter (sDirOutput, pDrawingConverter),
m_pApp (NULL),
m_pCore (NULL)
m_oCustomXmlWriter (sDirOutput, pDrawingConverter)
{
}
~FileWriter()
{
RELEASEOBJECT(m_pApp);
RELEASEOBJECT(m_pCore);
}
int getNextDocPr()
{
m_nDocPrIndex++;

View File

@ -29,8 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef READER_CLASSES
#define READER_CLASSES
@ -44,15 +42,15 @@ class SectPr
{
public:
std::wstring sHeaderFooterReference;
long W;
long H;
double W;
double H;
BYTE cOrientation;
long Left;
long Top;
long Right;
long Bottom;
long Header;
long Footer;
double Left;
double Top;
double Right;
double Bottom;
double Header;
double Footer;
bool TitlePg;
bool EvenAndOddHeaders;
BYTE SectionType;
@ -63,13 +61,6 @@ public:
std::wstring footnotePr;
std::wstring endnotePr;
bool bW;
bool bH;
bool bOrientation;
bool bLeft;
bool bTop;
bool bRight;
bool bBottom;
bool bHeader;
bool bFooter;
bool bTitlePg;
@ -78,16 +69,18 @@ public:
bool bPageNumStart;
SectPr()
{
W = Page_Width;
H = Page_Height;
cOrientation = orientation_Portrait;
Left = 30;
Top = 20;
Right = 15;
Bottom = 20;
Header = 12.5;
Footer = 12.5;
sHeaderFooterReference = _T("");
cols = _T("<w:cols w:space=\"708\"/>");
bW = false;
bH = false;
bOrientation = false;
bLeft = false;
bTop = false;
bRight = false;
bBottom = false;
bHeader = false;
bFooter = false;
bTitlePg = false;
@ -98,6 +91,14 @@ public:
std::wstring Write()
{
std::wstring sRes = _T("");
long nWidth = SerializeCommon::Round(W * g_dKoef_mm_to_twips);
long nHeight = SerializeCommon::Round(H * g_dKoef_mm_to_twips);
long nMLeft = SerializeCommon::Round(Left * g_dKoef_mm_to_twips);
long nMTop = SerializeCommon::Round(Top * g_dKoef_mm_to_twips);
long nMRight = SerializeCommon::Round(Right * g_dKoef_mm_to_twips);
long nMBottom = SerializeCommon::Round(Bottom * g_dKoef_mm_to_twips);
long nMHeader = SerializeCommon::Round(Header * g_dKoef_mm_to_twips);
long nMFooter = SerializeCommon::Round(Footer * g_dKoef_mm_to_twips);
if(!sHeaderFooterReference.empty())
sRes += sHeaderFooterReference;
@ -119,41 +120,19 @@ public:
}
sRes += L"<w:type w:val=\"" + sType + L"\"/>";
}
if((bW && bH) || bOrientation)
{
sRes += L"<w:pgSz";
if(bW && bH)
{
sRes += L" w:w=\"" + std::to_wstring(W) + L"\" w:h=\"" + std::to_wstring(H) + L"\"";
}
if(bOrientation)
{
if(orientation_Portrait != cOrientation)
sRes += L" w:orient=\"landscape\"";
else
sRes += L" w:orient=\"portrait\"";
}
sRes += L"<w:pgSz w:w=\"" + std::to_wstring(nWidth) + L"\" w:h=\"" + std::to_wstring(nHeight) + L"\"";
if(orientation_Portrait != cOrientation)
sRes += L" w:orient=\"landscape\"";
sRes += L"/>";
sRes += L"/>";
}
sRes += L"<w:pgMar w:top=\"" + std::to_wstring(nMTop) + L"\" w:right=\"" + std::to_wstring(nMRight) +
L"\" w:bottom=\"" + std::to_wstring(nMBottom) + L"\" w:left=\"" + std::to_wstring(nMLeft) + L"\" w:gutter=\"0\"";
if(bLeft || bTop || bRight || bBottom || bHeader || bFooter)
{
sRes += L"<w:pgMar";
if(bTop)
sRes += L" w:top=\"" + std::to_wstring(Top) + L"\"";
if(bRight)
sRes += L" w:right=\"" + std::to_wstring(Right) + L"\"";
if(bBottom)
sRes += L" w:bottom=\"" + std::to_wstring(Bottom) + L"\"";
if(bLeft)
sRes += L" w:left=\"" + std::to_wstring(Left) + L"\"";
if(bHeader)
sRes += L" w:header=\"" + std::to_wstring(Header) + L"\"";
if(bFooter)
sRes += L" w:footer=\"" + std::to_wstring(Footer) + L"\"";
sRes += L" w:gutter=\"0\"/>";
}
if(bHeader)
sRes += L" w:header=\"" + std::to_wstring(nMHeader) + L"\"";
if(bFooter)
sRes += L" w:footer=\"" + std::to_wstring(nMFooter) + L"\"";
sRes += L"/>";
if(!pgBorders.empty())
sRes += pgBorders;
@ -266,7 +245,6 @@ class Spacing
public:
bool bLineRule;
bool bLine;
bool bLineTwips;
bool bAfter;
bool bBefore;
bool bAfterAuto;
@ -274,16 +252,14 @@ public:
BYTE LineRule;
double Line;
long LineTwips;
long After;
long Before;
double After;
double Before;
bool AfterAuto;
bool BeforeAuto;
Spacing()
{
bLineRule = false;
bLine = false;
bLineTwips = false;
bAfter = false;
bBefore = false;
bAfterAuto = false;
@ -359,48 +335,10 @@ public:
sShd += L"<w:shd";
if(bValue)
{
switch(Value)
{
case SimpleTypes::shdClear : sShd += L" w:val=\"clear\""; break;
case SimpleTypes::shdDiagCross : sShd += L" w:val=\"diagCross\""; break;
case SimpleTypes::shdDiagStripe : sShd += L" w:val=\"diagStripe\""; break;
case SimpleTypes::shdHorzCross : sShd += L" w:val=\"horzCross\""; break;
case SimpleTypes::shdHorzStripe : sShd += L" w:val=\"horzStripe\""; break;
case SimpleTypes::shdNil : sShd += L" w:val=\"nil\""; break;
case SimpleTypes::shdPct10 : sShd += L" w:val=\"pct10\""; break;
case SimpleTypes::shdPct12 : sShd += L" w:val=\"pct12\""; break;
case SimpleTypes::shdPct15 : sShd += L" w:val=\"pct15\""; break;
case SimpleTypes::shdPct20 : sShd += L" w:val=\"pct20\""; break;
case SimpleTypes::shdPct25 : sShd += L" w:val=\"pct25\""; break;
case SimpleTypes::shdPct30 : sShd += L" w:val=\"pct30\""; break;
case SimpleTypes::shdPct35 : sShd += L" w:val=\"pct35\""; break;
case SimpleTypes::shdPct37 : sShd += L" w:val=\"pct37\""; break;
case SimpleTypes::shdPct40 : sShd += L" w:val=\"pct40\""; break;
case SimpleTypes::shdPct45 : sShd += L" w:val=\"pct45\""; break;
case SimpleTypes::shdPct5 : sShd += L" w:val=\"pct5\""; break;
case SimpleTypes::shdPct50 : sShd += L" w:val=\"pct50\""; break;
case SimpleTypes::shdPct55 : sShd += L" w:val=\"pct55\""; break;
case SimpleTypes::shdPct60 : sShd += L" w:val=\"pct60\""; break;
case SimpleTypes::shdPct62 : sShd += L" w:val=\"pct62\""; break;
case SimpleTypes::shdPct65 : sShd += L" w:val=\"pct65\""; break;
case SimpleTypes::shdPct70 : sShd += L" w:val=\"pct70\""; break;
case SimpleTypes::shdPct75 : sShd += L" w:val=\"pct75\""; break;
case SimpleTypes::shdPct80 : sShd += L" w:val=\"pct80\""; break;
case SimpleTypes::shdPct85 : sShd += L" w:val=\"pct85\""; break;
case SimpleTypes::shdPct87 : sShd += L" w:val=\"pct87\""; break;
case SimpleTypes::shdPct90 : sShd += L" w:val=\"pct90\""; break;
case SimpleTypes::shdPct95 : sShd += L" w:val=\"pct95\""; break;
case SimpleTypes::shdReverseDiagStripe : sShd += L" w:val=\"reverseDiagStripe\""; break;
case SimpleTypes::shdSolid : sShd += L" w:val=\"solid\""; break;
case SimpleTypes::shdThinDiagCross : sShd += L" w:val=\"thinDiagCross\""; break;
case SimpleTypes::shdThinDiagStripe : sShd += L" w:val=\"thinDiagStripe\""; break;
case SimpleTypes::shdThinHorzCross : sShd += L" w:val=\"thinHorzCross\""; break;
case SimpleTypes::shdThinHorzStripe : sShd += L" w:val=\"thinHorzStripe\""; break;
case SimpleTypes::shdThinReverseDiagStripe : sShd += L" w:val=\"thinReverseDiagStripe\""; break;
case SimpleTypes::shdThinVertStripe : sShd += L" w:val=\"thinVertStripe\""; break;
case SimpleTypes::shdVertStripe : sShd += L" w:val=\"vertStripe\""; break;
default : sShd += L" w:val=\"solid\""; break;
}
if(shd_Nil == Value)
sShd += L" w:val=\"nil\"";
else
sShd += L" w:val=\"clear\"";
}
sShd += L" w:color=\"auto\"";
if(bColor)
@ -425,7 +363,7 @@ class Tab
{
public:
BYTE Val;
long Pos;
double Pos;
BYTE Leader;
bool bLeader;
Tab()
@ -459,11 +397,11 @@ public:
docRGB HighLight;
std::wstring Shd;
std::wstring RStyle;
long Spacing;
double Spacing;
bool DStrikeout;
bool Caps;
bool SmallCaps;
long Position;
double Position;
BYTE FontHint;
bool BoldCs;
bool ItalicCs;
@ -704,11 +642,13 @@ public:
}
if(bSpacing)
{
pCStringWriter->WriteString(L"<w:spacing w:val=\"" + std::to_wstring(Spacing) + L"\"/>");
long nSpacing = SerializeCommon::Round( g_dKoef_mm_to_twips * Spacing);
pCStringWriter->WriteString(L"<w:spacing w:val=\"" + std::to_wstring(nSpacing) + L"\"/>");
}
if(bPosition)
{
std::wstring sPosition = L"<w:position w:val=\"" + std::to_wstring(Position) + L"\"/>";
long nPosition = SerializeCommon::Round( g_dKoef_mm_to_hps * Position);
std::wstring sPosition = L"<w:position w:val=\"" + std::to_wstring(nPosition) + L"\"/>";
pCStringWriter->WriteString(sPosition);
}
if(bFontSize)
@ -1061,26 +1001,6 @@ public:
};
class PaddingsToWrite
{
public:
long Left;
long Top;
long Right;
long Bottom;
bool bLeft;
bool bTop;
bool bRight;
bool bBottom;
public: PaddingsToWrite()
{
bLeft = false;
bTop = false;
bRight = false;
bBottom = false;
}
};
class PaddingsToWriteMM
{
public:
double Left;
double Top;
@ -1091,7 +1011,7 @@ public:
bool bTop;
bool bRight;
bool bBottom;
public: PaddingsToWriteMM()
public: PaddingsToWrite()
{
bLeft = false;
bTop = false;
@ -1108,7 +1028,7 @@ public:
double Y;
double Width;
double Height;
PaddingsToWriteMM Paddings;
PaddingsToWrite Paddings;
int m_nDocPr;
bool bMediaId;
@ -1247,8 +1167,8 @@ class docBorder
{
public:
docRGB Color;
long Space;
long Size;
double Space;
double Size;
BYTE Value;
CThemeColor ThemeColor;
@ -1281,11 +1201,13 @@ public:
}
if(bSize)
{
pCStringWriter->WriteString(L" w:sz=\"" + std::to_wstring(Size) + L"\"");
long nSize = SerializeCommon::Round(g_dKoef_mm_to_eightpoint * Size);
pCStringWriter->WriteString(L" w:sz=\"" + std::to_wstring(nSize) + L"\"");
}
if(bSpace)
{
pCStringWriter->WriteString(L" w:space=\"" + std::to_wstring(Space) + L"\"");
long nSpace = SerializeCommon::Round(g_dKoef_mm_to_pt * Space);
pCStringWriter->WriteString(L" w:space=\"" + std::to_wstring(nSpace) + L"\"");
}
if(bThemeColor && ThemeColor.IsNoEmpty())
{
@ -2152,8 +2074,8 @@ public:
class CDrawingPropertyWrapPoint
{
public:
__int64 X;
__int64 Y;
double X;
double Y;
bool bX;
bool bY;
@ -2200,29 +2122,29 @@ public:
long DataLength;
BYTE Type;
bool BehindDoc;
__int64 DistL;
__int64 DistT;
__int64 DistR;
__int64 DistB;
double DistL;
double DistT;
double DistR;
double DistB;
bool LayoutInCell;
unsigned long RelativeHeight;
bool BSimplePos;
__int64 EffectExtentL;
__int64 EffectExtentT;
__int64 EffectExtentR;
__int64 EffectExtentB;
__int64 Width;
__int64 Height;
double EffectExtentL;
double EffectExtentT;
double EffectExtentR;
double EffectExtentB;
double Width;
double Height;
BYTE PositionHRelativeFrom;
BYTE PositionHAlign;
__int64 PositionHPosOffset;
double PositionHPctOffset;
double PositionHPosOffset;
double PositionHPctOffset;
BYTE PositionVRelativeFrom;
BYTE PositionVAlign;
__int64 PositionVPosOffset;
double PositionVPosOffset;
double PositionVPctOffset;
__int64 SimplePosX;
__int64 SimplePosY;
double SimplePosX;
double SimplePosY;
std::wstring sChartRels;
std::wstring sSizeRelH;
std::wstring sSizeRelV;
@ -2312,17 +2234,24 @@ public:
{
if(bWidth && bHeight)
{
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
if(false == bChart)
sXml += L"<wp:inline xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height) + L"\"/>";
distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstring(emuWidth) + L"\" cy=\"" + std::to_wstring(emuHeight) + L"\"/>";
else
sXml += L"<w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\">\
<wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height) + L"\"/>";
<wp:extent cx=\"" + std::to_wstring(emuWidth) + L"\" cy=\"" + std::to_wstring(emuHeight) + L"\"/>";
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
{
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(EffectExtentL) + L"\" t=\"" + std::to_wstring(EffectExtentT) +
L"\" r=\"" + std::to_wstring(EffectExtentR) + L"\" b=\"" + std::to_wstring(EffectExtentB) + L"\"/>";
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(emuEffectExtentL) + L"\" t=\"" + std::to_wstring(emuEffectExtentT) +
L"\" r=\"" + std::to_wstring(emuEffectExtentR) + L"\" b=\"" + std::to_wstring(emuEffectExtentB) + L"\"/>";
}
if(!sDocPr.empty())
@ -2364,13 +2293,13 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
__int64 emuDistB = 0;
if(bDistL)
emuDistL = DistL;
emuDistL = (__int64)(g_dKoef_mm_to_emu * DistL);
if(bDistT)
emuDistT = DistT;
emuDistT = (__int64)(g_dKoef_mm_to_emu * DistT);
if(bDistR)
emuDistR = DistR;
emuDistR = (__int64)(g_dKoef_mm_to_emu * DistR);
if(bDistB)
emuDistB = DistB;
emuDistB = (__int64)(g_dKoef_mm_to_emu * DistB);
int nSimplePos = 0;
if(bBSimplePos && BSimplePos)
nSimplePos = 1;
@ -2399,10 +2328,10 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
__int64 emuX = 0;
if(bSimplePosX)
emuX = SimplePosX;
emuX = (__int64)(g_dKoef_mm_to_emu * SimplePosX);
__int64 emuY = 0;
if(bSimplePosY)
emuY = SimplePosY;
emuY = (__int64)(g_dKoef_mm_to_emu * SimplePosY);
sXml += L"<wp:simplePos x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
if(bPositionHRelativeFrom && (bPositionHAlign || bPositionHPosOffset || bPositionHPctOffset))
@ -2433,7 +2362,8 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
}
else if(bPositionHPosOffset)
{
sContent = L"<wp:posOffset>" + std::to_wstring(PositionHPosOffset) + L"</wp:posOffset>";
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionHPosOffset);
sContent = L"<wp:posOffset>" + std::to_wstring(emuPosOffset) + L"</wp:posOffset>";
}
else if(bPositionHPctOffset)
{
@ -2470,7 +2400,8 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
}
else if(bPositionVPosOffset)
{
sContent = L"<wp:posOffset>" + std::to_wstring(PositionVPosOffset) + L"</wp:posOffset>";
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionVPosOffset);
sContent = L"<wp:posOffset>" + std::to_wstring(emuPosOffset) + L"</wp:posOffset>";
}
else if(bPositionVPctOffset)
{
@ -2479,13 +2410,20 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
}
sXml += L"<wp:positionV relativeFrom=\"" + sRelativeFrom + L"\">" + sContent + L"</wp:positionV>";
}
sXml += L"<wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height)+ L"\"/>";
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
sXml += L"<wp:extent cx=\"" + std::to_wstring(emuWidth) + L"\" cy=\"" + std::to_wstring(emuHeight)+ L"\"/>";
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
{
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(EffectExtentL) +
L"\" t=\"" + std::to_wstring(EffectExtentT) + L"\" r=\"" + std::to_wstring(EffectExtentR) +
L"\" b=\"" + std::to_wstring(EffectExtentB) + L"\"/>";
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(emuEffectExtentL) +
L"\" t=\"" + std::to_wstring(emuEffectExtentT) + L"\" r=\"" + std::to_wstring(emuEffectExtentR) +
L"\" b=\"" + std::to_wstring(emuEffectExtentB) + L"\"/>";
}
if(bDrawingPropertyWrap && DrawingPropertyWrap.bWrappingType)
{
@ -2516,7 +2454,9 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
if(DrawingPropertyWrap.bStart && DrawingPropertyWrap.Start.bX && DrawingPropertyWrap.Start.bY)
{
sXml += L"<wp:start x=\"" + std::to_wstring(DrawingPropertyWrap.Start.X) + L"\" y=\"" + std::to_wstring(DrawingPropertyWrap.Start.Y) + L"\"/>";
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.X);
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.Y);
sXml += L"<wp:start x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
}
for(size_t i = 0; i < DrawingPropertyWrap.Points.size(); ++i)
@ -2524,7 +2464,9 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
CDrawingPropertyWrapPoint* pWrapPoint = DrawingPropertyWrap.Points[i];
if(pWrapPoint->bX && pWrapPoint->bY)
{
sXml += L"<wp:lineTo x=\"" + std::to_wstring(pWrapPoint->X) + L"\" y=\"" + std::to_wstring(pWrapPoint->Y) + L"\"/>";
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->X);
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->Y);
sXml += L"<wp:lineTo x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
}
}
sXml += L"</wp:wrapPolygon>";

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
namespace Writers
{
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults>");
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
static std::wstring g_string_set_End = _T("</w:settings>");
class SettingWriter

View File

@ -34,9 +34,8 @@
#include "BinReaderWriterDefines.h"
#include "../../Common/DocxFormat/Source/MathEquation/OutputDev.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_OMath.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Shared.h"
#include "../../Common/DocxFormat/Source/MathEquation/OutputDev.h"
#include <stack>
namespace MathEquation

View File

@ -36,6 +36,17 @@ namespace BinDocxRW
{
const double eps = 0.001;
const int Page_Width = 210;
const int Page_Height = 297;
const int X_Left_Margin = 30; // 3 cm
const int X_Right_Margin = 15; // 1.5 cm
const int Y_Bottom_Margin = 20; // 2 cm
const int Y_Top_Margin = 20; // 2 cm
const double Y_Default_Header = 12.5; // 1.25 cm расстояние от верха страницы до верха верхнего колонтитула
const double Y_Default_Footer = 12.5; // 1.25 cm расстояние от низа страницы до низа нижнего колонтитула
const int shd_Clear = 0;
const int shd_Nil = 1;
@ -145,9 +156,7 @@ extern int g_nCurFormatVersion;
Endnotes = 11,
Background = 12,
VbaProject = 13,
App = 15,
Core = 16,
DocumentComments = 17
App = 14
};}
namespace c_oSerSigTypes{enum c_oSerSigTypes
{
@ -302,9 +311,7 @@ extern int g_nCurFormatVersion;
RowBandSize = 15,
ColBandSize = 16,
tblCaption = 17,
tblDescription = 18,
TableIndTwips = 19,
TableCellSpacingTwips = 20
tblDescription = 18
};}
namespace c_oSer_tblpPrType{enum c_oSer_tblpPrType
{
@ -321,9 +328,7 @@ extern int g_nCurFormatVersion;
VertAnchor = 3,
TblpY = 4,
TblpYSpec = 5,
Paddings = 6,
TblpXTwips = 7,
TblpYTwips = 8
Paddings = 6
};}
namespace c_oSerProp_pPrType{enum c_oSerProp_pPrType
{
@ -360,14 +365,7 @@ extern int g_nCurFormatVersion;
numPr_Ins = 32,
pPrChange = 33,
outlineLvl = 34,
Tab_Item_Leader = 35,
Ind_LeftTwips = 36,
Ind_RightTwips = 37,
Ind_FirstLineTwips = 38,
Spacing_LineTwips = 39,
Spacing_BeforeTwips = 40,
Spacing_AfterTwips = 41,
Tab_Item_PosTwips = 42
Tab_Item_Leader = 35
};}
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
{
@ -408,9 +406,7 @@ extern int g_nCurFormatVersion;
Ins = 34,
rPrChange = 35,
MoveFrom = 36,
MoveTo = 37,
SpacingTwips = 38,
PositionHps = 39
MoveTo = 37
};}
namespace c_oSerProp_rowPrType{enum c_oSerProp_rowPrType
{
@ -431,9 +427,7 @@ extern int g_nCurFormatVersion;
TableHeader = 14,
Del = 15,
Ins = 16,
trPrChange = 17,
TableCellSpacingTwips = 18,
Height_ValueTwips = 19
trPrChange = 17
};}
namespace c_oSerProp_cellPrType{enum c_oSerProp_cellPrType
{
@ -523,8 +517,7 @@ extern int g_nCurFormatVersion;
tblGridChange = 9,
Sdt = 10,
BookmarkStart = 11,
BookmarkEnd = 12,
tblGrid_ItemTwips = 13
BookmarkEnd = 12
};}
namespace c_oSerRunType{enum c_oSerRunType
{
@ -614,37 +607,26 @@ extern int g_nCurFormatVersion;
SizeRelV = 28,
Embedded = 29,
GraphicFramePr = 30,
DocPr = 31,
DistBEmu = 32,
DistLEmu = 33,
DistREmu = 34,
DistTEmu = 35
DocPr = 31
};}
namespace c_oSerEffectExtent{enum c_oSerEffectExtent
{
Left = 0,
Top = 1,
Right = 2,
Bottom = 3,
LeftEmu = 4,
TopEmu = 5,
RightEmu = 6,
BottomEmu = 7
Bottom = 3
};}
namespace c_oSerExtent{enum c_oSerExtent
{
Cx = 0,
Cy = 1,
CxEmu = 2,
CyEmu = 3
Cy = 1
};}
namespace c_oSerPosHV{enum c_oSerPosHV
{
RelativeFrom = 0,
Align = 1,
PosOffset = 2,
PctOffset = 3,
PosOffsetEmu = 4
PctOffset = 3
};}
namespace c_oSerSizeRelHV{enum c_oSerSizeRelHV
{
@ -654,9 +636,7 @@ extern int g_nCurFormatVersion;
namespace c_oSerSimplePos{enum c_oSerSimplePos
{
X = 0,
Y = 1,
XEmu = 2,
YEmu = 3
Y = 1
};}
namespace c_oSerWrapSquare{enum c_oSerWrapSquare
{
@ -665,28 +645,20 @@ extern int g_nCurFormatVersion;
DistR = 2,
DistB = 3,
WrapText = 4,
EffectExtent = 5,
DistLEmu = 6,
DistTEmu = 7,
DistREmu = 8,
DistBEmu = 9
EffectExtent = 5
};}
namespace c_oSerWrapThroughTight{enum c_oSerWrapThroughTight
{
DistL = 0,
DistR = 1,
WrapText = 2,
WrapPolygon = 3,
DistLEmu = 4,
DistREmu = 5
WrapPolygon = 3
};}
namespace c_oSerWrapTopBottom{enum c_oSerWrapTopBottom
{
DistT = 0,
DistB = 1,
EffectExtent = 2,
DistTEmu = 3,
DistBEmu = 4
EffectExtent = 2
};}
namespace c_oSerWrapPolygon{enum c_oSerWrapPolygon
{
@ -698,9 +670,7 @@ extern int g_nCurFormatVersion;
namespace c_oSerPoint2D{enum c_oSerPoint2D
{
X = 0,
Y = 1,
XEmu = 2,
YEmu = 3
Y = 1
};}
namespace c_oSerBorderType{enum c_oSerBorderType
{
@ -708,9 +678,7 @@ extern int g_nCurFormatVersion;
Space = 1,
Size = 2,
Value = 3,
ColorTheme = 4,
SpacePoint = 5,
Size8Point = 6
ColorTheme = 4
};}
namespace c_oSerShdType{enum c_oSerShdType
{
@ -723,11 +691,7 @@ extern int g_nCurFormatVersion;
left = 0,
top = 1,
right = 2,
bottom = 3,
leftTwips = 4,
topTwips = 5,
rightTwips = 6,
bottomTwips = 7
bottom = 3
};}
namespace c_oSerMarginsType{enum c_oSerMarginsType
{
@ -761,9 +725,7 @@ extern int g_nCurFormatVersion;
{
W = 0,
H = 1,
Orientation = 2,
WTwips = 3,
HTwips = 4
Orientation = 2
};}
namespace c_oSer_pgMarType{enum c_oSer_pgMarType
{
@ -772,13 +734,7 @@ extern int g_nCurFormatVersion;
Right = 2,
Bottom = 3,
Header = 4,
Footer = 5,
LeftTwips = 6,
TopTwips = 7,
RightTwips = 8,
BottomTwips = 9,
HeaderTwips = 10,
FooterTwips = 11
Footer = 5
};}
namespace c_oSer_ColorType{enum c_oSer_ColorType
{
@ -809,10 +765,7 @@ extern int g_nCurFormatVersion;
EndnotePr = 5,
SdtGlobalColor = 6,
SdtGlobalShowHighlight = 7,
Compat = 8,
DefaultTabStopTwips = 9,
DecimalSymbol = 10,
ListSeparator = 11
Compat = 8
};}
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
{
@ -907,8 +860,7 @@ extern int g_nCurFormatVersion;
namespace c_oSer_OMathBottomNodesValType{enum c_oSer_OMathBottomNodesValType
{
Val = 0,
AlnAt = 1,
ValTwips = 2
AlnAt = 1
};}
namespace c_oSer_OMathContentType{enum c_oSer_OMathContentType
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -260,7 +260,8 @@ namespace BinXlsxRW{
{
OOX::Spreadsheet::CTableFile* pTable = new OOX::Spreadsheet::CTableFile(NULL);
pTable->m_oTable.Init();
pTable->m_oTable->m_oDisplayName = L"Table1";
pTable->m_oTable->m_oDisplayName.Init();
pTable->m_oTable->m_oDisplayName->append(L"Table1");
pTable->m_oTable->m_oRef.Init();
pTable->m_oTable->m_oRef->SetValue(OOX::Spreadsheet::CCell::combineRef(m_nRow1 - 1, m_nCol1 - 1) + L":" + OOX::Spreadsheet::CCell::combineRef(m_nRow2 - 1, m_nCol2 - 1));
pTable->m_oTable->m_oTotalsRowCount.Init();

View File

@ -30,20 +30,15 @@
*
*/
#include "DocxSerializer.h"
#include "../BinWriter/BinWriters.h"
#include "../BinReader/Readers.h"
#include "../../ASCOfficePPTXFile/ASCOfficeDrawingConverter.h"
#include "../../ASCOfficePPTXFile/Editor/FontPicker.h"
#include "FontProcessor.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../DesktopEditor/common/File.h"
#include "../../DesktopEditor/common/Path.h"
#include "../../DesktopEditor/common/SystemUtils.h"
#include "../BinWriter/BinWriters.h"
#include "../BinReader/Readers.h"
#include "../../ASCOfficePPTXFile/Editor/FontPicker.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
@ -301,28 +296,33 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
OOX::CPath DocProps = std::wstring(_T("docProps"));
if (NULL != m_pCurFileWriter->m_pApp)
OOX::CApp* pApp = new OOX::CApp(NULL);
if (pApp)
{
m_pCurFileWriter->m_pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
}
else
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
if (sApplication.empty())
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
pApp->SetApplication(sApplication);
#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, *pContentTypes);
delete pApp;
}
OOX::CCore* pCore = new OOX::CCore(NULL);
if (pCore)
{
OOX::CApp pApp(NULL);
pApp.SetDefaults();
pApp.write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
}
if (NULL != m_pCurFileWriter->m_pCore)
{
m_pCurFileWriter->m_pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
}
else
{
OOX::CCore pCore(NULL);
pCore.SetDefaults();
pCore.write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
}
pCore->SetCreator(_T(""));
pCore->SetLastModifiedBy(_T(""));
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
delete pCore;
}
/////////////////////////////////////////////////////////////////////////////////////
m_pCurFileWriter->Write();
pContentTypes->Write(sDstPath);

View File

@ -150,32 +150,28 @@ namespace BinXlsxRW{
m_pExternalDrawingConverter->SetDstContentRels();
//получаем sThemePath из bsFilename предполагая что папка theme находится на уровень выше bsFilename
std::wstring sDrawingsPath;
std::wstring sThemePath;
std::wstring sEmbedingPath;
std::wstring sContentTypePath;
size_t nIndex = (int)sFilepath.rfind(FILE_SEPARATOR_CHAR);
int nIndex = (int)sFilepath.rfind(FILE_SEPARATOR_CHAR);
nIndex = (int)sFilepath.rfind(FILE_SEPARATOR_CHAR, nIndex - 1);
if(std::wstring::npos != nIndex)
if(-1 != nIndex)
{
std::wstring sFilepathLeft = sFilepath.substr(0, nIndex + 1);
sThemePath = sFilepathLeft + L"theme";
sEmbedingPath = sFilepathLeft + L"embeddings";
sDrawingsPath = sFilepathLeft + L"drawings";
}
if (pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX) sContentTypePath = L"/word/charts/";
else if (pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_XLSX) sContentTypePath = L"/xl/charts/";
else sContentTypePath = L"/ppt/charts/";
//todo theme path
BinXlsxRW::SaveParams oSaveParams(sDrawingsPath, sThemePath, m_pExternalDrawingConverter->GetContentTypes());
BinXlsxRW::SaveParams oSaveParams(sThemePath, m_pExternalDrawingConverter->GetContentTypes());
OOX::Spreadsheet::CChartSpace oChartSpace(NULL);
BinXlsxRW::BinaryChartReader oBinaryChartReader(*pReader, oSaveParams, m_pExternalDrawingConverter);
oBinaryChartReader.ReadCT_ChartSpace(lLength, &oChartSpace);
oBinaryChartReader.ReadCT_ChartSpace(lLength, &oChartSpace.m_oChartSpace);
if(oChartSpace.isValid())
{
@ -211,11 +207,13 @@ namespace BinXlsxRW{
OOX::CSystemUtility::CreateDirectories(pathRelsDir.GetPath());
oChartSpace.write(sFilepath, sContentTypePath, *pReader->m_pRels->m_pManager->m_pContentTypes);
oChartSpace.write2(sFilepath);
OOX::CPath pathRelsFile = pathRelsDir + FILE_SEPARATOR_STR + strFilename + _T(".rels");
m_pExternalDrawingConverter->SaveDstContentRels(pathRelsFile.GetPath());
pReader->m_pRels->m_pManager->m_pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml", sContentTypePath, strFilename);
bRes = true;
}
return bRes;
@ -267,11 +265,4 @@ namespace BinXlsxRW{
NSDirectory::DeleteDirectory(sTempDir);
return res;
}
bool CXlsxSerializer::hasPivot(const std::wstring& sSrcPath)
{
//todo CXlsx
std::wstring sData;
NSFile::CFileBinary::ReadAllTextUtf8(sSrcPath + FILE_SEPARATOR_STR + L"[Content_Types].xml", sData);
return std::wstring::npos != sData.find(OOX::Spreadsheet::FileTypes::PivotTable.OverrideType());
}
};

View File

@ -74,7 +74,6 @@ namespace BinXlsxRW {
void setIsNoBase64 (bool bIsNoBase64);
bool writeChartXlsx (const std::wstring& sDstFile ,const OOX::Spreadsheet::CChartSpace& oChart);
bool hasPivot (const std::wstring& sSrcPath);
};
}
#endif // #ifndef XLSX_SERIALIZER

View File

@ -32,8 +32,6 @@ SOURCES += \
../../XlsxSerializerCom/Reader/ChartFromToBinary.cpp \
../../XlsxSerializerCom/Reader/CommonWriter.cpp \
../../XlsxSerializerCom/Reader/CSVReader.cpp \
../../XlsxSerializerCom/Reader/BinaryWriter.cpp \
../../XlsxSerializerCom/Writer/BinaryReader.cpp \
../../XlsxSerializerCom/Writer/CSVWriter.cpp \
../../OfficeCryptReader/source/ECMACryptFile.cpp \
../../OfficeCryptReader/source/CryptTransform.cpp \

View File

@ -53,10 +53,6 @@
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181AD1C77274E00B2952B /* FileDownloader.h */; };
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */; };
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */; };
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */; };
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */; };
8AE10E6E222824F400A542DE /* BinaryWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E6D222824F400A542DE /* BinaryWriter.cpp */; };
8AE10E702228251000A542DE /* BinaryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E6F2228251000A542DE /* BinaryReader.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -107,10 +103,6 @@
69F181AD1C77274E00B2952B /* FileDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader.h; path = ../../../Common/FileDownloader/FileDownloader.h; sourceTree = "<group>"; };
8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileDownloader.cpp; path = ../../../Common/FileDownloader/FileDownloader.cpp; sourceTree = "<group>"; };
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader_private.h; path = ../../../Common/FileDownloader/FileDownloader_private.h; sourceTree = "<group>"; };
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustormXmlWriter.cpp; sourceTree = "<group>"; };
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustormXmlWriter.h; sourceTree = "<group>"; };
8AE10E6D222824F400A542DE /* BinaryWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinaryWriter.cpp; sourceTree = "<group>"; };
8AE10E6F2228251000A542DE /* BinaryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinaryReader.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -157,8 +149,6 @@
children = (
17E17EEB1AC4544900BEA2EA /* ChartWriter.h */,
17E17EEC1AC4544900BEA2EA /* CommentsWriter.h */,
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */,
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */,
17A765271B0F3DC30046BC0B /* DefaultThemeWriter.h */,
17E17EF01AC4544900BEA2EA /* DocumentRelsWriter.h */,
17E17EF11AC4544900BEA2EA /* DocumentWriter.h */,
@ -219,7 +209,6 @@
isa = PBXGroup;
children = (
17E17F211AC4549B00BEA2EA /* BinaryWriter.h */,
8AE10E6D222824F400A542DE /* BinaryWriter.cpp */,
17E17F221AC4549B00BEA2EA /* ChartFromToBinary.cpp */,
17E17F231AC4549B00BEA2EA /* ChartFromToBinary.h */,
17E17F241AC4549B00BEA2EA /* CommonWriter.cpp */,
@ -235,7 +224,6 @@
children = (
17E17F2D1AC4549B00BEA2EA /* BinaryCommonReader.h */,
17E17F2E1AC4549B00BEA2EA /* BinaryReader.h */,
8AE10E6F2228251000A542DE /* BinaryReader.cpp */,
17E17F2F1AC4549B00BEA2EA /* CSVWriter.cpp */,
17E17F301AC4549B00BEA2EA /* CSVWriter.h */,
);
@ -304,7 +292,6 @@
17C1FEBC1ACC42C4006B99B3 /* DocxSerializer.h in Headers */,
17C1FEBD1ACC42C4006B99B3 /* FileWriter.h in Headers */,
17C1FEBE1ACC42C4006B99B3 /* CSVWriter.h in Headers */,
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -359,7 +346,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */,
17C1FE961ACC42C4006B99B3 /* Common.cpp in Sources */,
17C1FE971ACC42C4006B99B3 /* ChartFromToBinary.cpp in Sources */,
17C1FE981ACC42C4006B99B3 /* CSVReader.cpp in Sources */,
@ -368,13 +354,11 @@
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
8AE10E702228251000A542DE /* BinaryReader.cpp in Sources */,
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */,
8AE10E6E222824F400A542DE /* BinaryWriter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -391,12 +375,18 @@
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
NODOCX,
_USE_XMLLITE_READER_,
USE_LITE_READER,
USE_ATL_CSTRING,
USE_AVSOFFICESTUDIO_XMLUTILS,
SOLUTION_ASCOFFICEDOCXFILE2,
DONT_WRITE_EMBEDDED_FONTS,
_USE_LIBXML2_READER_,
LIBXML_READER_ENABLED,
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
_XCODE,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
@ -424,12 +414,18 @@
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
NODOCX,
_USE_XMLLITE_READER_,
USE_LITE_READER,
USE_ATL_CSTRING,
USE_AVSOFFICESTUDIO_XMLUTILS,
SOLUTION_ASCOFFICEDOCXFILE2,
DONT_WRITE_EMBEDDED_FONTS,
_USE_LIBXML2_READER_,
LIBXML_READER_ENABLED,
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
_XCODE,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;

View File

@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
@ -23,30 +23,27 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
@ -55,16 +52,16 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>

View File

@ -105,7 +105,7 @@ HRESULT convert_single(std::wstring srcFileName)
}
_CP_LOG << L"[info] " << srcFileName << std::endl;
nResult = ConvertODF2OOXml(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", srcTempPath2, L"", NULL);
nResult = ConvertODF2OOXml(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", srcTempPath2, L"password", NULL);
if (srcTempPath != srcFileName)
{

View File

@ -210,41 +210,25 @@ namespace formulasconvert {
bool odf2oox_converter::Impl::find_first_last_ref(std::wstring const & expr, std::wstring & table,std::wstring & ref_first,std::wstring & ref_last)
{
std::wstring workstr = expr;
workstr = boost::regex_replace(
workstr,
boost::wregex(L"('.*?')|(\".*?\")"),
&convert_scobci, boost::match_default | boost::format_all);
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, workstr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
bool res = false;
if (splitted.size() == 2)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[1];
res = true;
}
boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
if (splitted.size() == 3)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[2];
res = true;
return true;
}
if (splitted.size() == 4)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[3];
res = true;
return true;
}
replace_tmp_back( table );
return res;
return false;
}
bool odf2oox_converter::Impl::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)

View File

@ -188,7 +188,7 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSele
if ((0 == expr.find(L"KAVYCHKA")) && (expr.length() - 8 == expr.rfind(L"KAVYCHKA") ))
return;
boost::wregex re(L"(([:$!])+)|(\\S+\\d+)");
boost::wregex re(L"([:$!])+");
boost::wsmatch result;
bool b = boost::regex_search(expr, result, re);

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:ASCOfficeOdfFile.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -1 +0,0 @@
DO NOT REMOVE FOLDER FOR XCODE

View File

@ -146,7 +146,6 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
process_note_ (noNote),
new_list_style_number_ (0),
current_margin_left_ (0),
current_outline_level_ (-1),
is_rtl_ (false),
is_delete_text_ (false),
delayed_converting_ (false),
@ -370,9 +369,6 @@ void docx_conversion_context::start_index_content()
sInstrText += L" \\n "+ std::to_wstring(table_content_context_.min_outline_level) + L"-" +
std::to_wstring(table_content_context_.max_outline_level);
}
else if (table_content_context_.type_table_content == 1)
sInstrText += L" \\o";
if (false == table_content_context_.outline_level_styles.empty())
{
sInstrText += L" \\t \"";
@ -856,12 +852,9 @@ namespace
}
}
std::wstring StyleDisplayName(const std::wstring & Name, const std::wstring & DisplayName, odf_types::style_family::type Type)
std::wstring StyleDisplayName(const std::wstring & Name, odf_types::style_family::type Type)
{
if (!DisplayName.empty())
return DisplayName;
if (!Name.empty())
if (!Name.empty())
return Name;
else
{
@ -937,8 +930,8 @@ mc:Ignorable=\"w14 wp14\">";
for (size_t i = 0; i < numIds.size(); i++)
{
strm << L"<w:num w:numId=\"" << numIds[i] << L"\">";
strm << L"<w:abstractNumId w:val=\"" << numIds[i] << "\"/>";
strm << L"<w:num w:numId=\"" << numIds[i] << L"\" >";
strm << L"<w:abstractNumId w:val=\"" << numIds[i] << "\" />";
strm << L"</w:num>";
}
@ -964,19 +957,19 @@ void docx_conversion_context::process_fonts()
if (!arFonts[i]) continue;
if (arFonts[i]->name().empty()) continue;
strm << L"<w:font w:name=\"" << arFonts[i]->name() << L"\">";
strm << L"<w:font w:name=\"" << arFonts[i]->name() << L"\" >";
if (!arFonts[i]->charset().empty())
strm << L"<w:charset w:val=\"" << arFonts[i]->charset() <<"\"/>";
strm << L"<w:charset w:val=\"" << arFonts[i]->charset() <<"\" />";
if (!arFonts[i]->family().empty())
strm << L"<w:family w:val=\"" << arFonts[i]->family() << "\"/>";
strm << L"<w:family w:val=\"" << arFonts[i]->family() << "\" />";
if (!arFonts[i]->pitch().empty())
strm << L"<w:pitch w:val=\"" << arFonts[i]->pitch() << "\"/>";
strm << L"<w:pitch w:val=\"" << arFonts[i]->pitch() << "\" />";
if (!arFonts[i]->alt_name().empty())
strm << L"<w:altName w:val=\"" << arFonts[i]->alt_name() << "\"/>";
strm << L"<w:altName w:val=\"" << arFonts[i]->alt_name() << "\" />";
strm << L"</w:font>";
}
@ -999,7 +992,7 @@ void docx_conversion_context::process_styles()
_Wostream << L"xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" ";
_Wostream << L"xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" ";
_Wostream << L"xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" ";
_Wostream << L"mc:Ignorable=\"w14\">";
_Wostream << L"mc:Ignorable=\"w14\"> ";
if (odf_reader::odf_document * doc = root())
{
@ -1069,34 +1062,30 @@ void docx_conversion_context::process_styles()
}
_Wostream << L">";
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_name(), arStyles[i]->type());
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->type());
_Wostream << L"<w:name w:val=\"" << XmlUtils::EncodeXmlString(displayName) << L"\"/>";
_Wostream << L"<w:name w:val=\"" << displayName << L"\" />";
if (odf_reader::style_instance * baseOn = arStyles[i]->parent())
{
const std::wstring basedOnId = styles_map_.get(baseOn->name(), baseOn->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
}
else if (!arStyles[i]->is_default() && styles_map_.check(L"", arStyles[i]->type()))
{
const std::wstring basedOnId = styles_map_.get(L"", arStyles[i]->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
}
else
{
_Wostream << L"<w:qFormat/>";
}
if (odf_reader::style_instance * next = arStyles[i]->next())
{
const std::wstring nextId = styles_map_.get(next->name(), next->type());
_Wostream << L"<w:next w:val=\"" << nextId << "\"/>";
_Wostream << L"<w:next w:val=\"" << nextId << "\" />";
}
else if (arStyles[i]->is_default())
{
// self
_Wostream << L"<w:next w:val=\"" << id << "\"/>";
_Wostream << L"<w:next w:val=\"" << id << "\" />";
}
if (odf_reader::style_content * content = arStyles[i]->content())
@ -1345,7 +1334,6 @@ void docx_conversion_context::end_automatic_style()
in_automatic_style_ = false;
automatic_parent_style_.clear();
tabs_context_.clear();
current_outline_level_ = -1;
}
bool docx_conversion_context::in_automatic_style()
@ -1567,8 +1555,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
)
{
process_page_break_after(styleInst);
if (styleInst->is_automatic())
if (styleInst->is_automatic())
{
if (odf_reader::style_content * styleContent = styleInst->content())
{
@ -1606,10 +1593,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
}
}
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
{
set_outline_level(*Attr->outline_level_ - 1);
}
styleContent->docx_convert(*this);
end_automatic_style();
@ -1648,6 +1632,12 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
output_stream() << L"</w:pPr>";
}
}
else if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
{
output_stream() << L"<w:pPr>";
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
output_stream() << L"</w:pPr>";
}
return 1;
}
}

View File

@ -916,9 +916,6 @@ public:
void set_margin_left(int val) {current_margin_left_ = val;}
int get_margin_left() {return current_margin_left_;}
void set_outline_level(int val) {current_outline_level_ = val;}
int get_outline_level() {return current_outline_level_;}
void set_process_note (NoteType Val) { process_note_ = Val; }
NoteType get_process_note () const { return process_note_; }
void add_note_reference ();
@ -1034,7 +1031,6 @@ private:
std::wstring current_alphabetic_index_;
int current_margin_left_;
int current_outline_level_;
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
NoteType process_note_;

View File

@ -123,17 +123,16 @@ public:
if (sExt == L"wmv") return typeVideo;
if (sExt == L"avi") return typeVideo;
if (sExt == L"wmv") return typeVideo;
if (sExt == L"wma") return typeAudio;
if (sExt == L"wav") return typeAudio;
if (sExt == L"mp3") return typeAudio;
if (sExt == L"m4a") return typeAudio;
if (sExt == L"m4v") return typeVideo;
if (sExt == L"mp4") return typeVideo;
if (sExt == L"mov") return typeVideo;
if (sExt == L"mkv") return typeVideo;
if (sExt == L"webm") return typeVideo;
if (sExt == L"wmv") return typeVideo;
if (sExt == L"wma") return typeAudio;
if (sExt == L"wav") return typeAudio;
if (sExt == L"mp3") return typeAudio;
if (sExt == L"m4a") return typeAudio;
return typeMedia;
}

View File

@ -122,7 +122,6 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
oox_chart_shape shape;
_CP_OPT(bool) boolVal;
_CP_OPT(std::wstring) strVal;
_CP_OPT(double) doubleVal;
oox_title title;
title.set_content(content_.title_);//todo нужно задать понармальному layout
@ -147,23 +146,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
CP_XML_ATTR(L"val", "minMax");//default
}
}
odf_reader::GetProperty(content_.properties_,L"maximum", doubleVal);
if (doubleVal)
{
CP_XML_NODE(L"c:max")
{
CP_XML_ATTR(L"val", *doubleVal);
}
}
odf_reader::GetProperty(content_.properties_,L"minimum", doubleVal);
if (doubleVal)
{
CP_XML_NODE(L"c:min")
{
CP_XML_ATTR(L"val", *doubleVal);
}
}
odf_reader::GetProperty(content_.properties_,L"logarithmic", boolVal);
odf_reader::GetProperty(content_.properties_,L"logarithmic",boolVal);
if ((boolVal == true) && (boolVal.get()==true))
{
CP_XML_NODE(L"c:logBase")

View File

@ -59,19 +59,12 @@ oox_chart_series::oox_chart_series()
bLocalTable_ = false;
labelPosEnabled_ = true;
}
void oox_chart_series::setName(const std::wstring &value)
void oox_chart_series::setName(std::wstring &value)
{
name_ = value;
name_=value;
}
void oox_chart_series::setLabels(const std::wstring &formula, std::vector<std::wstring> & cash)
{
formulasconvert::odf2oox_converter converter;
label_.present = true;
label_.formula = converter.convert_chart_distance(formula);
label_.str_cache = cash;
}
void oox_chart_series::setFormula(int ind, const std::wstring &value, const std::wstring & formatCode, bool link_to_source)
void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & formatCode, bool link_to_source)
{
formulasconvert::odf2oox_converter converter;
@ -144,7 +137,6 @@ void oox_chart_series::parse_properties()
data_labels_->set_position(*intVal);
}
}
void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values)
{
values_[ind].present = true;
@ -223,44 +215,6 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
shape.set(content_.graphic_properties_, content_.fill_);
shape.oox_serialize(_Wostream);
if (label_.present)
{
CP_XML_NODE(L"c:tx")
{
CP_XML_NODE(L"c:strRef")
{
if (!label_.formula.empty())
{
CP_XML_NODE(L"c:f")
{
CP_XML_STREAM() << label_.formula;
}
}
if (false == label_.str_cache.empty())
{
CP_XML_NODE(L"c:strCache")
{
CP_XML_NODE(L"c:ptCount")
{
CP_XML_ATTR(L"val", label_.str_cache.size());
}
for (size_t i = 0; i < label_.str_cache.size(); i++)
{
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", i);
CP_XML_NODE(L"c:v")
{
CP_XML_STREAM() << label_.str_cache[i];
}
}
}
}
}
}
}
}
for (int i = 0; i < 5; i++)
{
if (values_[i].present)

View File

@ -56,20 +56,17 @@ public:
virtual void oox_serialize(std::wostream & _Wostream) = 0;
bool labelPosEnabled_;
_oox_chart_values values_[5]; //cat, common, x, y, bubble,
_oox_strRef label_; //tx (Series Text) §21.2.2.215
_oox_chart_values values_[5]; //cat(labels), common, x, y, bubble,
int id_;
std::wstring name_;
std::wstring name_; //tx (Series Text) §21.2.2.215
int iSymbolMarkerType_;
bool bLocalTable_;
_CP_OPT(oox_data_labels) data_labels_;
void setName(const std::wstring &value);
void setName(std::wstring &value);
void setFormula (int ind, const std::wstring & value, const std::wstring & formatCode, bool link_to_source);
void setFormula (int ind, std::wstring & value, std::wstring & formatCode, bool link_to_source);
void setValues (int ind, std::vector<std::wstring> & values);
void setLabels (const std::wstring &formula, std::vector<std::wstring> & values);
void parse_properties();
void set_cache_only (bool val);

View File

@ -55,21 +55,21 @@ struct _oox_numLit
struct _oox_strRef
{
bool present = false;
bool present;
std::wstring formula;
int str_cache_count = 0;
int str_cache_count;
std::vector<std::wstring> str_cache;
};
struct _oox_numRef
{
bool present = false;
bool present;
std::wstring formula;
std::wstring formatCode;
bool link_to_source = false;
int num_cache_count = 0;
bool link_to_source;
int num_cache_count;
std::vector<std::wstring> num_cache;
};

View File

@ -377,7 +377,8 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
}
else if ((bFitToSize) && (*bFitToSize))
{
CP_XML_NODE(L"a:normAutofit");
CP_XML_NODE(L"a:noAutofit");
//CP_XML_NODE(L"a:spAutoFit")
//{
// CP_XML_ATTR(L"lnSpcReduction", 10000);
//}

View File

@ -75,7 +75,6 @@ static std::wstring get_mime_type(const std::wstring & extension)
else if (L"tiff" == extension) return L"image/x-tiff";
else if (L"pdf" == extension) return L"application/pdf";
else if (L"bmp" == extension) return L"image/bmp";
else if (L"wdp" == extension) return L"image/vnd.ms-photo";
else if (L"wav" == extension) return L"audio/wav";
else if (L"mp3" == extension) return L"audio/mpeg";

View File

@ -46,13 +46,13 @@ void oox_chart::set_cache_only (bool val)
}
void oox_chart::set_formula_series(int ind, const std::wstring& val, const std::wstring& formatCode, bool link_to_source)
void oox_chart::set_formula_series(int ind, std::wstring val, std::wstring formatCode, bool link_to_source)
{
oox_series_ptr & current_ptr = series_.back();
current_ptr->setFormula(ind, val, formatCode, link_to_source);
}
void oox_chart::set_name(const std::wstring& val)
void oox_chart::set_name(std::wstring val)
{
oox_series_ptr & current_ptr = series_.back();
current_ptr->setName(val);
@ -68,13 +68,6 @@ void oox_chart::set_values_series(int ind, std::vector<std::wstring> & val)
oox_series_ptr & current_ptr = series_.back();
current_ptr->setValues (ind, val);
}
void oox_chart::set_label_series(const std::wstring& formula, std::vector<std::wstring> & cash)
{
if (formula.empty() && cash.empty()) return;
oox_series_ptr & current_ptr = series_.back();
current_ptr->setLabels (formula, cash);
}
void oox_chart::set_properties(std::vector<odf_reader::_property> g)
{
_CP_OPT(int) iVal;

View File

@ -78,10 +78,9 @@ public:
virtual void add_series(int id){}
void set_cache_only (bool val);
void set_formula_series (int ind, const std::wstring& val, const std::wstring& formatCode, bool link_to_source);
void set_formula_series (int ind, std::wstring val, std::wstring formatCode, bool link_to_source);
void set_values_series (int ind, std::vector<std::wstring> & val);
void set_label_series (const std::wstring& formula, std::vector<std::wstring> & val);
void set_name (const std::wstring& val);
void set_name (std::wstring val);
void set_content_series (odf_reader::chart::series & content);
//void set_showBubbleSize(bool Val){data_labels_.set_showBubbleSize(Val);}

View File

@ -42,11 +42,11 @@ namespace odf_reader {
const wchar_t * abstract_xml::ns = L"";
const wchar_t * abstract_xml::name = L"abstract-xml";
std::wostream & abstract_xml::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & abstract_xml::text_to_stream(std::wostream & _Wostream) const
{
for (size_t i = 0; i < xml_content_.size(); i++)
{
xml_content_[i]->text_to_stream(_Wostream, bXmlEncode);
xml_content_[i]->text_to_stream(_Wostream);
}
return _Wostream;
}

View File

@ -47,7 +47,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & xml_to_stream(std::wostream & _Wostream) const;
public:

View File

@ -212,13 +212,13 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
oox_convert(chart_context);
if (false == embeddedData.empty())
if (embeddedData.empty())
{
chart_context.set_externalData(embeddedData);
chart_context.set_cache_only(true);
}
else
{
chart_context.set_cache_only(true);
chart_context.set_externalData(embeddedData);
}
Context.end_chart();
@ -416,13 +416,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
std::vector<std::wstring> domain_cash;
std::vector<std::wstring> cell_cash;
std::vector<std::wstring> cat_cash;
std::vector<std::wstring> label_cash;
calc_cache_series (domain_cell_range_adress_, domain_cash);
calc_cache_series (series_[i].cell_range_address_, cell_cash);
calc_cache_series (series_[i].label_cell_address_, label_cash);
if (false == categories_.empty())
if (categories_.size() >0)
calc_cache_series (categories_[0], cat_cash);
std::wstring formatCode = L"General";
@ -436,11 +434,6 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
{
formatCode = *strVal;
}
if (false == series_[i].label_cell_address_.empty())
{
current->set_label_series(series_[i].label_cell_address_, label_cash);//_oox_strRef
}
if (domain_cell_range_adress_.empty() == false ||
last_set_type == chart_scatter)
@ -457,14 +450,14 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
}
else
{ //x
if (false == domain_cash.empty() || false == cash_values.empty())
if (false == domain_cash.empty())
{
if (!bPivotChart_)
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
current->set_values_series (2, domain_cash);
}
//y
if (false == cell_cash.empty() || false == cash_values.empty())
if (false == cell_cash.empty())
{
if (!bPivotChart_)
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
@ -744,7 +737,7 @@ void process_build_object::visit(chart_title& val)
if (val.text_p_)
{
std::wstringstream v;
val.text_p_->text_to_stream(v, false);
val.text_p_->text_to_stream(v);
t.content_ = v.str();
}
ApplyTextProperties(val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), t.text_properties_);
@ -771,7 +764,7 @@ void process_build_object::visit(chart_subtitle & val)
{
title t;
std::wstringstream v;
val.text_p_->text_to_stream(v, false);
val.text_p_->text_to_stream(v);
t.content_ = v.str();
if (val.attlist_.common_draw_position_attlist_.svg_x_)
@ -1045,15 +1038,15 @@ void process_build_object::visit(table_table_cell& val)
for (size_t i = 0 ; i < val.content_.elements_.size(); i++)
{
std::wstringstream wstream_temp;
val.content_.elements_[i]->text_to_stream(wstream_temp, false);
val.content_.elements_[i]->text_to_stream(wstream_temp);
if (val.content_.elements_[i]->get_type() == typeTextP)
{
cell_cash += wstream_temp.str();
cell_cash += xml::utils::replace_xml_to_text(wstream_temp.str());
}
else if (val.content_.elements_[i]->get_type() == typeDrawG)
{
cell_desc += wstream_temp.str();
cell_desc += xml::utils::replace_xml_to_text(wstream_temp.str());
}
}

View File

@ -76,26 +76,27 @@ std::wostream & operator<< (std::wostream & _Wostream, const length & _Length)
_Wostream << std::setprecision(4) << _Length.get_value() << _Length.get_unit();
return _Wostream;
}
length operator+ (length _Length1, length _Length2)
length operator+ (length & _Length1, length & _Length2)
{
return length(_Length1.get_value() + _Length2.get_value(),_Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному
}
length operator+ (length _Length1, double val)
length operator+ (length & _Length1, double val)
{
return length(_Length1.get_value() + val,_Length1.get_unit());
}
length operator- (length _Length1, length _Length2)
length operator- (length & _Length1, length & _Length2)
{
return length(_Length1.get_value() - _Length2.get_value(), _Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному
return length(_Length1.get_value() - _Length2.get_value(),_Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному
}
length operator/ (length _Length1, double val)
length operator/ (length & _Length1, double val)
{
return length(_Length1.get_value() / val, _Length1.get_unit());
return length(_Length1.get_value() / val ,_Length1.get_unit());
}
length operator* (length _Length1, double val)
length operator* (length & _Length1, double val)
{
return length(_Length1.get_value() * val, _Length1.get_unit());
return length(_Length1.get_value() * val ,_Length1.get_unit());
}
bool operator== (length & _Length1, length & _Length2)
{

View File

@ -78,12 +78,11 @@ private:
std::wostream & operator<< (std::wostream & _Wostream, const length::unit _Unit);
std::wostream & operator<< (std::wostream & _Wostream, const length & _Length);
length operator+ (length _Length1, double val);
length operator+ (length _Length1, length _Length2);
length operator- (length _Length1, length _Length2);
length operator/ (length _Length1, double val);
length operator* (length _Length1, double val);
length operator+ (length & _Length1, double val);
length operator+ (length & _Length1, length & _Length2);
length operator- (length & _Length1, length & _Length2);
length operator/ (length & _Length1, double val);
length operator* (length & _Length1, double val);
bool operator== (length & _Length1, length & _Length2);
bool operator== (const length & _Length1, const length & _Length2);

View File

@ -106,7 +106,7 @@ void draw_image::add_child_element( xml::sax * Reader, const std::wstring & Ns,
//CP_NOT_APPLICABLE_ELM();
}
}
std::wostream & draw_image::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & draw_image::text_to_stream(std::wostream & _Wostream) const
{
return _Wostream;
}
@ -115,7 +115,7 @@ std::wostream & draw_image::text_to_stream(std::wostream & _Wostream, bool bXmlE
const wchar_t * draw_chart::ns = L"draw";
const wchar_t * draw_chart::name = L"chart";
std::wostream & draw_chart::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & draw_chart::text_to_stream(std::wostream & _Wostream) const
{
return _Wostream;
}
@ -225,9 +225,9 @@ void draw_g::add_child_element( xml::sax * Reader, const std::wstring & Ns, cons
}
}
std::wostream & draw_g::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & draw_g::text_to_stream(std::wostream & _Wostream) const
{
CP_SERIALIZE_TEXT(content_, bXmlEncode);
CP_SERIALIZE_TEXT(content_);
return _Wostream;
}
@ -236,9 +236,9 @@ std::wostream & draw_g::text_to_stream(std::wostream & _Wostream, bool bXmlEncod
const wchar_t * draw_frame::ns = L"draw";
const wchar_t * draw_frame::name = L"frame";
std::wostream & draw_frame::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & draw_frame::text_to_stream(std::wostream & _Wostream) const
{
CP_SERIALIZE_TEXT(content_, bXmlEncode);
CP_SERIALIZE_TEXT(content_);
return _Wostream;
}
@ -308,9 +308,9 @@ void draw_text_box_attlist::add_attributes( const xml::attributes_wc_ptr & Attri
const wchar_t * draw_text_box::ns = L"draw";
const wchar_t * draw_text_box::name = L"text-box";
std::wostream & draw_text_box::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & draw_text_box::text_to_stream(std::wostream & _Wostream) const
{
CP_SERIALIZE_TEXT(content_, bXmlEncode);
CP_SERIALIZE_TEXT(content_);
return _Wostream;
}

View File

@ -70,7 +70,7 @@ public:
static const ElementType type = typeDrawImage;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
@ -114,7 +114,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
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);
@ -160,7 +160,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual void pptx_convert_placeHolder(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
int idx_in_owner ;
@ -211,7 +211,7 @@ public:
draw_g() : position_child_x1(0x7fffffff), position_child_y1(0x7fffffff), position_child_x2(0x7fffffff), position_child_y2(0x7fffffff) {}
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
@ -263,7 +263,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
draw_text_box_attlist draw_text_box_attlist_;
office_element_ptr_array content_;

View File

@ -145,11 +145,8 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
{
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Presentation);
if (defaultStyle)instances.push_back(defaultStyle);
instances.push_back(baseStyleInst);
}
else if (common_presentation_attlist_.presentation_class_)
{
instances.push_back(baseStyleInst);
instances.push_back(baseStyleInst);
}
if (grStyleInst)//обычная векторная фигура
{

View File

@ -44,7 +44,7 @@ namespace odf_reader {
const wchar_t * svg_desc::ns = L"svg";
const wchar_t * svg_desc::name = L"desc";
std::wostream & svg_desc::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & svg_desc::text_to_stream(std::wostream & _Wostream) const
{
_Wostream << text_ ;
return _Wostream;
@ -60,7 +60,7 @@ void svg_desc::add_text(const std::wstring & Text)
const wchar_t * svg_font_face_uri::ns = L"svg";
const wchar_t * svg_font_face_uri::name = L"font-face-uri";
std::wostream & svg_font_face_uri::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & svg_font_face_uri::text_to_stream(std::wostream & _Wostream) const
{
return _Wostream;
}
@ -88,7 +88,7 @@ void svg_font_face_uri::add_text(const std::wstring & Text)
const wchar_t * svg_font_face_format::ns = L"svg";
const wchar_t * svg_font_face_format::name = L"font-face-format";
std::wostream & svg_font_face_format::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & svg_font_face_format::text_to_stream(std::wostream & _Wostream) const
{
return _Wostream;
}
@ -111,7 +111,7 @@ void svg_font_face_format::add_text(const std::wstring & Text)
const wchar_t * svg_font_face_name::ns = L"svg";
const wchar_t * svg_font_face_name::name = L"font-face-name";
std::wostream & svg_font_face_name::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & svg_font_face_name::text_to_stream(std::wostream & _Wostream) const
{
return _Wostream;
}

View File

@ -69,7 +69,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
common_svg_font_face_xlink_attlist common_svg_font_face_xlink_attlist_;
office_element_ptr_array svg_font_face_format_;
@ -92,7 +92,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wstring text_;
@ -114,7 +114,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
optional<std::wstring>::Type svg_string_;
@ -136,7 +136,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
optional<std::wstring>::Type name_;
private:

View File

@ -87,9 +87,9 @@ void common_style_header_footer_attlist::add_attributes( const xml::attributes_w
}
// header-footer-content
std::wostream & header_footer_content::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & header_footer_content::text_to_stream(std::wostream & _Wostream) const
{
serialize_elements_text(_Wostream, content_, bXmlEncode);
serialize_elements_text(_Wostream, content_);
return _Wostream;
}

View File

@ -100,7 +100,7 @@ private:
class header_footer_content
{
public:
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
std::wostream & text_to_stream(std::wostream & _Wostream) const;
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
office_element_ptr tracked_changes_;

View File

@ -48,9 +48,9 @@ namespace text {
const wchar_t * number::ns = L"text";
const wchar_t * number::name = L"number";
std::wostream & number::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & number::text_to_stream(std::wostream & _Wostream) const
{
_Wostream << (bXmlEncode ? xml::utils::replace_xml_to_text( string_ ) : string_);
_Wostream << xml::utils::replace_xml_to_text( string_ );
return _Wostream;
}
@ -64,11 +64,11 @@ void number::add_text(const std::wstring & Text)
const wchar_t * list_item::ns = L"text";
const wchar_t * list_item::name = L"list-item";
std::wostream & list_item::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & list_item::text_to_stream(std::wostream & _Wostream) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream, bXmlEncode);
content_[i]->text_to_stream(_Wostream);
}
return _Wostream;
}
@ -161,11 +161,11 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context)
}
std::wostream & list_header::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & list_header::text_to_stream(std::wostream & _Wostream) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream, bXmlEncode);
content_[i]->text_to_stream(_Wostream);
}
return _Wostream;
}

View File

@ -52,7 +52,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
number() {}
@ -90,7 +90,7 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
list_item() {}
@ -128,7 +128,7 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
list_header() {}

View File

@ -65,7 +65,7 @@ void math_mi::add_text(const std::wstring & Text)
text_ = Text;
}
std::wostream & math_mi::text_to_stream(std::wostream & _strm, bool bXmlEncode) const
std::wostream & math_mi::text_to_stream(std::wostream & _strm) const
{
if (text_)
_strm << *text_;
@ -143,7 +143,7 @@ void math_mo::add_text(const std::wstring & Text)
text_ = Text;
}
std::wostream & math_mo::text_to_stream(std::wostream & _strm, bool bXmlEncode) const
std::wostream & math_mo::text_to_stream(std::wostream & _strm) const
{
if (text_)
_strm << *text_;

View File

@ -48,7 +48,7 @@ public:
virtual void oox_convert(oox::math_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
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);
@ -73,7 +73,7 @@ public:
virtual void oox_convert(oox::math_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
_CP_OPT(bool) fence_;
_CP_OPT(bool) stretchy_;

View File

@ -48,14 +48,14 @@ namespace text {
const wchar_t * note_citation::ns = L"text";
const wchar_t * note_citation::name = L"note-citation";
std::wostream & note_citation::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & note_citation::text_to_stream(std::wostream & _Wostream) const
{
if (!text_label_.empty())
_Wostream << text_label_;
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream, bXmlEncode);
content_[i]->text_to_stream(_Wostream);
}
return _Wostream;
}
@ -89,11 +89,11 @@ void note_citation::docx_convert(oox::docx_conversion_context & Context)
const wchar_t * note_body::ns = L"text";
const wchar_t * note_body::name = L"note-body";
std::wostream & note_body::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & note_body::text_to_stream(std::wostream & _Wostream) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream, bXmlEncode);
content_[i]->text_to_stream(_Wostream);
}
return _Wostream;
}

View File

@ -53,7 +53,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
note_citation() {}
@ -84,7 +84,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
note_body() {}

View File

@ -57,7 +57,6 @@ namespace odf_reader {
style_instance::style_instance(
styles_container *Container,
const std::wstring &Name,
const std::wstring &DisplayName,
style_family::type Type,
style_content *Content,
bool IsAutomatic,
@ -69,7 +68,6 @@ style_instance::style_instance(
) :
container_ (Container),
name_ (Name),
display_name_ (DisplayName),
style_type_ (Type),
content_ (Content),
is_automatic_ (IsAutomatic),
@ -112,7 +110,7 @@ void styles_container::add_style( const std::wstring & Name,
{
ParentStyleName = L"";//иначе в коде возможно зацикливание.
}
style_instance_ptr newStyle = style_instance_ptr( new style_instance(this, Name, DisplayName, Type, Content, IsAutomatic, IsDefault,
style_instance_ptr newStyle = style_instance_ptr( new style_instance(this, Name, Type, Content, IsAutomatic, IsDefault,
ParentStyleName, NextStyleName, DataStyleName, StyleClass));
instances_.push_back(newStyle);
@ -145,10 +143,7 @@ const std::wstring & style_instance::name() const
{
return name_;
}
const std::wstring & style_instance::display_name() const
{
return display_name_;
}
style_family::type style_instance::type() const
{
return style_type_;
@ -523,7 +518,11 @@ const std::wstring & font_instance::style_name() const
const std::wstring & font_instance::name() const
{
return name_;
static const std::wstring Symbol = L"Symbol";
if (name_ == L"StarSymbol")
return Symbol;
else
return name_;
}
const std::wstring & font_instance::charset() const

View File

@ -61,7 +61,6 @@ public:
style_instance(
styles_container * Container,
const std::wstring & Name,
const std::wstring & DisplayName,
odf_types::style_family::type Type,
style_content * Content,
bool IsAutomatic,
@ -72,8 +71,8 @@ public:
const std::wstring & StyleClass
);
const std::wstring & display_name()const;
const std::wstring & name() const;
const std::wstring & name() const;
odf_types::style_family::type type() const;
style_content * content() const;
style_instance * parent() const;
@ -89,10 +88,7 @@ public:
private:
styles_container * container_;
std::wstring name_;
std::wstring display_name_;
odf_types::style_family::type style_type_;
style_content * content_;

View File

@ -45,7 +45,7 @@ namespace odf_reader {
const wchar_t * office_binary_data::ns = L"office";
const wchar_t * office_binary_data::name = L"binary-data";
std::wostream & office_binary_data::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & office_binary_data::text_to_stream(std::wostream & _Wostream) const
{
return _Wostream;
}

View File

@ -53,7 +53,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wstring write_to(const std::wstring & path);
private:

View File

@ -55,10 +55,10 @@ namespace odf_reader {
const wchar_t * office_body::ns = L"office";
const wchar_t * office_body::name = L"body";
std::wostream & office_body::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & office_body::text_to_stream(std::wostream & _Wostream) const
{
if (content_)
content_->text_to_stream(_Wostream, bXmlEncode);
content_->text_to_stream(_Wostream);
return _Wostream;
}

View File

@ -62,7 +62,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
office_body();

View File

@ -43,9 +43,9 @@ namespace odf_reader {
std::wostream & office_document_base::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
std::wostream & office_document_base::text_to_stream(std::wostream & _Wostream) const
{
office_body_->text_to_stream(_Wostream, bXmlEncode);
office_body_->text_to_stream(_Wostream);
return _Wostream;
}

View File

@ -44,7 +44,7 @@ namespace odf_reader {
class office_document_base : public office_element
{
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
CPDOCCORE_DEFINE_VISITABLE();

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