Compare commits

..

46 Commits

Author SHA1 Message Date
699eb731b4 x2t - bin - form controls read/write 2019-04-04 20:02:26 +03:00
0eb032a281 . 2019-04-04 15:38:02 +03:00
f89174ded5 . 2019-04-04 14:02:02 +03:00
ff1d53637a x2t - bin - writing xlsx controls 2019-04-02 18:44:10 +03:00
e825b4359f Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-04-02 17:14:46 +03:00
d11b74007d . 2019-04-02 12:16:22 +03:00
45d5f3b130 . 2019-04-01 18:48:43 +03:00
25022ceecc XlsxFormat - ctrlProps 2019-04-01 18:25:53 +03:00
1a7476e465 x2t - XlsxFormat - fix bug #40316 - queryTables, connections, dataValidations 2019-03-31 17:19:47 +03:00
0edc2729e8 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-28 12:23:48 +03:00
d898f0ef2f OdfFormatW - ... 2019-03-27 18:35:33 +03:00
d51f004b11 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-27 13:49:34 +03:00
c645ed6aeb OdfFormatW - ... 2019-03-27 13:46:53 +03:00
79aa50d712 [x2t] Add OutlineLevelCol, OutlineLevelRow to Editor.bin 2019-03-25 19:56:24 +03:00
3dcb378de7 . 2019-03-25 19:24:44 +03:00
87c4ebe1d4 x2t - ... 2019-03-25 16:18:54 +03:00
fdef699b9b [ios][x2t] fixed build 2019-03-25 15:14:24 +03:00
498d58e856 x2t - ... 2019-03-25 13:50:29 +03:00
441aa277e3 XlsFormat - fixbug #40932 2019-03-25 13:15:18 +03:00
e8c314e535 . 2019-03-21 13:54:38 +03:00
12c8cf112a . 2019-03-21 13:51:57 +03:00
c9fb5cbe4d x2t - ... 2019-03-21 13:09:52 +03:00
8573513168 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-20 18:53:57 +03:00
4e337b5ef1 XlsFormat - fix user file 2019-03-20 18:49:38 +03:00
7e0e30d00f [x2t] Fix xlsx->Editor.bin conversion with invalid cell refs
<x:c r="2:1" instead of "B1"
2019-03-20 14:00:05 +03:00
72c4727a1e XlsFormat - fix bug #40895 2019-03-20 12:54:00 +03:00
29c197f383 XlsFormat - fix bug #40879 2019-03-19 19:49:40 +03:00
c07bd58bda XlsFormat -... 2019-03-18 19:58:20 +03:00
ae9a7f7fad [zlib] Fix 7-zip Warning: Headers error
Problem in header field: "last mod file date".
tm_sec = tm_min = tm_hour = tm_mday = tm_mon = tm_year = 0; is considered as 0 Jan 1980 (0x00200000 in file)
default value of tm_mon should be -1 (zip64local_TmzDateToDosDate tm_mon+1)
2019-03-15 19:26:57 +03:00
1157d6f97f . 2019-03-15 17:27:25 +03:00
5483547ee7 . 2019-03-15 15:47:26 +03:00
b9608771a9 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-15 14:51:35 +03:00
b3d219ef58 . 2019-03-15 14:50:29 +03:00
46a6e35a35 . 2019-03-15 14:48:53 +03:00
cfea717d20 XlsxFormat - dataValidation (+x14) 2019-03-14 19:53:11 +03:00
ae45b240a3 XlsFormat - ... 2019-03-14 19:44:37 +03:00
0ec79f2c2d . 2019-03-14 13:46:42 +03:00
6f0d22c3a4 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-14 12:06:08 +03:00
8d074cadf8 OdfFormatReader - ... 2019-03-14 12:04:44 +03:00
4a3b56d0d5 OdfFormatReader - .. 2019-03-14 12:03:22 +03:00
195e9079db Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-13 19:09:19 +03:00
8e8fd1096f . 2019-03-13 19:07:50 +03:00
b60811fd0d DocxFormat - read/write ooxml chart_ex 2019-03-13 16:30:09 +03:00
9eb82fa85e DocFormatReader - fix bug #40841 2019-03-13 14:06:10 +03:00
6d6cbd51c3 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-12 15:50:06 +03:00
9e0ff699aa . 2019-03-12 15:48:57 +03:00
184 changed files with 11886 additions and 3321 deletions

4
.gitignore vendored
View File

@ -63,4 +63,6 @@ X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
*.zip
*.tar.gz
**/*.build/
*.dat
*.txt
*.log

View File

@ -769,12 +769,21 @@ 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,15 +87,14 @@ namespace DocFileFormat
}
else
{
m_nDTTM = reader->ReadUInt32();
m_nDTTM = DateAndTime(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,6 +32,7 @@
#pragma once
#include "ByteStructure.h"
#include "DateAndTime.h"
namespace DocFileFormat
{
@ -72,7 +73,7 @@ namespace DocFileFormat
return (nWordVersion > 0) ? STRUCTURE_SIZE_OLD : STRUCTURE_SIZE;
}
AnnotationReferenceExDescriptor() : m_nDTTM(0), m_nDepth(0), m_nDiatrdParent(0), m_fInkAtn(false)
AnnotationReferenceExDescriptor() : m_nDepth(0), m_nDiatrdParent(0), m_fInkAtn(false)
{
}
@ -82,7 +83,7 @@ namespace DocFileFormat
virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length );
unsigned int m_nDTTM;
DateAndTime m_nDTTM;
unsigned int m_nDepth;
unsigned int m_nDiatrdParent;
bool m_fInkAtn;

View File

@ -85,9 +85,11 @@ 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,10 +85,14 @@ namespace DocFileFormat
for (size_t index = 0; index < count; ++index)
{
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
AnnotationReferenceExDescriptor* atrdPost10 = m_document->AnnotationsReferenceExPlex ? static_cast<AnnotationReferenceExDescriptor*>(m_document->AnnotationsReferenceExPlex->Elements[index]) : NULL;
AnnotationReferenceExDescriptor* atrdPost10 = NULL;
if ((m_document->AnnotationsReferenceExPlex) && (index < m_document->AnnotationsReferenceExPlex->Elements.size()))
{
atrdPost10 = static_cast<AnnotationReferenceExDescriptor*>(m_document->AnnotationsReferenceExPlex->Elements[index]);
}
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
if (atrdPre10->m_BookmarkId < 0)
if (atrdPre10->m_BookmarkId < 0)//-1 - easy ref (not start/end comment ref)
{
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index + 1 + count + 1024 ));
}
@ -98,21 +102,14 @@ namespace DocFileFormat
}
if (atrdPost10)
{
//!!!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));
}*/
m_pXmlWriter->WriteAttribute( L"w:date", atrdPost10->m_nDTTM.getString());
}
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", atrdPre10->m_UserInitials);
m_pXmlWriter->WriteAttribute( L"w:initials", FormatUtils::XmlEncode(atrdPre10->m_UserInitials));

View File

@ -83,6 +83,14 @@ 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
@ -1079,7 +1079,15 @@ namespace DocFileFormat
else if ((m_document->AnnotationsReferencePlex) && (_commentNr <= m_document->AnnotationsReferencePlex->Elements.size()))
{
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr++ ));
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->WriteNodeEnd( L"", true );
}
}
@ -1792,7 +1800,7 @@ namespace DocFileFormat
if (m_document->AnnotStartEndCPs[i].second == cp)
{
result = writeAnnotationEnd(i + 1);
_commentNr = i + 1;
//_commentNr = i + 1;
}
}

View File

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

View File

@ -1431,8 +1431,7 @@ namespace DocFileFormat
{
//append size and position ...
//if (pSpa->fAnchorLock )
if (pSpa->bx == TEXT && pSpa->by == TEXT)
if (m_isInlineShape)
{
// appendStyleProperty( style, L"position", L"static" );
}
@ -1689,21 +1688,17 @@ namespace DocFileFormat
m_pSpa->bx = PAGE;
}
else
{
nRelH = m_pSpa->bx;
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative(m_pSpa->bx));
{//rel column
}
}
if (nRelV < 0 && m_pSpa)
{
if (m_pSpa->by == TEXT && bZIndex)
if (m_pSpa->by == TEXT && bZIndex)
{
m_pSpa->by = PAGE;
}
else
{
nRelV = m_pSpa->by;
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative(m_pSpa->by));
{//rel paragraph
}
}
if (!m_isInlineShape && !bZIndex)
@ -1814,7 +1809,7 @@ namespace DocFileFormat
//append size and position ...
//if (m_pSpa->fAnchorLock)//это возможность смены привязки , а не ее тип
if (m_pSpa->bx == TEXT && m_pSpa->by == TEXT)
if (m_isInlineShape)/*m_pSpa->bx == TEXT && m_pSpa->by == TEXT*/
{
// appendStyleProperty( style, L"position", L"static" );
}

View File

@ -173,12 +173,16 @@ namespace DocFileFormat
//Lock ???
ODRAW::ProtectionBooleanProperties *prot = dynamic_cast<ODRAW::ProtectionBooleanProperties*>(pShape->Lock.get());
if ((prot) && (prot->fUsefLockAspectRatio && prot->fLockAspectRatio))
if ((prot) && (prot->fUsefLockAspectRatio))
{
appendValueAttribute( _lock, L"aspectratio", L"t" );
appendValueAttribute( _lock, L"aspectratio", prot->fLockAspectRatio ? L"t" : L"f" );
}
else
{
appendValueAttribute( _lock, L"aspectratio", L"t");
}
if ( _lock->GetAttributeCount() > 1 )
if ( _lock->GetAttributeCount() > 0 )
{
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),
EndnoteDocumentFieldsPlex(NULL), HeadersAndFootersDocumentFieldsPlex(NULL), HeaderStoriesPlex(NULL), AnnotationsFieldsPlex(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,10 +387,13 @@ 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)
@ -872,6 +875,7 @@ namespace DocFileFormat
RELEASEOBJECT(FootnoteDocumentFieldsPlex);
RELEASEOBJECT(EndnoteDocumentFieldsPlex);
RELEASEOBJECT(HeadersAndFootersDocumentFieldsPlex);
RELEASEOBJECT(AnnotationsFieldsPlex);
RELEASEOBJECT(HeaderStoriesPlex);
RELEASEOBJECT(IndividualCommentsPlex);
RELEASEOBJECT(AnnotationsReferencePlex);

View File

@ -224,6 +224,7 @@ 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,20 +2,17 @@
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

@ -801,7 +801,7 @@ void Binary_rPrWriter::Write_rPrChange(const OOX::Logic::CRPrChange& rPrChange)
if(rPrChange.m_pRunPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_RevisionType::rPrChange);
Write_rPr(rPrChange.m_pRunPr.operator->());
Write_rPr(rPrChange.m_pRunPr.GetPointer());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
@ -944,7 +944,7 @@ void Binary_pPrWriter::Write_pPr(const OOX::Logic::CParagraphProperty& pPr)
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::pPr_rPr);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
brPrs.Write_rPr(pPr.m_oRPr.operator->());
brPrs.Write_rPr(pPr.m_oRPr.GetPointer());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
//FramePr
@ -1425,7 +1425,7 @@ void Binary_pPrWriter::WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr,
if (oFile.IsInit() && (OOX::FileTypes::Header == oFile->type() || OOX::FileTypes::Footer == oFile->type()))
{
int nIndex = 0;
OOX::CHdrFtr* pHdrFtr = (OOX::CHdrFtr*)oFile.operator->();
OOX::CHdrFtr* pHdrFtr = (OOX::CHdrFtr*)oFile.GetPointer();
if(bHdr)
{
nIndex = (int)m_oBinaryHeaderFooterTableWriter->m_aHeaders.size();
@ -2264,7 +2264,7 @@ void Binary_tblPrWriter::WriteTcPrChange(const OOX::Logic::CTcPrChange& tcPrChan
if(tcPrChange.m_pTcPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_RevisionType::tcPrChange);
WriteCellPr(tcPrChange.m_pTcPr.operator->());
WriteCellPr(tcPrChange.m_pTcPr.GetPointer());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
@ -2452,7 +2452,7 @@ void BinaryStyleTableWriter::WriteStyle(const OOX::CStyle& style)
if(false != style.m_oRunPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_TextPr);
brPrs.Write_rPr(style.m_oRunPr.operator->());
brPrs.Write_rPr(style.m_oRunPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos);
}
//ParaPr
@ -2480,7 +2480,7 @@ void BinaryStyleTableWriter::WriteStyle(const OOX::CStyle& style)
if(false != style.m_oTcPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_sts::Style_CellPr);
btblPrs.WriteCellPr(style.m_oTcPr.operator->());
btblPrs.WriteCellPr(style.m_oTcPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos);
}
//TblStylePr
@ -2557,7 +2557,7 @@ void BinaryStyleTableWriter::WriteTblStyleProperties(const OOX::Logic::CTableSty
if(false != oProperty.m_oRunPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblStylePrType::RunPr);
brPrs.Write_rPr(oProperty.m_oRunPr.operator->());
brPrs.Write_rPr(oProperty.m_oRunPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos);
}
//ParaPr
@ -2585,7 +2585,7 @@ void BinaryStyleTableWriter::WriteTblStyleProperties(const OOX::Logic::CTableSty
if(false != oProperty.m_oTcPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblStylePrType::TcPr);
btblPrs.WriteCellPr(oProperty.m_oTcPr.operator->());
btblPrs.WriteCellPr(oProperty.m_oTcPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos);
}
}
@ -4234,7 +4234,7 @@ void BinaryDocumentTableWriter::WriteMathRunContent(OOX::Logic::CMRun* pMRun)
if ( pMRun->m_oRPr.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_OMathContentType::RPr);
brPrs.Write_rPr(pMRun->m_oRPr.operator->());
brPrs.Write_rPr(pMRun->m_oRPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pMRun->m_oARPr.IsInit() )
@ -4483,7 +4483,7 @@ void BinaryDocumentTableWriter::WriteMathCtrlPr(const OOX::Logic::CCtrlPr &pCtrl
if ( pCtrlPr.m_oRPr.IsInit() )
{
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerRunType::rPr);
brPrs.Write_rPr(pCtrlPr.m_oRPr.operator->());
brPrs.Write_rPr(pCtrlPr.m_oRPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos2);
}
if ( pCtrlPr.m_oARPr.IsInit() )
@ -6913,7 +6913,7 @@ void BinaryDocumentTableWriter::WriteSdt(OOX::Logic::CSdt* pStd, int type, OOX::
if(pStd->m_oSdtEndPr.IsInit() && pStd->m_oSdtEndPr->m_oRPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::EndPr);
brPrs.Write_rPr(pStd->m_oSdtEndPr->m_oRPr.operator->());
brPrs.Write_rPr(pStd->m_oSdtEndPr->m_oRPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos);
}
if(pStd->m_oSdtContent.IsInit())
@ -7037,7 +7037,7 @@ void BinaryDocumentTableWriter::WriteSdtPr(const OOX::Logic::CSdtPr& oStdPr)
if(oStdPr.m_oRPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::RPr);
brPrs.Write_rPr(oStdPr.m_oRPr.operator->());
brPrs.Write_rPr(oStdPr.m_oRPr.GetPointer());
m_oBcw.WriteItemEnd(nCurPos);
}
if(oStdPr.m_oShowingPlcHdr.IsInit())

View File

@ -277,13 +277,20 @@ namespace BinXlsxRW{
pTable->m_oTable->m_oTableStyleInfo->m_oShowColumnStripes.Init();
pTable->m_oTable->m_oTableStyleInfo->m_oShowColumnStripes->FromBool(false);
pTable->m_oTable->m_oTableColumns.Init();
for(size_t i = 0; i < m_aTableNames.size(); ++i)
{
OOX::Spreadsheet::CTableColumn* pTableColumn = new OOX::Spreadsheet::CTableColumn();
pTableColumn->m_oId.Init();
pTableColumn->m_oId->SetValue((unsigned int)i + 1);
pTableColumn->m_oName.Init();
pTableColumn->m_oName->append(m_aTableNames[i]);
if (!pTableColumn->m_oId.IsInit())
{
pTableColumn->m_oId.Init();
pTableColumn->m_oId->SetValue((unsigned int)i + 1);
}
if (!pTableColumn->m_oName.IsInit())
{
pTableColumn->m_oName = m_aTableNames[i];
}
pTable->m_oTable->m_oTableColumns->m_arrItems.push_back(pTableColumn);
}
pTable->m_oTable->m_oTableColumns->m_oCount.Init();

View File

@ -210,25 +210,41 @@ 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, expr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
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;
}
if (splitted.size() == 3)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[2];
return true;
res = true;
}
if (splitted.size() == 4)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[3];
return true;
res = true;
}
return false;
replace_tmp_back( table );
return res;
}
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"([:$!])+");
boost::wregex re(L"(([:$!])+)|(\\S+\\d+)");
boost::wsmatch result;
bool b = boost::regex_search(expr, result, re);

View File

