From e5356fb099d5fe0d476fa99697e4a7e04688f9ee Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 26 Aug 2020 15:44:06 +0200 Subject: [API CHANGE] Drop OSL_THIS_FUNC, directly use C++11 __func__ It had been documented as "the macro OSL_THIS_FUNC is intended to be an office internal macro for now", so take the liberty of removing it, even if technically that can be considered an incompatible API change. Change-Id: I7580a932e1da54845934378a650e894f3f3a9062 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101406 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- canvas/inc/base/bitmapcanvasbase.hxx | 2 +- canvas/inc/base/canvasbase.hxx | 34 +++++++-------- canvas/inc/base/canvascustomspritebase.hxx | 6 +-- canvas/inc/base/graphicdevicebase.hxx | 8 ++-- canvas/inc/base/integerbitmapbase.hxx | 8 ++-- canvas/inc/base/spritecanvasbase.hxx | 8 ++-- canvas/source/cairo/cairo_canvashelper_text.cxx | 2 +- canvas/source/opengl/ogl_canvascustomsprite.cxx | 2 +- canvas/source/opengl/ogl_spritedevicehelper.cxx | 2 +- canvas/source/vcl/canvashelper.cxx | 4 +- comphelper/source/misc/documentinfo.cxx | 2 +- comphelper/source/misc/storagehelper.cxx | 2 +- compilerplugins/clang/stringconcatliterals.cxx | 12 +----- compilerplugins/clang/stringconstant.cxx | 20 --------- filter/source/msfilter/rtfutil.cxx | 2 +- include/osl/diagnose.h | 19 --------- include/tools/diagnose_ex.h | 14 +++---- .../configuration/ChangeRequestQueueProcessor.cxx | 12 +++--- .../ui/framework/configuration/Configuration.cxx | 4 +- .../configuration/ConfigurationClassifier.cxx | 12 +++--- .../configuration/ConfigurationController.cxx | 14 +++---- .../ConfigurationControllerResourceManager.cxx | 16 +++---- .../configuration/ConfigurationUpdater.cxx | 18 ++++---- sd/source/ui/framework/module/ModuleController.cxx | 6 +-- sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx | 6 +-- .../ui/slidesorter/cache/SlsCacheCompactor.cxx | 4 +- sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx | 2 +- sd/source/ui/tools/TimerBasedTaskExecution.cxx | 6 +-- sd/source/ui/view/ToolBarManager.cxx | 26 ++++++------ sd/source/ui/view/ViewShellManager.cxx | 20 ++++----- sdext/source/presenter/PresenterAccessibility.cxx | 6 +-- slideshow/source/inc/delayevent.hxx | 4 +- slideshow/source/inc/tools.hxx | 4 +- starmath/source/rtfexport.cxx | 6 +-- sw/source/filter/ww8/rtfattributeoutput.cxx | 49 +++++++++++----------- sw/source/filter/ww8/rtfexport.cxx | 34 +++++++-------- sw/source/filter/ww8/rtfsdrexport.cxx | 10 ++--- vcl/osx/salframe.cxx | 2 +- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 7 ++-- writerfilter/source/rtftok/rtfskipdestination.cxx | 2 +- writerfilter/source/rtftok/rtftokenizer.cxx | 14 +++---- 41 files changed, 190 insertions(+), 241 deletions(-) diff --git a/canvas/inc/base/bitmapcanvasbase.hxx b/canvas/inc/base/bitmapcanvasbase.hxx index efbf58f55902..1293f301fdb1 100644 --- a/canvas/inc/base/bitmapcanvasbase.hxx +++ b/canvas/inc/base/bitmapcanvasbase.hxx @@ -112,7 +112,7 @@ namespace canvas { tools::verifyArgs(sourceCanvas, sourceRect, sourceViewState, sourceRenderState, destRect, destViewState, destRenderState, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::BaseType::MutexType aGuard( BaseType::m_aMutex ); diff --git a/canvas/inc/base/canvasbase.hxx b/canvas/inc/base/canvasbase.hxx index 323460a10946..b0f244e5951c 100644 --- a/canvas/inc/base/canvasbase.hxx +++ b/canvas/inc/base/canvasbase.hxx @@ -146,7 +146,7 @@ namespace canvas const css::rendering::RenderState& renderState) override { tools::verifyArgs(aPoint, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -160,7 +160,7 @@ namespace canvas const css::rendering::RenderState& renderState) override { tools::verifyArgs(aStartPoint, aEndPoint, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -176,7 +176,7 @@ namespace canvas const css::rendering::RenderState& renderState ) override { tools::verifyArgs(aBezierSegment, aEndPoint, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -192,7 +192,7 @@ namespace canvas const css::rendering::RenderState& renderState) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -209,7 +209,7 @@ namespace canvas const css::rendering::StrokeAttributes& strokeAttributes) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -227,7 +227,7 @@ namespace canvas const css::rendering::StrokeAttributes& strokeAttributes ) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -246,7 +246,7 @@ namespace canvas const css::rendering::StrokeAttributes& strokeAttributes ) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, xMapping, strokeAttributes, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -263,7 +263,7 @@ namespace canvas const css::rendering::StrokeAttributes& strokeAttributes ) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, strokeAttributes, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -279,7 +279,7 @@ namespace canvas const css::rendering::RenderState& renderState) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -296,7 +296,7 @@ namespace canvas const css::uno::Sequence< css::rendering::Texture >& textures) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -314,7 +314,7 @@ namespace canvas const css::uno::Reference< css::geometry::XMapping2D >& xMapping ) override { tools::verifyArgs(xPolyPolygon, viewState, renderState, textures, xMapping, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -334,7 +334,7 @@ namespace canvas // dummy, to keep argPos in sync fontRequest, fontMatrix, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -348,7 +348,7 @@ namespace canvas const css::uno::Sequence< css::beans::PropertyValue >& aFontProperties ) override { tools::verifyArgs(aFilter, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -365,7 +365,7 @@ namespace canvas sal_Int8 textDirection) override { tools::verifyArgs(xFont, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); tools::verifyRange( textDirection, css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT, @@ -385,7 +385,7 @@ namespace canvas const css::rendering::RenderState& renderState) override { tools::verifyArgs(laidOutText, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -402,7 +402,7 @@ namespace canvas const css::rendering::RenderState& renderState ) override { tools::verifyArgs(xBitmap, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -418,7 +418,7 @@ namespace canvas const css::rendering::RenderState& renderState ) override { tools::verifyArgs(xBitmap, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); diff --git a/canvas/inc/base/canvascustomspritebase.hxx b/canvas/inc/base/canvascustomspritebase.hxx index c47f232e0301..8379a54d935b 100644 --- a/canvas/inc/base/canvascustomspritebase.hxx +++ b/canvas/inc/base/canvascustomspritebase.hxx @@ -117,7 +117,7 @@ namespace canvas const css::rendering::RenderState& renderState ) override { tools::verifyArgs(xBitmap, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::MutexType aGuard( BaseType::m_aMutex ); @@ -152,7 +152,7 @@ namespace canvas const css::rendering::RenderState& renderState ) override { tools::verifyArgs(aNewPos, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::MutexType aGuard( BaseType::m_aMutex ); @@ -163,7 +163,7 @@ namespace canvas virtual void SAL_CALL transform( const css::geometry::AffineMatrix2D& aTransformation ) override { tools::verifyArgs(aTransformation, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::MutexType aGuard( BaseType::m_aMutex ); diff --git a/canvas/inc/base/graphicdevicebase.hxx b/canvas/inc/base/graphicdevicebase.hxx index 3a7c49834447..151a39a9f153 100644 --- a/canvas/inc/base/graphicdevicebase.hxx +++ b/canvas/inc/base/graphicdevicebase.hxx @@ -185,7 +185,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XBitmap > SAL_CALL createCompatibleBitmap( const css::geometry::IntegerSize2D& size ) override { tools::verifyBitmapSize(size, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -196,7 +196,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XVolatileBitmap > SAL_CALL createVolatileBitmap( const css::geometry::IntegerSize2D& size ) override { tools::verifyBitmapSize(size, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -207,7 +207,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XBitmap > SAL_CALL createCompatibleAlphaBitmap( const css::geometry::IntegerSize2D& size ) override { tools::verifyBitmapSize(size, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); @@ -218,7 +218,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XVolatileBitmap > SAL_CALL createVolatileAlphaBitmap( const css::geometry::IntegerSize2D& size ) override { tools::verifyBitmapSize(size, - OSL_THIS_FUNC, + __func__, static_cast< UnambiguousBaseType* >(this)); MutexType aGuard( BaseType::m_aMutex ); diff --git a/canvas/inc/base/integerbitmapbase.hxx b/canvas/inc/base/integerbitmapbase.hxx index aca2551f2322..d485233d45c7 100644 --- a/canvas/inc/base/integerbitmapbase.hxx +++ b/canvas/inc/base/integerbitmapbase.hxx @@ -45,7 +45,7 @@ namespace canvas const css::geometry::IntegerRectangle2D& rect ) override { tools::verifyArgs(rect, - OSL_THIS_FUNC, + __func__, static_cast< typename Base::UnambiguousBaseType* >(this)); tools::verifyIndexRange(rect, Base::getSize() ); @@ -60,7 +60,7 @@ namespace canvas const css::geometry::IntegerRectangle2D& rect ) override { tools::verifyArgs(bitmapLayout, rect, - OSL_THIS_FUNC, + __func__, static_cast< typename Base::UnambiguousBaseType* >(this)); tools::verifyIndexRange(rect, Base::getSize() ); @@ -74,7 +74,7 @@ namespace canvas const css::geometry::IntegerPoint2D& pos ) override { tools::verifyArgs(bitmapLayout, pos, - OSL_THIS_FUNC, + __func__, static_cast< typename Base::UnambiguousBaseType* >(this)); tools::verifyIndexRange(pos, Base::getSize() ); @@ -87,7 +87,7 @@ namespace canvas const css::geometry::IntegerPoint2D& pos ) override { tools::verifyArgs(pos, - OSL_THIS_FUNC, + __func__, static_cast< typename Base::UnambiguousBaseType* >(this)); tools::verifyIndexRange(pos, Base::getSize() ); diff --git a/canvas/inc/base/spritecanvasbase.hxx b/canvas/inc/base/spritecanvasbase.hxx index 041a6d3be7dc..0a0d952a2955 100644 --- a/canvas/inc/base/spritecanvasbase.hxx +++ b/canvas/inc/base/spritecanvasbase.hxx @@ -95,7 +95,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XAnimatedSprite > SAL_CALL createSpriteFromAnimation( const css::uno::Reference< css::rendering::XAnimation >& animation ) override { tools::verifyArgs(animation, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::MutexType aGuard( BaseType::m_aMutex ); @@ -107,7 +107,7 @@ namespace canvas sal_Int8 interpolationMode ) override { tools::verifyArgs(animationBitmaps, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); tools::verifyRange( interpolationMode, css::rendering::InterpolationMode::NEAREST_NEIGHBOR, @@ -121,7 +121,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XCustomSprite > SAL_CALL createCustomSprite( const css::geometry::RealSize2D& spriteSize ) override { tools::verifySpriteSize(spriteSize, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::MutexType aGuard( BaseType::m_aMutex ); @@ -132,7 +132,7 @@ namespace canvas virtual css::uno::Reference< css::rendering::XSprite > SAL_CALL createClonedSprite( const css::uno::Reference< css::rendering::XSprite >& original ) override { tools::verifyArgs(original, - OSL_THIS_FUNC, + __func__, static_cast< typename BaseType::UnambiguousBaseType* >(this)); typename BaseType::MutexType aGuard( BaseType::m_aMutex ); diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index 830388775670..258ba6a3166f 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -116,7 +116,7 @@ namespace cairocanvas const rendering::RenderState& renderState ) { ::canvas::tools::verifyInput( renderState, - OSL_THIS_FUNC, + __func__, const_cast(pOwner), // only for refcount 2, 3 /* text */ ); diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx index 903a0edfc93b..2e930611f5bf 100644 --- a/canvas/source/opengl/ogl_canvascustomsprite.cxx +++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx @@ -69,7 +69,7 @@ namespace oglcanvas const rendering::RenderState& renderState ) { canvas::tools::verifyArgs(aNewPos, viewState, renderState, - OSL_THIS_FUNC, + __func__, static_cast< ::cppu::OWeakObject* >(this)); ::osl::MutexGuard aGuard( m_aMutex ); diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index 57b0875c3f4e..230a34edea06 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -371,7 +371,7 @@ namespace oglcanvas void SpriteDeviceHelper::dumpScreenContent() const { - SAL_INFO("canvas.ogl", OSL_THIS_FUNC ); + SAL_INFO("canvas.ogl", __func__ ); } void SpriteDeviceHelper::show( const ::rtl::Reference< CanvasCustomSprite >& xSprite ) diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index fcfabb8e033d..5cc5f3c42b73 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -651,7 +651,7 @@ namespace vclcanvas "bitmap is NULL"); ::canvas::tools::verifyInput( renderState, - OSL_THIS_FUNC, + __func__, mpDevice, 4, bModulateColors ? 3 : 0 ); @@ -995,7 +995,7 @@ namespace vclcanvas "outdev null. Are we disposed?" ); ::canvas::tools::verifyInput( renderState, - OSL_THIS_FUNC, + __func__, mpDevice, 2, eColorType == IGNORE_COLOR ? 0 : 3 ); diff --git a/comphelper/source/misc/documentinfo.cxx b/comphelper/source/misc/documentinfo.cxx index 102766778f95..3b191f956866 100644 --- a/comphelper/source/misc/documentinfo.cxx +++ b/comphelper/source/misc/documentinfo.cxx @@ -152,7 +152,7 @@ namespace comphelper { caught >>= exception; SAL_WARN( "comphelper", "caught an exception!\ntype : " << caught.getValueTypeName() << "\nmessage: " << exception - << "\nin function:\n" << OSL_THIS_FUNC); + << "\nin function:\n" << __func__); } return sTitle; diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 01cec5831223..9c2f47444513 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -284,7 +284,7 @@ sal_Int32 OStorageHelper::GetXStorageFormat( else { // the mediatype is not known - OUString aMsg = OUStringLiteral(OSL_THIS_FUNC) + OUString aMsg = OUStringLiteral(__func__) + ":" + OUString::number(__LINE__) + ": unknown media type '" diff --git a/compilerplugins/clang/stringconcatliterals.cxx b/compilerplugins/clang/stringconcatliterals.cxx index 0b52bd0c9b4f..25872ff6ee32 100644 --- a/compilerplugins/clang/stringconcatliterals.cxx +++ b/compilerplugins/clang/stringconcatliterals.cxx @@ -141,17 +141,7 @@ bool StringConcatLiterals::isStringLiteral(Expr const * expr) { if (!isa(expr)) { return false; } - // OSL_THIS_FUNC may be defined as "" in include/osl/diagnose.h, so don't - // warn about expressions like 'SAL_INFO(..., OSL_THIS_FUNC << ":")' or - // 'OUString(OSL_THIS_FUNC) + ":"': - auto loc = compat::getBeginLoc(expr); - while (compiler.getSourceManager().isMacroArgExpansion(loc)) { - loc = compiler.getSourceManager().getImmediateMacroCallerLoc(loc); - } - return !compiler.getSourceManager().isMacroBodyExpansion(loc) - || (Lexer::getImmediateMacroName( - loc, compiler.getSourceManager(), compiler.getLangOpts()) - != "OSL_THIS_FUNC"); + return true; } loplugin::Plugin::Registration stringconcatliterals("stringconcatliterals"); diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index 389691796dd7..cafcd0763a14 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -895,17 +895,6 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { { return true; } - // OSL_THIS_FUNC may be defined as "" or as something other - // than a string literal in include/osl/diagnose.h: - auto loc = compat::getBeginLoc(arg); - if (compiler.getSourceManager().isMacroBodyExpansion(loc) - && (Lexer::getImmediateMacroName( - loc, compiler.getSourceManager(), - compiler.getLangOpts()) - == "OSL_THIS_FUNC")) - { - return true; - } if (cont != ContentKind::Ascii) { report( DiagnosticsEngine::Warning, @@ -1198,15 +1187,6 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { loc = compiler.getSourceManager() .getImmediateMacroCallerLoc(loc); } - if ((compiler.getSourceManager() - .isMacroBodyExpansion(loc)) - && (Lexer::getImmediateMacroName( - loc, compiler.getSourceManager(), - compiler.getLangOpts()) - == "OSL_THIS_FUNC")) - { - return true; - } if (kind == ChangeKind::SingleChar) { report( DiagnosticsEngine::Warning, diff --git a/filter/source/msfilter/rtfutil.cxx b/filter/source/msfilter/rtfutil.cxx index c4c6b30dfc63..9e78acf1dc00 100644 --- a/filter/source/msfilter/rtfutil.cxx +++ b/filter/source/msfilter/rtfutil.cxx @@ -198,7 +198,7 @@ OString OutChar(sal_Unicode c, int* pUCMode, rtl_TextEncoding eDestEnc, bool* pS OString OutString(const OUString& rStr, rtl_TextEncoding eDestEnc, bool bUnicode) { - SAL_INFO("filter.ms", OSL_THIS_FUNC << ", rStr = '" << rStr << "'"); + SAL_INFO("filter.ms", __func__ << ", rStr = '" << rStr << "'"); OStringBuffer aBuf; int nUCMode = 1; for (sal_Int32 n = 0; n < rStr.getLength(); ++n) diff --git a/include/osl/diagnose.h b/include/osl/diagnose.h index 18c08ef84eb8..bb21989e3d5f 100644 --- a/include/osl/diagnose.h +++ b/include/osl/diagnose.h @@ -116,25 +116,6 @@ /** @} */ -/* the macro OSL_THIS_FUNC is intended to be an office internal macro for now */ -/* copied from boost/current_function.hpp to make it usable from C - * sources as well - * - * Copyright (c) 2002 Peter Dimov and Multi Media Ltd. - * - * Distributed under the Boost Software License, Version 1.0. (See - * accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt) */ -#if defined(__GNUC__) -#define OSL_THIS_FUNC __PRETTY_FUNCTION__ -#elif defined(__FUNCSIG__) -#define OSL_THIS_FUNC __FUNCSIG__ -#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) -#define OSL_THIS_FUNC __func__ -#else -#define OSL_THIS_FUNC "" -#endif - #endif // INCLUDED_OSL_DIAGNOSE_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index 7d266464b1db..a09c64ae6c19 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -58,11 +58,11 @@ inline css::uno::Any DbgGetCaughtException() This takes two optional parameters: area and explanatory */ #define DBG_UNHANDLED_EXCEPTION_0_ARGS() \ - DbgUnhandledException( DbgGetCaughtException(), OSL_THIS_FUNC, SAL_DETAIL_WHERE ); + DbgUnhandledException( DbgGetCaughtException(), __func__, SAL_DETAIL_WHERE ); #define DBG_UNHANDLED_EXCEPTION_1_ARGS(area) \ - DbgUnhandledException( DbgGetCaughtException(), OSL_THIS_FUNC, SAL_DETAIL_WHERE, area ); + DbgUnhandledException( DbgGetCaughtException(), __func__, SAL_DETAIL_WHERE, area ); #define DBG_UNHANDLED_EXCEPTION_2_ARGS(area, explanatory) \ - DbgUnhandledException( DbgGetCaughtException(), OSL_THIS_FUNC, SAL_DETAIL_WHERE, area, explanatory ); + DbgUnhandledException( DbgGetCaughtException(), __func__, SAL_DETAIL_WHERE, area, explanatory ); #define DBG_UNHANDLED_FUNC_CHOOSER(_f1, _f2, _f3, ...) _f3 #define DBG_UNHANDLED_FUNC_RECOMPOSER(argsWithParentheses) DBG_UNHANDLED_FUNC_CHOOSER argsWithParentheses @@ -78,14 +78,14 @@ inline css::uno::Any DbgGetCaughtException() #define ENSURE_ARG_OR_THROW(c, m) if( !(c) ) { \ OSL_ENSURE(c, m); \ throw css::lang::IllegalArgumentException( \ - OUStringLiteral(OSL_THIS_FUNC) \ + OUStringLiteral(__func__) \ + ",\n" m, \ css::uno::Reference< css::uno::XInterface >(), \ 0 ); } #define ENSURE_ARG_OR_THROW2(c, m, ifc, arg) if( !(c) ) { \ OSL_ENSURE(c, m); \ throw css::lang::IllegalArgumentException( \ - OUStringLiteral(OSL_THIS_FUNC) \ + OUStringLiteral(__func__) \ + ",\n" m, \ ifc, \ arg ); } @@ -97,14 +97,14 @@ inline css::uno::Any DbgGetCaughtException() if( !(c) ){ \ OSL_ENSURE(c, m); \ throw css::uno::RuntimeException( \ - OUStringLiteral(OSL_THIS_FUNC) + ",\n" m, \ + OUStringLiteral(__func__) + ",\n" m, \ css::uno::Reference< css::uno::XInterface >() ); } #define ENSURE_OR_THROW2(c, m, ifc) \ if( !(c) ) { \ OSL_ENSURE(c, m); \ throw css::uno::RuntimeException( \ - OUStringLiteral(OSL_THIS_FUNC) + ",\n" m, \ + OUStringLiteral(__func__) + ",\n" m, \ ifc ); } /** This macro asserts the given condition (in debug mode), and diff --git a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx index 741e2607eee8..5cd99fbc1cb4 100644 --- a/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx +++ b/sd/source/ui/framework/configuration/ChangeRequestQueueProcessor.cxx @@ -41,7 +41,7 @@ void TraceRequest (const Reference& rxRequest) { Reference xNamed (rxRequest, UNO_QUERY); if (xNamed.is()) - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " << xNamed->getName()); + SAL_INFO("sd.fwk", __func__ << ": " << xNamed->getName()); } #endif @@ -83,11 +83,11 @@ void ChangeRequestQueueProcessor::AddRequest ( #if DEBUG_SD_CONFIGURATION_TRACE if (maQueue.empty()) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Adding requests to empty queue"); + SAL_INFO("sd.fwk", __func__ << ": Adding requests to empty queue"); ConfigurationTracer::TraceConfiguration( mxConfiguration, "current configuration of queue processor"); } - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Adding request"); + SAL_INFO("sd.fwk", __func__ << ": Adding request"); TraceRequest(rxRequest); #endif @@ -103,7 +103,7 @@ void ChangeRequestQueueProcessor::StartProcessing() && mxConfiguration.is() && ! maQueue.empty()) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ChangeRequestQueueProcessor scheduling processing"); + SAL_INFO("sd.fwk", __func__ << ": ChangeRequestQueueProcessor scheduling processing"); mnUserEventId = Application::PostUserEvent( LINK(this,ChangeRequestQueueProcessor,ProcessEvent)); } @@ -128,7 +128,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent() { ::osl::MutexGuard aGuard (maMutex); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ProcessOneEvent"); + SAL_INFO("sd.fwk", __func__ << ": ProcessOneEvent"); if (!mxConfiguration.is() || maQueue.empty()) return; @@ -149,7 +149,7 @@ void ChangeRequestQueueProcessor::ProcessOneEvent() if (!maQueue.empty()) return; - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": All requests are processed"); + SAL_INFO("sd.fwk", __func__ << ": All requests are processed"); // The queue is empty so tell the ConfigurationManager to update // its state. if (mpConfigurationUpdater != nullptr) diff --git a/sd/source/ui/framework/configuration/Configuration.cxx b/sd/source/ui/framework/configuration/Configuration.cxx index 05f5d924b9c1..53bbaa339316 100644 --- a/sd/source/ui/framework/configuration/Configuration.cxx +++ b/sd/source/ui/framework/configuration/Configuration.cxx @@ -102,7 +102,7 @@ void SAL_CALL Configuration::addResource (const Reference& rxResour if (mpResourceContainer->insert(rxResourceId).second) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Configuration::addResource() " << + SAL_INFO("sd.fwk", __func__ << ": Configuration::addResource() " << FrameworkHelper::ResourceIdToString(rxResourceId)); PostEvent(rxResourceId, true); } @@ -118,7 +118,7 @@ void SAL_CALL Configuration::removeResource (const Reference& rxRes ResourceContainer::iterator iResource (mpResourceContainer->find(rxResourceId)); if (iResource != mpResourceContainer->end()) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": Configuration::removeResource() " << + SAL_INFO("sd.fwk", __func__ << ": Configuration::removeResource() " << FrameworkHelper::ResourceIdToString(rxResourceId)); PostEvent(rxResourceId,false); mpResourceContainer->erase(iResource); diff --git a/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx b/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx index 443757793685..e2b799a0c912 100644 --- a/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationClassifier.cxx @@ -68,9 +68,9 @@ void ConfigurationClassifier::PartitionResources ( aC2minusC1, aC1andC2); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying resource ids to C1-C2"); + SAL_INFO("sd.fwk", __func__ << ": copying resource ids to C1-C2"); CopyResources(aC1minusC2, mxConfiguration1, maC1minusC2); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying resource ids to C2-C1"); + SAL_INFO("sd.fwk", __func__ << ": copying resource ids to C2-C1"); CopyResources(aC2minusC1, mxConfiguration2, maC2minusC1); // Process the unique resources that belong to both configurations. @@ -135,13 +135,13 @@ void ConfigurationClassifier::CopyResources ( rTarget.reserve(rTarget.size() + 1 + nL); rTarget.push_back(rxResource); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying " << + SAL_INFO("sd.fwk", __func__ << ": copying " << FrameworkHelper::ResourceIdToString(rxResource)); for (const Reference& rBoundResource : aBoundResources) { rTarget.push_back(rBoundResource); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": copying " << + SAL_INFO("sd.fwk", __func__ << ": copying " << FrameworkHelper::ResourceIdToString(rBoundResource)); } } @@ -154,11 +154,11 @@ void ConfigurationClassifier::TraceResourceIdVector ( const ResourceIdVector& rResources) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " << pMessage); + SAL_INFO("sd.fwk", __func__ << ": " << pMessage); for (const auto& rxResource : rResources) { OUString sResource (FrameworkHelper::ResourceIdToString(rxResource)); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " << sResource); + SAL_INFO("sd.fwk", __func__ << ": " << sResource); } } diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx b/sd/source/ui/framework/configuration/ConfigurationController.cxx index 023605ed625f..470d9777f7f6 100644 --- a/sd/source/ui/framework/configuration/ConfigurationController.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx @@ -117,14 +117,14 @@ void SAL_CALL ConfigurationController::disposing() if (mpImplementation == nullptr) return; - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::disposing"); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": requesting empty configuration"); + SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::disposing"); + SAL_INFO("sd.fwk", __func__ << ": requesting empty configuration"); // To destroy all resources an empty configuration is requested and then, // synchronously, all resulting requests are processed. mpImplementation->mpQueueProcessor->Clear(); restoreConfiguration(new Configuration(this,false)); mpImplementation->mpQueueProcessor->ProcessUntilEmpty(); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": all requests processed"); + SAL_INFO("sd.fwk", __func__ << ": all requests processed"); // Now that all resources have been deactivated, mark the controller as // disposed. @@ -238,12 +238,12 @@ void SAL_CALL ConfigurationController::requestResourceActivation ( // we just return silently during that stage. if (rBHelper.bInDispose) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::requestResourceActivation(): ignoring " << + SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::requestResourceActivation(): ignoring " << FrameworkHelper::ResourceIdToString(rxResourceId)); return; } - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::requestResourceActivation() " << + SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::requestResourceActivation() " << FrameworkHelper::ResourceIdToString(rxResourceId)); if (!rxResourceId.is()) @@ -286,7 +286,7 @@ void SAL_CALL ConfigurationController::requestResourceDeactivation ( ::osl::MutexGuard aGuard (maMutex); ThrowIfDisposed(); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::requestResourceDeactivation() " << + SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::requestResourceDeactivation() " << FrameworkHelper::ResourceIdToString(rxResourceId)); if (!rxResourceId.is()) @@ -404,7 +404,7 @@ void SAL_CALL ConfigurationController::restoreConfiguration ( // Get lists of resources that are to be activated or deactivated. Reference xCurrentConfiguration (mpImplementation->mxRequestedConfiguration); #if OSL_DEBUG_LEVEL >=1 - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::restoreConfiguration("); + SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::restoreConfiguration("); ConfigurationTracer::TraceConfiguration(rxNewConfiguration, "requested configuration"); ConfigurationTracer::TraceConfiguration(xCurrentConfiguration, "current configuration"); #endif diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx index 98842a1d8994..904011d7d5c0 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx @@ -107,7 +107,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( return; } - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": activating resource " << + SAL_INFO("sd.fwk", __func__ << ": activating resource " << FrameworkHelper::ResourceIdToString(rxResourceId)); // 1. Get the factory. @@ -115,7 +115,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( Reference xFactory (mpResourceFactoryContainer->GetFactory(sResourceURL)); if ( ! xFactory.is()) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": no factory found for " << sResourceURL); + SAL_INFO("sd.fwk", __func__ << ": no factory found for " << sResourceURL); return; } @@ -137,7 +137,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( if (xResource.is()) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": successfully created"); + SAL_INFO("sd.fwk", __func__ << ": successfully created"); // 3. Add resource to URL->Object map. AddResource(xResource, xFactory); @@ -152,7 +152,7 @@ void ConfigurationControllerResourceManager::ActivateResource ( } else { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": resource creation failed"); + SAL_INFO("sd.fwk", __func__ << ": resource creation failed"); } } catch (RuntimeException&) @@ -230,10 +230,10 @@ void ConfigurationControllerResourceManager::DeactivateResource ( #if OSL_DEBUG_LEVEL >= 1 if (bSuccess) - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": successfully deactivated " << + SAL_INFO("sd.fwk", __func__ << ": successfully deactivated " << FrameworkHelper::ResourceIdToString(rxResourceId)); else - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": activating resource " << + SAL_INFO("sd.fwk", __func__ << ": activating resource " << FrameworkHelper::ResourceIdToString(rxResourceId) << " failed"); #endif @@ -256,7 +256,7 @@ void ConfigurationControllerResourceManager::AddResource ( maResourceMap[rxResource->getResourceId()] = aDescriptor; #if OSL_DEBUG_LEVEL >= 2 - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationControllerResourceManager::AddResource(): added " << + SAL_INFO("sd.fwk", __func__ << ": ConfigurationControllerResourceManager::AddResource(): added " << FrameworkHelper::ResourceIdToString(rxResource->getResourceId()) << " -> " << rxResource.get()); #endif @@ -272,7 +272,7 @@ ConfigurationControllerResourceManager::ResourceDescriptor if (iResource != maResourceMap.end()) { #if OSL_DEBUG_LEVEL >= 2 - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationControllerResourceManager::RemoveResource(): removing " << + SAL_INFO("sd.fwk", __func__ << ": ConfigurationControllerResourceManager::RemoveResource(): removing " << FrameworkHelper::ResourceIdToString(rxResourceId) << " -> " << &iResource); #endif diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx index 6083757b4087..8b536831561d 100644 --- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx @@ -98,7 +98,7 @@ void ConfigurationUpdater::RequestUpdate ( // Find out whether we really can update the configuration. if (IsUpdatePossible()) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration start"); + SAL_INFO("sd.fwk", __func__ << ": UpdateConfiguration start"); // Call UpdateConfiguration while that is possible and while someone // set mbUpdatePending to true in the middle of it. @@ -111,7 +111,7 @@ void ConfigurationUpdater::RequestUpdate ( else { mbUpdatePending = true; - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": scheduling update for later"); + SAL_INFO("sd.fwk", __func__ << ": scheduling update for later"); } } @@ -126,7 +126,7 @@ bool ConfigurationUpdater::IsUpdatePossible() const void ConfigurationUpdater::UpdateConfiguration() { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration update"); + SAL_INFO("sd.fwk", __func__ << ": UpdateConfiguration update"); SetUpdateBeingProcessed(true); comphelper::ScopeGuard aScopeGuard ( [this] () { return this->SetUpdateBeingProcessed(false); }); @@ -140,7 +140,7 @@ void ConfigurationUpdater::UpdateConfiguration() if (aClassifier.Partition()) { #if DEBUG_SD_CONFIGURATION_TRACE - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationUpdater::UpdateConfiguration("); + SAL_INFO("sd.fwk", __func__ << ": ConfigurationUpdater::UpdateConfiguration("); ConfigurationTracer::TraceConfiguration( mxRequestedConfiguration, "requested configuration"); ConfigurationTracer::TraceConfiguration( @@ -171,7 +171,7 @@ void ConfigurationUpdater::UpdateConfiguration() } else { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": nothing to do"); + SAL_INFO("sd.fwk", __func__ << ": nothing to do"); #if DEBUG_SD_CONFIGURATION_TRACE ConfigurationTracer::TraceConfiguration( mxRequestedConfiguration, "requested configuration"); @@ -185,8 +185,8 @@ void ConfigurationUpdater::UpdateConfiguration() DBG_UNHANDLED_EXCEPTION("sd"); } - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationUpdater::UpdateConfiguration)"); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": UpdateConfiguration end"); + SAL_INFO("sd.fwk", __func__ << ": ConfigurationUpdater::UpdateConfiguration)"); + SAL_INFO("sd.fwk", __func__ << ": UpdateConfiguration end"); } void ConfigurationUpdater::CleanRequestedConfiguration() @@ -250,7 +250,7 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie mpResourceManager->ActivateResources(rClassifier.GetC1minusC2(), mxCurrentConfiguration); #if DEBUG_SD_CONFIGURATION_TRACE - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ConfigurationController::UpdateConfiguration)"); + SAL_INFO("sd.fwk", __func__ << ": ConfigurationController::UpdateConfiguration)"); ConfigurationTracer::TraceConfiguration( mxRequestedConfiguration, "requested configuration"); ConfigurationTracer::TraceConfiguration( @@ -322,7 +322,7 @@ void ConfigurationUpdater::CheckPureAnchors ( if (bDeactiveCurrentResource) { - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": deactivating pure anchor " << + SAL_INFO("sd.fwk", __func__ << ": deactivating pure anchor " << FrameworkHelper::ResourceIdToString(xResourceId) << "because it has no children"); // Erase element from current configuration. diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx index b18d9be163e7..b01074c3ca74 100644 --- a/sd/source/ui/framework/module/ModuleController.cxx +++ b/sd/source/ui/framework/module/ModuleController.cxx @@ -128,13 +128,13 @@ void ModuleController::ProcessFactory (const ::std::vector& rValues) "URL", aURLs); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ModuleController::adding factory " << sServiceName); + SAL_INFO("sd.fwk", __func__ << ": ModuleController::adding factory " << sServiceName); // Add the resource URLs to the map. for (const auto& rResource : aURLs) { (*mpResourceToFactoryMap)[rResource] = sServiceName; - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": " << rResource); + SAL_INFO("sd.fwk", __func__ << ": " << rResource); } } @@ -186,7 +186,7 @@ void ModuleController::ProcessStartupService (const ::std::vector& rValues) // at the configuration controller. xContext->getServiceManager()->createInstanceWithArgumentsAndContext(sServiceName, aArguments, xContext); - SAL_INFO("sd.fwk", OSL_THIS_FUNC << ": ModuleController::created startup service " << sServiceName); + SAL_INFO("sd.fwk", __func__ << ": ModuleController::created startup service " << sServiceName); } catch (Exception&) { diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx index 9c9d029ea622..025f6251afaf 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx @@ -342,7 +342,7 @@ void BitmapCache::ReCalculateTotalCacheSize() } mbIsFull = (mnNormalCacheSize >= mnMaximalNormalCacheSize); - SAL_INFO("sd.sls", OSL_THIS_FUNC << ": cache size is " << mnNormalCacheSize << "/" << mnPreciousCacheSize); + SAL_INFO("sd.sls", __func__ << ": cache size is " << mnNormalCacheSize << "/" << mnPreciousCacheSize); } void BitmapCache::Recycle (const BitmapCache& rCache) @@ -426,7 +426,7 @@ void BitmapCache::UpdateCacheSize (const CacheEntry& rEntry, CacheOperation eOpe if ( ! rEntry.IsPrecious() && mnNormalCacheSize>mnMaximalNormalCacheSize) { mbIsFull = true; - SAL_INFO("sd.sls", OSL_THIS_FUNC << ": cache size is " << mnNormalCacheSize << " > " << mnMaximalNormalCacheSize); + SAL_INFO("sd.sls", __func__ << ": cache size is " << mnNormalCacheSize << " > " << mnMaximalNormalCacheSize); mpCacheCompactor->RequestCompaction(); } break; @@ -507,7 +507,7 @@ void BitmapCache::CacheEntry::Compress (const std::shared_ptr& if (nOldSize == 0) nOldSize = 1; sal_Int32 nRatio (100L * nNewSize / nOldSize); - SAL_INFO("sd.sls", OSL_THIS_FUNC << ": compressing bitmap for " << %x << " from " << nOldSize << " to " << nNewSize << " bytes (" << nRatio << "%)"); + SAL_INFO("sd.sls", __func__ << ": compressing bitmap for " << %x << " from " << nOldSize << " to " << nNewSize << " bytes (" << nRatio << "%)"); #endif mpCompressor = rpCompressor; diff --git a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx index fa598567f84f..b4a44530ca57 100644 --- a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx @@ -168,7 +168,7 @@ void CacheCompactionByCompression::Run() if (mrCache.GetSize() <= mnMaximalCacheSize) return; - SAL_INFO("sd.sls", OSL_THIS_FUNC << ": bitmap cache uses too much space: " << mrCache.GetSize() << " > " << mnMaximalCacheSize); + SAL_INFO("sd.sls", __func__ << ": bitmap cache uses too much space: " << mrCache.GetSize() << " > " << mnMaximalCacheSize); ::std::unique_ptr< ::sd::slidesorter::cache::BitmapCache::CacheIndex> pIndex ( mrCache.GetCacheIndex()); @@ -182,7 +182,7 @@ void CacheCompactionByCompression::Run() break; } mrCache.ReCalculateTotalCacheSize(); - SAL_INFO("sd.sls", OSL_THIS_FUNC << ": there are now " << mrCache.GetSize() << " bytes occupied"); + SAL_INFO("sd.sls", __func__ << ": there are now " << mrCache.GetSize() << " bytes occupied"); } } // end of anonymous namespace diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx index a1fb53b2975e..f84d6265ee56 100644 --- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx +++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx @@ -136,7 +136,7 @@ void RequestQueue::AddRequest ( } #if OSL_DEBUG_LEVEL >=2 - SAL_INFO("sd.sls", OSL_THIS_FUNC << ": " << (bRemoved?"replaced":"added") + SAL_INFO("sd.sls", __func__ << ": " << (bRemoved?"replaced":"added") << " request for page " << ((aKey->GetPageNum()-1)/2) << " with priority class " << static_cast(eRequestClass)); #endif diff --git a/sd/source/ui/tools/TimerBasedTaskExecution.cxx b/sd/source/ui/tools/TimerBasedTaskExecution.cxx index 8ae7fddada92..0bd705bd60fe 100644 --- a/sd/source/ui/tools/TimerBasedTaskExecution.cxx +++ b/sd/source/ui/tools/TimerBasedTaskExecution.cxx @@ -110,17 +110,17 @@ IMPL_LINK_NOARG(TimerBasedTaskExecution, TimerCallback, Timer *, void) // mnMaxTimePerStep. Note that the last step may take longer // than allowed. sal_uInt32 nStartTime (::tools::Time( ::tools::Time::SYSTEM ).GetMSFromTime()); - SAL_INFO("sd.tools", OSL_THIS_FUNC << ": starting TimerBasedTaskExecution at " << nStartTime); + SAL_INFO("sd.tools", __func__ << ": starting TimerBasedTaskExecution at " << nStartTime); do { mpTask->RunNextStep(); sal_uInt32 nDuration (::tools::Time( ::tools::Time::SYSTEM ).GetMSFromTime()-nStartTime); - SAL_INFO("sd.tools", OSL_THIS_FUNC << ": executed step in " << nDuration); + SAL_INFO("sd.tools", __func__ << ": executed step in " << nDuration); if (nDuration > mnMaxTimePerStep) break; } while (mpTask->HasNextStep()); - SAL_INFO("sd.tools", OSL_THIS_FUNC << ": TimerBasedTaskExecution sleeping"); + SAL_INFO("sd.tools", __func__ << ": TimerBasedTaskExecution sleeping"); maTimer.Start(); } else diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 7f084e3952e7..808fcc0545a6 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -606,7 +606,7 @@ void ToolBarManager::Implementation::ResetToolBars (ToolBarGroup eGroup) void ToolBarManager::Implementation::ResetAllToolBars() { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": resetting all tool bars"); + SAL_INFO("sd.view", __func__ << ": resetting all tool bars"); for (auto i : o3tl::enumrange()) ResetToolBars(i); } @@ -679,7 +679,7 @@ void ToolBarManager::Implementation::PreUpdate() mbPreUpdatePending = false; - SAL_INFO("sd.view", OSL_THIS_FUNC << ": ToolBarManager::PreUpdate ["); + SAL_INFO("sd.view", __func__ << ": ToolBarManager::PreUpdate ["); // Get the list of tool bars that are not used anymore and are to be // deactivated. @@ -690,12 +690,12 @@ void ToolBarManager::Implementation::PreUpdate() for (const auto& aToolBar : aToolBars) { OUString sFullName (GetToolBarResourceName(aToolBar)); - SAL_INFO("sd.view", OSL_THIS_FUNC << ": turning off tool bar " << sFullName); + SAL_INFO("sd.view", __func__ << ": turning off tool bar " << sFullName); mxLayouter->destroyElement(sFullName); maToolBarList.MarkToolBarAsNotActive(aToolBar); } - SAL_INFO("sd.view", OSL_THIS_FUNC << ": ToolBarManager::PreUpdate ]"); + SAL_INFO("sd.view", __func__ << ": ToolBarManager::PreUpdate ]"); } void ToolBarManager::Implementation::PostUpdate() @@ -713,18 +713,18 @@ void ToolBarManager::Implementation::PostUpdate() std::vector aToolBars; maToolBarList.GetToolBarsToActivate(aToolBars); - SAL_INFO("sd.view", OSL_THIS_FUNC << ": ToolBarManager::PostUpdate ["); + SAL_INFO("sd.view", __func__ << ": ToolBarManager::PostUpdate ["); // Turn on the tool bars that are visible in the new context. for (const auto& aToolBar : aToolBars) { OUString sFullName (GetToolBarResourceName(aToolBar)); - SAL_INFO("sd.view", OSL_THIS_FUNC << ": turning on tool bar " << sFullName); + SAL_INFO("sd.view", __func__ << ": turning on tool bar " << sFullName); mxLayouter->requestElement(sFullName); maToolBarList.MarkToolBarAsActive(aToolBar); } - SAL_INFO("sd.view", OSL_THIS_FUNC << ": ToolBarManager::PostUpdate ]"); + SAL_INFO("sd.view", __func__ << ": ToolBarManager::PostUpdate ]"); } void ToolBarManager::Implementation::LockViewShellManager() @@ -736,7 +736,7 @@ void ToolBarManager::Implementation::LockViewShellManager() void ToolBarManager::Implementation::LockUpdate() { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": LockUpdate " << mnLockCount); + SAL_INFO("sd.view", __func__ << ": LockUpdate " << mnLockCount); ::osl::MutexGuard aGuard(maMutex); DBG_ASSERT(mnLockCount<100, "ToolBarManager lock count unusually high"); @@ -751,7 +751,7 @@ void ToolBarManager::Implementation::LockUpdate() void ToolBarManager::Implementation::UnlockUpdate() { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": UnlockUpdate " << mnLockCount); + SAL_INFO("sd.view", __func__ << ": UnlockUpdate " << mnLockCount); ::osl::MutexGuard aGuard(maMutex); OSL_ASSERT(mnLockCount>0); @@ -922,14 +922,14 @@ using namespace ::sd; LayouterLock::LayouterLock (const Reference& rxLayouter) : mxLayouter(rxLayouter) { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": LayouterLock " << (mxLayouter.is() ? 1 :0)); + SAL_INFO("sd.view", __func__ << ": LayouterLock " << (mxLayouter.is() ? 1 :0)); if (mxLayouter.is()) mxLayouter->lock(); } LayouterLock::~LayouterLock() { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": ~LayouterLock " << (mxLayouter.is() ? 1 :0)); + SAL_INFO("sd.view", __func__ << ": ~LayouterLock " << (mxLayouter.is() ? 1 :0)); if (mxLayouter.is()) mxLayouter->unlock(); } @@ -1374,7 +1374,7 @@ void ToolBarShellList::UpdateShells ( std::insert_iterator(aList,aList.begin())); for (const auto& rShell : aList) { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": deactivating tool bar shell " << static_cast(rShell.mnId)); + SAL_INFO("sd.view", __func__ << ": deactivating tool bar shell " << static_cast(rShell.mnId)); rpManager->DeactivateSubShell(*rpMainViewShell, rShell.mnId); } @@ -1386,7 +1386,7 @@ void ToolBarShellList::UpdateShells ( std::insert_iterator(aList,aList.begin())); for (const auto& rShell : aList) { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": activating tool bar shell " << static_cast(rShell.mnId)); + SAL_INFO("sd.view", __func__ << ": activating tool bar shell " << static_cast(rShell.mnId)); rpManager->ActivateSubShell(*rpMainViewShell, rShell.mnId); } diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 3b9308d8c5f0..08081f9b153e 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -732,9 +732,9 @@ void ViewShellManager::Implementation::UpdateShellStack() aSfxShellStack.push_back(mrBase.GetSubShell(nIndex)); #if OSL_DEBUG_LEVEL >= 2 - SAL_INFO("sd.view", OSL_THIS_FUNC << ": Current SFX Stack"); + SAL_INFO("sd.view", __func__ << ": Current SFX Stack"); DumpShellStack(aSfxShellStack); - SAL_INFO("sd.view", OSL_THIS_FUNC << ": Target Stack"); + SAL_INFO("sd.view", __func__ << ": Target Stack"); DumpShellStack(aTargetStack); #endif @@ -750,7 +750,7 @@ void ViewShellManager::Implementation::UpdateShellStack() i != iLast; ++i) { SfxShell* const pShell = *i; - SAL_INFO("sd.view", OSL_THIS_FUNC << ": removing shell " << pShell << " from stack"); + SAL_INFO("sd.view", __func__ << ": removing shell " << pShell << " from stack"); mrBase.RemoveSubShell(pShell); } aSfxShellStack.erase(iSfxShell, aSfxShellStack.end()); @@ -759,7 +759,7 @@ void ViewShellManager::Implementation::UpdateShellStack() mbShellStackIsUpToDate = false; while (iTargetShell != aTargetStack.end()) { - SAL_INFO("sd.view", OSL_THIS_FUNC << ": pushing shell " << *iTargetShell << " on stack"); + SAL_INFO("sd.view", __func__ << ": pushing shell " << *iTargetShell << " on stack"); mrBase.AddSubShell(**iTargetShell); ++iTargetShell; @@ -783,7 +783,7 @@ void ViewShellManager::Implementation::UpdateShellStack() mbShellStackIsUpToDate = true; #if OSL_DEBUG_LEVEL >= 2 - SAL_INFO("sd.view", OSL_THIS_FUNC << ": New current stack"); + SAL_INFO("sd.view", __func__ << ": New current stack"); DumpSfxShellStack(); #endif } @@ -799,7 +799,7 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe : nullptr; #if OSL_DEBUG_LEVEL >= 2 - SAL_INFO("sd.view", OSL_THIS_FUNC << "TakeShellsFromStack( " << pShell << ")"); + SAL_INFO("sd.view", __func__ << "TakeShellsFromStack( " << pShell << ")"); DumpSfxShellStack(); #endif @@ -836,7 +836,7 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe while (true) { SfxShell* pShellOnStack = mrBase.GetSubShell(0); - SAL_INFO("sd.view", OSL_THIS_FUNC << "removing shell " << pShellOnStack << " from stack"); + SAL_INFO("sd.view", __func__ << "removing shell " << pShellOnStack << " from stack"); mrBase.RemoveSubShell(pShellOnStack); if (pShellOnStack == pShell) break; @@ -853,7 +853,7 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe mpTopShell->SetUndoManager(pUndoManager); #if OSL_DEBUG_LEVEL >= 2 - SAL_INFO("sd.view", OSL_THIS_FUNC << "Sfx shell stack is:"); + SAL_INFO("sd.view", __func__ << "Sfx shell stack is:"); DumpSfxShellStack(); #endif } @@ -1081,11 +1081,11 @@ void ViewShellManager::Implementation::DumpShellStack (const ShellStack& rStack) ShellStack::const_reverse_iterator iEntry; for (iEntry=rStack.rbegin(); iEntry!=rStack.rend(); ++iEntry) if (*iEntry != NULL) - SAL_INFO("sd.view", OSL_THIS_FUNC << ": " << + SAL_INFO("sd.view", __func__ << ": " << *iEntry << " : " << (*iEntry)->GetName()); else - SAL_INFO("sd.view", OSL_THIS_FUNC << " null"); + SAL_INFO("sd.view", __func__ << " null"); } void ViewShellManager::Implementation::DumpSfxShellStack() diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 14474f224e61..951a18c5fca5 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -684,14 +684,14 @@ Reference SAL_CALL PresenterAccessible::getAccessibleContext void SAL_CALL PresenterAccessible::focusGained (const css::awt::FocusEvent&) { - SAL_INFO("sdext.presenter", OSL_THIS_FUNC << ": PresenterAccessible::focusGained at " << this + SAL_INFO("sdext.presenter", __func__ << ": PresenterAccessible::focusGained at " << this << " and window " << mxMainWindow.get()); AccessibleFocusManager::Instance()->FocusObject(mpAccessibleConsole); } void SAL_CALL PresenterAccessible::focusLost (const css::awt::FocusEvent&) { - SAL_INFO("sdext.presenter", OSL_THIS_FUNC << ": PresenterAccessible::focusLost at " << this); + SAL_INFO("sdext.presenter", __func__ << ": PresenterAccessible::focusLost at " << this); AccessibleFocusManager::Instance()->FocusObject(nullptr); } @@ -1410,7 +1410,7 @@ Sequence SAL_CALL ThrowIfDisposed(); #if OSL_DEBUG_LEVEL > 0 - SAL_INFO( "sdext.presenter", OSL_THIS_FUNC << " at " << this << ", " << nIndex << " returns empty set" ); + SAL_INFO( "sdext.presenter", __func__ << " at " << this << ", " << nIndex << " returns empty set" ); for (sal_Int32 nAttributeIndex(0), nAttributeCount(rRequestedAttributes.getLength()); nAttributeIndex < nAttributeCount; ++nAttributeIndex) diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx index 27bdd5aab403..631553915dca 100644 --- a/slideshow/source/inc/delayevent.hxx +++ b/slideshow/source/inc/delayevent.hxx @@ -125,10 +125,10 @@ inline EventSharedPtr makeDelay_( } #define makeDelay(f, t, d) makeDelay_(f, t, \ - OSL_THIS_FUNC, __FILE__, __LINE__, \ + __func__, __FILE__, __LINE__, \ d) #define makeEvent(f, d) makeDelay_(f, 0.0, \ - OSL_THIS_FUNC, __FILE__, __LINE__, \ + __func__, __FILE__, __LINE__, \ d) #endif // OSL_DEBUG_LEVEL <= 1 diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx index 632933feecd6..801cdf025d69 100644 --- a/slideshow/source/inc/tools.hxx +++ b/slideshow/source/inc/tools.hxx @@ -289,7 +289,7 @@ namespace slideshow bool const bRet = css::uno::fromAny(a, &rValue); #if OSL_DEBUG_LEVEL > 0 if( !bRet ) - SAL_INFO("slideshow", OSL_THIS_FUNC << ": while retrieving property " << propName << ", cannot extract Any of type " + SAL_INFO("slideshow", __func__ << ": while retrieving property " << propName << ", cannot extract Any of type " << a.getValueTypeRef()->pTypeName); #endif return bRet; @@ -318,7 +318,7 @@ namespace slideshow bool const bRet = rIfc.is(); #if OSL_DEBUG_LEVEL > 0 if( !bRet ) - SAL_INFO("slideshow", OSL_THIS_FUNC << ": while retrieving property " << propName << ", cannot extract Any of type " + SAL_INFO("slideshow", __func__ << ": while retrieving property " << propName << ", cannot extract Any of type " << a.getValueTypeRef()->pTypeName << " to interface"); #endif return bRet; diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx index 90a13f3ce1f4..685a31ec7ef1 100644 --- a/starmath/source/rtfexport.cxx +++ b/starmath/source/rtfexport.cxx @@ -269,7 +269,7 @@ void SmRtfExport::HandleOperator(const SmOperNode* pNode, int nLevel) m_pBuffer->append("}"); // mfunc break; default: - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC << " unhandled oper type"); + SAL_INFO("starmath.rtf", "TODO: " << __func__ << " unhandled oper type"); break; } } @@ -383,7 +383,7 @@ void SmRtfExport::HandleSubSupScriptInternal(const SmSubSupNode* pNode, int nLev m_pBuffer->append("}"); // mlimUpp } else - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC << " unhandled subsup type"); + SAL_INFO("starmath.rtf", "TODO: " << __func__ << " unhandled subsup type"); } void SmRtfExport::HandleMatrix(const SmMatrixNode* pNode, int nLevel) @@ -490,7 +490,7 @@ void SmRtfExport::HandleVerticalBrace(const SmVerticalBraceNode* pNode, int nLev break; } default: - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC << " unhandled vertical brace type"); + SAL_INFO("starmath.rtf", "TODO: " << __func__ << " unhandled vertical brace type"); break; } } diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index aec43227ec52..ac952d8d983c 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -388,7 +388,7 @@ void RtfAttributeOutput::EndParagraphProperties( void RtfAttributeOutput::StartRun(const SwRedlineData* pRedlineData, sal_Int32 /*nPos*/, bool bSingleEmptyRun) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", bSingleEmptyRun: " << bSingleEmptyRun); + SAL_INFO("sw.rtf", __func__ << ", bSingleEmptyRun: " << bSingleEmptyRun); m_bInRun = true; m_bSingleEmptyRun = bSingleEmptyRun; @@ -492,7 +492,7 @@ OString RtfAttributeOutput::MoveCharacterProperties(bool aAutoWriteRtlLtr) void RtfAttributeOutput::RunText(const OUString& rText, rtl_TextEncoding /*eCharSet*/) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rText: " << rText); + SAL_INFO("sw.rtf", __func__ << ", rText: " << rText); RawText(rText, m_rExport.GetCurrentEncoding()); } @@ -588,7 +588,7 @@ bool RtfAttributeOutput::EndURL(bool const isAtEndOfParagraph) void RtfAttributeOutput::FieldVanish(const OUString& /*rText*/, ww::eField /*eType*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::Redline(const SwRedlineData* pRedline) @@ -621,7 +621,7 @@ void RtfAttributeOutput::FormatDrop(const SwTextNode& /*rNode*/, ww8::WW8TableNodeInfo::Pointer_t /*pTextNodeInfo*/, ww8::WW8TableNodeInfoInner::Pointer_t /*pTextNodeInfoInner*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::ParagraphStyle(sal_uInt16 nStyle) @@ -947,7 +947,7 @@ void RtfAttributeOutput::TableOrientation( void RtfAttributeOutput::TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::TableRowEnd(sal_uInt32 /*nDepth*/) { /* noop, see EndTableRow() */} @@ -990,7 +990,7 @@ void RtfAttributeOutput::StartTableRow( const ww8::WW8TableNodeInfoInner::Pointer_t& pTableTextNodeInfoInner) { sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth(); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", (depth is " << nCurrentDepth << ")"); + SAL_INFO("sw.rtf", __func__ << ", (depth is " << nCurrentDepth << ")"); m_bTableRowEnded = false; TableDefinition(pTableTextNodeInfoInner); @@ -1019,7 +1019,7 @@ void RtfAttributeOutput::TableCellProperties( void RtfAttributeOutput::EndTableCell() { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", (depth is " << m_nTableDepth << ")"); + SAL_INFO("sw.rtf", __func__ << ", (depth is " << m_nTableDepth << ")"); if (!m_bWroteCellInfo) { @@ -1041,7 +1041,7 @@ void RtfAttributeOutput::EndTableCell() void RtfAttributeOutput::EndTableRow() { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", (depth is " << m_nTableDepth << ")"); + SAL_INFO("sw.rtf", __func__ << ", (depth is " << m_nTableDepth << ")"); // Trying to end the row without writing the required number of cells? Fill with empty ones. for (sal_uInt32 i = 0; i < m_aCells[m_nTableDepth]; i++) @@ -1140,7 +1140,7 @@ void RtfAttributeOutput::StartStyle(const OUString& rName, StyleType eType, sal_ sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", rName = '" << rName << "'"); + SAL_INFO("sw.rtf", __func__ << ", rName = '" << rName << "'"); m_aStylesheet.append('{'); if (eType == STYLE_TYPE_PARA) @@ -1332,7 +1332,7 @@ void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, void RtfAttributeOutput::SectionType(sal_uInt8 nBreakCode) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ", nBreakCode = " << int(nBreakCode)); + SAL_INFO("sw.rtf", __func__ << ", nBreakCode = " << int(nBreakCode)); /* * break code: 0 No break, 1 New column @@ -2315,9 +2315,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi m_aRun->append("}{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " "); } else - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " unhandled form control: '" - << xInfo->getImplementationName() - << "'"); + SAL_INFO("sw.rtf", __func__ << " unhandled form control: '" + << xInfo->getImplementationName() << "'"); m_aRun->append('}'); } } @@ -2340,8 +2339,8 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi } break; default: - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ": unknown type (" - << static_cast(rFrame.GetWriterType()) << ")"); + SAL_INFO("sw.rtf", __func__ << ": unknown type (" + << static_cast(rFrame.GetWriterType()) << ")"); break; } } @@ -2843,7 +2842,7 @@ void RtfAttributeOutput::WriteTextFootnoteNumStr(const SwFormatFootnote& rFootno void RtfAttributeOutput::TextFootnote_Impl(const SwFormatFootnote& rFootnote) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); m_aRun->append("{" OOO_STRING_SVTOOLS_RTF_SUPER " "); EndRunProperties(nullptr); @@ -2879,7 +2878,7 @@ void RtfAttributeOutput::TextFootnote_Impl(const SwFormatFootnote& rFootnote) m_aRun->append("}"); m_aRun->append("}"); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfAttributeOutput::ParaLineSpacing_Impl(short nSpace, short nMulti) @@ -3084,12 +3083,12 @@ void RtfAttributeOutput::ParaScriptSpace(const SfxBoolItem& rScriptSpace) void RtfAttributeOutput::ParaHangingPunctuation(const SfxBoolItem& /*rItem*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::ParaForbiddenRules(const SfxBoolItem& /*rItem*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::ParaVerticalAlign(const SvxParaVertAlignItem& rAlign) @@ -3119,7 +3118,7 @@ void RtfAttributeOutput::ParaVerticalAlign(const SvxParaVertAlignItem& rAlign) void RtfAttributeOutput::ParaSnapToGrid(const SvxParaGridItem& /*rGrid*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::FormatFrameSize(const SwFormatFrameSize& rSize) @@ -3137,7 +3136,7 @@ void RtfAttributeOutput::FormatFrameSize(const SwFormatFrameSize& rSize) void RtfAttributeOutput::FormatPaperBin(const SvxPaperBinItem& /*rItem*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::FormatLRSpace(const SvxLRSpaceItem& rLRSpace) @@ -3621,7 +3620,7 @@ void RtfAttributeOutput::FormatKeep(const SvxFormatKeepItem& rItem) void RtfAttributeOutput::FormatTextGrid(const SwTextGridItem& /*rGrid*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::FormatLineNumbering(const SwFormatLineNumber& rNumbering) @@ -3711,18 +3710,18 @@ void RtfAttributeOutput::WriteExpand(const SwField* pField) void RtfAttributeOutput::RefField(const SwField& /*rField*/, const OUString& /*rRef*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::HiddenField(const SwField& /*rField*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::SetField(const SwField& /*rField*/, ww::eField /*eType*/, const OUString& /*rCmd*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfAttributeOutput::PostitField(const SwField* pField) diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 71916fd3466f..8c3577ed7794 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -222,7 +222,7 @@ void RtfExport::BuildNumbering() void RtfExport::WriteNumbering() { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); if (!m_pUsedNumTable) return; // no numbering is used @@ -249,7 +249,7 @@ void RtfExport::WriteNumbering() NumberingDefinitions(); Strm().WriteChar('}'); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfExport::WriteRevTab() @@ -318,12 +318,12 @@ void RtfExport::OutputField(const SwField* pField, ww::eField eFieldType, const void RtfExport::WriteFormData(const ::sw::mark::IFieldmark& /*rFieldmark*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfExport::WriteHyperlinkData(const ::sw::mark::IFieldmark& /*rFieldmark*/) { - SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC); + SAL_INFO("sw.rtf", "TODO: " << __func__); } void RtfExport::DoComboBox(const OUString& /*rName*/, const OUString& /*rHelp*/, @@ -396,9 +396,9 @@ void RtfExport::WriteFonts() void RtfExport::WriteStyles() { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); m_pStyles->OutputStylesTable(); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfExport::WriteFootnoteSettings() @@ -418,7 +418,7 @@ void RtfExport::WriteFootnoteSettings() void RtfExport::WriteMainText() { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); if (std::unique_ptr oBrush = getBackground(); oBrush) { @@ -459,7 +459,7 @@ void RtfExport::WriteMainText() WriteText(); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfExport::WriteInfo() @@ -1108,9 +1108,9 @@ sal_uInt16 RtfExport::GetColor(const Color& rColor) const for (const auto& rEntry : m_aColTable) if (rEntry.second == rColor) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " returning " << rEntry.first << " (" - << rColor.GetRed() << "," << rColor.GetGreen() << "," - << rColor.GetBlue() << ")"); + SAL_INFO("sw.rtf", __func__ << " returning " << rEntry.first << " (" << rColor.GetRed() + << "," << rColor.GetGreen() << "," << rColor.GetBlue() + << ")"); return rEntry.first; } OSL_FAIL("No such Color in m_aColTable!"); @@ -1343,7 +1343,7 @@ const OUString* RtfExport::GetRedline(sal_uInt16 nId) void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); const SwPageDesc* pSave = m_pCurrentPageDesc; m_pCurrentPageDesc = &rPgDsc; @@ -1389,7 +1389,7 @@ void RtfExport::OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirst std::nullopt); m_pCurrentPageDesc = pSave; - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader) @@ -1407,7 +1407,7 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader) return; } - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); const char* pStr = (bHeader ? OOO_STRING_SVTOOLS_RTF_HEADER : OOO_STRING_SVTOOLS_RTF_FOOTER); /* is this a title page? */ @@ -1420,17 +1420,17 @@ void RtfExport::WriteHeaderFooter(const SfxPoolItem& rItem, bool bHeader) WriteHeaderFooterText(m_pCurrentPageDesc->GetMaster(), bHeader); Strm().WriteChar('}'); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfExport::WriteHeaderFooter(const SwFrameFormat& rFormat, bool bHeader, const char* pStr, bool bTitlepg) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); m_pAttrOutput->WriteHeaderFooter_Impl(rFormat, bHeader, pStr, bTitlepg); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } namespace diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index d6ddc0d47d91..81978c9bb106 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -386,7 +386,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl else SAL_INFO( "sw.rtf", - OSL_THIS_FUNC + __func__ << ": unhandled shape path, missing either pVertices or pSegmentInfo"); } break; @@ -449,8 +449,8 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl } break; default: - SAL_INFO("sw.rtf", OSL_THIS_FUNC << ": unhandled property: " << nId - << " (value: " << rOpt.nPropValue << ")"); + SAL_INFO("sw.rtf", __func__ << ": unhandled property: " << nId + << " (value: " << rOpt.nPropValue << ")"); break; } } @@ -682,7 +682,7 @@ sal_Int32 RtfSdrExport::StartShape() void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj, TextTypes eType) { - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start"); + SAL_INFO("sw.rtf", __func__ << " start"); const EditTextObject& rEditObj = rParaObj.GetTextObject(); MSWord_SdrAttrIter aAttrIter(m_rExport, rEditObj, eType); @@ -734,7 +734,7 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj, TextTypes e if (bShape) m_rAttrOutput.RunText().append('}'); - SAL_INFO("sw.rtf", OSL_THIS_FUNC << " end"); + SAL_INFO("sw.rtf", __func__ << " end"); } void RtfSdrExport::EndShape(sal_Int32 nShapeElement) diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index 71cc5a4f1982..1ffb1b46dccd 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -777,7 +777,7 @@ void AquaSalFrame::doShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) return; } - SAL_INFO("vcl.osx", OSL_THIS_FUNC << ": mbFullScreen=" << mbFullScreen << ", bFullScreen=" << bFullScreen); + SAL_INFO("vcl.osx", __func__ << ": mbFullScreen=" << mbFullScreen << ", bFullScreen=" << bFullScreen); if( mbFullScreen == bFullScreen ) return; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index f4fdde9ca86a..5971b8b8e96b 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -641,8 +641,7 @@ void RTFDocumentImpl::parBreak() void RTFDocumentImpl::sectBreak(bool bFinal) { - SAL_INFO("writerfilter.rtf", - OSL_THIS_FUNC << ": final? " << bFinal << ", needed? " << m_bNeedSect); + SAL_INFO("writerfilter.rtf", __func__ << ": final? " << bFinal << ", needed? " << m_bNeedSect); bool bNeedSect = m_bNeedSect; RTFValue::Pointer_t pBreak = m_aStates.top().getSectionSprms().find(NS_ooxml::LN_EG_SectPrContents_type); @@ -1963,7 +1962,7 @@ RTFError RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int n RTFError RTFDocumentImpl::pushState() { - //SAL_INFO("writerfilter.rtf", OSL_THIS_FUNC << " before push: " << m_pTokenizer->getGroup()); + //SAL_INFO("writerfilter.rtf", __func__ << " before push: " << m_pTokenizer->getGroup()); checkUnicode(/*bUnicode =*/true, /*bHex =*/true); m_nGroupStartPos = Strm().Tell(); @@ -3449,7 +3448,7 @@ void RTFDocumentImpl::afterPopState(RTFParserState& rState) RTFError RTFDocumentImpl::popState() { - //SAL_INFO("writerfilter", OSL_THIS_FUNC << " before pop: m_pTokenizer->getGroup() " << m_pTokenizer->getGroup() << + //SAL_INFO("writerfilter", __func__ << " before pop: m_pTokenizer->getGroup() " << m_pTokenizer->getGroup() << // ", dest state: " << m_aStates.top().eDestination); checkUnicode(/*bUnicode =*/true, /*bHex =*/true); diff --git a/writerfilter/source/rtftok/rtfskipdestination.cxx b/writerfilter/source/rtftok/rtfskipdestination.cxx index 47ada340e8b8..ad28ec64cf0c 100644 --- a/writerfilter/source/rtftok/rtfskipdestination.cxx +++ b/writerfilter/source/rtftok/rtfskipdestination.cxx @@ -27,7 +27,7 @@ RTFSkipDestination::~RTFSkipDestination() { if (!m_bParsed) { - SAL_INFO("writerfilter", OSL_THIS_FUNC << ": skipping destination"); + SAL_INFO("writerfilter", __func__ << ": skipping destination"); m_rImport.setDestination(Destination::SKIP); } m_rImport.setSkipUnknown(false); diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index 5f5782cea8d7..e98132db25bb 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -60,7 +60,7 @@ RTFTokenizer::~RTFTokenizer() = default; RTFError RTFTokenizer::resolveParse() { - SAL_INFO("writerfilter.rtf", OSL_THIS_FUNC); + SAL_INFO("writerfilter.rtf", __func__); char ch; RTFError ret; // for hex chars @@ -84,7 +84,7 @@ RTFError RTFTokenizer::resolveParse() while (Strm().ReadChar(ch), !Strm().eof()) { - //SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << ch << "'"); + //SAL_INFO("writerfilter", __func__ << ": parsing character '" << ch << "'"); sal_uInt64 const nCurrentPos = Strm().Tell(); if (m_xStatusIndicator.is() && nCurrentPos > (nLastPos + nPercentSize)) @@ -144,7 +144,7 @@ RTFError RTFTokenizer::resolveParse() } else { - SAL_INFO("writerfilter.rtf", OSL_THIS_FUNC << ": hex internal state"); + SAL_INFO("writerfilter.rtf", __func__ << ": hex internal state"); b = b << 4; sal_Int8 parsed = msfilter::rtfutil::AsHex(ch); if (parsed == -1) @@ -266,13 +266,13 @@ RTFError RTFTokenizer::dispatchKeyword(OString const& rKeyword, bool bParam, int Strm().SeekRel(nParam); return RTFError::OK; } - SAL_INFO("writerfilter.rtf", OSL_THIS_FUNC << ": keyword '\\" << rKeyword << "' with param? " - << (bParam ? 1 : 0) << " param val: '" - << (bParam ? nParam : 0) << "'"); + SAL_INFO("writerfilter.rtf", __func__ << ": keyword '\\" << rKeyword << "' with param? " + << (bParam ? 1 : 0) << " param val: '" + << (bParam ? nParam : 0) << "'"); auto findIt = s_aRTFControlWords.find(rKeyword); if (findIt == s_aRTFControlWords.end()) { - SAL_INFO("writerfilter.rtf", OSL_THIS_FUNC << ": unknown keyword '\\" << rKeyword << "'"); + SAL_INFO("writerfilter.rtf", __func__ << ": unknown keyword '\\" << rKeyword << "'"); RTFSkipDestination aSkip(m_rImport); aSkip.setParsed(false); return RTFError::OK; -- cgit