Compare commits

...

3 Commits

Author SHA1 Message Date
a7bf12c052 . 2018-01-31 18:17:45 +03:00
5c01b23dee . 2018-01-30 20:09:22 +03:00
db11b75a2e x2t version 2.4.514 2018-01-30 19:37:10 +03:00
41 changed files with 180 additions and 633 deletions

View File

@ -21,8 +21,6 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS \

View File

@ -87,10 +87,14 @@ namespace BinDocxRW
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, m_mapIgnoreComments, NULL);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, pHdrFtr->m_arrShapeTypes);
smart_ptr<OOX::IFileContainer> oldRels = m_pOfficeDrawingConverter->GetRels();
m_pOfficeDrawingConverter->SetRels(oParamsDocumentWriter.m_pRels);
m_pOfficeDrawingConverter->ClearShapeTypes();
nCurPos = m_oBcw.WriteItemStart(c_oSerHdrFtrTypes::HdrFtr_Content);
oBinaryDocumentTableWriter.WriteDocumentContent(pHdrFtr->m_arrItems);
m_oBcw.WriteItemEnd(nCurPos);
m_pOfficeDrawingConverter->SetRels(oldRels);
}
}

View File

@ -3023,18 +3023,6 @@ namespace BinDocxRW
poDocument = NULL;
m_bWriteSectPr = false;
}
void prepareOfficeDrawingConverter(NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, OOX::IFileContainer *rels, std::vector<std::wstring>& aShapeTypes)
{
smart_ptr<OOX::IFileContainer> oldRels = pOfficeDrawingConverter->GetRels();
pOfficeDrawingConverter->SetRels(rels);
for(size_t i = 0, length = aShapeTypes.size(); i < length; ++i)
{
std::wstring& sShapeType = aShapeTypes[i];
pOfficeDrawingConverter->AddShapeType(sShapeType);
}
pOfficeDrawingConverter->SetRels(oldRels);
}
void WriteVbaProject(OOX::VbaProject& oVbaProject)
{
m_oBcw.m_oStream.StartRecord(0);
@ -7724,7 +7712,7 @@ namespace BinDocxRW
m_oParamsWriter.m_pCurRels = oParamsDocumentWriter.m_pRels;
int nStart = m_oBcw.WriteItemWithLengthStart();
WriteNotes(oFootnotes.m_arrFootnote, oParamsDocumentWriter, oFootnotes.m_arrShapeTypes);
WriteNotes(oFootnotes.m_arrFootnote, oParamsDocumentWriter);
m_oBcw.WriteItemWithLengthEnd(nStart);
}
void WriteEndnotes(OOX::CEndnotes& oEndnotes)
@ -7733,20 +7721,27 @@ namespace BinDocxRW
m_oParamsWriter.m_pCurRels = oParamsDocumentWriter.m_pRels;
int nStart = m_oBcw.WriteItemWithLengthStart();
WriteNotes(oEndnotes.m_arrEndnote, oParamsDocumentWriter, oEndnotes.m_arrShapeTypes);
WriteNotes(oEndnotes.m_arrEndnote, oParamsDocumentWriter);
m_oBcw.WriteItemWithLengthEnd(nStart);
}
void WriteNotes(const std::vector<OOX::CFtnEdn*>& arrNotes, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<std::wstring>& arrShapeTypes)
void WriteNotes(const std::vector<OOX::CFtnEdn*>& arrNotes, ParamsDocumentWriter& oParamsDocumentWriter)
{
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, NULL);
smart_ptr<OOX::IFileContainer> oldRels = m_pOfficeDrawingConverter->GetRels();
m_pOfficeDrawingConverter->SetRels(oParamsDocumentWriter.m_pRels);
m_pOfficeDrawingConverter->ClearShapeTypes();
int nCurPos = 0;
for(size_t i = 0 ; i < arrNotes.size(); ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerNotes::Note);
WriteNote(*arrNotes[i], oParamsDocumentWriter, arrShapeTypes);
WriteNote(*arrNotes[i], oBinaryDocumentTableWriter);
m_oBcw.WriteItemEnd(nCurPos);
}
m_pOfficeDrawingConverter->SetRels(oldRels);
}
void WriteNote(const OOX::CFtnEdn& oFtnEdn, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<std::wstring>& arrShapeTypes)
void WriteNote(const OOX::CFtnEdn& oFtnEdn, BinaryDocumentTableWriter & oBinaryDocumentTableWriter)
{
int nCurPos = 0;
if(oFtnEdn.m_oType.IsInit())
@ -7761,10 +7756,6 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteLONG(oFtnEdn.m_oId->GetValue());
m_oBcw.WriteItemEnd(nCurPos);
}
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, NULL);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, arrShapeTypes);
nCurPos = m_oBcw.WriteItemStart(c_oSerNotes::NoteContent);
oBinaryDocumentTableWriter.WriteDocumentContent(oFtnEdn.m_arrItems);
@ -7924,8 +7915,10 @@ namespace BinDocxRW
//DocumentTable всегда пишем последней, чтобы сначала заполнить все вспомогательные структуры, а при заполении документа, вызывать методы типа Style_Add...
BinDocxRW::BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, &oBinaryHeaderFooterTableWriter);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_oParamsWriter.m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, oDocx.m_pDocument->m_arrShapeTypes);
m_oParamsWriter.m_pOfficeDrawingConverter->SetRels(oParamsDocumentWriter.m_pRels);
m_oParamsWriter.m_pOfficeDrawingConverter->ClearShapeTypes();
oBinaryDocumentTableWriter.pSectPr = pFirstSectPr;
oBinaryDocumentTableWriter.pBackground = oDocx.m_pDocument->m_oBackground.GetPointer();
oBinaryDocumentTableWriter.poDocument = oDocx.m_pDocument;

View File

@ -16,8 +16,6 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
USE_AVSOFFICESTUDIO_XMLUTILS \
SOLUTION_ASCOFFICEDOCXFILE2 \
#DISABLE_FILE_DOWNLOADER \

View File

@ -22,8 +22,6 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS

View File

@ -777,7 +777,8 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
{
double page_width = 0;
const odf_reader::page_layout_instance * pp = root()->odf_context().pageLayoutContainer().page_layout_first();
if (pp)
if ((pp) && (pp->properties()))
{
odf_reader::style_page_layout_properties_attlist & attr_page = pp->properties()->attlist_;
if (attr_page.fo_page_width_)

View File

@ -233,8 +233,9 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
Context.set_paragraph_state (false);
Context.set_run_state (false);
Context.get_math_context().base_font_size_ = baseFontHeight_;
Context.start_math_formula();
Context.get_math_context().base_font_size_ = baseFontHeight_;
office_math_->oox_convert(Context.get_math_context());
Context.end_math_formula();

View File

@ -61,6 +61,7 @@ private:
document_context::document_context() : impl_( new document_context::Impl() )
{
level = 0;
}
document_context::~document_context()

View File

@ -45,10 +45,11 @@ class document_context
public:
document_context();
virtual ~document_context();
public:
void set_last_paragraph(text::paragraph * Paragraph);
text::paragraph * get_last_paragraph();
int level;
private:
class Impl;

View File

@ -151,6 +151,8 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
{
if (page_layout_instance * lastPageLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_by_name(Context.get_page_properties()))
{
Context.next_dump_page_properties(true);
lastPageLayout->docx_serialize(Context.output_stream(), Context);
//Context.remove_page_properties();
}

View File

@ -213,7 +213,7 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
double kf_max_width_ms =1.;
const page_layout_instance * pp = Context.root()->odf_context().pageLayoutContainer().page_layout_first();//
if (pp)
if ((pp) && (pp->properties()))
{
style_page_layout_properties_attlist & attr_page = pp->properties()->attlist_;
if (attr_page.fo_page_width_)

View File

@ -312,14 +312,29 @@ void paragraph::afterCreate(document_context * Context)
// вызывается сразу после создания объекта
if (Context)
{
// выставляем у предыдущего параграфа указатель на следующий (т.е. на вновь созданный)
if (paragraph * prevPar = Context->get_last_paragraph())
prevPar->set_next(this);
// запоминаем в контексте вновь созданный параграф
Context->set_last_paragraph(this);
Context->level++;
// выставляем у предыдущего параграфа указатель на следующий (т.е. на вновь созданный)
if (Context->level == 1)
{
if (paragraph * prevPar = Context->get_last_paragraph())
{
prevPar->set_next(this);
}
// запоминаем в контексте вновь созданный параграф
Context->set_last_paragraph(this);
}
}
}
void paragraph::afterReadContent(document_context * Context)
{
if (Context)
{
Context->level--;
}
}
const wchar_t * emptyParagraphContent = L"<w:pPr></w:pPr><w:r><w:rPr></w:rPr></w:r>";
const wchar_t * emptyParagraphDrawing = L"<w:p><w:pPr></w:pPr></w:p>";
@ -435,27 +450,6 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
std::wostream & _Wostream = Context.output_stream();
if (next_par_)
{
// проверяем не сменит ли следующий параграф свойства страницы.
// если да — устанавливаем контексту флаг на то что необходимо в конце текущего параграфа
// распечатать свойства раздела
//проверить ... не она ли текущая - может быть прописан дубляж - и тогда разрыв нарисуется ненужный
const std::wstring & next_styleName = next_par_->attrs_.text_style_name_;
const _CP_OPT(std::wstring) next_masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(next_styleName);
if ((next_masterPageName) && (Context.get_master_page_name() != *next_masterPageName))
{
Context.next_dump_page_properties(true);
is_empty = false;
}
}
if (next_section_ || next_end_section_)
{
Context.get_section_context().get().is_dump_ = true;
is_empty = false;
}
const _CP_OPT(std::wstring) masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(styleName);
if (masterPageName)
@ -469,6 +463,27 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
is_empty = false;
}
if (next_par_)
{
// проверяем не сменит ли следующий параграф свойства страницы.
// если да — устанавливаем контексту флаг на то что необходимо в текущем параграфе
// распечатать свойства раздела/секции
//проверить ... не она ли текущая - может быть прописан дубляж - и тогда разрыв нарисуется ненужный
const std::wstring & next_styleName = next_par_->attrs_.text_style_name_;
const _CP_OPT(std::wstring) next_masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(next_styleName);
if ((next_masterPageName) && (Context.get_master_page_name() != *next_masterPageName))
{
Context.next_dump_page_properties(true);
is_empty = false;
}
}
if (next_section_/* || next_end_section_*/)
{
Context.get_section_context().get().is_dump_ = true;
is_empty = false;
}
std::wstringstream strm;
if (Context.process_page_properties(strm))
{
@ -604,7 +619,10 @@ void h::afterCreate()
{
paragraph_.afterCreate( getContext() );
}
void h::afterReadContent()
{
paragraph_.afterReadContent( getContext() );
}
void h::docx_convert(oox::docx_conversion_context & Context)
{
paragraph_.docx_convert(Context);
@ -627,7 +645,10 @@ void p::afterCreate()
{
paragraph_.afterCreate( getContext() );
}
void p::afterReadContent()
{
paragraph_.afterReadContent( getContext() );
}
std::wostream & p::text_to_stream(std::wostream & _Wostream) const
{
return paragraph_.text_to_stream(_Wostream);

View File

@ -73,7 +73,8 @@ public:
}
void afterCreate(document_context * ctx);
void afterReadContent(document_context * ctx);
void docx_convert (oox::docx_conversion_context & Context) ;
void xlsx_convert (oox::xlsx_conversion_context & Context) ;
void pptx_convert (oox::pptx_conversion_context & Context) ;
@ -114,7 +115,9 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual void afterCreate();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual void afterReadContent();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
paragraph paragraph_;
@ -151,8 +154,9 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual void afterCreate();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual void afterReadContent();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
p(){};
paragraph paragraph_;
@ -245,7 +249,8 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual void afterCreate();
virtual void afterCreate();
virtual void afterReadContent();
private:

View File

@ -22,8 +22,6 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS

View File

@ -262,6 +262,8 @@ void DocxConverter::convert_document()
//----------------------------------------------------------------------------------------------------------
convert(docx_document->m_pDocument->m_oSectPr.GetPointer(), false, L"Standard");
odt_context->text_context()->clear_params();
for (size_t sect = 0; sect < sections.size(); sect++)
@ -1412,7 +1414,7 @@ void DocxConverter::apply_HF_from(OOX::Logic::CSectionProperty *props, OOX::Logi
}
}
}
void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection)
void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection, const std::wstring & master_name)
{
if (oox_section_pr == NULL) return;
current_section_properties = NULL;
@ -1437,18 +1439,24 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool b
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (!last_section_properties && (!bSection || continuous == false || oox_section_pr->m_oTitlePg.IsInit()))
{
last_section_properties = oox_section_pr;
}
else if (!bSection || continuous == false)
bool bDefault = (master_name == L"Standard");
if (!bDefault)
{
apply_HF_from(last_section_properties, oox_section_pr);
if (!last_section_properties && (!bSection || continuous == false || oox_section_pr->m_oTitlePg.IsInit()))
{
last_section_properties = oox_section_pr;
}
else if (!bSection || continuous == false)
{
apply_HF_from(last_section_properties, oox_section_pr);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (!bSection || continuous == false)
{
odt_context->page_layout_context()->add_master_page(bSection ? L"" : L"Standard");
odt_context->page_layout_context()->add_master_page(master_name);
}
bool present_header = false;
@ -1585,7 +1593,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool b
if (continuous == false || oox_section_pr->m_oTitlePg.IsInit())
{
OOX::Logic::CSectionProperty* s = last_section_properties;
OOX::Logic::CSectionProperty* s = last_section_properties ? last_section_properties : oox_section_pr;
bool present_title_page = s->m_oTitlePg.IsInit() ? true : false;
bool present_odd_even_pages = odt_context->page_layout_context()->even_and_left_headers_;
@ -1652,7 +1660,8 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool b
if (!add_odd_even_pages_footer && present_odd_even_pages) odt_context->add_empty_footer(1);
if (!add_default_footer && (present_odd_even_pages || present_title_page)) odt_context->add_empty_footer(0);
odt_context->is_paragraph_in_current_section_ = true;
if (!bDefault)
odt_context->is_paragraph_in_current_section_ = true;
//odt_context->set_master_page_name(odt_context->page_layout_context()->last_master() ?
// odt_context->page_layout_context()->last_master()->get_name() : L"");
@ -1694,24 +1703,27 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool b
odt_context->add_section_columns(num_columns,
oox_section_pr->m_oCols->m_arrColumns.size() > 0 ? -1 : default_space_pt , separator );
std::vector<std::pair<double,double>> width_space;
for (size_t i = 0; i< oox_section_pr->m_oCols->m_arrColumns.size(); i++)
if (num_columns > 1) //
{
if (oox_section_pr->m_oCols->m_arrColumns[i] == NULL) continue;
std::vector<std::pair<double,double>> width_space;
double space = default_space_pt;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace.IsInit())
space = oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace->ToPoints();
double w = -1;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oW.IsInit())
w = oox_section_pr->m_oCols->m_arrColumns[i]->m_oW->ToPoints();
for (size_t i = 0; i < oox_section_pr->m_oCols->m_arrColumns.size(); i++)
{
if (oox_section_pr->m_oCols->m_arrColumns[i] == NULL) continue;
double space = default_space_pt;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace.IsInit())
space = oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace->ToPoints();
width_space.push_back(std::pair<double,double>(w, space));
}
double w = -1;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oW.IsInit())
w = oox_section_pr->m_oCols->m_arrColumns[i]->m_oW->ToPoints();
width_space.push_back(std::pair<double,double>(w, space));
}
odt_context->add_section_column(width_space);
odt_context->add_section_column(width_space);
}
}
}
void DocxConverter::convert(OOX::Logic::CBackground *oox_background, int type)