@ -1077,7 +1077,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=\"" << displayName << L"\"/>";
_Wostream << L"<w:name w:val=\"" << XmlUtils::EncodeXmlString(displayName) << L"\"/>";
if (odf_reader::style_instance * baseOn = arStyles[i]->parent())
{

View File

@ -150,12 +150,18 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
odf_reader::GetProperty(content_.properties_,L"maximum", doubleVal);
if (doubleVal)
{
CP_XML_ATTR(L"c:max", *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_ATTR(L"c:min", *doubleVal);
CP_XML_NODE(L"c:min")
{
CP_XML_ATTR(L"val", *doubleVal);
}
}
odf_reader::GetProperty(content_.properties_,L"logarithmic", boolVal);
if ((boolVal == true) && (boolVal.get()==true))

View File

@ -59,12 +59,19 @@ oox_chart_series::oox_chart_series()
bLocalTable_ = false;
labelPosEnabled_ = true;
}
void oox_chart_series::setName(std::wstring &value)
void oox_chart_series::setName(const 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;
void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & formatCode, bool link_to_source)
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)
{
formulasconvert::odf2oox_converter converter;
@ -137,6 +144,7 @@ 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;
@ -215,6 +223,44 @@ 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,17 +56,20 @@ public:
virtual void oox_serialize(std::wostream & _Wostream) = 0;
bool labelPosEnabled_;
_oox_chart_values values_[5]; //cat(labels), common, x, y, bubble,
_oox_chart_values values_[5]; //cat, common, x, y, bubble,
_oox_strRef label_; //tx (Series Text) §21.2.2.215
int id_;
std::wstring name_; //tx (Series Text) §21.2.2.215
std::wstring name_;
int iSymbolMarkerType_;
bool bLocalTable_;
_CP_OPT(oox_data_labels) data_labels_;
void setName(std::wstring &value);
void setName(const std::wstring &value);
void setFormula (int ind, std::wstring & value, std::wstring & formatCode, bool link_to_source);
void setFormula (int ind, const std::wstring & value, const 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;
bool present = false;
std::wstring formula;
int str_cache_count;
int str_cache_count = 0;
std::vector<std::wstring> str_cache;
};
struct _oox_numRef
{
bool present;
bool present = false;
std::wstring formula;
std::wstring formatCode;
bool link_to_source;
int num_cache_count;
bool link_to_source = false;
int num_cache_count = 0;
std::vector<std::wstring> num_cache;
};

View File

@ -46,13 +46,13 @@ void oox_chart::set_cache_only (bool val)
}
void oox_chart::set_formula_series(int ind, std::wstring val, std::wstring formatCode, bool link_to_source)
void oox_chart::set_formula_series(int ind, const std::wstring& val, const 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(std::wstring val)
void oox_chart::set_name(const std::wstring& val)
{
oox_series_ptr & current_ptr = series_.back();
current_ptr->setName(val);
@ -68,6 +68,13 @@ 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,9 +78,10 @@ public:
virtual void add_series(int id){}
void set_cache_only (bool val);
void set_formula_series (int ind, std::wstring val, std::wstring formatCode, bool link_to_source);
void set_formula_series (int ind, const std::wstring& val, const std::wstring& formatCode, bool link_to_source);
void set_values_series (int ind, std::vector<std::wstring> & val);
void set_name (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_content_series (odf_reader::chart::series & content);
//void set_showBubbleSize(bool Val){data_labels_.set_showBubbleSize(Val);}

View File

@ -421,11 +421,13 @@ 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 (categories_.size() >0)
if (false == categories_.empty())
calc_cache_series (categories_[0], cat_cash);
std::wstring formatCode = L"General";
@ -439,6 +441,11 @@ 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)
@ -455,14 +462,14 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
}
else
{ //x
if (false == domain_cash.empty() || cash_values.empty())
if (false == domain_cash.empty() || false == cash_values.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() || cash_values.empty())
if (false == cell_cash.empty() || false == cash_values.empty())
{
if (!bPivotChart_)
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));

View File

@ -265,7 +265,13 @@ void common_break_attlist::serialize(CP_ATTR_NODE)
void common_page_number_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"style:page-number", style_page_number_);
_CP_OPT(std::wstring) str;
CP_APPLY_ATTR(L"style:page-number", str);
if ((str) && (*str != L"auto"))
{
style_page_number_ = XmlUtils::GetInteger(*str);
}
}
void common_page_number_attlist::apply_from(const common_page_number_attlist & Other)
{

View File

@ -462,7 +462,9 @@ void odf_drawing_context::end_group()
impl_->current_group_ = impl_->group_list_.back()->prev_group;
impl_->group_list_.pop_back();
impl_->current_level_.pop_back();
if (!impl_->current_level_.empty())
impl_->current_level_.pop_back();
}
@ -2052,8 +2054,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_)
{
@ -2067,8 +2069,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;
}
}
@ -2373,6 +2375,7 @@ 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] = number_format_array_.size() - 1;
named_link_map_[oox_num_fmt] = (int)number_format_array_.size() - 1;
detect_format(number_format_array_.back());
}
@ -271,8 +271,14 @@ 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.style_name = std::wstring(L"NF1000") + boost::lexical_cast<std::wstring>( number_format_array_.size()+1);
state.language_code=0;
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);
switch (oox_num_fmt)
{
@ -342,7 +348,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] = number_format_array_.size() - 1;
named_link_map_[oox_num_fmt] = (int)number_format_array_.size() - 1;
detect_format(number_format_array_.back());
@ -355,7 +361,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();
}
}
@ -434,7 +440,7 @@ void odf_number_styles_context::create_numbers(number_format_state & state, offi
if (std::wstring::npos != splits[i].find(L"\""))
{
bText = true;
indText = i;
indText = (int)i;
break;
}
}
@ -442,7 +448,7 @@ void odf_number_styles_context::create_numbers(number_format_state & state, offi
{
if (i != indText)
{
indNumber = i;
indNumber = (int)i;
break;
}
}
@ -533,12 +539,13 @@ void odf_number_styles_context::create_percentage_style(number_format_state & st
create_numbers(state, elm, empty);
root_elm->add_child_element(elm);
create_element(L"number", L"text", elm, odf_context_);
number_text* number_text_ = dynamic_cast<number_text*>(elm.get());
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());
if (number_text_)number_text_->add_text(L"%");
root_elm->add_child_element(elm);
styles_elments.push_back(elm);
root_elm->add_child_element(elm_text);
styles_elments.push_back(elm_text);
}
void odf_number_styles_context::create_currency_style(number_format_state & state, office_element_ptr & root_elm)
@ -568,7 +575,7 @@ void odf_number_styles_context::create_currency_style(number_format_state & stat
}
}
if (number_country.length()>0)
if (false == number_country.empty())
{
number_currency_symbol_->number_country_ = number_country;
}

View File

