Compare commits

..

1 Commits

Author SHA1 Message Date
00328e88b2 [ios] spellcheck 2019-03-05 17:27:02 +03:00
111 changed files with 709 additions and 1199 deletions

1
.gitignore vendored
View File

@ -64,4 +64,3 @@ X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
*.tar.gz
**/*.build/
*.log

View File

@ -769,21 +769,12 @@ namespace DocFileFormat
return bytes;
}
#if !defined(_WIN32) && !defined(_WIN64)
static inline std::wstring IntToWideString(unsigned int value)
{
return (std::to_wstring(value));
}
static inline std::wstring IntToWideString(int value)
{
return (std::to_wstring(value));
}
#endif
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)
{
@ -1012,23 +1004,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 +1058,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 +1771,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

@ -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

@ -220,12 +220,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)
@ -292,7 +295,6 @@ namespace DocFileFormat
type.Convert( vmlShapeTypeMapping );
RELEASEOBJECT( vmlShapeTypeMapping );
}
else if (pict->embeddedData)
{
@ -418,23 +420,23 @@ 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:
{
@ -443,7 +445,7 @@ namespace DocFileFormat
if (booleans->fUsefBehindDocument && booleans->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)
//{
@ -452,7 +454,7 @@ namespace DocFileFormat
if (booleans->fHidden && booleans->fUsefHidden)
{
appendStyleProperty(strStyle, L"visibility", L"hidden");
appendStyleProperty(&strStyle, L"visibility", L"hidden");
}
}break;
default:
@ -497,8 +499,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,7 +56,7 @@ 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;
@ -74,7 +74,6 @@ namespace DocFileFormat
bool m_isBullete;
bool m_isEquation;
bool m_isEmbedded;
bool m_isPictureBroken;
std::string m_embeddedData;
std::wstring m_equationXml;
std::wstring m_blobXml;

View File

@ -52,7 +52,6 @@ namespace DocFileFormat
{
m_isInlineShape = isInlineShape;
m_isBullete = false;
m_isPictureBroken = false;
m_pSpa = pSpa;
m_pCaller = pCaller;
@ -278,7 +277,6 @@ namespace DocFileFormat
bool layoutInCell = true; //anmeldebogenfos.doc
bool b3D = false;
bool bShadow = false;
bool bPicturePresent = false;
int ndxTextLeft = -1;
int ndyTextTop = -1;
@ -567,8 +565,6 @@ namespace DocFileFormat
{
appendValueAttribute(&m_fill, L"r:id", std::wstring(( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ));
}
bPicturePresent = true;
}break;
case fillBlipName:
{
@ -651,7 +647,6 @@ namespace DocFileFormat
appendValueAttribute(&m_imagedata, L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString(m_nImageId) ));
}
}
bPicturePresent = true;
}break;
case pibName:
{
@ -756,11 +751,11 @@ namespace DocFileFormat
break;
case 1:
case 5://верт (склони голову направо)
appendStyleProperty(sTextboxStyle, L"layout-flow", L"vertical");
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
break;
case 2://верт (склони голову налево)
appendStyleProperty(sTextboxStyle, L"layout-flow", L"vertical");
appendStyleProperty(sTextboxStyle, L"mso-layout-flow-alt", L"bottom-to-top");
appendStyleProperty(&sTextboxStyle, L"layout-flow", L"vertical");
appendStyleProperty(&sTextboxStyle, L"mso-layout-flow-alt", L"bottom-to-top");
break;
}
}break;
@ -794,18 +789,18 @@ namespace DocFileFormat
if (i < font.size()) font.erase(font.begin() + i, font.end());
font = std::wstring(L"\"") + font + std::wstring(L"\"");
appendStyleProperty(m_textPathStyle, L"font-family", font);
appendStyleProperty(&m_textPathStyle, L"font-family", font);
}
}break;
case gtextSize:
{
std::wstring fontSize = FormatUtils::IntToWideString(iter->op/65535);
appendStyleProperty(m_textPathStyle, L"font-size", fontSize + L"pt");
appendStyleProperty(&m_textPathStyle, L"font-size", fontSize + L"pt");
}break;
case gtextSpacing:
{
std::wstring spacing = FormatUtils::IntToWideString(iter->op);
appendStyleProperty(m_textPathStyle, L"v-text-spacing", spacing + L"f");
appendStyleProperty(&m_textPathStyle, L"v-text-spacing", spacing + L"f");
}break;
case geometryTextBooleanProperties:
{
@ -820,20 +815,20 @@ namespace DocFileFormat
}
if (props->fUsegFVertical && props->fVertical)
{
appendStyleProperty(m_textPathStyle, L"v-rotate-letters", L"t");
appendStyleProperty(&m_textPathStyle, L"v-rotate-letters", L"t");
//_twistDimension = true;
}
if (props->fUsegFKern && props->fKern)
{
appendStyleProperty(m_textPathStyle, L"v-text-kern", L"t");
appendStyleProperty(&m_textPathStyle, L"v-text-kern", L"t");
}
if (props->fUsegFItalic && props->fItalic)
{
appendStyleProperty(m_textPathStyle, L"font-style", L"italic");
appendStyleProperty(&m_textPathStyle, L"font-style", L"italic");
}
if (props->fUsegFBold && props->fBold)
{
appendStyleProperty(m_textPathStyle, L"font-weight", L"bold");
appendStyleProperty(&m_textPathStyle, L"font-weight", L"bold");
}
}break;
default:
@ -878,10 +873,10 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( *xCoord ) + L"," + FormatUtils::IntToWideString( *yCoord ) ));
}
int nCode = 0;
int nCode = 0;
if (pShape->GetShapeType())
{
nCode = pShape->GetShapeType()->GetTypeCode();
nCode = pShape->GetShapeType()->GetTypeCode();
}
if (DocFileFormat::msosptRoundRectangle == nCode)
@ -891,11 +886,6 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute(L"arcsize", m_nAdjValues[0]);
}
}
else if (DocFileFormat::msosptPictureFrame == nCode)
{
if (bPicturePresent == false)
m_isPictureBroken = true;
}
else
{
if (nAdjValues > 0)
@ -1401,9 +1391,9 @@ namespace DocFileFormat
}
}
void VMLShapeMapping::AppendDimensionToStyle(std::wstring& style, const PictureDescriptor* pict, bool twistDimensions) const
void VMLShapeMapping::AppendDimensionToStyle(std::wstring* style, const PictureDescriptor* pict, bool twistDimensions) const
{
if ( pict != NULL )
if ( ( style != NULL ) && ( pict != NULL ) )
{
double xScaling = pict->mx / 1000.0;
double yScaling = pict->my / 1000.0;
@ -1420,23 +1410,26 @@ namespace DocFileFormat
std::wstring widthString = FormatUtils::DoubleToWideString( width.ToPoints() );
std::wstring heightString = FormatUtils::DoubleToWideString( height.ToPoints() );
style += L"width:" + widthString + L"pt;" ;
style += L"height:" + heightString + L"pt;";
style->operator += ( std::wstring( L"width:" ) + widthString + std::wstring( L"pt;" ) );
style->operator += ( std::wstring( L"height:" ) + heightString + std::wstring( L"pt;" ) );
}
}
void VMLShapeMapping::AppendDimensionToStyle(std::wstring& style, const Spa* pSpa, bool twistDimensions) const
void VMLShapeMapping::AppendDimensionToStyle(std::wstring* style, const Spa* pSpa, bool twistDimensions) const
{
if (pSpa != NULL )
if ( ( style != NULL ) && (pSpa != NULL ) )
{
//append size and position ...
if (m_isInlineShape)
{
//if (pSpa->fAnchorLock )
//if (pSpa->bx == TEXT && pSpa->by == TEXT)
//{
// appendStyleProperty( style, L"position", L"static" );
}
else
appendStylePropertyFirst( style, L"position", L"absolute" );
//}
//else
//{
appendStyleProperty( style, L"position", L"absolute" );
//}
TwipsValue left (pSpa->xaLeft);
TwipsValue top (pSpa->yaTop);
@ -1459,9 +1452,9 @@ namespace DocFileFormat
}
}
void VMLShapeMapping::AppendDimensionToStyle(std::wstring& style, const ChildAnchor* anchor, bool twistDimensions) const
void VMLShapeMapping::AppendDimensionToStyle(std::wstring* style, const ChildAnchor* anchor, bool twistDimensions) const
{
if (anchor != NULL)
if ((style != NULL) && (anchor != NULL))
{
DocFileFormat::Rectangle bounds = anchor->rcgBounds;
@ -1471,40 +1464,34 @@ namespace DocFileFormat
bounds.topLeftAngle.y = static_cast<LONG>(((anchor->Bottom + anchor->Top) * 0.5 - (anchor->Right - anchor->Left) * 0.5));
}
appendStylePropertyFirst(style, L"top", FormatUtils::IntToWideString(bounds.topLeftAngle.y));
appendStylePropertyFirst(style, L"left", FormatUtils::IntToWideString(bounds.topLeftAngle.x));
appendStylePropertyFirst(style, L"position", L"absolute");
appendStyleProperty(style, L"position", L"absolute");
appendStyleProperty(style, L"left", FormatUtils::IntToWideString(bounds.topLeftAngle.x));
appendStyleProperty(style, L"top", FormatUtils::IntToWideString(bounds.topLeftAngle.y));
if (twistDimensions)
{
appendStylePropertyFirst(style, L"width", FormatUtils::IntToWideString(bounds.size.cy));
appendStylePropertyFirst(style, L"height", FormatUtils::IntToWideString(bounds.size.cx));
appendStyleProperty(style, L"width", FormatUtils::IntToWideString(bounds.size.cy));
appendStyleProperty(style, L"height", FormatUtils::IntToWideString(bounds.size.cx));
}
else
{
appendStylePropertyFirst(style, L"width", FormatUtils::IntToWideString(bounds.size.cx));
appendStylePropertyFirst(style, L"height", FormatUtils::IntToWideString(bounds.size.cy));
appendStyleProperty(style, L"width", FormatUtils::IntToWideString(bounds.size.cx));
appendStyleProperty(style, L"height", FormatUtils::IntToWideString(bounds.size.cy));
}
}
}
void VMLShapeMapping::appendStyleProperty(std::wstring& style, const std::wstring& propName, const std::wstring& propValue) const
void VMLShapeMapping::appendStyleProperty(std::wstring* b, const std::wstring& propName, const std::wstring& propValue) const
{
style += ( propName );
style += ( L":" );
style += ( propValue );
style +=( L";" );
}
void VMLShapeMapping::appendStylePropertyFirst(std::wstring& style, const std::wstring& propName, const std::wstring& propValue) const
{
std::wstring s;
s += ( propName );
s += ( L":" );
s += ( propValue );
s +=( L";" );
style = s + style;
if ( b != NULL )
{
b->operator += ( propName );
b->operator += ( L":" );
b->operator += ( propValue );
b->operator +=( L";" );
}
}
std::wstring VMLShapeMapping::getTextboxAnchor(unsigned int anchor) const
{
switch ( anchor )
@ -1573,22 +1560,22 @@ namespace DocFileFormat
PositionHorizontalRelative hRel = (PositionHorizontalRelative )hRel_;
switch ( hRel )
{
case msoprhMargin: return L"margin"; //0 //MARGIN = anchor
case msoprhPage: return L"page"; //1 //PAGE
case msoprhText: return L"text"; //2 //TEXT
case msoprhChar: return L"char"; //3
case msoprhMargin: return L"margin";
case msoprhPage: return L"page";
case msoprhText: return L"text";
case msoprhChar: return L"char";
default:
return L"margin";
}
}
void VMLShapeMapping::AppendOptionsToStyle (std::wstring& oStyle, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex) const
void VMLShapeMapping::AppendOptionsToStyle (std::wstring* oStyle, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex) const
{
int nRelH = -1;
int nRelV = -1;
bool bRelH = false;
bool bRelV = false;
int nPosH = -1;
int nPosV = -1;
bool bPosH = false;
bool bPosV = false;
bool bZIndex = false;
@ -1600,40 +1587,36 @@ namespace DocFileFormat
// POSITIONING
case posh:
{
nPosH = iter->op;
appendStyleProperty(oStyle, L"mso-position-horizontal", mapHorizontalPosition((PositionHorizontal)iter->op));
bPosH = true;
}break;
case posrelh:
{
nRelH = iter->op;
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
bRelH = true;
}break;
case posv:
{
nPosV = iter->op;
appendStyleProperty(oStyle, L"mso-position-vertical", mapVerticalPosition((PositionVertical)iter->op));
bPosV = true;
}break;
case posrelv:
{
nRelV = iter->op;
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
bRelV = true;
}break;
// BOOLEANS
case groupShapeBooleans:
{
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
if (booleans->fUsefBehindDocument && booleans->fBehindDocument)
if (booleans->fUsefBehindDocument && booleans->fBehindDocument && !bZIndex)
{
//за текстом (The shape is behind the text, so the z-index must be negative.)
m_isInlineShape = false;
if (!bZIndex)
{
appendStyleProperty(oStyle, L"z-index", FormatUtils::IntToWideString(-zIndex - 0x7ffff));
bZIndex = true;
}
//The shape is behind the text, so the z-index must be negative.
appendStyleProperty(oStyle, L"z-index", L"-1" );
bZIndex = true;
}
if (!m_isInlineShape && !bZIndex)
else if (!m_isInlineShape && !bZIndex)
{
appendStyleProperty( oStyle, L"z-index", FormatUtils::IntToWideString(zIndex + 0x7ffff));
bZIndex = true;
@ -1681,25 +1664,13 @@ namespace DocFileFormat
}
}
if (nRelH < 0 && m_pSpa)
if (!bRelH && m_pSpa)
{
if (m_pSpa->bx == TEXT && bZIndex)
{
m_pSpa->bx = PAGE;
}
else
{//rel column
}
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative(m_pSpa->bx));
}
if (nRelV < 0 && m_pSpa)
if (!bRelV && m_pSpa)
{
if (m_pSpa->by == TEXT && bZIndex)
{
m_pSpa->by = PAGE;
}
else
{//rel paragraph
}
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->by));
}
if (!m_isInlineShape && !bZIndex)
{
@ -1707,19 +1678,6 @@ namespace DocFileFormat
bZIndex = true;
}
if (nRelH == 3 && nRelV == 3)
{
m_isInlineShape = true;
}
if (nPosH >= 0 && !m_isInlineShape)
{
appendStyleProperty(oStyle, L"mso-position-horizontal", mapHorizontalPosition((PositionHorizontal)nPosH));
}
if (nPosV >= 0 && !m_isInlineShape)
{
appendStyleProperty(oStyle, L"mso-position-vertical", mapVerticalPosition((PositionVertical)nPosV));
}
//if (!bPosH)
//{
// appendStyleProperty(oStyle, L"mso-position-horizontal", L"absolute" );
@ -1763,38 +1721,26 @@ namespace DocFileFormat
}
}
if ( shape->fFlipH )
{
appendStyleProperty( style, L"flip", L"x" );
}
if ( shape->fFlipV )
{
appendStyleProperty( style, L"flip", L"y" );
}
AppendOptionsToStyle( style, options, zIndex );
//don't append the dimension info to lines,
// because they have "from" and "to" attributes to decline the dimension
if(false == shape->is<LineType>())
if(!shape->is<LineType>())
{
if ( (m_pSpa != NULL) && ( anchor == NULL ) )
{
//this shape is placed directly in the document,
//so use the FSPA to build the style
AppendDimensionToStyle( style, m_pSpa, twistDimensions);
AppendDimensionToStyle(&style, m_pSpa, twistDimensions);
}
else if (anchor)
{
//the style is part of a group,
//so use the anchor
AppendDimensionToStyle( style, anchor, twistDimensions);
AppendDimensionToStyle(&style, anchor, twistDimensions);
}
else if (m_pict)
{
// it is some kind of PICT shape (e.g. WordArt)
AppendDimensionToStyle( style, m_pict, twistDimensions);
AppendDimensionToStyle(&style, m_pict, twistDimensions);
}
}
else
@ -1802,23 +1748,36 @@ namespace DocFileFormat
//если не написать тип позиции, то будет inline
if ( anchor != NULL )
{
appendStylePropertyFirst( style, L"position", L"absolute" );
appendStyleProperty( &style, L"position", L"absolute" );
}
else if (m_pSpa)
{
//append size and position ...
//if (m_pSpa->fAnchorLock)//это возможность смены привязки , а не ее тип
if (m_isInlineShape)/*m_pSpa->bx == TEXT && m_pSpa->by == TEXT*/
//if (m_pSpa->bx == TEXT && m_pSpa->by == TEXT)
//{
// appendStyleProperty( &style, L"position", L"static" );
//}
//else
{
// appendStyleProperty( style, L"position", L"static" );
}
else
{
appendStylePropertyFirst( style, L"position", L"absolute" );
appendStyleProperty( &style, L"position", L"absolute" );
}
}
}
if ( shape->fFlipH )
{
appendStyleProperty( &style, L"flip", L"x" );
}
if ( shape->fFlipV )
{
appendStyleProperty( &style, L"flip", L"y" );
}
AppendOptionsToStyle( &style, options, zIndex );
return style;
}

