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

......

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56437 954022d7-b5bf-4e40-9824-e11837661b57
parent 68f540eb
...@@ -772,7 +772,7 @@ void ods_table_state::set_cell_value(std::wstring & value) ...@@ -772,7 +772,7 @@ void ods_table_state::set_cell_value(std::wstring & value)
if (!cell->table_table_cell_attlist_.common_value_and_type_attlist_) if (!cell->table_table_cell_attlist_.common_value_and_type_attlist_)
{ {
cell->table_table_cell_attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist(); cell->table_table_cell_attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
//cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::Float); cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::Float);
//... //...
} }
cells_.back().empty = false; cells_.back().empty = false;
...@@ -922,7 +922,7 @@ void ods_table_state::start_conditional_format(std::wstring ref) ...@@ -922,7 +922,7 @@ void ods_table_state::start_conditional_format(std::wstring ref)
if (cond_format) if (cond_format)
{ {
formulasconvert::oox2odf_converter converter; formulasconvert::oox2odf_converter converter;
std::wstring out = converter.convert(ref); std::wstring out = converter.convert_ref(ref);
boost::algorithm::replace_all(out,L"[",L""); boost::algorithm::replace_all(out,L"[",L"");
boost::algorithm::replace_all(out,L"]",L""); boost::algorithm::replace_all(out,L"]",L"");
cond_format->calcext_target_range_address_ = out; cond_format->calcext_target_range_address_ = out;
...@@ -961,7 +961,16 @@ void ods_table_state::start_conditional_rule(int rule_type) ...@@ -961,7 +961,16 @@ void ods_table_state::start_conditional_rule(int rule_type)
case 13: /*notContainsText*/ case 13: /*notContainsText*/
case 15: /*top10*/ case 15: /*top10*/
case 16: /*uniqueValues*/ case 16: /*uniqueValues*/
default: create_element(L"calcext", L"condition",elm,&context_); default:
{
create_element(L"calcext", L"condition",elm,&context_);
calcext_condition* condition = dynamic_cast<calcext_condition*> (elm.get());
calcext_conditional_format* condition_fmt = dynamic_cast<calcext_conditional_format*> (current_level_.back().get());
if (condition && condition_fmt)
{
condition->calcext_condition_attr_.calcext_base_cell_address_=condition_fmt->calcext_target_range_address_;
}
}
} }
current_level_.back()->add_child_element(elm); current_level_.back()->add_child_element(elm);
...@@ -972,6 +981,21 @@ void ods_table_state::end_conditional_rule() ...@@ -972,6 +981,21 @@ void ods_table_state::end_conditional_rule()
{ {
current_level_.pop_back(); current_level_.pop_back();
} }
void ods_table_state::set_conditional_formula(std::wstring formula)
{
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
if (condition)condition->calcext_condition_attr_.calcext_value_= formula;
}
void ods_table_state::set_conditional_style_name(std::wstring style_name)
{
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
calcext_date_is* date_is = dynamic_cast<calcext_date_is*> (current_level_.back().get());
if (condition)condition->calcext_condition_attr_.calcext_apply_style_name_= style_ref(style_name);
if (date_is) date_is->calcext_date_is_attr_.calcext_style_ = style_ref(style_name);
}
void ods_table_state::set_conditional_value(int type, std::wstring value ) void ods_table_state::set_conditional_value(int type, std::wstring value )
{ {
calcext_icon_set* icon_set = dynamic_cast<calcext_icon_set*> (current_level_.back().get()); calcext_icon_set* icon_set = dynamic_cast<calcext_icon_set*> (current_level_.back().get());
......
...@@ -206,10 +206,12 @@ public: ...@@ -206,10 +206,12 @@ public:
void start_conditional_formats(); void start_conditional_formats();
void start_conditional_format(std::wstring ref); void start_conditional_format(std::wstring ref);
void start_conditional_rule(int rule_type); void start_conditional_rule(int rule_type);
void set_conditional_formula(std::wstring formula);
void set_conditional_value(int type, std::wstring value ); void set_conditional_value(int type, std::wstring value );
void set_conditional_iconset(int type_iconset); void set_conditional_iconset(int type_iconset);
void add_conditional_colorscale(_CP_OPT(color) color); void add_conditional_colorscale(_CP_OPT(color) color);
void set_conditional_databar_color(_CP_OPT(color) color); void set_conditional_databar_color(_CP_OPT(color) color);
void set_conditional_style_name(std::wstring style_name);
void end_conditional_rule(); void end_conditional_rule();
void end_conditional_format(); void end_conditional_format();
void end_conditional_formats(); void end_conditional_formats();
......
...@@ -441,7 +441,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::WritingElement *oox_unknown) ...@@ -441,7 +441,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::WritingElement *oox_unknown)
OOX::Spreadsheet::CDataBar *pB = static_cast<OOX::Spreadsheet::CDataBar*>(oox_unknown); OOX::Spreadsheet::CDataBar *pB = static_cast<OOX::Spreadsheet::CDataBar*>(oox_unknown);
convert(pB); convert(pB);
}break; }break;
default: case OOX::Spreadsheet::et_FormulaCF:
{
OOX::Spreadsheet::CFormulaCF *pF = static_cast<OOX::Spreadsheet::CFormulaCF*>(oox_unknown);
convert(pF);
}break; default:
{ {
std::wstringstream ss; std::wstringstream ss;
ss << L"[warning] : no convert element(" << oox_unknown->getType() << L")\n"; ss << L"[warning] : no convert element(" << oox_unknown->getType() << L")\n";
...@@ -1515,10 +1519,20 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_co ...@@ -1515,10 +1519,20 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_co
if (oox_cond_rule->m_oType.IsInit()) if (oox_cond_rule->m_oType.IsInit())
{ {
ods_context->current_table().start_conditional_rule(oox_cond_rule->m_oType->GetValue()); ods_context->current_table().start_conditional_rule(oox_cond_rule->m_oType->GetValue());
{
if (oox_cond_rule->m_oDxfId.IsInit())
{
// ... styles dxfs cellXfs
//std::wstring odf_style_name;
//odf::odf_style_state *style_state=NULL;
//odf_context()->styles_context()->find_odf_style_state(oox_cond_rule->m_oDxfId->GetValue(), odf::style_family::TableCell,style_state);
//if (style_state)odf_style_name = style_state->get_name();
for (long i=0; i< oox_cond_rule->m_arrItems.GetSize(); i++) //ods_context->current_table().set_conditional_style_name(odf_style_name);
convert(oox_cond_rule->m_arrItems[i]); }
for (long i=0; i< oox_cond_rule->m_arrItems.GetSize(); i++)
convert(oox_cond_rule->m_arrItems[i]);
}
ods_context->current_table().end_conditional_rule(); ods_context->current_table().end_conditional_rule();
} }
} }
...@@ -1580,6 +1594,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatValueObject *oox ...@@ -1580,6 +1594,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatValueObject *oox
ods_context->current_table().set_conditional_value(type,val); ods_context->current_table().set_conditional_value(type,val);
} }
void XlsxConverter::convert(OOX::Spreadsheet::CFormulaCF *oox_cond_formula)
{
if (!oox_cond_formula)return;
ods_context->current_table().set_conditional_formula(string2std_string(oox_cond_formula->m_sText));
}
void XlsxConverter::convert(OOX::Spreadsheet::CAutofilter *oox_filter) void XlsxConverter::convert(OOX::Spreadsheet::CAutofilter *oox_filter)
{ {
if (!oox_filter)return; if (!oox_filter)return;
......
...@@ -50,6 +50,7 @@ namespace OOX ...@@ -50,6 +50,7 @@ namespace OOX
class CDataBar; class CDataBar;
class CColorScale; class CColorScale;
class CIconSet; class CIconSet;
class CFormulaCF;
class CConditionalFormatValueObject; class CConditionalFormatValueObject;
class CAutofilter; class CAutofilter;
} }
...@@ -166,6 +167,7 @@ namespace Oox2Odf ...@@ -166,6 +167,7 @@ namespace Oox2Odf
void convert(OOX::Spreadsheet::CColorScale *oox_cond_colorscale); void convert(OOX::Spreadsheet::CColorScale *oox_cond_colorscale);
void convert(OOX::Spreadsheet::CIconSet *oox_cond_iconset); void convert(OOX::Spreadsheet::CIconSet *oox_cond_iconset);
void convert(OOX::Spreadsheet::CConditionalFormatValueObject*oox_cond_value); void convert(OOX::Spreadsheet::CConditionalFormatValueObject*oox_cond_value);
void convert(OOX::Spreadsheet::CFormulaCF *oox_cond_formula);
void convert(double oox_size, _CP_OPT(odf::length) & odf_size); void convert(double oox_size, _CP_OPT(odf::length) & odf_size);
void convert_sharing_string(int number); void convert_sharing_string(int number);
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//2 //2
//0 //0
//53 //54
#define INTVER 1,2,0,53 #define INTVER 1,2,0,54
#define STRVER "1,2,0,53\0" #define STRVER "1,2,0,54\0"
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