@ -92,22 +92,27 @@ 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,15 +601,23 @@ void odf_table_context::set_cell_row_span(int spanned)
else
{
int col = impl_->current_table().current_column - 1;
odf_column_state & state = impl_->current_table().columns[col];
if (col < (int)impl_->current_table().columns.size())
{
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,19 +110,18 @@ 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;
//todooo ПЕРЕПИСАТЬ !!!
//boost::posix_time::time_duration day(24, 0, 0);
//
//double millisec = day.total_milliseconds() * dTime;
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 += v * mul;
res += (int)(v * mul);
mul *= r;
}
return res;

View File

@ -82,7 +82,7 @@ void OoxConverter::convert(PPTX::Logic::SpTreeElem *oox_element)
smart_ptr<PPTX::WrapperWritingElement> elem = oox_element->GetElem();
convert (elem.operator->());
convert (elem.GetPointer());
}
void OoxConverter::convert_font(PPTX::Theme *theme, std::wstring & font)
@ -128,7 +128,7 @@ void OoxConverter::convert(PPTX::Logic::GraphicFrame *oox_graphic_frame)
}
else if ( oox_graphic_frame->element.is_init())
{
OoxConverter::convert(oox_graphic_frame->element.GetElem().operator->());
OoxConverter::convert(oox_graphic_frame->element.GetElem().GetPointer());
}
}
void OoxConverter::convert(PPTX::Logic::NvGraphicFramePr *oox_framePr)
@ -299,7 +299,7 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture)
PPTX::Slide *pSlide = dynamic_cast<PPTX::Slide*>(current_document());
PPTX::SlideMaster *pSlideMaster = dynamic_cast<PPTX::SlideMaster*>(current_document());
OOX::CVmlDrawing *pVml = pSlide ? pSlide->Vml.operator->() : (pSlideMaster ? pSlideMaster->Vml.operator->() : NULL);
OOX::CVmlDrawing *pVml = pSlide ? pSlide->Vml.GetPointer() : (pSlideMaster ? pSlideMaster->Vml.GetPointer() : NULL);
if (pVml)
{
@ -333,7 +333,7 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture)
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
{
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.GetPointer());
pathImage = pImageFileCache->filename().GetPath();
}
@ -381,7 +381,7 @@ void OoxConverter::convert(PPTX::Logic::Pic *oox_picture)
{
for (size_t i = 0 ; i < oox_picture->blipFill.blip->Effects.size(); i++)
{
convert(oox_picture->blipFill.blip->Effects[i].Effect.operator->());
convert(oox_picture->blipFill.blip->Effects[i].Effect.GetPointer());
}
}
OoxConverter::convert(&oox_picture->nvPicPr.cNvPr);
@ -405,7 +405,7 @@ void OoxConverter::convert(PPTX::Logic::SmartArt *oox_smart_art)
odf_context()->drawing_context()->get_size (width, height);
odf_context()->drawing_context()->get_position (x, y);
oox_current_child_document = oox_smart_art->m_pFileContainer.operator->();
oox_current_child_document = oox_smart_art->m_pFileContainer.GetPointer();
odf_context()->drawing_context()->start_group();
@ -436,18 +436,20 @@ void OoxConverter::convert(PPTX::Logic::ChartRec *oox_chart)
smart_ptr<OOX::File> oFile = find_file_by_id (oox_chart->id_data->get());
if (oFile.IsInit())
{
OOX::Spreadsheet::CChartSpace* pChart = dynamic_cast<OOX::Spreadsheet::CChartSpace*>(oFile.operator->());
OOX::Spreadsheet::CChartSpace* pChart = dynamic_cast<OOX::Spreadsheet::CChartSpace*>(oFile.GetPointer());
OOX::Spreadsheet::CChartSpaceEx* pChartEx = dynamic_cast<OOX::Spreadsheet::CChartSpaceEx*>(oFile.GetPointer());
if (pChart)
if (pChart || pChartEx)
{
oox_current_child_document = dynamic_cast<OOX::IFileContainer*>(pChart);
oox_current_child_document = pChart ? dynamic_cast<OOX::IFileContainer*>(pChart) : dynamic_cast<OOX::IFileContainer*>(pChartEx);
OOX::CChartDrawing* pChartDrawing = NULL;
if ((pChart->m_oChartSpace.m_userShapes) && (pChart->m_oChartSpace.m_userShapes->m_id))
if ( (pChart) && ((pChart->m_oChartSpace.m_userShapes) && (pChart->m_oChartSpace.m_userShapes->m_id)) )
{
oFile = find_file_by_id (*pChart->m_oChartSpace.m_userShapes->m_id);
pChartDrawing = dynamic_cast<OOX::CChartDrawing*>(oFile.operator->());
pChartDrawing = dynamic_cast<OOX::CChartDrawing*>(oFile.GetPointer());
}
if ((pChartDrawing) && (false == pChartDrawing->m_arrItems.empty()))
{
odf_context()->drawing_context()->start_group();
@ -465,9 +467,16 @@ void OoxConverter::convert(PPTX::Logic::ChartRec *oox_chart)
odf_context()->start_chart();
odf_context()->chart_context()->set_chart_size(width, height);
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
OoxConverter::convert(&pChart->m_oChartSpace);
if (pChart)
{
OoxConverter::convert(pChart->m_oChartSpace.m_oSpPr.GetPointer());
OoxConverter::convert(&pChart->m_oChartSpace);
}
else if (pChartEx)
{
OoxConverter::convert(pChartEx->m_oChartSpace.m_oSpPr.GetPointer());
OoxConverter::convert(&pChartEx->m_oChartSpace);
}
odf_context()->end_chart();
}
odf_context()->drawing_context()->end_object();
@ -623,7 +632,7 @@ void OoxConverter::convert(PPTX::Logic::SpTree *oox_shape_tree)
for (size_t i = 0; i < oox_shape_tree->SpTreeElems.size(); i++)
{
odf_context()->drawing_context()->start_drawing();
convert(oox_shape_tree->SpTreeElems[i].GetElem().operator->());
convert(oox_shape_tree->SpTreeElems[i].GetElem().GetPointer());
odf_context()->drawing_context()->end_drawing();
}
@ -748,7 +757,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_text_box();
odf_context()->drawing_context()->end_shape();
odf_context()->drawing_context()->end_drawing();
odf_context()->drawing_context()->end_group();
@ -902,7 +911,7 @@ void OoxConverter::convert(PPTX::Logic::CustGeom *oox_cust_geom)
}
for (size_t i = 0; i < oox_cust_geom->ahLst.size(); i++)
{
convert(oox_cust_geom->ahLst[i].ah.operator->());
convert(oox_cust_geom->ahLst[i].ah.GetPointer());
}
if (oox_cust_geom->rect.IsInit())
{
@ -933,7 +942,7 @@ void OoxConverter::convert(PPTX::Logic::EffectDag *oox_effect_dag, DWORD ARGB)
//type - sib, value
for (size_t i = 0; i < oox_effect_dag->Effects.size(); ++i)
{
convert(oox_effect_dag->Effects[i].Effect.operator->()/*, ARGB*/);
convert(oox_effect_dag->Effects[i].Effect.GetPointer()/*, ARGB*/);
}
}
void OoxConverter::convert(PPTX::Logic::EffectLst *oox_effect_list, DWORD ARGB)
@ -1152,7 +1161,7 @@ void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
}
for (size_t i = 0 ; i < oox_bitmap_fill->blip->Effects.size(); i++)
{
convert(oox_bitmap_fill->blip->Effects[i].Effect.operator->());
convert(oox_bitmap_fill->blip->Effects[i].Effect.GetPointer());
}
}
if (oox_bitmap_fill->srcRect.IsInit() && Width > 0 && Height > 0)//часть изображения
@ -1689,7 +1698,9 @@ void OoxConverter::convert_list_level(PPTX::Logic::TextParagraphPr *oox_para_pro
if (size_pt < 0.001 && odf_list_type == 1000)
{
odf_writer::style_text_properties * text_props = odf_context()->styles_context()->last_state(odf_types::style_family::Paragraph)->get_text_properties();
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;
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);
@ -1977,11 +1988,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())
{
@ -2014,7 +2025,8 @@ void OoxConverter::convert(PPTX::Logic::RunProperties *oox_run_pr, odf_writer::s
if (oox_run_pr->ln.is_init())
{
drawing->start_line_properties(true);
if (drawing)
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

@ -539,7 +539,7 @@ std::wstring OoxConverter::find_link_by (smart_ptr<OOX::File> & oFile, int type)
std::wstring ref;
if (type == 1 && OOX::FileTypes::Image == oFile->type())
{
OOX::Image* pImage = dynamic_cast<OOX::Image*>(oFile.operator->());
OOX::Image* pImage = dynamic_cast<OOX::Image*>(oFile.GetPointer());
if (pImage)
{
@ -548,7 +548,7 @@ std::wstring OoxConverter::find_link_by (smart_ptr<OOX::File> & oFile, int type)
}
if (type == 2 && OOX::FileTypes::HyperLink == oFile->type())
{
OOX::HyperLink* pHyperlink = dynamic_cast<OOX::HyperLink*>(oFile.operator->());
OOX::HyperLink* pHyperlink = dynamic_cast<OOX::HyperLink*>(oFile.GetPointer());
if (pHyperlink && pHyperlink->bHyperlink)
{
@ -557,7 +557,7 @@ std::wstring OoxConverter::find_link_by (smart_ptr<OOX::File> & oFile, int type)
}
if (type == 3)
{
OOX::Media* pMedia = dynamic_cast<OOX::Media*>(oFile.operator->());
OOX::Media* pMedia = dynamic_cast<OOX::Media*>(oFile.GetPointer());
if (pMedia)
{
@ -566,7 +566,7 @@ std::wstring OoxConverter::find_link_by (smart_ptr<OOX::File> & oFile, int type)
}
if (type == 4)
{
OOX::OleObject* pOleObject = dynamic_cast<OOX::OleObject*>(oFile.operator->());
OOX::OleObject* pOleObject = dynamic_cast<OOX::OleObject*>(oFile.GetPointer());
if (pOleObject)
{

View File

@ -230,6 +230,26 @@ namespace OOX
class CT_Style;
class CT_TextLanguageID;
class CTextProperties;
namespace ChartEx
{
class CChartSpace;
class CChart;
class CChartData;
class CData;
class CDimension;
class CPlotArea;
class CLegend;
class CAxis;
class CTickMarks;
class CGridlines;
class CValScaling;
class CCatScaling;
class CSeries;
class CDataLabels;
class CTitle;
}
}
class CSizeAnchor;
namespace Vml
@ -522,7 +542,12 @@ public:
void convert(OOX::Spreadsheet::CT_StrData *str_data, bool categories, bool label);
void convert(OOX::CSizeAnchor *sz_anchor, double x0, double y0, double width, double height);
//.chart.ex...........................................................................................................................
void convert(OOX::Spreadsheet::ChartEx::CChartSpace *oox_chart);
void convert(OOX::Spreadsheet::ChartEx::CTitle *ct_title);
void convert(OOX::Spreadsheet::ChartEx::CChart *oox_chart);
void convert(OOX::Spreadsheet::ChartEx::CChartData *oox_chart_data);
void convert(OOX::Spreadsheet::ChartEx::CPlotArea *oox_plot_area);
//.vml............................................................................................................................
void convert(OOX::Vml::CShapeType *vml_shape_type);
void convert(OOX::Vml::CShape *vml_shape);

View File

@ -282,7 +282,6 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_PlotArea* ct_plotArea)
odf_context()->chart_context()->end_element();
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
void OoxConverter::convert(OOX::Spreadsheet::CT_CatAx* axis)
{
if (axis == NULL)return;
@ -448,7 +447,6 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ValAx* axis)
convert(axis->m_minorGridlines, 2);
odf_context()->chart_context()->end_element();
}
////////////////////////////////////////////////////////////////////////////////////////////
void OoxConverter::convert(OOX::Spreadsheet::CT_ChartLines *line, int type)
{
if (line == NULL)return;
@ -1212,7 +1210,6 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_NumDataSource* val)
}
}
///////////////////////////////////////////////////////////////////////////////////////////////
void OoxConverter::convert(OOX::Spreadsheet::CT_Surface* ct_surface, int type, bool chart3D)
{
if (ct_surface == NULL && chart3D == false)return;
@ -1293,4 +1290,59 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_StrData *str_data, bool categori
odf_context()->chart_context()->set_cash(format, data, categories, label);
}
//---------------------------------------------------------------------------------------------------------------
////chart ex ///////////////////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------------------------------------------
void OoxConverter::convert(OOX::Spreadsheet::ChartEx::CPlotArea* oox_plotArea)
{
if (oox_plotArea == NULL)return;
//convert(oox_plotArea->m_layout);
///////////////////////
for (size_t i = 0; i < oox_plotArea->m_plotAreaRegion.m_arSeries.size(); i++)
{
convert(oox_plotArea->m_plotAreaRegion.m_arSeries[i]);
}
for (size_t i = 0; i < oox_plotArea->m_arAxis.size(); i++)
{
convert(oox_plotArea->m_arAxis[i]);
}
odf_context()->chart_context()->start_wall();
{
convert(oox_plotArea->m_oSpPr.GetPointer());
}
odf_context()->chart_context()->end_element();
}
void OoxConverter::convert(OOX::Spreadsheet::ChartEx::CChartData *oox_chart_data)
{
if (!oox_chart_data) return;
for (size_t i = 0; i < oox_chart_data->m_arData.size(); i++)
{
}
}
void OoxConverter::convert(OOX::Spreadsheet::ChartEx::CChartSpace *oox_chart)
{
if (!oox_chart)return;
convert(oox_chart->m_oSpPr.GetPointer());
convert_chart_text(oox_chart->m_oTxPr.GetPointer());
//convert(oox_chart->m_chart.m_title);
//convert(oox_chart->m_chart.m_legend);
convert(&oox_chart->m_chartData);
odf_context()->chart_context()->start_plot_area();
{
convert(&oox_chart->m_chart.m_plotArea);
}
odf_context()->chart_context()->end_plot_area();
}
}

View File

@ -101,7 +101,7 @@ PptxConverter::PptxConverter(const std::wstring & path, bool bTemplate)
delete pptx_document;
return;
}
presentation = presentation_ptr.operator->();
presentation = presentation_ptr.GetPointer();
output_document = new odf_writer::package::odf_document(L"presentation", bTemplate);
odp_context = new odf_writer::odp_conversion_context(output_document);
@ -284,7 +284,7 @@ void PptxConverter::convert_slides()
continue;// странное ... слайд 38 в FY10_September_Partner_Call.pptx
}
current_theme = slide->theme.operator->();
current_theme = slide->theme.GetPointer();
current_clrMap = NULL;
std::wstring master_style_name;
@ -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->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) && (current_theme->name.IsInit())) master_style_name = current_theme->name.get();
master_style_name += L"_" ;
@ -323,7 +323,7 @@ void PptxConverter::convert_slides()
odp_context->start_master_slide(master_style_name);
convert_common();
current_slide = slide->Master.operator->();
current_slide = slide->Master.GetPointer();
if (bShowLayoutMasterSp && bShowMasterSp)
convert_slide(&slide->Master->cSld, current_txStyles, false, true, Master);
@ -332,7 +332,7 @@ void PptxConverter::convert_slides()
if (slide->Layout->clrMapOvr.IsInit() && slide->Layout->clrMapOvr->overrideClrMapping.IsInit())
current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer();
current_slide = slide->Layout.operator->();
current_slide = slide->Layout.GetPointer();
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, Layout);
@ -346,7 +346,7 @@ void PptxConverter::convert_slides()
{
rId = presentation->notesMasterIdLst[0].rid.get();
smart_ptr<PPTX::NotesMaster> notes_master = ((*presentation)[rId]).smart_dynamic_cast<PPTX::NotesMaster>();
convert(notes_master.operator->());
convert(notes_master.GetPointer());
}
odp_context->end_master_slide();
@ -378,8 +378,8 @@ void PptxConverter::convert_slides()
if (slide->clrMapOvr.IsInit() && slide->clrMapOvr->overrideClrMapping.IsInit())
current_clrMap = slide->clrMapOvr->overrideClrMapping.GetPointer();
current_tableStyles = slide->tableStyles_.operator->();
current_slide = slide.operator->();
current_tableStyles = slide->tableStyles_.GetPointer();
current_slide = slide.GetPointer();
odp_context->start_slide();
@ -387,8 +387,8 @@ void PptxConverter::convert_slides()
odp_context->current_slide().set_layout_page (layout_style_name);
convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp, Slide);
convert (slide->comments.operator->());
convert (slide->Note.operator->());
convert (slide->comments.GetPointer());
convert (slide->Note.GetPointer());
convert (slide->transition.GetPointer());
//convert (slide->timing.GetPointer());
@ -406,7 +406,7 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
PPTX::Theme* old_theme = current_theme;
PPTX::Logic::ClrMap* old_clrMap = current_clrMap;
current_theme = oox_notes->theme_.operator->();
current_theme = oox_notes->theme_.GetPointer();
current_clrMap = &oox_notes->clrMap;
current_slide = dynamic_cast<OOX::IFileContainer*>(oox_notes);
@ -437,7 +437,7 @@ void PptxConverter::convert(PPTX::NotesSlide *oox_notes)
if (oox_notes->master_.IsInit())
{
current_theme = oox_notes->master_->theme_.operator->();
current_theme = oox_notes->master_->theme_.GetPointer();
current_clrMap = &oox_notes->master_->clrMap;
}
@ -542,7 +542,7 @@ void PptxConverter::convert( PPTX::Logic::Transition *oox_transition )
odp_context->current_slide().set_transition_duration(*oox_transition->dur);
}
convert(oox_transition->base.base.operator->());
convert(oox_transition->base.base.GetPointer());
if (oox_transition->sndAc.is_init() && oox_transition->sndAc->stSnd.is_init())
{
@ -1443,7 +1443,7 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
if (!bConvert)
{
OoxConverter::convert(pElem.operator->());
OoxConverter::convert(pElem.GetPointer());
}
odf_context()->drawing_context()->end_drawing();

View File

@ -89,7 +89,7 @@ odf_writer::odf_conversion_context* XlsxConverter::odf_context()
PPTX::Theme* XlsxConverter::oox_theme()
{
if (xlsx_document)
return xlsx_document->m_pTheme.operator->();
return xlsx_document->m_pTheme.GetPointer();
else
return NULL;
}
@ -179,7 +179,7 @@ void XlsxConverter::convert_sheets()
else
{
smart_ptr<OOX::Spreadsheet::CExternalLink> externalLink = file.smart_dynamic_cast<OOX::Spreadsheet::CExternalLink>();
convert(externalLink.operator->());
convert(externalLink.GetPointer());
}
}
}
@ -293,7 +293,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
smart_ptr<OOX::File> oFile = oox_sheet->Find(oox_table_part->m_oRId->GetValue());
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Table == oFile->type())
{
OOX::Spreadsheet::CTableFile* pTableFile = (OOX::Spreadsheet::CTableFile*)oFile.operator->();
OOX::Spreadsheet::CTableFile* pTableFile = (OOX::Spreadsheet::CTableFile*)oFile.GetPointer();
if ((pTableFile) && (pTableFile->m_oTable.IsInit()))
{
@ -340,7 +340,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
smart_ptr<OOX::File> oFile = oox_sheet->Find(oox_sheet->m_oDrawing->m_oId->GetValue());
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Drawings == oFile->type())
{
OOX::Spreadsheet::CDrawing* pDrawing = (OOX::Spreadsheet::CDrawing*)oFile.operator->();
OOX::Spreadsheet::CDrawing* pDrawing = (OOX::Spreadsheet::CDrawing*)oFile.GetPointer();
convert(pDrawing, oox_sheet);
}
@ -493,7 +493,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CTableColumns *oox_table_part_colu
{
std::wstring name;
if (oox_table_part_columns->m_arrItems[i]->m_oName.IsInit())
name = oox_table_part_columns->m_arrItems[i]->m_oName.get2();
name = *oox_table_part_columns->m_arrItems[i]->m_oName;
ods_context->add_table_part_column(name);
}
@ -2152,10 +2152,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing, OOX::Spread
OOX::Spreadsheet::CCellAnchor * oox_anchor = oox_drawing->m_arrItems[i];
if (oox_anchor->m_bShapeOle) continue;
if (oox_anchor->m_bShapeControl) continue;
if (oox_sheet->m_oOleObjects.IsInit() && oox_anchor->m_nId.IsInit())
{
boost::unordered_map<int, OOX::Spreadsheet::COleObject*>::const_iterator pFind = oox_sheet->m_oOleObjects->m_mapOleObjects.find(oox_anchor->m_nId.get());
boost::unordered_map<unsigned int, OOX::Spreadsheet::COleObject*>::const_iterator pFind = oox_sheet->m_oOleObjects->m_mapOleObjects.find(oox_anchor->m_nId.get());
if (pFind != oox_sheet->m_oOleObjects->m_mapOleObjects.end())
{
//??? перенести даные привязки
@ -2163,7 +2164,16 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing, OOX::Spread
continue;
}
}
if (oox_sheet->m_oControls.IsInit() && oox_anchor->m_nId.IsInit())
{
std::map<unsigned int, OOX::Spreadsheet::CControl*>::const_iterator pFind = oox_sheet->m_oControls->m_mapControls.find(oox_anchor->m_nId.get());
if (pFind != oox_sheet->m_oControls->m_mapControls.end())
{
//??? перенести даные привязки
oox_anchor->m_bShapeControl = true;
continue;
}
}
ods_context->start_drawings();
convert(oox_anchor);
ods_context->end_drawings();
@ -2175,7 +2185,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::COleObjects *oox_objects, OOX::Spr
{
if (!oox_objects) return;
for (boost::unordered_map<int, OOX::Spreadsheet::COleObject*>::const_iterator it = oox_objects->m_mapOleObjects.begin(); it != oox_objects->m_mapOleObjects.end(); ++it)
for (boost::unordered_map<unsigned int, OOX::Spreadsheet::COleObject*>::const_iterator it = oox_objects->m_mapOleObjects.begin(); it != oox_objects->m_mapOleObjects.end(); ++it)
{
OOX::Spreadsheet::COleObject* object = it->second;
ods_context->start_drawings();
@ -2223,7 +2233,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::COleObjects *oox_objects, OOX::Spr
smart_ptr<OOX::File> oFileV = oox_sheet->Find(oox_sheet->m_oLegacyDrawing->m_oId->GetValue());
if (oFileV.IsInit() && OOX::FileTypes::VmlDrawing == oFileV->type())
{
pVmlDrawing = (OOX::CVmlDrawing*)oFileV.operator->();
pVmlDrawing = (OOX::CVmlDrawing*)oFileV.GetPointer();
}
OOX::WritingElement* pShapeElem = NULL;
std::wstring sShapeId = L"_x0000_s" + std::to_wstring(object->m_oShapeId->GetValue());
@ -2277,7 +2287,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::COleObjects *oox_objects, OOX::Spr
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
{
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.GetPointer());
if (pImageFileCache && odf_ref_image.empty())
{

View File

@ -59,7 +59,17 @@ _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;
pStgFrom->open(false, false);
try
{
if (false == pStgFrom->open(false, false))
{
return AVS_ERROR_FILEACCESS; //file access error or not compound file
}
}
catch(...)
{
return AVS_ERROR_FILEACCESS;
}
m_pReader = new CPPTFileReader(pStgFrom, m_strTempDirectory);
CPPTFileReader* pptReader = (CPPTFileReader*)m_pReader;

View File

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

View File

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

View File

@ -349,6 +349,14 @@
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

@ -1690,7 +1690,7 @@ void CDrawingConverter::doc_LoadDiagram(PPTX::Logic::SpTreeElem *result, XmlUtil
if (oFileData.is_init())
{
pDiagramData = dynamic_cast<OOX::CDiagramData*>(oFileData.operator->());
pDiagramData = dynamic_cast<OOX::CDiagramData*>(oFileData.GetPointer());
if (pDiagramData)
{
for (size_t i = 0; (pDiagramData->m_oExtLst.IsInit()) && i < pDiagramData->m_oExtLst->m_arrExt.size(); i++)
@ -1706,7 +1706,7 @@ void CDrawingConverter::doc_LoadDiagram(PPTX::Logic::SpTreeElem *result, XmlUtil
if (id_drawing.is_init())
{
oFileDrawing = (*m_pBinaryWriter->m_pCurrentContainer)->Find(*id_drawing);
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.operator->());
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.GetPointer());
}
if (!pDiagramDrawing && pDiagramData)
{
@ -1721,7 +1721,7 @@ void CDrawingConverter::doc_LoadDiagram(PPTX::Logic::SpTreeElem *result, XmlUtil
{
oFileDrawing = smart_ptr<OOX::File>(dynamic_cast<OOX::File*>(new OOX::CDiagramDrawing(NULL, pathDiagramDrawing)));
if (oFileDrawing.IsInit())
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.operator->());
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.GetPointer());
}
}
}

View File

@ -1652,8 +1652,7 @@ namespace NSBinPptxRW
bool CBinaryFileReader::GetBool()
{
int res = GetUChar();
return (res == 1) ? true : false;
return (GetUChar() != 0) ? true : false;
}
// 2 byte

View File

@ -180,7 +180,7 @@ namespace PPTX
if (pRelation->Type() == OOX::Presentation::FileTypes::Slide)
{
OOX::HyperLink *link = dynamic_cast<OOX::HyperLink*>(file.operator->());
OOX::HyperLink *link = dynamic_cast<OOX::HyperLink*>(file.GetPointer());
if (link)
link->bHyperlink = false;
}

View File

@ -119,6 +119,12 @@ namespace PPTX
else if (relation.Type() == OOX::FileTypes::Chart)
return smart_ptr<OOX::File>(new OOX::Spreadsheet::CChartSpace(pMain, filename, filename));
else if (relation.Type() == OOX::FileTypes::ChartEx)
return smart_ptr<OOX::File>(new OOX::Spreadsheet::CChartSpaceEx(pMain, filename, filename));
else if (relation.Type() == OOX::FileTypes::ChartStyle)
return smart_ptr<OOX::File>(new OOX::Spreadsheet::CChartStyle(pMain, filename, filename));
else if (relation.Type() == OOX::FileTypes::ChartColorStyle)
return smart_ptr<OOX::File>(new OOX::Spreadsheet::CChartColorStyle(pMain, filename, filename));
else if (relation.Type() == OOX::FileTypes::HyperLink)
return smart_ptr<OOX::File>(new OOX::HyperLink(pMain, relation.Target()));
else if (relation.Type() == OOX::FileTypes::Image)

View File

@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_LOGIC_ACTIVEX_CONTROL_INCLUDE_H_
#define PPTX_LOGIC_ACTIVEX_CONTROL_INCLUDE_H_
#include "SpTreeElem.h"
@ -194,4 +192,3 @@ namespace PPTX
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_ACTIVEX_CONTROLS_INCLUDE_H_

View File

@ -508,7 +508,14 @@ namespace PPTX
}
else if (chartRec.is_init())
{
pWriter->WriteRecord2(3, chartRec);
if (chartRec->m_bChartEx)
{
pWriter->WriteRecord2(4, chartRec);
}
else
{
pWriter->WriteRecord2(3, chartRec);
}
}
else if (element.is_init())
{
@ -554,27 +561,30 @@ namespace PPTX
{
case 0:
{
nvGraphicFramePr.fromPPTY(pReader);
break;
}
nvGraphicFramePr.fromPPTY(pReader);
}break;
case 1:
{
xfrm = new Logic::Xfrm();
xfrm->fromPPTY(pReader);
xfrm->m_ns = L"p";
break;
}
xfrm->m_ns = L"p";
}break;
case 2:
{
table = new Logic::Table();
table->fromPPTY(pReader);
break;
}
table->fromPPTY(pReader);
}break;
case 3:
{
chartRec = new Logic::ChartRec();
chartRec->fromPPTY(pReader);
}
}break;
case 4:
{
chartRec = new Logic::ChartRec();
chartRec->m_bChartEx = true;
chartRec->fromPPTY(pReader);
}break;
default:
break;
}

