Refactor 'removeControl' method for improved readability and performance while avoiding use of index-based-for-loop Change-Id: Ib89e34dc69ff9f6cdfc94e500463163cd2466245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183190 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>