summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-11-05 16:02:32 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-11-06 01:12:47 +0100
commitbe2dd1746b021a99e99396adab71a0b0e5864825 (patch)
tree03a9ad30abf19bcf78fd36d5c942e936074786e8 /sc
parent1b1a066b935158dc029939520c8fe70b029cb311 (diff)
-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): sc
Change-Id: I26a36662f23c814cc95c8d6e1270892d068f6c6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142333 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/opencl/opbase.cxx6
-rw-r--r--sc/source/filter/excel/xestream.cxx3
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx3
3 files changed, 7 insertions, 5 deletions
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index 51ff89e043be..199b24b32459 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -9,6 +9,7 @@
#include <opencl/openclwrapper.hxx>
#include <formula/vectortoken.hxx>
+#include <rtl/string.hxx>
#include <sal/log.hxx>
#include <utility>
#include <unordered_map>
@@ -299,9 +300,8 @@ void SlidingFunctionBase::GenerateArg( const char* name, int arg, SubArguments&
void SlidingFunctionBase::GenerateArg( int arg, SubArguments& vSubArguments, outputstream& ss,
EmptyArgType empty, GenerateArgTypeType generateType )
{
- char buf[ 30 ];
- sprintf( buf, "arg%d", arg );
- GenerateArg( buf, arg, vSubArguments, ss, empty, generateType );
+ OString buf = "arg" + OString::number(arg);
+ GenerateArg( buf.getStr(), arg, vSubArguments, ss, empty, generateType );
}
void SlidingFunctionBase::GenerateArgWithDefault( const char* name, int arg, double def,
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 04cb7ad23ec7..ee75b188b0f7 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -23,6 +23,7 @@
#include <filter/msfilter/util.hxx>
#include <o3tl/safeint.hxx>
+#include <o3tl/sprintf.hxx>
#include <osl/diagnose.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
@@ -709,7 +710,7 @@ OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream
OString XclXmlUtils::ToOString( const Color& rColor )
{
char buf[9];
- sprintf( buf, "%.2X%.2X%.2X%.2X", rColor.GetAlpha(), rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
+ o3tl::sprintf( buf, "%.2X%.2X%.2X%.2X", rColor.GetAlpha(), rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue() );
buf[8] = '\0';
return OString(buf);
}
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index a28c22473ed8..55ec685428ae 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <o3tl/sprintf.hxx>
#include <svx/sdtaitm.hxx>
#include <svx/svdotext.hxx>
#include <editeng/editobj.hxx>
@@ -992,7 +993,7 @@ void XclObjOle::WriteSubRecs( XclExpStream& rStrm )
char aBuf[ sizeof(sal_uInt32) * 2 + 1 ];
// FIXME Eeek! Is this just a way to get a unique id?
sal_uInt32 nPictureId = sal_uInt32(reinterpret_cast<sal_uIntPtr>(this) >> 2);
- sprintf( aBuf, "%08X", static_cast< unsigned int >( nPictureId ) );
+ o3tl::sprintf( aBuf, "%08X", static_cast< unsigned int >( nPictureId ) );
aStorageName += OUString::createFromAscii(aBuf);
tools::SvRef<SotStorage> xOleStg = pRootStorage->OpenSotStorage( aStorageName );
if( !xOleStg.is() )