sw/source/filter/md/mdcallbcks.cxx | 2 +- sw/source/filter/md/swmd.cxx | 13 +++++-------- sw/source/filter/md/swmd.hxx | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-)
New commits: commit 412c0391b56419bea6b0ff7c949ef2ced59a4d6b Author: Ujjawal Kumar <[email protected]> AuthorDate: Wed Sep 17 22:42:07 2025 +0530 Commit: Miklos Vajna <[email protected]> CommitDate: Thu Sep 18 08:49:29 2025 +0200 tdf#168446 Unique name for images and better image representation Change-Id: Icff3556ed179b1a6ae7ad11583b752e77ea747ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191102 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/source/filter/md/mdcallbcks.cxx b/sw/source/filter/md/mdcallbcks.cxx index fe07fe5567c3..780f0999712b 100644 --- a/sw/source/filter/md/mdcallbcks.cxx +++ b/sw/source/filter/md/mdcallbcks.cxx @@ -281,7 +281,7 @@ int SwMarkdownParser::text_callback(MD_TEXTTYPE type, const MD_CHAR* text, MD_SI if (!parser->m_bInsideImage) parser->InsertText(aText); else - parser->m_aImg.altText = std::move(aText); + parser->m_aImg.desc = std::move(aText); break; } diff --git a/sw/source/filter/md/swmd.cxx b/sw/source/filter/md/swmd.cxx index 1b55156ad8b4..73a1ebc714b3 100644 --- a/sw/source/filter/md/swmd.cxx +++ b/sw/source/filter/md/swmd.cxx @@ -669,14 +669,11 @@ void SwMarkdownParser::InsertImage(const MDImage& rImg) SwFlyFrameFormat* pFlyFormat = m_xDoc->getIDocumentContentOperations().InsertGraphic( *m_pPam, sGrfNm, OUString(), &aGraphic, &aFlySet, nullptr, nullptr); - SwGrfNode* pGrfNd = m_xDoc->GetNodes()[pFlyFormat->GetContent().GetContentIdx()->GetIndex() + 1] - ->GetGrfNode(); - - if (!rImg.title.isEmpty()) - pFlyFormat->SetFormatName(UIName(rImg.title)); - - if (pGrfNd && !rImg.altText.isEmpty()) - pGrfNd->SetTitle(rImg.altText); + if (pFlyFormat) + { + pFlyFormat->SetObjTitle(rImg.title); + pFlyFormat->SetObjDescription(rImg.desc); + } m_bNoParSpace = true; } diff --git a/sw/source/filter/md/swmd.hxx b/sw/source/filter/md/swmd.hxx index 5be6c75b60bd..931db9bfeedb 100644 --- a/sw/source/filter/md/swmd.hxx +++ b/sw/source/filter/md/swmd.hxx @@ -37,14 +37,14 @@ struct MDImage { OUString url; OUString title; - OUString altText; + OUString desc; OUString link; void Reset() { url.clear(); title.clear(); - altText.clear(); + desc.clear(); link.clear(); } };
