diff options
-rw-r--r-- | fpicker/source/office/fpsmartcontent.cxx | 20 |
1 files 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(); |