View File

@ -67,7 +67,6 @@ namespace DocFileFormat
static std::wstring mapHorizontalPositionRelative(int hRel );
bool m_isBullete;
bool m_isPictureBroken;
std::wstring m_shapeId;
private:
@ -83,16 +82,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;
void AppendOptionsToStyle ( std::wstring* style, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
int UpdateFromGuides(const int val) const;
@ -124,7 +122,7 @@ namespace DocFileFormat
int m_nAdjValues[8];
std::vector<ODRAW::MSOSG> m_arrGuides;
mutable bool m_isInlineShape;
bool m_isInlineShape;
Spa* m_pSpa;
IMapping* m_pCaller;
BlipStoreContainer* m_pBlipStore;

View File

@ -173,16 +173,12 @@ namespace DocFileFormat
//Lock ???
ODRAW::ProtectionBooleanProperties *prot = dynamic_cast<ODRAW::ProtectionBooleanProperties*>(pShape->Lock.get());
if ((prot) && (prot->fUsefLockAspectRatio))
if ((prot) && (prot->fUsefLockAspectRatio && prot->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

@ -224,7 +224,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

@ -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

@ -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

@ -1071,7 +1071,7 @@ void docx_conversion_context::process_styles()
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_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())
{

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

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

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

@ -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));

View File

@ -462,9 +462,7 @@ void odf_drawing_context::end_group()
impl_->current_group_ = impl_->group_list_.back()->prev_group;
impl_->group_list_.pop_back();
if (!impl_->current_level_.empty())
impl_->current_level_.pop_back();
impl_->current_level_.pop_back();
}
@ -2054,8 +2052,8 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
double x = x_pt ? *x_pt : 0;
double y = y_pt ? *y_pt : 0;
//double cx = *impl_->current_drawing_state_.cx_;
//double cy = *impl_->current_drawing_state_.cy_;
double cx = *impl_->current_drawing_state_.cx_;
double cy = *impl_->current_drawing_state_.cy_;
if (impl_->current_drawing_state_.in_group_)
{
@ -2069,8 +2067,8 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
x = (x + impl_->group_list_[i]->shift_x) * impl_->group_list_[i]->scale_cx ;
y = (y + impl_->group_list_[i]->shift_y) * impl_->group_list_[i]->scale_cy;
//cx *= impl_->group_list_[i]->scale_cx;
//cy *= impl_->group_list_[i]->scale_cy;
cx *= impl_->group_list_[i]->scale_cx;
cy *= impl_->group_list_[i]->scale_cy;
}
}
@ -2375,7 +2373,6 @@ void odf_drawing_context::set_textarea_font(std::wstring & latin, std::wstring &
}
void odf_drawing_context::set_textarea_fontcolor(std::wstring hexColor)
{
if (hexColor.empty()) return;
if (impl_->current_drawing_state_.elements_.empty())return;
odf_style_state_ptr style_state = impl_->styles_context_->last_state(style_family::Paragraph);

View File

@ -240,14 +240,14 @@ void odf_number_styles_context::set_odf_context(odf_conversion_context * Context
}
void odf_number_styles_context::create(int oox_num_fmt, std::wstring formatCode)
{
if (oox_num_fmt < 164) return create_default(oox_num_fmt, formatCode);
if (oox_num_fmt <164)return create_default(oox_num_fmt,formatCode);
number_format_state state;
state.oox_num_fmt = oox_num_fmt;
state.style_name = std::wstring(L"NF1000") + boost::lexical_cast<std::wstring>( number_format_array_.size()+1);
state.ods_type = office_value_type::Custom;
state.language_code = 0;
state.language_code=0;
//////////////////////////////
@ -259,7 +259,7 @@ void odf_number_styles_context::create(int oox_num_fmt, std::wstring formatCode)
}
number_format_array_.push_back(state);
named_link_map_[oox_num_fmt] = (int)number_format_array_.size() - 1;
named_link_map_[oox_num_fmt] = number_format_array_.size() - 1;
detect_format(number_format_array_.back());
}
@ -271,14 +271,8 @@ void odf_number_styles_context::create_default(int oox_num_fmt, std::wstring for
state.oox_num_fmt = oox_num_fmt;
state.ods_type = office_value_type::Custom;
state.language_code = 0;
if (oox_num_fmt == 0 && formatCode.empty())
{
//general
}
else
state.style_name = std::wstring(L"NF1000") + boost::lexical_cast<std::wstring>( number_format_array_.size()+1);
state.style_name = std::wstring(L"NF1000") + boost::lexical_cast<std::wstring>( number_format_array_.size()+1);
state.language_code=0;
switch (oox_num_fmt)
{
@ -348,7 +342,7 @@ void odf_number_styles_context::create_default(int oox_num_fmt, std::wstring for
////////////////////////////////////////////
number_format_array_.push_back(state);
named_link_map_[oox_num_fmt] = (int)number_format_array_.size() - 1;
named_link_map_[oox_num_fmt] = number_format_array_.size() - 1;
detect_format(number_format_array_.back());
@ -361,7 +355,7 @@ number_format_state & odf_number_styles_context::add_or_find(int oox_num_fmt, st
}
else
{
create(oox_num_fmt, formatCode);
create(oox_num_fmt,formatCode);
return number_format_array_.back();
}
}
@ -440,7 +434,7 @@ void odf_number_styles_context::create_numbers(number_format_state & state, offi
if (std::wstring::npos != splits[i].find(L"\""))
{
bText = true;
indText = (int)i;
indText = i;
break;
}
}
@ -448,7 +442,7 @@ void odf_number_styles_context::create_numbers(number_format_state & state, offi
{
if (i != indText)
{
indNumber = (int)i;
indNumber = i;
break;
}
}
@ -539,13 +533,12 @@ void odf_number_styles_context::create_percentage_style(number_format_state & st
create_numbers(state, elm, empty);
root_elm->add_child_element(elm);
office_element_ptr elm_text;
create_element(L"number", L"text", elm_text, odf_context_);
number_text* number_text_ = dynamic_cast<number_text*>(elm_text.get());
create_element(L"number", L"text", elm, odf_context_);
number_text* number_text_ = dynamic_cast<number_text*>(elm.get());
if (number_text_)number_text_->add_text(L"%");
root_elm->add_child_element(elm_text);
styles_elments.push_back(elm_text);
root_elm->add_child_element(elm);
styles_elments.push_back(elm);
}
void odf_number_styles_context::create_currency_style(number_format_state & state, office_element_ptr & root_elm)
@ -575,7 +568,7 @@ void odf_number_styles_context::create_currency_style(number_format_state & stat
}
}
if (false == number_country.empty())
if (number_country.length()>0)
{
number_currency_symbol_->number_country_ = number_country;
}

View File

@ -92,27 +92,22 @@ void odf_page_layout_context::create_layer_sets()
create_element(L"draw", L"layer", elm, odf_context_); sets_elm->add_child_element(elm);
layer = dynamic_cast<draw_layer*>(elm.get());
if (layer) layer->draw_name_ = L"layout";
elm = office_element_ptr();
create_element(L"draw", L"layer", elm, odf_context_); sets_elm->add_child_element(elm);
layer = dynamic_cast<draw_layer*>(elm.get());
if (layer) layer->draw_name_ = L"background";
elm = office_element_ptr();
create_element(L"draw", L"layer", elm, odf_context_); sets_elm->add_child_element(elm);
layer = dynamic_cast<draw_layer*>(elm.get());
if (layer) layer->draw_name_ = L"backgroundobjects";
elm = office_element_ptr();
create_element(L"draw", L"layer", elm, odf_context_); sets_elm->add_child_element(elm);
layer = dynamic_cast<draw_layer*>(elm.get());
if (layer) layer->draw_name_ = L"controls";
elm = office_element_ptr();
create_element(L"draw", L"layer", elm, odf_context_); sets_elm->add_child_element(elm);
layer = dynamic_cast<draw_layer*>(elm.get());
if (layer) layer->draw_name_ = L"measurelines";
elm = office_element_ptr();
master_state_list_.push_back( odf_master_state(sets_elm) );
}

View File

@ -601,23 +601,15 @@ void odf_table_context::set_cell_row_span(int spanned)
else
{
int col = impl_->current_table().current_column - 1;
if (col < (int)impl_->current_table().columns.size())
{
odf_column_state & state = impl_->current_table().columns[col];
odf_column_state & state = impl_->current_table().columns[col];
state.spanned_row_cell.push_back(impl_->current_table().cells.back().elm);
}
state.spanned_row_cell.push_back(impl_->current_table().cells.back().elm);
}
}
void odf_table_context::set_cell_row_span_restart()
{
int col = impl_->current_table().current_column - 1;
if (col >= (int)impl_->current_table().columns.size())
return;
odf_column_state & state = impl_->current_table().columns[col];
unsigned int sz = (unsigned int)state.spanned_row_cell.size();

View File

@ -77,7 +77,7 @@ std::wstring convert_date(const std::wstring & oox_date)
{
return oox_date;
}
boost::gregorian::date date_ = boost::gregorian::date(1900, 1, 1) + boost::gregorian::date_duration(iDate - 2);
boost::gregorian::date date_ = boost::gregorian::date(1900, 1, 1) + boost::gregorian::date_duration(iDate-2);
////to for example, "1899-12-31T05:37:46.66569
std::wstring date_str;
@ -110,18 +110,19 @@ std::wstring convert_time(const std::wstring & oox_time)
}
//PT12H15M42S
int hours = 0, minutes = 0;
double sec = 0;
int hours=0, minutes=0;
double sec=0;
boost::posix_time::time_duration day(24, 0, 0);
double millisec = day.total_milliseconds() * dTime;
//todooo ПЕРЕПИСАТЬ !!!
//boost::posix_time::time_duration day(24, 0, 0);
//
//double millisec = day.total_milliseconds() * dTime;
sec = millisec /1000.;
hours = sec/60./60.;
minutes = (sec - (hours * 60 * 60))/60.;
sec = sec - (hours *60 + minutes) * 60.;
//sec = millisec /1000.;
//hours = sec/60./60.;
//minutes = (sec - (hours * 60 * 60))/60.;
//sec = sec - (hours *60 + minutes) * 60.;
int sec1 = sec;