View File

@ -641,11 +641,11 @@ namespace PPTX
if (parentFileIs<PPTX::Slide>())
{
pVml = parentFileAs<PPTX::Slide>().Vml.operator->();
pVml = parentFileAs<PPTX::Slide>().Vml.GetPointer();
}
else if (parentFileIs<PPTX::SlideMaster>())
{
pVml = parentFileAs<PPTX::SlideMaster>().Vml.operator->();
pVml = parentFileAs<PPTX::SlideMaster>().Vml.GetPointer();
}
if (oleObject->m_sShapeId.IsInit() && pVml && !blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty())
{
@ -679,7 +679,7 @@ namespace PPTX
if (pFile.IsInit() && ( OOX::FileTypes::Image == pFile->type()))
{
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.operator->());
OOX::Image* pImageFileCache = static_cast<OOX::Image*>(pFile.GetPointer());
blipFill.blip->oleFilepathImage = pImageFileCache->filename().GetPath();
}

View File

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

View File

@ -69,7 +69,7 @@ namespace PPTX
if (oFileData.IsInit())
{
pDiagramData = dynamic_cast<OOX::CDiagramData*>(oFileData.operator->());
pDiagramData = dynamic_cast<OOX::CDiagramData*>(oFileData.GetPointer());
if (pDiagramData) result = true; // это smart art ..есть у него drawing или нет - неважно
if ((pDiagramData) && (pDiagramData->m_oExtLst.IsInit()))
@ -95,7 +95,7 @@ namespace PPTX
//пробуем по тому же пути с номером data.xml - ниже
}
}
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.operator->());
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.GetPointer());
if (!pDiagramDrawing && pDiagramData)
{
@ -109,7 +109,7 @@ namespace PPTX
oFileDrawing = smart_ptr<OOX::File>(dynamic_cast<OOX::File*>(new OOX::CDiagramDrawing(NULL, pathDiagramDrawing)));
if (oFileDrawing.IsInit())
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.operator->());
pDiagramDrawing = dynamic_cast<OOX::CDiagramDrawing*>(oFileDrawing.GetPointer());
}
if ((pDiagramDrawing) && (pDiagramDrawing->m_oShapeTree.IsInit()))
@ -150,16 +150,16 @@ namespace PPTX
{
if (m_diag.is_init())
{
smart_ptr<OOX::IFileContainer> old = *pWriter->m_pCurrentContainer;
smart_ptr<OOX::IFileContainer> oldContainer = *pWriter->m_pCurrentContainer;
*pWriter->m_pCurrentContainer = m_pFileContainer;
if (pWriter->m_pMainDocument)
pWriter->m_pMainDocument->m_pParamsWriter->m_pCurRels = (OOX::IFileContainer*)m_pFileContainer.operator->();
pWriter->m_pMainDocument->m_pParamsWriter->m_pCurRels = (OOX::IFileContainer*)m_pFileContainer.GetPointer();
m_diag->toPPTY(pWriter);
*pWriter->m_pCurrentContainer = old;
*pWriter->m_pCurrentContainer = oldContainer;
if (pWriter->m_pMainDocument)
pWriter->m_pMainDocument->m_pParamsWriter->m_pCurRels = old.operator->();
pWriter->m_pMainDocument->m_pParamsWriter->m_pCurRels = oldContainer.GetPointer();
}
}
void ChartRec::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
@ -175,9 +175,9 @@ namespace PPTX
else if (pRels != NULL) file = pRels->Find(*id_data);
}
smart_ptr<OOX::Spreadsheet::CChartSpace> pChart = file.smart_dynamic_cast<OOX::Spreadsheet::CChartSpace>();
smart_ptr<OOX::Spreadsheet::CChartSpaceEx> pChartEx = file.smart_dynamic_cast<OOX::Spreadsheet::CChartSpaceEx>();
if (pChart.IsInit() == false)
return;
if (false == pChart.IsInit() && false == pChartEx.IsInit()) return;
NSBinPptxRW::CDrawingConverter oDrawingConverter;
@ -190,7 +190,14 @@ namespace PPTX
oDrawingConverter.SetRels(pChart.smart_dynamic_cast<OOX::IFileContainer>());
BinXlsxRW::BinaryChartWriter oBinaryChartWriter(*pWriter, &oDrawingConverter);
oBinaryChartWriter.WriteCT_ChartSpace(*pChart);
if (pChart.IsInit())
{
oBinaryChartWriter.WriteCT_ChartSpace(*pChart);
}
else if (pChartEx.IsInit())
{
//oBinaryChartWriter.WriteCT_ChartSpace(*pChartEx);
}
oDrawingConverter.SetRels(oldRels);

