mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-22 15:57:09 +08:00
Compare commits
22 Commits
core-linux
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e2e5996f3 | |||
| 033feeaf9d | |||
| de336e5f96 | |||
| 82b3dbdae6 | |||
| d1227f7759 | |||
| 4d134387f9 | |||
| 3f8600dfb7 | |||
| 511f043d63 | |||
| 69a41343c2 | |||
| 578327bab6 | |||
| 52908908a5 | |||
| 24d9b99a44 | |||
| dce58b628f | |||
| f42cb4580c | |||
| 52777e36cb | |||
| 7b7e9f3e6e | |||
| d39fa156e7 | |||
| 48bf40919c | |||
| fd53a987be | |||
| b4d298542a | |||
| bae854027b | |||
| 07562a9582 |
@ -33,6 +33,8 @@
|
||||
|
||||
#include "IMapping.h"
|
||||
|
||||
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class IVisitable
|
||||
|
||||
@ -582,7 +582,7 @@ namespace DocFileFormat
|
||||
// The style id is used for a reverse reference.
|
||||
// It can happen that the reference points to the wrong style.
|
||||
|
||||
if (styleIndex != ListData::ISTD_NIL)
|
||||
if (styleIndex != ListData::ISTD_NIL && styleIndex < m_document->Styles->Styles->size())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pStyle", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))));
|
||||
|
||||
@ -462,57 +462,60 @@ namespace DocFileFormat
|
||||
|
||||
void PropertiesMapping::appendShading( XMLTools::XMLElement* parent, const ShadingDescriptor& desc )
|
||||
{
|
||||
std::wstring pattern = getShadingPattern( desc );
|
||||
if ( ( parent != NULL ) && ( desc.shadingSpecialValue == shadingSpecialValueNormal ))
|
||||
{
|
||||
XMLTools::XMLElement shd( L"w:shd" );
|
||||
|
||||
//fill color
|
||||
XMLTools::XMLAttribute fill( L"w:fill" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvBackAuto )
|
||||
{
|
||||
fill.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( RGBColor( (int)desc.cvBack, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( FormatUtils::MapValueToWideString( desc.icoBack, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( fill );
|
||||
|
||||
//foreground color
|
||||
XMLTools::XMLAttribute color( L"w:color" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvForeAuto )
|
||||
{
|
||||
color.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( RGBColor( (int)desc.cvFore, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( FormatUtils::MapValueToWideString( desc.icoFore, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( color );
|
||||
|
||||
//pattern
|
||||
XMLTools::XMLAttribute val( L"w:val" );
|
||||
val.SetValue( getShadingPattern( desc ));
|
||||
val.SetValue( pattern);
|
||||
shd.AppendAttribute( val );
|
||||
|
||||
if (pattern != L"nil")
|
||||
{
|
||||
//fill color
|
||||
XMLTools::XMLAttribute fill( L"w:fill" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvBackAuto )
|
||||
{
|
||||
fill.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( RGBColor( (int)desc.cvBack, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( FormatUtils::MapValueToWideString( desc.icoBack, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( fill );
|
||||
|
||||
//foreground color
|
||||
XMLTools::XMLAttribute color( L"w:color" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvForeAuto )
|
||||
{
|
||||
color.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( RGBColor( (int)desc.cvFore, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( FormatUtils::MapValueToWideString( desc.icoFore, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( color );
|
||||
}
|
||||
parent->RemoveChildByName( L"w:shd" );
|
||||
parent->AppendChild( shd );
|
||||
}
|
||||
|
||||
@ -174,9 +174,9 @@ namespace DocFileFormat
|
||||
//it's a Word 97 SPRM
|
||||
short val = FormatUtils::BytesToInt16(bytes, 0, size);
|
||||
|
||||
icoFore = (val & 0x1F);
|
||||
icoBack = ((val >> 5) & 0x1F);
|
||||
ipat = (ShadingPattern) ((val >> 10) & 0x3F);
|
||||
icoFore = GETBITS(val, 0, 4);
|
||||
icoBack = GETBITS(val, 5, 9);
|
||||
ipat = (ShadingPattern) GETBITS(val, 10, 15);
|
||||
|
||||
shadingType = shadingTypeShd80;
|
||||
|
||||
@ -209,7 +209,7 @@ namespace DocFileFormat
|
||||
else if (0x0F == icoFore) { cvFore = RGB2 (0x80, 0x80, 0x80); }
|
||||
else if (0x10 == icoFore) { cvFore = RGB2 (0xC0, 0xC0, 0xC0); }
|
||||
|
||||
if (0x00 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0x00); cvBackAuto = true; }
|
||||
if (0x00 == icoBack) { cvBack = RGB2 (0xFF, 0xFF, 0xFF); cvBackAuto = true; }
|
||||
else if (0x01 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0x00); }
|
||||
else if (0x02 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0xFF); }
|
||||
else if (0x03 == icoBack) { cvBack = RGB2 (0x00, 0xFF, 0xFF); }
|
||||
|
||||
@ -354,7 +354,7 @@ namespace DocFileFormat
|
||||
|
||||
void TableCellPropertiesMapping::apppendCellShading (unsigned char* sprmArg, int size, int cellIndex)
|
||||
{
|
||||
if (sprmArg)
|
||||
if (sprmArg && cellIndex >= 0)
|
||||
{
|
||||
//shading descriptor can have 10 bytes (Word 2000) or 2 bytes (Word 97)
|
||||
int shdLength = 2;
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
#pragma comment(lib, "Rpcrt4.lib")
|
||||
|
||||
HRESULT convert_single(std::wstring sSrcDoc)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
@ -100,10 +100,10 @@ xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"
|
||||
mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_ftr_End = _T("</w:ftr>");
|
||||
|
||||
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes 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: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 wp14\">");
|
||||
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes 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: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\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_footnotes_End = _T("</w:footnotes>");
|
||||
|
||||
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes 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: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 wp14\">");
|
||||
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes 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: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\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_endnotes_End = _T("</w:endnotes>");
|
||||
|
||||
class HeaderFooterWriter
|
||||
|
||||
@ -144,9 +144,13 @@ namespace MathEquation
|
||||
void AddAccent (MEMBELTYPE eType)
|
||||
{
|
||||
LONG lPos = GetSize() - 1;
|
||||
|
||||
if (lPos < 0) return;
|
||||
|
||||
EquationRun oRun;
|
||||
oRun = arrRun[lPos];
|
||||
RemoveElem(lPos);
|
||||
|
||||
oRun.bAccent = true;
|
||||
oRun.eType = eType;
|
||||
Add(oRun);
|
||||
@ -1675,7 +1679,7 @@ namespace MathEquation
|
||||
|
||||
void WriteEndNode(BinaryEquationWriter* pWriter)
|
||||
{
|
||||
int nCurPos;
|
||||
int nCurPos = -1;
|
||||
if (!m_aBaseStack.empty())
|
||||
{
|
||||
nCurPos = m_aBaseStack.top();
|
||||
@ -1687,14 +1691,20 @@ namespace MathEquation
|
||||
}
|
||||
|
||||
if (bPile && bEqArrayStart)
|
||||
{
|
||||
pWriter->WriteItemEnd(nCurPos);
|
||||
}
|
||||
else if (!bPile && !bEqArrayStart)
|
||||
{
|
||||
pWriter->WriteItemEnd(nCurPos);
|
||||
}
|
||||
else if (!bPile && bEqArrayStart)
|
||||
{
|
||||
pWriter->m_aRowsCounter.push(nRows);
|
||||
bEqArrayStart = false;
|
||||
pWriter->WriteItemEnd(nCurPos);//eqArr
|
||||
|
||||
if (nCurPos > 0)
|
||||
pWriter->WriteItemEnd(nCurPos);//eqArr
|
||||
|
||||
if (!m_aBaseStack.empty())
|
||||
{
|
||||
|
||||
@ -356,6 +356,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
|
||||
>
|
||||
|
||||
@ -133,7 +133,8 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
|
||||
xlsx_drawing_context_ (Context->get_drawing_context_handle()),
|
||||
xlsx_comments_context_ (Context->get_comments_context_handle()),
|
||||
table_column_last_width_(0.0),
|
||||
in_cell(false)
|
||||
in_cell(false),
|
||||
bEndTable(false)
|
||||
|
||||
{
|
||||
memset(&group_row_,0,sizeof(_group_row));
|
||||
|
||||
@ -91,6 +91,9 @@ public:
|
||||
void end_row ();
|
||||
|
||||
void add_empty_row(int count);
|
||||
|
||||
void set_end_table(){ bEndTable = true; }
|
||||
bool get_end_table(){ return bEndTable; }
|
||||
|
||||
std::wstring current_row_style () const;
|
||||
std::wstring default_row_cell_style () const;
|
||||
@ -153,6 +156,7 @@ public:
|
||||
friend class xlsx_table_context;
|
||||
|
||||
private:
|
||||
bool bEndTable;
|
||||
xlsx_conversion_context * context_;
|
||||
|
||||
std::wstring tableName_;
|
||||
|
||||
@ -195,7 +195,14 @@ std::wstring cellType2Str(XlsxCellType::type type)
|
||||
|
||||
boost::int64_t convertDate(int Year, int Month, int Day)
|
||||
{
|
||||
boost::int64_t daysFrom1900 = boost::gregorian::date_duration(boost::gregorian::date(Year, Month, Day) - boost::gregorian::date(1900, 1, 1)).days() + 1;
|
||||
if (Year < 1400 || Year >10000)
|
||||
return - 1;
|
||||
if (Month < 1 || Month > 12)
|
||||
return - 1;
|
||||
if (Day < 1 || Day > 31)
|
||||
return - 1;
|
||||
|
||||
boost::int64_t daysFrom1900 = boost::gregorian::date_duration(boost::gregorian::date(Year, Month, Day) - boost::gregorian::date(1900, 1, 1)).days() + 1;
|
||||
|
||||
if (Year <= 1900 &&
|
||||
Month <= 2 &&
|
||||
|
||||
@ -78,13 +78,16 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
|
||||
|
||||
void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
bool bEndTable = Context.get_table_context().state()->get_end_table();
|
||||
|
||||
if (attlist_.table_number_rows_repeated_ > 1 && empty())
|
||||
{
|
||||
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
|
||||
return;
|
||||
}
|
||||
if (attlist_.table_number_rows_repeated_ > 0xf000 && empty_content_cells())
|
||||
if (attlist_.table_number_rows_repeated_ > 0x0f00 && empty_content_cells() || bEndTable)//0xf000 - conv_KDZO3J3xLIbZ5fC0HR0__xlsx.ods
|
||||
{
|
||||
Context.get_table_context().state()->set_end_table();
|
||||
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
|
||||
return; //conv_hSX8n3lVbhALjt0aafg__xlsx.ods, conv_MA2CauoNfX_7ejKS5eg__xlsx.ods
|
||||
}
|
||||
@ -731,7 +734,15 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
int y, m, d;
|
||||
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(oox::convertDate(y, m, d));
|
||||
boost::int64_t intDate = oox::convertDate(y, m, d);
|
||||
if (intDate > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_val = attr.office_date_value_.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -742,11 +753,19 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if (attr.office_time_value_)
|
||||
{
|
||||
const std::wstring tv = attr.office_time_value_.get();
|
||||
int h,m;
|
||||
int h, m;
|
||||
double s;
|
||||
if (oox::parseTime(tv, h, m, s))
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(oox::convertTime(h, m, s));
|
||||
boost::int64_t intTime = oox::convertTime(h, m, s);
|
||||
if (intTime > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_val = tv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -899,34 +918,262 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & strm = Context.current_sheet().sheetData();
|
||||
|
||||
const int sharedStringId = content_.xlsx_convert(Context, NULL);
|
||||
|
||||
const common_value_and_type_attlist & attr = attlist_.common_value_and_type_attlist_;
|
||||
|
||||
office_value_type::type odf_value_type = office_value_type::Custom;
|
||||
oox::XlsxCellType::type t_val = oox::XlsxCellType::s;
|
||||
std::wstring formula = attlist_.table_formula_.get_value_or(L"");
|
||||
|
||||
std::wstring number_val;
|
||||
_CP_OPT(bool) bool_val;
|
||||
_CP_OPT(std::wstring) str_val;
|
||||
|
||||
std::wstring num_format;
|
||||
|
||||
size_t xfId_last_set = 0;
|
||||
int empty_cell_count = 0;
|
||||
bool skip_next_cell = false;
|
||||
bool is_style_visible = true;
|
||||
bool is_data_visible = false;
|
||||
// вычислить стиль для ячейки
|
||||
|
||||
std::wstring cellStyleName = attlist_.table_style_name_.get_value_or(L"");
|
||||
std::wstring columnStyleName = Context.get_table_context().default_column_cell_style();
|
||||
std::wstring rowStyleName = Context.get_table_context().default_row_cell_style();
|
||||
|
||||
if (attlist_.table_number_columns_repeated_ > 1)
|
||||
columnStyleName.clear(); // могут быть разные стили колонок Book 24.ods
|
||||
|
||||
odf_read_context & odfContext = Context.root()->odf_context();
|
||||
|
||||
style_instance *defaultCellStyle=NULL, *defaultColumnCellStyle = NULL, *defaultRowCellStyle =NULL, *cellStyle = NULL;
|
||||
try
|
||||
{
|
||||
defaultCellStyle = odfContext.styleContainer().style_default_by_type(style_family::TableCell);
|
||||
|
||||
defaultColumnCellStyle = odfContext.styleContainer().style_by_name(columnStyleName, style_family::TableCell, false);
|
||||
defaultRowCellStyle = odfContext.styleContainer().style_by_name(rowStyleName, style_family::TableCell, false);
|
||||
cellStyle = odfContext.styleContainer().style_by_name(cellStyleName, style_family::TableCell, false);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
_CP_LOG << L"[error]: style wrong\n";
|
||||
}
|
||||
|
||||
std::wstring data_style = CalcCellDataStyle(Context, columnStyleName, rowStyleName, cellStyleName);
|
||||
|
||||
// стили не наследуются
|
||||
std::vector<const style_instance *> instances;
|
||||
instances.push_back(defaultCellStyle);
|
||||
|
||||
if (defaultColumnCellStyle)
|
||||
instances.push_back(defaultColumnCellStyle);
|
||||
|
||||
if (defaultRowCellStyle)
|
||||
{
|
||||
if (instances.size() > 1)
|
||||
instances[1] = defaultRowCellStyle;
|
||||
else
|
||||
instances.push_back(defaultRowCellStyle);
|
||||
}
|
||||
|
||||
if (cellStyle)
|
||||
{
|
||||
if (instances.size() > 1)
|
||||
instances[1] = cellStyle;
|
||||
else
|
||||
instances.push_back(cellStyle);
|
||||
}
|
||||
|
||||
text_format_properties_content textFormatProperties = calc_text_properties_content (instances);
|
||||
paragraph_format_properties parFormatProperties = calc_paragraph_properties_content (instances);
|
||||
style_table_cell_properties_attlist cellFormatProperties = calc_table_cell_properties (instances);
|
||||
|
||||
if (attr.office_value_type_)
|
||||
odf_value_type = attr.office_value_type_->get_type();
|
||||
|
||||
if ((odf_value_type == office_value_type::Float) ||
|
||||
(odf_value_type == office_value_type::Custom && attr.office_value_))
|
||||
{
|
||||
t_val = oox::XlsxCellType::n;
|
||||
number_val = attr.office_value_.get_value_or(L"");
|
||||
}
|
||||
else if (odf_value_type == office_value_type::Percentage)
|
||||
{
|
||||
t_val = oox::XlsxCellType::n;
|
||||
number_val = attr.office_value_.get_value_or(L"");
|
||||
}
|
||||
else if (odf_value_type == office_value_type::Currency)
|
||||
{
|
||||
t_val = oox::XlsxCellType::n;
|
||||
number_val = attr.office_value_.get_value_or(L"");
|
||||
}
|
||||
else if ((odf_value_type == office_value_type::Date) ||
|
||||
(odf_value_type == office_value_type::Custom && attr.office_date_value_))
|
||||
{
|
||||
t_val = oox::XlsxCellType::n;
|
||||
if (attr.office_date_value_)
|
||||
{
|
||||
int y, m, d;
|
||||
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
|
||||
{
|
||||
boost::int64_t intDate = oox::convertDate(y, m, d);
|
||||
if (intDate > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
str_val = attr.office_date_value_.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((odf_value_type == office_value_type::Time) ||
|
||||
(odf_value_type == office_value_type::Custom && attr.office_time_value_))
|
||||
{
|
||||
t_val = oox::XlsxCellType::n;
|
||||
if (attr.office_time_value_)
|
||||
{
|
||||
const std::wstring tv = attr.office_time_value_.get();
|
||||
int h,m;
|
||||
double s;
|
||||
if (oox::parseTime(tv, h, m, s))
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(oox::convertTime(h, m, s));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((odf_value_type == office_value_type::Boolean) ||
|
||||
(odf_value_type == office_value_type::Custom && attr.office_boolean_value_))
|
||||
{
|
||||
t_val = oox::XlsxCellType::b;
|
||||
if (attr.office_boolean_value_) bool_val = oox::parseBoolVal(attr.office_boolean_value_.get());
|
||||
}
|
||||
else if ((odf_value_type == office_value_type::String) ||
|
||||
(odf_value_type == office_value_type::Custom && attr.office_string_value_))
|
||||
{
|
||||
t_val = oox::XlsxCellType::str;
|
||||
if (attr.office_string_value_) str_val = attr.office_string_value_.get();
|
||||
}
|
||||
|
||||
if (!data_style.empty())
|
||||
{
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (num_style)
|
||||
{
|
||||
Context.get_num_format_context().start_complex_format();
|
||||
num_style->oox_convert(Context.get_num_format_context());
|
||||
Context.get_num_format_context().end_complex_format();
|
||||
|
||||
num_format = Context.get_num_format_context().get_last_format();
|
||||
}
|
||||
}
|
||||
|
||||
oox::xlsx_cell_format cellFormat;
|
||||
|
||||
cellFormat.set_cell_type(t_val);
|
||||
cellFormat.set_num_format(oox::odf_string_to_build_in(odf_value_type));
|
||||
|
||||
is_style_visible = (!cellStyleName.empty() || defaultColumnCellStyle) ? true : false;
|
||||
|
||||
if ( content_.elements_.size() > 0 ||
|
||||
!formula.empty() ||
|
||||
( t_val == oox::XlsxCellType::n && !number_val.empty()) ||
|
||||
( t_val == oox::XlsxCellType::b && bool_val) ||
|
||||
(( t_val == oox::XlsxCellType::str || oox::XlsxCellType::inlineStr) && str_val)) is_data_visible = true;
|
||||
|
||||
if (attlist_.table_number_columns_repeated_ < 199 && last_cell_) last_cell_ = false;
|
||||
|
||||
int cell_repeated_max = Context.current_table_column() + attlist_.table_number_columns_repeated_ + 1;
|
||||
|
||||
if (cell_repeated_max >= 1024 && cellStyleName.empty() && last_cell_ && !is_data_visible)
|
||||
{//Book 24.ods
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_style_visible)
|
||||
{
|
||||
xfId_last_set = Context.get_style_manager().xfId(&textFormatProperties, &parFormatProperties, &cellFormatProperties, &cellFormat, num_format, false, is_style_visible);
|
||||
}
|
||||
|
||||
for (unsigned int r = 0; r < attlist_.table_number_columns_repeated_; ++r)
|
||||
{
|
||||
Context.start_table_covered_cell();
|
||||
const int xfId = Context.get_current_cell_style_id();
|
||||
Context.start_table_covered_cell ();
|
||||
|
||||
if (is_style_visible)
|
||||
Context.set_current_cell_style_id(xfId_last_set);
|
||||
|
||||
const int sharedStringId = content_.xlsx_convert(Context, &textFormatProperties);
|
||||
|
||||
if (t_val == oox::XlsxCellType::str && sharedStringId >=0)
|
||||
t_val = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение
|
||||
|
||||
if (skip_next_cell)break;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
// пустые ячейки пропускаем.
|
||||
if ( is_data_visible || ((cellStyle || defaultColumnCellStyle) && is_style_visible))
|
||||
{
|
||||
CP_XML_NODE(L"c")
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_ATTR(L"r", Context.current_cell_address());
|
||||
|
||||
if (xfId >= 0)
|
||||
{
|
||||
CP_XML_ATTR(L"s", xfId);
|
||||
}
|
||||
CP_XML_NODE(L"c")
|
||||
{
|
||||
CP_XML_ATTR(L"r", oox::getCellAddress(Context.current_table_column(), Context.current_table_row()));
|
||||
CP_XML_ATTR(L"t", oox::cellType2Str(t_val));
|
||||
CP_XML_ATTR(L"s", xfId_last_set);
|
||||
|
||||
if (sharedStringId >=0)
|
||||
{
|
||||
CP_XML_NODE(L"v")
|
||||
if (!formula.empty())
|
||||
{
|
||||
CP_XML_CONTENT(sharedStringId);
|
||||
const std::wstring xlsxFormula = formulas_converter.convert(formula);
|
||||
if (!xlsxFormula.empty())
|
||||
{
|
||||
CP_XML_NODE(L"f")
|
||||
{
|
||||
CP_XML_CONTENT(xlsxFormula);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // c
|
||||
|
||||
if (sharedStringId >= 0 && t_val == oox::XlsxCellType::s)
|
||||
{
|
||||
CP_XML_NODE(L"v") { CP_XML_CONTENT(sharedStringId); }
|
||||
}
|
||||
else if ((t_val == oox::XlsxCellType::str || t_val == oox::XlsxCellType::inlineStr) && str_val)
|
||||
{
|
||||
CP_XML_NODE(L"v") { CP_XML_CONTENT(str_val.get()); }
|
||||
}
|
||||
else if (t_val == oox::XlsxCellType::n && !number_val.empty())
|
||||
{
|
||||
CP_XML_NODE(L"v") { CP_XML_CONTENT(number_val);}
|
||||
}
|
||||
else if (t_val == oox::XlsxCellType::b && bool_val)
|
||||
{
|
||||
CP_XML_NODE(L"v") { CP_XML_CONTENT((int)(bool_val.get())); }
|
||||
}
|
||||
}
|
||||
if ( is_data_visible || (cellStyle && is_style_visible && !last_cell_))
|
||||
{
|
||||
Context.non_empty_row();
|
||||
empty_cell_count = 0 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
empty_cell_count++;
|
||||
//Уведомление_о_вручении.ods - 13 повторов пустых с cellStyle=NULL - нужные !!!
|
||||
if (empty_cell_count > 19 && last_cell_&& (attlist_.table_number_columns_repeated_> 299 || cellStyle == NULL))
|
||||
{//пишем простыню только если задан стиль тока для этих ячеек
|
||||
skip_next_cell = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (last_cell_) // Vehicle log book.ods (row = 24 and more)
|
||||
skip_next_cell = true;
|
||||
}
|
||||
|
||||
Context.end_table_covered_cell();
|
||||
|
||||
@ -2057,11 +2057,12 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::st
|
||||
convert(oox_run_pr->m_oColor.GetPointer(),text_properties->content_.fo_color_);
|
||||
}
|
||||
|
||||
text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None);
|
||||
//text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None); //нельзя..если будет выше наследуемого то подчеркивания не будет
|
||||
if (oox_run_pr->m_oU.IsInit())
|
||||
{
|
||||
text_properties->content_.style_text_underline_style_ = odf_types::line_style(odf_types::line_style::Solid);
|
||||
text_properties->content_.style_text_underline_type_ = odf_types::line_type(odf_types::line_type::Single);
|
||||
text_properties->content_.style_text_underline_width_ = odf_types::line_width(odf_types::line_width::Auto);
|
||||
|
||||
_CP_OPT(odf_types::color) color;
|
||||
convert(oox_run_pr->m_oU->m_oColor.GetPointer(), oox_run_pr->m_oU->m_oThemeColor.GetPointer(),
|
||||
@ -3187,9 +3188,9 @@ void DocxConverter::convert_table_style(OOX::CStyle *oox_style)
|
||||
{
|
||||
if (oox_style == NULL)return;
|
||||
|
||||
std::wstring oox_name = oox_style->m_sStyleId.IsInit() ? *oox_style->m_sStyleId : L"";
|
||||
std::wstring oox_name_id = oox_style->m_sStyleId.IsInit() ? *oox_style->m_sStyleId : L"";
|
||||
|
||||
odt_context->styles_context()->table_styles().start_style(oox_name);
|
||||
odt_context->styles_context()->table_styles().start_style(oox_name_id);
|
||||
//общие
|
||||
|
||||
if (oox_style->m_oTblPr.IsInit())
|
||||
@ -3303,17 +3304,21 @@ void DocxConverter::convert(OOX::CStyle *oox_style)
|
||||
return;
|
||||
}
|
||||
|
||||
std::wstring oox_name = oox_style->m_sStyleId.IsInit() ? *oox_style->m_sStyleId : L"";
|
||||
|
||||
odt_context->styles_context()->create_style(oox_name, family, false, true, -1);
|
||||
std::wstring oox_name_id = oox_style->m_sStyleId.IsInit() ? *oox_style->m_sStyleId : L"";
|
||||
|
||||
odt_context->styles_context()->create_style(oox_name_id, family, false, true, -1);
|
||||
|
||||
std::wstring style_name;
|
||||
if (oox_style->m_oName.IsInit() && oox_style->m_oName->m_sVal.IsInit())
|
||||
odt_context->styles_context()->last_state()->set_display_name(*oox_style->m_oName->m_sVal);
|
||||
{
|
||||
style_name = *oox_style->m_oName->m_sVal;
|
||||
odt_context->styles_context()->last_state()->set_display_name(style_name);
|
||||
}
|
||||
|
||||
odf_writer::style_text_properties* text_properties = NULL;
|
||||
if (oox_style->m_oRunPr.IsInit())
|
||||
{
|
||||
odf_writer::style_text_properties* text_properties = odt_context->styles_context()->last_state()->get_text_properties();
|
||||
text_properties = odt_context->styles_context()->last_state()->get_text_properties();
|
||||
|
||||
if (oox_style->m_oDefault.IsInit() && oox_style->m_oDefault->ToBool())
|
||||
{
|
||||
@ -3330,14 +3335,14 @@ void DocxConverter::convert(OOX::CStyle *oox_style)
|
||||
}
|
||||
if (oox_style->m_oParPr.IsInit())
|
||||
{
|
||||
odf_writer::style_paragraph_properties * paragraph_properties = odt_context->styles_context()->last_state()->get_paragraph_properties();
|
||||
odf_writer::style_paragraph_properties *paragraph_properties = odt_context->styles_context()->last_state()->get_paragraph_properties();
|
||||
if (oox_style->m_oDefault.IsInit() && oox_style->m_oDefault->ToBool())
|
||||
{
|
||||
//основан на дефолтовом - накатить
|
||||
odf_writer::odf_style_state_ptr def_style_state;
|
||||
if (odt_context->styles_context()->find_odf_default_style_state(odf_types::style_family::Paragraph, def_style_state) && def_style_state)
|
||||
{
|
||||
odf_writer::style_paragraph_properties * props = def_style_state->get_paragraph_properties();
|
||||
odf_writer::style_paragraph_properties *props = def_style_state->get_paragraph_properties();
|
||||
paragraph_properties->apply_from(props);
|
||||
}
|
||||
}
|
||||
@ -3367,9 +3372,19 @@ void DocxConverter::convert(OOX::CStyle *oox_style)
|
||||
if (oox_style->m_oBasedOn.IsInit() && oox_style->m_oBasedOn->m_sVal.IsInit())
|
||||
odt_context->styles_context()->last_state()->set_parent_style_name(*oox_style->m_oBasedOn->m_sVal);
|
||||
|
||||
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oQFormat;
|
||||
//nullable<ComplexTypes::Word::std::wstring_> m_oAliases;
|
||||
|
||||
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oQFormat;
|
||||
//nullable<ComplexTypes::Word::std::wstring_> m_oAliases;
|
||||
//-------------------------------------------------------------------------------------------------------------------------
|
||||
if (style_name == L"Hyperlink")
|
||||
{
|
||||
odt_context->styles_context()->create_style(L"Internet_20_link", family, false, true, -1);
|
||||
//odt_context->styles_context()->last_state()->set_parent_style_name(oox_name_id);
|
||||
odt_context->styles_context()->last_state()->set_display_name(L"Internet link");
|
||||
|
||||
odf_writer::style_text_properties* hyperlink_text_props = odt_context->styles_context()->last_state()->get_text_properties();
|
||||
hyperlink_text_props->apply_from(text_properties);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void DocxConverter::convert(OOX::Logic::CCommentRangeStart* oox_comm_start)
|
||||
|
||||
@ -794,7 +794,7 @@ void NSPresentationEditor::CPPTXWriter::WriteBackground(CStringWriter& oWriter,
|
||||
oWriter.WriteString(std::wstring(L"</p:bgPr></p:bg>"));
|
||||
}
|
||||
|
||||
void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout)
|
||||
void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, CElementPtr pElement, CLayout* pLayout)
|
||||
{
|
||||
if (!pElement) return;
|
||||
|
||||
@ -817,7 +817,7 @@ void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRe
|
||||
if ((pElement->m_lPlaceholderType == pLayout->m_arElements[nIndex]->m_lPlaceholderType) &&
|
||||
(pElement->m_lPlaceholderID == pLayout->m_arElements[nIndex]->m_lPlaceholderID))
|
||||
{
|
||||
IElement* pElLayout = pLayout->m_arElements[nIndex];
|
||||
CElementPtr pElLayout = pLayout->m_arElements[nIndex];
|
||||
|
||||
bool bIsEqualTransform = ((pElement->m_dRotate == pElLayout->m_dRotate)
|
||||
&& (pElement->m_bFlipH == pElLayout->m_bFlipH) && (pElement->m_bFlipV == pElLayout->m_bFlipV));
|
||||
|
||||
@ -82,7 +82,7 @@ namespace NSPresentationEditor
|
||||
void WriteTransition (CStringWriter& oWriter, CTransition& transition);
|
||||
void WriteColorScheme (CStringWriter& oWriter, const std::wstring & name, const std::vector<CColor> & colors, bool extra = false);
|
||||
void WriteBackground (CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground);
|
||||
void WriteElement (CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout = NULL);
|
||||
void WriteElement (CStringWriter& oWriter, CRelsGenerator& oRels, CElementPtr pElement, CLayout* pLayout = NULL);
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -293,10 +293,10 @@ NSPresentationEditor::CShapeWriter::CShapeWriter()
|
||||
m_pImageElement = NULL;
|
||||
m_pShapeElement = NULL;
|
||||
}
|
||||
bool NSPresentationEditor::CShapeWriter::SetElement(IElement* pElem)
|
||||
bool NSPresentationEditor::CShapeWriter::SetElement(CElementPtr pElem)
|
||||
{
|
||||
m_pShapeElement = dynamic_cast<CShapeElement*>(pElem);
|
||||
m_pImageElement = dynamic_cast<CImageElement*>(pElem);
|
||||
m_pShapeElement = dynamic_cast<CShapeElement*>(pElem.get());
|
||||
m_pImageElement = dynamic_cast<CImageElement*>(pElem.get());
|
||||
|
||||
m_pSimpleGraphicsConverter->PathCommandEnd();
|
||||
|
||||
@ -309,7 +309,7 @@ bool NSPresentationEditor::CShapeWriter::SetElement(IElement* pElem)
|
||||
|
||||
if (m_pShapeElement)
|
||||
{
|
||||
m_pShapeElement->m_oShape.GetTextRect(m_oTextRect);
|
||||
m_pShapeElement->m_pShape->GetTextRect(m_oTextRect);
|
||||
}
|
||||
|
||||
m_oWriter.ClearNoAttack();
|
||||
@ -809,7 +809,7 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo()
|
||||
}
|
||||
void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
{
|
||||
size_t nCount = m_pShapeElement->m_oShape.m_oText.m_arParagraphs.size();
|
||||
size_t nCount = m_pShapeElement->m_pShape->m_oText.m_arParagraphs.size();
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"<p:txBody>"));
|
||||
|
||||
@ -826,21 +826,21 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
|
||||
// m_oWriter.WriteString(std::wstring(L" lIns=\"0\" tIns=\"0\" rIns=\"0\" bIns=\"0\""));
|
||||
|
||||
if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 0 )
|
||||
if (m_pShapeElement->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical == 0 )
|
||||
m_oWriter.WriteString(L" anchor=\"t\"");
|
||||
else if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 2 )
|
||||
else if (m_pShapeElement->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical == 2 )
|
||||
m_oWriter.WriteString(L" anchor=\"b\"");
|
||||
else if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical == 1 )
|
||||
else if (m_pShapeElement->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical == 1 )
|
||||
{
|
||||
m_oWriter.WriteString(L" anchor=\"ctr\"");
|
||||
m_oWriter.WriteString(L" anchorCtr=\"0\"");
|
||||
}
|
||||
if (m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_dTextRotate > 0)
|
||||
if (m_pShapeElement->m_pShape->m_oText.m_oAttributes.m_dTextRotate > 0)
|
||||
{
|
||||
std::wstring strProp = std::to_wstring((int)(m_pShapeElement->m_oShape.m_oText.m_oAttributes.m_dTextRotate * 60000));
|
||||
std::wstring strProp = std::to_wstring((int)(m_pShapeElement->m_pShape->m_oText.m_oAttributes.m_dTextRotate * 60000));
|
||||
m_oWriter.WriteString(L" rot=\"" + strProp + L"\"");
|
||||
}
|
||||
if (m_pShapeElement->m_oShape.m_oText.m_bVertical)
|
||||
if (m_pShapeElement->m_pShape->m_oText.m_bVertical)
|
||||
{
|
||||
m_oWriter.WriteString(L" vert=\"eaVert\"");
|
||||
}
|
||||
@ -853,7 +853,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
m_oWriter.WriteString(std::wstring(L" prst=\"") + prstTxWarp + _T("\">"));
|
||||
m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//модификаторы
|
||||
|
||||
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(m_pShapeElement->m_oShape.getBaseShape());
|
||||
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(m_pShapeElement->m_pShape->getBaseShape().get());
|
||||
std::wstring strVal;
|
||||
|
||||
for (int i = 0 ; (pPPTShape) && (i < pPPTShape->m_arAdjustments.size()); i++)
|
||||
@ -875,7 +875,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
m_oWriter.WriteString(L"</a:avLst>");
|
||||
m_oWriter.WriteString(L"</a:prstTxWarp>");
|
||||
}
|
||||
if (m_pShapeElement->m_oShape.m_oText.m_bAutoFit)
|
||||
if (m_pShapeElement->m_pShape->m_oText.m_bAutoFit)
|
||||
{
|
||||
m_oWriter.WriteString(L"<a:spAutoFit/>");
|
||||
}
|
||||
@ -890,14 +890,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
|
||||
if (!m_bWordArt)
|
||||
{
|
||||
CStylesWriter::ConvertStyles(m_pShapeElement->m_oShape.m_oText.m_oStyles, m_oMetricInfo, m_oWriter);
|
||||
CStylesWriter::ConvertStyles(m_pShapeElement->m_pShape->m_oText.m_oStyles, m_oMetricInfo, m_oWriter);
|
||||
}
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"</a:lstStyle>"));
|
||||
|
||||
for (size_t nIndexPar = 0; nIndexPar < nCount; ++nIndexPar)
|
||||
{
|
||||
NSPresentationEditor::CParagraph* pParagraph = &m_pShapeElement->m_oShape.m_oText.m_arParagraphs[nIndexPar];
|
||||
NSPresentationEditor::CParagraph* pParagraph = &m_pShapeElement->m_pShape->m_oText.m_arParagraphs[nIndexPar];
|
||||
|
||||
//if (m_bWordArt && nIndexPar == nCount-1)
|
||||
//{
|
||||
@ -1308,11 +1308,11 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
|
||||
m_oWriter.WriteString(std::wstring(L"</a:xfrm>"));
|
||||
}
|
||||
|
||||
CBaseShape *shape = m_pShapeElement->m_oShape.getBaseShape();
|
||||
CBaseShapePtr shape = m_pShapeElement->m_pShape->getBaseShape();
|
||||
|
||||
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic || shape->m_bCustomShape)
|
||||
if (m_pShapeElement->m_pShape->m_lDrawType & c_ShapeDrawType_Graphic || shape->m_bCustomShape)
|
||||
{
|
||||
m_pShapeElement->m_oShape.ToRenderer(dynamic_cast<IRenderer*>(this), oInfo, m_oMetricInfo, 0.0, 1.0);
|
||||
m_pShapeElement->m_pShape->ToRenderer(dynamic_cast<IRenderer*>(this), oInfo, m_oMetricInfo, 0.0, 1.0);
|
||||
}
|
||||
|
||||
if ((prstGeom.empty() == false || m_pShapeElement->m_bShapePreset) && prstTxWarp.empty() && !shape->m_bCustomShape)
|
||||
|
||||
@ -170,7 +170,7 @@ namespace NSPresentationEditor
|
||||
m_lNextShapeID = 1000;
|
||||
}
|
||||
|
||||
bool SetElement(IElement* pElem);
|
||||
bool SetElement(CElementPtr pElem);
|
||||
//--------------------------------------------------------------------
|
||||
std::wstring ConvertShape ();
|
||||
std::wstring ConvertImage ();
|
||||
|
||||
@ -93,7 +93,8 @@ public:
|
||||
|
||||
bool bResult = pInfo->ReadFromStream(&oUserAtom, pStream);
|
||||
|
||||
offsetToEdit = pInfo->m_oUser.m_nOffsetLastEdit;
|
||||
m_bMacros = pInfo->m_bMacros;
|
||||
offsetToEdit = pInfo->m_oUser.m_nOffsetLastEdit;
|
||||
m_oCurrentUser.m_bIsEncrypt = pInfo->m_bEncrypt;
|
||||
|
||||
if (bResult == false)
|
||||
|
||||
@ -757,16 +757,14 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, pNotes->m_lOriginalWidth, pNotes->m_lOriginalHeight,
|
||||
CElementPtr pElement = oArrayShapes[nShape]->GetElement(&m_oExMedia, pNotes->m_lOriginalWidth, pNotes->m_lOriginalHeight,
|
||||
pTheme, pLayout, pThemeWrapper, pNotesWrapper, pNotes);
|
||||
|
||||
if (NULL != pElement)
|
||||
{
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor && !bMasterBackGround)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(pNotes, pTheme, pLayout);
|
||||
@ -774,7 +772,6 @@ void CPPTUserInfo::LoadNotes(DWORD dwNoteID, CSlide* pNotes)
|
||||
pNotes->m_bIsBackground = true;
|
||||
pNotes->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
RELEASEOBJECT(pElement);
|
||||
continue;
|
||||
|
||||
}
|
||||
@ -1002,16 +999,14 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
|
||||
CElementPtr pElement = oArrayShapes[nShape]->GetElement(&m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
|
||||
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
|
||||
|
||||
if (NULL != pElement)
|
||||
{
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor && !bMasterBackGround)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(pSlide, pTheme, pLayout);
|
||||
@ -1019,7 +1014,6 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
pSlide->m_bIsBackground = true;
|
||||
pSlide->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
RELEASEOBJECT(pElement);
|
||||
continue;
|
||||
|
||||
}else
|
||||
@ -1044,13 +1038,12 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
|
||||
//-------------элементы колонтитулов
|
||||
std::multimap<int, int>::iterator it;
|
||||
IElement* pElement = NULL;
|
||||
|
||||
|
||||
if (bHasSlideNumber) AddLayoutSlidePlaceholder(pSlide, MasterSlideNumber, pLayout, true);
|
||||
|
||||
if (bHasDate)
|
||||
{
|
||||
IElement *pElement = AddLayoutSlidePlaceholder(pSlide, MasterDate, pLayout, true);
|
||||
CElementPtr pElement = AddLayoutSlidePlaceholder(pSlide, MasterDate, pLayout, true);
|
||||
|
||||
if (pElement) pElement->m_nFormatDate = nFormatDate;
|
||||
}
|
||||
@ -1058,9 +1051,9 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
|
||||
if (bHasFooter) AddLayoutSlidePlaceholder(pSlide, MasterFooter, pLayout, true);
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placeholderType, CLayout *pLayout, bool idx_only)
|
||||
CElementPtr CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placeholderType, CLayout *pLayout, bool idx_only)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
CElementPtr pElement;
|
||||
|
||||
for (std::multimap<int, int>::iterator it = pLayout->m_mapPlaceholders.begin(); it != pLayout->m_mapPlaceholders.end(); it++)
|
||||
{
|
||||
@ -1073,7 +1066,7 @@ IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placehold
|
||||
|
||||
pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
|
||||
pSlide->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
pSlide->m_mapPlaceholders.insert(std::pair<int, int>(placeholderType, pSlide->m_arElements.size()-1));
|
||||
}
|
||||
else
|
||||
@ -1092,7 +1085,7 @@ IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placehold
|
||||
{
|
||||
pElement = pLayout->m_arElements[it->second]->CreateDublicate();
|
||||
|
||||
pSlide->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
|
||||
pSlide->m_arElements.push_back(pElement);
|
||||
pSlide->m_mapPlaceholders.insert(std::pair<int, int>(placeholderType, pSlide->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
@ -1102,9 +1095,9 @@ IElement* CPPTUserInfo::AddLayoutSlidePlaceholder (CSlide *pSlide, int placehold
|
||||
return pElement;
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme, bool idx_only)
|
||||
CElementPtr CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme, bool idx_only)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
CElementPtr pElement;
|
||||
|
||||
for (std::multimap<int, int>::iterator it = pTheme->m_mapPlaceholders.begin(); it != pTheme->m_mapPlaceholders.end(); it++)
|
||||
{
|
||||
@ -1116,7 +1109,7 @@ IElement* CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeho
|
||||
|
||||
pElement->m_bPlaceholderSet = true;
|
||||
|
||||
pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
|
||||
pLayout->m_arElements.push_back(pElement);
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(placeholderType, pLayout->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
@ -1124,9 +1117,9 @@ IElement* CPPTUserInfo::AddThemeLayoutPlaceholder (CLayout *pLayout, int placeho
|
||||
return pElement; //last added
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset)
|
||||
CElementPtr CPPTUserInfo::AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset)
|
||||
{
|
||||
if (placeholderType < 1) return NULL;
|
||||
if (placeholderType < 1) return CElementPtr();
|
||||
|
||||
CShapeElement* pShape = new CShapeElement(NSBaseShape::ppt, PPTShapes::sptCRect);
|
||||
|
||||
@ -1139,10 +1132,12 @@ IElement* CPPTUserInfo::AddNewLayoutPlaceholder (CLayout *pLayout, int placehold
|
||||
|
||||
CorrectPlaceholderType(pShape->m_lPlaceholderType);
|
||||
|
||||
pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pShape));
|
||||
CElementPtr pElement = CElementPtr(pShape);
|
||||
|
||||
pLayout->m_arElements.push_back(pElement);
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(pShape->m_lPlaceholderType, pLayout->m_arElements.size()-1));
|
||||
|
||||
return pShape;
|
||||
return pElement;
|
||||
}
|
||||
|
||||
int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool addShapes, bool bMasterObjects)
|
||||
@ -1244,7 +1239,7 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool
|
||||
{
|
||||
if (it1->first == it->first)
|
||||
{
|
||||
IElement* pElemLayout = pLayout->m_arElements[it1->second];
|
||||
CElementPtr pElemLayout = pLayout->m_arElements[it1->second];
|
||||
if (pElemLayout->m_lPlaceholderID == pTheme->m_arElements[it->second]->m_lPlaceholderID)
|
||||
{
|
||||
found = true;
|
||||
@ -1254,9 +1249,9 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool
|
||||
}
|
||||
if (found == false)
|
||||
{
|
||||
IElement *pElemTheme = pTheme->m_arElements[it->second]->CreateDublicate();
|
||||
CElementPtr pElemTheme = pTheme->m_arElements[it->second]->CreateDublicate();
|
||||
|
||||
pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElemTheme));
|
||||
pLayout->m_arElements.push_back(pElemTheme);
|
||||
pLayout->m_mapPlaceholders.insert(std::pair<int, int>(it->first, pLayout->m_arElements.size()-1));
|
||||
}
|
||||
}
|
||||
@ -1275,9 +1270,9 @@ int CPPTUserInfo::AddNewLayout(CTheme* pTheme, CRecordSlide* pRecordSlide, bool
|
||||
return ind;
|
||||
}
|
||||
|
||||
IElement* CPPTUserInfo::AddNewThemePlaceholder (CTheme* pTheme, int placeholderType, int placeholderSizePreset)
|
||||
CElementPtr CPPTUserInfo::AddNewThemePlaceholder (CTheme* pTheme, int placeholderType, int placeholderSizePreset)
|
||||
{
|
||||
if (placeholderType < 1) return NULL;
|
||||
if (placeholderType < 1) return CElementPtr();
|
||||
|
||||
CShapeElement* pShape = new CShapeElement(NSBaseShape::ppt, PPTShapes::sptCRect);
|
||||
|
||||
@ -1290,10 +1285,12 @@ IElement* CPPTUserInfo::AddNewThemePlaceholder (CTheme* pTheme, int placeholderT
|
||||
|
||||
CorrectPlaceholderType(pShape->m_lPlaceholderType);
|
||||
|
||||
pTheme->m_arElements.push_back(dynamic_cast<IElement*>(pShape));
|
||||
CElementPtr pElement = CElementPtr(pShape);
|
||||
|
||||
pTheme->m_arElements.push_back(pElement);
|
||||
pTheme->m_mapPlaceholders.insert(std::pair<int, int>(pShape->m_lPlaceholderType, pTheme->m_arElements.size()-1));
|
||||
|
||||
return pShape;
|
||||
return pElement;
|
||||
}
|
||||
void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight)
|
||||
{
|
||||
@ -1507,16 +1504,15 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
NSPresentationEditor::IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
NSPresentationEditor::CElementPtr pElement = oArrayShapes[nShape]->GetElement(&m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
|
||||
if (NULL != pElement)
|
||||
if (pElement)
|
||||
{
|
||||
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElement );
|
||||
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(NULL, pTheme, pLayout);
|
||||
@ -1524,8 +1520,6 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
|
||||
pTheme->m_bIsBackground = true;
|
||||
pTheme->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
|
||||
RELEASEINTERFACE(pElement);
|
||||
continue;
|
||||
}
|
||||
pTheme->m_arElements.push_back(pElement);
|
||||
@ -1756,16 +1750,15 @@ void CPPTUserInfo::LoadMaster(CRecordSlide* pMaster, CSlideInfo *& pMasterWrappe
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
NSPresentationEditor::IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
NSPresentationEditor::CElementPtr pElement = oArrayShapes[nShape]->GetElement(&m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pMasterWrapper, pMasterWrapper);
|
||||
|
||||
if (NULL != pElement)
|
||||
if (pElement)
|
||||
{
|
||||
//AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElement );
|
||||
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShape)
|
||||
{
|
||||
pShape->SetupProperties(NULL, pTheme, pLayout);
|
||||
@ -1773,8 +1766,6 @@ void CPPTUserInfo::LoadMaster(CRecordSlide* pMaster, CSlideInfo *& pMasterWrappe
|
||||
pTheme->m_bIsBackground = true;
|
||||
pTheme->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
|
||||
RELEASEINTERFACE(pElement);
|
||||
continue;
|
||||
}
|
||||
pTheme->m_arElements.push_back(pElement);
|
||||
@ -1948,16 +1939,15 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
|
||||
for (size_t nShape = 0; nShape < oArrayShapes.size(); ++nShape)
|
||||
{
|
||||
IElement* pElement = NULL;
|
||||
oArrayShapes[nShape]->GetElement(&pElement, &m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
|
||||
CElementPtr pElement =oArrayShapes[nShape]->GetElement(&m_oExMedia, lOriginWidth, lOriginHeight, pTheme, pLayout, pThemeWrapper, pMasterWrapper);
|
||||
|
||||
if (NULL != pElement)
|
||||
if (pElement)
|
||||
{
|
||||
AddAnimation ( dwMasterID, lOriginWidth, lOriginHeight, pElement );
|
||||
|
||||
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
|
||||
if (NULL != pShape)
|
||||
{
|
||||
@ -1966,7 +1956,6 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
|
||||
pLayout->m_bIsBackground = true;
|
||||
pLayout->m_oBackground = pShape->m_oBrush;
|
||||
}
|
||||
RELEASEINTERFACE(pElement);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2385,7 +2374,7 @@ void CPPTUserInfo::LoadExAudio(CRecordsContainer* pExObject)
|
||||
oArrayCString.clear();
|
||||
}
|
||||
|
||||
void CPPTUserInfo::AddAnimation ( DWORD dwSlideID, double Width, double Height, IElement* pElement )
|
||||
void CPPTUserInfo::AddAnimation ( DWORD dwSlideID, double Width, double Height, CElementPtr pElement )
|
||||
{
|
||||
std::map <DWORD, Animations::CSlideTimeLine*>::iterator pPair = m_mapAnimations.find( dwSlideID );
|
||||
|
||||
@ -2439,7 +2428,7 @@ void CPPTUserInfo::AddAudioTransition (DWORD dwSlideID, CTransition* pTransition
|
||||
}
|
||||
// ??? недоделка ???
|
||||
|
||||
pAudio->Release();
|
||||
delete pAudio;
|
||||
}
|
||||
|
||||
void CPPTUserInfo::CreateDefaultStyle(NSPresentationEditor::CTextStyles& pStyle, NSPresentationEditor::CTheme* pTheme)
|
||||
|
||||
@ -310,15 +310,15 @@ public:
|
||||
return _T("blank");
|
||||
}
|
||||
|
||||
void AddAnimation (DWORD dwSlideID, double Width, double Height, IElement* pElement);
|
||||
void AddAnimation (DWORD dwSlideID, double Width, double Height, CElementPtr pElement);
|
||||
void AddAudioTransition (DWORD dwSlideID, CTransition* pTransition, const std::wstring& strFilePath);
|
||||
|
||||
int AddNewLayout(NSPresentationEditor::CTheme* pTheme, CRecordSlide* pRecordSlide, bool addShapes, bool bMasterObjects);
|
||||
|
||||
IElement* AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1);
|
||||
CElementPtr AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1);
|
||||
|
||||
IElement* AddNewThemePlaceholder (CTheme* pTheme, int placeholderType, int placeholderSizePreset = -1);
|
||||
CElementPtr AddNewThemePlaceholder (CTheme* pTheme, int placeholderType, int placeholderSizePreset = -1);
|
||||
|
||||
IElement* AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme, bool idx_only = false);
|
||||
IElement* AddLayoutSlidePlaceholder (CSlide *pSlide, int placeholderType, CLayout *pLayout, bool idx_only = false);
|
||||
CElementPtr AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme, bool idx_only = false);
|
||||
CElementPtr AddLayoutSlidePlaceholder (CSlide *pSlide, int placeholderType, CLayout *pLayout, bool idx_only = false);
|
||||
};
|
||||
|
||||
@ -113,9 +113,9 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
CColor CorrectSysColor(int nColorCode, IElement* pElement, CTheme* pTheme)
|
||||
CColor CorrectSysColor(int nColorCode, CElementPtr pElement, CTheme* pTheme)
|
||||
{
|
||||
if (pElement == NULL) return CColor();
|
||||
if (!pElement) return CColor();
|
||||
|
||||
CColor color;
|
||||
|
||||
@ -229,7 +229,7 @@ public:
|
||||
|
||||
return color;
|
||||
}
|
||||
inline void SetUpProperties(IElement* pElement, CTheme* pTheme, CSlideInfo* pWrapper, CSlide* pSlide, CProperties* pProperties)
|
||||
inline void SetUpProperties(CElementPtr pElement, CTheme* pTheme, CSlideInfo* pWrapper, CSlide* pSlide, CProperties* pProperties)
|
||||
{
|
||||
long lCount = pProperties->m_lCount;
|
||||
switch (pElement->m_etType)
|
||||
@ -239,7 +239,7 @@ public:
|
||||
pElement->m_bLine = false;
|
||||
for (long i = 0; i < lCount; ++i)
|
||||
{
|
||||
SetUpPropertyVideo((CVideoElement*)pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
SetUpPropertyVideo(pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -249,7 +249,7 @@ public:
|
||||
pElement->m_bLine = false;
|
||||
for (long i = 0; i < lCount; ++i)
|
||||
{
|
||||
SetUpPropertyImage((CImageElement*)pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
SetUpPropertyImage(pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -258,14 +258,14 @@ public:
|
||||
pElement->m_bLine = false;
|
||||
for (long i = 0; i < lCount; ++i)
|
||||
{
|
||||
SetUpPropertyAudio((CAudioElement*)pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
SetUpPropertyAudio(pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NSPresentationEditor::etShape:
|
||||
{
|
||||
CShapeElement* pShapeElem = (CShapeElement*)pElement;
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShapeElem->m_oShape.getBaseShape());
|
||||
CShapeElement* pShapeElem = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShapeElem->m_pShape->getBaseShape().get());
|
||||
|
||||
if (NULL != pPPTShape)
|
||||
{
|
||||
@ -274,7 +274,7 @@ public:
|
||||
|
||||
for (long i = 0; i < lCount; ++i)
|
||||
{
|
||||
SetUpPropertyShape(pShapeElem, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
SetUpPropertyShape(pElement, pTheme, pWrapper, pSlide, &pProperties->m_arProperties[i]);
|
||||
}
|
||||
|
||||
if (NULL != pPPTShape)
|
||||
@ -289,7 +289,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetUpProperty(IElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
inline void SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
{
|
||||
bool bIsFilled = true;
|
||||
|
||||
@ -797,17 +797,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetUpPropertyVideo(CVideoElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
inline void SetUpPropertyVideo(CElementPtr pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
{
|
||||
SetUpPropertyImage((CImageElement*)pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
SetUpPropertyImage(pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
}
|
||||
inline void SetUpPropertyAudio(CAudioElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
inline void SetUpPropertyAudio(CElementPtr pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
{
|
||||
SetUpPropertyImage((CImageElement*)pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
SetUpPropertyImage(pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
}
|
||||
inline void SetUpPropertyImage(CImageElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
inline void SetUpPropertyImage(CElementPtr pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
{
|
||||
SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
SetUpProperty(pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
|
||||
CImageElement* image_element = dynamic_cast<CImageElement*>(pElement.get());
|
||||
|
||||
switch(pProperty->m_ePID)
|
||||
{
|
||||
@ -816,50 +818,55 @@ public:
|
||||
int dwOffset = pInfo->GetIndexPicture(pProperty->m_lValue);
|
||||
if (dwOffset >=0)
|
||||
{
|
||||
pElement->m_strImageFileName += pInfo->GetFileNamePicture(dwOffset);
|
||||
pElement->m_bImagePresent = true;
|
||||
image_element->m_strImageFileName += pInfo->GetFileNamePicture(dwOffset);
|
||||
image_element->m_bImagePresent = true;
|
||||
}
|
||||
}break;
|
||||
case pictureId://OLE identifier of the picture.
|
||||
{
|
||||
pElement->m_bOLE = true;
|
||||
image_element->m_bOLE = true;
|
||||
}break;
|
||||
case pibName:
|
||||
{
|
||||
pElement->m_sImageName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2-1);
|
||||
image_element->m_sImageName = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)pProperty->m_pOptions, pProperty->m_lValue /2-1);
|
||||
// TextMining05.ppt, слайд 20 - некорректное имя ( - todooo потом подчистить его
|
||||
}break;
|
||||
case cropFromTop:
|
||||
{
|
||||
pElement->m_lcropFromTop = pProperty->m_lValue;
|
||||
pElement->m_bCropEnabled = true;
|
||||
image_element->m_lcropFromTop = pProperty->m_lValue;
|
||||
image_element->m_bCropEnabled = true;
|
||||
}break;
|
||||
case cropFromBottom:
|
||||
{
|
||||
pElement->m_lcropFromBottom = pProperty->m_lValue;
|
||||
pElement->m_bCropEnabled = true;
|
||||
image_element->m_lcropFromBottom = pProperty->m_lValue;
|
||||
image_element->m_bCropEnabled = true;
|
||||
}break;
|
||||
case cropFromLeft:
|
||||
{
|
||||
pElement->m_lcropFromLeft = pProperty->m_lValue;
|
||||
pElement->m_bCropEnabled = true;
|
||||
image_element->m_lcropFromLeft = pProperty->m_lValue;
|
||||
image_element->m_bCropEnabled = true;
|
||||
}break;
|
||||
case cropFromRight:
|
||||
{
|
||||
pElement->m_lcropFromRight = pProperty->m_lValue;
|
||||
pElement->m_bCropEnabled = true;
|
||||
image_element->m_lcropFromRight = pProperty->m_lValue;
|
||||
image_element->m_bCropEnabled = true;
|
||||
}break;
|
||||
case pibFlags:
|
||||
{
|
||||
}break;
|
||||
}
|
||||
}
|
||||
inline void SetUpPropertyShape(CShapeElement* pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
inline void SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlideInfo* pInfo, CSlide* pSlide, CProperty* pProperty)
|
||||
{
|
||||
SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
SetUpProperty(pElement, pTheme, pInfo, pSlide, pProperty);
|
||||
|
||||
CShape* pParentShape = &pElement->m_oShape;
|
||||
CPPTShape* pShape = dynamic_cast<CPPTShape*>(pParentShape->getBaseShape());
|
||||
CShapeElement* shape_element = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
|
||||
CShapePtr pParentShape = shape_element->m_pShape;
|
||||
if (NULL == pParentShape)
|
||||
return;
|
||||
|
||||
CPPTShape* pShape = dynamic_cast<CPPTShape*>(pParentShape->getBaseShape().get());
|
||||
|
||||
if (NULL == pShape)
|
||||
return;
|
||||
@ -1238,22 +1245,19 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void GetElement (IElement** ppElement, CExMedia* pMapIDs,
|
||||
CElementPtr GetElement (CExMedia* pMapIDs,
|
||||
long lSlideWidth, long lSlideHeight, CTheme* pTheme, CLayout* pLayout,
|
||||
CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide = NULL)
|
||||
{
|
||||
if (NULL == ppElement)
|
||||
return;
|
||||
if (bGroupShape) return CElementPtr();
|
||||
|
||||
if (bGroupShape) return;
|
||||
|
||||
*ppElement = NULL;
|
||||
CElementPtr pElement;
|
||||
|
||||
std::vector<CRecordShape*> oArrayShape;
|
||||
GetRecordsByType(&oArrayShape, true, true);
|
||||
|
||||
if (0 == oArrayShape.size())
|
||||
return;
|
||||
return pElement;
|
||||
|
||||
std::vector<CRecordPlaceHolderAtom*> oArrayPlaceHolder;
|
||||
GetRecordsByType(&oArrayPlaceHolder, true, true);
|
||||
@ -1266,7 +1270,7 @@ public:
|
||||
|
||||
int lMasterID = -1;
|
||||
|
||||
IElement * pElementLayout = NULL;
|
||||
CElementPtr pElementLayout;
|
||||
|
||||
if (NULL != pSlide)
|
||||
{
|
||||
@ -1301,13 +1305,13 @@ public:
|
||||
pLayout->m_arElements[nIndex]->m_lPlaceholderID = placeholder_id;
|
||||
}
|
||||
|
||||
*ppElement = pLayout->m_arElements[nIndex]->CreateDublicate();
|
||||
pElement = pLayout->m_arElements[nIndex]->CreateDublicate();
|
||||
|
||||
if (elType == etShape)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(*ppElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShape)
|
||||
pShape->m_oShape.m_oText.m_arParagraphs.clear();
|
||||
pShape->m_pShape->m_oText.m_arParagraphs.clear();
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1321,9 +1325,7 @@ public:
|
||||
}
|
||||
// раньше искался шейп - и делался дубликат. Теперь думаю это не нужно
|
||||
// нужно ориентироваться на placeholder (type & id)
|
||||
IElement* pElem = *ppElement;
|
||||
|
||||
if (NULL == pElem)
|
||||
if (!pElement)
|
||||
{
|
||||
switch (eType)
|
||||
{
|
||||
@ -1362,11 +1364,12 @@ public:
|
||||
pVideoElem->m_strVideoFileName = oInfo.m_strFilePath ;
|
||||
pVideoElem->m_strImageFileName = oInfoDefault.m_strFilePath + FILE_SEPARATOR_STR;
|
||||
|
||||
pElem = (IElement*)pVideoElem;
|
||||
pElement = CElementPtr(pVideoElem);
|
||||
}
|
||||
else if (CExFilesInfo::eftAudio == exType)
|
||||
{
|
||||
CAudioElement* pAudioElem = new CAudioElement();
|
||||
pElement = CElementPtr(pAudioElem);
|
||||
|
||||
pAudioElem->m_strAudioFileName = oInfo.m_strFilePath;
|
||||
pAudioElem->m_strImageFileName = oInfoDefault.m_strFilePath + FILE_SEPARATOR_STR;
|
||||
@ -1385,39 +1388,38 @@ public:
|
||||
else
|
||||
{
|
||||
if (pLayout)
|
||||
pLayout->m_arElements.push_back(pAudioElem);
|
||||
pLayout->m_arElements.push_back(pElement);
|
||||
}
|
||||
|
||||
pElem = (IElement*)pAudioElem;
|
||||
}
|
||||
else
|
||||
{
|
||||
CImageElement* pImageElem = new CImageElement();
|
||||
pImageElem->m_strImageFileName = oInfo.m_strFilePath + FILE_SEPARATOR_STR;
|
||||
|
||||
pElem = (IElement*)pImageElem;
|
||||
pElement = CElementPtr(pImageElem);
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
// shape
|
||||
CShapeElement* pShape = new CShapeElement(NSBaseShape::ppt, eType);
|
||||
CPPTShape *ppt_shape = dynamic_cast<CPPTShape *>(pShape->m_oShape.getBaseShape());
|
||||
CPPTShape *ppt_shape = dynamic_cast<CPPTShape *>(pShape->m_pShape->getBaseShape().get());
|
||||
|
||||
if ( (ppt_shape) && (OOXMLShapes::sptCustom == ppt_shape->m_eType))
|
||||
{
|
||||
pShape->m_bShapePreset = true;
|
||||
}
|
||||
pElem = (IElement*)pShape;
|
||||
pElement = CElementPtr(pShape);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
if (NULL == pElem)
|
||||
return;
|
||||
if (!pElement)
|
||||
return pElement;
|
||||
|
||||
pElem->m_lID = oArrayShape[0]->m_nID;
|
||||
pElem->m_lLayoutID = lMasterID;
|
||||
pElement->m_lID = oArrayShape[0]->m_nID;
|
||||
pElement->m_lLayoutID = lMasterID;
|
||||
|
||||
//---------внешние ссылки
|
||||
{
|
||||
@ -1426,7 +1428,7 @@ public:
|
||||
|
||||
if (NULL != pTextureInfo)
|
||||
{
|
||||
pElem->m_oBrush.TexturePath = pTextureInfo->m_strFilePath + FILE_SEPARATOR_STR;
|
||||
pElement->m_oBrush.TexturePath = pTextureInfo->m_strFilePath + FILE_SEPARATOR_STR;
|
||||
}
|
||||
|
||||
std::vector<CRecordExObjRefAtom*> oArrayEx;
|
||||
@ -1437,7 +1439,7 @@ public:
|
||||
|
||||
if (CExFilesInfo::eftHyperlink == exType && pInfo)
|
||||
{
|
||||
pElem->m_sHyperlink = pInfo->m_strFilePath;
|
||||
pElement->m_sHyperlink = pInfo->m_strFilePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1446,30 +1448,30 @@ public:
|
||||
// placeholders
|
||||
if (0 < oArrayPlaceHolder.size())
|
||||
{
|
||||
pElem->m_bLine = false; //по умолчанию у них нет линий
|
||||
pElem->m_lPlaceholderID = oArrayPlaceHolder[0]->m_nPosition;
|
||||
pElem->m_lPlaceholderType = oArrayPlaceHolder[0]->m_nPlacementID;
|
||||
pElem->m_lPlaceholderSizePreset = oArrayPlaceHolder[0]->m_nSize;
|
||||
pElement->m_bLine = false; //по умолчанию у них нет линий
|
||||
pElement->m_lPlaceholderID = oArrayPlaceHolder[0]->m_nPosition;
|
||||
pElement->m_lPlaceholderType = oArrayPlaceHolder[0]->m_nPlacementID;
|
||||
pElement->m_lPlaceholderSizePreset = oArrayPlaceHolder[0]->m_nSize;
|
||||
|
||||
if (pElementLayout)
|
||||
pElementLayout->m_lPlaceholderSizePreset = oArrayPlaceHolder[0]->m_nSize;
|
||||
|
||||
CorrectPlaceholderType(pElem->m_lPlaceholderType);
|
||||
CorrectPlaceholderType(pElement->m_lPlaceholderType);
|
||||
}
|
||||
|
||||
std::vector<CRecordRoundTripHFPlaceholder12Atom*> oArrayHFPlaceholder;
|
||||
GetRecordsByType(&oArrayHFPlaceholder, true, true);
|
||||
if (0 < oArrayHFPlaceholder.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = oArrayHFPlaceholder[0]->m_nPlacementID;//PT_MasterDate, PT_MasterSlideNumber, PT_MasterFooter, or PT_MasterHeader
|
||||
CorrectPlaceholderType(pElem->m_lPlaceholderType);
|
||||
pElement->m_lPlaceholderType = oArrayHFPlaceholder[0]->m_nPlacementID;//PT_MasterDate, PT_MasterSlideNumber, PT_MasterFooter, or PT_MasterHeader
|
||||
CorrectPlaceholderType(pElement->m_lPlaceholderType);
|
||||
|
||||
if (pLayout)
|
||||
{
|
||||
std::multimap<int, int>::iterator it = pLayout->m_mapPlaceholders.find(pElem->m_lPlaceholderType);
|
||||
std::multimap<int, int>::iterator it = pLayout->m_mapPlaceholders.find(pElement->m_lPlaceholderType);
|
||||
if (it != pLayout->m_mapPlaceholders.end())
|
||||
{
|
||||
pElem->m_lPlaceholderID = pLayout->m_arElements[it->second]->m_lPlaceholderID;
|
||||
pElement->m_lPlaceholderID = pLayout->m_arElements[it->second]->m_lPlaceholderID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1479,31 +1481,31 @@ public:
|
||||
GetRecordsByType(&oArrayFooterMeta, true, true);
|
||||
if (0 < oArrayFooterMeta.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = PT_MasterFooter;
|
||||
pElem->m_lPlaceholderUserStr = oArrayFooterMeta[0]->m_nPosition;
|
||||
pElement->m_lPlaceholderType = PT_MasterFooter;
|
||||
pElement->m_lPlaceholderUserStr = oArrayFooterMeta[0]->m_nPosition;
|
||||
}
|
||||
std::vector<CRecordSlideNumberMetaAtom*> oArraySlideNumberMeta;
|
||||
GetRecordsByType(&oArraySlideNumberMeta, true, true);
|
||||
if (0 < oArraySlideNumberMeta.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = PT_MasterSlideNumber;
|
||||
pElement->m_lPlaceholderType = PT_MasterSlideNumber;
|
||||
}
|
||||
std::vector<CRecordGenericDateMetaAtom*> oArrayDateMeta;
|
||||
GetRecordsByType(&oArrayDateMeta, true, true);
|
||||
if (0 < oArrayDateMeta.size())
|
||||
{
|
||||
pElem->m_lPlaceholderType = PT_MasterDate;
|
||||
pElement->m_lPlaceholderType = PT_MasterDate;
|
||||
|
||||
CRecordDateTimeMetaAtom* format_data = dynamic_cast<CRecordDateTimeMetaAtom*>(oArrayDateMeta[0]);
|
||||
if (format_data)
|
||||
{
|
||||
pElem->m_nFormatDate = 1;
|
||||
pElement->m_nFormatDate = 1;
|
||||
//todooo сделать форматированый вывод
|
||||
}
|
||||
else
|
||||
{
|
||||
pElem->m_lPlaceholderUserStr = oArrayDateMeta[0]->m_nPosition;
|
||||
pElem->m_nFormatDate = 2;
|
||||
pElement->m_lPlaceholderUserStr = oArrayDateMeta[0]->m_nPosition;
|
||||
pElement->m_nFormatDate = 2;
|
||||
}
|
||||
}
|
||||
//------------- привязки ---------------------------------------------------------------------------------
|
||||
@ -1514,12 +1516,12 @@ public:
|
||||
|
||||
if (0 != oArrayAnchor.size())
|
||||
{
|
||||
pElem->m_rcBoundsOriginal.left = (LONG)oArrayAnchor[0]->m_oBounds.Left;
|
||||
pElem->m_rcBoundsOriginal.top = (LONG)oArrayAnchor[0]->m_oBounds.Top;
|
||||
pElem->m_rcBoundsOriginal.right = (LONG)oArrayAnchor[0]->m_oBounds.Right;
|
||||
pElem->m_rcBoundsOriginal.bottom = (LONG)oArrayAnchor[0]->m_oBounds.Bottom;
|
||||
pElement->m_rcBoundsOriginal.left = (LONG)oArrayAnchor[0]->m_oBounds.Left;
|
||||
pElement->m_rcBoundsOriginal.top = (LONG)oArrayAnchor[0]->m_oBounds.Top;
|
||||
pElement->m_rcBoundsOriginal.right = (LONG)oArrayAnchor[0]->m_oBounds.Right;
|
||||
pElement->m_rcBoundsOriginal.bottom = (LONG)oArrayAnchor[0]->m_oBounds.Bottom;
|
||||
|
||||
pElem->m_bBoundsEnabled = true;
|
||||
pElement->m_bBoundsEnabled = true;
|
||||
bAnchor = true;
|
||||
}
|
||||
else
|
||||
@ -1529,14 +1531,14 @@ public:
|
||||
|
||||
if (0 != oArrayChildAnchor.size())
|
||||
{
|
||||
pElem->m_rcBoundsOriginal.left = oArrayChildAnchor[0]->m_oBounds.left;
|
||||
pElem->m_rcBoundsOriginal.top = oArrayChildAnchor[0]->m_oBounds.top;
|
||||
pElem->m_rcBoundsOriginal.right = oArrayChildAnchor[0]->m_oBounds.right;
|
||||
pElem->m_rcBoundsOriginal.bottom = oArrayChildAnchor[0]->m_oBounds.bottom;
|
||||
pElement->m_rcBoundsOriginal.left = oArrayChildAnchor[0]->m_oBounds.left;
|
||||
pElement->m_rcBoundsOriginal.top = oArrayChildAnchor[0]->m_oBounds.top;
|
||||
pElement->m_rcBoundsOriginal.right = oArrayChildAnchor[0]->m_oBounds.right;
|
||||
pElement->m_rcBoundsOriginal.bottom = oArrayChildAnchor[0]->m_oBounds.bottom;
|
||||
|
||||
RecalcGroupShapeAnchor(pElem->m_rcBoundsOriginal);
|
||||
RecalcGroupShapeAnchor(pElement->m_rcBoundsOriginal);
|
||||
|
||||
pElem->m_bBoundsEnabled = true;
|
||||
pElement->m_bBoundsEnabled = true;
|
||||
bAnchor = true;
|
||||
}
|
||||
else
|
||||
@ -1544,18 +1546,18 @@ public:
|
||||
if (oArrayShape[0]->m_bBackground)
|
||||
{
|
||||
// здесь background
|
||||
pElem->m_rcBoundsOriginal.left = 0;
|
||||
pElem->m_rcBoundsOriginal.top = 0;
|
||||
pElem->m_rcBoundsOriginal.right = lSlideWidth;
|
||||
pElem->m_rcBoundsOriginal.bottom = lSlideHeight;
|
||||
pElement->m_rcBoundsOriginal.left = 0;
|
||||
pElement->m_rcBoundsOriginal.top = 0;
|
||||
pElement->m_rcBoundsOriginal.right = lSlideWidth;
|
||||
pElement->m_rcBoundsOriginal.bottom = lSlideHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
// не понятно...
|
||||
pElem->m_rcBoundsOriginal.left = 0;
|
||||
pElem->m_rcBoundsOriginal.top = 0;
|
||||
pElem->m_rcBoundsOriginal.right = 0;
|
||||
pElem->m_rcBoundsOriginal.bottom = 0;
|
||||
pElement->m_rcBoundsOriginal.left = 0;
|
||||
pElement->m_rcBoundsOriginal.top = 0;
|
||||
pElement->m_rcBoundsOriginal.right = 0;
|
||||
pElement->m_rcBoundsOriginal.bottom = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1563,30 +1565,30 @@ public:
|
||||
double dScaleX = c_dMasterUnitsToMillimetreKoef;
|
||||
double dScaleY = c_dMasterUnitsToMillimetreKoef;
|
||||
|
||||
pElem->NormalizeCoords(dScaleX, dScaleY);
|
||||
pElement->NormalizeCoords(dScaleX, dScaleY);
|
||||
|
||||
pElem->m_bFlipH = oArrayShape[0]->m_bFlipH;
|
||||
pElem->m_bFlipV = oArrayShape[0]->m_bFlipV;
|
||||
pElement->m_bFlipH = oArrayShape[0]->m_bFlipH;
|
||||
pElement->m_bFlipV = oArrayShape[0]->m_bFlipV;
|
||||
|
||||
|
||||
if (pElementLayout && bAnchor)
|
||||
{
|
||||
pElementLayout->m_rcBoundsOriginal = pElem->m_rcBoundsOriginal;
|
||||
pElementLayout->m_rcBounds = pElem->m_rcBounds;
|
||||
pElementLayout->m_rcBoundsOriginal = pElement->m_rcBoundsOriginal;
|
||||
pElementLayout->m_rcBounds = pElement->m_rcBounds;
|
||||
|
||||
pElementLayout->m_bPlaceholderSet = true;
|
||||
pElementLayout->m_bBoundsEnabled = true;
|
||||
}
|
||||
//--------- наличие текста --------------------------------------------------------------------------
|
||||
CShapeElement* pShapeElem = dynamic_cast<CShapeElement*>(pElem);
|
||||
CShapeElement* pShapeElem = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (NULL != pShapeElem)
|
||||
{
|
||||
CElementInfo oElementInfo;
|
||||
|
||||
oElementInfo.m_lMasterPlaceholderType = pElem->m_lPlaceholderType;
|
||||
oElementInfo.m_lMasterPlaceholderType = pElement->m_lPlaceholderType;
|
||||
|
||||
pShapeElem->m_oShape.m_dWidthLogic = ShapeSizeVML;
|
||||
pShapeElem->m_oShape.m_dHeightLogic = ShapeSizeVML;
|
||||
pShapeElem->m_pShape->m_dWidthLogic = ShapeSizeVML;
|
||||
pShapeElem->m_pShape->m_dHeightLogic = ShapeSizeVML;
|
||||
|
||||
// проверка на textheader present
|
||||
std::vector<CRecordTextHeaderAtom*> oArrayTextHeader;
|
||||
@ -1594,14 +1596,14 @@ public:
|
||||
|
||||
if (0 < oArrayTextHeader.size())
|
||||
{
|
||||
pShapeElem->m_oShape.m_oText.m_lTextType = oArrayTextHeader[0]->m_nTextType;
|
||||
pShapeElem->m_oShape.m_oText.m_lTextMasterType = oArrayTextHeader[0]->m_nTextType;
|
||||
pShapeElem->m_pShape->m_oText.m_lTextType = oArrayTextHeader[0]->m_nTextType;
|
||||
pShapeElem->m_pShape->m_oText.m_lTextMasterType = oArrayTextHeader[0]->m_nTextType;
|
||||
oElementInfo.m_lMasterTextType = oArrayTextHeader[0]->m_nTextType;
|
||||
}
|
||||
else
|
||||
{
|
||||
pShapeElem->m_oShape.m_oText.m_lTextType = NSOfficePPT::NoPresent;
|
||||
pShapeElem->m_oShape.m_oText.m_lTextMasterType = NSOfficePPT::NoPresent;
|
||||
pShapeElem->m_pShape->m_oText.m_lTextType = NSOfficePPT::NoPresent;
|
||||
pShapeElem->m_pShape->m_oText.m_lTextMasterType = NSOfficePPT::NoPresent;
|
||||
oElementInfo.m_lMasterTextType = NSOfficePPT::NoPresent;
|
||||
}
|
||||
|
||||
@ -1630,17 +1632,17 @@ public:
|
||||
strShapeText = oArrayTextChars[0]->m_strText;
|
||||
}
|
||||
|
||||
if (pElem->m_lPlaceholderType == PT_MasterSlideNumber && strShapeText.length() > 5)
|
||||
if (pElement->m_lPlaceholderType == PT_MasterSlideNumber && strShapeText.length() > 5)
|
||||
{
|
||||
int pos = strShapeText.find(L"*");
|
||||
if (pos < 0) pElem->m_lPlaceholderType = PT_MasterFooter; ///???? 1-(33).ppt
|
||||
if (pos < 0) pElement->m_lPlaceholderType = PT_MasterFooter; ///???? 1-(33).ppt
|
||||
}
|
||||
|
||||
//------ shape properties ----------------------------------------------------------------------------------------
|
||||
for (int nIndexProp = 0; nIndexProp < oArrayOptions.size(); ++nIndexProp)
|
||||
{
|
||||
CPPTElement oElement;
|
||||
oElement.SetUpProperties(pElem, pTheme, pSlideWrapper, pSlide, &oArrayOptions[nIndexProp]->m_oProperties);
|
||||
oElement.SetUpProperties(pElement, pTheme, pSlideWrapper, pSlide, &oArrayOptions[nIndexProp]->m_oProperties);
|
||||
}
|
||||
|
||||
std::vector<CRecordStyleTextPropAtom*> oArrayTextStyle;
|
||||
@ -1663,7 +1665,7 @@ public:
|
||||
this->GetRecordsByType(&oArrayTextRuler, true, true);
|
||||
if (0 != oArrayTextRuler.size())
|
||||
{
|
||||
pShapeElem->m_oShape.m_oText.m_oRuler = oArrayTextRuler[0]->m_oTextRuler;
|
||||
pShapeElem->m_pShape->m_oText.m_oRuler = oArrayTextRuler[0]->m_oTextRuler;
|
||||
}
|
||||
|
||||
std::vector<CRecordInteractiveInfoAtom*> oArrayInteractive;
|
||||
@ -1750,38 +1752,38 @@ public:
|
||||
|
||||
pSlideWrapper->m_mapElements.insert(std::pair<LONG, CElementInfo>(pShapeElem->m_lID, oElementInfo));
|
||||
|
||||
SetUpTextStyle(strShapeText, pTheme, pLayout, pElem, pThemeWrapper, pSlideWrapper, pSlide, master_level);
|
||||
SetUpTextStyle(strShapeText, pTheme, pLayout, pElement, pThemeWrapper, pSlideWrapper, pSlide, master_level);
|
||||
}
|
||||
else
|
||||
{//image, audio, video ....
|
||||
for (int nIndexProp = 0; nIndexProp < oArrayOptions.size(); ++nIndexProp)
|
||||
{
|
||||
CPPTElement oElement;
|
||||
oElement.SetUpProperties(pElem, pTheme, pSlideWrapper, pSlide, &oArrayOptions[nIndexProp]->m_oProperties);
|
||||
oElement.SetUpProperties(pElement, pTheme, pSlideWrapper, pSlide, &oArrayOptions[nIndexProp]->m_oProperties);
|
||||
}
|
||||
|
||||
pElem->m_lLayoutID = lMasterID;
|
||||
pElement->m_lLayoutID = lMasterID;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
if (NULL != pSlide)
|
||||
{
|
||||
pElem->m_dStartTime = pSlide->m_dStartTime;
|
||||
pElem->m_dEndTime = pSlide->m_dEndTime;
|
||||
pElement->m_dStartTime = pSlide->m_dStartTime;
|
||||
pElement->m_dEndTime = pSlide->m_dEndTime;
|
||||
|
||||
pElem->m_oMetric.SetUnitsContainerSize(pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight);
|
||||
pElement->m_oMetric.SetUnitsContainerSize(pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
pElem->m_dStartTime = 0;
|
||||
pElem->m_dEndTime = 0;
|
||||
pElement->m_dStartTime = 0;
|
||||
pElement->m_dEndTime = 0;
|
||||
|
||||
pElem->m_oMetric.SetUnitsContainerSize(lSlideWidth, lSlideHeight);
|
||||
pElement->m_oMetric.SetUnitsContainerSize(lSlideWidth, lSlideHeight);
|
||||
}
|
||||
|
||||
pElem->m_bIsBackground = (true == oArrayShape[0]->m_bBackground);
|
||||
pElem->m_bHaveAnchor = (true == oArrayShape[0]->m_bHaveAnchor);
|
||||
pElement->m_bIsBackground = (true == oArrayShape[0]->m_bBackground);
|
||||
pElement->m_bHaveAnchor = (true == oArrayShape[0]->m_bHaveAnchor);
|
||||
|
||||
*ppElement = pElem;
|
||||
return pElement;
|
||||
}
|
||||
|
||||
void RecalcGroupShapeAnchor(CDoubleRect& rcChildAnchor)
|
||||
@ -1847,13 +1849,13 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
void ApplyThemeStyle(IElement* pElem, CTheme* pTheme, CRecordMasterTextPropAtom* master_levels)
|
||||
void ApplyThemeStyle(CElementPtr pElem, CTheme* pTheme, CRecordMasterTextPropAtom* master_levels)
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem.get());
|
||||
if (NULL == pShape)
|
||||
return;
|
||||
|
||||
CTextAttributesEx* pText = &(pShape->m_oShape.m_oText);
|
||||
CTextAttributesEx* pText = &(pShape->m_pShape->m_oText);
|
||||
|
||||
|
||||
if (master_levels)
|
||||
@ -1871,7 +1873,7 @@ protected:
|
||||
pText->ApplyThemeStyle(pTheme);
|
||||
|
||||
}
|
||||
void SetUpTextStyle(std::wstring& strText, CTheme* pTheme, CLayout* pLayout, IElement* pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide, CRecordMasterTextPropAtom* master_levels)
|
||||
void SetUpTextStyle(std::wstring& strText, CTheme* pTheme, CLayout* pLayout, CElementPtr pElem, CSlideInfo* pThemeWrapper, CSlideInfo* pSlideWrapper, CSlide* pSlide, CRecordMasterTextPropAtom* master_levels)
|
||||
{
|
||||
// сначала проверяем на shape
|
||||
// затем применяем все настройки по-очереди
|
||||
@ -1891,11 +1893,11 @@ protected:
|
||||
if (etShape != pElem->m_etType)
|
||||
return;
|
||||
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElem.get());
|
||||
if (NULL == pShape)
|
||||
return;
|
||||
|
||||
CTextAttributesEx* pTextSettings = &(pShape->m_oShape.m_oText);
|
||||
CTextAttributesEx* pTextSettings = &(pShape->m_pShape->m_oText);
|
||||
|
||||
// сначала применим ссылки на masterstyle (для шаблонного элемента)
|
||||
// как узнать - просто есть ли массивы (т.к. они могли появиться пока только оттуда)
|
||||
@ -1924,11 +1926,11 @@ protected:
|
||||
{
|
||||
for (size_t i = 0; i < pLayout->m_arElements.size(); ++i)
|
||||
{
|
||||
IElement* pPh = pLayout->m_arElements[i];
|
||||
CElementPtr & pPh = pLayout->m_arElements[i];
|
||||
if ((etShape == pPh->m_etType) && (ph_type == pPh->m_lPlaceholderType) && (/*ph_pos == pPh->m_lPlaceholderID*/true))
|
||||
{
|
||||
pElementLayoutPH = dynamic_cast<CShapeElement*>(pPh);
|
||||
eTypeMaster = (NSOfficePPT::TextType)pElementLayoutPH->m_oShape.m_oText.m_lTextMasterType;
|
||||
pElementLayoutPH = dynamic_cast<CShapeElement*>(pPh.get());
|
||||
eTypeMaster = (NSOfficePPT::TextType)pElementLayoutPH->m_pShape->m_oText.m_lTextMasterType;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1985,7 +1987,7 @@ protected:
|
||||
|
||||
pStyle->ReadFromStream(oHeader, oElemInfo.m_pStream);
|
||||
|
||||
NSPresentationEditor::ConvertPPTTextToEditorStructure(pStyle->m_arrPFs, pStyle->m_arrCFs, strText, pShape->m_oShape.m_oText);
|
||||
NSPresentationEditor::ConvertPPTTextToEditorStructure(pStyle->m_arrPFs, pStyle->m_arrCFs, strText, pShape->m_pShape->m_oText);
|
||||
|
||||
bIsOwnPresentSettings = (0 < pStyle->m_lCount);
|
||||
|
||||
@ -2113,9 +2115,9 @@ protected:
|
||||
{
|
||||
if (NULL != pElementLayoutPH)
|
||||
{
|
||||
pTextSettings->m_oLayoutStyles = pElementLayoutPH->m_oShape.m_oText.m_oStyles;
|
||||
pTextSettings->m_lTextType = pElementLayoutPH->m_oShape.m_oText.m_lTextType;
|
||||
pTextSettings->m_lStyleThemeIndex = pElementLayoutPH->m_oShape.m_oText.m_lStyleThemeIndex;
|
||||
pTextSettings->m_oLayoutStyles = pElementLayoutPH->m_pShape->m_oText.m_oStyles;
|
||||
pTextSettings->m_lTextType = pElementLayoutPH->m_pShape->m_oText.m_lTextType;
|
||||
pTextSettings->m_lStyleThemeIndex = pElementLayoutPH->m_pShape->m_oText.m_lStyleThemeIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2225,13 +2227,13 @@ protected:
|
||||
pSpecInfo->m_lCount = -1;
|
||||
|
||||
pSpecInfo->ReadFromStream(oHeader, oElemInfo.m_pStream);
|
||||
pSpecInfo->ApplyProperties(&(pShape->m_oShape.m_oText));
|
||||
pSpecInfo->ApplyProperties(&(pShape->m_pShape->m_oText));
|
||||
|
||||
RELEASEOBJECT(pSpecInfo);
|
||||
}
|
||||
StreamUtils::StreamSeek(lPosition, oElemInfo.m_pStream);
|
||||
}
|
||||
pShape->m_oShape.m_oText.RecalcParagraphsPPT();
|
||||
pShape->m_pShape->m_oText.RecalcParagraphsPPT();
|
||||
|
||||
ApplyThemeStyle(pElem, pTheme, master_levels);
|
||||
|
||||
@ -2247,7 +2249,7 @@ protected:
|
||||
ApplyHyperlink(pShape, oColor);
|
||||
}
|
||||
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.getBaseShape());
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_pShape->getBaseShape().get());
|
||||
|
||||
if (NULL != pPPTShape) // проверка на wordart
|
||||
{
|
||||
@ -2294,12 +2296,12 @@ protected:
|
||||
case sptTextCanUp:
|
||||
case sptTextCanDown:
|
||||
{
|
||||
pShape->m_oShape.m_oText.m_oAttributes.m_oTextBrush = pShape->m_oBrush;
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_oTextBrush = pShape->m_oBrush;
|
||||
|
||||
pShape->m_oShape.m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
pShape->m_oShape.m_oText.m_oAttributes.m_nTextAlignVertical = 1;
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
|
||||
|
||||
pShape->m_oShape.m_lDrawType = c_ShapeDrawType_Text;
|
||||
pShape->m_pShape->m_lDrawType = c_ShapeDrawType_Text;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -2311,7 +2313,7 @@ protected:
|
||||
void ApplyHyperlink(CShapeElement* pShape, CColor& oColor)
|
||||
{
|
||||
std::vector<CTextRange>* pRanges = &pShape->m_oTextActions.m_arRanges;
|
||||
CTextAttributesEx* pTextAttributes = &pShape->m_oShape.m_oText;
|
||||
CTextAttributesEx* pTextAttributes = &pShape->m_pShape->m_oText;
|
||||
|
||||
int lCountHyper = pRanges->size();
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@
|
||||
|
||||
#include <tchar.h>
|
||||
|
||||
#pragma comment(lib, "Rpcrt4.lib")
|
||||
|
||||
#if defined(_WIN64)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
|
||||
#elif defined (_WIN32)
|
||||
@ -46,6 +48,10 @@
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
//#ifdef _DEBUG
|
||||
// _CrtDumpMemoryLeaks();
|
||||
//#endif
|
||||
|
||||
if (argc < 2) return 1;
|
||||
|
||||
std::wstring sSrcPpt = argv[1];
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include"
|
||||
PreprocessorDefinitions="_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
|
||||
PreprocessorDefinitions="_DEBUG;_CONSOLE;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
||||
@ -982,12 +982,12 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
|
||||
std::wstring strId = oNodeST.GetAttribute(L"id");
|
||||
pShape->LoadFromXMLShapeType(oNodeST);
|
||||
|
||||
CShape* pS = new CShape(NSBaseShape::unknown, 0);
|
||||
pS->setBaseShape(pShape);
|
||||
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
|
||||
pS->setBaseShape(CBaseShapePtr(pShape));
|
||||
|
||||
LoadCoordSize(oNodeST, pS);
|
||||
|
||||
m_mapShapeTypes.insert(std::pair<std::wstring, CShape*>(strId, pS));
|
||||
m_mapShapeTypes.insert(std::pair<std::wstring, CShapePtr>(strId, pS));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@ -1687,6 +1687,7 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
|
||||
NSPresentationEditor::CShapeElement oShapeElem;
|
||||
CPPTShape* pPPTShape = NULL;
|
||||
bool bSetShape = false;
|
||||
|
||||
if (L"v:background" == strNameNode)
|
||||
{
|
||||
@ -1845,12 +1846,16 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
{
|
||||
strType = strType.substr(1);
|
||||
|
||||
std::map<std::wstring, CShape*>::iterator pPair = m_mapShapeTypes.find(strType);
|
||||
std::map<std::wstring, CShapePtr>::iterator pPair = m_mapShapeTypes.find(strType);
|
||||
if (m_mapShapeTypes.end() != pPair)
|
||||
{
|
||||
CBaseShapePtr base_shape_type = pPair->second->getBaseShape();
|
||||
CPPTShape* ppt_shape_type = dynamic_cast<CPPTShape*>(base_shape_type.get());
|
||||
|
||||
pPPTShape = new CPPTShape();
|
||||
pPair->second->getBaseShape()->SetToDublicate(pPPTShape);
|
||||
pPPTShape->m_eType = ((CPPTShape*)(pPair->second->getBaseShape()))->m_eType;
|
||||
base_shape_type->SetToDublicate(pPPTShape);
|
||||
|
||||
pPPTShape->m_eType = ppt_shape_type->m_eType;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1880,28 +1885,30 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
|
||||
pPPTShape->m_eType = PPTShapes::sptCustom;
|
||||
}
|
||||
}
|
||||
oShapeElem.m_oShape.setBaseShape(pPPTShape);
|
||||
oShapeElem.m_pShape->setBaseShape(CBaseShapePtr(pPPTShape));
|
||||
bSetShape = true;
|
||||
|
||||
if (bIsNeedCoordSizes)
|
||||
{
|
||||
LoadCoordPos(oNodeShape, &oShapeElem.m_oShape); //for path calculate
|
||||
LoadCoordPos(oNodeShape, oShapeElem.m_pShape); //for path calculate
|
||||
}
|
||||
pPPTShape->LoadFromXMLShapeType(oNodeShape);
|
||||
}
|
||||
|
||||
if (pPPTShape != NULL)
|
||||
{
|
||||
oShapeElem.m_oShape.setBaseShape(pPPTShape);
|
||||
if (!bSetShape)
|
||||
oShapeElem.m_pShape->setBaseShape(CBaseShapePtr(pPPTShape));
|
||||
if (bIsNeedCoordSizes)
|
||||
{
|
||||
LoadCoordSize(oNodeShape, &oShapeElem.m_oShape);
|
||||
LoadCoordSize(oNodeShape, oShapeElem.m_pShape);
|
||||
}
|
||||
else
|
||||
{
|
||||
oShapeElem.m_oShape.m_dWidthLogic = 21600;
|
||||
oShapeElem.m_oShape.m_dHeightLogic = 21600;
|
||||
oShapeElem.m_pShape->m_dWidthLogic = 21600;
|
||||
oShapeElem.m_pShape->m_dHeightLogic = 21600;
|
||||
|
||||
oShapeElem.m_oShape.getBaseShape()->m_oPath.SetCoordsize(21600, 21600);
|
||||
oShapeElem.m_pShape->getBaseShape()->m_oPath.SetCoordsize(21600, 21600);
|
||||
}
|
||||
|
||||
std::wstring strXmlPPTX;
|
||||
@ -2812,12 +2819,12 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
|
||||
|
||||
pShape->LoadFromXMLShapeType(oNodeT);
|
||||
|
||||
CShape* pS = new CShape(NSBaseShape::unknown, 0);
|
||||
pS->setBaseShape(pShape);
|
||||
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
|
||||
pS->setBaseShape(CBaseShapePtr(pShape));
|
||||
|
||||
LoadCoordSize(oNodeT, pS);
|
||||
|
||||
m_mapShapeTypes.insert(std::pair<std::wstring, CShape*>(strId, pS));
|
||||
m_mapShapeTypes.insert(std::pair<std::wstring, CShapePtr>(strId, pS));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2989,8 +2996,10 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
|
||||
|
||||
result->InitElem(pTree);
|
||||
}
|
||||
void CDrawingConverter::LoadCoordPos(XmlUtils::CXmlNode& oNode, CShape* pShape)
|
||||
void CDrawingConverter::LoadCoordPos(XmlUtils::CXmlNode& oNode, CShapePtr pShape)
|
||||
{
|
||||
if (!pShape) return;
|
||||
|
||||
pShape->m_dXLogic = 0;
|
||||
pShape->m_dYLogic = 0;
|
||||
|
||||
@ -3030,8 +3039,10 @@ void CDrawingConverter::LoadCoordPos(XmlUtils::CXmlNode& oNode, CShape* pShape)
|
||||
}
|
||||
|
||||
|
||||
void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape)
|
||||
void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShapePtr pShape)
|
||||
{
|
||||
if (!pShape) return;
|
||||
|
||||
pShape->m_dWidthLogic = ShapeSizeVML;
|
||||
pShape->m_dHeightLogic = ShapeSizeVML;
|
||||
|
||||
@ -5327,16 +5338,10 @@ int CDrawingConverter::GetDocumentChartsCount ()
|
||||
OOX::CContentTypes* CDrawingConverter::GetContentTypes()
|
||||
{
|
||||
return m_pImageManager->m_pContentTypes;
|
||||
//return m_pReader->mm_strContentTypes;
|
||||
}
|
||||
|
||||
void CDrawingConverter::Clear()
|
||||
{
|
||||
for (std::map<std::wstring, CShape*>::iterator pPair = m_mapShapeTypes.begin(); pPair != m_mapShapeTypes.end(); ++pPair)
|
||||
{
|
||||
CShape* pMem = pPair->second;
|
||||
RELEASEOBJECT(pMem);
|
||||
}
|
||||
m_mapShapeTypes.clear();
|
||||
}
|
||||
void CDrawingConverter::SetRels(smart_ptr<OOX::IFileContainer> container)
|
||||
|
||||
@ -43,11 +43,14 @@
|
||||
#include <map>
|
||||
|
||||
class IRenderer;
|
||||
class CShape;
|
||||
class CPPTShape;
|
||||
class CFontManager;
|
||||
class COfficeFontPicker;
|
||||
|
||||
class CShape;
|
||||
typedef boost::shared_ptr<CShape> CShapePtr;
|
||||
|
||||
class CPPTShape;
|
||||
|
||||
namespace XmlUtils
|
||||
{
|
||||
class CXmlNode;
|
||||
@ -187,7 +190,7 @@ namespace NSBinPptxRW
|
||||
};
|
||||
|
||||
|
||||
std::map<std::wstring, CShape*> m_mapShapeTypes;
|
||||
std::map<std::wstring, CShapePtr> m_mapShapeTypes;
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter* m_pBinaryWriter;
|
||||
int m_lNextId;
|
||||
@ -276,8 +279,8 @@ namespace NSBinPptxRW
|
||||
void CheckBrushShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
|
||||
void CheckPenShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
|
||||
|
||||
void LoadCoordSize (XmlUtils::CXmlNode& oNode, ::CShape* pShape);
|
||||
void LoadCoordPos (XmlUtils::CXmlNode& oNode, ::CShape* pShape);
|
||||
void LoadCoordSize (XmlUtils::CXmlNode& oNode, ::CShapePtr pShape);
|
||||
void LoadCoordPos (XmlUtils::CXmlNode& oNode, ::CShapePtr pShape);
|
||||
|
||||
std::wstring GetDrawingMainProps (XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps);
|
||||
|
||||
|
||||
@ -103,13 +103,13 @@ namespace NSPresentationEditor
|
||||
size_t nCountElems = pSlide->m_arElements.size();
|
||||
for (size_t i = 0; i < nCountElems; ++i)
|
||||
{
|
||||
IElement* pElement = pSlide->m_arElements[i];
|
||||
CElementPtr pElement = pSlide->m_arElements[i];
|
||||
|
||||
switch (pElement->m_etType)
|
||||
{
|
||||
case etAudio:
|
||||
{
|
||||
CAudioElement* pAudioElem = dynamic_cast<CAudioElement*>(pElement);
|
||||
CAudioElement* pAudioElem = dynamic_cast<CAudioElement*>(pElement.get());
|
||||
|
||||
if (NULL != pAudioElem)
|
||||
{
|
||||
@ -147,9 +147,9 @@ namespace NSPresentationEditor
|
||||
}
|
||||
}
|
||||
|
||||
void ResetAutoText(IElement *pElement, vector_string const (&placeholdersReplaceString)[3])
|
||||
void ResetAutoText(CElementPtr pElement, vector_string const (&placeholdersReplaceString)[3])
|
||||
{
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
|
||||
if (NULL == pShape) return;
|
||||
|
||||
@ -193,7 +193,7 @@ namespace NSPresentationEditor
|
||||
size_t nCountElems = pTheme->m_arElements.size();
|
||||
for (size_t nIndexEl = 0; nIndexEl < nCountElems; ++nIndexEl)
|
||||
{
|
||||
IElement* pElement = pTheme->m_arElements[nIndexEl];
|
||||
CElementPtr pElement = pTheme->m_arElements[nIndexEl];
|
||||
|
||||
if (pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
@ -219,7 +219,7 @@ namespace NSPresentationEditor
|
||||
size_t nCountLayoutElements = pLayout->m_arElements.size();
|
||||
for (size_t nIndexLayoutEl = 0; nIndexLayoutEl < nCountLayoutElements; ++nIndexLayoutEl)
|
||||
{
|
||||
IElement* pElement = pLayout->m_arElements[nIndexLayoutEl];
|
||||
CElementPtr pElement = pLayout->m_arElements[nIndexLayoutEl];
|
||||
|
||||
if (pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
@ -232,7 +232,7 @@ namespace NSPresentationEditor
|
||||
pElement->m_pTheme = pTheme;
|
||||
pElement->m_pLayout = NULL;
|
||||
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement);
|
||||
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
|
||||
if (!pLayout->m_bUseThemeColorScheme && NULL != pShape)
|
||||
{
|
||||
int lPhType = pElement->m_lPlaceholderType;
|
||||
@ -253,20 +253,20 @@ namespace NSPresentationEditor
|
||||
if (pThemeStyles->m_pLevels[nIndexLevel]->m_oCFRun.Color->m_lSchemeIndex == -1)
|
||||
continue;
|
||||
|
||||
if (pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0].is_init())
|
||||
if (pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0].is_init())
|
||||
{
|
||||
if (pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color.is_init())
|
||||
if (pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color.is_init())
|
||||
{
|
||||
|
||||
if (pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->m_lSchemeIndex != -1)
|
||||
if (pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->m_lSchemeIndex != -1)
|
||||
continue;
|
||||
|
||||
LONG lIndexSchemeT = pThemeStyles->m_pLevels[nIndexLevel]->m_oCFRun.Color->m_lSchemeIndex;
|
||||
|
||||
pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->m_lSchemeIndex = -1;
|
||||
pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->R = pLayout->m_arColorScheme[lIndexSchemeT].R;
|
||||
pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->G = pLayout->m_arColorScheme[lIndexSchemeT].G;
|
||||
pShape->m_oShape.m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->B = pLayout->m_arColorScheme[lIndexSchemeT].B;
|
||||
pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->m_lSchemeIndex = -1;
|
||||
pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->R = pLayout->m_arColorScheme[lIndexSchemeT].R;
|
||||
pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->G = pLayout->m_arColorScheme[lIndexSchemeT].G;
|
||||
pShape->m_pShape->m_oText.m_oStyles.m_pLevels[0]->m_oCFRun.Color->B = pLayout->m_arColorScheme[lIndexSchemeT].B;
|
||||
|
||||
bIsPlaceholderSetUp = true;
|
||||
}
|
||||
@ -301,7 +301,7 @@ namespace NSPresentationEditor
|
||||
size_t nCountElems = pSlide->m_arElements.size();
|
||||
for (size_t nIndexEl = 0; nIndexEl < nCountElems; ++nIndexEl)
|
||||
{
|
||||
IElement* pElement = pSlide->m_arElements[nIndexEl];
|
||||
CElementPtr pElement = pSlide->m_arElements[nIndexEl];
|
||||
|
||||
if (pElement->m_lPlaceholderType > 0)
|
||||
{
|
||||
|
||||
@ -124,11 +124,11 @@ namespace NSPresentationEditor
|
||||
class CLayout;
|
||||
class CSlide;
|
||||
|
||||
class IElement
|
||||
class CElement;
|
||||
typedef boost::shared_ptr<CElement> CElementPtr;
|
||||
|
||||
class CElement
|
||||
{
|
||||
protected:
|
||||
ULONG m_lCountRef;
|
||||
|
||||
public:
|
||||
ElementType m_etType;
|
||||
CDoubleRect m_rcBounds;
|
||||
@ -181,23 +181,7 @@ namespace NSPresentationEditor
|
||||
|
||||
std::wstring m_sHyperlink;
|
||||
|
||||
virtual ULONG AddRef()
|
||||
{
|
||||
++m_lCountRef;
|
||||
return m_lCountRef;
|
||||
}
|
||||
virtual ULONG Release()
|
||||
{
|
||||
--m_lCountRef;
|
||||
if (0 == m_lCountRef)
|
||||
{
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return m_lCountRef;
|
||||
}
|
||||
|
||||
IElement()
|
||||
CElement()
|
||||
{
|
||||
m_bIsBackground = false;
|
||||
m_bHaveAnchor = true;
|
||||
@ -237,12 +221,10 @@ namespace NSPresentationEditor
|
||||
m_bFlipV = false;
|
||||
m_bLine = true;
|
||||
|
||||
m_lCountRef = 1;
|
||||
|
||||
m_pTheme = NULL;
|
||||
m_pLayout = NULL;
|
||||
}
|
||||
virtual ~IElement()
|
||||
virtual ~CElement()
|
||||
{
|
||||
}
|
||||
|
||||
@ -263,12 +245,11 @@ namespace NSPresentationEditor
|
||||
m_rcBoundsOriginal.top = dScaleY * m_rcBounds.top;
|
||||
m_rcBoundsOriginal.bottom = dScaleY * m_rcBounds.bottom;
|
||||
}
|
||||
virtual IElement* CreateDublicate() = 0;
|
||||
virtual CElementPtr CreateDublicate() = 0;
|
||||
|
||||
protected:
|
||||
virtual void SetProperiesToDublicate(IElement* pDublicate)
|
||||
virtual void SetProperiesToDublicate(CElementPtr pDublicate)
|
||||
{
|
||||
if (NULL == pDublicate)
|
||||
if (!pDublicate)
|
||||
return;
|
||||
|
||||
pDublicate->m_bBoundsEnabled = m_bBoundsEnabled;
|
||||
|
||||
@ -63,7 +63,7 @@ void NSPresentationEditor::CShapeElement::CalculateColor(CColor& oColor, CSlide*
|
||||
|
||||
void NSPresentationEditor::CShapeElement::SetupTextProperties(CSlide* pSlide, CTheme* pTheme, CLayout* pLayout)
|
||||
{
|
||||
NSPresentationEditor::CTextAttributesEx* pAttributes = &m_oShape.m_oText;
|
||||
NSPresentationEditor::CTextAttributesEx* pAttributes = &m_pShape->m_oText;
|
||||
int nCountColors = 0;
|
||||
if (NULL != pTheme)
|
||||
nCountColors = (int)pTheme->m_arColorScheme.size();
|
||||
@ -123,7 +123,7 @@ void NSPresentationEditor::CShapeElement::SetupTextProperties(CSlide* pSlide, CT
|
||||
bool NSPresentationEditor::CShapeElement::SetUpTextPlaceholder(std::wstring newText)
|
||||
{
|
||||
bool result = false;
|
||||
NSPresentationEditor::CTextAttributesEx* pText = &m_oShape.m_oText;
|
||||
NSPresentationEditor::CTextAttributesEx* pText = &m_pShape->m_oText;
|
||||
|
||||
for (size_t p = 0 ; p < pText->m_arParagraphs.size(); p++) //тут по всем -> 1-(33).ppt
|
||||
{
|
||||
|
||||
@ -284,7 +284,7 @@ namespace PPTX2EditorAdvanced
|
||||
|
||||
namespace NSPresentationEditor
|
||||
{
|
||||
class CImageElement : public IElement
|
||||
class CImageElement : public CElement
|
||||
{
|
||||
public:
|
||||
std::wstring m_strImageFileName;
|
||||
@ -306,7 +306,7 @@ namespace NSPresentationEditor
|
||||
|
||||
std::wstring m_sImageName;
|
||||
|
||||
CImageElement() : IElement()
|
||||
CImageElement() : CElement()
|
||||
{
|
||||
m_etType = etPicture;
|
||||
|
||||
@ -328,11 +328,13 @@ namespace NSPresentationEditor
|
||||
virtual ~CImageElement()
|
||||
{
|
||||
}
|
||||
virtual IElement* CreateDublicate()
|
||||
virtual CElementPtr CreateDublicate()
|
||||
{
|
||||
CImageElement* pImageElement = new CImageElement();
|
||||
|
||||
CElementPtr pElement = CElementPtr( pImageElement );
|
||||
|
||||
SetProperiesToDublicate((IElement*)pImageElement);
|
||||
SetProperiesToDublicate(pElement);
|
||||
|
||||
pImageElement->m_strImageFileName = m_strImageFileName;
|
||||
pImageElement->m_nAlpha = m_nAlpha;
|
||||
@ -349,7 +351,7 @@ namespace NSPresentationEditor
|
||||
pImageElement->m_bImagePresent = m_bImagePresent;
|
||||
pImageElement->m_bOLE = m_bOLE;
|
||||
|
||||
return (IElement*)pImageElement;
|
||||
return pElement;
|
||||
}
|
||||
AVSINLINE std::wstring ConvertPPTShapeToPPTX(bool bIsNamespace = false)
|
||||
{
|
||||
@ -389,79 +391,90 @@ namespace NSPresentationEditor
|
||||
}
|
||||
};
|
||||
|
||||
class CShapeElement : public IElement
|
||||
class CShapeElement : public CElement
|
||||
{
|
||||
public:
|
||||
NSBaseShape::ClassType m_ClassType;
|
||||
|
||||
int m_lShapeType;
|
||||
CShape m_oShape;
|
||||
CShapePtr m_pShape;
|
||||
bool m_bShapePreset; // or rect (
|
||||
|
||||
CShapeElement(NSBaseShape::ClassType ClassType, int eType) : IElement(), m_lShapeType(eType), m_oShape(ClassType, eType)
|
||||
CShapeElement(NSBaseShape::ClassType ClassType, int eType) : CElement()
|
||||
{
|
||||
m_lShapeType = eType;
|
||||
m_ClassType = ClassType;
|
||||
m_etType = etShape;
|
||||
|
||||
m_oShape.m_rcBounds = m_rcBounds;
|
||||
m_pShape = CShapePtr( new CShape(ClassType, eType));
|
||||
|
||||
m_oShape.m_dStartTime = m_dStartTime;
|
||||
m_oShape.m_dStartTime = m_dEndTime;
|
||||
m_pShape->m_rcBounds = m_rcBounds;
|
||||
|
||||
m_pShape->m_dStartTime = m_dStartTime;
|
||||
m_pShape->m_dStartTime = m_dEndTime;
|
||||
|
||||
m_bShapePreset = false;
|
||||
|
||||
}
|
||||
|
||||
CShapeElement() : m_oShape(NSBaseShape::unknown, 0x1000)
|
||||
CShapeElement() : CElement()
|
||||
{
|
||||
m_lShapeType = 0x1000;
|
||||
m_etType = etShape;
|
||||
m_bShapePreset = false;
|
||||
|
||||
m_pShape = CShapePtr( new CShape(NSBaseShape::unknown, 0x1000));
|
||||
}
|
||||
|
||||
CShapeElement(const std::wstring& str) : IElement(), m_oShape(NSBaseShape::unknown, 0x1000)
|
||||
CShapeElement(const std::wstring& str) : CElement()
|
||||
{
|
||||
m_lShapeType = 0x1000;
|
||||
m_bShapePreset = false;
|
||||
|
||||
m_oShape.LoadFromXML(str);
|
||||
m_ClassType = m_oShape.getBaseShape()->GetClassType();
|
||||
m_pShape = CShapePtr( new CShape(NSBaseShape::unknown, 0x1000));
|
||||
m_pShape->LoadFromXML(str);
|
||||
|
||||
m_ClassType = m_pShape->getBaseShape()->GetClassType();
|
||||
}
|
||||
virtual void NormalizeCoordsByMetric()
|
||||
{
|
||||
IElement::NormalizeCoordsByMetric();
|
||||
CElement::NormalizeCoordsByMetric();
|
||||
|
||||
double dScaleX = (double)m_oMetric.m_lUnitsHor / m_oMetric.m_lMillimetresHor;
|
||||
double dScaleY = (double)m_oMetric.m_lUnitsVer / m_oMetric.m_lMillimetresVer;
|
||||
|
||||
m_oShape.m_oText.m_oBounds.left = (int)(dScaleX * m_oShape.m_oText.m_oBounds.left);
|
||||
m_oShape.m_oText.m_oBounds.right = (int)(dScaleX * m_oShape.m_oText.m_oBounds.right);
|
||||
m_oShape.m_oText.m_oBounds.top = (int)(dScaleY * m_oShape.m_oText.m_oBounds.top);
|
||||
m_oShape.m_oText.m_oBounds.bottom = (int)(dScaleY * m_oShape.m_oText.m_oBounds.bottom);
|
||||
m_pShape->m_oText.m_oBounds.left = (int)(dScaleX * m_pShape->m_oText.m_oBounds.left);
|
||||
m_pShape->m_oText.m_oBounds.right = (int)(dScaleX * m_pShape->m_oText.m_oBounds.right);
|
||||
m_pShape->m_oText.m_oBounds.top = (int)(dScaleY * m_pShape->m_oText.m_oBounds.top);
|
||||
m_pShape->m_oText.m_oBounds.bottom = (int)(dScaleY * m_pShape->m_oText.m_oBounds.bottom);
|
||||
}
|
||||
virtual ~CShapeElement()
|
||||
{
|
||||
}
|
||||
|
||||
virtual IElement* CreateDublicate()
|
||||
virtual CElementPtr CreateDublicate()
|
||||
{
|
||||
CShapeElement* pShapeElement = new CShapeElement(m_ClassType, m_lShapeType);
|
||||
|
||||
SetProperiesToDublicate((IElement*)pShapeElement);
|
||||
CElementPtr pElement = CElementPtr( pShapeElement );
|
||||
|
||||
SetProperiesToDublicate(pElement);
|
||||
|
||||
pShapeElement->m_lShapeType = m_lShapeType;
|
||||
pShapeElement->m_bShapePreset = m_bShapePreset;
|
||||
|
||||
m_oShape.SetToDublicate(&pShapeElement->m_oShape);
|
||||
return (IElement*)pShapeElement;
|
||||
m_pShape->SetToDublicate(pShapeElement->m_pShape.get());
|
||||
|
||||
return pElement;
|
||||
}
|
||||
bool SetUpTextPlaceholder(std::wstring newText);
|
||||
|
||||
virtual void SetupProperties(CSlide* pSlide, CTheme* pTheme, CLayout* pLayout)
|
||||
{
|
||||
m_oShape.m_oText.m_lPlaceholderType = m_lPlaceholderType;
|
||||
m_oShape.m_oText.m_lPlaceholderID = m_lPlaceholderID;
|
||||
m_pShape->m_oText.m_lPlaceholderType = m_lPlaceholderType;
|
||||
m_pShape->m_oText.m_lPlaceholderID = m_lPlaceholderID;
|
||||
|
||||
m_oShape.getBaseShape()->ReCalculate();
|
||||
m_pShape->getBaseShape()->ReCalculate();
|
||||
|
||||
SetupTextProperties(pSlide, pTheme, pLayout);
|
||||
|
||||
@ -476,7 +489,7 @@ namespace NSPresentationEditor
|
||||
|
||||
AVSINLINE std::wstring ConvertPPTShapeToPPTX(bool bIsNamespace = false)
|
||||
{
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_oShape.getBaseShape());
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_pShape->getBaseShape().get());
|
||||
if (NULL == pPPTShape)
|
||||
{
|
||||
// такого быть не может
|
||||
@ -712,11 +725,12 @@ namespace NSPresentationEditor
|
||||
{
|
||||
}
|
||||
|
||||
virtual IElement* CreateDublicate()
|
||||
virtual CElementPtr CreateDublicate()
|
||||
{
|
||||
CAudioElement* pAudioElement = new CAudioElement();
|
||||
CElementPtr pElement = CElementPtr( pAudioElement );
|
||||
|
||||
SetProperiesToDublicate((CImageElement*)pAudioElement);
|
||||
SetProperiesToDublicate(pElement);
|
||||
|
||||
pAudioElement->m_strAudioFileName = m_strAudioFileName;
|
||||
pAudioElement->m_nAmplify = m_nAmplify;
|
||||
@ -728,7 +742,7 @@ namespace NSPresentationEditor
|
||||
pAudioElement->m_dClipStartTime = m_dClipStartTime;
|
||||
pAudioElement->m_dClipEndTime = m_dClipEndTime;
|
||||
|
||||
return (IElement*)pAudioElement;
|
||||
return pElement;
|
||||
}
|
||||
};
|
||||
class CVideoElement : public CImageElement
|
||||
@ -759,11 +773,13 @@ namespace NSPresentationEditor
|
||||
{
|
||||
}
|
||||
|
||||
virtual IElement* CreateDublicate()
|
||||
virtual CElementPtr CreateDublicate()
|
||||
{
|
||||
CVideoElement* pVideoElement = new CVideoElement();
|
||||
|
||||
SetProperiesToDublicate((CImageElement*)pVideoElement);
|
||||
CElementPtr pElement = CElementPtr( pVideoElement );
|
||||
|
||||
SetProperiesToDublicate(pElement);
|
||||
|
||||
pVideoElement->m_strVideoFileName = m_strVideoFileName;
|
||||
pVideoElement->m_nAlpha = m_nAlpha;
|
||||
@ -774,7 +790,7 @@ namespace NSPresentationEditor
|
||||
pVideoElement->m_dClipEndTime = m_dClipEndTime;
|
||||
pVideoElement->m_bLoop = m_bLoop;
|
||||
|
||||
return (IElement*)pVideoElement;
|
||||
return pElement;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ namespace NSPresentationEditor
|
||||
class CLayout
|
||||
{
|
||||
public:
|
||||
std::vector<IElement*> m_arElements;
|
||||
std::vector<CElementPtr>m_arElements;
|
||||
std::vector<CColor> m_arColorScheme;
|
||||
std::multimap<int,int> m_mapPlaceholders;
|
||||
|
||||
@ -66,7 +66,7 @@ namespace NSPresentationEditor
|
||||
std::wstring m_strLayoutType;
|
||||
|
||||
std::wstring m_sName;
|
||||
public:
|
||||
|
||||
CLayout()
|
||||
{
|
||||
Clear();
|
||||
@ -81,12 +81,10 @@ namespace NSPresentationEditor
|
||||
{
|
||||
Clear();
|
||||
|
||||
m_arElements = oSrc.m_arElements;
|
||||
|
||||
size_t nCount = m_arElements.size();
|
||||
size_t nCount = oSrc.m_arElements.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
ADDREFINTERFACE((m_arElements[nIndex]));
|
||||
m_arElements.push_back(oSrc.m_arElements[nIndex]->CreateDublicate());
|
||||
}
|
||||
|
||||
m_mapPlaceholders = oSrc.m_mapPlaceholders;
|
||||
@ -108,7 +106,8 @@ namespace NSPresentationEditor
|
||||
m_bHasFooter = oSrc.m_bHasFooter;
|
||||
m_nFormatDate = oSrc.m_nFormatDate;
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i] = oSrc.m_PlaceholdersReplaceString[i];
|
||||
for (int i = 0 ; i < 3 ; i++)
|
||||
m_PlaceholdersReplaceString[i] = oSrc.m_PlaceholdersReplaceString[i];
|
||||
|
||||
m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
|
||||
m_strLayoutType = oSrc.m_strLayoutType;
|
||||
@ -127,15 +126,8 @@ namespace NSPresentationEditor
|
||||
m_lOriginalHeight = m_oInfo.m_lUnitsVer;
|
||||
}
|
||||
|
||||
public:
|
||||
void Clear()
|
||||
{
|
||||
size_t nCount = m_arElements.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
RELEASEINTERFACE((m_arElements[nIndex]));
|
||||
}
|
||||
|
||||
m_arElements.clear();
|
||||
m_mapPlaceholders.clear();
|
||||
|
||||
@ -143,7 +135,9 @@ namespace NSPresentationEditor
|
||||
m_bHasSlideNumber = false;
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i].clear();
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++)
|
||||
m_PlaceholdersReplaceString[i].clear();
|
||||
|
||||
m_bUseThemeColorScheme = true;
|
||||
m_bShowMasterShapes = true;
|
||||
@ -159,12 +153,11 @@ namespace NSPresentationEditor
|
||||
|
||||
for (size_t nIndex = 0; nIndex < m_arElements.size(); ++nIndex)
|
||||
{
|
||||
IElement* pElem = m_arElements[nIndex];
|
||||
CElementPtr pElem = m_arElements[nIndex];
|
||||
if (NULL != pElem)
|
||||
{
|
||||
m_arElements[nIndex] = pElem->CreateDublicate();
|
||||
}
|
||||
RELEASEINTERFACE(pElem);
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,24 +168,21 @@ namespace NSPresentationEditor
|
||||
return pNew;
|
||||
}
|
||||
|
||||
IElement* GetPlaceholder(LONG lID, bool bIsAddRef)
|
||||
CElementPtr GetPlaceholder(LONG lID)
|
||||
{
|
||||
size_t nCount = m_arElements.size();
|
||||
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
IElement* pElem = m_arElements[i];
|
||||
CElementPtr pElem = m_arElements[i];
|
||||
|
||||
if (pElem->m_lPlaceholderType == lID)
|
||||
{
|
||||
if (bIsAddRef)
|
||||
ADDREFINTERFACE(pElem);
|
||||
|
||||
return pElem;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return CElementPtr();
|
||||
}
|
||||
|
||||
LONG GetCountPlaceholderWithType(LONG lType)
|
||||
@ -209,10 +199,6 @@ namespace NSPresentationEditor
|
||||
|
||||
return lFound;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
NSPresentationEditor::CColor GetColor(const LONG& lIndexScheme)
|
||||
{
|
||||
if (lIndexScheme < (LONG)m_arColorScheme.size())
|
||||
|
||||
@ -36,8 +36,9 @@
|
||||
#include "PPTXShape/PptxShape.h"
|
||||
#include "PPTShape/PptShape.h"
|
||||
|
||||
using namespace NSPresentationEditor;
|
||||
|
||||
NSPresentationEditor::CBaseShape* NSPresentationEditor::CBaseShape::CreateByType(NSPresentationEditor::NSBaseShape::ClassType ClassType, int ShapeType)
|
||||
CBaseShapePtr CBaseShape::CreateByType(NSBaseShape::ClassType ClassType, int ShapeType)
|
||||
{
|
||||
if(ClassType == pptx)
|
||||
{
|
||||
@ -52,7 +53,7 @@ NSPresentationEditor::CBaseShape* NSPresentationEditor::CBaseShape::CreateByType
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool NSPresentationEditor::CBaseShape::SetType(NSPresentationEditor::NSBaseShape::ClassType ClassType, int ShapeType)
|
||||
bool CBaseShape::SetType(NSBaseShape::ClassType ClassType, int ShapeType)
|
||||
{
|
||||
if (ClassType != GetClassType())
|
||||
return false;
|
||||
|
||||
@ -30,9 +30,12 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Path.h"
|
||||
#include "../../../../../Common/DocxFormat/Source/Common/SimpleTypes_Base.h"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace NSPresentationEditor
|
||||
{
|
||||
using namespace NSBaseShape;
|
||||
@ -61,7 +64,10 @@ namespace NSPresentationEditor
|
||||
return (*this);
|
||||
}
|
||||
};
|
||||
//
|
||||
|
||||
class CBaseShape;
|
||||
typedef boost::shared_ptr<CBaseShape> CBaseShapePtr;
|
||||
|
||||
class CBaseShape
|
||||
{
|
||||
public:
|
||||
@ -120,7 +126,7 @@ namespace NSPresentationEditor
|
||||
|
||||
virtual void AddGuide(const std::wstring& strGuide) {}
|
||||
|
||||
static CBaseShape* CreateByType(ClassType ClassType, int ShapeType);
|
||||
static CBaseShapePtr CreateByType(ClassType ClassType, int ShapeType);
|
||||
|
||||
virtual const ClassType GetClassType()const = 0;
|
||||
bool SetType(ClassType ClassType, int ShapeType);
|
||||
|
||||
@ -48,34 +48,40 @@ LONG NSGuidesVML::CFormula::Calculate(NSGuidesVML::CFormulasManager* pManager)
|
||||
LONG lAdjCount = (LONG)pManager->m_pAdjustments->size();
|
||||
|
||||
LONG a1 = m_lParam1;
|
||||
if (ptFormula == m_eType1)
|
||||
if (ptFormula == m_eType1 && !pManager->m_bCalc)
|
||||
{
|
||||
pManager->m_bCalc = true;
|
||||
a1 = (m_lParam1 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam1].Calculate(pManager);
|
||||
}
|
||||
else if (ptAdjust == m_eType1)
|
||||
{
|
||||
a1 = (m_lParam1 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam1];
|
||||
}
|
||||
pManager->m_bCalc = false;
|
||||
|
||||
LONG b1 = m_lParam2;
|
||||
if (ptFormula == m_eType2)
|
||||
if (ptFormula == m_eType2 && !pManager->m_bCalc)
|
||||
{
|
||||
pManager->m_bCalc = true;
|
||||
b1 = (m_lParam2 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam2].Calculate(pManager);
|
||||
}
|
||||
else if (ptAdjust == m_eType2)
|
||||
{
|
||||
b1 = (m_lParam2 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam2];
|
||||
}
|
||||
pManager->m_bCalc = false;
|
||||
|
||||
LONG c1 = m_lParam3;
|
||||
if (ptFormula == m_eType3)
|
||||
if (ptFormula == m_eType3 && !pManager->m_bCalc)
|
||||
{
|
||||
pManager->m_bCalc = true;
|
||||
c1 = (m_lParam3 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam3].Calculate(pManager);
|
||||
}
|
||||
else if (ptAdjust == m_eType3)
|
||||
{
|
||||
c1 = (m_lParam3 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam3];
|
||||
}
|
||||
pManager->m_bCalc = false;
|
||||
|
||||
double a = (double)a1;
|
||||
double b = (double)b1;
|
||||
|
||||
@ -341,8 +341,9 @@ namespace NSGuidesVML
|
||||
long m_lShapeWidth;
|
||||
long m_lShapeHeight;
|
||||
|
||||
public:
|
||||
CFormulasManager() : m_arFormulas(), m_arResults()
|
||||
bool m_bCalc; //status
|
||||
|
||||
CFormulasManager() : m_bCalc(false)
|
||||
{
|
||||
m_pAdjustments = NULL;
|
||||
m_lShapeWidth = ShapeSizeVML;
|
||||
@ -350,6 +351,7 @@ namespace NSGuidesVML
|
||||
}
|
||||
CFormulasManager& operator =(const CFormulasManager& oSrc)
|
||||
{
|
||||
m_bCalc = oSrc.m_bCalc;
|
||||
m_pAdjustments = oSrc.m_pAdjustments;
|
||||
m_lShapeWidth = oSrc.m_lShapeWidth;
|
||||
m_lShapeHeight = oSrc.m_lShapeHeight;
|
||||
@ -370,6 +372,7 @@ namespace NSGuidesVML
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_bCalc = false;
|
||||
m_pAdjustments = NULL;
|
||||
m_lShapeWidth = ShapeSizeVML;
|
||||
m_lShapeHeight = ShapeSizeVML;
|
||||
|
||||
@ -42,7 +42,26 @@ const double EMU_MM = 36000;
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
using namespace PPTShapes;
|
||||
CPPTShape* CPPTShape::CreateByType(PPTShapes::ShapeType type)
|
||||
using namespace NSPresentationEditor;
|
||||
|
||||
CPPTShape::CPPTShape() : CBaseShape(), m_arStringTextRects()
|
||||
{
|
||||
m_eType = PPTShapes::sptMin;
|
||||
|
||||
m_arStringTextRects.push_back(_T("0,0,21600,21600"));
|
||||
|
||||
m_strPathLimoX = _T("");
|
||||
m_strPathLimoY = _T("");
|
||||
m_bIsShapeType = false;
|
||||
|
||||
m_bIsFilled = true;
|
||||
m_bIsStroked = true;
|
||||
}
|
||||
CPPTShape::~CPPTShape()
|
||||
{
|
||||
}
|
||||
|
||||
CBaseShapePtr CPPTShape::CreateByType(PPTShapes::ShapeType type)
|
||||
{
|
||||
CPPTShape* pShape = NULL;
|
||||
switch (type)
|
||||
@ -288,6 +307,143 @@ CPPTShape* CPPTShape::CreateByType(PPTShapes::ShapeType type)
|
||||
if (NULL != pShape)
|
||||
pShape->m_eType = type;
|
||||
|
||||
return pShape;
|
||||
return CBaseShapePtr(pShape);
|
||||
}
|
||||
|
||||
|
||||
bool CPPTShape::LoadFromXML(const std::wstring& xml)
|
||||
{
|
||||
XmlUtils::CXmlNode oNodePict;
|
||||
if (oNodePict.FromXmlString(xml))
|
||||
{
|
||||
return LoadFromXML(oNodePict);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPPTShape::LoadFromXML(XmlUtils::CXmlNode& oNodePict)
|
||||
{
|
||||
std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
|
||||
bool isPathList = false;
|
||||
if (id != _T(""))
|
||||
{
|
||||
SetShapeType((PPTShapes::ShapeType)XmlUtils::GetInteger(id));
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlUtils::CXmlNode oNodeTemplate;
|
||||
if (oNodePict.GetNode(_T("template"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
|
||||
LoadAdjustValuesList(strAdj);
|
||||
|
||||
XmlUtils::CXmlNode oNodeGuides;
|
||||
if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
{
|
||||
LoadGuidesList(oNodeGuides.GetXml());
|
||||
}
|
||||
|
||||
std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
|
||||
if (strPath != _T(""))
|
||||
{
|
||||
LoadPathList(strPath);
|
||||
isPathList = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeGuides;
|
||||
if (oNodePict.GetNode(_T("path"), oNodeGuides))
|
||||
{
|
||||
std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
|
||||
if (strPath != _T(""))
|
||||
{
|
||||
LoadPathList(strPath);
|
||||
isPathList = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isPathList)
|
||||
ReCalculate();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPPTShape::LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType) // vml object
|
||||
{ // из за особенносей форматирования vmlDrawing могут вылезти пустые текстовые значения - value ..
|
||||
std::wstring sId = oNodeShapeType.GetAttribute(_T("o:spt"));
|
||||
|
||||
bool bIsNeedRecalc = true;
|
||||
if (sId != _T(""))
|
||||
{
|
||||
int id = XmlUtils::GetInteger(sId);
|
||||
if (id > 0)
|
||||
{
|
||||
SetShapeType((PPTShapes::ShapeType)id);
|
||||
//ReCalculate();
|
||||
m_eType = (PPTShapes::ShapeType)id;
|
||||
}
|
||||
}
|
||||
std::wstring strAdj = oNodeShapeType.GetAttribute(_T("adj"));
|
||||
if (strAdj != _T(""))
|
||||
LoadAdjustValuesList(strAdj);
|
||||
|
||||
XmlUtils::CXmlNode oNodeGuides;
|
||||
if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
{
|
||||
LoadGuidesList(oNodeGuides.GetXml());
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodePath;
|
||||
if (oNodeShapeType.GetNode(_T("v:path"), oNodePath))
|
||||
{
|
||||
std::wstring strTextR = oNodePath.GetAttribute(_T("textboxrect"));
|
||||
if (strTextR != _T(""))
|
||||
LoadTextRect(strTextR);
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeAHs;
|
||||
if (oNodeShapeType.GetNode(_T("v:handles"), oNodeAHs))
|
||||
{
|
||||
LoadAHList(oNodeAHs);
|
||||
}
|
||||
|
||||
std::wstring strPath = oNodeShapeType.GetAttribute(_T("path"));
|
||||
if (strPath != _T(""))
|
||||
{
|
||||
LoadPathList(strPath);
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeTextPath;
|
||||
if (oNodeShapeType.GetNode(_T("v:textpath"), oNodeTextPath))
|
||||
{
|
||||
if (m_eType < PPTShapes::ShapeType::sptCTextPlain || m_eType > PPTShapes::ShapeType::sptCTextCanDown)
|
||||
m_eType = PPTShapes::ShapeType::sptCTextPlain;
|
||||
}
|
||||
|
||||
std::wstring strFilled = oNodeShapeType.GetAttribute(_T("filled"));
|
||||
std::wstring strStroked = oNodeShapeType.GetAttribute(_T("stroked"));
|
||||
|
||||
if (strFilled != _T(""))
|
||||
{
|
||||
if (strFilled == _T("false") || strFilled == _T("f"))
|
||||
m_bIsFilled = false;
|
||||
else
|
||||
m_bIsFilled = true;
|
||||
}
|
||||
|
||||
if (strStroked != _T(""))
|
||||
{
|
||||
if (strStroked == _T("false") || strStroked == _T("f"))
|
||||
m_bIsStroked = false;
|
||||
else
|
||||
m_bIsStroked = true;
|
||||
}
|
||||
XmlUtils::CXmlNode oNodeSignature;
|
||||
if (oNodeShapeType.GetNode(_T("o:signatureline"), oNodeSignature))
|
||||
{
|
||||
m_oSignatureLine = oNodeSignature;
|
||||
}
|
||||
|
||||
ReCalculate();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -56,240 +56,12 @@ public:
|
||||
bool m_bIsStroked;
|
||||
nullable<OOX::VmlOffice::CSignatureLine> m_oSignatureLine;
|
||||
|
||||
public:
|
||||
CPPTShape() : CBaseShape(), m_arStringTextRects()
|
||||
{
|
||||
m_eType = PPTShapes::sptMin;
|
||||
|
||||
m_arStringTextRects.push_back(_T("0,0,21600,21600"));
|
||||
|
||||
m_strPathLimoX = _T("");
|
||||
m_strPathLimoY = _T("");
|
||||
m_bIsShapeType = false;
|
||||
|
||||
m_bIsFilled = true;
|
||||
m_bIsStroked = true;
|
||||
}
|
||||
|
||||
~CPPTShape()
|
||||
{
|
||||
}
|
||||
virtual bool LoadFromXML(const std::wstring& xml)
|
||||
{
|
||||
XmlUtils::CXmlNode oNodePict;
|
||||
if (oNodePict.FromXmlString(xml))
|
||||
{
|
||||
return LoadFromXML(oNodePict);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//virtual bool LoadFromXML(const std::wstring& xml)
|
||||
//{
|
||||
// XmlUtils::CXmlNode oNodePict;
|
||||
// if (oNodePict.FromXmlString(xml))
|
||||
// {
|
||||
// if (_T("shape") == oNodePict.GetName())
|
||||
// {
|
||||
// std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
|
||||
// if (id != _T(""))
|
||||
// {
|
||||
// SetShapeType((PPTShapes::ShapeType)Strings::ToInteger(id));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// XmlUtils::CXmlNode oNodeTemplate;
|
||||
// if (oNodePict.GetNode(_T("template"), oNodeTemplate))
|
||||
// {
|
||||
// std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
|
||||
// LoadAdjustValuesList(strAdj);
|
||||
|
||||
// XmlUtils::CXmlNode oNodeGuides;
|
||||
// if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
// {
|
||||
// LoadGuidesList(oNodeGuides.GetXml());
|
||||
// }
|
||||
|
||||
// std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
|
||||
// LoadPathList(strPath);
|
||||
// }
|
||||
// }
|
||||
|
||||
// XmlUtils::CXmlNode oNodeGuides;
|
||||
// if (oNodePict.GetNode(_T("path"), oNodeGuides))
|
||||
// {
|
||||
// std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
|
||||
// LoadPathList(strPath);
|
||||
// }
|
||||
|
||||
// /*XmlUtils::CXmlNode oNodeShapeType;
|
||||
// if (oNodePict.GetNode(_T("v:shapetype"), oNodeShapeType))
|
||||
// {
|
||||
// std::wstring strAdj = oNodeShapeType.GetAttributeOrValue(_T("adj"));
|
||||
// LoadAdjustValuesList(strAdj);
|
||||
|
||||
// XmlUtils::CXmlNode oNodeGuides;
|
||||
// if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
// {
|
||||
// LoadGuidesList(oNodeGuides.GetXml());
|
||||
// }
|
||||
|
||||
// std::wstring strPath = oNodeShapeType.GetAttributeOrValue(_T("path"));
|
||||
// LoadAdjustValuesList(strPath);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// XmlUtils::CXmlNode oNodeShape;
|
||||
// if (oNodePict.GetNode(_T("v:shape"), oNodeShape))
|
||||
// {
|
||||
// std::wstring strAdj = oNodeShape.GetAttributeOrValue(_T("adj"));
|
||||
// LoadAdjustValuesList(strAdj);
|
||||
|
||||
// XmlUtils::CXmlNode oNodeGuides;
|
||||
// if (oNodeShape.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
// {
|
||||
// LoadGuidesList(oNodeGuides.GetXml());
|
||||
// }
|
||||
|
||||
// std::wstring strPath = oNodeShape.GetAttributeOrValue(_T("path"));
|
||||
// LoadPathList(strPath);
|
||||
// }
|
||||
// }*/
|
||||
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return false;
|
||||
//}
|
||||
|
||||
virtual bool LoadFromXML(XmlUtils::CXmlNode& oNodePict)
|
||||
{
|
||||
std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
|
||||
bool isPathList = false;
|
||||
if (id != _T(""))
|
||||
{
|
||||
SetShapeType((PPTShapes::ShapeType)XmlUtils::GetInteger(id));
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlUtils::CXmlNode oNodeTemplate;
|
||||
if (oNodePict.GetNode(_T("template"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
|
||||
LoadAdjustValuesList(strAdj);
|
||||
|
||||
XmlUtils::CXmlNode oNodeGuides;
|
||||
if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
{
|
||||
LoadGuidesList(oNodeGuides.GetXml());
|
||||
}
|
||||
|
||||
std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
|
||||
if (strPath != _T(""))
|
||||
{
|
||||
LoadPathList(strPath);
|
||||
isPathList = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeGuides;
|
||||
if (oNodePict.GetNode(_T("path"), oNodeGuides))
|
||||
{
|
||||
std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
|
||||
if (strPath != _T(""))
|
||||
{
|
||||
LoadPathList(strPath);
|
||||
isPathList = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isPathList)
|
||||
ReCalculate();
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType) // vml object
|
||||
{ // из за особенносей форматирования vmlDrawing могут вылезти пустые текстовые значения - value ..
|
||||
std::wstring sId = oNodeShapeType.GetAttribute(_T("o:spt"));
|
||||
|
||||
bool bIsNeedRecalc = true;
|
||||
if (sId != _T(""))
|
||||
{
|
||||
int id = XmlUtils::GetInteger(sId);
|
||||
if (id > 0)
|
||||
{
|
||||
SetShapeType((PPTShapes::ShapeType)id);
|
||||
//ReCalculate();
|
||||
m_eType = (PPTShapes::ShapeType)id;
|
||||
}
|
||||
}
|
||||
std::wstring strAdj = oNodeShapeType.GetAttribute(_T("adj"));
|
||||
if (strAdj != _T(""))
|
||||
LoadAdjustValuesList(strAdj);
|
||||
|
||||
XmlUtils::CXmlNode oNodeGuides;
|
||||
if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
|
||||
{
|
||||
LoadGuidesList(oNodeGuides.GetXml());
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodePath;
|
||||
if (oNodeShapeType.GetNode(_T("v:path"), oNodePath))
|
||||
{
|
||||
std::wstring strTextR = oNodePath.GetAttribute(_T("textboxrect"));
|
||||
if (strTextR != _T(""))
|
||||
LoadTextRect(strTextR);
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeAHs;
|
||||
if (oNodeShapeType.GetNode(_T("v:handles"), oNodeAHs))
|
||||
{
|
||||
LoadAHList(oNodeAHs);
|
||||
}
|
||||
|
||||
std::wstring strPath = oNodeShapeType.GetAttribute(_T("path"));
|
||||
if (strPath != _T(""))
|
||||
{
|
||||
LoadPathList(strPath);
|
||||
}
|
||||
|
||||
XmlUtils::CXmlNode oNodeTextPath;
|
||||
if (oNodeShapeType.GetNode(_T("v:textpath"), oNodeTextPath))
|
||||
{
|
||||
if (m_eType < PPTShapes::ShapeType::sptCTextPlain || m_eType > PPTShapes::ShapeType::sptCTextCanDown)
|
||||
m_eType = PPTShapes::ShapeType::sptCTextPlain;
|
||||
}
|
||||
|
||||
std::wstring strFilled = oNodeShapeType.GetAttribute(_T("filled"));
|
||||
std::wstring strStroked = oNodeShapeType.GetAttribute(_T("stroked"));
|
||||
|
||||
if (strFilled != _T(""))
|
||||
{
|
||||
if (strFilled == _T("false") || strFilled == _T("f"))
|
||||
m_bIsFilled = false;
|
||||
else
|
||||
m_bIsFilled = true;
|
||||
}
|
||||
|
||||
if (strStroked != _T(""))
|
||||
{
|
||||
if (strStroked == _T("false") || strStroked == _T("f"))
|
||||
m_bIsStroked = false;
|
||||
else
|
||||
m_bIsStroked = true;
|
||||
}
|
||||
XmlUtils::CXmlNode oNodeSignature;
|
||||
if (oNodeShapeType.GetNode(_T("o:signatureline"), oNodeSignature))
|
||||
{
|
||||
m_oSignatureLine = oNodeSignature;
|
||||
}
|
||||
|
||||
ReCalculate();
|
||||
return true;
|
||||
}
|
||||
CPPTShape();
|
||||
virtual ~CPPTShape();
|
||||
|
||||
virtual bool LoadFromXML(const std::wstring& xml);
|
||||
virtual bool LoadFromXML(XmlUtils::CXmlNode& oNodePict);
|
||||
virtual bool LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType);
|
||||
virtual bool LoadAdjustValuesList(const std::wstring& xml)
|
||||
{
|
||||
std::wstring strXml = xml;
|
||||
@ -484,8 +256,9 @@ public:
|
||||
LoadPathList(m_strPath);
|
||||
}
|
||||
|
||||
static CPPTShape* CreateByType(PPTShapes::ShapeType type);
|
||||
virtual const ClassType GetClassType()const
|
||||
static CBaseShapePtr CreateByType(PPTShapes::ShapeType type);
|
||||
|
||||
virtual const ClassType GetClassType()const
|
||||
{
|
||||
return NSBaseShape::ppt;
|
||||
}
|
||||
@ -533,13 +306,13 @@ public:
|
||||
|
||||
bool SetShapeType(PPTShapes::ShapeType type)
|
||||
{
|
||||
CPPTShape* l_pShape = CreateByType(type);
|
||||
if(l_pShape != NULL)
|
||||
CBaseShapePtr pShape = CreateByType(type);
|
||||
|
||||
if(pShape)
|
||||
{
|
||||
m_eType = type;
|
||||
|
||||
SetProperties(l_pShape);
|
||||
delete l_pShape;
|
||||
SetProperties(pShape.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -34,8 +34,9 @@
|
||||
#include "PptxShape.h"
|
||||
//#include "PresetShapesHeader.h"
|
||||
|
||||
CPPTXShape* CPPTXShape::CreateByType(OOXMLShapes::ShapeType type)
|
||||
CBaseShapePtr CPPTXShape::CreateByType(OOXMLShapes::ShapeType type)
|
||||
{
|
||||
CBaseShapePtr shape;
|
||||
// switch(type)
|
||||
// {
|
||||
// case OOXMLShapes::sptCAccentBorderCallout1: return new OOXMLShapes::CAccentBorderCallout1();
|
||||
@ -266,5 +267,5 @@ CPPTXShape* CPPTXShape::CreateByType(OOXMLShapes::ShapeType type)
|
||||
// case OOXMLShapes::sptCWedgeRectCallout: return new OOXMLShapes::CWedgeRectCallout();
|
||||
// case OOXMLShapes::sptCWedgeRoundRectCallout: return new OOXMLShapes::CWedgeRoundRectCallout();
|
||||
// }
|
||||
return NULL;
|
||||
return shape;
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ public:
|
||||
OOXMLShapes::ShapeType m_eType;
|
||||
|
||||
NSGuidesOOXML::CFormulaManager FManager;
|
||||
public:
|
||||
|
||||
CPPTXShape() : CBaseShape(), FManager(m_arAdjustments, m_arGuides)
|
||||
{
|
||||
m_eType = OOXMLShapes::sptMin;
|
||||
@ -507,7 +507,7 @@ public:
|
||||
LoadPathList(m_strPath);
|
||||
}
|
||||
|
||||
static CPPTXShape* CreateByType(OOXMLShapes::ShapeType type);
|
||||
static CBaseShapePtr CreateByType(OOXMLShapes::ShapeType type);
|
||||
|
||||
virtual const ClassType GetClassType()const
|
||||
{
|
||||
@ -540,13 +540,12 @@ public:
|
||||
|
||||
bool SetShapeType(OOXMLShapes::ShapeType type)
|
||||
{
|
||||
CPPTXShape* l_pShape = CreateByType(type);
|
||||
if(l_pShape != NULL)
|
||||
CBaseShapePtr pShape = CreateByType(type);
|
||||
if(pShape)
|
||||
{
|
||||
m_eType = type;
|
||||
|
||||
SetProperties(l_pShape);
|
||||
delete l_pShape;
|
||||
SetProperties(pShape.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -49,10 +49,13 @@ const LONG c_ShapeDrawType_Graphic = 0x01;
|
||||
const LONG c_ShapeDrawType_Text = 0x02;
|
||||
const LONG c_ShapeDrawType_All = c_ShapeDrawType_Graphic | c_ShapeDrawType_Text;
|
||||
|
||||
class CShape;
|
||||
typedef boost::shared_ptr<CShape> CShapePtr;
|
||||
|
||||
class CShape
|
||||
{
|
||||
private:
|
||||
CBaseShape* m_pShape;
|
||||
CBaseShapePtr m_pShape;
|
||||
public:
|
||||
double m_dStartTime;
|
||||
double m_dEndTime;
|
||||
@ -103,15 +106,11 @@ public:
|
||||
m_dTextMarginRight = 0;
|
||||
m_dTextMarginBottom = 0;
|
||||
|
||||
m_strPPTXShape = _T("");
|
||||
|
||||
m_pShape = NULL;
|
||||
|
||||
m_classType = classType;
|
||||
|
||||
if (m_classType == NSBaseShape::pptx)
|
||||
{
|
||||
m_pShape = new CPPTXShape();
|
||||
m_pShape = CBaseShapePtr(new CPPTXShape());
|
||||
m_pShape->SetType(NSBaseShape::pptx, ShapeType_);
|
||||
}
|
||||
else if (m_classType == NSBaseShape::ppt)
|
||||
@ -119,7 +118,7 @@ public:
|
||||
m_pShape = CPPTShape::CreateByType((PPTShapes::ShapeType)ShapeType_ );
|
||||
if (m_pShape == NULL)
|
||||
{
|
||||
m_pShape = new CPPTShape();
|
||||
m_pShape = CBaseShapePtr(new CPPTShape());
|
||||
m_pShape->SetType(NSBaseShape::ppt, ShapeType_);
|
||||
}
|
||||
|
||||
@ -135,20 +134,17 @@ public:
|
||||
|
||||
~CShape()
|
||||
{
|
||||
RELEASEOBJECT(m_pShape);
|
||||
}
|
||||
|
||||
CBaseShape* getBaseShape()
|
||||
CBaseShapePtr getBaseShape()
|
||||
{
|
||||
return m_pShape;
|
||||
}
|
||||
|
||||
void setBaseShape(CBaseShape* pShape)
|
||||
void setBaseShape(CBaseShapePtr pShape)
|
||||
{
|
||||
if (pShape == NULL) return;
|
||||
|
||||
CPPTXShape *pptxShape = dynamic_cast<CPPTXShape*>(pShape);
|
||||
CPPTShape *pptShape = dynamic_cast<CPPTShape*>(pShape);
|
||||
CPPTXShape *pptxShape = dynamic_cast<CPPTXShape*>(pShape.get());
|
||||
CPPTShape *pptShape = dynamic_cast<CPPTShape*>(pShape.get());
|
||||
|
||||
if (pptxShape) m_classType = NSBaseShape::pptx;
|
||||
if (pptShape) m_classType = NSBaseShape::ppt;
|
||||
@ -180,7 +176,7 @@ public:
|
||||
if (NSBaseShape::ppt == m_pShape->GetClassType())
|
||||
{
|
||||
// как будто могло быть иначе
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_pShape);
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_pShape.get());
|
||||
if (NULL != pPPTShape)
|
||||
{
|
||||
pPPTShape->CalcTextRectOffsets(dPercentLeft, dPercentTop, dPercentRight, dPercentBottom);
|
||||
@ -251,7 +247,7 @@ public:
|
||||
if ((m_pShape) && (NSBaseShape::ppt == m_pShape->GetClassType()))
|
||||
{
|
||||
// как будто могло быть иначе
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_pShape);
|
||||
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_pShape.get());
|
||||
if (NULL != pPPTShape)
|
||||
{
|
||||
//pPPTShape->CalcTextRectOffsets(dPercentLeft, dPercentTop, dPercentRight, dPercentBottom);
|
||||
@ -338,23 +334,23 @@ public:
|
||||
{
|
||||
if(_T("ooxml-shape") == root.GetName())
|
||||
{
|
||||
if(m_pShape != NULL)
|
||||
delete m_pShape;
|
||||
m_pShape = new CPPTXShape();
|
||||
//return m_pShape->LoadFromXML(xml);
|
||||
return ((CPPTXShape*)m_pShape)->LoadFromXML(root);
|
||||
m_pShape = CBaseShapePtr(new CPPTXShape());
|
||||
|
||||
CPPTXShape* pptx_shape = dynamic_cast<CPPTXShape*>(m_pShape.get());
|
||||
|
||||
return pptx_shape ? pptx_shape->LoadFromXML(root) : false;
|
||||
}
|
||||
else if(_T("shape") == root.GetName())
|
||||
{
|
||||
if(m_pShape != NULL)
|
||||
delete m_pShape;
|
||||
m_pShape = new CPPTShape();
|
||||
m_pShape = CBaseShapePtr(new CPPTShape());
|
||||
|
||||
SetCoordSize(root);
|
||||
SetPen (root);
|
||||
SetBrush (root);
|
||||
|
||||
return ((CPPTShape*)m_pShape)->LoadFromXML(root);
|
||||
CPPTShape* ppt_shape = dynamic_cast<CPPTShape*>(m_pShape.get());
|
||||
|
||||
return ppt_shape ? ppt_shape->LoadFromXML(root) : false;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -386,7 +382,7 @@ public:
|
||||
Shape->m_dTextMarginBottom = m_dTextMarginBottom;
|
||||
|
||||
if (m_pShape)
|
||||
return m_pShape->SetToDublicate(Shape->m_pShape);
|
||||
return m_pShape->SetToDublicate(Shape->m_pShape.get());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ namespace NSPresentationEditor
|
||||
LONG m_lSlideID; //for notes rels
|
||||
LONG m_lNotesID; //for slide rels
|
||||
|
||||
std::vector<IElement*> m_arElements;
|
||||
std::vector<CElementPtr>m_arElements;
|
||||
CSlideShowInfo m_oSlideShow;
|
||||
std::multimap<int,int> m_mapPlaceholders;
|
||||
|
||||
@ -73,7 +73,7 @@ namespace NSPresentationEditor
|
||||
std::wstring m_strComment;
|
||||
std::wstring m_sName;
|
||||
|
||||
CSlide() : m_arElements(), m_oSlideShow()
|
||||
CSlide() : m_oSlideShow()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
@ -84,11 +84,6 @@ namespace NSPresentationEditor
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for (size_t nIndex = 0; nIndex < m_arElements.size(); ++nIndex)
|
||||
{
|
||||
IElement* pElem = m_arElements[nIndex];
|
||||
RELEASEINTERFACE(pElem);
|
||||
}
|
||||
m_arColorScheme.clear();
|
||||
m_arElements.clear();
|
||||
|
||||
@ -111,7 +106,8 @@ namespace NSPresentationEditor
|
||||
m_strComment.clear();
|
||||
m_sName.clear();
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i].clear();
|
||||
for (int i = 0 ; i < 3 ; i++)
|
||||
m_PlaceholdersReplaceString[i].clear();
|
||||
}
|
||||
|
||||
CSlide(const CSlide& oSrc)
|
||||
@ -171,7 +167,7 @@ namespace NSPresentationEditor
|
||||
{
|
||||
if (-1 != m_arElements[nEl]->m_lPlaceholderType && etShape == m_arElements[nEl]->m_etType)
|
||||
{
|
||||
CShapeElement* pSlideElement = dynamic_cast<CShapeElement*>(m_arElements[nEl]);
|
||||
CShapeElement* pSlideElement = dynamic_cast<CShapeElement*>(m_arElements[nEl].get());
|
||||
|
||||
if (NULL != pSlideElement)
|
||||
{
|
||||
@ -185,10 +181,10 @@ namespace NSPresentationEditor
|
||||
if ((pLayout->m_arElements[i]->m_lPlaceholderType == pSlideElement->m_lPlaceholderType) &&
|
||||
(pLayout->m_arElements[i]->m_etType == etShape))
|
||||
{
|
||||
CShapeElement* pLayoutElement = dynamic_cast<CShapeElement*>(pLayout->m_arElements[i]);
|
||||
CShapeElement* pLayoutElement = dynamic_cast<CShapeElement*>(pLayout->m_arElements[i].get());
|
||||
if (NULL != pLayoutElement)
|
||||
{
|
||||
pSlideElement->m_oShape.m_oText.m_oLayoutStyles = pLayoutElement->m_oShape.m_oText.m_oStyles;
|
||||
pSlideElement->m_pShape->m_oText.m_oLayoutStyles = pLayoutElement->m_pShape->m_oText.m_oStyles;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -198,10 +194,10 @@ namespace NSPresentationEditor
|
||||
(pLayout->m_arElements[i]->m_lPlaceholderID == pSlideElement->m_lPlaceholderID) &&
|
||||
(pLayout->m_arElements[i]->m_etType == etShape))
|
||||
{
|
||||
CShapeElement* pLayoutElement = dynamic_cast<CShapeElement*>(pLayout->m_arElements[i]);
|
||||
CShapeElement* pLayoutElement = dynamic_cast<CShapeElement*>(pLayout->m_arElements[i].get());
|
||||
if (NULL != pLayoutElement)
|
||||
{
|
||||
pSlideElement->m_oShape.m_oText.m_oLayoutStyles = pLayoutElement->m_oShape.m_oText.m_oStyles;
|
||||
pSlideElement->m_pShape->m_oText.m_oLayoutStyles = pLayoutElement->m_pShape->m_oText.m_oStyles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ namespace NSPresentationEditor
|
||||
bool m_bIsBackground;
|
||||
CBrush m_oBackground;
|
||||
|
||||
std::vector<IElement*> m_arElements;
|
||||
std::vector<CElementPtr> m_arElements;
|
||||
|
||||
CMetricInfo m_oInfo;
|
||||
|
||||
@ -133,11 +133,6 @@ namespace NSPresentationEditor
|
||||
|
||||
m_arElements = oSrc.m_arElements;
|
||||
|
||||
nCount = m_arElements.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
ADDREFINTERFACE((m_arElements[nIndex]));
|
||||
}
|
||||
CreateDublicateElements();
|
||||
|
||||
for (long nIndexStyle = 0; nIndexStyle < g_ThemeTextStylesCount; ++nIndexStyle)
|
||||
@ -154,23 +149,16 @@ namespace NSPresentationEditor
|
||||
size_t nCount = m_arElements.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
IElement* pElem = m_arElements[nIndex];
|
||||
CElementPtr pElem = m_arElements[nIndex];
|
||||
if (NULL != pElem)
|
||||
{
|
||||
m_arElements[nIndex] = pElem->CreateDublicate();
|
||||
}
|
||||
RELEASEINTERFACE(pElem);
|
||||
}
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
size_t nCount = m_arElements.size();
|
||||
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
|
||||
{
|
||||
RELEASEINTERFACE((m_arElements[nIndex]));
|
||||
}
|
||||
|
||||
m_arElements.clear();
|
||||
m_arLayouts.clear();
|
||||
m_mapTitleLayout.clear();
|
||||
@ -186,15 +174,13 @@ namespace NSPresentationEditor
|
||||
m_bHasFooter = false;
|
||||
m_nFormatDate = 1;
|
||||
|
||||
for (int i = 0 ; i < 3 ; i++) m_PlaceholdersReplaceString[i].clear();
|
||||
for (int i = 0 ; i < 3 ; i++)
|
||||
m_PlaceholdersReplaceString[i].clear();
|
||||
}
|
||||
|
||||
~CTheme()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
NSPresentationEditor::CColor GetColor(const LONG& lIndexScheme)
|
||||
{
|
||||
if (lIndexScheme < (LONG)m_arColorScheme.size())
|
||||
|
||||
@ -112,6 +112,10 @@ namespace PPTX
|
||||
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
std::wstring namespaceLocks = L"a";
|
||||
std::wstring namespaceLocksLink = PPTX::g_Namespaces.a.m_strLink;
|
||||
//if (m_namespace == L"wp") namespaceLocks = L"wp";
|
||||
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
|
||||
oAttr.Write(_T("noDrilldown"), noDrilldown);
|
||||
@ -120,21 +124,23 @@ namespace PPTX
|
||||
oAttr.Write(_T("noResize"), noResize);
|
||||
oAttr.Write(_T("noSelect"), noSelect);
|
||||
|
||||
std::wstring namespaceLocks = L"a";
|
||||
//if (m_namespace == L"wp") namespaceLocks = L"wp";
|
||||
bool isAttrEmpty = oAttr.m_strValue.empty();
|
||||
oAttr.Write(_T("xmlns:") + namespaceLocks, namespaceLocksLink);
|
||||
|
||||
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr", oAttr.m_strValue.empty() ? L"" : XmlUtils::CreateNode(namespaceLocks + L":graphicFrameLocks", oAttr));
|
||||
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr", isAttrEmpty ? L"" : XmlUtils::CreateNode(namespaceLocks + L":graphicFrameLocks", oAttr));
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
std::wstring namespaceLock_ = L"a";
|
||||
std::wstring namespaceLockLink_ = PPTX::g_Namespaces.a.m_strLink;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
namespaceLock_ = L"a";
|
||||
namespaceLockLink_ = PPTX::g_Namespaces.a.m_strLink;
|
||||
namespace_ = L"wp";
|
||||
}
|
||||
|
||||
@ -145,7 +151,7 @@ namespace PPTX
|
||||
pWriter->StartNode(namespaceLock_ + L":graphicFrameLocks");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("xmlns:") + namespaceLock_, namespaceLockLink_);
|
||||
pWriter->WriteAttribute(_T("noChangeAspect"), noChangeAspect);
|
||||
pWriter->WriteAttribute(_T("noDrilldown"), noDrilldown);
|
||||
pWriter->WriteAttribute(_T("noGrp"), noGrp);
|
||||
|
||||
@ -54,7 +54,7 @@ namespace PPTX
|
||||
lpShapeElement = new NSPresentationEditor::CShapeElement(NSBaseShape::pptx, (int)_lspt);
|
||||
std::wstring strAdjustValues = lpGeom.GetODString();
|
||||
|
||||
lpShapeElement->m_oShape.getBaseShape()->LoadAdjustValuesList(strAdjustValues);
|
||||
lpShapeElement->m_pShape->getBaseShape()->LoadAdjustValuesList(strAdjustValues);
|
||||
}
|
||||
else if (this->is<PPTX::Logic::CustGeom>())
|
||||
{
|
||||
@ -71,8 +71,8 @@ namespace PPTX
|
||||
|
||||
LONG lCoordSize = 100000;
|
||||
|
||||
lpShapeElement->m_oShape.getBaseShape()->SetWidthHeightLogic(dCoordSizeX, dCoordSizeY);
|
||||
lpShapeElement->m_oShape.getBaseShape()->ReCalculate();
|
||||
lpShapeElement->m_pShape->getBaseShape()->SetWidthHeightLogic(dCoordSizeX, dCoordSizeY);
|
||||
lpShapeElement->m_pShape->getBaseShape()->ReCalculate();
|
||||
|
||||
pOOXToVMLRenderer->put_Width((double)lCoordSize / dCoordSizeX);
|
||||
pOOXToVMLRenderer->put_Height((double)lCoordSize / dCoordSizeY);
|
||||
@ -85,7 +85,7 @@ namespace PPTX
|
||||
oInfo.m_dWidth = dCoordSizeX;
|
||||
oInfo.m_dHeight = dCoordSizeY;
|
||||
|
||||
NSPresentationEditor::CPath& oPath = lpShapeElement->m_oShape.getBaseShape()->m_oPath;
|
||||
NSPresentationEditor::CPath& oPath = lpShapeElement->m_pShape->getBaseShape()->m_oPath;
|
||||
|
||||
COOXToVMLGeometry* pOOXToVMLGeometry = dynamic_cast<COOXToVMLGeometry*>(pOOXToVMLRenderer);
|
||||
|
||||
@ -111,19 +111,19 @@ namespace PPTX
|
||||
if(NULL != pOOXToVMLGeometry)
|
||||
pOOXToVMLGeometry->ResultPath(&strPath);
|
||||
|
||||
if (lpShapeElement->m_oShape.getBaseShape()->m_arTextRects.size() <= 0)
|
||||
if (lpShapeElement->m_pShape->getBaseShape()->m_arTextRects.size() <= 0)
|
||||
{
|
||||
strRect = _T("0,0,100000,100000");
|
||||
}
|
||||
else
|
||||
{
|
||||
Aggplus::RECT& txRect = lpShapeElement->m_oShape.getBaseShape()->m_arTextRects[0];
|
||||
Aggplus::RECT& txRect = lpShapeElement->m_pShape->getBaseShape()->m_arTextRects[0];
|
||||
//double dkoefX = (double)lCoordSize / max(1, dCoordSizeX);
|
||||
//double dkoefY = (double)lCoordSize / max(1, dCoordSizeY);
|
||||
|
||||
double _dWidth = ShapeSize;
|
||||
double _dHeight = ShapeSize;
|
||||
lpShapeElement->m_oShape.getBaseShape()->GetWidthHeightLogic(_dWidth, _dHeight);
|
||||
lpShapeElement->m_pShape->getBaseShape()->GetWidthHeightLogic(_dWidth, _dHeight);
|
||||
|
||||
double dkoefX = (double)lCoordSize / (std::max)(1., _dWidth);
|
||||
double dkoefY = (double)lCoordSize / (std::max)(1., _dHeight);
|
||||
|
||||
@ -233,7 +233,7 @@ namespace PPTX
|
||||
}
|
||||
NSDirectory::DeleteDirectory(oox_unpacked.GetPath());
|
||||
}
|
||||
else if ( L"Equation.3" == sProgID || L"Equation.2" == sProgID )
|
||||
else if ( std::wstring::npos != sProgID.find(L"Equation"))
|
||||
{
|
||||
pWriter->StartRecord(1);
|
||||
pWriter->WriteBYTE(4);
|
||||
@ -743,7 +743,7 @@ namespace PPTX
|
||||
if(oleObject.IsInit() && oleObject->isValid())
|
||||
{
|
||||
bOle = true;
|
||||
pWriter->WriteString(L"<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"0\" name=\"\"/><p:cNvGraphicFramePr><a:graphicFrameLocks noChangeAspect=\"1\"/></p:cNvGraphicFramePr><p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2157879785\"/></p:ext></p:extLst></p:nvPr></p:nvGraphicFramePr>");
|
||||
pWriter->WriteString(L"<p:graphicFrame><p:nvGraphicFramePr><p:cNvPr id=\"0\" name=\"\"/><p:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" noChangeAspect=\"1\"/></p:cNvGraphicFramePr><p:nvPr><p:extLst><p:ext uri=\"{D42A27DB-BD31-4B8C-83A1-F6EECF244321}\"><p14:modId xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"2157879785\"/></p:ext></p:extLst></p:nvPr></p:nvGraphicFramePr>");
|
||||
if(spPr.xfrm.IsInit())
|
||||
{
|
||||
std::wstring oldNamespace = spPr.xfrm->m_ns;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1116,7 +1116,8 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
//Custom
|
||||
if (!m_aPVerticles.empty() || !m_aPSegmentInfo.empty())
|
||||
{
|
||||
CPPTShape * custom_shape = CPPTShape::CreateByType((PPTShapes::ShapeType)m_nShapeType);
|
||||
CBaseShapePtr base_shape = CPPTShape::CreateByType((PPTShapes::ShapeType)m_nShapeType);
|
||||
CPPTShape *custom_shape = dynamic_cast<CPPTShape*>(base_shape.get());
|
||||
if (custom_shape)
|
||||
{
|
||||
custom_shape->m_bCustomShape = true;
|
||||
|
||||
@ -513,7 +513,23 @@ const std::wstring tab2sheet_name(const short tabid, std::vector<std::wstring>&
|
||||
}
|
||||
return L"#REF";
|
||||
}
|
||||
|
||||
const std::wstring name2sheet_name(std::wstring name, const std::wstring prefix)
|
||||
{
|
||||
static boost::wregex correct_sheet_name(L"^\\'.+?\\'$");
|
||||
static boost::wregex test_sheet_name(L"[\\s)(\\'&:-]+"); //.??? 6442946.xls
|
||||
|
||||
std::wstring sheet_first = prefix + name;
|
||||
|
||||
if(!boost::regex_search(sheet_first.begin(), sheet_first.end(), correct_sheet_name))
|
||||
{
|
||||
if(boost::regex_search(sheet_first.begin(), sheet_first.end(), test_sheet_name))
|
||||
{
|
||||
sheet_first = boost::algorithm::replace_all_copy(sheet_first, L"'", L"''");
|
||||
sheet_first = std::wstring(L"'") + sheet_first + std::wstring(L"'");
|
||||
}
|
||||
}
|
||||
return sheet_first;
|
||||
}
|
||||
const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabLast, std::vector<std::wstring>& names, const std::wstring prefix)
|
||||
{
|
||||
if(-1 == tabFirst)
|
||||
@ -538,7 +554,7 @@ const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabL
|
||||
std::wstring sheet_last;
|
||||
if (tabLast != tabFirst)
|
||||
{
|
||||
sheet_last = prefix + tab2sheet_name(tabLast, names);
|
||||
sheet_last = std::wstring(L":") + prefix + tab2sheet_name(tabLast, names);
|
||||
|
||||
if(!boost::regex_search(sheet_last.begin(), sheet_last.end(), correct_sheet_name))
|
||||
{
|
||||
@ -548,7 +564,6 @@ const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabL
|
||||
sheet_last = std::wstring(L"\'") + sheet_last + std::wstring(L"\'");
|
||||
}
|
||||
}
|
||||
sheet_last = std::wstring(L":") + sheet_last;
|
||||
}
|
||||
|
||||
return sheet_first + sheet_last;
|
||||
|
||||
@ -95,6 +95,7 @@ namespace STR
|
||||
namespace XMLSTUFF
|
||||
{;
|
||||
|
||||
const std::wstring name2sheet_name(std::wstring name, const std::wstring prefix);
|
||||
const std::wstring xti_indexes2sheet_name(const short tabFirst, const short tabLast, std::vector<std::wstring>& names, const std::wstring prefix = L"");
|
||||
|
||||
}
|
||||
|
||||
@ -73,6 +73,47 @@ void CFStream::read(void* buf, const size_t size)
|
||||
return;// EndOfStreamReached
|
||||
}
|
||||
}
|
||||
void CFStream::copy( std::wstring streamNameCreate, POLE::Storage * storageOut)
|
||||
{
|
||||
stream_->seek(0);
|
||||
int size_stream = stream_->size();
|
||||
|
||||
POLE::Stream *streamNew = new POLE::Stream(storageOut, streamNameCreate, true, size_stream);
|
||||
if (!streamNew) return;
|
||||
|
||||
unsigned char buffer[4096];
|
||||
int bytesRead = 0;
|
||||
|
||||
while(true)
|
||||
{
|
||||
int bytesToRead = size_stream - bytesRead;
|
||||
if (bytesToRead <= 0)
|
||||
break;
|
||||
if (bytesToRead > 4096)
|
||||
bytesToRead = 4096;
|
||||
|
||||
stream_->read(buffer, bytesToRead);
|
||||
streamNew->write(buffer, bytesToRead);
|
||||
|
||||
bytesRead += bytesToRead;
|
||||
}
|
||||
//unsigned char* data_stream = new unsigned char[size_stream + 64];
|
||||
//memset(data_stream, 0, size_stream + 64);
|
||||
//if (data_stream)
|
||||
//{
|
||||
// stream->read(data_stream, size_stream);
|
||||
|
||||
// streamNew->write(data_stream, size_stream);
|
||||
|
||||
// delete []data_stream;
|
||||
// data_stream = NULL;
|
||||
//}
|
||||
|
||||
streamNew->flush();
|
||||
|
||||
delete streamNew;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Write 'size' unsigned chars to the stream
|
||||
|
||||
@ -46,6 +46,8 @@ class CFStream
|
||||
public:
|
||||
CFStream(POLE::Stream* stream);
|
||||
~CFStream();
|
||||
|
||||
void copy( std::wstring streamNameCreate, POLE::Storage * storageOut);
|
||||
|
||||
template<class Type>
|
||||
CFStream& operator>>(Type& val) // Read a simple type or an object (not array)
|
||||
|
||||
@ -49,6 +49,7 @@ global_info_(global_info)
|
||||
skippable_records_names.push_back("StartBlock");
|
||||
skippable_records_names.push_back("EndBlock");
|
||||
skippable_records_names.push_back("ChartFrtInfo");
|
||||
skippable_records_names.push_back("FrtWrapper");
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +101,7 @@ CFRecordPtr CFStreamCacheReader::getNextRecord(const CFRecordType::TypeId desira
|
||||
}
|
||||
if(skippable_records_names.end() != std::find(skippable_records_names.begin(), skippable_records_names.end(), rec_name))
|
||||
{
|
||||
Log::warning("The extracted record has been skipped (" + rec_name + ")");
|
||||
//Log::warning("The extracted record has been skipped (" + rec_name + ")");
|
||||
records_cache.pop_front();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ void CompoundFile::copy_stream(std::wstring streamNameOpen, std::wstring streamN
|
||||
if (!stream) return;
|
||||
|
||||
stream->seek(0);
|
||||
int size_stream = stream->size();
|
||||
POLE::uint64 size_stream = stream->size();
|
||||
|
||||
if (bWithRoot == false)
|
||||
{
|
||||
|
||||
@ -79,7 +79,7 @@ void BoundSheet8::readFields(CFRecord& record)
|
||||
hsState = std::wstring (L"hidden");
|
||||
break;
|
||||
case 2:
|
||||
hsState = std::wstring (L"hidden");//(L"veryHidden");
|
||||
hsState = std::wstring (L"veryHidden");
|
||||
break;
|
||||
}
|
||||
if (name_.length() > 31)
|
||||
@ -91,9 +91,11 @@ void BoundSheet8::readFields(CFRecord& record)
|
||||
{//file(6).xls
|
||||
name_ = L"Sheet_" + boost::lexical_cast<std::wstring>(record.getGlobalWorkbookInfo()->current_sheet + 1);
|
||||
}
|
||||
|
||||
record.getGlobalWorkbookInfo()->sheets_names.push_back(name_);
|
||||
record.getGlobalWorkbookInfo()->sheets_state.push_back(hsState);
|
||||
|
||||
GlobalWorkbookInfo::_sheet_info sheet_info;
|
||||
sheet_info.state = hsState;
|
||||
sheet_info.name = name_;
|
||||
record.getGlobalWorkbookInfo()->sheets_info.push_back(sheet_info);
|
||||
|
||||
dt = GETBITS(flags, 8, 15);
|
||||
}
|
||||
|
||||
@ -122,9 +122,9 @@ void DConRef::check_external()
|
||||
{
|
||||
bool bFound = false;
|
||||
|
||||
for (size_t i = 0; !bFilePath && i < global_info_->sheets_names.size(); i++)
|
||||
for (size_t i = 0; !bFilePath && i < global_info_->sheets_info.size(); i++)
|
||||
{
|
||||
if (global_info_->sheets_names[i] == sheet_name)
|
||||
if (global_info_->sheets_info[i].name == sheet_name)
|
||||
{
|
||||
bFound = true;
|
||||
break;
|
||||
|
||||
@ -55,7 +55,10 @@ void DefColWidth::readFields(CFRecord& record)
|
||||
GlobalWorkbookInfoPtr global_info = record.getGlobalWorkbookInfo();
|
||||
record >> cchdefColWidth;
|
||||
|
||||
global_info->sheet_size_info.back().defaultColumnWidth = cchdefColWidth ;
|
||||
if (!global_info->sheets_info.empty())
|
||||
{
|
||||
global_info->sheets_info.back().defaultColumnWidth = cchdefColWidth ;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -65,7 +65,10 @@ void DefaultRowHeight::readFields(CFRecord& record)
|
||||
|
||||
record >> miyRw;
|
||||
|
||||
global_info->sheet_size_info.back().defaultRowHeight = miyRw / 20.;
|
||||
if (!global_info->sheets_info.empty())
|
||||
{
|
||||
global_info->sheets_info.back().defaultRowHeight = miyRw / 20.;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of ObjProtect record in BIFF8
|
||||
class ObjProtect: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(ObjProtect)
|
||||
@ -51,7 +49,7 @@ public:
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeObjProtect;
|
||||
static const ElementType type = typeObjProtect;
|
||||
|
||||
//-----------------------------
|
||||
Boolean<unsigned short> fLockObj;
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Protect record in BIFF8
|
||||
class Protect: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Protect)
|
||||
|
||||
@ -94,7 +94,13 @@ void SXAddl::readFields(CFRecord& record)
|
||||
content->load(record);
|
||||
|
||||
if (sxd == 0x00) bStartElement = true;
|
||||
if (sxd == 0xff) bEndElement = true;
|
||||
if (sxd == 0xff)
|
||||
{
|
||||
BiffStructurePtr end = BiffStructurePtr(new SXAddl_Universal_End());
|
||||
end->load(record);
|
||||
|
||||
bEndElement = true;
|
||||
}
|
||||
|
||||
}
|
||||
BiffStructurePtr SXAddl::createSxcView(CFRecord& record)
|
||||
@ -104,10 +110,15 @@ BiffStructurePtr SXAddl::createSxcView(CFRecord& record)
|
||||
switch(sxd)
|
||||
{
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCView_SXDId()); break;
|
||||
case 0x02: result = BiffStructurePtr(new SXAddl_SXCView_SXDVer10Info()); break;
|
||||
case 0x19: result = BiffStructurePtr(new SXAddl_SXCView_SXDVer12Info()); break;
|
||||
case 0x01: result = BiffStructurePtr(new SXAddl_SXCView_SXDVerUpdInv()); break;
|
||||
case 0x02: result = BiffStructurePtr(new SXAddl_SXCView_SXDVer10Info()); break;
|
||||
//case 0x03: result = BiffStructurePtr(new SXAddl_SXCView_SXDCalcMember()); break;
|
||||
//case 0x0A: result = BiffStructurePtr(new SXAddl_SXCView_SXDCalcMemString()); break;
|
||||
case 0x19: result = BiffStructurePtr(new SXAddl_SXCView_SXDVer12Info()); break;
|
||||
case 0x1E: result = BiffStructurePtr(new SXAddl_SXCView_SXDTableStyleClient()); break;
|
||||
case 0xff: result = BiffStructurePtr(new SXAddl_SXCView_SXDEnd()); break;
|
||||
//case 0x21: result = BiffStructurePtr(new SXAddl_SXCView_SXDCompactRwHdr()); break;
|
||||
//case 0x22: result = BiffStructurePtr(new SXAddl_SXCView_SXDCompactColHdr()); break;
|
||||
//case 0x26: result = BiffStructurePtr(new SXAddl_SXCView_SXDSXPIIvmb()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -119,7 +130,6 @@ BiffStructurePtr SXAddl::createSxcField(CFRecord& record)
|
||||
{
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCField_SXDId()); break;
|
||||
case 0x02: result = BiffStructurePtr(new SXAddl_SXCField_SXDVer10Info()); break;
|
||||
case 0xff: result = BiffStructurePtr(new SXAddl_SXCField_SXDEnd()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -128,12 +138,26 @@ BiffStructurePtr SXAddl::createSxcHierarchy(CFRecord& record)
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0xff: break;
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDId()); break;
|
||||
case 0x01: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDVerUpdInv()); break;
|
||||
case 0x05: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDProperty()); break;
|
||||
case 0x09: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDFilterMember()); break;
|
||||
case 0x1d: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDSXSetParentUnique());break;
|
||||
case 0x1f: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDUserCaption()); break;
|
||||
case 0x20: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDId()); break;
|
||||
case 0x24: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDMeasureGrp()); break;
|
||||
case 0x25: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDDisplayFolder()); break;
|
||||
case 0x26: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDParentKPI()); break;
|
||||
case 0x27: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIValue()); break;
|
||||
case 0x28: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIGoal()); break;
|
||||
case 0x29: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIStatus()); break;
|
||||
case 0x2a: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPITrend()); break;
|
||||
case 0x2b: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIWeight()); break;
|
||||
case 0x2c: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPITime()); break;
|
||||
case 0x3f: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDFilterMember12()); break;
|
||||
case 0x41: result = BiffStructurePtr(new SXAddl_SXCHierarchy_SXDInfo12()); break;
|
||||
}
|
||||
|
||||
if (result)
|
||||
result->load(record);
|
||||
|
||||
return result;
|
||||
}
|
||||
BiffStructurePtr SXAddl::createSxcCache (CFRecord& record)
|
||||
@ -147,7 +171,6 @@ BiffStructurePtr SXAddl::createSxcCache (CFRecord& record)
|
||||
case 0x18: result = BiffStructurePtr(new SXAddl_SXCCache_SXDVerSXMacro()); break;
|
||||
case 0x34: result = BiffStructurePtr(new SXAddl_SXCCache_SXDInvRefreshReal()); break;
|
||||
case 0x41: result = BiffStructurePtr(new SXAddl_SXCCache_SXDInfo12()); break;
|
||||
case 0xff: result = BiffStructurePtr(new SXAddl_SXCCache_SXDEnd()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -163,7 +186,21 @@ BiffStructurePtr SXAddl::createSxcCacheField(CFRecord& record)
|
||||
case 0x30: result = BiffStructurePtr(new SXAddl_SXCCacheField_SXDIfdbMempropMap()); break;
|
||||
case 0x31: result = BiffStructurePtr(new SXAddl_SXCCacheField_SXDIfdbMpMapCount()); break;
|
||||
case 0x40: result = BiffStructurePtr(new SXAddl_SXCCacheField_SXDPropName()); break;
|
||||
case 0xff: result = BiffStructurePtr(new SXAddl_SXCCacheField_SXDEnd()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
BiffStructurePtr SXAddl::createSxcField12(CFRecord& record)
|
||||
{
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCField12_SXDId()); break;
|
||||
case 0x01: result = BiffStructurePtr(new SXAddl_SXCField12_SXDVerUpdInv()); break;
|
||||
case 0x11: result = BiffStructurePtr(new SXAddl_SXCField12_SXDMemberCaption()); break;
|
||||
case 0x19: result = BiffStructurePtr(new SXAddl_SXCField12_SXDVer12Info()); break;
|
||||
case 0x1c: result = BiffStructurePtr(new SXAddl_SXCField12_SXDISXTH()); break;
|
||||
case 0x37: result = BiffStructurePtr(new SXAddl_SXCField12_SXDAutoshow()); break;
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -208,7 +245,10 @@ BiffStructurePtr SXAddl::createSxcCacheItem(CFRecord& record)
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0xff: break;
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCCacheItem_SXDId()); break;
|
||||
case 0x2e: result = BiffStructurePtr(new SXAddl_SXCCacheItem_SXDSxrmitmDisp()); break;
|
||||
case 0x32: result = BiffStructurePtr(new SXAddl_SXCCacheItem_SXDItmMpropMap()); break;
|
||||
case 0x33: result = BiffStructurePtr(new SxAddl_SXCCacheItem_SXDItmMpMapCount());break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -235,7 +275,8 @@ BiffStructurePtr SXAddl::createSxcSXDH(CFRecord& record)
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0xff: break;
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCSXDH_SXDId()); break;
|
||||
case 0x1A: result = BiffStructurePtr(new SXAddl_SXCSXDH_SXDSxdh()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -253,7 +294,8 @@ BiffStructurePtr SXAddl::createSxcSXMgs(CFRecord& record)
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0xff: break;
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCSXMgs_SXDId()); break;
|
||||
case 0x23: result = BiffStructurePtr(new SXAddl_SXCSXMgs_SXDMGrpSXDHMap()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -262,16 +304,8 @@ BiffStructurePtr SXAddl::createSxcSXMg(CFRecord& record)
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0xff: break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
BiffStructurePtr SXAddl::createSxcField12(CFRecord& record)
|
||||
{
|
||||
BiffStructurePtr result;
|
||||
switch(sxd)
|
||||
{
|
||||
case 0xff: break;
|
||||
case 0x00: result = BiffStructurePtr(new SXAddl_SXCSXMg_SXDId()); break;
|
||||
case 0x1F: result = BiffStructurePtr(new SXAddl_SXCSXMg_SXDUserCaption()); break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -397,24 +431,12 @@ void SXAddl_SXCView_SXDVer12Info::load(CFRecord& record)
|
||||
fNoHeaders = GETBIT(flags, 23);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField_SXDEnd::clone()
|
||||
BiffStructurePtr SXAddl_Universal_End::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField_SXDEnd(*this));
|
||||
return BiffStructurePtr(new SXAddl_Universal_End(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField_SXDEnd::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCView_SXDEnd::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCView_SXDEnd(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCView_SXDEnd::load(CFRecord& record)
|
||||
void SXAddl_Universal_End::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
@ -453,18 +475,6 @@ void SXAddl_SXCCache_SXDId::load(CFRecord& record)
|
||||
record >> idCache >> reserved;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCache_SXDEnd::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCache_SXDEnd(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCCache_SXDEnd::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField_SXDVer10Info::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField_SXDVer10Info(*this));
|
||||
@ -511,7 +521,6 @@ void SXAddl_SXCCache_SXDVer10Info::load(CFRecord& record)
|
||||
record >> reserved2;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
BiffStructurePtr SXAddl_SXCCache_SXDVerUpdInv::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCache_SXDVerUpdInv(*this));
|
||||
@ -521,11 +530,21 @@ void SXAddl_SXCCache_SXDVerUpdInv::load(CFRecord& record)
|
||||
{
|
||||
record >> dwVersionInvalidates;
|
||||
|
||||
record.skipNunBytes(5);
|
||||
|
||||
record.skipNunBytes(5);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCView_SXDVerUpdInv::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCView_SXDVerUpdInv(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCView_SXDVerUpdInv::load(CFRecord& record)
|
||||
{
|
||||
record >> dwVersionInvalidates;
|
||||
|
||||
record.skipNunBytes(5);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCache_SXDInfo12::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCache_SXDInfo12(*this));
|
||||
@ -641,18 +660,6 @@ void SXAddl_SXCCacheField_SXDIfdbMpMapCount::load(CFRecord& record)
|
||||
record >> ifdbMemProp >> reserved2;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCacheField_SXDEnd::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCacheField_SXDEnd(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCCacheField_SXDEnd::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCacheField_SXDCaption::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCacheField_SXDCaption(*this));
|
||||
@ -677,5 +684,411 @@ void SXAddl_SXCCache_SXDInvRefreshReal::load(CFRecord& record)
|
||||
fEnableRefresh = GETBIT(flags, 0);
|
||||
fInvalid = GETBIT(flags, 1);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField12_SXDId::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField12_SXDId(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField12_SXDId::load(CFRecord& record)
|
||||
{
|
||||
record >> stName;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField12_SXDISXTH::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField12_SXDISXTH(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField12_SXDISXTH::load(CFRecord& record)
|
||||
{
|
||||
short reserved2;
|
||||
record >> isxth >> reserved2;;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField12_SXDVer12Info::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField12_SXDVer12Info(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField12_SXDVer12Info::load(CFRecord& record)
|
||||
{
|
||||
short flags, reserved2, reserved3;
|
||||
record >> flags >> reserved2 >> reserved3;
|
||||
|
||||
fHiddenLvl = GETBIT(flags, 1);
|
||||
fUseMemPropCaption = GETBIT(flags, 2);
|
||||
fCompact = GETBIT(flags, 3);
|
||||
fNotAutoSortDft = GETBIT(flags, 4);
|
||||
fFilterInclusive = GETBIT(flags, 5);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField12_SXDMemberCaption::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField12_SXDMemberCaption(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField12_SXDMemberCaption::load(CFRecord& record)
|
||||
{
|
||||
record >> stMemberPropertyCaptionUnique;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField12_SXDVerUpdInv::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField12_SXDVerUpdInv(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField12_SXDVerUpdInv::load(CFRecord& record)
|
||||
{
|
||||
record >> dwVersionInvalidates;
|
||||
|
||||
record.skipNunBytes(5);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCField12_SXDAutoshow::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCField12_SXDAutoshow(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCField12_SXDAutoshow::load(CFRecord& record)
|
||||
{
|
||||
short reserved;
|
||||
record >> citmAutoShow >> reserved;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCacheItem_SXDSxrmitmDisp::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCacheItem_SXDSxrmitmDisp(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCCacheItem_SXDSxrmitmDisp::load(CFRecord& record)
|
||||
{
|
||||
record >> stDisplay;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SxAddl_SXCCacheItem_SXDItmMpMapCount::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SxAddl_SXCCacheItem_SXDItmMpMapCount(*this));
|
||||
}
|
||||
|
||||
void SxAddl_SXCCacheItem_SXDItmMpMapCount::load(CFRecord& record)
|
||||
{
|
||||
short reserved;
|
||||
record >> cMemProps >> reserved;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCCacheItem_SXDItmMpropMap::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCCacheItem_SXDItmMpropMap(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCCacheItem_SXDItmMpropMap::load(CFRecord& record)
|
||||
{
|
||||
int sz = (record.getDataSize() - record.getRdPtr()) / 4;
|
||||
for (int i = 0; i < sz; i++)
|
||||
{
|
||||
_INT32 val;
|
||||
record >> val;
|
||||
rgMemProps.push_back(val);
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCSXDH_SXDId::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCSXDH_SXDId(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCSXDH_SXDId::load(CFRecord& record)
|
||||
{
|
||||
short reserved;
|
||||
record >> dwCount >> reserved;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCSXDH_SXDSxdh::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCSXDH_SXDSxdh(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCSXDH_SXDSxdh::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2 >> isxth >> cchDimensionName >> cchDimensionUnique >> cchDimensionCaption;
|
||||
|
||||
if (cchDimensionName > 0)
|
||||
{
|
||||
stDimensionName.setSize(cchDimensionName);
|
||||
record >> stDimensionName;
|
||||
}
|
||||
if (cchDimensionUnique > 0)
|
||||
{
|
||||
stDimensionUnique.setSize(cchDimensionUnique);
|
||||
record >> stDimensionUnique;
|
||||
}
|
||||
if (cchDimensionCaption > 0)
|
||||
{
|
||||
stDimensionCaption.setSize(cchDimensionCaption);
|
||||
record >> stDimensionCaption;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCSXMg_SXDId::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCSXMg_SXDId(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCSXMg_SXDId::load(CFRecord& record)
|
||||
{
|
||||
record >> stName;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCSXMg_SXDUserCaption::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCSXMg_SXDUserCaption(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCSXMg_SXDUserCaption::load(CFRecord& record)
|
||||
{
|
||||
record >> stUserCaption;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCSXMgs_SXDId::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCSXMgs_SXDId(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCSXMgs_SXDId::load(CFRecord& record)
|
||||
{
|
||||
short reserved;
|
||||
record >> cmgs >> reserved >> cmaps;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCSXMgs_SXDMGrpSXDHMap::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCSXMgs_SXDMGrpSXDHMap(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCSXMgs_SXDMGrpSXDHMap::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2 >> iKey >> iVal;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDId::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDId(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDId::load(CFRecord& record)
|
||||
{
|
||||
record >> stHierUnq;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDVerUpdInv::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDVerUpdInv(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDVerUpdInv::load(CFRecord& record)
|
||||
{
|
||||
record >> dwVersionInvalidates;
|
||||
record.skipNunBytes(5);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDProperty::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDProperty(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDProperty::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 flags;
|
||||
short reserved2;
|
||||
|
||||
record >> flags >> reserved2 >> cchProperty;
|
||||
|
||||
fDisplayInReport = GETBIT(flags, 0);
|
||||
fDisplayInTip = GETBIT(flags, 1);
|
||||
fDisplayInCaption = GETBIT(flags, 2);
|
||||
|
||||
if (cchProperty > 0)
|
||||
{
|
||||
stProperty.setSize(cchProperty);
|
||||
record >> stProperty;
|
||||
}
|
||||
record >> cchLevelUnq >> ichPropName >> cchPropName >> isxtl;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDFilterMember::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDFilterMember(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDFilterMember::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 flags;
|
||||
short reserved2;
|
||||
|
||||
record >> flags >> reserved2 >> cItems;
|
||||
fMultFiltHavePlex = GETBIT(flags, 1);
|
||||
|
||||
for (unsigned short i = 0; i < cItems; i++)
|
||||
{
|
||||
XLUnicodeString val;
|
||||
record >> val;
|
||||
rgStMembers.push_back(val.value());
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDFilterMember12::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDFilterMember12(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDFilterMember12::load(CFRecord& record)
|
||||
{
|
||||
short reserved2;
|
||||
|
||||
record >> isxtl >> reserved2 >> cItems;
|
||||
|
||||
for (unsigned short i = 0; i < cItems; i++)
|
||||
{
|
||||
XLUnicodeString val;
|
||||
record >> val;
|
||||
rgStMembers.push_back(val.value());
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDSXSetParentUnique::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDSXSetParentUnique(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDSXSetParentUnique::load(CFRecord& record)
|
||||
{
|
||||
record >> stHierUnique;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDUserCaption::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDUserCaption(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDUserCaption::load(CFRecord& record)
|
||||
{
|
||||
record >> stCaption;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDMeasureGrp::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDMeasureGrp(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDMeasureGrp::load(CFRecord& record)
|
||||
{
|
||||
record >> stMeasureGroup;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDDisplayFolder::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDDisplayFolder(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDDisplayFolder::load(CFRecord& record)
|
||||
{
|
||||
record >> stDisplayFolder;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDParentKPI::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDParentKPI(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDParentKPI::load(CFRecord& record)
|
||||
{
|
||||
record >> stParentKPI;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDKPIValue::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIValue(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDKPIValue::load(CFRecord& record)
|
||||
{
|
||||
record >> stKPIValue;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDKPIGoal::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIGoal(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDKPIGoal::load(CFRecord& record)
|
||||
{
|
||||
record >> stKPIGoal;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDKPIStatus::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIStatus(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDKPIStatus::load(CFRecord& record)
|
||||
{
|
||||
record >> stKPIStatus;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDKPITime::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPITime(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDKPITime::load(CFRecord& record)
|
||||
{
|
||||
record >> stKPITime;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDKPIWeight::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPIWeight(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDKPIWeight::load(CFRecord& record)
|
||||
{
|
||||
record >> stKPIWeight;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDKPITrend::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDKPITrend(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDKPITrend::load(CFRecord& record)
|
||||
{
|
||||
record >> stKPITrend;
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
BiffStructurePtr SXAddl_SXCHierarchy_SXDInfo12::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAddl_SXCHierarchy_SXDInfo12(*this));
|
||||
}
|
||||
|
||||
void SXAddl_SXCHierarchy_SXDInfo12::load(CFRecord& record)
|
||||
{
|
||||
_UINT32 flags;
|
||||
short reserved2;
|
||||
|
||||
record >> flags >> reserved2;
|
||||
|
||||
fUnbalancedRealKnown = GETBIT(flags, 0);
|
||||
fUnbalancedReal = GETBIT(flags, 1);
|
||||
fUnbalancedGroupKnown = GETBIT(flags, 2);
|
||||
fUnbalancedGroup = GETBIT(flags, 3);
|
||||
fHidden = GETBIT(flags, 4);
|
||||
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -129,14 +129,14 @@ public:
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stName;
|
||||
};
|
||||
class SXAddl_SXCField_SXDEnd : public BiffStructure
|
||||
class SXAddl_Universal_End : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField_SXDEnd)
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_Universal_End)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField_SXDEnd(){}
|
||||
~SXAddl_SXCField_SXDEnd(){}
|
||||
SXAddl_Universal_End(){}
|
||||
~SXAddl_Universal_End(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
@ -173,18 +173,20 @@ public:
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stName;
|
||||
};
|
||||
class SXAddl_SXCView_SXDEnd : public BiffStructure
|
||||
class SXAddl_SXCView_SXDVerUpdInv : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCView_SXDEnd)
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCView_SXDVerUpdInv)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCView_SXDEnd(){}
|
||||
~SXAddl_SXCView_SXDEnd(){}
|
||||
SXAddl_SXCView_SXDVerUpdInv(){}
|
||||
~SXAddl_SXCView_SXDVerUpdInv(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
unsigned char dwVersionInvalidates;
|
||||
};
|
||||
class SXAddl_SXCView_SXDTableStyleClient : public BiffStructure
|
||||
{
|
||||
@ -208,19 +210,7 @@ public:
|
||||
|
||||
LPWideString stName;
|
||||
};
|
||||
class SXAddl_SXCAutoSort_SXDEnd : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCAutoSort_SXDEnd)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCAutoSort_SXDEnd(){}
|
||||
~SXAddl_SXCAutoSort_SXDEnd(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
};
|
||||
class SXAddl_SXCAutoSort_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCAutoSort_SXDId)
|
||||
@ -236,20 +226,6 @@ public:
|
||||
|
||||
bool fAscendSort;
|
||||
};
|
||||
class SXAddl_SXCCache_SXDEnd : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCCache_SXDEnd)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCCache_SXDEnd(){}
|
||||
~SXAddl_SXCCache_SXDEnd(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
SXAddl_SXCCache_SXDEnd(CFRecord& record);
|
||||
};
|
||||
|
||||
class SXAddl_SXCCache_SXDId : public BiffStructure
|
||||
{
|
||||
@ -369,19 +345,6 @@ public:
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stCaption;
|
||||
};
|
||||
class SXAddl_SXCCacheField_SXDEnd : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCCacheField_SXDEnd)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCCacheField_SXDEnd(){}
|
||||
~SXAddl_SXCCacheField_SXDEnd(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
};
|
||||
|
||||
class SXAddl_SXCCacheField_SXDId : public BiffStructure
|
||||
{
|
||||
@ -475,21 +438,6 @@ public:
|
||||
_UINT32 citm;
|
||||
};
|
||||
|
||||
class SXAddl_SXCCacheItem_SXDEnd : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCCacheItem_SXDEnd)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCCacheItem_SXDEnd(){}
|
||||
~SXAddl_SXCCacheItem_SXDEnd(){}
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
};
|
||||
|
||||
class SXAddl_SXCCacheItem_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCCacheItem_SXDId)
|
||||
@ -575,6 +523,519 @@ public:
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stName;
|
||||
};
|
||||
class SXAddl_SXCField12_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField12_SXDId)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField12_SXDId(){}
|
||||
~SXAddl_SXCField12_SXDId(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stName;
|
||||
};
|
||||
class SXAddl_SXCField12_SXDISXTH : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField12_SXDISXTH)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField12_SXDISXTH(){}
|
||||
~SXAddl_SXCField12_SXDISXTH(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 isxth;
|
||||
};
|
||||
class SXAddl_SXCField12_SXDVer12Info : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField12_SXDVer12Info)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField12_SXDVer12Info(){}
|
||||
~SXAddl_SXCField12_SXDVer12Info(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
bool fHiddenLvl;
|
||||
bool fUseMemPropCaption;
|
||||
bool fCompact;
|
||||
bool fNotAutoSortDft;
|
||||
bool fFilterInclusive;
|
||||
};
|
||||
class SXAddl_SXCField12_SXDVerUpdInv : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField12_SXDVerUpdInv)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField12_SXDVerUpdInv(){}
|
||||
~SXAddl_SXCField12_SXDVerUpdInv(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
unsigned char dwVersionInvalidates;
|
||||
};
|
||||
class SXAddl_SXCField12_SXDMemberCaption : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField12_SXDMemberCaption)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField12_SXDMemberCaption(){}
|
||||
~SXAddl_SXCField12_SXDMemberCaption(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stMemberPropertyCaptionUnique;
|
||||
};
|
||||
class SXAddl_SXCField12_SXDAutoshow : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCField12_SXDAutoshow)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCField12_SXDAutoshow(){}
|
||||
~SXAddl_SXCField12_SXDAutoshow(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 citmAutoShow;
|
||||
|
||||
};
|
||||
class SXAddl_SXCCacheItem_SXDSxrmitmDisp : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCCacheItem_SXDSxrmitmDisp)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCCacheItem_SXDSxrmitmDisp(){}
|
||||
~SXAddl_SXCCacheItem_SXDSxrmitmDisp(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stDisplay;
|
||||
};
|
||||
class SXAddl_SXCCacheItem_SXDItmMpropMap : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCCacheItem_SXDItmMpropMap)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCCacheItem_SXDItmMpropMap(){}
|
||||
~SXAddl_SXCCacheItem_SXDItmMpropMap(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
std::vector<_INT32> rgMemProps;
|
||||
};
|
||||
class SxAddl_SXCCacheItem_SXDItmMpMapCount : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SxAddl_SXCCacheItem_SXDItmMpMapCount)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SxAddl_SXCCacheItem_SXDItmMpMapCount(){}
|
||||
~SxAddl_SXCCacheItem_SXDItmMpMapCount(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 cMemProps;
|
||||
};
|
||||
class SXAddl_SXCSXDH_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCSXDH_SXDId)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCSXDH_SXDId(){}
|
||||
~SXAddl_SXCSXDH_SXDId(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 dwCount;
|
||||
};
|
||||
class SXAddl_SXCSXDH_SXDSxdh : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCSXDH_SXDSxdh)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCSXDH_SXDSxdh(){}
|
||||
~SXAddl_SXCSXDH_SXDSxdh(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_INT32 isxth;
|
||||
unsigned short cchDimensionName;
|
||||
unsigned short cchDimensionUnique;
|
||||
unsigned short cchDimensionCaption;
|
||||
|
||||
XLUnicodeStringNoCch stDimensionName;
|
||||
XLUnicodeStringNoCch stDimensionUnique;
|
||||
XLUnicodeStringNoCch stDimensionCaption;
|
||||
};
|
||||
class SXAddl_SXCSXMg_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCSXMg_SXDId)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCSXMg_SXDId(){}
|
||||
~SXAddl_SXCSXMg_SXDId(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stName;
|
||||
};
|
||||
class SXAddl_SXCSXMg_SXDUserCaption : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCSXMg_SXDUserCaption)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCSXMg_SXDUserCaption(){}
|
||||
~SXAddl_SXCSXMg_SXDUserCaption(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stUserCaption;
|
||||
};
|
||||
class SXAddl_SXCSXMgs_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCSXMgs_SXDId)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCSXMgs_SXDId(){}
|
||||
~SXAddl_SXCSXMgs_SXDId(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 cmgs;
|
||||
_UINT32 cmaps;
|
||||
};
|
||||
class SXAddl_SXCSXMgs_SXDMGrpSXDHMap : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCSXMgs_SXDMGrpSXDHMap)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCSXMgs_SXDMGrpSXDHMap(){}
|
||||
~SXAddl_SXCSXMgs_SXDMGrpSXDHMap(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 iKey;
|
||||
_UINT32 iVal;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDId : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDId)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDId(){}
|
||||
~SXAddl_SXCHierarchy_SXDId(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stHierUnq;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDVerUpdInv : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDVerUpdInv)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDVerUpdInv(){}
|
||||
~SXAddl_SXCHierarchy_SXDVerUpdInv(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
unsigned char dwVersionInvalidates;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDProperty : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDProperty)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDProperty(){}
|
||||
~SXAddl_SXCHierarchy_SXDProperty(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
bool fDisplayInReport;
|
||||
bool fDisplayInTip;
|
||||
bool fDisplayInCaption;
|
||||
|
||||
unsigned short cchProperty;
|
||||
XLUnicodeStringNoCch stProperty;
|
||||
|
||||
unsigned short cchLevelUnq;
|
||||
unsigned short ichPropName;
|
||||
unsigned short cchPropName;
|
||||
short isxtl;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDFilterMember : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDFilterMember)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDFilterMember(){}
|
||||
~SXAddl_SXCHierarchy_SXDFilterMember(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
bool fMultFiltHavePlex;
|
||||
unsigned short cItems;
|
||||
std::vector<std::wstring> rgStMembers;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDFilterMember12 : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDFilterMember12)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDFilterMember12(){}
|
||||
~SXAddl_SXCHierarchy_SXDFilterMember12(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
_UINT32 isxtl;
|
||||
unsigned short cItems;
|
||||
std::vector<std::wstring> rgStMembers;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDSXSetParentUnique : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDSXSetParentUnique)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDSXSetParentUnique(){}
|
||||
~SXAddl_SXCHierarchy_SXDSXSetParentUnique(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stHierUnique;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDUserCaption : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDUserCaption)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDUserCaption(){}
|
||||
~SXAddl_SXCHierarchy_SXDUserCaption(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stCaption;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDMeasureGrp : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDMeasureGrp)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDMeasureGrp(){}
|
||||
~SXAddl_SXCHierarchy_SXDMeasureGrp(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stMeasureGroup;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDDisplayFolder : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDDisplayFolder)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDDisplayFolder(){}
|
||||
~SXAddl_SXCHierarchy_SXDDisplayFolder(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stDisplayFolder;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDParentKPI : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDParentKPI)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDParentKPI(){}
|
||||
~SXAddl_SXCHierarchy_SXDParentKPI(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stParentKPI;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDKPIValue : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDKPIValue)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDKPIValue(){}
|
||||
~SXAddl_SXCHierarchy_SXDKPIValue(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stKPIValue;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDKPIGoal : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDKPIGoal)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDKPIGoal(){}
|
||||
~SXAddl_SXCHierarchy_SXDKPIGoal(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stKPIGoal;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDKPIStatus : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDKPIStatus)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDKPIStatus(){}
|
||||
~SXAddl_SXCHierarchy_SXDKPIStatus(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stKPIStatus;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDKPITrend : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDKPITrend)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDKPITrend(){}
|
||||
~SXAddl_SXCHierarchy_SXDKPITrend(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stKPITrend;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDKPIWeight : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDKPIWeight)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDKPIWeight(){}
|
||||
~SXAddl_SXCHierarchy_SXDKPIWeight(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stKPIWeight;
|
||||
};
|
||||
class SXAddl_SXCHierarchy_SXDKPITime : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDKPITime)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDKPITime(){}
|
||||
~SXAddl_SXCHierarchy_SXDKPITime(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
XLUnicodeStringSegmentedSXADDL stKPITime;
|
||||
};
|
||||
|
||||
class SXAddl_SXCHierarchy_SXDInfo12 : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAddl_SXCHierarchy_SXDInfo12)
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
SXAddl_SXCHierarchy_SXDInfo12(){}
|
||||
~SXAddl_SXCHierarchy_SXDInfo12(){}
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
bool fUnbalancedRealKnown;
|
||||
bool fUnbalancedReal;
|
||||
bool fUnbalancedGroupKnown;
|
||||
bool fUnbalancedGroup;
|
||||
bool fHidden;
|
||||
};
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
|
||||
@ -44,7 +44,6 @@ ScenarioProtect::~ScenarioProtect()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr ScenarioProtect::clone()
|
||||
{
|
||||
return BaseObjectPtr(new ScenarioProtect(*this));
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of ScenarioProtect record in BIFF8
|
||||
class ScenarioProtect: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(ScenarioProtect)
|
||||
@ -48,14 +46,12 @@ public:
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeScenarioProtect;
|
||||
|
||||
//-----------------------------
|
||||
Boolean<unsigned short> fScenProtect;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,17 +35,14 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
WsBool::WsBool(const bool is_dialog_sheet)
|
||||
: fDialog(is_dialog_sheet)
|
||||
WsBool::WsBool(bool & is_dialog_sheet) : fDialog(is_dialog_sheet)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
WsBool::~WsBool()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr WsBool::clone()
|
||||
{
|
||||
return BaseObjectPtr(new WsBool(*this));
|
||||
@ -56,16 +53,17 @@ void WsBool::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
record >> flags;
|
||||
|
||||
fShowAutoBreaks = GETBIT(flags, 0);
|
||||
fDialog = GETBIT(flags, 4);
|
||||
fApplyStyles = GETBIT(flags, 5);
|
||||
fRowSumsBelow = GETBIT(flags, 6);
|
||||
fColSumsRight = GETBIT(flags, 7);
|
||||
fFitToPage = GETBIT(flags, 8);
|
||||
fDspGuts = GETBIT(flags, 10);
|
||||
fSyncHoriz = GETBIT(flags, 12);
|
||||
fSyncVert = GETBIT(flags, 13);
|
||||
fAltExprEval = GETBIT(flags, 14);
|
||||
fDialog = GETBIT(flags, 4);
|
||||
fApplyStyles = GETBIT(flags, 5);
|
||||
fRowSumsBelow = GETBIT(flags, 6);
|
||||
fColSumsRight = GETBIT(flags, 7);
|
||||
fFitToPage = GETBIT(flags, 8);
|
||||
fDspGuts = GETBIT(flags, 10);
|
||||
fSyncHoriz = GETBIT(flags, 12);
|
||||
fSyncVert = GETBIT(flags, 13);
|
||||
fAltExprEval = GETBIT(flags, 14);
|
||||
fAltFormulaEntry = GETBIT(flags, 15);
|
||||
}
|
||||
|
||||
|
||||
@ -36,14 +36,12 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of WsBool record in BIFF8
|
||||
class WsBool: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(WsBool)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(WsBool)
|
||||
public:
|
||||
WsBool(const bool is_dialog_sheet);
|
||||
WsBool(bool & is_dialog_sheet);
|
||||
~WsBool();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
@ -53,17 +51,17 @@ public:
|
||||
static const ElementType type = typeWsBool;
|
||||
|
||||
//-----------------------------
|
||||
bool fShowAutoBreaks;
|
||||
bool fDialog;
|
||||
bool fApplyStyles;
|
||||
bool fRowSumsBelow;
|
||||
bool fColSumsRight;
|
||||
bool fFitToPage;
|
||||
bool fDspGuts;
|
||||
bool fSyncHoriz;
|
||||
bool fSyncVert;
|
||||
bool fAltExprEval;
|
||||
bool fAltFormulaEntry;
|
||||
bool fShowAutoBreaks;
|
||||
bool& fDialog;
|
||||
bool fApplyStyles;
|
||||
bool fRowSumsBelow;
|
||||
bool fColSumsRight;
|
||||
bool fFitToPage;
|
||||
bool fDspGuts;
|
||||
bool fSyncHoriz;
|
||||
bool fSyncVert;
|
||||
bool fAltExprEval;
|
||||
bool fAltFormulaEntry;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -88,9 +88,9 @@ void NoteSh::load(CFRecord& record)
|
||||
//-----------------------------------------------------------------------
|
||||
void NoteSh::calculate()
|
||||
{
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info & sheet_info = global_info->current_sheet >= 0 ?
|
||||
global_info->sheet_size_info[global_info->current_sheet - 1] : zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info->current_sheet >= 0 ?
|
||||
global_info->sheets_info[global_info->current_sheet - 1] : zero;
|
||||
|
||||
ref_ = CellRef(row, col, true, true).toString();
|
||||
|
||||
|
||||
@ -79,9 +79,9 @@ void OfficeArtClientAnchorSheet::calculate()
|
||||
{
|
||||
global_info->GetDigitFontSizePixels();
|
||||
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info & sheet_info = global_info->current_sheet >= 0 ?
|
||||
global_info->sheet_size_info[global_info->current_sheet - 1] : zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info->current_sheet >= 0 ?
|
||||
global_info->sheets_info[global_info->current_sheet - 1] : zero;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
//1 inch = 72 point
|
||||
@ -134,9 +134,9 @@ void OfficeArtClientAnchorSheet::calculate_1()
|
||||
{
|
||||
global_info->GetDigitFontSizePixels();
|
||||
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info & sheet_info = global_info->current_sheet >= 0 ?
|
||||
global_info->sheet_size_info[global_info->current_sheet - 1] : zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info->current_sheet >= 0 ?
|
||||
global_info->sheets_info[global_info->current_sheet - 1] : zero;
|
||||
|
||||
double kfRow = ( 360000 * 2.54 / 72) / 256. ;
|
||||
double Digit_Width = global_info->defaultDigitFontSize.first;
|
||||
|
||||
@ -114,10 +114,22 @@ void PtgArea3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool f
|
||||
ixti = ixals;
|
||||
if (ixals == 0xffff)
|
||||
{
|
||||
std::wstring prefix = XMLSTUFF::xti_indexes2sheet_name(itabFirst, itabLast, global_info->sheets_names);
|
||||
if (!prefix.empty()) prefix += L"!";
|
||||
std::wstring strRange;
|
||||
if(-1 == itabFirst)
|
||||
{
|
||||
strRange = L"#REF";
|
||||
}
|
||||
else
|
||||
{
|
||||
strRange = XMLSTUFF::name2sheet_name(global_info->sheets_info[itabFirst].name, L"");
|
||||
if (itabFirst != itabLast)
|
||||
{
|
||||
strRange += std::wstring(L":") + XMLSTUFF::name2sheet_name(global_info->sheets_info[itabLast].name, L"");
|
||||
}
|
||||
}
|
||||
if (!strRange.empty()) strRange += L"!";
|
||||
|
||||
ptg_stack.push(prefix + range_ref);
|
||||
ptg_stack.push(strRange + range_ref);
|
||||
}
|
||||
}
|
||||
if (ixti != 0xffff)
|
||||
|
||||
@ -109,10 +109,22 @@ void PtgRef3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool fu
|
||||
ixti = ixals;
|
||||
if (ixals == 0xffff)
|
||||
{
|
||||
std::wstring prefix = XMLSTUFF::xti_indexes2sheet_name(itabFirst, itabLast, global_info->sheets_names);
|
||||
if (!prefix.empty()) prefix += L"!";
|
||||
std::wstring strRange;
|
||||
if(-1 == itabFirst)
|
||||
{
|
||||
strRange = L"#REF";
|
||||
}
|
||||
else
|
||||
{
|
||||
strRange = XMLSTUFF::name2sheet_name(global_info->sheets_info[itabFirst].name, L"");
|
||||
if (itabFirst != itabLast)
|
||||
{
|
||||
strRange += std::wstring(L":") + XMLSTUFF::name2sheet_name(global_info->sheets_info[itabLast].name, L"");
|
||||
}
|
||||
}
|
||||
if (!strRange.empty()) strRange += L"!";
|
||||
|
||||
ptg_stack.push(prefix + cell_ref);
|
||||
ptg_stack.push(strRange + cell_ref);
|
||||
}
|
||||
}
|
||||
if (ixti != 0xffff)
|
||||
|
||||
@ -31,10 +31,8 @@
|
||||
*/
|
||||
|
||||
#include "AI.h"
|
||||
#include <Logic/Biff_records/BRAI.h>
|
||||
#include <Logic/Biff_records/SeriesText.h>
|
||||
|
||||
//#include <Logic/Biff_unions/PAGESETUP.h>
|
||||
#include "../Biff_records/BRAI.h"
|
||||
#include "../Biff_records/SeriesText.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -31,23 +31,22 @@
|
||||
*/
|
||||
|
||||
#include "ATTACHEDLABEL.h"
|
||||
#include <Logic/Biff_records/Text.h>
|
||||
#include <Logic/Biff_records/Begin.h>
|
||||
#include <Logic/Biff_records/Pos.h>
|
||||
#include <Logic/Biff_records/FontX.h>
|
||||
#include <Logic/Biff_records/AlRuns.h>
|
||||
#include <Logic/Biff_records/ObjectLink.h>
|
||||
#include <Logic/Biff_records/DataLabExtContents.h>
|
||||
#include <Logic/Biff_records/CrtLayout12.h>
|
||||
#include <Logic/Biff_records/End.h>
|
||||
#include <Logic/Biff_records/SeriesText.h>
|
||||
#include <Logic/Biff_records/Font.h>
|
||||
#include <Logic/Biff_records/FrtWrapper.h>
|
||||
#include "AI.h"
|
||||
#include "FRAME.h"
|
||||
#include "TEXTPROPS.h"
|
||||
#include "CRTMLFRT.h"
|
||||
|
||||
#include <Logic/Biff_unions/AI.h>
|
||||
#include <Logic/Biff_unions/FRAME.h>
|
||||
#include <Logic/Biff_unions/TEXTPROPS.h>
|
||||
#include <Logic/Biff_unions/CRTMLFRT.h>
|
||||
#include "../Biff_records/Text.h"
|
||||
#include "../Biff_records/Begin.h"
|
||||
#include "../Biff_records/Pos.h"
|
||||
#include "../Biff_records/FontX.h"
|
||||
#include "../Biff_records/AlRuns.h"
|
||||
#include "../Biff_records/ObjectLink.h"
|
||||
#include "../Biff_records/DataLabExtContents.h"
|
||||
#include "../Biff_records/CrtLayout12.h"
|
||||
#include "../Biff_records/End.h"
|
||||
#include "../Biff_records/SeriesText.h"
|
||||
#include "../Biff_records/Font.h"
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
@ -149,7 +148,7 @@ const bool ATTACHEDLABEL::loadContent(BinProcessor& proc)
|
||||
}
|
||||
|
||||
proc.optional<CRTMLFRT>();
|
||||
proc.optional<FrtWrapper>();
|
||||
|
||||
proc.mandatory<End>(); elements_.pop_back();
|
||||
|
||||
return true;
|
||||
|
||||
@ -145,6 +145,7 @@ int AUTOFILTER::serialize(std::wostream & stream)
|
||||
if (it == pGlobalWorkbookInfoPtr->mapDefineNames.end()) return 0;
|
||||
|
||||
int count_columns = info->cEntries;
|
||||
|
||||
size_t ind = pGlobalWorkbookInfoPtr->current_sheet;
|
||||
std::wstring ref;
|
||||
|
||||
@ -159,7 +160,7 @@ int AUTOFILTER::serialize(std::wostream & stream)
|
||||
}
|
||||
if (ref.empty()) return 0;
|
||||
|
||||
std::wstring sheet_name = ind <= pGlobalWorkbookInfoPtr->sheets_names.size() ? pGlobalWorkbookInfoPtr->sheets_names[ind-1] : L"";
|
||||
std::wstring sheet_name = ind <= pGlobalWorkbookInfoPtr->sheets_info.size() ? pGlobalWorkbookInfoPtr->sheets_info[ind-1].name : L"";
|
||||
if (!sheet_name.empty())
|
||||
{
|
||||
int pos = ref.find(sheet_name);
|
||||
|
||||
@ -69,7 +69,7 @@ const bool AXISPARENT::loadContent(BinProcessor& proc)
|
||||
m_AxisParent = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
proc.mandatory<Begin>(); elements_.pop_back();
|
||||
if (proc.optional<Begin>()) elements_.pop_back();
|
||||
|
||||
if (proc.optional<Pos>())
|
||||
{
|
||||
@ -93,7 +93,7 @@ const bool AXISPARENT::loadContent(BinProcessor& proc)
|
||||
count--;
|
||||
}
|
||||
|
||||
if (proc.mandatory<End>()) elements_.pop_back();
|
||||
if (proc.optional<End>()) elements_.pop_back();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -31,11 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "AXM.h"
|
||||
#include <Logic/Biff_records/YMult.h>
|
||||
#include <Logic/Biff_records/StartObject.h>
|
||||
#include <Logic/Biff_unions/ATTACHEDLABEL.h>
|
||||
#include <Logic/Biff_records/EndObject.h>
|
||||
#include <Logic/Biff_records/FrtWrapper.h>
|
||||
#include "ATTACHEDLABEL.h"
|
||||
|
||||
#include "../Biff_records/YMult.h"
|
||||
#include "../Biff_records/StartObject.h"
|
||||
#include "../Biff_records/EndObject.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -68,7 +68,6 @@ const bool AXM::loadContent(BinProcessor& proc)
|
||||
|
||||
if (proc.optional<StartObject>()) elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<FrtWrapper>(0,0);
|
||||
if (proc.optional<ATTACHEDLABEL>())
|
||||
{
|
||||
m_ATTACHEDLABEL = elements_.back(); elements_.pop_back();
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of BIGNAME union of records
|
||||
class BIGNAME: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(BIGNAME)
|
||||
@ -49,6 +47,7 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
BaseObjectPtr m_BigName;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,29 +31,25 @@
|
||||
*/
|
||||
|
||||
#include "BIGNAME.h"
|
||||
#include <Logic/Biff_records/BigName.h>
|
||||
#include <Logic/Biff_records/ContinueBigName.h>
|
||||
|
||||
#include "../Biff_records/BigName.h"
|
||||
#include "../Biff_records/ContinueBigName.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
BIGNAME::BIGNAME()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BIGNAME::~BIGNAME()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr BIGNAME::clone()
|
||||
{
|
||||
return BaseObjectPtr(new BIGNAME(*this));
|
||||
}
|
||||
|
||||
|
||||
// BIGNAME = BigName *ContinueBigName
|
||||
const bool BIGNAME::loadContent(BinProcessor& proc)
|
||||
{
|
||||
@ -61,7 +57,10 @@ const bool BIGNAME::loadContent(BinProcessor& proc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
proc.repeated<ContinueBigName>(0, 0);
|
||||
m_BigName = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
int count = proc.repeated<ContinueBigName>(0, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -61,9 +61,9 @@ public:
|
||||
{
|
||||
global_info_ = proc.getGlobalWorkbookInfo();
|
||||
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info & sheet_info = global_info_->current_sheet >=0 ?
|
||||
global_info_->sheet_size_info[global_info_->current_sheet - 1] : zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info_->current_sheet >=0 ?
|
||||
global_info_->sheets_info[global_info_->current_sheet - 1] : zero;
|
||||
|
||||
int count, count_row = 0;
|
||||
|
||||
@ -175,9 +175,9 @@ struct _CompareColumnCell
|
||||
|
||||
int CELL_GROUP::serialize(std::wostream & stream)
|
||||
{
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_size_info & sheet_info = global_info_->current_sheet >=0 ?
|
||||
global_info_->sheet_size_info[global_info_->current_sheet - 1] : zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info zero;
|
||||
XLS::GlobalWorkbookInfo::_sheet_info & sheet_info = global_info_->current_sheet >=0 ?
|
||||
global_info_->sheets_info[global_info_->current_sheet - 1] : zero;
|
||||
|
||||
CP_XML_WRITER(stream)
|
||||
{
|
||||
|
||||
@ -57,8 +57,8 @@
|
||||
#include "../Biff_records/EndObject.h"
|
||||
#include "../Biff_records/End.h"
|
||||
#include "../Biff_records/ObjectLink.h"
|
||||
#include "../Biff_records/FrtWrapper.h"
|
||||
#include "../Biff_records/TextPropsStream.h"
|
||||
#include "../Biff_records/FrtFontList.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -86,7 +86,10 @@ public:
|
||||
|
||||
const bool loadContent(BinProcessor& proc)
|
||||
{
|
||||
if(proc.optional<DataLabExt>())
|
||||
bool bData = proc.optional<DataLabExt>();
|
||||
bool bFont = proc.optional<FrtFontList>();
|
||||
|
||||
if(bFont || bData)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@ -254,11 +257,8 @@ const bool CHARTFORMATS::loadContent(BinProcessor& proc)
|
||||
cf.attachedLABEL = NULL;
|
||||
}
|
||||
cf.dataLabExt = elements_.front();
|
||||
elements_.pop_front();
|
||||
count--;
|
||||
continue;
|
||||
}
|
||||
if ("ATTACHEDLABEL" == elements_.front()->getClassName())
|
||||
else if ("ATTACHEDLABEL" == elements_.front()->getClassName())
|
||||
{//обязат
|
||||
if (cf.attachedLABEL)
|
||||
{
|
||||
@ -266,10 +266,12 @@ const bool CHARTFORMATS::loadContent(BinProcessor& proc)
|
||||
cf.dataLabExt = NULL;
|
||||
}
|
||||
cf.attachedLABEL = elements_.front();
|
||||
elements_.pop_front();
|
||||
count--;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
elements_.pop_front();
|
||||
count--;
|
||||
}
|
||||
if (proc.optional<TEXTPROPS>())
|
||||
{
|
||||
|
||||
@ -56,7 +56,8 @@ const bool CHART::loadContent(BinProcessor& proc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!proc.mandatory<ChartSheetSubstream>())
|
||||
ChartSheetSubstream chart_sheet(-1);
|
||||
if(!proc.mandatory(chart_sheet))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -77,10 +77,10 @@ const bool COLUMNS::loadContent(BinProcessor& proc)
|
||||
|
||||
for (int i = column_info->colFirst; i <= column_info->colLast; i++)
|
||||
{
|
||||
global_info_->sheet_size_info.back().customColumnsWidth.insert(std::make_pair(i, column_info->coldx / 256.));
|
||||
global_info_->sheets_info.back().customColumnsWidth.insert(std::make_pair(i, column_info->coldx / 256.));
|
||||
//else if (def_ok)
|
||||
//{
|
||||
// global_info_->sheet_size_info.back().customColumnsWidth.insert(std::make_pair(i, global_info_->sheet_size_info.back().defaultColumnWidth));
|
||||
// global_info_->sheets_info.back().customColumnsWidth.insert(std::make_pair(i, global_info_->sheets_info.back().defaultColumnWidth));
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of COLUMNS union of records
|
||||
class COLUMNS: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(COLUMNS)
|
||||
@ -51,7 +49,7 @@ public:
|
||||
|
||||
int serialize(std::wostream & stream);
|
||||
|
||||
static const ElementType type = typeCOLUMNS;
|
||||
static const ElementType type = typeCOLUMNS;
|
||||
|
||||
BaseObjectPtr m_DefColWidth;
|
||||
|
||||
|
||||
@ -31,43 +31,43 @@
|
||||
*/
|
||||
|
||||
#include "CRT.h"
|
||||
#include <Logic/Biff_records/ChartFormat.h>
|
||||
#include <Logic/Biff_records/Begin.h>
|
||||
#include <Logic/Biff_records/Bar.h>
|
||||
#include <Logic/Biff_records/Line.h>
|
||||
#include <Logic/Biff_records/BopPop.h>
|
||||
#include <Logic/Biff_records/BopPopCustom.h>
|
||||
#include <Logic/Biff_records/Pie.h>
|
||||
#include <Logic/Biff_records/Area.h>
|
||||
#include <Logic/Biff_records/Scatter.h>
|
||||
#include <Logic/Biff_records/Radar.h>
|
||||
#include <Logic/Biff_records/RadarArea.h>
|
||||
#include <Logic/Biff_records/Surf.h>
|
||||
#include <Logic/Biff_records/CrtLink.h>
|
||||
#include <Logic/Biff_records/SeriesList.h>
|
||||
#include <Logic/Biff_records/Chart3d.h>
|
||||
#include <Logic/Biff_unions/LD.h>
|
||||
#include <Logic/Biff_unions/DROPBAR.h>
|
||||
#include <Logic/Biff_records/CrtLine.h>
|
||||
#include <Logic/Biff_records/LineFormat.h>
|
||||
#include <Logic/Biff_unions/DFTTEXT.h>
|
||||
#include <Logic/Biff_records/DataLabExtContents.h>
|
||||
#include <Logic/Biff_unions/SS.h>
|
||||
#include <Logic/Biff_unions/SHAPEPROPS.h>
|
||||
#include <Logic/Biff_records/End.h>
|
||||
#include <Logic/Biff_records/ValueRange.h>
|
||||
#include <Logic/Biff_records/Tick.h>
|
||||
#include <Logic/Biff_records/FontX.h>
|
||||
#include <Logic/Biff_records/AxisLine.h>
|
||||
#include <Logic/Biff_records/LineFormat.h>
|
||||
#include <Logic/Biff_records/ShapePropsStream.h>
|
||||
#include <Logic/Biff_records/TextPropsStream.h>
|
||||
#include <Logic/Biff_records/PlotArea.h>
|
||||
#include <Logic/Biff_records/DropBar.h>
|
||||
#include <Logic/Biff_records/CrtMlFrt.h>
|
||||
#include "../Biff_records/ChartFormat.h"
|
||||
#include "../Biff_records/Begin.h"
|
||||
#include "../Biff_records/Bar.h"
|
||||
#include "../Biff_records/Line.h"
|
||||
#include "../Biff_records/BopPop.h"
|
||||
#include "../Biff_records/BopPopCustom.h"
|
||||
#include "../Biff_records/Pie.h"
|
||||
#include "../Biff_records/Area.h"
|
||||
#include "../Biff_records/Scatter.h"
|
||||
#include "../Biff_records/Radar.h"
|
||||
#include "../Biff_records/RadarArea.h"
|
||||
#include "../Biff_records/Surf.h"
|
||||
#include "../Biff_records/CrtLink.h"
|
||||
#include "../Biff_records/SeriesList.h"
|
||||
#include "../Biff_records/Chart3d.h"
|
||||
#include "../Biff_unions/LD.h"
|
||||
#include "../Biff_unions/DROPBAR.h"
|
||||
#include "../Biff_records/CrtLine.h"
|
||||
#include "../Biff_records/LineFormat.h"
|
||||
#include "../Biff_unions/DFTTEXT.h"
|
||||
#include "../Biff_records/DataLabExtContents.h"
|
||||
#include "../Biff_unions/SS.h"
|
||||
#include "../Biff_unions/SHAPEPROPS.h"
|
||||
#include "../Biff_records/End.h"
|
||||
#include "../Biff_records/ValueRange.h"
|
||||
#include "../Biff_records/Tick.h"
|
||||
#include "../Biff_records/FontX.h"
|
||||
#include "../Biff_records/AxisLine.h"
|
||||
#include "../Biff_records/LineFormat.h"
|
||||
#include "../Biff_records/ShapePropsStream.h"
|
||||
#include "../Biff_records/TextPropsStream.h"
|
||||
#include "../Biff_records/PlotArea.h"
|
||||
#include "../Biff_records/DropBar.h"
|
||||
#include "../Biff_records/CrtMlFrt.h"
|
||||
|
||||
#include <Logic/Biff_records/StartObject.h>
|
||||
#include <Logic/Biff_records/EndObject.h>
|
||||
#include "../Biff_records/StartObject.h"
|
||||
#include "../Biff_records/EndObject.h"
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -176,7 +176,8 @@ const bool CRT::loadContent(BinProcessor& proc)
|
||||
m_ChartFormat = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
proc.mandatory<Begin>(); elements_.pop_back();
|
||||
if (proc.optional<Begin>()) elements_.pop_back();
|
||||
|
||||
proc.mandatory<Parenthesis_CRT_1>();
|
||||
|
||||
m_ChartType = elements_.front();
|
||||
@ -196,7 +197,9 @@ const bool CRT::loadContent(BinProcessor& proc)
|
||||
}
|
||||
if (proc.optional<StartObject>())
|
||||
{
|
||||
proc.optional<EndObject>();
|
||||
elements_.pop_back();
|
||||
if (proc.optional<EndObject>())
|
||||
elements_.pop_back();
|
||||
}
|
||||
if (proc.optional<SeriesList>())
|
||||
{
|
||||
@ -252,6 +255,7 @@ const bool CRT::loadContent(BinProcessor& proc)
|
||||
m_DataLabExtContents = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
if (proc.optional<SS>())
|
||||
{
|
||||
m_SS = elements_.back();
|
||||
@ -268,7 +272,7 @@ const bool CRT::loadContent(BinProcessor& proc)
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
proc.mandatory<End>(); elements_.pop_back();
|
||||
if (proc.optional<End>()) elements_.pop_back();
|
||||
//-------------------------------------------------------------------------------------
|
||||
m_bIs3D = false;
|
||||
if (m_Chart3d)
|
||||
|
||||
@ -31,12 +31,13 @@
|
||||
*/
|
||||
|
||||
#include "DFTTEXT.h"
|
||||
#include <Logic/Biff_records/DataLabExt.h>
|
||||
#include <Logic/Biff_records/StartObject.h>
|
||||
#include <Logic/Biff_records/DefaultText.h>
|
||||
#include <Logic/Biff_records/EndObject.h>
|
||||
#include "ATTACHEDLABEL.h"
|
||||
|
||||
#include <Logic/Biff_unions/ATTACHEDLABEL.h>
|
||||
#include "../Biff_records/DataLabExt.h"
|
||||
#include "../Biff_records/DataLabExtContents.h"
|
||||
#include "../Biff_records/StartObject.h"
|
||||
#include "../Biff_records/DefaultText.h"
|
||||
#include "../Biff_records/EndObject.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -66,30 +67,32 @@ const bool DFTTEXT::loadContent(BinProcessor& proc)
|
||||
m_DataLabExt = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
proc.mandatory<StartObject>(); elements_.pop_back();
|
||||
if (proc.optional<StartObject>()) elements_.pop_back();
|
||||
|
||||
proc.mandatory<DefaultText>();
|
||||
|
||||
m_DefaultText = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
else
|
||||
|
||||
if(proc.mandatory<DefaultText>())
|
||||
{
|
||||
if(!proc.mandatory<DefaultText>())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_DefaultText = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
proc.mandatory<ATTACHEDLABEL>();
|
||||
m_ATTACHEDLABEL = elements_.back();
|
||||
elements_.pop_back();
|
||||
if (proc.optional<DataLabExtContents>())
|
||||
{
|
||||
m_DataLabExtContents = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
if (proc.mandatory<ATTACHEDLABEL>())
|
||||
{
|
||||
m_ATTACHEDLABEL = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
if (proc.optional<EndObject>()) elements_.pop_back();
|
||||
|
||||
return true;
|
||||
if (m_DefaultText || m_DataLabExtContents)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DFTTEXT union of records
|
||||
class DFTTEXT: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(DFTTEXT)
|
||||
@ -49,9 +47,11 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typeDFTTEXT;
|
||||
static const ElementType type = typeDFTTEXT;
|
||||
|
||||
BaseObjectPtr m_DefaultText;
|
||||
BaseObjectPtr m_DataLabExtContents;
|
||||
|
||||
BaseObjectPtr m_ATTACHEDLABEL;
|
||||
BaseObjectPtr m_DataLabExt;
|
||||
};
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of FEAT union of records
|
||||
class FEAT: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(FEAT)
|
||||
@ -49,7 +47,7 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typeFEAT;
|
||||
static const ElementType type = typeFEAT;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,12 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "FONTLIST.h"
|
||||
#include <Logic/Biff_records/FrtFontList.h>
|
||||
#include <Logic/Biff_records/StartObject.h>
|
||||
#include <Logic/Biff_records/Font.h>
|
||||
#include <Logic/Biff_records/Fbi.h>
|
||||
#include <Logic/Biff_records/EndObject.h>
|
||||
#include <Logic/Biff_records/FrtWrapper.h>
|
||||
#include "../Biff_records/FrtFontList.h"
|
||||
#include "../Biff_records/StartObject.h"
|
||||
#include "../Biff_records/Font.h"
|
||||
#include "../Biff_records/Fbi.h"
|
||||
#include "../Biff_records/EndObject.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -88,9 +87,9 @@ const bool FONTLIST::loadContent(BinProcessor& proc)
|
||||
return false;
|
||||
}
|
||||
proc.mandatory<StartObject>(); elements_.pop_back();
|
||||
|
||||
proc.repeated<Parenthesis_FONTLIST_1>(0, 0);
|
||||
|
||||
proc.optional<FrtWrapper>();
|
||||
proc.mandatory<EndObject>(); elements_.pop_back();
|
||||
|
||||
return true;
|
||||
|
||||
@ -31,34 +31,33 @@
|
||||
*/
|
||||
|
||||
#include "GLOBALS.h"
|
||||
#include <Logic/Biff_records/DefColWidth.h>
|
||||
#include <Logic/Biff_records/DxGCol.h>
|
||||
|
||||
#include <Logic/Biff_records/Protect.h>
|
||||
#include <Logic/Biff_records/CalcMode.h>
|
||||
#include <Logic/Biff_records/CalcCount.h>
|
||||
#include <Logic/Biff_records/CalcRefMode.h>
|
||||
#include <Logic/Biff_records/CalcIter.h>
|
||||
#include <Logic/Biff_records/CalcDelta.h>
|
||||
#include <Logic/Biff_records/CalcSaveRecalc.h>
|
||||
#include <Logic/Biff_records/PrintRowCol.h>
|
||||
#include <Logic/Biff_records/PrintGrid.h>
|
||||
#include <Logic/Biff_records/GridSet.h>
|
||||
#include <Logic/Biff_records/Guts.h>
|
||||
#include <Logic/Biff_records/DefaultRowHeight.h>
|
||||
#include <Logic/Biff_records/WsBool.h>
|
||||
#include <Logic/Biff_records/Sync.h>
|
||||
#include <Logic/Biff_records/LPr.h>
|
||||
#include <Logic/Biff_records/HorizontalPageBreaks.h>
|
||||
#include <Logic/Biff_records/VerticalPageBreaks.h>
|
||||
#include <Logic/Biff_records/Country.h>
|
||||
#include "../Biff_records/DefColWidth.h"
|
||||
#include "../Biff_records/DxGCol.h"
|
||||
#include "../Biff_records/Protect.h"
|
||||
#include "../Biff_records/CalcMode.h"
|
||||
#include "../Biff_records/CalcCount.h"
|
||||
#include "../Biff_records/CalcRefMode.h"
|
||||
#include "../Biff_records/CalcIter.h"
|
||||
#include "../Biff_records/CalcDelta.h"
|
||||
#include "../Biff_records/CalcSaveRecalc.h"
|
||||
#include "../Biff_records/PrintRowCol.h"
|
||||
#include "../Biff_records/PrintGrid.h"
|
||||
#include "../Biff_records/GridSet.h"
|
||||
#include "../Biff_records/Guts.h"
|
||||
#include "../Biff_records/DefaultRowHeight.h"
|
||||
#include "../Biff_records/WsBool.h"
|
||||
#include "../Biff_records/Sync.h"
|
||||
#include "../Biff_records/LPr.h"
|
||||
#include "../Biff_records/HorizontalPageBreaks.h"
|
||||
#include "../Biff_records/VerticalPageBreaks.h"
|
||||
#include "../Biff_records/Country.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
GLOBALS::GLOBALS(const bool is_dialog_sheet)
|
||||
: is_dialog(is_dialog_sheet)
|
||||
GLOBALS::GLOBALS() : is_dialog(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -40,12 +40,12 @@ class GLOBALS: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(GLOBALS)
|
||||
public:
|
||||
GLOBALS(const bool is_dialog_sheet);
|
||||
GLOBALS();
|
||||
~GLOBALS();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent (BinProcessor& proc);
|
||||
virtual const bool loadContent (BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typeGLOBALS;
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PIVOTADDL::PIVOTADDL() : current( &content)
|
||||
PIVOTADDL::PIVOTADDL() : current( &content), m_SXADDLCONDFMTS(NULL, -1), m_SXADDLSXFILTERS12(NULL, -1)
|
||||
{
|
||||
_sxAddl elm(NULL, 0);
|
||||
current->push_back(elm);
|
||||
@ -94,38 +94,51 @@ const bool PIVOTADDL::loadContent(BinProcessor& proc)
|
||||
|
||||
result = true;
|
||||
|
||||
if (addl->bEndElement)
|
||||
{
|
||||
elements_.pop_back();
|
||||
if (level == 0 && addl->bEndElement)
|
||||
{
|
||||
elements_.pop_back(); //end элемент не нужен в дальнейшем
|
||||
break;
|
||||
}
|
||||
else if (addl->bEndElement)
|
||||
{
|
||||
level--;
|
||||
std::vector<_sxAddl> *current_old = current;
|
||||
|
||||
_sxAddl & current_level = current->back();
|
||||
|
||||
current = current_level.prev;
|
||||
current_level.prev = NULL;
|
||||
|
||||
if (level == 0)
|
||||
break;
|
||||
else level--;
|
||||
{
|
||||
switch(addl->sxc)
|
||||
{
|
||||
case 0x01:
|
||||
case 0x17:
|
||||
m_arSXADDLFIELD.push_back(current_level); break;
|
||||
case 0x02: m_arSXADDLHIERARCHY.push_back(current_level); break;
|
||||
case 0x03: m_arSXADDLCALCMEMBER.push_back(current_level); break;
|
||||
case 0x1a: m_SXADDLCONDFMTS = current_level; break;
|
||||
case 0x1c: m_SXADDLSXFILTERS12 = current_level; break;
|
||||
}
|
||||
}
|
||||
|
||||
current = current->back().prev;
|
||||
elements_.pop_back(); //end элемент не нужен в дальнейшем
|
||||
continue;
|
||||
}
|
||||
if (level == 0)
|
||||
else if (level == 0)
|
||||
{
|
||||
SXAddl_SXCView_SXDId* p0 = dynamic_cast<SXAddl_SXCView_SXDId*>(addl->content.get());
|
||||
if (p0)
|
||||
switch(addl->sxd)
|
||||
{
|
||||
m_SXAddl_SXCView_SXDId = addl->content;
|
||||
case 0x00: m_SXAddl_SXCView_SXDId = addl->content; break;
|
||||
case 0x02: m_SXAddl_SXCView_SXDVer10Info = addl->content; break;
|
||||
case 0x19: m_SXAddl_SXCView_SXDVer12Info = addl->content; break;
|
||||
case 0x1E: m_SXAddl_SXCView_SXDTableStyleClient = addl->content; break;
|
||||
}
|
||||
SXAddl_SXCView_SXDTableStyleClient* p1 = dynamic_cast<SXAddl_SXCView_SXDTableStyleClient*>(addl->content.get());
|
||||
if (p1)
|
||||
if (addl->sxd == 0x00 || addl->sxd == 0x02 || addl->sxd == 0x19 || addl->sxd == 0x1e)
|
||||
{
|
||||
m_SXAddl_SXCView_SXDTableStyleClient = addl->content;
|
||||
}
|
||||
SXAddl_SXCView_SXDVer10Info* p2 = dynamic_cast<SXAddl_SXCView_SXDVer10Info*>(addl->content.get());
|
||||
if (p2)
|
||||
{
|
||||
m_SXAddl_SXCView_SXDVer10Info = addl->content;
|
||||
}
|
||||
SXAddl_SXCView_SXDVer12Info* p3 = dynamic_cast<SXAddl_SXCView_SXDVer12Info*>(addl->content.get());
|
||||
if (p3)
|
||||
{
|
||||
m_SXAddl_SXCView_SXDVer12Info = addl->content;
|
||||
elements_.pop_back();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,10 +36,10 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
|
||||
class PIVOTADDL: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PIVOTADDL)
|
||||
public:
|
||||
struct _sxAddl
|
||||
{
|
||||
_sxAddl(std::vector<_sxAddl> *p, int l) : prev(p), level (l) {}
|
||||
@ -48,10 +48,8 @@ class PIVOTADDL: public CompositeObject
|
||||
int level = 0;
|
||||
std::vector<BaseObjectPtr> elements;
|
||||
std::vector<_sxAddl> levels;
|
||||
};
|
||||
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PIVOTADDL)
|
||||
public:
|
||||
};
|
||||
|
||||
PIVOTADDL();
|
||||
~PIVOTADDL();
|
||||
|
||||
@ -72,6 +70,14 @@ public:
|
||||
std::vector<BiffStructurePtr> m_arSXAddl_SXCView_SXDVerUpdInv;
|
||||
std::vector<BiffStructurePtr> m_arSXAddl_SXCView_SXDSXPIIvmb;
|
||||
|
||||
std::vector<_sxAddl> m_arSXADDLHIERARCHY;
|
||||
std::vector<_sxAddl> m_arSXADDLFIELD;
|
||||
std::vector<_sxAddl> m_arSXADDLCALCMEMBER;
|
||||
|
||||
_sxAddl m_SXADDLCONDFMTS;
|
||||
_sxAddl m_SXADDLSXFILTERS12;
|
||||
|
||||
//others
|
||||
std::vector<_sxAddl> content;
|
||||
std::vector<_sxAddl> *current;
|
||||
|
||||
|
||||
@ -200,8 +200,10 @@ int PIVOTCACHEDEFINITION::serialize_definitions(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bOLAP)
|
||||
if (olap_view)
|
||||
{
|
||||
olap_view->m_PIVOTADDL = m_PIVOTADDL;
|
||||
|
||||
olap_view->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of PIVOTCACHEDEFINITION union of records
|
||||
class PIVOTCACHEDEFINITION: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PIVOTCACHEDEFINITION)
|
||||
@ -52,7 +50,7 @@ public:
|
||||
int serialize_definitions(std::wostream & stream);
|
||||
int serialize_records(std::wostream & stream);
|
||||
|
||||
static const ElementType type = typePIVOTCACHEDEFINITION;
|
||||
static const ElementType type = typePIVOTCACHEDEFINITION;
|
||||
|
||||
BaseObjectPtr m_SXStreamID;
|
||||
BaseObjectPtr m_SXVS;
|
||||
@ -60,7 +58,9 @@ public:
|
||||
BaseObjectPtr m_SXADDLCACHE;
|
||||
//--------------------------------------------------------------------------
|
||||
GlobalWorkbookInfoPtr global_info_;
|
||||
|
||||
BaseObjectPtr m_PIVOTVIEWEX;
|
||||
BaseObjectPtr m_PIVOTADDL;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -102,28 +102,33 @@ const bool PIVOTVIEW::loadContent(BinProcessor& proc)
|
||||
PIVOTCACHEDEFINITION* pivot_cache = dynamic_cast<PIVOTCACHEDEFINITION*>(global_info_->arPIVOTCACHEDEFINITION[view->iCache].get());
|
||||
if (pivot_cache)
|
||||
{
|
||||
SXStreamID *stream_id = dynamic_cast<SXStreamID*>(pivot_cache->m_SXStreamID.get());
|
||||
indexStream = stream_id->idStm;
|
||||
SXSRC* src = dynamic_cast<SXSRC*> (pivot_cache->m_SXSRC.get());
|
||||
SXStreamID * stream_id = dynamic_cast<SXStreamID*> (pivot_cache->m_SXStreamID.get());
|
||||
PIVOTFRT* frt = dynamic_cast<PIVOTFRT*> (m_PIVOTFRT.get());
|
||||
|
||||
if (m_PIVOTFRT && pivot_cache->m_SXSRC)
|
||||
indexStream = stream_id ? stream_id->idStm : -1;
|
||||
|
||||
if (frt && src)
|
||||
{
|
||||
SXSRC* src = dynamic_cast<SXSRC*>(pivot_cache->m_SXSRC.get());
|
||||
PIVOTFRT* frt = dynamic_cast<PIVOTFRT*>(m_PIVOTFRT.get());
|
||||
pivot_cache->m_PIVOTADDL = frt->m_PIVOTADDL;
|
||||
|
||||
PIVOTFRT9* frt9 = frt ? dynamic_cast<PIVOTFRT9*>(frt->m_PIVOTFRT9.get()) : NULL;
|
||||
|
||||
DBQUERY * db_query = dynamic_cast<DBQUERY*>(src->m_source.get());
|
||||
if (db_query && frt9)
|
||||
PIVOTFRT9* frt9 = dynamic_cast<PIVOTFRT9*>(frt->m_PIVOTFRT9.get());
|
||||
if (frt9)
|
||||
{
|
||||
QsiSXTag *qsiTag =dynamic_cast<QsiSXTag*>(frt9->m_QsiSXTag.get());
|
||||
if (qsiTag->fTensorEx)
|
||||
pivot_cache->m_PIVOTVIEWEX = frt9->m_PIVOTVIEWEX;
|
||||
|
||||
DBQUERY * db_query = dynamic_cast<DBQUERY*>(src->m_source.get());
|
||||
if (db_query)
|
||||
{
|
||||
//OLAP !!!
|
||||
src->bOLAP = true;
|
||||
core->bOLAP = true;
|
||||
QsiSXTag *qsiTag =dynamic_cast<QsiSXTag*>(frt9->m_QsiSXTag.get());
|
||||
if (qsiTag->fTensorEx)
|
||||
{
|
||||
//OLAP !!!
|
||||
src->bOLAP = true;
|
||||
core->bOLAP = true;
|
||||
}
|
||||
db_query->m_DBQUERYEXT = frt9->m_DBQUERYEXT;
|
||||
}
|
||||
db_query->m_DBQUERYEXT = frt9->m_DBQUERYEXT;
|
||||
pivot_cache->m_PIVOTVIEWEX = frt9->m_PIVOTVIEWEX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,11 +33,13 @@
|
||||
#include "PIVOTVIEWEX.h"
|
||||
#include "PIVOTTH.h"
|
||||
#include "PIVOTVDTEX.h"
|
||||
#include "PIVOTADDL.h"
|
||||
|
||||
#include "../Biff_records/SXTH.h"
|
||||
#include "../Biff_records/SXViewEx.h"
|
||||
#include "../Biff_records/SXPIEx.h"
|
||||
#include "../Biff_records/SXVDTEx.h"
|
||||
#include "../Biff_records/SXAddl.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -89,10 +91,14 @@ int PIVOTVIEWEX::serialize(std::wostream & strm)
|
||||
{
|
||||
if (m_arPIVOTTH.empty()) return 0;
|
||||
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapDimensions;
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapMeasures;
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapKpis;
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapNamed;
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapDimensions;
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapMeasures;
|
||||
std::unordered_map<std::wstring, int> mapKpis;
|
||||
std::unordered_map<std::wstring, std::vector<int>> mapNamed;
|
||||
|
||||
PIVOTADDL *addls = dynamic_cast<PIVOTADDL*>(m_PIVOTADDL.get());
|
||||
|
||||
bool bAddl = addls ? (addls->m_arSXADDLHIERARCHY.size() == m_arPIVOTTH.size()) : false;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -102,55 +108,70 @@ int PIVOTVIEWEX::serialize(std::wostream & strm)
|
||||
|
||||
for (size_t i = 0; i < m_arPIVOTTH.size(); i++)
|
||||
{
|
||||
PIVOTTH* ht = dynamic_cast<PIVOTTH*>(m_arPIVOTTH[i].get());
|
||||
SXTH* szTH = dynamic_cast<SXTH*>(ht->m_SXTH.get());
|
||||
PIVOTTH* th = dynamic_cast<PIVOTTH*>(m_arPIVOTTH[i].get());
|
||||
SXTH* sxTH = dynamic_cast<SXTH*>(th->m_SXTH.get());
|
||||
|
||||
if (szTH->fKPI)
|
||||
SXAddl_SXCHierarchy_SXDId *id = NULL;
|
||||
SXAddl_SXCHierarchy_SXDInfo12 *info12 = NULL;
|
||||
SXAddl_SXCHierarchy_SXDUserCaption *user_caption = NULL;
|
||||
SXAddl_SXCHierarchy_SXDMeasureGrp *measure_grp = NULL;
|
||||
|
||||
for (size_t j = 0; bAddl && j < addls->m_arSXADDLHIERARCHY[i].elements.size(); j++)
|
||||
{
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapKpis.find(szTH->stUnique.value());
|
||||
SXAddl * addl = dynamic_cast<SXAddl*>(addls->m_arSXADDLHIERARCHY[i].elements[j].get());
|
||||
if (!addl) continue;
|
||||
|
||||
if (!id) id = dynamic_cast<SXAddl_SXCHierarchy_SXDId*> (addl->content.get());
|
||||
if (!info12) info12 = dynamic_cast<SXAddl_SXCHierarchy_SXDInfo12*> (addl->content.get());
|
||||
if (!user_caption) user_caption = dynamic_cast<SXAddl_SXCHierarchy_SXDUserCaption*> (addl->content.get());
|
||||
if (!measure_grp) measure_grp = dynamic_cast<SXAddl_SXCHierarchy_SXDMeasureGrp*> (addl->content.get());
|
||||
}
|
||||
if (sxTH->fKPI)
|
||||
{
|
||||
std::unordered_map<std::wstring, int>::iterator pFind = mapKpis.find(sxTH->stUnique.value());
|
||||
if (pFind == mapKpis.end())
|
||||
{
|
||||
std::vector<int> v; v.push_back(i);
|
||||
mapKpis.insert(std::make_pair(szTH->stUnique.value(), v));
|
||||
//std::vector<int> v; v.push_back(i);
|
||||
mapKpis.insert(std::make_pair(sxTH->stUnique.value(), i/*v*/));
|
||||
}
|
||||
else
|
||||
{
|
||||
pFind->second.push_back(i);
|
||||
//pFind->second.push_back(i);
|
||||
}
|
||||
}
|
||||
else if (szTH->fMeasure && !szTH->fSet && !szTH->fKPI)
|
||||
else if (sxTH->fMeasure && !sxTH->fSet && !sxTH->fKPI && measure_grp)
|
||||
{
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapMeasures.find(szTH->stUnique.value());
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapMeasures.find(measure_grp->stMeasureGroup.string.value());
|
||||
if (pFind == mapMeasures.end())
|
||||
{
|
||||
std::vector<int> v; v.push_back(i);
|
||||
mapMeasures.insert(std::make_pair(szTH->stUnique.value(), v));
|
||||
mapMeasures.insert(std::make_pair(measure_grp->stMeasureGroup.string.value(), v));
|
||||
}
|
||||
else
|
||||
{
|
||||
pFind->second.push_back(i);
|
||||
}
|
||||
}
|
||||
else if (szTH->fSet && !szTH->fMeasure && !szTH->fKPI)
|
||||
else if (sxTH->fSet && !sxTH->fMeasure && !sxTH->fKPI)
|
||||
{
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapNamed.find(szTH->stUnique.value());
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapNamed.find(sxTH->stUnique.value());
|
||||
if (pFind == mapNamed.end())
|
||||
{
|
||||
std::vector<int> v; v.push_back(i);
|
||||
mapNamed.insert(std::make_pair(szTH->stUnique.value(), v));
|
||||
mapNamed.insert(std::make_pair(sxTH->stUnique.value(), v));
|
||||
}
|
||||
else
|
||||
{
|
||||
pFind->second.push_back(i);
|
||||
}
|
||||
}
|
||||
if (!szTH->stDimension.value().empty())
|
||||
if (!sxTH->stDimension.value().empty())
|
||||
{
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapDimensions.find(szTH->stDimension.value());
|
||||
std::unordered_map<std::wstring, std::vector<int>>::iterator pFind = mapDimensions.find(sxTH->stDimension.value());
|
||||
if (pFind == mapDimensions.end())
|
||||
{
|
||||
std::vector<int> v; v.push_back(i);
|
||||
mapDimensions.insert(std::make_pair(szTH->stDimension.value(), v));
|
||||
mapDimensions.insert(std::make_pair(sxTH->stDimension.value(), v));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -158,15 +179,100 @@ int PIVOTVIEWEX::serialize(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
szTH->serialize(CP_XML_STREAM());
|
||||
CP_XML_NODE(L"cacheHierarchy")
|
||||
{
|
||||
CP_XML_ATTR(L"uniqueName", sxTH->stUnique.value());
|
||||
|
||||
if (user_caption)
|
||||
{
|
||||
CP_XML_ATTR(L"caption", user_caption->stCaption.string.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_ATTR(L"caption", sxTH->stDisplay.value());
|
||||
}
|
||||
if (sxTH->fMeasure)
|
||||
{
|
||||
CP_XML_ATTR(L"measure", true);
|
||||
if (measure_grp)
|
||||
{
|
||||
CP_XML_ATTR(L"measureGroup", measure_grp->stMeasureGroup.string.value());
|
||||
}
|
||||
if (sxTH->cisxvd > 0)
|
||||
CP_XML_ATTR(L"oneField", sxTH->cisxvd);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (!sxTH->stDimension.value().empty())
|
||||
//{
|
||||
// CP_XML_ATTR(L"attribute", sxTH->fKeyAttributeHierarchy);
|
||||
// CP_XML_ATTR(L"keyAttribute", sxTH->fKeyAttributeHierarchy);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
CP_XML_ATTR(L"attribute", !sxTH->fKeyAttributeHierarchy);
|
||||
}
|
||||
//keyAttribute
|
||||
CP_XML_ATTR(L"defaultMemberUniqueName", sxTH->stDefault.value());
|
||||
CP_XML_ATTR(L"allUniqueName", sxTH->stAll.value());
|
||||
CP_XML_ATTR(L"dimensionUniqueName", sxTH->stDimension.value());
|
||||
|
||||
CP_XML_ATTR(L"count", 0);//levels in this hierarchy.
|
||||
|
||||
if (info12)
|
||||
{
|
||||
CP_XML_ATTR(L"unbalanced", info12->fUnbalancedReal);//??
|
||||
if (info12->fHidden)
|
||||
CP_XML_ATTR(L"hidden", info12->fHidden);
|
||||
}
|
||||
}
|
||||
|
||||
if (sxTH->cisxvd > 0)
|
||||
{
|
||||
CP_XML_NODE(L"fieldsUsage")
|
||||
{
|
||||
CP_XML_ATTR(L"count", sxTH->cisxvd);
|
||||
for (size_t i = 0; i < sxTH->rgisxvd.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"fieldUsage")
|
||||
{
|
||||
CP_XML_ATTR(L"x", sxTH->rgisxvd[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"kpis")
|
||||
{
|
||||
CP_XML_ATTR(L"count", mapKpis.size());
|
||||
|
||||
for (std::unordered_map<std::wstring, std::vector<int>>::iterator it = mapKpis.begin(); it != mapKpis.end(); it++)
|
||||
for (std::unordered_map<std::wstring, int>::iterator it = mapKpis.begin(); it != mapKpis.end(); it++)
|
||||
{
|
||||
SXAddl_SXCHierarchy_SXDKPIValue *value = NULL;
|
||||
SXAddl_SXCHierarchy_SXDKPIGoal *goal = NULL;
|
||||
SXAddl_SXCHierarchy_SXDKPIStatus *status = NULL;
|
||||
SXAddl_SXCHierarchy_SXDKPITrend *trend = NULL;
|
||||
SXAddl_SXCHierarchy_SXDKPIWeight *weight = NULL;
|
||||
SXAddl_SXCHierarchy_SXDKPITime *time = NULL;
|
||||
|
||||
PIVOTADDL::_sxAddl & tmp = addls->m_arSXADDLHIERARCHY[it->second];
|
||||
|
||||
for (size_t i = 0; bAddl && i < tmp.elements.size(); i++)
|
||||
{
|
||||
SXAddl * addl = dynamic_cast<SXAddl*>(tmp.elements[i].get());
|
||||
if (!addl) continue;
|
||||
|
||||
if (!value) value = dynamic_cast<SXAddl_SXCHierarchy_SXDKPIValue*> (addl->content.get());
|
||||
if (!goal) goal = dynamic_cast<SXAddl_SXCHierarchy_SXDKPIGoal*> (addl->content.get());
|
||||
if (!status) status = dynamic_cast<SXAddl_SXCHierarchy_SXDKPIStatus*> (addl->content.get());
|
||||
if (!trend) trend = dynamic_cast<SXAddl_SXCHierarchy_SXDKPITrend*> (addl->content.get());
|
||||
if (!weight) weight = dynamic_cast<SXAddl_SXCHierarchy_SXDKPIWeight*> (addl->content.get());
|
||||
if (!time) time = dynamic_cast<SXAddl_SXCHierarchy_SXDKPITime*> (addl->content.get());
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"kpi")
|
||||
{
|
||||
CP_XML_ATTR(L"uniqueName", it->first);
|
||||
@ -183,7 +289,18 @@ int PIVOTVIEWEX::serialize(std::wostream & strm)
|
||||
}
|
||||
CP_XML_NODE(L"dimensions")
|
||||
{
|
||||
CP_XML_ATTR(L"count", mapDimensions.size());
|
||||
CP_XML_ATTR(L"count", mapDimensions.size() + (mapMeasures.empty() ? 0 : 1));
|
||||
|
||||
if (!mapMeasures.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dimension")
|
||||
{
|
||||
CP_XML_ATTR(L"measure", L"1");
|
||||
CP_XML_ATTR(L"name", L"Measures");
|
||||
CP_XML_ATTR(L"uniqueName", L"[Measures]");
|
||||
CP_XML_ATTR(L"caption", L"Measures");
|
||||
}
|
||||
}
|
||||
for (std::unordered_map<std::wstring, std::vector<int>>::iterator it = mapDimensions.begin(); it != mapDimensions.end(); it++)
|
||||
{
|
||||
CP_XML_NODE(L"dimension")
|
||||
@ -191,34 +308,49 @@ int PIVOTVIEWEX::serialize(std::wostream & strm)
|
||||
CP_XML_ATTR(L"name", it->first.substr(1, it->first.length() - 2));
|
||||
CP_XML_ATTR(L"uniqueName", it->first);
|
||||
|
||||
//if (szTH->fMeasure)
|
||||
//if (sxTH->fMeasure)
|
||||
// CP_XML_ATTR(L"measure", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
int count_maps = 0;
|
||||
CP_XML_NODE(L"measureGroups")
|
||||
{
|
||||
CP_XML_ATTR(L"count", mapMeasures.size());
|
||||
for (std::unordered_map<std::wstring, std::vector<int>>::iterator it = mapMeasures.begin(); it != mapMeasures.end(); it++)
|
||||
{
|
||||
CP_XML_ATTR(L"name", it->first.substr(1, it->first.length() - 2));
|
||||
CP_XML_NODE(L"measureGroup")
|
||||
{
|
||||
CP_XML_ATTR(L"name", it->first);
|
||||
CP_XML_ATTR(L"caption", it->first);
|
||||
}
|
||||
//if (it->second.size() > 1)
|
||||
// count_maps += mapDimensions;
|
||||
//else
|
||||
// count_maps += 1;
|
||||
count_maps += it->second.size();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"maps")
|
||||
{
|
||||
int i = 0;
|
||||
CP_XML_ATTR(L"count", count_maps);
|
||||
for (std::unordered_map<std::wstring, std::vector<int>>::iterator it = mapMeasures.begin(); it != mapMeasures.end(); it++, i++)
|
||||
{
|
||||
for (size_t j = 0; j < it->second.size(); j++)
|
||||
{
|
||||
CP_XML_NODE(L"map")
|
||||
{
|
||||
CP_XML_ATTR(L"measureGroup", i);
|
||||
|
||||
PIVOTTH* th = dynamic_cast<PIVOTTH*>(m_arPIVOTTH[it->second[j]].get());
|
||||
SXTH* sxTH = dynamic_cast<SXTH*>(th->m_SXTH.get());
|
||||
|
||||
CP_XML_ATTR(L"dimension", j + 1/*it->first*/);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//CP_XML_ATTR(L"count", m_arPIVOTVDTEX.size());
|
||||
//for (size_t i = 0; i < m_arPIVOTVDTEX.size(); i++)
|
||||
//{
|
||||
// PIVOTVDTEX *VDTEX = dynamic_cast<PIVOTVDTEX*>(m_arPIVOTVDTEX[i].get());
|
||||
// SXVDTEx *ex = dynamic_cast<SXVDTEx*>(VDTEX->m_SXVDTEx.get());
|
||||
//
|
||||
// PIVOTTH* ht = dynamic_cast<PIVOTTH*>(m_arPIVOTTH[ex->isxth].get());
|
||||
// SXTH* szTH = dynamic_cast<SXTH*>(ht->m_SXTH.get());
|
||||
//
|
||||
// CP_XML_NODE(L"measureGroup")
|
||||
// {
|
||||
// CP_XML_ATTR(L"name", szTH->stDimension.value());
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -54,6 +54,8 @@ public:
|
||||
std::vector<BaseObjectPtr> m_arPIVOTTH;
|
||||
std::vector<BaseObjectPtr> m_arSXPIEx;
|
||||
std::vector<BaseObjectPtr> m_arPIVOTVDTEX;
|
||||
//-------------------------------------------------------------
|
||||
BaseObjectPtr m_PIVOTADDL;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,11 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "PROTECTION.h"
|
||||
#include <Logic/Biff_records/WinProtect.h>
|
||||
#include <Logic/Biff_records/Protect.h>
|
||||
#include <Logic/Biff_records/Password.h>
|
||||
#include <Logic/Biff_records/Prot4Rev.h>
|
||||
#include <Logic/Biff_records/Prot4RevPass.h>
|
||||
|
||||
#include "../Biff_records/WinProtect.h"
|
||||
#include "../Biff_records/Protect.h"
|
||||
#include "../Biff_records/Password.h"
|
||||
#include "../Biff_records/Prot4Rev.h"
|
||||
#include "../Biff_records/Prot4RevPass.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -85,7 +86,7 @@ const bool PROTECTION::loadContent(BinProcessor& proc)
|
||||
m_Prot4RevPass = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
return true;
|
||||
return m_WinProtect || m_Protect || m_Password;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of PROTECTION union of records
|
||||
class PROTECTION: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PROTECTION)
|
||||
@ -49,7 +47,7 @@ public:
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
|
||||
static const ElementType type = typePROTECTION;
|
||||
static const ElementType type = typePROTECTION;
|
||||
|
||||
BaseObjectPtr m_WinProtect;
|
||||
BaseObjectPtr m_Protect;
|
||||
|
||||
@ -31,25 +31,23 @@
|
||||
*/
|
||||
|
||||
#include "PROTECTION_COMMON.h"
|
||||
#include <Logic/Biff_records/Protect.h>
|
||||
#include <Logic/Biff_records/ScenarioProtect.h>
|
||||
#include <Logic/Biff_records/ObjProtect.h>
|
||||
#include <Logic/Biff_records/Password.h>
|
||||
|
||||
#include "../Biff_records/Protect.h"
|
||||
#include "../Biff_records/ScenarioProtect.h"
|
||||
#include "../Biff_records/ObjProtect.h"
|
||||
#include "../Biff_records/Password.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
PROTECTION_COMMON::PROTECTION_COMMON()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
PROTECTION_COMMON::~PROTECTION_COMMON()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr PROTECTION_COMMON::clone()
|
||||
{
|
||||
return BaseObjectPtr(new PROTECTION_COMMON(*this));
|
||||
@ -59,12 +57,58 @@ BaseObjectPtr PROTECTION_COMMON::clone()
|
||||
// PROTECTION_COMMON = [Protect] [ScenarioProtect] [ObjProtect] [Password]
|
||||
const bool PROTECTION_COMMON::loadContent(BinProcessor& proc)
|
||||
{
|
||||
bool res1 = proc.optional<Protect>();
|
||||
bool res2 = proc.optional<ScenarioProtect>();
|
||||
bool res3 = proc.optional<ObjProtect>();
|
||||
bool res4 = proc.optional<Password>();
|
||||
if (proc.optional<Protect>())
|
||||
{
|
||||
m_Protect = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
if (proc.optional<ScenarioProtect>())
|
||||
{
|
||||
m_ScenarioProtect = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
if (proc.optional<ObjProtect>())
|
||||
{
|
||||
m_ObjProtect = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
if (proc.optional<Password>())
|
||||
{
|
||||
m_Password = elements_.back();
|
||||
elements_.pop_back();
|
||||
}
|
||||
|
||||
return res1 || res2 || res3 || res4;
|
||||
return m_Protect || m_ScenarioProtect || m_ObjProtect || m_Password;
|
||||
}
|
||||
|
||||
int PROTECTION_COMMON::serialize (std::wostream & _stream)
|
||||
{
|
||||
Protect *protect = dynamic_cast<Protect*> (m_Protect.get());
|
||||
Password *password = dynamic_cast<Password*> (m_Password.get());
|
||||
ScenarioProtect *scenario = dynamic_cast<ScenarioProtect*>(m_ScenarioProtect.get());
|
||||
ObjProtect *object = dynamic_cast<ObjProtect*> (m_ObjProtect.get());
|
||||
|
||||
CP_XML_WRITER(_stream)
|
||||
{
|
||||
CP_XML_NODE(L"sheetProtection")
|
||||
{
|
||||
if (protect)
|
||||
{
|
||||
CP_XML_ATTR(L"sheet", (protect->fLock ? 1 : 0));
|
||||
}
|
||||
if (object)
|
||||
{
|
||||
CP_XML_ATTR(L"objects", (object->fLockObj ? 1 : 0));
|
||||
}
|
||||
if (scenario)
|
||||
{
|
||||
CP_XML_ATTR(L"scenarios", (scenario->fScenProtect ? 1 : 0));
|
||||
}
|
||||
CP_XML_ATTR(L"selectLockedCells", 1);
|
||||
}
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,8 +36,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of PROTECTION_COMMON union of records
|
||||
class PROTECTION_COMMON: public CompositeObject
|
||||
{
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(PROTECTION)
|
||||
@ -48,8 +46,14 @@ public:
|
||||
BaseObjectPtr clone();
|
||||
|
||||
virtual const bool loadContent(BinProcessor& proc);
|
||||
int serialize (std::wostream & _stream);
|
||||
|
||||
static const ElementType type = typePROTECTION_COMMON;
|
||||
static const ElementType type = typePROTECTION_COMMON;
|
||||
|
||||
BaseObjectPtr m_Protect;
|
||||
BaseObjectPtr m_ScenarioProtect;
|
||||
BaseObjectPtr m_ObjProtect;
|
||||
BaseObjectPtr m_Password;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -31,12 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "RECORD12.h"
|
||||
#include <Logic/Biff_records/HeaderFooter.h>
|
||||
#include "../Biff_records/HeaderFooter.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
RECORD12::RECORD12()
|
||||
{
|
||||
}
|
||||
@ -60,6 +59,9 @@ const bool RECORD12::loadContent(BinProcessor& proc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_HeaderFooter = elements_.back();
|
||||
elements_.pop_back();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user