summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-08-29 00:51:02 +0300
committerArkadiy Illarionov <qarkai@gmail.com>2019-08-30 14:15:57 +0200
commit760a377f7148e623e9e16d24e66f54a401ecb946 (patch)
treec9ea106618e4b9f6bb2c20d8817603c7556a9ef6 /lotuswordpro
parentcc4edc0f29c034722f10ab289eb0d8d563a8632c (diff)
Simplify Sequence iterations in lingucomponent..lotuswordpro
Use range-based loops, STL and comphelper functions. Change-Id: I975a9c09265976d5ce4a1d7ac2023cbb75bb7f28 Reviewed-on: https://gerrit.libreoffice.org/78242 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/LotusWordProImportFilter.cxx26
1 files changed, 10 insertions, 16 deletions
diff --git a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
index 051dced016e1..3abbce1cb73f 100644
--- a/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
+++ b/lotuswordpro/source/filter/LotusWordProImportFilter.cxx
@@ -49,15 +49,12 @@ static const sal_Int8 header[] = { 0x57, 0x6f, 0x72, 0x64, 0x50, 0x72, 0x6f };
bool LotusWordProImportFilter::importImpl( const Sequence< css::beans::PropertyValue >& aDescriptor )
{
-
- sal_Int32 nLength = aDescriptor.getLength();
- const PropertyValue * pValue = aDescriptor.getConstArray();
OUString sURL;
- for ( sal_Int32 i = 0 ; i < nLength; i++)
+ for (const PropertyValue& rValue : aDescriptor)
{
//Note, we should attempt to use InputStream here first!
- if ( pValue[i].Name == "URL" )
- pValue[i].Value >>= sURL;
+ if ( rValue.Name == "URL" )
+ rValue.Value >>= sURL;
}
SvFileStream inputStream( sURL, StreamMode::READ );
@@ -98,20 +95,17 @@ void SAL_CALL LotusWordProImportFilter::setTargetDocument( const uno::Reference<
// XExtendedFilterDetection
OUString SAL_CALL LotusWordProImportFilter::detect( css::uno::Sequence< PropertyValue >& Descriptor )
{
-
OUString sTypeName( "writer_LotusWordPro_Document" );
- sal_Int32 nLength = Descriptor.getLength();
OUString sURL;
- const PropertyValue * pValue = Descriptor.getConstArray();
uno::Reference < XInputStream > xInputStream;
- for ( sal_Int32 i = 0 ; i < nLength; i++)
+ for (const PropertyValue& rValue : std::as_const(Descriptor))
{
- if ( pValue[i].Name == "TypeName" )
- pValue[i].Value >>= sTypeName;
- else if ( pValue[i].Name == "InputStream" )
- pValue[i].Value >>= xInputStream;
- else if ( pValue[i].Name == "URL" )
- pValue[i].Value >>= sURL;
+ if ( rValue.Name == "TypeName" )
+ rValue.Value >>= sTypeName;
+ else if ( rValue.Name == "InputStream" )
+ rValue.Value >>= xInputStream;
+ else if ( rValue.Name == "URL" )
+ rValue.Value >>= sURL;
}
uno::Reference< css::ucb::XCommandEnvironment > xEnv;