View File

@ -184,7 +184,7 @@ namespace Oox2Odf
void convert(OOX::Logic::CBackground *oox_background, int type);
void convert(OOX::Logic::CSdt *oox_sdt);
void convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection);
void convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection, const std::wstring & master_name = L"");
void convert(OOX::Logic::CParagraph *oox_paragraph);
void convert(OOX::Logic::CRun *oox_run);
void convert(OOX::Logic::CParagraphProperty *oox_para_prop, odf_writer::style_paragraph_properties *paragraph_properties);

View File

@ -23,8 +23,6 @@ DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED \
USE_LITE_READER \
_USE_XMLLITE_READER_ \
_PRESENTATION_WRITER_ \
_SVG_CONVERT_TO_IMAGE_ \
DONT_WRITE_EMBEDDED_FONTS

View File

@ -937,6 +937,12 @@ void CDrawingConverter::SetEmbedDstPath(const std::wstring& sPath)
NSDirectory::CreateDirectory(sPath);
}
void CDrawingConverter::ClearShapeTypes()
{
m_mapShapeTypes.clear();
}
HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
{
std::wstring strXml = L"<main ";
@ -974,20 +980,24 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
if (oNode.IsValid())
{
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
XmlUtils::CXmlNode oNodeST = oNode.ReadNodeNoNS(L"shapetype");
std::wstring strId = oNodeST.GetAttribute(L"id");
pShape->LoadFromXMLShapeType(oNodeST);
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
pS->setBaseShape(CBaseShapePtr(pShape));
LoadCoordSize(oNodeST, pS);
//if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())//?? с затиранием ???
{
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
pShape->LoadFromXMLShapeType(oNodeST);
m_mapShapeTypes.insert(std::pair<std::wstring, CShapePtr>(strId, pS));
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
pS->setBaseShape(CBaseShapePtr(pShape));
LoadCoordSize(oNodeST, pS);
m_mapShapeTypes.insert(std::make_pair(strId, pS));
}
}
return S_OK;
@ -1094,6 +1104,12 @@ PPTX::Logic::SpTreeElem CDrawingConverter::ObjectFromXml(const std::wstring& sXm
}
else if (strName == L"pict" || strName == L"object")
{
//сначала shape type
XmlUtils::CXmlNode oNodeST;
if (oParseNode.GetNode(L"v:shapetype", oNodeST))
{
AddShapeType(oNodeST.GetXml());
}
XmlUtils::CXmlNodes oChilds;
if (oParseNode.GetNodes(L"*", oChilds))
{
@ -1148,10 +1164,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::ObjectFromXml(const std::wstring& sXm
#endif
}
}
else if (L"shapetype" == strNameP)
{
AddShapeType(oNodeP.GetXml());
}
else
{
continue;
@ -1447,6 +1459,13 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p
}
else if (strName == L"pict" || strName == L"object")
{
//сначала shape type
XmlUtils::CXmlNode oNodeST;
if (oParseNode.GetNode(L"v:shapetype", oNodeST))
{
AddShapeType(oNodeST.GetXml());
}
XmlUtils::CXmlNodes oChilds;
if (oParseNode.GetNodes(L"*", oChilds))
{
@ -1487,10 +1506,6 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p
doc_LoadGroup(pElem, oNodeP, pMainProps, true);
}
}
else if (L"shapetype" == strNameP)
{
AddShapeType(oNodeP.GetXml());
}
else
{
continue;
@ -2817,6 +2832,13 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
if (bIsTop) pTree->m_lGroupIndex = 0;
else pTree->m_lGroupIndex = 1;
//сначала shape type
XmlUtils::CXmlNode oNodeST;
if (oNode.GetNode(L"v:shapetype", oNodeST))
{
AddShapeType(oNodeST.GetXml());
}
XmlUtils::CXmlNodes oNodes;
if (oNode.GetNodes(L"*", oNodes))
{
@ -2828,30 +2850,7 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
std::wstring strNameP = XmlUtils::GetNameNoNS(oNodeT.GetName());
if (L"shapetype" == strNameP)
{
//AddShapeType(oNodeT.GetXml());
std::wstring strId = oNodeT.GetAttribute(L"id");
if (strId.length() > 0)
{
if (m_mapShapeTypes.find(strId) == m_mapShapeTypes.end())
{
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
pShape->LoadFromXMLShapeType(oNodeT);
CShapePtr pS = CShapePtr(new CShape(NSBaseShape::unknown, 0));
pS->setBaseShape(CBaseShapePtr(pShape));
LoadCoordSize(oNodeT, pS);
m_mapShapeTypes.insert(std::pair<std::wstring, CShapePtr>(strId, pS));
}
}
}
else if (L"shape" == strNameP ||
if (L"shape" == strNameP ||
L"rect" == strNameP ||
L"oval" == strNameP ||
L"line" == strNameP ||
@ -2873,6 +2872,8 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
if (_el.is_init())
pTree->SpTreeElems.push_back(_el);
}
else
continue;
}
}

View File

@ -225,7 +225,8 @@ namespace NSBinPptxRW
void SetMediaDstPath (const std::wstring& sMediaPath);
void SetEmbedDstPath (const std::wstring& sEmbedPath);
HRESULT AddShapeType (const std::wstring& sXml);
void ClearShapeTypes ();
HRESULT AddObject (const std::wstring& sXml, std::wstring** pMainProps);
HRESULT SaveObject (long lStart, long lLength, const std::wstring& sMainProps, std::wstring & sXml);
@ -293,6 +294,7 @@ namespace NSBinPptxRW
void Clear();
HRESULT SetCurrentRelsPath();
HRESULT AddShapeType (const std::wstring& sXml);
};
}
#endif //OOX_IFILE_CONTAINER_INCLUDE_H_

View File

@ -26,8 +26,6 @@ include($$PWD/../../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML \
#DISABLE_FILE_DOWNLOADER \
CXIMAGE_DONT_DECLARE_TCHAR \

View File

@ -21,8 +21,6 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE _UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS \
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML

View File

@ -19,8 +19,6 @@ include(../../../Common/base.pri)
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
DONT_WRITE_EMBEDDED_FONTS \
LIBXML_READER_ENABLED

View File

@ -18,8 +18,6 @@ include(../../../Common/base.pri)
DEFINES += UNICODE _UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
@ -72,7 +70,6 @@ SOURCES += \
../Source/Common/Index.cpp \
../Source/Common/NumFormat.cpp \
../Source/Common/Position.cpp \
../Source/Common/Utils.cpp \
../Source/Common/Wrap.cpp \
../Source/Common/ZIndex.cpp \
../Source/Common/SimpleTypes_Word.cpp \
@ -108,7 +105,6 @@ HEADERS += docxformatlib.h \
../Source/Common/SimpleTypes_Word.h \
../Source/Common/Size.h \
../Source/Common/Unit.h \
../Source/Common/Utils.h \
../Source/Common/Wrap.h \
../Source/Common/ZIndex.h \
../Source/DocxFormat/Drawing/Drawing.h \

View File

@ -59,7 +59,6 @@
#include "../Source/Common/Index.cpp"
#include "../Source/Common/NumFormat.cpp"
#include "../Source/Common/Position.cpp"
#include "../Source/Common/Utils.cpp"
#include "../Source/Common/Wrap.cpp"
#include "../Source/Common/ZIndex.cpp"
#include "../Source/Common/SimpleTypes_Word.cpp"

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@ -114,7 +114,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -181,7 +181,7 @@
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=".\..\Source\XML\libxml2\XML\include;.\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist;..\..\ASCOfficeOdtFile\Source\OfficeSvmFile"
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
ProgramDataBaseFileName="$(IntDir)\DocxFormat.pdb"
@ -246,7 +246,7 @@
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=".\..\Source\XML\libxml2\XML\include;.\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist;..\..\ASCOfficeOdtFile\Source\OfficeSvmFile"
PreprocessorDefinitions="USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
PreprocessorDefinitions="_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
ProgramDataBaseFileName="$(IntDir)\DocxFormat.pdb"
@ -1381,14 +1381,6 @@
RelativePath="..\Source\Common\Unit.h"
>
</File>
<File
RelativePath="..\Source\Common\Utils.cpp"
>
</File>
<File
RelativePath="..\Source\Common\Utils.h"
>
</File>
<File
RelativePath="..\Source\Common\Wrap.cpp"
>

View File

@ -145,7 +145,6 @@ namespace NSCommon
this->m_pPointer = new Type(oNode);
return *this;
}
#ifdef _USE_XMLLITE_READER_
nullable<Type>& operator=(XmlUtils::CXmlLiteReader& oReader)
{
RELEASEOBJECT(this->m_pPointer);
@ -153,7 +152,6 @@ namespace NSCommon
this->m_pPointer = new Type(oReader);
return *this;
}
#endif
nullable<Type>& operator=(const wchar_t* cwsValue)
{
RELEASEOBJECT(this->m_pPointer);

View File

@ -1,56 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "Utils.h"
#include "../../../DesktopEditor/xml/include/xmlutils.h"
void Common::readAllShapeTypes(const OOX::CPath& oPath, std::vector<std::wstring>& aShapetypes)
{
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
while ( false != oReader.ReadNextNode() )
{
std::wstring sName = oReader.GetName();
if(_T("v:shapetype") == sName)
{
std::wstring sXml = oReader.GetOuterXml();
if(false == sXml.empty())
aShapetypes.push_back(sXml);
}
}
}

View File

@ -1,44 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef COMMON_UTILS_INCLUDE_H_
#define COMMON_UTILS_INCLUDE_H_
#include "../SystemUtility/SystemUtility.h"
#include <vector>
namespace Common
{
void readAllShapeTypes(const OOX::CPath& oPath, std::vector<std::wstring>& aShapetypes);
} // namespace Common
#endif // COMMON_UTILS_INCLUDE_H_

View File

@ -320,8 +320,6 @@ namespace OOX
}
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -341,7 +339,6 @@ namespace OOX
m_arrComments.push_back( new CComment(oReader) );
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
@ -436,8 +433,6 @@ namespace OOX
}
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -457,7 +452,6 @@ namespace OOX
m_arrComments.push_back( new CCommentExt(oReader) );
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
@ -598,7 +592,6 @@ namespace OOX
}
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -618,7 +611,6 @@ namespace OOX
m_arrPeoples.push_back( new CPerson(oReader) );
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const

