sd/inc/strings.hrc                 |    1 -
 sd/source/ui/docshell/docshel2.cxx |   11 ++++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 04bf1d2385ed80e7aee8015dc69e868c2abe4142
Author:     Baole Fang <baole.f...@gmail.com>
AuthorDate: Tue Mar 28 23:18:37 2023 -0400
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Apr 7 16:30:21 2023 +0200

    tdf#154437: Check "Page" instead of "Slide" in Draw rename
    
    Change-Id: Iec1ee88f12895007240408c8411cc1638c2f0559
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149672
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index c9a48bfe3574..81c54ccb8e86 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -92,7 +92,6 @@
 #define STR_VOC_FILE                                    NC_("STR_VOC_FILE", 
"Creative Labs Audio")
 #define STR_AIFF_FILE                                   NC_("STR_AIFF_FILE", 
"Apple/SGI Audio")
 #define STR_SVX_FILE                                    NC_("STR_SVX_FILE", 
"Amiga SVX Audio")
-#define STR_SD_PAGE                                     NC_("STR_SD_PAGE", 
"Slide")
 #define STR_SD_PAGE_COUNT                               
NC_("STR_SD_PAGE_COUNT", "Slide %1 of %2")
 #define STR_SD_PAGE_COUNT_CUSTOM                        
NC_("STR_SD_PAGE_COUNT_CUSTOM", "Slide %1 of %2 (%3)")
 #define STR_ALL_SUPPORTED_FORMATS                       
NC_("STR_ALL_SUPPORTED_FORMATS", "All supported formats")
diff --git a/sd/source/ui/docshell/docshel2.cxx 
b/sd/source/ui/docshell/docshel2.cxx
index caf0fc86f1b1..582afec0517a 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -305,12 +305,17 @@ bool DrawDocShell::IsNewPageNameValid( OUString & 
rInOutPageName, bool bResetStr
 {
     bool bCanUseNewName = false;
 
-    // check if name is something like 'Slide n'
-    OUString aStrPage(SdResId(STR_SD_PAGE) + " ");
+    // check if name is something like 'Slide/Page n'
+    OUString aStrPage;
+    if (GetDoc()->GetDocumentType() == DocumentType::Draw)
+        aStrPage = SdResId(STR_PAGE_NAME) + " ";
+    else
+        // using the same strings as SdPage::GetName
+        aStrPage = SdResId(STR_PAGE) + " ";
 
     bool bIsStandardName = false;
 
-    // prevent also _future_ slide names of the form "'STR_SD_PAGE' + ' ' + 
'[0-9]+|[a-z]|[A-Z]|[CDILMVX]+|[cdilmvx]+'"
+    // prevent also _future_ slide names of the form "'STR_PAGE' + ' ' + 
'[0-9]+|[a-z]|[A-Z]|[CDILMVX]+|[cdilmvx]+'"
     // (arabic, lower- and upper case single letter, lower- and upper case 
roman numbers)
     if (rInOutPageName.startsWith(aStrPage) &&
         rInOutPageName.getLength() > aStrPage.getLength())

Reply via email to