Commit ed59c2b9 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 925bca71
...@@ -189,6 +189,14 @@ namespace formulasconvert { ...@@ -189,6 +189,14 @@ namespace formulasconvert {
return c1 + (c3.empty() ? L"" : (L":" + c3) ); return c1 + (c3.empty() ? L"" : (L":" + c3) );
} }
} }
else if (sz == 5 && !what[1].matched)
{
const std::wstring c1 = what[2].str();
const std::wstring c2 = what[3].str(); //sheet name 2
const std::wstring c3 = what[4].str();
return c1 + (c3.empty() ? L"" : (L":" + c3) );
}
return L""; return L"";
} }
std::wstring odf2oox_converter::Impl::replace_named_ref_formater1(boost::wsmatch const & what) std::wstring odf2oox_converter::Impl::replace_named_ref_formater1(boost::wsmatch const & what)
...@@ -216,10 +224,10 @@ namespace formulasconvert { ...@@ -216,10 +224,10 @@ namespace formulasconvert {
void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr, bool withTableName) void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr, bool withTableName)
{ {
convert_with_TableName = withTableName; convert_with_TableName = withTableName;
//boost::wregex simpleRef(L"\\[\\.([a-zA-Z]+\\d+)(?::\\.([a-zA-Z]+\\d+)){0,1}\\]");
boost::wregex complexRef(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}\\]"); boost::wregex complexRef(L"\\[(?:\$)?([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}\\]");
/* /*
[ $ Sheet2 . A1 : . B5 ] [ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
*/ */
const std::wstring res = boost::regex_replace( const std::wstring res = boost::regex_replace(
...@@ -590,6 +598,13 @@ namespace formulasconvert { ...@@ -590,6 +598,13 @@ namespace formulasconvert {
bool isFormula = impl_->check_formula(workstr); bool isFormula = impl_->check_formula(workstr);
if (isFormula)
{
workstr = impl_->convert(expr);
}
else
{
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
workstr = boost::regex_replace( workstr = boost::regex_replace(
...@@ -614,10 +629,6 @@ namespace formulasconvert { ...@@ -614,10 +629,6 @@ 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;
} }
......
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