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 <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2023-10-20 22:46:23 +02:00
parent 5f69ffb27a
commit 335e73a7f3
4 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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<ov::AbstractGeometryAttributes> pGeomHelper )
: ProgressBarImpl_BASE( xParent, xContext, xControl, xModel, std::move(pGeomHelper) )
+1 -1
View File
@@ -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,
+8 -8
View File
@@ -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 ) );
}