diff options
Diffstat (limited to 'writerperfect/source/calc/MSWorksCalcImportFilter.cxx')
-rw-r--r-- | writerperfect/source/calc/MSWorksCalcImportFilter.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx index ca12e62eb648..d1d513f974fc 100644 --- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx @@ -105,15 +105,11 @@ public: /** returns the ith sub streams name */ const char* subStreamName(unsigned id) override { - std::map<std::string, rtl::OUString>::const_iterator it = m_nameToPathMap.begin(); - for (unsigned i = 0; i < id; ++i) - { - if (it == m_nameToPathMap.end()) - return nullptr; - ++it; - } - if (it == m_nameToPathMap.end()) + if (m_nameToPathMap.size() < id) return nullptr; + + std::map<std::string, rtl::OUString>::const_iterator it = m_nameToPathMap.begin(); + std::advance(it, id); return it->first.c_str(); } /** returns true if a substream with name exists */ |