From 4e3671fd46e54a96dd4f8e360ab127e3662a688c Mon Sep 17 00:00:00 2001 From: Martin van Zijl Date: Apr 01 2020 09:15:11 +0000 Subject: Use npos instead of -1. Remove second comment. --- diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cpp index 032f5f7..862c5ac 100644 --- a/toonz/sources/common/tsystem/tfilepath.cpp +++ b/toonz/sources/common/tsystem/tfilepath.cpp @@ -606,8 +606,7 @@ std::string TFilePath::getLevelName() const { } //----------------------------------------------------------------------------- -// es. TFilePath("/pippo/pluto.0001.tif").getLevelName() == "pluto..tif" -// es. TFilePath("/pippo/0001.tif").getLevelName() == "0001.tif" +// es. TFilePath("/pippo/pluto.0001.gif").getLevelName() == "pluto..gif" std::wstring TFilePath::getLevelNameW() const { int i = getLastSlash(m_path); // cerco l'ultimo slash @@ -623,7 +622,8 @@ std::wstring TFilePath::getLevelNameW() const { if (j == i || j - i == 1) // prova.tif o prova..tif return str; - if (!checkForSeqNum(type) || !isNumbers(str, i, j) || i == -1) return str; + if (!checkForSeqNum(type) || !isNumbers(str, i, j) || + i == (int)std::wstring::npos) return str; // prova.0001.tif return str.erase(i + 1, j - i - 1); }