From 34cecc1f9c5dd41473a84be051d56b37118698aa Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 5 Nov 2022 16:00:48 +0100 Subject: -Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): lotuswordpro Change-Id: I6b9707c1f416eb1ab890ff0d783151066cf695d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142329 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- lotuswordpro/source/filter/bencont.cxx | 13 +++++-------- lotuswordpro/source/filter/lwpgrfobj.cxx | 12 ++++++------ lotuswordpro/source/filter/xfilter/xfcolor.cxx | 4 ++-- 3 files changed, 13 insertions(+), 16 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx index b5648a64b3ec..60e644ce212d 100644 --- a/lotuswordpro/source/filter/bencont.cxx +++ b/lotuswordpro/source/filter/bencont.cxx @@ -55,9 +55,9 @@ ************************************************************************/ #include "first.hxx" #include "tocread.hxx" -#include #include #include +#include namespace OpenStormBento { @@ -277,16 +277,13 @@ std::vector LtcBenContainer::GetGraphicData(const char *pObjectName) return aData; } // construct the string of property name - char sSName[64]=""; - char sDName[64]=""; - - sprintf(sSName, "%s-S", pObjectName); - sprintf(sDName, "%s-D", pObjectName); + OString sSName=OString::Concat(pObjectName) + "-S"; + OString sDName=OString::Concat(pObjectName) + "-D"; /* traverse the found properties and construct the stream vectors */ // get S&D's stream and merge them together - std::unique_ptr xS(FindValueStreamWithPropertyName(sSName)); - std::unique_ptr xD(FindValueStreamWithPropertyName(sDName)); + std::unique_ptr xS(FindValueStreamWithPropertyName(sSName.getStr())); + std::unique_ptr xD(FindValueStreamWithPropertyName(sDName.getStr())); sal_uInt64 nDLen = 0; if (xD) diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index 76c8aa76c52a..3c8f3d03a381 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -58,9 +58,8 @@ * @file * For LWP filter architecture prototype */ -#include - #include +#include #include #include "lwpgrfobj.hxx" @@ -69,6 +68,8 @@ #include #include +#include +#include #include "lwpframelayout.hxx" #include @@ -314,7 +315,7 @@ void LwpGraphicObject::GetBentoNamebyID(LwpObjectID const & rMyID, std::string& sal_uInt32 nLow = rMyID.GetLow(); char pTempStr[32]; rName = std::string("Gr"); - sprintf(pTempStr, "%X,%" SAL_PRIXUINT32, nHigh, nLow); + o3tl::sprintf(pTempStr, "%X,%" SAL_PRIXUINT32, nHigh, nLow); rName.append(pTempStr); } @@ -369,11 +370,10 @@ sal_uInt32 LwpGraphicObject::GetGrafData(std::unique_ptr& pGrafData std::string aGrfObjName; GetBentoNamebyID(rMyID, aGrfObjName); - char sDName[64]=""; - sprintf(sDName, "%s-D", aGrfObjName.c_str()); + OString sDName=OString::Concat(std::string_view(aGrfObjName)) + "-D"; // get bento stream by the name - pGrafStream = pBentoContainer->FindValueStreamWithPropertyName(sDName); + pGrafStream = pBentoContainer->FindValueStreamWithPropertyName(sDName.getStr()); std::unique_ptr pMemGrafStream(static_cast(pGrafStream)); diff --git a/lotuswordpro/source/filter/xfilter/xfcolor.cxx b/lotuswordpro/source/filter/xfilter/xfcolor.cxx index c30e35341f3e..7b5fd8655361 100644 --- a/lotuswordpro/source/filter/xfilter/xfcolor.cxx +++ b/lotuswordpro/source/filter/xfilter/xfcolor.cxx @@ -57,13 +57,13 @@ * @file * Color object to serial to xml filter. ************************************************************************/ -#include +#include #include OUString XFColor::ToString() const { char buf[8] = {}; - sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue); + o3tl::sprintf(buf,"#%2x%2x%2x",m_nRed, m_nGreen, m_nBlue); for( int i=1; i<7;i++ ) { if( buf[i] == ' ' ) -- cgit