View File

@ -186,9 +186,8 @@ namespace OOX
virtual void read(const CPath& oRootPath, const CPath& oFilePath)
{
IFileContainer::Read( oRootPath, oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
return;
@ -220,7 +219,6 @@ namespace OOX
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const

View File

@ -37,7 +37,6 @@
#include "../Common/SimpleTypes_Word.h"
#include "../Common/SimpleTypes_Shared.h"
#include "../Common/Utils.h"
#include "WritingElement.h"
#include "File.h"
@ -73,8 +72,6 @@ namespace OOX
virtual ~CBackground()
{
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:color"), m_oColor );
@ -326,9 +323,6 @@ namespace OOX
m_bMacroEnabled = true;
}
#ifdef USE_LITE_READER
Common::readAllShapeTypes(oPath, m_arrShapeTypes);//todooo перенести на уровень OOX::Documet чтоли - при чтении xml
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
@ -360,104 +354,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oDocument;
oDocument.FromXmlFile2( oPath.GetPath() );
if ( _T("w:document") == oDocument.GetName() )
{
oDocument.ReadAttributeBase( _T("w:conformance"), m_oConformance );
XmlUtils::CXmlNode oBackground;
if ( oDocument.GetNode( _T("w:background"), oBackground ) )
m_oBackground = oBackground;
XmlUtils::CXmlNode oBody;
if ( oDocument.GetNode( _T("w:body"), oBody ) )
{
XmlUtils::CXmlNodes oBodyChilds;
if ( oBody.GetNodes( _T("*"), oBodyChilds ) )
{
XmlUtils::CXmlNode oItem;
for (unsigned int nIndex = 0; nIndex < oBodyChilds.GetCount(); nIndex++ )
{
if ( oBodyChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
/*if ( _T("w:altChunk") == sName )
pItem = new Logic::CAltChunk( oItem );
else*/ if ( _T("w:bookmarkEnd") == sName )
pItem = new Logic::CBookmarkEnd( oItem );
else if ( _T("w:bookmarkStart") == sName )
pItem = new Logic::CBookmarkStart( oItem );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new Logic::CCommentRangeEnd( oItem );
else if ( _T("w:commentRangeStart") == sName )
pItem = new Logic::CCommentRangeStart( oItem );
//else if ( _T("w:customXml") == sName )
// pItem = new Logic::CCustomXml( oItem );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new Logic::CCustomXmlDelRangeEnd( oItem );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new Logic::CCustomXmlDelRangeStart( oItem );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new Logic::CCustomXmlInsRangeEnd( oItem );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new Logic::CCustomXmlInsRangeStart( oItem );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeEnd( oItem );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeStart( oItem );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveToRangeEnd( oItem );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveToRangeStart( oItem );
//else if ( _T("w:del") == sName )
// pItem = new Logic::CDel( oItem );
//else if ( _T("w:ins") == sName )
// pItem = new Logic::CIns( oItem );
//else if ( _T("w:moveFrom") == sName )
// pItem = new Logic::CMoveFrom( oItem );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new Logic::CMoveFromRangeEnd( oItem );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new Logic::CMoveFromRangeStart( oItem );
//else if ( _T("w:moveTo") == sName )
// pItem = new Logic::CMoveTo( oItem );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new Logic::CMoveToRangeEnd( oItem );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new Logic::CMoveToRangeStart( oItem );
else if ( _T("m:oMath") == sName )
pItem = new Logic::COMath( oItem );
else if ( _T("m:oMathPara") == sName )
pItem = new Logic::COMathPara( oItem );
else if ( _T("w:p") == sName )
pItem = new Logic::CParagraph( oItem );
else if ( _T("w:permEnd") == sName )
pItem = new Logic::CPermEnd( oItem );
else if ( _T("w:permStart") == sName )
pItem = new Logic::CPermStart( oItem );
else if ( _T("w:proofErr") == sName )
pItem = new Logic::CProofErr( oItem );
else if ( _T("w:sdt") == sName )
pItem = new Logic::CSdt( oItem );
else if ( _T("w:sectPr") == sName )
m_oSectPr = oItem;
else if ( _T("w:tbl") == sName )
pItem = new Logic::CTbl( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
}
}
#endif
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
@ -664,8 +560,6 @@ mc:Ignorable=\"w14 wp14\">";
nullable<OOX::Logic::CBackground > m_oBackground;
std::vector<WritingElement *> m_arrItems;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX

View File

@ -80,8 +80,6 @@ namespace OOX
m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -158,7 +156,6 @@ namespace OOX
CPath m_oReadPath;
std::vector<OOX::CFtnEdn*> m_arrEndnote;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX
#endif // OOX_ENDNOTE_INCLUDE_H_

View File

@ -80,8 +80,6 @@ namespace OOX
m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -158,7 +156,6 @@ namespace OOX
CPath m_oReadPath;
std::vector<OOX::CFtnEdn*> m_arrFootnote;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX

View File

@ -78,8 +78,6 @@ namespace OOX
m_arrItems.clear();
}
public:
virtual void read(const CPath& oFilePath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
@ -90,8 +88,6 @@ namespace OOX
{
m_oReadPath = oFilePath;
IFileContainer::Read( oRootPath, oFilePath );
#ifdef USE_LITE_READER
Common::readAllShapeTypes(oFilePath, m_arrShapeTypes);
XmlUtils::CXmlLiteReader oReader;
@ -183,95 +179,6 @@ namespace OOX
m_arrItems.push_back( pItem );
}
}
#else
XmlUtils::CXmlNode oMainNode;
oMainNode.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:ftr") == oMainNode.GetName() )
m_eType = et_w_ftr;
else if ( _T("w:hdr") == oMainNode.GetName() )
m_eType = et_w_hdr;
else
return;
XmlUtils::CXmlNodes oChilds;
if ( oMainNode.GetNodes( _T("*"), oChilds ) )
{
XmlUtils::CXmlNode oItem;
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
{
if ( oChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
/*if ( _T("w:altChunk") == sName )
pItem = new Logic::AltChunk( oItem );
else */if ( _T("w:bookmarkEnd") == sName )
pItem = new Logic::CBookmarkEnd( oItem );
else if ( _T("w:bookmarkStart") == sName )
pItem = new Logic::CBookmarkStart( oItem );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new Logic::CCommentRangeEnd( oItem );
else if ( _T("w:commentRangeStart") == sName )
pItem = new Logic::CCommentRangeStart( oItem );
//else if ( _T("w:customXml") == sName )
// pItem = new Logic::CCustomXml( oItem );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new Logic::CCustomXmlDelRangeEnd( oItem );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new Logic::CCustomXmlDelRangeStart( oItem );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new Logic::CCustomXmlInsRangeEnd( oItem );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new Logic::CCustomXmlInsRangeStart( oItem );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeEnd( oItem );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveFromRangeStart( oItem );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new Logic::CCustomXmlMoveToRangeEnd( oItem );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new Logic::CCustomXmlMoveToRangeStart( oItem );
//else if ( _T("w:del") == sName )
// pItem = new Logic::CDel( oItem );
//else if ( _T("w:ins") == sName )
// pItem = new Logic::CIns( oItem );
//else if ( _T("w:moveFrom") == sName )
// pItem = new Logic::CMoveFrom( oItem );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new Logic::CMoveFromRangeEnd( oItem );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new Logic::CMoveFromRangeStart( oItem );
//else if ( _T("w:moveTo") == sName )
// pItem = new Logic::CMoveTo( oItem );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new Logic::CMoveToRangeEnd( oItem );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new Logic::CMoveToRangeStart( oItem );
else if ( _T("m:oMath") == sName )
pItem = new Logic::COMath( oItem );
else if ( _T("m:oMathPara") == sName )
pItem = new Logic::COMathPara( oItem );
else if ( _T("w:p") == sName )
pItem = new Logic::CParagraph( oItem );
else if ( _T("w:permEnd") == sName )
pItem = new Logic::CPermEnd( oItem );
else if ( _T("w:permStart") == sName )
pItem = new Logic::CPermStart( oItem );
else if ( _T("w:proofErr") == sName )
pItem = new Logic::CProofErr( oItem );
else if ( _T("w:sdt") == sName )
pItem = new Logic::CSdt( oItem );
else if ( _T("w:tbl") == sName )
pItem = new Logic::CTbl( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{
@ -371,7 +278,6 @@ mc:Ignorable=\"w14 wp14\">");
OOX::EElementType m_eType;
std::vector<WritingElement* > m_arrItems;
std::vector<std::wstring> m_arrShapeTypes;
};
} // namespace OOX

View File

@ -854,7 +854,6 @@ namespace OOX
virtual void read(const CPath& oRootPath, const CPath& oFilePath)
{
IFileContainer::Read( oRootPath, oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
@ -890,59 +889,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oNumbering;
oNumbering.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:numbering") == oNumbering.GetName() )
{
XmlUtils::CXmlNodes oAbstractNumList;
oNumbering.GetNodes( _T("w:abstractNum"), oAbstractNumList );
for ( int nIndex = 0; nIndex < oAbstractNumList.GetCount(); nIndex++ )
{
XmlUtils::CXmlNode oAbstractNumNode;
if ( oAbstractNumList.GetAt( nIndex, oAbstractNumNode ) )
{
//OOX::Numbering::CAbstractNum oAbstractNum = oAbstractNumNode;
m_arrAbstractNum.push_back( /*oAbstractNum*/ new OOX::Numbering::CAbstractNum (oAbstractNumNode) );
}
}
XmlUtils::CXmlNodes oNumList;
oNumbering.GetNodes( _T("w:num"), oNumList );
for ( int nIndex = 0; nIndex < oNumList.GetCount(); nIndex++ )
{
XmlUtils::CXmlNode oNumNode;
if ( oNumList.GetAt( nIndex, oNumNode ) )
{
//OOX::Numbering::CNum oNum = oNumNode;
m_arrNum.push_back( /*oNum*/ new OOX::Numbering::CNum (oNumNode) );
}
}
XmlUtils::CXmlNode oNumIdPicBulletNode;
if ( oNumbering.GetNode( _T("w:numIdMacAtCleanup"), oNumIdPicBulletNode ) )
m_oNumIdMacAtCleanup = oNumIdPicBulletNode;
// TO DO: ак будут сделаны классы CDrawing, нужно будет сделать чтение
// w:numPicBullet
XmlUtils::CXmlNodes oNumPicList;
oNumbering.GetNodes( _T("w:numPicBullet"), oNumPicList );
for ( int nIndex = 0; nIndex < oNumPicList.GetCount(); nIndex++ )
{
XmlUtils::CXmlNode oNumNode;
if ( oNumPicList.GetAt( nIndex, oNumNode ) )
{
//OOX::Numbering::CNumPicBullet oNum = oNumNode;
m_arrNumPicBullet.push_back( /*oNum*/ new OOX::Numbering::CNumPicBullet (oNumNode) );
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const

View File

@ -184,8 +184,6 @@ namespace OOX
{
CPath oRelsPath = CreateFileName( oFilePath );
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oRelsPath.GetPath() ) )
@ -217,33 +215,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oNode;
if ( oNode.FromXmlFile( oRelsPath.GetPath() ) && _T("Relationships") == oNode.GetName() )
{
XmlUtils::CXmlNodes oNodes;
if ( oNode.GetNodes( _T("Relationship"), oNodes ) )
{
XmlUtils::CXmlNode oRelNode;
for ( int nIndex = 0; nIndex < oNodes.GetCount(); nIndex++ )
{
if ( oNodes.GetAt( nIndex, oRelNode ) )
{
Rels::CRelationShip *pRel = new Rels::CRelationShip (oRelNode);
if (pRel)
{
std::wstring rid = pRel->rId().get();
m_arRelations.push_back(pRel);
m_mapRelations.insert(std::make_pair( rid, pRel) );
}
}
}
}
}
#endif
}
void Write(const CPath& oFilePath) const
{

View File

@ -2847,7 +2847,6 @@ namespace OOX
public:
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -3024,16 +3023,6 @@ namespace OOX
}
}
}
#else
XmlUtils::CXmlNode oWebSettings;
oWebSettings.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:settings") == oWebSettings.GetName() )
{
XmlUtils::CXmlNode oNode;
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{

View File

@ -160,7 +160,6 @@ namespace OOX
public:
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -182,22 +181,6 @@ namespace OOX
m_oOptimizeForBrowser = oReader;
}
}
#else
XmlUtils::CXmlNode oWebSettings;
oWebSettings.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:webSettings") == oWebSettings.GetName() )
{
XmlUtils::CXmlNode oNode;
if ( oWebSettings.GetNode( _T("w:allowPNG"), oNode ) )
m_oAllowPNG = oNode;
if ( oWebSettings.GetNode( _T("w:optimizeForBrowser"), oNode ) )
m_oOptimizeForBrowser = oNode;
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{

View File

@ -799,8 +799,6 @@ namespace OOX
public:
virtual void read(const CPath& oFilePath)
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oFilePath.GetPath() ) )
@ -835,41 +833,6 @@ namespace OOX
m_oLatentStyles = oReader;
}
}
#else
XmlUtils::CXmlNode oStyles;
oStyles.FromXmlFile( oFilePath.GetPath(), true );
if ( _T("w:styles") == oStyles.GetName() )
{
XmlUtils::CXmlNode oChild;
if ( oStyles.GetNode( _T("w:docDefaults"), oChild ) )
m_oDocDefaults = oChild;
if ( oStyles.GetNode( _T("w:latentStyles"), oChild ) )
m_oLatentStyles = oChild;
XmlUtils::CXmlNodes oStyleList;
oStyles.GetNodes( _T("w:style"), oStyleList );
for ( int nStlyeIndex = 0; nStlyeIndex < oStyleList.GetCount(); nStlyeIndex++ )
{
XmlUtils::CXmlNode oStyleNode;
if ( oStyleList.GetAt( nStlyeIndex, oStyleNode ) )
{
OOX::CStyle *oStyle = new OOX::CStyle (oStyleNode);
if (oStyle)
{
if (oStyle->m_oName.IsInit())
{
m_arrStyleNamesMap[oStyle->m_oName->ToString()] = m_arrStyle.size();
}
m_arrStyle.push_back( oStyle );
}
}
}
}
#endif
}
virtual void write(const CPath& oFilePath, const CPath& oDirectory, CContentTypes& oContent) const
{

View File

@ -1,4 +1,4 @@
VERSION = 2.4.512.0
VERSION = 2.4.514.0
DEFINES += INTVER=$$VERSION
# CONFIGURATION

View File

@ -41,8 +41,6 @@ core_linux_64 {
DEFINES += UNICODE \
_UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
#DISABLE_FILE_DOWNLOADER \
FILTER_FLATE_DECODE_ENABLED \
CXIMAGE_DONT_DECLARE_TCHAR \