Commit c4765e9f authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #24236

parent 3ff5233e
...@@ -157,6 +157,13 @@ namespace formulasconvert { ...@@ -157,6 +157,13 @@ namespace formulasconvert {
if (convert_with_TableName) if (convert_with_TableName)
{ {
if (std::wstring::npos != sheet1.find(L" "))
{
if (sheet1[0] != L'\'')
{
sheet1 = L"'" + sheet1 + L"'";
}
}
return (sheet1 + L"!") + c1 + (c2.empty() ? L"" : (L":" + c2) ); return (sheet1 + L"!") + c1 + (c2.empty() ? L"" : (L":" + c2) );
} }
else else
...@@ -579,10 +586,14 @@ namespace formulasconvert { ...@@ -579,10 +586,14 @@ namespace formulasconvert {
} }
std::wstring odf2oox_converter::convert_named_expr(const std::wstring& expr, bool withTableName) std::wstring odf2oox_converter::convert_named_expr(const std::wstring& expr, bool withTableName)
{ {
std::wstring workstr = expr;
bool isFormula = impl_->check_formula(workstr);
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
std::wstring workstr = boost::regex_replace( workstr = boost::regex_replace(
expr, workstr,
complexRef, complexRef,
&replace_point_space, &replace_point_space,
boost::match_default | boost::format_all); boost::match_default | boost::format_all);
...@@ -603,6 +614,11 @@ namespace formulasconvert { ...@@ -603,6 +614,11 @@ namespace formulasconvert {
XmlUtils::replace_all( workstr, L"PROBEL" , L" "); XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'"); XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
XmlUtils::replace_all( workstr, L"TOCHKA" , L"."); XmlUtils::replace_all( workstr, L"TOCHKA" , L".");
if (!isFormula)
{
workstr = L"\"" + workstr + L"\"";
}
return workstr; return workstr;
} }
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include <boost/foreach.hpp>
#include "docx_content_type.h" #include "docx_content_type.h"
#include "namespaces.h" #include "namespaces.h"
...@@ -86,14 +84,14 @@ std::wostream & content_type_content::xml_to_stream(std::wostream & _Wostream) c ...@@ -86,14 +84,14 @@ std::wostream & content_type_content::xml_to_stream(std::wostream & _Wostream) c
CP_XML_ATTR(L"xmlns", xmlns::types.value); CP_XML_ATTR(L"xmlns", xmlns::types.value);
BOOST_FOREACH(const xml::element_wc & elm, default_) for (size_t i = 0; i < default_.size(); i++)
{ {
elm.xml_to_stream(CP_XML_STREAM()); default_[i].xml_to_stream(CP_XML_STREAM());
} }
BOOST_FOREACH(const xml::element_wc & elm, override_) for (size_t i = 0; i < override_.size(); i++)
{ {
elm.xml_to_stream(CP_XML_STREAM()); override_[i].xml_to_stream(CP_XML_STREAM());
} }
} }
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* *
*/ */
#include <boost/foreach.hpp>
#include "docx_package.h" #include "docx_package.h"
#include "docx_conversion_context.h" #include "docx_conversion_context.h"
...@@ -218,26 +219,25 @@ void docx_charts_files::write(const std::wstring & RootPath) ...@@ -218,26 +219,25 @@ void docx_charts_files::write(const std::wstring & RootPath)
size_t count = 0; size_t count = 0;
BOOST_FOREACH(const chart_content_ptr & item, charts_) for (int i = 0 ; i < charts_.size(); i++)
{ {
if (item) if (!charts_[i]) continue;
{
count++; count++;
const std::wstring fileName = std::wstring(L"chart") + std::to_wstring(count) + L".xml"; const std::wstring fileName = std::wstring(L"chart") + std::to_wstring(count) + L".xml";
const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml"; const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml";
content_type_content * contentTypes = get_main_document()->get_content_types_file().content(); content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
contentTypes->add_override(std::wstring(L"/word/charts/") + fileName, kWSConType); contentTypes->add_override(std::wstring(L"/word/charts/") + fileName, kWSConType);
package::simple_element(fileName, item->str()).write(path); package::simple_element(fileName, charts_[i]->str()).write(path);
rels_files relFiles; rels_files relFiles;
item->get_rel_file()->set_file_name(fileName + L".rels"); charts_[i]->get_rel_file()->set_file_name(fileName + L".rels");
relFiles.add_rel_file(item->get_rel_file()); relFiles.add_rel_file(charts_[i]->get_rel_file());
relFiles.write(path); relFiles.write(path);
}
} }
} }
/////////////////////////// ///////////////////////////
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h> #include <cpdoccore/CPSharedPtr.h>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "docx_conversion_context.h" #include "docx_conversion_context.h"
#include "logging.h" #include "logging.h"
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
#include "../odf/odfcontext.h" #include "../odf/odfcontext.h"
......
...@@ -33,9 +33,6 @@ ...@@ -33,9 +33,6 @@
#include "hyperlinks.h" #include "hyperlinks.h"
#include "oox_rels.h" #include "oox_rels.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
namespace cpdoccore { namespace cpdoccore {
......
...@@ -31,10 +31,8 @@ ...@@ -31,10 +31,8 @@
*/ */
#include "oox_chart_axis.h" #include "oox_chart_axis.h"
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include <boost/foreach.hpp>
#include "oox_title.h" #include "oox_title.h"
#include "oox_chart_shape.h" #include "oox_chart_shape.h"
...@@ -181,18 +179,18 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream) ...@@ -181,18 +179,18 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
} }
} }
BOOST_FOREACH(odf_reader::chart::axis::grid & g, content_.grids_) for (size_t i = 0; i < content_.grids_.size(); i++)
{ {
_oox_fill fill_null; _oox_fill fill_null;
shape.set(g.graphic_properties_, fill_null); shape.set(content_.grids_[i].graphic_properties_, fill_null);
if (g.type_ == odf_reader::chart::axis::grid::major) if (content_.grids_[i].type_ == odf_reader::chart::axis::grid::major)
{ {
CP_XML_NODE(L"c:majorGridlines") CP_XML_NODE(L"c:majorGridlines")
{ {
shape.oox_serialize(CP_XML_STREAM()); shape.oox_serialize(CP_XML_STREAM());
} }
odf_reader::GetProperty(content_.properties_,L"display_label",boolVal); odf_reader::GetProperty(content_.properties_, L"display_label", boolVal);
if ((boolVal == true) && (boolVal.get()==true)) if ((boolVal == true) && (boolVal.get()==true))
{ {
CP_XML_NODE(L"c:majorTickMark") CP_XML_NODE(L"c:majorTickMark")
...@@ -201,7 +199,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream) ...@@ -201,7 +199,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
} }
} }
} }
if (g.type_ == odf_reader::chart::axis::grid::minor) if (content_.grids_[i].type_ == odf_reader::chart::axis::grid::minor)
{ {
CP_XML_NODE(L"c:minorGridlines") CP_XML_NODE(L"c:minorGridlines")
{ {
...@@ -234,11 +232,11 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream) ...@@ -234,11 +232,11 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
oox_serialize_default_text(_Wostream, content_.text_properties_); oox_serialize_default_text(_Wostream, content_.text_properties_);
BOOST_FOREACH(int const & ii, cross_id_) for (size_t i = 0; i < cross_id_.size(); i++)
{ {
CP_XML_NODE(L"c:crossAx") CP_XML_NODE(L"c:crossAx")
{ {
CP_XML_ATTR(L"val", ii); CP_XML_ATTR(L"val", cross_id_[i]);
} }
} }
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include <boost/foreach.hpp>
#include <boost/functional.hpp> #include <boost/functional.hpp>
#include <cpdoccore/CPHash.h> #include <cpdoccore/CPHash.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* *
*/ */
#include <boost/foreach.hpp>
#include <boost/functional.hpp> #include <boost/functional.hpp>
#include <cpdoccore/CPHash.h> #include <cpdoccore/CPHash.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "oox_conversion_context.h" #include "oox_conversion_context.h"
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include "oox_data_labels.h" #include "oox_data_labels.h"
#include "oox_chart_shape.h" #include "oox_chart_shape.h"
#include <boost/foreach.hpp>
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include "oox_layout.h" #include "oox_layout.h"
#include <boost/foreach.hpp>
#include <boost/functional.hpp> #include <boost/functional.hpp>
#include <cpdoccore/CPHash.h> #include <cpdoccore/CPHash.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "oox_package.h" #include "oox_package.h"
#include <boost/foreach.hpp>
#include <boost/ref.hpp> #include <boost/ref.hpp>
#include <cpdoccore/utf8cpp/utf8.h> #include <cpdoccore/utf8cpp/utf8.h>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "oox_rels.h" #include "oox_rels.h"
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <boost/foreach.hpp>
#include "namespaces.h" #include "namespaces.h"
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include "oox_title.h" #include "oox_title.h"
#include <boost/foreach.hpp>
#include <boost/functional.hpp> #include <boost/functional.hpp>
#include <cpdoccore/CPHash.h> #include <cpdoccore/CPHash.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -30,12 +30,8 @@ ...@@ -30,12 +30,8 @@
* *
*/ */
#include "oox_types_chart.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include "oox_types_chart.h"
#include "oox_chart_shape.h" #include "oox_chart_shape.h"
namespace cpdoccore { namespace cpdoccore {
...@@ -104,15 +100,15 @@ void oox_chart::oox_serialize_common(std::wostream & _Wostream) ...@@ -104,15 +100,15 @@ void oox_chart::oox_serialize_common(std::wostream & _Wostream)
CP_XML_ATTR(L"val", grouping_); CP_XML_ATTR(L"val", grouping_);
} }
} }
BOOST_FOREACH(oox_series_ptr const & s, series_) for (size_t i = 0; i < series_.size(); i++)
{ {
s->oox_serialize(_Wostream); series_[i]->oox_serialize(_Wostream);
} }
BOOST_FOREACH(int const & i, axisId_) for (size_t i = 0; i < axisId_.size(); i++)
{ {
CP_XML_NODE(L"c:axId") CP_XML_NODE(L"c:axId")
{ {
CP_XML_ATTR(L"val", i); CP_XML_ATTR(L"val", axisId_[i]);
} }
} }
data_labels_.oox_serialize(_Wostream); data_labels_.oox_serialize(_Wostream);
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include "pptx_comments.h" #include "pptx_comments.h"
#include <boost/foreach.hpp>
#include <vector> #include <vector>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include "oox_rels.h" #include "oox_rels.h"
...@@ -53,23 +52,23 @@ public: ...@@ -53,23 +52,23 @@ public:
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"); CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"xmlns:p", L"http://schemas.openxmlformats.org/presentationml/2006/main"); CP_XML_ATTR(L"xmlns:p", L"http://schemas.openxmlformats.org/presentationml/2006/main");
BOOST_FOREACH(_pptx_comment const & c, pptx_comment_) for (size_t i = 0; i < pptx_comment_.size(); i++)
{ {
CP_XML_NODE(L"p:cm") CP_XML_NODE(L"p:cm")
{ {
CP_XML_ATTR(L"idx",c.idx_); CP_XML_ATTR(L"idx", pptx_comment_[i].idx_);
CP_XML_ATTR(L"authorId", c.author_id_); CP_XML_ATTR(L"authorId", pptx_comment_[i].author_id_);
CP_XML_ATTR(L"dt", c.date_); CP_XML_ATTR(L"dt", pptx_comment_[i].date_);
CP_XML_NODE(L"p:pos") CP_XML_NODE(L"p:pos")
{ {
CP_XML_ATTR(L"x", c.x_); CP_XML_ATTR(L"x", pptx_comment_[i].x_);
CP_XML_ATTR(L"y", c.y_); CP_XML_ATTR(L"y", pptx_comment_[i].y_);
} }
CP_XML_NODE(L"p:text") CP_XML_NODE(L"p:text")
{ {
CP_XML_STREAM() << c.content_; CP_XML_STREAM() << pptx_comment_[i].content_;
} }
} }
} }
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include "pptx_comments_context.h" #include "pptx_comments_context.h"
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include "../odf/datatypes/length.h" #include "../odf/datatypes/length.h"
#include "xlsx_utils.h" #include "xlsx_utils.h"
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
* *
*/ */
#include <boost/foreach.hpp>
#include <vector> #include <vector>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
* *
*/ */
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
* *
*/ */
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
* *
*/ */
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <iostream> #include <iostream>
#include <list> #include <list>
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include "xlsx_border.h" #include "xlsx_border.h"
#include <boost/foreach.hpp>
#include <boost/functional.hpp> #include <boost/functional.hpp>
#include <cpdoccore/CPHash.h> #include <cpdoccore/CPHash.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "xlsx_cell_format.h" #include "xlsx_cell_format.h"
#include <boost/foreach.hpp>
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
*/ */
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include "xlsx_cell_styles.h" #include "xlsx_cell_styles.h"
...@@ -69,9 +67,9 @@ void xlsx_cell_styles::serialize(std::wostream & _Wostream) const ...@@ -69,9 +67,9 @@ void xlsx_cell_styles::serialize(std::wostream & _Wostream) const
{ {
CP_XML_ATTR(L"count", impl_->cell_styles_.size()); CP_XML_ATTR(L"count", impl_->cell_styles_.size());
BOOST_FOREACH(const xlsx_cell_style & s, impl_->cell_styles_) for (size_t i = 0; i < impl_->cell_styles_.size(); i++)
{ {
oox::xlsx_serialize(CP_XML_STREAM(), s); oox::xlsx_serialize(CP_XML_STREAM(), impl_->cell_styles_[i]);
} }
} }
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <sstream> #include <sstream>
#include <boost/foreach.hpp>
#include <boost/functional/hash/hash.hpp> #include <boost/functional/hash/hash.hpp>
#include "xlsx_font.h" #include "xlsx_font.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "xlsx_comments_context.h" #include "xlsx_comments_context.h"
#include "xlsx_table_metrics.h" #include "xlsx_table_metrics.h"
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include "../odf/datatypes/length.h" #include "../odf/datatypes/length.h"
#include "xlsx_utils.h" #include "xlsx_utils.h"
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* *
*/ */
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <iostream> #include <iostream>
......
...@@ -175,13 +175,6 @@ void xlsx_fills::serialize(std::wostream & _Wostream) const ...@@ -175,13 +175,6 @@ void xlsx_fills::serialize(std::wostream & _Wostream) const
} }
} }
} }
//_Wostream << L"<fills count=\"" << inst_array.size() << L"\" >";
//BOOST_FOREACH(const xlsx_fill & f, inst_array)
//{
// ::cpdoccore::oox::xlsx_serialize(_Wostream, f);
//}
//_Wostream << L"</fills>";
} }
} }
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
* *
*/ */
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include "xlsx_hyperlinks.h" #include "xlsx_hyperlinks.h"
...@@ -60,11 +57,12 @@ public: ...@@ -60,11 +57,12 @@ public:
void dump_rels(rels & Rels) const void dump_rels(rels & Rels) const
{ {
BOOST_FOREACH(const record & rec, records_) for (size_t i = 0; i < records_.size(); i++)
{ {
if (rec.type == L"External") if (records_[i].type == L"External")
{ {
Rels.add( relationship(rec.id, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", rec.location, rec.type) ); Rels.add( relationship(records_[i].id, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
records_[i].location, records_[i].type) );
} }
} }
} }
...@@ -109,23 +107,23 @@ public: ...@@ -109,23 +107,23 @@ public:
void xlsx_serialize(std::wostream & _Wostream) const void xlsx_serialize(std::wostream & _Wostream) const
{ {
BOOST_FOREACH(record const & r, records_) for (size_t i = 0; i < records_.size(); i++)
{ {
CP_XML_WRITER(_Wostream) CP_XML_WRITER(_Wostream)
{ {
CP_XML_NODE(L"hyperlink") CP_XML_NODE(L"hyperlink")
{ {
CP_XML_ATTR(L"ref", r.ref); CP_XML_ATTR(L"ref", records_[i].ref);
CP_XML_ATTR(L"display", r.display); CP_XML_ATTR(L"display", records_[i].display);
if (!r.location.empty() && r.type == L"Internal") if (!records_[i].location.empty() && records_[i].type == L"Internal")
{ {
CP_XML_ATTR(L"location", r.location); CP_XML_ATTR(L"location", records_[i].location);
} }
if (!r.id.empty() && r.type == L"External") if (!records_[i].id.empty() && records_[i].type == L"External")
{ {
CP_XML_ATTR(L"r:id", r.id); CP_XML_ATTR(L"r:id", records_[i].id);
} }
} }
} }
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
*/ */
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
#include "xlsx_sharedstrings.h" #include "xlsx_sharedstrings.h"
...@@ -55,10 +53,10 @@ void xlsx_shared_strings::Impl::serialize(std::wostream & _Wostream) const ...@@ -55,10 +53,10 @@ void xlsx_shared_strings::Impl::serialize(std::wostream & _Wostream) const
_Wostream << L"<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"" << _Wostream << L"<sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"" <<
strings_.size() << "\" uniqueCount=\"" << strings_.size() << "\">"; strings_.size() << "\" uniqueCount=\"" << strings_.size() << "\">";
BOOST_FOREACH(const std::wstring & str, strings_) for (size_t i = 0; i < strings_.size(); i++)
{ {
_Wostream << L"<si>"; _Wostream << L"<si>";
_Wostream << str; _Wostream << strings_[i];
_Wostream << L"</si>"; _Wostream << L"</si>";
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <iostream> #include <iostream>
#include <iosfwd> #include <iosfwd>
#include <cpdoccore/CPScopedPtr.h> #include <cpdoccore/CPScopedPtr.h>
#include <boost/noncopyable.hpp>
namespace cpdoccore { namespace cpdoccore {
namespace oox { namespace oox {
......
...@@ -232,9 +232,9 @@ void xlsx_style_manager::Impl::serialize_xf(std::wostream & _Wostream, const xls ...@@ -232,9 +232,9 @@ void xlsx_style_manager::Impl::serialize_xf(std::wostream & _Wostream, const xls
std::sort(xfs_.begin(), xfs_.end(), compare_xlsx_xf()); std::sort(xfs_.begin(), xfs_.end(), compare_xlsx_xf());
_Wostream << L"<" << nodeName << L" count=\"" << xfs_.size() << L"\">"; _Wostream << L"<" << nodeName << L" count=\"" << xfs_.size() << L"\">";
BOOST_FOREACH(const xlsx_xf & xfRecord, xfs_) for (size_t i = 0; i < xfs_.size(); i++)
{ {
cpdoccore::oox::xlsx_serialize(_Wostream, xfRecord); cpdoccore::oox::xlsx_serialize(_Wostream, xfs_[i]);
} }
_Wostream << L"</" << nodeName << L">"; _Wostream << L"</" << nodeName << L">";
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "xlsx_table_metrics.h" #include "xlsx_table_metrics.h"
#include <vector> #include <vector>
#include <boost/foreach.hpp>
namespace cpdoccore { namespace cpdoccore {
namespace oox namespace oox
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "logging.h" #include "logging.h"
#include <boost/foreach.hpp>
#include <iostream> #include <iostream>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "xlsx_sharedstrings.h" #include "xlsx_sharedstrings.h"
#include <list> #include <list>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include <boost/foreach.hpp>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <boost/foreach.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* *
*/ */
#include <boost/foreach.hpp>
#include "../docx/xlsx_textcontext.h" #include "../docx/xlsx_textcontext.h"
#include "../docx/xlsx_num_format_context.h" #include "../docx/xlsx_num_format_context.h"
...@@ -275,12 +277,12 @@ void object_odf_context::calc_cache_series(std::wstring adress, std::vector<std: ...@@ -275,12 +277,12 @@ void object_odf_context::calc_cache_series(std::wstring adress, std::vector<std:
oox::getCellAddressInv(ref_1, col_1,row_1); oox::getCellAddressInv(ref_1, col_1,row_1);
oox::getCellAddressInv(ref_2, col_2,row_2); oox::getCellAddressInv(ref_2, col_2,row_2);
BOOST_FOREACH(_cell & val,cash_values) for (size_t i = 0; i < cash_values.size(); i++)
{ {
if (val.col>=col_1 && val.col<=col_2 && if (cash_values[i].col >= col_1 && cash_values[i].col <= col_2 &&
val.row>=row_1 && val.row<=row_2) cash_values[i].row >= row_1 && cash_values[i].row <= row_2)
{ {
cash.push_back(val.val); cash.push_back(cash_values[i].val);
} }
} }
} }
...@@ -315,12 +317,12 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -315,12 +317,12 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
chart_context.add_chart(class_); chart_context.add_chart(class_);
} }
BOOST_FOREACH(series & s, series_) for (size_t i = 0; i < series_.size(); i++)
{ {
if (s.class_ != last_set_type) //разные типы серий в диаграмме - например бар и линия. if (series_[i].class_ != last_set_type) //разные типы серий в диаграмме - например бар и линия.
{ {
chart_context.add_chart(s.class_); chart_context.add_chart(series_[i].class_);
last_set_type = s.class_; last_set_type = series_[i].class_;
} }
oox::oox_chart_ptr current = chart_context.get_current_chart(); oox::oox_chart_ptr current = chart_context.get_current_chart();
...@@ -331,11 +333,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -331,11 +333,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
current->add_series(series_id++); current->add_series(series_id++);
if (s.cell_range_address_.empty() ) if (series_[i].cell_range_address_.empty() )
s.cell_range_address_ = plot_area_.cell_range_address_; //SplitByColumn (ind_ser,range); series_[i].cell_range_address_ = plot_area_.cell_range_address_; //SplitByColumn (ind_ser,range);
//SplitByRow (ind_ser,range); //SplitByRow (ind_ser,range);
if (s.cell_range_address_.empty()) if (series_[i].cell_range_address_.empty())
s.cell_range_address_ = domain_cell_range_adress2_; series_[i].cell_range_address_ = domain_cell_range_adress2_;
//тут данные нужно поделить по столбцам или строкам - так как в плот-ареа общий диапазон //тут данные нужно поделить по столбцам или строкам - так как в плот-ареа общий диапазон
//первый столбец-строка МОЖЕт использоваться для подписей //первый столбец-строка МОЖЕт использоваться для подписей
...@@ -347,7 +349,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -347,7 +349,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
std::vector<std::wstring> cat_cash; std::vector<std::wstring> cat_cash;
calc_cache_series (domain_cell_range_adress_, domain_cash); calc_cache_series (domain_cell_range_adress_, domain_cash);
calc_cache_series (s.cell_range_address_, cell_cash); calc_cache_series (series_[i].cell_range_address_, cell_cash);
if (categories_.size() >0) if (categories_.size() >0)
calc_cache_series (categories_[0], cat_cash); calc_cache_series (categories_[0], cat_cash);
...@@ -356,8 +358,8 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -356,8 +358,8 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
_CP_OPT(std::wstring) strVal; _CP_OPT(std::wstring) strVal;
_CP_OPT(bool) boolVal; _CP_OPT(bool) boolVal;
odf_reader::GetProperty(s.properties_, L"num_format", strVal); odf_reader::GetProperty(series_[i].properties_, L"num_format", strVal);
odf_reader::GetProperty(s.properties_, L"link-data-style-to-source", boolVal); odf_reader::GetProperty(series_[i].properties_, L"link-data-style-to-source", boolVal);
if ((strVal) && (strVal->length() > 1)) if ((strVal) && (strVal->length() > 1))
{ {
...@@ -371,7 +373,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -371,7 +373,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
current->set_formula_series(4, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true)); current->set_formula_series(4, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
current->set_values_series (4, domain_cash); current->set_values_series (4, domain_cash);
//y //y
current->set_formula_series(3, s.cell_range_address_, formatCode, boolVal.get_value_or(true)); current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
current->set_values_series (3, cell_cash); current->set_values_series (3, cell_cash);
} }
else else
...@@ -379,13 +381,13 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -379,13 +381,13 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true)); current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
current->set_values_series (2, domain_cash); current->set_values_series (2, domain_cash);
//y //y
current->set_formula_series(3, s.cell_range_address_, formatCode, boolVal.get_value_or(true)); current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
current->set_values_series (3, cell_cash); current->set_values_series (3, cell_cash);
} }
} }
else else
{ //common { //common
current->set_formula_series(1, s.cell_range_address_, formatCode, boolVal.get_value_or(true)); current->set_formula_series(1, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
current->set_values_series(1, cell_cash); current->set_values_series(1, cell_cash);
} }
...@@ -394,9 +396,9 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context) ...@@ -394,9 +396,9 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
current->set_formula_series(0, categories_[0], L"General", true); current->set_formula_series(0, categories_[0], L"General", true);
current->set_values_series(0, cat_cash); current->set_values_series(0, cat_cash);
} }
current->set_name(s.name_); current->set_name(series_[i].name_);
current->set_content_series(s); current->set_content_series(series_[i]);
} }
std::sort(axises_.begin(), axises_.end(), axises_sort());//file_1_ (1).odp std::sort(axises_.begin(), axises_.end(), axises_sort());//file_1_ (1).odp
...@@ -501,9 +503,9 @@ void process_build_object::ApplyChartProperties(std::wstring style, std::vector< ...@@ -501,9 +503,9 @@ void process_build_object::ApplyChartProperties(std::wstring style, std::vector<
if (!properties)return; if (!properties)return;
BOOST_FOREACH(_property const & p, properties->content_) for (size_t i = 0; i < properties->content_.size(); i++)
{ {
propertiesOut.push_back(p); propertiesOut.push_back(properties->content_[i]);
} }
} }
} }
......
...@@ -86,10 +86,10 @@ static const class_type_pair class_type_str[] = ...@@ -86,10 +86,10 @@ static const class_type_pair class_type_str[] =
chart::class_type static get_series_class_type(std::wstring const & str) chart::class_type static get_series_class_type(std::wstring const & str)
{ {
BOOST_FOREACH(class_type_pair const & p, class_type_str) for (size_t i = 0; i < 12/*class_type_str.size()*/; i++)
{ {
if (p.class_type_str_ == str) if (class_type_str[i].class_type_str_ == str)
return p.class_type_; return class_type_str[i].class_type_;
} }
return chart::chart_bar; //лучше хоть какой назначить чем никакой !! return chart::chart_bar; //лучше хоть какой назначить чем никакой !!
} }
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <boost/foreach.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
...@@ -67,9 +66,9 @@ namespace odf_reader { ...@@ -67,9 +66,9 @@ namespace odf_reader {
namespace { namespace {
bool IsExistProperty(std::vector<_property> Heap,const std::wstring Name) bool IsExistProperty(std::vector<_property> Heap,const std::wstring Name)
{ {
BOOST_FOREACH(_property const & p, Heap) for (size_t i = 0; i < Heap.size(); i++)
{ {
int res = p.name_.find(Name); int res = Heap[i].name_.find(Name);
if (res>=0) if (res>=0)
{ {
return true; return true;
...@@ -1166,10 +1165,10 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context) ...@@ -1166,10 +1165,10 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
bool drState = Context.get_drawing_state_content(); bool drState = Context.get_drawing_state_content();
Context.set_drawing_state_content(true); Context.set_drawing_state_content(true);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
ElementType type = elm->get_type(); ElementType type = content_[i]->get_type();
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.get_drawing_context().get_text_stream_frame() = temp_stream.str(); Context.get_drawing_context().get_text_stream_frame() = temp_stream.str();
...@@ -1284,10 +1283,10 @@ void draw_g::docx_convert(oox::docx_conversion_context & Context) ...@@ -1284,10 +1283,10 @@ void draw_g::docx_convert(oox::docx_conversion_context & Context)
Context.set_paragraph_state (false); Context.set_paragraph_state (false);
Context.set_run_state (false); Context.set_run_state (false);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
ElementType type = elm->get_type(); ElementType type = content_[i]->get_type();
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
drawing.content_group_ = temp_stream.str(); drawing.content_group_ = temp_stream.str();
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <boost/foreach.hpp>
#include <boost/regex.h> #include <boost/regex.h>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
......
...@@ -80,13 +80,13 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context) ...@@ -80,13 +80,13 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
Context.set_stream_man( boost::shared_ptr<oox::streams_man>( new oox::streams_man(temp_stream) )); Context.set_stream_man( boost::shared_ptr<oox::streams_man>( new oox::streams_man(temp_stream) ));
//сначала элементы графики потом все остальное //сначала элементы графики потом все остальное
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
ElementType type = elm->get_type(); ElementType type = content_[i]->get_type();
if (type == typeDrawCustomShape) // || .... if (type == typeDrawCustomShape) // || ....
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
} }
......
...@@ -136,9 +136,9 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context) ...@@ -136,9 +136,9 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
properties.apply_to(Context.get_slide_context().get_properties()); properties.apply_to(Context.get_slide_context().get_properties());
BOOST_FOREACH(odf_reader::_property const & p, additional_) for (size_t i = 0; i < additional_.size(); i++)
{ {
Context.get_slide_context().set_property(p); Context.get_slide_context().set_property(additional_[i]);
} }
if (!textStyleName.empty()) if (!textStyleName.empty())
{ {
...@@ -162,9 +162,9 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context) ...@@ -162,9 +162,9 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
} }
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
Context.get_text_context().start_object(); Context.get_text_context().start_object();
BOOST_FOREACH(office_element_ptr const & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
std::wstring text_content_ = Context.get_text_context().end_object(); std::wstring text_content_ = Context.get_text_context().end_object();
......
...@@ -122,9 +122,9 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -122,9 +122,9 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
properties.apply_to(Context.get_drawing_context().get_properties()); properties.apply_to(Context.get_drawing_context().get_properties());
BOOST_FOREACH(odf_reader::_property const & p, additional_) for (size_t i = 0; i < additional_.size(); i++)
{ {
Context.get_drawing_context().set_property(p); Context.get_drawing_context().set_property(additional_[i]);
} }
oox::_oox_fill fill; oox::_oox_fill fill;
...@@ -134,9 +134,9 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -134,9 +134,9 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
Context.get_text_context().start_drawing_content(); Context.get_text_context().start_drawing_content();
BOOST_FOREACH(office_element_ptr const & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
std::wstring text_content_ = Context.get_text_context().end_drawing_content(); std::wstring text_content_ = Context.get_text_context().end_drawing_content();
......
...@@ -244,9 +244,9 @@ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \ ...@@ -244,9 +244,9 @@ xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \ xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
mc:Ignorable=\"w14\">"; mc:Ignorable=\"w14\">";
BOOST_FOREACH(office_element_ptr elm, style_font_face_) for (size_t i = 0; i < style_font_face_.size(); i++)
{ {
elm->docx_convert(Context); style_font_face_[i]->docx_convert(Context);
} }
strm << L"</w:fonts>"; strm << L"</w:fonts>";
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "list.h" #include "list.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -68,10 +66,9 @@ const wchar_t * list_item::name = L"list-item"; ...@@ -68,10 +66,9 @@ const wchar_t * list_item::name = L"list-item";
std::wostream & list_item::text_to_stream(std::wostream & _Wostream) const std::wostream & list_item::text_to_stream(std::wostream & _Wostream) const
{ {
// TODO!!!! for (size_t i = 0; i < content_.size(); i++)
BOOST_FOREACH(const office_element_ptr & parElement, content_)
{ {
parElement->text_to_stream(_Wostream); content_[i]->text_to_stream(_Wostream);
} }
return _Wostream; return _Wostream;
} }
...@@ -104,9 +101,9 @@ void list_item::docx_convert(oox::docx_conversion_context & Context) ...@@ -104,9 +101,9 @@ void list_item::docx_convert(oox::docx_conversion_context & Context)
Context.start_list_item(restart); Context.start_list_item(restart);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.end_list_item(); Context.end_list_item();
...@@ -123,9 +120,9 @@ void list_item::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -123,9 +120,9 @@ void list_item::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_text_context().start_list_item(restart); Context.get_text_context().start_list_item(restart);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
Context.get_text_context().end_list_item(); Context.get_text_context().end_list_item();
...@@ -143,9 +140,9 @@ void list_header::docx_convert(oox::docx_conversion_context & Context) ...@@ -143,9 +140,9 @@ void list_header::docx_convert(oox::docx_conversion_context & Context)
std::wstring s = Context.current_list_style(); std::wstring s = Context.current_list_style();
Context.end_list(); Context.end_list();
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.start_list(s, true); Context.start_list(s, true);
...@@ -156,9 +153,9 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -156,9 +153,9 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context)
//заголовок это не элемент списка //заголовок это не элемент списка
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
} }
...@@ -166,10 +163,9 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -166,10 +163,9 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context)
std::wostream & list_header::text_to_stream(std::wostream & _Wostream) const std::wostream & list_header::text_to_stream(std::wostream & _Wostream) const
{ {
// TODO!!!! for (size_t i = 0; i < content_.size(); i++)
BOOST_FOREACH(const office_element_ptr & parElement, content_)
{ {
parElement->text_to_stream(_Wostream); content_[i]->text_to_stream(_Wostream);
} }
return _Wostream; return _Wostream;
} }
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "math_elementaries.h" #include "math_elementaries.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "math_elements.h" #include "math_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include "math_token_elements.h" #include "math_token_elements.h"
#include "style_text_properties.h" #include "style_text_properties.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -342,7 +340,7 @@ void math_menclose::add_child_element( xml::sax * Reader, const std::wstring & N ...@@ -342,7 +340,7 @@ void math_menclose::add_child_element( xml::sax * Reader, const std::wstring & N
void math_menclose::oox_convert(oox::math_context & Context) void math_menclose::oox_convert(oox::math_context & Context)
{//0* elements {//0* elements
//BOOST_FOREACH(const office_element_ptr & elm, content_) //for (size_t i = 0; i < content_.size(); i++)
//{ //{
//office_math_element* math_element = dynamic_cast<office_math_element*>(elm.get()); //office_math_element* math_element = dynamic_cast<office_math_element*>(elm.get());
//math_element->oox_convert(Context); //math_element->oox_convert(Context);
...@@ -368,7 +366,7 @@ void math_mfenced::add_child_element( xml::sax * Reader, const std::wstring & Ns ...@@ -368,7 +366,7 @@ void math_mfenced::add_child_element( xml::sax * Reader, const std::wstring & Ns
void math_mfenced::oox_convert(oox::math_context & Context) void math_mfenced::oox_convert(oox::math_context & Context)
{//0* elements {//0* elements
//BOOST_FOREACH(const office_element_ptr & elm, content_) //for (size_t i = 0; i < content_.size(); i++)
//{ //{
//office_math_element* math_element = dynamic_cast<office_math_element*>(elm.get()); //office_math_element* math_element = dynamic_cast<office_math_element*>(elm.get());
//math_element->oox_convert(Context); //math_element->oox_convert(Context);
......
...@@ -32,13 +32,10 @@ ...@@ -32,13 +32,10 @@
#include "math_limit_elements.h" #include "math_limit_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
namespace cpdoccore { namespace cpdoccore {
using namespace odf_types; using namespace odf_types;
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "math_table_elements.h" #include "math_table_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#include "math_token_elements.h" #include "math_token_elements.h"
#include "style_text_properties.h" #include "style_text_properties.h"
#include <boost/foreach.hpp>
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "note.h" #include "note.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -55,9 +54,9 @@ std::wostream & note_citation::text_to_stream(std::wostream & _Wostream) const ...@@ -55,9 +54,9 @@ std::wostream & note_citation::text_to_stream(std::wostream & _Wostream) const
if (!text_label_.empty()) if (!text_label_.empty())
_Wostream << text_label_; _Wostream << text_label_;
BOOST_FOREACH(const office_element_ptr & element, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
element->text_to_stream(_Wostream); content_[i]->text_to_stream(_Wostream);
} }
return _Wostream; return _Wostream;
} }
...@@ -80,9 +79,9 @@ void note_citation::add_text(const std::wstring & Text) ...@@ -80,9 +79,9 @@ void note_citation::add_text(const std::wstring & Text)
void note_citation::docx_convert(oox::docx_conversion_context & Context) void note_citation::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
} }
...@@ -93,9 +92,9 @@ const wchar_t * note_body::name = L"note-body"; ...@@ -93,9 +92,9 @@ const wchar_t * note_body::name = L"note-body";
std::wostream & note_body::text_to_stream(std::wostream & _Wostream) const std::wostream & note_body::text_to_stream(std::wostream & _Wostream) const
{ {
BOOST_FOREACH(const office_element_ptr & element, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
element->text_to_stream(_Wostream); content_[i]->text_to_stream(_Wostream);
} }
return _Wostream; return _Wostream;
} }
...@@ -129,9 +128,9 @@ void note_body::docx_convert(oox::docx_conversion_context & Context) ...@@ -129,9 +128,9 @@ void note_body::docx_convert(oox::docx_conversion_context & Context)
Context.set_paragraph_state (false); Context.set_paragraph_state (false);
Context.set_run_state (false); Context.set_run_state (false);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.set_process_headers_footers (false); Context.set_process_headers_footers (false);
Context.set_run_state (runState); Context.set_run_state (runState);
......
...@@ -411,9 +411,9 @@ void number_text::oox_convert(oox::num_format_context & Context) ...@@ -411,9 +411,9 @@ void number_text::oox_convert(oox::num_format_context & Context)
{ {
std::wstringstream strm; std::wstringstream strm;
BOOST_FOREACH(const office_element_ptr & elm, text_) for (size_t i = 0; i < text_.size(); i++)
{ {
elm->text_to_stream(strm); text_[i]->text_to_stream(strm);
} }
std::wstring text_ = strm.str(); std::wstring text_ = strm.str();
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
*/ */
#include "odfcontext.h" #include "odfcontext.h"
#include <boost/foreach.hpp>
namespace cpdoccore { namespace cpdoccore {
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_annotation.h" #include "office_annotation.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -141,9 +139,9 @@ void office_annotation::docx_convert(oox::docx_conversion_context & Context) ...@@ -141,9 +139,9 @@ void office_annotation::docx_convert(oox::docx_conversion_context & Context)
bool pState = Context.get_paragraph_state(); bool pState = Context.get_paragraph_state();
Context.set_paragraph_state(false); Context.set_paragraph_state(false);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.set_run_state(runState); Context.set_run_state(runState);
...@@ -191,9 +189,9 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -191,9 +189,9 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
} }
Context.get_text_context().start_comment_content(); Context.get_text_context().start_comment_content();
BOOST_FOREACH(office_element_ptr const & elm, content_)//текст + текстовый стиль for (size_t i = 0; i < content_.size(); i++)//текст + текстовый стиль
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
Context.get_comments_context().add_author(author); Context.get_comments_context().add_author(author);
Context.get_comments_context().add_content(Context.get_text_context().end_comment_content()); Context.get_comments_context().add_content(Context.get_text_context().end_comment_content());
...@@ -268,9 +266,9 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -268,9 +266,9 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_comments_context().start_comment(x, y,id_idx.first,id_idx.second);//author & idx (uniq number for author Context.get_comments_context().start_comment(x, y,id_idx.first,id_idx.second);//author & idx (uniq number for author
Context.get_text_context().start_comment_content(); Context.get_text_context().start_comment_content();
BOOST_FOREACH(office_element_ptr const & elm, content_)//текст + текстовый стиль for (size_t i = 0; i < content_.size(); i++)//текст + текстовый стиль
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
Context.get_comments_context().add_date(date); Context.get_comments_context().add_date(date);
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_binary_data.h" #include "office_binary_data.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include "serialize_elements.h" #include "serialize_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_chart.h" #include "office_chart.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_document.h" #include "office_document.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_event_listeners.h" #include "office_event_listeners.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_scripts.h" #include "office_scripts.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_settings.h" #include "office_settings.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "office_spreadsheet.h" #include "office_spreadsheet.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -70,9 +68,9 @@ void office_spreadsheet::add_attributes( const xml::attributes_wc_ptr & Attribut ...@@ -70,9 +68,9 @@ void office_spreadsheet::add_attributes( const xml::attributes_wc_ptr & Attribut
void office_spreadsheet::docx_convert(oox::docx_conversion_context & Context) void office_spreadsheet::docx_convert(oox::docx_conversion_context & Context)
{ {
Context.start_office_text(); Context.start_office_text();
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.end_office_text(); Context.end_office_text();
} }
...@@ -82,13 +80,13 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -82,13 +80,13 @@ void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context)
Context.start_office_spreadsheet(this); Context.start_office_spreadsheet(this);
_CP_LOG << L"[info][xlsx] process spreadsheet (" << content_.size() << L" elmements)" << std::endl; _CP_LOG << L"[info][xlsx] process spreadsheet (" << content_.size() << L" elmements)" << std::endl;
BOOST_FOREACH(const office_element_ptr & elm, table_database_ranges_) for (size_t i = 0; i < table_database_ranges_.size(); i++)
{ {
elm->xlsx_convert(Context); table_database_ranges_[i]->xlsx_convert(Context);
} }
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
Context.end_office_spreadsheet(); Context.end_office_spreadsheet();
} }
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#include "office_text.h" #include "office_text.h"
#include "office_annotation.h" #include "office_annotation.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
...@@ -117,9 +115,9 @@ void office_text::docx_convert(oox::docx_conversion_context & Context) ...@@ -117,9 +115,9 @@ void office_text::docx_convert(oox::docx_conversion_context & Context)
tracked_changes_->docx_convert(Context); tracked_changes_->docx_convert(Context);
Context.start_office_text(); Context.start_office_text();
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.end_office_text(); Context.end_office_text();
} }
...@@ -127,18 +125,18 @@ void office_text::docx_convert(oox::docx_conversion_context & Context) ...@@ -127,18 +125,18 @@ void office_text::docx_convert(oox::docx_conversion_context & Context)
void office_text::xlsx_convert(oox::xlsx_conversion_context & Context) void office_text::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
//Context.start_office_text(); //Context.start_office_text();
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
//Context.end_office_text(); //Context.end_office_text();
} }
void office_text::pptx_convert(oox::pptx_conversion_context & Context) void office_text::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
} }
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <boost/foreach.hpp>
#include "paragraph_elements.h" #include "paragraph_elements.h"
#include "serialize_elements.h" #include "serialize_elements.h"
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#pragma once #pragma once
#include "office_elements.h" #include "office_elements.h"
#include <boost/foreach.hpp>
namespace cpdoccore { namespace cpdoccore {
namespace odf_reader { namespace odf_reader {
...@@ -46,9 +45,9 @@ inline std::wostream & serialize_elements(std::wostream & _Wostream, const offic ...@@ -46,9 +45,9 @@ inline std::wostream & serialize_elements(std::wostream & _Wostream, const offic
inline std::wostream & serialize_elements(std::wostream & _Wostream, const office_element_ptr_array & elms) inline std::wostream & serialize_elements(std::wostream & _Wostream, const office_element_ptr_array & elms)
{ {
BOOST_FOREACH(const office_element_ptr & elm, elms) for (size_t i = 0; i < elms.size(); i++)
{ {
serialize_elements(_Wostream, elm); serialize_elements(_Wostream, elms[i]);
} }
return _Wostream; return _Wostream;
} }
...@@ -62,9 +61,9 @@ inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const ...@@ -62,9 +61,9 @@ inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const
inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const office_element_ptr_array & elms) inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const office_element_ptr_array & elms)
{ {
BOOST_FOREACH(const office_element_ptr & elm, elms) for (size_t i = 0; i < elms.size(); i++)
{ {
serialize_elements_text(_Wostream, elm); serialize_elements_text(_Wostream, elms[i]);
} }
return _Wostream; return _Wostream;
} }
......
...@@ -32,9 +32,6 @@ ...@@ -32,9 +32,6 @@
#include "style_map.h" #include "style_map.h"
#include <boost/foreach.hpp>
//#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h" #include "serialize_elements.h"
......
...@@ -37,8 +37,6 @@ ...@@ -37,8 +37,6 @@
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h> #include <cpdoccore/xml/utils.h>
#include <boost/foreach.hpp>
#include "office_elements_create.h" #include "office_elements_create.h"
#include "datatypes/borderstyle.h" #include "datatypes/borderstyle.h"
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "style_paragraph_properties.h" #include "style_paragraph_properties.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
...@@ -423,9 +422,9 @@ void style_tab_stops::docx_convert(oox::docx_conversion_context & Context) ...@@ -423,9 +422,9 @@ void style_tab_stops::docx_convert(oox::docx_conversion_context & Context)
if (style_tab_stops_.size() > 0) if (style_tab_stops_.size() > 0)
{ {
BOOST_FOREACH(const office_element_ptr & elm, style_tab_stops_) for (size_t i = 0; i < style_tab_stops_.size(); i++)
{ {
elm->docx_convert(Context); style_tab_stops_[i]->docx_convert(Context);
} }
} }
_pPr << L"</w:tabs>"; _pPr << L"</w:tabs>";
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <iostream> #include <iostream>
#include "style_paragraph_properties.h" #include "style_paragraph_properties.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h> #include <cpdoccore/xml/simple_xml_writer.h>
#include "../docx/pptx_conversion_context.h" #include "../docx/pptx_conversion_context.h"
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "style_regions.h" #include "style_regions.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -51,17 +49,17 @@ const wchar_t * style_region_left::name = L"region-left"; ...@@ -51,17 +49,17 @@ const wchar_t * style_region_left::name = L"region-left";
void style_region_left::docx_convert(oox::docx_conversion_context & Context) void style_region_left::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
} }
void style_region_left::xlsx_convert(oox::xlsx_conversion_context & Context) void style_region_left::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
} }
...@@ -85,17 +83,17 @@ const wchar_t * style_region_right::name = L"region-right"; ...@@ -85,17 +83,17 @@ const wchar_t * style_region_right::name = L"region-right";
void style_region_right::docx_convert(oox::docx_conversion_context & Context) void style_region_right::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
} }
void style_region_right::xlsx_convert(oox::xlsx_conversion_context & Context) void style_region_right::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
} }
...@@ -119,17 +117,17 @@ const wchar_t * style_region_center::name = L"region-center"; ...@@ -119,17 +117,17 @@ const wchar_t * style_region_center::name = L"region-center";
void style_region_center::docx_convert(oox::docx_conversion_context & Context) void style_region_center::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
} }
void style_region_center::xlsx_convert(oox::xlsx_conversion_context & Context) void style_region_center::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
} }
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <cpdoccore/odf/odf_document.h> #include <cpdoccore/odf/odf_document.h>
#include <iostream> #include <iostream>
#include <boost/foreach.hpp>
#include "office_elements.h" #include "office_elements.h"
#include "office_elements_create.h" #include "office_elements_create.h"
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/foreach.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include "../../include/cpdoccore/CPOptional.h" #include "../../include/cpdoccore/CPOptional.h"
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "table_calculation_settings.h" #include "table_calculation_settings.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
......
...@@ -51,14 +51,14 @@ namespace odf_reader { ...@@ -51,14 +51,14 @@ namespace odf_reader {
bool table_table_cell_content::docx_convert(oox::docx_conversion_context & Context) bool table_table_cell_content::docx_convert(oox::docx_conversion_context & Context)
{ {
bool wasPar = false; bool wasPar = false;
BOOST_FOREACH(const office_element_ptr & elm, elements_) for (size_t i = 0; i < elements_.size(); i++)
{ {
ElementType type = elm->get_type(); ElementType type = elements_[i]->get_type();
if (type == typeTextP || type== typeTextH) if (type == typeTextP || type== typeTextH)
wasPar = true; wasPar = true;
elm->docx_convert(Context); elements_[i]->docx_convert(Context);
} }
return wasPar; return wasPar;
} }
...@@ -83,9 +83,9 @@ void table_table_row::docx_convert(oox::docx_conversion_context & Context) ...@@ -83,9 +83,9 @@ void table_table_row::docx_convert(oox::docx_conversion_context & Context)
Context.get_table_context().start_row(styleName, defaultCellStyle); Context.get_table_context().start_row(styleName, defaultCellStyle);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
Context.get_table_context().end_row(); Context.get_table_context().end_row();
...@@ -96,17 +96,17 @@ void table_table_row::docx_convert(oox::docx_conversion_context & Context) ...@@ -96,17 +96,17 @@ void table_table_row::docx_convert(oox::docx_conversion_context & Context)
void table_table_rows::docx_convert(oox::docx_conversion_context & Context) void table_table_rows::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_) for (size_t i = 0; i < table_table_row_.size(); i++)
{ {
elm->docx_convert(Context); table_table_row_[i]->docx_convert(Context);
} }
} }
void table_table_header_rows::docx_convert(oox::docx_conversion_context & Context) void table_table_header_rows::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_) for (size_t i = 0; i < table_table_row_.size(); i++)
{ {
elm->docx_convert(Context); table_table_row_[i]->docx_convert(Context);
} }
} }
...@@ -116,9 +116,9 @@ void table_rows::docx_convert(oox::docx_conversion_context & Context) ...@@ -116,9 +116,9 @@ void table_rows::docx_convert(oox::docx_conversion_context & Context)
table_table_rows_->docx_convert(Context); table_table_rows_->docx_convert(Context);
else else
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_) for (size_t i = 0; i < table_table_row_.size(); i++)
{ {
elm->docx_convert(Context); table_table_row_[i]->docx_convert(Context);
} }
} }
} }
...@@ -135,9 +135,9 @@ void table_rows_no_group::docx_convert(oox::docx_conversion_context & Context) ...@@ -135,9 +135,9 @@ void table_rows_no_group::docx_convert(oox::docx_conversion_context & Context)
void table_rows_and_groups::docx_convert(oox::docx_conversion_context & Context) void table_rows_and_groups::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
} }
...@@ -182,17 +182,17 @@ void table_columns::docx_convert(oox::docx_conversion_context & Context) ...@@ -182,17 +182,17 @@ void table_columns::docx_convert(oox::docx_conversion_context & Context)
if (table_table_columns_) if (table_table_columns_)
table_table_columns_->docx_convert(Context); table_table_columns_->docx_convert(Context);
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_) for (size_t i = 0; i < table_table_column_.size(); i++)
{ {
elm->docx_convert(Context); table_table_column_[i]->docx_convert(Context);
} }
} }
void table_table_columns::docx_convert(oox::docx_conversion_context & Context) void table_table_columns::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_) for (size_t i = 0; i < table_table_column_.size(); i++)
{ {
elm->docx_convert(Context); table_table_column_[i]->docx_convert(Context);
} }
} }
...@@ -208,9 +208,9 @@ void table_columns_no_group::docx_convert(oox::docx_conversion_context & Context ...@@ -208,9 +208,9 @@ void table_columns_no_group::docx_convert(oox::docx_conversion_context & Context
void table_columns_and_groups::docx_convert(oox::docx_conversion_context & Context) void table_columns_and_groups::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->docx_convert(Context); content_[i]->docx_convert(Context);
} }
//if (table_table_column_group_) //if (table_table_column_group_)
// table_table_column_group_->docx_convert(Context); // table_table_column_group_->docx_convert(Context);
...@@ -220,9 +220,9 @@ void table_columns_and_groups::docx_convert(oox::docx_conversion_context & Conte ...@@ -220,9 +220,9 @@ void table_columns_and_groups::docx_convert(oox::docx_conversion_context & Conte
void table_table_header_columns::docx_convert(oox::docx_conversion_context & Context) void table_table_header_columns::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_) for (size_t i = 0; i < table_table_column_.size(); i++)
{ {
elm->docx_convert(Context); table_table_column_[i]->docx_convert(Context);
} }
} }
......
...@@ -69,9 +69,9 @@ void table_named_expressions::docx_convert(oox::docx_conversion_context & Contex ...@@ -69,9 +69,9 @@ void table_named_expressions::docx_convert(oox::docx_conversion_context & Contex
void table_named_expressions::xlsx_convert(oox::xlsx_conversion_context & Context) void table_named_expressions::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
BOOST_FOREACH(office_element_ptr const & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
} }
......
...@@ -56,12 +56,12 @@ namespace odf_reader { ...@@ -56,12 +56,12 @@ namespace odf_reader {
bool table_table_cell_content::pptx_convert(oox::pptx_conversion_context & Context) bool table_table_cell_content::pptx_convert(oox::pptx_conversion_context & Context)
{ {
bool wasPar = false; bool wasPar = false;
BOOST_FOREACH(const office_element_ptr & elm, elements_) for (size_t i = 0; i < elements_.size(); i++)
{ {
if (elm->get_type() == typeTextP || if (elements_[i]->get_type() == typeTextP ||
elm->get_type() == typeTextH) elements_[i]->get_type() == typeTextH)
wasPar = true; wasPar = true;
elm->pptx_convert(Context); elements_[i]->pptx_convert(Context);
} }
return wasPar; return wasPar;
} }
...@@ -97,9 +97,9 @@ void table_table_row::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -97,9 +97,9 @@ void table_table_row::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_table_context().start_row(styleName, defaultCellStyle); Context.get_table_context().start_row(styleName, defaultCellStyle);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
Context.get_table_context().end_row(); Context.get_table_context().end_row();
...@@ -110,17 +110,17 @@ void table_table_row::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -110,17 +110,17 @@ void table_table_row::pptx_convert(oox::pptx_conversion_context & Context)
void table_table_rows::pptx_convert(oox::pptx_conversion_context & Context) void table_table_rows::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_) for (size_t i = 0; i < table_table_row_.size(); i++)
{ {
elm->pptx_convert(Context); table_table_row_[i]->pptx_convert(Context);
} }
} }
void table_table_header_rows::pptx_convert(oox::pptx_conversion_context & Context) void table_table_header_rows::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_) for (size_t i = 0; i < table_table_row_.size(); i++)
{ {
elm->pptx_convert(Context); table_table_row_[i]->pptx_convert(Context);
} }
} }
...@@ -130,9 +130,9 @@ void table_rows::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -130,9 +130,9 @@ void table_rows::pptx_convert(oox::pptx_conversion_context & Context)
table_table_rows_->pptx_convert(Context); table_table_rows_->pptx_convert(Context);
else else
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_) for (size_t i = 0; i < table_table_row_.size(); i++)
{ {
elm->pptx_convert(Context); table_table_row_[i]->pptx_convert(Context);
} }
} }
} }
...@@ -149,9 +149,9 @@ void table_rows_no_group::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -149,9 +149,9 @@ void table_rows_no_group::pptx_convert(oox::pptx_conversion_context & Context)
void table_rows_and_groups::pptx_convert(oox::pptx_conversion_context & Context) void table_rows_and_groups::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
} }
...@@ -244,17 +244,17 @@ void table_columns::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -244,17 +244,17 @@ void table_columns::pptx_convert(oox::pptx_conversion_context & Context)
if (table_table_columns_) if (table_table_columns_)
table_table_columns_->pptx_convert(Context); table_table_columns_->pptx_convert(Context);
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_) for (size_t i = 0; i < table_table_column_.size(); i++)
{ {
elm->pptx_convert(Context); table_table_column_[i]->pptx_convert(Context);
} }
} }
void table_table_columns::pptx_convert(oox::pptx_conversion_context & Context) void table_table_columns::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_) for (size_t i = 0; i < table_table_column_.size(); i++)
{ {
elm->pptx_convert(Context); table_table_column_[i]->pptx_convert(Context);
} }
} }
...@@ -270,17 +270,17 @@ void table_columns_no_group::pptx_convert(oox::pptx_conversion_context & Context ...@@ -270,17 +270,17 @@ void table_columns_no_group::pptx_convert(oox::pptx_conversion_context & Context
void table_columns_and_groups::pptx_convert(oox::pptx_conversion_context & Context) void table_columns_and_groups::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
} }
void table_table_header_columns::pptx_convert(oox::pptx_conversion_context & Context) void table_table_header_columns::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_) for (size_t i = 0; i < table_table_column_.size(); i++)
{ {
elm->pptx_convert(Context); table_table_column_[i]->pptx_convert(Context);
} }
} }
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "text_elements.h" #include "text_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h> #include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h> #include <cpdoccore/xml/attributes.h>
...@@ -455,8 +453,8 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context) ...@@ -455,8 +453,8 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
Context.add_note_reference(); Context.add_note_reference();
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
if (Context.get_page_break()) if (Context.get_page_break())
{ {
if (Context.process_headers_footers_ == false) if (Context.process_headers_footers_ == false)
...@@ -464,9 +462,9 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context) ...@@ -464,9 +462,9 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
_Wostream << L"<w:br w:type=\"page\"/>"; _Wostream << L"<w:br w:type=\"page\"/>";
Context.set_page_break(false); Context.set_page_break(false);
} }
elm->docx_convert(Context); content_[i]->docx_convert(Context);
if (Context.get_drop_cap_context().state() >0) if (Context.get_drop_cap_context().state() > 0)
Context.get_drop_cap_context().state(0);//disable Context.get_drop_cap_context().state(0);//disable
} }
...@@ -510,9 +508,9 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context) ...@@ -510,9 +508,9 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
void paragraph::xlsx_convert(oox::xlsx_conversion_context & Context) void paragraph::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
Context.start_paragraph(attrs_.text_style_name_); Context.start_paragraph(attrs_.text_style_name_);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->xlsx_convert(Context); content_[i]->xlsx_convert(Context);
} }
Context.end_paragraph(); Context.end_paragraph();
} }
...@@ -520,9 +518,9 @@ void paragraph::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -520,9 +518,9 @@ void paragraph::pptx_convert(oox::pptx_conversion_context & Context)
{ {
Context.get_text_context().start_paragraph(attrs_.text_style_name_); Context.get_text_context().start_paragraph(attrs_.text_style_name_);
BOOST_FOREACH(const office_element_ptr & elm, content_) for (size_t i = 0; i < content_.size(); i++)
{ {
elm->pptx_convert(Context); content_[i]->pptx_convert(Context);
} }
Context.get_text_context().end_paragraph(); Context.get_text_context().end_paragraph();
...@@ -638,9 +636,9 @@ const wchar_t * list::name = L"list"; ...@@ -638,9 +636,9 @@ const wchar_t * list::name = L"list";
std::wostream & list::text_to_stream(std::wostream & _Wostream) const std::wostream & list::text_to_stream(std::wostream & _Wostream) const
{ {
BOOST_FOREACH(const office_element_ptr & listItem, text_list_items_) for (size_t i = 0; i < text_list_items_.size(); i++)
{ {
listItem->text_to_stream(_Wostream); text_list_items_[i]->text_to_stream(_Wostream);
} }
return _Wostream; return _Wostream;
} }
...@@ -677,9 +675,9 @@ void list::docx_convert(oox::docx_conversion_context & Context) ...@@ -677,9 +675,9 @@ void list::docx_convert(oox::docx_conversion_context & Context)
if (text_list_header_) if (text_list_header_)
text_list_header_->docx_convert(Context); text_list_header_->docx_convert(Context);
BOOST_FOREACH(const office_element_ptr & elm, text_list_items_) for (size_t i = 0; i < text_list_items_.size(); i++)
{ {
elm->docx_convert(Context); text_list_items_[i]->docx_convert(Context);
} }
Context.end_list(); Context.end_list();
...@@ -692,9 +690,9 @@ void list::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -692,9 +690,9 @@ void list::pptx_convert(oox::pptx_conversion_context & Context)
if (text_list_header_) if (text_list_header_)
text_list_header_->pptx_convert(Context); text_list_header_->pptx_convert(Context);
BOOST_FOREACH(const office_element_ptr & elm, text_list_items_) for (size_t i = 0; i < text_list_items_.size(); i++)
{ {
elm->pptx_convert(Context); text_list_items_[i]->pptx_convert(Context);
} }
Context.get_text_context().end_list(); Context.get_text_context().end_list();
...@@ -788,9 +786,9 @@ void text_section::docx_convert(oox::docx_conversion_context & Context) ...@@ -788,9 +786,9 @@ void text_section::docx_convert(oox::docx_conversion_context & Context)
Context.add_page_properties(current_page_properties); Context.add_page_properties(current_page_properties);
BOOST_FOREACH(const office_element_ptr & elm, text_content_) for (size_t i = 0; i < text_content_.size(); i++)
{ {
elm->docx_convert(Context); text_content_[i]->docx_convert(Context);
} }
} }
...@@ -844,16 +842,16 @@ void text_index_body::add_child_element( xml::sax * Reader, const std::wstring & ...@@ -844,16 +842,16 @@ void text_index_body::add_child_element( xml::sax * Reader, const std::wstring &
void text_index_body::docx_convert(oox::docx_conversion_context & Context) void text_index_body::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, index_content_main_) for (size_t i = 0; i < index_content_main_.size(); i++)
{ {
elm->docx_convert(Context); index_content_main_[i]->docx_convert(Context);
} }
} }
void text_index_body::pptx_convert(oox::pptx_conversion_context & Context) void text_index_body::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(const office_element_ptr & elm, index_content_main_) for (size_t i = 0; i < index_content_main_.size(); i++)
{ {
elm->pptx_convert(Context); index_content_main_[i]->pptx_convert(Context);
} }
} }
// text:index-title // text:index-title
...@@ -864,16 +862,16 @@ const wchar_t * text_index_title::name = L"index-title"; ...@@ -864,16 +862,16 @@ const wchar_t * text_index_title::name = L"index-title";
void text_index_title::docx_convert(oox::docx_conversion_context & Context) void text_index_title::docx_convert(oox::docx_conversion_context & Context)
{ {
BOOST_FOREACH(office_element_ptr & elm, index_content_main_) for (size_t i = 0; i < index_content_main_.size(); i++)
{ {
elm->docx_convert(Context); index_content_main_[i]->docx_convert(Context);
} }
} }
void text_index_title::pptx_convert(oox::pptx_conversion_context & Context) void text_index_title::pptx_convert(oox::pptx_conversion_context & Context)
{ {
BOOST_FOREACH(office_element_ptr & elm, index_content_main_) for (size_t i = 0; i < index_content_main_.size(); i++)
{ {
elm->pptx_convert(Context); index_content_main_[i]->pptx_convert(Context);
} }
} }
std::wostream & text_index_title::text_to_stream(std::wostream & _Wostream) const std::wostream & text_index_title::text_to_stream(std::wostream & _Wostream) const
......
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