vcl/qa/cppunit/BitmapScaleTest.cxx | 4 ++-- vcl/qa/cppunit/graphicfilter/filters-test.cxx | 12 ++++++------ vcl/qa/cppunit/timer.cxx | 2 +- vcl/unx/generic/app/saldata.cxx | 2 +- vcl/unx/gtk3/gtkdata.cxx | 2 +- vcl/unx/gtk4/convert3to4.cxx | 1 - vcl/win/gdi/winlayout.cxx | 2 +- 7 files changed, 12 insertions(+), 13 deletions(-)
New commits: commit f69793083e625e7c4533dc7e4240927463f53b58 Author: shlok3640 <[email protected]> AuthorDate: Sat Jan 17 11:28:10 2026 +0000 Commit: Hossein <[email protected]> CommitDate: Fri Feb 6 17:20:50 2026 +0100 tdf#130924: Replace fprintf with SAL_INFO/WARN in vcl Change-Id: Ia7ee1e94c77c12df6441a2ebb4da6aaeed68e492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197490 Tested-by: Jenkins Reviewed-by: Hossein <[email protected]> diff --git a/vcl/qa/cppunit/BitmapScaleTest.cxx b/vcl/qa/cppunit/BitmapScaleTest.cxx index 03e20f376f9d..b1e9c4472742 100644 --- a/vcl/qa/cppunit/BitmapScaleTest.cxx +++ b/vcl/qa/cppunit/BitmapScaleTest.cxx @@ -10,7 +10,7 @@ #include <cppunit/TestAssert.h> #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> - +#include <sal/log.hxx> #include <vcl/bitmap.hxx> #include <tools/stream.hxx> @@ -110,7 +110,7 @@ void BitmapScaleTest::testScale() OString testStr = "Testing scale (" + scaleSize.srcSize.toString() + ")->(" + scaleSize.destSize.toString() + "), method " + OString::number(static_cast<int>(scaleMethod)); - fprintf(stderr, "%s ", testStr.getStr()); + SAL_INFO("vcl", testStr); Bitmap bitmap(scaleSize.srcSize, vcl::PixelFormat::N24_BPP); { // Fill each quarter of the source bitmap with a different color, diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index dfb702254c6a..b352cdafc001 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -8,7 +8,7 @@ */ #include <sal/config.h> - +#include <sal/log.hxx> #include <cstdlib> #include <unotest/filters-test.hxx> @@ -138,15 +138,15 @@ void VclFiltersTest::checkExportImport(std::u16string_view aFilterShortName) void VclFiltersTest::testExportImport() { - fprintf(stderr, "Check ExportImport JPG "); + SAL_INFO("vcl", "Check ExportImport JPG"); checkExportImport(u"jpg"); - fprintf(stderr, "Check ExportImport PNG "); + SAL_INFO("vcl", "Check ExportImport PNG"); checkExportImport(u"png"); - fprintf(stderr, "Check ExportImport BMP "); + SAL_INFO("vcl", "Check ExportImport BMP"); checkExportImport(u"bmp"); - fprintf(stderr, "Check ExportImport TIF "); + SAL_INFO("vcl", "Check ExportImport TIF"); checkExportImport(u"tif"); - fprintf(stderr, "Check ExportImport WEBP "); + SAL_INFO("vcl", "Check ExportImport WEBP"); checkExportImport(u"webp"); } diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx index 467d7b1a776d..05c9d8babe64 100644 --- a/vcl/qa/cppunit/timer.cxx +++ b/vcl/qa/cppunit/timer.cxx @@ -43,7 +43,7 @@ public: virtual void SAL_CALL run() override { osl::Thread::wait( std::chrono::seconds(mnSeconds) ); - fprintf(stderr, "ERROR: WatchDog timer thread expired, failing the test! "); + SAL_WARN("vcl", "WatchDog timer thread expired, failing the test!"); fflush(stderr); CPPUNIT_ASSERT_MESSAGE("watchdog triggered", false); } diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index f73938ff3a73..ac2f15810268 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -495,7 +495,7 @@ void X11SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) static Bool bOnce = False; if ( !bOnce ) { - std::fprintf(stderr, "X-Error occurred in a request for X_OpenFont "); + SAL_WARN("vcl", "X-Error occurred in a request for X_OpenFont"); EmitFontpathWarning(); bOnce = True ; diff --git a/vcl/unx/gtk3/gtkdata.cxx b/vcl/unx/gtk3/gtkdata.cxx index 0d6561b6ff32..1c6f97f3c688 100644 --- a/vcl/unx/gtk3/gtkdata.cxx +++ b/vcl/unx/gtk3/gtkdata.cxx @@ -341,7 +341,7 @@ extern "C" { static int XIOErrorHdl(Display *) { - fprintf(stderr, "X IO Error "); + SAL_WARN("vcl.gtk", "X IO Error"); _exit(1); // avoid crashes in unrelated threads that still run while atexit // handlers are in progress diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx index 8491351f1d5a..bd2e92a74778 100644 --- a/vcl/unx/gtk4/convert3to4.cxx +++ b/vcl/unx/gtk4/convert3to4.cxx @@ -1605,7 +1605,6 @@ void builder_add_from_gtk3_file(GtkBuilder* pBuilder, const OUString& rUri) sal_Int32 nRead = xInput->readBytes(bytes, std::max<sal_Int32>(nToRead, 4096)); if (!nRead) break; - // fprintf(stderr, "text is %s ", reinterpret_cast<const gchar*>(bytes.getArray())); bool rc = gtk_builder_add_from_string( pBuilder, reinterpret_cast<const gchar*>(bytes.getArray()), nRead, &err); if (!rc) diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 23d97a4acf87..7127f9680c12 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -55,7 +55,7 @@ TextOutRenderer& TextOutRenderer::get(bool bUseDWrite, bool bRenderingModeNatura if (!pSalData) { // don't call this after DeInitVCL() - fprintf(stderr, "TextOutRenderer fatal error: no SalData"); + SAL_WARN("vcl.gdi", "TextOutRenderer fatal error: no SalData"); abort(); }
