loplugin:reftotemp in libreofficekit..oox

Change-Id: I62d868f70e33850fa933c8f413f824a523422499
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176400
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin 2024-11-11 13:49:53 +02:00
parent 9ce6abe3d4
commit 69089f1737
14 changed files with 50 additions and 51 deletions

View file

@ -1130,7 +1130,7 @@ callback (gpointer pData)
std::stringstream aStream(pCallback->m_aPayload);
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
const std::string& rRectangle = aTree.get<std::string>("rectangle");
const std::string rRectangle = aTree.get<std::string>("rectangle");
int nViewId = aTree.get<int>("viewId");
priv->m_aVisibleCursor = payloadToRectangle(pDocView, rRectangle.c_str());
@ -1211,7 +1211,7 @@ callback (gpointer pData)
boost::property_tree::read_json(aStream, aTree);
int nViewId = aTree.get<int>("viewId");
int nPart = aTree.get<int>("part");
const std::string& rRectangle = aTree.get<std::string>("selection");
const std::string rRectangle = aTree.get<std::string>("selection");
if (rRectangle != "EMPTY")
priv->m_aGraphicViewSelections[nViewId] = ViewRectangle(nPart, payloadToRectangle(pDocView, rRectangle.c_str()));
else
@ -1295,7 +1295,7 @@ callback (gpointer pData)
boost::property_tree::read_json(aStream, aTree);
int nViewId = aTree.get<int>("viewId");
int nPart = aTree.get<int>("part");
const std::string& rRectangle = aTree.get<std::string>("rectangle");
const std::string rRectangle = aTree.get<std::string>("rectangle");
priv->m_aViewCursors[nViewId] = ViewRectangle(nPart, payloadToRectangle(pDocView, rRectangle.c_str()));
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
break;
@ -1307,7 +1307,7 @@ callback (gpointer pData)
boost::property_tree::read_json(aStream, aTree);
int nViewId = aTree.get<int>("viewId");
int nPart = aTree.get<int>("part");
const std::string& rSelection = aTree.get<std::string>("selection");
const std::string rSelection = aTree.get<std::string>("selection");
priv->m_aTextViewSelectionRectangles[nViewId] = ViewRectangles(nPart, payloadToRectangles(pDocView, rSelection.c_str()));
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
break;
@ -1318,7 +1318,7 @@ callback (gpointer pData)
boost::property_tree::ptree aTree;
boost::property_tree::read_json(aStream, aTree);
int nViewId = aTree.get<int>("viewId");
const std::string& rVisible = aTree.get<std::string>("visible");
const std::string rVisible = aTree.get<std::string>("visible");
priv->m_aViewCursorVisibilities[nViewId] = rVisible == "true";
gtk_widget_queue_draw(GTK_WIDGET(pDocView));
break;
@ -1331,7 +1331,7 @@ callback (gpointer pData)
boost::property_tree::read_json(aStream, aTree);
int nViewId = aTree.get<int>("viewId");
int nPart = aTree.get<int>("part");
const std::string& rRectangle = aTree.get<std::string>("rectangle");
const std::string rRectangle = aTree.get<std::string>("rectangle");
if (rRectangle != "EMPTY")
priv->m_aCellViewCursors[nViewId] = ViewRectangle(nPart, payloadToRectangle(pDocView, rRectangle.c_str()));
else
@ -1350,7 +1350,7 @@ callback (gpointer pData)
boost::property_tree::read_json(aStream, aTree);
int nViewId = aTree.get<int>("viewId");
int nPart = aTree.get<int>("part");
const std::string& rRectangle = aTree.get<std::string>("rectangle");
const std::string rRectangle = aTree.get<std::string>("rectangle");
if (rRectangle != "EMPTY")
priv->m_aViewLockRectangles[nViewId] = ViewRectangle(nPart, payloadToRectangle(pDocView, rRectangle.c_str()));
else
@ -1762,7 +1762,7 @@ static const GdkRGBA& getDarkColor(int nViewId, LOKDocViewPrivate& priv)
boost::property_tree::read_json(aStream, aTree);
for (const auto& rValue : aTree.get_child("authors"))
{
const std::string& rName = rValue.second.get<std::string>("name");
const std::string rName = rValue.second.get<std::string>("name");
guint32 nColor = rValue.second.get<guint32>("color");
GdkRGBA aColor{static_cast<double>(static_cast<guint8>(nColor>>16))/255, static_cast<double>(static_cast<guint8>(static_cast<guint16>(nColor) >> 8))/255, static_cast<double>(static_cast<guint8>(nColor))/255, 0};
auto itAuthorViews = g_aAuthorViews.find(rName);

View file

@ -550,7 +550,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC
m_bGCServicesChecked = true;
}
if (const auto& [aSvcImplName, oFallbackBcp47] = getServiceForLocale(rLocale);
if (const auto [aSvcImplName, oFallbackBcp47] = getServiceForLocale(rLocale);
!aSvcImplName.isEmpty()) // matching configured language found?
{
if (oFallbackBcp47)

View file

@ -83,19 +83,19 @@ void ProposalList::Append( const OUString &rOrig, bool bPrepend )
{
bool bFound = false;
// convert ASCII apostrophe to the typographic one
const OUString &rText( rOrig.indexOf( '\'' ) > -1 ? rOrig.replace('\'', u'') : rOrig );
const OUString aText( rOrig.indexOf( '\'' ) > -1 ? rOrig.replace('\'', u'') : rOrig );
size_t nCnt = aVec.size();
for (size_t i = 0; !bFound && i < nCnt; ++i)
{
if (aVec[i] == rText)
if (aVec[i] == aText)
bFound = true;
}
if (!bFound)
{
if ( bPrepend )
aVec.insert( aVec.begin(), rText );
aVec.insert( aVec.begin(), aText );
else
aVec.push_back( rText );
aVec.push_back( aText );
}
}

View file

@ -353,11 +353,11 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat
{
oaCellRange = pLabelSource->mxDataSeq->maFormula;
const auto& rLabelMap = pLabelSource->mxDataSeq->maData;
const auto& rKV = rLabelMap.find(mrModel.mnIndex);
if (rKV != rLabelMap.end())
const auto aKV = rLabelMap.find(mrModel.mnIndex);
if (aKV != rLabelMap.end())
{
oaLabelText.emplace();
rKV->second >>= *oaLabelText;
aKV->second >>= *oaLabelText;
}
}
}

View file

@ -316,7 +316,7 @@ void ConnectorHelper::applyConnections(oox::drawingml::ShapePtr& pConnector,
// It contains maximal two items, each a struct with mbStartShape, maDestShapeId, mnDestGlueId
for (const auto& aIt : aConnectorShapeProperties)
{
const auto& pItem = rShapeMap.find(aIt.maDestShapeId);
const auto pItem = rShapeMap.find(aIt.maDestShapeId);
if (pItem == rShapeMap.end())
continue;

View file

@ -89,7 +89,7 @@ Reference< XGraphic > lclRotateGraphic(uno::Reference<graphic::XGraphic> const &
assert (aGraphic.GetType() == GraphicType::Bitmap);
BitmapEx aBitmapEx(aGraphic.GetBitmapEx());
const ::Color& aColor = ::Color(0x00);
const ::Color aColor(0x00);
aBitmapEx.Rotate(nRotation, aColor);
aReturnGraphic = ::Graphic(aBitmapEx);
aReturnGraphic.setOriginURL(aGraphic.getOriginURL());

View file

@ -1811,7 +1811,7 @@ Reference< XShape > const & Shape::createAndInsert(
tools::Rectangle aArea{};
pTableShape->LayoutTableHeight(aArea);
sal_Int32 nCorrectedHeight = aArea.GetHeight();
const auto& aShapeSize = mxShape->getSize();
const auto aShapeSize = mxShape->getSize();
if( nCorrectedHeight > aShapeSize.Height )
mxShape->setSize( {aShapeSize.Width, nCorrectedHeight} );
pTableShape->SetSkipChangeLayout(false);

View file

@ -556,10 +556,10 @@ void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, cons
}
if (aBgColor.isUsed())
{
const Color& rCellColor = aFillProperties.getBestSolidColor();
const double fTransparency = rCellColor.isUsed() ? 0.01 * rCellColor.getTransparency() : 1.0;
const Color aCellColor = aFillProperties.getBestSolidColor();
const double fTransparency = aCellColor.isUsed() ? 0.01 * aCellColor.getTransparency() : 1.0;
::Color nBgColor( aBgColor.getColor(rFilterBase.getGraphicHelper(), nPhClr) );
::Color nCellColor( rCellColor.getColor(rFilterBase.getGraphicHelper()) );
::Color nCellColor( aCellColor.getColor(rFilterBase.getGraphicHelper()) );
::Color aResult( basegfx::interpolate(nBgColor.getBColor(), nCellColor.getBColor(), 1.0 - fTransparency) );
aFillProperties.maFillColor.clearTransformations();
aFillProperties.maFillColor.setSrgbClr(sal_Int32(aResult.GetRGBColor()));

View file

@ -221,7 +221,7 @@ bool DMLPresetShapeExporter::WriteShape()
if (!m_bHasHandleValues)
{
OUString sShapeType = GetShapeType();
const OString& sPresetShape = msfilter::util::GetOOXMLPresetGeometry(sShapeType);
const OString sPresetShape = msfilter::util::GetOOXMLPresetGeometry(sShapeType);
m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(),
false, false);
m_pDMLexporter->WritePresetShape(sPresetShape);
@ -252,8 +252,8 @@ bool DMLPresetShapeExporter::StartAVListWriting()
{
try
{
const OString& pShape = msfilter::util::GetOOXMLPresetGeometry(GetShapeType());
m_pDMLexporter->GetFS()->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape);
const OString aShape = msfilter::util::GetOOXMLPresetGeometry(GetShapeType());
m_pDMLexporter->GetFS()->startElementNS(XML_a, XML_prstGeom, XML_prst, aShape);
m_pDMLexporter->GetFS()->startElementNS(XML_a, XML_avLst);
return true;
}

View file

@ -1433,16 +1433,16 @@ void GraphicExport::writeBlip(Graphic const& rGraphic, std::vector<model::BlipEf
OUString GraphicExport::writeNewEntryToStorage(const Graphic& rGraphic, bool bRelPathToMedia)
{
GfxLink const& rLink = rGraphic.GetGfxLink();
GfxLink const aLink = rGraphic.GetGfxLink();
OUString sMediaType;
OUString aExtension;
SvMemoryStream aStream;
const void* aData = rLink.GetData();
std::size_t nDataSize = rLink.GetDataSize();
const void* aData = aLink.GetData();
std::size_t nDataSize = aLink.GetDataSize();
switch (rLink.GetType())
switch (aLink.GetType())
{
case GfxLinkType::NativeGif:
sMediaType = u"image/gif"_ustr;
@ -1559,12 +1559,12 @@ OUString GraphicExport::writeNewSvgEntryToStorage(const Graphic& rGraphic, bool
OUString sMediaType = u"image/svg"_ustr;
OUString aExtension = u"svg"_ustr;
GfxLink const& rLink = rGraphic.GetGfxLink();
if (rLink.GetType() != GfxLinkType::NativeSvg)
GfxLink const aLink = rGraphic.GetGfxLink();
if (aLink.GetType() != GfxLinkType::NativeSvg)
return OUString();
const void* aData = rLink.GetData();
std::size_t nDataSize = rLink.GetDataSize();
const void* aData = aLink.GetData();
std::size_t nDataSize = aLink.GetDataSize();
GraphicExportCache& rGraphicExportCache = GraphicExportCache::get();
auto sImageCountString = OUString::number(rGraphicExportCache.nextImageCount());
@ -2013,8 +2013,8 @@ void DrawingML::WriteSrcRectXGraphic(uno::Reference<beans::XPropertySet> const &
{
Graphic aGraphic(rxGraphic);
Size aOriginalSize = aGraphic.GetPrefSize();
const MapMode& rMapMode = aGraphic.GetPrefMapMode();
WriteGraphicCropProperties(rxPropertySet, aOriginalSize, rMapMode);
const MapMode aMapMode = aGraphic.GetPrefMapMode();
WriteGraphicCropProperties(rxPropertySet, aOriginalSize, aMapMode);
}
void DrawingML::WriteXGraphicStretch(uno::Reference<beans::XPropertySet> const & rXPropSet,
@ -2103,9 +2103,9 @@ void DrawingML::WriteXGraphicTile(uno::Reference<beans::XPropertySet> const& rXP
{
Graphic aGraphic(rxGraphic);
Size aOriginalSize(aGraphic.GetPrefSize());
const MapMode& rMapMode = aGraphic.GetPrefMapMode();
const MapMode aMapMode = aGraphic.GetPrefMapMode();
// if the original size is in pixel, convert it to mm100
if (rMapMode.GetMapUnit() == MapUnit::MapPixel)
if (aMapMode.GetMapUnit() == MapUnit::MapPixel)
aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize,
MapMode(MapUnit::Map100thMM));
sal_Int32 nSizeX = 0;
@ -2182,9 +2182,9 @@ void DrawingML::WriteXGraphicCustomPosition(uno::Reference<beans::XPropertySet>
{
Graphic aGraphic(rxGraphic);
Size aOriginalSize(aGraphic.GetPrefSize());
const MapMode& rMapMode = aGraphic.GetPrefMapMode();
const MapMode aMapMode = aGraphic.GetPrefMapMode();
// if the original size is in pixel, convert it to mm100
if (rMapMode.GetMapUnit() == MapUnit::MapPixel)
if (aMapMode.GetMapUnit() == MapUnit::MapPixel)
aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize,
MapMode(MapUnit::Map100thMM));
double nSizeX = 0;
@ -3497,8 +3497,8 @@ bool DrawingML::WriteParagraphProperties(const Reference<XTextContent>& rParagra
if (nLevel > -1)
{
Reference< XIndexAccess > xNumberingRules(rXPropSet->getPropertyValue(u"NumberingRules"_ustr), UNO_QUERY);
const PropertyValues& rNumRuleOfLevel = xNumberingRules->getByIndex(nLevel).get<PropertyValues>();
for (const PropertyValue& rRule : rNumRuleOfLevel)
const PropertyValues aNumRuleOfLevel = xNumberingRules->getByIndex(nLevel).get<PropertyValues>();
for (const PropertyValue& rRule : aNumRuleOfLevel)
if (rRule.Name == "NumberingType" && rRule.Value.hasValue())
bNumberingOnThisLevel = rRule.Value.get<sal_uInt16>() != style::NumberingType::NUMBER_NONE;
}

View file

@ -263,15 +263,15 @@ void PPTShape::addShape(
case XML_ftr :
if (IsPlaceHolderCandidate(rSlidePersist))
{
const OUString& rFooterText = getTextBody()->toString();
const OUString aFooterText = getTextBody()->toString();
if( !rFooterText.isEmpty() )
if( !aFooterText.isEmpty() )
{
// if it is possible to get the footer as a property the LO way,
// get it and discard the shape
Reference< XPropertySet > xPropertySet( rSlidePersist.getPage(), UNO_QUERY );
xPropertySet->setPropertyValue( u"IsFooterVisible"_ustr, Any( true ) );
xPropertySet->setPropertyValue( u"FooterText"_ustr, Any(rFooterText) );
xPropertySet->setPropertyValue( u"FooterText"_ustr, Any(aFooterText) );
return;
}
}

View file

@ -335,10 +335,9 @@ void PresentationFragmentHandler::saveThemeToGrabBag(const oox::drawingml::Theme
::Color nColor;
rClrScheme.getColor(nToken, nColor);
const uno::Any& rColor = uno::Any(nColor);
pCurrentTheme[nId].Name = sName;
pCurrentTheme[nId].Value = rColor;
pCurrentTheme[nId].Value <<= nColor;
}

View file

@ -177,7 +177,7 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase )
{
pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() );
const auto& pIter = maShapeMap.find(pPPTShape->getId());
const auto pIter = maShapeMap.find(pPPTShape->getId());
if (pIter != maShapeMap.end())
lcl_createShapeMap(pIter->second, aConnectorShapeMap);
}
@ -421,7 +421,7 @@ static sal_Int32 lcl_GetAngle(uno::Reference<drawing::XShape>& rXShape, awt::Poi
Reference<XAnimationNode> SlidePersist::getAnimationNode(const OUString& sId) const
{
const auto& pIter = maAnimNodesMap.find(sId);
const auto pIter = maAnimNodesMap.find(sId);
if (pIter != maAnimNodesMap.end())
return pIter->second;
@ -530,7 +530,7 @@ void SlidePersist::createConnectorShapeConnection(oox::drawingml::ShapePtr& pCon
for (sal_Int32 j = 0; j < nCount; j++)
{
OUString aDestShapeId = aConnectorShapeProperties[j].maDestShapeId;
const auto& pShape = maShapeMap.find(aDestShapeId);
const auto pShape = maShapeMap.find(aDestShapeId);
if (pShape == maShapeMap.end())
continue;
uno::Reference<drawing::XShape> xShape(pShape->second->getXShape(), uno::UNO_QUERY);

View file

@ -935,11 +935,11 @@ Reference<XShape> SimpleShape::finalImplConvertAndInsert(const css::uno::Referen
&& !maShapeModel.mbInGroup)
{
const GraphicHelper& rGraphicHelper = mrDrawing.getFilter().getGraphicHelper();
const auto& nLeft = ConversionHelper::decodeMeasureToHmm(
const auto nLeft = ConversionHelper::decodeMeasureToHmm(
rGraphicHelper, maTypeModel.maMarginLeft, 0, true, true);
PropertySet aPropertySet(rxShape);
aPropertySet.setProperty(PROP_HoriOrientPosition, nLeft);
const auto& nTop = ConversionHelper::decodeMeasureToHmm(
const auto nTop = ConversionHelper::decodeMeasureToHmm(
rGraphicHelper, maTypeModel.maMarginTop, 0, true, true);
aPropertySet.setProperty(PROP_VertOrientPosition, nTop);
aPropertySet.setProperty(PROP_TextBox, true);