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 169388be1b50a733760bc6c48a144ed25c07ea54 Author: Ujjawal Kumar <randomfores...@gmail.com> AuthorDate: Wed Sep 17 22:42:07 2025 +0530 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Sep 18 15:46:45 2025 +0200 tdf#168446 Unique name for images and better image representation (cherry picked from commit 412c0391b56419bea6b0ff7c949ef2ced59a4d6b) Conflicts: sw/source/filter/md/swmd.cxx Change-Id: Icff3556ed179b1a6ae7ad11583b752e77ea747ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191124 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/filter/md/mdcallbcks.cxx b/sw/source/filter/md/mdcallbcks.cxx index 04de4197e344..937d88a14571 100644 --- a/sw/source/filter/md/mdcallbcks.cxx +++ b/sw/source/filter/md/mdcallbcks.cxx @@ -277,7 +277,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 61115dd57abc..331fb0e90698 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(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 4b595c28b779..a828130533ad 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(); } };