mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
fix bug #72063
This commit is contained in:
@ -350,6 +350,9 @@ namespace formulasconvert {
|
||||
replace_tmp_back(external);
|
||||
|
||||
int id = -1;//add_external_link(external);
|
||||
|
||||
if (external[0] == L'\'') external = external.substr(1, external.size() - 2);
|
||||
|
||||
std::unordered_map<std::wstring, int>::iterator pFind = mapExternalLink_.find(external);
|
||||
if ( pFind == mapExternalLink_.end())
|
||||
{
|
||||
@ -364,6 +367,9 @@ namespace formulasconvert {
|
||||
{
|
||||
sheet1 = sheet1.substr(1, sheet1.length() - 2);
|
||||
}
|
||||
replace_tmp_back(sheet1);
|
||||
if (sheet1[0] == L'\'') sheet1 = sheet1.substr(1, sheet1.size() - 2);
|
||||
|
||||
sheet1 = L"'[" + std::to_wstring(id) + L"]" + sheet1 + L"'";
|
||||
}
|
||||
else if (std::wstring::npos != sheet1.find(L" "))
|
||||
@ -468,9 +474,9 @@ namespace formulasconvert {
|
||||
convert_with_absolute = bAbsoluteAlways;
|
||||
|
||||
//boost::wregex complexRef(L"\\[(?:\'([^\']*)\'#){0,1}\\[{0,1}(?:\\$){0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
boost::wregex complexRef(L"(?:(?:(?:(?:\\[\'([^\']*)\'#)|(?:\'([^\']*)\'#\\[)))|(?:\\[))\
|
||||
boost::wregex complexRef(L"(?:(?:(?:(?:\\[(.*)#)|(?:(.*)#\\[)))|(?:\\[))\
|
||||
(?:\\$){0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]");
|
||||
// [ 'external'# [ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
|
||||
// [ external# [ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
|
||||
|
||||
std::wstring result = boost::regex_replace(
|
||||
expr,
|
||||
@ -504,8 +510,8 @@ namespace formulasconvert {
|
||||
convert_with_absolute = bAbsoluteAlways;
|
||||
|
||||
//boost::wregex complexRef(L"\\${0,1}([^\\.]+?){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}\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
// 'external'# $ Sheet2 . A1 : ( $ Sheet2)? . B5
|
||||
boost::wregex complexRef(L"\\[{0,1}(?:(.*)#){0,1}\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
// external# $ Sheet2 . A1 : ( $ Sheet2)? . B5
|
||||
|
||||
const std::wstring res = boost::regex_replace(
|
||||
expr,
|
||||
|
||||
@ -192,9 +192,6 @@ std::vector<std::map<std::wstring, std::wstring>> oox2odf_converter::Impl::mapRe
|
||||
|
||||
void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSelect)
|
||||
{
|
||||
if ((0 == expr.find(L"KAVYCHKA")) && (expr.length() - 8 == expr.rfind(L"KAVYCHKA") ))
|
||||
return;
|
||||
|
||||
boost::wregex re(L"(([:$!])+)|(\\S+\\d+)");
|
||||
|
||||
boost::wsmatch result;
|
||||
@ -307,11 +304,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
|
||||
std::wstring c1 = what[2].str();
|
||||
std::wstring c2 = what[3].str();
|
||||
|
||||
if ((0 == c1.find(L"KAVYCHKA")) && (c1.length() - 8 == c1.rfind(L"KAVYCHKA") ))
|
||||
{
|
||||
return c1;
|
||||
}
|
||||
else if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
{
|
||||
XmlUtils::replace_all( sheet, L"!", L"");
|
||||
|
||||
@ -365,11 +358,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
|
||||
std::wstring c1 = what[2].str();
|
||||
std::wstring c2 = what[3].str();
|
||||
|
||||
if ((0 == c1.find(L"KAVYCHKA")) && (c1.length() - 8 == c1.rfind(L"KAVYCHKA") ))
|
||||
{
|
||||
return c1;
|
||||
}
|
||||
else if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
{
|
||||
XmlUtils::replace_all( sheet, L"!", L"");
|
||||
|
||||
@ -600,7 +589,7 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
|
||||
if (res1 == res)
|
||||
{
|
||||
//XmlUtils::replace_all( res1, L"KAVYCHKA", L"\""); //IMCONJUGATE_emb.xlsx
|
||||
//IMCONJUGATE_emb.xlsx
|
||||
|
||||
res = boost::regex_replace(
|
||||
res1,
|
||||
|
||||
Reference in New Issue
Block a user