From 7f0241c4bb85bf9a3794d5a8f8e918a92adbd3f1 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 20 Dec 2017 05:32:49 +0200 Subject: loplugin:unusedindex Change-Id: I30a49d9d9f9badadab3afcbaa6cee011b7af4bd0 Reviewed-on: https://gerrit.libreoffice.org/46830 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- fpicker/source/office/fpsmartcontent.cxx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx index 1f176efcf0ef..d5aead5af3fc 100644 --- a/fpicker/source/office/fpsmartcontent.cxx +++ b/fpicker/source/office/fpsmartcontent.cxx @@ -264,13 +264,10 @@ namespace svt bool bRet = false; try { - Sequence< ContentInfo > aInfo = m_pContent->queryCreatableContentsInfo(); - const ContentInfo* pInfo = aInfo.getConstArray(); - sal_Int32 nCount = aInfo.getLength(); - for ( sal_Int32 i = 0; i < nCount; ++i, ++pInfo ) + for ( auto const& rInfo : m_pContent->queryCreatableContentsInfo() ) { // Simply look for the first KIND_FOLDER... - if ( pInfo->Attributes & ContentInfoAttribute::KIND_FOLDER ) + if ( rInfo.Attributes & ContentInfoAttribute::KIND_FOLDER ) { bRet = true; break; @@ -295,15 +292,12 @@ namespace svt { OUString sFolderType; - Sequence< ContentInfo > aInfo = m_pContent->queryCreatableContentsInfo(); - const ContentInfo* pInfo = aInfo.getConstArray(); - sal_Int32 nCount = aInfo.getLength(); - for ( sal_Int32 i = 0; i < nCount; ++i, ++pInfo ) + for ( auto const& rInfo : m_pContent->queryCreatableContentsInfo() ) { // Simply look for the first KIND_FOLDER... - if ( pInfo->Attributes & ContentInfoAttribute::KIND_FOLDER ) + if ( rInfo.Attributes & ContentInfoAttribute::KIND_FOLDER ) { - sFolderType = pInfo->Type; + sFolderType = rInfo.Type; break; } } @@ -312,9 +306,7 @@ namespace svt { ucbhelper::Content aCreated; Sequence< OUString > aNames { "Title" }; - Sequence< Any > aValues( 1 ); - Any* pValues = aValues.getArray(); - pValues[0] <<= _rTitle; + Sequence< Any > aValues { Any(_rTitle) }; m_pContent->insertNewContent( sFolderType, aNames, aValues, aCreated ); aCreatedUrl = aCreated.getURL(); -- cgit