From 9083e8d1ca0246ba21423726d568846cb89efae9 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 29 Nov 2013 09:59:28 +0200 Subject: convert SvxNumberFormatShell::AddFormat from xub_Strlen to sal_Int32 And make the return code be -1 for error. Change-Id: I17d066180a604208f0ad689d5dffb77d126c256b --- svx/source/items/numfmtsh.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'svx/source') diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index a5f717383570..118ff9a1b765 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -225,7 +225,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos, } // ----------------------------------------------------------------------- -bool SvxNumberFormatShell::AddFormat( OUString& rFormat, xub_StrLen& rErrPos, +bool SvxNumberFormatShell::AddFormat( OUString& rFormat, sal_Int32& rErrPos, sal_uInt16& rCatLbSelPos, short& rFmtSelPos, std::vector& rFmtEntries ) { @@ -247,13 +247,11 @@ bool SvxNumberFormatShell::AddFormat( OUString& rFormat, xub_StrLen& rErrPos, } else // neues Format { - OUString sTemp(rFormat); sal_Int32 nPos; - bInserted = pFormatter->PutEntry( sTemp, nPos, + bInserted = pFormatter->PutEntry( rFormat, nPos, nCurCategory, nAddKey, eCurLanguage ); - rErrPos = (nPos >= 0) ? (xub_StrLen)nPos : 0xFFFF; - rFormat = sTemp; + rErrPos = (nPos >= 0) ? nPos : -1; if (bInserted) { @@ -342,15 +340,15 @@ void SvxNumberFormatShell::MakeFormat( OUString& rFormat, { if( aCurrencyFormatList.size() > static_cast(nCurrencyPos) ) { - xub_StrLen rErrPos=0; + sal_Int32 rErrPos=0; std::vector aFmtEList; sal_uInt32 nFound = pFormatter->TestNewString( aCurrencyFormatList[nCurrencyPos], eCurLanguage ); if ( nFound == NUMBERFORMAT_ENTRY_NOT_FOUND ) { - sal_uInt16 rCatLbSelPos=0; - short rFmtSelPos=0; + sal_uInt16 rCatLbSelPos =0; + short rFmtSelPos = 0; AddFormat( aCurrencyFormatList[nCurrencyPos],rErrPos,rCatLbSelPos, rFmtSelPos,aFmtEList); } -- cgit