View File

@ -102,7 +102,7 @@ namespace utils
f = false;
else
v += 1;
res += (int)(v * mul);
res += v * mul;
mul *= r;
}
return res;

View File

@ -748,7 +748,7 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
odf_context()->drawing_context()->set_no_fill();
odf_context()->drawing_context()->end_line_properties();
odf_context()->drawing_context()->end_shape();
odf_context()->drawing_context()->end_text_box();
odf_context()->drawing_context()->end_drawing();
odf_context()->drawing_context()->end_group();
@ -1689,9 +1689,7 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
if (size_pt < 0.001 && odf_list_type == 1000)
{
odf_writer::odf_style_state_ptr state = odf_context()->styles_context()->last_state(odf_types::style_family::Paragraph);
odf_writer::style_text_properties *text_props = state ? state->get_text_properties() : NULL;
odf_writer::style_text_properties * text_props = odf_context()->styles_context()->last_state(odf_types::style_family::Paragraph)->get_text_properties();
if (text_props && text_props->content_.fo_font_size_)
{
size_pt = text_props->content_.fo_font_size_->get_length().get_value_unit(odf_types::length::pt);
@ -1979,11 +1977,11 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
odf_writer::odf_drawing_context *drawing = odf_context()->drawing_context();
if (drawing) //from styles drawing impossible( ... todoooo ???
{
//if ((oox_run_pr->Fill.is<PPTX::Logic::GradFill>()) ||
// (oox_run_pr->ln.IsInit() /*&& (oox_run_pr->ln->Fill.is_init() && oox_run_pr->ln->Fill.getType() != OOX::et_a_noFill)*/))
//{
// drawing->change_text_box_2_wordart();
//}
if ((oox_run_pr->Fill.is<PPTX::Logic::GradFill>()) ||
(oox_run_pr->ln.IsInit() /*&& (oox_run_pr->ln->Fill.is_init() && oox_run_pr->ln->Fill.getType() != OOX::et_a_noFill)*/))
{
drawing->change_text_box_2_wordart();
}
if (drawing->is_wordart())
{
@ -2016,8 +2014,7 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
if (oox_run_pr->ln.is_init())
{
if (drawing)
drawing->start_line_properties(true);
drawing->start_line_properties(true);
if (oox_run_pr->ln->Fill.is_init() && oox_run_pr->ln->Fill.getType() == OOX::et_a_solidFill )
{
solidFill = &oox_run_pr->ln->Fill.as<PPTX::Logic::SolidFill>();

View File

@ -310,8 +310,8 @@ void PptxConverter::convert_slides()
bool bShowLayoutMasterAnim = slide->Layout->showMasterPhAnim.get_value_or(true);
bool bShowLayoutMasterSp = slide->Layout->showMasterSp.get_value_or(true);
if (slide->Master->cSld.attrName.IsInit()) master_style_name = slide->Master->cSld.attrName.get();
else if ((current_theme) && (current_theme->name.IsInit())) master_style_name = current_theme->name.get();
if (slide->Master->cSld.attrName.IsInit()) master_style_name = slide->Master->cSld.attrName.get();
else if (current_theme->name.IsInit()) master_style_name = current_theme->name.get();
master_style_name += L"_" ;

View File

@ -59,17 +59,7 @@ _UINT32 COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstr
POLE::Storage *pStgFrom = new POLE::Storage(sFileName.c_str());
if (pStgFrom == NULL) return AVS_ERROR_FILEFORMAT;
try
{
if (false == pStgFrom->open(false, false))
{
return AVS_ERROR_FILEACCESS; //file access error or not compound file
}
}
catch(...)
{
return AVS_ERROR_FILEACCESS;
}
pStgFrom->open(false, false);
m_pReader = new CPPTFileReader(pStgFrom, m_strTempDirectory);
CPPTFileReader* pptReader = (CPPTFileReader*)m_pReader;

View File

@ -121,15 +121,8 @@ public:
{
if (m_arUsers.empty()) return false;
try
{
m_arUsers[0]->ReadExtenalObjects(strFolderMem);
m_arUsers[0]->FromDocument();
}
catch(int) //error code
{
return false;
}
m_arUsers[0]->ReadExtenalObjects(strFolderMem);
m_arUsers[0]->FromDocument();
return true;
}

View File

@ -860,12 +860,7 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide)
if (pPairTheme == m_mapMasterToTheme.end())
{
//????? слайду не присвоена тема !!!
if (false == m_mapMasterToTheme.empty())
pPairTheme = m_mapMasterToTheme.begin();
else
{
throw 1; // file format error
}
pPairTheme = m_mapMasterToTheme.begin();
}
//-----------------
pSlide->m_lThemeID = pPairTheme->second;
@ -1771,10 +1766,8 @@ void CPPTUserInfo::LoadMaster(_typeMaster type, CRecordSlide* pMaster, CSlideInf
//настройки текстовых стилей -----------------------------------------------
for (size_t i = 0; i < 9 && false == m_arMasterWrapper.empty(); ++i)
{
for (size_t i = 0; i < 9; ++i)
pMasterWrapper->m_pStyles[i] = m_arMasterWrapper[0].m_pStyles[i]; //main master
}
CLayout* pLayout = NULL; // ну нету тут разметок ...!!

View File

@ -349,14 +349,6 @@
RelativePath="..\..\ASCOfficePPTXFile\Editor\BinaryFileReaderWriter.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Writer\BinaryReader.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\BinaryWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>

View File

@ -502,18 +502,15 @@ namespace PPTX
{
if (parentFileIs<Slide>())
{
if (parentFileAs<Slide>().Layout.IsInit())
parentFileAs<Slide>().Layout->GetLevelUp(this);
parentFileAs<Slide>().Layout->GetLevelUp(this);
}
else if(parentFileIs<SlideLayout>())
{
if (parentFileAs<SlideLayout>().Master.IsInit())
parentFileAs<SlideLayout>().Master->GetLevelUp(this);
parentFileAs<SlideLayout>().Master->GetLevelUp(this);
}
else if(parentFileIs<NotesSlide>())
{
if (parentFileAs<NotesSlide>().master_.IsInit())
parentFileAs<NotesSlide>().master_->GetLevelUp(this);
parentFileAs<NotesSlide>().master_->GetLevelUp(this);
}
}
}

View File

@ -279,7 +279,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
}
else if (( st_inline == m_eAnchorTypeShape || st_none == m_eAnchorTypeShape) && !m_bIsOle)
{
if( NULL != m_oPicture && m_nShapeType == ODRAW::sptPictureFrame && !m_bInGroup)
if( NULL != m_oPicture && m_nShapeType == ODRAW::sptPictureFrame)
{
if (m_oPicture->m_nWidth == PROP_DEF)
{
@ -361,13 +361,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
//sResult += L"{\\sp{\\sn fLockRotation}{\\sv 1}}";
//picture
if( NULL != m_oPicture && m_nShapeType == ODRAW::sptPictureFrame && m_bInGroup)
{
sResult += L"{\\sp{\\sn pib}{\\sv ";
sResult += m_oPicture->RenderToRtf( oRenderParameter );
sResult += L"}}";
}
else if( NULL != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 3 || m_nFillType == 9)
if( 0 != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 3 || m_nFillType == 9)
{
sResult += L"{\\sp{\\sn fillBlip}{\\sv ";
sResult += m_oPicture->RenderToRtf( oRenderParameter );

View File

@ -343,14 +343,6 @@
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\XlsxSerializerCom\Writer\BinaryReader.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\BinaryWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>

View File

@ -359,14 +359,6 @@
<Filter
Name="Common"
>
<File
RelativePath="..\..\XlsxSerializerCom\Writer\BinaryReader.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\BinaryWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>

View File

@ -35,14 +35,16 @@
namespace XLS
{
ContinueFrt::ContinueFrt() : nData(0)
ContinueFrt::ContinueFrt()
{
}
ContinueFrt::~ContinueFrt()
{
}
BaseObjectPtr ContinueFrt::clone()
{
return BaseObjectPtr(new ContinueFrt(*this));
@ -50,15 +52,10 @@ BaseObjectPtr ContinueFrt::clone()
void ContinueFrt::readFields(CFRecord& record)
{
record >> frtHeaderOld;
nData = record.getDataSize() - 4;
pData = boost::shared_array<char>(new char[nData]);
memcpy(pData.get(), record.getCurData<char>(), nData);
record.skipNunBytes(nData);
#pragma message("####################### ContinueFrt record is not implemented")
Log::error("ContinueFrt record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
}
} // namespace XLS

View File

@ -31,12 +31,13 @@
*/
#pragma once
#include "../Biff_structures/FrtHeaderOld.h"
#include "BiffRecord.h"
namespace XLS
{
// Logical representation of ContinueFrt record in BIFF8
class ContinueFrt: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ContinueFrt)
@ -46,14 +47,11 @@ public:
~ContinueFrt();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeContinueFrt;
FrtHeaderOld frtHeaderOld;
boost::shared_array<char> pData;
size_t nData;
static const ElementType type = typeContinueFrt;
};

View File

@ -35,14 +35,16 @@
namespace XLS
{
ContinueFrt11::ContinueFrt11(): nData(0)
ContinueFrt11::ContinueFrt11()
{
}
ContinueFrt11::~ContinueFrt11()
{
}
BaseObjectPtr ContinueFrt11::clone()
{
return BaseObjectPtr(new ContinueFrt11(*this));
@ -51,15 +53,6 @@ BaseObjectPtr ContinueFrt11::clone()
void ContinueFrt11::readFields(CFRecord& record)
{
record >> frtHeaderOld;
nData = record.getDataSize() - 4;
pData = boost::shared_array<char>(new char[nData]);
memcpy(pData.get(), record.getCurData<char>(), nData);
record.skipNunBytes(nData);
}
} // namespace XLS

View File

@ -31,12 +31,13 @@
*/
#pragma once
#include "../Biff_structures/FrtHeaderOld.h"
#include "BiffRecord.h"
namespace XLS
{
// Logical representation of ContinueFrt11 record in BIFF8
class ContinueFrt11: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(ContinueFrt11)
@ -46,14 +47,12 @@ public:
~ContinueFrt11();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeContinueFrt11;
FrtHeaderOld frtHeaderOld;
boost::shared_array<char> pData;
size_t nData;
};
} // namespace XLS

View File

@ -52,13 +52,10 @@ BaseObjectPtr CrtMlFrt::clone()
void CrtMlFrt::readFields(CFRecord& record)
{
record >> frtHeader >> cbXmltkChain;
//xmltkChain.cb = cbXmltkChain;
//record >> xmltkChain;
record.skipNunBytes(cbXmltkChain);
record.skipNunBytes(4);
#pragma message("####################### CrtMlFrt record is not implemented")
Log::error("CrtMlFrt record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
}
} // namespace XLS

View File

@ -31,12 +31,13 @@
*/
#pragma once
#include "../Biff_structures/FrtHeader.h"
#include "BiffRecord.h"
namespace XLS
{
// Logical representation of CrtMlFrt record in BIFF8
class CrtMlFrt: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(CrtMlFrt)
@ -46,16 +47,12 @@ public:
~CrtMlFrt();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeCrtMlFrt;
FrtHeader frtHeader;
_UINT32 cbXmltkChain;
//XmlTkChain xmltkChain;
//-----------------------------
_UINT32 cb;

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of Dimensions record in BIFF8
class Dimensions: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Dimensions)
@ -45,10 +47,11 @@ public:
~Dimensions();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeDimensions;
static const ElementType type = typeDimensions;
int serialize(std::wostream & stream);

View File

@ -40,15 +40,18 @@ DropDownObjIds::DropDownObjIds()
{
}
DropDownObjIds::~DropDownObjIds()
{
}
BaseObjectPtr DropDownObjIds::clone()
{
return BaseObjectPtr(new DropDownObjIds(*this));
}
void DropDownObjIds::readFields(CFRecord& record)
{
FrtHeader frtHeader(rt_DropDownObjIds);

View File

@ -32,10 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/DropDownObjId.h"
#include <Logic/Biff_structures/DropDownObjId.h>
namespace XLS
{
// Logical representation of DropDownObjIds record in BIFF8
class DropDownObjIds: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(DropDownObjIds)
@ -45,6 +48,7 @@ public:
~DropDownObjIds();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -58,15 +58,12 @@ void ExternSheet::readFields(CFRecord& record)
if (record.getGlobalWorkbookInfo()->Version < 0x0600)
{
unsigned char type;
unsigned char size;
record >> size >> type;
LPAnsiStringNoCch stName(size);
record >> stName;
ShortXLAnsiString stName;
record >> type >> stName;
name = stName.value();
//int type = stName.value().substr(0, 1).c_str()[0];
//if (!name.empty())
// record.getGlobalWorkbookInfo()->arExternalNames.push_back(name);

View File

@ -31,12 +31,11 @@
*/
#include "Feature11.h"
#include "ContinueFrt11.h"
namespace XLS
{
Feature11::Feature11(bool bFeat12) : bFeature12(bFeat12)
Feature11::Feature11()
{
}
@ -51,18 +50,6 @@ BaseObjectPtr Feature11::clone()
void Feature11::readFields(CFRecord& record)
{
size_t sz = continue_records.size();
std::list<CFRecordPtr>& recs = continue_records[rt_ContinueFrt11];
while (!recs.empty())
{
ContinueFrt11 continueFrt;
continueFrt.readFields(*recs.front());
record.appendRawData(continueFrt.pData.get(), continueFrt.nData);
recs.pop_front();
}
record >> frtRefHeaderU;
record >> isf;
@ -80,13 +67,7 @@ void Feature11::readFields(CFRecord& record)
refs2.push_back(BiffStructurePtr(new Ref8U(reff)));
sqref += reff.toString() + ((i == cref2 - 1) ? L"" : L" ");
}
if (cbFeatData == 0)
{
cbFeatData = record.getDataSize() - (cref2 * 8) - 27;
}
rgbFeat.bFeature12 = bFeature12;
rgbFeat.cbFeatData = cbFeatData;
record >> rgbFeat;
}

View File

@ -31,7 +31,7 @@
*/
#pragma once
#include "BiffRecordContinued.h"
#include "BiffRecord.h"
#include "../Biff_structures/FrtRefHeaderU.h"
#include "../Biff_structures/CellRangeRef.h"
@ -40,12 +40,12 @@
namespace XLS
{
class Feature11 : public BiffRecordContinued //: public BiffRecord
class Feature11: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Feature11)
BASE_OBJECT_DEFINE_CLASS_NAME(Feature11)
public:
Feature11(bool bFeat12 = false);
Feature11();
~Feature11();
BaseObjectPtr clone();
@ -62,8 +62,6 @@ public:
std::wstring sqref;
TableFeatureType rgbFeat;
bool bFeature12;
};
} // namespace XLS

View File

@ -31,12 +31,11 @@
*/
#include "Feature12.h"
#include "ContinueFrt.h"
namespace XLS
{
Feature12::Feature12() : feature11(true)
Feature12::Feature12()
{
}
@ -52,17 +51,6 @@ BaseObjectPtr Feature12::clone()
void Feature12::readFields(CFRecord& record)
{
size_t sz = continue_records.size();
std::list<CFRecordPtr>& recs = continue_records[rt_ContinueFrt];
while (!recs.empty())
{
ContinueFrt continueFrt;
continueFrt.readFields(*recs.front());
record.appendRawData(continueFrt.pData.get(), continueFrt.nData);
recs.pop_front();
}
feature11.readFields(record);
}

View File

@ -32,11 +32,13 @@
#pragma once
#include "BiffRecord.h"
#include "../Biff_structures/LongRGB.h"
#include <Logic/Biff_structures/LongRGB.h>
namespace XLS
{
// Logical representation of LineFormat record in BIFF8
class LineFormat: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(LineFormat)
@ -46,6 +48,7 @@ public:
~LineFormat();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -36,6 +36,7 @@
namespace XLS
{
class IXFCellMulBlankSpecial : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(IXFCellMulBlankSpecial)
@ -52,6 +53,9 @@ public:
std::vector<unsigned short> rgixfe;
};
// Logical representation of MulBlank record in BIFF8
class MulBlank: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(MulBlank)

View File

@ -179,7 +179,10 @@ void Obj::readFields(CFRecord& record)
old_version.anchor->loadFields(record);
record >> nMacrosSize;
record.skipNunBytes(6);
record.skipNunBytes(2);
record >> nNameLen;
record.skipNunBytes(2);
if(OBJ_Line == cmo.ot)
{
@ -187,26 +190,6 @@ void Obj::readFields(CFRecord& record)
record >> old_version.flag;
record >> old_version.flag2;
}
else if(OBJ_DropdownList == cmo.ot)
{
old_version.bFill = true;
record >> old_version.fill;
record >> old_version.line;
record.skipNunBytes(6);
short iVal, iMin, iMax, dInc, dPage, fHoriz, dxScroll, grbit, ifnt;
record >> iVal >> iMin >> iMax >> dInc >> dPage >> fHoriz >> dxScroll >> grbit;
record.skipNunBytes(18);
record >> ifnt;
record.skipNunBytes(14);
short xLeft, yTop, xRight, yBot;
record >> xLeft >> yTop >> xRight >> yBot;
record.skipNunBytes(4);
}
else
{
old_version.bFill = true;
@ -278,38 +261,9 @@ void Obj::readFields(CFRecord& record)
old_version.name = txO->name;
}
else if(OBJ_DropdownList == cmo.ot)
{
record >> old_version.name;
short cbFmla1, cbFmla2, cbFmla3;
ObjectParsedFormula fmla1, fmla2, fmla3;
record >> cbFmla1;
if (cbFmla1 > 0)
{
fmla1.load(record);
}
record >> cbFmla2;
if (cbFmla2 > 0)
{
fmla2.load(record);
}
record >> cbFmla3;
if (cbFmla3 > 0)
{
fmla3.load(record);
}
short cLines, iSel, flag1, flag2, cLine, dxMin;
record >> cLines >> iSel >> flag1;
record.skipNunBytes(2);
record >> flag2 >> cLine >> dxMin;
//record.skipNunBytes(2);
}
else
{
//if (nNameLen > 0)
if (nNameLen > 0)
{
record >> old_version.name;
}

View File

@ -95,8 +95,8 @@ public:
bool bFill = false;
ShortXLAnsiString name;
_UINT32 fill = 0;//(icvBack, icvFore, fls, fAuto)
_UINT32 line = 0;//(icv, lns, lnw, fAuto)
_UINT32 fill = 0;
_UINT32 line = 0;
_UINT16 flag = 0;
_UINT16 flag2 = 0;
}old_version;

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of Row record in BIFF8
class Row: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Row)
@ -45,12 +47,13 @@ public:
~Row();
BaseObjectPtr clone();
void readFields(CFRecord& record);
int serialize(std::wostream & stream);
static const ElementType type = typeRow;
static const ElementType type = typeRow;
GlobalWorkbookInfoPtr global_info_;

View File

@ -50,6 +50,7 @@ BaseObjectPtr Sort::clone()
return BaseObjectPtr(new Sort(*this));
}
void Sort::readFields(CFRecord& record)
{
unsigned short flags;
@ -67,52 +68,20 @@ void Sort::readFields(CFRecord& record)
unsigned char cchKey2;
unsigned char cchKey3;
record >> cchKey1 >> cchKey2 >> cchKey3;
if (record.getGlobalWorkbookInfo()->Version >= 0x0600)
if(cchKey1)
{
XLUnicodeStringNoCch stKey1_, stKey2_, stKey3_;
if(cchKey1)
{
stKey1_.setSize(cchKey1);
record >> stKey1_;
stKey1 = stKey1_.value();
}
if(cchKey2)
{
stKey2_.setSize(cchKey2);
record >> stKey2_;
stKey2 = stKey2_.value();
}
if(cchKey3)
{
stKey3_.setSize(cchKey3);
record >> stKey3_;
stKey3 = stKey3_.value();
}
stKey1.setSize(cchKey1);
record >> stKey1;
}
else
if(cchKey2)
{
LPAnsiStringNoCch stKey1_, stKey2_, stKey3_;
if(cchKey1)
{
stKey1_.setSize(cchKey1);
record >> stKey1_;
stKey1 = stKey1_.value();
}
if(cchKey2)
{
stKey2_.setSize(cchKey2);
record >> stKey2_;
stKey2 = stKey2_.value();
}
if(cchKey3)
{
stKey3_.setSize(cchKey3);
record >> stKey3_;
stKey3 = stKey3_.value();
}
stKey2.setSize(cchKey2);
record >> stKey2;
}
if(cchKey3)
{
stKey3.setSize(cchKey3);
record >> stKey3;
}
record.skipNunBytes(1); // reserved
}

View File

@ -63,9 +63,9 @@ public:
_INT16 iOrder;
bool fAltMethod;
std::wstring stKey1;
std::wstring stKey2;
std::wstring stKey3;
XLUnicodeStringNoCch stKey1;
XLUnicodeStringNoCch stKey2;
XLUnicodeStringNoCch stKey3;
};
} // namespace XLS

View File

@ -50,10 +50,7 @@ void CachedDiskHeader::load(CFRecord& record)
rgHdrDisk.size = cbdxfHdrDisk;
rgHdrDisk.load(record);
}
if (fSaveStyleName)
{
record >> strStyleName;
}
record >> strStyleName;
}
} // namespace XLS

View File

@ -52,9 +52,6 @@ public:
_UINT32 cbdxfHdrDisk;
DXFN12List rgHdrDisk;
XLUnicodeString strStyleName;
bool fSaveStyleName;
};
typedef boost::shared_ptr<CachedDiskHeader> CachedDiskHeaderPtr;

View File

@ -64,7 +64,6 @@ void DXFN12List::load(CFRecord& record)
bExist = true;
record >> dxfn;
size -= (record.getRdPtr() - pos_record);
pos_record = record.getRdPtr();
}
if (size > 0)
{

View File

@ -57,7 +57,7 @@ public:
XFExtNoFRT xfext;
//-----------------------------------------------------------------
bool bExist;
_INT32 size;
_UINT32 size;
};
typedef boost::shared_ptr<DXFN12List> DXFN12ListPtr;

View File

@ -36,11 +36,13 @@
namespace XLS
{
BiffStructurePtr DropDownObjId::clone()
{
return BiffStructurePtr(new DropDownObjId(*this));
}
void DropDownObjId::load(CFRecord& record)
{
record >> id;

View File

@ -49,6 +49,7 @@ public:
virtual void load(CFRecord& record);
ObjId id;
};

View File

@ -49,7 +49,6 @@ void Feat11FdaAutoFilter::load(CFRecord& record)
if (cbAutoFilter >= 0xffff0000)
{
//LCA BI - Financial Report Usage2010.xls
record.RollRdPtrBack(4);
return;
}
record.skipNunBytes(2);

View File

@ -36,7 +36,7 @@
namespace XLS
{
Feat11FieldDataItem::Feat11FieldDataItem(_UINT32 _lt, bool bDskHeaderCache, bool bFeat12) : lt(_lt), bDiskHdrCache(bDskHeaderCache), bFeature12(bFeat12)
Feat11FieldDataItem::Feat11FieldDataItem(_UINT32 _lt, bool bDskHeaderCache) : lt(_lt), bDiskHdrCache(bDskHeaderCache)
{
}
BiffStructurePtr Feat11FieldDataItem::clone()
@ -96,7 +96,7 @@ void Feat11FieldDataItem::load(CFRecord& record)
{
fmla.load(record);
}
if (fLoadTotalFmla && bFeature12)
if (fLoadTotalFmla)
{
if (fLoadTotalArray)
{
@ -107,7 +107,7 @@ void Feat11FieldDataItem::load(CFRecord& record)
totalFmla.load(record);
}
}
if (fLoadTotalStr && bFeature12)
if (fLoadTotalStr)
{
record >> strTotal;
}
@ -122,7 +122,6 @@ void Feat11FieldDataItem::load(CFRecord& record)
}
if (bDiskHdrCache)
{
dskHdrCache.fSaveStyleName = fSaveStyleName;
record >> dskHdrCache;
}
}

View File

@ -50,7 +50,7 @@ class Feat11FieldDataItem : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(Feat11FieldDataItem)
public:
Feat11FieldDataItem(_UINT32 lt, bool bDskHeaderCache, bool bFeat12);
Feat11FieldDataItem(_UINT32 lt, bool bDskHeaderCache);
BiffStructurePtr clone();
static const ElementType type = typeFeat11FieldDataItem;
@ -97,7 +97,6 @@ public:
//------------------------------------------------
_UINT32 lt;
bool bDiskHdrCache;
bool bFeature12;
};
typedef boost::shared_ptr<Feat11FieldDataItem> Feat11FieldDataItemPtr;

View File

@ -50,6 +50,8 @@ public:
BiffStructurePtr clone();
virtual void load(CFRecord& record);
static const ElementType type = typeFrtHeader;

View File

@ -74,7 +74,7 @@ public:
unsigned short nElems, nElemsAlloc;
unsigned short cbElem;
size_t pos1 = record.getRdPtr();
int pos1 = record.getRdPtr();
record >> nElems >> nElemsAlloc >> cbElem;

View File

@ -59,7 +59,7 @@ public:
XLS::BiffStructurePtr clone()
{
return XLS::BiffStructurePtr(new OfficeArtBlip((unsigned short)recType));
return XLS::BiffStructurePtr(new OfficeArtBlip(recType));
}
static const XLS::ElementType type = XLS::typeOfficeArtBlip;

View File

@ -131,7 +131,7 @@ void PtgArea3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool f
ptg_stack.push(strRange + range_ref);
}
}
if (ixti < global_info->arXti_External.size())
if (ixti != 0xffff)
{
std::wstring link = global_info->arXti_External[ixti].link;
if (!link.empty() && !range_ref.empty())

View File

@ -80,13 +80,13 @@ void PtgFuncVar::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool
{
arguments += ptg_stack.top();
ptg_stack.pop();
for(unsigned char i = 0; i < nparams - 1 && !ptg_stack.empty(); ++i)
for(unsigned char i = 0; i < nparams - 1 ; ++i)
{
arguments = ptg_stack.top() + L',' + arguments;
ptg_stack.pop();
}
}
if(0xFF == tab.getIndex()&& !ptg_stack.empty()) // user-defined function
if(0xFF == tab.getIndex() && ptg_stack.size() > 0) // user-defined function
{
func_name = ptg_stack.top();

View File

@ -87,25 +87,6 @@ void TableFeatureType::load(CFRecord& record)
fLoadCSPName = GETBIT(flags, 14);
fLoadPldwIdChanged = GETBIT(flags, 15);
if (bFeature12)
{
//crwHeader = 0;
//lt = 0x00000003;
//fSingleCell = false;
}
else
{
//lt != 0x00000003;
//crwHeader == 0 && fSingleCell == false -> lt = 0
}
if (fAutoFilter) crwHeader = 1;
if (fSingleCell)
{
crwHeader = 0;
crwTotals = 0;
}
record >> flags;
verXL = GETBITS(flags, 0, 4);
fLoadEntryId = GETBIT(flags, 4);
@ -124,7 +105,7 @@ void TableFeatureType::load(CFRecord& record)
record.skipNunBytes(16); // rgbHashParam
record >> rgbName;
record >> cFieldData; //from 1 to 0x100
record >> cFieldData; //from 1 to 100
if (fLoadCSPName)
record >> cSPName;
@ -137,7 +118,7 @@ void TableFeatureType::load(CFRecord& record)
if (record.getRdPtr() >= record.getDataSize())
return;
arFieldData.push_back(BiffStructurePtr(new Feat11FieldDataItem(lt, (crwHeader == 0x0000 && fSingleCell == 0x0000), bFeature12)));
arFieldData.push_back(BiffStructurePtr(new Feat11FieldDataItem(lt, (crwHeader == 0x0000 && fSingleCell))));
arFieldData.back()->load(record);
}
if (fLoadPldwIdDeleted)

View File

@ -93,10 +93,6 @@ public:
BiffStructurePtr idDeleted;
BiffStructurePtr idChanged;
BiffStructurePtr cellInvalid;
//-------
_UINT32 cbFeatData;
bool bFeature12;
};
typedef boost::shared_ptr<TableFeatureType> TableFeatureTypePtr;

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of AUTOFILTER union of records
class AUTOFILTER: public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(AUTOFILTER)
@ -55,7 +57,7 @@ public:
std::vector<BaseObjectPtr> m_arSORTDATA12;
GlobalWorkbookInfoPtr global_info_;
GlobalWorkbookInfoPtr pGlobalWorkbookInfoPtr;
};