View File

@ -123,10 +123,8 @@ namespace PPTX
public:
WritingElement_AdditionConstructors(ChartRec)
ChartRec()
ChartRec() : m_bChartEx(false), m_bData(false), m_lChartNumber(0)
{
m_bData = false;
m_lChartNumber = 0;
}
ChartRec(const ChartRec& oSrc)
@ -148,7 +146,11 @@ namespace PPTX
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
std::wstring ns = XmlUtils::GetNamespace(oReader.GetName());
m_bData = false;
m_bChartEx = false;
ReadAttributes( oReader );
FillParentPointersForChilds();
@ -156,10 +158,18 @@ namespace PPTX
{
m_bData = true;
}
if (ns == L"cx")
{
m_bChartEx = true;
}
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
m_bData = false;
m_bChartEx = false;
std::wstring ns = XmlUtils::GetNamespace(node.GetName());
XmlMacroReadAttributeBase(node, L"r:id", id_data);
FillParentPointersForChilds();
@ -168,6 +178,10 @@ namespace PPTX
{
m_bData = true;
}
if (ns == L"cx")
{
m_bChartEx = true;
}
}
virtual std::wstring toXML() const;
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
@ -179,6 +193,7 @@ namespace PPTX
LONG m_lChartNumber;
bool m_bData;
bool m_bChartEx;
protected:
virtual void FillParentPointersForChilds()
{

View File

@ -149,7 +149,7 @@ namespace PPTX
std::wstring SpPr::toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.WriteLimitNullable(_T("bwMode"), bwMode);
oAttr.WriteLimitNullable(L"bwMode", bwMode);
XmlUtils::CNodeValue oValue;
oValue.WriteNullable(xfrm);
@ -160,7 +160,7 @@ namespace PPTX
oValue.WriteNullable(scene3d);
oValue.WriteNullable(sp3d);
return XmlUtils::CreateNode(m_namespace + _T(":spPr"), oAttr, oValue);
return XmlUtils::CreateNode(m_namespace + L":spPr", oAttr, oValue);
}
void SpPr::Merge(SpPr& spPr)const

