Bugfix #7177

Fixes #7177 and by the way fixed "composer legends inappropriately connected to the first composer map item on creation from XML"