View File

@ -42,6 +42,7 @@
namespace XLS
{
AUTOFILTER::AUTOFILTER()
{
}
@ -86,11 +87,11 @@ const bool AUTOFILTER::loadContent(BinProcessor& proc)
return false;
}
global_info_ = proc.getGlobalWorkbookInfo();
pGlobalWorkbookInfoPtr = proc.getGlobalWorkbookInfo();
m_AutoFilterInfo = elements_.back();
elements_.pop_back();
int count = proc.repeated<Parenthesis_AUTOFILTER_1>(0, 0);
while(count > 0)
{
@ -138,13 +139,13 @@ int AUTOFILTER::serialize(std::wostream & stream)
AutoFilterInfo *info = dynamic_cast<AutoFilterInfo*>(m_AutoFilterInfo.get());
std::map<std::wstring, std::vector<std::wstring>>::iterator it = global_info_->mapDefineNames.find(L"_xlnm._FilterDatabase");
std::map<std::wstring, std::vector<std::wstring>>::iterator it = pGlobalWorkbookInfoPtr->mapDefineNames.find(L"_xlnm._FilterDatabase");
if (it == global_info_->mapDefineNames.end()) return 0;
if (it == pGlobalWorkbookInfoPtr->mapDefineNames.end()) return 0;
int count_columns = info->cEntries;
size_t ind = global_info_->current_sheet;
size_t ind = pGlobalWorkbookInfoPtr->current_sheet;
std::wstring ref;
if (ind < it->second.size() && ind >= 0)
@ -158,7 +159,7 @@ int AUTOFILTER::serialize(std::wostream & stream)
}
if (ref.empty()) return 0;
std::wstring sheet_name = ind <= global_info_->sheets_info.size() ? global_info_->sheets_info[ind-1].name : L"";
std::wstring sheet_name = ind <= pGlobalWorkbookInfoPtr->sheets_info.size() ? pGlobalWorkbookInfoPtr->sheets_info[ind-1].name : L"";
if (!sheet_name.empty())
{
int pos = ref.find(sheet_name);

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of AXISPARENT union of records
class AXISPARENT: public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(AXISPARENT)

View File

@ -38,6 +38,7 @@ namespace XLS
class CellRef;
// Logical representation of CELL union of records
class CELL: public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(CELL)
@ -51,7 +52,7 @@ public:
int serialize(std::wostream & stream);
static const ElementType type = typeCELL;
static const ElementType type = typeCELL;
int RowNumber;
int ColumnNumber;

View File

@ -31,19 +31,18 @@
*/
#include "CELLTABLE.h"
#include "CELL.h"
#include "../Biff_records/EntExU2.h"
#include "../Biff_records/Row.h"
#include "../Biff_records/DBCell.h"
#include "../Biff_records/MulBlank.h"
#include "../Biff_records/MulRk.h"
#include <Logic/Biff_records/EntExU2.h>
#include <Logic/Biff_records/Row.h>
#include <Logic/Biff_unions/CELL.h>
#include <Logic/Biff_records/DBCell.h>
#include <simple_xml_writer.h>
namespace XLS
{
// This class is made a deriver of CompositeObject intentionally.
// This is an optimization step - to form a CELLTABLE that is divided into smaller groups
class CELL_GROUP : public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(CELL_GROUP)
@ -60,10 +59,11 @@ public:
const bool loadContent(BinProcessor& proc)
{
global_info_ = proc.getGlobalWorkbookInfo();
int index_sheet_info_ = global_info_->current_sheet - 1;
global_info_ = proc.getGlobalWorkbookInfo();
GlobalWorkbookInfo::_sheet_info & sheet_info = global_info_->sheets_info[index_sheet_info_];
XLS::GlobalWorkbookInfo::_sheet_info zero;
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info_->current_sheet >=0 ?
global_info_->sheets_info[global_info_->current_sheet - 1] : zero;
int count, count_row = 0;
@ -81,22 +81,7 @@ public:
sheet_info.customRowsHeight.insert(std::make_pair(row->rw, row->miyRw / 20.));
}
}
std::map<int, GlobalWorkbookInfo::_row_info>::iterator pFindRow = sheet_info.mapRows.find(row->rw);
if (pFindRow == sheet_info.mapRows.end())
{
GlobalWorkbookInfo::_row_info row_info;
row_info.row_info = elements_.front();
sheet_info.mapRows.insert(std::make_pair(row->rw, row_info));
}
else
{
if (!pFindRow->second.row_info)
{
pFindRow->second.row_info = elements_.front();
}
}
m_rows.push_back(elements_.front());
elements_.pop_front();
count--;
}
@ -112,25 +97,16 @@ public:
CELL * cell = dynamic_cast<CELL *>(elements_.front().get());
if (cell)
{
std::map<int, GlobalWorkbookInfo::_row_info>::iterator pFindRow = sheet_info.mapRows.find(cell->RowNumber);
if (pFindRow == sheet_info.mapRows.end())
std::map<int, std::list<BaseObjectPtr>>::iterator it = m_cells.find(cell->RowNumber);
if (it == m_cells.end())
{
GlobalWorkbookInfo::_row_info row_info;
sheet_info.mapRows.insert(std::make_pair(cell->RowNumber, row_info));
pFindRow = sheet_info.mapRows.find(cell->RowNumber);
}
std::map<int, BaseObjectPtr>::iterator pFindCell = pFindRow->second.mapCells.find(cell->ColumnNumber);
if (pFindCell != pFindRow->second.mapCells.end())
{
CELL* cell_prev = dynamic_cast<CELL *>(pFindCell->second.get());
pFindCell->second = elements_.front();
std::list<BaseObjectPtr> c;
c.push_back(elements_.front());
m_cells.insert(std::make_pair(cell->RowNumber, c));
}
else
{
pFindRow->second.mapCells.insert(std::make_pair(cell->ColumnNumber, elements_.front()));
it->second.push_back(elements_.front());
}
}
elements_.pop_front();
@ -148,19 +124,158 @@ public:
else return false;
}
static const ElementType type = typeCELL_GROUP;
int serialize(std::wostream & stream);
static const ElementType type = typeCELL_GROUP;
//---------------------------------------------------------------------------
std::list<BaseObjectPtr> m_DBCells;
std::map<int, std::list<BaseObjectPtr>> m_cells;
std::list<BaseObjectPtr> m_rows;
std::list<BaseObjectPtr> m_DBCells;
private:
std::vector<CellRangeRef>& shared_formulas_locations_ref_;
GlobalWorkbookInfoPtr global_info_;
};
struct _CompareRowCell
{
bool operator()(XLS::BaseObjectPtr & first, XLS::BaseObjectPtr & second)
{
CELL * cell_1 = dynamic_cast<CELL *>(first.get());
CELL * cell_2 = dynamic_cast<CELL *>(second.get());
if (!cell_1 || !cell_2)
return true;
if (cell_1->RowNumber < cell_2->RowNumber)
return true;
else
return false;
}
}CompareRowCell;
struct _CompareColumnCell
{
bool operator()(XLS::BaseObjectPtr & first, XLS::BaseObjectPtr & second)
{
CELL * cell_1 = dynamic_cast<CELL *>(first.get());
CELL * cell_2 = dynamic_cast<CELL *>(second.get());
if (!cell_1 || !cell_2)
return true;
if (cell_1->ColumnNumber < cell_2->ColumnNumber)
return true;
else
return false;
}
}CompareColumnCell;
int CELL_GROUP::serialize(std::wostream & stream)
{
XLS::GlobalWorkbookInfo::_sheet_info zero;
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info_->current_sheet >=0 ?
global_info_->sheets_info[global_info_->current_sheet - 1] : zero;
CP_XML_WRITER(stream)
{
std::list<XLS::BaseObjectPtr>::iterator current_row = m_rows.begin();
for (std::map<int, std::list<BaseObjectPtr>>::iterator it_row = m_cells.begin(); it_row != m_cells.end(); it_row++)
{
it_row->second.sort(CompareColumnCell);
Row * row = NULL;
if (current_row != m_rows.end())
{
row = dynamic_cast<Row *>(current_row->get());
while ((row) && (row->rw < it_row->first))
{//skip cells
row->serialize(stream);
current_row++;
if (current_row == m_rows.end())
break;
row = dynamic_cast<Row *>(current_row->get());
}
}
CP_XML_NODE(L"row")
{
CP_XML_ATTR(L"r", it_row->first + 1);
if ((row) && (row->rw == it_row->first))
{
bool xf_set = true;
if (row->fGhostDirty == false) xf_set = false;
if (xf_set)
{
int xf = row->ixfe_val >= global_info_->cellStyleXfs_count ? row->ixfe_val - global_info_->cellStyleXfs_count : -1/*row->ixfe_val*/;
if (xf < global_info_->cellXfs_count && xf >= 0)
{
CP_XML_ATTR(L"s", xf);
CP_XML_ATTR(L"customFormat", true);
}
}
if (row->miyRw > 0 && row->miyRw < 0x8000) //v8_14A_1b13.xls
{
CP_XML_ATTR(L"ht", row->miyRw / 20.);
CP_XML_ATTR(L"customHeight", true);
}
if (row->iOutLevel > 0)
{
CP_XML_ATTR(L"outlineLevel", row->iOutLevel);
}
if (row->fCollapsed)
{
CP_XML_ATTR(L"collapsed", row->fCollapsed);
}
if (row->fExAsc)
{
CP_XML_ATTR(L"thickTop", true);
}
if (row->fExDes)
{
CP_XML_ATTR(L"thickBot", true);
}
if (row->fDyZero)
{
CP_XML_ATTR(L"hidden", true);
}
row = NULL;
current_row++;
if (current_row != m_rows.end())
row = dynamic_cast<Row *>(current_row->get());
}
for ( std::list<BaseObjectPtr>::iterator it_cell = it_row->second.begin(); it_cell != it_row->second.end(); it_cell++)
{
(*it_cell)->serialize(CP_XML_STREAM());
}
}
}
while (current_row != m_rows.end())
{//skip cells ... last rows
(*current_row)->serialize(stream);
current_row++;
}
}
return 0;
}
//-----------------------------------------------------------------------------------------------------------------
CELLTABLE::CELLTABLE(std::vector<CellRangeRef>& shared_formulas_locations_ref) :
isConcatinate_(false), shared_formulas_locations_ref_(shared_formulas_locations_ref)
m_count_CELL_GROUP(0)
,shared_formulas_locations_ref_(shared_formulas_locations_ref)
{
}
@ -178,31 +293,16 @@ BaseObjectPtr CELLTABLE::clone()
// CELLTABLE = 1*(1*Row *CELL 1*DBCell) *EntExU2
const bool CELLTABLE::loadContent(BinProcessor& proc)
{
global_info_ = proc.getGlobalWorkbookInfo();
index_sheet_info_ = global_info_->current_sheet - 1;
GlobalWorkbookInfo::_sheet_info zero;
while (index_sheet_info_ >= global_info_->sheets_info.size())
{
global_info_->sheets_info.push_back(zero);
}
CELL_GROUP cell_group(shared_formulas_locations_ref_);
if(!proc.mandatory(cell_group))
CELL_GROUP cell_group1(shared_formulas_locations_ref_);
if(!proc.mandatory(cell_group1))
{
return false;
}
int count = 1 + proc.repeated(cell_group, 0, 0);
while(!elements_.empty())
{
//m_arCELLGROUP.insert(m_arCELLGROUP.begin(), elements_.back());
elements_.pop_back();
count--;
}
count = proc.repeated<EntExU2>(0, 0);
CELL_GROUP cell_group2(shared_formulas_locations_ref_);
m_count_CELL_GROUP = proc.repeated(cell_group2, 0, 0);
int count = proc.repeated<EntExU2>(0, 0);
while(count > 0)
{
m_arEntExU2.insert(m_arEntExU2.begin(), elements_.back());
@ -211,95 +311,12 @@ const bool CELLTABLE::loadContent(BinProcessor& proc)
}
return true;
}
int CELLTABLE::serialize(std::wostream & stream)
{
GlobalWorkbookInfo::_sheet_info & sheet_info = global_info_->sheets_info[index_sheet_info_];
CP_XML_WRITER(stream)
{
for (std::map<int, GlobalWorkbookInfo::_row_info>::iterator it_row = sheet_info.mapRows.begin(); it_row != sheet_info.mapRows.end(); it_row++)
{
Row* row = dynamic_cast<Row*>(it_row->second.row_info.get());
if (row && it_row->second.mapCells.empty())
{
it_row->second.row_info->serialize(stream);
}
else
{
CP_XML_NODE(L"row")
{
CP_XML_ATTR(L"r", it_row->first + 1);
if (row)
{
bool xf_set = true;
if (row->fGhostDirty == false) xf_set = false;
if (xf_set)
{
int xf = row->ixfe_val >= global_info_->cellStyleXfs_count ? row->ixfe_val - global_info_->cellStyleXfs_count : -1/*row->ixfe_val*/;
if (xf < global_info_->cellXfs_count && xf >= 0)
{
CP_XML_ATTR(L"s", xf);
CP_XML_ATTR(L"customFormat", true);
}
}
if (row->miyRw > 0 && row->miyRw < 0x8000) //v8_14A_1b13.xls
{
CP_XML_ATTR(L"ht", row->miyRw / 20.);
CP_XML_ATTR(L"customHeight", true);
}
if (row->iOutLevel > 0)
{
CP_XML_ATTR(L"outlineLevel", row->iOutLevel);
}
if (row->fCollapsed)
{
CP_XML_ATTR(L"collapsed", row->fCollapsed);
}
if (row->fExAsc)
{
CP_XML_ATTR(L"thickTop", true);
}
if (row->fExDes)
{
CP_XML_ATTR(L"thickBot", true);
}
if (row->fDyZero)
{
CP_XML_ATTR(L"hidden", true);
}
}
for ( std::map<int, BaseObjectPtr>::iterator it_cell = it_row->second.mapCells.begin(); it_cell != it_row->second.mapCells.end(); it_cell++)
{
if (isConcatinate_)
{
CELL* cell = dynamic_cast<CELL*>((it_cell->second).get());
MulBlank *mulblank = dynamic_cast<MulBlank*>(cell->elements_.begin()->get());
MulRk *mulrk = dynamic_cast<MulRk*>(cell->elements_.begin()->get());
if (mulblank || mulrk)
{
std::map<int, BaseObjectPtr>::iterator it_next_cell = it_cell; it_next_cell++;
if (it_next_cell != it_row->second.mapCells.end())
{
CELL* cell_next = dynamic_cast<CELL*>((it_next_cell->second).get());
if (mulblank) mulblank->colLast = (std::min)((int)mulblank->colLast, cell_next->ColumnNumber - 1);
if (mulrk) mulrk->colLast = (std::min)((int)mulrk->colLast, cell_next->ColumnNumber - 1);
}
}
}
(it_cell->second)->serialize(CP_XML_STREAM());
}
}
}
}
for (std::list<XLS::BaseObjectPtr>::iterator it = elements_.begin(); it != elements_.end(); ++it)
{
it->get()->serialize(stream);
}
return 0;
}

View File

@ -54,12 +54,8 @@ public:
int serialize(std::wostream & stream);
std::vector<CellRangeRef>& shared_formulas_locations_ref_;
int m_count_CELL_GROUP;
std::vector<BaseObjectPtr> m_arEntExU2;
GlobalWorkbookInfoPtr global_info_;
int index_sheet_info_;
bool isConcatinate_;
};
} // namespace XLS