View File

@ -137,7 +137,6 @@ namespace PPTX
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
void Merge(SpPr& spPr)const;
public:
nullable<Xfrm> xfrm;
Logic::Geometry Geometry;
UniFill Fill;
@ -147,9 +146,8 @@ namespace PPTX
nullable<Sp3d> sp3d;
nullable_limit<Limit::BWMode> bwMode;
//private:
public:
std::wstring m_namespace;
std::wstring m_namespace;
protected:
virtual void FillParentPointersForChilds();
};

View File

@ -218,14 +218,14 @@ namespace PPTX
if ((type == lType) && (idx == lIdx) && !idx.empty())
{
if (pShape) pShape->SetLevelUpElement(pMasterShape.operator->());
if (pPic) pPic->SetLevelUpElement(pMasterShape.operator->());
if (pShape) pShape->SetLevelUpElement(pMasterShape.GetPointer());
if (pPic) pPic->SetLevelUpElement(pMasterShape.GetPointer());
return;
}
else if ((type == lType) && idx.empty() && lIdx.empty())
{
if (pShape) pShape->SetLevelUpElement(pMasterShape.operator->());
if (pPic) pPic->SetLevelUpElement(pMasterShape.operator->());
if (pShape) pShape->SetLevelUpElement(pMasterShape.GetPointer());
if (pPic) pPic->SetLevelUpElement(pMasterShape.GetPointer());
return;
}
}

View File

@ -159,15 +159,15 @@ namespace PPTX
if ((type == lType) && (idx == lIdx) && !idx.empty())
{
if (pShape) pShape->SetLevelUpElement(pLayoutShape.operator->());
if (pPic) pPic->SetLevelUpElement(pLayoutShape.operator->());
if (pShape) pShape->SetLevelUpElement(pLayoutShape.GetPointer());
if (pPic) pPic->SetLevelUpElement(pLayoutShape.GetPointer());
return;
}
else if ((type == lType) && idx.empty() && lIdx.empty())
{
if (pShape) pShape->SetLevelUpElement(pLayoutShape.operator->());
if (pPic) pPic->SetLevelUpElement(pLayoutShape.operator->());
if (pShape) pShape->SetLevelUpElement(pLayoutShape.GetPointer());
if (pPic) pPic->SetLevelUpElement(pLayoutShape.GetPointer());
return;
}

View File

@ -161,8 +161,8 @@ namespace PPTX
if (lType == L"ctrTitle") lType = L"title";
if (type == lType)
{
if (pShape) pShape->SetLevelUpElement(pMasterShape.operator->());
if (pPic) pPic->SetLevelUpElement(pMasterShape.operator->());
if (pShape) pShape->SetLevelUpElement(pMasterShape.GetPointer());
if (pPic) pPic->SetLevelUpElement(pMasterShape.GetPointer());
return;
}

View File

@ -45,12 +45,12 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
if (m_ooxGraphic->element.getType() == OOX::et_p_ShapeTree ||
m_ooxGraphic->element.getType() == OOX::et_lc_LockedCanvas)
{
OOXShapeGroupReader groupReader(dynamic_cast<PPTX::Logic::SpTree*>(m_ooxGraphic->element.GetElem().operator->()));
OOXShapeGroupReader groupReader(dynamic_cast<PPTX::Logic::SpTree*>(m_ooxGraphic->element.GetElem().GetPointer()));
return (groupReader.Parse(oParam, pOutput) ? 1 : 0);
}
else
{
OOXShapeReader shapeReader(m_ooxGraphic->element.GetElem().operator->());
OOXShapeReader shapeReader(m_ooxGraphic->element.GetElem().GetPointer());
return (shapeReader.Parse(oParam, pOutput) ? 1 : 0);
}
}

View File

@ -257,7 +257,7 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP
smart_ptr<OOX::File> oFile = oParam.oReader->m_currentContainer->Find(pHyperlink->m_oId->GetValue());
if ((oFile.IsInit()) && (OOX::FileTypes::HyperLink == oFile->type()))
{
OOX::HyperLink* pH = (OOX::HyperLink*)oFile.operator->();
OOX::HyperLink* pH = (OOX::HyperLink*)oFile.GetPointer();
sTarget = pH->Uri().GetPath();
}
}

View File

