Commit 6c5687a4 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62929 954022d7-b5bf-4e40-9824-e11837661b57
parent cf32d321
...@@ -45,9 +45,7 @@ namespace cpdoccore ...@@ -45,9 +45,7 @@ namespace cpdoccore
} }
catch(...) catch(...)
{ {
#ifdef _DEBUG _CP_LOG << L"[warning] : incorrect type convert \'" << Name << L"\'\n";
_CP_LOG(warning) << L"[warning] : incorrect type convert \'" << Name << L"\'\n";
#endif
} }
return true; return true;
} }
...@@ -104,9 +102,7 @@ namespace cpdoccore ...@@ -104,9 +102,7 @@ namespace cpdoccore
} }
catch(...) catch(...)
{ {
#ifdef _DEBUG _CP_LOG << L"[warning] : could't read attribute \'" << QualifiedName << L"\'\n";
_CP_LOG(warning) << L"[warning] : could't read attribute \'" << QualifiedName << L"\'\n";
#endif
} }
} }
......
...@@ -2,54 +2,29 @@ ...@@ -2,54 +2,29 @@
#include <iosfwd> #include <iosfwd>
namespace cpdoccore { namespace cpdoccore
#if 1
template <class Ostream>
class logging
{
public:
logging(Ostream &stream) : ostream_(stream)
{}
template <class T>
Ostream & operator << (const T & t)
{
return (ostream_ << t );
}
private:
Ostream & ostream_;
};
#else
template <class Ostream>
class logging
{ {
public: template <class Ostream>
logging(Ostream & Ostream) class logging
{}
template <class T>
logging & operator << (const T & t)
{ {
return *this; public:
} logging(Ostream &stream) : ostream_(stream)
{}
private: template <class T>
Ostream & operator << (const T & t)
{
#if _DEBUG
return (ostream_ << t );
#endif
}
}; private:
Ostream & ostream_;
};
#endif extern logging< std::wostream > logging_cout;
extern logging< std::wostream > logging_err;
extern logging< std::wostream > logging_cout;
} }
#define _CP_LOG_error ::cpdoccore::logging_err #define _CP_LOG cpdoccore::logging_cout
#define _CP_LOG_info ::cpdoccore::logging_err
#define _CP_LOG_warning ::cpdoccore::logging_err
#define _CP_LOG(A) _CP_LOG_##A
...@@ -13,12 +13,10 @@ bool read_doc_element::read_sax( xml::sax * Reader ) ...@@ -13,12 +13,10 @@ bool read_doc_element::read_sax( xml::sax * Reader )
xml::attributes_wc_ptr attrb = xml::read_attributes( Reader ); xml::attributes_wc_ptr attrb = xml::read_attributes( Reader );
add_attributes( attrb ); add_attributes( attrb );
#ifdef _DEBUG
if (!attrb->check()) if (!attrb->check())
{ {
std::wcerr << " -- end (" << Reader->nodeQualifiedName() << ")\n"; std::wcerr << " -- end (" << Reader->nodeQualifiedName() << ")\n";
} }
#endif
//const std::wstring value = Reader->value(); //const std::wstring value = Reader->value();
...@@ -65,4 +63,4 @@ bool read_doc_element::read_sax( xml::sax * Reader ) ...@@ -65,4 +63,4 @@ bool read_doc_element::read_sax( xml::sax * Reader )
} }
} }
} }
\ No newline at end of file
...@@ -9,16 +9,16 @@ namespace oox { ...@@ -9,16 +9,16 @@ namespace oox {
void conversion_element::docx_convert(docx_conversion_context & Context) void conversion_element::docx_convert(docx_conversion_context & Context)
{ {
_CP_LOG(info) << L"[warning] empty conversion_element::docx_convert: \"" << typeid(*this).name() << L"\"\n"; _CP_LOG << L"[warning] empty conversion_element::docx_convert: \"" << typeid(*this).name() << L"\"\n";
} }
void conversion_element::xlsx_convert(xlsx_conversion_context & Context) void conversion_element::xlsx_convert(xlsx_conversion_context & Context)
{ {
_CP_LOG(info) << L"[warning] empty conversion_element::xlsx_convert: \"" << typeid(*this).name() << L"\"\n"; _CP_LOG << L"[warning] empty conversion_element::xlsx_convert: \"" << typeid(*this).name() << L"\"\n";
} }
void conversion_element::pptx_convert(pptx_conversion_context & Context) void conversion_element::pptx_convert(pptx_conversion_context & Context)
{ {
_CP_LOG(info) << L"[warning] empty conversion_element::pptx_convert: \"" << typeid(*this).name() << L"\"\n"; _CP_LOG << L"[warning] empty conversion_element::pptx_convert: \"" << typeid(*this).name() << L"\"\n";
} }
} }
......
...@@ -140,7 +140,7 @@ void word_files::add_charts(chart_content_ptr chart) ...@@ -140,7 +140,7 @@ void word_files::add_charts(chart_content_ptr chart)
} }
bool word_files::has_numbering() bool word_files::has_numbering()
{ {
return numbering_; return numbering_ ? true : false;
} }
void word_files::set_headers_footers(headers_footers & HeadersFooters) void word_files::set_headers_footers(headers_footers & HeadersFooters)
......
...@@ -138,9 +138,7 @@ void docx_table_state::set_columns_spanned(unsigned int Val) ...@@ -138,9 +138,7 @@ void docx_table_state::set_columns_spanned(unsigned int Val)
{ {
if ( current_columns_spaned() > 0 ) if ( current_columns_spaned() > 0 )
{ {
#ifdef _DEBUG _CP_LOG << L"[warning] set_columns_spanned warning\n";
_CP_LOG(info) << L"[warning] set_columns_spanned warning\n";
#endif
} }
columns_spanned_num_ = Val; columns_spanned_num_ = Val;
...@@ -155,13 +153,13 @@ void docx_table_state::set_rows_spanned(unsigned int Column, unsigned int Val, u ...@@ -155,13 +153,13 @@ void docx_table_state::set_rows_spanned(unsigned int Column, unsigned int Val, u
{ {
if (rows_spanned_.size() <= Column) if (rows_spanned_.size() <= Column)
{ {
_CP_LOG(info) << L"[warning] set_rows_spanned error\n"; _CP_LOG << L"[warning] set_rows_spanned error\n";
} }
else else
{ {
if (rows_spanned_[Column].num() > 0) if (rows_spanned_[Column].num() > 0)
{ {
_CP_LOG(info) << L"[warning] set_rows_spanned warning\n"; _CP_LOG << L"[warning] set_rows_spanned warning\n";
} }
rows_spanned_[Column].num(Val); rows_spanned_[Column].num(Val);
rows_spanned_[Column].set_style(Style); rows_spanned_[Column].set_style(Style);
...@@ -173,7 +171,7 @@ unsigned int docx_table_state::current_rows_spanned(unsigned int Column) const ...@@ -173,7 +171,7 @@ unsigned int docx_table_state::current_rows_spanned(unsigned int Column) const
{ {
if (rows_spanned_.size() <= Column) if (rows_spanned_.size() <= Column)
{ {
_CP_LOG(info) << L"[warning] current_rows_spanned error\n"; _CP_LOG << L"[warning] current_rows_spanned error\n";
return 0; return 0;
} }
else else
......
...@@ -63,13 +63,11 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou ...@@ -63,13 +63,11 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou
{ {
try try
{ {
#if _DEBUG _CP_LOG << "[info] : GetMaxDigitSizePixels...";
_CP_LOG(info) << "[info] : GetMaxDigitSizePixels...";
#endif
std::pair<float, float> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager); std::pair<float, float> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager);
#if _DEBUG
_CP_LOG(info) << "ok" << std::endl; _CP_LOG << "ok" << std::endl;
#endif
return val; return val;
} }
catch(...) catch(...)
......
...@@ -327,7 +327,7 @@ void oox_serialize_xfrm(std::wostream & strm, _oox_drawing const & val, std::wst ...@@ -327,7 +327,7 @@ void oox_serialize_xfrm(std::wostream & strm, _oox_drawing const & val, std::wst
} }
}else }else
{ {
_CP_LOG(info) << L"[error!!!] not set size object\n"; _CP_LOG << L"[error!!!] not set size object\n";
} }
} }
} }
...@@ -356,4 +356,4 @@ void oox_serialize_hlink(std::wostream & strm, std::vector<_hlink_desc> const & ...@@ -356,4 +356,4 @@ void oox_serialize_hlink(std::wostream & strm, std::vector<_hlink_desc> const &
} }
} }
\ No newline at end of file
...@@ -163,7 +163,7 @@ void pptx_table_state::set_rows_spanned(unsigned int Column, unsigned int Val, u ...@@ -163,7 +163,7 @@ void pptx_table_state::set_rows_spanned(unsigned int Column, unsigned int Val, u
{ {
if (rows_spanned_.size() <= Column) if (rows_spanned_.size() <= Column)
{ {
_CP_LOG(info) << L"[warning] set_rows_spanned error\n"; _CP_LOG << L"[warning] set_rows_spanned error\n";
} }
else else
{ {
...@@ -177,7 +177,7 @@ unsigned int pptx_table_state::current_rows_spanned(unsigned int Column) const ...@@ -177,7 +177,7 @@ unsigned int pptx_table_state::current_rows_spanned(unsigned int Column) const
{ {
if (rows_spanned_.size() <= Column) if (rows_spanned_.size() <= Column)
{ {
_CP_LOG(info) << L"[warning] current_rows_spanned error\n"; _CP_LOG << L"[warning] current_rows_spanned error\n";
return 0; return 0;
} }
else else
......
...@@ -46,14 +46,23 @@ bool xlsx_border_edge::operator != (const xlsx_border_edge & rVal) const ...@@ -46,14 +46,23 @@ bool xlsx_border_edge::operator != (const xlsx_border_edge & rVal) const
return !(this->operator ==(rVal)); return !(this->operator ==(rVal));
} }
std::size_t hash_value(xlsx_border_edge const & val) std::size_t hash_value(xlsx_border_edge const& val)
{ {
std::size_t seed = 0; std::size_t seed = 0;
boost::hash_combine(seed, val.style.get_value_or(L"")); boost::hash_combine(seed, val.style.get_value_or(L""));
boost::hash_combine(seed, val.color.get_value_or(xlsx_color())); boost::hash_combine(seed, val.color.get_value_or(xlsx_color()));
return seed; return seed;
} }
std::size_t hash_value(const _CP_OPT(xlsx_border_edge) & val)
{
std::size_t seed = 0;
if (val)
{
boost::hash_combine(seed, val->style.get_value_or(L""));
boost::hash_combine(seed, val->color.get_value_or(xlsx_color()));
}
return seed;
}
void xlsx_serialize(std::wostream & _Wostream, const _CP_OPT(xlsx_border_edge) & borderEdge, const std::wstring & name) void xlsx_serialize(std::wostream & _Wostream, const _CP_OPT(xlsx_border_edge) & borderEdge, const std::wstring & name)
{ {
if (borderEdge) if (borderEdge)
...@@ -97,7 +106,7 @@ void xlsx_serialize(std::wostream & _Wostream, const xlsx_border & border) ...@@ -97,7 +106,7 @@ void xlsx_serialize(std::wostream & _Wostream, const xlsx_border & border)
} }
} }
std::size_t hash_value(xlsx_border const & val) std::size_t hash_value(xlsx_border const& val)
{ {
std::size_t seed = 0; std::size_t seed = 0;
boost::hash_combine(seed, val.diagonalUp.get_value_or(false)); boost::hash_combine(seed, val.diagonalUp.get_value_or(false));
...@@ -117,21 +126,28 @@ std::size_t hash_value(xlsx_border const & val) ...@@ -117,21 +126,28 @@ std::size_t hash_value(xlsx_border const & val)
bool is_default(const _CP_OPT(xlsx_border_edge) & borderEdge) bool is_default(const _CP_OPT(xlsx_border_edge) & borderEdge)
{ {
if (!borderEdge || is_default(borderEdge.get())) if (!borderEdge) return true;
return true; if (is_default(borderEdge.get())) return true;
else
return false; return false;
} }
bool is_default(const xlsx_border_edge & borderEdge) bool is_default(xlsx_border_edge * borderEdge)
{ {
if (!borderEdge.style || borderEdge.style.get() == L"none") if (!borderEdge) return true;
return true; if (!borderEdge->style) return true;
else if (borderEdge->style.get() == L"none") return true;
return false;
return false;
} }
bool is_default(xlsx_border_edge const& borderEdge)
{
if (!borderEdge.style) return true;
if (borderEdge.style.get() == L"none") return true;
bool is_default(const xlsx_border & border) return false;
}
bool is_default(xlsx_border const& border)
{ {
if (border.diagonalUp.get_value_or(false) == false && if (border.diagonalUp.get_value_or(false) == false &&
border.diagonalDown.get_value_or(false) == false && border.diagonalDown.get_value_or(false) == false &&
......
...@@ -34,7 +34,6 @@ namespace oox { ...@@ -34,7 +34,6 @@ namespace oox {
bool operator == (const xlsx_border_edge & rVal) const; bool operator == (const xlsx_border_edge & rVal) const;
bool operator != (const xlsx_border_edge & rVal) const; bool operator != (const xlsx_border_edge & rVal) const;
friend std::size_t hash_value(xlsx_border_edge const & val);
}; };
struct xlsx_border struct xlsx_border
...@@ -56,13 +55,18 @@ namespace oox { ...@@ -56,13 +55,18 @@ namespace oox {
bool operator == (const xlsx_border & rVal) const; bool operator == (const xlsx_border & rVal) const;
bool operator != (const xlsx_border & rVal) const; bool operator != (const xlsx_border & rVal) const;
friend bool is_default(xlsx_border_edge const & borderEdge);
friend bool is_default(_CP_OPT(xlsx_border_edge) const & borderEdge);
friend bool is_default(xlsx_border const & border);
friend std::size_t hash_value(xlsx_border const & val);
}; };
std::size_t hash_value(const _CP_OPT(xlsx_border_edge) & val);
std::size_t hash_value(xlsx_border_edge const& val);
std::size_t hash_value(xlsx_border const& val);
bool is_default(xlsx_border_edge * borderEdge);
bool is_default(xlsx_border_edge const& borderEdge);
bool is_default(const _CP_OPT(xlsx_border_edge) & borderEdge);
bool is_default(xlsx_border const& border);
void xlsx_serialize(std::wostream & _Wostream, xlsx_border const & border); void xlsx_serialize(std::wostream & _Wostream, xlsx_border const & border);
} }
......
...@@ -104,7 +104,7 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned) ...@@ -104,7 +104,7 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned)
if ( current_columns_spaned() > 0 ) if ( current_columns_spaned() > 0 )
{ {
_CP_LOG(info) << L"[warning] current columns spanned > 0\n"; _CP_LOG << L"[warning] current columns spanned > 0\n";
} }
columns_spanned_num_ = static_cast<int>(columnsSpanned); columns_spanned_num_ = static_cast<int>(columnsSpanned);
...@@ -121,17 +121,13 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned) ...@@ -121,17 +121,13 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned)
if (rows_spanned_.size() <= current_table_column_) if (rows_spanned_.size() <= current_table_column_)
{ {
#ifdef _DEBUG _CP_LOG << L"[warning] set_rows_spanned error\n";
_CP_LOG(info) << L"[warning] set_rows_spanned error\n";
#endif
} }
else else
{ {
if (rows_spanned_[current_table_column_].num() > 0) if (rows_spanned_[current_table_column_].num() > 0)
{ {
#ifdef _DEBUG _CP_LOG << L"[warning] current rows spanned > 0\n";
_CP_LOG(info) << L"[warning] current rows spanned > 0\n";
#endif
} }
rows_spanned_[current_table_column_].num(static_cast<unsigned int>(rowsSpanned)); rows_spanned_[current_table_column_].num(static_cast<unsigned int>(rowsSpanned));
rows_spanned_[current_table_column_].column_spanned(static_cast<unsigned int>(columnsSpanned)); rows_spanned_[current_table_column_].column_spanned(static_cast<unsigned int>(columnsSpanned));
...@@ -213,7 +209,7 @@ unsigned int xlsx_table_state::current_rows_spanned(unsigned int Column) const ...@@ -213,7 +209,7 @@ unsigned int xlsx_table_state::current_rows_spanned(unsigned int Column) const
{ {
if (rows_spanned_.size() <= Column) if (rows_spanned_.size() <= Column)
{ {
_CP_LOG(info) << L"[warning] current_rows_spanned error\n"; _CP_LOG << L"[warning] current_rows_spanned error\n";
return 0; return 0;
} }
else else
......
...@@ -103,7 +103,7 @@ void chart_build::add_grid(std::wstring const & className, std::wstring const & ...@@ -103,7 +103,7 @@ void chart_build::add_grid(std::wstring const & className, std::wstring const &
} }
else else
{ {
_CP_LOG(warning) << "unexpected chart:grid" << std::endl; _CP_LOG << "[warning] unexpected chart:grid" << std::endl;
} }
} }
void chart_build::add_series(std::wstring const & cellRangeAddress, void chart_build::add_series(std::wstring const & cellRangeAddress,
...@@ -126,7 +126,7 @@ void chart_build::add_point(unsigned int rep, std::wstring const & styleName) ...@@ -126,7 +126,7 @@ void chart_build::add_point(unsigned int rep, std::wstring const & styleName)
} }
else else
{ {
_CP_LOG(warning) << "unexpected chart:data-point" << std::endl; _CP_LOG << "[warning] unexpected chart:data-point" << std::endl;
} }
} }
...@@ -369,7 +369,7 @@ bool process_build_chart::visit_rows(unsigned int repeated) ...@@ -369,7 +369,7 @@ bool process_build_chart::visit_rows(unsigned int repeated)
////////////////////////////////////////////////// //////////////////////////////////////////////////
void process_build_chart::on_not_impl(std::string const & message) void process_build_chart::on_not_impl(std::string const & message)
{ {
_CP_LOG(warning) << L"[process_draw_chart visitor] : not impliment for \"" << utf8_to_utf16(message) << L"\"" << std::endl; _CP_LOG << L"[process_draw_chart visitor] : not impliment for \"" << utf8_to_utf16(message) << L"\"" << std::endl;
} }
////////////////////////////////////////////////// //////////////////////////////////////////////////
......
...@@ -228,9 +228,7 @@ public: ...@@ -228,9 +228,7 @@ public:
,styles_(styles) ,styles_(styles)
,draw_styles_(draw_styles) ,draw_styles_(draw_styles)
{ {
_CP_LOG(warning) << L"[process_draw_object] \"" << L"\"" << std::endl; }
}
private: private:
void ApplyChartProperties(std::wstring style,std::vector<_property> & propertiesOut); void ApplyChartProperties(std::wstring style,std::vector<_property> & propertiesOut);
......
...@@ -24,9 +24,7 @@ bool create_element_and_read(xml::sax * Reader, ...@@ -24,9 +24,7 @@ bool create_element_and_read(xml::sax * Reader,
if (_Element) // if (_Element) //
{ {
std::wstringstream ss; _CP_LOG << L"[error] : duplicate element (" << Ns << L":" << Name << L")\n";
ss << L"[warning] : duplicate element (" << Ns << L":" << Name << L")\n";
_CP_LOG(error) << ss.str();
} }
_Element = elm; _Element = elm;
...@@ -34,11 +32,8 @@ bool create_element_and_read(xml::sax * Reader, ...@@ -34,11 +32,8 @@ bool create_element_and_read(xml::sax * Reader,
} }
else else
{ {
#ifdef _DEBUG _CP_LOG << L"[error] : create element failed (" << Ns << L":" << Name << L")\n";
std::wstringstream ss;
ss << L"[warning] : create element failed (" << Ns << L":" << Name << L")\n";
_CP_LOG(error) << ss.str();
#endif
not_applicable_element(L"[!!!]", Reader, Ns, Name); not_applicable_element(L"[!!!]", Reader, Ns, Name);
} }
return false; return false;
......
...@@ -46,7 +46,7 @@ const std::wstring color::get_hex_value() const ...@@ -46,7 +46,7 @@ const std::wstring color::get_hex_value() const
} }
//_CP_LOG(info) << "[warning] convert color error (" << color_ << L")\n"; //_CP_LOG << "[warning] convert color error (" << color_ << L")\n";
return L"000000"; return L"000000";
} }
......
...@@ -27,9 +27,8 @@ public: ...@@ -27,9 +27,8 @@ public:
catch(odf::errors::invalid_attribute &) catch(odf::errors::invalid_attribute &)
{ {
attributes::value_type val = attr.get(QualifiedName); attributes::value_type val = attr.get(QualifiedName);
#ifdef _DEBUG
_CP_LOG(error) << L"[warning] : invalud attribute value [" << QualifiedName << L":" << ( (val) ? (*val) : (L"?")) << L"]\n"; _CP_LOG << L"[error] : invalud attribute value [" << QualifiedName << L":" << ( (val) ? (*val) : (L"?")) << L"]\n";
#endif
} }
return optional_v_type(); return optional_v_type();
} }
......
...@@ -498,7 +498,7 @@ void oox_convert_transforms(std::wstring transformStr,std::vector<odf::_property ...@@ -498,7 +498,7 @@ void oox_convert_transforms(std::wstring transformStr,std::vector<odf::_property
BOOST_FOREACH(std::wstring const & t, transforms) BOOST_FOREACH(std::wstring const & t, transforms)
{ {
//_CP_LOG(info) << "[info] : transform = " << t << L"\n"; //_CP_LOG << "[info] : transform = " << t << L"\n";
std::vector<std::wstring> transform; std::vector<std::wstring> transform;
boost::algorithm::split(transform,t, boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on); boost::algorithm::split(transform,t, boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on);
...@@ -555,7 +555,7 @@ void xlsx_convert_transforms(std::wstring transformStr, oox::xlsx_conversion_con ...@@ -555,7 +555,7 @@ void xlsx_convert_transforms(std::wstring transformStr, oox::xlsx_conversion_con
BOOST_FOREACH(std::wstring const & t, transforms) BOOST_FOREACH(std::wstring const & t, transforms)
{ {
//_CP_LOG(info) << "[info] : transform = " << t << L"\n"; //_CP_LOG << "[info] : transform = " << t << L"\n";
std::vector<std::wstring> transform; std::vector<std::wstring> transform;
boost::algorithm::split(transform,t, boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on); boost::algorithm::split(transform,t, boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on);
...@@ -615,7 +615,7 @@ void pptx_convert_transforms(std::wstring transformStr, oox::pptx_conversion_con ...@@ -615,7 +615,7 @@ void pptx_convert_transforms(std::wstring transformStr, oox::pptx_conversion_con
BOOST_FOREACH(std::wstring const & t, transforms) BOOST_FOREACH(std::wstring const & t, transforms)
{ {
//_CP_LOG(info) << "[info] : transform = " << t << L"\n"; //_CP_LOG << "[info] : transform = " << t << L"\n";
std::vector<std::wstring> transform; std::vector<std::wstring> transform;
boost::algorithm::split(transform,t, boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on); boost::algorithm::split(transform,t, boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on);
......
...@@ -1218,7 +1218,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context) ...@@ -1218,7 +1218,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
} }
catch(...) catch(...)
{ {
_CP_LOG(error) << "convert draw::object error" << std::endl; _CP_LOG << "[error] : convert draw::object error" << std::endl;
} }
} }
......
...@@ -299,7 +299,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -299,7 +299,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
} }
catch(...) catch(...)
{ {
_CP_LOG(error) << "convert draw::object error" << std::endl; _CP_LOG << "[error] : convert draw::object error" << std::endl;
} }
} }
......
...@@ -264,7 +264,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -264,7 +264,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
} }
catch(...) catch(...)
{ {
_CP_LOG(error) << "convert draw::object error" << std::endl; _CP_LOG << "[error] : convert draw::object error" << std::endl;
} }
} }
void draw_object_ole::xlsx_convert(oox::xlsx_conversion_context & Context) void draw_object_ole::xlsx_convert(oox::xlsx_conversion_context & Context)
......
...@@ -100,7 +100,7 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -100,7 +100,7 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L""); const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L"");
const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L""); const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L"");
_CP_LOG(info) << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl; _CP_LOG << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl;
Context.start_page(pageName, pageStyleName, layoutName,masterName); Context.start_page(pageName, pageStyleName, layoutName,masterName);
......
...@@ -26,7 +26,7 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -26,7 +26,7 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L""); const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L"");
const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L""); const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L"");
_CP_LOG(info) << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl; _CP_LOG << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl;
Context.start_page(pageName, pageStyleName, layoutName,masterName); Context.start_page(pageName, pageStyleName, layoutName,masterName);
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
#include <logging.h> #include <logging.h>
#include <iostream> #include <iostream>
namespace cpdoccore { namespace cpdoccore
{
logging< std::wostream > logging_err(std::wcerr); logging< std::wostream > logging_cout(std::wcout);
logging< std::wostream > logging_cout(std::wcout);
} }
...@@ -52,13 +52,13 @@ public: ...@@ -52,13 +52,13 @@ public:
public: public:
virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const virtual ::std::wostream & text_to_stream(::std::wostream & _Wostream) const
{ {
_CP_LOG(info) << L"[warning] use base text_to_stream\n"; _CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream; return _Wostream;
} }
virtual ::std::wostream & xml_to_stream(::std::wostream & _Wostream) const virtual ::std::wostream & xml_to_stream(::std::wostream & _Wostream) const
{ {
_CP_LOG(info) << L"[warning] use base xml_to_stream\n"; _CP_LOG << L"[warning] use base xml_to_stream\n";
return _Wostream; return _Wostream;
} }
document_context * getContext() { return context_; } document_context * getContext() { return context_; }
......
...@@ -76,17 +76,13 @@ bool office_element_creator::register_element(const std::wstring &ns, const std: ...@@ -76,17 +76,13 @@ bool office_element_creator::register_element(const std::wstring &ns, const std:
void not_applicable_element(const std::wstring & Current, xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) void not_applicable_element(const std::wstring & Current, xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{ {
#ifdef _DEBUG
std::wstringstream ss; std::wstringstream ss;
ss << L"[warning] : element " << Ns << L":" << Name << " not applicable in current place"; ss << L"[error] : element " << Ns << L":" << Name << " not applicable in current place";
if (!Current.empty()) if (!Current.empty())
ss << L" ("<< Current << ")"; ss << L" ("<< Current << ")";
ss << L"\n"; ss << L"\n";
_CP_LOG(error) << ss.str(); _CP_LOG << ss.str();
#endif
//if (Reader)
// _skip_element::skip_element_.read_sax(Reader);
} }
void not_applicable_element(const office_element * CurrentElm, xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) void not_applicable_element(const office_element * CurrentElm, xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
......
...@@ -44,7 +44,7 @@ void office_presentation::add_attributes( const xml::attributes_wc_ptr & Attribu ...@@ -44,7 +44,7 @@ void office_presentation::add_attributes( const xml::attributes_wc_ptr & Attribu
void office_presentation::docx_convert(oox::docx_conversion_context & Context) void office_presentation::docx_convert(oox::docx_conversion_context & Context)
{ {
Context.start_office_text(); Context.start_office_text();
_CP_LOG(info) << L"[info][docx] process pages (" << pages_.size() << L" elmements)" << std::endl; _CP_LOG << L"[info][docx] process pages (" << pages_.size() << L" elmements)" << std::endl;
BOOST_FOREACH(const office_element_ptr & elm, pages_) BOOST_FOREACH(const office_element_ptr & elm, pages_)
{ {
elm->docx_convert(Context); elm->docx_convert(Context);
...@@ -55,7 +55,7 @@ void office_presentation::docx_convert(oox::docx_conversion_context & Context) ...@@ -55,7 +55,7 @@ void office_presentation::docx_convert(oox::docx_conversion_context & Context)
void office_presentation::xlsx_convert(oox::xlsx_conversion_context & Context) void office_presentation::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
Context.start_office_spreadsheet(this); Context.start_office_spreadsheet(this);
_CP_LOG(info) << L"[info][xlsx] process pages (" << pages_.size() << L" elmements)" << std::endl; _CP_LOG << L"[info][xlsx] process pages (" << pages_.size() << L" elmements)" << std::endl;
BOOST_FOREACH(const office_element_ptr & elm, pages_) BOOST_FOREACH(const office_element_ptr & elm, pages_)
{ {
elm->xlsx_convert(Context); elm->xlsx_convert(Context);
...@@ -67,7 +67,7 @@ void office_presentation::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -67,7 +67,7 @@ void office_presentation::pptx_convert(oox::pptx_conversion_context & Context)
{ {
Context.start_office_presentation(); Context.start_office_presentation();
_CP_LOG(info) << L"[info][pptx] process pages(" << pages_.size() << L" elmements)" << std::endl; _CP_LOG << L"[info][pptx] process pages(" << pages_.size() << L" elmements)" << std::endl;
BOOST_FOREACH(const office_element_ptr & elm, footer_decls_) BOOST_FOREACH(const office_element_ptr & elm, footer_decls_)
{ {
......
...@@ -44,7 +44,7 @@ void office_spreadsheet::docx_convert(oox::docx_conversion_context & Context) ...@@ -44,7 +44,7 @@ void office_spreadsheet::docx_convert(oox::docx_conversion_context & Context)
void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context) void office_spreadsheet::xlsx_convert(oox::xlsx_conversion_context & Context)
{ {
Context.start_office_spreadsheet(this); Context.start_office_spreadsheet(this);
_CP_LOG(info) << 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, content_) BOOST_FOREACH(const office_element_ptr & elm, content_)
{ {
elm->xlsx_convert(Context); elm->xlsx_convert(Context);
......
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
private: private:
virtual void on_not_impl(std::string const & message) virtual void on_not_impl(std::string const & message)
{ {
_CP_LOG(warning) << L"[table_round visitor] : not impliment for \"" << utf8_to_utf16(message) << L"\"" << std::endl; _CP_LOG << L"[table_round visitor] : not impliment for \"" << utf8_to_utf16(message) << L"\"" << std::endl;
} }
public: public:
......
...@@ -19,9 +19,7 @@ void _skip_element::add_attributes( const xml::attributes_wc_ptr & Attributes ) ...@@ -19,9 +19,7 @@ void _skip_element::add_attributes( const xml::attributes_wc_ptr & Attributes )
void _skip_element::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name) void _skip_element::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name)
{ {
std::wstringstream ss; _CP_LOG << L"[error] : skip element " << Ns << L":" << Name << "\n";
ss << L"[warning] : skip element " << Ns << L":" << Name << "\n";
_CP_LOG(error) << ss.str();
if (Reader) if (Reader)
skip_element_.read_sax(Reader); skip_element_.read_sax(Reader);
...@@ -29,9 +27,7 @@ void _skip_element::add_child_element( xml::sax * Reader, const ::std::wstring & ...@@ -29,9 +27,7 @@ void _skip_element::add_child_element( xml::sax * Reader, const ::std::wstring &
void _skip_element::add_text(const std::wstring & Text) void _skip_element::add_text(const std::wstring & Text)
{ {
std::wstringstream ss; _CP_LOG << L"[error] : skip element text\n";
ss << L"[warning] : skip element text\n";
_CP_LOG(error) << ss.str();
} }
} }
......
...@@ -94,9 +94,7 @@ std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, double Mu ...@@ -94,9 +94,7 @@ std::wstring process_margin(const _CP_OPT(length_or_percent) & margin, double Mu
} }
else else
{ {
#ifdef _DEBUG _CP_LOG << L"[docx_convert] convert margin warning: invalid type (percent)\n";
_CP_LOG(info) << L"[docx_convert] convert margin warning: invalid type (percent)\n";
#endif
} }
} }
return L""; return L"";
...@@ -443,7 +441,6 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context) ...@@ -443,7 +441,6 @@ void style_tab_stop::docx_convert(oox::docx_conversion_context & Context)
{ {
if (style_leader_style_) if (style_leader_style_)
{ {
_CP_LOG(info) << L"[docx_convert] convert warning (w:tab/@w:leader)\n";
switch(style_leader_style_->get_type()) switch(style_leader_style_->get_type())
{ {
case line_style::None: case line_style::None:
......
...@@ -391,7 +391,7 @@ void style_tab_stop::pptx_convert(oox::pptx_conversion_context & Context) ...@@ -391,7 +391,7 @@ void style_tab_stop::pptx_convert(oox::pptx_conversion_context & Context)
// { // {
// if (style_leader_style_) // if (style_leader_style_)
// { // {
// _CP_LOG(info) << L"[pptx_convert] convert warning (a:tab/@a:leader)\n"; // _CP_LOG << L"[pptx_convert] convert warning (a:tab/@a:leader)\n";
// switch(style_leader_style_->get_type()) // switch(style_leader_style_->get_type())
// { // {
// case line_style::None: // case line_style::None:
......
...@@ -246,7 +246,7 @@ double text_format_properties_content::process_font_size_impl(const _CP_OPT(font ...@@ -246,7 +246,7 @@ double text_format_properties_content::process_font_size_impl(const _CP_OPT(font
} }
else else
{ {
_CP_LOG(info) << L"[docx_convert] convert font_size error (" << FontSize << ")\n"; _CP_LOG << L"[docx_convert] convert font_size error (" << FontSize << ")\n";
} }
return -1.0; return -1.0;
......
...@@ -62,9 +62,6 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -62,9 +62,6 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool skip_next_row = false; bool skip_next_row = false;
#ifdef _DEBUG
_CP_LOG(info) << "[info][xlsx] process repeated rows " << table_table_row_attlist_.table_number_rows_repeated_ << std::endl;
#endif
std::wstring ht = L""; std::wstring ht = L"";
double row_height = 0.0; double row_height = 0.0;
...@@ -240,7 +237,7 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -240,7 +237,7 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
const std::wstring tableStyleName = table_table_attlist_.table_style_name_ ? table_table_attlist_.table_style_name_->style_name() : L""; const std::wstring tableStyleName = table_table_attlist_.table_style_name_ ? table_table_attlist_.table_style_name_->style_name() : L"";
const std::wstring tableName = table_table_attlist_.table_name_.get_value_or(L""); const std::wstring tableName = table_table_attlist_.table_name_.get_value_or(L"");
_CP_LOG(info) << L"[info][xlsx] process table \"" <</* tableName*/ L"1111" << L"\"" << std::endl; _CP_LOG << L"[info][xlsx] process table \"" << tableName << L"\"\n" << std::endl;
if (table_table_source_) if (table_table_source_)
{ {
...@@ -556,7 +553,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context) ...@@ -556,7 +553,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
} }
catch(...) catch(...)
{ {
_CP_LOG(info) << L"\n[error]: style wrong\n"; _CP_LOG << L"[error]: style wrong\n";
} }
std::wstring data_style = CalcCellDataStyle(Context, std::wstring data_style = CalcCellDataStyle(Context,
......
...@@ -5,7 +5,7 @@ typedef void (*OnProgressExCallback)( void* lpParam, long nID, long nPercent, sh ...@@ -5,7 +5,7 @@ typedef void (*OnProgressExCallback)( void* lpParam, long nID, long nPercent, sh
struct ProgressCallback struct ProgressCallback
{ {
OnProgressCallback OnProgress; OnProgressCallback OnProgress;
OnProgressExCallback OnProgressEx; OnProgressExCallback OnProgressEx;
void* caller; void* caller;
}; };
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