[Libreoffice-commits] core.git: fpicker/source

Mike Kaganski mike.kaganski at collabora.com
Wed Dec 20 08:28:45 UTC 2017


 fpicker/source/office/fpsmartcontent.cxx |   20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

New commits:
commit 7f0241c4bb85bf9a3794d5a8f8e918a92adbd3f1
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Wed Dec 20 05:32:49 2017 +0200

    loplugin:unusedindex
    
    Change-Id: I30a49d9d9f9badadab3afcbaa6cee011b7af4bd0
    Reviewed-on: https://gerrit.libreoffice.org/46830
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

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();


More information about the Libreoffice-commits mailing list