Commit 04be1d61 authored by ElenaSubbotina's avatar ElenaSubbotina Committed by Alexander Trofimov

XlsFormat - правка ошибок по результатам тестирования

parent 8608d0aa
......@@ -600,7 +600,7 @@ const std::wstring tab2sheet_name(const short tabid, std::vector<std::wstring>&
{
return sheets_names[tabid];
}
return L"#REF!";
return L"#REF";
}
//
......@@ -617,7 +617,7 @@ const std::wstring xti_indexes2sheet_name(const short itabFirst, const short ita
{
if(-1 == itabFirst)
{
return L"#REF!";
return L"#REF";
}
static boost::wregex correct_sheet_name(L"^\\'.+?\\'$");
static boost::wregex test_sheet_name(L"[\\s)(\\':.-]+");
......
......@@ -4,6 +4,15 @@
namespace XLS
{
const wchar_t* const AutoFilterDefineNames[] =
{
L"_FilterDatabase", // English
L"_FilterDatenbank", // German
L"_" // Russian
};
Lbl::Lbl()
: rgce(false)
{
......@@ -168,6 +177,16 @@ void Lbl::readFields(CFRecord& record)
if(!fBuiltin)
{
Name = Name_bin.getEscaped_ST_Xstring();
for (int i = 0 ; i < 3; i++)
{
int res = Name_bin.value().find(AutoFilterDefineNames[i]);
if (res >=0)
{
Name = Name_bin = (L"_xlnm._FilterDatabase");
break;
}
}
}
else
{
......
......@@ -4,9 +4,10 @@
#include <Logic/Biff_structures/BiffString.h>
#include <Logic/Biff_structures/NameParsedFormula.h>
namespace XLS
{
// Logical representation of Lbl record in BIFF8
class Lbl: public BiffRecord
......
......@@ -30,8 +30,9 @@ void XTI::load(CFRecord& record)
}
else
{
record.getGlobalWorkbookInfo()->xti_parsed.push_back(
XMLSTUFF::xti_indexes2sheet_name(itabFirst, itabLast, record.getGlobalWorkbookInfo()->sheets_names));
std::wstring name = XMLSTUFF::xti_indexes2sheet_name(itabFirst, itabLast, record.getGlobalWorkbookInfo()->sheets_names);
if (name == L"#REF") name += L"!";
record.getGlobalWorkbookInfo()->xti_parsed.push_back( name );
}
}
......
......@@ -139,6 +139,16 @@ int AUTOFILTER::serialize(std::wostream & stream)
ref.erase(0, pos + 1);
}
}
sheet_name = L"#REF";
{
int pos = ref.find(sheet_name);
if (pos >= 0)
{
pos = ref.find(L"!");
if (pos >= 0)
ref.erase(0, pos + 1);
}
}
CP_XML_WRITER(stream)
{
......
......@@ -50,7 +50,7 @@ const bool LBL::loadContent(BinProcessor& proc)
if (lbl->fBuiltin) name = lbl->Name.value().get_value_or(L"");
if (name.empty()) name = lbl->Name_bin.value();
std::wstring value = lbl->rgce.getAssembledFormula(lbl->itab == 0 ? true : false);
std::wstring value = lbl->rgce.getAssembledFormula(lbl->fWorkbookParam/*lbl->itab == 0 ? true : false*/);
NameCmt namecmt(name);
if (proc.optional(namecmt))
......
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