sd/source/core/drawdoc2.cxx |    6 +++++-
 sd/source/core/sdpage.cxx   |    3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 58352309d1299cbbaf465991f5cec17c2ae32cee
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Tue Mar 12 16:32:09 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Mar 14 11:22:32 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>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164760
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>
    (cherry picked from commit 2ad14fdade187579b2abf3c76a08780b77614662)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164747

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index d591113fcca9..335761f862c7 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -326,7 +326,11 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * 
pPage, sal_uInt16 nPo
 
                 if (!aURL.isEmpty() && (aURL[0] == 35))
                 {
-                    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))
                     {
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 230b6b5aef79..8947b6ef4b4b 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 )
             {

Reply via email to