7100: reapply fix from trunk after CR by dsblank

git-svn-id: svn+ssh://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40@23278 4ae1f11a-8b86-4847-b8af-ab372f36d1fd
7068: back-port from trunk

git-svn-id: svn+ssh://svn.code.sf.net/p/gramps/code/branches/maintenance/gramps40@23281 4ae1f11a-8b86-4847-b8af-ab372f36d1fd