[Libreoffice-commits] core.git: sd/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Dec 23 06:32:11 UTC 2020


 sd/source/ui/unoidl/unopage.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit bbf65fd839a757b0f446c1cffb7938f82a6a1e67
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 22 19:56:56 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Dec 23 07:31:29 2020 +0100

    Use optional rest argument of OUString::startsWith
    
    Change-Id: Id8f9e7464c2c35a1a5ffadbc4c9c5d1f0d780923
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108214
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 54a779ade127..b082556d17b6 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2226,10 +2226,10 @@ void SAL_CALL SdDrawPage::setName( const OUString& rName )
         return;
 
     // check if this is the default 'page1234' name
-    if(aName.startsWith( sEmptyPageName ))
+    OUString aNumber;
+    if(aName.startsWith( sEmptyPageName, &aNumber ))
     {
-        // ok, it maybe is, first get the number part after 'page'
-        OUString aNumber( aName.copy( sizeof( sEmptyPageName ) - 1 ) );
+        // ok, it maybe is, aNumber is the number part after 'page'
 
         // create the page number
         sal_Int32 nPageNumber = aNumber.toInt32();


More information about the Libreoffice-commits mailing list