Commit a536722c authored by ElenaSubbotina's avatar ElenaSubbotina

DocFormat (before 1997) - shapes, groups shapes, textboxes, ...

parent 741265d8
......@@ -34,6 +34,7 @@
#include "CommentsMapping.h"
#include "TablePropertiesMapping.h"
#include "MainDocumentMapping.h"
#include "DrawingPrimitives.h"
#include "../Common/TextMark.h"
#include "../Common/FormatUtils.h"
......@@ -454,9 +455,9 @@ namespace DocFileFormat
//write text
for (unsigned int i = 0; i < chars->size(); ++i)
{
wchar_t c = chars->at(i);
wchar_t c = chars->at(i), code = c;
if (TextMark::Tab == c)
if (TextMark::Tab == code)
{
writeTextElement(text, textType);
......@@ -466,7 +467,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
}
else if (TextMark::HardLineBreak == c)
else if (TextMark::HardLineBreak == code)
{
writeTextElement(text, textType);
......@@ -478,11 +479,11 @@ namespace DocFileFormat
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
}
else if (TextMark::ParagraphEnd == c)
else if (TextMark::ParagraphEnd == code)
{
//do nothing
}
else if (TextMark::PageBreakOrSectionMark == c)
else if (TextMark::PageBreakOrSectionMark == code)
{
//write page break, section breaks are written by writeParagraph() method
if (/*!isSectionEnd(c)*/_isSectionPageBreak == 0)
......@@ -497,7 +498,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
}
}
else if (TextMark::ColumnBreak == c)
else if (TextMark::ColumnBreak == code)
{
writeTextElement(text, textType);
......@@ -508,7 +509,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
}
else if (TextMark::FieldBeginMark == c)
else if (TextMark::FieldBeginMark == code)
{
int cpFieldStart = initialCp + i;
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
......@@ -732,7 +733,7 @@ namespace DocFileFormat
_fldCharCounter++;
}
}
else if (TextMark::FieldSeparator == c)
else if (TextMark::FieldSeparator == code)
{
if (_fldCharCounter > 0)
{
......@@ -742,7 +743,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
}
}
else if (TextMark::FieldEndMark == c)
else if (TextMark::FieldEndMark == code)
{
if (_fldCharCounter > 0)
{
......@@ -764,7 +765,7 @@ namespace DocFileFormat
_writeInstrText = false;
}
}
else if ((TextMark::Symbol == c) && fSpec)
else if ((TextMark::Symbol == code) && fSpec)
{
Symbol s = getSymbol( chpx );
......@@ -773,7 +774,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute(_T("w:char"), FormatUtils::XmlEncode(s.HexValue).c_str());
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE);
}
else if ((TextMark::DrawnObject == c) && fSpec)
else if ((TextMark::DrawnObject == code) && fSpec)
{
Spa* pSpa = NULL;
if (typeid(*this) == typeid(MainDocumentMapping))
......@@ -797,9 +798,17 @@ namespace DocFileFormat
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
}
if (!pSpa->primitives.empty())
{
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller);
pSpa->primitives.Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
}
}
}
else if ((TextMark::Picture == c) && fSpec )
else if ((TextMark::Picture == code) && fSpec )
{
PictureDescriptor oPicture (chpx, m_document->bOlderVersion ? m_document->WordDocumentStream : m_document->DataStream, 0x7fffffff, m_document->bOlderVersion);
......@@ -850,7 +859,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
}
}
else if ((TextMark::AutoNumberedFootnoteReference == c) && fSpec)
else if ((TextMark::AutoNumberedFootnoteReference == code) && fSpec)
{
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
{
......@@ -876,7 +885,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
}
}
else if (TextMark::AnnotationReference == c)
else if (TextMark::AnnotationReference == code)
{
if (typeid(*this) != typeid(CommentsMapping))
{
......
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "DrawingPrimitives.h"
#include "VirtualStreamReader.h"
namespace DocFileFormat
{
DrawingPrimitive * DrawingPrimitive::Create(VirtualStreamReader* reader, int length, short dpk)
{
DrawingPrimitive * dp = NULL;
int pos1 = reader->GetPosition();
switch(dpk)
{
case 0x0000:
dp = new DrawingPrimitiveGroup(reader, length, true);
break;
case 0x0001:
dp = new DrawingPrimitiveLine(reader, length);
break;
case 0x0002: //textbox
dp = new DrawingPrimitiveTextBox(reader, length);
break;
case 0x0003: //rectangle
dp = new DrawingPrimitiveRect(reader, length);
break;
case 0x0004: //elipse
dp = new DrawingPrimitiveElipse(reader, length);
break;
case 0x0005: //arc
dp = new DrawingPrimitiveArc(reader, length);
break;
case 0x0006: //polyline
dp = new DrawingPrimitivePolyline(reader, length);
break;
case 0x0007: //callout textbox
dp = new DrawingPrimitiveCTextBox(reader, length);
break;
case 0x0008: //callout textbox
dp = new DrawingPrimitiveGroup(reader, length, false);
break;
case 0x0009: //sample primitive holding default values
default:
dp = new DrawingPrimitive(reader, length);
break;
}
if (dp)
{
dp->type = dpk;
}
int pos2 = reader->GetPosition();
if (pos2 - pos1 < length && dpk != 0 && dpk != 8)
{
int sz = length - (pos2 - pos1);
unsigned char * data = reader->ReadBytes(sz, true);
if (data)
delete []data;
}
return dp;
}
DrawingPrimitive::DrawingPrimitive(VirtualStreamReader *reader, int length) :
lineWeight(0), lineStyle(0), lineColor(0), fillBack(0), fillFore(0), fillPattern(0), shadowX(0), shadowY(0)
{
xa = reader->ReadInt16();
ya = reader->ReadInt16();
dxa = reader->ReadInt16();
dya = reader->ReadInt16();
}
void DrawingPrimitive::read_fill(VirtualStreamReader* reader)
{
fillFore = read_color(reader);
fillBack = read_color(reader);
fillPattern = reader->ReadInt16();
}
void DrawingPrimitive::read_shadow(VirtualStreamReader* reader)
{
shadowInt = reader->ReadInt16();
shadowX = reader->ReadInt16();
shadowY = reader->ReadInt16();
}
void DrawingPrimitive::read_line(VirtualStreamReader* reader)
{
lineColor = read_color(reader);
lineWeight = reader->ReadInt16();
lineStyle = reader->ReadInt16();
}
const static int shemeDefaultColor[] =
{
0x00000000, 0x00FFFFFF, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00FFFF00, 0x00FF00FF, 0x0000FFFF,
0x00000000, 0x00FFFFFF, 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00FFFF00, 0x00FF00FF, 0x0000FFFF,
0x00800000, 0x00008000, 0x00000080, 0x00808000, 0x00800080, 0x00008080, 0x00C0C0C0, 0x00808080,
0x009999FF, 0x00993366, 0x00FFFFCC, 0x00CCFFFF, 0x00660066, 0x00FF8080, 0x000066CC, 0x00CCCCFF,
0x00000080, 0x00FF00FF, 0x00FFFF00, 0x0000FFFF, 0x00800080, 0x00800000, 0x00008080, 0x000000FF,
0x0000CCFF, 0x00CCFFFF, 0x00CCFFCC, 0x00FFFF99, 0x0099CCFF, 0x00FF99CC, 0x00CC99FF, 0x00FFCC99,
0x003366FF, 0x0033CCCC, 0x0099CC00, 0x00FFCC00, 0x00FF9900, 0x00FF6600, 0x00666699, 0x00969696,
0x00003366, 0x00339966, 0x00003300, 0x00333300, 0x00993300, 0x00993366, 0x00333399, 0x00333333
};
long DrawingPrimitive::read_color(VirtualStreamReader* reader)
{
//int ind = reader->ReadUInt32();
//return shemeDefaultColor[ind];
unsigned r = reader->ReadByte();
unsigned g = reader->ReadByte();
unsigned b = reader->ReadByte();
unsigned a = reader->ReadByte();
return ( (r<<16) | (g<<8) | (b) );
}
DrawingPrimitiveGroup::DrawingPrimitiveGroup(VirtualStreamReader *reader, int length, bool start) : DrawingPrimitive(reader, length)
{
strVmlType = L"v:group";
bStart = start;
val = reader->ReadInt16();
}
DrawingPrimitiveLine::DrawingPrimitiveLine(VirtualStreamReader *reader, int length, bool read_as_line) : DrawingPrimitive(reader, length)
{
strVmlType = L"v:line";
if (!read_as_line) return;
read_start_end (reader);
read_line(reader);
read_epp(reader);
read_shadow(reader);
}
void DrawingPrimitiveLine::read_epp(VirtualStreamReader* reader)
{
unsigned short f = reader->ReadUInt16();
eppsStart = FormatUtils::BitmaskToInt (f, 0x0003);
eppwStart = FormatUtils::BitmaskToInt (f, 0x000c);
epplStart = FormatUtils::BitmaskToInt (f, 0x0030);
f = reader->ReadUInt16();
eppsEnd = FormatUtils::BitmaskToInt (f, 0x0003);
eppwEnd = FormatUtils::BitmaskToInt (f, 0x000c);
epplEnd = FormatUtils::BitmaskToInt (f, 0x0030);
}
void DrawingPrimitiveLine::read_start_end(VirtualStreamReader* reader)
{
xaStart = reader->ReadInt16();
yaStart = reader->ReadInt16();
xaEnd = reader->ReadInt16();
yaEnd = reader->ReadInt16();
}
DrawingPrimitiveRect::DrawingPrimitiveRect(VirtualStreamReader *reader, int length) : DrawingPrimitive(reader, length)
{
strVmlType = L"v:rect";
read_line(reader);
read_fill(reader);
read_shadow(reader);
unsigned short f = reader->ReadUInt16();
fRoundCorners = FormatUtils::BitmaskToInt (f, 0x0001);
zaShape = FormatUtils::BitmaskToInt (f, 0x000e);
}
DrawingPrimitiveArc::DrawingPrimitiveArc(VirtualStreamReader *reader, int length) : DrawingPrimitive(reader, length)
{
strVmlType = L"v:oval";//L"v:shape";
read_line (reader);
read_fill (reader);
read_shadow (reader);
unsigned short f = reader->ReadUInt16();
fLeft = FormatUtils::BitmaskToInt (f, 0x00ff);
fUp = FormatUtils::BitmaskToInt (f, 0xff00);
}
DrawingPrimitiveElipse::DrawingPrimitiveElipse(VirtualStreamReader *reader, int length) : DrawingPrimitive(reader, length)
{
strVmlType = L"v:oval";
read_line (reader);
read_fill (reader);
read_shadow (reader);
}
DrawingPrimitiveTextBox::DrawingPrimitiveTextBox(VirtualStreamReader *reader, int length) : DrawingPrimitiveRect(reader, length)
{
strVmlType = L"v:rect";
//strVmlType = L"v:shape";
}
DrawingPrimitiveCTextBox::DrawingPrimitiveCTextBox(VirtualStreamReader *reader, int length) : DrawingPrimitive(reader, length)
{
strVmlType = L"v:shape";
}
DrawingPrimitivePolyline::DrawingPrimitivePolyline(VirtualStreamReader *reader, int length) : DrawingPrimitiveLine(reader, length, false)
{
strVmlType = L"v:shape";
read_line(reader);
read_fill(reader);
read_epp(reader);
read_shadow(reader);
unsigned short f = reader->ReadUInt16();
fPolygon = FormatUtils::BitmaskToInt (f, 0x0001);
count = FormatUtils::BitmaskToInt (f, 0x00fe);
read_start_end(reader);
for (int i = 0; i < count; i++)
{
std::pair<short, short> point;
point.first = reader->ReadInt16();
point.second = reader->ReadInt16();
arPoints.push_back(point);
}
}
}
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <string>
#include <vector>
#include "IVisitable.h"
class VirtualStreamReader;
namespace DocFileFormat
{
class DrawingPrimitive
{
public:
DrawingPrimitive(VirtualStreamReader* reader, int length) ;
virtual ~DrawingPrimitive() {}
short type;
short xa;
short ya;
short dxa;
short dya;
short lineWeight;
short lineStyle;
long lineColor;
long fillBack;
long fillFore;
short fillPattern;
short shadowInt;
short shadowX;
short shadowY;
std::wstring strVmlType;
void read_fill (VirtualStreamReader* reader);
void read_line (VirtualStreamReader* reader);
void read_shadow(VirtualStreamReader* reader);
long read_color (VirtualStreamReader* reader);
static DrawingPrimitive * Create(VirtualStreamReader* reader, int length, short dpk);
};
class DrawingPrimitiveGroup : public DrawingPrimitive
{
public:
DrawingPrimitiveGroup(VirtualStreamReader* reader, int length, bool start);
bool bStart;
short val;
};
class DrawingPrimitiveLine : public DrawingPrimitive
{
public:
DrawingPrimitiveLine(VirtualStreamReader* reader, int length, bool read_as_line = true) ;
void read_epp ( VirtualStreamReader* reader);
void read_start_end (VirtualStreamReader* reader);
short xaStart;
short yaStart;
short xaEnd;
short yaEnd;
short eppsStart; //Start EndPoint Property Style
short eppwStart; //Start EndPoint Property Weight
short epplStart; //Start EndPoint Property length
short eppsEnd; //End EndPoint Property Style
short eppwEnd; //End EndPoint Property Weight
short epplEnd; //End EndPoint Property length
};
class DrawingPrimitiveRect: public DrawingPrimitive
{
public:
DrawingPrimitiveRect(VirtualStreamReader* reader, int length);
bool fRoundCorners;
unsigned short zaShape;
};
class DrawingPrimitiveTextBox: public DrawingPrimitiveRect
{
public:
DrawingPrimitiveTextBox(VirtualStreamReader* reader, int length);
};
class DrawingPrimitiveCTextBox: public DrawingPrimitive
{
public:
DrawingPrimitiveCTextBox(VirtualStreamReader* reader, int length);
};
class DrawingPrimitiveArc: public DrawingPrimitive
{
public:
DrawingPrimitiveArc(VirtualStreamReader* reader, int length);
bool fLeft;
bool fUp;
};
class DrawingPrimitiveElipse: public DrawingPrimitive
{
public:
DrawingPrimitiveElipse(VirtualStreamReader* reader, int length);
};
class DrawingPrimitivePolyline: public DrawingPrimitiveLine
{
public:
DrawingPrimitivePolyline(VirtualStreamReader* reader, int length);
bool fPolygon;
short count;
std::vector<std::pair<short, short>> arPoints;
};
//-------------------------------------------------------------------------------------
class DrawingPrimitives : public IVisitable, public std::vector<DrawingPrimitive*>
{
public:
DrawingPrimitives () {}
};
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ namespace DocFileFormat
}
else
{
code_page = ENCODING_UTF16;
code_page = (code_page == ENCODING_WINDOWS_1250 ? ENCODING_UTF16 : code_page_);
this->fc = fcValue;
}
}
......
......@@ -68,9 +68,10 @@ namespace DocFileFormat
{
if ( ( sprmStart + opCodeSize ) < size )
{
OperationCode opCode = oldVersion ? (OperationCode)FormatUtils::BytesToUChar ( bytes, sprmStart, size ) :
(OperationCode)FormatUtils::BytesToUInt16 ( bytes, sprmStart, size ) ;
unsigned short code = oldVersion ? FormatUtils::BytesToUChar ( bytes, sprmStart, size ) :
FormatUtils::BytesToUInt16 ( bytes, sprmStart, size ) ;
OperationCode opCode = (OperationCode)code;
short opSize = -1;
if (oldVersion)
......
/*
* (c) Copyright Ascensio System SIA 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "Spa.h"
#include "VirtualStreamReader.h"
namespace DocFileFormat
{
Spa::Spa() : spid(0), fHdr(0), bx(MARGIN), by(MARGIN), wr(0), wrk(0),
xaLeft(0), yaTop(0), xaRight(0), yaBottom(0),
fRcaSimple(0), fBelowText(0), fAnchorLock(0), cTxbx(0)
{
}
Spa::~Spa()
{
for (int i = 0 ; i < primitives.size(); i++)
{
if (primitives[i]) delete primitives[i];
primitives[i] = NULL;
}
}
void Spa::read_primitives(Spa* pSpa, VirtualStreamReader* reader, int length)
{
if (!pSpa) return;
if (!reader || length < 1) return;
int stream_pos = reader->GetPosition();
int pos = 0;
while (pos < length)
{
reader->Seek(stream_pos + pos, 0);
unsigned short dpk = reader->ReadUInt16();
int shape_type = FormatUtils::BitmaskToInt (dpk, 0x00ff);
short cb_primitive = reader->ReadInt16();
if (pos + cb_primitive > length)
{
reader->Seek(reader->GetPosition() - 4, 0);
break;
}
DrawingPrimitive *dp = DrawingPrimitive::Create(reader, cb_primitive - 4, shape_type);
if (dp)
pSpa->primitives.push_back(dp);
if (shape_type == 0x00)
{
//start group
read_primitives(pSpa, reader, cb_primitive - 4);
}
else if (shape_type == 0x08)
{
//end group
break;
}
pos += cb_primitive;
}
}
ByteStructure* Spa::ConstructObject(VirtualStreamReader* reader, int length)
{
Spa* pSpa = new Spa();
if (!pSpa) return NULL;
if (reader->olderVersion)
{
int fc = reader->ReadInt32();
pSpa->cTxbx = reader->ReadUInt16();
int pos_keep = reader->GetPosition();
reader->Seek(fc, 0);
unsigned short dok = reader->ReadUInt16();
short cb = reader->ReadInt16();
pSpa->bx = (AnchorType)reader->ReadByte();
pSpa->by = (AnchorType)reader->ReadByte();
short height = reader->ReadInt16();
pSpa->fAnchorLock = reader->ReadUInt16();
int pos = 10; //fixed size
read_primitives(pSpa, reader, cb - 10/*_primitive*/);
reader->Seek(pos_keep, 0);
}
else
{
pSpa->spid = reader->ReadInt32();
pSpa->xaLeft = reader->ReadInt32();
pSpa->yaTop = reader->ReadInt32();
pSpa->xaRight = reader->ReadInt32();
pSpa->yaBottom = reader->ReadInt32();
unsigned short flag = reader->ReadUInt16();
pSpa->fHdr = FormatUtils::BitmaskToBool(flag, 0x0001);
pSpa->bx = (AnchorType)FormatUtils::BitmaskToInt(flag, 0x0006);
pSpa->by = (AnchorType)FormatUtils::BitmaskToInt(flag, 0x0018);
pSpa->wr = (unsigned short)FormatUtils::BitmaskToInt(flag, 0x01E0);
pSpa->wrk = (unsigned short)FormatUtils::BitmaskToInt(flag, 0x1E00);
pSpa->fRcaSimple = FormatUtils::BitmaskToBool(flag, 0x2000);
pSpa->fBelowText = FormatUtils::BitmaskToBool(flag, 0x4000);
pSpa->fAnchorLock = FormatUtils::BitmaskToBool(flag, 0x8000);
pSpa->cTxbx = reader->ReadInt32();
}
return static_cast<ByteStructure*>(pSpa);
}
}
......@@ -31,8 +31,10 @@
*/
#pragma once
#include "VirtualStreamReader.h"
#include "ByteStructure.h"
#include "DrawingPrimitives.h"
class VirtualStreamReader;
namespace DocFileFormat
{
......@@ -47,6 +49,8 @@ namespace DocFileFormat
{
public:
friend class VMLShapeMapping;
friend class DocumentMapping;
static const int STRUCTURE_SIZE = 26;
static const int STRUCTURE_SIZE_OLD = 6;
......@@ -55,46 +59,11 @@ namespace DocFileFormat
return bOldVersion ? STRUCTURE_SIZE_OLD : STRUCTURE_SIZE;
}
Spa()
{
Spa();
}
virtual ~Spa()
{
}
virtual ByteStructure* ConstructObject(VirtualStreamReader* reader, int length)
{
Spa* pSpa = new Spa();
if (pSpa)
{
pSpa->spid = reader->ReadInt32();
pSpa->xaLeft = reader->ReadInt32();
pSpa->yaTop = reader->ReadInt32();
pSpa->xaRight = reader->ReadInt32();
pSpa->yaBottom = reader->ReadInt32();
unsigned short flag = reader->ReadUInt16();
pSpa->fHdr = FormatUtils::BitmaskToBool(flag, 0x0001);
pSpa->bx = (AnchorType)FormatUtils::BitmaskToInt(flag, 0x0006);
pSpa->by = (AnchorType)FormatUtils::BitmaskToInt(flag, 0x0018);
pSpa->wr = (unsigned short)FormatUtils::BitmaskToInt(flag, 0x01E0);
pSpa->wrk = (unsigned short)FormatUtils::BitmaskToInt(flag, 0x1E00);
pSpa->fRcaSimple = FormatUtils::BitmaskToBool(flag, 0x2000);
pSpa->fBelowText = FormatUtils::BitmaskToBool(flag, 0x4000);
pSpa->fAnchorLock = FormatUtils::BitmaskToBool(flag, 0x8000);
pSpa->cTxbx = reader->ReadInt32();
return static_cast<ByteStructure*>(pSpa);
}
return NULL;
}
virtual ~Spa();
virtual ByteStructure* ConstructObject(VirtualStreamReader* reader, int length);
inline int GetShapeID() const
{
return spid;
......@@ -147,13 +116,12 @@ namespace DocFileFormat
/// forcing the xaLeft, xaRight, yaTop, and yaBottom fields
/// to all be page relative.
bool fRcaSimple;
/// true: shape is below text
/// false: shape is above text
bool fBelowText;
/// true: anchor is locked
/// fasle: anchor is not locked
bool fAnchorLock;
/// Count of textboxes in shape (undo doc only)
int cTxbx;
bool fBelowText; // true: shape is below text
bool fAnchorLock; // true: anchor is locked
int cTxbx; // Count of textboxes in shape (undo doc only)
DrawingPrimitives primitives;
void read_primitives(Spa* pSpa, VirtualStreamReader* reader, int length);
};
}
......@@ -136,7 +136,7 @@ namespace DocFileFormat
{
name = new unsigned char[characterCount];//characters are zero-terminated, so 1 char has 2 bytes:
memcpy( name, ( bytes + cbStdBase + 1 ), ( characterCount ) );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &(this->xstzName), name, ( characterCount ), ENCODING_WINDOWS_1250 );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &(xstzName), name, ( characterCount ), ENCODING_WINDOWS_1250 );
upxOffset = cbStdBase + 1 + ( characterCount /** 2*/ ) + 1;
}
else
......@@ -144,14 +144,14 @@ namespace DocFileFormat
name = new unsigned char[characterCount * 2];//characters are zero-terminated, so 1 char has 2 bytes:
memcpy( name, ( bytes + cbStdBase + 2 ), ( characterCount * 2 ) );
//remove zero-termination
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &(this->xstzName), name, ( characterCount * 2 ), ENCODING_UTF16 );
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &(xstzName), name, ( characterCount * 2 ), ENCODING_UTF16 );
//parse the UPX structs
upxOffset = cbStdBase + 1 + ( characterCount * 2 ) + 2;
}
RELEASEARRAYOBJECTS( name );
for ( int i = 0; i < this->cupx; i++ )
for ( int i = 0; i < cupx; i++ )
{
//find the next even unsigned char border
if ( ( upxOffset % 2 ) != 0 )
......@@ -168,7 +168,7 @@ namespace DocFileFormat
unsigned char* upxBytes = new unsigned char[cbUPX];
memcpy( upxBytes, ( bytes + upxOffset + 2 ), cbUPX );
if ( this->stk == table_style )
if ( stk == table_style )
{
//first upx is TAPX; second PAPX, third CHPX
switch ( i )
......@@ -176,68 +176,68 @@ namespace DocFileFormat
case 0:
{
//todooo не реализовано
//RELEASEOBJECT( this->tapx );
//this->tapx = new TablePropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion);
//RELEASEOBJECT( tapx );
//tapx = new TablePropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion);
}
break;
case 1:
{
RELEASEOBJECT( this->papx );
this->papx = new ParagraphPropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion);
RELEASEOBJECT( papx );
papx = new ParagraphPropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion);
}
break;
case 2:
{
RELEASEOBJECT( this->chpx );
this->chpx = new CharacterPropertyExceptions( upxBytes, cbUPX , oldVersion);
RELEASEOBJECT( chpx );
chpx = new CharacterPropertyExceptions( upxBytes, cbUPX , oldVersion);
}
break;
}
}
else if ( this->stk == paragraph_style )
else if ( stk == paragraph_style )
{
//first upx is PAPX, second CHPX
switch ( i )
{
case 0:
{
RELEASEOBJECT( this->papx );
this->papx = new ParagraphPropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion );
RELEASEOBJECT( papx );
papx = new ParagraphPropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion );
}
break;
case 1:
{
RELEASEOBJECT( this->chpx );
this->chpx = new CharacterPropertyExceptions( upxBytes, cbUPX, oldVersion);
RELEASEOBJECT( chpx );
chpx = new CharacterPropertyExceptions( upxBytes, cbUPX, oldVersion);
}
break;
}
}
else if ( this->stk == numbering_style )
else if ( stk == numbering_style )
{
//list styles have only one PAPX
switch ( i )
{
case 0:
{
RELEASEOBJECT( this->papx );
this->papx = new ParagraphPropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion );
RELEASEOBJECT( papx );
papx = new ParagraphPropertyExceptions( upxBytes, cbUPX, dataStream, oldVersion );
}
break;
}
}
else if ( this->stk == character_style )
else if ( stk == character_style )
{
//character styles have only one CHPX
switch ( i )
{
case 0:
{
RELEASEOBJECT( this->chpx );
this->chpx = new CharacterPropertyExceptions( upxBytes, cbUPX, oldVersion);
RELEASEOBJECT( chpx );
chpx = new CharacterPropertyExceptions( upxBytes, cbUPX, oldVersion);
}
break;
}
......
......@@ -94,6 +94,7 @@ namespace DocFileFormat
class FTXBXS : public ByteStructure
{
friend class TextboxMapping;
public:
struct FTXBXSReusable
{
......@@ -107,7 +108,6 @@ namespace DocFileFormat
int cTxbxEdit; // This value MUST be zero and MUST be ignored.
};
public:
static const int STRUCTURE_SIZE = 22;
FTXBXS ()
......@@ -123,26 +123,22 @@ namespace DocFileFormat
virtual ByteStructure* ConstructObject (VirtualStreamReader* reader, int length)
{
FTXBXS* pFTXBXS = new FTXBXS();
if (pFTXBXS)
{
pFTXBXS->reusable01 = reader->ReadInt32();
pFTXBXS->reusable02 = reader->ReadInt32();
FTXBXS* pFTXBXS = new FTXBXS();
if (!pFTXBXS) return NULL;
pFTXBXS->fReusable = reader->ReadInt16();
pFTXBXS->reusable01 = reader->ReadInt32();
pFTXBXS->reusable02 = reader->ReadInt32();
pFTXBXS->itxbxsDest = reader->ReadInt32();
pFTXBXS->lid = reader->ReadInt32();
pFTXBXS->txidUndo = reader->ReadInt32();
pFTXBXS->fReusable = reader->ReadInt16();
return static_cast<ByteStructure*>(pFTXBXS);
}
pFTXBXS->itxbxsDest = reader->ReadInt32();
pFTXBXS->lid = reader->ReadInt32();
pFTXBXS->txidUndo = reader->ReadInt32();
return NULL;
return static_cast<ByteStructure*>(pFTXBXS);
}
private:
int reusable01;
int reusable02;
......
......@@ -74,7 +74,7 @@ namespace DocFileFormat
{
//emu to pt (1 pt = 12700)
m_dxTextLeft = nLeft / 12700.;
m_dyTextTop = nTop / 12700.;
m_dyTextTop = nTop / 12700.;
m_dxTextRight = nRight / 12700.;
m_dyTextBottom = nBottom / 12700.;
}
......@@ -110,33 +110,38 @@ namespace DocFileFormat
Tbkd* bkd = NULL;
int txtbxSubdocStart =
m_document->FIB->m_RgLw97.ccpText +
m_document->FIB->m_RgLw97.ccpFtn +
m_document->FIB->m_RgLw97.ccpHdr +
m_document->FIB->m_RgLw97.ccpAtn +
m_document->FIB->m_RgLw97.ccpEdn;
m_document->FIB->m_RgLw97.ccpText +
m_document->FIB->m_RgLw97.ccpFtn +
m_document->FIB->m_RgLw97.ccpHdr +
m_document->FIB->m_RgLw97.ccpAtn +
m_document->FIB->m_RgLw97.ccpEdn ;
if (typeid(*_caller) == typeid(MainDocumentMapping))
{
if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size() )//file(21).doc
{
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlex->Elements[m_nTBIndex]);
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlex->Elements[m_nTBIndex]);
}
if (m_nTBIndex < m_document->TextboxBreakPlex->CharacterPositions.size() - 1)
if (m_nTBIndex + 1 < m_document->TextboxBreakPlex->CharacterPositions.size())
{
cp = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex + 1];
cp = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex + 1];
}
else if (m_nTBIndex + 1 < m_document->TextboxIndividualPlex->CharacterPositions.size())
{
cp = m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex];
cpEnd = m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex + 1];
}
}
else if ((typeid(*_caller) == typeid(HeaderMapping)) || (typeid(*_caller) == typeid(FooterMapping)))
{
txtbxSubdocStart += m_document->FIB->m_RgLw97.ccpTxbx;
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlexHeader->Elements[m_nTBIndex]);
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlexHeader->Elements[m_nTBIndex]);
cp = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex + 1];
cp = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex + 1];
}
//convert the textbox text
......
......@@ -31,7 +31,6 @@
*/
#include "VMLPictureMapping.h"
#include "OleObject.h"
#include "OfficeDrawing/GeometryBooleanProperties.h"
#include "OfficeDrawing/GeometryTextBooleanProperties.h"
......@@ -155,40 +154,6 @@ namespace DocFileFormat
void VMLPictureMapping::Apply( IVisitable* visited )
{
PictureDescriptor* pict = dynamic_cast<PictureDescriptor*>(visited);
if (pict) ApplyPict(pict);
OleObject* obj = dynamic_cast<OleObject*>(visited);
if (obj) ApplyObj(obj);
}
void VMLPictureMapping::ApplyObj( OleObject* obj )
{
if (!obj) return;
std::wstring widthString = FormatUtils::DoubleToWideString( 100 );
std::wstring heightString = FormatUtils::DoubleToWideString( 100 );
m_pXmlWriter->WriteNodeBegin( _T( "v:shape" ), true );
PictureFrameType type;
m_pXmlWriter->WriteAttribute( _T( "type" ), std::wstring( _T( "#" ) + VMLShapeTypeMapping::GenerateTypeId(&type)).c_str());
std::wstring style = std::wstring( _T( "width:" ) ) + widthString + std::wstring( _T( "pt;" ) ) + std::wstring( _T( "height:" ) ) + heightString + std::wstring( _T( "pt;" ) );
m_pXmlWriter->WriteAttribute( _T( "style" ), style.c_str() );
m_pXmlWriter->WriteAttribute( _T( "id" ), m_ShapeId.c_str() );
if (m_isOlePreview)
{
m_pXmlWriter->WriteAttribute( _T( "o:ole" ), _T( "" ) );
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "v:shape" ) );
}
void VMLPictureMapping::ApplyPict( PictureDescriptor* pict )
{
if (!pict) return;
double xScaling = pict->mx / 1000.0;
......
......@@ -60,10 +60,6 @@ namespace DocFileFormat
/// Writes a border element
void writePictureBorder (const std::wstring & name, const BorderCode* brc);
void appendStyleProperty( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
void ApplyPict ( PictureDescriptor* p );
void ApplyObj ( OleObject* o );
protected:
/// Copies the picture from the binary stream to the zip archive
/// and creates the relationships for the image.
......
......@@ -52,6 +52,8 @@
#include "OfficeDrawing/GroupShapeBooleanProperties.h"
#include "OfficeDrawing/ProtectionBooleanProperties.h"
#include "DrawingPrimitives.h"
#include "../../DesktopEditor/common/String.h"
namespace DocFileFormat
......@@ -93,6 +95,12 @@ namespace DocFileFormat
{
m_pBlipStore = static_cast<BlipStoreContainer*>(recBs);
}
m_offset_x.push_back(0);
m_offset_y.push_back(0);
m_scale_x.push_back(1);
m_scale_y.push_back(1);
}
VMLShapeMapping::~VMLShapeMapping()
......@@ -104,7 +112,13 @@ namespace DocFileFormat
{
void VMLShapeMapping::Apply(IVisitable* visited)
{
ShapeContainer* pContainer = static_cast<ShapeContainer*>(visited);
DrawingPrimitives * primitives = dynamic_cast<DrawingPrimitives *>(visited);
if ( primitives ) return ApplyPrimitives(primitives);
//----------------------------------------------------------------------------------------------
ShapeContainer* pContainer = dynamic_cast<ShapeContainer*>(visited);
if ((pContainer != NULL) && (!pContainer->Children.empty()))
{
Record* firstRecord = pContainer->Children[0];
......@@ -2084,4 +2098,176 @@ namespace DocFileFormat
return rectangles;
}
//------------------------------------------------------------------------------------------------------
static int count_vml_objects = 0;
void VMLShapeMapping::ApplyPrimitives(DrawingPrimitives * primitives)
{
int index = 0;
while(true)
{
index = ApplyPrimitive(primitives, index);
if (index > primitives->size() - 1)
break;
}
}
static int currentTextBoxIndex = 1;
int VMLShapeMapping::ApplyPrimitive(DrawingPrimitives * primitives, int index)
{
if (!primitives) return index++;
if (index >= primitives->size()) return index++;
DrawingPrimitive *primitive = dynamic_cast<DrawingPrimitive *>(primitives->at(index));
m_pXmlWriter->WriteNodeBegin(primitive->strVmlType.c_str(), TRUE );
TwipsValue x( primitive->xa );
TwipsValue y( primitive->ya );
TwipsValue w( primitive->dxa );
TwipsValue h( primitive->dya );
std::wstring strId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(1024 + (count_vml_objects++));
//m_pXmlWriter->WriteAttribute ( _T( "id") , strId.c_str());
m_pXmlWriter->WriteAttribute ( _T( "o:spid"), strId.c_str());
std::wstring strStyle = _T("position:absolute;visibility:visible;mso-wrap-style:square;");
DrawingPrimitiveLine * line = dynamic_cast<DrawingPrimitiveLine *>(primitive);
if (line)
{
TwipsValue x1( line->xaStart );
TwipsValue y1( line->yaStart );
TwipsValue x2( line->xaEnd );
TwipsValue y2( line->yaEnd );
std::wstring strStart = FormatUtils::IntToWideString(line->xaStart + primitive->xa) + _T(",") + FormatUtils::IntToWideString(line->yaStart + primitive->ya);
std::wstring strEnd = FormatUtils::IntToWideString(line->xaEnd + primitive->xa) + _T(",") + FormatUtils::IntToWideString(line->yaEnd + primitive->ya);
m_pXmlWriter->WriteAttribute(_T("from"), strStart.c_str() );
m_pXmlWriter->WriteAttribute(_T("to"), strEnd.c_str());
}
else
{
if (index > 0)
{
strStyle += _T("left:") + FormatUtils::IntToWideString( primitive->xa) + _T(";");
strStyle += _T("top:") + FormatUtils::IntToWideString( primitive->ya) + _T(";");
strStyle += _T("width:") + FormatUtils::IntToWideString( primitive->dxa) + _T(";");
strStyle += _T("height:") + FormatUtils::IntToWideString( primitive->dya) + _T(";");
}
else
{
//strStyle += _T("left:") + FormatUtils::IntToWideString( x.ToPoints()) + _T("pt;");
//strStyle += _T("top:") + FormatUtils::IntToWideString( y.ToPoints()) + _T("pt;");
strStyle += _T("width:") + FormatUtils::IntToWideString( w.ToPoints()) + _T("pt;");
strStyle += _T("height:") + FormatUtils::IntToWideString( h.ToPoints()) + _T("pt;");
strStyle += _T("margin-left:") + FormatUtils::IntToWideString( x.ToPoints()) + _T("pt;");
strStyle += _T("margin-top:") + FormatUtils::IntToWideString( y.ToPoints()) + _T("pt;");
std::wstring xMargin;
std::wstring yMargin;
if (m_pSpa->bx == PAGE) xMargin = _T("page;");
if (m_pSpa->by == PAGE) yMargin = _T("page;");
if (m_pSpa->bx == MARGIN) xMargin = _T("margin;");
if (m_pSpa->by == MARGIN) yMargin = _T("margin;");
if (!xMargin.empty()) strStyle += _T("mso-position-horizontal-relative:") + xMargin;
if (!yMargin.empty()) strStyle += _T("mso-position-vertical-relative:") + yMargin;
std::wstring strSize = FormatUtils::IntToWideString(primitive->dxa) + _T(",") + FormatUtils::IntToWideString(primitive->dya);
std::wstring strOrigin = FormatUtils::IntToWideString(primitive->xa) + _T(",") + FormatUtils::IntToWideString(primitive->ya);
m_pXmlWriter->WriteAttribute( _T("coordsize"), strSize.c_str());
//m_pXmlWriter->WriteAttribute( _T("coordorigin"), strOrigin.c_str());
}
}
if (primitive->type > 1)
{
m_pXmlWriter->WriteAttribute( _T("fillColor"), FormatUtils::IntToFormattedWideString(primitive->fillFore, L"#%06x").c_str());
}
m_pXmlWriter->WriteAttribute( _T("style"), strStyle.c_str());
std::wstring strStrokeWeight = FormatUtils::IntToWideString(primitive->lineWeight / 20) + _T("pt");
if (primitive->lineWeight > 20)
m_pXmlWriter->WriteAttribute( _T("strokeweight"), strStrokeWeight.c_str());
if (primitive->type > 0)
m_pXmlWriter->WriteAttribute( _T("strokecolor"), FormatUtils::IntToFormattedWideString(primitive->lineColor, L"#%06x").c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
if (primitive->type > 1)
{
m_pXmlWriter->WriteNodeBegin(_T("v:fill"), TRUE );
m_pXmlWriter->WriteAttribute( _T("color2"), FormatUtils::IntToFormattedWideString(primitive->fillBack, L"#%06x").c_str());
if (primitive->fillPattern > 0)
{
m_pXmlWriter->WriteAttribute( _T("type"), _T("pattern"));
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T("v:fill") );
}
if (primitive->lineStyle > 1)
{
m_pXmlWriter->WriteNodeBegin(_T("v:stroke"), TRUE );
std::wstring strDashStyle = FormatUtils::IntToWideString(primitive->lineStyle) + _T(" 1");
m_pXmlWriter->WriteAttribute( _T("dashstyle"), strDashStyle.c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T("v:stroke") );
}
if (primitive->type == 0x0000)
{
m_offset_x.push_back(20000. / primitive->xa);
m_offset_y.push_back(20000. / primitive->ya);
m_scale_x.push_back(20000. / primitive->dxa);
m_scale_y.push_back(20000. / primitive->dya);
index++;
while(true)
{
if (index > primitives->size() - 1)
break;
primitive = dynamic_cast<DrawingPrimitive *>(primitives->at(index));
if (primitive->type == 0x0008)
{
m_offset_x.pop_back();
m_offset_y.pop_back();
m_scale_x.pop_back();
m_scale_y.pop_back();
break;
}
index = ApplyPrimitive(primitives, index);
}
}
if (primitive->type == 0x0002 || primitive->type == 0x0007)
{
int nLTxID = currentTextBoxIndex++;;
if (-1 != nLTxID)
{
TextboxMapping textboxMapping(m_ctx, nLTxID - 1, m_pXmlWriter, m_pCaller);
//textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
m_ctx->_doc->Convert(&textboxMapping);
}
}
m_pXmlWriter->WriteNodeEnd( primitive->strVmlType.c_str() );
index++;
return index;
}
}
......@@ -65,6 +65,9 @@ namespace DocFileFormat
private:
void ApplyPrimitives(DrawingPrimitives * primitives );
int ApplyPrimitive (DrawingPrimitives * primitives, int index);
// Converts a group of shapes
void WriteGroup(const GroupContainer* pContainer);
// Converts a single shape
......@@ -132,5 +135,12 @@ namespace DocFileFormat
XMLTools::XMLElement<wchar_t> m_imagedata;
XMLTools::XMLElement<wchar_t> m_3dstyle;
XMLTools::XMLElement<wchar_t> m_textpath;
//----------------------------------------------------------------
std::vector<double> m_offset_x;
std::vector<double> m_offset_y;
std::vector<double> m_scale_x;
std::vector<double> m_scale_y;
};
}
......@@ -243,12 +243,14 @@ namespace DocFileFormat
if (FIB->m_RgLw97.ccpAtn > 0)
{
IndividualCommentsPlex = new Plex<EmptyStructure>(EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfandTxt, FIB->m_FibWord97.lcbPlcfandTxt, bOlderVersion);
AnnotationsReferencePlex = new Plex<AnnotationReferenceDescriptor>(AnnotationReferenceDescriptor::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcfandRef, FIB->m_FibWord97.lcbPlcfandRef, bOlderVersion);
IndividualCommentsPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfandTxt, FIB->m_FibWord97.lcbPlcfandTxt, bOlderVersion);
}
OfficeDrawingPlex = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaMom, FIB->m_FibWord97.lcbPlcSpaMom, bOlderVersion);
OfficeDrawingPlexHeader = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaHdr, FIB->m_FibWord97.lcbPlcSpaHdr, bOlderVersion);
OfficeDrawingPlex = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaMom, FIB->m_FibWord97.lcbPlcSpaMom, bOlderVersion);
OfficeDrawingPlexHeader = new Plex<Spa> (Spa::GetSize(bOlderVersion), TableStream, FIB->m_FibWord97.fcPlcSpaHdr, FIB->m_FibWord97.lcbPlcSpaHdr, bOlderVersion);
TextboxIndividualPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, bOlderVersion);
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, bOlderVersion);
BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, bOlderVersion);
BookmarkEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkl, FIB->m_FibWord97.lcbPlcfBkl, bOlderVersion);
......@@ -586,6 +588,7 @@ namespace DocFileFormat
RELEASEOBJECT(TextboxBreakPlexHeader);
RELEASEOBJECT(OfficeDrawingPlex);
RELEASEOBJECT(OfficeDrawingPlexHeader);
RELEASEOBJECT(TextboxIndividualPlex);
RELEASEOBJECT(TextboxBreakPlexHeader);
RELEASEOBJECT(SectionPlex);
RELEASEOBJECT(BookmarkStartPlex);
......
......@@ -182,6 +182,7 @@ namespace DocFileFormat
Plex<EmptyStructure> *HeaderStoriesPlex; //A plex of the header document
Plex<EmptyStructure> *IndividualCommentsPlex; // A plex with all ATRDPre10 structs
Plex<EmptyStructure> *TextboxIndividualPlex;
Plex<Tbkd> *TextboxBreakPlex; // Describes the breaks inside the textbox subdocument
Plex<Tbkd> *TextboxBreakPlexHeader; // Describes the breaks inside the header textbox subdocument
......@@ -191,8 +192,6 @@ namespace DocFileFormat
Plex<SectionDescriptor> *SectionPlex; // A Plex containing all section descriptors
Plex<FTXBXS> *m_arFTBXS; // FOR TEST
Plex<BookmarkFirst> *BookmarkStartPlex;
Plex<EmptyStructure> *BookmarkEndPlex;
......
......@@ -411,6 +411,14 @@
RelativePath="..\..\DocDocxConverter\DrawingObjectGrid.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\DrawingPrimitives.cpp"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\DrawingPrimitives.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\EmuValue.h"
>
......@@ -639,6 +647,10 @@
RelativePath="..\..\DocDocxConverter\SinglePropertyModifier.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\Spa.cpp"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\Spa.h"
>
......
......@@ -2,13 +2,6 @@
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
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
EndProject
......@@ -18,20 +11,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeUtilsLib", "..\..\Off
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
ProjectSection(ProjectDependencies) = postProject
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
ProjectSection(ProjectDependencies) = postProject
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
......@@ -56,12 +49,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOffic
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "..\DocFormatTest\DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
ProjectSection(ProjectDependencies) = postProject
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{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}"
......
......@@ -13,20 +13,16 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "..\DesktopEditor\fontengine\font_engine_vs2005.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
ProjectSection(ProjectDependencies) = postProject
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
ProjectSection(ProjectDependencies) = postProject
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
......@@ -68,26 +64,27 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "X2tTest", "..\X2tConverter\
ProjectSection(ProjectDependencies) = postProject
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{41BED424-4EAF-4053-8A5F-1E2A387D53D1} = {41BED424-4EAF-4053-8A5F-1E2A387D53D1}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{CBEDD0D1-10A8-45C1-AF81-8492F40964CA} = {CBEDD0D1-10A8-45C1-AF81-8492F40964CA}
{7B27E40E-F70A-4A74-A77C-0944D7931D15} = {7B27E40E-F70A-4A74-A77C-0944D7931D15}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{AF2D00A7-A351-4700-AE88-C1D9ADE29345} = {AF2D00A7-A351-4700-AE88-C1D9ADE29345}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{DACBE6CA-E089-47D1-8CE7-C7DB59C15417} = {DACBE6CA-E089-47D1-8CE7-C7DB59C15417}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
{50E20601-4A8D-4AFB-8870-63828D328429} = {50E20601-4A8D-4AFB-8870-63828D328429}
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD} = {E5A67556-44DA-4481-8F87-0A3AEDBD20DD}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
{BEE01B53-244A-44E6-8947-ED9342D9247E} = {BEE01B53-244A-44E6-8947-ED9342D9247E}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{BEE01B53-244A-44E6-8947-ED9342D9247E} = {BEE01B53-244A-44E6-8947-ED9342D9247E}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD} = {E5A67556-44DA-4481-8F87-0A3AEDBD20DD}
{50E20601-4A8D-4AFB-8870-63828D328429} = {50E20601-4A8D-4AFB-8870-63828D328429}
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{DACBE6CA-E089-47D1-8CE7-C7DB59C15417} = {DACBE6CA-E089-47D1-8CE7-C7DB59C15417}
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{AF2D00A7-A351-4700-AE88-C1D9ADE29345} = {AF2D00A7-A351-4700-AE88-C1D9ADE29345}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
{7B27E40E-F70A-4A74-A77C-0944D7931D15} = {7B27E40E-F70A-4A74-A77C-0944D7931D15}
{CBEDD0D1-10A8-45C1-AF81-8492F40964CA} = {CBEDD0D1-10A8-45C1-AF81-8492F40964CA}
{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}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment