From ce8816ff95c06ce86dffee90431e6538b676b5e4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 11 Nov 2024 09:55:02 +0200 Subject: [PATCH] loplugin:reftotemp in drawinglayer..framework Change-Id: I31618b4ae7ea4e37834bffc89e352b4c33eda14d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176372 Reviewed-by: Noel Grandin Tested-by: Jenkins --- .../source/primitive2d/glowprimitive2d.cxx | 12 ++++---- .../source/primitive2d/shadowprimitive2d.cxx | 12 ++++---- .../source/primitive2d/textlayoutdevice.cxx | 28 +++++++++---------- filter/source/svg/svgwriter.cxx | 4 +-- formula/source/ui/dlg/funcpage.cxx | 2 +- fpicker/source/office/RemoteFilesDialog.cxx | 4 +-- .../source/accelerators/acceleratorcache.cxx | 4 +-- framework/source/uielement/toolbarmanager.cxx | 2 +- .../xml/acceleratorconfigurationwriter.cxx | 4 +-- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/drawinglayer/source/primitive2d/glowprimitive2d.cxx b/drawinglayer/source/primitive2d/glowprimitive2d.cxx index 6bf9dea8af83..18fa5224887d 100644 --- a/drawinglayer/source/primitive2d/glowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/glowprimitive2d.cxx @@ -182,23 +182,23 @@ void GlowPrimitive2D::create2DDecomposition( if (aAlpha.IsEmpty()) return; - const Size& rBitmapExSizePixel(aAlpha.GetSizePixel()); + const Size aBitmapExSizePixel(aAlpha.GetSizePixel()); - if (rBitmapExSizePixel.Width() <= 0 || rBitmapExSizePixel.Height() <= 0) + if (aBitmapExSizePixel.Width() <= 0 || aBitmapExSizePixel.Height() <= 0) return; // We may have to take a corrective scaling into account when the // MaximumQuadraticPixel limit was used/triggered double fScale(1.0); - if (static_cast(rBitmapExSizePixel.Width()) != nDiscreteClippedWidth - || static_cast(rBitmapExSizePixel.Height()) != nDiscreteClippedHeight) + if (static_cast(aBitmapExSizePixel.Width()) != nDiscreteClippedWidth + || static_cast(aBitmapExSizePixel.Height()) != nDiscreteClippedHeight) { // scale in X and Y should be the same (see fReduceFactor in createAlphaMask), // so adapt numerically to a single scale value, they are integer rounded values - const double fScaleX(static_cast(rBitmapExSizePixel.Width()) + const double fScaleX(static_cast(aBitmapExSizePixel.Width()) / static_cast(nDiscreteClippedWidth)); - const double fScaleY(static_cast(rBitmapExSizePixel.Height()) + const double fScaleY(static_cast(aBitmapExSizePixel.Height()) / static_cast(nDiscreteClippedHeight)); fScale = (fScaleX + fScaleY) * 0.5; diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index 5de34c5440b6..c6a7a2e66707 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -224,22 +224,22 @@ void ShadowPrimitive2D::create2DDecomposition( if (aAlpha.IsEmpty()) return; - const Size& rBitmapExSizePixel(aAlpha.GetSizePixel()); - if (!(rBitmapExSizePixel.Width() > 0 && rBitmapExSizePixel.Height() > 0)) + const Size aBitmapExSizePixel(aAlpha.GetSizePixel()); + if (!(aBitmapExSizePixel.Width() > 0 && aBitmapExSizePixel.Height() > 0)) return; // We may have to take a corrective scaling into account when the // MaximumQuadraticPixel limit was used/triggered double fScale(1.0); - if (static_cast(rBitmapExSizePixel.Width()) != nDiscreteClippedWidth - || static_cast(rBitmapExSizePixel.Height()) != nDiscreteClippedHeight) + if (static_cast(aBitmapExSizePixel.Width()) != nDiscreteClippedWidth + || static_cast(aBitmapExSizePixel.Height()) != nDiscreteClippedHeight) { // scale in X and Y should be the same (see fReduceFactor in createAlphaMask), // so adapt numerically to a single scale value, they are integer rounded values - const double fScaleX(static_cast(rBitmapExSizePixel.Width()) + const double fScaleX(static_cast(aBitmapExSizePixel.Width()) / static_cast(nDiscreteClippedWidth)); - const double fScaleY(static_cast(rBitmapExSizePixel.Height()) + const double fScaleY(static_cast(aBitmapExSizePixel.Height()) / static_cast(nDiscreteClippedHeight)); fScale = (fScaleX + fScaleY) * 0.5; diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index ac51f8a9e458..1061d518d9c1 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -211,36 +211,36 @@ void TextLayouterDevice::setTextColor(const basegfx::BColor& rColor) double TextLayouterDevice::getOverlineOffset() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - double fRet = (rMetric.GetInternalLeading() / 2.0) - rMetric.GetAscent(); + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + double fRet = (aMetric.GetInternalLeading() / 2.0) - aMetric.GetAscent(); return fRet * mnFontScalingFixY; } double TextLayouterDevice::getUnderlineOffset() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - double fRet = rMetric.GetDescent() / 2.0; + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + double fRet = aMetric.GetDescent() / 2.0; return fRet * mnFontScalingFixY; } double TextLayouterDevice::getStrikeoutOffset() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - double fRet = (rMetric.GetAscent() - rMetric.GetInternalLeading()) / 3.0; + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + double fRet = (aMetric.GetAscent() - aMetric.GetInternalLeading()) / 3.0; return fRet * mnFontScalingFixY; } double TextLayouterDevice::getOverlineHeight() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - double fRet = rMetric.GetInternalLeading() / 2.5; + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + double fRet = aMetric.GetInternalLeading() / 2.5; return fRet * mnFontScalingFixY; } double TextLayouterDevice::getUnderlineHeight() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - double fRet = rMetric.GetDescent() / 4.0; + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + double fRet = aMetric.GetDescent() / 4.0; return fRet * mnFontScalingFixY; } @@ -319,14 +319,14 @@ basegfx::B2DRange TextLayouterDevice::getTextBoundRect(const OUString& rText, sa double TextLayouterDevice::getFontAscent() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - return rMetric.GetAscent() * mnFontScalingFixY; + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + return aMetric.GetAscent() * mnFontScalingFixY; } double TextLayouterDevice::getFontDescent() const { - const ::FontMetric& rMetric = mrDevice.GetFontMetric(); - return rMetric.GetDescent() * mnFontScalingFixY; + const ::FontMetric aMetric = mrDevice.GetFontMetric(); + return aMetric.GetDescent() * mnFontScalingFixY; } void TextLayouterDevice::addTextRectActions(const ::tools::Rectangle& rRectangle, diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 3b58d330e001..2c19058cd3a4 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -4042,8 +4042,8 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, case MetaActionType::MOVECLIPREGION: { const_cast(pAction)->Execute( mpVDev ); - const vcl::Region& rClipRegion = mpVDev->GetActiveClipRegion(); - ImplWriteClipPath( rClipRegion.GetAsPolyPolygon() ); + const vcl::Region aClipRegion = mpVDev->GetActiveClipRegion(); + ImplWriteClipPath( aClipRegion.GetAsPolyPolygon() ); mbClipAttrChanged = true; } diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 9724793928a5..114cce0da52c 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -312,7 +312,7 @@ IMPL_LINK_NOARG(FuncPage, SelHelpClickHdl, weld::Button&, void) { if (Help* pHelp = Application::GetHelp()) { - const OUString& sHelpId = pDesc->getHelpId(); + const OUString sHelpId = pDesc->getHelpId(); if (!sHelpId.isEmpty()) { pHelp->Start(sHelpId); diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 50c897f35b48..b4ad4485c17e 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -1064,12 +1064,12 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL ) m_xTreeView->connect_changed(Link()); // read cached data for this url and fill the tree - const ::std::vector< SvtContentEntry >& rFolders = m_xFileView->GetContent(); + const ::std::vector< SvtContentEntry > aContentFolders = m_xFileView->GetContent(); ::std::vector< std::pair< OUString, OUString > > aFolders; m_xName_ed->ClearEntries(); - for(const auto & rFolder : rFolders) + for(const auto & rFolder : aContentFolders) { //WebDAV folders path ends in '/', so strip it OUString aFolderName = rFolder.maURL; diff --git a/framework/source/accelerators/acceleratorcache.cxx b/framework/source/accelerators/acceleratorcache.cxx index c0b819a2a9e8..8f64ed330e19 100644 --- a/framework/source/accelerators/acceleratorcache.cxx +++ b/framework/source/accelerators/acceleratorcache.cxx @@ -111,8 +111,8 @@ void AcceleratorCache::removeKey(const css::awt::KeyEvent& aKey) void AcceleratorCache::removeCommand(const OUString& sCommand) { - const TKeyList& lKeys = getKeysByCommand(sCommand); - for (auto const& lKey : lKeys) + const TKeyList aKeys = getKeysByCommand(sCommand); + for (auto const& lKey : aKeys) { removeKey(lKey); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 0cab884b4017..d6bde87bc940 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -644,7 +644,7 @@ void ToolBarManager::CheckAndUpdateImages() m_eSymbolSize = eNewSymbolSize; } - const OUString& sCurrentIconTheme = SvtMiscOptions::GetIconTheme(); + const OUString sCurrentIconTheme = SvtMiscOptions::GetIconTheme(); if ( m_sIconTheme != sCurrentIconTheme ) { bRefreshImages = true; diff --git a/framework/source/xml/acceleratorconfigurationwriter.cxx b/framework/source/xml/acceleratorconfigurationwriter.cxx index 3f8b08a0e678..c36c8b6a1eb7 100644 --- a/framework/source/xml/acceleratorconfigurationwriter.cxx +++ b/framework/source/xml/acceleratorconfigurationwriter.cxx @@ -72,8 +72,8 @@ void AcceleratorConfigurationWriter::flush() AcceleratorCache::TKeyList lKeys = m_rContainer.getAllKeys(); for (auto const& lKey : lKeys) { - const OUString& rCommand = m_rContainer.getCommandByKey(lKey); - impl_ts_writeKeyCommandPair(lKey, rCommand, xExtendedCFG); + const OUString aCommand = m_rContainer.getCommandByKey(lKey); + impl_ts_writeKeyCommandPair(lKey, aCommand, xExtendedCFG); } /* TODO write key-command list