View File

@ -35,8 +35,8 @@
#include "../Biff_records/Blank.h"
#include "../Biff_records/MulBlank.h"
#include "../Biff_records/MulRk.h"
#include "../Biff_records/RK.h"
#include "../Biff_records/MulRk.h"
#include "../Biff_records/BoolErr.h"
#include "../Biff_records/Number.h"
#include "../Biff_records/LabelSst.h"

View File

@ -31,12 +31,9 @@
*/
#include "CHART.h"
#include "../ChartSheetSubstream.h"
#include "../Biff_records/BOF.h"
#include "../Biff_records/Continue.h"
#include "../Biff_unions/CELLTABLE.h"
#include "../Biff_structures/CellRangeRef.h"
#include "../Biff_records/EOF.h"
#include <Logic/Biff_records/BOF.h>
#include <Logic/ChartSheetSubstream.h>
#include <Logic/Biff_records/Continue.h>
namespace XLS
{
@ -54,17 +51,12 @@ BaseObjectPtr CHART::clone()
const bool CHART::loadContent(BinProcessor& proc)
{
GlobalWorkbookInfoPtr global_info = proc.getGlobalWorkbookInfo();
unsigned short ss_type;
if(!proc.getNextSubstreamType(ss_type) || BOF::st_Chart != ss_type)
{
return false;
}
size_t tmp_index_table = global_info->sheets_info.size(); //if present table
ChartSheetSubstream chart_sheet(tmp_index_table);
ChartSheetSubstream chart_sheet(-1);
if(!proc.mandatory(chart_sheet))
{
return false;
@ -90,20 +82,6 @@ const bool CHART::loadContent(BinProcessor& proc)
elements_.pop_back();
count--;
}
//chart_sourcedata_missing_import_biff5.xls
if (proc.getGlobalWorkbookInfo()->Version < 0x0600)
{
std::vector<CellRangeRef> shared_formulas_locations;
CELLTABLE cell_table_temlate(shared_formulas_locations);
if (proc.optional(cell_table_temlate))
{
//cash table
}
if (proc.optional<EOF_T>())
{//???
}
}
return true;
}

View File

@ -36,6 +36,8 @@
namespace XLS
{
// Logical representation of CRT union of records
class CRT: public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(CRT)

View File

@ -31,24 +31,24 @@
*/
#include "CUSTOMVIEW.h"
#include "AUTOFILTER.h"
#include "../Biff_records/UserSViewBegin.h"
#include "../Biff_records/Selection.h"
#include "../Biff_records/HorizontalPageBreaks.h"
#include "../Biff_records/VerticalPageBreaks.h"
#include "../Biff_records/Header.h"
#include "../Biff_records/Footer.h"
#include "../Biff_records/HCenter.h"
#include "../Biff_records/VCenter.h"
#include "../Biff_records/LeftMargin.h"
#include "../Biff_records/RightMargin.h"
#include "../Biff_records/TopMargin.h"
#include "../Biff_records/BottomMargin.h"
#include "../Biff_records/Pls.h"
#include "../Biff_records/Setup.h"
#include "../Biff_records/PrintSize.h"
#include "../Biff_records/HeaderFooter.h"
#include "../Biff_records/UserSViewEnd.h"
#include <Logic/Biff_records/UserSViewBegin.h>
#include <Logic/Biff_records/Selection.h>
#include <Logic/Biff_records/HorizontalPageBreaks.h>
#include <Logic/Biff_records/VerticalPageBreaks.h>
#include <Logic/Biff_records/Header.h>
#include <Logic/Biff_records/Footer.h>
#include <Logic/Biff_records/HCenter.h>
#include <Logic/Biff_records/VCenter.h>
#include <Logic/Biff_records/LeftMargin.h>
#include <Logic/Biff_records/RightMargin.h>
#include <Logic/Biff_records/TopMargin.h>
#include <Logic/Biff_records/BottomMargin.h>
#include <Logic/Biff_records/Pls.h>
#include <Logic/Biff_records/Setup.h>
#include <Logic/Biff_records/PrintSize.h>
#include <Logic/Biff_records/HeaderFooter.h>
#include <Logic/Biff_records/UserSViewEnd.h>
#include <Logic/Biff_unions/AUTOFILTER.h>
namespace XLS
{
@ -105,7 +105,7 @@ const bool CUSTOMVIEW::loadContent(BinProcessor& proc)
proc.optional<TopMargin>();
proc.optional<BottomMargin>();
if (proc.optional<Pls>())
if (proc.optional<Pls>())
{
m_pls = elements_.back();
elements_.pop_back();

View File

@ -80,7 +80,9 @@ public:
return false;
}
}
int count = proc.repeated<List12>(0, 0);
int count = 0;
count = proc.repeated<ContinueFrt11>(0, 0);
count = proc.repeated<List12>(0, 0);
while (proc.optional<AutoFilter12>())
{
@ -197,14 +199,10 @@ int FEAT11::serialize(std::wostream & strm, size_t index)
{
if (display.empty()) display = feature11->rgbFeat.rgbName.value();
CP_XML_ATTR(L"id", feature11->rgbFeat.idList);
CP_XML_ATTR(L"name", feature11->rgbFeat.rgbName.value());
CP_XML_ATTR(L"displayName", display);
CP_XML_ATTR(L"ref", feature11->sqref);
CP_XML_ATTR(L"headerRowCount", feature11->rgbFeat.crwHeader);
CP_XML_ATTR(L"totalsRowCount", feature11->rgbFeat.crwTotals);
//CP_XML_ATTR(L"totalsRowShown", feature11->rgbFeat.fShownTotalRow);
CP_XML_ATTR(L"id", feature11->rgbFeat.idList);
CP_XML_ATTR(L"name", feature11->rgbFeat.rgbName.value());
CP_XML_ATTR(L"displayName", display);
CP_XML_ATTR(L"ref", feature11->sqref);
if (!comment.empty())
CP_XML_ATTR(L"comment", comment);
@ -291,23 +289,7 @@ int FEAT11::serialize(std::wostream & strm, size_t index)
//if (!field->stData.value().empty())
// CP_XML_ATTR(L"dataDxfId", field->stData.value());
}
if (field->fmla.bFmlaExist)
{
CP_XML_NODE(L"calculatedColumnFormula")
{
CP_XML_STREAM() << field->fmla.fmla.getAssembledFormula();
}
}
if (field->fLoadTotalFmla)
{
CP_XML_NODE(L"totalsRowFormula")
{
if (field->fLoadTotalArray)
CP_XML_STREAM() << field->totalArrayFmla.getAssembledFormula();
else
CP_XML_STREAM() << field->totalFmla.getAssembledFormula();
}
}
//totalsRowFunction
}
}
}

