Both SvxScriptOrgDialog and CuiConfigGroupListBox had a copy of a function called getDocumentModel which looks up an XModel given the name of a document. This patch combines them into one shared utility function. Change-Id: I25cafd7658760a1cf02a7bcef9a38e63b02979ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206149 Reviewed-by: Neil Roberts <nroberts@libreoffice.org> Tested-by: Jenkins