Take extra cache/uno_packages/*.tmp_/*properties files into account

...when migrating user extensions from an old user profile.

Change-Id: I4425eba1e840bfdb33782bb3ed0542ce48b2f75f
(cherry picked from commit bd9c4510ff13ab7e935ed12c5b6d1f132c6f2b79)
Reviewed-on: https://gerrit.libreoffice.org/1313
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 12f4ec4..1e38f28 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -145,22 +145,25 @@ void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDi
                //Check next folder as the "real" extension folder is below a temp folder!
                ::rtl::OUString sExtensionFolderURL = fs.getFileURL();

                osl::DirectoryItem aExtDirItem;
                osl::Directory     aExtensionRootDir( sExtensionFolderURL );

                nRetCode = aExtensionRootDir.open();
                if (( nRetCode == osl::Directory::E_None ) &&
                    ( aExtensionRootDir.getNextItem( aExtDirItem, nHint ) == osl::Directory::E_None ))
                if ( nRetCode == osl::Directory::E_None )
                {
                    bool bFileStatus = aExtDirItem.getFileStatus(fs) == osl::FileBase::E_None;
                    bool bIsDir      = fs.getFileType() == osl::FileStatus::Directory;

                    if ( bFileStatus && bIsDir )
                    osl::DirectoryItem aExtDirItem;
                    while ( aExtensionRootDir.getNextItem( aExtDirItem, nHint ) == osl::Directory::E_None )
                    {
                        sExtensionFolderURL = fs.getFileURL();
                        ScanResult eResult = scanExtensionFolder( sExtensionFolderURL );
                        if ( eResult == SCANRESULT_MIGRATE_EXTENSION )
                            aMigrateExtensions.push_back( sExtensionFolderURL );
                        bool bFileStatus = aExtDirItem.getFileStatus(fs) == osl::FileBase::E_None;
                        bool bIsDir      = fs.getFileType() == osl::FileStatus::Directory;

                        if ( bFileStatus && bIsDir )
                        {
                            sExtensionFolderURL = fs.getFileURL();
                            ScanResult eResult = scanExtensionFolder( sExtensionFolderURL );
                            if ( eResult == SCANRESULT_MIGRATE_EXTENSION )
                                aMigrateExtensions.push_back( sExtensionFolderURL );
                            break;
                        }
                    }
                }
            }