Commit 909a7b0a authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov
parent 8299b3fa
......@@ -38,7 +38,7 @@ namespace Oox2Odf
impl_ = NULL;
if (type == _T("text")) impl_ = new DocxConverter(path, CallBack);
if (type == _T("spreadsheet")) impl_ = new XlsxConverter(path, CallBack);
if (type == _T("spreadsheet")) impl_ = new XlsxConverter(path, CallBack);
if (impl_)
impl_->set_fonts_directory(fontsPath);
......
......@@ -45,6 +45,12 @@ DocxConverter::DocxConverter(const std::wstring & path, const ProgressCallback*
if (UpdateProgress(290000))return;
}
DocxConverter::~DocxConverter()
{
if (odt_context) delete odt_context; odt_context = NULL;
if (docx_document) delete docx_document; docx_document = NULL;
if (output_document) delete output_document; output_document = NULL;
}
void DocxConverter::write(const std::wstring & path)
{
if (!output_document)return;
......
......@@ -96,21 +96,22 @@ namespace Oox2Odf
{
public:
DocxConverter(const std::wstring & path, const ProgressCallback* ffCallBack);
~DocxConverter();
virtual void convertDocument();
virtual void write(const std::wstring & path);
virtual odf_writer::odf_conversion_context *odf_context();
virtual OOX::CTheme *oox_theme();
virtual CString find_link_by_id (CString sId, int t);
virtual OOX::CTheme *oox_theme();
virtual CString find_link_by_id (CString sId, int t);
void convert(OOX::WritingElement *oox_unknown);
void convert(OOX::WritingElement *oox_unknown);
private:
OOX::CDocx *docx_document;
OOX::CDocx *docx_document;
cpdoccore::odf_writer::package::odf_document *output_document;
odf_writer::odt_conversion_context *odt_context;
OOX::Logic::CSectionProperty *last_section_properties;
OOX::Logic::CSectionProperty *last_section_properties;
void apply_from(OOX::Logic::CSectionProperty *props, OOX::Logic::CSectionProperty *other);
......
......@@ -38,6 +38,12 @@ XlsxConverter::XlsxConverter(const std::wstring & path, const ProgressCallback*
if (UpdateProgress(400000))return;
}
XlsxConverter::~XlsxConverter()
{
if (ods_context) delete ods_context; ods_context = NULL;
if (xlsx_document) delete xlsx_document; xlsx_document = NULL;
if (output_document) delete output_document; output_document = NULL;
}
void XlsxConverter::write(const std::wstring & path)
{
if (!output_document)return;
......
......@@ -98,18 +98,19 @@ namespace Oox2Odf
{
public:
XlsxConverter(const std::wstring & path, const ProgressCallback* ffCallBack);
~XlsxConverter();
virtual void convertDocument();
virtual void write(const std::wstring & path);
virtual odf_writer::odf_conversion_context *odf_context();
virtual OOX::CTheme *oox_theme();
virtual CString find_link_by_id (CString sId, int t);
virtual OOX::CTheme *oox_theme();
virtual CString find_link_by_id (CString sId, int t);
void convert(OOX::Spreadsheet::WritingElement *oox_unknown);
private:
OOX::Spreadsheet::CXlsx *xlsx_document;
OOX::Spreadsheet::CDrawing *xlsx_current_drawing; // .. ,
OOX::Spreadsheet::CXlsx *xlsx_document;
OOX::Spreadsheet::CDrawing *xlsx_current_drawing; // .. ,
odf_writer::ods_conversion_context *ods_context;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment