filter/source/t602/t602filter.cxx |   19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

New commits:
commit d45d1e14d75b58323e3486c3ca3dfd2866e08bdb
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Sat Nov 5 15:58:27 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Sat Nov 5 18:27:01 2022 +0100

    -Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): filter
    
    Change-Id: Ia69631701e2f1f5d61fda8ce6a7f7fc76ecc6e3e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142326
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/filter/source/t602/t602filter.cxx 
b/filter/source/t602/t602filter.cxx
index f2c5ed49bd1a..f26875347023 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -20,8 +20,6 @@
 #include "t602filter.hxx"
 #include <strings.hrc>
 
-#include <stdio.h>
-
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/bootstrap.hxx>
 #include <cppuhelper/supportsservice.hxx>
@@ -210,10 +208,8 @@ void T602ImportFilter::inschr(unsigned char ch)
                 inschrdef(' ');
             pst.wasfdash = false;
         } else {
-            char s[20];
-            sprintf(s,"%i",pst.wasspace);
             if (mpAttrList)
-                
mpAttrList->AddAttribute("text:c",OUString::createFromAscii(s));
+                
mpAttrList->AddAttribute("text:c",OUString::number(pst.wasspace));
             Start_("text:s");
             End_("text:s");
         }
@@ -249,9 +245,8 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
     Reference < XImporter > xImporter(mxHandler, UNO_QUERY);
     xImporter->setTargetDocument(mxDoc);
 
-    char fs[32], fs2[32];
-    sprintf(fs, "%ipt", inistruct::fontsize);
-    sprintf(fs2,"%ipt", 2*inistruct::fontsize);
+    auto const fs = OUString(OUString::number(inistruct::fontsize) + "pt");
+    auto const fs2 = OUString(OUString::number(2*inistruct::fontsize) + "pt");
 
     mpAttrList = new SvXMLAttributeList;
 
@@ -293,7 +288,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
     mpAttrList->AddAttribute("style:parent-style-name","Standard");
     Start_("style:style");
     mpAttrList->AddAttribute("style:font-name","Courier New");
-    mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs));
+    mpAttrList->AddAttribute("fo:font-size",fs);
     Start_("style:properties");
     End_("style:properties");
     End_("style:style");
@@ -304,7 +299,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
     mpAttrList->AddAttribute("style:parent-style-name","Standard");
     Start_("style:style");
     mpAttrList->AddAttribute("style:font-name","Courier New");
-    mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs));
+    mpAttrList->AddAttribute("fo:font-size",fs);
     mpAttrList->AddAttribute("fo:break-before","page");
     Start_("style:properties");
     End_("style:properties");
@@ -350,7 +345,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
     mpAttrList->AddAttribute("style:name","T5");
     mpAttrList->AddAttribute("style:family","text");
     Start_("style:style");
-    mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2));
+    mpAttrList->AddAttribute("fo:font-size",fs2);
     mpAttrList->AddAttribute("fo:font-weight","bold");
     mpAttrList->AddAttribute("style:text-scale","50%");
     Start_("style:properties");
@@ -361,7 +356,7 @@ bool T602ImportFilter::importImpl( const Sequence< 
css::beans::PropertyValue >&
     mpAttrList->AddAttribute("style:name","T6");
     mpAttrList->AddAttribute("style:family","text");
     Start_("style:style");
-    mpAttrList->AddAttribute("fo:font-size",OUString::createFromAscii(fs2));
+    mpAttrList->AddAttribute("fo:font-size",fs2);
     mpAttrList->AddAttribute("fo:font-weight","bold");
     Start_("style:properties");
     End_("style:properties");

Reply via email to