View File

@ -31,9 +31,9 @@
*/
#include "INTERFACE.h"
#include "../Biff_records/InterfaceHdr.h"
#include "../Biff_records/Mms.h"
#include "../Biff_records/InterfaceEnd.h"
#include <Logic/Biff_records/InterfaceHdr.h>
#include <Logic/Biff_records/Mms.h>
#include <Logic/Biff_records/InterfaceEnd.h>
namespace XLS
{

View File

@ -95,7 +95,7 @@ const bool IVAXIS::loadContent(BinProcessor& proc)
elements_.pop_back();
}
if (proc.optional<AxcExt>()) // 4-th place
if (proc.mandatory<AxcExt>()) // 4-th place
{
m_AxcExt = elements_.back();
elements_.pop_back();
@ -109,7 +109,7 @@ const bool IVAXIS::loadContent(BinProcessor& proc)
m_CatLab = elements_.back();
elements_.pop_back();
}
if (proc.optional<AXS>())
if (proc.mandatory<AXS>())
{
m_AXS = elements_.back();
elements_.pop_back();

View File

@ -32,20 +32,18 @@
#include "PAGESETUP.h"
#include "../Biff_records/Header.h"
#include "../Biff_records/Footer.h"
#include "../Biff_records/HCenter.h"
#include "../Biff_records/VCenter.h"
#include "../Biff_records/LeftMargin.h"
#include "../Biff_records/RightMargin.h"
#include "../Biff_records/TopMargin.h"
#include "../Biff_records/BottomMargin.h"
#include "../Biff_records/Pls.h"
#include "../Biff_records/Continue.h"
#include "../Biff_records/Setup.h"
#include "../Biff_records/HeaderFooter.h"
#include "../Biff_records/HorizontalPageBreaks.h"
#include "../Biff_records/VerticalPageBreaks.h"
#include <Logic/Biff_records/Header.h>
#include <Logic/Biff_records/Footer.h>
#include <Logic/Biff_records/HCenter.h>
#include <Logic/Biff_records/VCenter.h>
#include <Logic/Biff_records/LeftMargin.h>
#include <Logic/Biff_records/RightMargin.h>
#include <Logic/Biff_records/TopMargin.h>
#include <Logic/Biff_records/BottomMargin.h>
#include <Logic/Biff_records/Pls.h>
#include <Logic/Biff_records/Continue.h>
#include <Logic/Biff_records/Setup.h>
#include <Logic/Biff_records/HeaderFooter.h>
namespace XLS
{
@ -137,13 +135,10 @@ const bool PAGESETUP::loadContent(BinProcessor& proc)
elements_.pop_back();
}
}break;
case rt_BottomMargin: proc.optional<BottomMargin>(); break;
case rt_BottomMargin: proc.optional<BottomMargin>(); break;
case rt_TopMargin: proc.optional<TopMargin>(); break;
case rt_LeftMargin: proc.optional<LeftMargin>(); break;
case rt_RightMargin: proc.optional<RightMargin>(); break;
case rt_HorizontalPageBreaks: proc.optional<HorizontalPageBreaks>(); break;
case rt_VerticalPageBreaks: proc.optional<VerticalPageBreaks>(); break;
case rt_Pls:
{
if (proc.optional<Pls>())
@ -243,35 +238,32 @@ int PAGESETUP::serialize(std::wostream & stream)
if (!r) CP_XML_ATTR(L"right" , 0.75);
}
if (setup)
if (setup->iFitHeight > 0 && setup->iFitWidth == 1 && setup->iScale == 100)
{
if (setup->iFitHeight > 0 && setup->iFitWidth == 1 && setup->iScale == 100)
setup->iScale = 90;
}
if (false == setup->fNoPls)
{
CP_XML_NODE(L"pageSetup")// - для chartsheet аккуратнее
{
setup->iScale = 90;
}
CP_XML_ATTR(L"paperSize", setup->iPaperSize);
CP_XML_ATTR(L"firstPageNumber", setup->iPageStart);
CP_XML_ATTR(L"scale", setup->iScale);
if (false == setup->fNoPls)
{
CP_XML_NODE(L"pageSetup")// - для chartsheet аккуратнее
{
CP_XML_ATTR(L"paperSize", setup->iPaperSize);
CP_XML_ATTR(L"firstPageNumber", setup->iPageStart);
CP_XML_ATTR(L"scale", setup->iScale);
CP_XML_ATTR(L"orientation", setup->fPortrait ? L"portrait" : L"landscape");
CP_XML_ATTR(L"horizontalDpi", setup->iRes);
CP_XML_ATTR(L"verticalDpi", setup->iVRes);
CP_XML_ATTR(L"orientation", setup->fPortrait ? L"portrait" : L"landscape");
CP_XML_ATTR(L"horizontalDpi", setup->iRes);
CP_XML_ATTR(L"verticalDpi", setup->iVRes);
if (setup->fUsePage)
CP_XML_ATTR(L"useFirstPageNumber", true);
if (setup->iFitWidth > 0 && setup->iFitWidth < 32767)
CP_XML_ATTR(L"fitToWidth", setup->iFitWidth);
if (setup->fUsePage)
CP_XML_ATTR(L"useFirstPageNumber", true);
if (setup->iFitWidth > 0 && setup->iFitWidth < 32767)
CP_XML_ATTR(L"fitToWidth", setup->iFitWidth);
if (setup->iFitHeight > 0 && setup->iFitHeight < 32767)
CP_XML_ATTR(L"fitToHeight", setup->iFitHeight);
}
if (setup->iFitHeight > 0 && setup->iFitHeight < 32767)
CP_XML_ATTR(L"fitToHeight", setup->iFitHeight);
}
}