@ -327,7 +327,7 @@ bool OOXShapeReader::ParseVmlChild( ReaderParameter oParam , RtfShapePtr& pOutpu
if ( oFile.IsInit() && (OOX::FileTypes::Image == oFile->type()))
{
OOX::Image* pImage = (OOX::Image*)oFile.operator->();
OOX::Image* pImage = (OOX::Image*)oFile.GetPointer();
std::wstring sImagePath = pImage->filename().GetPath();
pOutput->m_oPicture = RtfPicturePtr( new RtfPicture() );
@ -418,7 +418,7 @@ bool OOXShapeReader::ParseVmlChild( ReaderParameter oParam , RtfShapePtr& pOutpu
{
pOutput->m_oPicture = RtfPicturePtr( new RtfPicture() );
OOX::Image* pImage = (OOX::Image*)oFile.operator->();
OOX::Image* pImage = (OOX::Image*)oFile.GetPointer();
std::wstring sImagePath = pImage->filename().GetPath();
WriteDataToPicture( sImagePath, *pOutput->m_oPicture, oParam);
@ -756,7 +756,7 @@ bool OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L
if ( oFile.IsInit() && (OOX::FileTypes::Image == oFile->type()))
{
OOX::Image* pImage = (OOX::Image*)oFile.operator->();
OOX::Image* pImage = (OOX::Image*)oFile.GetPointer();
std::wstring sImagePath = pImage->filename().GetPath();
@ -902,7 +902,7 @@ void OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L
{
//oox_grad_fill->GsLst[i]->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
}
Parse(oParam, oox_grad_fill->GsLst[i].color.Color.operator->(), hexColor, opacity);
Parse(oParam, oox_grad_fill->GsLst[i].color.Color.GetPointer(), hexColor, opacity);
if (i == 0)
{
@ -958,7 +958,7 @@ void OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L
unsigned int nColor = 0; //black
_CP_OPT(double) opacity;
Parse(oParam, fill.operator->(), nColor, opacity);
Parse(oParam, fill.GetPointer(), nColor, opacity);
pOutput->m_nLineColor = nColor;
}
else
@ -1529,7 +1529,7 @@ bool OOXShapeReader::ParseVmlObject ( ReaderParameter oParam , RtfShapePtr& pOut
if ((oFile.IsInit() && (OOX::FileTypes::OleObject == oFile->type())))
{
OOX::OleObject* pO = (OOX::OleObject*)oFile.operator->();
OOX::OleObject* pO = (OOX::OleObject*)oFile.GetPointer();
sOlePath = pO->filename().m_strFilename;
}
}
@ -1934,7 +1934,7 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapePtr& pOutput)
smart_ptr<PPTX::Logic::SpTree> e = m_ooxGroup->SpTreeElems[i].GetElem().smart_dynamic_cast<PPTX::Logic::SpTree>();
OOXShapeGroupReader oShapeReader(e.operator->());
OOXShapeGroupReader oShapeReader(e.GetPointer());
pNewShape->m_bInGroup = true;
if( true == oShapeReader.Parse( oParam, pNewShape ) )
@ -1945,7 +1945,7 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapePtr& pOutput)
RtfShapePtr pNewShape ( new RtfShape() );
smart_ptr<OOX::WritingElement> e = m_ooxGroup->SpTreeElems[i].GetElem().smart_dynamic_cast<OOX::WritingElement>();
OOXShapeReader oShapeReader(e.operator->());
OOXShapeReader oShapeReader(e.GetPointer());
pNewShape->m_bInGroup = true;
if( true == oShapeReader.Parse( oParam, pNewShape ) )

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

View File

@ -343,6 +343,14 @@
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,6 +359,14 @@
<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,16 +35,14 @@
namespace XLS
{
ContinueFrt::ContinueFrt()
ContinueFrt::ContinueFrt() : nData(0)
{
}
ContinueFrt::~ContinueFrt()
{
}
BaseObjectPtr ContinueFrt::clone()
{
return BaseObjectPtr(new ContinueFrt(*this));
@ -52,10 +50,15 @@ BaseObjectPtr ContinueFrt::clone()
void ContinueFrt::readFields(CFRecord& record)
{
#pragma message("####################### ContinueFrt record is not implemented")
Log::error("ContinueFrt record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
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,13 +31,12 @@
*/
#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)
@ -47,11 +46,14 @@ public:
~ContinueFrt();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeContinueFrt;
static const ElementType type = typeContinueFrt;
FrtHeaderOld frtHeaderOld;
boost::shared_array<char> pData;
size_t nData;
};

View File

@ -35,16 +35,14 @@
namespace XLS
{
ContinueFrt11::ContinueFrt11()
ContinueFrt11::ContinueFrt11(): nData(0)
{
}
ContinueFrt11::~ContinueFrt11()
{
}
BaseObjectPtr ContinueFrt11::clone()
{
return BaseObjectPtr(new ContinueFrt11(*this));
@ -53,6 +51,15 @@ 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,13 +31,12 @@
*/
#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)
@ -47,12 +46,14 @@ 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,10 +52,13 @@ BaseObjectPtr CrtMlFrt::clone()
void CrtMlFrt::readFields(CFRecord& record)
{
#pragma message("####################### CrtMlFrt record is not implemented")
Log::error("CrtMlFrt record is not implemented.");
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
record >> frtHeader >> cbXmltkChain;
//xmltkChain.cb = cbXmltkChain;
//record >> xmltkChain;
record.skipNunBytes(cbXmltkChain);
record.skipNunBytes(4);
}
} // namespace XLS

View File

@ -31,13 +31,12 @@
*/
#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)
@ -47,12 +46,16 @@ public:
~CrtMlFrt();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeCrtMlFrt;
FrtHeader frtHeader;
_UINT32 cbXmltkChain;
//XmlTkChain xmltkChain;
//-----------------------------
_UINT32 cb;

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of Dimensions record in BIFF8
class Dimensions: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Dimensions)
@ -47,11 +45,10 @@ 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,18 +40,15 @@ DropDownObjIds::DropDownObjIds()
{
}
DropDownObjIds::~DropDownObjIds()
{
}
BaseObjectPtr DropDownObjIds::clone()
{
return BaseObjectPtr(new DropDownObjIds(*this));
}
void DropDownObjIds::readFields(CFRecord& record)
{
FrtHeader frtHeader(rt_DropDownObjIds);

View File

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

View File

@ -58,12 +58,15 @@ void ExternSheet::readFields(CFRecord& record)
if (record.getGlobalWorkbookInfo()->Version < 0x0600)
{
unsigned char type;
unsigned char size;
ShortXLAnsiString stName;
record >> type >> stName;
record >> size >> type;
LPAnsiStringNoCch stName(size);
record >> 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,11 +31,12 @@
*/
#include "Feature11.h"
#include "ContinueFrt11.h"
namespace XLS
{
Feature11::Feature11()
Feature11::Feature11(bool bFeat12) : bFeature12(bFeat12)
{
}
@ -50,6 +51,18 @@ 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;
@ -67,7 +80,13 @@ 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 "BiffRecord.h"
#include "BiffRecordContinued.h"
#include "../Biff_structures/FrtRefHeaderU.h"
#include "../Biff_structures/CellRangeRef.h"
@ -40,12 +40,12 @@
namespace XLS
{
class Feature11: public BiffRecord
class Feature11 : public BiffRecordContinued //: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Feature11)
BASE_OBJECT_DEFINE_CLASS_NAME(Feature11)
public:
Feature11();
Feature11(bool bFeat12 = false);
~Feature11();
BaseObjectPtr clone();
@ -62,6 +62,8 @@ public:
std::wstring sqref;
TableFeatureType rgbFeat;
bool bFeature12;
};
} // namespace XLS

View File

@ -31,11 +31,12 @@
*/
#include "Feature12.h"
#include "ContinueFrt.h"
namespace XLS
{
Feature12::Feature12()
Feature12::Feature12() : feature11(true)
{
}
@ -51,6 +52,17 @@ 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,13 +32,11 @@
#pragma once
#include "BiffRecord.h"
#include <Logic/Biff_structures/LongRGB.h>
#include "../Biff_structures/LongRGB.h"
namespace XLS
{
// Logical representation of LineFormat record in BIFF8
class LineFormat: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(LineFormat)
@ -48,7 +46,6 @@ public:
~LineFormat();
BaseObjectPtr clone();
void readFields(CFRecord& record);

View File

@ -36,7 +36,6 @@
namespace XLS
{
class IXFCellMulBlankSpecial : public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(IXFCellMulBlankSpecial)
@ -53,9 +52,6 @@ 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,10 +179,7 @@ void Obj::readFields(CFRecord& record)
old_version.anchor->loadFields(record);
record >> nMacrosSize;
record.skipNunBytes(2);
record >> nNameLen;
record.skipNunBytes(2);
record.skipNunBytes(6);
if(OBJ_Line == cmo.ot)
{
@ -190,6 +187,26 @@ 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;
@ -261,9 +278,38 @@ 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;
_UINT32 line = 0;
_UINT32 fill = 0;//(icvBack, icvFore, fls, fAuto)
_UINT32 line = 0;//(icv, lns, lnw, fAuto)
_UINT16 flag = 0;
_UINT16 flag2 = 0;
}old_version;

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of Row record in BIFF8
class Row: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(Row)
@ -47,13 +45,12 @@ 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,7 +50,6 @@ BaseObjectPtr Sort::clone()
return BaseObjectPtr(new Sort(*this));
}
void Sort::readFields(CFRecord& record)
{
unsigned short flags;
@ -68,20 +67,52 @@ void Sort::readFields(CFRecord& record)
unsigned char cchKey2;
unsigned char cchKey3;
record >> cchKey1 >> cchKey2 >> cchKey3;
if(cchKey1)
if (record.getGlobalWorkbookInfo()->Version >= 0x0600)
{
stKey1.setSize(cchKey1);
record >> stKey1;
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();
}
}
if(cchKey2)
else
{
stKey2.setSize(cchKey2);
record >> stKey2;
}
if(cchKey3)
{
stKey3.setSize(cchKey3);
record >> stKey3;
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();
}
}
record.skipNunBytes(1); // reserved
}

View File

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

View File

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

View File

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

View File

@ -64,6 +64,7 @@ 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;
_UINT32 size;
_INT32 size;
};
typedef boost::shared_ptr<DXFN12List> DXFN12ListPtr;

View File

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

View File

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

View File

@ -49,6 +49,7 @@ 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) : lt(_lt), bDiskHdrCache(bDskHeaderCache)
Feat11FieldDataItem::Feat11FieldDataItem(_UINT32 _lt, bool bDskHeaderCache, bool bFeat12) : lt(_lt), bDiskHdrCache(bDskHeaderCache), bFeature12(bFeat12)
{
}
BiffStructurePtr Feat11FieldDataItem::clone()
@ -96,7 +96,7 @@ void Feat11FieldDataItem::load(CFRecord& record)
{
fmla.load(record);
}
if (fLoadTotalFmla)
if (fLoadTotalFmla && bFeature12)
{
if (fLoadTotalArray)
{
@ -107,7 +107,7 @@ void Feat11FieldDataItem::load(CFRecord& record)
totalFmla.load(record);
}
}
if (fLoadTotalStr)
if (fLoadTotalStr && bFeature12)
{
record >> strTotal;
}
@ -122,6 +122,7 @@ 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);
Feat11FieldDataItem(_UINT32 lt, bool bDskHeaderCache, bool bFeat12);
BiffStructurePtr clone();
static const ElementType type = typeFeat11FieldDataItem;
@ -97,6 +97,7 @@ public:
//------------------------------------------------
_UINT32 lt;
bool bDiskHdrCache;
bool bFeature12;
};
typedef boost::shared_ptr<Feat11FieldDataItem> Feat11FieldDataItemPtr;

View File

@ -50,8 +50,6 @@ 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;
int pos1 = record.getRdPtr();
size_t pos1 = record.getRdPtr();
record >> nElems >> nElemsAlloc >> cbElem;

View File

@ -59,7 +59,7 @@ public:
XLS::BiffStructurePtr clone()
{
return XLS::BiffStructurePtr(new OfficeArtBlip(recType));
return XLS::BiffStructurePtr(new OfficeArtBlip((unsigned short)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 != 0xffff)
if (ixti < global_info->arXti_External.size())
{
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 ; ++i)
for(unsigned char i = 0; i < nparams - 1 && !ptg_stack.empty(); ++i)
{
arguments = ptg_stack.top() + L',' + arguments;
ptg_stack.pop();
}
}
if(0xFF == tab.getIndex() && ptg_stack.size() > 0) // user-defined function
if(0xFF == tab.getIndex()&& !ptg_stack.empty()) // user-defined function
{
func_name = ptg_stack.top();

View File

@ -87,6 +87,25 @@ 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);
@ -105,7 +124,7 @@ void TableFeatureType::load(CFRecord& record)
record.skipNunBytes(16); // rgbHashParam
record >> rgbName;
record >> cFieldData; //from 1 to 100
record >> cFieldData; //from 1 to 0x100
if (fLoadCSPName)
record >> cSPName;
@ -118,7 +137,7 @@ void TableFeatureType::load(CFRecord& record)
if (record.getRdPtr() >= record.getDataSize())
return;
arFieldData.push_back(BiffStructurePtr(new Feat11FieldDataItem(lt, (crwHeader == 0x0000 && fSingleCell))));
arFieldData.push_back(BiffStructurePtr(new Feat11FieldDataItem(lt, (crwHeader == 0x0000 && fSingleCell == 0x0000), bFeature12)));
arFieldData.back()->load(record);
}
if (fLoadPldwIdDeleted)

View File

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

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