From 9e39414a685d337f876f587c0b73751bec922b52 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Fri, 6 Jun 2003 09:46:16 +0000 Subject: [PATCH] INTEGRATION: CWS draw15 (1.55.146); FILE MERGED 2003/06/02 15:03:14 cl 1.55.146.1: #109949# only convert api page names with 'page [0-9]*' schema --- sd/source/ui/unoidl/unopage.cxx | 37 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 36a73c3c4b0f..91c2fbf65434 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unopage.cxx,v $ * - * $Revision: 1.55 $ + * $Revision: 1.56 $ * - * last change: $Author: cl $ $Date: 2002-09-04 14:05:58 $ + * last change: $Author: vg $ $Date: 2003-06-06 10:46:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1708,11 +1708,34 @@ String SdDrawPage::getUiNameFromPageApiName( const ::rtl::OUString& rApiName ) const String aDefPageName(RTL_CONSTASCII_USTRINGPARAM( sEmptyPageName )); if( rApiName.compareTo( aDefPageName, aDefPageName.Len() ) == 0 ) { - OUStringBuffer sBuffer; - sBuffer.append( String(SdResId(STR_PAGE)) ); - sBuffer.append( sal_Unicode( ' ' ) ); - sBuffer.append( rApiName.copy( aDefPageName.Len() ) ); - return sBuffer.makeStringAndClear(); + OUString aNumber( rApiName.copy( sizeof( sEmptyPageName ) - 1 ) ); + + // create the page number + sal_Int32 nPageNumber = aNumber.toInt32(); + + // check if there are non number characters in the number part + const sal_Int32 nChars = aNumber.getLength(); + const sal_Unicode* pString = aNumber.getStr(); + sal_Int32 nChar; + for( nChar = 0; nChar < nChars; nChar++, pString++ ) + { + if((*pString < sal_Unicode('0')) || (*pString > sal_Unicode('9'))) + { + // found a non number character, so this is not the default + // name for this page + nPageNumber = -1; + break; + } + } + + if( nPageNumber != -1) + { + OUStringBuffer sBuffer; + sBuffer.append( String(SdResId(STR_PAGE)) ); + sBuffer.append( sal_Unicode( ' ' ) ); + sBuffer.append( aNumber ); + return sBuffer.makeStringAndClear(); + } } return rApiName;