mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-25 16:26:18 +00:00
Changed: Small optimization for sheet id constructor with default type
This commit is contained in:
parent
0275a78bcd
commit
2a56fa9750
1 changed files with 6 additions and 1 deletions
|
@ -114,14 +114,19 @@ CSheetId::CSheetId( const string& sheetName )
|
||||||
|
|
||||||
CSheetId::CSheetId( const std::string& sheetName, const std::string &defaultType )
|
CSheetId::CSheetId( const std::string& sheetName, const std::string &defaultType )
|
||||||
{
|
{
|
||||||
if (CFile::getExtension(sheetName) == "" && defaultType != "")
|
// Don't use this function without defaultType, use the one above.
|
||||||
|
nlassert(defaultType.size() != 0);
|
||||||
|
|
||||||
|
if (sheetName.rfind('.') == std::string::npos)
|
||||||
{
|
{
|
||||||
std::string withType = sheetName + "." + defaultType;
|
std::string withType = sheetName + "." + defaultType;
|
||||||
*this = CSheetId(withType);
|
*this = CSheetId(withType);
|
||||||
// nldebug("SHEETID: Constructing CSheetId from name '%s' without explicit type, defaulting as '%s' to '%s'", sheetName.c_str(), defaultType.c_str(), withType.c_str());
|
// nldebug("SHEETID: Constructing CSheetId from name '%s' without explicit type, defaulting as '%s' to '%s'", sheetName.c_str(), defaultType.c_str(), withType.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
*this = CSheetId(sheetName);
|
*this = CSheetId(sheetName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue