X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=ecf02295f54f0ec5d1e3c1ee8e5e9bfc5289efd4;hb=6154a90fba843789b65d2a023c7f3cc7b72ef775;hp=15547477c6560919aecc44943232f3daaa03ec02;hpb=11bea5a763d695f9f537ae878fadd6aa4dd1d193;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 15547477c6..ecf02295f5 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -18,7 +18,6 @@ #include "Color.h" #include "BufferParams.h" -#include "support/debug.h" #include "Encoding.h" #include "Floating.h" #include "FloatList.h" @@ -28,9 +27,11 @@ #include "LyXRC.h" #include "TextClass.h" +#include "support/debug.h" #include "support/docstream.h" #include "support/FileName.h" #include "support/filetools.h" +#include "support/lstrings.h" using namespace std; using namespace lyx::support; @@ -414,13 +415,12 @@ bool LaTeXFeatures::mustProvide(string const & name) const bool LaTeXFeatures::isAvailable(string const & name) { - string n = name; if (packages_.empty()) getAvailable(); - size_t loc = n.rfind(".sty"); - if (loc == n.length() - 4) - n = n.erase(name.length() - 4); - return find(packages_.begin(), packages_.end(), n) != packages_.end(); + string n = name; + if (suffixIs(n, ".sty")) + n.erase(name.length() - 4); + return packages_.find(n) != packages_.end(); }