View File

@ -134,14 +134,7 @@ const bool SERIESFORMAT::loadContent(BinProcessor& proc)
m_Series = elements_.back();
elements_.pop_back();
if (proc.getGlobalWorkbookInfo()->Version < 0x0600)
{
if (proc.optional<Begin>()) elements_.pop_back(); //skip
}
else
{
if (proc.mandatory<Begin>()) elements_.pop_back(); //skip
}
proc.mandatory<Begin>(); elements_.pop_back(); //skip
count = proc.repeated<AI>(4, 4);
while(count > 0 && elements_.size() > 0)
@ -181,7 +174,7 @@ const bool SERIESFORMAT::loadContent(BinProcessor& proc)
count = elements_.size();
while(count > 0)
{
if ("SerParent" == elements_.front()->getClassName())
if ("SerParent" == elements_.front()->getClassName())
m_SerParent = elements_.front();
else if ("SerToCrt" == elements_.front()->getClassName())
m_SerToCrt = elements_.front();
@ -231,14 +224,7 @@ const bool SERIESFORMAT::loadContent(BinProcessor& proc)
m_SeriesEx.push_back(ex);
}
if (proc.getGlobalWorkbookInfo()->Version < 0x0600)
{
if (proc.optional<End>()) elements_.pop_back(); //skip
}
else
{
if (proc.mandatory<End>()) elements_.pop_back(); //skip
}
if (proc.mandatory<End>()) elements_.pop_back(); //skip
return true;
}

View File

@ -113,18 +113,9 @@ const bool SS::loadContent(BinProcessor& proc)
m_DataFormat = elements_.back();
elements_.pop_back();
bool bRead = false;
if (proc.getGlobalWorkbookInfo()->Version < 0x0600)
if (proc.mandatory<Begin>())
{
bRead = true;
}
if (proc.optional<Begin>()) //при biff5 может быть или нет, biff8 - обязано быть
{
bRead = true;
elements_.pop_back();
}
if (bRead)
{
while (true)
{
CFRecordType::TypeId type = proc.getNextRecordType();

View File

@ -70,7 +70,6 @@
#include "Biff_records/Chart.h"
#include "Biff_records/ExternSheet.h"
#include "Biff_records/FrtFontList.h"
#include "Biff_records/ChartFrtInfo.h"
#include "Biff_unions/FONTLIST.h"
#include "Biff_unions/PAGESETUP.h"
@ -143,7 +142,7 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
{
CFRecordType::TypeId type = proc.getNextRecordType();
Log::warning(CFRecordType::getStringById(type));
//Log::warning(CFRecordType::getStringById(type));
if (type == rt_NONE || type == rt_BOF ) break;
if (type == rt_EOF)
@ -386,11 +385,7 @@ const bool ChartSheetSubstream::loadContent(BinProcessor& proc)
count--;
}
}break;
case rt_ChartFrtInfo:
{
//skipped record
count = proc.repeated<ChartFrtInfo>(0, 0);
}break;
default://unknown .... skip
{
proc.SkipRecord();

View File

@ -150,12 +150,6 @@ public:
unsigned int startAddedSharedStrings;
std::vector<std::wstring> arAddedSharedStrings;
struct _row_info
{
BaseObjectPtr row_info;
std::map<int, BaseObjectPtr> mapCells;
};
struct _sheet_info
{
@ -167,8 +161,6 @@ public:
double defaultColumnWidth = 8.0;
double defaultRowHeight = 14.4;
std::map<int, _row_info> mapRows;
};
std::vector<_sheet_info> sheets_info;
std::vector<std::wstring> external_sheets_info; //current

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