SvxBrushItem::GetGraphic wants the name of the document the brush came from, so take it as an argument and hand in SwDoc::GetLinkReferer wherever a document is at hand, the Writer style, frame and background shell paths included. The dialog and example-window callers pass the name of the active document shell through a new svx helper getActiveDocumentLinkReferer. The hand-rolled copies of the GetPersist, HasName, GetMedium GetName sequence elsewhere in sw now call SwDoc::GetLinkReferer too. Change-Id: I8693d27869baed79962b2d5bdcb7b7e2c63227bb Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/8200 Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com> Tested-by: Jenkins CPCI <releng@collaboraoffice.com> (cherry picked from commit 18f91ac71710027479dfe9f206ae2207bad8f2b7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209827 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins