diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-02 09:34:11 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-06-02 11:40:38 +0200 |
commit | 4bd4a922298c170fad2f90ff9e1e1344fdc51ad7 (patch) | |
tree | 0c004ef1b4783f3ca7ef7121bd397d1fc6b95e94 /oox | |
parent | 9d2c9d9c6fa592d83a5236a4b9626ad2c1e8c408 (diff) |
oox: clean up lclHasSuffix() and its copy&pasted version
These were added before rtl::OUString::endsWith() was introduced.
Change-Id: Ia8ee94c58429b3c5981d4f180d944aefe8cb0201
Reviewed-on: https://gerrit.libreoffice.org/38339
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 04e58ab6f0af..19f06ffcda85 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -88,12 +88,6 @@ using ::sax_fastparser::FastSerializerHelper; namespace { -bool lclHasSuffix( const OUString& rFragmentPath, const OUString& rSuffix ) -{ - sal_Int32 nSuffixPos = rFragmentPath.getLength() - rSuffix.getLength(); - return (nSuffixPos >= 0) && rFragmentPath.match( rSuffix, nSuffixPos ); -} - struct NamespaceIds: public rtl::StaticWithInit< Sequence< beans::Pair< OUString, sal_Int32 > >, NamespaceIds> @@ -315,7 +309,7 @@ bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHan return false; // try to import binary streams (fragment extension must be '.bin') - if( lclHasSuffix( aFragmentPath, mxImpl->maBinSuffix ) ) + if (aFragmentPath.endsWith(mxImpl->maBinSuffix)) { try { @@ -387,8 +381,7 @@ Reference<XDocument> XmlFilterBase::importFragment( const OUString& aFragmentPat return xRet; // binary streams (fragment extension is '.bin') currently not supported - sal_Int32 nBinSuffixPos = aFragmentPath.getLength() - mxImpl->maBinSuffix.getLength(); - if( (nBinSuffixPos >= 0) && aFragmentPath.match( mxImpl->maBinSuffix, nBinSuffixPos ) ) + if (aFragmentPath.endsWith(mxImpl->maBinSuffix)) return xRet; // try to import XML stream |