-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): basic

Change-Id: If70c3bf8d7d6c855baf23b02cccb3f3b5ccb9f64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142321
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2022-11-05 15:54:12 +01:00
parent 90e1bf18aa
commit e88cb2d41f

View file

@ -24,7 +24,9 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/character.hxx>
#include <o3tl/sprintf.hxx>
#include <o3tl/string_view.hxx>
#include <string_view>
#include <utility>
/*
@ -234,17 +236,16 @@ void SbxBasicFormater::InitScan( double _dNum )
dNum = _dNum;
InitExp( get_number_of_digits( dNum ) );
// maximum of 15 positions behind the decimal point, example: -1.234000000000000E-001
/*int nCount =*/ sprintf( sBuffer,"%+22.15lE",dNum );
/*int nCount =*/ o3tl::sprintf( sBuffer,"%+22.15lE",dNum );
sSciNumStrg = OUString::createFromAscii( sBuffer );
}
void SbxBasicFormater::InitExp( double _dNewExp )
{
char sBuffer[ MAX_DOUBLE_BUFFER_LENGTH ];
nNumExp = static_cast<short>(_dNewExp);
/*int nCount =*/ sprintf( sBuffer,"%+i",nNumExp );
sNumExpStrg = OUString::createFromAscii( sBuffer );
sNumExpStrg = (nNumExp >= 0 ? std::u16string_view(u"+") : std::u16string_view(u""))
+ OUString::number(nNumExp);
nExpExp = static_cast<short>(get_number_of_digits( static_cast<double>(nNumExp) ));
}