From 335e73a7f37f5efc08a6691d8e4b271c68e0a2ac Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 19 Oct 2023 10:30:39 +0200 Subject: Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: vbahelper Change-Id: Idb944974318a94763532639c9e74040adadf06f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158290 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- vbahelper/source/msforms/vbamultipage.cxx | 2 +- vbahelper/source/msforms/vbaprogressbar.cxx | 2 +- vbahelper/source/vbahelper/vbaglobalbase.cxx | 2 +- vbahelper/source/vbahelper/vbahelper.cxx | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'vbahelper') diff --git a/vbahelper/source/msforms/vbamultipage.cxx b/vbahelper/source/msforms/vbamultipage.cxx index 183a93b667d4..72f62b665248 100644 --- a/vbahelper/source/msforms/vbamultipage.cxx +++ b/vbahelper/source/msforms/vbamultipage.cxx @@ -25,7 +25,7 @@ using namespace com::sun::star; using namespace ooo::vba; -constexpr OUStringLiteral SVALUE( u"MultiPageValue" ); +constexpr OUString SVALUE( u"MultiPageValue"_ustr ); namespace { diff --git a/vbahelper/source/msforms/vbaprogressbar.cxx b/vbahelper/source/msforms/vbaprogressbar.cxx index f988112b5c52..2e6462e4d72b 100644 --- a/vbahelper/source/msforms/vbaprogressbar.cxx +++ b/vbahelper/source/msforms/vbaprogressbar.cxx @@ -22,7 +22,7 @@ using namespace com::sun::star; using namespace ooo::vba; // uno servicename com.sun.star.awt.UnoControlProgressBarMode -constexpr OUStringLiteral SVALUE( u"ProgressValue" ); +constexpr OUString SVALUE( u"ProgressValue"_ustr ); ScVbaProgressBar::ScVbaProgressBar( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, std::unique_ptr pGeomHelper ) : ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, std::move(pGeomHelper) ) diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx index 13273f246060..a8a0d6df3a8d 100644 --- a/vbahelper/source/vbahelper/vbaglobalbase.cxx +++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx @@ -34,7 +34,7 @@ using namespace ooo::vba; // special key to return the Application const char sAppService[] = "ooo.vba.Application"; -constexpr OUStringLiteral gsApplication( u"Application" ); +constexpr OUString gsApplication( u"Application"_ustr ); VbaGlobalsBase::VbaGlobalsBase( const uno::Reference< ov::XHelperInterface >& xParent, diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 20fa519dc0d6..0e0c7b9c8f28 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -854,14 +854,14 @@ double UserFormGeometryHelper::getOffsetY() const return mfOffsetY; } -constexpr OUStringLiteral saPosXName = u"PositionX"; -constexpr OUStringLiteral saPosYName = u"PositionY"; -constexpr OUStringLiteral saWidthName = u"Width"; -constexpr OUStringLiteral saHeightName = u"Height"; +constexpr OUString saPosXName = u"PositionX"_ustr; +constexpr OUString saPosYName = u"PositionY"_ustr; +constexpr OUString saWidthName = u"Width"_ustr; +constexpr OUString saHeightName = u"Height"_ustr; double UserFormGeometryHelper::implGetPos( bool bPosY ) const { - sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? OUString(saPosYName) : OUString(saPosXName) ).get< sal_Int32 >(); + sal_Int32 nPosAppFont = mxModelProps->getPropertyValue( bPosY ? saPosYName : saPosXName ).get< sal_Int32 >(); // appfont to pixel awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( nPosAppFont, nPosAppFont ), util::MeasureUnit::APPFONT ); // pixel to VBA points @@ -876,12 +876,12 @@ void UserFormGeometryHelper::implSetPos( double fPos, bool bPosY ) awt::Point aPosPixel = mxUnitConv->convertPointToPixel( awt::Point( nPosPixel, nPosPixel ), util::MeasureUnit::POINT ); // pixel to appfont awt::Point aPosAppFont = mxUnitConv->convertPointToLogic( aPosPixel, util::MeasureUnit::APPFONT ); - mxModelProps->setPropertyValue( bPosY ? OUString(saPosYName) : OUString(saPosXName), uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) ); + mxModelProps->setPropertyValue( bPosY ? saPosYName : saPosXName, uno::Any( bPosY ? aPosAppFont.Y : aPosAppFont.X ) ); } double UserFormGeometryHelper::implGetSize( bool bHeight, bool bOuter ) const { - sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? OUString(saHeightName) : OUString(saWidthName) ).get< sal_Int32 >(); + sal_Int32 nSizeAppFont = mxModelProps->getPropertyValue( bHeight ? saHeightName : saWidthName ).get< sal_Int32 >(); // appfont to pixel awt::Size aSizePixel = mxUnitConv->convertSizeToPixel( awt::Size( nSizeAppFont, nSizeAppFont ), util::MeasureUnit::APPFONT ); @@ -929,7 +929,7 @@ void UserFormGeometryHelper::implSetSize( double fSize, bool bHeight, bool bOute } awt::Size aSizeAppFont = mxUnitConv->convertSizeToLogic( aSizePixel, util::MeasureUnit::APPFONT ); - mxModelProps->setPropertyValue( bHeight ? OUString(saHeightName) : OUString(saWidthName), uno::Any( bHeight ? aSizeAppFont.Height : aSizeAppFont.Width ) ); + mxModelProps->setPropertyValue( bHeight ? saHeightName : saWidthName, uno::Any( bHeight ? aSizeAppFont.Height : aSizeAppFont.Width ) ); } -- cgit