mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-03-17 21:12:19 +08:00
Compare commits
199 Commits
core-win-3
...
core-win-3
| Author | SHA1 | Date | |
|---|---|---|---|
| e3ff8912f0 | |||
| 98114aa7a5 | |||
| 6bd1d9b90b | |||
| 36aa148aa0 | |||
| f69180dcf6 | |||
| 864c3bfdc7 | |||
| 4bb34abf91 | |||
| 3887879671 | |||
| 9516a0b02b | |||
| 047041aa9b | |||
| ca5e70118c | |||
| 99159d5932 | |||
| 5d89558b5d | |||
| 5058d41d6a | |||
| 69be19feda | |||
| 73933c683e | |||
| 55e4902d66 | |||
| 2dc1ad5af7 | |||
| ab0def1840 | |||
| 957972e3be | |||
| 49e31f2c0c | |||
| 4585e86fb7 | |||
| 6bcafa516a | |||
| e41f8019d6 | |||
| e8f1da2478 | |||
| b378084925 | |||
| 99f47b43a5 | |||
| dc1999482e | |||
| 7c764f5b84 | |||
| 03316ea82d | |||
| 567f547d10 | |||
| a4a52ec016 | |||
| 1458b1c57f | |||
| 7d59211e67 | |||
| f68662827d | |||
| bd61eb4bef | |||
| 63fabad661 | |||
| b9981cffef | |||
| 30a30d1bc6 | |||
| d5d086d286 | |||
| 6822c8b7dd | |||
| 56b7889270 | |||
| f4cdfc49bb | |||
| 972f1ef4e5 | |||
| 8fda74aefc | |||
| 7bba282321 | |||
| 8c8f59da80 | |||
| 3027a038d0 | |||
| 9c6ee2a171 | |||
| e8d6092a95 | |||
| 3bc08e72dc | |||
| c094962751 | |||
| 70f8abf0bf | |||
| 47318eef9c | |||
| 094a1d98d6 | |||
| 471219e59a | |||
| 2cfd2a0126 | |||
| f3ec039a01 | |||
| f4795db0b8 | |||
| b52d9cb5d6 | |||
| ff2303f386 | |||
| d78fe3b9b1 | |||
| b589d53213 | |||
| fcb01e9675 | |||
| 60b41cae31 | |||
| ecca92951c | |||
| 5612c09b0c | |||
| 8926c52369 | |||
| b1d0b7aac7 | |||
| 923fbfcbe0 | |||
| fc6f8bdba9 | |||
| e6da67b3e1 | |||
| 49fa17978d | |||
| 61211fc08c | |||
| 8316861e00 | |||
| 8ebf0c590a | |||
| 3451d93b57 | |||
| f36ba68722 | |||
| 9a8a0a9bf2 | |||
| ae6d97ffd8 | |||
| 16ffb9cefd | |||
| 92beed0782 | |||
| 27e68c0fa7 | |||
| 9cdd977367 | |||
| 6ad996780b | |||
| bd0a2bcbd7 | |||
| a4e2fcad31 | |||
| 7e23508e06 | |||
| c9928f0929 | |||
| 207549cc88 | |||
| a16d889984 | |||
| 8600020fb0 | |||
| 8950201785 | |||
| c600841902 | |||
| 1a3a73d0ec | |||
| 5a82c47fa0 | |||
| 65f7a4a170 | |||
| 413424bf62 | |||
| 41606e907a | |||
| 01499a21f3 | |||
| a9215a867b | |||
| e9fd8205fa | |||
| f30a3c4ae8 | |||
| 615179f9da | |||
| 2fc5a4f37a | |||
| 25af6b2ecf | |||
| f0fdf9f86e | |||
| 5d5e7bce72 | |||
| 58903d92e1 | |||
| b7ea6bb376 | |||
| a1007d4522 | |||
| 4b68d3294c | |||
| 24b44f6b03 | |||
| 9f20ee6fef | |||
| 14921ca98d | |||
| 663bf866ed | |||
| 4894639c09 | |||
| 2314452d5a | |||
| 22c8ae9d0e | |||
| 996fa5c84d | |||
| 59d2dd2840 | |||
| 3727c2e982 | |||
| 1b67ebe9a6 | |||
| 967ab71adc | |||
| d7c7dadbba | |||
| a48322f1cc | |||
| bd41922f66 | |||
| ccd73c8c68 | |||
| 5b6659f816 | |||
| a5122a6a47 | |||
| 7a4cf11c62 | |||
| 9b9d7df4e2 | |||
| c9330ee0f1 | |||
| 2214362426 | |||
| bdce91fccf | |||
| f9e35983f4 | |||
| dd65f70fcb | |||
| bf600c6eb0 | |||
| 0db6728463 | |||
| 03bccc6b10 | |||
| 09c43b1179 | |||
| e6134405cb | |||
| 0499c6ff4f | |||
| 1860c19539 | |||
| 2d5015bcf2 | |||
| 390ab3bcc8 | |||
| c0d16ed7c3 | |||
| 075f70c220 | |||
| 6abf1613ec | |||
| 0abc21d4ee | |||
| 7a7cdab770 | |||
| 7c6218ccb5 | |||
| 34c5a4b3af | |||
| 9256b0f9a3 | |||
| ce370581a8 | |||
| 39647894a8 | |||
| 3d456bcc80 | |||
| 7ae3c6f2ea | |||
| 404058354e | |||
| d398488f3d | |||
| 35bd2803a4 | |||
| c312a2b868 | |||
| 08f75771b9 | |||
| 060f695fb1 | |||
| de3261521e | |||
| e7bf661432 | |||
| 6470a3a8a4 | |||
| 14aed88307 | |||
| 132f770d28 | |||
| 8f5318a9a2 | |||
| 635265eaa2 | |||
| 038a687d01 | |||
| 69e8ea6f4b | |||
| 1393de8057 | |||
| 7636ff79cc | |||
| 2092aef589 | |||
| eff937699b | |||
| 3efc1f0432 | |||
| 69fee1ae0b | |||
| a0cc6b6274 | |||
| 31eb395858 | |||
| ed1019a004 | |||
| 4e554d128a | |||
| b8d441a327 | |||
| 8fb809bf4a | |||
| cabf6ab32a | |||
| 35c4d70cf5 | |||
| 58952393f0 | |||
| 688d5972ea | |||
| 81176e851c | |||
| 0b987aeed2 | |||
| c7315e2f21 | |||
| aefb229343 | |||
| ac080b3485 | |||
| eb9d69d1ec | |||
| eb4ffee9e7 | |||
| 763347d8ec | |||
| 9670d021c2 | |||
| 564b7f9c29 |
@ -82,6 +82,7 @@ namespace DocFileFormat
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
|
||||
|
||||
size_t count = m_document->AnnotationsReferencePlex->Elements.size();
|
||||
|
||||
for (size_t index = 0; index < count; ++index)
|
||||
{
|
||||
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
|
||||
@ -92,14 +93,15 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
|
||||
if (atrdPre10->m_BookmarkId < 0)//-1 - easy ref (not start/end comment ref)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::SizeTToWideString( index + 1 + count + 1024 ));
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (atrdPre10->m_BookmarkId < 0)//-1 - easy ref (not start/end comment ref)
|
||||
//{
|
||||
// m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::SizeTToWideString( index + 1 + count + 1024 ));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::SizeTToWideString( index + 1 ));
|
||||
}
|
||||
//}
|
||||
|
||||
if (atrdPost10)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:date", atrdPost10->m_nDTTM.getString());
|
||||
|
||||
@ -800,8 +800,9 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
XMLTools::XMLElement elem(L"w:br");
|
||||
elem.AppendAttribute(L"w:type", L"textWrapping");
|
||||
elem.AppendAttribute(L"w:clear", L"all");
|
||||
//СЗ в МРФ Техноград о предоставлении ТП 1 квартал 2019_MO_Q31.doc
|
||||
//elem.AppendAttribute(L"w:type", L"textWrapping");
|
||||
//elem.AppendAttribute(L"w:clear", L"all");
|
||||
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString());
|
||||
}
|
||||
@ -892,12 +893,16 @@ namespace DocFileFormat
|
||||
}
|
||||
else if ((TextMark::Symbol == code) && fSpec)
|
||||
{
|
||||
writeNotesReferences(cp);//for word95 & non-automatic notes
|
||||
|
||||
Symbol s = getSymbol( chpx );
|
||||
|
||||
//m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
//m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
//m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
//m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
//<w:sym w:font="Symbol" w:char="F062"/>
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
else if ((TextMark::DrawnObject == code) && fSpec)
|
||||
{
|
||||
@ -1035,39 +1040,7 @@ namespace DocFileFormat
|
||||
}
|
||||
else if ((TextMark::AutoNumberedFootnoteReference == code) && fSpec)
|
||||
{
|
||||
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnoteReference", true );
|
||||
FootnoteDescriptor* desc = dynamic_cast<FootnoteDescriptor*>(m_document->FootnoteReferenceCharactersPlex->Elements[_footnoteNr]);
|
||||
if (desc && desc->aFtnIdx == 0)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_footnoteNr++ ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnoteRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
|
||||
EndnoteDescriptor* desc = dynamic_cast<EndnoteDescriptor*>(m_document->EndnoteReferenceCharactersPlex->Elements[_endnoteNr]);
|
||||
if (desc && desc->aEndIdx == 0)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_endnoteNr++ ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->IndividualEndnotesPlex != NULL) &&
|
||||
(m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
writeNotesReferences(cp);
|
||||
}
|
||||
else if (TextMark::AnnotationReference == code)
|
||||
{
|
||||
@ -1084,8 +1057,8 @@ namespace DocFileFormat
|
||||
|
||||
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index - 1]);
|
||||
|
||||
if (atrdPre10->m_BookmarkId < 0)
|
||||
index += m_document->AnnotationsReferencePlex->Elements.size() + 1024;
|
||||
//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 );
|
||||
@ -1093,6 +1066,8 @@ namespace DocFileFormat
|
||||
}
|
||||
else if (!FormatUtils::IsControlSymbol(c) && ((int)c != 0xFFFF))
|
||||
{
|
||||
|
||||
writeNotesReferences(cp);//for word95 & non-automatic notes
|
||||
text += FormatUtils::GetXMLSymbol(c);
|
||||
}
|
||||
|
||||
@ -1378,6 +1353,7 @@ namespace DocFileFormat
|
||||
fEndNestingLevel = ( iter->Arguments[0] == 1 ) ? (true) : (false);
|
||||
}break;
|
||||
|
||||
case sprmOldPFInTable:
|
||||
case sprmPItap:
|
||||
{
|
||||
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
@ -1418,7 +1394,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nestingLevel > 1 && fEndNestingLevel && !boundaries.empty())
|
||||
if (nestingLevel != iTap_current && fEndNestingLevel && !boundaries.empty())
|
||||
break;
|
||||
//get the next papx
|
||||
papx = findValidPapx( fcRowEnd );
|
||||
@ -1764,7 +1740,51 @@ namespace DocFileFormat
|
||||
|
||||
return cpCellEnd;
|
||||
}
|
||||
|
||||
bool DocumentMapping::writeNotesReferences(int cp)
|
||||
{
|
||||
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
FootnoteDescriptor* desc = dynamic_cast<FootnoteDescriptor*>(m_document->FootnoteReferenceCharactersPlex->Elements[_footnoteNr]);
|
||||
if ((desc) && (false == desc->bUsed))
|
||||
{
|
||||
desc->bUsed = true;
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnoteReference", true );
|
||||
if (desc->aFtnIdx == 0)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_footnoteNr++ ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
}
|
||||
else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnoteRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
EndnoteDescriptor* desc = dynamic_cast<EndnoteDescriptor*>(m_document->EndnoteReferenceCharactersPlex->Elements[_endnoteNr]);
|
||||
if ((desc) && (false == desc->bUsed))
|
||||
{
|
||||
desc->bUsed = true;
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
|
||||
if (desc->aEndIdx == 0)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_endnoteNr++ ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
}
|
||||
else if ((m_document->IndividualEndnotesPlex != NULL) &&
|
||||
(m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool DocumentMapping::writeBookmarks(int cp)
|
||||
{
|
||||
bool result = true;
|
||||
@ -1907,7 +1927,7 @@ namespace DocFileFormat
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
|
||||
|
||||
ret.FontName = ffn->xszFtn;
|
||||
ret.HexValue = FormatUtils::IntToFormattedWideString( code, L"%04x" );
|
||||
ret.HexValue = FormatUtils::IntToFormattedWideString( code, L"%04X" );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -121,6 +121,8 @@ namespace DocFileFormat
|
||||
bool writeBookmarkStart ( short id );
|
||||
bool writeBookmarkEnd ( short id );
|
||||
|
||||
bool writeNotesReferences(int cp);
|
||||
|
||||
bool writeAnnotations ( int cp );
|
||||
bool writeAnnotationStart( short id );
|
||||
bool writeAnnotationEnd ( short id );
|
||||
|
||||
@ -40,7 +40,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
static const int STRUCTURE_SIZE = 2;
|
||||
|
||||
EndnoteDescriptor(): aEndIdx(0) {}
|
||||
EndnoteDescriptor(): aEndIdx(0), bUsed(false) {}
|
||||
|
||||
virtual ~EndnoteDescriptor()
|
||||
{
|
||||
@ -54,6 +54,7 @@ namespace DocFileFormat
|
||||
return static_cast<ByteStructure*>( newObject );
|
||||
}
|
||||
|
||||
bool bUsed;
|
||||
short aEndIdx;
|
||||
};
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
static const int STRUCTURE_SIZE = 2;
|
||||
|
||||
FootnoteDescriptor() : aFtnIdx(0) {}
|
||||
FootnoteDescriptor() : aFtnIdx(0), bUsed(false) {}
|
||||
|
||||
virtual ~FootnoteDescriptor()
|
||||
{
|
||||
@ -56,5 +56,6 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
short aFtnIdx;
|
||||
bool bUsed;
|
||||
};
|
||||
}
|
||||
|
||||
@ -259,6 +259,12 @@ namespace DocFileFormat
|
||||
//compatibility settings
|
||||
m_oXmlWriter.WriteNodeBegin( L"w:compat" );
|
||||
|
||||
m_oXmlWriter.WriteNodeBegin( L"w:compatSetting", TRUE);
|
||||
m_oXmlWriter.WriteAttribute( L"w:name", L"compatibilityMode" );
|
||||
m_oXmlWriter.WriteAttribute( L"w:uri", L"http://schemas.microsoft.com/office/word" );
|
||||
m_oXmlWriter.WriteAttribute( L"w:val", L"11" );
|
||||
m_oXmlWriter.WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//some settings must always be written
|
||||
|
||||
if ( dop->fUseNormalStyleForList )
|
||||
|
||||
@ -75,7 +75,7 @@ namespace DocFileFormat
|
||||
void TableCellPropertiesMapping::Apply (IVisitable* visited)
|
||||
{
|
||||
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>(visited);
|
||||
int nComputedCellWidth = 0;
|
||||
int nComputedCellWidth = 0, nComputedCellWidths = 0;
|
||||
|
||||
_gridSpan = 0;
|
||||
_bCoverCell = false;
|
||||
@ -164,7 +164,11 @@ namespace DocFileFormat
|
||||
else
|
||||
{
|
||||
_gridSpan = 1;
|
||||
nComputedCellWidth += tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ] ;
|
||||
|
||||
nComputedCellWidths += (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ 0 ]);
|
||||
nComputedCellWidth += tdef.rgTc80[ _cellIndex].wWidth > 1 ? tdef.rgTc80[ _cellIndex].wWidth : (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ]);
|
||||
//Технические_Требования_1_287_ДИТ.DOC
|
||||
|
||||
}
|
||||
|
||||
if (!IsTableBordersDefined(tapx->grpprl))
|
||||
@ -348,19 +352,22 @@ namespace DocFileFormat
|
||||
tcW.AppendAttribute( tcWVal );
|
||||
_tcPr->AppendChild( tcW );
|
||||
|
||||
int nComputedCellWidthsGrid = 0;
|
||||
|
||||
if ( _gridSpan == 1 && ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidth > _grid->at( _gridIndex ) ) )
|
||||
for (size_t ccc = 0; ccc < _grid->size() && ccc <= _gridIndex; ccc++)
|
||||
{
|
||||
nComputedCellWidthsGrid += _grid->at(ccc);
|
||||
}
|
||||
if ( _gridSpan == 1 && ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidths > nComputedCellWidthsGrid ) )
|
||||
{
|
||||
//check the number of merged cells
|
||||
int w = _grid->at( _gridIndex );
|
||||
|
||||
for ( size_t i = _gridIndex + 1; i < _grid->size(); i++ )
|
||||
{
|
||||
_gridSpan++;
|
||||
|
||||
w += _grid->at( i );
|
||||
nComputedCellWidthsGrid += _grid->at( i );
|
||||
|
||||
if ( w >= nComputedCellWidth )
|
||||
if ( nComputedCellWidthsGrid >= nComputedCellWidths )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1280,7 +1280,7 @@ namespace DocFileFormat
|
||||
|
||||
for (size_t i = 0; i < pWrapPolygonVertices->complex.data.size(); ++i)
|
||||
{
|
||||
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i++].x);
|
||||
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i].x);
|
||||
coords += L",";
|
||||
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i].y);
|
||||
coords += L",";
|
||||
|
||||
@ -29,9 +29,6 @@
|
||||
6967B4D41E27C52700A129E2 /* ListTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4271E27C52700A129E2 /* ListTable.cpp */; };
|
||||
6967B4D51E27C52700A129E2 /* MainDocumentMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4291E27C52700A129E2 /* MainDocumentMapping.cpp */; };
|
||||
6967B4D61E27C52700A129E2 /* NumberingMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */; };
|
||||
6967B4D71E27C52700A129E2 /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4471E27C52700A129E2 /* Record.cpp */; };
|
||||
6967B4D81E27C52700A129E2 /* RecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4491E27C52700A129E2 /* RecordFactory.cpp */; };
|
||||
6967B4D91E27C52700A129E2 /* ShapeTypeFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */; };
|
||||
6967B4DA1E27C52700A129E2 /* OleObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47A1E27C52700A129E2 /* OleObject.cpp */; };
|
||||
6967B4DB1E27C52700A129E2 /* OpenXmlPackage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47D1E27C52700A129E2 /* OpenXmlPackage.cpp */; };
|
||||
6967B4DC1E27C52700A129E2 /* ParagraphHeight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47F1E27C52700A129E2 /* ParagraphHeight.cpp */; };
|
||||
@ -60,6 +57,9 @@
|
||||
6967B4F31E27C52700A129E2 /* VMLShapeTypeMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BC1E27C52700A129E2 /* VMLShapeTypeMapping.cpp */; };
|
||||
6967B4F41E27C52700A129E2 /* WordDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BF1E27C52700A129E2 /* WordDocument.cpp */; };
|
||||
6967B4F51E27C52700A129E2 /* WordprocessingDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */; };
|
||||
8A1BC15322DF34920084799E /* ShapeTypeFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A1BC11622DF34900084799E /* ShapeTypeFactory.cpp */; };
|
||||
8A1BC15422DF34920084799E /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A1BC14922DF34920084799E /* Record.cpp */; };
|
||||
8A1BC15522DF34920084799E /* RecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A1BC15222DF34920084799E /* RecordFactory.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
@ -166,79 +166,6 @@
|
||||
6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberingMapping.cpp; sourceTree = "<group>"; };
|
||||
6967B42D1E27C52700A129E2 /* NumberingMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberingMapping.h; sourceTree = "<group>"; };
|
||||
6967B42E1E27C52700A129E2 /* OfficeArtContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtContent.h; sourceTree = "<group>"; };
|
||||
6967B4301E27C52700A129E2 /* BitmapBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapBlip.h; sourceTree = "<group>"; };
|
||||
6967B4311E27C52700A129E2 /* BlipStoreContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreContainer.h; sourceTree = "<group>"; };
|
||||
6967B4321E27C52700A129E2 /* BlipStoreEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreEntry.h; sourceTree = "<group>"; };
|
||||
6967B4331E27C52700A129E2 /* ChildAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildAnchor.h; sourceTree = "<group>"; };
|
||||
6967B4341E27C52700A129E2 /* ClientAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientAnchor.h; sourceTree = "<group>"; };
|
||||
6967B4351E27C52700A129E2 /* ClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientData.h; sourceTree = "<group>"; };
|
||||
6967B4361E27C52700A129E2 /* DiagramBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagramBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B4371E27C52700A129E2 /* DrawingContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingContainer.h; sourceTree = "<group>"; };
|
||||
6967B4381E27C52700A129E2 /* DrawingGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroup.h; sourceTree = "<group>"; };
|
||||
6967B4391E27C52700A129E2 /* DrawingGroupRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroupRecord.h; sourceTree = "<group>"; };
|
||||
6967B43A1E27C52700A129E2 /* DrawingRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingRecord.h; sourceTree = "<group>"; };
|
||||
6967B43B1E27C52700A129E2 /* FillStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FillStyleBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B43C1E27C52700A129E2 /* GeometryBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B43D1E27C52700A129E2 /* GeometryTextBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryTextBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B43E1E27C52700A129E2 /* GroupContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupContainer.h; sourceTree = "<group>"; };
|
||||
6967B43F1E27C52700A129E2 /* GroupShapeBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B4401E27C52700A129E2 /* GroupShapeRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeRecord.h; sourceTree = "<group>"; };
|
||||
6967B4411E27C52700A129E2 /* LineStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineStyleBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B4421E27C52700A129E2 /* MetafilePictBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetafilePictBlip.h; sourceTree = "<group>"; };
|
||||
6967B4431E27C52700A129E2 /* OfficeArtClientTextbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtClientTextbox.h; sourceTree = "<group>"; };
|
||||
6967B4441E27C52700A129E2 /* PathParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathParser.h; sourceTree = "<group>"; };
|
||||
6967B4451E27C52700A129E2 /* PathSegment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathSegment.h; sourceTree = "<group>"; };
|
||||
6967B4461E27C52700A129E2 /* ProtectionBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B4471E27C52700A129E2 /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
|
||||
6967B4481E27C52700A129E2 /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
|
||||
6967B4491E27C52700A129E2 /* RecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecordFactory.cpp; sourceTree = "<group>"; };
|
||||
6967B44A1E27C52700A129E2 /* RecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordFactory.h; sourceTree = "<group>"; };
|
||||
6967B44B1E27C52700A129E2 /* RegularContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegularContainer.h; sourceTree = "<group>"; };
|
||||
6967B44C1E27C52700A129E2 /* ShadowStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowStyleBooleanProperties.h; sourceTree = "<group>"; };
|
||||
6967B44D1E27C52700A129E2 /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shape.h; sourceTree = "<group>"; };
|
||||
6967B44E1E27C52700A129E2 /* ShapeContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeContainer.h; sourceTree = "<group>"; };
|
||||
6967B44F1E27C52700A129E2 /* ShapeOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeOptions.h; sourceTree = "<group>"; };
|
||||
6967B4501E27C52700A129E2 /* ShapeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeType.h; sourceTree = "<group>"; };
|
||||
6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShapeTypeFactory.cpp; sourceTree = "<group>"; };
|
||||
6967B4521E27C52700A129E2 /* ShapeTypeFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeTypeFactory.h; sourceTree = "<group>"; };
|
||||
6967B4541E27C52700A129E2 /* ArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArcType.h; sourceTree = "<group>"; };
|
||||
6967B4551E27C52700A129E2 /* ArrowType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowType.h; sourceTree = "<group>"; };
|
||||
6967B4561E27C52700A129E2 /* BevelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BevelType.h; sourceTree = "<group>"; };
|
||||
6967B4571E27C52700A129E2 /* BlockArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockArcType.h; sourceTree = "<group>"; };
|
||||
6967B4581E27C52700A129E2 /* BracketsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BracketsType.h; sourceTree = "<group>"; };
|
||||
6967B4591E27C52700A129E2 /* CalloutsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalloutsType.h; sourceTree = "<group>"; };
|
||||
6967B45A1E27C52700A129E2 /* CanType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanType.h; sourceTree = "<group>"; };
|
||||
6967B45B1E27C52700A129E2 /* Connector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
|
||||
6967B45C1E27C52700A129E2 /* CubeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeType.h; sourceTree = "<group>"; };
|
||||
6967B45D1E27C52700A129E2 /* DiamondType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiamondType.h; sourceTree = "<group>"; };
|
||||
6967B45E1E27C52700A129E2 /* DonutType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DonutType.h; sourceTree = "<group>"; };
|
||||
6967B45F1E27C52700A129E2 /* FlowChartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlowChartType.h; sourceTree = "<group>"; };
|
||||
6967B4601E27C52700A129E2 /* FoldedCornerlType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldedCornerlType.h; sourceTree = "<group>"; };
|
||||
6967B4611E27C52700A129E2 /* HeartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeartType.h; sourceTree = "<group>"; };
|
||||
6967B4621E27C52700A129E2 /* HexagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonType.h; sourceTree = "<group>"; };
|
||||
6967B4631E27C52700A129E2 /* IsoscelesTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoscelesTriangleType.h; sourceTree = "<group>"; };
|
||||
6967B4641E27C52700A129E2 /* LightningBoltType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LightningBoltType.h; sourceTree = "<group>"; };
|
||||
6967B4651E27C52700A129E2 /* LineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineType.h; sourceTree = "<group>"; };
|
||||
6967B4661E27C52700A129E2 /* MoonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoonType.h; sourceTree = "<group>"; };
|
||||
6967B4671E27C52700A129E2 /* NoSmokingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoSmokingType.h; sourceTree = "<group>"; };
|
||||
6967B4681E27C52700A129E2 /* OctagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OctagonType.h; sourceTree = "<group>"; };
|
||||
6967B4691E27C52700A129E2 /* OvalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OvalType.h; sourceTree = "<group>"; };
|
||||
6967B46A1E27C52700A129E2 /* ParallelogramType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelogramType.h; sourceTree = "<group>"; };
|
||||
6967B46B1E27C52700A129E2 /* PentagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PentagonType.h; sourceTree = "<group>"; };
|
||||
6967B46C1E27C52700A129E2 /* PictureFrameType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureFrameType.h; sourceTree = "<group>"; };
|
||||
6967B46D1E27C52700A129E2 /* PlaqueType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaqueType.h; sourceTree = "<group>"; };
|
||||
6967B46E1E27C52700A129E2 /* PlusType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlusType.h; sourceTree = "<group>"; };
|
||||
6967B46F1E27C52700A129E2 /* RectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectangleType.h; sourceTree = "<group>"; };
|
||||
6967B4701E27C52700A129E2 /* RightTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightTriangleType.h; sourceTree = "<group>"; };
|
||||
6967B4711E27C52700A129E2 /* RoundedRectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangleType.h; sourceTree = "<group>"; };
|
||||
6967B4721E27C52700A129E2 /* SmileyFaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmileyFaceType.h; sourceTree = "<group>"; };
|
||||
6967B4731E27C52700A129E2 /* StarType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarType.h; sourceTree = "<group>"; };
|
||||
6967B4741E27C52700A129E2 /* SunType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SunType.h; sourceTree = "<group>"; };
|
||||
6967B4751E27C52700A129E2 /* TextboxType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextboxType.h; sourceTree = "<group>"; };
|
||||
6967B4761E27C52700A129E2 /* TrapezoidType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrapezoidType.h; sourceTree = "<group>"; };
|
||||
6967B4771E27C52700A129E2 /* WordArtText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordArtText.h; sourceTree = "<group>"; };
|
||||
6967B4781E27C52700A129E2 /* SplitMenuColorContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplitMenuColorContainer.h; sourceTree = "<group>"; };
|
||||
6967B4791E27C52700A129E2 /* UnknownRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownRecord.h; sourceTree = "<group>"; };
|
||||
6967B47A1E27C52700A129E2 /* OleObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OleObject.cpp; sourceTree = "<group>"; };
|
||||
6967B47B1E27C52700A129E2 /* OleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OleObject.h; sourceTree = "<group>"; };
|
||||
6967B47C1E27C52700A129E2 /* OleObjectMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OleObjectMapping.h; sourceTree = "<group>"; };
|
||||
@ -312,6 +239,71 @@
|
||||
6967B4C01E27C52700A129E2 /* WordDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordDocument.h; sourceTree = "<group>"; };
|
||||
6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WordprocessingDocument.cpp; sourceTree = "<group>"; };
|
||||
6967B4C21E27C52700A129E2 /* WordprocessingDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordprocessingDocument.h; sourceTree = "<group>"; };
|
||||
8A1BC11122DF348F0084799E /* ClientAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientAnchor.h; sourceTree = "<group>"; };
|
||||
8A1BC11222DF34900084799E /* ShapeTypeFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeTypeFactory.h; sourceTree = "<group>"; };
|
||||
8A1BC11322DF34900084799E /* OfficeArtClientTextbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtClientTextbox.h; sourceTree = "<group>"; };
|
||||
8A1BC11422DF34900084799E /* DiagramBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagramBooleanProperties.h; sourceTree = "<group>"; };
|
||||
8A1BC11522DF34900084799E /* MetafilePictBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetafilePictBlip.h; sourceTree = "<group>"; };
|
||||
8A1BC11622DF34900084799E /* ShapeTypeFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShapeTypeFactory.cpp; sourceTree = "<group>"; };
|
||||
8A1BC11722DF34900084799E /* DrawingContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC11822DF34900084799E /* UnknownRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownRecord.h; sourceTree = "<group>"; };
|
||||
8A1BC11922DF34900084799E /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
|
||||
8A1BC11A22DF34900084799E /* BitmapBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapBlip.h; sourceTree = "<group>"; };
|
||||
8A1BC11B22DF34910084799E /* OfficeArtFRITContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtFRITContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC11C22DF34910084799E /* DrawingGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroup.h; sourceTree = "<group>"; };
|
||||
8A1BC11D22DF34910084799E /* ShapeContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC11E22DF34910084799E /* ShapeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeType.h; sourceTree = "<group>"; };
|
||||
8A1BC12022DF34910084799E /* PlaqueType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaqueType.h; sourceTree = "<group>"; };
|
||||
8A1BC12122DF34910084799E /* CubeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeType.h; sourceTree = "<group>"; };
|
||||
8A1BC12222DF34910084799E /* LightningBoltType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LightningBoltType.h; sourceTree = "<group>"; };
|
||||
8A1BC12322DF34910084799E /* OvalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OvalType.h; sourceTree = "<group>"; };
|
||||
8A1BC12422DF34910084799E /* CalloutsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalloutsType.h; sourceTree = "<group>"; };
|
||||
8A1BC12522DF34910084799E /* TextboxType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextboxType.h; sourceTree = "<group>"; };
|
||||
8A1BC12622DF34910084799E /* HexagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonType.h; sourceTree = "<group>"; };
|
||||
8A1BC12722DF34910084799E /* NoSmokingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoSmokingType.h; sourceTree = "<group>"; };
|
||||
8A1BC12822DF34910084799E /* OctagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OctagonType.h; sourceTree = "<group>"; };
|
||||
8A1BC12922DF34910084799E /* ArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArcType.h; sourceTree = "<group>"; };
|
||||
8A1BC12A22DF34910084799E /* CanType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanType.h; sourceTree = "<group>"; };
|
||||
8A1BC12B22DF34910084799E /* PictureFrameType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureFrameType.h; sourceTree = "<group>"; };
|
||||
8A1BC12C22DF34910084799E /* BevelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BevelType.h; sourceTree = "<group>"; };
|
||||
8A1BC12D22DF34910084799E /* MoonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoonType.h; sourceTree = "<group>"; };
|
||||
8A1BC12E22DF34910084799E /* FoldedCornerlType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldedCornerlType.h; sourceTree = "<group>"; };
|
||||
8A1BC12F22DF34910084799E /* PentagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PentagonType.h; sourceTree = "<group>"; };
|
||||
8A1BC13022DF34910084799E /* BracketsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BracketsType.h; sourceTree = "<group>"; };
|
||||
8A1BC13122DF34910084799E /* IsoscelesTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoscelesTriangleType.h; sourceTree = "<group>"; };
|
||||
8A1BC13222DF34910084799E /* StarType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarType.h; sourceTree = "<group>"; };
|
||||
8A1BC13322DF34910084799E /* DonutType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DonutType.h; sourceTree = "<group>"; };
|
||||
8A1BC13422DF34910084799E /* RectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectangleType.h; sourceTree = "<group>"; };
|
||||
8A1BC13522DF34910084799E /* TrapezoidType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrapezoidType.h; sourceTree = "<group>"; };
|
||||
8A1BC13622DF34910084799E /* ArrowType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowType.h; sourceTree = "<group>"; };
|
||||
8A1BC13722DF34910084799E /* SmileyFaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmileyFaceType.h; sourceTree = "<group>"; };
|
||||
8A1BC13822DF34910084799E /* PlusType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlusType.h; sourceTree = "<group>"; };
|
||||
8A1BC13922DF34910084799E /* RightTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightTriangleType.h; sourceTree = "<group>"; };
|
||||
8A1BC13A22DF34910084799E /* HeartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeartType.h; sourceTree = "<group>"; };
|
||||
8A1BC13B22DF34910084799E /* SunType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SunType.h; sourceTree = "<group>"; };
|
||||
8A1BC13C22DF34910084799E /* Connector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
|
||||
8A1BC13D22DF34910084799E /* RoundedRectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangleType.h; sourceTree = "<group>"; };
|
||||
8A1BC13E22DF34910084799E /* BlockArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockArcType.h; sourceTree = "<group>"; };
|
||||
8A1BC13F22DF34910084799E /* WordArtText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordArtText.h; sourceTree = "<group>"; };
|
||||
8A1BC14022DF34910084799E /* FlowChartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlowChartType.h; sourceTree = "<group>"; };
|
||||
8A1BC14122DF34910084799E /* LineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineType.h; sourceTree = "<group>"; };
|
||||
8A1BC14222DF34910084799E /* DiamondType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiamondType.h; sourceTree = "<group>"; };
|
||||
8A1BC14322DF34910084799E /* ParallelogramType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelogramType.h; sourceTree = "<group>"; };
|
||||
8A1BC14422DF34910084799E /* ClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientData.h; sourceTree = "<group>"; };
|
||||
8A1BC14522DF34910084799E /* GroupShapeRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeRecord.h; sourceTree = "<group>"; };
|
||||
8A1BC14622DF34910084799E /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shape.h; sourceTree = "<group>"; };
|
||||
8A1BC14722DF34910084799E /* BlipStoreEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreEntry.h; sourceTree = "<group>"; };
|
||||
8A1BC14822DF34920084799E /* DrawingGroupRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroupRecord.h; sourceTree = "<group>"; };
|
||||
8A1BC14922DF34920084799E /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
|
||||
8A1BC14A22DF34920084799E /* SplitMenuColorContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplitMenuColorContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC14B22DF34920084799E /* ShapeOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeOptions.h; sourceTree = "<group>"; };
|
||||
8A1BC14C22DF34920084799E /* RegularContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegularContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC14D22DF34920084799E /* BlipStoreContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC14E22DF34920084799E /* RecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordFactory.h; sourceTree = "<group>"; };
|
||||
8A1BC14F22DF34920084799E /* DrawingRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingRecord.h; sourceTree = "<group>"; };
|
||||
8A1BC15022DF34920084799E /* GroupContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupContainer.h; sourceTree = "<group>"; };
|
||||
8A1BC15122DF34920084799E /* ChildAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildAnchor.h; sourceTree = "<group>"; };
|
||||
8A1BC15222DF34920084799E /* RecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecordFactory.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -541,87 +533,79 @@
|
||||
6967B42F1E27C52700A129E2 /* OfficeDrawing */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6967B4301E27C52700A129E2 /* BitmapBlip.h */,
|
||||
6967B4311E27C52700A129E2 /* BlipStoreContainer.h */,
|
||||
6967B4321E27C52700A129E2 /* BlipStoreEntry.h */,
|
||||
6967B4331E27C52700A129E2 /* ChildAnchor.h */,
|
||||
6967B4341E27C52700A129E2 /* ClientAnchor.h */,
|
||||
6967B4351E27C52700A129E2 /* ClientData.h */,
|
||||
6967B4361E27C52700A129E2 /* DiagramBooleanProperties.h */,
|
||||
6967B4371E27C52700A129E2 /* DrawingContainer.h */,
|
||||
6967B4381E27C52700A129E2 /* DrawingGroup.h */,
|
||||
6967B4391E27C52700A129E2 /* DrawingGroupRecord.h */,
|
||||
6967B43A1E27C52700A129E2 /* DrawingRecord.h */,
|
||||
6967B43B1E27C52700A129E2 /* FillStyleBooleanProperties.h */,
|
||||
6967B43C1E27C52700A129E2 /* GeometryBooleanProperties.h */,
|
||||
6967B43D1E27C52700A129E2 /* GeometryTextBooleanProperties.h */,
|
||||
6967B43E1E27C52700A129E2 /* GroupContainer.h */,
|
||||
6967B43F1E27C52700A129E2 /* GroupShapeBooleanProperties.h */,
|
||||
6967B4401E27C52700A129E2 /* GroupShapeRecord.h */,
|
||||
6967B4411E27C52700A129E2 /* LineStyleBooleanProperties.h */,
|
||||
6967B4421E27C52700A129E2 /* MetafilePictBlip.h */,
|
||||
6967B4431E27C52700A129E2 /* OfficeArtClientTextbox.h */,
|
||||
6967B4441E27C52700A129E2 /* PathParser.h */,
|
||||
6967B4451E27C52700A129E2 /* PathSegment.h */,
|
||||
6967B4461E27C52700A129E2 /* ProtectionBooleanProperties.h */,
|
||||
6967B4471E27C52700A129E2 /* Record.cpp */,
|
||||
6967B4481E27C52700A129E2 /* Record.h */,
|
||||
6967B4491E27C52700A129E2 /* RecordFactory.cpp */,
|
||||
6967B44A1E27C52700A129E2 /* RecordFactory.h */,
|
||||
6967B44B1E27C52700A129E2 /* RegularContainer.h */,
|
||||
6967B44C1E27C52700A129E2 /* ShadowStyleBooleanProperties.h */,
|
||||
6967B44D1E27C52700A129E2 /* Shape.h */,
|
||||
6967B44E1E27C52700A129E2 /* ShapeContainer.h */,
|
||||
6967B44F1E27C52700A129E2 /* ShapeOptions.h */,
|
||||
6967B4501E27C52700A129E2 /* ShapeType.h */,
|
||||
6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */,
|
||||
6967B4521E27C52700A129E2 /* ShapeTypeFactory.h */,
|
||||
6967B4531E27C52700A129E2 /* Shapetypes */,
|
||||
6967B4781E27C52700A129E2 /* SplitMenuColorContainer.h */,
|
||||
6967B4791E27C52700A129E2 /* UnknownRecord.h */,
|
||||
8A1BC11A22DF34900084799E /* BitmapBlip.h */,
|
||||
8A1BC14D22DF34920084799E /* BlipStoreContainer.h */,
|
||||
8A1BC14722DF34910084799E /* BlipStoreEntry.h */,
|
||||
8A1BC15122DF34920084799E /* ChildAnchor.h */,
|
||||
8A1BC11122DF348F0084799E /* ClientAnchor.h */,
|
||||
8A1BC14422DF34910084799E /* ClientData.h */,
|
||||
8A1BC11422DF34900084799E /* DiagramBooleanProperties.h */,
|
||||
8A1BC11722DF34900084799E /* DrawingContainer.h */,
|
||||
8A1BC11C22DF34910084799E /* DrawingGroup.h */,
|
||||
8A1BC14822DF34920084799E /* DrawingGroupRecord.h */,
|
||||
8A1BC14F22DF34920084799E /* DrawingRecord.h */,
|
||||
8A1BC15022DF34920084799E /* GroupContainer.h */,
|
||||
8A1BC14522DF34910084799E /* GroupShapeRecord.h */,
|
||||
8A1BC11522DF34900084799E /* MetafilePictBlip.h */,
|
||||
8A1BC11322DF34900084799E /* OfficeArtClientTextbox.h */,
|
||||
8A1BC11B22DF34910084799E /* OfficeArtFRITContainer.h */,
|
||||
8A1BC14922DF34920084799E /* Record.cpp */,
|
||||
8A1BC11922DF34900084799E /* Record.h */,
|
||||
8A1BC15222DF34920084799E /* RecordFactory.cpp */,
|
||||
8A1BC14E22DF34920084799E /* RecordFactory.h */,
|
||||
8A1BC14C22DF34920084799E /* RegularContainer.h */,
|
||||
8A1BC14622DF34910084799E /* Shape.h */,
|
||||
8A1BC11D22DF34910084799E /* ShapeContainer.h */,
|
||||
8A1BC14B22DF34920084799E /* ShapeOptions.h */,
|
||||
8A1BC11E22DF34910084799E /* ShapeType.h */,
|
||||
8A1BC11622DF34900084799E /* ShapeTypeFactory.cpp */,
|
||||
8A1BC11222DF34900084799E /* ShapeTypeFactory.h */,
|
||||
8A1BC11F22DF34910084799E /* Shapetypes */,
|
||||
8A1BC14A22DF34920084799E /* SplitMenuColorContainer.h */,
|
||||
8A1BC11822DF34900084799E /* UnknownRecord.h */,
|
||||
);
|
||||
path = OfficeDrawing;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6967B4531E27C52700A129E2 /* Shapetypes */ = {
|
||||
8A1BC11F22DF34910084799E /* Shapetypes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6967B4541E27C52700A129E2 /* ArcType.h */,
|
||||
6967B4551E27C52700A129E2 /* ArrowType.h */,
|
||||
6967B4561E27C52700A129E2 /* BevelType.h */,
|
||||
6967B4571E27C52700A129E2 /* BlockArcType.h */,
|
||||
6967B4581E27C52700A129E2 /* BracketsType.h */,
|
||||
6967B4591E27C52700A129E2 /* CalloutsType.h */,
|
||||
6967B45A1E27C52700A129E2 /* CanType.h */,
|
||||
6967B45B1E27C52700A129E2 /* Connector.h */,
|
||||
6967B45C1E27C52700A129E2 /* CubeType.h */,
|
||||
6967B45D1E27C52700A129E2 /* DiamondType.h */,
|
||||
6967B45E1E27C52700A129E2 /* DonutType.h */,
|
||||
6967B45F1E27C52700A129E2 /* FlowChartType.h */,
|
||||
6967B4601E27C52700A129E2 /* FoldedCornerlType.h */,
|
||||
6967B4611E27C52700A129E2 /* HeartType.h */,
|
||||
6967B4621E27C52700A129E2 /* HexagonType.h */,
|
||||
6967B4631E27C52700A129E2 /* IsoscelesTriangleType.h */,
|
||||
6967B4641E27C52700A129E2 /* LightningBoltType.h */,
|
||||
6967B4651E27C52700A129E2 /* LineType.h */,
|
||||
6967B4661E27C52700A129E2 /* MoonType.h */,
|
||||
6967B4671E27C52700A129E2 /* NoSmokingType.h */,
|
||||
6967B4681E27C52700A129E2 /* OctagonType.h */,
|
||||
6967B4691E27C52700A129E2 /* OvalType.h */,
|
||||
6967B46A1E27C52700A129E2 /* ParallelogramType.h */,
|
||||
6967B46B1E27C52700A129E2 /* PentagonType.h */,
|
||||
6967B46C1E27C52700A129E2 /* PictureFrameType.h */,
|
||||
6967B46D1E27C52700A129E2 /* PlaqueType.h */,
|
||||
6967B46E1E27C52700A129E2 /* PlusType.h */,
|
||||
6967B46F1E27C52700A129E2 /* RectangleType.h */,
|
||||
6967B4701E27C52700A129E2 /* RightTriangleType.h */,
|
||||
6967B4711E27C52700A129E2 /* RoundedRectangleType.h */,
|
||||
6967B4721E27C52700A129E2 /* SmileyFaceType.h */,
|
||||
6967B4731E27C52700A129E2 /* StarType.h */,
|
||||
6967B4741E27C52700A129E2 /* SunType.h */,
|
||||
6967B4751E27C52700A129E2 /* TextboxType.h */,
|
||||
6967B4761E27C52700A129E2 /* TrapezoidType.h */,
|
||||
6967B4771E27C52700A129E2 /* WordArtText.h */,
|
||||
8A1BC12022DF34910084799E /* PlaqueType.h */,
|
||||
8A1BC12122DF34910084799E /* CubeType.h */,
|
||||
8A1BC12222DF34910084799E /* LightningBoltType.h */,
|
||||
8A1BC12322DF34910084799E /* OvalType.h */,
|
||||
8A1BC12422DF34910084799E /* CalloutsType.h */,
|
||||
8A1BC12522DF34910084799E /* TextboxType.h */,
|
||||
8A1BC12622DF34910084799E /* HexagonType.h */,
|
||||
8A1BC12722DF34910084799E /* NoSmokingType.h */,
|
||||
8A1BC12822DF34910084799E /* OctagonType.h */,
|
||||
8A1BC12922DF34910084799E /* ArcType.h */,
|
||||
8A1BC12A22DF34910084799E /* CanType.h */,
|
||||
8A1BC12B22DF34910084799E /* PictureFrameType.h */,
|
||||
8A1BC12C22DF34910084799E /* BevelType.h */,
|
||||
8A1BC12D22DF34910084799E /* MoonType.h */,
|
||||
8A1BC12E22DF34910084799E /* FoldedCornerlType.h */,
|
||||
8A1BC12F22DF34910084799E /* PentagonType.h */,
|
||||
8A1BC13022DF34910084799E /* BracketsType.h */,
|
||||
8A1BC13122DF34910084799E /* IsoscelesTriangleType.h */,
|
||||
8A1BC13222DF34910084799E /* StarType.h */,
|
||||
8A1BC13322DF34910084799E /* DonutType.h */,
|
||||
8A1BC13422DF34910084799E /* RectangleType.h */,
|
||||
8A1BC13522DF34910084799E /* TrapezoidType.h */,
|
||||
8A1BC13622DF34910084799E /* ArrowType.h */,
|
||||
8A1BC13722DF34910084799E /* SmileyFaceType.h */,
|
||||
8A1BC13822DF34910084799E /* PlusType.h */,
|
||||
8A1BC13922DF34910084799E /* RightTriangleType.h */,
|
||||
8A1BC13A22DF34910084799E /* HeartType.h */,
|
||||
8A1BC13B22DF34910084799E /* SunType.h */,
|
||||
8A1BC13C22DF34910084799E /* Connector.h */,
|
||||
8A1BC13D22DF34910084799E /* RoundedRectangleType.h */,
|
||||
8A1BC13E22DF34910084799E /* BlockArcType.h */,
|
||||
8A1BC13F22DF34910084799E /* WordArtText.h */,
|
||||
8A1BC14022DF34910084799E /* FlowChartType.h */,
|
||||
8A1BC14122DF34910084799E /* LineType.h */,
|
||||
8A1BC14222DF34910084799E /* DiamondType.h */,
|
||||
8A1BC14322DF34910084799E /* ParallelogramType.h */,
|
||||
);
|
||||
path = Shapetypes;
|
||||
sourceTree = "<group>";
|
||||
@ -667,6 +651,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 6967B2E21E27C23A00A129E2;
|
||||
@ -687,7 +672,6 @@
|
||||
6967B4D11E27C52700A129E2 /* LanguageIdMapping.cpp in Sources */,
|
||||
6967B4E61E27C52700A129E2 /* SinglePropertyModifier.cpp in Sources */,
|
||||
6967B4C91E27C52700A129E2 /* EncryptionHeader.cpp in Sources */,
|
||||
6967B4D71E27C52700A129E2 /* Record.cpp in Sources */,
|
||||
6967B4ED1E27C52700A129E2 /* TableMapping.cpp in Sources */,
|
||||
6967B4F31E27C52700A129E2 /* VMLShapeTypeMapping.cpp in Sources */,
|
||||
6967B4E31E27C52700A129E2 /* RevisionData.cpp in Sources */,
|
||||
@ -699,18 +683,18 @@
|
||||
6967B4E21E27C52700A129E2 /* PropertyExceptions.cpp in Sources */,
|
||||
6967B4C31E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp in Sources */,
|
||||
6967B4D31E27C52700A129E2 /* ListLevel.cpp in Sources */,
|
||||
8A1BC15322DF34920084799E /* ShapeTypeFactory.cpp in Sources */,
|
||||
6967B4CB1E27C52700A129E2 /* FontTableMapping.cpp in Sources */,
|
||||
6967B4EC1E27C52700A129E2 /* TableCellPropertiesMapping.cpp in Sources */,
|
||||
6967B4D81E27C52700A129E2 /* RecordFactory.cpp in Sources */,
|
||||
6967B4C61E27C52700A129E2 /* DocumentMapping.cpp in Sources */,
|
||||
6967B4CA1E27C52700A129E2 /* FontFamilyName.cpp in Sources */,
|
||||
6967B4F21E27C52700A129E2 /* VMLShapeMapping.cpp in Sources */,
|
||||
6967B4C71E27C52700A129E2 /* DocumentProperties.cpp in Sources */,
|
||||
6967B4EF1E27C52700A129E2 /* TableRowPropertiesMapping.cpp in Sources */,
|
||||
8A1BC15422DF34920084799E /* Record.cpp in Sources */,
|
||||
6967B4E01E27C52700A129E2 /* PieceTable.cpp in Sources */,
|
||||
6967B4E81E27C52700A129E2 /* StyleSheet.cpp in Sources */,
|
||||
6967B4EA1E27C52700A129E2 /* StyleSheetInformation.cpp in Sources */,
|
||||
6967B4D91E27C52700A129E2 /* ShapeTypeFactory.cpp in Sources */,
|
||||
6967B4D01E27C52700A129E2 /* HeaderMapping.cpp in Sources */,
|
||||
6967B4DA1E27C52700A129E2 /* OleObject.cpp in Sources */,
|
||||
6967B4D61E27C52700A129E2 /* NumberingMapping.cpp in Sources */,
|
||||
@ -724,6 +708,7 @@
|
||||
6967B4C51E27C52700A129E2 /* Converter.cpp in Sources */,
|
||||
6967B4E91E27C52700A129E2 /* StyleSheetDescription.cpp in Sources */,
|
||||
6967B4E41E27C52700A129E2 /* SectionPropertiesMapping.cpp in Sources */,
|
||||
8A1BC15522DF34920084799E /* RecordFactory.cpp in Sources */,
|
||||
6967B4EE1E27C52700A129E2 /* TablePropertiesMapping.cpp in Sources */,
|
||||
6967B4D51E27C52700A129E2 /* MainDocumentMapping.cpp in Sources */,
|
||||
6967B4E51E27C52700A129E2 /* SettingsMapping.cpp in Sources */,
|
||||
@ -835,16 +820,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 2WH24U26GJ;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
USE_ATL_CSTRING,
|
||||
_USE_LIBXML2_READER_,
|
||||
LIBXML_READER_ENABLED,
|
||||
_IOS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
@ -866,16 +841,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = 2WH24U26GJ;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
USE_ATL_CSTRING,
|
||||
_USE_LIBXML2_READER_,
|
||||
LIBXML_READER_ENABLED,
|
||||
_IOS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
|
||||
@ -41,6 +41,8 @@ namespace Writers
|
||||
static std::wstring g_string_comment_End = _T("</w:comments>");
|
||||
static std::wstring g_string_commentExt_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:commentsEx xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
|
||||
static std::wstring g_string_commentExt_End = _T("</w15:commentsEx>");
|
||||
static std::wstring g_string_commentsIds_Start = _T("<w16cid:commentsIds mc:Ignorable=\"w16cid\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\">");
|
||||
static std::wstring g_string_commentsIds_End = _T("</w16cid:commentsIds>");
|
||||
static std::wstring g_string_people_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:people xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
|
||||
static std::wstring g_string_people_End = _T("</w15:people>");
|
||||
|
||||
@ -50,21 +52,25 @@ namespace Writers
|
||||
public:
|
||||
std::wstring m_sComment;
|
||||
std::wstring m_sCommentExt;
|
||||
std::wstring m_sCommentsIds;
|
||||
std::wstring m_sPeople;
|
||||
std::wstring m_sDocumentComment;
|
||||
std::wstring m_sDocumentCommentExt;
|
||||
std::wstring m_sDocumentCommentsIds;
|
||||
std::wstring m_sDocumentPeople;
|
||||
|
||||
CommentsWriter(std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentPeople)
|
||||
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sCommentsIds, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentCommentsIds, std::wstring& sDocumentPeople)
|
||||
{
|
||||
m_sComment = sComment;
|
||||
m_sCommentExt = sCommentExt;
|
||||
m_sCommentsIds = sCommentsIds;
|
||||
m_sPeople = sPeople;
|
||||
m_sDocumentComment = sDocumentComment;
|
||||
m_sDocumentCommentExt = sDocumentCommentExt;
|
||||
m_sDocumentCommentsIds = sDocumentCommentsIds;
|
||||
m_sDocumentPeople = sDocumentPeople;
|
||||
}
|
||||
void Write()
|
||||
@ -90,6 +96,15 @@ namespace Writers
|
||||
oFile.WriteStringUTF8(g_string_commentExt_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
if(false == m_sCommentsIds.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(sDir + OOX::FileTypes::CommentsIds.DefaultFileName().GetPath());
|
||||
oFile.WriteStringUTF8(g_string_commentsIds_Start);
|
||||
oFile.WriteStringUTF8(m_sCommentsIds);
|
||||
oFile.WriteStringUTF8(g_string_commentsIds_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
if(false == m_sPeople.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
@ -120,6 +135,15 @@ namespace Writers
|
||||
oFile.WriteStringUTF8(g_string_commentExt_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
if(false == m_sDocumentCommentsIds.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentCommentsIds.DefaultFileName().GetPath());
|
||||
oFile.WriteStringUTF8(g_string_commentsIds_Start);
|
||||
oFile.WriteStringUTF8(m_sDocumentCommentsIds);
|
||||
oFile.WriteStringUTF8(g_string_commentsIds_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
if(false == m_sDocumentPeople.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
|
||||
@ -62,6 +62,8 @@ public:
|
||||
std::wstring pgBorders;
|
||||
std::wstring footnotePr;
|
||||
std::wstring endnotePr;
|
||||
bool RtlGutter;
|
||||
long Gutter;
|
||||
|
||||
bool bW;
|
||||
bool bH;
|
||||
@ -76,6 +78,8 @@ public:
|
||||
bool bEvenAndOddHeaders;
|
||||
bool bSectionType;
|
||||
bool bPageNumStart;
|
||||
bool bRtlGutter;
|
||||
bool bGutter;
|
||||
SectPr()
|
||||
{
|
||||
sHeaderFooterReference = _T("");
|
||||
@ -94,6 +98,7 @@ public:
|
||||
bEvenAndOddHeaders = false;
|
||||
bSectionType = false;
|
||||
bPageNumStart = false;
|
||||
bRtlGutter = false;
|
||||
}
|
||||
std::wstring Write()
|
||||
{
|
||||
@ -152,7 +157,9 @@ public:
|
||||
sRes += L" w:header=\"" + std::to_wstring(Header) + L"\"";
|
||||
if(bFooter)
|
||||
sRes += L" w:footer=\"" + std::to_wstring(Footer) + L"\"";
|
||||
sRes += L" w:gutter=\"0\"/>";
|
||||
if(bGutter)
|
||||
sRes += L" w:gutter=\"" + std::to_wstring(Gutter) + L"\"";
|
||||
sRes += L"/>";
|
||||
}
|
||||
if(!pgBorders.empty())
|
||||
sRes += pgBorders;
|
||||
@ -160,6 +167,14 @@ public:
|
||||
if(bPageNumStart)
|
||||
sRes += L"<w:pgNumType w:start=\"" + std::to_wstring(PageNumStart) + L"\"/>";
|
||||
|
||||
if(bRtlGutter)
|
||||
{
|
||||
if(RtlGutter)
|
||||
sRes += L"<w:rtlGutter/>";
|
||||
else
|
||||
sRes += L"<w:rtlGutter w:val=\"0\"/>";
|
||||
}
|
||||
|
||||
if(!cols.empty())
|
||||
sRes += cols;
|
||||
sRes += L"<w:docGrid w:linePitch=\"360\"/>";
|
||||
@ -1481,14 +1496,25 @@ public:
|
||||
std::wstring sFormat;
|
||||
switch(Format)
|
||||
{
|
||||
case numbering_numfmt_None:sFormat = _T("none");break;
|
||||
case numbering_numfmt_Bullet:sFormat = _T("bullet");break;
|
||||
case numbering_numfmt_Decimal:sFormat = _T("decimal");break;
|
||||
case numbering_numfmt_LowerRoman:sFormat = _T("lowerRoman");break;
|
||||
case numbering_numfmt_UpperRoman:sFormat = _T("upperRoman");break;
|
||||
case numbering_numfmt_LowerLetter:sFormat = _T("lowerLetter");break;
|
||||
case numbering_numfmt_UpperLetter:sFormat = _T("upperLetter");break;
|
||||
case numbering_numfmt_DecimalZero:sFormat = _T("decimalZero");break;
|
||||
case numbering_numfmt_None: sFormat = L"none"; break;
|
||||
case numbering_numfmt_Bullet: sFormat = L"bullet"; break;
|
||||
case numbering_numfmt_Decimal: sFormat = L"decimal"; break;
|
||||
case numbering_numfmt_LowerRoman: sFormat = L"lowerRoman"; break;
|
||||
case numbering_numfmt_UpperRoman: sFormat = L"upperRoman"; break;
|
||||
case numbering_numfmt_LowerLetter: sFormat = L"lowerLetter"; break;
|
||||
case numbering_numfmt_UpperLetter: sFormat = L"upperLetter"; break;
|
||||
case numbering_numfmt_DecimalZero: sFormat = L"decimalZero"; break;
|
||||
default:
|
||||
{
|
||||
Format -= 0x2008;
|
||||
if (Format >= 0)
|
||||
{
|
||||
SimpleTypes::CNumberFormat<> numFormat;
|
||||
numFormat.SetValue((SimpleTypes::ENumberFormat)Format);
|
||||
|
||||
sFormat = numFormat.ToString();
|
||||
}
|
||||
}break;
|
||||
}
|
||||
if(!sFormat.empty())
|
||||
{
|
||||
@ -1876,10 +1902,13 @@ public:
|
||||
int IdOpen;
|
||||
int IdFormat;
|
||||
std::wstring UserName;
|
||||
std::wstring Initials;
|
||||
std::wstring UserId;
|
||||
std::wstring ProviderId;
|
||||
std::wstring Date;
|
||||
std::wstring OOData;
|
||||
bool Solved;
|
||||
unsigned int DurableId;
|
||||
std::wstring Text;
|
||||
std::wstring m_sParaId;
|
||||
std::wstring m_sParaIdParent;
|
||||
@ -1888,12 +1917,14 @@ public:
|
||||
bool bIdOpen;
|
||||
bool bIdFormat;
|
||||
bool bSolved;
|
||||
bool bDurableId;
|
||||
public:
|
||||
CComment(IdCounter& oParaIdCounter, IdCounter& oFormatIdCounter):m_oParaIdCounter(oParaIdCounter),m_oFormatIdCounter(oFormatIdCounter)
|
||||
{
|
||||
bIdOpen = false;
|
||||
bIdFormat = false;
|
||||
bSolved = false;
|
||||
bDurableId = false;
|
||||
}
|
||||
~CComment()
|
||||
{
|
||||
@ -1930,15 +1961,6 @@ public:
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
std::wstring writeTemplates(bool isExt)
|
||||
{
|
||||
std::wstring sRes;
|
||||
sRes += isExt ? writeContentExt(this) : writeContent(this);
|
||||
|
||||
for(size_t i = 0; i < replies.size(); ++i)
|
||||
sRes += isExt ? writeContentExt(replies[i]) : writeContent(replies[i]);
|
||||
return sRes;
|
||||
}
|
||||
static std::wstring writeRef(CComment* pComment, const std::wstring& sBefore, const std::wstring& sRef, const std::wstring& sAfter)
|
||||
{
|
||||
std::wstring sRes;
|
||||
@ -1952,7 +1974,7 @@ public:
|
||||
sRes += (sAfter);
|
||||
return sRes;
|
||||
}
|
||||
static bool writeContentWritePart(CComment* pComment, std::wstring& sText, int nPrevIndex, int nCurIndex, bool bFirst, std::wstring& sRes)
|
||||
static void writeContentWritePart(CComment* pComment, std::wstring& sText, int nPrevIndex, int nCurIndex, std::wstring& sRes)
|
||||
{
|
||||
std::wstring sPart;
|
||||
if(nPrevIndex < nCurIndex)
|
||||
@ -1960,17 +1982,11 @@ public:
|
||||
|
||||
int nId = pComment->m_oParaIdCounter.getNextId();
|
||||
|
||||
std::wstring sId = XmlUtils::IntToString(nId, L"%08X");
|
||||
if(bFirst)
|
||||
{
|
||||
bFirst = false;
|
||||
pComment->m_sParaId = sId;
|
||||
}
|
||||
sRes += L"<w:p w14:paraId=\"" + sId + L"\" w14:textId=\"" + sId + L"\">";
|
||||
pComment->m_sParaId = XmlUtils::IntToString(nId, L"%08X");
|
||||
sRes += L"<w:p w14:paraId=\"" + pComment->m_sParaId + L"\" w14:textId=\"" + pComment->m_sParaId + L"\">";
|
||||
sRes += L"<w:pPr><w:spacing w:line=\"240\" w:after=\"0\" w:lineRule=\"auto\" w:before=\"0\"/><w:ind w:firstLine=\"0\" w:left=\"0\" w:right=\"0\"/><w:jc w:val=\"left\"/></w:pPr><w:r><w:rPr><w:rFonts w:eastAsia=\"Arial\" w:ascii=\"Arial\" w:hAnsi=\"Arial\" w:cs=\"Arial\"/><w:sz w:val=\"22\"/></w:rPr><w:t xml:space=\"preserve\">";
|
||||
sRes += sPart;
|
||||
sRes += L"</w:t></w:r></w:p>";
|
||||
return bFirst;
|
||||
}
|
||||
static std::wstring writeContent(CComment* pComment)
|
||||
{
|
||||
@ -1981,22 +1997,12 @@ public:
|
||||
pComment->IdFormat = pComment->m_oFormatIdCounter.getNextId();
|
||||
}
|
||||
sRes += L"<w:comment w:id=\"" + std::to_wstring(pComment->IdFormat) + L"\"";
|
||||
std::wstring sInitials;
|
||||
if(false == pComment->UserName.empty())
|
||||
{
|
||||
std::wstring sUserName = XmlUtils::EncodeXmlString(pComment->UserName);
|
||||
sRes += L" w:author=\"";
|
||||
sRes += (sUserName);
|
||||
sRes += L"\"";
|
||||
//делаем initials
|
||||
std::vector<std::wstring> arSplit;
|
||||
boost::algorithm::split(arSplit, pComment->UserName, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
for (size_t i = 0; i < arSplit.size(); i++)
|
||||
{
|
||||
sInitials += arSplit[i][0];
|
||||
}
|
||||
|
||||
sRes += L"\"";
|
||||
}
|
||||
if(false == pComment->Date.empty())
|
||||
{
|
||||
@ -2012,11 +2018,10 @@ public:
|
||||
sRes += sData;
|
||||
sRes += L"\"";
|
||||
}
|
||||
if(false == sInitials.empty())
|
||||
if(false == pComment->Initials.empty())
|
||||
{
|
||||
sInitials = XmlUtils::EncodeXmlString(sInitials);
|
||||
sRes += L" w:initials=\"";
|
||||
sRes += sInitials;
|
||||
sRes += XmlUtils::EncodeXmlString(pComment->Initials);
|
||||
sRes += L"\"";
|
||||
}
|
||||
sRes += L">";
|
||||
@ -2024,18 +2029,17 @@ public:
|
||||
|
||||
XmlUtils::replace_all(sText, L"\r", L"");
|
||||
|
||||
bool bFirst = true;
|
||||
int nPrevIndex = 0;
|
||||
for (int i = 0; i < (int)sText.length(); i++)
|
||||
{
|
||||
wchar_t cToken = sText[i];
|
||||
if('\n' == cToken)
|
||||
{
|
||||
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, i, sRes);
|
||||
nPrevIndex = i + 1;
|
||||
}
|
||||
}
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), sRes);
|
||||
sRes += L"</w:comment>";
|
||||
return sRes;
|
||||
}
|
||||
@ -2058,18 +2062,32 @@ w15:paraIdParent=\"" + pComment->m_sParaIdParent + L"\" w15:done=\"" + sDone + L
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
static std::wstring writeContentsIds(CComment* pComment)
|
||||
{
|
||||
std::wstring sRes;
|
||||
if(!pComment->m_sParaId.empty() && pComment->bDurableId)
|
||||
{
|
||||
sRes += L"<w16cid:commentId w16cid:paraId=\"" + pComment->m_sParaId + L"\" w16cid:durableId=\"" + XmlUtils::IntToString(pComment->DurableId, L"%08X") + L"\"/>";
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
static std::wstring writePeople(CComment* pComment)
|
||||
{
|
||||
std::wstring sRes;
|
||||
if(false == pComment->UserName.empty() && false == pComment->UserId.empty())
|
||||
if(false == pComment->UserName.empty())
|
||||
{
|
||||
std::wstring sUserName = XmlUtils::EncodeXmlString(pComment->UserName);
|
||||
std::wstring sUserId = XmlUtils::EncodeXmlString(pComment->UserId);
|
||||
sRes += L"<w15:person w15:author=\"";
|
||||
sRes += sUserName;
|
||||
sRes += L"\"><w15:presenceInfo w15:providerId=\"Teamlab\" w15:userId=\"";
|
||||
sRes += sUserId;
|
||||
sRes += L"\"/></w15:person>";
|
||||
sRes += XmlUtils::EncodeXmlString(pComment->UserName);
|
||||
sRes += L"\">";
|
||||
if(!pComment->ProviderId.empty() && !pComment->UserId.empty())
|
||||
{
|
||||
sRes += L"<w15:presenceInfo w15:providerId=\"";
|
||||
sRes += XmlUtils::EncodeXmlString(pComment->ProviderId);
|
||||
sRes += L"\" w15:userId=\"";
|
||||
sRes += XmlUtils::EncodeXmlString(pComment->UserId);
|
||||
sRes += L"\"/>";
|
||||
}
|
||||
sRes += L"</w15:person>";
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
@ -2125,7 +2143,9 @@ public:
|
||||
std::wstring sRes;
|
||||
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
|
||||
{
|
||||
sRes += it->second->writeTemplates(false);
|
||||
sRes += CComment::writeContent(it->second);
|
||||
for(size_t i = 0; i < it->second->replies.size(); ++i)
|
||||
sRes += CComment::writeContent(it->second->replies[i]);
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
@ -2134,7 +2154,20 @@ public:
|
||||
std::wstring sRes;
|
||||
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
|
||||
{
|
||||
sRes += it->second->writeTemplates(true);
|
||||
sRes += CComment::writeContentExt(it->second);
|
||||
for(size_t i = 0; i < it->second->replies.size(); ++i)
|
||||
sRes += CComment::writeContentExt(it->second->replies[i]);
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
std::wstring writeContentsIds()
|
||||
{
|
||||
std::wstring sRes;
|
||||
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
|
||||
{
|
||||
sRes += CComment::writeContentsIds(it->second);
|
||||
for(size_t i = 0; i < it->second->replies.size(); ++i)
|
||||
sRes += CComment::writeContentsIds(it->second->replies[i]);
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
|
||||
@ -58,6 +58,11 @@
|
||||
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
|
||||
#define UINT_TO_COMPLEX_BOOL(offset, val) \
|
||||
if (0 != ((nFlags >> offset) & 1)) { \
|
||||
val.Init(); \
|
||||
}
|
||||
|
||||
namespace BinDocxRW {
|
||||
|
||||
enum ETblStyleOverrideType
|
||||
@ -1397,6 +1402,11 @@ int Binary_pPrReader::Read_SecPr(BYTE type, long length, void* poResult)
|
||||
READ1_DEF(length, res, this->ReadEndnotePr, &oEdnProps);
|
||||
pSectPr->endnotePr = oEdnProps.toXML();
|
||||
}
|
||||
else if( c_oSerProp_secPrType::rtlGutter == type )
|
||||
{
|
||||
pSectPr->bRtlGutter = true;
|
||||
pSectPr->RtlGutter = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -1592,6 +1602,11 @@ int Binary_pPrReader::Read_pgMar(BYTE type, long length, void* poResult)
|
||||
pSectPr->bFooter = true;
|
||||
pSectPr->Footer = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::GutterTwips == type )
|
||||
{
|
||||
pSectPr->bGutter = true;
|
||||
pSectPr->Gutter = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3364,11 +3379,20 @@ int Binary_CommentsTableReader::ReadCommentContent(BYTE type, long length, void*
|
||||
std::wstring UserName(m_oBufferedStream.GetString3(length));
|
||||
pComment->UserName = UserName;
|
||||
}
|
||||
else if ( c_oSer_CommentsType::Initials == type )
|
||||
{
|
||||
pComment->Initials = m_oBufferedStream.GetString3(length);
|
||||
}
|
||||
else if ( c_oSer_CommentsType::UserId == type )
|
||||
{
|
||||
std::wstring UserId(m_oBufferedStream.GetString3(length));
|
||||
pComment->UserId = UserId;
|
||||
}
|
||||
else if ( c_oSer_CommentsType::ProviderId == type )
|
||||
{
|
||||
std::wstring ProviderId(m_oBufferedStream.GetString3(length));
|
||||
pComment->ProviderId = ProviderId;
|
||||
}
|
||||
else if ( c_oSer_CommentsType::Date == type )
|
||||
{
|
||||
std::wstring Date(m_oBufferedStream.GetString3(length));
|
||||
@ -3389,6 +3413,11 @@ int Binary_CommentsTableReader::ReadCommentContent(BYTE type, long length, void*
|
||||
pComment->bSolved = true;
|
||||
pComment->Solved = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if ( c_oSer_CommentsType::DurableId == type )
|
||||
{
|
||||
pComment->bDurableId = true;
|
||||
pComment->DurableId = m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSer_CommentsType::Replies == type )
|
||||
{
|
||||
READ1_DEF(length, res, this->ReadReplies, &pComment->replies);
|
||||
@ -3518,6 +3547,50 @@ int Binary_SettingsTableReader::ReadSettings(BYTE type, long length, void* poRes
|
||||
std::wstring sListSeparator = m_oBufferedStream.GetString3(length);
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:listSeparator w:val=\"" + XmlUtils::EncodeXmlString(sListSeparator) + L"\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::GutterAtTop == type )
|
||||
{
|
||||
bool bGutterAtTop = m_oBufferedStream.GetBool();
|
||||
if (bGutterAtTop)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:gutterAtTop/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:gutterAtTop w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::MirrorMargins == type )
|
||||
{
|
||||
bool bMirrorMargins = m_oBufferedStream.GetBool();
|
||||
if (bMirrorMargins)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:mirrorMargins/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:mirrorMargins w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::PrintTwoOnOne == type )
|
||||
{
|
||||
bool bPrintTwoOnOne = m_oBufferedStream.GetBool();
|
||||
if (bPrintTwoOnOne)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:printTwoOnOne/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:printTwoOnOne w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::BookFoldPrinting == type )
|
||||
{
|
||||
bool bBookFoldPrinting = m_oBufferedStream.GetBool();
|
||||
if (bBookFoldPrinting)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldPrinting/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldPrinting w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::BookFoldPrintingSheets == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldPrintingSheets w:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::BookFoldRevPrinting == type )
|
||||
{
|
||||
bool bBookFoldRevPrinting = m_oBufferedStream.GetBool();
|
||||
if (bBookFoldRevPrinting)
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldRevPrinting/>");
|
||||
else
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:bookFoldRevPrinting w:val=\"0\"/>");
|
||||
}
|
||||
else if( c_oSer_SettingsType::SdtGlobalColor == type )
|
||||
{
|
||||
rPr oRPr(m_oFileWriter.m_oFontTableWriter.m_mapFonts);
|
||||
@ -3530,10 +3603,127 @@ int Binary_SettingsTableReader::ReadSettings(BYTE type, long length, void* poRes
|
||||
m_oSettingsCustom.m_oSdtGlobalShowHighlight.Init();
|
||||
m_oSettingsCustom.m_oSdtGlobalShowHighlight->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if( c_oSer_SettingsType::Compat == type )
|
||||
{
|
||||
OOX::Settings::CCompat oCompat;
|
||||
READ1_DEF(length, res, this->ReadCompat, &oCompat);
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(oCompat.toXML());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
};
|
||||
};
|
||||
int Binary_SettingsTableReader::ReadCompat(BYTE type, long length, void* poResult)
|
||||
{
|
||||
OOX::Settings::CCompat* pCompat = static_cast<OOX::Settings::CCompat*>(poResult);
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
if( c_oSerCompat::CompatSetting == type )
|
||||
{
|
||||
OOX::Settings::CCompatSetting* pCCompatSetting = new OOX::Settings::CCompatSetting();
|
||||
READ1_DEF(length, res, this->ReadCompatSetting, pCCompatSetting);
|
||||
pCompat->m_arrCompatSettings.push_back(pCCompatSetting);
|
||||
}
|
||||
else if( c_oSerCompat::Flags1 == type )
|
||||
{
|
||||
_UINT32 nFlags = m_oBufferedStream.GetULong();
|
||||
UINT_TO_COMPLEX_BOOL(0, pCompat->m_oUseSingleBorderforContiguousCells);
|
||||
UINT_TO_COMPLEX_BOOL(1, pCompat->m_oWpJustification);
|
||||
UINT_TO_COMPLEX_BOOL(2, pCompat->m_oNoTabHangInd);
|
||||
UINT_TO_COMPLEX_BOOL(3, pCompat->m_oNoLeading);
|
||||
UINT_TO_COMPLEX_BOOL(4, pCompat->m_oSpaceForUL);
|
||||
UINT_TO_COMPLEX_BOOL(5, pCompat->m_oNoColumnBalance);
|
||||
UINT_TO_COMPLEX_BOOL(6, pCompat->m_oBalanceSingleByteDoubleByteWidth);
|
||||
UINT_TO_COMPLEX_BOOL(7, pCompat->m_oNoExtraLineSpacing);
|
||||
UINT_TO_COMPLEX_BOOL(8, pCompat->m_oDoNotLeaveBackslashAlone);
|
||||
UINT_TO_COMPLEX_BOOL(9, pCompat->m_oUlTrailSpace);
|
||||
UINT_TO_COMPLEX_BOOL(10, pCompat->m_oDoNotExpandShiftReturn);
|
||||
UINT_TO_COMPLEX_BOOL(11, pCompat->m_oSpacingInWholePoints);
|
||||
UINT_TO_COMPLEX_BOOL(12, pCompat->m_oLineWrapLikeWord6);
|
||||
UINT_TO_COMPLEX_BOOL(13, pCompat->m_oPrintBodyTextBeforeHeader);
|
||||
UINT_TO_COMPLEX_BOOL(14, pCompat->m_oPrintColBlack);
|
||||
UINT_TO_COMPLEX_BOOL(15, pCompat->m_oWpSpaceWidth);
|
||||
UINT_TO_COMPLEX_BOOL(16, pCompat->m_oShowBreaksInFrames);
|
||||
UINT_TO_COMPLEX_BOOL(17, pCompat->m_oSubFontBySize);
|
||||
UINT_TO_COMPLEX_BOOL(18, pCompat->m_oSuppressBottomSpacing);
|
||||
UINT_TO_COMPLEX_BOOL(19, pCompat->m_oSuppressTopSpacing);
|
||||
UINT_TO_COMPLEX_BOOL(20, pCompat->m_oSuppressSpacingAtTopOfPage);
|
||||
UINT_TO_COMPLEX_BOOL(21, pCompat->m_oSuppressTopSpacingWP);
|
||||
UINT_TO_COMPLEX_BOOL(22, pCompat->m_oSuppressSpBfAfterPgBrk);
|
||||
UINT_TO_COMPLEX_BOOL(23, pCompat->m_oSwapBordersFacingPages);
|
||||
UINT_TO_COMPLEX_BOOL(24, pCompat->m_oConvMailMergeEsc);
|
||||
UINT_TO_COMPLEX_BOOL(25, pCompat->m_oTruncateFontHeightsLikeWP6);
|
||||
UINT_TO_COMPLEX_BOOL(26, pCompat->m_oMwSmallCaps);
|
||||
UINT_TO_COMPLEX_BOOL(27, pCompat->m_oUsePrinterMetrics);
|
||||
UINT_TO_COMPLEX_BOOL(28, pCompat->m_oDoNotSuppressParagraphBorders);
|
||||
UINT_TO_COMPLEX_BOOL(29, pCompat->m_oWrapTrailSpaces);
|
||||
UINT_TO_COMPLEX_BOOL(30, pCompat->m_oFootnoteLayoutLikeWW8);
|
||||
UINT_TO_COMPLEX_BOOL(31, pCompat->m_oShapeLayoutLikeWW8);
|
||||
}
|
||||
else if( c_oSerCompat::Flags2 == type )
|
||||
{
|
||||
_UINT32 nFlags = m_oBufferedStream.GetULong();
|
||||
UINT_TO_COMPLEX_BOOL(0, pCompat->m_oAlignTablesRowByRow);
|
||||
UINT_TO_COMPLEX_BOOL(1, pCompat->m_oForgetLastTabAlignment);
|
||||
UINT_TO_COMPLEX_BOOL(2, pCompat->m_oAdjustLineHeightInTable);
|
||||
UINT_TO_COMPLEX_BOOL(3, pCompat->m_oAutoSpaceLikeWord95);
|
||||
UINT_TO_COMPLEX_BOOL(4, pCompat->m_oNoSpaceRaiseLower);
|
||||
UINT_TO_COMPLEX_BOOL(5, pCompat->m_oDoNotUseHTMLParagraphAutoSpacing);
|
||||
UINT_TO_COMPLEX_BOOL(6, pCompat->m_oLayoutRawTableWidth);
|
||||
UINT_TO_COMPLEX_BOOL(7, pCompat->m_oLayoutTableRowsApart);
|
||||
UINT_TO_COMPLEX_BOOL(8, pCompat->m_oUseWord97LineBreakRules);
|
||||
UINT_TO_COMPLEX_BOOL(9, pCompat->m_oDoNotBreakWrappedTables);
|
||||
UINT_TO_COMPLEX_BOOL(10, pCompat->m_oDoNotSnapToGridInCell);
|
||||
UINT_TO_COMPLEX_BOOL(11, pCompat->m_oSelectFldWithFirstOrLastChar);
|
||||
UINT_TO_COMPLEX_BOOL(12, pCompat->m_oApplyBreakingRules);
|
||||
UINT_TO_COMPLEX_BOOL(13, pCompat->m_oDoNotWrapTextWithPunct);
|
||||
UINT_TO_COMPLEX_BOOL(14, pCompat->m_oDoNotUseEastAsianBreakRules);
|
||||
UINT_TO_COMPLEX_BOOL(15, pCompat->m_oUseWord2002TableStyleRules);
|
||||
UINT_TO_COMPLEX_BOOL(16, pCompat->m_oGrowAutofit);
|
||||
UINT_TO_COMPLEX_BOOL(17, pCompat->m_oUseFELayout);
|
||||
UINT_TO_COMPLEX_BOOL(18, pCompat->m_oUseNormalStyleForList);
|
||||
UINT_TO_COMPLEX_BOOL(19, pCompat->m_oDoNotUseIndentAsNumberingTabStop);
|
||||
UINT_TO_COMPLEX_BOOL(20, pCompat->m_oUseAltKinsokuLineBreakRules);
|
||||
UINT_TO_COMPLEX_BOOL(21, pCompat->m_oAllowSpaceOfSameStyleInTable);
|
||||
UINT_TO_COMPLEX_BOOL(22, pCompat->m_oDoNotSuppressIndentation);
|
||||
UINT_TO_COMPLEX_BOOL(23, pCompat->m_oDoNotAutofitConstrainedTables);
|
||||
UINT_TO_COMPLEX_BOOL(24, pCompat->m_oAutofitToFirstFixedWidthCell);
|
||||
UINT_TO_COMPLEX_BOOL(25, pCompat->m_oUnderlineTabInNumList);
|
||||
UINT_TO_COMPLEX_BOOL(26, pCompat->m_oDisplayHangulFixedWidth);
|
||||
UINT_TO_COMPLEX_BOOL(27, pCompat->m_oSplitPgBreakAndParaMark);
|
||||
UINT_TO_COMPLEX_BOOL(28, pCompat->m_oDoNotVertAlignCellWithSp);
|
||||
UINT_TO_COMPLEX_BOOL(29, pCompat->m_oDoNotBreakConstrainedForcedTable);
|
||||
UINT_TO_COMPLEX_BOOL(30, pCompat->m_oDoNotVertAlignInTxbx);
|
||||
UINT_TO_COMPLEX_BOOL(31, pCompat->m_oUseAnsiKerningPairs);
|
||||
}
|
||||
else if( c_oSerCompat::Flags3 == type )
|
||||
{
|
||||
_UINT32 nFlags = m_oBufferedStream.GetULong();
|
||||
UINT_TO_COMPLEX_BOOL(0, pCompat->m_oCachedColBalance);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int Binary_SettingsTableReader::ReadCompatSetting(BYTE type, long length, void* poResult)
|
||||
{
|
||||
OOX::Settings::CCompatSetting* pCompatSetting = static_cast<OOX::Settings::CCompatSetting*>(poResult);
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
if( c_oSerCompat::CompatName == type )
|
||||
{
|
||||
pCompatSetting->m_sName = m_oBufferedStream.GetString3(length);
|
||||
}
|
||||
else if( c_oSerCompat::CompatUri == type )
|
||||
{
|
||||
pCompatSetting->m_sUri = m_oBufferedStream.GetString3(length);
|
||||
}
|
||||
else if( c_oSerCompat::CompatValue == type )
|
||||
{
|
||||
pCompatSetting->m_sVal = m_oBufferedStream.GetString3(length);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int Binary_SettingsTableReader::ReadFootnotePr(BYTE type, long length, void* poResult)
|
||||
{
|
||||
OOX::Settings::CFtnDocProps* pFtnProps = static_cast<OOX::Settings::CFtnDocProps*>(poResult);
|
||||
@ -4182,15 +4372,15 @@ int Binary_DocumentTableReader::ReadParagraphContent(BYTE type, long length, voi
|
||||
}
|
||||
else if ( c_oSerParType::OMathPara == type )
|
||||
{
|
||||
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMathPara>")));
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("<m:oMathPara>")));
|
||||
READ1_DEF(length, res, this->ReadMathOMathPara, poResult);
|
||||
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMathPara>")));
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("</m:oMathPara>")));
|
||||
}
|
||||
else if ( c_oSerParType::OMath == type )
|
||||
{
|
||||
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMath>")));
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("<m:oMath>")));
|
||||
READ1_DEF(length, res, this->ReadMathArg, poResult);
|
||||
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMath>")));
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("</m:oMath>")));
|
||||
}
|
||||
else if ( c_oSerParType::MRun == type )
|
||||
{
|
||||
@ -9052,13 +9242,15 @@ int BinaryFileReader::ReadMainTable()
|
||||
|
||||
std::wstring sContent = oComments.writeContent();
|
||||
std::wstring sContentEx = oComments.writeContentExt(); //важно чтобы writeContentExt вызывался после writeContent
|
||||
std::wstring sContentsId = oComments.writeContentsIds();
|
||||
std::wstring sPeople = oComments.writePeople();
|
||||
|
||||
std::wstring sDocumentContent = oBinary_DocumentCommentsTableReader.m_oComments.writeContent();
|
||||
std::wstring sDocumentContentEx = oBinary_DocumentCommentsTableReader.m_oComments.writeContentExt(); //важно чтобы writeContentExt вызывался после writeContent
|
||||
std::wstring sDocumentContentsId = oBinary_DocumentCommentsTableReader.m_oComments.writeContentsIds();
|
||||
std::wstring sDocumentPeople = oBinary_DocumentCommentsTableReader.m_oComments.writePeople();
|
||||
|
||||
oCommentsWriter.setElements(sContent, sContentEx, sPeople, sDocumentContent, sDocumentContentEx, sDocumentPeople);
|
||||
oCommentsWriter.setElements(sContent, sContentEx, sContentsId, sPeople, sDocumentContent, sDocumentContentEx, sDocumentContentsId, sDocumentPeople);
|
||||
|
||||
if(false == oCommentsWriter.m_sComment.empty())
|
||||
{
|
||||
@ -9072,6 +9264,12 @@ int BinaryFileReader::ReadMainTable()
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::CommentsExt.RelationType(), OOX::FileTypes::CommentsExt.DefaultFileName().GetPath(), std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::CommentsExt.OverrideType(), L"/word", OOX::FileTypes::CommentsExt.DefaultFileName().GetPath());
|
||||
}
|
||||
if(false == oCommentsWriter.m_sCommentsIds.empty())
|
||||
{
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::CommentsIds.RelationType(), OOX::FileTypes::CommentsIds.DefaultFileName().GetPath(), std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::CommentsIds.OverrideType(), L"/word", OOX::FileTypes::CommentsIds.DefaultFileName().GetPath());
|
||||
}
|
||||
if(false == oCommentsWriter.m_sPeople.empty())
|
||||
{
|
||||
unsigned int rId;
|
||||
@ -9090,6 +9288,12 @@ int BinaryFileReader::ReadMainTable()
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::DocumentCommentsExt.RelationType(), OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath(), std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::DocumentCommentsExt.OverrideType(), L"/word", OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath());
|
||||
}
|
||||
if(false == oCommentsWriter.m_sDocumentCommentsIds.empty())
|
||||
{
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::DocumentCommentsIds.RelationType(), OOX::FileTypes::DocumentCommentsIds.DefaultFileName().GetPath(), std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::DocumentCommentsIds.OverrideType(), L"/word", OOX::FileTypes::DocumentCommentsIds.DefaultFileName().GetPath());
|
||||
}
|
||||
if(false == oCommentsWriter.m_sDocumentPeople.empty())
|
||||
{
|
||||
unsigned int rId;
|
||||
|
||||
@ -247,6 +247,8 @@ public:
|
||||
Binary_SettingsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, OOX::CSettingsCustom& oSettingsCustom);
|
||||
int Read();
|
||||
int ReadSettings(BYTE type, long length, void* poResult);
|
||||
int ReadCompat(BYTE type, long length, void* poResult);
|
||||
int ReadCompatSetting(BYTE type, long length, void* poResult);
|
||||
int ReadFootnotePr(BYTE type, long length, void* poResult);
|
||||
int ReadEndnotePr(BYTE type, long length, void* poResult);
|
||||
int ReadMathPr(BYTE type, long length, void* poResult);
|
||||
|
||||
@ -37,14 +37,14 @@
|
||||
namespace Writers
|
||||
{
|
||||
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
|
||||
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults>");
|
||||
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults>");
|
||||
static std::wstring g_string_set_End = _T("</w:settings>");
|
||||
|
||||
class SettingWriter
|
||||
{
|
||||
std::wstring m_sDir;
|
||||
NSStringUtils::CStringBuilder m_oSettingWriter;
|
||||
HeaderFooterWriter& m_oHeaderFooterWriter;
|
||||
std::wstring m_sDir;
|
||||
NSStringUtils::CStringBuilder m_oSettingWriter;
|
||||
HeaderFooterWriter& m_oHeaderFooterWriter;
|
||||
public:
|
||||
SettingWriter(std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir),m_oHeaderFooterWriter(oHeaderFooterWriter)
|
||||
{
|
||||
|
||||
@ -467,7 +467,8 @@ extern int g_nCurFormatVersion;
|
||||
cols = 8,
|
||||
pgBorders = 9,
|
||||
footnotePr = 10,
|
||||
endnotePr = 11
|
||||
endnotePr = 11,
|
||||
rtlGutter = 12
|
||||
};}
|
||||
namespace c_oSerProp_secPrSettingsType{enum c_oSerProp_secPrSettingsType
|
||||
{
|
||||
@ -506,7 +507,8 @@ extern int g_nCurFormatVersion;
|
||||
JsaProject = 22,
|
||||
BookmarkStart = 23,
|
||||
BookmarkEnd = 24,
|
||||
MRun = 25
|
||||
MRun = 25,
|
||||
AltChunk = 26
|
||||
};}
|
||||
namespace c_oSerDocTableType{enum c_oSerDocTableType
|
||||
{
|
||||
@ -782,7 +784,8 @@ extern int g_nCurFormatVersion;
|
||||
RightTwips = 8,
|
||||
BottomTwips = 9,
|
||||
HeaderTwips = 10,
|
||||
FooterTwips = 11
|
||||
FooterTwips = 11,
|
||||
GutterTwips = 12
|
||||
};}
|
||||
namespace c_oSer_ColorType{enum c_oSer_ColorType
|
||||
{
|
||||
@ -801,7 +804,9 @@ extern int g_nCurFormatVersion;
|
||||
QuoteText = 7,
|
||||
Solved = 8,
|
||||
Replies = 9,
|
||||
OOData = 10
|
||||
OOData = 10,
|
||||
DurableId = 11,
|
||||
ProviderId = 12
|
||||
};}
|
||||
namespace c_oSer_SettingsType{enum c_oSer_SettingsType
|
||||
{
|
||||
@ -816,7 +821,13 @@ extern int g_nCurFormatVersion;
|
||||
Compat = 8,
|
||||
DefaultTabStopTwips = 9,
|
||||
DecimalSymbol = 10,
|
||||
ListSeparator = 11
|
||||
ListSeparator = 11,
|
||||
GutterAtTop = 12,
|
||||
MirrorMargins = 13,
|
||||
PrintTwoOnOne = 14,
|
||||
BookFoldPrinting = 15,
|
||||
BookFoldPrintingSheets = 16,
|
||||
BookFoldRevPrinting = 17
|
||||
};}
|
||||
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
|
||||
{
|
||||
@ -1212,7 +1223,10 @@ extern int g_nCurFormatVersion;
|
||||
CompatSetting = 0,
|
||||
CompatName = 1,
|
||||
CompatUri = 2,
|
||||
CompatValue = 3
|
||||
CompatValue = 3,
|
||||
Flags1 = 4,
|
||||
Flags2 = 5,
|
||||
Flags3 = 6
|
||||
};}
|
||||
}
|
||||
|
||||
|
||||
@ -33,6 +33,8 @@
|
||||
|
||||
#include "../DocWrapper/FontProcessor.h"
|
||||
#include "../../Common/Base64.h"
|
||||
#include "../../Common/OfficeFileFormatChecker.h"
|
||||
|
||||
#include "../../ASCOfficePPTXFile/Editor/FontCutter.h"
|
||||
#include "../../ASCOfficePPTXFile/PPTXFormat/App.h"
|
||||
#include "../../ASCOfficePPTXFile/PPTXFormat/Core.h"
|
||||
@ -40,6 +42,16 @@
|
||||
#include "BinEquationWriter.h"
|
||||
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
#ifndef _IOS
|
||||
#include "../../ASCOfficeDocFile/DocFormatLib/DocFormatLib.h"
|
||||
#endif
|
||||
#include "../../ASCOfficeRtfFile/RtfFormatLib/source/ConvertationManager.h"
|
||||
|
||||
|
||||
#define COMPLEX_BOOL_TO_UINT(offset, val) \
|
||||
if(val.IsInit()) { \
|
||||
nFlags |= (val->m_oVal.ToBool() ? 1 : 0) << offset; \
|
||||
}
|
||||
|
||||
namespace BinDocxRW
|
||||
{
|
||||
@ -1313,6 +1325,12 @@ void Binary_pPrWriter::WriteSectPr (OOX::Logic::CSectionProperty* pSectPr)
|
||||
NULL, &pSectPr->m_oEndnotePr->m_oPos, NULL);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(pSectPr->m_oRtlGutter.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_secPrType::rtlGutter);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(pSectPr->m_oRtlGutter->m_oVal.ToBool());
|
||||
}
|
||||
}
|
||||
void Binary_pPrWriter::WritePageSettings(OOX::Logic::CSectionProperty* pSectPr)
|
||||
{
|
||||
@ -1411,6 +1429,12 @@ void Binary_pPrWriter::WritePageMargin(OOX::Logic::CSectionProperty* pSectPr)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oFooter->ToTwips());
|
||||
}
|
||||
if(pMar.m_oGutter.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::GutterTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oGutter->ToTwips());
|
||||
}
|
||||
}
|
||||
}
|
||||
void Binary_pPrWriter::WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr, std::vector<ComplexTypes::Word::CHdrFtrRef*>& aRefs, bool bHdr)
|
||||
@ -2757,15 +2781,16 @@ void BinaryNumberingTableWriter::WriteLevel(const OOX::Numbering::CLvl& lvl)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
switch(oNumberFormat.GetValue())
|
||||
{
|
||||
case SimpleTypes::numberformatNone: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_None);break;
|
||||
case SimpleTypes::numberformatBullet: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Bullet);break;
|
||||
case SimpleTypes::numberformatDecimal: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Decimal);break;
|
||||
case SimpleTypes::numberformatLowerRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerRoman);break;
|
||||
case SimpleTypes::numberformatUpperRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperRoman);break;
|
||||
case SimpleTypes::numberformatLowerLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerLetter);break;
|
||||
case SimpleTypes::numberformatUpperLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperLetter);break;
|
||||
case SimpleTypes::numberformatDecimalZero: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_DecimalZero);break;
|
||||
default: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Decimal);break;
|
||||
case SimpleTypes::numberformatNone: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_None);break;
|
||||
case SimpleTypes::numberformatBullet: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Bullet);break;
|
||||
case SimpleTypes::numberformatDecimal: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_Decimal);break;
|
||||
case SimpleTypes::numberformatLowerRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerRoman);break;
|
||||
case SimpleTypes::numberformatUpperRoman: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperRoman);break;
|
||||
case SimpleTypes::numberformatLowerLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_LowerLetter);break;
|
||||
case SimpleTypes::numberformatUpperLetter: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_UpperLetter);break;
|
||||
case SimpleTypes::numberformatDecimalZero: m_oBcw.m_oStream.WriteLONG(numbering_numfmt_DecimalZero);break;
|
||||
default:
|
||||
m_oBcw.m_oStream.WriteLONG(oNumberFormat.GetValue() + 0x2008);break; //max our numbering
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3028,10 +3053,25 @@ void BinaryDocumentTableWriter::WriteDocumentContent(const std::vector<OOX::Writ
|
||||
|
||||
switch(item->getType())
|
||||
{
|
||||
case OOX::et_w_altChunk:
|
||||
{
|
||||
OOX::Logic::CAltChunk* pAltChunk = static_cast<OOX::Logic::CAltChunk*>(item);
|
||||
if (pAltChunk->m_oId.IsInit())
|
||||
{
|
||||
OOX::Rels::CRelationShip* oRels = NULL;
|
||||
smart_ptr<OOX::File> pFile = m_oParamsDocumentWriter.m_pRels->Find( OOX::RId(pAltChunk->m_oId.get().GetValue()));
|
||||
if (pFile.IsInit() && OOX::FileTypes::Media == pFile->type())
|
||||
{
|
||||
OOX::Media* pAltChunkFile = static_cast<OOX::Media*>(pFile.operator ->());
|
||||
|
||||
WriteAltChunk(*pAltChunkFile);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::et_w_p:
|
||||
{
|
||||
OOX::Logic::CParagraph* pParagraph = static_cast<OOX::Logic::CParagraph*>(item);
|
||||
OOX::Logic::CParagraphProperty* pPr = pParagraph->m_oParagraphProperty;
|
||||
OOX::Logic::CParagraph* pParagraph = static_cast<OOX::Logic::CParagraph*>(item);
|
||||
OOX::Logic::CParagraphProperty* pPr = pParagraph->m_oParagraphProperty;
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerParType::Par);
|
||||
nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
@ -3178,6 +3218,68 @@ void BinaryDocumentTableWriter::WriteBackground (OOX::Logic::CBackground* pBackg
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
void BinaryDocumentTableWriter::WriteAltChunk(OOX::Media& oAltChunkFile)
|
||||
{
|
||||
if (false == oAltChunkFile.IsExist()) return;
|
||||
|
||||
|
||||
std::wstring file_name_inp = oAltChunkFile.filename().GetPath();
|
||||
|
||||
std::wstring sTempDir = NSDirectory::CreateDirectoryWithUniqueName(oAltChunkFile.filename().GetDirectory());
|
||||
std::wstring sResultDocxDir = NSDirectory::CreateDirectoryWithUniqueName(oAltChunkFile.filename().GetDirectory());
|
||||
|
||||
bool result = false;
|
||||
|
||||
COfficeFileFormatChecker OfficeFileFormatChecker;
|
||||
if (OfficeFileFormatChecker.isOfficeFile(file_name_inp))
|
||||
{
|
||||
switch(OfficeFileFormatChecker.nFileType)
|
||||
{
|
||||
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX:
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM:
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX:
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM:
|
||||
{
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
result = (S_OK == oCOfficeUtils.ExtractToDirectory(file_name_inp, sResultDocxDir, NULL, 0));
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
NSDirectory::DeleteDirectory(sTempDir);
|
||||
|
||||
if (result)
|
||||
{
|
||||
OOX::CDocx oDocx = OOX::CDocx(OOX::CPath(sResultDocxDir));
|
||||
|
||||
if (oDocx.m_pDocument)
|
||||
{
|
||||
ParamsDocumentWriter oParamsDocumentWriterEmb(oDocx.m_pDocument);
|
||||
|
||||
ParamsWriter oParamsWriterEmb( m_oParamsWriter.m_pCBufferedStream,
|
||||
m_oParamsWriter.m_pFontProcessor,
|
||||
m_oParamsWriter.m_pOfficeDrawingConverter,
|
||||
m_oParamsWriter.m_pEmbeddedFontsManager);
|
||||
|
||||
oParamsWriterEmb.m_poTheme = oDocx.m_pTheme;
|
||||
oParamsWriterEmb.m_oSettings = oDocx.m_pSettings;
|
||||
oParamsWriterEmb.m_pCurRels = oParamsDocumentWriterEmb.m_pRels;
|
||||
|
||||
BinaryDocumentTableWriter oBinaryDocumentEmbTableWriter(oParamsWriterEmb, oParamsDocumentWriterEmb, &oParamsWriterEmb.m_mapIgnoreComments, NULL);
|
||||
|
||||
//*oBufferedStream.m_pTheme = smart_ptr<PPTX::Theme>(oDocx.m_pTheme);
|
||||
//oBufferedStream.m_pTheme->AddRef();
|
||||
|
||||
//if(NULL != oDocx.m_pFontTable)
|
||||
// m_oParamsWriter.m_pFontProcessor->setFontTable(oDocx.m_pFontTable);
|
||||
oBinaryDocumentEmbTableWriter.WriteDocumentContent(oDocx.m_pDocument->m_arrItems);
|
||||
}
|
||||
}
|
||||
NSDirectory::DeleteDirectory(sResultDocxDir);
|
||||
}
|
||||
|
||||
void BinaryDocumentTableWriter::WriteParapraph(OOX::Logic::CParagraph& par, OOX::Logic::CParagraphProperty* pPr)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
@ -7317,17 +7419,16 @@ void BinaryDocumentTableWriter::WriteDropDownList(const OOX::Logic::CSdtDropDown
|
||||
BinaryCommentsTableWriter::BinaryCommentsTableWriter(ParamsWriter& oParamsWriter):m_oBcw(oParamsWriter)
|
||||
{
|
||||
};
|
||||
void BinaryCommentsTableWriter::Write(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, std::map<int, bool>& mapIgnoreComments)
|
||||
void BinaryCommentsTableWriter::Write(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments)
|
||||
{
|
||||
int nStart = m_oBcw.WriteItemWithLengthStart();
|
||||
WriteCommentsContent(oComments, pCommentsExt, pPeople, mapIgnoreComments);
|
||||
WriteCommentsContent(oComments, pCommentsExt, pPeople, pCommentsIds, mapIgnoreComments);
|
||||
m_oBcw.WriteItemWithLengthEnd(nStart);
|
||||
}
|
||||
void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, std::map<int, bool>& mapIgnoreComments)
|
||||
void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments)
|
||||
{
|
||||
std::map<std::wstring, std::wstring> mapAuthorToUserId;
|
||||
std::map<int, CCommentWriteTemp*> mapParaIdToComment;
|
||||
std::map<int, bool> mapCommentsIgnore;
|
||||
std::map<std::wstring, OOX::CPerson*> mapAuthorToUserId;
|
||||
std::map<unsigned int, CCommentWriteTemp*> mapParaIdToComment;
|
||||
std::vector<CCommentWriteTemp*> aCommentsToWrite;
|
||||
//map author -> userId
|
||||
if(NULL != pPeople)
|
||||
@ -7335,8 +7436,8 @@ void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments,
|
||||
for(size_t i = 0, length = pPeople->m_arrPeoples.size(); i < length; i++)
|
||||
{
|
||||
OOX::CPerson* pPerson = pPeople->m_arrPeoples[i];
|
||||
if(NULL != pPerson && pPerson->m_oAuthor.IsInit() && pPerson->m_oPresenceInfo.IsInit() && pPerson->m_oPresenceInfo->m_oProviderId.IsInit() && _T("Teamlab") == pPerson->m_oPresenceInfo->m_oProviderId.get2() && pPerson->m_oPresenceInfo->m_oUserId.IsInit())
|
||||
mapAuthorToUserId[pPerson->m_oAuthor.get2()] = pPerson->m_oPresenceInfo->m_oUserId.get2();
|
||||
if(NULL != pPerson && pPerson->m_oAuthor.IsInit())
|
||||
mapAuthorToUserId[pPerson->m_oAuthor.get2()] = pPerson;
|
||||
}
|
||||
}
|
||||
//map paraId -> CCommentWriteTemp
|
||||
@ -7347,9 +7448,22 @@ void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments,
|
||||
pNewCommentWriteTemp->pComment = pComment;
|
||||
if(pComment->m_oAuthor.IsInit())
|
||||
{
|
||||
std::map<std::wstring, std::wstring>::const_iterator pPair = mapAuthorToUserId.find(pComment->m_oAuthor.get2());
|
||||
std::map<std::wstring, OOX::CPerson*>::const_iterator pPair = mapAuthorToUserId.find(pComment->m_oAuthor.get2());
|
||||
if(mapAuthorToUserId.end() != pPair)
|
||||
pNewCommentWriteTemp->sUserId = pPair->second;
|
||||
{
|
||||
OOX::CPerson* pPerson = pPair->second;
|
||||
if(pPerson->m_oPresenceInfo.IsInit())
|
||||
{
|
||||
if(pPerson->m_oPresenceInfo->m_oUserId.IsInit())
|
||||
{
|
||||
pNewCommentWriteTemp->sUserId = pPerson->m_oPresenceInfo->m_oUserId.get();
|
||||
}
|
||||
if(pPerson->m_oPresenceInfo->m_oProviderId.IsInit())
|
||||
{
|
||||
pNewCommentWriteTemp->sProviderId = pPerson->m_oPresenceInfo->m_oProviderId.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(std::vector<OOX::WritingElement*>::iterator jt = pComment->m_arrItems.begin(); jt != pComment->m_arrItems.end(); jt++)
|
||||
{
|
||||
@ -7372,7 +7486,7 @@ void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments,
|
||||
OOX::CCommentExt* pCommentExt = pCommentsExt->m_arrComments[i];
|
||||
if(pCommentExt->m_oParaId.IsInit())
|
||||
{
|
||||
std::map<int, CCommentWriteTemp*>::const_iterator pPair = mapParaIdToComment.find(pCommentExt->m_oParaId->GetValue());
|
||||
std::map<unsigned int, CCommentWriteTemp*>::const_iterator pPair = mapParaIdToComment.find(pCommentExt->m_oParaId->GetValue());
|
||||
if(mapParaIdToComment.end() != pPair)
|
||||
{
|
||||
CCommentWriteTemp* pCommentWriteTemp = pPair->second;
|
||||
@ -7381,8 +7495,8 @@ void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments,
|
||||
pCommentWriteTemp->bDone = pCommentExt->m_oDone->ToBool();
|
||||
if(pCommentExt->m_oParaIdParent.IsInit())
|
||||
{
|
||||
int nParaIdParent = pCommentExt->m_oParaIdParent->GetValue();
|
||||
std::map<int, CCommentWriteTemp*>::const_iterator pPairParent = mapParaIdToComment.find(nParaIdParent);
|
||||
unsigned int nParaIdParent = pCommentExt->m_oParaIdParent->GetValue();
|
||||
std::map<unsigned int, CCommentWriteTemp*>::const_iterator pPairParent = mapParaIdToComment.find(nParaIdParent);
|
||||
if(mapParaIdToComment.end() != pPairParent)
|
||||
{
|
||||
CCommentWriteTemp* pCommentWriteTempParent = pPairParent->second;
|
||||
@ -7395,7 +7509,22 @@ void BinaryCommentsTableWriter::WriteCommentsContent(OOX::CComments& oComments,
|
||||
}
|
||||
}
|
||||
}
|
||||
int nCurPos = 0;
|
||||
if(NULL != pCommentsIds)
|
||||
{
|
||||
for(size_t i = 0, length = pCommentsIds->m_arrComments.size(); i < length; i++)
|
||||
{
|
||||
OOX::CCommentId* pCommentId = pCommentsIds->m_arrComments[i];
|
||||
if(pCommentId->m_oParaId.IsInit() && pCommentId->m_oDurableId.IsInit())
|
||||
{
|
||||
std::map<unsigned int, CCommentWriteTemp*>::const_iterator pPair = mapParaIdToComment.find(pCommentId->m_oParaId->GetValue());
|
||||
if(mapParaIdToComment.end() != pPair)
|
||||
{
|
||||
CCommentWriteTemp* pCommentWriteTemp = pPair->second;
|
||||
pCommentWriteTemp->nDurableId = pCommentId->m_oDurableId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(size_t i = 0, length = aCommentsToWrite.size(); i < length; ++i)
|
||||
{
|
||||
@ -7451,12 +7580,30 @@ void BinaryCommentsTableWriter::WriteComment(CCommentWriteTemp& oComment)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_CommentsType::UserId);
|
||||
m_oBcw.m_oStream.WriteStringW(oComment.sUserId.get2());
|
||||
}
|
||||
if(oComment.sProviderId.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_CommentsType::ProviderId);
|
||||
m_oBcw.m_oStream.WriteStringW(oComment.sProviderId.get2());
|
||||
}
|
||||
if(oComment.bDone.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentsType::Solved);
|
||||
m_oBcw.m_oStream.WriteBOOL(oComment.bDone.get2());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
_UINT32 nDurableId;
|
||||
if(oComment.nDurableId.IsInit())
|
||||
{
|
||||
nDurableId = oComment.nDurableId->GetValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
nDurableId = XmlUtils::GenerateInt();
|
||||
}
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentsType::DurableId);
|
||||
m_oBcw.m_oStream.WriteULONG(nDurableId);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
|
||||
if(oComment.aReplies.size() > 0)
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentsType::Replies);
|
||||
@ -7545,6 +7692,42 @@ void BinarySettingsTableWriter::WriteSettingsContent(OOX::CSettings& oSettings,
|
||||
m_oBcw.m_oStream.WriteStringW3(oSettings.m_oListSeparator->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oGutterAtTop.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::GutterAtTop);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oGutterAtTop->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oMirrorMargins.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::MirrorMargins);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oMirrorMargins->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oPrintTwoOnOne.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::PrintTwoOnOne);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oPrintTwoOnOne->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oBookFoldPrinting.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::BookFoldPrinting);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oBookFoldPrinting->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oBookFoldPrintingSheets.IsInit() && oSettings.m_oBookFoldPrintingSheets->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::BookFoldPrintingSheets);
|
||||
m_oBcw.m_oStream.WriteLONG(oSettings.m_oBookFoldPrintingSheets->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oBookFoldRevPrinting.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::BookFoldRevPrinting);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSettings.m_oBookFoldRevPrinting->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettingsCustom.m_oSdtGlobalColor.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::SdtGlobalColor);
|
||||
@ -7877,6 +8060,85 @@ void BinarySettingsTableWriter::WriteColorSchemeMapping(const PPTX::Logic::ClrMa
|
||||
void BinarySettingsTableWriter::WriteCompat(const OOX::Settings::CCompat& oCompat)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
_UINT32 nFlags;
|
||||
nFlags = 0;
|
||||
COMPLEX_BOOL_TO_UINT(0, oCompat.m_oUseSingleBorderforContiguousCells);
|
||||
COMPLEX_BOOL_TO_UINT(1, oCompat.m_oWpJustification);
|
||||
COMPLEX_BOOL_TO_UINT(2, oCompat.m_oNoTabHangInd);
|
||||
COMPLEX_BOOL_TO_UINT(3, oCompat.m_oNoLeading);
|
||||
COMPLEX_BOOL_TO_UINT(4, oCompat.m_oSpaceForUL);
|
||||
COMPLEX_BOOL_TO_UINT(5, oCompat.m_oNoColumnBalance);
|
||||
COMPLEX_BOOL_TO_UINT(6, oCompat.m_oBalanceSingleByteDoubleByteWidth);
|
||||
COMPLEX_BOOL_TO_UINT(7, oCompat.m_oNoExtraLineSpacing);
|
||||
COMPLEX_BOOL_TO_UINT(8, oCompat.m_oDoNotLeaveBackslashAlone);
|
||||
COMPLEX_BOOL_TO_UINT(9, oCompat.m_oUlTrailSpace);
|
||||
COMPLEX_BOOL_TO_UINT(10, oCompat.m_oDoNotExpandShiftReturn);
|
||||
COMPLEX_BOOL_TO_UINT(11, oCompat.m_oSpacingInWholePoints);
|
||||
COMPLEX_BOOL_TO_UINT(12, oCompat.m_oLineWrapLikeWord6);
|
||||
COMPLEX_BOOL_TO_UINT(13, oCompat.m_oPrintBodyTextBeforeHeader);
|
||||
COMPLEX_BOOL_TO_UINT(14, oCompat.m_oPrintColBlack);
|
||||
COMPLEX_BOOL_TO_UINT(15, oCompat.m_oWpSpaceWidth);
|
||||
COMPLEX_BOOL_TO_UINT(16, oCompat.m_oShowBreaksInFrames);
|
||||
COMPLEX_BOOL_TO_UINT(17, oCompat.m_oSubFontBySize);
|
||||
COMPLEX_BOOL_TO_UINT(18, oCompat.m_oSuppressBottomSpacing);
|
||||
COMPLEX_BOOL_TO_UINT(19, oCompat.m_oSuppressTopSpacing);
|
||||
COMPLEX_BOOL_TO_UINT(20, oCompat.m_oSuppressSpacingAtTopOfPage);
|
||||
COMPLEX_BOOL_TO_UINT(21, oCompat.m_oSuppressTopSpacingWP);
|
||||
COMPLEX_BOOL_TO_UINT(22, oCompat.m_oSuppressSpBfAfterPgBrk);
|
||||
COMPLEX_BOOL_TO_UINT(23, oCompat.m_oSwapBordersFacingPages);
|
||||
COMPLEX_BOOL_TO_UINT(24, oCompat.m_oConvMailMergeEsc);
|
||||
COMPLEX_BOOL_TO_UINT(25, oCompat.m_oTruncateFontHeightsLikeWP6);
|
||||
COMPLEX_BOOL_TO_UINT(26, oCompat.m_oMwSmallCaps);
|
||||
COMPLEX_BOOL_TO_UINT(27, oCompat.m_oUsePrinterMetrics);
|
||||
COMPLEX_BOOL_TO_UINT(28, oCompat.m_oDoNotSuppressParagraphBorders);
|
||||
COMPLEX_BOOL_TO_UINT(29, oCompat.m_oWrapTrailSpaces);
|
||||
COMPLEX_BOOL_TO_UINT(30, oCompat.m_oFootnoteLayoutLikeWW8);
|
||||
COMPLEX_BOOL_TO_UINT(31, oCompat.m_oShapeLayoutLikeWW8);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerCompat::Flags1);
|
||||
m_oBcw.m_oStream.WriteULONG(nFlags);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
nFlags = 0;
|
||||
COMPLEX_BOOL_TO_UINT(0, oCompat.m_oAlignTablesRowByRow);
|
||||
COMPLEX_BOOL_TO_UINT(1, oCompat.m_oForgetLastTabAlignment);
|
||||
COMPLEX_BOOL_TO_UINT(2, oCompat.m_oAdjustLineHeightInTable);
|
||||
COMPLEX_BOOL_TO_UINT(3, oCompat.m_oAutoSpaceLikeWord95);
|
||||
COMPLEX_BOOL_TO_UINT(4, oCompat.m_oNoSpaceRaiseLower);
|
||||
COMPLEX_BOOL_TO_UINT(5, oCompat.m_oDoNotUseHTMLParagraphAutoSpacing);
|
||||
COMPLEX_BOOL_TO_UINT(6, oCompat.m_oLayoutRawTableWidth);
|
||||
COMPLEX_BOOL_TO_UINT(7, oCompat.m_oLayoutTableRowsApart);
|
||||
COMPLEX_BOOL_TO_UINT(8, oCompat.m_oUseWord97LineBreakRules);
|
||||
COMPLEX_BOOL_TO_UINT(9, oCompat.m_oDoNotBreakWrappedTables);
|
||||
COMPLEX_BOOL_TO_UINT(10, oCompat.m_oDoNotSnapToGridInCell);
|
||||
COMPLEX_BOOL_TO_UINT(11, oCompat.m_oSelectFldWithFirstOrLastChar);
|
||||
COMPLEX_BOOL_TO_UINT(12, oCompat.m_oApplyBreakingRules);
|
||||
COMPLEX_BOOL_TO_UINT(13, oCompat.m_oDoNotWrapTextWithPunct);
|
||||
COMPLEX_BOOL_TO_UINT(14, oCompat.m_oDoNotUseEastAsianBreakRules);
|
||||
COMPLEX_BOOL_TO_UINT(15, oCompat.m_oUseWord2002TableStyleRules);
|
||||
COMPLEX_BOOL_TO_UINT(16, oCompat.m_oGrowAutofit);
|
||||
COMPLEX_BOOL_TO_UINT(17, oCompat.m_oUseFELayout);
|
||||
COMPLEX_BOOL_TO_UINT(18, oCompat.m_oUseNormalStyleForList);
|
||||
COMPLEX_BOOL_TO_UINT(19, oCompat.m_oDoNotUseIndentAsNumberingTabStop);
|
||||
COMPLEX_BOOL_TO_UINT(20, oCompat.m_oUseAltKinsokuLineBreakRules);
|
||||
COMPLEX_BOOL_TO_UINT(21, oCompat.m_oAllowSpaceOfSameStyleInTable);
|
||||
COMPLEX_BOOL_TO_UINT(22, oCompat.m_oDoNotSuppressIndentation);
|
||||
COMPLEX_BOOL_TO_UINT(23, oCompat.m_oDoNotAutofitConstrainedTables);
|
||||
COMPLEX_BOOL_TO_UINT(24, oCompat.m_oAutofitToFirstFixedWidthCell);
|
||||
COMPLEX_BOOL_TO_UINT(25, oCompat.m_oUnderlineTabInNumList);
|
||||
COMPLEX_BOOL_TO_UINT(26, oCompat.m_oDisplayHangulFixedWidth);
|
||||
COMPLEX_BOOL_TO_UINT(27, oCompat.m_oSplitPgBreakAndParaMark);
|
||||
COMPLEX_BOOL_TO_UINT(28, oCompat.m_oDoNotVertAlignCellWithSp);
|
||||
COMPLEX_BOOL_TO_UINT(29, oCompat.m_oDoNotBreakConstrainedForcedTable);
|
||||
COMPLEX_BOOL_TO_UINT(30, oCompat.m_oDoNotVertAlignInTxbx);
|
||||
COMPLEX_BOOL_TO_UINT(31, oCompat.m_oUseAnsiKerningPairs);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerCompat::Flags2);
|
||||
m_oBcw.m_oStream.WriteULONG(nFlags);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
nFlags = 0;
|
||||
COMPLEX_BOOL_TO_UINT(0, oCompat.m_oCachedColBalance);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerCompat::Flags3);
|
||||
m_oBcw.m_oStream.WriteULONG(nFlags);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
|
||||
for(size_t i = 0; i < oCompat.m_arrCompatSettings.size(); ++i)
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerCompat::CompatSetting);
|
||||
@ -8074,14 +8336,14 @@ void BinaryFileWriter::intoBindoc(const std::wstring& sDir)
|
||||
{
|
||||
BinDocxRW::BinaryCommentsTableWriter oBinaryCommentsTableWriter(m_oParamsWriter);
|
||||
int nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::Comments);
|
||||
oBinaryCommentsTableWriter.Write(*oDocx.m_pComments, oDocx.m_pCommentsExt, oDocx.m_pPeople, m_oParamsWriter.m_mapIgnoreComments);
|
||||
oBinaryCommentsTableWriter.Write(*oDocx.m_pComments, oDocx.m_pCommentsExt, oDocx.m_pPeople, oDocx.m_pCommentsIds, m_oParamsWriter.m_mapIgnoreComments);
|
||||
this->WriteTableEnd(nCurPos);
|
||||
}
|
||||
if(NULL != oDocx.m_pDocumentComments)
|
||||
{
|
||||
BinDocxRW::BinaryCommentsTableWriter oBinaryCommentsTableWriter(m_oParamsWriter);
|
||||
int nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::DocumentComments);
|
||||
oBinaryCommentsTableWriter.Write(*oDocx.m_pDocumentComments, oDocx.m_pDocumentCommentsExt, oDocx.m_pDocumentPeople, m_oParamsWriter.m_mapIgnoreComments);
|
||||
oBinaryCommentsTableWriter.Write(*oDocx.m_pDocumentComments, oDocx.m_pDocumentCommentsExt, oDocx.m_pDocumentPeople, oDocx.m_pDocumentCommentsIds, m_oParamsWriter.m_mapIgnoreComments);
|
||||
this->WriteTableEnd(nCurPos);
|
||||
}
|
||||
|
||||
|
||||
@ -310,6 +310,8 @@ namespace BinDocxRW
|
||||
bool m_bWriteSectPr;//Записывать ли свойства верхнего уровня в данном экземпляре BinaryOtherTableWriter
|
||||
//---------------------------------
|
||||
BinaryDocumentTableWriter(ParamsWriter& oParamsWriter, ParamsDocumentWriter& oParamsDocumentWriter, std::map<int, bool>* mapIgnoreComments, BinaryHeaderFooterTableWriter* oBinaryHeaderFooterTableWriter);
|
||||
|
||||
void WriteAltChunk(OOX::Media& oAltChunk);
|
||||
void WriteVbaProject(OOX::VbaProject& oVbaProject);
|
||||
void Write(std::vector<OOX::WritingElement*> & aElems);
|
||||
void WriteDocumentContent(const std::vector<OOX::WritingElement*> & aElems);
|
||||
@ -481,13 +483,15 @@ namespace BinDocxRW
|
||||
OOX::CComment* pComment;
|
||||
nullable<bool> bDone;
|
||||
nullable<std::wstring> sUserId;
|
||||
nullable<std::wstring> sProviderId;
|
||||
nullable<SimpleTypes::CLongHexNumber<> > nDurableId;
|
||||
std::vector<CCommentWriteTemp*> aReplies;
|
||||
};
|
||||
BinaryCommonWriter m_oBcw;
|
||||
public:
|
||||
BinaryCommentsTableWriter(ParamsWriter& oParamsWriter);
|
||||
void Write(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, std::map<int, bool>& mapIgnoreComments);
|
||||
void WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, std::map<int, bool>& mapIgnoreComments);
|
||||
void Write(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments);
|
||||
void WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments);
|
||||
void WriteComment(CCommentWriteTemp& oComment);
|
||||
void WriteReplies(std::vector<CCommentWriteTemp*>& aCommentWriteTemp);
|
||||
};
|
||||
|
||||
@ -187,7 +187,7 @@ namespace BinXlsxRW{
|
||||
{
|
||||
OOX::Spreadsheet::CText* pText = new OOX::Spreadsheet::CText();
|
||||
pText->m_sText = aSharedStrings[i];
|
||||
if(std::wstring::npos == pText->m_sText.find(_T(" ")))
|
||||
if(std::wstring::npos != pText->m_sText.find(_T(" ")))
|
||||
{
|
||||
pText->m_oSpace.Init();
|
||||
pText->m_oSpace->SetValue(SimpleTypes::xmlspacePreserve);
|
||||
|
||||
@ -342,6 +342,7 @@
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
English,
|
||||
en,
|
||||
);
|
||||
mainGroup = 17E17ED31AC453F800BEA2EA;
|
||||
@ -384,7 +385,7 @@
|
||||
17C1FEC01ACC42C4006B99B3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
@ -416,7 +417,7 @@
|
||||
17C1FEC11ACC42C4006B99B3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ENABLE_BITCODE = NO;
|
||||
ENABLE_BITCODE = YES;
|
||||
EXECUTABLE_PREFIX = lib;
|
||||
GCC_ENABLE_CPP_EXCEPTIONS = YES;
|
||||
GCC_ENABLE_CPP_RTTI = YES;
|
||||
|
||||
@ -92,8 +92,9 @@ public:
|
||||
std::wstring convert_conditional_formula(std::wstring const & expr);
|
||||
|
||||
// Лист1!$A$1 -> $Лист1.$A$1
|
||||
std::wstring convert_named_ref (std::wstring const & expr);
|
||||
std::wstring convert_named_ref(std::wstring const & expr);
|
||||
std::wstring convert_named_formula(std::wstring const & expr);
|
||||
bool is_simple_ref(std::wstring const & expr);
|
||||
|
||||
std::wstring get_table_name();
|
||||
|
||||
|
||||
@ -122,27 +122,64 @@ namespace formulasconvert {
|
||||
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
|
||||
//XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
|
||||
//XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( expr, L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
}
|
||||
static void replace_tmp(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
// XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
// XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
|
||||
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
|
||||
// XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
// XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
|
||||
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( expr, L" ", L"PROBEL");
|
||||
// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
|
||||
// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
|
||||
// //XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
|
||||
// //XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
|
||||
//
|
||||
// XmlUtils::replace_all( expr, L" ", L"PROBEL");
|
||||
//// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
|
||||
//// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
|
||||
|
||||
std::wstring result;
|
||||
|
||||
size_t pos = 0, size = expr.length();
|
||||
|
||||
while(pos < size)
|
||||
{
|
||||
switch(expr[pos])
|
||||
{
|
||||
case '.':
|
||||
{
|
||||
result += L"ТОСHKA";
|
||||
}break;
|
||||
case '!':
|
||||
{
|
||||
result += L"VOSKL";
|
||||
}break;
|
||||
case '(':
|
||||
{
|
||||
result += L"SCOBCAIN";
|
||||
}break;
|
||||
case ')':
|
||||
{
|
||||
result += L"SCOBCAOUT";
|
||||
}break;
|
||||
case ' ':
|
||||
{
|
||||
result += L"PROBEL";
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
result += expr[pos];
|
||||
}break;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
expr = result;
|
||||
}
|
||||
static std::wstring convert_scobci(boost::wsmatch const & what)
|
||||
{
|
||||
|
||||
@ -133,34 +133,202 @@ public:
|
||||
}
|
||||
static void oox_replace_tmp_back(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"ТОСHKA", L".");
|
||||
XmlUtils::replace_all( expr, L"VOSKL", L"!");
|
||||
std::wstring result;
|
||||
|
||||
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
|
||||
size_t pos = 0, size = expr.length();
|
||||
|
||||
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( expr, L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
while(pos < size)
|
||||
{
|
||||
if (pos + 5 >= size)
|
||||
{
|
||||
result += expr[pos++];
|
||||
continue;
|
||||
}
|
||||
switch(expr[pos])
|
||||
{
|
||||
case 'M':
|
||||
{
|
||||
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"MINYS"))
|
||||
{
|
||||
result += L"-"; pos += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'T':
|
||||
{
|
||||
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"ТОСHKA"))
|
||||
{
|
||||
result += L"."; pos += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'V':
|
||||
{
|
||||
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"VOSKL"))
|
||||
{
|
||||
result += L"!"; pos += 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'S':
|
||||
{
|
||||
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"SCOBCAIN"))
|
||||
{
|
||||
result += L"("; pos += 8;
|
||||
}
|
||||
else if ((pos + 9 < size) && (expr.substr(pos, 9) == L"SCOBCAOUT"))
|
||||
{
|
||||
result += L")"; pos += 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'K':
|
||||
{
|
||||
if ((pos + 9 < size) && (expr.substr(pos, 9) == L"KVADRATIN"))
|
||||
{
|
||||
result += L"["; pos += 9;
|
||||
}
|
||||
else if ((pos + 10 < size) && (expr.substr(pos, 10) == L"KVADRATOUT"))
|
||||
{
|
||||
result += L"]"; pos += 10;
|
||||
}
|
||||
else if ((pos + 8 < size) && (expr.substr(pos, 8) == L"KAVYCHKA"))
|
||||
{
|
||||
result += L"\""; pos += 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'P':
|
||||
{
|
||||
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"PROBEL"))
|
||||
{
|
||||
result += L" "; pos += 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'A':
|
||||
{
|
||||
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"APOSTROF"))
|
||||
{
|
||||
result += L"'"; pos += 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
result += expr[pos++];
|
||||
}break;
|
||||
}
|
||||
}
|
||||
expr = result;
|
||||
//XmlUtils::replace_all( expr, L"MINYS", L"-");
|
||||
//XmlUtils::replace_all( expr, L"ТОСHKA", L".");
|
||||
//XmlUtils::replace_all( expr, L"VOSKL", L"!");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
|
||||
//XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
|
||||
//XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
|
||||
//
|
||||
//XmlUtils::replace_all( expr, L"PROBEL", L" ");
|
||||
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
}
|
||||
|
||||
static void oox_replace_tmp(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
std::wstring result;
|
||||
|
||||
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
|
||||
size_t pos = 0, size = expr.length();
|
||||
|
||||
XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( expr, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( expr, L"'", L"APOSTROF");
|
||||
XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
|
||||
while(pos < size)
|
||||
{
|
||||
switch(expr[pos])
|
||||
{
|
||||
case '-':
|
||||
{
|
||||
result += L"MINYS";
|
||||
}break;
|
||||
case '.':
|
||||
{
|
||||
result += L"ТОСHKA";
|
||||
}break;
|
||||
case '!':
|
||||
{
|
||||
result += L"VOSKL";
|
||||
}break;
|
||||
case '(':
|
||||
{
|
||||
result += L"SCOBCAIN";
|
||||
}break;
|
||||
case ')':
|
||||
{
|
||||
result += L"SCOBCAOUT";
|
||||
}break;
|
||||
case '[':
|
||||
{
|
||||
result += L"KVADRATIN";
|
||||
}break;
|
||||
case ']':
|
||||
{
|
||||
result += L"KVADRATOUT";
|
||||
}break;
|
||||
case ' ':
|
||||
{
|
||||
result += L"PROBEL";
|
||||
}break;
|
||||
case '\'':
|
||||
{
|
||||
result += L"APOSTROF";
|
||||
}break;
|
||||
case '\"':
|
||||
{
|
||||
result += L"KAVYCHKA";
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
result += expr[pos];
|
||||
}break;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
expr = result;
|
||||
|
||||
//XmlUtils::replace_all( expr, L"-", L"MINYS");
|
||||
//XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
//XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
//XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
|
||||
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
|
||||
//
|
||||
//XmlUtils::replace_all( expr, L" ", L"PROBEL");
|
||||
//XmlUtils::replace_all( expr, L"'", L"APOSTROF");
|
||||
//XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
|
||||
}
|
||||
|
||||
static bool is_forbidden1(const std::wstring & formula)
|
||||
@ -174,6 +342,7 @@ public:
|
||||
}
|
||||
void replace_named_ref(std::wstring & expr);
|
||||
void replace_named_formula(std::wstring & expr);
|
||||
bool is_simple_ref(std::wstring const & expr);
|
||||
|
||||
static bool isFindBaseCell_;
|
||||
|
||||
@ -195,7 +364,7 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSele
|
||||
|
||||
if (b)
|
||||
{
|
||||
boost::wregex re1(L"(\\$?[^\']+\\!)?([\\w^0-9$]*\\d*)\\:?([\\w^0-9$]*\\d*)?");
|
||||
boost::wregex re1(L"(\\$?[^\\']+\\!)?([a-zA-Z$]+\\d*)(\\:[a-zA-Z$]+\\d*)?");
|
||||
// $ Sheet2 ! $ A1 : $ B5
|
||||
// $ Sheet2 ! $ A : $ A
|
||||
// $ Sheet2 ! $ 1 : $ 1
|
||||
@ -238,9 +407,11 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
|
||||
|
||||
if (isFindBaseCell_ && table_name_.empty() && !sheet.empty())
|
||||
{
|
||||
table_name_ = sheet + L".$A$1";
|
||||
table_name_ = L"$" + sheet + L".$A$1";
|
||||
}
|
||||
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
|
||||
if (!c2.empty() && c2.substr(0, 1) == L":")
|
||||
c2 = c2.substr(1);
|
||||
|
||||
|
||||
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
|
||||
@ -281,10 +452,12 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
||||
|
||||
if (isFindBaseCell_ && table_name_.empty() && !sheet.empty())
|
||||
{
|
||||
table_name_ = sheet + L".$A$1";
|
||||
table_name_ = L"$" + sheet + L".$A$1";
|
||||
}
|
||||
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
|
||||
|
||||
|
||||
if (!c2.empty() && c2.substr(0, 1) == L":")
|
||||
c2 = c2.substr(1);
|
||||
|
||||
s = sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"");
|
||||
}
|
||||
@ -310,6 +483,19 @@ void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
|
||||
expr = convert_formula(expr);
|
||||
isFindBaseCell_ = false;
|
||||
}
|
||||
bool oox2odf_converter::Impl::is_simple_ref(std::wstring const & expr)
|
||||
{
|
||||
if (expr.find(L"(") != std::wstring::npos) return false;
|
||||
if (expr.find(L" ") != std::wstring::npos) return false;
|
||||
if (expr.find(L";") != std::wstring::npos) return false;
|
||||
|
||||
boost::wsmatch match;
|
||||
if (boost::regex_search(expr, match, boost::wregex(L"([\\w]+\\!)?\\$?[a-zA-Z]+\\$?\\d+(\\:\\$?[a-zA-Z]+\\$?\\d+)?")))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
{
|
||||
@ -644,6 +830,11 @@ std::wstring oox2odf_converter::convert_named_formula(const std::wstring& expr)
|
||||
impl_->replace_named_formula(workstr);
|
||||
return workstr;
|
||||
}
|
||||
bool oox2odf_converter::is_simple_ref(std::wstring const & expr)
|
||||
{
|
||||
return impl_->is_simple_ref(expr);
|
||||
}
|
||||
|
||||
std::wstring oox2odf_converter::get_table_name()
|
||||
{
|
||||
return impl_->table_name_;
|
||||
|
||||
@ -39,7 +39,8 @@ enum ElementType
|
||||
typeNone = 0,
|
||||
type_AbstractXml,
|
||||
|
||||
typeTextText = 1000,
|
||||
typeTextTextElement = 1000,
|
||||
typeTextText,
|
||||
typeTextS,
|
||||
typeTextTab,
|
||||
typeTextLineBreak,
|
||||
@ -247,6 +248,7 @@ enum ElementType
|
||||
typeStyleTableColumnProperties,
|
||||
typeStyleTableRowProperties,
|
||||
typeStyleTableCellProperties,
|
||||
typeStyleHeaderFooter,
|
||||
typeStyleHeader,
|
||||
typeStyleFooter,
|
||||
typeStyleHeaderFirst,
|
||||
@ -535,7 +537,10 @@ enum ElementType
|
||||
typeOfficeAnnotation,
|
||||
typeOfficeAnnotationStart,
|
||||
typeOfficeAnnotationEnd,
|
||||
typeStyleRegion,
|
||||
typeStyleRegionLeft,
|
||||
typeStyleRegionCenter,
|
||||
typeStyleRegionRight,
|
||||
typeOfficeScripts,
|
||||
typeOfficeScript,
|
||||
typeOfficePresentation,
|
||||
@ -591,8 +596,6 @@ enum ElementType
|
||||
typeChartRegressionCurve,
|
||||
typeChartEquation,
|
||||
|
||||
typeStyleRegionCenter,
|
||||
typeStyleRegionRight,
|
||||
typeStyleChartProperties,
|
||||
|
||||
typeCalcextColorScaleEntry,
|
||||
|
||||
@ -694,7 +694,7 @@ void docx_conversion_context::end_document()
|
||||
output_document_->get_word_files().set_comments ( comments_context_);
|
||||
output_document_->get_word_files().set_headers_footers( headers_footers_);
|
||||
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(chart_drawing_handle_->content());
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(chart_drawing_handle_->content(), chart_drawing_handle_->content_vml());
|
||||
output_document_->get_word_files().set_drawings(drawings);
|
||||
|
||||
package::content_types_file & content_file_ = output_document_->get_content_types_file();
|
||||
@ -820,6 +820,16 @@ std::wstring docx_conversion_context::dump_settings_document()
|
||||
{
|
||||
CP_XML_NODE(L"w:mirrorMargins");
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"w:compat")
|
||||
{
|
||||
CP_XML_NODE(L"w:compatSetting")
|
||||
{
|
||||
CP_XML_ATTR(L"w:name", L"compatibilityMode" );
|
||||
CP_XML_ATTR(L"w:uri", L"http://schemas.microsoft.com/office/word" );
|
||||
CP_XML_ATTR(L"w:val", L"15" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return output.str();
|
||||
@ -1600,7 +1610,6 @@ int docx_conversion_context::process_paragraph_style(const std::wstring & style_
|
||||
set_rtl(false);
|
||||
}
|
||||
}
|
||||
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
|
||||
|
||||
styleContent->docx_convert(*this);
|
||||
|
||||
@ -1701,7 +1710,6 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
|
||||
set_rtl(false);
|
||||
}
|
||||
}
|
||||
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
|
||||
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
|
||||
{
|
||||
set_outline_level(*Attr->outline_level_ - 1);
|
||||
|
||||
@ -919,9 +919,6 @@ public:
|
||||
double get_current_fontSize() {return current_fontSize.empty() ? 0 : current_fontSize.back();}
|
||||
void pop_current_fontSize() {if (!current_fontSize.empty()) current_fontSize.pop_back();}
|
||||
|
||||
void set_margin_left(int val) {current_margin_left_ = val;}
|
||||
int get_margin_left() {return current_margin_left_;}
|
||||
|
||||
void set_outline_level(int val) {current_outline_level_ = val;}
|
||||
int get_outline_level() {return current_outline_level_;}
|
||||
|
||||
|
||||
@ -232,6 +232,7 @@ void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
|
||||
}
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -267,6 +268,7 @@ void docx_serialize_shape_child(std::wostream & strm, _docx_drawing & val)
|
||||
val.serialize_shape (CP_XML_STREAM());
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
val.serialize_text(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
@ -38,8 +38,9 @@
|
||||
#include "oox_rels.h"
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace odf_reader {
|
||||
class header_footer_impl;
|
||||
namespace odf_reader
|
||||
{
|
||||
class header_footer_impl;
|
||||
}
|
||||
|
||||
namespace oox {
|
||||
|
||||
@ -73,7 +73,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
|
||||
//if (FALSE == (hr = pFontManager->LoadString2( std::to_wstring(i), 0, 0)))
|
||||
// return std::pair<float, float>(7,8);
|
||||
|
||||
if (FALSE == (hr = pFontManager->LoadString2( L"xxxxx" , 0, 0)))
|
||||
if (FALSE == (hr = pFontManager->LoadString2( L"0123456789abcdefghijklmnopqrstuvwxyz" , 0, 0)))
|
||||
return std::pair<float, float>(7,8);
|
||||
|
||||
TBBox box;
|
||||
@ -96,7 +96,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
|
||||
if (box.fMaxY - box.fMinY < minHeight) minHeight = box.fMaxY - box.fMinY;
|
||||
}
|
||||
|
||||
double width = (minWidth + 2 * maxWidth) /3. /5.;
|
||||
double width = (minWidth + 2 * maxWidth) /36. /3.;
|
||||
return std::pair<float, float>(width, maxHeight);
|
||||
}
|
||||
|
||||
|
||||
@ -99,17 +99,23 @@ void tabs_context::reset()
|
||||
odf_reader::style_tab_stop *tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(tabs[i].get());
|
||||
if (tab_stop)
|
||||
{
|
||||
clear_tabs.insert(std::make_pair(tab_stop->style_position_.get_value(), tabs[i]));
|
||||
double pos = tab_stop->margin_left + tab_stop->style_position_.get_value_unit(odf_types::length::pt);
|
||||
|
||||
clear_tabs.insert(std::make_pair((int)pos, tabs[i]));
|
||||
}
|
||||
}
|
||||
tabs.clear();
|
||||
}
|
||||
void tabs_context::add(const odf_reader::office_element_ptr & element)
|
||||
void tabs_context::add(const odf_reader::office_element_ptr & element, double margin_left)
|
||||
{
|
||||
odf_reader::style_tab_stop *tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(element.get());
|
||||
if (tab_stop)
|
||||
{
|
||||
std::map<double, odf_reader::office_element_ptr>::iterator pFind = clear_tabs.find(tab_stop->style_position_.get_value());
|
||||
tab_stop->margin_left = margin_left;
|
||||
|
||||
double pos = margin_left + tab_stop->style_position_.get_value_unit(odf_types::length::pt);
|
||||
|
||||
std::map<int, odf_reader::office_element_ptr>::iterator pFind = clear_tabs.find((int)pos);
|
||||
|
||||
if (pFind != clear_tabs.end())
|
||||
{
|
||||
@ -126,7 +132,7 @@ void tabs_context::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
_pPr << L"<w:tabs>";
|
||||
|
||||
for (std::map<double, odf_reader::office_element_ptr>::iterator it = clear_tabs.begin(); it != clear_tabs.end(); ++it)
|
||||
for (std::map<int, odf_reader::office_element_ptr>::iterator it = clear_tabs.begin(); it != clear_tabs.end(); ++it)
|
||||
{
|
||||
odf_reader::style_tab_stop * tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(it->second.get());
|
||||
tab_stop->docx_convert(Context, true);
|
||||
|
||||
@ -110,7 +110,7 @@ class tabs_context : boost::noncopyable
|
||||
public:
|
||||
|
||||
std::vector<odf_reader::office_element_ptr> tabs;
|
||||
std::map<double, odf_reader::office_element_ptr> clear_tabs;
|
||||
std::map<int, odf_reader::office_element_ptr> clear_tabs;
|
||||
|
||||
void clear()
|
||||
{
|
||||
@ -120,7 +120,7 @@ public:
|
||||
|
||||
void reset();
|
||||
|
||||
void add(const odf_reader::office_element_ptr & element);
|
||||
void add(const odf_reader::office_element_ptr & element, double margin_left);
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
};
|
||||
class styles_context : boost::noncopyable
|
||||
|
||||
@ -131,6 +131,76 @@ static const std::wstring _ooxDashStyle[]=
|
||||
L"dashDot",
|
||||
L"sysDashDotDot"
|
||||
};
|
||||
static const std::wstring _vmlDashStyle[]=
|
||||
{
|
||||
L"none",
|
||||
L"solid",
|
||||
L"dot",
|
||||
L"dash",
|
||||
L"dash",
|
||||
L"dashdot",
|
||||
L"shortdashdotdot"
|
||||
};
|
||||
|
||||
void oox_serialize_effects(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
|
||||
{
|
||||
_CP_OPT(bool) bShadow;
|
||||
_CP_OPT(std::wstring) strShadowColor;
|
||||
_CP_OPT(double) dShadowOpacity;
|
||||
_CP_OPT(double) dShadowOffsetX;
|
||||
_CP_OPT(double) dShadowOffsetY;
|
||||
|
||||
odf_reader::GetProperty(prop, L"shadow", bShadow);
|
||||
odf_reader::GetProperty(prop, L"shadow-color", strShadowColor);
|
||||
odf_reader::GetProperty(prop, L"shadow-opacity", dShadowOpacity);
|
||||
odf_reader::GetProperty(prop, L"shadow-offset-x", dShadowOffsetX);
|
||||
odf_reader::GetProperty(prop, L"shadow-offset-y", dShadowOffsetY);
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:effectLst")
|
||||
{
|
||||
if ((bShadow) && (*bShadow))
|
||||
{
|
||||
CP_XML_NODE(L"a:outerShdw")
|
||||
{
|
||||
//CP_XML_ATTR(L"blurRad", 0);
|
||||
|
||||
double offsetX = dShadowOffsetX.get_value_or(0);
|
||||
double offsetY = dShadowOffsetY.get_value_or(0);
|
||||
|
||||
double dist = sqrt(offsetX * offsetX + offsetY * offsetY);
|
||||
double dir = (offsetX > 0 ? atan(offsetY / offsetX) : 0) * 180. / 3.1415926;
|
||||
|
||||
CP_XML_ATTR(L"dist", (int)(dist));
|
||||
CP_XML_ATTR(L"dir", (int)(dir * 60000));
|
||||
|
||||
CP_XML_ATTR(L"rotWithShape", L"0");
|
||||
CP_XML_ATTR(L"algn", L"tl");
|
||||
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
if (strShadowColor)
|
||||
{
|
||||
CP_XML_ATTR(L"val", *strShadowColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_ATTR(L"val", L"000000");
|
||||
}
|
||||
if (dShadowOpacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alpha")
|
||||
{
|
||||
CP_XML_ATTR(L"val", *dShadowOpacity * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop, bool always_draw, const std::wstring &ns)
|
||||
{
|
||||
@ -152,7 +222,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
odf_reader::GetProperty(prop, L"stroke" , iStroke);
|
||||
odf_reader::GetProperty(prop, L"stroke-width" , dStrokeWidth);
|
||||
odf_reader::GetProperty(prop, L"stroke-opacity" , dStrokeOpacity);
|
||||
|
||||
|
||||
if ((!strStrokeColor && !iStroke && !dStrokeWidth) && !always_draw)return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
@ -190,7 +260,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
|
||||
CP_XML_NODE(ns + L":srgbClr")
|
||||
{
|
||||
CP_XML_ATTR2(ns_att + L"val",color);
|
||||
CP_XML_ATTR2(ns_att + L"val", color);
|
||||
|
||||
if (dStrokeOpacity)
|
||||
{
|
||||
@ -224,6 +294,102 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
}
|
||||
}
|
||||
}
|
||||
void vml_serialize_text(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
|
||||
{
|
||||
_CP_OPT(std::wstring) strTextContent;
|
||||
odf_reader::GetProperty(prop, L"text-content", strTextContent);
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
if (strTextContent)
|
||||
{
|
||||
CP_XML_NODE(L"v:textbox")
|
||||
{
|
||||
CP_XML_ATTR(L"style", L"mso-direction-alt:auto");
|
||||
CP_XML_ATTR(L"o:singleclick", L"f");
|
||||
|
||||
CP_XML_NODE(L"div")
|
||||
{
|
||||
CP_XML_ATTR(L"style", L"text-align:left");
|
||||
|
||||
CP_XML_NODE(L"font")
|
||||
{
|
||||
CP_XML_ATTR(L"face", L"Segoe UI");
|
||||
CP_XML_ATTR(L"size", L"160");
|
||||
CP_XML_ATTR(L"color", L"#000000");
|
||||
|
||||
const std::wstring & test_string = strTextContent.get();
|
||||
CP_XML_STREAM() << test_string;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
void vml_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
|
||||
{
|
||||
_CP_OPT(std::wstring) strStrokeColor;
|
||||
_CP_OPT(int) iStroke;
|
||||
_CP_OPT(double) dStrokeWidth;
|
||||
_CP_OPT(double) dStrokeOpacity;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(prop, L"wordArt", bWordArt);
|
||||
|
||||
odf_reader::GetProperty(prop, L"stroke-color" , strStrokeColor);
|
||||
odf_reader::GetProperty(prop, L"stroke" , iStroke);
|
||||
odf_reader::GetProperty(prop, L"stroke-width" , dStrokeWidth);
|
||||
odf_reader::GetProperty(prop, L"stroke-opacity" , dStrokeOpacity);
|
||||
|
||||
if (!strStrokeColor && !iStroke && !dStrokeWidth) return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"v:stroke")
|
||||
{
|
||||
std::wstring color, dash_style ;
|
||||
|
||||
if (strStrokeColor) color = *strStrokeColor;
|
||||
|
||||
if (iStroke)
|
||||
{
|
||||
if (iStroke.get() != 0 ) dash_style = _vmlDashStyle[iStroke.get()];
|
||||
}
|
||||
|
||||
if ((dStrokeWidth) && (*dStrokeWidth >= 0))
|
||||
{
|
||||
int val = dStrokeWidth.get() * 12700; //in emu (1 pt = 12700)
|
||||
if (val < 10) val = 12700;
|
||||
|
||||
CP_XML_ATTR(L"weight", val);
|
||||
}
|
||||
|
||||
if (false == color.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"color", L"#" + color);
|
||||
}
|
||||
if (!dash_style.empty() && dash_style != L"solid")
|
||||
{
|
||||
CP_XML_ATTR(L"dashstyle", dash_style);
|
||||
}
|
||||
//odf_reader::GetProperty(prop,L"marker-start", strVal);
|
||||
//if (strVal)
|
||||
//{
|
||||
//}
|
||||
//odf_reader::GetProperty(prop,L"marker-end",strVal);
|
||||
//if (strVal)
|
||||
//{
|
||||
//}
|
||||
|
||||
CP_XML_ATTR(L"startarrow", L"block");
|
||||
CP_XML_ATTR(L"startarrowwidth", L"medium");
|
||||
CP_XML_ATTR(L"startarrowlength", L"medium");
|
||||
CP_XML_ATTR(L"joinstyle", L"round");
|
||||
CP_XML_ATTR(L"endcap", L"flat");
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop, const std::wstring & shapeGeomPreset, const std::wstring &ns)
|
||||
{
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
@ -83,7 +83,7 @@ namespace oox {
|
||||
class _oox_drawing
|
||||
{
|
||||
public:
|
||||
_oox_drawing() : type(typeUnknown), id(0), x(0), y(0), cx(0), cy(0), sub_type(0), inGroup(false), lined(false), connector(false), name(L"object"), extExternal(false)
|
||||
_oox_drawing() : type(typeUnknown), id(0), x(0), y(0), cx(0), cy(0), sub_type(0), hidden(false), inGroup(false), lined(false), connector(false), name(L"object"), extExternal(false)
|
||||
{
|
||||
}
|
||||
RelsType type;
|
||||
@ -92,6 +92,7 @@ namespace oox {
|
||||
size_t id;
|
||||
bool lined;
|
||||
bool connector;
|
||||
bool hidden;
|
||||
|
||||
std::wstring name;
|
||||
int sub_type; //odf
|
||||
@ -123,7 +124,10 @@ namespace oox {
|
||||
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false, const std::wstring &ns = L"a");
|
||||
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val, const std::wstring & shapeGeomPreset, const std::wstring &ns = L"a");
|
||||
void oox_serialize_action (std::wostream & strm, const _action_desc & val);
|
||||
void oox_serialize_effects (std::wostream & strm, const std::vector<odf_reader::_property> & val);
|
||||
|
||||
void vml_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val);
|
||||
void vml_serialize_text (std::wostream & strm, const std::vector<odf_reader::_property> & val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -245,7 +245,7 @@ void vml_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
|
||||
{
|
||||
if (!val.gradient->colors.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"color2", val.gradient->colors[val.gradient->colors.size() - 1].color_ref);
|
||||
CP_XML_ATTR(L"color2", L"#" + val.gradient->colors[val.gradient->colors.size() - 1].color_ref);
|
||||
|
||||
std::wstring colors_value;
|
||||
for (size_t i = 0; i < val.gradient->colors.size(); i++)
|
||||
@ -404,6 +404,27 @@ void vml_serialize_background (std::wostream & strm, const _oox_fill & val, cons
|
||||
}
|
||||
}
|
||||
|
||||
void vml_serialize_fill (std::wostream & strm, const _oox_fill & val)
|
||||
{
|
||||
switch (val.type)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
vml_serialize_solid_fill(strm, val);
|
||||
break;
|
||||
case 2:
|
||||
vml_serialize_bitmap_fill(strm, val);
|
||||
break;
|
||||
case 3:
|
||||
vml_serialize_gradient_fill(strm, val);
|
||||
break;
|
||||
case 4:
|
||||
//vml_serialize_hatch_fill(strm, val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
|
||||
{
|
||||
switch (val.type)
|
||||
|
||||
@ -154,5 +154,6 @@ namespace oox {
|
||||
void oox_serialize_bitmap_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns = L"a");
|
||||
|
||||
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns = L"a");
|
||||
void vml_serialize_fill (std::wostream & strm, const _oox_fill & val);
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_comments_xml(std::wstring const & content,pptx_comments_ptr comments)
|
||||
std::pair<std::wstring, std::wstring> add_comments_xml(std::wstring const & content, pptx_comments_ptr comments)
|
||||
{
|
||||
const std::wstring file_id = std::to_wstring(next_file_id_++);
|
||||
|
||||
|
||||
@ -101,6 +101,7 @@ void pptx_serialize_image(std::wostream & strm, _pptx_drawing & val)
|
||||
CP_XML_NODE(L"a:avLst");
|
||||
}
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
//_CP_OPT(std::wstring) strTextContent;
|
||||
//odf::GetProperty(properties,L"text-content",strTextContent);
|
||||
@ -186,7 +187,8 @@ void pptx_serialize_media(std::wostream & strm, _pptx_drawing & val)
|
||||
}
|
||||
oox_serialize_fill (CP_XML_STREAM(), val.fill);
|
||||
oox_serialize_ln (CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
//_CP_OPT(std::wstring) strTextContent;
|
||||
//odf::GetProperty(properties,L"text-content",strTextContent);
|
||||
//pptx_serialize_text(CP_XML_STREAM(),val.additional);
|
||||
@ -248,6 +250,7 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val)
|
||||
val.serialize_shape(CP_XML_STREAM());
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
}
|
||||
pptx_serialize_text(CP_XML_STREAM(), val);
|
||||
@ -307,6 +310,7 @@ void pptx_serialize_connector(std::wostream & strm, _pptx_drawing & val)
|
||||
val.serialize_shape(CP_XML_STREAM());
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
}
|
||||
pptx_serialize_text(CP_XML_STREAM(), val);
|
||||
|
||||
@ -39,14 +39,14 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
unsigned int hex_string_to_int(std::wstring str)
|
||||
{
|
||||
unsigned int x;
|
||||
std::wstringstream ss;
|
||||
ss << std::hex << str;
|
||||
ss >> x;
|
||||
return x;
|
||||
}
|
||||
unsigned int hex_string_to_int(std::wstring str)
|
||||
{
|
||||
unsigned int x;
|
||||
std::wstringstream ss;
|
||||
ss << std::hex << str;
|
||||
ss >> x;
|
||||
return x;
|
||||
}
|
||||
|
||||
class xlsx_comments::Impl
|
||||
{
|
||||
@ -82,6 +82,7 @@ public:
|
||||
{
|
||||
CP_XML_ATTR(L"ref", c.ref_);
|
||||
CP_XML_ATTR(L"authorId", c.author_);
|
||||
CP_XML_ATTR(L"shapeId", 0);
|
||||
|
||||
CP_XML_NODE(L"text")
|
||||
{
|
||||
@ -94,127 +95,6 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
void serialize_vml(std::wostream & strm) const
|
||||
{
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
_CP_OPT(double) dVal;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xml")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:v", L"urn:schemas-microsoft-com:vml");
|
||||
CP_XML_ATTR(L"xmlns:o", L"urn:schemas-microsoft-com:office:office");
|
||||
CP_XML_ATTR(L"xmlns:x", L"urn:schemas-microsoft-com:office:excel");
|
||||
|
||||
for (size_t i = 0; i < xlsx_comment_.size(); i++)
|
||||
{
|
||||
const _xlsx_comment & c = xlsx_comment_[i];
|
||||
|
||||
std::wstring str_fill_color_ = L"00003f";
|
||||
if (odf_reader::GetProperty(c.graphicProperties_,L"fill-color",strVal))
|
||||
str_fill_color_ = strVal.get();
|
||||
|
||||
CP_XML_NODE(L"v:shapetype")
|
||||
{
|
||||
CP_XML_ATTR(L"id", L"shapetype_202");
|
||||
CP_XML_ATTR(L"coordsize", L"21600,21600");
|
||||
CP_XML_ATTR(L"o:spt", L"202");
|
||||
CP_XML_ATTR(L"path", L"m,l,21600l21600,21600l21600,xe");
|
||||
|
||||
CP_XML_NODE(L"v:stroke")
|
||||
{
|
||||
CP_XML_ATTR(L"joinstyle", L"miter");
|
||||
}
|
||||
CP_XML_NODE(L"v:path")
|
||||
{
|
||||
CP_XML_ATTR(L"gradientshapeok", L"t");
|
||||
CP_XML_ATTR(L"o:connecttype", L"rect");
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"v:shape")
|
||||
{
|
||||
if( hex_string_to_int(str_fill_color_) !=0 )
|
||||
{
|
||||
CP_XML_ATTR(L"fillcolor", std::wstring(L"#") + str_fill_color_);
|
||||
}//иначе это полная прозрачность
|
||||
|
||||
CP_XML_ATTR(L"id", L"shape_0");
|
||||
|
||||
std::wstring style = std::wstring(L"position:absolute;");
|
||||
|
||||
style += std::wstring(L"margin-left:") + boost::lexical_cast<std::wstring>(c.left_) + std::wstring(L"pt;");
|
||||
style += std::wstring(L"margin-top:") + boost::lexical_cast<std::wstring>(c.top_) + std::wstring(L"pt;");
|
||||
style += std::wstring(L"width:") + boost::lexical_cast<std::wstring>(c.width_) + std::wstring(L"pt;");
|
||||
style += std::wstring(L"height:") + boost::lexical_cast<std::wstring>(c.height_) + std::wstring(L"pt;");
|
||||
|
||||
if (c.visibly_ == false)style += std::wstring(L"visibility:hidden;");
|
||||
|
||||
CP_XML_ATTR(L"style",style);
|
||||
CP_XML_ATTR(L"type", L"shapetype_202");
|
||||
//if (odf_reader::GetProperty(c.graphicProperties_,L"opacity",dVal))
|
||||
//{
|
||||
// CP_XML_ATTR(L"opacity", boost::lexical_cast<std::wstring>((int)(100.-dVal.get())) + L"%");
|
||||
//}
|
||||
//CP_XML_NODE(L"v:shadow")
|
||||
//{
|
||||
// CP_XML_ATTR(L"color", L"black");
|
||||
// CP_XML_ATTR(L"obscured", L"t");
|
||||
// CP_XML_ATTR(L"on", L"t");
|
||||
//}
|
||||
|
||||
CP_XML_NODE(L"v:wrap")
|
||||
{
|
||||
CP_XML_ATTR(L"v:type", L"none");
|
||||
}
|
||||
CP_XML_NODE(L"v:fill")
|
||||
{
|
||||
CP_XML_ATTR(L"detectmouseclick", L"t");
|
||||
if( hex_string_to_int(str_fill_color_) !=0 )
|
||||
{
|
||||
CP_XML_ATTR(L"color", std::wstring(L"#") + str_fill_color_);
|
||||
CP_XML_ATTR(L"color2", std::wstring(L"#") + str_fill_color_);
|
||||
CP_XML_ATTR(L"type", L"solid");
|
||||
}//иначе это полная прозрачность
|
||||
//if (odf_reader::GetProperty(c.graphicProperties_,L"opacity",dVal))
|
||||
//{
|
||||
// CP_XML_ATTR(L"opacity", (dVal.get())/100.);
|
||||
// //CP_XML_ATTR(L"opacity2",(dVal.get())/100.);
|
||||
//}
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"v:stroke")
|
||||
{
|
||||
if (odf_reader::GetProperty(c.graphicProperties_,L"stroke-color",strVal))
|
||||
CP_XML_ATTR(L"color", std::wstring(L"#") + strVal.get());
|
||||
else
|
||||
CP_XML_ATTR(L"color",L"#3465af"); //синенький
|
||||
|
||||
if (odf_reader::GetProperty(c.graphicProperties_,L"stroke-opacity",dVal))
|
||||
{
|
||||
CP_XML_ATTR(L"opacity",(100.-dVal.get())/100.);
|
||||
}
|
||||
CP_XML_ATTR(L"endcap", L"flat");
|
||||
CP_XML_ATTR(L"joinstyle", L"round");
|
||||
CP_XML_ATTR(L"startarrow", L"block");
|
||||
CP_XML_ATTR(L"v:startarrowwidth", L"medium");
|
||||
CP_XML_ATTR(L"startarrowlength", L"medium");
|
||||
}
|
||||
CP_XML_NODE(L"x:ClientData")
|
||||
{
|
||||
CP_XML_ATTR(L"ObjectType", L"Note");
|
||||
CP_XML_NODE(L"x:MoveWithCells"){}
|
||||
CP_XML_NODE(L"x:SizeWithCells"){}
|
||||
CP_XML_NODE(L"x:AutoFill"){CP_XML_CONTENT("False");}
|
||||
CP_XML_NODE(L"x:Row"){CP_XML_CONTENT(c.row_);}
|
||||
CP_XML_NODE(L"x:Column"){CP_XML_CONTENT(c.col_);}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
bool empty() const
|
||||
{
|
||||
return ( xlsx_comment_.empty());
|
||||
@ -264,11 +144,6 @@ void xlsx_serialize(std::wostream & _Wostream, xlsx_comments const & val)
|
||||
val.impl_->serialize(_Wostream);
|
||||
}
|
||||
|
||||
void xlsx_serialize_vml(std::wostream & _Wostream, xlsx_comments const & val)
|
||||
{
|
||||
val.impl_->serialize_vml(_Wostream);
|
||||
}
|
||||
|
||||
xlsx_comments_ptr xlsx_comments::create()
|
||||
{
|
||||
return boost::make_shared<xlsx_comments>();
|
||||
|
||||
@ -42,38 +42,24 @@ namespace oox {
|
||||
|
||||
struct _xlsx_comment
|
||||
{
|
||||
size_t left_, top_;
|
||||
size_t width_, height_;
|
||||
|
||||
std::wstring ref_;
|
||||
|
||||
int col_;
|
||||
int row_;
|
||||
|
||||
bool visibly_;
|
||||
|
||||
std::vector<odf_reader::_property> graphicProperties_;
|
||||
|
||||
std::wstring author_;
|
||||
std::wstring content_;
|
||||
};
|
||||
//class rels;
|
||||
|
||||
class xlsx_comments;
|
||||
typedef _CP_PTR(xlsx_comments) xlsx_comments_ptr;
|
||||
|
||||
struct comment_elm
|
||||
{
|
||||
comment_elm(std::wstring const & _filename, std::wstring const & _vml_filename, std::wstring const & _content, std::wstring const & _vml_content, xlsx_comments_ptr _comments)
|
||||
: filename(_filename), content(_content), comments(_comments),vml_filename(_vml_filename),vml_content(_vml_content)
|
||||
comment_elm(std::wstring const & _filename, std::wstring const & _content, xlsx_comments_ptr _comments)
|
||||
: filename(_filename), content(_content), comments(_comments)
|
||||
{}
|
||||
xlsx_comments_ptr comments;
|
||||
|
||||
std::wstring filename;
|
||||
std::wstring content;
|
||||
|
||||
std::wstring vml_filename;
|
||||
std::wstring vml_content;
|
||||
};
|
||||
|
||||
class xlsx_comments
|
||||
@ -87,10 +73,7 @@ public:
|
||||
void add(_xlsx_comment & d);
|
||||
bool empty() const;
|
||||
|
||||
friend void docx_serialize(std::wostream & _Wostream, xlsx_comments const & val);
|
||||
|
||||
friend void xlsx_serialize(std::wostream & _Wostream, xlsx_comments const & val);
|
||||
friend void xlsx_serialize_vml(std::wostream & _Wostream, xlsx_comments const & val);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
#include "../odf/datatypes/length.h"
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
//#include <formulasconvert.h>
|
||||
|
||||
namespace cpdoccore { namespace oox {
|
||||
|
||||
@ -46,32 +45,22 @@ typedef _CP_PTR(xlsx_comments) xlsx_comments_ptr;
|
||||
class xlsx_comments_context_handle::Impl
|
||||
{
|
||||
public:
|
||||
Impl()
|
||||
: next_comments_id_(1) ,next_file_id_(1)
|
||||
Impl() : next_comments_id_(1), next_file_id_(1)
|
||||
{
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_comments_xml(std::wstring const & content, std::wstring const & vml_content,xlsx_comments_ptr comments)
|
||||
std::pair<std::wstring, std::wstring> add_comments_xml(std::wstring const & content, xlsx_comments_ptr comments)
|
||||
{
|
||||
const std::wstring file_id = std::to_wstring(next_file_id_++);
|
||||
|
||||
const std::wstring file_id = std::to_wstring(next_file_id_++);
|
||||
const std::wstring fileName = std::wstring(L"comments") + file_id + L".xml";
|
||||
const std::wstring vml_fileName = std::wstring(L"vmlDrawing") + file_id + L".vml";
|
||||
|
||||
comments_.push_back(comment_elm(fileName,vml_fileName, content, vml_content, comments));
|
||||
comments_.push_back(comment_elm(fileName, content, comments));
|
||||
|
||||
const std::wstring id = std::to_wstring(next_comments_id_++);
|
||||
const std::wstring rId = std::wstring(L"comId") + id;
|
||||
return std::pair<std::wstring, std::wstring>(fileName, rId);
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> get_vml_drawing_xml()
|
||||
{
|
||||
const std::wstring id = std::to_wstring(next_comments_id_++);
|
||||
const std::wstring rId = std::wstring(L"comId") + id;
|
||||
return std::pair<std::wstring, std::wstring>(comments_.back().vml_filename, rId);
|
||||
}
|
||||
|
||||
const std::vector<comment_elm> & content() const
|
||||
{
|
||||
return comments_;
|
||||
@ -89,25 +78,17 @@ xlsx_comments_context_handle::xlsx_comments_context_handle()
|
||||
: impl_(new xlsx_comments_context_handle::Impl())
|
||||
{
|
||||
}
|
||||
|
||||
xlsx_comments_context_handle::~xlsx_comments_context_handle()
|
||||
{
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> xlsx_comments_context_handle::add_comments_xml(std::wstring const & content, std::wstring const & vml_content,xlsx_comments_ptr comments)
|
||||
std::pair<std::wstring, std::wstring> xlsx_comments_context_handle::add_comments_xml(std::wstring const & content, xlsx_comments_ptr comments)
|
||||
{
|
||||
return impl_->add_comments_xml(content,vml_content, comments);
|
||||
return impl_->add_comments_xml(content, comments);
|
||||
}
|
||||
std::pair<std::wstring, std::wstring> xlsx_comments_context_handle::get_vml_drawing_xml()
|
||||
{
|
||||
return impl_->get_vml_drawing_xml();
|
||||
}
|
||||
|
||||
const std::vector<comment_elm> & xlsx_comments_context_handle::content() const
|
||||
{
|
||||
return impl_->content();
|
||||
}
|
||||
|
||||
class xlsx_comments_context::Impl
|
||||
{
|
||||
public:
|
||||
@ -127,10 +108,6 @@ public:
|
||||
{
|
||||
xlsx_serialize(strm, *xlsx_comments_);
|
||||
}
|
||||
void serialize_vml(std::wostream & strm)
|
||||
{
|
||||
xlsx_serialize_vml(strm, *xlsx_comments_);
|
||||
}
|
||||
bool empty() const
|
||||
{
|
||||
return xlsx_comments_->empty();
|
||||
@ -154,40 +131,20 @@ xlsx_comments_context::~xlsx_comments_context()
|
||||
{
|
||||
}
|
||||
|
||||
void xlsx_comments_context::start_comment (double width_pt, double height_pt, double x_pt, double y_pt)
|
||||
void xlsx_comments_context::start_comment(const std::wstring & ref)
|
||||
{
|
||||
impl_->current_.ref_ = L"";
|
||||
impl_->current_.width_ = width_pt;
|
||||
impl_->current_.height_ = height_pt;
|
||||
impl_->current_.left_ = x_pt;
|
||||
impl_->current_.top_ = y_pt;
|
||||
|
||||
impl_->current_.visibly_ = false;
|
||||
impl_->current_.ref_ = ref;
|
||||
}
|
||||
void xlsx_comments_context::add_content(std::wstring content)
|
||||
void xlsx_comments_context::add_content(const std::wstring & content)
|
||||
{
|
||||
impl_->current_.content_ = content;
|
||||
}
|
||||
void xlsx_comments_context::add_author(std::wstring author)
|
||||
void xlsx_comments_context::add_author(const std::wstring & author)
|
||||
{
|
||||
impl_->current_.author_ = author;
|
||||
}
|
||||
void xlsx_comments_context::set_visibly(bool Val)
|
||||
void xlsx_comments_context::end_comment()
|
||||
{
|
||||
impl_->current_.visibly_ = Val;
|
||||
}
|
||||
|
||||
std::vector<odf_reader::_property> & xlsx_comments_context::get_draw_properties()
|
||||
{
|
||||
return impl_->current_.graphicProperties_;
|
||||
|
||||
}
|
||||
void xlsx_comments_context::end_comment(std::wstring ref,int col, int row)
|
||||
{
|
||||
impl_->current_.ref_ = ref;
|
||||
impl_->current_.col_ = col;
|
||||
impl_->current_.row_ = row;
|
||||
|
||||
impl_->add_comment(impl_->current_);
|
||||
}
|
||||
|
||||
@ -200,11 +157,6 @@ void xlsx_comments_context::serialize(std::wostream & strm)
|
||||
{
|
||||
impl_->serialize(strm);
|
||||
}
|
||||
void xlsx_comments_context::serialize_vml(std::wostream & strm)
|
||||
{
|
||||
impl_->serialize_vml(strm);
|
||||
}
|
||||
|
||||
xlsx_comments_ptr xlsx_comments_context::get_comments()
|
||||
{
|
||||
return impl_->get_comments();
|
||||
|
||||
@ -45,16 +45,13 @@ class xlsx_table_metrics;
|
||||
class xlsx_comments;
|
||||
typedef _CP_PTR(xlsx_comments) xlsx_comments_ptr;
|
||||
|
||||
|
||||
|
||||
class xlsx_comments_context_handle
|
||||
{
|
||||
public:
|
||||
xlsx_comments_context_handle();
|
||||
~xlsx_comments_context_handle();
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_comments_xml(std::wstring const & content, std::wstring const & vml_content,xlsx_comments_ptr comments);
|
||||
std::pair<std::wstring, std::wstring> get_vml_drawing_xml();
|
||||
std::pair<std::wstring, std::wstring> add_comments_xml(std::wstring const & content, xlsx_comments_ptr comments);
|
||||
const std::vector<comment_elm> & content() const;
|
||||
|
||||
friend class xlsx_comments_context;
|
||||
@ -72,21 +69,16 @@ public:
|
||||
xlsx_comments_context(xlsx_comments_context_handle & h);
|
||||
~xlsx_comments_context();
|
||||
|
||||
void start_comment(double width_pt, double height_pt, double x_pt, double y_pt);
|
||||
void start_comment(const std::wstring & ref);
|
||||
|
||||
void add_content(std::wstring content);
|
||||
void add_author(std::wstring author);
|
||||
void add_content(const std::wstring & content);
|
||||
void add_author(const std::wstring & author);
|
||||
|
||||
std::vector<odf_reader::_property> & get_draw_properties();
|
||||
|
||||
void set_visibly(bool Val);
|
||||
|
||||
void end_comment(std::wstring ref,int col,int row);
|
||||
void end_comment();
|
||||
|
||||
bool empty() const;
|
||||
|
||||
void serialize (std::wostream & strm);
|
||||
void serialize_vml (std::wostream & strm);
|
||||
void serialize (std::wostream & strm);
|
||||
xlsx_comments_ptr get_comments();
|
||||
|
||||
private:
|
||||
|
||||
@ -55,10 +55,17 @@ struct xlsx_dataValidation
|
||||
std::wstring formula1;
|
||||
std::wstring formula2;
|
||||
std::wstring operator_;
|
||||
|
||||
bool showErrorMessage = false;
|
||||
bool showInputMessage = false;
|
||||
bool showDropDown = false;
|
||||
bool allowBlank = false;
|
||||
|
||||
std::wstring error_text;
|
||||
std::wstring error_title;
|
||||
|
||||
std::wstring promt_text;
|
||||
std::wstring promt_title;
|
||||
};
|
||||
typedef shared_ptr<xlsx_dataValidation>::Type xlsx_dataValidation_ptr;
|
||||
|
||||
@ -103,24 +110,23 @@ public:
|
||||
if (jt2_next == mapCells.end() || jt2->first + 1 != jt2_next->first)
|
||||
break;
|
||||
|
||||
size_t j = 0; bool bFound = false;
|
||||
for (size_t j = 0; j < jt2_next->second.size(); j++)
|
||||
//size_t j = 0;
|
||||
bool bFound = false;
|
||||
|
||||
for (std::vector<std::pair<int, int>>::iterator v_jt2 = jt2_next->second.begin();
|
||||
v_jt2 != jt2_next->second.end(); ++v_jt2)
|
||||
{
|
||||
if (jt1->second[i].first == jt2_next->second[j].first ||
|
||||
jt1->second[i].second == jt2_next->second[j].second)
|
||||
if (jt1->second[i].first == v_jt2->first ||
|
||||
jt1->second[i].second == v_jt2->second)
|
||||
{
|
||||
bFound = true;
|
||||
jt2_next->second.erase(v_jt2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFound)
|
||||
{
|
||||
jt2_next->second.erase(jt2_next->second.begin() + j, jt2_next->second.begin() + j + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (false == bFound)
|
||||
break;
|
||||
}
|
||||
|
||||
jt2 = jt2_next;
|
||||
}
|
||||
if (!activate_ref.empty()) activate_ref += L" ";
|
||||
@ -135,11 +141,33 @@ public:
|
||||
{
|
||||
CP_XML_ATTR(L"sqref", activate_ref);
|
||||
CP_XML_ATTR(L"allowBlank", it->second->allowBlank);
|
||||
CP_XML_ATTR(L"operator", it->second->operator_);
|
||||
if (!it->second->operator_.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"operator", it->second->operator_);
|
||||
}
|
||||
CP_XML_ATTR(L"showDropDown", it->second->showDropDown);
|
||||
CP_XML_ATTR(L"showErrorMessage", it->second->showErrorMessage);
|
||||
CP_XML_ATTR(L"showInputMessage", it->second->showInputMessage);
|
||||
CP_XML_ATTR(L"type", it->second->type);
|
||||
if (!it->second->type.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"type", it->second->type);
|
||||
}
|
||||
if (!it->second->error_title.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"errorTitle", it->second->error_title);
|
||||
}
|
||||
if (!it->second->error_text.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"error", it->second->error_text);
|
||||
}
|
||||
if (!it->second->promt_title.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"promptTitle", it->second->promt_title);
|
||||
}
|
||||
if (!it->second->promt_text.empty())
|
||||
{
|
||||
CP_XML_ATTR(L"prompt", it->second->promt_text);
|
||||
}
|
||||
|
||||
if (!it->second->formula1.empty())
|
||||
{
|
||||
@ -237,22 +265,26 @@ void xlsx_dataValidations_context::add(const std::wstring & name, const std::wst
|
||||
|
||||
impl_->mapDataValidations.insert(std::make_pair(name, _new));
|
||||
}
|
||||
void xlsx_dataValidations_context::add_help_msg(const std::wstring & name, bool val)
|
||||
void xlsx_dataValidations_context::add_help_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
pFind->second->showInputMessage = val;
|
||||
pFind->second->showInputMessage = display;
|
||||
pFind->second->promt_title = title;
|
||||
pFind->second->promt_text = content;
|
||||
}
|
||||
|
||||
void xlsx_dataValidations_context::add_error_msg(const std::wstring & name, bool val)
|
||||
void xlsx_dataValidations_context::add_error_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display)
|
||||
{
|
||||
std::map<std::wstring, xlsx_dataValidation_ptr>::iterator pFind = impl_->mapDataValidations.find(name);
|
||||
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
pFind->second->showErrorMessage = val;
|
||||
pFind->second->showErrorMessage = display;
|
||||
pFind->second->error_title = title;
|
||||
pFind->second->error_text = content;
|
||||
}
|
||||
void xlsx_dataValidations_context::add_formula(const std::wstring & name, const std::wstring & f) // todooo пооптимальней
|
||||
{
|
||||
@ -261,10 +293,10 @@ void xlsx_dataValidations_context::add_formula(const std::wstring & name, const
|
||||
if (pFind == impl_->mapDataValidations.end()) return;
|
||||
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
int pos = -1;
|
||||
std::wstring val;
|
||||
size_t pos;
|
||||
std::wstring val, val2;
|
||||
|
||||
if ( 0 <= (pos = f.find(L"cell-content-is-in-list"))) //oooc: , of:
|
||||
if ( std::wstring::npos != (pos = f.find(L"cell-content-is-in-list"))) //oooc: , of:
|
||||
{
|
||||
pFind->second->type = L"list";
|
||||
val = f.substr(24 + pos, f.size() - 25 - pos);
|
||||
@ -287,6 +319,108 @@ void xlsx_dataValidations_context::add_formula(const std::wstring & name, const
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
}
|
||||
}
|
||||
else if ( std::wstring::npos != (pos = f.find(L"is-true-formula")))
|
||||
{
|
||||
pFind->second->type = L"custom";
|
||||
val = f.substr(16 + pos, f.size() - 17 - pos);
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (std::wstring::npos != (pos = f.find(L"cell-content-is-date")))
|
||||
{
|
||||
pFind->second->type = L"date";
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-decimal-number")))
|
||||
{
|
||||
pFind->second->type = L"decimal";
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-time")))
|
||||
{
|
||||
pFind->second->type = L"time";
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-whole-number")))
|
||||
{
|
||||
pFind->second->type = L"whole";
|
||||
}
|
||||
|
||||
if (std::wstring::npos != (pos = f.find(L"cell-content()==")))
|
||||
{
|
||||
pFind->second->operator_ = L"equal";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()<>")))
|
||||
{
|
||||
pFind->second->operator_ = L"notEqual";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()<=")))
|
||||
{
|
||||
pFind->second->operator_ = L"lessThanOrEqual";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()<")))
|
||||
{
|
||||
pFind->second->operator_ = L"lessThan";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 15);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 15, pos2 - pos - 15);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()>=")))
|
||||
{
|
||||
pFind->second->operator_ = L"greaterThanOrEqual";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 16);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 16, pos2 - pos - 16);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content()>")))
|
||||
{
|
||||
pFind->second->operator_ = L"greaterThan";
|
||||
|
||||
size_t pos2 = f.find(L"and", pos + 15);
|
||||
if (pos2 == std::wstring::npos) pos2 = f.length();
|
||||
|
||||
val = f.substr(pos + 15, pos2 - pos - 15);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-not-between(")))
|
||||
{
|
||||
pFind->second->operator_ = L"greaterThanOrEqual";
|
||||
|
||||
size_t pos2 = f.find(L",", pos + 27);
|
||||
size_t pos3 = f.rfind(L")");
|
||||
|
||||
val = f.substr(pos + 27, pos2 - pos - 27);
|
||||
val2 = f.substr(pos2 + 1, pos3 - pos2 - 1);
|
||||
}
|
||||
else if (std::wstring::npos != (pos = f.find(L"cell-content-is-between(")))
|
||||
{
|
||||
pFind->second->operator_ = L"between";
|
||||
|
||||
size_t pos2 = f.find(L",", pos + 24);
|
||||
size_t pos3 = f.rfind(L")");
|
||||
|
||||
val = f.substr(pos + 24, pos2 - pos - 24);
|
||||
val2 = f.substr(pos2 + 1, pos3 - pos2 - 1);
|
||||
}
|
||||
pFind->second->formula1 = converter.convert(val);
|
||||
pFind->second->formula2 = converter.convert(val2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -46,8 +46,8 @@ public:
|
||||
|
||||
void add(const std::wstring & name, /*int col, int row*/const std::wstring & ref);
|
||||
void add_formula(const std::wstring & name, const std::wstring & f);
|
||||
void add_help_msg(const std::wstring & name, bool val);
|
||||
void add_error_msg(const std::wstring & name, bool val);
|
||||
void add_help_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display);
|
||||
void add_error_msg(const std::wstring & name, const std::wstring & title, const std::wstring & content, bool display);
|
||||
|
||||
void activate(const std::wstring & name, int col, int row/*const std::wstring & ref*/);
|
||||
|
||||
|
||||
@ -35,6 +35,30 @@
|
||||
#include <xml/utils.h>
|
||||
|
||||
#include "../odf/datatypes/custom_shape_types_convert.h"
|
||||
#include "../../formulasconvert/formulasconvert.h"
|
||||
|
||||
#define OBJ_Group 0x0000
|
||||
#define OBJ_Line 0x0001
|
||||
#define OBJ_Rectangle 0x0002
|
||||
#define OBJ_Oval 0x0003
|
||||
#define OBJ_Arc 0x0004
|
||||
#define OBJ_Text 0x0006
|
||||
#define OBJ_OfficeArt 0x001E
|
||||
#define OBJ_Polygon 0x0009
|
||||
#define OBJ_Picture 0x0008
|
||||
#define OBJ_Chart 0x0005
|
||||
#define OBJ_Button 0x0007
|
||||
#define OBJ_CheckBox 0x000B
|
||||
#define OBJ_RadioButton 0x000C
|
||||
#define OBJ_EditBox 0x000D
|
||||
#define OBJ_Label 0x000E
|
||||
#define OBJ_DialogBox 0x000F
|
||||
#define OBJ_SpinControl 0x0010
|
||||
#define OBJ_Scrollbar 0x0011
|
||||
#define OBJ_List 0x0012
|
||||
#define OBJ_GroupBox 0x0013
|
||||
#define OBJ_DropdownList 0x0014
|
||||
#define OBJ_Note 0x0019
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -48,7 +72,7 @@ std::wostream & operator << (std::wostream & strm, xlsx_drawing_position::type_t
|
||||
}
|
||||
|
||||
}
|
||||
void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
void xml_serialize_text(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
_CP_OPT(std::wstring) strTextContent;
|
||||
odf_reader::GetProperty ( val.additional, L"text-content", strTextContent);
|
||||
@ -71,11 +95,17 @@ void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val, const std::w
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_drawing_position::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
std::wstring xlsx_drawing_position::vml_serialize()
|
||||
{
|
||||
//emu -> pt = 1 / 12700 = 72.0 / (360000.0 * 2.54);
|
||||
return std::to_wstring(position.col) + L"," + std::to_wstring((int)(position.colOff / 12700)) + L"," +
|
||||
std::to_wstring(position.row) + L"," + std::to_wstring((int)(position.rowOff / 12700));
|
||||
}
|
||||
void xlsx_drawing_position::serialize(std::wostream & strm, const std::wstring & ns_title, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE( ns + (ns.empty() ? L"" : L":") + (type == xlsx_drawing_position::from ? L"from" : L"to") )
|
||||
CP_XML_NODE( ns_title + (ns_title.empty() ? L"" : L":") + (type == xlsx_drawing_position::from ? L"from" : L"to") )
|
||||
{
|
||||
CP_XML_NODE(ns + (ns.empty() ? L"" : L":") + L"col")
|
||||
{
|
||||
@ -100,7 +130,7 @@ void xlsx_drawing_position::serialize(std::wostream & strm, const std::wstring &
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
void xml_serialize_image(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -113,6 +143,8 @@ void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val, const std::
|
||||
CP_XML_ATTR(L"id", val.id);
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
|
||||
if (val.hidden) CP_XML_ATTR(L"hidden", 1);
|
||||
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
|
||||
}
|
||||
@ -139,12 +171,12 @@ void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val, const std::
|
||||
}
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
xlsx_serialize_text(CP_XML_STREAM(), val, ns);
|
||||
xml_serialize_text(CP_XML_STREAM(), val, ns);
|
||||
}
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
|
||||
void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
void xml_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -155,9 +187,10 @@ void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::
|
||||
CP_XML_NODE(ns + L":cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);//числовое значение val.rId
|
||||
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
|
||||
if (val.hidden) CP_XML_ATTR(L"hidden", 1);
|
||||
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
}
|
||||
CP_XML_NODE(ns + L":cNvSpPr")//non visual properies (собственно тока 1 там)
|
||||
@ -174,11 +207,11 @@ void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::
|
||||
oox_serialize_ln(CP_XML_STREAM(),val.additional, val.lined);
|
||||
} // xdr:spPr
|
||||
|
||||
xlsx_serialize_text(CP_XML_STREAM(), val, ns);
|
||||
xml_serialize_text(CP_XML_STREAM(), val, ns);
|
||||
}
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
void xlsx_serialize_object(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xml_serialize_object(std::wostream & strm, _xlsx_drawing & val)
|
||||
{//отображательная часть
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -190,7 +223,24 @@ void xlsx_serialize_object(std::wostream & strm, _xlsx_drawing & val)
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id); //числовое значение val.rId
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
}
|
||||
|
||||
if (val.hidden) CP_XML_ATTR(L"hidden", 1);
|
||||
|
||||
if (false == val.objectId.empty())
|
||||
{
|
||||
CP_XML_NODE(L"a:extLst")
|
||||
{
|
||||
CP_XML_NODE(L"a:ext")
|
||||
{
|
||||
CP_XML_ATTR(L"uri", L"{63B3BB69-23CF-44E3-9099-C40C66FF867C}");
|
||||
CP_XML_NODE(L"a14:compatExt")
|
||||
{
|
||||
CP_XML_ATTR(L"spid", L"_x0000_s" + std::to_wstring(val.id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"xdr:cNvSpPr");
|
||||
|
||||
}
|
||||
@ -206,7 +256,7 @@ void xlsx_serialize_object(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_serialize_group(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
void xml_serialize_group(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -218,7 +268,9 @@ void xlsx_serialize_group(std::wostream & strm, _xlsx_drawing & val, const std::
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
}
|
||||
|
||||
if (val.hidden) CP_XML_ATTR(L"hidden", 1);
|
||||
}
|
||||
CP_XML_NODE(ns + L":cNvGrpSpPr");
|
||||
}
|
||||
CP_XML_NODE(ns + L":grpSpPr")
|
||||
@ -231,7 +283,7 @@ void xlsx_serialize_group(std::wostream & strm, _xlsx_drawing & val, const std::
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_serialize_chart(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xml_serialize_chart(std::wostream & strm, _xlsx_drawing & val)
|
||||
{//отображательная часть
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -243,7 +295,9 @@ void xlsx_serialize_chart(std::wostream & strm, _xlsx_drawing & val)
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
}
|
||||
|
||||
if (val.hidden) CP_XML_ATTR(L"hidden", 1);
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"xdr:cNvGraphicFramePr");
|
||||
}
|
||||
@ -266,36 +320,37 @@ void xlsx_serialize_chart(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_serialize(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
void xml_serialize(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
if (val.type == typeShape)
|
||||
{
|
||||
xlsx_serialize_shape(strm, val, ns);
|
||||
xml_serialize_shape(strm, val, ns);
|
||||
}
|
||||
else if (val.type == typeImage)
|
||||
{
|
||||
xlsx_serialize_image(strm, val, ns);
|
||||
xml_serialize_image(strm, val, ns);
|
||||
}
|
||||
else if (val.type == typeChart)
|
||||
{
|
||||
xlsx_serialize_chart(strm, val);
|
||||
xml_serialize_chart(strm, val);
|
||||
}
|
||||
else if (val.type == typeGroupShape)
|
||||
{
|
||||
xlsx_serialize_group(strm, val, ns);
|
||||
xml_serialize_group(strm, val, ns);
|
||||
}
|
||||
else if (val.type == typeOleObject ||
|
||||
val.type == typeMsObject ||
|
||||
val.type == typeControl)
|
||||
{
|
||||
xlsx_serialize_object(strm, val);
|
||||
xml_serialize_object(strm, val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _xlsx_drawing::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
if (inGroup)
|
||||
return xlsx_serialize(strm, *this, ns);
|
||||
return xml_serialize(strm, *this, ns);
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -308,7 +363,7 @@ void _xlsx_drawing::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
from_.serialize (CP_XML_STREAM());
|
||||
to_.serialize (CP_XML_STREAM());
|
||||
|
||||
xlsx_serialize (CP_XML_STREAM(), *this, ns);
|
||||
xml_serialize (CP_XML_STREAM(), *this, ns);
|
||||
CP_XML_NODE(ns + L":clientData");
|
||||
}
|
||||
}
|
||||
@ -326,7 +381,7 @@ void _xlsx_drawing::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
CP_XML_ATTR(L"cx", cx);
|
||||
CP_XML_ATTR(L"cy", cy);
|
||||
}
|
||||
xlsx_serialize(CP_XML_STREAM(), *this, ns);
|
||||
xml_serialize(CP_XML_STREAM(), *this, ns);
|
||||
CP_XML_NODE(ns + L":clientData");
|
||||
}
|
||||
}
|
||||
@ -359,14 +414,12 @@ void _xlsx_drawing::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
CP_XML_STREAM() << ((double)y1 / *owner_cy_);
|
||||
}
|
||||
}
|
||||
xlsx_serialize(CP_XML_STREAM(), *this, ns);
|
||||
xml_serialize(CP_XML_STREAM(), *this, ns);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void _xlsx_drawing::serialize_object (std::wostream & strm)
|
||||
{
|
||||
if (type != typeOleObject && type != typeMsObject) return;
|
||||
@ -390,9 +443,8 @@ void _xlsx_drawing::serialize_object (std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"moveWithCells", 1);
|
||||
|
||||
from_.serialize (CP_XML_STREAM(), L"");
|
||||
to_.serialize (CP_XML_STREAM(), L"");
|
||||
|
||||
from_.serialize (CP_XML_STREAM(), L"", L"");
|
||||
to_.serialize (CP_XML_STREAM(), L"", L"");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -422,14 +474,186 @@ void _xlsx_drawing::serialize_control (std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"moveWithCells", 1);
|
||||
|
||||
from_.serialize (CP_XML_STREAM(), L"");
|
||||
to_.serialize (CP_XML_STREAM(), L"");
|
||||
from_.serialize (CP_XML_STREAM(), L"", L"xdr");
|
||||
to_.serialize (CP_XML_STREAM(), L"", L"xdr");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void _xlsx_drawing::serialize_vml(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"v:shape")
|
||||
{
|
||||
CP_XML_ATTR(L"id", L"_x0000_s" + std::to_wstring(id));
|
||||
CP_XML_ATTR(L"type", sub_type == OBJ_Note ? L"#_x0000_t202" : L"#_x0000_t201");
|
||||
|
||||
std::wstring color;
|
||||
|
||||
if (fill.solid)
|
||||
color = fill.solid->color;
|
||||
|
||||
if (!color.empty())
|
||||
CP_XML_ATTR(L"fillcolor", L"#" + color);
|
||||
|
||||
CP_XML_ATTR(L"stroked", /*lined ? */L"t"/* : L"f"*/);
|
||||
|
||||
std::wstring style = L"position:absolute";
|
||||
//style +="margin-left:414.3pt;margin-top:70.2pt;width:144.15pt;height:96.75pt";
|
||||
|
||||
CP_XML_ATTR(L"style", style);
|
||||
CP_XML_NODE(L"v:shadow")
|
||||
{
|
||||
CP_XML_ATTR(L"on", L"t");
|
||||
CP_XML_ATTR(L"obscured", L"t");
|
||||
CP_XML_ATTR(L"color", L"black");
|
||||
}
|
||||
//CP_XML_NODE(L"w10:wrap")
|
||||
//{
|
||||
// CP_XML_ATTR(L"type", L"none");
|
||||
//}
|
||||
vml_serialize_fill(CP_XML_STREAM(), fill);
|
||||
|
||||
vml_serialize_ln(CP_XML_STREAM(), additional);
|
||||
|
||||
vml_serialize_text(CP_XML_STREAM(), additional);
|
||||
|
||||
CP_XML_NODE(L"x:ClientData")
|
||||
{
|
||||
switch(sub_type)
|
||||
{
|
||||
case OBJ_Button: CP_XML_ATTR(L"ObjectType", L"Button"); break;
|
||||
case OBJ_CheckBox: CP_XML_ATTR(L"ObjectType", L"Checkbox");break;
|
||||
case OBJ_RadioButton: CP_XML_ATTR(L"ObjectType", L"Radio"); break;
|
||||
case OBJ_EditBox: CP_XML_ATTR(L"ObjectType", L"Edit"); break;
|
||||
case OBJ_Label: CP_XML_ATTR(L"ObjectType", L"Label"); break;
|
||||
case OBJ_DialogBox: CP_XML_ATTR(L"ObjectType", L"Dialog"); break;
|
||||
case OBJ_SpinControl: CP_XML_ATTR(L"ObjectType", L"Spin"); break;
|
||||
case OBJ_Scrollbar: CP_XML_ATTR(L"ObjectType", L"Scroll"); break;
|
||||
case OBJ_List: CP_XML_ATTR(L"ObjectType", L"List"); break;
|
||||
case OBJ_DropdownList: CP_XML_ATTR(L"ObjectType", L"List"); break;
|
||||
case OBJ_Note: CP_XML_ATTR(L"ObjectType", L"Note"); break;
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"x:MoveWithCells");
|
||||
CP_XML_NODE(L"x:SizeWithCells");
|
||||
CP_XML_NODE(L"x:Anchor")
|
||||
{
|
||||
CP_XML_STREAM() << from_.vml_serialize() << L"," << to_.vml_serialize();
|
||||
}
|
||||
CP_XML_NODE(L"x:AutoFill")
|
||||
{
|
||||
CP_XML_STREAM() << L"False";
|
||||
}
|
||||
|
||||
_CP_OPT(int) base_col, base_row;
|
||||
GetProperty(additional, L"base_col", base_col);
|
||||
GetProperty(additional, L"base_row", base_row);
|
||||
|
||||
if (base_row)
|
||||
{
|
||||
CP_XML_NODE(L"x:Row")
|
||||
{
|
||||
CP_XML_STREAM() << *base_row;
|
||||
}
|
||||
}
|
||||
if (base_col)
|
||||
{
|
||||
CP_XML_NODE(L"x:Column")
|
||||
{
|
||||
CP_XML_STREAM() << *base_col;
|
||||
}
|
||||
}
|
||||
_CP_OPT(std::wstring) sVal;
|
||||
GetProperty(additional, L"linked_cell", sVal);
|
||||
if (sVal)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
std::wstring fmla = converter.convert_named_ref(*sVal);
|
||||
CP_XML_NODE(L"x:FmlaLink")
|
||||
{
|
||||
CP_XML_STREAM() << fmla;
|
||||
}
|
||||
}
|
||||
GetProperty(additional, L"cell_range", sVal);
|
||||
if (sVal)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
std::wstring fmla = converter.convert_named_ref(*sVal);
|
||||
CP_XML_NODE(L"x:FmlaRange")
|
||||
{
|
||||
CP_XML_STREAM() << fmla;
|
||||
}
|
||||
}
|
||||
_CP_OPT(bool) visible;
|
||||
GetProperty(additional, L"visible", visible);
|
||||
if (visible)
|
||||
{
|
||||
if (*visible == false)
|
||||
{
|
||||
CP_XML_NODE(L"x:Visible")
|
||||
{
|
||||
CP_XML_STREAM() << L"False";
|
||||
}
|
||||
}
|
||||
else
|
||||
CP_XML_NODE(L"x:Visible");
|
||||
}
|
||||
|
||||
_CP_OPT(int) nVal;
|
||||
GetProperty(additional, L"min_value", nVal);
|
||||
if (nVal)
|
||||
{
|
||||
CP_XML_NODE(L"x:Min")
|
||||
{
|
||||
CP_XML_STREAM() << *nVal;
|
||||
}
|
||||
}
|
||||
GetProperty(additional, L"max_value", nVal);
|
||||
if (nVal)
|
||||
{
|
||||
CP_XML_NODE(L"x:Max")
|
||||
{
|
||||
CP_XML_STREAM() << *nVal;
|
||||
}
|
||||
}
|
||||
GetProperty(additional, L"step", nVal);
|
||||
if (nVal)
|
||||
{
|
||||
CP_XML_NODE(L"x:Inc")
|
||||
{
|
||||
CP_XML_STREAM() << *nVal;
|
||||
}
|
||||
}
|
||||
GetProperty(additional, L"page_step", nVal);
|
||||
if (nVal)
|
||||
{
|
||||
CP_XML_NODE(L"x:Page")
|
||||
{
|
||||
CP_XML_STREAM() << *nVal;
|
||||
}
|
||||
}
|
||||
GetProperty(additional, L"value", sVal);
|
||||
if (sVal)
|
||||
{
|
||||
CP_XML_NODE(L"x:Val")
|
||||
{
|
||||
CP_XML_STREAM() << *sVal;
|
||||
}
|
||||
}
|
||||
|
||||
GetProperty(additional, L"orientation", sVal);
|
||||
if (sVal)
|
||||
{
|
||||
if (*sVal == L"horizontal") CP_XML_NODE(L"x:Horiz");
|
||||
else CP_XML_NODE(L"x:Vert");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -49,10 +49,10 @@ struct xlsx_drawing_position
|
||||
enum type_t {from, to} type;
|
||||
xlsx_table_position position;
|
||||
|
||||
void serialize(std::wostream & _Wostream, const std::wstring & ns = L"xdr");
|
||||
void serialize(std::wostream & _Wostream, const std::wstring & ns_title = L"xdr", const std::wstring & ns = L"xdr");
|
||||
std::wstring vml_serialize();
|
||||
};
|
||||
|
||||
|
||||
class _xlsx_drawing : public _oox_drawing
|
||||
{
|
||||
public:
|
||||
@ -71,6 +71,7 @@ public:
|
||||
virtual void serialize (std::wostream & strm) {return serialize(strm, L"xdr");}
|
||||
|
||||
void serialize (std::wostream & strm, const std::wstring & ns);
|
||||
void serialize_vml (std::wostream & strm);
|
||||
void serialize_object (std::wostream & strm);
|
||||
void serialize_control (std::wostream & strm);
|
||||
};
|
||||
|
||||
@ -53,15 +53,21 @@ namespace oox {
|
||||
class xlsx_drawing_context_handle::Impl
|
||||
{
|
||||
public:
|
||||
Impl(mediaitems_ptr & items) : items_(items), next_rId_(1), next_drawing_id_(1)
|
||||
Impl(mediaitems_ptr & items) : items_(items), next_drawing_id_(1), next_vml_drawing_id_(1)
|
||||
{
|
||||
}
|
||||
|
||||
mediaitems_ptr & get_mediaitems() { return items_; }
|
||||
|
||||
size_t next_rId()
|
||||
std::pair<std::wstring, std::wstring> add_drawing_vml(std::wstring const & content, xlsx_drawings_ptr drawings)
|
||||
{
|
||||
return next_rId_++;
|
||||
const std::wstring id = std::to_wstring(next_vml_drawing_id_++);
|
||||
const std::wstring fileName = std::wstring(L"vmlDrawing") + id + L".vml";
|
||||
|
||||
drawings_vml_.push_back(drawing_elm(fileName, content, drawings, typeDefault));
|
||||
const std::wstring rId = std::wstring(L"rVId") + id;
|
||||
|
||||
return std::pair<std::wstring, std::wstring>(fileName, rId);
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings, RelsType const & type_)
|
||||
@ -75,20 +81,26 @@ public:
|
||||
return std::pair<std::wstring, std::wstring>(fileName, rId);
|
||||
}
|
||||
|
||||
const std::vector<drawing_elm> & content() const
|
||||
{
|
||||
return drawings_;
|
||||
}
|
||||
const std::vector<drawing_elm> & content() const
|
||||
{
|
||||
return drawings_;
|
||||
}
|
||||
const std::vector<drawing_elm> & content_vml() const
|
||||
{
|
||||
return drawings_vml_;
|
||||
}
|
||||
private:
|
||||
mediaitems_ptr items_;
|
||||
std::vector<drawing_elm> drawings_;
|
||||
|
||||
std::vector<drawing_elm> drawings_;
|
||||
std::vector<drawing_elm> drawings_vml_;
|
||||
|
||||
size_t next_rId_;
|
||||
size_t next_drawing_id_;
|
||||
size_t next_vml_drawing_id_;
|
||||
};
|
||||
|
||||
xlsx_drawing_context_handle::xlsx_drawing_context_handle(mediaitems_ptr & items) :
|
||||
impl_(new xlsx_drawing_context_handle::Impl(items))
|
||||
next_rId_(1024), impl_(new xlsx_drawing_context_handle::Impl(items))
|
||||
{
|
||||
}
|
||||
|
||||
@ -100,12 +112,19 @@ std::pair<std::wstring, std::wstring> xlsx_drawing_context_handle::add_drawing_x
|
||||
{
|
||||
return impl_->add_drawing_xml(content, drawings, type_);
|
||||
}
|
||||
std::pair<std::wstring, std::wstring> xlsx_drawing_context_handle::add_drawing_vml(std::wstring const & content, xlsx_drawings_ptr drawings)
|
||||
{
|
||||
return impl_->add_drawing_vml(content, drawings);
|
||||
}
|
||||
|
||||
const std::vector<drawing_elm> & xlsx_drawing_context_handle::content() const
|
||||
{
|
||||
return impl_->content();
|
||||
}
|
||||
|
||||
const std::vector<drawing_elm> & xlsx_drawing_context_handle::content_vml() const
|
||||
{
|
||||
return impl_->content_vml();
|
||||
}
|
||||
class xlsx_drawing_context::Impl
|
||||
{
|
||||
public:
|
||||
@ -131,15 +150,21 @@ public:
|
||||
{
|
||||
xlsx_drawings_->serialize(strm, ns);
|
||||
}
|
||||
|
||||
void serialize_vml(std::wostream & strm)
|
||||
{
|
||||
xlsx_drawings_->serialize_vml(strm);
|
||||
}
|
||||
bool empty() const
|
||||
{
|
||||
return xlsx_drawings_->empty();
|
||||
}
|
||||
|
||||
bool vml_empty() const
|
||||
{
|
||||
return xlsx_drawings_->vml_empty();
|
||||
}
|
||||
size_t next_rId()
|
||||
{
|
||||
return handle_->impl_->next_rId();
|
||||
return handle_->next_rId();
|
||||
}
|
||||
|
||||
xlsx_drawings_ptr get_drawings()
|
||||
@ -282,7 +307,29 @@ void xlsx_drawing_context::end_shape()
|
||||
{
|
||||
impl_->current_level_->push_back(impl_->object_description_);
|
||||
}
|
||||
void xlsx_drawing_context::start_comment(int base_col, int base_row)
|
||||
{
|
||||
impl_->object_description_.type_ = typeComment;
|
||||
impl_->object_description_.shape_type_ = 0x0019; // OBJ_Note object type for vml
|
||||
|
||||
set_property(odf_reader::_property(L"base_col", base_col));
|
||||
set_property(odf_reader::_property(L"base_row", base_row));
|
||||
}
|
||||
void xlsx_drawing_context::end_comment()
|
||||
{
|
||||
impl_->current_level_->push_back(impl_->object_description_);
|
||||
}
|
||||
void xlsx_drawing_context::start_control(const std::wstring & ctrlPropId, int type)
|
||||
{
|
||||
impl_->object_description_.type_ = typeControl;
|
||||
impl_->object_description_.shape_type_ = type; // object type for vml
|
||||
|
||||
impl_->object_description_.xlink_href_ = ctrlPropId;
|
||||
}
|
||||
void xlsx_drawing_context::end_control()
|
||||
{
|
||||
impl_->current_level_->push_back(impl_->object_description_);
|
||||
}
|
||||
void xlsx_drawing_context::set_use_image_replacement()
|
||||
{
|
||||
impl_->use_image_replacement_ = true;
|
||||
@ -305,11 +352,6 @@ void xlsx_drawing_context::set_ms_object(const std::wstring & path, const std::w
|
||||
impl_->object_description_.xlink_href_ = path;
|
||||
impl_->object_description_.descriptor_ = progId;
|
||||
}
|
||||
void xlsx_drawing_context::set_control(const std::wstring & ctrlPropId)
|
||||
{
|
||||
impl_->object_description_.type_ = typeControl;
|
||||
impl_->object_description_.xlink_href_ = ctrlPropId;
|
||||
}
|
||||
void xlsx_drawing_context::set_image(const std::wstring & path)
|
||||
{
|
||||
int pos_replaicement = path.find(L"ObjectReplacements");
|
||||
@ -446,7 +488,10 @@ bool xlsx_drawing_context::empty() const
|
||||
{
|
||||
return impl_->empty();
|
||||
}
|
||||
|
||||
bool xlsx_drawing_context::vml_empty() const
|
||||
{
|
||||
return impl_->vml_empty();
|
||||
}
|
||||
void xlsx_drawing_context::process_common_properties(drawing_object_description & obj, _xlsx_drawing & drawing, xlsx_table_metrics & table_metrics)
|
||||
{
|
||||
if (obj.anchor_.empty())
|
||||
@ -585,7 +630,7 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx
|
||||
|
||||
if (drawing.type == typeShape)
|
||||
{
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);//собственно это не объект, а доп рел и ref объекта
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, false, false);//собственно это не объект, а доп рел и ref объекта
|
||||
|
||||
isMediaInternal=true;
|
||||
std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
@ -597,7 +642,7 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, typeImage);//объект
|
||||
|
||||
if (drawing.inGroup)
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, obj.type_); // не объект
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, obj.type_, false, false); // не объект
|
||||
}
|
||||
}
|
||||
|
||||
@ -610,8 +655,9 @@ void xlsx_drawing_context::process_chart(drawing_object_description & obj,_xlsx_
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, drawing.objectId, ref, obj.type_);
|
||||
|
||||
if (drawing.inGroup)
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_); // не объект
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_, false, false); // не объект
|
||||
}
|
||||
|
||||
void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx_table_metrics & table_metrics, _xlsx_drawing & drawing, xlsx_drawings_ptr xlsx_drawings_)
|
||||
{
|
||||
std::wstring ref;
|
||||
@ -637,10 +683,11 @@ void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx
|
||||
drawing.to_.position.rowOff = static_cast<size_t>(odf_types::length(to.rowOff, odf_types::length::pt).get_value_unit(odf_types::length::emu));
|
||||
}
|
||||
|
||||
if (obj.type_ == typeControl)
|
||||
if (obj.type_ == typeControl || obj.type_ == typeComment)
|
||||
{
|
||||
drawing.objectId = obj.xlink_href_;
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, drawing.objectId, ref, obj.type_);
|
||||
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, drawing.objectId, ref, obj.type_, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -651,14 +698,14 @@ void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx
|
||||
}
|
||||
|
||||
if (drawing.inGroup)
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_); // не объект
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.objectId, ref, obj.type_, false, false); // не объект
|
||||
}
|
||||
void xlsx_drawing_context::process_shape(drawing_object_description & obj,_xlsx_drawing & drawing, xlsx_drawings_ptr xlsx_drawings_)
|
||||
{
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, rId, ref, obj.type_);
|
||||
}
|
||||
|
||||
@ -702,7 +749,7 @@ void xlsx_drawing_context::process_group_objects(std::vector<drawing_object_desc
|
||||
drawing.lined = obj.lined_;
|
||||
drawing.connector = obj.connector_;
|
||||
|
||||
drawing.sub_type = obj.shape_type_;
|
||||
drawing.sub_type = obj.shape_type_;
|
||||
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
@ -712,7 +759,7 @@ void xlsx_drawing_context::process_group_objects(std::vector<drawing_object_desc
|
||||
drawing.fill.bitmap->rId = impl_->get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
bool in_sheet = (obj.type_== typeOleObject || obj.type_== typeMsObject) ? true : false;
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, in_sheet);//собственно это не объект, а доп рел и ref объекта
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, in_sheet, false);//собственно это не объект, а доп рел и ref объекта
|
||||
|
||||
//object dumps in sheet rels !!
|
||||
}
|
||||
@ -727,8 +774,8 @@ void xlsx_drawing_context::process_group_objects(std::vector<drawing_object_desc
|
||||
case typeGroupShape: process_group ( obj, table_metrics, drawing, xlsx_drawings_); break;
|
||||
case typeMsObject:
|
||||
case typeOleObject:
|
||||
case typeControl:
|
||||
process_object ( obj, table_metrics, drawing, xlsx_drawings_); break;
|
||||
case typeControl:
|
||||
case typeComment: process_object ( obj, table_metrics, drawing, xlsx_drawings_); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -737,6 +784,10 @@ void xlsx_drawing_context::serialize(std::wostream & strm, const std::wstring& n
|
||||
{
|
||||
impl_->serialize(strm, ns);
|
||||
}
|
||||
void xlsx_drawing_context::serialize_vml(std::wostream & strm)
|
||||
{
|
||||
impl_->serialize_vml(strm);
|
||||
}
|
||||
|
||||
xlsx_drawings_ptr xlsx_drawing_context::get_drawings()
|
||||
{
|
||||
|
||||
@ -63,10 +63,20 @@ public:
|
||||
~xlsx_drawing_context_handle();
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings, RelsType const & type_ = typeDefault);
|
||||
const std::vector<drawing_elm> & content() const;
|
||||
std::pair<std::wstring, std::wstring> add_drawing_vml(std::wstring const & content, xlsx_drawings_ptr drawings);
|
||||
|
||||
const std::vector<drawing_elm> & content() const;
|
||||
const std::vector<drawing_elm> & content_vml() const;
|
||||
|
||||
friend class xlsx_drawing_context;
|
||||
|
||||
size_t next_rId()
|
||||
{
|
||||
return next_rId_++;
|
||||
}
|
||||
private:
|
||||
size_t next_rId_;
|
||||
|
||||
class Impl;
|
||||
_CP_PTR(Impl) impl_;
|
||||
};
|
||||
@ -90,7 +100,6 @@ public:
|
||||
void end_group ();
|
||||
|
||||
void start_shape(int type);
|
||||
//...пока тока общие свойства ... частные для каждого объекта пооозже
|
||||
void end_shape();
|
||||
|
||||
void start_frame();
|
||||
@ -98,10 +107,15 @@ public:
|
||||
void set_chart (const std::wstring & path);
|
||||
void set_ole_object (const std::wstring & path, const std::wstring & progId);
|
||||
void set_ms_object (const std::wstring & path, const std::wstring & progId);
|
||||
void set_control (const std::wstring & ctrlPropId);
|
||||
void set_text_box ();
|
||||
void end_frame();
|
||||
|
||||
void start_control(const std::wstring & ctrlPropId, int type);
|
||||
void end_control();
|
||||
|
||||
void start_comment(int base_col, int base_row);
|
||||
void end_comment();
|
||||
|
||||
void set_rect(double width_pt, double height_pt, double x_pt, double y_pt);
|
||||
|
||||
void set_translate (double x_pt, double y_pt);
|
||||
@ -110,13 +124,13 @@ public:
|
||||
|
||||
void set_rel_anchor (_INT32 owner_cx, _INT32 owner_cy);
|
||||
void set_anchor (std::wstring anchor, double x_pt, double y_pt, bool group = false);
|
||||
void set_property (odf_reader::_property p);
|
||||
void set_clipping (const std::wstring & str );
|
||||
void set_fill (_oox_fill & fill);
|
||||
|
||||
void set_is_line_shape(bool val);
|
||||
void set_is_connector_shape(bool val);
|
||||
|
||||
void set_property (odf_reader::_property p);
|
||||
std::vector<odf_reader::_property> & get_properties();
|
||||
|
||||
std::wstring add_hyperlink(std::wstring const & ref);
|
||||
@ -124,9 +138,12 @@ public:
|
||||
void set_use_image_replacement();
|
||||
|
||||
bool empty() const;
|
||||
bool vml_empty() const;
|
||||
|
||||
void clear();
|
||||
|
||||
void serialize(std::wostream & strm, const std::wstring& ns = L"xdr");
|
||||
void serialize_vml(std::wostream & strm);
|
||||
|
||||
std::wstring dump_path(std::vector<svg_path::_polyline> & path, double w,double h);
|
||||
|
||||
|
||||
@ -44,20 +44,35 @@ namespace oox {
|
||||
class xlsx_drawings::Impl
|
||||
{
|
||||
public:
|
||||
void add(_xlsx_drawing const & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel )//объект
|
||||
void add(_xlsx_drawing & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel )//объект
|
||||
{
|
||||
xlsx_drawings_.push_back(d);
|
||||
|
||||
add (isInternal, rid, ref, type, sheet_rel);
|
||||
|
||||
for (size_t i = 0; i < d.hlinks.size(); i++)
|
||||
{
|
||||
xlsx_drawing_rels_.push_back(_rel(false, d.hlinks[i].hId, d.hlinks[i].hRef, typeHyperlink));
|
||||
if ( type == typeControlProps || type == typeComment)
|
||||
{
|
||||
vml_drawings_.push_back(d);
|
||||
add (isInternal, rid, ref, type, sheet_rel, true);
|
||||
}
|
||||
else if (type == typeControl)
|
||||
{
|
||||
vml_drawings_.push_back(d);
|
||||
add (isInternal, rid, ref, type, sheet_rel, true);
|
||||
|
||||
d.hidden = true;
|
||||
drawings_.push_back(d);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawings_.push_back(d);
|
||||
add (isInternal, rid, ref, type, sheet_rel, false);
|
||||
|
||||
for (size_t i = 0; i < d.hlinks.size(); i++)
|
||||
{
|
||||
drawing_rels_.push_back(_rel(false, d.hlinks[i].hId, d.hlinks[i].hRef, typeHyperlink));
|
||||
}
|
||||
if (!d.action.hId.empty())
|
||||
drawing_rels_.push_back(_rel(false, d.action.hId, d.action.hRef, d.action.typeRels));
|
||||
}
|
||||
if (!d.action.hId.empty())
|
||||
xlsx_drawing_rels_.push_back(_rel(false, d.action.hId, d.action.hRef, d.action.typeRels));
|
||||
}
|
||||
void add( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel) //не объект
|
||||
void add( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel, bool vml_rel) //не объект
|
||||
{
|
||||
bool present = false;
|
||||
|
||||
@ -73,25 +88,37 @@ public:
|
||||
if (!present)
|
||||
xlsx_sheet_rels_.push_back (_rel(isInternal, rid, ref, type));
|
||||
}
|
||||
else
|
||||
else if (vml_rel)
|
||||
{
|
||||
for (size_t i = 0 ; i < xlsx_drawing_rels_.size(); i++)
|
||||
for (size_t i = 0 ; i < vml_drawing_rels_.size(); i++)
|
||||
{
|
||||
if (xlsx_drawing_rels_[i].rid == rid && xlsx_drawing_rels_[i].ref == ref)
|
||||
if (vml_drawing_rels_[i].rid == rid && vml_drawing_rels_[i].ref == ref)
|
||||
present = true;
|
||||
}
|
||||
if (!present)
|
||||
xlsx_drawing_rels_.push_back(_rel(isInternal, rid, ref, type));
|
||||
vml_drawing_rels_.push_back(_rel(isInternal, rid, ref, type));
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0 ; i < drawing_rels_.size(); i++)
|
||||
{
|
||||
if (drawing_rels_[i].rid == rid && drawing_rels_[i].ref == ref)
|
||||
present = true;
|
||||
}
|
||||
if (!present)
|
||||
drawing_rels_.push_back(_rel(isInternal, rid, ref, type));
|
||||
}
|
||||
}
|
||||
|
||||
void serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
if (drawings_.empty()) return;
|
||||
|
||||
if (inGroup)
|
||||
{
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
for (size_t i = 0 ; i < drawings_.size(); i++)
|
||||
{
|
||||
xlsx_drawings_[i].serialize(strm, ns);
|
||||
drawings_[i].serialize(strm, ns);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -110,10 +137,76 @@ public:
|
||||
}
|
||||
CP_XML_ATTR(L"xmlns:a" , L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r" , L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"xmlns:a14", L"http://schemas.microsoft.com/office/drawing/2010/main");
|
||||
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
for (size_t i = 0 ; i < drawings_.size(); i++)
|
||||
{
|
||||
xlsx_drawings_[i].serialize(CP_XML_STREAM(), ns);
|
||||
drawings_[i].serialize(CP_XML_STREAM(), ns);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void serialize_vml(std::wostream & strm)
|
||||
{
|
||||
if (vml_drawings_.empty()) return;
|
||||
|
||||
if (inGroup)
|
||||
{
|
||||
for (size_t i = 0 ; i < vml_drawings_.size(); i++)
|
||||
{
|
||||
vml_drawings_[i].serialize_vml(strm);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xml")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:v", L"urn:schemas-microsoft-com:vml");
|
||||
CP_XML_ATTR(L"xmlns:o", L"urn:schemas-microsoft-com:office:office");
|
||||
CP_XML_ATTR(L"xmlns:x", L"urn:schemas-microsoft-com:office:excel");
|
||||
|
||||
CP_XML_NODE(L"v:shapetype")
|
||||
{
|
||||
CP_XML_ATTR(L"id", L"_x0000_t201");
|
||||
CP_XML_ATTR(L"o:spt", L"201"); // sptHostControl = 201
|
||||
|
||||
CP_XML_ATTR(L"coordsize", L"21600,21600");
|
||||
CP_XML_ATTR(L"path", L"m,l,21600r21600,l21600,xe");
|
||||
|
||||
CP_XML_NODE(L"v:stroke")
|
||||
{
|
||||
CP_XML_ATTR(L"joinstyle", L"miter");
|
||||
}
|
||||
CP_XML_NODE(L"v:path")
|
||||
{
|
||||
CP_XML_ATTR(L"gradientshapeok", L"t");
|
||||
CP_XML_ATTR(L"o:connecttype", L"rect");
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"v:shapetype")
|
||||
{
|
||||
CP_XML_ATTR(L"id", L"_x0000_t202");
|
||||
CP_XML_ATTR(L"o:spt", L"202"); // sptTextBox = 202
|
||||
|
||||
CP_XML_ATTR(L"coordsize", L"21600,21600");
|
||||
CP_XML_ATTR(L"path", L"m,l,21600l21600,21600l21600,xe");
|
||||
|
||||
CP_XML_NODE(L"v:stroke")
|
||||
{
|
||||
CP_XML_ATTR(L"joinstyle", L"miter");
|
||||
}
|
||||
CP_XML_NODE(L"v:path")
|
||||
{
|
||||
CP_XML_ATTR(L"gradientshapeok", L"t");
|
||||
CP_XML_ATTR(L"o:connecttype", L"rect");
|
||||
}
|
||||
}
|
||||
for (size_t i = 0 ; i < vml_drawings_.size(); i++)
|
||||
{
|
||||
vml_drawings_[i].serialize_vml(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -121,41 +214,62 @@ public:
|
||||
}
|
||||
void serialize_objects(std::wostream & strm)
|
||||
{
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
for (size_t i = 0 ; i < drawings_.size(); i++)
|
||||
{
|
||||
if (xlsx_drawings_[i].type != typeOleObject && xlsx_drawings_[i].type != typeMsObject) continue;
|
||||
if (drawings_[i].type != typeOleObject && drawings_[i].type != typeMsObject) continue;
|
||||
|
||||
xlsx_drawings_[i].serialize_object(strm);
|
||||
drawings_[i].serialize_object(strm);
|
||||
}
|
||||
}
|
||||
void serialize_controls(std::wostream & strm)
|
||||
{
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
for (size_t i = 0 ; i < vml_drawings_.size(); i++)
|
||||
{
|
||||
if (xlsx_drawings_[i].type != typeControl) continue;
|
||||
if (vml_drawings_[i].type != typeControl) continue;
|
||||
|
||||
xlsx_drawings_[i].serialize_control(strm);
|
||||
vml_drawings_[i].serialize_control(strm);
|
||||
}
|
||||
}
|
||||
bool empty() const
|
||||
{
|
||||
return (xlsx_drawings_.empty());
|
||||
return (drawings_.empty());
|
||||
}
|
||||
bool vml_empty() const
|
||||
{
|
||||
return (vml_drawings_.empty());
|
||||
}
|
||||
|
||||
void dump_rels_drawing(rels & Rels)
|
||||
{
|
||||
for (size_t i = 0 ; i < xlsx_drawing_rels_.size(); i++)
|
||||
for (size_t i = 0 ; i < drawing_rels_.size(); i++)
|
||||
{
|
||||
if (xlsx_drawing_rels_[i].type == typeImage ||
|
||||
xlsx_drawing_rels_[i].type == typeMedia ||
|
||||
xlsx_drawing_rels_[i].type == typeChart ||
|
||||
xlsx_drawing_rels_[i].type == typeHyperlink )
|
||||
if (drawing_rels_[i].type == typeImage ||
|
||||
drawing_rels_[i].type == typeMedia ||
|
||||
drawing_rels_[i].type == typeChart ||
|
||||
drawing_rels_[i].type == typeHyperlink )
|
||||
{
|
||||
|
||||
Rels.add(relationship( xlsx_drawing_rels_[i].rid,
|
||||
mediaitems::get_rel_type(xlsx_drawing_rels_[i].type),
|
||||
(xlsx_drawing_rels_[i].is_internal ? std::wstring(L"../") + xlsx_drawing_rels_[i].ref : xlsx_drawing_rels_[i].ref),
|
||||
(xlsx_drawing_rels_[i].is_internal ? L"" : L"External")) );
|
||||
Rels.add(relationship( drawing_rels_[i].rid,
|
||||
mediaitems::get_rel_type(drawing_rels_[i].type),
|
||||
(drawing_rels_[i].is_internal ? std::wstring(L"../") + drawing_rels_[i].ref : drawing_rels_[i].ref),
|
||||
(drawing_rels_[i].is_internal ? L"" : L"External")) );
|
||||
}
|
||||
}
|
||||
}
|
||||
void dump_rels_vml_drawing(rels & Rels)
|
||||
{
|
||||
for (size_t i = 0 ; i < vml_drawing_rels_.size(); i++)
|
||||
{
|
||||
if (vml_drawing_rels_[i].type == typeImage ||
|
||||
vml_drawing_rels_[i].type == typeMedia ||
|
||||
vml_drawing_rels_[i].type == typeChart ||
|
||||
vml_drawing_rels_[i].type == typeHyperlink )
|
||||
{
|
||||
|
||||
Rels.add(relationship( vml_drawing_rels_[i].rid,
|
||||
mediaitems::get_rel_type(vml_drawing_rels_[i].type),
|
||||
(vml_drawing_rels_[i].is_internal ? std::wstring(L"../") + vml_drawing_rels_[i].ref : vml_drawing_rels_[i].ref),
|
||||
(vml_drawing_rels_[i].is_internal ? L"" : L"External")) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -173,9 +287,11 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
std::vector<_xlsx_drawing> xlsx_drawings_;
|
||||
std::vector<_xlsx_drawing> drawings_;
|
||||
std::vector<_xlsx_drawing> vml_drawings_;
|
||||
|
||||
std::vector<_rel> xlsx_drawing_rels_;
|
||||
std::vector<_rel> drawing_rels_;
|
||||
std::vector<_rel> vml_drawing_rels_;
|
||||
std::vector<_rel> xlsx_sheet_rels_;
|
||||
};
|
||||
|
||||
@ -188,21 +304,25 @@ xlsx_drawings::~xlsx_drawings()
|
||||
{
|
||||
}
|
||||
|
||||
void xlsx_drawings::add(_xlsx_drawing const & d, bool isInternal, std::wstring const & rid,
|
||||
void xlsx_drawings::add(_xlsx_drawing & d, bool isInternal, std::wstring const & rid,
|
||||
std::wstring const & ref, RelsType type, bool sheet_rel)
|
||||
{
|
||||
impl_->add(d, isInternal, rid, ref, type, sheet_rel);
|
||||
}
|
||||
|
||||
void xlsx_drawings::add( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel)
|
||||
void xlsx_drawings::add( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel, bool vml_rel)
|
||||
{
|
||||
impl_->add(isInternal, rid, ref, type, sheet_rel);
|
||||
impl_->add(isInternal, rid, ref, type, sheet_rel, vml_rel);
|
||||
}
|
||||
|
||||
void xlsx_drawings::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
impl_->serialize(strm, ns);
|
||||
}
|
||||
void xlsx_drawings::serialize_vml(std::wostream & strm)
|
||||
{
|
||||
impl_->serialize_vml(strm);
|
||||
}
|
||||
|
||||
void xlsx_drawings::serialize_objects(std::wostream & strm)
|
||||
{
|
||||
@ -217,12 +337,18 @@ bool xlsx_drawings::empty() const
|
||||
{
|
||||
return impl_->empty();
|
||||
}
|
||||
|
||||
bool xlsx_drawings::vml_empty() const
|
||||
{
|
||||
return impl_->vml_empty();
|
||||
}
|
||||
void xlsx_drawings::dump_rels_drawing(rels & Rels)
|
||||
{
|
||||
return impl_->dump_rels_drawing(Rels);
|
||||
}
|
||||
|
||||
void xlsx_drawings::dump_rels_vml_drawing(rels & Rels)
|
||||
{
|
||||
return impl_->dump_rels_vml_drawing(Rels);
|
||||
}
|
||||
void xlsx_drawings::dump_rels_sheet(rels & Rels)
|
||||
{
|
||||
return impl_->dump_rels_sheet(Rels);
|
||||
|
||||
@ -65,14 +65,18 @@ public:
|
||||
~xlsx_drawings ();
|
||||
static xlsx_drawings_ptr create(bool inGroup);
|
||||
|
||||
void add ( _xlsx_drawing const & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel = false );
|
||||
void add ( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel = false );
|
||||
void add ( _xlsx_drawing & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel = false );
|
||||
void add ( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type, bool sheet_rel, bool vml_rel);
|
||||
|
||||
bool empty () const;
|
||||
void dump_rels_sheet (rels & Rels);
|
||||
void dump_rels_drawing (rels & Rels);
|
||||
bool empty() const;
|
||||
bool vml_empty() const;
|
||||
|
||||
void dump_rels_sheet (rels & Rels);
|
||||
void dump_rels_drawing (rels & Rels);
|
||||
void dump_rels_vml_drawing (rels & Rels);
|
||||
|
||||
void serialize (std::wostream & _Wostream, const std::wstring & ns);
|
||||
void serialize_vml (std::wostream & _Wostream);
|
||||
void serialize_objects (std::wostream & _Wostream);
|
||||
void serialize_controls (std::wostream & _Wostream);
|
||||
private:
|
||||
|
||||
@ -49,7 +49,6 @@ public:
|
||||
std::wstringstream sheetFormat_;
|
||||
std::wstringstream sheetData_;
|
||||
std::wstringstream mergeCells_;
|
||||
std::wstringstream drawing_;
|
||||
std::wstringstream hyperlinks_;
|
||||
std::wstringstream comments_;
|
||||
std::wstringstream sort_;
|
||||
@ -60,6 +59,7 @@ public:
|
||||
std::wstringstream dataValidations_;
|
||||
std::wstringstream ole_objects_;
|
||||
std::wstringstream page_props_;
|
||||
std::wstringstream header_footer_;
|
||||
std::wstringstream controls_;
|
||||
std::wstringstream protection_;
|
||||
|
||||
@ -130,10 +130,6 @@ std::wostream & xlsx_xml_worksheet::autofilter()
|
||||
{
|
||||
return impl_->autofilter_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::drawing()
|
||||
{
|
||||
return impl_->drawing_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::comments()
|
||||
{
|
||||
return impl_->comments_;
|
||||
@ -154,6 +150,10 @@ std::wostream & xlsx_xml_worksheet::page_properties()
|
||||
{
|
||||
return impl_->page_props_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::header_footer()
|
||||
{
|
||||
return impl_->header_footer_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::picture_background()
|
||||
{
|
||||
return impl_->picture_background_;
|
||||
@ -217,35 +217,40 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}//props выше legacyDrawing !!
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
//props выше legacyDrawing !!
|
||||
|
||||
CP_XML_STREAM() << impl_->header_footer_.str();
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (!impl_->commentsId_.empty())
|
||||
if (false == impl_->drawingId_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"drawing")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", impl_->drawingId_);
|
||||
}
|
||||
}
|
||||
if (false == impl_->vml_drawingId_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"legacyDrawing")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id",impl_->vml_drawingId_);
|
||||
CP_XML_ATTR(L"r:id", impl_->vml_drawingId_);
|
||||
}
|
||||
}
|
||||
if (!impl_->ole_objects_.str().empty())
|
||||
if (false == impl_->ole_objects_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"oleObjects")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->controls_.str().empty())
|
||||
if (false == impl_->controls_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"controls")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->controls_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->tableParts_.str().empty())
|
||||
if (false == impl_->tableParts_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"tableParts")
|
||||
{
|
||||
|
||||
@ -58,7 +58,6 @@ public:
|
||||
std::wostream & sheetData();
|
||||
std::wostream & hyperlinks();
|
||||
std::wostream & mergeCells();
|
||||
std::wostream & drawing();
|
||||
std::wostream & comments();
|
||||
std::wostream & autofilter();
|
||||
std::wostream & tableParts();
|
||||
@ -68,6 +67,7 @@ public:
|
||||
std::wostream & sort();
|
||||
std::wostream & ole_objects();
|
||||
std::wostream & page_properties();
|
||||
std::wostream & header_footer();
|
||||
std::wostream & controls();
|
||||
std::wostream & protection();
|
||||
|
||||
|
||||
@ -558,18 +558,20 @@ void xl_control_props_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
xl_drawings_ptr xl_drawings::create(const std::vector<drawing_elm> & elms)
|
||||
xl_drawings_ptr xl_drawings::create(const std::vector<drawing_elm> & elms, const std::vector<drawing_elm> & vml_elms)
|
||||
{
|
||||
return boost::make_shared<xl_drawings>(boost::ref(elms));
|
||||
return boost::make_shared<xl_drawings>(boost::ref(elms), boost::ref(vml_elms));
|
||||
}
|
||||
|
||||
void xl_drawings::write(const std::wstring & RootPath)
|
||||
{
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
if (drawings_.empty() && vml_drawings_.empty()) return;
|
||||
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"drawings";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
pptx_document *pptx = dynamic_cast<pptx_document*>(this->get_main_document());
|
||||
xlsx_document *xlsx = dynamic_cast<xlsx_document*>(this->get_main_document());
|
||||
docx_document *docx = dynamic_cast<docx_document*>(this->get_main_document());
|
||||
@ -594,6 +596,20 @@ void xl_drawings::write(const std::wstring & RootPath)
|
||||
|
||||
contentTypes->add_override(override_str + drawings_[i].filename, kDrawingCT);
|
||||
}
|
||||
for (size_t i = 0; i < vml_drawings_.size(); i++)
|
||||
{
|
||||
package::simple_element(vml_drawings_[i].filename, vml_drawings_[i].content).write(path);
|
||||
|
||||
rels_files relFiles;
|
||||
rels_file_ptr r = rels_file::create(vml_drawings_[i].filename + L".rels");
|
||||
|
||||
vml_drawings_[i].drawings->dump_rels_vml_drawing(r->get_rels());
|
||||
|
||||
relFiles.add_rel_file(r);
|
||||
relFiles.write(path);
|
||||
|
||||
//content types - default
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
@ -604,9 +620,6 @@ xl_comments_ptr xl_comments::create(const std::vector<comment_elm> & elms)
|
||||
|
||||
void xl_comments::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring vml_path = RootPath + FILE_SEPARATOR_STR + L"drawings";
|
||||
NSDirectory::CreateDirectory(vml_path.c_str());
|
||||
|
||||
for (size_t i = 0; i < comments_.size(); i++)
|
||||
{
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
@ -615,7 +628,6 @@ void xl_comments::write(const std::wstring & RootPath)
|
||||
contentTypes->add_override(std::wstring(L"/xl/") + comments_[i].filename, kWSConType);
|
||||
|
||||
package::simple_element(comments_[i].filename, comments_[i].content).write(RootPath);
|
||||
package::simple_element(comments_[i].vml_filename, comments_[i].vml_content).write(vml_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -244,20 +244,27 @@ class xl_drawings: public element
|
||||
{
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
void set_rels(rels_files * rels)
|
||||
{
|
||||
rels_ = rels;
|
||||
}
|
||||
|
||||
xl_drawings(const std::vector<drawing_elm> & elms) : drawings_ ( elms )
|
||||
|
||||
//void set_rels(rels_files * rels)
|
||||
// {
|
||||
// rels_ = rels;
|
||||
// }
|
||||
//void set_vml_rels(rels_files * rels)
|
||||
// {
|
||||
// vml_rels_ = rels;
|
||||
// }
|
||||
xl_drawings(const std::vector<drawing_elm> & elms, const std::vector<drawing_elm> & vml_elms) : drawings_(elms), vml_drawings_(vml_elms)
|
||||
{
|
||||
}
|
||||
|
||||
static xl_drawings_ptr create(const std::vector<drawing_elm> & elms);
|
||||
static xl_drawings_ptr create(const std::vector<drawing_elm> & elms, const std::vector<drawing_elm> & vml_elms);
|
||||
|
||||
private:
|
||||
const std::vector<drawing_elm> & drawings_;
|
||||
rels_files * rels_;
|
||||
const std::vector<drawing_elm> & vml_drawings_;
|
||||
|
||||
//rels_files * rels_;
|
||||
//rels_files * vml_rels_;
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
class xl_control_props_files : public element
|
||||
|
||||
@ -406,6 +406,49 @@ void xlsx_table_state::serialize_page_properties (std::wostream & strm)
|
||||
|
||||
page_layout->xlsx_serialize(strm, *context_);
|
||||
}
|
||||
void xlsx_table_state::serialize_header_footer (std::wostream & strm)
|
||||
{
|
||||
_CP_OPT(std::wstring) masterPageName = context_->root()->odf_context().styleContainer().master_page_name_by_name(table_style_);
|
||||
if (!masterPageName) return;
|
||||
|
||||
odf_reader::style_master_page* master_style_ = context_->root()->odf_context().pageLayoutContainer().master_page_by_name(*masterPageName);
|
||||
if (!master_style_) return;
|
||||
|
||||
odf_reader::style_header *header_odd = dynamic_cast<odf_reader::style_header*> (master_style_->style_header_.get());
|
||||
odf_reader::style_header_first *header_first = dynamic_cast<odf_reader::style_header_first*> (master_style_->style_header_first_.get());
|
||||
odf_reader::style_header_left *header_even = dynamic_cast<odf_reader::style_header_left*> (master_style_->style_header_left_.get());
|
||||
|
||||
odf_reader::style_footer *footer_odd = dynamic_cast<odf_reader::style_footer*> (master_style_->style_footer_.get());
|
||||
odf_reader::style_footer_first *footer_first = dynamic_cast<odf_reader::style_footer_first*> (master_style_->style_footer_first_.get());
|
||||
odf_reader::style_footer_left *footer_even = dynamic_cast<odf_reader::style_footer_left*> (master_style_->style_footer_left_.get());
|
||||
|
||||
if (!header_odd && !header_first && !header_even &&
|
||||
!footer_odd && !footer_first && !footer_even) return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"headerFooter")
|
||||
{
|
||||
if (master_style_->style_header_left_ || master_style_->style_footer_left_)
|
||||
{
|
||||
CP_XML_ATTR(L"differentOddEven", 1);
|
||||
}
|
||||
if (master_style_->style_header_first_ || master_style_->style_footer_first_)
|
||||
{
|
||||
CP_XML_ATTR(L"differentFirst", 1);
|
||||
}
|
||||
|
||||
if (header_odd) header_odd->xlsx_serialize(CP_XML_STREAM(), *context_);
|
||||
if (footer_odd) footer_odd->xlsx_serialize(CP_XML_STREAM(), *context_);
|
||||
|
||||
if (header_even) header_even->xlsx_serialize(CP_XML_STREAM(), *context_);
|
||||
if (footer_even) footer_even->xlsx_serialize(CP_XML_STREAM(), *context_);
|
||||
|
||||
if (header_first) header_first->xlsx_serialize(CP_XML_STREAM(), *context_);
|
||||
if (footer_first) footer_first->xlsx_serialize(CP_XML_STREAM(), *context_);
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_table_state::serialize_background (std::wostream & strm)
|
||||
{
|
||||
if (tableBackground_.empty()) return;
|
||||
@ -485,6 +528,10 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
CP_XML_ATTR(L"rightToLeft", 1);
|
||||
|
||||
std::wstring s_col, s_row;
|
||||
|
||||
bool bXSplit = false, bYSplit = false;
|
||||
int nXSplit = 0, nYSplit = 0;
|
||||
|
||||
for (int i = 0; i < odfContext.Settings().get_table_view_count(0, tableName_); i++)
|
||||
{
|
||||
std::pair<std::wstring, std::wstring> value = odfContext.Settings().get_table_view(0, tableName_, i);
|
||||
@ -494,9 +541,14 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
CP_XML_ATTR(L"zoomScale", value.second);
|
||||
CP_XML_ATTR(L"zoomScaleNormal", value.second);
|
||||
}
|
||||
if (value.first == L"ShowGrid") CP_XML_ATTR(L"showGridLines", value.second);
|
||||
if (value.first == L"CursorPositionX") s_col = value.second;
|
||||
if (value.first == L"CursorPositionY") s_row = value.second;
|
||||
if (value.first == L"ShowGrid") CP_XML_ATTR(L"showGridLines", value.second);
|
||||
else if (value.first == L"CursorPositionX") s_col = value.second;
|
||||
else if (value.first == L"CursorPositionY") s_row = value.second;
|
||||
|
||||
else if (value.first == L"HorizontalSplitMode") bXSplit = (value.second == L"2");
|
||||
else if (value.first == L"VerticalSplitMode") bYSplit = (value.second == L"2");
|
||||
else if (value.first == L"HorizontalSplitPosition") nXSplit = boost::lexical_cast<int>(value.second);
|
||||
else if (value.first == L"VerticalSplitPosition") nYSplit = boost::lexical_cast<int>(value.second);
|
||||
}
|
||||
|
||||
int col = -1, row = -1;
|
||||
@ -507,16 +559,26 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
}
|
||||
catch(...){}
|
||||
|
||||
if (bXSplit || bYSplit)
|
||||
{
|
||||
CP_XML_NODE(L"pane")
|
||||
{
|
||||
CP_XML_ATTR(L"xSplit", bXSplit ? nXSplit : 0);
|
||||
CP_XML_ATTR(L"ySplit", bYSplit ? nYSplit : 0);
|
||||
CP_XML_ATTR(L"topLeftCell", getCellAddress(nXSplit, nYSplit));
|
||||
CP_XML_ATTR(L"activePane", L"bottomLeft");
|
||||
CP_XML_ATTR(L"state", L"frozen");
|
||||
}
|
||||
}
|
||||
if (col >= 0 && row >= 0)
|
||||
{
|
||||
CP_XML_NODE(L"selection")
|
||||
{
|
||||
CP_XML_ATTR(L"activeCell", getCellAddress(col, row));
|
||||
CP_XML_ATTR(L"activeCellId", 0);
|
||||
CP_XML_ATTR(L"pane", L"topLeft");
|
||||
CP_XML_ATTR(L"pane", ((bXSplit || bYSplit) ? L"bottomLeft" : L"topLeft"));
|
||||
CP_XML_ATTR(L"sqref", getCellAddress(col, row));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,6 +184,7 @@ public:
|
||||
void serialize_page_properties (std::wostream & _Wostream);
|
||||
void serialize_background (std::wostream & _Wostream);
|
||||
void serialize_protection (std::wostream & _Wostream);
|
||||
void serialize_header_footer (std::wostream & _Wostream);
|
||||
|
||||
void dump_rels_hyperlinks (rels & Rels);
|
||||
void dump_rels_ole_objects (rels & Rels);
|
||||
@ -217,6 +218,9 @@ private:
|
||||
int tableId_;
|
||||
std::wstring tableBackground_;
|
||||
|
||||
_CP_OPT(double) header_page;
|
||||
_CP_OPT(double) footer_page;
|
||||
|
||||
std::wstring table_style_;
|
||||
std::wstring table_row_style_;
|
||||
std::wstring cell_style_;
|
||||
|
||||
@ -290,6 +290,23 @@ unsigned int xlsx_table_context::columns_count()
|
||||
return state()->columns_count();
|
||||
}
|
||||
|
||||
void xlsx_table_context::set_header_page(_CP_OPT(double) val)
|
||||
{
|
||||
state()->header_page = val;
|
||||
}
|
||||
_CP_OPT(double) xlsx_table_context::get_header_page()
|
||||
{
|
||||
return state()->header_page;
|
||||
}
|
||||
void xlsx_table_context::set_footer_page(_CP_OPT(double) val)
|
||||
{
|
||||
state()->footer_page = val;
|
||||
}
|
||||
_CP_OPT(double) xlsx_table_context::get_footer_page()
|
||||
{
|
||||
return state()->footer_page;
|
||||
}
|
||||
|
||||
std::wstring xlsx_table_context::default_row_cell_style()
|
||||
{
|
||||
return state()->default_row_cell_style();
|
||||
@ -340,6 +357,12 @@ void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels &
|
||||
|
||||
// из за дебелизма мсофис которому ОБЯЗАТЕЛЬНО нужно прописывать имена колонок таблицы (и они должны быть еще
|
||||
// прописаны и в самих данных таблицы !!
|
||||
|
||||
while (xlsx_data_ranges_[it->second]->header_values.size() > xlsx_data_ranges_[it->second]->cell_end.first -
|
||||
xlsx_data_ranges_[it->second]->cell_start.first + 1)
|
||||
{
|
||||
xlsx_data_ranges_[it->second]->header_values.pop_back();
|
||||
}
|
||||
int i = xlsx_data_ranges_[it->second]->header_values.size() - 1;
|
||||
for (; i >= 0; i--)
|
||||
{
|
||||
@ -505,6 +528,10 @@ void xlsx_table_context::serialize_page_properties(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_page_properties(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_header_footer(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_header_footer(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_background(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_background(_Wostream);
|
||||
|
||||
@ -83,6 +83,12 @@ public:
|
||||
|
||||
unsigned int columns_count();
|
||||
|
||||
void set_header_page(_CP_OPT(double) val);
|
||||
_CP_OPT(double) get_header_page();
|
||||
|
||||
void set_footer_page(_CP_OPT(double) val);
|
||||
_CP_OPT(double) get_footer_page();
|
||||
|
||||
void serialize_tableParts (std::wostream & _Wostream, rels & Rels);
|
||||
void serialize_sort (std::wostream & _Wostream);
|
||||
void serialize_autofilter (std::wostream & _Wostream);
|
||||
@ -96,6 +102,7 @@ public:
|
||||
void serialize_background (std::wostream & _Wostream);
|
||||
void serialize_data_validation (std::wostream & _Wostream);
|
||||
void serialize_protection (std::wostream & _Wostream);
|
||||
void serialize_header_footer (std::wostream & _Wostream);
|
||||
|
||||
xlsx_table_metrics & get_table_metrics();
|
||||
|
||||
|
||||
@ -74,7 +74,10 @@ public:
|
||||
void start_drawing_content();
|
||||
std::wstring end_drawing_content();
|
||||
|
||||
void serialize_shared_strings(std::wostream & strm);
|
||||
void start_only_text();
|
||||
std::wstring end_only_text();
|
||||
|
||||
void serialize_shared_strings(std::wostream & strm);
|
||||
|
||||
void ApplyTextProperties (std::wstring style, std::wstring para_style, odf_reader::text_format_properties_content & propertiesOut);
|
||||
void ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut);
|
||||
@ -94,6 +97,7 @@ private:
|
||||
bool in_span;
|
||||
bool in_paragraph;
|
||||
bool in_cell_content;
|
||||
bool only_text;
|
||||
|
||||
odf_reader::styles_container & styles_;
|
||||
odf_reader::text_format_properties_content * text_properties_cell_;
|
||||
@ -126,7 +130,7 @@ void xlsx_text_context::Impl::serialize_shared_strings(std::wostream & strm)
|
||||
|
||||
|
||||
xlsx_text_context::Impl::Impl(odf_reader::styles_container & styles): paragraphs_cout_(0),styles_(styles),
|
||||
in_comment(false),in_draw(false),in_paragraph(false),in_span(false),in_cell_content(false)
|
||||
in_comment(false),in_draw(false),in_paragraph(false),in_span(false),in_cell_content(false),only_text(false)
|
||||
{
|
||||
local_styles_ptr_ = NULL;
|
||||
text_properties_cell_ = NULL;
|
||||
@ -136,7 +140,7 @@ void xlsx_text_context::Impl::add_text(const std::wstring & text)
|
||||
{
|
||||
text_ << text;
|
||||
|
||||
if (!in_comment && !in_draw)
|
||||
if (!in_comment && !in_draw && !only_text)
|
||||
dump_run();
|
||||
}
|
||||
|
||||
@ -149,7 +153,7 @@ void xlsx_text_context::Impl::start_paragraph(const std::wstring & styleName)
|
||||
{
|
||||
if (paragraphs_cout_++ > 0)
|
||||
{
|
||||
if ( in_comment == true )
|
||||
if ( in_comment || only_text)
|
||||
{
|
||||
// конец предыдущего абзаца и начало следующего
|
||||
//text_ << L" ";
|
||||
@ -169,7 +173,7 @@ void xlsx_text_context::Impl::start_paragraph(const std::wstring & styleName)
|
||||
|
||||
void xlsx_text_context::Impl::end_paragraph()
|
||||
{
|
||||
if (!in_comment && !in_draw)
|
||||
if (!in_comment && !in_draw && !only_text)
|
||||
{
|
||||
dump_run();
|
||||
paragraph_style_name_ = L"";
|
||||
@ -181,7 +185,7 @@ void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кус
|
||||
{
|
||||
int text_size = text_.str().length();
|
||||
|
||||
if (in_comment || in_draw)
|
||||
if (in_comment || in_draw || only_text)
|
||||
{
|
||||
if (( span_style_name_ != styleName && text_size > 0 ) || in_span)
|
||||
{
|
||||
@ -202,12 +206,12 @@ void xlsx_text_context::Impl::start_span(const std::wstring & styleName)//кус
|
||||
void xlsx_text_context::Impl::end_span() //odf корявенько написан - возможны повторы стилей в последовательных кусках текста
|
||||
//пока с анализом стилей тока комменты - остальные текстовые куски как есть.. с охрененным возможно дубляжом
|
||||
{
|
||||
if (!in_comment)
|
||||
if (!in_comment && !only_text)
|
||||
{
|
||||
dump_run();
|
||||
span_style_name_=L"";
|
||||
span_style_name_ = L"";
|
||||
}
|
||||
in_span=false;
|
||||
in_span = false;
|
||||
}
|
||||
|
||||
std::wstring xlsx_text_context::Impl::end_span2()
|
||||
@ -375,7 +379,9 @@ std::wstring xlsx_text_context::Impl::dump_paragraph(/*bool last*/)
|
||||
|
||||
std::wstring str_run = run_.str();
|
||||
|
||||
if (str_run.length() > 0 || paragraph_style_name_.length() > 0)
|
||||
if (only_text) return str_run;
|
||||
|
||||
if (false == str_run.empty() || false == paragraph_style_name_.empty())
|
||||
{
|
||||
CP_XML_WRITER(paragraph_)
|
||||
{
|
||||
@ -402,8 +408,7 @@ std::wstring xlsx_text_context::Impl::dump_run()
|
||||
{
|
||||
const std::wstring content = xml::utils::replace_text_to_xml(text_.str());
|
||||
|
||||
if (content.empty())
|
||||
return L"";
|
||||
if (content.empty()) return L"";
|
||||
|
||||
std::wstring prefix_draw;
|
||||
if (in_draw) prefix_draw = L"a:";
|
||||
@ -418,7 +423,10 @@ std::wstring xlsx_text_context::Impl::dump_run()
|
||||
|
||||
CP_XML_NODE(prefix_draw + L"t")
|
||||
{
|
||||
if (!in_draw)CP_XML_ATTR(L"xml:space", L"preserve");
|
||||
if (false == in_draw && std::wstring::npos != content.find(L" "))
|
||||
{
|
||||
CP_XML_ATTR(L"xml:space", L"preserve");
|
||||
}
|
||||
|
||||
CP_XML_STREAM() << content;
|
||||
}
|
||||
@ -449,7 +457,35 @@ void xlsx_text_context::Impl::start_cell_content()
|
||||
|
||||
text_properties_cell_ = NULL;
|
||||
}
|
||||
void xlsx_text_context::Impl::start_only_text()
|
||||
{
|
||||
paragraphs_cout_ = 0;
|
||||
|
||||
run_.str(std::wstring());
|
||||
paragraph_.str(std::wstring());
|
||||
text_.str(std::wstring());
|
||||
|
||||
paragraph_style_name_ = L"";
|
||||
span_style_name_ = L"";
|
||||
|
||||
only_text = true;
|
||||
}
|
||||
std::wstring xlsx_text_context::Impl::end_only_text()
|
||||
{
|
||||
std::wstring message = dump_run();
|
||||
|
||||
paragraphs_cout_ = 0;
|
||||
|
||||
run_.str(std::wstring());
|
||||
paragraph_.str(std::wstring());
|
||||
text_.str(std::wstring());
|
||||
|
||||
paragraph_style_name_ = L"";
|
||||
span_style_name_ = L"";
|
||||
|
||||
only_text = false;
|
||||
return message;
|
||||
}
|
||||
void xlsx_text_context::Impl::start_comment_content()
|
||||
{
|
||||
paragraphs_cout_ = 0;
|
||||
@ -585,26 +621,30 @@ bool xlsx_text_context::is_drawing_context()
|
||||
{
|
||||
return impl_->is_drawing_context();
|
||||
}
|
||||
|
||||
void xlsx_text_context::start_cell_content()
|
||||
{
|
||||
return impl_->start_cell_content();
|
||||
}
|
||||
|
||||
int xlsx_text_context::end_cell_content()
|
||||
{
|
||||
return impl_->end_cell_content();
|
||||
}
|
||||
|
||||
void xlsx_text_context::start_comment_content()
|
||||
{
|
||||
return impl_->start_comment_content();
|
||||
}
|
||||
|
||||
std::wstring xlsx_text_context::end_comment_content()
|
||||
{
|
||||
return impl_->end_comment_content();
|
||||
}
|
||||
void xlsx_text_context::start_only_text()
|
||||
{
|
||||
return impl_->start_only_text();
|
||||
}
|
||||
std::wstring xlsx_text_context::end_only_text()
|
||||
{
|
||||
return impl_->end_only_text();
|
||||
}
|
||||
void xlsx_text_context::start_drawing_content()
|
||||
{
|
||||
return impl_->start_drawing_content();
|
||||
|
||||
@ -70,6 +70,9 @@ public:
|
||||
void start_cell_content();
|
||||
int end_cell_content();
|
||||
|
||||
void start_only_text();
|
||||
std::wstring end_only_text();
|
||||
|
||||
void start_comment_content();
|
||||
std::wstring end_comment_content();
|
||||
|
||||
|
||||
@ -332,8 +332,8 @@ void xlsx_conversion_context::end_document()
|
||||
output_document_->get_content_types_file().set_media(get_mediaitems());
|
||||
output_document_->get_xl_files().set_media(get_mediaitems());
|
||||
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(drawing_context_handle_->content());
|
||||
output_document_->get_xl_files().set_drawings(drawings);
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(drawing_context_handle_->content(), drawing_context_handle_->content_vml());
|
||||
output_document_->get_xl_files().set_drawings(drawings);
|
||||
|
||||
package::xl_comments_ptr comments = package::xl_comments::create(xlsx_comments_context_handle_.content());
|
||||
output_document_->get_xl_files().set_comments(comments);
|
||||
@ -475,6 +475,7 @@ void xlsx_conversion_context::end_table()
|
||||
|
||||
get_table_context().serialize_table_format (current_sheet().sheetFormat());
|
||||
get_table_context().serialize_page_properties (current_sheet().page_properties());
|
||||
get_table_context().serialize_header_footer (current_sheet().header_footer());
|
||||
get_table_context().serialize_conditionalFormatting (current_sheet().conditionalFormatting());
|
||||
get_table_context().serialize_tableParts (current_sheet().tableParts(), current_sheet().sheet_rels());
|
||||
get_table_context().serialize_autofilter (current_sheet().autofilter());
|
||||
@ -514,33 +515,28 @@ void xlsx_conversion_context::end_table()
|
||||
= drawing_context_handle_->add_drawing_xml(strm.str(), get_drawing_context().get_drawings() );
|
||||
|
||||
current_sheet().set_drawing_link(drawingName.first, drawingName.second);
|
||||
|
||||
CP_XML_WRITER(current_sheet().drawing())
|
||||
{
|
||||
CP_XML_NODE(L"drawing")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", drawingName.second);
|
||||
}
|
||||
}
|
||||
}
|
||||
get_table_context().serialize_background (current_sheet().drawing());
|
||||
if (false == get_drawing_context().vml_empty())
|
||||
{
|
||||
std::wstringstream strm;
|
||||
get_drawing_context().serialize_vml(strm);
|
||||
|
||||
const std::pair<std::wstring, std::wstring> vml_drawingName
|
||||
= drawing_context_handle_->add_drawing_vml(strm.str(), get_drawing_context().get_drawings() );
|
||||
|
||||
if (!get_comments_context().empty())
|
||||
current_sheet().set_vml_drawing_link(vml_drawingName.first, vml_drawingName.second);
|
||||
}
|
||||
//get_table_context().serialize_background (current_sheet().picture());
|
||||
|
||||
if (false == get_comments_context().empty())
|
||||
{
|
||||
std::wstringstream strm;
|
||||
get_comments_context().serialize(strm);
|
||||
|
||||
std::wstringstream vml_strm;
|
||||
get_comments_context().serialize_vml(vml_strm);
|
||||
|
||||
|
||||
const std::pair<std::wstring, std::wstring> commentsName
|
||||
= xlsx_comments_context_handle_.add_comments_xml(strm.str(), vml_strm.str(),get_comments_context().get_comments() );
|
||||
|
||||
const std::pair<std::wstring, std::wstring> vml_drawingName
|
||||
=xlsx_comments_context_handle_.get_vml_drawing_xml();
|
||||
= xlsx_comments_context_handle_.add_comments_xml(strm.str(), get_comments_context().get_comments() );
|
||||
|
||||
current_sheet().set_comments_link(commentsName.first, commentsName.second);
|
||||
current_sheet().set_vml_drawing_link(vml_drawingName.first, vml_drawingName.second);
|
||||
}
|
||||
get_table_context().end_table();
|
||||
}
|
||||
|
||||
@ -168,15 +168,20 @@ void calc_tab_stops(const style_instance * styleInstance, oox::tabs_context & co
|
||||
}
|
||||
styleInstance = styleInstance->parent();
|
||||
}
|
||||
double margin_left = 0;
|
||||
|
||||
for (size_t i = 0; i < parProps.size(); i++)
|
||||
{
|
||||
if (parProps[i]->content_.fo_margin_left_)
|
||||
margin_left = 20.0 * parProps[i]->content_.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt);
|
||||
|
||||
if (parProps[i]->content_.style_tab_stops_)
|
||||
{
|
||||
style_tab_stops *tab_stops = dynamic_cast<style_tab_stops*>(parProps[i]->content_.style_tab_stops_.get());
|
||||
context.reset();
|
||||
for (size_t j = 0; j < tab_stops->content_.size(); j++)
|
||||
{
|
||||
context.add(tab_stops->content_[j]);
|
||||
context.add(tab_stops->content_[j], margin_left);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,14 +301,32 @@ void common_background_color_attlist::serialize(CP_ATTR_NODE)
|
||||
void common_shadow_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"style:shadow", style_shadow_);
|
||||
|
||||
CP_APPLY_ATTR(L"draw:shadow", draw_shadow_);
|
||||
CP_APPLY_ATTR(L"draw:shadow-opacity", draw_shadow_opacity_);
|
||||
CP_APPLY_ATTR(L"draw:shadow-color", draw_shadow_color_);
|
||||
CP_APPLY_ATTR(L"draw:shadow-offset-y", draw_shadow_offset_y_);
|
||||
CP_APPLY_ATTR(L"draw:shadow-offset-x", draw_shadow_offset_x_);
|
||||
}
|
||||
void common_shadow_attlist::apply_from(const common_shadow_attlist & Other)
|
||||
{
|
||||
_CP_APPLY_PROP(style_shadow_, Other.style_shadow_);
|
||||
_CP_APPLY_PROP(style_shadow_, Other.style_shadow_);
|
||||
|
||||
_CP_APPLY_PROP(draw_shadow_, Other.draw_shadow_);
|
||||
_CP_APPLY_PROP(draw_shadow_opacity_, Other.draw_shadow_opacity_);
|
||||
_CP_APPLY_PROP(draw_shadow_color_, Other.draw_shadow_color_);
|
||||
_CP_APPLY_PROP(draw_shadow_offset_y_, Other.draw_shadow_offset_y_);
|
||||
_CP_APPLY_PROP(draw_shadow_offset_x_, Other.draw_shadow_offset_x_);
|
||||
}
|
||||
void common_shadow_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"style:shadow", style_shadow_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"draw:shadow", draw_shadow_);
|
||||
CP_XML_ATTR_OPT(L"draw:shadow-opacity", draw_shadow_opacity_);
|
||||
CP_XML_ATTR_OPT(L"draw:shadow-color", draw_shadow_color_);
|
||||
CP_XML_ATTR_OPT(L"draw:shadow-offset-y", draw_shadow_offset_y_);
|
||||
CP_XML_ATTR_OPT(L"draw:shadow-offset-x", draw_shadow_offset_x_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -886,5 +904,32 @@ void section_attlists::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"text:display", display_);
|
||||
CP_XML_ATTR_OPT(L"text:condition", condition_);
|
||||
}
|
||||
void dr3d_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"dr3d:transform", transform_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:vrp", vrp_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:vpn", vpn_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:vup", vup_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:focal-length", focal_length_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:distance", distance_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:projection", projection_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:ambient-color", ambient_color_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:shade-mode", shade_mode_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:lighting-mode", lighting_mode_);
|
||||
}
|
||||
void dr3d_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"dr3d:vpn", vpn_);
|
||||
CP_APPLY_ATTR(L"dr3d:vrp", vrp_);
|
||||
CP_APPLY_ATTR(L"dr3d:vup", vup_);
|
||||
CP_APPLY_ATTR(L"dr3d:focal-length", focal_length_);
|
||||
CP_APPLY_ATTR(L"dr3d:distance", distance_);
|
||||
CP_APPLY_ATTR(L"dr3d:projection", projection_);
|
||||
CP_APPLY_ATTR(L"dr3d:ambient-color", ambient_color_);
|
||||
CP_APPLY_ATTR(L"dr3d:shade-mode", shade_mode_);
|
||||
CP_APPLY_ATTR(L"dr3d:lighting-mode", lighting_mode_);
|
||||
CP_APPLY_ATTR(L"dr3d:transform", transform_);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,8 +214,13 @@ public:
|
||||
void apply_from(const common_shadow_attlist & Other);
|
||||
void serialize(CP_ATTR_NODE);
|
||||
|
||||
_CP_OPT(shadow_type) style_shadow_;
|
||||
_CP_OPT(shadow_type) style_shadow_;
|
||||
|
||||
_CP_OPT(odf_types::shadow_type1) draw_shadow_;
|
||||
_CP_OPT(odf_types::percent) draw_shadow_opacity_;
|
||||
_CP_OPT(odf_types::color) draw_shadow_color_;
|
||||
_CP_OPT(odf_types::length) draw_shadow_offset_y_;
|
||||
_CP_OPT(odf_types::length) draw_shadow_offset_x_;
|
||||
};
|
||||
|
||||
// common-keep-with-next-attlist
|
||||
@ -612,5 +617,25 @@ public:
|
||||
_CP_OPT(std::wstring) condition_;
|
||||
|
||||
};
|
||||
|
||||
class dr3d_attlist
|
||||
{
|
||||
public:
|
||||
void add_attributes ( const xml::attributes_wc_ptr & Attributes );
|
||||
void serialize (CP_ATTR_NODE);
|
||||
|
||||
_CP_OPT(vector3D) vpn_;
|
||||
_CP_OPT(vector3D) vrp_;
|
||||
_CP_OPT(vector3D) vup_;
|
||||
_CP_OPT(length) focal_length_;
|
||||
_CP_OPT(length) distance_;
|
||||
_CP_OPT(std::wstring) projection_;
|
||||
_CP_OPT(color) ambient_color_;
|
||||
_CP_OPT(std::wstring) shade_mode_;
|
||||
_CP_OPT(std::wstring) lighting_mode_;
|
||||
_CP_OPT(std::wstring) transform_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,10 +35,11 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const length::unit _Unit)
|
||||
std::wostream & operator<< (std::wostream & _Wostream, const length::unit _Unit)
|
||||
{
|
||||
switch(_Unit)
|
||||
{
|
||||
@ -259,6 +260,26 @@ double length::get_value_unit(unit Unit) const
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------
|
||||
std::wostream & operator<< (std::wostream & _Wostream, const vector3D & _vector3D)
|
||||
{
|
||||
_Wostream << L"(" << _vector3D.get_x() << L" " << _vector3D.get_y() << L" " << _vector3D.get_z() << L")";
|
||||
return _Wostream;
|
||||
}
|
||||
vector3D vector3D::parse(const std::wstring & Str)
|
||||
{
|
||||
if (Str.length() < 8) return vector3D();
|
||||
|
||||
std::wstring vsp = Str.substr(1, Str.length() - 2);
|
||||
|
||||
std::vector<std::wstring> coord;
|
||||
boost::algorithm::split(coord, vsp, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
if (coord.size() != 3) return vector3D();
|
||||
|
||||
return vector3D(std::stod(coord[0]), std::stod(coord[1]), std::stod(coord[2]));
|
||||
}
|
||||
|
||||
|
||||
} }
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@ public:
|
||||
emu
|
||||
};
|
||||
|
||||
public:
|
||||
length(double v = 0.0, unit u = none) : value_(v), unit_(u)
|
||||
{}
|
||||
|
||||
@ -87,11 +86,39 @@ length operator* (length _Length1, double val);
|
||||
bool operator== (length & _Length1, length & _Length2);
|
||||
bool operator== (const length & _Length1, const length & _Length2);
|
||||
|
||||
typedef length coordinate;
|
||||
//-------------------------------------------------------------
|
||||
|
||||
class vector3D
|
||||
{
|
||||
public:
|
||||
|
||||
vector3D(double x = 0.0, double y = 0.0, double z = 0.0) : x_(x), y_(y), z_(z)
|
||||
{}
|
||||
|
||||
double get_x() const
|
||||
{
|
||||
return x_;
|
||||
}
|
||||
double get_y() const
|
||||
{
|
||||
return y_;
|
||||
}
|
||||
double get_z() const
|
||||
{
|
||||
return z_;
|
||||
}
|
||||
static vector3D parse(const std::wstring & Str);
|
||||
|
||||
private:
|
||||
double x_;
|
||||
double y_;
|
||||
double z_;
|
||||
};
|
||||
|
||||
std::wostream & operator<< (std::wostream & _Wostream, const vector3D & _vector3D);
|
||||
|
||||
}
|
||||
|
||||
APPLY_PARSE_XML_ATTRIBUTES(odf_types::length);
|
||||
|
||||
APPLY_PARSE_XML_ATTRIBUTES(odf_types::vector3D);
|
||||
}
|
||||
|
||||
|
||||
@ -562,7 +562,6 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
const wchar_t * draw_a::ns = L"draw";
|
||||
const wchar_t * draw_a::name = L"a";
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -159,7 +159,7 @@ length ComputeContextWidth(const style_page_layout_properties * pageProperties
|
||||
if (pagePropertiesNode)
|
||||
{
|
||||
if (const style_columns * styleColumns
|
||||
= dynamic_cast<const style_columns*>( pagePropertiesNode->elements_.style_columns_.get()))
|
||||
= dynamic_cast<const style_columns*>( pagePropertiesNode->style_columns_.get()))
|
||||
{
|
||||
columnsCount = styleColumns->fo_column_count_.get_value_or(1);
|
||||
if (!columnsCount)
|
||||
@ -858,7 +858,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
std::wstring transformStr = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_transform_.get();
|
||||
docx_convert_transforms(transformStr, drawing->additional);
|
||||
}
|
||||
if (!drawing->isInline)
|
||||
if (false == drawing->isInline)
|
||||
{
|
||||
drawing->relativeHeight = L"2";
|
||||
drawing->behindDoc = L"0";
|
||||
@ -913,9 +913,9 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
{
|
||||
drawing->posOffsetV = (int)(length(0.01, length::cm).get_value_unit(length::emu));
|
||||
}
|
||||
//////////////////////////////////////////////
|
||||
//----------------------------------------------------
|
||||
graphicProperties.apply_to(drawing->additional);
|
||||
//////////////////////////////////////////
|
||||
//----------------------------------------------------
|
||||
bool bTxbx = (drawing->sub_type == 1);
|
||||
|
||||
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, graphicProperties.style_background_image_, Context.root()->odf_context().drawStyles(),drawing->fill, bTxbx);
|
||||
@ -926,7 +926,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
//----------------------------------------------------
|
||||
drawing->additional.push_back(odf_reader::_property(L"border_width_left", Compute_BorderWidth(graphicProperties, sideLeft)));
|
||||
drawing->additional.push_back(odf_reader::_property(L"border_width_top", Compute_BorderWidth(graphicProperties, sideTop)));
|
||||
drawing->additional.push_back(odf_reader::_property(L"border_width_right", Compute_BorderWidth(graphicProperties, sideRight)));
|
||||
@ -941,7 +941,8 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
|
||||
}
|
||||
}
|
||||
///////////////////////////
|
||||
//----------------------------------------------------
|
||||
//----------------------------------------------------
|
||||
if (attlists_.rel_size_.common_draw_size_attlist_.svg_width_)
|
||||
{
|
||||
double w_shape = attlists_.rel_size_.common_draw_size_attlist_.svg_width_->get_value_unit(length::pt);
|
||||
@ -969,11 +970,24 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
drawing->x += new_x;
|
||||
drawing->y += new_y;
|
||||
}
|
||||
|
||||
if (Context.process_headers_footers_ && drawing->posOffsetH < 0)
|
||||
{//p7офис_Альт.odt
|
||||
const _CP_OPT(length) pageMarginLeft = CalcResultLength(pageProperties.common_horizontal_margin_attlist_.fo_margin_left_, pageProperties.fo_page_width_);
|
||||
|
||||
if (pageMarginLeft)
|
||||
{
|
||||
double val = pageMarginLeft->get_value_unit(length::emu);
|
||||
|
||||
if (drawing->posOffsetH < - val)
|
||||
drawing->posOffsetH = -val;
|
||||
}
|
||||
}
|
||||
|
||||
GetProperty(drawing->additional, L"svg:scale_x",dVal);
|
||||
GetProperty(drawing->additional, L"svg:scale_x", dVal);
|
||||
if (dVal)drawing->cx = (int)(0.5 + drawing->cx * dVal.get());
|
||||
|
||||
GetProperty(drawing->additional, L"svg:scale_y",dVal);
|
||||
GetProperty(drawing->additional, L"svg:scale_y", dVal);
|
||||
if (dVal)drawing->cy = (int)(0.5 + drawing->cy * dVal.get());
|
||||
|
||||
GetProperty(drawing->additional, L"svg:translate_x", dVal);
|
||||
|
||||
@ -720,6 +720,7 @@ const wchar_t * dr3d_scene::name = L"scene";
|
||||
|
||||
void dr3d_scene::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
dr3d_attlist_.add_attributes(Attributes);
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
sub_type_ = 12;
|
||||
@ -789,8 +790,8 @@ void dr3d_sphere::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"dr3d:size", dr3d_size_); //vector3D
|
||||
CP_APPLY_ATTR(L"dr3d:center", dr3d_center_); //vector3D
|
||||
CP_APPLY_ATTR(L"dr3d:size", dr3d_size_);
|
||||
CP_APPLY_ATTR(L"dr3d:center", dr3d_center_);
|
||||
CP_APPLY_ATTR(L"dr3d:transform",dr3d_transform_);
|
||||
|
||||
sub_type_ = 16;
|
||||
|
||||
@ -585,6 +585,7 @@ public:
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
odf_types::dr3d_attlist dr3d_attlist_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_scene);
|
||||
@ -692,9 +693,9 @@ public:
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
_CP_OPT(std::wstring) dr3d_size_; //vector3D
|
||||
_CP_OPT(std::wstring) dr3d_center_; //vector3D
|
||||
_CP_OPT(std::wstring) dr3d_transform_;
|
||||
_CP_OPT(odf_types::vector3D) dr3d_size_;
|
||||
_CP_OPT(odf_types::vector3D) dr3d_center_;
|
||||
_CP_OPT(std::wstring) dr3d_transform_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_sphere);
|
||||
|
||||
@ -112,7 +112,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
|
||||
odf_reader::style_instance* styleInst =
|
||||
Context.root()->odf_context().styleContainer().style_by_name(styleName, odf_types::style_family::Graphic,false/*Context.process_headers_footers_*/);
|
||||
Context.root()->odf_context().styleContainer().style_by_name(styleName, odf_types::style_family::Graphic, false/*Context.process_headers_footers_*/);
|
||||
if (styleInst)
|
||||
{
|
||||
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic);
|
||||
@ -396,28 +396,111 @@ void draw_control::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
oox::forms_context::_state & state = Context.get_forms_context().get_state_element(*control_id_);
|
||||
if (state.id.empty()) return;
|
||||
|
||||
form_element* control = dynamic_cast<form_element*>(state.element);
|
||||
if (!control) return;
|
||||
|
||||
if (state.ctrlPropId.empty())
|
||||
{
|
||||
std::wstring target;
|
||||
state.ctrlPropId = Context.get_mediaitems()->add_control_props(target);
|
||||
|
||||
std::wstringstream strm;
|
||||
|
||||
form_element* control = dynamic_cast<form_element*>(state.element);
|
||||
if (control)
|
||||
{
|
||||
control->serialize_control_props(strm);
|
||||
}
|
||||
control->serialize_control_props(strm);
|
||||
|
||||
Context.add_control_props(state.ctrlPropId, target, strm.str());
|
||||
}
|
||||
|
||||
Context.get_drawing_context().start_frame();
|
||||
Context.get_drawing_context().set_control(state.ctrlPropId);
|
||||
Context.get_drawing_context().start_control(state.ctrlPropId, control->object_type_);
|
||||
|
||||
common_xlsx_convert(Context);
|
||||
|
||||
if (control->linked_cell_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"linked_cell", control->linked_cell_.get()));
|
||||
}
|
||||
if (control->disabled_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"disabled", control->disabled_->get()));
|
||||
}
|
||||
if (control->value_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"value", control->value_.get()));
|
||||
}
|
||||
else if (control->current_value_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"value", control->current_value_.get()));
|
||||
}
|
||||
if (control->label_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"label", control->label_.get()));
|
||||
Context.get_drawing_context().set_property(_property(L"text-content", control->label_.get()));
|
||||
}
|
||||
//if (control->name_)
|
||||
//{
|
||||
// Context.get_drawing_context().set_name(control->name_.get());
|
||||
//}
|
||||
form_value_range* value_range = dynamic_cast<form_value_range*>(control);
|
||||
|
||||
Context.get_drawing_context().end_frame();
|
||||
if (value_range)
|
||||
{
|
||||
if (value_range->min_value_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"min_value", value_range->min_value_.get()));
|
||||
}
|
||||
if (value_range->max_value_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"max_value", value_range->max_value_.get()));
|
||||
}
|
||||
if (value_range->step_size_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"step", value_range->step_size_.get()));
|
||||
}
|
||||
if (value_range->page_step_size_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"page_step", value_range->page_step_size_.get()));
|
||||
}
|
||||
if (value_range->orientation_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"orientation", value_range->orientation_.get()));
|
||||
}
|
||||
}
|
||||
form_combobox* combobox = dynamic_cast<form_combobox*>(control);
|
||||
|
||||
if (combobox)
|
||||
{
|
||||
//items_;
|
||||
if (combobox->source_cell_range_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"cell_range", combobox->source_cell_range_.get()));
|
||||
}
|
||||
if (combobox->list_source_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"list_source", combobox->list_source_.get()));
|
||||
}
|
||||
}
|
||||
form_listbox* listbox = dynamic_cast<form_listbox*>(control);
|
||||
if (listbox)
|
||||
{
|
||||
if (listbox->source_cell_range_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"cell_range", listbox->source_cell_range_.get()));
|
||||
}
|
||||
if (listbox->list_source_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"list_source", listbox->list_source_.get()));
|
||||
}
|
||||
}
|
||||
form_checkbox* checkbox = dynamic_cast<form_checkbox*>(control);
|
||||
if (checkbox)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"checkbox_state", checkbox->current_state_));
|
||||
}
|
||||
|
||||
//_CP_OPT(std::wstring) label_;
|
||||
//_CP_OPT(std::wstring) title_;
|
||||
//_CP_OPT(odf_types::Bool) dropdown_;
|
||||
|
||||
Context.get_drawing_context().end_control();
|
||||
Context.get_drawing_context().clear();
|
||||
|
||||
}
|
||||
|
||||
@ -41,8 +41,6 @@ namespace cpdoccore {
|
||||
|
||||
namespace odf_reader {
|
||||
|
||||
// style-header-footer-properties-attlist
|
||||
|
||||
void style_header_footer_properties_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"svg:height", svg_height_);
|
||||
@ -58,7 +56,7 @@ void style_header_footer_properties_attlist::add_attributes( const xml::attribut
|
||||
CP_APPLY_ATTR(L"style:dynamic-spacing", style_dynamic_spacing_);
|
||||
}
|
||||
|
||||
/// style-header-footer-properties
|
||||
|
||||
const wchar_t * style_header_footer_properties::ns = L"style";
|
||||
const wchar_t * style_header_footer_properties::name = L"header-footer-properties";
|
||||
|
||||
@ -78,30 +76,10 @@ void style_header_footer_properties::add_child_element( xml::sax * Reader, const
|
||||
not_applicable_element(L"style-header-footer-properties", Reader, Ns, Name);
|
||||
}
|
||||
}
|
||||
|
||||
// common-style-header-footer-attlist
|
||||
|
||||
void common_style_header_footer_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"style:display", style_display_, true);
|
||||
}
|
||||
|
||||
// header-footer-content
|
||||
std::wostream & header_footer_content::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
|
||||
{
|
||||
serialize_elements_text(_Wostream, content_, bXmlEncode);
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
void header_footer_content::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context)
|
||||
{
|
||||
if CP_CHECK_NAME(L"text", L"tracked-changes")
|
||||
{
|
||||
CP_CREATE_ELEMENT_SIMPLE(tracked_changes_);
|
||||
}
|
||||
else
|
||||
CP_CREATE_ELEMENT_SIMPLE(content_);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,17 +95,6 @@ public:
|
||||
private:
|
||||
bool style_display_; // default true
|
||||
|
||||
};
|
||||
// header-footer-content
|
||||
class header_footer_content
|
||||
{
|
||||
public:
|
||||
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
|
||||
|
||||
office_element_ptr tracked_changes_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -364,6 +364,34 @@ style_page_layout_properties * page_layout_instance::properties() const
|
||||
|
||||
void page_layout_instance::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
const style_header_style * headerStyle = dynamic_cast<style_header_style *>(style_page_layout_->style_header_style_.get());
|
||||
const style_footer_style * footerStyle = dynamic_cast<style_footer_style *>(style_page_layout_->style_footer_style_.get());
|
||||
|
||||
style_header_footer_properties * headerProp = headerStyle ? dynamic_cast<style_header_footer_properties *>(headerStyle->style_header_footer_properties_.get()) : NULL;
|
||||
style_header_footer_properties * footerProp = footerStyle ? dynamic_cast<style_header_footer_properties *>(footerStyle->style_header_footer_properties_.get()) : NULL;
|
||||
|
||||
if (headerProp)
|
||||
{
|
||||
const style_header_footer_properties_attlist & attr = headerProp->style_header_footer_properties_attlist_;
|
||||
_CP_OPT(double) header;
|
||||
|
||||
if (attr.fo_min_height_) header = attr.fo_min_height_->get_value_unit(length::pt);
|
||||
else if (attr.svg_height_) header = attr.svg_height_->get_value_unit(length::pt);
|
||||
|
||||
Context.get_table_context().set_header_page(header);
|
||||
}
|
||||
|
||||
if (footerProp)
|
||||
{
|
||||
const style_header_footer_properties_attlist & attr = footerProp->style_header_footer_properties_attlist_;
|
||||
_CP_OPT(double) footer;
|
||||
|
||||
if (attr.fo_min_height_) footer = attr.fo_min_height_->get_value_unit(length::pt);
|
||||
else if (attr.svg_height_) footer = attr.svg_height_->get_value_unit(length::pt);
|
||||
|
||||
Context.get_table_context().set_footer_page(footer);
|
||||
}
|
||||
|
||||
style_page_layout_properties * props = properties();
|
||||
if (props)
|
||||
props->xlsx_serialize(strm, Context);
|
||||
|
||||
@ -80,7 +80,7 @@ public:
|
||||
const std::wstring & parent_name() const;
|
||||
style_instance * next() const;
|
||||
const std::wstring & next_name() const;
|
||||
const styles_container * container() const { return container_; }
|
||||
const styles_container * container() const { return container_; }
|
||||
const std::wstring & data_style_name() const;
|
||||
const std::wstring & style_class() const;
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
|
||||
#include <odf/odf_document.h>
|
||||
#include "odfcontext.h"
|
||||
|
||||
#include "draw_common.h"
|
||||
#include "calcs_styles.h"
|
||||
#include "../docx/xlsx_utils.h"
|
||||
|
||||
@ -111,7 +111,7 @@ void office_annotation::add_child_element( xml::sax * Reader, const std::wstring
|
||||
|
||||
void office_annotation::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
office_annotation_attr_.add_attributes(Attributes);
|
||||
attr_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void office_annotation::docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -159,19 +159,20 @@ void office_annotation::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
const _CP_OPT(length) svg_widthVal = office_annotation_attr_.svg_width_;
|
||||
const _CP_OPT(length) svg_widthVal = attr_.svg_width_;
|
||||
|
||||
const double width_cm = svg_widthVal.get_value_or(length(0)).get_value_unit(length::cm);
|
||||
const double width_pt = svg_widthVal.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
|
||||
const _CP_OPT(length) svg_heightVal =office_annotation_attr_.svg_height_;
|
||||
const _CP_OPT(length) svg_heightVal =attr_.svg_height_;
|
||||
|
||||
const double height_cm = svg_heightVal.get_value_or(length(0)).get_value_unit(length::cm);
|
||||
const double height_pt = svg_heightVal.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
|
||||
const double x_pt = office_annotation_attr_.svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
const double y_pt = office_annotation_attr_.svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
/////////////////////////////////
|
||||
const double x_pt = attr_.svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
const double y_pt = attr_.svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
|
||||
//-----------------------------------------------
|
||||
std::wstring date;
|
||||
std::wstring author;
|
||||
if (dc_date_)
|
||||
@ -182,11 +183,14 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
author = xml::utils::replace_text_to_xml(dynamic_cast<dc_creator * >(dc_creator_.get())->content_);
|
||||
}
|
||||
////////////////////////////////////////
|
||||
Context.get_comments_context().start_comment(width_pt, height_pt, x_pt, y_pt);
|
||||
if (office_annotation_attr_.display_)
|
||||
int col = Context.current_table_column(); if (col < 0) col = 0;
|
||||
int row = Context.current_table_row(); if (row < 0) row = 0;
|
||||
|
||||
std::wstring ref = oox::getCellAddress(col, row);
|
||||
//-----------------------------------------------
|
||||
Context.get_comments_context().start_comment(ref);
|
||||
if (attr_.display_)
|
||||
{
|
||||
Context.get_comments_context().set_visibly(office_annotation_attr_.display_.get());
|
||||
}
|
||||
|
||||
Context.get_text_context().start_comment_content();
|
||||
@ -196,13 +200,43 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
}
|
||||
Context.get_comments_context().add_author(author);
|
||||
Context.get_comments_context().add_content(Context.get_text_context().end_comment_content());
|
||||
//----------- drawing part ---------------
|
||||
Context.get_drawing_context().start_comment(col, row);
|
||||
Context.get_drawing_context().start_drawing(L"");
|
||||
|
||||
Context.get_drawing_context().set_rect(width_pt, height_pt, x_pt, y_pt);
|
||||
if (attr_.display_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"visibly", attr_.display_.get()));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
/// Обрабатываем стиль draw
|
||||
if (attr_.draw_style_name_)
|
||||
{
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
|
||||
odf_reader::style_instance* styleInst =
|
||||
Context.root()->odf_context().styleContainer().style_by_name(*attr_.draw_style_name_, odf_types::style_family::Graphic, false/*Context.process_headers_footers_*/);
|
||||
if (styleInst)
|
||||
{
|
||||
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic);
|
||||
if (defaultStyle)instances.push_back(defaultStyle);
|
||||
|
||||
instances.push_back(styleInst);
|
||||
}
|
||||
graphic_format_properties properties = calc_graphic_properties_content(instances);
|
||||
|
||||
//-----------------------------------------------
|
||||
properties.apply_to(Context.get_drawing_context().get_properties());
|
||||
|
||||
oox::_oox_fill fill;
|
||||
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_,
|
||||
Context.root()->odf_context().drawStyles(), fill);
|
||||
Context.get_drawing_context().set_fill(fill);
|
||||
}
|
||||
//-----------------------------------------------
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
style_instance* styleInst = Context.root()->odf_context().styleContainer().style_by_name(
|
||||
office_annotation_attr_.draw_style_name_.get_value_or(L""), odf_types::style_family::Graphic, false/*Context.process_headers_footers_*/);
|
||||
attr_.draw_style_name_.get_value_or(L""), odf_types::style_family::Graphic, false/*Context.process_headers_footers_*/);
|
||||
if (styleInst)
|
||||
{
|
||||
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic);
|
||||
@ -212,16 +246,13 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
}
|
||||
graphic_format_properties graphicProperties = calc_graphic_properties_content(instances);
|
||||
|
||||
graphicProperties.apply_to(Context.get_comments_context().get_draw_properties());
|
||||
|
||||
const std::wstring textStyleName = office_annotation_attr_.draw_text_style_name_.get_value_or(L"");
|
||||
|
||||
int col = Context.current_table_column(); if (col < 0) col = 0;
|
||||
int row = Context.current_table_row(); if (row < 0) row = 0;
|
||||
|
||||
std::wstring ref = oox::getCellAddress(col, row);
|
||||
|
||||
Context.get_comments_context().end_comment(ref, col, row);
|
||||
const std::wstring textStyleName = attr_.draw_text_style_name_.get_value_or(L"");
|
||||
|
||||
Context.get_drawing_context().end_drawing();
|
||||
Context.get_drawing_context().end_comment();
|
||||
Context.get_drawing_context().clear();
|
||||
//-----------------------------------------------
|
||||
Context.get_comments_context().end_comment();
|
||||
}
|
||||
// officeooo:annotation
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -246,13 +277,13 @@ void officeooo_annotation::add_child_element( xml::sax * Reader, const std::wstr
|
||||
|
||||
void officeooo_annotation::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
office_annotation_attr_.add_attributes(Attributes);
|
||||
attr_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const double x = 8 * office_annotation_attr_.svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
const double y = 8 * office_annotation_attr_.svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
const double x = 8 * attr_.svg_x_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
const double y = 8 * attr_.svg_y_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
/////////////////////////////////
|
||||
std::wstring date;
|
||||
std::wstring author;
|
||||
@ -283,7 +314,7 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
/// Обрабатываем стиль draw
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
style_instance* styleInst = Context.root()->odf_context().styleContainer().style_by_name(
|
||||
office_annotation_attr_.draw_style_name_.get_value_or(L""), odf_types::style_family::Graphic,false/*Context.process_headers_footers_*/);
|
||||
attr_.draw_style_name_.get_value_or(L""), odf_types::style_family::Graphic,false/*Context.process_headers_footers_*/);
|
||||
if (styleInst)
|
||||
{
|
||||
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Graphic);
|
||||
@ -295,7 +326,7 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
graphicProperties.apply_to(Context.get_comments_context().get_draw_properties());
|
||||
|
||||
const std::wstring textStyleName = office_annotation_attr_.draw_text_style_name_.get_value_or(L"");
|
||||
const std::wstring textStyleName = attr_.draw_text_style_name_.get_value_or(L"");
|
||||
|
||||
Context.get_comments_context().end_comment();
|
||||
}
|
||||
|
||||
@ -46,7 +46,6 @@ class office_annotation_attr
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(odf_types::length) svg_y_;
|
||||
_CP_OPT(odf_types::length) svg_x_;
|
||||
_CP_OPT(odf_types::length) svg_width_;
|
||||
@ -123,9 +122,8 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
office_annotation_attr office_annotation_attr_;
|
||||
office_annotation_attr attr_;
|
||||
|
||||
office_element_ptr dc_date_;
|
||||
office_element_ptr dc_creator_;
|
||||
@ -150,9 +148,8 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
office_annotation_attr office_annotation_attr_;
|
||||
office_annotation_attr attr_;
|
||||
|
||||
office_element_ptr dc_date_;
|
||||
office_element_ptr dc_creator_;
|
||||
|
||||
@ -113,7 +113,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
oox::_oox_fill fill;
|
||||
|
||||
Compute_GraphicFill(layout_properties->attlist_.common_draw_fill_attlist_,
|
||||
layout_properties->elements_.style_background_image_,
|
||||
layout_properties->style_background_image_,
|
||||
Context.root()->odf_context().drawStyles(), fill);
|
||||
|
||||
if (layout_properties->attlist_.common_background_color_attlist_.fo_background_color_ || fill.type != 0)
|
||||
|
||||
@ -41,6 +41,30 @@
|
||||
#include "serialize_elements.h"
|
||||
|
||||
#include "../formulasconvert/formulasconvert.h"
|
||||
|
||||
#define OBJ_Group 0x0000
|
||||
#define OBJ_Line 0x0001
|
||||
#define OBJ_Rectangle 0x0002
|
||||
#define OBJ_Oval 0x0003
|
||||
#define OBJ_Arc 0x0004
|
||||
#define OBJ_Text 0x0006
|
||||
#define OBJ_OfficeArt 0x001E
|
||||
#define OBJ_Polygon 0x0009
|
||||
#define OBJ_Picture 0x0008
|
||||
#define OBJ_Chart 0x0005
|
||||
#define OBJ_Button 0x0007
|
||||
#define OBJ_CheckBox 0x000B
|
||||
#define OBJ_RadioButton 0x000C
|
||||
#define OBJ_EditBox 0x000D
|
||||
#define OBJ_Label 0x000E
|
||||
#define OBJ_DialogBox 0x000F
|
||||
#define OBJ_SpinControl 0x0010
|
||||
#define OBJ_Scrollbar 0x0011
|
||||
#define OBJ_List 0x0012
|
||||
#define OBJ_GroupBox 0x0013
|
||||
#define OBJ_DropdownList 0x0014
|
||||
#define OBJ_Note 0x0019
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
@ -266,6 +290,45 @@ void form_element::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
Context.get_forms_context().end_element();
|
||||
}
|
||||
// form:frame
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_frame::ns = L"form";
|
||||
const wchar_t * form_frame::name = L"frame";
|
||||
|
||||
void form_frame::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_GroupBox;
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_frame::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(1);
|
||||
|
||||
form_element::docx_convert(Context);
|
||||
}
|
||||
void form_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(1);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_frame::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"formControlPr")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||
|
||||
CP_XML_ATTR(L"objectType", L"GBox");
|
||||
|
||||
CP_XML_ATTR(L"dx", L"20");
|
||||
CP_XML_ATTR(L"noThreeD", L"1");
|
||||
}
|
||||
}
|
||||
}
|
||||
// form:button
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_button::ns = L"form";
|
||||
@ -273,6 +336,7 @@ const wchar_t * form_button::name = L"button";
|
||||
|
||||
void form_button::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_Button;
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_button::docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -311,6 +375,7 @@ const wchar_t * form_text::name = L"text";
|
||||
|
||||
void form_text::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_EditBox;
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_text::docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -411,6 +476,7 @@ const wchar_t * form_fixed_text::name = L"fixed-text";
|
||||
|
||||
void form_fixed_text::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_Label;
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_fixed_text::docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -506,6 +572,8 @@ const wchar_t * form_checkbox::name = L"checkbox";
|
||||
|
||||
void form_checkbox::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_CheckBox;
|
||||
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
CP_APPLY_ATTR(L"form:current-state", strVal);
|
||||
|
||||
@ -609,7 +677,68 @@ void form_checkbox::docx_convert_field(oox::docx_conversion_context & Context, d
|
||||
Context.output_stream() << L"</w:t>";
|
||||
Context.finish_run();
|
||||
}
|
||||
// form:checkbox
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_radio::ns = L"form";
|
||||
const wchar_t * form_radio::name = L"radio";
|
||||
|
||||
void form_radio::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_RadioButton;
|
||||
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
CP_APPLY_ATTR(L"form:current-selected", strVal);
|
||||
|
||||
if ((strVal) && (*strVal == L"true"))
|
||||
{
|
||||
current_state_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
current_state_ = false;
|
||||
}
|
||||
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_radio::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(3);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::docx_convert(Context);
|
||||
|
||||
//only to activeX object
|
||||
}
|
||||
void form_radio::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(3);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_radio::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"formControlPr")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||
|
||||
CP_XML_ATTR(L"objectType", L"Radio");
|
||||
if (current_state_)
|
||||
CP_XML_ATTR(L"checked", L"Checked");
|
||||
|
||||
CP_XML_ATTR(L"dx", L"20");
|
||||
CP_XML_ATTR(L"noThreeD", L"1");
|
||||
}
|
||||
}
|
||||
}
|
||||
void form_radio::docx_convert_sdt(oox::docx_conversion_context & Context, draw_control *draw)
|
||||
{
|
||||
}
|
||||
void form_radio::docx_convert_field(oox::docx_conversion_context & Context, draw_control *draw)
|
||||
{
|
||||
}
|
||||
// form:combobox
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_combobox::ns = L"form";
|
||||
@ -617,6 +746,7 @@ const wchar_t * form_combobox::name = L"combobox";
|
||||
|
||||
void form_combobox::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_DropdownList;
|
||||
form_element::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"form:source-cell-range", source_cell_range_);
|
||||
@ -662,7 +792,7 @@ void form_combobox::serialize_control_props(std::wostream & strm)
|
||||
|
||||
if (linked_cell_)
|
||||
{
|
||||
std::wstring fmla = converter.convert_named_expr(*linked_cell_);
|
||||
std::wstring fmla = converter.convert_named_ref(*linked_cell_);
|
||||
CP_XML_ATTR(L"fmlaLink", fmla);
|
||||
}
|
||||
if (source_cell_range_)
|
||||
@ -737,6 +867,7 @@ const wchar_t * form_listbox::name = L"listbox";
|
||||
|
||||
void form_listbox::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_List;
|
||||
form_element::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"form:source-cell-range", source_cell_range_);
|
||||
@ -777,12 +908,12 @@ void form_listbox::serialize_control_props(std::wostream & strm)
|
||||
|
||||
if (linked_cell_)
|
||||
{
|
||||
std::wstring fmla = converter.convert_named_expr(*linked_cell_);
|
||||
std::wstring fmla = converter.convert_named_ref(*linked_cell_);
|
||||
CP_XML_ATTR(L"fmlaLink", fmla);
|
||||
}
|
||||
if (source_cell_range_)
|
||||
{
|
||||
std::wstring fmla = converter.convert_named_expr(*source_cell_range_);
|
||||
std::wstring fmla = converter./*convert_named_expr*/convert_named_ref(*source_cell_range_);
|
||||
CP_XML_ATTR(L"fmlaRange", fmla);
|
||||
}
|
||||
//CP_XML_ATTR(L"sel", L"3");
|
||||
@ -799,6 +930,7 @@ const wchar_t * form_date::name = L"date";
|
||||
|
||||
void form_date::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = 0x0015;
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_date::docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -873,6 +1005,7 @@ const wchar_t * form_time::name = L"time";
|
||||
|
||||
void form_time::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = 0x0016;
|
||||
form_element::add_attributes(Attributes);
|
||||
}
|
||||
void form_time::docx_convert(oox::docx_conversion_context & Context)
|
||||
@ -940,6 +1073,38 @@ void form_time::docx_convert_sdt(oox::docx_conversion_context & Context, draw_co
|
||||
Context.finish_run();
|
||||
}
|
||||
}
|
||||
// form:image-frame
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_image_frame::ns = L"form";
|
||||
const wchar_t * form_image_frame::name = L"image-frame";
|
||||
|
||||
void form_image_frame::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_Picture;
|
||||
form_element::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"form:image-data", image_data_);
|
||||
}
|
||||
void form_image_frame::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
//Context.get_forms_context().start_element(xxx);
|
||||
//Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
//form_element::docx_convert(Context);
|
||||
}
|
||||
void form_image_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
//Context.get_forms_context().start_element(xxx);
|
||||
//Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
//form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_image_frame::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
}
|
||||
void form_image_frame::docx_convert_sdt(oox::docx_conversion_context & Context, draw_control *draw)
|
||||
{
|
||||
}
|
||||
// form:listbox
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_value_range::ns = L"form";
|
||||
@ -947,6 +1112,8 @@ const wchar_t * form_value_range::name = L"value-range";
|
||||
|
||||
void form_value_range::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
object_type_ = OBJ_Scrollbar;
|
||||
|
||||
form_element::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"form:min-value", min_value_);
|
||||
@ -955,6 +1122,20 @@ void form_value_range::add_attributes( const xml::attributes_wc_ptr & Attributes
|
||||
CP_APPLY_ATTR(L"form:page-step-size", page_step_size_);
|
||||
CP_APPLY_ATTR(L"form:orientation", orientation_);
|
||||
CP_APPLY_ATTR(L"form:delay-for-repeat", delay_for_repeat_);
|
||||
|
||||
if (control_implementation_)
|
||||
{
|
||||
if (control_implementation_->find(L"SpinButton") != std::wstring::npos)
|
||||
{
|
||||
object_type_ = OBJ_SpinControl;
|
||||
if (!orientation_) orientation_ = L"vertical";
|
||||
}
|
||||
else
|
||||
{
|
||||
object_type_ = OBJ_Scrollbar;
|
||||
if (!orientation_) orientation_ = L"horizontal";
|
||||
}
|
||||
}
|
||||
}
|
||||
void form_value_range::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -986,12 +1167,6 @@ void form_value_range::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
if (!control_implementation_) return;
|
||||
|
||||
std::wstring object_type;
|
||||
if (control_implementation_->find(L"SpinButton") != std::wstring::npos)
|
||||
object_type = L"Spin";
|
||||
else
|
||||
object_type = L"Scroll";
|
||||
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -999,13 +1174,13 @@ void form_value_range::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||
|
||||
CP_XML_ATTR(L"objectType", object_type);
|
||||
CP_XML_ATTR(L"objectType", object_type_ == OBJ_SpinControl ? L"Spin" : L"Scroll");
|
||||
|
||||
CP_XML_ATTR(L"noThreeD", L"1");
|
||||
|
||||
if (linked_cell_)
|
||||
{
|
||||
std::wstring fmla = converter.convert_named_expr(*linked_cell_);
|
||||
std::wstring fmla = converter.convert_named_ref(*linked_cell_);
|
||||
CP_XML_ATTR(L"fmlaLink", fmla);
|
||||
}
|
||||
if (value_) CP_XML_ATTR(L"val", *value_);
|
||||
|
||||
@ -218,7 +218,7 @@ public:
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeFormElement;
|
||||
|
||||
form_element() {}
|
||||
form_element() : object_type_(0) {}
|
||||
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -253,8 +253,31 @@ public:
|
||||
_CP_OPT(std::wstring) xforms_bind_;
|
||||
_CP_OPT(std::wstring) current_value_;
|
||||
_CP_OPT(odf_types::Bool) dropdown_;
|
||||
};
|
||||
//----------------------------------------------------------------------------------------------
|
||||
|
||||
int object_type_;
|
||||
};
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// form:frame
|
||||
class form_frame : public form_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeFormFrame;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
|
||||
virtual void serialize_control_props(std::wostream & strm);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_frame);
|
||||
//-----------------------------------------------------------------------------------------
|
||||
// form:button
|
||||
class form_button : public form_element
|
||||
{
|
||||
@ -277,8 +300,8 @@ public:
|
||||
|
||||
//form:image-align
|
||||
//form:image-position
|
||||
//form:button-type 19.255,
|
||||
//form:default-button 19.265,
|
||||
//form:button-type
|
||||
//form:default-button
|
||||
//form:delayfor-repeat
|
||||
//form:focus-on-click
|
||||
//form:image-data
|
||||
@ -313,13 +336,11 @@ private:
|
||||
|
||||
public:
|
||||
//form:convert-empty-to-null
|
||||
//form:current-value
|
||||
//form:readonly
|
||||
//form:max-length
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_text);
|
||||
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// form:fixed-text
|
||||
class form_fixed_text : public form_element
|
||||
{
|
||||
@ -344,7 +365,7 @@ private:
|
||||
public:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_fixed_text);
|
||||
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// form:textarea
|
||||
class form_textarea : public form_text
|
||||
{
|
||||
@ -356,7 +377,7 @@ public:
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_textarea);
|
||||
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// form:checkbox
|
||||
class form_checkbox : public form_text
|
||||
{
|
||||
@ -383,12 +404,34 @@ public:
|
||||
bool current_state_;
|
||||
//form:image-align
|
||||
//form:image-position
|
||||
//form:current-state
|
||||
//form:is-tristate
|
||||
//form:visual-effect
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_checkbox);
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// form:radio
|
||||
class form_radio : public form_checkbox
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeFormRadio;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control *draw);
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
|
||||
virtual void serialize_control_props(std::wostream & strm);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_radio);
|
||||
//--------------------------------------------------------------------------------------------
|
||||
// form:value-range
|
||||
class form_value_range : public form_element
|
||||
{
|
||||
@ -539,6 +582,34 @@ public:
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_time);
|
||||
|
||||
// form:image-frame
|
||||
class form_image_frame : public form_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeFormImageFrame;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
|
||||
virtual void serialize_control_props(std::wostream & strm);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
public:
|
||||
_CP_OPT(std::wstring) image_data_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(form_image_frame);
|
||||
|
||||
// form:item
|
||||
class form_item : public office_element_impl<form_item>
|
||||
{
|
||||
|
||||
@ -65,8 +65,11 @@ namespace odf_reader {
|
||||
|
||||
namespace text {
|
||||
|
||||
template <class ElementT>
|
||||
void paragraph_content_element<ElementT>::docx_serialize_field(const std::wstring & field_name, office_element_ptr & text,
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * paragraph_content_element::ns = L"";
|
||||
const wchar_t * paragraph_content_element::name = L"";
|
||||
|
||||
void paragraph_content_element::docx_serialize_field(const std::wstring & field_name, office_element_ptr & text,
|
||||
oox::docx_conversion_context & Context, bool bLock )
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
@ -90,8 +93,7 @@ void paragraph_content_element<ElementT>::docx_serialize_field(const std::wstrin
|
||||
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
|
||||
}
|
||||
}
|
||||
template <class ElementT>
|
||||
void paragraph_content_element<ElementT>::docx_serialize_sdt_placeholder(const std::wstring & name, office_element_ptr & text, oox::docx_conversion_context & Context)
|
||||
void paragraph_content_element::docx_serialize_sdt_placeholder(const std::wstring & name, office_element_ptr & text, oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
Context.finish_run();
|
||||
@ -106,8 +108,7 @@ void paragraph_content_element<ElementT>::docx_serialize_sdt_placeholder(const s
|
||||
strm << L"</w:sdtContent></w:sdt>";
|
||||
}
|
||||
|
||||
template <class ElementT>
|
||||
void paragraph_content_element<ElementT>::docx_serialize_run(office_element_ptr & text, oox::docx_conversion_context & Context)
|
||||
void paragraph_content_element::docx_serialize_run(office_element_ptr & text, oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.add_new_run();
|
||||
if (text)
|
||||
@ -116,6 +117,7 @@ void paragraph_content_element<ElementT>::docx_serialize_run(office_element_ptr
|
||||
}
|
||||
Context.finish_run();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * text::ns = L"";
|
||||
const wchar_t * text::name = L"";
|
||||
@ -570,9 +572,40 @@ void span::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
}
|
||||
Context.end_span();
|
||||
}
|
||||
void span::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (content_.empty()) return;
|
||||
|
||||
if (false == text_style_name_.empty())
|
||||
{
|
||||
if (style_instance *styleInst = Context.root()->odf_context().styleContainer().style_by_name(text_style_name_, style_family::Text, true))
|
||||
{
|
||||
if (style_content* style = styleInst->content())
|
||||
{
|
||||
style->xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
text *t = dynamic_cast<text*>(content_[i].get());
|
||||
if (t)
|
||||
{
|
||||
t->text_to_stream(_Wostream, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
text::paragraph_content_element *element = dynamic_cast<text::paragraph_content_element*>(content_[i].get());
|
||||
if (element)
|
||||
{
|
||||
element->xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void span::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
if (style_instance * styleInst = Context.root()->odf_context().styleContainer().style_by_name(text_style_name_, style_family::Text,false))
|
||||
if (style_instance * styleInst = Context.root()->odf_context().styleContainer().style_by_name(text_style_name_, style_family::Text, false))
|
||||
Context.get_text_context().get_styles_context().start_process_style(styleInst);
|
||||
|
||||
Context.get_text_context().start_span(text_style_name_);
|
||||
@ -1015,6 +1048,10 @@ void text_page_number::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
docx_serialize_field(L"PAGE", text_, Context);
|
||||
}
|
||||
void text_page_number::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
_Wostream << L"&P";
|
||||
}
|
||||
void text_page_number::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_text_context().start_field(oox::page_number, L"");
|
||||
@ -1053,6 +1090,10 @@ void text_page_count::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
docx_serialize_field(L"NUMPAGES", text_, Context);
|
||||
}
|
||||
void text_page_count::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
_Wostream << L"&N";
|
||||
}
|
||||
void text_page_count::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
//поскольку такого поля в ms нет - конвертим как обычный текст
|
||||
@ -1090,7 +1131,10 @@ void text_date::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
docx_serialize_field(L"DATE", text_, Context, bLock);
|
||||
}
|
||||
|
||||
void text_date::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
_Wostream << L"&D";
|
||||
}
|
||||
void text_date::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_text_context().start_field(oox::date,style_data_style_name_.get_value_or(L""));
|
||||
@ -1151,6 +1195,10 @@ void text_time::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
docx_serialize_field(L"TIME", text_, Context, bLock);
|
||||
}
|
||||
void text_time::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
_Wostream << L"&T";
|
||||
}
|
||||
void text_time::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_text_context().start_field(oox::time, style_data_style_name_.get_value_or(L""));
|
||||
@ -1204,6 +1252,10 @@ void text_file_name::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
docx_serialize_field(L"FILENAME", text_, Context);
|
||||
}
|
||||
void text_file_name::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
_Wostream << L"&F";
|
||||
}
|
||||
void text_file_name::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
// Context.get_text_context().start_field(oox::file_name, style_data_style_name_.get_value_or(L""));
|
||||
@ -1467,6 +1519,10 @@ void sheet_name::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
docx_serialize_sdt_placeholder(L"sheet name", text_, Context);
|
||||
}
|
||||
void sheet_name::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
_Wostream << L"&A";
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * author_name::ns = L"text";
|
||||
const wchar_t * author_name::name = L"author-name";
|
||||
|
||||
@ -53,18 +53,32 @@ namespace odf_reader {
|
||||
|
||||
namespace text {
|
||||
|
||||
template <class ElementT>
|
||||
class paragraph_content_element : public office_element_impl<ElementT>
|
||||
class paragraph_content_element : public office_element_impl<paragraph_content_element>
|
||||
{
|
||||
public:
|
||||
void docx_serialize_sdt_placeholder(const std::wstring & name, office_element_ptr & text, oox::docx_conversion_context & Context);
|
||||
void docx_serialize_field(const std::wstring & field_name, office_element_ptr & text, oox::docx_conversion_context & Context, bool bLock = false);
|
||||
void docx_serialize_run(office_element_ptr & text, oox::docx_conversion_context & Context);
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTextTextElement;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context){}
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
|
||||
virtual void docx_serialize_sdt_placeholder(const std::wstring & name, office_element_ptr & text, oox::docx_conversion_context & Context);
|
||||
virtual void docx_serialize_field(const std::wstring & field_name, office_element_ptr & text, oox::docx_conversion_context & Context, bool bLock = false);
|
||||
virtual void docx_serialize_run(office_element_ptr & text, oox::docx_conversion_context & Context);
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context){}
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
};
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// simple text
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text : public paragraph_content_element<text>
|
||||
class text : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static office_element_ptr create(const std::wstring & Text);
|
||||
@ -99,7 +113,7 @@ private:
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:s
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class s : public paragraph_content_element<s>
|
||||
class s : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -130,7 +144,7 @@ CP_REGISTER_OFFICE_ELEMENT2(s);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:tab
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class tab : public paragraph_content_element<tab>
|
||||
class tab : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -161,7 +175,7 @@ CP_REGISTER_OFFICE_ELEMENT2(tab);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:line-break
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class line_break : public paragraph_content_element<line_break>
|
||||
class line_break : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -187,7 +201,7 @@ CP_REGISTER_OFFICE_ELEMENT2(line_break);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:bookmark
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class bookmark : public paragraph_content_element<bookmark>
|
||||
class bookmark : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -211,7 +225,7 @@ CP_REGISTER_OFFICE_ELEMENT2(bookmark);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:bookmark-start
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class bookmark_start : public paragraph_content_element<bookmark_start>
|
||||
class bookmark_start : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -235,7 +249,7 @@ CP_REGISTER_OFFICE_ELEMENT2(bookmark_start);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:bookmark-end
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class bookmark_end : public paragraph_content_element<bookmark_end>
|
||||
class bookmark_end : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -260,7 +274,7 @@ CP_REGISTER_OFFICE_ELEMENT2(bookmark_end);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:bookmark-ref
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class bookmark_ref : public paragraph_content_element<bookmark_ref>
|
||||
class bookmark_ref : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -281,7 +295,7 @@ CP_REGISTER_OFFICE_ELEMENT2(bookmark_ref);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:reference-ref
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class reference_ref : public paragraph_content_element<reference_ref>
|
||||
class reference_ref : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -303,7 +317,7 @@ CP_REGISTER_OFFICE_ELEMENT2(reference_ref);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:reference-mark
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class reference_mark : public paragraph_content_element<reference_mark>
|
||||
class reference_mark : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -324,7 +338,7 @@ CP_REGISTER_OFFICE_ELEMENT2(reference_mark);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:reference-mark-start
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class reference_mark_start : public paragraph_content_element<reference_mark_start>
|
||||
class reference_mark_start : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -345,7 +359,7 @@ CP_REGISTER_OFFICE_ELEMENT2(reference_mark_start);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:reference-mark-end
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class reference_mark_end : public paragraph_content_element<reference_mark_end>
|
||||
class reference_mark_end : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -367,7 +381,7 @@ CP_REGISTER_OFFICE_ELEMENT2(reference_mark_end);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:span
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class span : public paragraph_content_element<span>
|
||||
class span : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -380,6 +394,8 @@ public:
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
span() {}
|
||||
@ -400,7 +416,7 @@ CP_REGISTER_OFFICE_ELEMENT2(span);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:a
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class a : public paragraph_content_element<a>
|
||||
class a : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -438,7 +454,7 @@ CP_REGISTER_OFFICE_ELEMENT2(a);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:note
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class note : public paragraph_content_element<note>
|
||||
class note : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -467,7 +483,7 @@ CP_REGISTER_OFFICE_ELEMENT2(note);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:ruby
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class ruby : public paragraph_content_element<ruby>
|
||||
class ruby : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -491,7 +507,7 @@ CP_REGISTER_OFFICE_ELEMENT2(ruby);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:title
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class title : public paragraph_content_element<title>
|
||||
class title : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -519,7 +535,7 @@ CP_REGISTER_OFFICE_ELEMENT2(title);
|
||||
|
||||
// text:chapter
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class chapter : public paragraph_content_element<chapter>
|
||||
class chapter : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -545,7 +561,7 @@ CP_REGISTER_OFFICE_ELEMENT2(chapter);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:subject
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class subject : public paragraph_content_element<subject>
|
||||
class subject : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -570,7 +586,7 @@ CP_REGISTER_OFFICE_ELEMENT2(subject);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:placeholder
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_placeholder : public paragraph_content_element<text_placeholder>
|
||||
class text_placeholder : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -597,7 +613,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_placeholder);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:page-number
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_page_number: public paragraph_content_element<text_page_number>
|
||||
class text_page_number: public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -609,6 +625,8 @@ public:
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
private:
|
||||
@ -629,7 +647,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_page_number);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:page-count
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_page_count : public paragraph_content_element<text_page_count>
|
||||
class text_page_count : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -641,6 +659,8 @@ public:
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
_CP_OPT(odf_types::style_numformat) style_num_format_;
|
||||
@ -658,7 +678,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_page_count);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:date
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_date : public paragraph_content_element<text_date>
|
||||
class text_date : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -670,7 +690,8 @@ public:
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(odf_types::Bool) text_fixed_;
|
||||
@ -713,7 +734,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_modification_date);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:time
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_time : public paragraph_content_element<text_time>
|
||||
class text_time : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -725,7 +746,9 @@ public:
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
|
||||
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(odf_types::Bool)text_fixed_;
|
||||
@ -768,7 +791,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_modification_time);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:file-name
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_file_name : public paragraph_content_element<text_file_name>
|
||||
class text_file_name : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -780,7 +803,9 @@ public:
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
@ -795,7 +820,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_file_name);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:hidden-paragraph
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class hidden_paragraph : public paragraph_content_element<hidden_paragraph>
|
||||
class hidden_paragraph : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -819,7 +844,7 @@ CP_REGISTER_OFFICE_ELEMENT2(hidden_paragraph);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:hidden-text
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class hidden_text : public paragraph_content_element<hidden_text>
|
||||
class hidden_text : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -844,7 +869,7 @@ CP_REGISTER_OFFICE_ELEMENT2(hidden_text);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sequence
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sequence : public paragraph_content_element<sequence>
|
||||
class sequence : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -875,7 +900,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sequence);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:expression
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class expression: public paragraph_content_element<expression>
|
||||
class expression: public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -903,7 +928,7 @@ CP_REGISTER_OFFICE_ELEMENT2(expression);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:text-input
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_input: public paragraph_content_element<text_input>
|
||||
class text_input: public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -927,7 +952,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_input);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sequence_ref
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sequence_ref : public paragraph_content_element<sequence_ref>
|
||||
class sequence_ref : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -952,7 +977,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sequence_ref);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:drop-down
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_drop_down : public paragraph_content_element<text_drop_down>
|
||||
class text_drop_down : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -979,7 +1004,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_drop_down);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:label
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class text_label : public paragraph_content_element<text_label>
|
||||
class text_label : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1000,7 +1025,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_label);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sheet-name
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sheet_name : public paragraph_content_element<sheet_name>
|
||||
class sheet_name : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1010,6 +1035,8 @@ public:
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
@ -1022,7 +1049,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sheet_name);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:author-name
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class author_name : public paragraph_content_element<author_name>
|
||||
class author_name : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1044,7 +1071,7 @@ CP_REGISTER_OFFICE_ELEMENT2(author_name);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:author-initials
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class author_initials : public paragraph_content_element<author_initials>
|
||||
class author_initials : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1066,7 +1093,7 @@ CP_REGISTER_OFFICE_ELEMENT2(author_initials);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-city
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_city : public paragraph_content_element<sender_city>
|
||||
class sender_city : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1088,7 +1115,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_city);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-postal-code
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_postal_code : public paragraph_content_element<sender_postal_code>
|
||||
class sender_postal_code : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1112,7 +1139,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_postal_code);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-street
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_street : public paragraph_content_element<sender_street>
|
||||
class sender_street : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1134,7 +1161,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_street);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-state-or-province
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_state_or_province : public paragraph_content_element<sender_state_or_province>
|
||||
class sender_state_or_province : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1156,7 +1183,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_state_or_province);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-email
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_email : public paragraph_content_element<sender_email>
|
||||
class sender_email : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1178,7 +1205,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_email);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-firstname
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_firstname : public paragraph_content_element<sender_firstname>
|
||||
class sender_firstname : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1200,7 +1227,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_firstname);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-lastname
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_lastname : public paragraph_content_element<sender_lastname>
|
||||
class sender_lastname : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1222,7 +1249,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_lastname);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// text:sender-company
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class sender_company : public paragraph_content_element<sender_company>
|
||||
class sender_company : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1245,7 +1272,7 @@ CP_REGISTER_OFFICE_ELEMENT2(sender_company);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:user-field-get
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_user_field_get : public paragraph_content_element<text_user_field_get>
|
||||
class text_user_field_get : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1271,7 +1298,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_user_field_get);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//text:user-defined
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class text_user_defined : public paragraph_content_element<text_user_defined>
|
||||
class text_user_defined : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1299,7 +1326,7 @@ CP_REGISTER_OFFICE_ELEMENT2(text_user_defined);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:bibliography-mark
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class bibliography_mark : public paragraph_content_element<bibliography_mark>
|
||||
class bibliography_mark : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1356,7 +1383,7 @@ CP_REGISTER_OFFICE_ELEMENT2(bibliography_mark);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:alphabetical-index-auto-mark-file
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class alphabetical_index_auto_mark_file : public paragraph_content_element<alphabetical_index_auto_mark_file>
|
||||
class alphabetical_index_auto_mark_file : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1377,7 +1404,7 @@ CP_REGISTER_OFFICE_ELEMENT2(alphabetical_index_auto_mark_file);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:alphabetical-index-mark-start
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class alphabetical_index_mark_start : public paragraph_content_element<alphabetical_index_mark_start>
|
||||
class alphabetical_index_mark_start : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1403,7 +1430,7 @@ CP_REGISTER_OFFICE_ELEMENT2(alphabetical_index_mark_start);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:alphabetical-index-mark-end
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class alphabetical_index_mark_end : public paragraph_content_element<alphabetical_index_mark_end>
|
||||
class alphabetical_index_mark_end : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1424,7 +1451,7 @@ CP_REGISTER_OFFICE_ELEMENT2(alphabetical_index_mark_end);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:alphabetical-index-mark
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class alphabetical_index_mark : public paragraph_content_element<alphabetical_index_mark>
|
||||
class alphabetical_index_mark : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1450,7 +1477,7 @@ CP_REGISTER_OFFICE_ELEMENT2(alphabetical_index_mark);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:user-index-mark-start
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class user_index_mark_start : public paragraph_content_element<user_index_mark_start>
|
||||
class user_index_mark_start : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1473,7 +1500,7 @@ CP_REGISTER_OFFICE_ELEMENT2(user_index_mark_start);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:user-index-mark-end
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class user_index_mark_end : public paragraph_content_element<user_index_mark_end>
|
||||
class user_index_mark_end : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1494,7 +1521,7 @@ CP_REGISTER_OFFICE_ELEMENT2(user_index_mark_end);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:user-index-mark
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class user_index_mark : public paragraph_content_element<user_index_mark>
|
||||
class user_index_mark : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1517,7 +1544,7 @@ CP_REGISTER_OFFICE_ELEMENT2(user_index_mark);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:toc-mark-start
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class toc_mark_start : public paragraph_content_element<toc_mark_start>
|
||||
class toc_mark_start : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1539,7 +1566,7 @@ CP_REGISTER_OFFICE_ELEMENT2(toc_mark_start);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:toc-mark-end
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class toc_mark_end : public paragraph_content_element<toc_mark_end>
|
||||
class toc_mark_end : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1560,7 +1587,7 @@ CP_REGISTER_OFFICE_ELEMENT2(toc_mark_end);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
//text:toc-mark
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
class toc_mark : public paragraph_content_element<toc_mark>
|
||||
class toc_mark : public paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1584,7 +1611,7 @@ CP_REGISTER_OFFICE_ELEMENT2(toc_mark);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//presentation:footer
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class presentation_footer : public text::paragraph_content_element<presentation_footer>
|
||||
class presentation_footer : public text::paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1606,7 +1633,7 @@ CP_REGISTER_OFFICE_ELEMENT2(presentation_footer);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
//presentation:date-time
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class presentation_date_time: public text::paragraph_content_element<presentation_date_time>
|
||||
class presentation_date_time: public text::paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1629,7 +1656,7 @@ CP_REGISTER_OFFICE_ELEMENT2(presentation_date_time);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// field:fieldmark-start
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class field_fieldmark_start : public text::paragraph_content_element<field_fieldmark_start>
|
||||
class field_fieldmark_start : public text::paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1651,7 +1678,7 @@ CP_REGISTER_OFFICE_ELEMENT2(field_fieldmark_start);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// field:fieldmark-end
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class field_fieldmark_end : public text::paragraph_content_element<field_fieldmark_end>
|
||||
class field_fieldmark_end : public text::paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1670,7 +1697,7 @@ CP_REGISTER_OFFICE_ELEMENT2(field_fieldmark_end);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// field:fieldmark
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class field_fieldmark : public text::paragraph_content_element<field_fieldmark>
|
||||
class field_fieldmark : public text::paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -1694,7 +1721,7 @@ CP_REGISTER_OFFICE_ELEMENT2(field_fieldmark);
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
// field:param
|
||||
//-------------------------------------------------------------------------------------------------------------------
|
||||
class field_param : public text::paragraph_content_element<field_param>
|
||||
class field_param : public text::paragraph_content_element
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
|
||||
@ -158,13 +158,22 @@ void graphic_format_properties::apply_to(std::vector<_property> & properties)
|
||||
{
|
||||
properties.push_back(_property(L"contrast", common_draw_fill_attlist_.draw_contrast_->get_value()));
|
||||
}
|
||||
if (common_shadow_attlist_.draw_shadow_.get_value_or(shadow_type1::Hidden).get_type() == shadow_type1::Visible)
|
||||
{
|
||||
properties.push_back(_property(L"shadow", true));
|
||||
if (common_shadow_attlist_.draw_shadow_color_) properties.push_back(_property(L"shadow-color", common_shadow_attlist_.draw_shadow_color_->get_hex_value()));
|
||||
if (common_shadow_attlist_.draw_shadow_opacity_) properties.push_back(_property(L"shadow-opacity", common_shadow_attlist_.draw_shadow_opacity_->get_value()));
|
||||
if (common_shadow_attlist_.draw_shadow_offset_x_) properties.push_back(_property(L"shadow-offset-x", common_shadow_attlist_.draw_shadow_offset_x_->get_value_unit(length::emu)));
|
||||
if (common_shadow_attlist_.draw_shadow_offset_y_) properties.push_back(_property(L"shadow-offset-y", common_shadow_attlist_.draw_shadow_offset_y_->get_value_unit(length::emu)));
|
||||
}
|
||||
if (common_padding_attlist_.fo_padding_)
|
||||
{
|
||||
properties.push_back(_property(L"text-padding-left", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
|
||||
properties.push_back(_property(L"text-padding-right", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
|
||||
properties.push_back(_property(L"text-padding-top", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
|
||||
properties.push_back(_property(L"text-padding-bottom", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (common_padding_attlist_.fo_padding_left_)
|
||||
properties.push_back(_property(L"text-padding-left", common_padding_attlist_.fo_padding_left_->get_value_unit(length::emu)));
|
||||
|
||||
@ -85,6 +85,8 @@ public:
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleTabStop;
|
||||
|
||||
style_tab_stop() : margin_left(0) {}
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
@ -108,7 +110,10 @@ public:
|
||||
_CP_OPT(odf_types::style_leader_color) style_leader_color_;
|
||||
|
||||
_CP_OPT( std::wstring ) style_leader_text_;
|
||||
_CP_OPT( std::wstring ) style_leader_text_style_;
|
||||
_CP_OPT( std::wstring ) style_leader_text_style_;
|
||||
|
||||
//-----------------------------
|
||||
double margin_left;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -450,12 +450,8 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context, bool c
|
||||
|
||||
length def_tab = length(1.0, length::cm);// в ms значение 0.8 не корректно оО
|
||||
|
||||
int tab_pos = (int)( 20.0 * style_position_.get_value_unit(length::pt) ) ;
|
||||
int min_tab_pos = (int)( 20.0 * def_tab.get_value_unit(length::pt) ) ;
|
||||
|
||||
int margin_left_pos = Context.get_margin_left();
|
||||
|
||||
tab_pos += margin_left_pos;
|
||||
double tab_pos = 20.0 * style_position_.get_value_unit(length::pt) + margin_left ;
|
||||
double min_tab_pos = 20.0 * def_tab.get_value_unit(length::pt) ;
|
||||
|
||||
if (tab_pos < min_tab_pos)
|
||||
tab_pos = min_tab_pos;
|
||||
@ -467,12 +463,13 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context, bool c
|
||||
{
|
||||
case style_type::Left: val = L"left"; break;
|
||||
case style_type::Center:val = L"center"; break;
|
||||
case style_type::Right: val = L"right"; break;
|
||||
case style_type::Char: val = L"decimal"; break;
|
||||
case style_type::Right: val = L"right"; break;
|
||||
}
|
||||
}
|
||||
|
||||
_pPr << L" w:val=\"" << val << "\"";
|
||||
_pPr << L" w:pos=\"" << tab_pos << "\"";
|
||||
_pPr << L" w:pos=\"" << (int)tab_pos << "\"";
|
||||
|
||||
std::wstring leader;
|
||||
|
||||
|
||||
@ -31,118 +31,110 @@
|
||||
*/
|
||||
|
||||
#include "style_regions.h"
|
||||
#include "text_elements.h"
|
||||
#include "paragraph_elements.h"
|
||||
|
||||
#include <xml/xmlchar.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
const wchar_t * style_region_impl::ns = L"style";
|
||||
const wchar_t * style_region_impl::name = L"region";
|
||||
|
||||
void style_region_impl::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
void style_region_impl::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
void style_region_impl::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
text::p* paragr = dynamic_cast<text::p*>(content_[i].get());
|
||||
text::h* header = dynamic_cast<text::h*>(content_[i].get());
|
||||
|
||||
if (paragr || header)
|
||||
{
|
||||
text::paragraph* p = paragr ? ¶gr->paragraph_ : &header->paragraph_;
|
||||
|
||||
if (false == p->attrs_.text_style_name_.empty())
|
||||
{
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < p->content_.size(); j++)
|
||||
{
|
||||
text::paragraph_content_element *element = dynamic_cast<text::paragraph_content_element*>(p->content_[j].get());
|
||||
|
||||
if (element)
|
||||
{
|
||||
element->xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_SERIALIZE_TEXT(p->content_[j], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_SERIALIZE_TEXT(content_[i], true);
|
||||
}
|
||||
if (i < content_.size() - 1)
|
||||
_Wostream << L"
";
|
||||
}
|
||||
}
|
||||
void style_region_impl::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
}
|
||||
|
||||
void style_region_impl::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
// style:region-left
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_region_left::ns = L"style";
|
||||
const wchar_t * style_region_left::name = L"region-left";
|
||||
|
||||
void style_region_left::docx_convert(oox::docx_conversion_context & Context)
|
||||
void style_region_left::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
_Wostream << L"&L";
|
||||
style_region_impl::xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
|
||||
void style_region_left::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
void style_region_left::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
}
|
||||
|
||||
void style_region_left::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void style_region_left::add_text(const std::wstring & Text)
|
||||
{
|
||||
}
|
||||
|
||||
// style:region-right
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_region_right::ns = L"style";
|
||||
const wchar_t * style_region_right::name = L"region-right";
|
||||
|
||||
void style_region_right::docx_convert(oox::docx_conversion_context & Context)
|
||||
void style_region_right::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
_Wostream << L"&R";
|
||||
style_region_impl::xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
|
||||
void style_region_right::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
void style_region_right::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
}
|
||||
|
||||
void style_region_right::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void style_region_right::add_text(const std::wstring & Text)
|
||||
{
|
||||
}
|
||||
|
||||
// style:region-center
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_region_center::ns = L"style";
|
||||
const wchar_t * style_region_center::name = L"region-center";
|
||||
|
||||
void style_region_center::docx_convert(oox::docx_conversion_context & Context)
|
||||
void style_region_center::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
void style_region_center::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
void style_region_center::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
}
|
||||
|
||||
void style_region_center::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void style_region_center::add_text(const std::wstring & Text)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
_Wostream << L"&C";
|
||||
style_region_impl::xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,80 +40,66 @@
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
class style_region_impl : public office_element_impl<style_region_impl>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleRegion;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
};
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
// style:region-left
|
||||
class style_region_left : public office_element_impl<style_region_left>
|
||||
class style_region_left : public style_region_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleRegionLeft;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_region_left);
|
||||
|
||||
// style:region-right
|
||||
class style_region_right : public office_element_impl<style_region_right>
|
||||
class style_region_right : public style_region_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleRegionRight;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_region_right);
|
||||
|
||||
|
||||
// style:region-center
|
||||
class style_region_center : public office_element_impl<style_region_center>
|
||||
class style_region_center : public style_region_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleRegionCenter;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_region_center);
|
||||
|
||||
}
|
||||
|
||||
@ -552,7 +552,71 @@ void text_format_properties_content::drawing_serialize(std::wostream & strm, std
|
||||
}
|
||||
}
|
||||
}
|
||||
void text_format_properties_content::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
double font_size = process_font_size_impl(fo_font_size_, NULL);
|
||||
|
||||
bool bBold = false, bItalic = false;
|
||||
if (font_size > 0)
|
||||
{
|
||||
strm << L"&" << font_size;
|
||||
}
|
||||
if (fo_font_style_ && fo_font_style_->get_type() == font_style::Italic)
|
||||
{
|
||||
bItalic = true;
|
||||
//strm << L"&I";
|
||||
}
|
||||
if (fo_font_weight_ && fo_font_weight_->get_type() == font_weight::WNormal)
|
||||
{
|
||||
bBold = true;
|
||||
//strm << L"&B";
|
||||
}
|
||||
std::wstring font_name;
|
||||
if (fo_font_family_)
|
||||
{
|
||||
font_name = *fo_font_family_;
|
||||
}
|
||||
else if (style_font_name_)
|
||||
{
|
||||
odf_read_context & context = Context.root()->odf_context();
|
||||
fonts_container & fonts = context.fontContainer();
|
||||
|
||||
font_instance * font = fonts.font_by_style_name(*style_font_name_);
|
||||
if (font)
|
||||
font_name = font->name();
|
||||
}
|
||||
//if (font_name.empty())
|
||||
{
|
||||
font_name = L"-";
|
||||
}
|
||||
font_name += L",";
|
||||
|
||||
if (!bBold && !bItalic) font_name += L"Regular";
|
||||
else if (bBold && bItalic) font_name += L"Bold Italic";
|
||||
else if (bBold) font_name += L"Bold";
|
||||
else if (bItalic) font_name += L"Italic";
|
||||
|
||||
strm << L"&"" << font_name << L""";
|
||||
|
||||
if (style_text_underline_type_)
|
||||
{
|
||||
if (style_text_underline_type_->get_type() == line_type::Single) strm << L"&U";
|
||||
if (style_text_underline_type_->get_type() == line_type::Double) strm << L"&E";
|
||||
}
|
||||
if (style_text_line_through_type_ && style_text_line_through_type_->get_type() != line_type::None)
|
||||
{
|
||||
strm << L"&S";
|
||||
}
|
||||
if (style_text_position_)
|
||||
{
|
||||
if (style_text_position_->get_position().get_value() < 0) strm << L"&Y";
|
||||
if (style_text_position_->get_position().get_value() > 0) strm << L"&X";
|
||||
}
|
||||
if (fo_color_)
|
||||
{
|
||||
strm << L"&K" << fo_color_->get_hex_value();
|
||||
}
|
||||
}
|
||||
void text_format_properties_content::docx_serialize(std::wostream & _rPr, fonts_container & fonts)
|
||||
{//упрощенный вариант
|
||||
|
||||
@ -1603,7 +1667,7 @@ const wchar_t * style_text_properties::name = L"text-properties";
|
||||
|
||||
void style_text_properties::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
text_format_properties_content_.add_attributes(Attributes);
|
||||
content_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_text_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -1613,12 +1677,12 @@ void style_text_properties::add_child_element( xml::sax * Reader, const std::wst
|
||||
|
||||
void style_text_properties::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
text_format_properties_content_.docx_convert(Context);
|
||||
content_.docx_convert(Context);
|
||||
}
|
||||
|
||||
void style_text_properties::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
text_format_properties_content_.pptx_convert(Context);
|
||||
content_.pptx_convert(Context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -70,7 +70,6 @@ namespace odf_reader {
|
||||
class style_instance;
|
||||
class fonts_container;
|
||||
|
||||
// 15.4
|
||||
class text_format_properties_content : public oox::conversion_element
|
||||
{
|
||||
public:
|
||||
@ -84,7 +83,9 @@ public:
|
||||
void docx_serialize (std::wostream & stream, fonts_container & fonts);
|
||||
void drawing_serialize (std::wostream & stream, std::wstring node, fonts_container & fonts, const odf_reader::style_instance *current_style = NULL, std::wstring hlink = L"");
|
||||
|
||||
void apply_from (const text_format_properties_content & Other);
|
||||
void xlsx_serialize (std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
|
||||
void apply_from (const text_format_properties_content & Other);
|
||||
void apply_to (std::vector<_property> & properties);
|
||||
void set_r_style (const std::wstring & rStyle) { r_style_ = rStyle; }
|
||||
|
||||
@ -178,7 +179,7 @@ class style_text_properties;
|
||||
typedef shared_ptr<style_text_properties>::Type style_text_properties_ptr;
|
||||
|
||||
|
||||
/// style:text-properties
|
||||
// style:text-properties
|
||||
class style_text_properties : public office_element_impl<style_text_properties>
|
||||
{
|
||||
public:
|
||||
@ -192,17 +193,17 @@ public:
|
||||
void docx_convert (oox::docx_conversion_context & Context);
|
||||
void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
|
||||
const text_format_properties_content & content() const { return text_format_properties_content_; } ;
|
||||
text_format_properties_content & content() { return text_format_properties_content_; } ;
|
||||
const text_format_properties_content & content() const { return content_; } ;
|
||||
text_format_properties_content & content() { return content_; } ;
|
||||
|
||||
style_text_properties(){};
|
||||
style_text_properties(const std::wstring & rStyle) { text_format_properties_content_.set_r_style(rStyle); };
|
||||
style_text_properties(const std::wstring & rStyle) { content_.set_r_style(rStyle); };
|
||||
|
||||
private:
|
||||
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
text_format_properties_content text_format_properties_content_;
|
||||
text_format_properties_content content_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_text_properties);
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
#include "style_graphic_properties.h"
|
||||
#include "style_chart_properties.h"
|
||||
#include "style_presentation.h"
|
||||
#include "style_regions.h"
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include "odfcontext.h"
|
||||
@ -204,7 +205,13 @@ style_drawing_page_properties * style_content::get_style_drawing_page_properties
|
||||
{
|
||||
return dynamic_cast<style_drawing_page_properties *>(style_drawing_page_properties_.get());
|
||||
}
|
||||
|
||||
void style_content::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (style_text_properties *text_props = get_style_text_properties())
|
||||
{
|
||||
text_props->content().xlsx_serialize(strm, Context);
|
||||
}
|
||||
}
|
||||
void style_content::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (style_table_column_properties_)
|
||||
@ -215,7 +222,6 @@ void style_content::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
if (style_chart_properties_)
|
||||
style_chart_properties_->xlsx_convert(Context);
|
||||
|
||||
}
|
||||
|
||||
void style_content::docx_convert(oox::docx_conversion_context & Context, bool in_styles)
|
||||
@ -659,93 +665,6 @@ void office_styles::add_child_element( xml::sax * Reader, const std::wstring & N
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// style:header
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_header::ns = L"style";
|
||||
const wchar_t * style_header::name = L"header";
|
||||
|
||||
void style_header::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
content().common_style_header_footer_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_header::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_footer::ns = L"style";
|
||||
const wchar_t * style_footer::name = L"footer";
|
||||
|
||||
void style_footer::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
content().common_style_header_footer_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_footer::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_header_first::ns = L"style";
|
||||
const wchar_t * style_header_first::name = L"header-first";
|
||||
|
||||
void style_header_first::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
content().common_style_header_footer_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_header_first::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_footer_first::ns = L"style";
|
||||
const wchar_t * style_footer_first::name = L"footer-first";
|
||||
|
||||
void style_footer_first::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
content().common_style_header_footer_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_footer_first::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_header_left::ns = L"style";
|
||||
const wchar_t * style_header_left::name = L"header-left";
|
||||
|
||||
void style_header_left::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
content().common_style_header_footer_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_header_left::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_footer_left::ns = L"style";
|
||||
const wchar_t * style_footer_left::name = L"footer-left";
|
||||
|
||||
void style_footer_left::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
content().common_style_header_footer_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_footer_left::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_columns::ns = L"style";
|
||||
const wchar_t * style_columns::name = L"columns";
|
||||
@ -1265,7 +1184,21 @@ void style_page_layout_properties::add_attributes( const xml::attributes_wc_ptr
|
||||
|
||||
void style_page_layout_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
elements_.add_child_element(Reader, Ns, Name, getContext());
|
||||
if (L"style" == Ns && L"background-image" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(style_background_image_);
|
||||
}
|
||||
else if (L"style" == Ns && L"columns" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(style_columns_);
|
||||
}
|
||||
else if (L"style" == Ns && L"footnote-sep" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(style_footnote_sep_);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
bool style_page_layout_properties::docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id)
|
||||
@ -1292,9 +1225,7 @@ bool style_page_layout_properties::docx_background_serialize(std::wostream & str
|
||||
return true;
|
||||
}
|
||||
|
||||
void style_page_layout_properties::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
}
|
||||
|
||||
void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -1305,10 +1236,10 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
|
||||
if (horizontal_margins.fo_margin_left_ || horizontal_margins.fo_margin_right_ ||
|
||||
vertical_margins.fo_margin_top_ || vertical_margins.fo_margin_bottom_ )
|
||||
{
|
||||
//_CP_OPT(odf_types::length) margin_top, margin_bottom;
|
||||
_CP_OPT(double) header, footer;
|
||||
|
||||
//margin_top = Context.get_header_footer_context().header();
|
||||
//margin_bottom = Context.get_header_footer_context().footer();
|
||||
header = Context.get_table_context().get_header_page();
|
||||
footer = Context.get_table_context().get_footer_page();
|
||||
|
||||
CP_XML_NODE(L"pageMargins")
|
||||
{
|
||||
@ -1328,12 +1259,10 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
|
||||
CP_XML_ATTR(L"bottom" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
|
||||
else CP_XML_ATTR(L"bottom", 1.025);
|
||||
|
||||
if (vertical_margins.fo_margin_top_)
|
||||
CP_XML_ATTR(L"header" , vertical_margins.fo_margin_top_->get_length().get_value_unit(odf_types::length::inch));
|
||||
if (header) CP_XML_ATTR(L"header" , *header / 72.0); // pt -> inch
|
||||
else CP_XML_ATTR(L"header", 0.7875);
|
||||
|
||||
if (vertical_margins.fo_margin_bottom_)
|
||||
CP_XML_ATTR(L"footer" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
|
||||
if (footer) CP_XML_ATTR(L"footer" , *footer / 72.0);
|
||||
else CP_XML_ATTR(L"footer", 0.7875);
|
||||
}
|
||||
}
|
||||
@ -1360,11 +1289,11 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
|
||||
}
|
||||
}
|
||||
}
|
||||
if (elements_.style_background_image_)
|
||||
if (style_background_image_)
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
|
||||
Compute_GraphicFill(attlist_.common_draw_fill_attlist_, elements_.style_background_image_, Context.root()->odf_context().drawStyles(), fill);
|
||||
Compute_GraphicFill(attlist_.common_draw_fill_attlist_, style_background_image_, Context.root()->odf_context().drawStyles(), fill);
|
||||
if (fill.bitmap)
|
||||
{
|
||||
if ( fill.bitmap->rId.empty())
|
||||
@ -1372,7 +1301,7 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
|
||||
Context.get_drawing_context().get_drawings()->add(fill.bitmap->isInternal, fill.bitmap->rId, href, oox::typeImage, true);
|
||||
Context.get_drawing_context().get_drawings()->add(fill.bitmap->isInternal, fill.bitmap->rId, href, oox::typeImage, true, false);
|
||||
}
|
||||
|
||||
Context.get_table_context().state()->set_background(fill.bitmap->rId);
|
||||
@ -1382,7 +1311,7 @@ void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xls
|
||||
|
||||
void style_page_layout_properties::docx_serialize(std::wostream & strm, oox::docx_conversion_context & Context)
|
||||
{
|
||||
style_columns * columns = dynamic_cast<style_columns *>( elements_.style_columns_.get());
|
||||
style_columns * columns = dynamic_cast<style_columns *>( style_columns_.get());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -1474,28 +1403,6 @@ void style_page_layout_properties::pptx_serialize(std::wostream & strm, oox::ppt
|
||||
}
|
||||
}
|
||||
|
||||
// style-page-layout-properties-elements
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void style_page_layout_properties_elements::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context )
|
||||
{
|
||||
if (L"style" == Ns && L"background-image" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT_SIMPLE(style_background_image_);
|
||||
}
|
||||
else if (L"style" == Ns && L"columns" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT_SIMPLE(style_columns_);
|
||||
}
|
||||
else if (L"style" == Ns && L"footnote-sep" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT_SIMPLE(style_footnote_sep_);
|
||||
}
|
||||
else
|
||||
{
|
||||
not_applicable_element(L"style-page-layout-properties-elements", Reader, Ns, Name);
|
||||
}
|
||||
}
|
||||
|
||||
// style-master-page-attlist
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1620,7 +1527,6 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
|
||||
}
|
||||
////////////////
|
||||
|
||||
const wchar_t * hdrHeader = L"<w:hdr \
|
||||
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
@ -1661,6 +1567,10 @@ xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
mc:Ignorable=\"w14 wp14\">";
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * style_header::ns = L"style";
|
||||
const wchar_t * style_header::name = L"header";
|
||||
|
||||
void style_header::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
@ -1670,6 +1580,20 @@ void style_header::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
strm << L"</w:hdr>";
|
||||
}
|
||||
void style_header::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"oddHeader")
|
||||
{
|
||||
header_footer_impl::xlsx_serialize(CP_XML_STREAM(), Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * style_footer::ns = L"style";
|
||||
const wchar_t * style_footer::name = L"footer";
|
||||
|
||||
void style_footer::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -1679,6 +1603,19 @@ void style_footer::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
strm << L"</w:ftr>";
|
||||
}
|
||||
void style_footer::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"oddFooter")
|
||||
{
|
||||
header_footer_impl::xlsx_serialize(CP_XML_STREAM(), Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * style_header_first::ns = L"style";
|
||||
const wchar_t * style_header_first::name = L"header-first";
|
||||
|
||||
void style_header_first::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -1689,6 +1626,20 @@ void style_header_first::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
strm << L"</w:hdr>";
|
||||
}
|
||||
void style_header_first::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"firstHeader")
|
||||
{
|
||||
header_footer_impl::xlsx_serialize(CP_XML_STREAM(), Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * style_footer_first::ns = L"style";
|
||||
const wchar_t * style_footer_first::name = L"footer-first";
|
||||
|
||||
void style_footer_first::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -1698,7 +1649,19 @@ void style_footer_first::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
strm << L"</w:ftr>";
|
||||
}
|
||||
|
||||
void style_footer_first::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"firstFooter")
|
||||
{
|
||||
header_footer_impl::xlsx_serialize(CP_XML_STREAM(), Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * style_header_left::ns = L"style";
|
||||
const wchar_t * style_header_left::name = L"header-left";
|
||||
|
||||
void style_header_left::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -1708,6 +1671,20 @@ void style_header_left::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
strm << L"</w:hdr>";
|
||||
}
|
||||
void style_header_left::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"evenHeader")
|
||||
{
|
||||
header_footer_impl::xlsx_serialize(CP_XML_STREAM(), Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
const wchar_t * style_footer_left::ns = L"style";
|
||||
const wchar_t * style_footer_left::name = L"footer-left";
|
||||
|
||||
void style_footer_left::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
@ -1717,18 +1694,66 @@ void style_footer_left::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
strm << L"</w:ftr>";
|
||||
}
|
||||
void style_footer_left::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"evenFooter")
|
||||
{
|
||||
header_footer_impl::xlsx_serialize(CP_XML_STREAM(), Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
const wchar_t * header_footer_impl::ns = L"style";
|
||||
const wchar_t * header_footer_impl::name = L"header-footer";
|
||||
|
||||
void header_footer_impl::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void header_footer_impl::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"text", L"tracked-changes")
|
||||
{
|
||||
CP_CREATE_ELEMENT(tracked_changes_);
|
||||
}
|
||||
else
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
std::wostream & header_footer_impl::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
|
||||
{
|
||||
serialize_elements_text(_Wostream, content_, bXmlEncode);
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
void header_footer_impl::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
if (content_.header_footer_content_.tracked_changes_)
|
||||
content_.header_footer_content_.tracked_changes_->docx_convert(Context);
|
||||
if (tracked_changes_)
|
||||
tracked_changes_->docx_convert(Context);
|
||||
|
||||
for (size_t i = 0; i < content_.header_footer_content_.content_.size(); i++)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_.header_footer_content_.content_[i]->docx_convert(Context);
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
void header_footer_impl::xlsx_serialize(std::wostream & _Wostream, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
style_region_impl* region = dynamic_cast<style_region_impl*>(content_[i].get());
|
||||
|
||||
if (region)
|
||||
{
|
||||
region->xlsx_serialize(_Wostream, Context);
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_SERIALIZE_TEXT(content_[i], true);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// text:notes-configuration
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * text_notes_configuration::ns = L"text";
|
||||
|
||||
@ -89,7 +89,9 @@ public:
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context, bool in_styles = false);
|
||||
void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
|
||||
|
||||
void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
|
||||
graphic_format_properties * get_graphic_properties() const;
|
||||
|
||||
style_text_properties * get_style_text_properties() const;
|
||||
@ -570,28 +572,38 @@ public:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(office_styles);
|
||||
|
||||
class header_footer_content_impl
|
||||
//----------------------------------------------------------------------------------------------
|
||||
class header_footer_impl : public office_element_impl<header_footer_impl>
|
||||
{
|
||||
public:
|
||||
common_style_header_footer_attlist common_style_header_footer_attlist_;
|
||||
header_footer_content header_footer_content_;
|
||||
};
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeStyleHeaderFooter;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
class header_footer_impl
|
||||
{
|
||||
public:
|
||||
header_footer_content_impl & content() { return content_; }
|
||||
const header_footer_content_impl & content() const { return content_; }
|
||||
virtual ~header_footer_impl() {}
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
friend class odf_document;
|
||||
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) {}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context) {}
|
||||
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
header_footer_content_impl content_;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
|
||||
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
|
||||
|
||||
common_style_header_footer_attlist attlist_;
|
||||
|
||||
office_element_ptr tracked_changes_;
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
|
||||
// style:header
|
||||
class style_header : public office_element_impl<style_header>, public header_footer_impl
|
||||
// style:header
|
||||
class style_header : public header_footer_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
@ -600,133 +612,86 @@ public:
|
||||
static const ElementType type = typeStyleHeader;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
//header_footer_content_impl content_;
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_header);
|
||||
|
||||
/// style:footer
|
||||
class style_footer : public office_element_impl<style_footer>, public header_footer_impl
|
||||
// style:footer
|
||||
class style_footer : public header_footer_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleFooter;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
// header_footer_content_impl content_;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_footer);
|
||||
|
||||
/// style:header-first
|
||||
class style_header_first : public office_element_impl<style_header_first>, public header_footer_impl
|
||||
// style:header-first
|
||||
class style_header_first : public header_footer_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleHeaderFirst;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
//header_footer_content_impl content_;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_header_first);
|
||||
|
||||
/// style:footer_first
|
||||
class style_footer_first : public office_element_impl<style_footer_first>, public header_footer_impl
|
||||
// style:footer_first
|
||||
class style_footer_first : public header_footer_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleFooterFirst;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
// header_footer_content_impl content_;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_footer_first);
|
||||
|
||||
/// style:header-left
|
||||
class style_header_left : public office_element_impl<style_header_left>, public header_footer_impl
|
||||
// style:header-left
|
||||
class style_header_left : public header_footer_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleHeaderLeft;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
// header_footer_content_impl content_;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_header_left);
|
||||
|
||||
/// style:footer-left
|
||||
class style_footer_left : public office_element_impl<style_footer_left>, public header_footer_impl
|
||||
// style:footer-left
|
||||
class style_footer_left : public header_footer_impl
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleFooterLeft;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
// header_footer_content_impl content_;
|
||||
|
||||
virtual void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_footer_left);
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
class style_columns : public office_element_impl<style_columns>
|
||||
{
|
||||
public:
|
||||
@ -982,20 +947,6 @@ private:
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_footnote_sep);
|
||||
|
||||
// style-page-layout-properties-elements
|
||||
class style_page_layout_properties_elements
|
||||
{
|
||||
public:
|
||||
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
|
||||
|
||||
office_element_ptr style_background_image_;
|
||||
office_element_ptr style_columns_;
|
||||
|
||||
// 15.2.20
|
||||
office_element_ptr style_footnote_sep_;
|
||||
|
||||
};
|
||||
|
||||
// style:page-layout-properties
|
||||
class style_page_layout_properties : public office_element_impl<style_page_layout_properties>
|
||||
{
|
||||
@ -1006,19 +957,21 @@ public:
|
||||
static const ElementType type = typeStylePageLayout;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
void xlsx_convert (oox::xlsx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
bool docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id);
|
||||
|
||||
void docx_serialize (std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void docx_serialize(std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
void pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context);
|
||||
|
||||
style_page_layout_properties() { }
|
||||
|
||||
style_page_layout_properties_attlist attlist_;
|
||||
style_page_layout_properties_elements elements_;
|
||||
style_page_layout_properties_attlist attlist_;
|
||||
|
||||
office_element_ptr style_background_image_;
|
||||
office_element_ptr style_columns_;
|
||||
office_element_ptr style_footnote_sep_;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@ -777,7 +777,6 @@ public:
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
@ -802,7 +801,6 @@ public:
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
|
||||
@ -1249,11 +1249,31 @@ void table_content_validation::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
{
|
||||
if (content_[i]->get_type() == typeTableErrorMassage)
|
||||
{
|
||||
Context.get_dataValidations_context().add_error_msg(name, true);
|
||||
table_error_message* error = dynamic_cast<table_error_message*>(content_[i].get());
|
||||
|
||||
Context.get_text_context().start_only_text();
|
||||
for (size_t j = 0 ; j < error->content_.size(); j++)
|
||||
{
|
||||
error->content_[j]->xlsx_convert(Context);
|
||||
}
|
||||
std::wstring content = Context.get_text_context().end_only_text();
|
||||
|
||||
Context.get_dataValidations_context().add_error_msg(name, error->table_title_.get_value_or(L""), content,
|
||||
error->table_display_ ? error->table_display_->get() : true);
|
||||
}
|
||||
else if (content_[i]->get_type() == typeTableErrorMassage)
|
||||
else if (content_[i]->get_type() == typeTableHelpMassage)
|
||||
{
|
||||
Context.get_dataValidations_context().add_help_msg(name, true);
|
||||
table_help_message* help = dynamic_cast<table_help_message*>(content_[i].get());
|
||||
|
||||
Context.get_text_context().start_only_text();
|
||||
for (size_t j = 0 ; j < help->content_.size(); j++)
|
||||
{
|
||||
help->content_[j]->xlsx_convert(Context);
|
||||
}
|
||||
std::wstring content = Context.get_text_context().end_only_text();
|
||||
|
||||
Context.get_dataValidations_context().add_help_msg(name, help->table_title_.get_value_or(L""), content,
|
||||
help->table_display_ ? help->table_display_->get() : true);
|
||||
}
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
|
||||
@ -78,13 +78,13 @@ public:
|
||||
|
||||
size_t drop_cap_docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
paragraph_attrs attrs_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr sequence_;
|
||||
private:
|
||||
void drop_cap_text_docx_convert(office_element_ptr first_text_paragraph,oox::docx_conversion_context & Context);
|
||||
|
||||
paragraph_attrs attrs_;
|
||||
|
||||
|
||||
bool next_section_;
|
||||
bool next_end_section_;
|
||||
|
||||
|
||||
@ -427,6 +427,14 @@
|
||||
RelativePath="..\src\odf\style_ref.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\style_regions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\style_regions.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\style_table_properties.cpp"
|
||||
>
|
||||
@ -1667,14 +1675,6 @@
|
||||
RelativePath="..\src\odf\skipelement.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\style_regions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\style_regions.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\odf\table.cpp"
|
||||
>
|
||||
|
||||
@ -105,7 +105,7 @@ void draw_rect::serialize(std::wostream & _Wostream)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/// draw-ellipse-attlist
|
||||
|
||||
void draw_ellipse_attlist::serialize(CP_ATTR_NODE)
|
||||
@ -113,7 +113,9 @@ void draw_ellipse_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"draw:filter-name", draw_filter_name_);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/// draw:ellipse
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_ellipse::ns = L"draw";
|
||||
const wchar_t * draw_ellipse::name = L"ellipse";
|
||||
|
||||
@ -134,8 +136,9 @@ void draw_ellipse::serialize(std::wostream & _Wostream)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:circle
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_circle::ns = L"draw";
|
||||
const wchar_t * draw_circle::name = L"circle";
|
||||
|
||||
@ -153,7 +156,7 @@ void draw_circle::serialize(std::wostream & _Wostream)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/// draw-line-attlist
|
||||
void draw_line_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
@ -181,8 +184,9 @@ void draw_line::serialize(std::wostream & _Wostream)
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:custom_shape
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_custom_shape::ns = L"draw";
|
||||
const wchar_t * draw_custom_shape::name = L"custom-shape";
|
||||
|
||||
@ -219,7 +223,9 @@ void draw_path_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"svg:viewBox", svg_viewbox_);
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:path
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_path::ns = L"draw";
|
||||
const wchar_t * draw_path::name = L"path";
|
||||
|
||||
@ -280,7 +286,9 @@ void draw_polygon_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"svg:viewBox", svg_viewbox_);
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:polygon
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_polygon::ns = L"draw";
|
||||
const wchar_t * draw_polygon::name = L"polygon";
|
||||
|
||||
@ -334,7 +342,7 @@ void draw_polygon::reset_polygon_path()
|
||||
// }
|
||||
//}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
void draw_equation_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"draw:name", draw_name_);
|
||||
@ -355,7 +363,9 @@ void draw_handle_attlist::serialize(CP_ATTR_NODE)
|
||||
|
||||
CP_XML_ATTR_OPT(L"draw:handle-polar", draw_handle_polar_);
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:path
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_handle::ns = L"draw";
|
||||
const wchar_t * draw_handle::name = L"handle";
|
||||
|
||||
@ -401,6 +411,7 @@ int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/// draw-enhanced_geometry_attlist
|
||||
void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
@ -424,7 +435,9 @@ void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"draw:text-path-scale", draw_text_path_scale_);
|
||||
CP_XML_ATTR_OPT(L"draw:text-path-same-letter-heights", draw_text_path_same_letter_heights_);
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:enhanced_geometry
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_enhanced_geometry::ns = L"draw";
|
||||
const wchar_t * draw_enhanced_geometry::name = L"enhanced-geometry";
|
||||
|
||||
@ -488,9 +501,9 @@ void draw_enhanced_geometry::add_child_element( const office_element_ptr & child
|
||||
}
|
||||
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:caption
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_caption::ns = L"draw";
|
||||
const wchar_t * draw_caption::name = L"caption";
|
||||
|
||||
@ -508,7 +521,7 @@ void draw_caption::serialize(std::wostream & _Wostream)
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
/// draw-connector-attlist
|
||||
void draw_connector_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
@ -517,7 +530,9 @@ void draw_connector_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"draw:type",draw_type_);
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:connector
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_connector::ns = L"draw";
|
||||
const wchar_t * draw_connector::name = L"connector";
|
||||
|
||||
@ -577,8 +592,9 @@ void draw_connector::reset_svg_path()
|
||||
// }
|
||||
//}
|
||||
}
|
||||
///////////////////////////////////////
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:control
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_control::ns = L"draw";
|
||||
const wchar_t * draw_control::name = L"control";
|
||||
|
||||
@ -628,5 +644,170 @@ void draw_control::add_child_element( const office_element_ptr & child_element)
|
||||
}
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:scene
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_scene::ns = L"dr3d";
|
||||
const wchar_t * dr3d_scene::name = L"scene";
|
||||
|
||||
void dr3d_scene::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_shape::serialize_attlist(CP_GET_XML_NODE());
|
||||
dr3d_attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
draw_shape::serialize(CP_XML_STREAM());
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void dr3d_scene::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
void dr3d_scene::add_child_element( const office_element_ptr & child_element)
|
||||
{
|
||||
if (!child_element) return;
|
||||
|
||||
content_.push_back(child_element);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:extrude
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_extrude::ns = L"dr3d";
|
||||
const wchar_t * dr3d_extrude::name = L"extrude";
|
||||
|
||||
void dr3d_extrude::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_path::serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:rotate
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_rotate::ns = L"dr3d";
|
||||
const wchar_t * dr3d_rotate::name = L"rotate";
|
||||
|
||||
void dr3d_rotate::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_path::serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:light
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_light::ns = L"dr3d";
|
||||
const wchar_t * dr3d_light::name = L"light";
|
||||
|
||||
void dr3d_light::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"dr3d:diffuse_color", dr3d_diffuse_color_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:direction", dr3d_direction_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:specular", dr3d_specular_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:enabled", dr3d_enabled_);
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:cube
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_cube::ns = L"dr3d";
|
||||
const wchar_t * dr3d_cube::name = L"cube";
|
||||
|
||||
void dr3d_cube::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_shape::serialize_attlist(CP_GET_XML_NODE());
|
||||
|
||||
CP_XML_ATTR_OPT(L"dr3d:max-edge", dr3d_max_edge_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:min-edge", dr3d_min_edge_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:transform", dr3d_transform_);
|
||||
|
||||
draw_shape::serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:sphere
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_sphere::ns = L"dr3d";
|
||||
const wchar_t * dr3d_sphere::name = L"sphere";
|
||||
|
||||
void dr3d_sphere::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_shape::serialize_attlist(CP_GET_XML_NODE());
|
||||
|
||||
CP_XML_ATTR_OPT(L"dr3d:max-edge", dr3d_size_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:min-edge", dr3d_center_);
|
||||
CP_XML_ATTR_OPT(L"dr3d:transform", dr3d_transform_);
|
||||
|
||||
draw_shape::serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_a::ns = L"draw";
|
||||
const wchar_t * draw_a::name = L"a";
|
||||
//-------------------------------------------------------------------------------------------
|
||||
void draw_a::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
void draw_a::add_child_element( const office_element_ptr & child_element)
|
||||
{
|
||||
if (!child_element) return;
|
||||
|
||||
content_.push_back(child_element);
|
||||
}
|
||||
void draw_a::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
xlink_attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
CP_XML_ATTR_OPT(L"office:name", office_name_);
|
||||
CP_XML_ATTR_OPT(L"text:style-name", text_style_name_);
|
||||
CP_XML_ATTR_OPT(L"text:visited-style-name", text_visited_style_name_);
|
||||
CP_XML_ATTR_OPT(L"office:target-frame-name",office_target_frame_name_);
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,7 @@
|
||||
#include "draw_base.h"
|
||||
|
||||
#include "common_attlists.h"
|
||||
#include "targetframename.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_writer {
|
||||
@ -434,5 +435,156 @@ public:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_control);
|
||||
//----------------------------------------------------------------------------------------------
|
||||
class dr3d_scene : public draw_shape
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dScene;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
odf_types::dr3d_attlist dr3d_attlist_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_scene);
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
|
||||
class dr3d_extrude : public draw_path
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dExtrude;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_extrude);
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
|
||||
class dr3d_rotate : public draw_path
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dRotate;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_rotate);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
class dr3d_light : public office_element_impl<dr3d_light>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeDr3dLight;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
_CP_OPT(std::wstring) dr3d_diffuse_color_;
|
||||
_CP_OPT(std::wstring) dr3d_direction_;
|
||||
_CP_OPT(odf_types::Bool) dr3d_specular_;
|
||||
_CP_OPT(odf_types::Bool) dr3d_enabled_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_light);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
class dr3d_cube : public draw_shape
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dCube;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
_CP_OPT(std::wstring) dr3d_max_edge_;
|
||||
_CP_OPT(std::wstring) dr3d_min_edge_;
|
||||
_CP_OPT(std::wstring) dr3d_transform_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_cube);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
class dr3d_sphere : public draw_shape
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dSphere;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
_CP_OPT(odf_types::vector3D) dr3d_size_;
|
||||
_CP_OPT(odf_types::vector3D) dr3d_center_;
|
||||
_CP_OPT(std::wstring) dr3d_transform_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_sphere);
|
||||
//----------------------------------------------------------------------------------
|
||||
// draw:a
|
||||
//----------------------------------------------------------------------------------
|
||||
class draw_a : public office_element_impl<draw_a>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawA;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
friend class odf_document;
|
||||
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
|
||||
_CP_OPT(std::wstring) office_name_;
|
||||
_CP_OPT(odf_types::target_frame_name) office_target_frame_name_;
|
||||
|
||||
_CP_OPT(std::wstring) text_style_name_;
|
||||
_CP_OPT(std::wstring) text_visited_style_name_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_a);
|
||||
}
|
||||
}
|
||||
@ -45,7 +45,7 @@ namespace cpdoccore {
|
||||
namespace odf_writer {
|
||||
|
||||
|
||||
/// style:header-footer-properties-attlist
|
||||
// style:header-footer-properties-attlist
|
||||
class style_header_footer_properties_attlist
|
||||
{
|
||||
public:
|
||||
@ -53,11 +53,11 @@ public:
|
||||
|
||||
_CP_OPT(odf_types::length) svg_height_;
|
||||
_CP_OPT(odf_types::length) fo_min_height_;
|
||||
odf_types::common_horizontal_margin_attlist common_horizontal_margin_attlist_;
|
||||
odf_types::common_horizontal_margin_attlist common_horizontal_margin_attlist_;
|
||||
odf_types::common_vertical_margin_attlist common_vertical_margin_attlist_;
|
||||
odf_types::common_margin_attlist common_margin_attlist_;
|
||||
odf_types::common_border_attlist common_border_attlist_;
|
||||
odf_types::common_border_line_width_attlist common_border_line_width_attlist_;
|
||||
odf_types::common_border_line_width_attlist common_border_line_width_attlist_;
|
||||
odf_types::common_padding_attlist common_padding_attlist_;
|
||||
odf_types::common_background_color_attlist common_background_color_attlist_;
|
||||
odf_types::common_shadow_attlist common_shadow_attlist_;
|
||||
@ -65,7 +65,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/// style:header-footer-properties
|
||||
// style:header-footer-properties
|
||||
class style_header_footer_properties : public office_element_impl<style_header_footer_properties>
|
||||
{
|
||||
public:
|
||||
@ -89,7 +89,7 @@ public:
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_header_footer_properties)
|
||||
|
||||
|
||||
/// common:style-header-footer-attlist
|
||||
// common:style-header-footer-attlist
|
||||
class common_style_header_footer_attlist
|
||||
{
|
||||
public:
|
||||
@ -98,7 +98,7 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/// header:footer-content
|
||||
// header:footer-content
|
||||
class header_footer_content
|
||||
{
|
||||
public:
|
||||
|
||||
@ -385,7 +385,7 @@ void odf_chart_context::set_chart_size(_CP_OPT(double) width_pt, _CP_OPT(double)
|
||||
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm), length::cm);
|
||||
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(*height_pt,length::pt).get_value_unit(length::cm), length::cm);
|
||||
}
|
||||
void odf_chart_context::set_chart_type(std::wstring type)
|
||||
void odf_chart_context::set_chart_type(const std::wstring & type)
|
||||
{
|
||||
chart_chart *chart = impl_->get_current_chart();
|
||||
if (!chart)return;
|
||||
@ -399,25 +399,25 @@ void odf_chart_context::set_chart_bar_type(int type)
|
||||
switch(type)
|
||||
{
|
||||
case 0: // st_shapeCONE = 0,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ = chart_solid_type(chart_solid_type::cone); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ = chart_solid_type(chart_solid_type::cone); break;
|
||||
case 1: // st_shapeCONETOMAX = 1,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ = chart_solid_type(chart_solid_type::cone); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ = chart_solid_type(chart_solid_type::cone); break;
|
||||
case 2: // st_shapeBOX = 2,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ = chart_solid_type(chart_solid_type::cuboid); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ = chart_solid_type(chart_solid_type::cuboid); break;
|
||||
case 3: // st_shapeCYLINDER = 3,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ = chart_solid_type(chart_solid_type::cylinder); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ = chart_solid_type(chart_solid_type::cylinder); break;
|
||||
case 4: // st_shapePYRAMID = 4,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ = chart_solid_type(chart_solid_type::pyramid); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ = chart_solid_type(chart_solid_type::pyramid); break;
|
||||
case 5: // st_shapePYRAMIDTOMAX = 5
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ = chart_solid_type(chart_solid_type::pyramid); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ = chart_solid_type(chart_solid_type::pyramid); break;
|
||||
}
|
||||
if (type == -1)
|
||||
{
|
||||
//нужно вытащить свойство с уровня выше.
|
||||
size_t sz = impl_->current_level_.size();
|
||||
if (sz > 1)
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_solid_type_ =
|
||||
impl_->current_level_[sz-2].chart_properties_->content_.chart_solid_type_;
|
||||
impl_->current_level_.back().chart_properties_->content_.solid_type_ =
|
||||
impl_->current_level_[sz-2].chart_properties_->content_.solid_type_;
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ void odf_chart_context::set_chart_bar_direction(int type)
|
||||
switch(type)
|
||||
{
|
||||
case 0: // st_bardirBAR = 0,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_vertical_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.vertical_ = true; break;
|
||||
case 1: // st_bardirCOL = 1
|
||||
break;
|
||||
}
|
||||
@ -465,7 +465,7 @@ void odf_chart_context::set_chart_stock_candle_stick(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_) return;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_japanese_candle_stick_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.japanese_candle_stick_ = val;
|
||||
|
||||
}
|
||||
|
||||
@ -492,12 +492,12 @@ void odf_chart_context::set_chart_bar_grouping(int type)
|
||||
switch(type)
|
||||
{
|
||||
case 0: // st_groupingPERCENTSTACKED = 0,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_percentage_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.percentage_ = true; break;
|
||||
case 1: // st_bargroupingCLUSTERED = 1,
|
||||
case 2: // st_bargroupingSTANDARD = 2,
|
||||
break;
|
||||
case 3: // st_bargroupingSTACKED = 3
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_stacked_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.stacked_ = true; break;
|
||||
}
|
||||
}
|
||||
void odf_chart_context::set_chart_grouping(int type)
|
||||
@ -507,76 +507,149 @@ void odf_chart_context::set_chart_grouping(int type)
|
||||
switch(type)
|
||||
{
|
||||
case 0: // st_groupingPERCENTSTACKED = 0,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_percentage_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.percentage_ = true; break;
|
||||
case 1: // st_groupingSTANDARD = 1,
|
||||
break;
|
||||
case 2: // st_groupingSTACKED = 2
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_stacked_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.stacked_ = true; break;
|
||||
}
|
||||
}
|
||||
void odf_chart_context::set_chart_3D(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_) return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_three_dimensional_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.three_dimensional_ = val;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_treat_empty_cells_ = boost::none;
|
||||
//impl_->current_level_.back().chart_properties_->content_.chart_series_source_ = chart_series_source(chart_series_source::rows);
|
||||
impl_->current_level_.back().chart_properties_->content_.treat_empty_cells_ = boost::none;
|
||||
//impl_->current_level_.back().chart_properties_->content_.series_source_ = chart_series_source(chart_series_source::rows);
|
||||
|
||||
//impl_->current_level_.back().chart_properties_->content_.
|
||||
//chart:treat-empty-cells="leave-gap"
|
||||
//chart:series-source="rows"
|
||||
//impl_->current_level_.back().chart_properties_->content_.chart_deep_ = true;
|
||||
//chart_plot_area *plot_area = dynamic_cast<chart_plot_area*>(current_level_.back().elm.get());
|
||||
//impl_->current_level_.back().chart_properties_->content_.deep_ = true;
|
||||
//if (!plot_area)return;
|
||||
|
||||
//plot_area->chart_plot_area_attlist_.dr3d_shade_mode=L"gouraud";
|
||||
chart_plot_area *plot_area = dynamic_cast<chart_plot_area*>(impl_->current_level_.back().elm.get());
|
||||
|
||||
if (val && plot_area)
|
||||
{
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.vpn_ = odf_types::vector3D(0, 0, 0);
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.vup_ = odf_types::vector3D(0, 0, 0);
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.projection_ = L"parallel";
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.distance_ = odf_types::length(4.2, odf_types::length::cm);
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.focal_length_ = odf_types::length(8, odf_types::length::cm);
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.lighting_mode_ = L"false";
|
||||
|
||||
//plot_area->chart_plot_area_attlist_.dr3d_attlist_.projection_ = L"perspective";
|
||||
//plot_area->chart_plot_area_attlist_.dr3d_attlist_.distance_ = odf_types::length(4.2, odf_types::length::cm);
|
||||
//plot_area->chart_plot_area_attlist_.dr3d_attlist_.focal_length_ = odf_types::length(8, odf_types::length::cm);
|
||||
//plot_area->chart_plot_area_attlist_.dr3d_attlist_.vpn_ = odf_types::vector3D(0.416199821709347,0.173649045905254,0.892537795986984);
|
||||
//plot_area->chart_plot_area_attlist_.dr3d_attlist_.vup_ = odf_types::vector3D(-0.0733876362771618,0.984807599917971,-0.157379306090273);
|
||||
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.vrp_ = odf_types::vector3D(17634.6218373783, 10271.4823817647, 24594.8639082739);
|
||||
}
|
||||
}
|
||||
void odf_chart_context::set_view3D(int rotX, int rotY, int depthPercent, int perspective, int hPercent, bool angAx)
|
||||
{
|
||||
if (rotX < 0) rotX += 360;
|
||||
if (rotY < 0) rotY += 360;
|
||||
|
||||
int rotZ = 0;
|
||||
|
||||
const double DEG2RAD = 3.1415926 / 180;
|
||||
double sx, sy, sz, cx, cy, cz, theta;
|
||||
|
||||
// rotation angle about X-axis (pitch)
|
||||
theta = rotX * DEG2RAD;
|
||||
sx = sin(theta);
|
||||
cx = cos(theta);
|
||||
|
||||
// rotation angle about Y-axis (yaw)
|
||||
theta = rotY * DEG2RAD;
|
||||
sy = sin(theta);
|
||||
cy = cos(theta);
|
||||
|
||||
// rotation angle about Z-axis (roll)
|
||||
theta = rotZ * DEG2RAD;
|
||||
sz = sin(theta);
|
||||
cz = cos(theta);
|
||||
|
||||
// determine left axis
|
||||
double left_x = cy*cz;
|
||||
double left_y = sx*sy*cz + cx*sz;
|
||||
double left_z = -cx*sy*cz + sx*sz;
|
||||
|
||||
// determine up axis
|
||||
double up_x = -cy*sz;
|
||||
double up_y = -sx*sy*sz + cx*cz;
|
||||
double up_z = cx*sy*sz + sx*cz;
|
||||
|
||||
// determine forward axis
|
||||
double forward_x = sy;
|
||||
double forward_y = -sx*cy;
|
||||
double forward_z = cx*cy;
|
||||
|
||||
std::wstringstream sTransform;
|
||||
|
||||
sTransform << L"matrix(" << left_x << L" " << up_x << L" " << forward_x << L" " << left_y << L" " << up_y << L" " << forward_y << L" " << left_z << L" " << up_z << L" " << forward_z << L" 0cm 0cm 0cm)";
|
||||
|
||||
chart_plot_area *plot_area = dynamic_cast<chart_plot_area*>(impl_->current_level_.back().elm.get());
|
||||
if (plot_area)
|
||||
{
|
||||
plot_area->chart_plot_area_attlist_.dr3d_attlist_.transform_ = sTransform.str();
|
||||
|
||||
if (impl_->current_level_.back().chart_properties_)
|
||||
{
|
||||
impl_->current_level_.back().chart_properties_->content_.right_angled_axes_ = angAx;
|
||||
}
|
||||
}
|
||||
}
|
||||
void odf_chart_context::set_chart_colored(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_) return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_three_dimensional_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.three_dimensional_ = val;
|
||||
}
|
||||
void odf_chart_context::set_marker_size(int size)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_) return;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_width_ = length(size,length::pt);
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_height_ = length(size,length::pt);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_width_ = length(size,length::pt);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_height_ = length(size,length::pt);
|
||||
}
|
||||
void odf_chart_context::set_marker_type(int type)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_) return;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::namedSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::namedSymbol);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case 0://st_markerstyleCIRCLE = 0,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::circleSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::circleSymbol); break;
|
||||
case 1://st_markerstyleDASH = 1,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::horizontal_barSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::horizontal_barSymbol); break;
|
||||
case 2://st_markerstyleDIAMOND = 2,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::diamondSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::diamondSymbol); break;
|
||||
case 3://st_markerstyleDOT = 3,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::circleSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::circleSymbol); break;
|
||||
case 4://st_markerstyleNONE = 4,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::noneSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::noneSymbol); break;
|
||||
case 5://st_markerstylePICTURE = 5,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::asteriskSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::asteriskSymbol); break;
|
||||
case 6://st_markerstylePLUS = 6,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::plusSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::plusSymbol); break;
|
||||
case 7://st_markerstyleSQUARE = 7,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::squareSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::squareSymbol); break;
|
||||
case 8://st_markerstyleSTAR = 8,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::starSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::starSymbol); break;
|
||||
case 9://st_markerstyleTRIANGLE = 9,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::arrow_upSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::arrow_upSymbol); break;
|
||||
case 10://st_markerstyleX = 10,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::xSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::xSymbol); break;
|
||||
case 11://st_markerstyleAUTO = 11
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_name_ = chart_symbol_name(chart_symbol_name::autoSymbol); break;
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_name_ = chart_symbol_name(chart_symbol_name::autoSymbol); break;
|
||||
default:
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
}
|
||||
|
||||
}
|
||||
@ -589,28 +662,28 @@ void odf_chart_context::set_chart_scatter_type(int type)
|
||||
case 0://st_scatterstyleNONE
|
||||
break;
|
||||
case 1://st_scatterstyleLINE
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::noneSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::noneSymbol);
|
||||
break;
|
||||
case 2://st_scatterstyleLINEMARKER
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
break;
|
||||
case 3://st_scatterstyleMARKER
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
break;
|
||||
case 4://st_scatterstyleSMOOTH
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::noneSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_interpolation_ = chart_interpolation(chart_interpolation::cubicSpline);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::noneSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.interpolation_ = chart_interpolation(chart_interpolation::cubicSpline);
|
||||
break;
|
||||
case 5://st_scatterstyleSMOOTHMARKER
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_interpolation_ = chart_interpolation(chart_interpolation::cubicSpline);
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
impl_->current_level_.back().chart_properties_->content_.interpolation_ = chart_interpolation(chart_interpolation::cubicSpline);
|
||||
impl_->current_level_.back().chart_properties_->content_.symbol_type_ = chart_symbol_type(chart_symbol_type::autoSymbol);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void odf_chart_context::start_group_series()
|
||||
{
|
||||
}
|
||||
void odf_chart_context::start_series(std::wstring type)
|
||||
void odf_chart_context::start_series(const std::wstring & type)
|
||||
{
|
||||
office_element_ptr elm;
|
||||
create_element(L"chart", L"series", elm, impl_->odf_context_);
|
||||
@ -663,7 +736,7 @@ void odf_chart_context::end_series()
|
||||
void odf_chart_context::set_label_delete(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_display_label_ = !val;
|
||||
impl_->current_level_.back().chart_properties_->content_.display_label_ = !val;
|
||||
}
|
||||
void odf_chart_context::set_label_show_bubble_size(bool val)
|
||||
{
|
||||
@ -677,10 +750,19 @@ void odf_chart_context::set_label_show_leader_line(bool val)
|
||||
void odf_chart_context::set_label_show_legend_key(bool val)
|
||||
{
|
||||
}
|
||||
void odf_chart_context::set_label_formula(const std::wstring & oox_formula) //в odf не поддерживается
|
||||
{
|
||||
std::wstring odf_formula = impl_->convert_formula(oox_formula);
|
||||
|
||||
if (!odf_formula.empty())
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void odf_chart_context::set_label_show_percent(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
//impl_->current_level_.back().chart_properties_->content_.chart_percentage_ = val;
|
||||
//impl_->current_level_.back().chart_properties_->content_.percentage_ = val;
|
||||
}
|
||||
void odf_chart_context::set_label_show_ser_name(bool val)
|
||||
{
|
||||
@ -688,7 +770,7 @@ void odf_chart_context::set_label_show_ser_name(bool val)
|
||||
void odf_chart_context::set_label_show_values(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_ || !val)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_data_label_number_=chart_data_label_number(chart_data_label_number::value);
|
||||
impl_->current_level_.back().chart_properties_->content_.data_label_number_=chart_data_label_number(chart_data_label_number::value);
|
||||
}
|
||||
void odf_chart_context::add_axis_group_series(unsigned int id)
|
||||
{
|
||||
@ -721,7 +803,7 @@ void odf_chart_context::end_group_series()
|
||||
|
||||
if (countX < 1 && countY > 1)
|
||||
{
|
||||
impl_->axis_[0].dimension == 1;
|
||||
impl_->axis_[0].dimension = 1;
|
||||
chart_axis *axis = dynamic_cast<chart_axis*>(impl_->axis_[0].elm.get());
|
||||
axis->chart_axis_attlist_.chart_dimension_ = L"x";
|
||||
countY--;
|
||||
@ -760,7 +842,7 @@ void odf_chart_context::end_group_series()
|
||||
impl_->axis_group_series_.clear();
|
||||
}
|
||||
|
||||
void odf_chart_context::add_domain(std::wstring formula)
|
||||
void odf_chart_context::add_domain(const std::wstring & formula)
|
||||
{
|
||||
size_t level = impl_->current_level_.size();
|
||||
if (level == 0)return;
|
||||
@ -779,7 +861,7 @@ void odf_chart_context::add_domain(std::wstring formula)
|
||||
impl_->current_chart_state_.elements_.push_back(state);
|
||||
}
|
||||
|
||||
void odf_chart_context::add_categories(std::wstring odf_formula, office_element_ptr & axis)
|
||||
void odf_chart_context::add_categories(const std::wstring & odf_formula, office_element_ptr & axis)
|
||||
{
|
||||
office_element_ptr elm;
|
||||
create_element(L"chart", L"categories", elm, impl_->odf_context_);
|
||||
@ -822,15 +904,15 @@ void odf_chart_context::start_axis()
|
||||
odf_axis_state axis_state={0, 0, L"", elm};
|
||||
impl_->axis_.push_back(axis_state);
|
||||
/////////////////////defaults
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_reverse_direction_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.reverse_direction_ = false;
|
||||
|
||||
if (impl_->bar_overlap)
|
||||
{
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_overlap_ = impl_->bar_overlap.get();
|
||||
impl_->current_level_.back().chart_properties_->content_.overlap_ = impl_->bar_overlap.get();
|
||||
}
|
||||
if (impl_->bar_gap_width)
|
||||
{
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_gap_width_ = impl_->bar_gap_width.get();
|
||||
impl_->current_level_.back().chart_properties_->content_.gap_width_ = impl_->bar_gap_width.get();
|
||||
}
|
||||
}
|
||||
void odf_chart_context::start_grid(int type)
|
||||
@ -908,7 +990,7 @@ void odf_chart_context::start_plot_area()
|
||||
|
||||
if (!impl_->current_level_.back().chart_properties_) return;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_treat_empty_cells_ = true;
|
||||
impl_->current_level_.back().chart_properties_->content_.treat_empty_cells_ = true;
|
||||
}
|
||||
void odf_chart_context::end_plot_area()
|
||||
{
|
||||
@ -942,26 +1024,41 @@ void odf_chart_context::end_text()
|
||||
{
|
||||
odf_text_context *text_context_ = text_context();
|
||||
|
||||
if (text_context_ == NULL || impl_->current_level_.size() < 1 )return;
|
||||
if (text_context_ == NULL || impl_->current_level_.empty())return;
|
||||
|
||||
for (size_t i = 0; i < text_context_->text_elements_list_.size(); i++)
|
||||
{
|
||||
if (text_context_->text_elements_list_[i].level ==0)
|
||||
if (text_context_->text_elements_list_[i].level == 0)
|
||||
{
|
||||
impl_->current_level_.back().elm->add_child_element(text_context_->text_elements_list_[i].elm);
|
||||
}
|
||||
size_t level_root = impl_->current_level_.size() + 1;
|
||||
|
||||
odf_element_state state={text_context_->text_elements_list_[i].elm,
|
||||
text_context_->text_elements_list_[i].style_name,
|
||||
text_context_->text_elements_list_[i].style_elm,
|
||||
text_context_->text_elements_list_[i].level + level_root};
|
||||
odf_element_state state = { text_context_->text_elements_list_[i].elm,
|
||||
text_context_->text_elements_list_[i].style_name,
|
||||
text_context_->text_elements_list_[i].style_elm,
|
||||
text_context_->text_elements_list_[i].level + level_root};
|
||||
|
||||
impl_->current_chart_state_.elements_.push_back(state);
|
||||
}
|
||||
|
||||
impl_->odf_context_->end_text_context();
|
||||
}
|
||||
|
||||
void odf_chart_context::add_text(const std::wstring & val)
|
||||
{
|
||||
office_element_ptr paragr_elm;
|
||||
create_element(L"text", L"p", paragr_elm, impl_->odf_context_);
|
||||
|
||||
text_p* p = dynamic_cast<text_p*>(paragr_elm.get());
|
||||
if (p)
|
||||
p->add_text(val);
|
||||
|
||||
impl_->current_level_.back().elm->add_child_element(paragr_elm);
|
||||
|
||||
odf_element_state state = {paragr_elm, L"", office_element_ptr(), impl_->current_level_.size() + 1};
|
||||
impl_->current_chart_state_.elements_.push_back(state);
|
||||
}
|
||||
void odf_chart_context::set_textarea_vertical_align(int align)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
@ -1228,7 +1325,7 @@ void odf_chart_context::set_layout_x(double *val,int mode)//edge, factor
|
||||
void odf_chart_context::set_display_label(bool Val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_display_label_ = Val;
|
||||
impl_->current_level_.back().chart_properties_->content_.display_label_ = Val;
|
||||
}
|
||||
void odf_chart_context::set_display_label_position(int type)
|
||||
{
|
||||
@ -1238,17 +1335,17 @@ void odf_chart_context::set_display_label_position(int type)
|
||||
void odf_chart_context::set_axis_orientation(int type)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
if (type == 0) impl_->current_level_.back().chart_properties_->content_.chart_reverse_direction_ = true;
|
||||
if (type == 0) impl_->current_level_.back().chart_properties_->content_.reverse_direction_ = true;
|
||||
}
|
||||
void odf_chart_context::set_axis_max(double val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_maximum_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.maximum_ = val;
|
||||
}
|
||||
void odf_chart_context::set_axis_min(double val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_minimum_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.minimum_ = val;
|
||||
}
|
||||
void odf_chart_context::set_axis_tick_minor(int type)
|
||||
{
|
||||
@ -1258,14 +1355,14 @@ void odf_chart_context::set_axis_tick_minor(int type)
|
||||
{
|
||||
case 0: break;// st_tickmarkCROSS = 0,
|
||||
case 1: // st_tickmarkIN = 1,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_minor_inner_ = true;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_minor_outer_ = false; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_minor_inner_ = true;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_minor_outer_ = false; break;
|
||||
case 2: // st_tickmarkNONE = 2,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_minor_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_minor_outer_ = false; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_minor_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_minor_outer_ = false; break;
|
||||
case 3: // st_tickmarkOUT = 3
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_minor_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_minor_outer_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_minor_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_minor_outer_ = true; break;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1284,25 +1381,30 @@ void odf_chart_context::set_axis_tick_major(int type)
|
||||
{
|
||||
case 0: break;// st_tickmarkCROSS = 0,
|
||||
case 1: // st_tickmarkIN = 1,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_major_inner_ = true;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_major_outer_ = false; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_major_inner_ = true;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_major_outer_ = false; break;
|
||||
case 2: // st_tickmarkNONE = 2,
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_major_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_major_outer_ = false; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_major_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_major_outer_ = false; break;
|
||||
case 3: // st_tickmarkOUT = 3
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_major_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_tick_marks_major_outer_ = true; break;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_major_inner_ = false;
|
||||
impl_->current_level_.back().chart_properties_->content_.tick_marks_major_outer_ = true; break;
|
||||
}
|
||||
}
|
||||
void odf_chart_context::set_axis_logarithmic(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_logarithmic_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.logarithmic_ = val;
|
||||
}
|
||||
void odf_chart_context::set_axis_id(unsigned int id)
|
||||
{
|
||||
if (impl_->axis_.size()>0)impl_->axis_.back().oox_id = id;
|
||||
}
|
||||
void odf_chart_context::set_axis_visible(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
impl_->current_level_.back().chart_properties_->content_.visible_ = val;
|
||||
}
|
||||
void odf_chart_context::set_axis_dimension(int type)
|
||||
{
|
||||
chart_axis *axis = impl_->get_current_axis();
|
||||
@ -1330,9 +1432,9 @@ void odf_chart_context::set_axis_position(int type)
|
||||
//st_axposR = 2,
|
||||
//st_axposT = 3
|
||||
//if (type ==0 || type ==2)
|
||||
// impl_->current_level_.back().chart_properties_->content_.chart_axis_position_ = L"end";
|
||||
// impl_->current_level_.back().chart_properties_->content_.axis_position_ = L"end";
|
||||
//if (type ==1 || type ==3)
|
||||
// impl_->current_level_.back().chart_properties_->content_.chart_axis_position_ = L"start";
|
||||
// impl_->current_level_.back().chart_properties_->content_.axis_position_ = L"start";
|
||||
//a value of type double – the axis line is placed at the given value on the crossing axis.
|
||||
//If the crossing axis is an axis displaying categories rather than values, a value of 1 indicates that the axis should be placed at the first category, a value of 2 indicates that the axis should be placed at the second category and so forth.
|
||||
}
|
||||
@ -1343,9 +1445,9 @@ void odf_chart_context::set_axis_label_position(int type)
|
||||
//st_ticklblposLOW = 1,
|
||||
//st_ticklblposNEXTTO = 2,
|
||||
//st_ticklblposNONE = 3
|
||||
if (type ==1)impl_->current_level_.back().chart_properties_->content_.chart_axis_label_position_ = L"outside-start";
|
||||
if (type ==0)impl_->current_level_.back().chart_properties_->content_.chart_axis_label_position_ = L"outside-end";
|
||||
if (type ==2)impl_->current_level_.back().chart_properties_->content_.chart_axis_label_position_ = L"near-axis";
|
||||
if (type ==1)impl_->current_level_.back().chart_properties_->content_.axis_label_position_ = L"outside-start";
|
||||
if (type ==0)impl_->current_level_.back().chart_properties_->content_.axis_label_position_ = L"outside-end";
|
||||
if (type ==2)impl_->current_level_.back().chart_properties_->content_.axis_label_position_ = L"near-axis";
|
||||
|
||||
//near-axis-other-side
|
||||
//near-axis //default
|
||||
@ -1394,7 +1496,7 @@ void odf_chart_context::set_layout_h(double *val,int mode)
|
||||
if (plot_area)plot_area->chart_plot_area_attlist_.common_draw_size_attlist_.svg_height_ = height_cm;
|
||||
}
|
||||
|
||||
void odf_chart_context::start_element(office_element_ptr & elm, office_element_ptr & style_elm, std::wstring style_name)
|
||||
void odf_chart_context::start_element(office_element_ptr & elm, office_element_ptr & style_elm, const std::wstring & style_name)
|
||||
{
|
||||
size_t level = impl_->current_level_.size();
|
||||
|
||||
@ -1402,14 +1504,13 @@ void odf_chart_context::start_element(office_element_ptr & elm, office_element_p
|
||||
//if (impl_->current_level_.size()>0) impl_->current_level_.back()->add_child_element(elm); не надо...наследование через start_element в drawing
|
||||
|
||||
odf_element_state state={elm, style_name, style_elm, level};
|
||||
odf_chart_level_state level_state = {NULL,NULL,NULL,NULL,elm};
|
||||
odf_chart_level_state level_state = {NULL, NULL, NULL, NULL, elm};
|
||||
|
||||
impl_->current_chart_state_.elements_.push_back(state);
|
||||
|
||||
style* style_ = dynamic_cast<style*>(style_elm.get());
|
||||
if (style_)
|
||||
{
|
||||
style_name = style_->style_name_;
|
||||
level_state.chart_properties_ = style_->content_.get_style_chart_properties();
|
||||
}
|
||||
impl_->current_level_.push_back(level_state);//стоит ли сюда перенести и current_chart_properties ????
|
||||
@ -1485,7 +1586,7 @@ void odf_chart_context::end_chart()
|
||||
impl_->clear_current();
|
||||
}
|
||||
|
||||
void odf_chart_context::set_series_value_formula(std::wstring oox_formula)
|
||||
void odf_chart_context::set_series_value_formula(const std::wstring & oox_formula)
|
||||
{
|
||||
std::wstring odf_formula = impl_->convert_formula(oox_formula);
|
||||
|
||||
@ -1502,7 +1603,7 @@ void odf_chart_context::set_series_value_formula(std::wstring oox_formula)
|
||||
}
|
||||
}
|
||||
|
||||
void odf_chart_context::set_series_label_formula(std::wstring oox_formula)
|
||||
void odf_chart_context::set_series_label_formula(const std::wstring & oox_formula)
|
||||
{
|
||||
std::wstring odf_formula = impl_->convert_formula(oox_formula);
|
||||
|
||||
@ -1518,7 +1619,7 @@ void odf_chart_context::set_series_label_formula(std::wstring oox_formula)
|
||||
}
|
||||
}
|
||||
|
||||
void odf_chart_context::set_category_axis_formula(std::wstring oox_formula, int type)
|
||||
void odf_chart_context::set_category_axis_formula(const std::wstring & oox_formula, int type)
|
||||
{
|
||||
std::wstring odf_formula = impl_->convert_formula(oox_formula);
|
||||
|
||||
@ -1532,13 +1633,13 @@ void odf_chart_context::set_series_pie_explosion(int val)//или точка с
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_pie_offset_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.pie_offset_ = val;
|
||||
}
|
||||
void odf_chart_context::set_series_pie_bubble(bool val)
|
||||
{
|
||||
if (!impl_->current_level_.back().chart_properties_)return;
|
||||
|
||||
impl_->current_level_.back().chart_properties_->content_.chart_pie_bubble_ = val;
|
||||
impl_->current_level_.back().chart_properties_->content_.pie_bubble_ = val;
|
||||
|
||||
}
|
||||
//void odf_chart_context::set_cash(std::wstring format, std::vector<double> &data_double)
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
odf_text_context *text_context();
|
||||
|
||||
void start_chart (office_element_ptr & root);
|
||||
void set_chart_type (std::wstring type);
|
||||
void set_chart_type (const std::wstring & type);
|
||||
void set_chart_3D (bool Val);
|
||||
void set_chart_size (_CP_OPT(double) width_pt, _CP_OPT(double) height_pt);
|
||||
void set_chart_colored (bool val);
|
||||
@ -79,12 +79,14 @@ public:
|
||||
void start_plot_area();
|
||||
void end_plot_area();
|
||||
|
||||
void set_view3D(int rotX, int rotY, int depthPercent, int perspective, int hPercent, bool angAx);
|
||||
|
||||
void start_group_series();
|
||||
void add_axis_group_series(unsigned int id);
|
||||
void start_series (std::wstring type);
|
||||
void set_series_value_formula (std::wstring oox_formula);
|
||||
void set_series_label_formula (std::wstring oox_formula);
|
||||
void set_category_axis_formula (std::wstring oox_formula,int type);
|
||||
void start_series (const std::wstring & type);
|
||||
void set_series_value_formula (const std::wstring & oox_formula);
|
||||
void set_series_label_formula (const std::wstring & oox_formula);
|
||||
void set_category_axis_formula (const std::wstring & oox_formula, int type);
|
||||
void start_data_point_series (int count);
|
||||
long get_count_data_points_series();
|
||||
|
||||
@ -93,7 +95,8 @@ public:
|
||||
void end_series();
|
||||
void end_group_series();
|
||||
|
||||
void set_label_name (std::wstring name);
|
||||
void set_label_formula (const std::wstring & oox_formula);
|
||||
void set_label_name (const std::wstring & name);
|
||||
void set_label_delete (bool val);
|
||||
void set_label_show_bubble_size (bool val);
|
||||
void set_label_show_cat_name (bool val);
|
||||
@ -116,6 +119,7 @@ public:
|
||||
void set_axis_min(double val);
|
||||
void set_axis_tick_minor(int type);
|
||||
void set_axis_tick_major(int type);
|
||||
void set_axis_visible(bool val);
|
||||
void start_title();
|
||||
void start_grid(int type);
|
||||
void start_legend();
|
||||
@ -131,9 +135,11 @@ public:
|
||||
void set_stock_loss_marker_width(std::wstring val);
|
||||
void start_stock_range_line();
|
||||
|
||||
void start_element(office_element_ptr & elm, office_element_ptr & style_elm, std::wstring style_name);
|
||||
void start_element(office_element_ptr & elm, office_element_ptr & style_elm, const std::wstring & style_name);
|
||||
void end_element();
|
||||
|
||||
void add_text(const std::wstring & val);
|
||||
|
||||
void start_text();
|
||||
void end_text();
|
||||
|
||||
@ -141,8 +147,8 @@ public:
|
||||
void set_textarea_padding (_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom);//in pt
|
||||
void set_textarea_rotation (double val);
|
||||
|
||||
void add_domain(std::wstring formula);
|
||||
void add_categories(std::wstring formula, office_element_ptr & axis);
|
||||
void add_domain(const std::wstring & formula);
|
||||
void add_categories(const std::wstring & formula, office_element_ptr & axis);
|
||||
|
||||
void set_layout_x(double *val,int mode);
|
||||
void set_layout_y(double *val,int mode);
|
||||
|
||||
@ -104,7 +104,7 @@ void odf_comment_context::start_comment(office_element_ptr &elm, int oox_id)
|
||||
office_annotation* comm = dynamic_cast<office_annotation*>(elm.get());
|
||||
if (!comm)return;
|
||||
|
||||
comm->office_annotation_attr_.name_ = impl_->comments_.back().odf_name;
|
||||
comm->attr_.name_ = impl_->comments_.back().odf_name;
|
||||
|
||||
|
||||
}
|
||||
@ -117,7 +117,7 @@ void odf_comment_context::end_comment(office_element_ptr &elm, int oox_id)
|
||||
office_annotation_end* comm = dynamic_cast<office_annotation_end*>(elm.get());
|
||||
if (!comm)return;
|
||||
|
||||
comm->office_annotation_attr_.name_ = impl_->comments_[i].odf_name;
|
||||
comm->attr_.name_ = impl_->comments_[i].odf_name;
|
||||
|
||||
impl_->comments_[i].state = 2;//stoped
|
||||
|
||||
@ -206,8 +206,8 @@ void odf_comment_context::set_position (double x, double y)
|
||||
|
||||
if (comm)
|
||||
{
|
||||
comm->office_annotation_attr_.svg_x_ = odf_types::length(x, odf_types::length::pt);
|
||||
comm->office_annotation_attr_.svg_y_ = odf_types::length(y, odf_types::length::pt);
|
||||
comm->attr_.svg_x_ = odf_types::length(x, odf_types::length::pt);
|
||||
comm->attr_.svg_y_ = odf_types::length(y, odf_types::length::pt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user