mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-11 02:16:02 +08:00
Compare commits
84 Commits
core/devel
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| b19191b286 | |||
| 77f8ab6875 | |||
| 6fc6f9ead3 | |||
| 270c1fa2ac | |||
| f76a03fab8 | |||
| 09e6d3f760 | |||
| 90d8055bcb | |||
| 01ba3b4182 | |||
| ddb67584b8 | |||
| 38ce5586bb | |||
| f6d9ce83f0 | |||
| 03edd40850 | |||
| 9ff87b3c6b | |||
| 645cbef1ef | |||
| 02238f7eea | |||
| 907e00a3ac | |||
| 2470bfd335 | |||
| 3ae52bd221 | |||
| 227d4f18d6 | |||
| 36bdbad685 | |||
| 525b828540 | |||
| f64ee80a1a | |||
| f6402813c4 | |||
| 224ac7d6e2 | |||
| 2e2bd8989d | |||
| 8f434efb95 | |||
| 244dafb02b | |||
| 149a1bdbd5 | |||
| a79d9041bc | |||
| 3954c42602 | |||
| 29dc0aee32 | |||
| d805972d6d | |||
| 549d5a46a6 | |||
| 9e867be756 | |||
| 771bf2d55c | |||
| 3c58cd96fc | |||
| e50864fa98 | |||
| c8c0924c74 | |||
| af732e4e85 | |||
| 47ffdae8cc | |||
| fd5870083b | |||
| 5ba62cb25d | |||
| 79e0588544 | |||
| a3d08cfc35 | |||
| 5caccb284a | |||
| ce19969b52 | |||
| 0f91dc392e | |||
| e9805cef30 | |||
| e3e05eb2db | |||
| c09f17cffb | |||
| ce73dd5987 | |||
| 77df8aacb9 | |||
| ce45b2802f | |||
| 7886018d6f | |||
| 5b5cb4188e | |||
| f797af5f17 | |||
| 055977535e | |||
| 6ab24f10f0 | |||
| 12a03da231 | |||
| cb7088979a | |||
| 1fb1fc6c97 | |||
| e633c3c5d1 | |||
| 0f04de34b1 | |||
| 3f8c2c293a | |||
| 2c97e743da | |||
| 2c83860c04 | |||
| c64b624de2 | |||
| 5e3990937d | |||
| 21744c1607 | |||
| 0892e2549f | |||
| cff6f305d4 | |||
| 5060071227 | |||
| d64109eaa4 | |||
| ec064bbd50 | |||
| baf952a151 | |||
| 0dd36c5e6a | |||
| 474404a8f9 | |||
| f2f6483b6f | |||
| c30161dbd0 | |||
| ec4f4fe476 | |||
| 634509ae28 | |||
| 1244048c50 | |||
| a62b69fb31 | |||
| 8197fb8900 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,6 +20,7 @@ Common/3dParty/v8/win_32
|
||||
Common/3dParty/v8/linux_64
|
||||
Common/3dParty/v8/linux_32
|
||||
Common/3dParty/v8/mac_64
|
||||
Common/3dParty/openssl/openssl
|
||||
**/core_build
|
||||
**/Release
|
||||
**/Debug
|
||||
|
||||
15
.travis.yml
15
.travis.yml
@ -1 +1,14 @@
|
||||
language: cpp
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- p7zip-full
|
||||
script:
|
||||
- exit 0
|
||||
# Build fails anyway. See explanation in
|
||||
# https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
|
||||
- cd Common/3dParty && ./make.sh
|
||||
- cd ../../
|
||||
- make
|
||||
@ -811,10 +811,10 @@ namespace DocFileFormat
|
||||
{
|
||||
Symbol s = getSymbol( chpx );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
//m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
//m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
//m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
//m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
else if ((TextMark::DrawnObject == code) && fSpec)
|
||||
{
|
||||
@ -1663,12 +1663,17 @@ namespace DocFileFormat
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
|
||||
|
||||
ret.FontName = ffn->xszFtn;
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );//-123 - ShortToFormattedWideString
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.HexValue.length() > 4)
|
||||
{
|
||||
ret.HexValue = ret.HexValue.substr(ret.HexValue.length() - 4, 4);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -178,7 +178,9 @@ namespace BinXlsxRW{
|
||||
{
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(lChartNumber) + L".xlsx";
|
||||
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
|
||||
|
||||
writeChartXlsx(sXlsxPath, oChartSpace);
|
||||
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
|
||||
|
||||
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
|
||||
long rId;
|
||||
|
||||
@ -307,6 +307,7 @@ namespace
|
||||
content << L"<w:" << Node << L"s \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
|
||||
@ -191,6 +191,12 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
}
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}//props выше legacyDrawing !!
|
||||
|
||||
if (impl_->commentsId_.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"legacyDrawing")
|
||||
@ -205,10 +211,7 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}
|
||||
|
||||
//CP_XML_NODE(L"headerFooter){}
|
||||
|
||||
//CP_XML_NODE(L"rowBreaks){}
|
||||
|
||||
@ -34,8 +34,6 @@
|
||||
#include "office_presentation.h"
|
||||
#include "draw_page.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
@ -76,9 +74,10 @@ void office_presentation::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.start_office_text();
|
||||
_CP_LOG << L"[info][docx] process pages (" << pages_.size() << L" elmements)" << std::endl;
|
||||
BOOST_FOREACH(const office_element_ptr & elm, pages_)
|
||||
{
|
||||
elm->docx_convert(Context);
|
||||
|
||||
for (size_t i = 0; i < pages_.size(); i++)
|
||||
{
|
||||
pages_[i]->docx_convert(Context);
|
||||
}
|
||||
Context.end_office_text();
|
||||
}
|
||||
@ -87,9 +86,10 @@ void office_presentation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.start_office_spreadsheet(this);
|
||||
_CP_LOG << L"[info][xlsx] process pages (" << pages_.size() << L" elmements)" << std::endl;
|
||||
BOOST_FOREACH(const office_element_ptr & elm, pages_)
|
||||
{
|
||||
elm->xlsx_convert(Context);
|
||||
|
||||
for (size_t i = 0; i < pages_.size(); i++)
|
||||
{
|
||||
pages_[i]->xlsx_convert(Context);
|
||||
}
|
||||
Context.end_office_spreadsheet();
|
||||
}
|
||||
@ -100,29 +100,29 @@ void office_presentation::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
_CP_LOG << L"[info][pptx] process pages(" << pages_.size() << L" elmements)" << std::endl;
|
||||
|
||||
BOOST_FOREACH(const office_element_ptr & elm, footer_decls_)
|
||||
for (size_t i = 0; i < footer_decls_.size(); i++)
|
||||
{
|
||||
presentation_footer_decl * style = dynamic_cast<presentation_footer_decl *>(elm.get());
|
||||
presentation_footer_decl * style = dynamic_cast<presentation_footer_decl *>(footer_decls_[i].get());
|
||||
|
||||
if (!style)
|
||||
continue;
|
||||
|
||||
std::wstring style_name_ = L"footer:" + style->presentation_name_.get_value_or(L"");
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, elm);
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, footer_decls_[i]);
|
||||
}
|
||||
BOOST_FOREACH(const office_element_ptr & elm, date_time_decls_)
|
||||
{
|
||||
presentation_date_time_decl * style = dynamic_cast<presentation_date_time_decl *>(elm.get());
|
||||
for (size_t i = 0; i < date_time_decls_.size(); i++)
|
||||
{
|
||||
presentation_date_time_decl * style = dynamic_cast<presentation_date_time_decl *>(date_time_decls_[i].get());
|
||||
|
||||
if (!style)
|
||||
continue;
|
||||
|
||||
std::wstring style_name_ = L"datetime:" + style->presentation_name_.get_value_or(L"");
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, elm);
|
||||
Context.root()->odf_context().drawStyles().add(style_name_, date_time_decls_[i]);
|
||||
}
|
||||
BOOST_FOREACH(const office_element_ptr & elm, pages_)
|
||||
for (size_t i = 0; i < pages_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
pages_[i]->pptx_convert(Context);
|
||||
}
|
||||
Context.end_office_presentation();
|
||||
}
|
||||
|
||||
@ -602,17 +602,24 @@ void OoxConverter::convert(PPTX::Logic::SpPr *oox_spPr, PPTX::Logic::ShapeStyle*
|
||||
|
||||
bool bLine = odf_context()->drawing_context()->isLineShape();
|
||||
|
||||
if (!bLine)
|
||||
if (custGeom && !custGeom->cxnLst.empty())
|
||||
bLine = true;
|
||||
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
{
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
if (bLine)
|
||||
{
|
||||
odf_context()->drawing_context()->set_no_fill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oox_spPr->Fill.is_init())
|
||||
convert(&oox_spPr->Fill);
|
||||
else if (oox_sp_style)
|
||||
convert(&oox_sp_style->fillRef, 1);
|
||||
}
|
||||
odf_context()->drawing_context()->end_area_properties();
|
||||
}
|
||||
odf_context()->drawing_context()->end_area_properties();
|
||||
|
||||
odf_context()->drawing_context()->start_line_properties();
|
||||
{
|
||||
|
||||
@ -72,6 +72,7 @@ using namespace cpdoccore;
|
||||
|
||||
namespace Oox2Odf
|
||||
{
|
||||
|
||||
PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback* CallBack)
|
||||
{
|
||||
current_clrMap = NULL;
|
||||
@ -342,7 +343,7 @@ void PptxConverter::convert_slides()
|
||||
current_slide = slide->Master.operator->();
|
||||
|
||||
if (bShowLayoutMasterSp && bShowMasterSp)
|
||||
convert_slide(&slide->Master->cSld, current_txStyles, false, true, 2);
|
||||
convert_slide(&slide->Master->cSld, current_txStyles, false, true, Master);
|
||||
else
|
||||
convert(slide->Master->cSld.bg.GetPointer());
|
||||
|
||||
@ -350,7 +351,7 @@ void PptxConverter::convert_slides()
|
||||
current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer();
|
||||
current_slide = slide->Layout.operator->();
|
||||
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, 3);
|
||||
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, Layout);
|
||||
|
||||
if (slide->Layout->transition.IsInit()) convert (slide->Layout->transition.GetPointer());
|
||||
else convert (slide->Master->transition.GetPointer());
|
||||
@ -402,7 +403,7 @@ void PptxConverter::convert_slides()
|
||||
odp_context->current_slide().set_master_page (master_style_name);
|
||||
odp_context->current_slide().set_layout_page (layout_style_name);
|
||||
|
||||
convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp, 1);
|
||||
convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp, Slide);
|
||||
convert (slide->comments.operator->());
|
||||
convert (slide->Note.operator->());
|
||||
|
||||
@ -435,7 +436,7 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
|
||||
|
||||
odf_context()->page_layout_context()->set_page_size(width, height);
|
||||
}
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, 2);
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, NotesMaster);
|
||||
|
||||
odp_context->end_note();
|
||||
|
||||
@ -468,7 +469,7 @@ void PptxConverter::convert(PPTX::NotesSlide *oox_notes)
|
||||
if (oox_notes->clrMapOvr.IsInit() && oox_notes->clrMapOvr->overrideClrMapping.IsInit())
|
||||
current_clrMap = oox_notes->clrMapOvr->overrideClrMapping.GetPointer();
|
||||
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, 1);
|
||||
convert_slide(&oox_notes->cSld, NULL, true, true, Notes);
|
||||
|
||||
odp_context->end_note();
|
||||
|
||||
@ -1312,13 +1313,19 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background)
|
||||
}
|
||||
odf_writer::style* page_style_ = dynamic_cast<odf_writer::style*>(odp_context->current_slide().page_style_elm_.get());
|
||||
odf_writer::style_drawing_page_properties* page_props = page_style_->content_.get_style_drawing_page_properties();
|
||||
|
||||
//необязательно
|
||||
//if (page_props->content_.common_draw_fill_attlist_.draw_fill_image_name_)
|
||||
//{
|
||||
// page_props->content_.draw_background_size_ = L"border";
|
||||
//}
|
||||
|
||||
odp_context->drawing_context()->end_drawing_background(page_props->content_.common_draw_fill_attlist_);
|
||||
|
||||
odp_context->end_drawings();
|
||||
}
|
||||
|
||||
void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, int type)
|
||||
void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, _typePages type)
|
||||
{
|
||||
if (oox_slide == NULL) return;
|
||||
|
||||
@ -1328,7 +1335,10 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
|
||||
if (oox_slide->attrName.IsInit())
|
||||
odp_context->current_slide().set_page_name(oox_slide->attrName.get());
|
||||
|
||||
convert(oox_slide->bg.GetPointer());
|
||||
if (type != Notes && type != NotesMaster)
|
||||
{
|
||||
convert(oox_slide->bg.GetPointer());
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < oox_slide->spTree.SpTreeElems.size(); i++)
|
||||
{
|
||||
@ -1348,7 +1358,7 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
|
||||
{
|
||||
int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode();
|
||||
|
||||
if (type == 3 && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
|
||||
if (type == Layout && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
|
||||
continue;
|
||||
|
||||
odf_context()->drawing_context()->set_placeholder_type(ph_type);
|
||||
|
||||
@ -100,6 +100,14 @@ using namespace cpdoccore;
|
||||
|
||||
namespace Oox2Odf
|
||||
{
|
||||
enum _typePages
|
||||
{
|
||||
Slide,
|
||||
Master,
|
||||
Layout,
|
||||
NotesMaster,
|
||||
Notes
|
||||
};
|
||||
class PptxConverter : public OoxConverter
|
||||
{
|
||||
public:
|
||||
@ -119,7 +127,7 @@ namespace Oox2Odf
|
||||
|
||||
void convert(OOX::WritingElement *oox_unknown);
|
||||
|
||||
void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, int type);
|
||||
void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, _typePages type);
|
||||
void convert_layout (PPTX::Logic::CSld *oox_slide);
|
||||
void convert (PPTX::Comments *oox_comments);
|
||||
void convert (PPTX::NotesSlide *oox_notes);
|
||||
|
||||
@ -186,6 +186,8 @@ namespace NSBinPptxRW
|
||||
#define SPTREE_TYPE_SPTREE 4
|
||||
#define SPTREE_TYPE_GRFRAME 5
|
||||
#define SPTREE_TYPE_OLE 6
|
||||
#define SPTREE_TYPE_VIDEO 7
|
||||
#define SPTREE_TYPE_AUDIO 8
|
||||
|
||||
static BYTE SchemeClr_GetBYTECode(const std::wstring& sValue)
|
||||
{
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/WritingElement.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
|
||||
|
||||
#include "../../Common/Base64.h"
|
||||
|
||||
@ -106,7 +108,7 @@ namespace NSBinPptxRW
|
||||
CreateFontPicker(NULL);
|
||||
}
|
||||
|
||||
CImageManager2::CImageManager2() : m_mapImages(), m_lIndexNextImage(0), m_lIndexNextOle(0)
|
||||
CImageManager2::CImageManager2() : m_mapImages(), m_lIndexNextImage(0), m_lIndexCounter(0)
|
||||
{
|
||||
m_nDocumentType = XMLWRITER_DOC_TYPE_PPTX;
|
||||
m_pContentTypes = new OOX::CContentTypes();
|
||||
@ -118,8 +120,8 @@ namespace NSBinPptxRW
|
||||
void CImageManager2::Clear()
|
||||
{
|
||||
m_mapImages.clear();
|
||||
m_lIndexNextImage = 1;
|
||||
m_lIndexNextOle = 1;
|
||||
m_lIndexNextImage = 0;
|
||||
m_lIndexCounter = 0;
|
||||
}
|
||||
void CImageManager2::SetDstMedia(const std::wstring& strDst)
|
||||
{
|
||||
@ -147,34 +149,50 @@ namespace NSBinPptxRW
|
||||
{
|
||||
if(nIndex1 + sFind1.length() < strInput.length())
|
||||
{
|
||||
wchar_t cRes = strInput[nIndex1 + sFind1.length()];
|
||||
if('1' <= cRes && cRes <= '6')
|
||||
wchar_t cRes1 = strInput[nIndex1 + sFind1.length()];
|
||||
if('1' <= cRes1 && cRes1 <= '9')
|
||||
{
|
||||
wchar_t cRes2 = strInput[nIndex1 + sFind1.length() + 1];
|
||||
|
||||
int nImageIndex = nIndex1 + (int)sFind1.length() + 1;
|
||||
if(nImageIndex == (int)strInput.find(_T("image"), nImageIndex))
|
||||
nRes = cRes - '0';
|
||||
if (std::wstring::npos != strInput.find(_T("image"), nImageIndex))
|
||||
{
|
||||
nRes = cRes1 - '0';
|
||||
if('0' <= cRes2 && cRes2 <= '9')
|
||||
{
|
||||
nRes = nRes * 10 + (cRes2 - '0');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return nRes;
|
||||
}
|
||||
_imageManager2Info CImageManager2::GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::OleObject> & oleFile, const std::wstring& oleData, std::wstring strBase64Image)
|
||||
_imageManager2Info CImageManager2::GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image)
|
||||
{
|
||||
if (IsNeedDownload(strInput))
|
||||
return DownloadImage(strInput);
|
||||
|
||||
std::map<std::wstring, _imageManager2Info>::const_iterator pPair = m_mapImages.find ((_T("") == strBase64Image) ? strInput : strBase64Image);
|
||||
std::map<std::wstring, _imageManager2Info>::const_iterator pPair = m_mapImages.find ((strBase64Image.empty()) ? strInput : strBase64Image);
|
||||
|
||||
if (pPair != m_mapImages.end())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
mediaFile->set_filename(pPair->second.sFilepathAdditional);
|
||||
|
||||
return pPair->second;
|
||||
}
|
||||
|
||||
std::wstring strExts = _T(".jpg");
|
||||
int nIndexExt = (int)strInput.rfind(wchar_t('.'));
|
||||
if (-1 != nIndexExt)
|
||||
strExts = strInput.substr(nIndexExt);
|
||||
|
||||
std::wstring strOleBin;
|
||||
int typeAdditional = 0;
|
||||
std::wstring strAdditional;
|
||||
std::wstring strImage = strInput;
|
||||
|
||||
int nDisplayType = IsDisplayedImage(strInput);
|
||||
@ -208,21 +226,52 @@ namespace NSBinPptxRW
|
||||
}
|
||||
if(0 != (nDisplayType & 4))
|
||||
{
|
||||
smart_ptr<OOX::OleObject> oleFile = additionalFile.smart_dynamic_cast<OOX::OleObject>();
|
||||
if (oleFile.IsInit())
|
||||
{
|
||||
if (OOX::CSystemUtility::IsFileExist(oleFile->filename()) == false)
|
||||
{
|
||||
typeAdditional = 1;
|
||||
|
||||
std::wstring strOle = strFolder + strFileName + oleFile->filename().GetExtention();
|
||||
if (OOX::CSystemUtility::IsFileExist(strOle))
|
||||
{
|
||||
m_pContentTypes->AddDefault(oleFile->filename().GetExtention(false));
|
||||
strOleBin = strOle;
|
||||
strAdditional = strOle;
|
||||
}
|
||||
else
|
||||
{
|
||||
strOle = strFolder + strFileName + L".bin";
|
||||
if (OOX::CSystemUtility::IsFileExist(strOle))
|
||||
strOleBin = strOle;
|
||||
strAdditional = strOle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(0 != (nDisplayType & 8))
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
{
|
||||
if (OOX::CSystemUtility::IsFileExist(mediaFile->filename()) == false)
|
||||
{
|
||||
typeAdditional = 2;
|
||||
|
||||
std::wstring strMedia = strFolder + strFileName + mediaFile->filename().GetExtention();
|
||||
if (OOX::CSystemUtility::IsFileExist(strMedia))
|
||||
{
|
||||
m_pContentTypes->AddDefault(mediaFile->filename().GetExtention(false));
|
||||
strAdditional = strMedia;
|
||||
}
|
||||
else
|
||||
{
|
||||
strMedia = strFolder + strFileName;
|
||||
|
||||
if (mediaFile.is<OOX::Audio>()) strMedia += L".wav";
|
||||
if (mediaFile.is<OOX::Video>()) strMedia += L".avi";
|
||||
|
||||
if (OOX::CSystemUtility::IsFileExist(strMedia))
|
||||
strAdditional = strMedia;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -233,10 +282,20 @@ namespace NSBinPptxRW
|
||||
m_pContentTypes->AddDefault(strExts.substr(1));
|
||||
}
|
||||
|
||||
_imageManager2Info oImageManagerInfo = GenerateImageExec(strImage, strExts, strOleBin, oleData);
|
||||
if (oleData.empty() == false)
|
||||
{
|
||||
//plugins data - generate ole
|
||||
typeAdditional = 1;
|
||||
}
|
||||
|
||||
if (!oImageManagerInfo.sFilepathOle.empty())
|
||||
oleFile->set_filename(oImageManagerInfo.sFilepathOle);
|
||||
_imageManager2Info oImageManagerInfo = GenerateImageExec(strImage, strExts, strAdditional, typeAdditional, oleData);
|
||||
|
||||
if (!oImageManagerInfo.sFilepathAdditional.empty())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
mediaFile->set_filename(oImageManagerInfo.sFilepathAdditional);
|
||||
}
|
||||
|
||||
if (strBase64Image.empty())
|
||||
m_mapImages[strInput] = oImageManagerInfo;
|
||||
@ -281,7 +340,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
return bRes;
|
||||
}
|
||||
_imageManager2Info CImageManager2::GenerateImageExec(const std::wstring& strInput, const std::wstring& sExts, const std::wstring& strOleImage, const std::wstring& oleData)
|
||||
_imageManager2Info CImageManager2::GenerateImageExec(const std::wstring& strInput, const std::wstring& sExts, const std::wstring& strAdditionalImage, int nAdditionalType, const std::wstring& oleData)
|
||||
{
|
||||
OOX::CPath oPathOutput;
|
||||
_imageManager2Info oImageManagerInfo;
|
||||
@ -293,8 +352,11 @@ namespace NSBinPptxRW
|
||||
{
|
||||
oPathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts;
|
||||
|
||||
if (oPathOutput.GetPath() != strInput)
|
||||
CDirectory::CopyFile(strInput, oPathOutput.GetPath());
|
||||
if (oPathOutput.GetPath() != strInput && NSFile::CFileBinary::Exists(strInput))
|
||||
{
|
||||
NSFile::CFileBinary::Copy(strInput, oPathOutput.GetPath());
|
||||
oImageManagerInfo.sFilepathImage = oPathOutput.GetPath();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -302,32 +364,52 @@ namespace NSBinPptxRW
|
||||
strExts = _T(".png");
|
||||
oPathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts;
|
||||
SaveImageAsPng(strInput, oPathOutput.GetPath());
|
||||
oImageManagerInfo.sFilepathImage = oPathOutput.GetPath();
|
||||
}
|
||||
oImageManagerInfo.sFilepathImage = oPathOutput.GetPath();
|
||||
|
||||
if (!strOleImage.empty() || !oleData.empty() )
|
||||
if ((!strAdditionalImage.empty() || !oleData.empty() ) && (nAdditionalType == 1))
|
||||
{
|
||||
std::wstring strExtsOle = L".bin";
|
||||
std::wstring strAdditionalExt = L".bin";
|
||||
|
||||
int pos = (int)strOleImage.rfind(L".");
|
||||
if (pos >= 0) strExtsOle = strOleImage.substr(pos);
|
||||
int pos = (int)strAdditionalImage.rfind(L".");
|
||||
if (pos >= 0) strAdditionalExt = strAdditionalImage.substr(pos);
|
||||
|
||||
std::wstring strImageOle = L"oleObject" + std::to_wstring(++m_lIndexNextOle) + strExtsOle;
|
||||
std::wstring strImageAdditional = L"oleObject" + std::to_wstring(++m_lIndexCounter) + strAdditionalExt;
|
||||
|
||||
OOX::CPath pathOutputOle = m_strDstEmbed + FILE_SEPARATOR_STR + strImageOle;
|
||||
OOX::CPath pathOutput = m_strDstEmbed + FILE_SEPARATOR_STR + strImageAdditional;
|
||||
|
||||
std::wstring strOleImageOut = pathOutputOle.GetPath();
|
||||
std::wstring strAdditionalImageOut = pathOutput.GetPath();
|
||||
|
||||
if(!oleData.empty())
|
||||
{
|
||||
WriteOleData(strOleImageOut, oleData);
|
||||
WriteOleData(strAdditionalImageOut, oleData);
|
||||
oImageManagerInfo.sFilepathAdditional = strAdditionalImageOut;
|
||||
}
|
||||
else
|
||||
else if (NSFile::CFileBinary::Exists(strAdditionalImage))
|
||||
{
|
||||
CDirectory::CopyFile(strOleImage, strOleImageOut);
|
||||
NSFile::CFileBinary::Copy(strAdditionalImage, strAdditionalImageOut);
|
||||
oImageManagerInfo.sFilepathAdditional = strAdditionalImageOut;
|
||||
}
|
||||
|
||||
oImageManagerInfo.sFilepathOle = strOleImageOut;
|
||||
}
|
||||
else if (!strAdditionalImage.empty() && nAdditionalType == 2)
|
||||
{
|
||||
std::wstring strAdditionalExt;
|
||||
|
||||
int pos = (int)strAdditionalImage.rfind(L".");
|
||||
if (pos >= 0) strAdditionalExt = strAdditionalImage.substr(pos);
|
||||
|
||||
std::wstring strImageAdditional = L"media" + std::to_wstring(++m_lIndexCounter) + strAdditionalExt;
|
||||
|
||||
OOX::CPath pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImageAdditional;
|
||||
|
||||
std::wstring strAdditionalImageOut = pathOutput.GetPath();
|
||||
|
||||
if (NSFile::CFileBinary::Exists(strAdditionalImage))
|
||||
{
|
||||
NSFile::CFileBinary::Copy(strAdditionalImage, strAdditionalImageOut);
|
||||
oImageManagerInfo.sFilepathAdditional = strAdditionalImageOut;
|
||||
}
|
||||
}
|
||||
|
||||
return oImageManagerInfo;
|
||||
@ -372,7 +454,6 @@ namespace NSBinPptxRW
|
||||
strExts = strUrl.substr(nIndexExt);
|
||||
|
||||
std::wstring strImage;
|
||||
std::wstring strOleImage;
|
||||
|
||||
int nDisplayType = IsDisplayedImage(strUrl);
|
||||
|
||||
@ -380,11 +461,6 @@ namespace NSBinPptxRW
|
||||
{
|
||||
std::wstring strInputMetafile = strUrl.substr(0, strUrl.length() - strExts.length());
|
||||
std::wstring sDownloadRes;
|
||||
//todo
|
||||
if(0 != (nDisplayType & 4))
|
||||
{
|
||||
strOleImage = DownloadImageExec(strInputMetafile + _T(".bin"));
|
||||
}
|
||||
|
||||
if(0 != (nDisplayType & 1))
|
||||
{
|
||||
@ -414,11 +490,9 @@ namespace NSBinPptxRW
|
||||
_imageManager2Info oImageManagerInfo;
|
||||
if (!strImage.empty())
|
||||
{
|
||||
oImageManagerInfo = GenerateImageExec(strImage, strExts, strOleImage, L"");
|
||||
oImageManagerInfo = GenerateImageExec(strImage, strExts, L"", 0, L"");
|
||||
CDirectory::DeleteFile(strImage);
|
||||
}
|
||||
if (!strOleImage.empty())
|
||||
CDirectory::DeleteFile(strOleImage);
|
||||
|
||||
m_mapImages[strUrl] = oImageManagerInfo;
|
||||
return oImageManagerInfo;
|
||||
@ -1041,6 +1115,16 @@ namespace NSBinPptxRW
|
||||
m_pWriter->WriteString(str);
|
||||
}
|
||||
|
||||
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" +
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(s);
|
||||
}
|
||||
void CRelsGenerator::StartNotesMaster(int nIndexTheme)
|
||||
{
|
||||
m_pWriter->WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
|
||||
m_pWriter->WriteString(_T("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"));
|
||||
|
||||
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" +
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
@ -1056,7 +1140,7 @@ namespace NSBinPptxRW
|
||||
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(str);
|
||||
}
|
||||
void CRelsGenerator::StartSlide(int nIndexSlide, int nIndexLayout)
|
||||
void CRelsGenerator::StartSlide(int nIndexSlide, int nIndexLayout, int nIndexNotes)
|
||||
{
|
||||
m_pWriter->WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
|
||||
m_pWriter->WriteString(_T("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"));
|
||||
@ -1066,12 +1150,15 @@ namespace NSBinPptxRW
|
||||
std::to_wstring(nIndexLayout + 1) + L".xml\"/>";
|
||||
m_pWriter->WriteString(str);
|
||||
|
||||
str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide" +
|
||||
std::to_wstring(nIndexSlide + 1) + L".xml\"/>";
|
||||
if (nIndexNotes >= 0)
|
||||
{
|
||||
str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide" +
|
||||
std::to_wstring(nIndexNotes + 1) + L".xml\"/>";
|
||||
}
|
||||
m_pWriter->WriteString(str);
|
||||
}
|
||||
void CRelsGenerator::StartNote(int nIndexSlide)
|
||||
void CRelsGenerator::StartNotes(int nIndexSlide)
|
||||
{
|
||||
m_pWriter->WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
|
||||
m_pWriter->WriteString(L"<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
||||
@ -1166,36 +1253,42 @@ namespace NSBinPptxRW
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
_relsGeneratorInfo CRelsGenerator::WriteImage(const std::wstring& strImage, smart_ptr<OOX::OleObject> & oleFile, const std::wstring& oleData, std::wstring strBase64Image = _T(""))
|
||||
_relsGeneratorInfo CRelsGenerator::WriteImage(const std::wstring& strImage, smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image = _T(""))
|
||||
{
|
||||
_imageManager2Info oImageManagerInfo = m_pManager->GenerateImage(strImage, oleFile, oleData, strBase64Image);
|
||||
_imageManager2Info oImageManagerInfo = m_pManager->GenerateImage(strImage, additionalFile, oleData, strBase64Image);
|
||||
|
||||
std::wstring strImageRelsPath;
|
||||
|
||||
if (m_pManager->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX) strImageRelsPath = L"media/";
|
||||
else strImageRelsPath = L"../media/";
|
||||
|
||||
strImageRelsPath += OOX::CPath(oImageManagerInfo.sFilepathImage).GetFilename();
|
||||
|
||||
std::map<std::wstring, _relsGeneratorInfo>::iterator pPair = m_mapImages.find(strImageRelsPath);
|
||||
|
||||
if (m_mapImages.end() != pPair)
|
||||
{
|
||||
return pPair->second;
|
||||
}
|
||||
_relsGeneratorInfo oRelsGeneratorInfo;
|
||||
|
||||
oRelsGeneratorInfo.nImageRId = m_lNextRelsID++;
|
||||
oRelsGeneratorInfo.sFilepathImage = oImageManagerInfo.sFilepathImage;
|
||||
|
||||
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.nImageRId);
|
||||
|
||||
m_pWriter->WriteString( L"<Relationship Id=\"" + strRid +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"" + strImageRelsPath +
|
||||
L"\"/>");
|
||||
|
||||
if( oleFile.IsInit() )
|
||||
if (!oImageManagerInfo.sFilepathImage.empty())
|
||||
{
|
||||
strImageRelsPath += OOX::CPath(oImageManagerInfo.sFilepathImage).GetFilename();
|
||||
|
||||
std::map<std::wstring, _relsGeneratorInfo>::iterator pPair = m_mapImages.find(strImageRelsPath);
|
||||
|
||||
if (m_mapImages.end() != pPair)
|
||||
{
|
||||
return pPair->second;
|
||||
}
|
||||
|
||||
oRelsGeneratorInfo.nImageRId = m_lNextRelsID++;
|
||||
oRelsGeneratorInfo.sFilepathImage = oImageManagerInfo.sFilepathImage;
|
||||
|
||||
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.nImageRId);
|
||||
|
||||
m_pWriter->WriteString( L"<Relationship Id=\"" + strRid +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"" + strImageRelsPath +
|
||||
L"\"/>");
|
||||
}
|
||||
|
||||
if(additionalFile.is<OOX::OleObject>())
|
||||
{
|
||||
smart_ptr<OOX::OleObject> oleFile = additionalFile.smart_dynamic_cast<OOX::OleObject>();
|
||||
|
||||
std::wstring strOleRelsPath;
|
||||
|
||||
oRelsGeneratorInfo.nOleRId = m_lNextRelsID++;
|
||||
@ -1222,7 +1315,29 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(additionalFile.is<OOX::Media>())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
std::wstring strMediaRelsPath;
|
||||
|
||||
oRelsGeneratorInfo.nMediaRId = m_lNextRelsID++;
|
||||
oRelsGeneratorInfo.sFilepathOle = mediaFile->filename().GetPath();
|
||||
|
||||
if (m_pManager->m_nDocumentType != XMLWRITER_DOC_TYPE_XLSX)
|
||||
{
|
||||
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.nMediaRId);
|
||||
|
||||
if (m_pManager->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX) strMediaRelsPath = L"media/";
|
||||
else strMediaRelsPath = L"../media/";
|
||||
|
||||
strMediaRelsPath += mediaFile->filename().GetFilename();
|
||||
|
||||
m_pWriter->WriteString( L"<Relationship Id=\"" + strRid
|
||||
+ L"\" Type=\"http://schemas.microsoft.com/office/2007/relationships/media\" Target=\"" +
|
||||
strMediaRelsPath + L"\"/>");
|
||||
}
|
||||
}
|
||||
m_mapImages.insert(std::pair<std::wstring, _relsGeneratorInfo>(strImageRelsPath, oRelsGeneratorInfo));
|
||||
return oRelsGeneratorInfo;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ class COfficeFontPicker;
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
class OleObject;
|
||||
class File;
|
||||
class CContentTypes;
|
||||
class WritingElement;
|
||||
class IFileContainer;
|
||||
@ -91,7 +91,7 @@ namespace NSBinPptxRW
|
||||
|
||||
struct _imageManager2Info
|
||||
{
|
||||
std::wstring sFilepathOle;
|
||||
std::wstring sFilepathAdditional;
|
||||
std::wstring sFilepathImage;
|
||||
};
|
||||
|
||||
@ -99,7 +99,9 @@ namespace NSBinPptxRW
|
||||
{
|
||||
int nImageRId;
|
||||
int nOleRId;
|
||||
int nMediaRId;
|
||||
|
||||
std::wstring sFilepathMedia;
|
||||
std::wstring sFilepathOle;
|
||||
std::wstring sFilepathImage;
|
||||
|
||||
@ -107,6 +109,7 @@ namespace NSBinPptxRW
|
||||
{
|
||||
nImageRId = -1;
|
||||
nOleRId = -1;
|
||||
nMediaRId = -1;
|
||||
}
|
||||
};
|
||||
|
||||
@ -158,17 +161,13 @@ namespace NSBinPptxRW
|
||||
|
||||
NSShapeImageGen::CImageManager* m_pImageManager;
|
||||
|
||||
//NSFontCutter::CFontDstManager m_oFontPicker;
|
||||
|
||||
NSFontCutter::CFontDstManager* m_pNativePicker;
|
||||
COfficeFontPicker* m_pFontPicker;
|
||||
bool m_bDeleteFontPicker;
|
||||
|
||||
public:
|
||||
CCommonWriter();
|
||||
~CCommonWriter();
|
||||
|
||||
public:
|
||||
void CreateFontPicker(COfficeFontPicker* pPicker);
|
||||
void CheckFontPicker();
|
||||
};
|
||||
@ -178,7 +177,7 @@ namespace NSBinPptxRW
|
||||
private:
|
||||
std::map<std::wstring, _imageManager2Info> m_mapImages;
|
||||
_INT32 m_lIndexNextImage;
|
||||
_INT32 m_lIndexNextOle;
|
||||
_INT32 m_lIndexCounter;
|
||||
std::wstring m_strDstMedia;
|
||||
std::wstring m_strDstEmbed;
|
||||
public:
|
||||
@ -197,8 +196,8 @@ namespace NSBinPptxRW
|
||||
|
||||
int IsDisplayedImage(const std::wstring& strInput);
|
||||
|
||||
_imageManager2Info GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::OleObject> & oleFile, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
_imageManager2Info GenerateImageExec(const std::wstring& strInput, const std::wstring& strExts, const std::wstring& strOleImage, const std::wstring& oleData);
|
||||
_imageManager2Info GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
_imageManager2Info GenerateImageExec(const std::wstring& strInput, const std::wstring& strExts, const std::wstring& strAdditionalImage, int nAdditionalType, const std::wstring& oleData);
|
||||
|
||||
void SaveImageAsPng(const std::wstring& strFileSrc, const std::wstring& strFileDst);
|
||||
void SaveImageAsJPG(const std::wstring& strFileSrc, const std::wstring& strFileDst);
|
||||
@ -408,8 +407,9 @@ namespace NSBinPptxRW
|
||||
|
||||
void StartMaster (int nIndexTheme, const _slideMasterInfo& oInfo);
|
||||
void StartLayout (int nIndexTheme);
|
||||
void StartSlide (int nIndexSlide, int nIndexLayout);
|
||||
void StartNote (int nIndexSlide);
|
||||
void StartSlide (int nIndexSlide, int nIndexLayout, int nIndexNotes);
|
||||
void StartNotes (int nIndexSlide);
|
||||
void StartNotesMaster(int nIndexTheme);
|
||||
|
||||
void WriteMasters (int nCount);
|
||||
void WriteThemes (int nCount);
|
||||
@ -426,7 +426,7 @@ namespace NSBinPptxRW
|
||||
void AddRels (const std::wstring& strRels);
|
||||
void SaveRels (const std::wstring& strFile);
|
||||
|
||||
_relsGeneratorInfo WriteImage (const std::wstring& strImage, NSCommon::smart_ptr<OOX::OleObject>& strOle, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
_relsGeneratorInfo WriteImage (const std::wstring& strImage, NSCommon::smart_ptr<OOX::File>& additionalFile, const std::wstring& oleData, std::wstring strBase64Image);
|
||||
};
|
||||
|
||||
class CBinaryFileReader
|
||||
|
||||
@ -162,8 +162,7 @@ namespace PPTX2EditorAdvanced
|
||||
}
|
||||
|
||||
// записываем все слайды
|
||||
size_t nCount = presentation->sldIdLst.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
for (size_t i = 0; i < presentation->sldIdLst.size(); ++i)
|
||||
{
|
||||
std::wstring rId = presentation->sldIdLst[i].rid.get();
|
||||
smart_ptr<PPTX::Slide> slide = ((*presentation)[rId]).smart_dynamic_cast<PPTX::Slide>();
|
||||
|
||||
@ -58,10 +58,12 @@ namespace NSBinPptxRW
|
||||
|
||||
std::vector<PPTX::Slide> m_arSlides;
|
||||
std::vector<LONG> m_arSlides_Layout;
|
||||
std::vector<LONG> m_arSlides_Notes;
|
||||
|
||||
std::vector<PPTX::NotesMaster> m_arNotesMasters;
|
||||
std::vector<PPTX::NotesSlide> m_arNotesSlides;
|
||||
std::vector<LONG> m_arNotesSlides_Master;
|
||||
std::vector<LONG> m_arNotesMasters_Theme;
|
||||
|
||||
PPTX::Presentation m_oPresentation;
|
||||
PPTX::TableStyles m_oTableStyles;
|
||||
@ -175,10 +177,9 @@ namespace NSBinPptxRW
|
||||
|
||||
std::map<BYTE, LONG>::iterator pPair;
|
||||
|
||||
// writer
|
||||
CXmlWriter oXmlWriter;
|
||||
|
||||
// первым делом определим количество необходимого. если хоть одно из этих чисел - ноль, то ппту не корректный
|
||||
// первым делом определим количество необходимого. если хоть одно из этих чисел - ноль, то ппту не корректный
|
||||
LONG nCountThemes = 0;
|
||||
LONG nCountMasters = 0;
|
||||
LONG nCountLayouts = 0;
|
||||
@ -214,7 +215,7 @@ namespace NSBinPptxRW
|
||||
return;
|
||||
}
|
||||
|
||||
// теперь создадим массивы для рельсов
|
||||
// теперь создадим массивы для рельсов
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
_slideMasterInfo elm;
|
||||
@ -226,8 +227,11 @@ namespace NSBinPptxRW
|
||||
}
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
m_arSlides_Layout.push_back(0);
|
||||
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
m_arSlides_Notes.push_back(-1);
|
||||
|
||||
// ThemeRels
|
||||
// ThemeRels
|
||||
pPair = m_mainTables.find(NSMainTables::ThemeRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -242,7 +246,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// нужно проставить всем шаблонам мастер.
|
||||
// нужно проставить всем шаблонам мастер.
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
size_t _countL = m_arSlideMasters_Theme[i].m_arLayouts.size();
|
||||
@ -252,7 +256,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// готово, теперь нужно слайдам проставить шаблоны
|
||||
// готово, теперь нужно слайдам проставить шаблоны
|
||||
pPair = m_mainTables.find(NSMainTables::SlideRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -271,11 +275,46 @@ namespace NSBinPptxRW
|
||||
m_arSlides_Layout[index++] = m_oReader.GetULong();
|
||||
}
|
||||
}
|
||||
pPair = m_mainTables.find(NSMainTables::SlideNotesRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
m_oReader.Skip(6); // type + len + start attr
|
||||
|
||||
// теперь нужно удалить все themes, которые не ведут на мастерслайд
|
||||
size_t index =0;
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = m_oReader.GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
//m_arSlides_Layout[_at] = m_oReader.GetULong(); тут прописан не индекс, а тип - смотри - oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Layout_Rels[i]);
|
||||
if (index < m_arSlides_Notes.size())
|
||||
m_arSlides_Notes[index++] = m_oReader.GetULong();
|
||||
}
|
||||
}
|
||||
|
||||
pPair = m_mainTables.find(NSMainTables::NotesMastersRels);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
m_oReader.Skip(6); // type + len + start attr
|
||||
|
||||
size_t index =0;
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = m_oReader.GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
m_arNotesMasters_Theme.push_back( m_oReader.GetULong());
|
||||
}
|
||||
}
|
||||
// теперь нужно удалить все themes, которые не ведут на мастерслайды
|
||||
std::vector<LONG> arThemes;
|
||||
std::vector<LONG> arThemesDst;
|
||||
std::vector<bool> arThemesSave;
|
||||
|
||||
for (LONG i = 0; i < nCountThemes; ++i)
|
||||
{
|
||||
arThemes.push_back(i);
|
||||
@ -286,6 +325,11 @@ namespace NSBinPptxRW
|
||||
{
|
||||
arThemesSave[m_arSlideMasters_Theme[i].m_lThemeIndex] = true;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_arNotesMasters_Theme.size(); i++)
|
||||
{
|
||||
arThemesSave[m_arNotesMasters_Theme[i]] = true;
|
||||
}
|
||||
LONG lCurrectTheme = 0;
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
@ -298,9 +342,8 @@ namespace NSBinPptxRW
|
||||
for (LONG i = 0; i < nCountMasters; ++i)
|
||||
{
|
||||
m_arSlideMasters_Theme[i].m_lThemeIndex = arThemesDst[i];
|
||||
}
|
||||
|
||||
// themes
|
||||
}
|
||||
// themes
|
||||
pPair = m_mainTables.find(NSMainTables::Themes);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -343,7 +386,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// slideMasters
|
||||
// slideMasters
|
||||
pPair = m_mainTables.find(NSMainTables::SlideMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -396,7 +439,7 @@ namespace NSBinPptxRW
|
||||
}
|
||||
}
|
||||
|
||||
// slideLayouts
|
||||
// slideLayouts
|
||||
pPair = m_mainTables.find(NSMainTables::SlideLayouts);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
@ -431,8 +474,99 @@ namespace NSBinPptxRW
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
// notes
|
||||
pPair = m_mainTables.find(NSMainTables::NotesSlides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
// slides
|
||||
if ( lCount > 0 )
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
NSDirectory::CreateDirectory (pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory (pathFolderRels.GetPath());
|
||||
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
PPTX::NotesSlide elm;
|
||||
m_arNotesSlides.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
|
||||
size_t indexSlide = 0;
|
||||
for (indexSlide = 0; indexSlide < m_arSlides_Notes.size(); indexSlide++)
|
||||
{//todooo -> make map
|
||||
if (m_arSlides_Notes[indexSlide] == i)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_oReader.m_pRels->StartNotes(indexSlide);
|
||||
|
||||
m_arNotesSlides[i].fromPPTY(&m_oReader);
|
||||
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strNotesXml = L"notesSlide" + std::to_wstring(i + 1) + L".xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_arNotesSlides[i].toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strNotesXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strNotesXml + _T(".rels");
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
// noteMasters
|
||||
pPair = m_mainTables.find(NSMainTables::NotesMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
if (lCount > 0 || m_arNotesSlides.size() > 0)//один элемент
|
||||
{
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesMasters");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
NSDirectory::CreateDirectory(pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory(pathFolderRels.GetPath());
|
||||
|
||||
PPTX::NotesMaster elm;
|
||||
m_arNotesMasters.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartNotesMaster(m_arSlideMasters_Theme.size());
|
||||
|
||||
if (lCount > 0)
|
||||
{
|
||||
m_arNotesMasters.back().fromPPTY(&m_oReader);
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strMasterNotesXml = L"notesMaster1.xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_arNotesMasters.back().toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterNotesXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterNotesXml + _T(".rels");
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDefaultNotesMasters(m_arSlideMasters_Theme.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
// slides
|
||||
int nComment = 1;
|
||||
pPair = m_mainTables.find(NSMainTables::Slides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
@ -452,7 +586,7 @@ namespace NSBinPptxRW
|
||||
m_arSlides.push_back(elm);
|
||||
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartSlide(i, m_arSlides_Layout[i]);
|
||||
m_oReader.m_pRels->StartSlide(i, m_arSlides_Layout[i], m_arSlides_Notes[i]);
|
||||
m_arSlides[i].fromPPTY(&m_oReader);
|
||||
|
||||
if (m_arSlides[i].comments.is_init())
|
||||
@ -488,71 +622,6 @@ namespace NSBinPptxRW
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
// noteMasters
|
||||
pPair = m_mainTables.find(NSMainTables::NotesMasters);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
PPTX::NotesMaster elm;
|
||||
m_arNotesMasters.push_back(elm);
|
||||
m_arNotesMasters[i].fromPPTY(&m_oReader);
|
||||
}
|
||||
}
|
||||
|
||||
// notes
|
||||
pPair = m_mainTables.find(NSMainTables::NotesSlides);
|
||||
if (m_mainTables.end() != pPair)
|
||||
{
|
||||
m_oReader.Seek(pPair->second);
|
||||
LONG lCount = m_oReader.GetLong();
|
||||
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
PPTX::NotesSlide elm;
|
||||
m_arNotesSlides.push_back(elm);
|
||||
m_arNotesSlides[i].fromPPTY(&m_oReader);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// create default
|
||||
CreateDefaultNotesMasters((int)m_arThemes.size() + 1);
|
||||
CreateDefaultNote();
|
||||
|
||||
OOX::CPath pathFolder = m_strDstFolder + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("notesSlides");
|
||||
OOX::CPath pathFolderRels = pathFolder + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
NSDirectory::CreateDirectory (pathFolder.GetPath());
|
||||
NSDirectory::CreateDirectory (pathFolderRels.GetPath());
|
||||
|
||||
LONG lCount = (LONG)m_arSlides.size();
|
||||
for (LONG i = 0; i < lCount; ++i)
|
||||
{
|
||||
m_oReader.m_pRels->Clear();
|
||||
m_oReader.m_pRels->StartNote(i);
|
||||
m_oReader.m_pRels->CloseRels();
|
||||
|
||||
std::wstring strMasterXml = L"notesSlide" + std::to_wstring(i + 1) + L".xml";
|
||||
oXmlWriter.ClearNoAttack();
|
||||
|
||||
m_oDefaultNote.toXmlWriter(&oXmlWriter);
|
||||
|
||||
OOX::CPath pathFile = pathFolder + FILE_SEPARATOR_STR + strMasterXml;
|
||||
oXmlWriter.SaveToFile(pathFile.GetPath());
|
||||
|
||||
OOX::CPath pathFileRels = pathFolderRels + FILE_SEPARATOR_STR + strMasterXml + _T(".rels");
|
||||
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
|
||||
}
|
||||
}
|
||||
|
||||
if (false)
|
||||
{
|
||||
// app
|
||||
@ -595,15 +664,13 @@ namespace NSBinPptxRW
|
||||
m_oViewProps.fromPPTY(&m_oReader);
|
||||
}
|
||||
|
||||
//CreateDefaultPresProps();
|
||||
}
|
||||
else
|
||||
{
|
||||
// create default
|
||||
CreateDefaultApp();
|
||||
CreateDefaultCore();
|
||||
//CreateDefaultPresProps();
|
||||
//CreateDefaultTableStyles();
|
||||
|
||||
CreateDefaultViewProps();
|
||||
|
||||
// presProps
|
||||
@ -760,15 +827,13 @@ namespace NSBinPptxRW
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.extended-properties+xml", L"/docProps", L"app.xml");
|
||||
|
||||
// themes
|
||||
for (LONG i = 0; i < (LONG)m_arThemes.size(); ++i)
|
||||
for (size_t i = 0; i < m_arThemes.size(); ++i)
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.theme+xml", L"/ppt/theme", L"theme" + std::to_wstring(i + 1) + L".xml");
|
||||
}
|
||||
if (true)
|
||||
{
|
||||
// notes theme
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.theme+xml", L"/ppt/theme", L"theme" + std::to_wstring((int)m_arThemes.size() + 1) + L".xml");
|
||||
// notes master
|
||||
if (!m_arNotesMasters.empty())
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml", L"/ppt/notesMasters", L"notesMaster1.xml");
|
||||
}
|
||||
|
||||
@ -785,13 +850,13 @@ namespace NSBinPptxRW
|
||||
}
|
||||
|
||||
// slides
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
for (size_t i = 0; i < m_arSlides.size(); ++i)
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.slide+xml", L"/ppt/slides", L"slide" + std::to_wstring(i + 1) + L".xml");
|
||||
}
|
||||
|
||||
// notes
|
||||
for (LONG i = 0; i < nCountSlides; ++i)
|
||||
for (size_t i = 0; i < m_arNotesSlides.size(); ++i)
|
||||
{
|
||||
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml", L"/ppt/notesSlides", L"notesSlide" + std::to_wstring(i + 1) + L".xml");
|
||||
}
|
||||
|
||||
@ -104,16 +104,14 @@ namespace NSShapeImageGen
|
||||
|
||||
return *this;
|
||||
}
|
||||
void SetNameModificator(NSShapeImageGen::ImageType eType, bool bOle)
|
||||
void SetNameModificator(NSShapeImageGen::ImageType eType, int typeAdditionalFile )
|
||||
{
|
||||
std::wstring sPrefix;
|
||||
int nRes = 0;
|
||||
if(itWMF == eType)
|
||||
nRes += 1;
|
||||
if(itEMF == eType)
|
||||
nRes += 2;
|
||||
if(bOle)
|
||||
nRes += 4;
|
||||
if(itWMF == eType) nRes += 1;
|
||||
if(itEMF == eType) nRes += 2;
|
||||
if(typeAdditionalFile == 1) nRes += 4;
|
||||
if(typeAdditionalFile == 2) nRes += 8;
|
||||
|
||||
if(0 != nRes)
|
||||
m_sName = L"display" + std::to_wstring(nRes) + L"image";
|
||||
}
|
||||
@ -199,7 +197,7 @@ namespace NSShapeImageGen
|
||||
|
||||
return GenerateImageID(punkImage, (std::max)(1.0, width), (std::max)(1.0, height));
|
||||
}
|
||||
CImageInfo WriteImage(const std::wstring& strFile, const std::wstring& strOleFile, double& x, double& y, double& width, double& height)
|
||||
CImageInfo WriteImage(const std::wstring& strFile, double& x, double& y, double& width, double& height, const std::wstring& strAdditionalFile, int typeAdditionalFile)
|
||||
{
|
||||
bool bIsDownload = false;
|
||||
int n1 = (int)strFile.find (L"www");
|
||||
@ -215,16 +213,16 @@ namespace NSShapeImageGen
|
||||
if (bIsDownload)
|
||||
{
|
||||
|
||||
std::wstring strFile1 = strFile;
|
||||
std::wstring strFileUrl = strFile;
|
||||
|
||||
XmlUtils::replace_all(strFile1, L"\\", L"/");
|
||||
XmlUtils::replace_all(strFile1, L"http:/", L"http://");
|
||||
XmlUtils::replace_all(strFile1, L"https:/", L"https://");
|
||||
XmlUtils::replace_all(strFile1, L"ftp:/", L"ftp://");
|
||||
XmlUtils::replace_all(strFileUrl, L"\\", L"/");
|
||||
XmlUtils::replace_all(strFileUrl, L"http:/", L"http://");
|
||||
XmlUtils::replace_all(strFileUrl, L"https:/", L"https://");
|
||||
XmlUtils::replace_all(strFileUrl, L"ftp:/", L"ftp://");
|
||||
|
||||
|
||||
CImageInfo oInfo;
|
||||
std::map<std::wstring, CImageInfo>::iterator pPair = m_mapImagesFile.find(strFile1);
|
||||
std::map<std::wstring, CImageInfo>::iterator pPair = m_mapImagesFile.find(strFileUrl);
|
||||
|
||||
if (pPair != m_mapImagesFile.end())
|
||||
return pPair->second;
|
||||
@ -233,7 +231,7 @@ namespace NSShapeImageGen
|
||||
|
||||
#ifndef DISABLE_FILE_DOWNLOADER
|
||||
|
||||
CFileDownloader oDownloader(strFile1, true);
|
||||
CFileDownloader oDownloader(strFileUrl, true);
|
||||
if (oDownloader.DownloadSync())
|
||||
{
|
||||
strDownload = oDownloader.GetFilePath();
|
||||
@ -241,21 +239,23 @@ namespace NSShapeImageGen
|
||||
|
||||
#endif
|
||||
|
||||
return GenerateImageID(strDownload, strFile1, strOleFile, (std::max)(1.0, width), (std::max)(1.0, height));
|
||||
return GenerateImageID(strDownload, strFileUrl, (std::max)(1.0, width), (std::max)(1.0, height), strAdditionalFile, typeAdditionalFile);
|
||||
|
||||
|
||||
}
|
||||
|
||||
CImageInfo info;
|
||||
CFile oFile;
|
||||
if (S_OK != oFile.OpenFile(strFile))
|
||||
return info;
|
||||
if (strAdditionalFile.empty())
|
||||
{
|
||||
CImageInfo info;
|
||||
CFile oFile;
|
||||
if (S_OK != oFile.OpenFile(strFile))
|
||||
return info;
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
oFile.CloseFile();
|
||||
|
||||
if (-1 == width && -1 == height)
|
||||
return GenerateImageID(strFile, L"", strOleFile, width, height);
|
||||
return GenerateImageID(strFile, L"", strOleFile, (std::max)(1.0, width), (std::max)(1.0, height));
|
||||
if (width < 0 && height < 0) return GenerateImageID(strFile, L"", -1, -1, strAdditionalFile, typeAdditionalFile);
|
||||
return GenerateImageID(strFile, L"", (std::max)(1.0, width), (std::max)(1.0, height), strAdditionalFile, typeAdditionalFile);
|
||||
}
|
||||
void SetFontManager(CFontManager* pFontManager)
|
||||
{
|
||||
@ -413,12 +413,12 @@ namespace NSShapeImageGen
|
||||
return oInfo;
|
||||
}
|
||||
|
||||
CImageInfo GenerateImageID(const std::wstring& strFileName, const std::wstring & strUrl, const std::wstring& strOleFile, double dWidth, double dHeight)
|
||||
CImageInfo GenerateImageID(const std::wstring& strFileName, const std::wstring & strUrl, double dWidth, double dHeight, const std::wstring& strAdditionalFile, int typeAdditionalFile)
|
||||
{
|
||||
std::wstring sMapKey = strFileName;
|
||||
|
||||
if(!strUrl.empty()) sMapKey = strUrl;
|
||||
if(!strOleFile.empty()) sMapKey += strOleFile;
|
||||
if(!strAdditionalFile.empty()) sMapKey += strAdditionalFile;
|
||||
|
||||
CImageInfo oInfo;
|
||||
std::map<std::wstring, CImageInfo>::iterator pPair = m_mapImagesFile.find(sMapKey);
|
||||
@ -434,26 +434,30 @@ namespace NSShapeImageGen
|
||||
LONG lImageType = m_oImageExt.GetImageType(strFileName);
|
||||
|
||||
bool bVector = (1 == lImageType || 2 == lImageType);
|
||||
bool bOle = !strOleFile.empty();
|
||||
|
||||
bool bOle = !strAdditionalFile.empty() && (typeAdditionalFile == 1);
|
||||
bool bMedia = !strAdditionalFile.empty() && (typeAdditionalFile == 2);
|
||||
|
||||
if(bVector)
|
||||
oInfo.m_eType = (1 == lImageType) ? itWMF : itEMF;
|
||||
|
||||
oInfo.SetNameModificator(oInfo.m_eType, bOle);
|
||||
oInfo.SetNameModificator(oInfo.m_eType, typeAdditionalFile);
|
||||
|
||||
std::wstring strSaveDir = m_strDstMedia + FILE_SEPARATOR_STR;
|
||||
std::wstring strSaveItemWE = strSaveDir + std::wstring(oInfo.GetPathWithoutExtension());
|
||||
|
||||
//copy ole bin
|
||||
if(bOle)
|
||||
//copy ole bin or media
|
||||
if(bOle || bMedia)
|
||||
{
|
||||
std::wstring strExts = _T(".bin");
|
||||
int nIndexExt = (int)strOleFile.rfind(wchar_t('.'));
|
||||
std::wstring strExts;
|
||||
int nIndexExt = (int)strAdditionalFile.rfind(wchar_t('.'));
|
||||
if (-1 != nIndexExt)
|
||||
strExts = strOleFile.substr(nIndexExt);
|
||||
strExts = strAdditionalFile.substr(nIndexExt);
|
||||
|
||||
std::wstring sCopyOlePath = strSaveItemWE + strExts;//L".bin";
|
||||
CDirectory::CopyFile(strOleFile, sCopyOlePath);
|
||||
if(bOle && strExts.empty()) strExts = L".bin";
|
||||
|
||||
std::wstring sCopyOlePath = strSaveItemWE + strExts;
|
||||
CDirectory::CopyFile(strAdditionalFile, sCopyOlePath);
|
||||
}
|
||||
|
||||
if (bVector)
|
||||
|
||||
@ -86,12 +86,12 @@ namespace PPTX
|
||||
|
||||
void FileContainer::read(const OOX::CPath& filename)
|
||||
{
|
||||
//not implement FileContainer.read
|
||||
//OOX::IFileContainer::read(filename);
|
||||
}
|
||||
|
||||
void FileContainer::read(const OOX::CRels& rels, const OOX::CPath& path)
|
||||
{
|
||||
//not implement FileContainer.read
|
||||
//OOX::IFileContainer::read(rels, path);
|
||||
}
|
||||
void FileContainer::read(const OOX::CRels& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event)
|
||||
{
|
||||
@ -157,8 +157,6 @@ namespace PPTX
|
||||
pContainer->read(normPath, map, Event);
|
||||
m_bCancelled = pContainer->m_bCancelled;
|
||||
}
|
||||
//todo детально разобраться и вернуть проверку res.(до перехода на cross platform все было хорошо)
|
||||
//на презентация с hyperlink выходим при достижении 100%. Проценты считаются от количества обработанных файлов, а hyperlink не файл(Ligninger_og_uligheder.pptx)
|
||||
if (m_bCancelled)
|
||||
{
|
||||
break;
|
||||
|
||||
@ -187,8 +187,25 @@ namespace PPTX
|
||||
break;
|
||||
}
|
||||
case BULLET_TYPE_BULLET_BLIP:
|
||||
// TODO:
|
||||
break;
|
||||
{
|
||||
pReader->Skip(5); // len + type + start attr
|
||||
|
||||
Logic::BuBlip *pBuBlip = new Logic::BuBlip();
|
||||
pBuBlip->blip.fromPPTY(pReader);
|
||||
|
||||
if (pBuBlip->blip.embed.IsInit())
|
||||
{
|
||||
m_Bullet.reset(pBuBlip);
|
||||
}
|
||||
else
|
||||
{//??? сбой ???
|
||||
delete pBuBlip;
|
||||
|
||||
Logic::BuChar *pBuChar = new Logic::BuChar();
|
||||
pBuChar->Char = wchar_t(L'\x2022');
|
||||
m_Bullet.reset(pBuChar);
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
m_Bullet.reset(new Logic::BuNone());
|
||||
break;
|
||||
|
||||
@ -44,7 +44,11 @@ namespace PPTX
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(ClrMap)
|
||||
PPTX_LOGIC_BASE2(ClrMap)
|
||||
|
||||
ClrMap(std::wstring name = L"p:clrMap")
|
||||
{
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
|
||||
@ -165,12 +165,26 @@ namespace PPTX
|
||||
XmlUtils::CAttribute oAttr;
|
||||
XmlUtils::CNodeValue oValue;
|
||||
|
||||
return XmlUtils::CreateNode(_T("p:ext"), oValue);
|
||||
return XmlUtils::CreateNode(L"p:ext", oValue);
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
// TODO:
|
||||
if (link.IsInit() && uri.IsInit())
|
||||
{
|
||||
pWriter->StartNode(L"p:ext");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(L"uri", *uri);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(L"p14:media");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(L"xmlns:p14", std::wstring(L"http://schemas.microsoft.com/office/powerpoint/2010/main"));
|
||||
pWriter->WriteAttribute(L"r:embed", link->get());
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(L"p14:media");
|
||||
pWriter->EndNode(L"p:ext");
|
||||
}
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
|
||||
@ -156,5 +156,230 @@ namespace PPTX
|
||||
|
||||
return L"";
|
||||
}
|
||||
void Blip::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring strName = (_T("") == m_namespace) ? _T("blip") : (m_namespace + _T(":blip"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
if (embed.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:embed"), embed->ToString());
|
||||
if (link.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:link"), link->ToString());
|
||||
pWriter->WriteAttribute(_T("cstate"), cstate);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
// TODO:
|
||||
size_t nCount = Effects.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
Effects[i].toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
void Blip::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, cstate);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
if (embed.is_init())
|
||||
pWriter->WriteString1(10, embed->get());
|
||||
if (link.is_init())
|
||||
pWriter->WriteString1(11, link->get());
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
ULONG len = (ULONG)Effects.size();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(3, Effects[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
double dX = pWriter->GetShapeX(); //mm
|
||||
double dY = pWriter->GetShapeY();
|
||||
|
||||
double dW = pWriter->GetShapeWidth(); //mm
|
||||
double dH = pWriter->GetShapeHeight();
|
||||
|
||||
OOX::IFileContainer* pRels = NULL;
|
||||
|
||||
if (pWriter->m_pCurrentContainer->is_init())
|
||||
pRels = pWriter->m_pCurrentContainer->operator ->();
|
||||
|
||||
std::wstring additionalPath;
|
||||
int additionalType = 0;
|
||||
if(!oleFilepathBin.empty())
|
||||
{
|
||||
additionalPath = oleFilepathBin;
|
||||
additionalType = 1;
|
||||
}
|
||||
else if(!oleRid.empty())
|
||||
{
|
||||
additionalPath = this->GetFullOleName(OOX::RId(oleRid), pRels);
|
||||
additionalType = 1;
|
||||
}
|
||||
else if(!mediaRid.empty())
|
||||
{
|
||||
additionalPath = this->GetFullOleName(OOX::RId(mediaRid), pRels);
|
||||
additionalType = 2;
|
||||
}
|
||||
else if(!mediaFilepath.empty())
|
||||
{
|
||||
additionalPath = mediaFilepath;
|
||||
additionalType = 2;
|
||||
}
|
||||
|
||||
std::wstring imagePath;
|
||||
if(!oleFilepathImage.empty())
|
||||
{
|
||||
imagePath = oleFilepathImage;
|
||||
}
|
||||
else
|
||||
{
|
||||
imagePath = this->GetFullPicName(pRels);
|
||||
}
|
||||
|
||||
NSShapeImageGen::CImageInfo oId = pWriter->m_pCommon->m_pImageManager->WriteImage(imagePath, dX, dY, dW, dH, additionalPath, additionalType);
|
||||
std::wstring s = oId.GetPath2();
|
||||
|
||||
pWriter->StartRecord(3);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, s);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void Blip::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _s2 = pReader->GetPos();
|
||||
LONG _e2 = _s2 + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (NSBinPptxRW::g_nodeAttributeEnd == _at)
|
||||
break;
|
||||
|
||||
if (_at == 0)
|
||||
pReader->Skip(1);
|
||||
}
|
||||
|
||||
while (pReader->GetPos() < _e2)
|
||||
{
|
||||
BYTE _t = pReader->GetUChar();
|
||||
|
||||
switch (_t)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
{
|
||||
// id. embed / link
|
||||
pReader->Skip(4);
|
||||
break;
|
||||
}
|
||||
case 10:
|
||||
case 11:
|
||||
{
|
||||
// id. embed / link
|
||||
pReader->GetString2();
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
pReader->Skip(4);
|
||||
ULONG count_effects = pReader->GetULong();
|
||||
for (ULONG _eff = 0; _eff < count_effects; ++_eff)
|
||||
{
|
||||
pReader->Skip(1); // type
|
||||
ULONG rec_len = pReader->GetULong();
|
||||
if (0 == rec_len)
|
||||
continue;
|
||||
|
||||
BYTE rec = pReader->GetUChar();
|
||||
|
||||
if (rec == EFFECT_TYPE_ALPHAMODFIX)
|
||||
{
|
||||
// alpha!!!
|
||||
LONG _e22 = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
pReader->Skip(1); // startattr
|
||||
|
||||
PPTX::Logic::AlphaModFix* pEffect = new PPTX::Logic::AlphaModFix();
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (NSBinPptxRW::g_nodeAttributeEnd == _at)
|
||||
break;
|
||||
|
||||
if (_at == 0)
|
||||
pEffect->amt = pReader->GetLong();
|
||||
}
|
||||
|
||||
Effects.push_back(UniEffect());
|
||||
Effects[0].InitPointer(pEffect);
|
||||
|
||||
pReader->Seek(_e22);
|
||||
}
|
||||
else
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
pReader->Skip(6); // len + start attributes + type
|
||||
|
||||
std::wstring strImagePath = pReader->GetString2();
|
||||
|
||||
if (0 != strImagePath.find(_T("http:")) &&
|
||||
0 != strImagePath.find(_T("https:")) &&
|
||||
0 != strImagePath.find(_T("ftp:")) &&
|
||||
0 != strImagePath.find(_T("file:")))
|
||||
{
|
||||
if (0 == strImagePath.find(_T("theme")))
|
||||
{
|
||||
strImagePath = pReader->m_strFolderExternalThemes + FILE_SEPARATOR_STR + strImagePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
strImagePath = pReader->m_strFolder + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR + strImagePath;
|
||||
}
|
||||
|
||||
OOX::CPath pathUrl = strImagePath;
|
||||
strImagePath = pathUrl.GetPath();
|
||||
}
|
||||
|
||||
smart_ptr<OOX::File> additionalFile;
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strImagePath, additionalFile, L"", L"");
|
||||
|
||||
if (oRelsGeneratorInfo.nImageRId > 0)
|
||||
{
|
||||
embed = new OOX::RId((size_t)oRelsGeneratorInfo.nImageRId);
|
||||
}
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
pReader->SkipRecord();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReader->Seek(_e2);
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
@ -63,16 +63,22 @@ namespace PPTX
|
||||
link = oSrc.link;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
|
||||
oleRid = oSrc.oleRid;
|
||||
oleFilepathBin = oSrc.oleFilepathBin;
|
||||
|
||||
mediaRid = oSrc.mediaRid;
|
||||
mediaFilepath = oSrc.mediaFilepath;
|
||||
|
||||
return *this;
|
||||
}
|
||||
virtual OOX::EElementType getType() const
|
||||
{
|
||||
return OOX::et_a_blip;
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
@ -81,96 +87,12 @@ namespace PPTX
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("cstate"), cstate )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual std::wstring toXML() const;
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring strName = (_T("") == m_namespace) ? _T("blip") : (m_namespace + _T(":blip"));
|
||||
pWriter->StartNode(strName);
|
||||
|
||||
pWriter->StartAttributes();
|
||||
if (embed.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:embed"), embed->ToString());
|
||||
if (link.IsInit())
|
||||
pWriter->WriteAttribute(_T("r:link"), link->ToString());
|
||||
pWriter->WriteAttribute(_T("cstate"), cstate);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
// TODO:
|
||||
size_t nCount = Effects.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
Effects[i].toXmlWriter(pWriter);
|
||||
}
|
||||
|
||||
pWriter->EndNode(strName);
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteLimit2(0, cstate);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
if (embed.is_init())
|
||||
pWriter->WriteString1(10, embed->get());
|
||||
if (link.is_init())
|
||||
pWriter->WriteString1(11, link->get());
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
ULONG len = (ULONG)Effects.size();
|
||||
pWriter->WriteULONG(len);
|
||||
|
||||
for (ULONG i = 0; i < len; ++i)
|
||||
{
|
||||
pWriter->WriteRecord1(3, Effects[i]);
|
||||
}
|
||||
|
||||
pWriter->EndRecord();
|
||||
|
||||
double dX = pWriter->GetShapeX(); //mm
|
||||
double dY = pWriter->GetShapeY();
|
||||
|
||||
double dW = pWriter->GetShapeWidth(); //mm
|
||||
double dH = pWriter->GetShapeHeight();
|
||||
|
||||
OOX::IFileContainer* pRels = NULL;
|
||||
|
||||
if (pWriter->m_pCurrentContainer->is_init())
|
||||
pRels = pWriter->m_pCurrentContainer->operator ->();
|
||||
|
||||
std::wstring olePath;
|
||||
if(!oleFilepathBin.empty())
|
||||
{
|
||||
olePath = oleFilepathBin;
|
||||
}
|
||||
else if(!oleRid.empty())
|
||||
{
|
||||
olePath= this->GetFullOleName(OOX::RId(oleRid), pRels);
|
||||
}
|
||||
|
||||
std::wstring imagePath;
|
||||
if(!oleFilepathImage.empty())
|
||||
{
|
||||
imagePath = oleFilepathImage;
|
||||
}
|
||||
else
|
||||
{
|
||||
imagePath = this->GetFullPicName(pRels);
|
||||
}
|
||||
|
||||
NSShapeImageGen::CImageInfo oId = pWriter->m_pCommon->m_pImageManager->WriteImage(imagePath, olePath, dX, dY, dW, dH);
|
||||
std::wstring s = oId.GetPath2();
|
||||
|
||||
pWriter->StartRecord(3);
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
pWriter->WriteString1(0, s);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
|
||||
virtual std::wstring GetFullPicName(OOX::IFileContainer* pRels = NULL)const;
|
||||
virtual std::wstring GetFullOleName(const OOX::RId& pRId, OOX::IFileContainer* pRels = NULL)const;
|
||||
|
||||
@ -180,9 +102,11 @@ namespace PPTX
|
||||
nullable<OOX::RId> embed;
|
||||
nullable<OOX::RId> link;
|
||||
std::wstring m_namespace;
|
||||
//internal
|
||||
std::wstring mediaRid;
|
||||
std::wstring mediaFilepath;
|
||||
|
||||
std::wstring oleRid;
|
||||
//internal
|
||||
std::wstring oleFilepathBin;
|
||||
std::wstring oleFilepathImage;
|
||||
protected:
|
||||
|
||||
@ -69,6 +69,9 @@ namespace PPTX
|
||||
dpi = oSrc.dpi;
|
||||
rotWithShape = oSrc.rotWithShape;
|
||||
|
||||
additionalFile = oSrc.additionalFile;
|
||||
oleData = oSrc.oleData;
|
||||
|
||||
m_namespace = oSrc.m_namespace;
|
||||
return *this;
|
||||
}
|
||||
@ -432,10 +435,10 @@ namespace PPTX
|
||||
strImagePath = pathUrl.GetPath();
|
||||
}
|
||||
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strImagePath, oleFile, oleData, strOrigBase64);
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strImagePath, additionalFile, oleData, strOrigBase64);
|
||||
|
||||
// -------------------
|
||||
if (strTempFile != _T(""))
|
||||
if (!strTempFile.empty())
|
||||
{
|
||||
CDirectory::DeleteFile(strTempFile);
|
||||
}
|
||||
@ -444,15 +447,22 @@ namespace PPTX
|
||||
if (!blip.is_init())
|
||||
blip = new PPTX::Logic::Blip();
|
||||
|
||||
blip->embed = new OOX::RId((size_t)oRelsGeneratorInfo.nImageRId);
|
||||
blip->oleFilepathImage = oRelsGeneratorInfo.sFilepathImage;
|
||||
if (oRelsGeneratorInfo.nImageRId > 0)
|
||||
{
|
||||
blip->embed = new OOX::RId((size_t)oRelsGeneratorInfo.nImageRId);
|
||||
}
|
||||
|
||||
if(oRelsGeneratorInfo.nOleRId > 0)
|
||||
{
|
||||
blip->oleRid = OOX::RId((size_t)oRelsGeneratorInfo.nOleRId).get();
|
||||
blip->oleFilepathBin = oRelsGeneratorInfo.sFilepathOle;
|
||||
blip->oleFilepathImage = oRelsGeneratorInfo.sFilepathImage;
|
||||
}
|
||||
if(oRelsGeneratorInfo.nMediaRId > 0)
|
||||
{
|
||||
blip->mediaRid = OOX::RId((size_t)oRelsGeneratorInfo.nMediaRId).get();
|
||||
blip->mediaFilepath = oRelsGeneratorInfo.sFilepathMedia;
|
||||
}
|
||||
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
}
|
||||
@ -507,8 +517,8 @@ namespace PPTX
|
||||
nullable_bool rotWithShape;
|
||||
|
||||
//internal
|
||||
smart_ptr<OOX::OleObject> oleFile;
|
||||
std::wstring oleData;
|
||||
mutable smart_ptr<OOX::File> additionalFile;
|
||||
std::wstring oleData;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds()
|
||||
{
|
||||
|
||||
@ -45,8 +45,9 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(MediaFile)
|
||||
|
||||
MediaFile()
|
||||
MediaFile(std::wstring name_)
|
||||
{
|
||||
name = name_;
|
||||
}
|
||||
|
||||
MediaFile& operator=(const MediaFile& oSrc)
|
||||
@ -75,19 +76,28 @@ namespace PPTX
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:link"), link)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("contentType"), contentType)
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, L"r:link", link)
|
||||
WritingElement_ReadAttributes_Read_else_if ( oReader, L"contentType", contentType)
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
virtual std::wstring toXML() const
|
||||
{
|
||||
XmlUtils::CAttribute oAttr;
|
||||
oAttr.Write(_T("r:link"), link.ToString());
|
||||
oAttr.Write(_T("contentType"), contentType);
|
||||
oAttr.Write(L"r:link", link.ToString());
|
||||
oAttr.Write(L"contentType", contentType);
|
||||
|
||||
return XmlUtils::CreateNode(_T("a:") + name, oAttr);
|
||||
return XmlUtils::CreateNode(L"a:" + name, oAttr);
|
||||
}
|
||||
public:
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
pWriter->StartNode(L"a:" + name);
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute (L"r:link", link.ToString());
|
||||
pWriter->WriteAttribute (L"contentType", contentType);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(L"a:" + name);
|
||||
}
|
||||
|
||||
std::wstring name;
|
||||
OOX::RId link;
|
||||
nullable_string contentType;
|
||||
|
||||
@ -41,7 +41,10 @@
|
||||
#include "Media/MediaFile.h"
|
||||
#include "Media/WavAudioFile.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/MathEquation/MathEquation.h"
|
||||
|
||||
#include "../../../ASCOfficeDocxFile2/BinWriter/BinEquationWriter.h"
|
||||
@ -134,9 +137,11 @@ namespace PPTX
|
||||
pWriter->WriteLimit2(4, m_oDrawAspect);
|
||||
pWriter->WriteLimit2(5, m_oType);
|
||||
pWriter->WriteLimit2(6, m_oUpdateMode);
|
||||
if (ole_file.IsInit() == false || ole_file->isMsPackage() == false)
|
||||
if (ole_file.IsInit() && ole_file->isMsPackage() == false)
|
||||
{
|
||||
pWriter->WriteString1(7, ole_file->filename().GetFilename()); //OleObject Binary FileName (bin, xls, doc, ... other stream file)
|
||||
std::wstring sExt = ole_file->filename().GetExtention(false);
|
||||
if (!sExt.empty())
|
||||
pWriter->WriteString1(7, L"maskFile." + sExt); //OleObject Binary FileName Extension (bin, xls, doc, ... other stream file)
|
||||
}
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
|
||||
@ -608,6 +613,137 @@ namespace PPTX
|
||||
|
||||
return XmlUtils::CreateNode(m_namespace + L":pic", oValue);
|
||||
}
|
||||
|
||||
void Pic::toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if(oleObject.IsInit())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_OLE);
|
||||
}
|
||||
else if (nvPicPr.nvPr.media.is_init())
|
||||
{
|
||||
blipFill.additionalFile = GetMediaLink();
|
||||
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit() && blipFill.blip.IsInit())
|
||||
{
|
||||
blipFill.blip->mediaFilepath = mediaFile->filename().GetPath();
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == L"audioFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_AUDIO);
|
||||
else if (nvPicPr.nvPr.media.as<MediaFile>().name == L"videoFile")
|
||||
pWriter->StartRecord(SPTREE_TYPE_VIDEO);
|
||||
else
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
|
||||
if (blipFill.additionalFile.is<OOX::Media>())
|
||||
{
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
pWriter->StartRecord(5);
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
|
||||
std::wstring sExt = mediaFile->filename().GetExtention(false);
|
||||
if (!sExt.empty())
|
||||
pWriter->WriteString1(0, L"maskFile." + sExt);
|
||||
//todoo start, end positions ..
|
||||
|
||||
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
pWriter->WriteRecord2(4, oleObject);
|
||||
pWriter->WriteRecord1(0, nvPicPr);
|
||||
pWriter->WriteRecord1(1, blipFill);
|
||||
pWriter->WriteRecord1(2, spPr);
|
||||
pWriter->WriteRecord2(3, style);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void Pic::toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
bool bOle = false;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"pic";
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
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>");
|
||||
if(spPr.xfrm.IsInit())
|
||||
{
|
||||
std::wstring oldNamespace = spPr.xfrm->m_ns;
|
||||
spPr.xfrm->m_ns = _T("p");
|
||||
spPr.xfrm->toXmlWriter(pWriter);
|
||||
spPr.xfrm->m_ns = oldNamespace;
|
||||
}
|
||||
pWriter->WriteString(L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/presentationml/2006/ole\">");
|
||||
|
||||
pWriter->StartNode(_T("p:oleObj"));
|
||||
pWriter->WriteAttribute(L"name", (std::wstring)L"oleObj");
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
pWriter->WriteAttribute2(L"r:id", oleObject->m_oId->get());
|
||||
}
|
||||
if(oleObject->m_oDxaOrig.IsInit())
|
||||
{
|
||||
int nDxaOrig = oleObject->m_oDxaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgW", 635 * nDxaOrig); //twips to emu
|
||||
}
|
||||
if(oleObject->m_oDyaOrig.IsInit())
|
||||
{
|
||||
int nDyaOrig = oleObject->m_oDyaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgH", 635 * nDyaOrig); //twips to emu
|
||||
}
|
||||
pWriter->WriteAttribute2(L"progId", oleObject->m_sProgId);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteString(L"<p:embed/>");
|
||||
}
|
||||
}
|
||||
pWriter->StartNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:pic"), (std::wstring)_T("http://schemas.openxmlformats.org/drawingml/2006/picture"));
|
||||
}
|
||||
pWriter->EndAttributes();
|
||||
|
||||
nvPicPr.toXmlWriter(pWriter);
|
||||
|
||||
blipFill.m_namespace = namespace_;
|
||||
blipFill.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->m_lFlag = 1;
|
||||
spPr.toXmlWriter(pWriter);
|
||||
pWriter->m_lFlag = 0;
|
||||
|
||||
pWriter->Write(style);
|
||||
|
||||
pWriter->EndNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if(bOle)
|
||||
{
|
||||
pWriter->WriteString(L"</p:oleObj></a:graphicData></a:graphic></p:graphicFrame>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Pic::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
@ -621,9 +757,8 @@ namespace PPTX
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
nvPicPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
nvPicPr.fromPPTY(pReader);
|
||||
}break;
|
||||
case 1:
|
||||
{
|
||||
blipFill.fromPPTY(pReader);
|
||||
@ -637,19 +772,23 @@ namespace PPTX
|
||||
if (NSFile::CFileBinary::Exists(oleObject->m_OleObjectFile->filename().GetPath()) == false)
|
||||
oleObject->m_OleObjectFile->set_filename (blipFill.blip->oleFilepathBin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit() && blipFill.blip.IsInit())
|
||||
{
|
||||
if (NSFile::CFileBinary::Exists(mediaFile->filename().GetPath()) == false)
|
||||
mediaFile->set_filename (blipFill.blip->mediaFilepath);
|
||||
}
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
spPr.fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
spPr.fromPPTY(pReader);
|
||||
}break;
|
||||
case 3:
|
||||
{
|
||||
style = new ShapeStyle(L"p");
|
||||
style->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
style->fromPPTY(pReader);
|
||||
}break;
|
||||
case 4:
|
||||
{
|
||||
oleObject = new COLEObject();
|
||||
@ -658,15 +797,34 @@ namespace PPTX
|
||||
if(oleObject->m_sData.IsInit())
|
||||
blipFill.oleData = oleObject->m_sData.get();
|
||||
|
||||
blipFill.oleFile = oleObject->m_OleObjectFile;
|
||||
blipFill.additionalFile = oleObject->m_OleObjectFile.smart_dynamic_cast<OOX::File>();
|
||||
}break;
|
||||
case 5:
|
||||
{
|
||||
LONG _end_rec1 = pReader->GetPos() + pReader->GetLong() + 4;
|
||||
|
||||
//if (oleObject->m_OleObjectFile.IsInit())
|
||||
//{
|
||||
// blipFill.olePath = oleObject->m_OleObjectFile->filename().GetPath();
|
||||
// if (NSFile::CFileBinary::Exists(blipFill.olePath))
|
||||
// blipFill.olePath.clear();
|
||||
//}
|
||||
break;
|
||||
pReader->Skip(1); // start attributes
|
||||
|
||||
while (true)
|
||||
{
|
||||
BYTE _at = pReader->GetUChar_TypeNode();
|
||||
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
|
||||
break;
|
||||
|
||||
if (0 == _at)
|
||||
{
|
||||
std::wstring strMediaFileMask = pReader->GetString2();
|
||||
|
||||
smart_ptr<OOX::Media> mediaFile = blipFill.additionalFile.smart_dynamic_cast<OOX::Media>();
|
||||
if (mediaFile.IsInit())
|
||||
{
|
||||
mediaFile->set_filename(strMediaFileMask);
|
||||
}
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
pReader->Seek(_end_rec1);
|
||||
}
|
||||
default:
|
||||
{
|
||||
@ -674,16 +832,53 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
}
|
||||
if(blipFill.blip.IsInit() && !blipFill.blip->oleRid.empty() && oleObject.IsInit())
|
||||
if(blipFill.blip.IsInit() && blipFill.additionalFile.IsInit())
|
||||
{
|
||||
oleObject->m_oId = OOX::RId(blipFill.blip->oleRid);
|
||||
|
||||
if (oleObject->m_OleObjectFile.IsInit() == false)
|
||||
if (!blipFill.blip->oleRid.empty() && oleObject.IsInit())
|
||||
{
|
||||
oleObject->m_OleObjectFile = new OOX::OleObject(false, pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
|
||||
oleObject->m_OleObjectFile->set_filename (blipFill.blip->oleFilepathBin);
|
||||
oleObject->m_OleObjectFile->set_filename_cache (blipFill.blip->oleFilepathImage);
|
||||
oleObject->m_oId = OOX::RId(blipFill.blip->oleRid);
|
||||
|
||||
if (oleObject->m_OleObjectFile.IsInit() == false)
|
||||
{
|
||||
oleObject->m_OleObjectFile = new OOX::OleObject(false, pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
|
||||
oleObject->m_OleObjectFile->set_filename (blipFill.blip->oleFilepathBin);
|
||||
oleObject->m_OleObjectFile->set_filename_cache (blipFill.blip->oleFilepathImage);
|
||||
}
|
||||
}
|
||||
if (!blipFill.blip->mediaRid.empty())
|
||||
{
|
||||
PPTX::Logic::Ext ext;
|
||||
ext.link = OOX::RId(blipFill.blip->mediaRid);
|
||||
ext.uri = L"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}";
|
||||
nvPicPr.nvPr.extLst.push_back(ext);
|
||||
|
||||
int nRId = -1;
|
||||
if (blipFill.additionalFile.is<OOX::Audio>())
|
||||
{
|
||||
nvPicPr.nvPr.media.Media = new PPTX::Logic::MediaFile(L"audioFile");
|
||||
nRId = pReader->m_pRels->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio",
|
||||
L"NULL", L"External");
|
||||
|
||||
}
|
||||
if (blipFill.additionalFile.is<OOX::Video>())
|
||||
{
|
||||
nvPicPr.nvPr.media.Media = new PPTX::Logic::MediaFile(L"videoFile");
|
||||
nRId = pReader->m_pRels->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",
|
||||
L"NULL", L"External");
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.Media.IsInit() && nRId > 0)
|
||||
{
|
||||
PPTX::Logic::MediaFile& mediaFile = nvPicPr.nvPr.media.Media.as<PPTX::Logic::MediaFile>();
|
||||
mediaFile.link = OOX::RId((size_t)nRId);
|
||||
|
||||
}
|
||||
if (nvPicPr.cNvPr.hlinkClick.IsInit() == false)
|
||||
nvPicPr.cNvPr.hlinkClick.Init();
|
||||
|
||||
nvPicPr.cNvPr.hlinkClick->id = L"";
|
||||
nvPicPr.cNvPr.hlinkClick->action = L"ppaction://media";
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,57 +921,28 @@ namespace PPTX
|
||||
return blipFill.blip->GetFullPicName();
|
||||
return _T("");
|
||||
}
|
||||
|
||||
std::wstring Pic::GetVideoLink()const
|
||||
smart_ptr<OOX::File> Pic::GetMediaLink()const
|
||||
{
|
||||
std::wstring file = _T("");
|
||||
if (parentFileIs<Slide>())
|
||||
smart_ptr<OOX::File> file;
|
||||
|
||||
if (!parentFileIs<Slide>()) return file;
|
||||
|
||||
if (nvPicPr.nvPr.media.is<WavAudioFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if ((nvPicPr.nvPr.media.as<MediaFile>().name == _T("videoFile")) || (nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")))
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get());
|
||||
if (std::wstring (_T("NULL")) == file) // HAVE TRIM
|
||||
{
|
||||
if(nvPicPr.nvPr.extLst.size())
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.extLst[0].link.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return parentFileAs<Slide>().Find(nvPicPr.nvPr.media.as<WavAudioFile>().embed.get());
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
std::wstring Pic::GetAudioLink()const
|
||||
{
|
||||
std::wstring file = _T("");
|
||||
if (parentFileIs<Slide>())
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.is<WavAudioFile>())
|
||||
file = parentFileAs<Slide>().Find(nvPicPr.nvPr.media.as<MediaFile>().link.get());
|
||||
smart_ptr<OOX::Media> mediaFile = file.smart_dynamic_cast<OOX::Media>();
|
||||
|
||||
if ( mediaFile.IsInit() == false && !nvPicPr.nvPr.extLst.empty())
|
||||
{
|
||||
return parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<WavAudioFile>().embed.get());
|
||||
}
|
||||
|
||||
if (nvPicPr.nvPr.media.is<MediaFile>())
|
||||
{
|
||||
if (nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile"))
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get());
|
||||
|
||||
if (std::wstring (_T("NULL")) == file) // HAVE TRIM
|
||||
{
|
||||
if(nvPicPr.nvPr.extLst.size())
|
||||
{
|
||||
file = parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.extLst[0].link.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//todooo - почему везде нулевой то? - сделать по всем поиск по uri
|
||||
file = parentFileAs<Slide>().Find(nvPicPr.nvPr.extLst[0].link.get());
|
||||
}
|
||||
}//удалять ли c UnknownType ???? (если не найден щас генерится)
|
||||
return file;
|
||||
}
|
||||
|
||||
@ -970,8 +1136,18 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
if (spPr.Geometry.is_init())
|
||||
bool bRect = bOle; //ole ВСЕГДА rect
|
||||
|
||||
if (spPr.Geometry.is<PPTX::Logic::PrstGeom>())
|
||||
{
|
||||
const PPTX::Logic::PrstGeom & lpGeom = spPr.Geometry.as<PPTX::Logic::PrstGeom>();
|
||||
|
||||
if( lpGeom.prst.get() == L"rect" )
|
||||
bRect = true;
|
||||
}
|
||||
|
||||
if (bRect == false)
|
||||
{//custom vml shape
|
||||
std::wstring strPath;
|
||||
std::wstring strTextRect;
|
||||
|
||||
@ -1158,7 +1334,9 @@ namespace PPTX
|
||||
}
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
blipFill.blip->oleRid = oleObject->m_oId.get().ToString();
|
||||
if (blipFill.blip.IsInit() == false)
|
||||
blipFill.blip.Init();
|
||||
blipFill.blip->oleRid = oleObject->m_oId->get();
|
||||
}
|
||||
}
|
||||
} // namespace Logic
|
||||
|
||||
@ -237,127 +237,35 @@ namespace PPTX
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node);
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
|
||||
|
||||
virtual std::wstring toXML() const;
|
||||
void fromXMLOle(XmlUtils::CXmlNode& node);
|
||||
|
||||
virtual void GetRect(Aggplus::RECT& pRect)const;
|
||||
|
||||
virtual std::wstring GetFullPicName()const;
|
||||
virtual std::wstring GetVideoLink()const;
|
||||
virtual std::wstring GetAudioLink()const;
|
||||
smart_ptr<OOX::File> GetMediaLink()const;
|
||||
|
||||
DWORD GetFill(UniFill& fill)const;
|
||||
DWORD GetLine(Ln& line)const;
|
||||
|
||||
double GetStTrim () const;
|
||||
double GetEndTrim () const;
|
||||
long GetRefId() const;
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
if(oleObject.IsInit())
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_OLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->StartRecord(SPTREE_TYPE_PIC);
|
||||
}
|
||||
|
||||
pWriter->WriteRecord2(4, oleObject);
|
||||
pWriter->WriteRecord1(0, nvPicPr);
|
||||
pWriter->WriteRecord1(1, blipFill);
|
||||
pWriter->WriteRecord1(2, spPr);
|
||||
pWriter->WriteRecord2(3, style);
|
||||
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
std::wstring namespace_ = m_namespace;
|
||||
bool bOle = false;
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
|
||||
else if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"pic";
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
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>");
|
||||
if(spPr.xfrm.IsInit())
|
||||
{
|
||||
std::wstring oldNamespace = spPr.xfrm->m_ns;
|
||||
spPr.xfrm->m_ns = _T("p");
|
||||
spPr.xfrm->toXmlWriter(pWriter);
|
||||
spPr.xfrm->m_ns = oldNamespace;
|
||||
}
|
||||
pWriter->WriteString(L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/presentationml/2006/ole\">");
|
||||
|
||||
pWriter->StartNode(_T("p:oleObj"));
|
||||
pWriter->WriteAttribute(L"name", (std::wstring)L"oleObj");
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
pWriter->WriteAttribute2(L"r:id", oleObject->m_oId->get());
|
||||
}
|
||||
if(oleObject->m_oDxaOrig.IsInit())
|
||||
{
|
||||
int nDxaOrig = oleObject->m_oDxaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgW", 635 * nDxaOrig); //twips to emu
|
||||
}
|
||||
if(oleObject->m_oDyaOrig.IsInit())
|
||||
{
|
||||
int nDyaOrig = oleObject->m_oDyaOrig.get();
|
||||
pWriter->WriteAttribute(L"imgH", 635 * nDyaOrig); //twips to emu
|
||||
}
|
||||
pWriter->WriteAttribute2(L"progId", oleObject->m_sProgId);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->WriteString(L"<p:embed/>");
|
||||
}
|
||||
}
|
||||
pWriter->StartNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:pic"), (std::wstring)_T("http://schemas.openxmlformats.org/drawingml/2006/picture"));
|
||||
}
|
||||
pWriter->EndAttributes();
|
||||
|
||||
nvPicPr.toXmlWriter(pWriter);
|
||||
|
||||
blipFill.m_namespace = namespace_;
|
||||
blipFill.toXmlWriter(pWriter);
|
||||
|
||||
pWriter->m_lFlag = 1;
|
||||
spPr.toXmlWriter(pWriter);
|
||||
pWriter->m_lFlag = 0;
|
||||
|
||||
pWriter->Write(style);
|
||||
|
||||
pWriter->EndNode(namespace_ + L":pic");
|
||||
|
||||
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_XLSX &&
|
||||
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
|
||||
{
|
||||
if(bOle)
|
||||
{
|
||||
pWriter->WriteString(L"</p:oleObj></a:graphicData></a:graphic></p:graphicFrame>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader);
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const;
|
||||
|
||||
virtual std::wstring toXML() const;
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const;
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, bool in_group = false);
|
||||
void fromXMLOle(XmlUtils::CXmlNode& node);
|
||||
//----------------------------------------------------------------------
|
||||
NvPicPr nvPicPr;
|
||||
BlipFill blipFill;
|
||||
SpPr spPr;
|
||||
nullable<ShapeStyle> style;
|
||||
//internal
|
||||
nullable<COLEObject> oleObject;
|
||||
|
||||
std::wstring m_namespace;
|
||||
nullable<COLEObject> oleObject;
|
||||
nullable_string m_sClientDataXml;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds();
|
||||
|
||||
@ -409,7 +409,6 @@ namespace PPTX
|
||||
|
||||
pWriter->StartRecord(4);
|
||||
pWriter->m_pMainDocument->getBinaryContentElem(OOX::et_w_sdtContent, oTextBoxShape.GetPointer(), *pWriter, lDataSize);
|
||||
//pWriter->m_pMainDocument->getBinaryContent(TextBoxShape.get(), *pWriter, lDataSize);
|
||||
pWriter->EndRecord();
|
||||
|
||||
if (oTextBoxBodyPr.is_init())
|
||||
@ -419,6 +418,24 @@ namespace PPTX
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
}
|
||||
else if (strTextBoxShape.is_init())//после конвертации старого шейпа (vml)
|
||||
{
|
||||
long lDataSize = 0;
|
||||
ULONG lPos = pWriter->GetPosition();
|
||||
pWriter->SetPosition(lPos);
|
||||
|
||||
pWriter->StartRecord(4);
|
||||
pWriter->m_pMainDocument->getBinaryContent(strTextBoxShape.get(), *pWriter, lDataSize);
|
||||
pWriter->EndRecord();
|
||||
|
||||
if (oTextBoxBodyPr.is_init())
|
||||
{
|
||||
pWriter->StartRecord(5);
|
||||
oTextBoxBodyPr->toPPTY(pWriter);
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
}
|
||||
|
||||
else if (txBody.is_init())
|
||||
{
|
||||
std::wstring strContent = txBody->GetDocxTxBoxContent(pWriter, style);
|
||||
@ -553,7 +570,7 @@ namespace PPTX
|
||||
std::wstring strFillNode;
|
||||
std::wstring strStrokeNode;;
|
||||
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle);
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle, bSignature);
|
||||
CalculateLine(spPr, style, oTheme, oClrMap, strStrokeAttr, strStrokeNode, bOle, bSignature);
|
||||
|
||||
pWriter->StartNode(L"v:shape");
|
||||
|
||||
@ -37,8 +37,11 @@
|
||||
#include "CxnSp.h"
|
||||
#include "SpTree.h"
|
||||
#include "GraphicFrame.h"
|
||||
#include "./../SlideMaster.h"
|
||||
|
||||
#include "../SlideMaster.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -56,7 +59,7 @@ namespace PPTX
|
||||
}
|
||||
|
||||
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::Theme>& oTheme,
|
||||
NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle)
|
||||
NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle, bool bSignature)
|
||||
{
|
||||
PPTX::Logic::UniFill fill;
|
||||
DWORD ARGB = 0;
|
||||
@ -110,7 +113,7 @@ namespace PPTX
|
||||
|
||||
std::wstring strId = oBlip.blip->embed->ToString();
|
||||
|
||||
if(bOle)
|
||||
if (bOle || bSignature)
|
||||
{
|
||||
strAttr = _T(" filled=\"f\"");
|
||||
strNode = _T("<v:imagedata r:id=\"") + strId + _T("\" o:title=\"\" />");
|
||||
@ -346,8 +349,22 @@ namespace PPTX
|
||||
}
|
||||
case SPTREE_TYPE_OLE:
|
||||
case SPTREE_TYPE_PIC:
|
||||
case SPTREE_TYPE_AUDIO:
|
||||
case SPTREE_TYPE_VIDEO:
|
||||
{
|
||||
Logic::Pic* p = new Logic::Pic();
|
||||
|
||||
if (_type == SPTREE_TYPE_AUDIO)
|
||||
{
|
||||
OOX::Audio *pAudio = new OOX::Audio(pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
p->blipFill.additionalFile = smart_ptr<OOX::File>(dynamic_cast<OOX::File*>(pAudio));
|
||||
}
|
||||
else if (_type == SPTREE_TYPE_VIDEO)
|
||||
{
|
||||
OOX::Video* pVideo = new OOX::Video(pReader->m_nDocumentType == XMLWRITER_DOC_TYPE_DOCX);
|
||||
p->blipFill.additionalFile = smart_ptr<OOX::File>(dynamic_cast<OOX::File*>(pVideo));
|
||||
}
|
||||
|
||||
p->fromPPTY(pReader);
|
||||
m_elem.reset(p);
|
||||
break;
|
||||
|
||||
@ -44,7 +44,7 @@ namespace PPTX
|
||||
namespace Logic
|
||||
{
|
||||
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::Theme>& oTheme,
|
||||
smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false);
|
||||
smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false, bool bSignature = false);
|
||||
|
||||
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle,
|
||||
smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false, bool bSignature = false);
|
||||
|
||||
@ -46,9 +46,9 @@ namespace PPTX
|
||||
public:
|
||||
WritingElement_AdditionConstructors(TextListStyle)
|
||||
|
||||
TextListStyle()
|
||||
TextListStyle(std::wstring name = L"a:lstStyle")
|
||||
{
|
||||
m_name = L"a:lstStyle";
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlNode& node)
|
||||
|
||||
@ -189,8 +189,8 @@ namespace PPTX
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("lvl"), lvl)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("algn"), algn)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("fontAlgn"),fontAlgn)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marL"), marR)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marR"), marL)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marL"), marL)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("marR"), marR)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("indent"), indent)
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("defTabSz"),defTabSz)
|
||||
WritingElement_ReadAttributes_End ( oReader )
|
||||
@ -541,4 +541,4 @@ namespace PPTX
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_TEXTPARAGRAPHPR_INCLUDE_H_
|
||||
#endif // PPTX_LOGIC_TEXTPARAGRAPHPR_INCLUDE_H_
|
||||
|
||||
@ -434,10 +434,10 @@ namespace PPTX
|
||||
}
|
||||
// -------------------
|
||||
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strUrl, pFill->oleFile, pFill->oleData, strOrigBase64);
|
||||
NSBinPptxRW::_relsGeneratorInfo oRelsGeneratorInfo = pReader->m_pRels->WriteImage(strUrl, pFill->additionalFile, pFill->oleData, strOrigBase64);
|
||||
|
||||
// -------------------
|
||||
if (strTempFile != _T(""))
|
||||
if (!strTempFile.empty())
|
||||
{
|
||||
CDirectory::DeleteFile(strTempFile);
|
||||
}
|
||||
@ -455,7 +455,11 @@ namespace PPTX
|
||||
pFill->blip->oleRid = OOX::RId((size_t)oRelsGeneratorInfo.nOleRId).get();
|
||||
pFill->blip->oleFilepathBin = oRelsGeneratorInfo.sFilepathOle;
|
||||
}
|
||||
|
||||
if(oRelsGeneratorInfo.nMediaRId > 0)
|
||||
{
|
||||
pFill->blip->mediaRid = OOX::RId((size_t)oRelsGeneratorInfo.nMediaRId).get();
|
||||
pFill->blip->mediaFilepath = oRelsGeneratorInfo.sFilepathMedia;
|
||||
}
|
||||
pReader->Skip(1); // end attribute
|
||||
break;
|
||||
}
|
||||
|
||||
@ -107,16 +107,13 @@ namespace PPTX
|
||||
return Media->toXML();
|
||||
return _T("");
|
||||
}
|
||||
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
|
||||
virtual void toPPTY(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
// TODO:
|
||||
if (Media.is_init())
|
||||
Media->toXmlWriter(pWriter);
|
||||
}
|
||||
@ -126,8 +123,7 @@ namespace PPTX
|
||||
template<class T> AVSINLINE const bool is() const { return Media.is<T>(); }
|
||||
template<class T> AVSINLINE T& as() { return Media.as<T>(); }
|
||||
template<class T> AVSINLINE const T& as() const { return Media.as<T>(); }
|
||||
//public:
|
||||
private:
|
||||
|
||||
smart_ptr<WrapperWritingElement> Media;
|
||||
protected:
|
||||
virtual void FillParentPointersForChilds(){};
|
||||
|
||||
@ -131,11 +131,11 @@ namespace PPTX
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("xmlns:a"), PPTX::g_Namespaces.a.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:r"), PPTX::g_Namespaces.r.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:m"), PPTX::g_Namespaces.m.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:w"), PPTX::g_Namespaces.w.m_strLink);
|
||||
pWriter->WriteAttribute(_T("xmlns:p"), PPTX::g_Namespaces.p.m_strLink);
|
||||
pWriter->EndAttributes();
|
||||
|
||||
cSld.toXmlWriter(pWriter);
|
||||
|
||||
clrMap.toXmlWriter(pWriter);
|
||||
pWriter->Write(hf);
|
||||
pWriter->Write(notesStyle);
|
||||
@ -172,7 +172,7 @@ namespace PPTX
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
notesStyle = new Logic::TextListStyle();
|
||||
notesStyle = new Logic::TextListStyle(L"p:notesStyle");
|
||||
notesStyle->fromPPTY(pReader);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ namespace PPTX
|
||||
}
|
||||
virtual void read(const OOX::CPath& filename, FileMap& map)
|
||||
{
|
||||
//FileContainer::read(filename, map);
|
||||
//FileContainer::read(filename);
|
||||
|
||||
XmlUtils::CXmlNode oNode;
|
||||
oNode.FromXmlFile(filename.m_strFilename);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Version="8,00"
|
||||
Name="PPTXFormat"
|
||||
ProjectGUID="{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
RootNamespace="PPTXFormat"
|
||||
|
||||
@ -48,7 +48,6 @@ public:
|
||||
~AutoFilter();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "ChartFrtInfo.h"
|
||||
#include <Logic/Biff_structures/FrtHeaderOld.h>
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -37,6 +37,8 @@ namespace XLS
|
||||
|
||||
DConRef::DConRef()
|
||||
{
|
||||
bFilePath = false;
|
||||
bSheetName = false;
|
||||
}
|
||||
|
||||
|
||||
@ -52,10 +54,33 @@ BaseObjectPtr DConRef::clone()
|
||||
|
||||
void DConRef::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### DConRef record is not implemented")
|
||||
Log::error("DConRef record is not implemented.");
|
||||
record >> ref >> cchFile;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
if (cchFile > 1)
|
||||
{
|
||||
XLUnicodeStringNoCch stFile_;
|
||||
stFile_.setSize(cchFile);
|
||||
record >> stFile_;
|
||||
//dcon-file = external-virt-path / self-reference
|
||||
//external-virt-path = volume / unc-volume / rel-volume / transfer-protocol / startup / alt-startup / library / simple-file-path-dcon
|
||||
//simple-file-path-dcon = %x0001 file-path
|
||||
//self-reference = %x0002 sheet-name
|
||||
|
||||
stFile = stFile_.value();
|
||||
if (stFile.substr(0, 1) == L"\x0001")
|
||||
{
|
||||
bFilePath = true;
|
||||
stFile = stFile.substr(1);
|
||||
}
|
||||
else if (stFile.substr(0, 1) == L"\x0002")
|
||||
{
|
||||
bSheetName = true;
|
||||
stFile = stFile.substr(1);
|
||||
}
|
||||
}
|
||||
|
||||
int unused = record.getDataSize() - record.getRdPtr();
|
||||
record.skipNunBytes(unused);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -33,11 +33,12 @@
|
||||
|
||||
#include "BiffRecord.h"
|
||||
|
||||
#include "../Biff_structures/BiffString.h"
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of DConRef record in BIFF8
|
||||
class DConRef: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(DConRef)
|
||||
@ -47,12 +48,17 @@ public:
|
||||
~DConRef();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeDConRef;
|
||||
static const ElementType type = typeDConRef;
|
||||
|
||||
RefU ref;
|
||||
unsigned short cchFile;
|
||||
std::wstring stFile;
|
||||
|
||||
bool bFilePath;
|
||||
bool bSheetName;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "EndObject.h"
|
||||
#include <Logic/Biff_structures/FrtHeaderOld.h>
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -54,7 +54,7 @@ void MTRSettings::readFields(CFRecord& record)
|
||||
{
|
||||
record.skipNunBytes(12);
|
||||
_UINT32 temp1, temp2;
|
||||
#pragma message("############################ frtHeader skipped here")
|
||||
|
||||
record >> temp1 >> temp2 >> cUserThreadCount;
|
||||
|
||||
fMTREnabled = temp1;
|
||||
|
||||
@ -52,9 +52,9 @@ BaseObjectPtr OleDbConn::clone()
|
||||
|
||||
void OleDbConn::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### OleDbConn record is not implemented")
|
||||
Log::error("OleDbConn record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr PicF::clone()
|
||||
|
||||
void PicF::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### PicF record is not implemented")
|
||||
Log::error("PicF record is not implemented.");
|
||||
//record >> some_value;
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr PivotChartBits::clone()
|
||||
|
||||
void PivotChartBits::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### PivotChartBits record is not implemented")
|
||||
Log::error("PivotChartBits record is not implemented.");
|
||||
//record >> some_value;
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -52,9 +52,9 @@ BaseObjectPtr Qsi::clone()
|
||||
|
||||
void Qsi::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### Qsi record is not implemented")
|
||||
Log::error("Qsi record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -52,9 +52,22 @@ BaseObjectPtr QsiSXTag::clone()
|
||||
|
||||
void QsiSXTag::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### QsiSXTag record is not implemented")
|
||||
Log::error("QsiSXTag record is not implemented.");
|
||||
//record >> some_value;
|
||||
unsigned char reserved1;
|
||||
unsigned short flags, reserved2;
|
||||
|
||||
record >> frtHeaderOld >> fSx >> flags;
|
||||
|
||||
fEnableRefresh = GETBIT(flags, 0);
|
||||
fInvalid = GETBIT(flags, 1);
|
||||
fTensorEx = GETBIT(flags, 2);
|
||||
|
||||
record >> dwQsiFuture >> verSxLastUpdated >> verSxUpdatableMin >> obCchName >> reserved1;
|
||||
record >> stName;
|
||||
|
||||
record >> reserved2;
|
||||
|
||||
int skip = record.getDataSize() - record.getRdPtr();
|
||||
record.skipNunBytes(skip);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/BiffString.h"
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of QsiSXTag record in BIFF8
|
||||
class QsiSXTag: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(QsiSXTag)
|
||||
@ -47,12 +47,24 @@ public:
|
||||
~QsiSXTag();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeQsiSXTag;
|
||||
static const ElementType type = typeQsiSXTag;
|
||||
|
||||
FrtHeaderOld frtHeaderOld;
|
||||
unsigned short fSx;
|
||||
|
||||
bool fEnableRefresh;
|
||||
bool fInvalid;
|
||||
bool fTensorEx;
|
||||
|
||||
_UINT32 dwQsiFuture;
|
||||
unsigned char verSxLastUpdated;
|
||||
unsigned char verSxUpdatableMin;
|
||||
|
||||
unsigned char obCchName;
|
||||
XLUnicodeString stName;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr Qsif::clone()
|
||||
|
||||
void Qsif::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### Qsif record is not implemented")
|
||||
Log::error("Qsif record is not implemented.");
|
||||
//record >> some_value;
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,9 +53,9 @@ BaseObjectPtr RRSort::clone()
|
||||
|
||||
void RRSort::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### RRSort record is not implemented")
|
||||
Log::error("RRSort record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -83,7 +83,7 @@ int SST::serialize(std::wostream & stream)
|
||||
{
|
||||
CP_XML_WRITER(stream)
|
||||
{
|
||||
for (int i=0; i < rgb.size(); i++)
|
||||
for (size_t i=0; i < rgb.size(); i++)
|
||||
{
|
||||
XLUnicodeRichExtendedString *richText = dynamic_cast<XLUnicodeRichExtendedString *>(rgb[i].get());
|
||||
|
||||
|
||||
@ -52,11 +52,66 @@ BaseObjectPtr SXAddl::clone()
|
||||
|
||||
void SXAddl::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXAddl record is not implemented")
|
||||
//Log::error("SXAddl record is not implemented.");
|
||||
//record >> some_value;
|
||||
m_SXAddlHdr.load(record);
|
||||
|
||||
Log::error("SXAddl record is not implemented.");
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
void SXAddl_SXCCache_SXDId::readFields(CFRecord& record)
|
||||
{
|
||||
m_SXAddlHdr.load(record);
|
||||
|
||||
short reserved;
|
||||
record >> idCache >> reserved;
|
||||
}
|
||||
|
||||
void SXAddl_SXCCache_SXDEnd::readFields(CFRecord& record)
|
||||
{
|
||||
m_SXAddlHdr.load(record);
|
||||
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2;
|
||||
}
|
||||
|
||||
void SXAddl_SXCCache_SXDVer10Info::readFields(CFRecord& record)
|
||||
{
|
||||
m_SXAddlHdr.load(record);
|
||||
|
||||
_UINT32 reserved1;
|
||||
short reserved2;
|
||||
record >> reserved1 >> reserved2;
|
||||
|
||||
record >> citmGhostMax >> bVerCacheLastRefresh >> bVerCacheRefreshableMin;
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
record >> numDateCopy[i];
|
||||
|
||||
record >> reserved2;
|
||||
}
|
||||
void SXAddl_SXCCache_SXDInfo12::readFields(CFRecord& record)
|
||||
{
|
||||
m_SXAddlHdr.load(record);
|
||||
|
||||
_UINT32 flags;
|
||||
short reserved;
|
||||
|
||||
record >> flags >> reserved;
|
||||
|
||||
fSheetData = GETBIT(flags, 0);
|
||||
fSrvSupportAttribDrill = GETBIT(flags, 1);
|
||||
fSrvSupportSubQuery = GETBIT(flags, 2);
|
||||
}
|
||||
void SXAddl_SXCCache_SXDVerSXMacro::readFields(CFRecord& record)
|
||||
{
|
||||
m_SXAddlHdr.load(record);
|
||||
|
||||
unsigned char reserved1;
|
||||
short reserved2, reserved3;
|
||||
|
||||
record >> dwVer >> reserved1 >> reserved2 >> reserved3;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -43,129 +43,188 @@ class SXAddl: public BiffRecord
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SXAddl)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXAddl)
|
||||
public:
|
||||
struct _SXAddlHdr
|
||||
{
|
||||
_UINT32 frtHeaderOld;
|
||||
unsigned char sxc;
|
||||
unsigned char sxd;
|
||||
|
||||
void load(CFRecord& record)
|
||||
{
|
||||
record >> frtHeaderOld >> sxc >> sxd;
|
||||
}
|
||||
}m_SXAddlHdr;
|
||||
|
||||
SXAddl();
|
||||
~SXAddl();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
virtual void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAddl;
|
||||
};
|
||||
|
||||
class Continue_SxaddlSxString : public SXAddl
|
||||
{
|
||||
public:
|
||||
//virtual void readFields(CFRecord& record);
|
||||
|
||||
};
|
||||
class SXAddl_SXCAutoSort_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCAutoSort_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDEnd : public SXAddl
|
||||
{
|
||||
public:
|
||||
virtual void readFields(CFRecord& record);
|
||||
};
|
||||
|
||||
class SXAddl_SXCCache_SXDId : public SXAddl
|
||||
{
|
||||
public:
|
||||
virtual void readFields(CFRecord& record);
|
||||
|
||||
_UINT32 idCache;
|
||||
};
|
||||
|
||||
class SXAddl_SXCCache_SXDInfo12 : public SXAddl
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void readFields(CFRecord& record);
|
||||
|
||||
bool fSheetData;
|
||||
bool fSrvSupportAttribDrill;
|
||||
bool fSrvSupportSubQuery;
|
||||
|
||||
};
|
||||
|
||||
// The following classes are not implemented and most probably won't be.
|
||||
// So we save some compilation and link time and resulting dll size
|
||||
class Continue_SxaddlSxString : public SXAddl {};
|
||||
class SXAddl_SXCAutoSort_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCAutoSort_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDInfo12 : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDInvRefreshReal : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDVer10Info : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDVerSXMacro : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDCaption : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDIfdbMempropMap : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDIfdbMpMapCount : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDProperty : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDPropName : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDSxrmitmCount : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDItmMpMapCount : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDItmMpropMap : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDSxrmitmDisp : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDAutoshow : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDISXTH : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDMemberCaption : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDVer12Info : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCField_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCField_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCField_SXDVer10Info : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDGrpInfo : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDMember : public SXAddl {};
|
||||
class SXAddl_SXCGrpLevel_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCGrpLevel_SXDGrpLevelInfo : public SXAddl {};
|
||||
class SXAddl_SXCGrpLevel_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDDisplayFolder : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDFilterMember : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDFilterMember12 : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDIconSet : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDInfo12 : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIGoal : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIStatus : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPITime : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPITrend : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIValue : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIWeight : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDMeasureGrp : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDParentKPI : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDProperty : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDSXSetParentUnique : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDUserCaption : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCQsi_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCQsi_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDReconnCond : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDSrcConnFile : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDSrcDataFile : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDXMLSource : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmt_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmt_SXDSXCondFmt : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmts_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmts_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXDH_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXDH_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXDH_SXDSxdh : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDSXfilt : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDSXItm : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDCaption : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilter : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilterDesc : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilterValue1 : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilterValue2 : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDXlsFilter : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDXlsFilterValue1 : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDXlsFilterValue2 : public SXAddl {};
|
||||
class SXAddl_SXCSXFilters12_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXFilters12_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXMg_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXMg_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXMg_SXDUserCaption : public SXAddl {};
|
||||
class SXAddl_SXCSXMgs_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXMgs_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXMgs_SXDMGrpSXDHMap : public SXAddl {};
|
||||
class SXAddl_SXCSXrule_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXrule_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXrule_SXDSXrule : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCalcMember : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCalcMemString : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCompactColHdr : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCompactRwHdr : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDSXPIIvmb : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDTableStyleClient : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDVer10Info : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDVer12Info : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCCache_SXDInvRefreshReal : public SXAddl
|
||||
{
|
||||
};
|
||||
|
||||
class SXAddl_SXCCache_SXDVer10Info : public SXAddl
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void readFields(CFRecord& record);
|
||||
|
||||
_INT32 citmGhostMax;
|
||||
unsigned char bVerCacheLastRefresh;
|
||||
unsigned char bVerCacheRefreshableMin;
|
||||
|
||||
unsigned char numDateCopy[8];
|
||||
};
|
||||
|
||||
class SXAddl_SXCCache_SXDVerSXMacro : public SXAddl
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void readFields(CFRecord& record);
|
||||
|
||||
unsigned char dwVer;
|
||||
};
|
||||
|
||||
class SXAddl_SXCCache_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDCaption : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDIfdbMempropMap: public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDIfdbMpMapCount: public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDProperty : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDPropName : public SXAddl {};
|
||||
class SXAddl_SXCCacheField_SXDSxrmitmCount : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDItmMpMapCount : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDItmMpropMap : public SXAddl {};
|
||||
class SXAddl_SXCCacheItem_SXDSxrmitmDisp : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDAutoshow : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDISXTH : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDMemberCaption : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDVer12Info : public SXAddl {};
|
||||
class SXAddl_SXCField12_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCField_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCField_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCField_SXDVer10Info : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDGrpInfo : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCGroup_SXDMember : public SXAddl {};
|
||||
class SXAddl_SXCGrpLevel_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCGrpLevel_SXDGrpLevelInfo : public SXAddl {};
|
||||
class SXAddl_SXCGrpLevel_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDDisplayFolder : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDFilterMember : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDFilterMember12 : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDIconSet : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDInfo12 : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIGoal : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIStatus : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPITime : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPITrend : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIValue : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDKPIWeight : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDMeasureGrp : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDParentKPI : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDProperty : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDSXSetParentUnique : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDUserCaption : public SXAddl {};
|
||||
class SXAddl_SXCHierarchy_SXDVerUpdInv : public SXAddl {};
|
||||
class SXAddl_SXCQsi_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCQsi_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDReconnCond : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDSrcConnFile : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDSrcDataFile : public SXAddl {};
|
||||
class SXAddl_SXCQuery_SXDXMLSource : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmt_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmt_SXDSXCondFmt : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmts_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXCondFmts_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXDH_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXDH_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXDH_SXDSxdh : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDSXfilt : public SXAddl {};
|
||||
class SXAddl_SXCSXfilt_SXDSXItm : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDCaption : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilter : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilterDesc : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilterValue1: public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDSXFilterValue2: public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDXlsFilter : public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDXlsFilterValue1: public SXAddl {};
|
||||
class SXAddl_SXCSXFilter12_SXDXlsFilterValue2: public SXAddl {};
|
||||
class SXAddl_SXCSXFilters12_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXFilters12_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXMg_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXMg_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXMg_SXDUserCaption : public SXAddl {};
|
||||
class SXAddl_SXCSXMgs_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXMgs_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXMgs_SXDMGrpSXDHMap : public SXAddl {};
|
||||
class SXAddl_SXCSXrule_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCSXrule_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCSXrule_SXDSXrule : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCalcMember : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCalcMemString : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCompactColHdr : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDCompactRwHdr : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDEnd : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDId : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDSXPIIvmb : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDTableStyleClient : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDVer10Info : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDVer12Info : public SXAddl {};
|
||||
class SXAddl_SXCView_SXDVerUpdInv : public SXAddl {};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXDI::clone()
|
||||
|
||||
void SXDI::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXDI record is not implemented")
|
||||
Log::error("SXDI record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,57 @@ BaseObjectPtr SXEx::clone()
|
||||
|
||||
void SXEx::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXEx record is not implemented")
|
||||
Log::error("SXEx record is not implemented.");
|
||||
//record >> some_value;
|
||||
record >> csxformat >> cchErrorString >> cchNullString >> cchTag >> csxselect;
|
||||
|
||||
_UINT32 flags;
|
||||
record >> crwPage >> ccolPage >> flags;
|
||||
|
||||
fAcrossPageLay = GETBIT(flags, 0);
|
||||
cWrapPage = GETBITS(flags, 1, 9);
|
||||
fEnableWizard = GETBIT(flags, 16);
|
||||
fEnableDrilldown = GETBIT(flags, 17);
|
||||
fEnableFieldDialog = GETBIT(flags, 18);
|
||||
fPreserveFormatting = GETBIT(flags, 19);
|
||||
fMergeLabels = GETBIT(flags, 20);
|
||||
fDisplayErrorString = GETBIT(flags, 21);
|
||||
fDisplayNullString = GETBIT(flags, 22);
|
||||
fSubtotalHiddenPageItems = GETBIT(flags, 23);
|
||||
|
||||
record >> cchPageFieldStyle >> cchTableStyle >> cchVacateStyle;
|
||||
|
||||
if (cchErrorString > 0 && cchErrorString != 0xffff)
|
||||
{
|
||||
stError.setSize(cchErrorString);
|
||||
record >> stError;
|
||||
}
|
||||
if (cchNullString > 0 && cchNullString != 0xffff)
|
||||
{
|
||||
stDisplayNull.setSize(cchNullString);
|
||||
record >> stDisplayNull;
|
||||
}
|
||||
if (cchTag > 0 && cchTag != 0xffff)
|
||||
{
|
||||
stTag.setSize(cchTag);
|
||||
record >> stTag;
|
||||
}
|
||||
if (cchPageFieldStyle > 0 && cchPageFieldStyle != 0xffff)
|
||||
{
|
||||
stPageFieldStyle.setSize(cchPageFieldStyle);
|
||||
record >> stPageFieldStyle;
|
||||
}
|
||||
if (cchTableStyle > 0 && cchTableStyle != 0xffff)
|
||||
{
|
||||
stTableStyle.setSize(cchTableStyle);
|
||||
record >> cchTableStyle;
|
||||
}
|
||||
if (cchVacateStyle > 0 && cchVacateStyle != 0xffff)
|
||||
{
|
||||
stVacateStyle.setSize(cchVacateStyle);
|
||||
record >> cchVacateStyle;
|
||||
}
|
||||
|
||||
int skip = record.getDataSize() - record.getRdPtr();
|
||||
record.skipNunBytes(skip);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/BiffString.h"
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of SXEx record in BIFF8
|
||||
class SXEx: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SXEx)
|
||||
@ -47,13 +47,41 @@ public:
|
||||
~SXEx();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXEx;
|
||||
static const ElementType type = typeSXEx;
|
||||
|
||||
unsigned short csxformat;
|
||||
unsigned short cchErrorString;
|
||||
unsigned short cchNullString;
|
||||
unsigned short cchTag;
|
||||
unsigned short csxselect;
|
||||
|
||||
DRw crwPage;
|
||||
ColU ccolPage;
|
||||
|
||||
bool fAcrossPageLay;
|
||||
unsigned char cWrapPage;
|
||||
bool fEnableWizard;
|
||||
bool fEnableDrilldown;
|
||||
bool fEnableFieldDialog;
|
||||
bool fPreserveFormatting;
|
||||
bool fMergeLabels;
|
||||
bool fDisplayErrorString;
|
||||
bool fDisplayNullString;
|
||||
bool fSubtotalHiddenPageItems;
|
||||
|
||||
unsigned short cchPageFieldStyle;
|
||||
unsigned short cchTableStyle;
|
||||
unsigned short cchVacateStyle;
|
||||
|
||||
XLUnicodeStringNoCch stError;
|
||||
XLUnicodeStringNoCch stDisplayNull;
|
||||
XLUnicodeStringNoCch stTag;
|
||||
XLUnicodeStringNoCch stPageFieldStyle;
|
||||
XLUnicodeStringNoCch stTableStyle;
|
||||
XLUnicodeStringNoCch stVacateStyle;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXLI::clone()
|
||||
|
||||
void SXLI::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXLI record is not implemented")
|
||||
Log::error("SXLI record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXPI::clone()
|
||||
|
||||
void SXPI::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXPI record is not implemented")
|
||||
Log::error("SXPI record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXPIEx::clone()
|
||||
|
||||
void SXPIEx::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXPIEx record is not implemented")
|
||||
Log::error("SXPIEx record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -53,10 +53,7 @@ BaseObjectPtr SXStreamID::clone()
|
||||
|
||||
void SXStreamID::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXStreamID record is not implemented")
|
||||
Log::error("SXStreamID record is not implemented.");
|
||||
//record >> some_value;
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
record >> idStm;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,8 +53,7 @@ public:
|
||||
|
||||
static const ElementType type = typeSXStreamID;
|
||||
|
||||
|
||||
|
||||
short idStm;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SXString::clone()
|
||||
|
||||
void SXString::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXString record is not implemented")
|
||||
Log::error("SXString record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SXTBRGIITM::clone()
|
||||
|
||||
void SXTBRGIITM::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXTBRGIITM record is not implemented")
|
||||
Log::error("SXTBRGIITM record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SXTH::clone()
|
||||
|
||||
void SXTH::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXTH record is not implemented")
|
||||
Log::error("SXTH record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXTbl::clone()
|
||||
|
||||
void SXTbl::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXTbl record is not implemented")
|
||||
Log::error("SXTbl record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SXVDEx::clone()
|
||||
|
||||
void SXVDEx::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXVDEx record is not implemented")
|
||||
//Log::error("SXVDEx record is not implemented.");
|
||||
//record >> some_value;
|
||||
Log::error("SXVDEx record is not implemented.");
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXVDTEx::clone()
|
||||
|
||||
void SXVDTEx::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXVDTEx record is not implemented")
|
||||
Log::error("SXVDTEx record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXVI::clone()
|
||||
|
||||
void SXVI::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXVI record is not implemented")
|
||||
//Log::error("SXVI record is not implemented.");
|
||||
//record >> some_value;
|
||||
Log::error("SXVI record is not implemented.");
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,12 +52,7 @@ BaseObjectPtr SXVS::clone()
|
||||
|
||||
void SXVS::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXVS record is not implemented")
|
||||
Log::error("SXVS record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
|
||||
record >> sxvs;
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -47,13 +47,18 @@ public:
|
||||
~SXVS();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXVS;
|
||||
|
||||
short sxvs;
|
||||
|
||||
//enum
|
||||
//SHEET 0x0001
|
||||
//EXTERNAL 0x0002
|
||||
//CONSOLIDATION 0x0004
|
||||
//SCENARIO 0x0010
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -35,16 +35,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
SXViewEx::SXViewEx()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SXViewEx::~SXViewEx()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr SXViewEx::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SXViewEx(*this));
|
||||
@ -52,9 +42,11 @@ BaseObjectPtr SXViewEx::clone()
|
||||
|
||||
void SXViewEx::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXViewEx record is not implemented")
|
||||
Log::error("SXViewEx record is not implemented.");
|
||||
//record >> some_value;
|
||||
record >> frtHeaderOld >> csxth >> csxpi >> csxvdtex >> cbFuture;
|
||||
|
||||
if (cbFuture)
|
||||
rgbFuture = std::string(record.getCurData<char>(), cbFuture);
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
@ -43,16 +44,22 @@ class SXViewEx: public BiffRecord
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SXViewEx)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SXViewEx)
|
||||
public:
|
||||
SXViewEx();
|
||||
~SXViewEx();
|
||||
SXViewEx() {}
|
||||
~SXViewEx(){}
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXViewEx;
|
||||
static const ElementType type = typeSXViewEx;
|
||||
|
||||
FrtHeaderOld frtHeaderOld;
|
||||
_INT32 csxth;
|
||||
_INT32 csxpi;
|
||||
_INT32 csxvdtex;
|
||||
_UINT32 cbFuture;
|
||||
|
||||
std::string rgbFuture;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SXViewEx9::clone()
|
||||
|
||||
void SXViewEx9::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXViewEx9 record is not implemented")
|
||||
Log::error("SXViewEx9 record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SXViewLink::clone()
|
||||
|
||||
void SXViewLink::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SXViewLink record is not implemented")
|
||||
Log::error("SXViewLink record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -55,13 +55,14 @@ void Sort::readFields(CFRecord& record)
|
||||
{
|
||||
unsigned short flags;
|
||||
record >> flags;
|
||||
fCol = GETBIT(flags, 0);
|
||||
fKey1Dsc = GETBIT(flags, 1);
|
||||
fKey2Dsc = GETBIT(flags, 2);
|
||||
fKey3Dsc = GETBIT(flags, 3);
|
||||
|
||||
fCol = GETBIT(flags, 0);
|
||||
fKey1Dsc = GETBIT(flags, 1);
|
||||
fKey2Dsc = GETBIT(flags, 2);
|
||||
fKey3Dsc = GETBIT(flags, 3);
|
||||
fCaseSensitive = GETBIT(flags, 4);
|
||||
iOrder = GETBITS(flags, 5, 9);
|
||||
fAltMethod = GETBIT(flags, 10);
|
||||
iOrder = GETBITS(flags, 5, 9);
|
||||
fAltMethod = GETBIT(flags, 10);
|
||||
|
||||
unsigned char cchKey1;
|
||||
unsigned char cchKey2;
|
||||
|
||||
@ -48,7 +48,6 @@ public:
|
||||
~Sort();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "StartObject.h"
|
||||
#include <Logic/Biff_structures/FrtHeaderOld.h>
|
||||
#include "../Biff_structures/FrtHeaderOld.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SxDXF::clone()
|
||||
|
||||
void SxDXF::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxDXF record is not implemented")
|
||||
Log::error("SxDXF record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SxFilt::clone()
|
||||
|
||||
void SxFilt::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxFilt record is not implemented")
|
||||
Log::error("SxFilt record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,6 @@ public:
|
||||
~SxFilt();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SxFormat::clone()
|
||||
|
||||
void SxFormat::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxFormat record is not implemented")
|
||||
Log::error("SxFormat record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -52,9 +52,8 @@ BaseObjectPtr SxItm::clone()
|
||||
|
||||
void SxItm::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxItm record is not implemented")
|
||||
Log::error("SxItm record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -35,16 +35,6 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
SxIvd::SxIvd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
SxIvd::~SxIvd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BaseObjectPtr SxIvd::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SxIvd(*this));
|
||||
@ -53,10 +43,17 @@ BaseObjectPtr SxIvd::clone()
|
||||
|
||||
void SxIvd::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxIvd record is not implemented")
|
||||
Log::error("SxIvd record is not implemented.");
|
||||
//record >> some_value;
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
int rgSize = record.getDataSize() / 2;
|
||||
|
||||
for (int i = 0; i < rgSize; i++)
|
||||
{
|
||||
short val;
|
||||
record >> val;
|
||||
rgSxivd.push_back(val);
|
||||
}
|
||||
|
||||
int skip = record.getDataSize() - record.getRdPtr();
|
||||
record.skipNunBytes(skip);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -36,22 +36,21 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of SxIvd record in BIFF8
|
||||
class SxIvd: public BiffRecordContinued
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SxIvd)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SxIvd)
|
||||
public:
|
||||
SxIvd();
|
||||
~SxIvd();
|
||||
SxIvd() {}
|
||||
~SxIvd(){}
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSxIvd;
|
||||
static const ElementType type = typeSxIvd;
|
||||
|
||||
std::vector<short> rgSxivd;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SxRule::clone()
|
||||
|
||||
void SxRule::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxRule record is not implemented")
|
||||
Log::error("SxRule record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -47,13 +47,10 @@ public:
|
||||
~SxRule();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSxRule;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -53,9 +53,8 @@ BaseObjectPtr SxSelect::clone()
|
||||
|
||||
void SxSelect::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxSelect record is not implemented")
|
||||
Log::error("SxSelect record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,6 @@ public:
|
||||
~SxSelect();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
|
||||
@ -53,9 +53,7 @@ BaseObjectPtr SxTbpg::clone()
|
||||
|
||||
void SxTbpg::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxTbpg record is not implemented")
|
||||
Log::error("SxTbpg record is not implemented.");
|
||||
//record >> some_value;
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
|
||||
|
||||
@ -35,16 +35,20 @@
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
SxView::SxView()
|
||||
BiffStructurePtr SXAxis::clone()
|
||||
{
|
||||
return BiffStructurePtr(new SXAxis(*this));
|
||||
}
|
||||
|
||||
|
||||
SxView::~SxView()
|
||||
void SXAxis::load(CFRecord& record)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned short flags;
|
||||
record >> flags;
|
||||
|
||||
bRw = GETBIT(flags, 0);
|
||||
bCol = GETBIT(flags, 1);
|
||||
bPage = GETBIT(flags, 2);
|
||||
bData = GETBIT(flags, 3);
|
||||
}
|
||||
BaseObjectPtr SxView::clone()
|
||||
{
|
||||
return BaseObjectPtr(new SxView(*this));
|
||||
@ -52,10 +56,36 @@ BaseObjectPtr SxView::clone()
|
||||
|
||||
void SxView::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### SxView record is not implemented")
|
||||
Log::error("SxView record is not implemented.");
|
||||
//record >> some_value;
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
short reserved, flags;
|
||||
record >> ref >> rwFirstHead >> rwFirstData >> colFirstData >> iCache >> reserved;
|
||||
record >> sxaxis4Data >> ipos4Data;
|
||||
record >> cDim >> cDimRw >> cDimCol >> cDimPg >> cDimData >> cRw >> cCol;
|
||||
|
||||
record >> flags;
|
||||
fRwGrand = GETBIT(flags, 0);
|
||||
fColGrand = GETBIT(flags, 1);
|
||||
fAutoFormat = GETBIT(flags, 3);
|
||||
fAtrNum = GETBIT(flags, 4);
|
||||
fAtrFnt = GETBIT(flags, 5);
|
||||
fAtrAlc = GETBIT(flags, 6);
|
||||
fAtrBdr = GETBIT(flags, 7);
|
||||
fAtrPat = GETBIT(flags, 8);
|
||||
fAtrProc = GETBIT(flags, 9);
|
||||
|
||||
record >> itblAutoFmt >> cchTableName >> cchDataName;
|
||||
|
||||
if(cchTableName && cchTableName <= 0x00FF)
|
||||
{
|
||||
stTable.setSize(cchTableName);
|
||||
record >> stTable;
|
||||
}
|
||||
if(cchDataName > 0 && cchDataName <= 0x00FE)
|
||||
{
|
||||
stData.setSize(cchDataName);
|
||||
record >> stData;
|
||||
}
|
||||
int skip = record.getDataSize() - record.getRdPtr();
|
||||
record.skipNunBytes(skip);
|
||||
}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -32,27 +32,78 @@
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "../Biff_structures/BiffString.h"
|
||||
#include "../Biff_structures/CellRangeRef.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
class SXAxis : public BiffStructure
|
||||
{
|
||||
BASE_STRUCTURE_DEFINE_CLASS_NAME(SXAxis)
|
||||
public:
|
||||
|
||||
SXAxis(){}
|
||||
~SXAxis(){}
|
||||
|
||||
BiffStructurePtr clone();
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSXAxis;
|
||||
|
||||
bool bRw;
|
||||
bool bCol;
|
||||
bool bPage;
|
||||
bool bData;
|
||||
|
||||
};
|
||||
|
||||
// Logical representation of SxView record in BIFF8
|
||||
class SxView: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(SxView)
|
||||
BASE_OBJECT_DEFINE_CLASS_NAME(SxView)
|
||||
public:
|
||||
SxView();
|
||||
~SxView();
|
||||
SxView() {cchTableName = cchDataName = 0;}
|
||||
~SxView() {}
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSxView;
|
||||
static const ElementType type = typeSxView;
|
||||
|
||||
Ref8U ref;
|
||||
RwU rwFirstHead;
|
||||
RwU rwFirstData;
|
||||
ColU colFirstData;
|
||||
short iCache;
|
||||
short reserved;
|
||||
SXAxis sxaxis4Data;
|
||||
short ipos4Data;
|
||||
short cDim;
|
||||
unsigned short cDimRw;
|
||||
unsigned short cDimCol;
|
||||
unsigned short cDimPg;
|
||||
short cDimData;
|
||||
unsigned short cRw;
|
||||
unsigned short cCol;
|
||||
|
||||
bool fRwGrand;
|
||||
bool fColGrand;
|
||||
bool fAutoFormat;
|
||||
bool fAtrNum;
|
||||
bool fAtrFnt;
|
||||
bool fAtrAlc;
|
||||
bool fAtrBdr;
|
||||
bool fAtrPat;
|
||||
bool fAtrProc;
|
||||
|
||||
unsigned short itblAutoFmt; //enum AutoFmt8
|
||||
unsigned short cchTableName;
|
||||
unsigned short cchDataName;
|
||||
|
||||
XLUnicodeStringNoCch stTable;
|
||||
XLUnicodeStringNoCch stData;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -37,6 +37,7 @@ namespace XLS
|
||||
|
||||
Sxvd::Sxvd()
|
||||
{
|
||||
cchName = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -52,12 +53,31 @@ BaseObjectPtr Sxvd::clone()
|
||||
|
||||
void Sxvd::readFields(CFRecord& record)
|
||||
{
|
||||
#pragma message("####################### Sxvd record is not implemented")
|
||||
//Log::error("Sxvd record is not implemented.");
|
||||
//record >> some_value;
|
||||
short flags;
|
||||
record >> sxaxis >> cSub >> flags;
|
||||
|
||||
fDefault = GETBIT(flags, 0);
|
||||
fSum = GETBIT(flags, 1);
|
||||
fCounta = GETBIT(flags, 2);
|
||||
fAverage = GETBIT(flags, 3);
|
||||
fMax = GETBIT(flags, 4);
|
||||
fMin = GETBIT(flags, 5);
|
||||
fProduct = GETBIT(flags, 6);
|
||||
fCount = GETBIT(flags, 7);
|
||||
fStdev = GETBIT(flags, 8);
|
||||
fStdevp = GETBIT(flags, 9);
|
||||
fVariance = GETBIT(flags, 10);
|
||||
fVariancep = GETBIT(flags, 11);
|
||||
|
||||
record.skipNunBytes(record.getDataSize() - record.getRdPtr());
|
||||
}
|
||||
record >> cItm >> cchName;
|
||||
|
||||
if(cchName && cchName != 0xffff)
|
||||
{
|
||||
stName.setSize(cchName);
|
||||
record >> stName;
|
||||
}
|
||||
int skip = record.getDataSize() - record.getRdPtr();
|
||||
record.skipNunBytes(skip);}
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
|
||||
@ -31,13 +31,11 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "BiffRecord.h"
|
||||
#include "SxView.h"
|
||||
|
||||
namespace XLS
|
||||
{
|
||||
|
||||
|
||||
// Logical representation of Sxvd record in BIFF8
|
||||
class Sxvd: public BiffRecord
|
||||
{
|
||||
BIFF_RECORD_DEFINE_TYPE_INFO(Sxvd)
|
||||
@ -47,12 +45,31 @@ public:
|
||||
~Sxvd();
|
||||
|
||||
BaseObjectPtr clone();
|
||||
|
||||
|
||||
void readFields(CFRecord& record);
|
||||
|
||||
static const ElementType type = typeSxvd;
|
||||
|
||||
SXAxis sxaxis;
|
||||
unsigned short cSub;
|
||||
|
||||
bool fDefault;
|
||||
bool fSum;
|
||||
bool fCounta;
|
||||
bool fAverage;
|
||||
bool fMax;
|
||||
bool fMin;
|
||||
bool fProduct;
|
||||
bool fCount;
|
||||
bool fStdev;
|
||||
bool fStdevp;
|
||||
bool fVariance;
|
||||
bool fVariancep;
|
||||
|
||||
short cItm;
|
||||
unsigned short cchName;
|
||||
XLUnicodeStringNoCch stName;
|
||||
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -43,18 +43,15 @@ class Bes : public BiffStructure
|
||||
public:
|
||||
BiffStructurePtr clone();
|
||||
|
||||
static const ElementType type = typeBes;
|
||||
|
||||
static const ElementType type = typeBes;
|
||||
|
||||
virtual void load(CFRecord& record);
|
||||
|
||||
|
||||
const std::wstring toString();
|
||||
void fromString(const std::wstring str);
|
||||
|
||||
private:
|
||||
unsigned char bBoolErr;
|
||||
Boolean<unsigned char> fError;
|
||||
unsigned char bBoolErr;
|
||||
Boolean<unsigned char> fError;
|
||||
};
|
||||
|
||||
} // namespace XLS
|
||||
|
||||
@ -57,8 +57,8 @@ void ExtPtgArea3D::load(CFRecord& record)
|
||||
|
||||
void ExtPtgArea3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref)
|
||||
{
|
||||
#pragma message("####################### ExtPtgArea3D record is not implemented")
|
||||
Log::info("ExtPtgArea3D record is not implemented.");
|
||||
|
||||
ptg_stack.push(L"#REF!");
|
||||
}
|
||||
|
||||
|
||||
@ -52,8 +52,8 @@ void ExtPtgAreaErr3D::load(CFRecord& record)
|
||||
|
||||
void ExtPtgAreaErr3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref)
|
||||
{
|
||||
#pragma message("####################### ExtPtgAreaErr3D record is not implemented")
|
||||
Log::info("ExtPtgAreaErr3D record is not implemented.");
|
||||
|
||||
ptg_stack.push(L"#REF!");
|
||||
}
|
||||
|
||||
|
||||
@ -57,8 +57,8 @@ void ExtPtgRef3D::load(CFRecord& record)
|
||||
|
||||
void ExtPtgRef3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref )
|
||||
{
|
||||
#pragma message("####################### ExtPtgRef3D record is not implemented")
|
||||
Log::info("ExtPtgRef3D record is not implemented.");
|
||||
|
||||
ptg_stack.push(L"#REF!");
|
||||
}
|
||||
|
||||
|
||||
@ -51,8 +51,8 @@ void ExtPtgRefErr3D::load(CFRecord& record)
|
||||
|
||||
void ExtPtgRefErr3D::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool full_ref)
|
||||
{
|
||||
#pragma message("####################### ExtPtgRefErr3D record is not implemented")
|
||||
Log::info("ExtPtgRefErr3D record is not implemented.");
|
||||
|
||||
ptg_stack.push(L"#REF!");
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@
|
||||
|
||||
#include "FixedPoint.h"
|
||||
#include <Binary/CFRecord.h>
|
||||
//#include <Exception/AttributeDataWrong.h>
|
||||
|
||||
namespace OSHARED
|
||||
{
|
||||
@ -40,8 +39,14 @@ namespace OSHARED
|
||||
|
||||
FixedPoint::FixedPoint()
|
||||
{
|
||||
Integral = 0;
|
||||
Fractional = 0;
|
||||
}
|
||||
FixedPoint::FixedPoint(unsigned short cbElement_)
|
||||
{
|
||||
Integral = 0;
|
||||
Fractional = 0;
|
||||
}
|
||||
|
||||
|
||||
FixedPoint::FixedPoint(const int raw_data)
|
||||
{
|
||||
@ -49,7 +54,6 @@ FixedPoint::FixedPoint(const int raw_data)
|
||||
Integral = static_cast<unsigned char>(raw_data >> 16);
|
||||
}
|
||||
|
||||
|
||||
XLS::BiffStructurePtr FixedPoint::clone()
|
||||
{
|
||||
return XLS::BiffStructurePtr(new FixedPoint(*this));
|
||||
|
||||
@ -41,6 +41,7 @@ class CFRecord;
|
||||
class FixedPoint : public XLS::BiffAttribute
|
||||
{
|
||||
public:
|
||||
FixedPoint(unsigned short cbElement_); //fixed always!!
|
||||
FixedPoint();
|
||||
FixedPoint(const int raw_data);
|
||||
XLS::BiffStructurePtr clone();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user