sd/source/core/drawdoc2.cxx | 6 +++++- sd/source/core/sdpage.cxx | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-)
New commits: commit c1f097854f89f35cfc0f097a10384014042b95d6 Author: Hossein <hoss...@libreoffice.org> AuthorDate: Tue Mar 12 16:32:09 2024 +0100 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Wed Mar 13 00:39:16 2024 +0100 tdf#160162 Fix hyperlink update in Draw Changing the links to keep them up-to-date was previously done only when the name "Slide" was used for the pages, just like Impress, as Draw and Impress share code. Now, the term "Page" is used instead of "Slide" since 942d1d2ea59bf4605f2c464a6b29c967fa9f8de8 in Draw. This change, fixes the above issue by also using the correct string consntant. The patch is tested for Draw and Impress to make sure both are working correctly now. Change-Id: I55b4f56bd499d05f87f475d4c6cb3423247bf8d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164716 Tested-by: Jenkins Reviewed-by: Stéphane Guillou <stephane.guil...@libreoffice.org> Reviewed-by: Hossein <hoss...@libreoffice.org> diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 4feb8f10c6fd..69e274afc906 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -339,7 +339,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo if (aURL.isEmpty() || (aURL[0] != 35)) return true; // continue callbacks - OUString aHashSlide = "#" + SdResId(STR_PAGE); + OUString aHashSlide; + if (meDocType == DocumentType::Draw) + aHashSlide = "#" + SdResId(STR_PAGE_NAME); + else + aHashSlide = "#" + SdResId(STR_PAGE); if (!aURL.startsWith(aHashSlide)) return true; // continue callbacks diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 02609a7083fa..10b4f34b761f 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2512,9 +2512,10 @@ const OUString& SdPage::GetName() const // default name for handout pages sal_uInt16 nNum = (GetPageNum() + 1) / 2; - aCreatedPageName = SdResId(STR_PAGE) + " "; if (static_cast<SdDrawDocument&>(getSdrModelFromSdrPage()).GetDocumentType() == DocumentType::Draw ) aCreatedPageName = SdResId(STR_PAGE_NAME) + " "; + else + aCreatedPageName = SdResId(STR_PAGE) + " "; if( getSdrModelFromSdrPage().GetPageNumType() == css::style::NumberingType::NUMBER_NONE ) {