summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2025-03-20 08:14:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2025-03-20 16:43:56 +0100
commitdfe21d378722e90218f2b97cea5c7a449d00b48c (patch)
tree65cd6e8ce78ef12b48d84926c0d20239599f6c03 /oox/source
parent76c2a523c6ab19bdaed2b4ad068348b9376d9c59 (diff)
loplugin:constparam in oox
Change-Id: Iadec18cc82fd3fa8fb129698be92fed4ec2fbb1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183144 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/connectorhelper.cxx2
-rw-r--r--oox/source/drawingml/connectorshapecontext.cxx2
-rw-r--r--oox/source/drawingml/diagram/diagram.hxx2
-rw-r--r--oox/source/drawingml/diagram/diagramhelper.cxx2
-rw-r--r--oox/source/drawingml/diagram/diagramhelper.hxx2
-rw-r--r--oox/source/drawingml/fontworkhelpers.cxx10
-rw-r--r--oox/source/export/drawingml.cxx8
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx2
-rw-r--r--oox/source/ppt/slidepersist.cxx8
-rw-r--r--oox/source/shape/WordprocessingCanvasContext.cxx2
-rw-r--r--oox/source/shape/WordprocessingCanvasContext.hxx2
-rw-r--r--oox/source/shape/WpsContext.cxx2
12 files changed, 23 insertions, 21 deletions
diff --git a/oox/source/drawingml/connectorhelper.cxx b/oox/source/drawingml/connectorhelper.cxx
index 0a529b56a03c..e2f30e787c21 100644
--- a/oox/source/drawingml/connectorhelper.cxx
+++ b/oox/source/drawingml/connectorhelper.cxx
@@ -290,7 +290,7 @@ void ConnectorHelper::getLOCurvedHandlePositionsHmm(
}
}
-void ConnectorHelper::applyConnections(oox::drawingml::ShapePtr& pConnector,
+void ConnectorHelper::applyConnections(const oox::drawingml::ShapePtr& pConnector,
oox::drawingml::ShapeIdMap& rShapeMap)
{
uno::Reference<drawing::XShape> xConnector(pConnector->getXShape());
diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx
index 62c7a245e87b..9b3fd6733aa4 100644
--- a/oox/source/drawingml/connectorshapecontext.cxx
+++ b/oox/source/drawingml/connectorshapecontext.cxx
@@ -33,7 +33,7 @@ using namespace ::com::sun::star;
namespace oox::drawingml {
ConnectorShapePropertiesContext::ConnectorShapePropertiesContext(
- ContextHandler2Helper const& rParent, ShapePtr& pShapePtr,
+ ContextHandler2Helper const& rParent, const ShapePtr& pShapePtr,
std::vector<ConnectorShapeProperties>& rConnectorShapePropertiesList)
: ContextHandler2(rParent)
, mrConnectorShapePropertiesList(rConnectorShapePropertiesList)
diff --git a/oox/source/drawingml/diagram/diagram.hxx b/oox/source/drawingml/diagram/diagram.hxx
index 5eb82069b91b..0a1a59336da9 100644
--- a/oox/source/drawingml/diagram/diagram.hxx
+++ b/oox/source/drawingml/diagram/diagram.hxx
@@ -129,7 +129,7 @@ class Diagram
{
public:
explicit Diagram();
- void setData( OoxDiagramDataPtr& pData )
+ void setData( const OoxDiagramDataPtr& pData )
{ mpData = pData; }
const OoxDiagramDataPtr& getData() const
{ return mpData; }
diff --git a/oox/source/drawingml/diagram/diagramhelper.cxx b/oox/source/drawingml/diagram/diagramhelper.cxx
index 327524b655fa..cfd0b45b790f 100644
--- a/oox/source/drawingml/diagram/diagramhelper.cxx
+++ b/oox/source/drawingml/diagram/diagramhelper.cxx
@@ -251,7 +251,7 @@ void AdvancedDiagramHelper::doAnchor(SdrObjGroup& rTarget, ::oox::drawingml::Sha
}
const std::shared_ptr< ::oox::drawingml::Theme >& AdvancedDiagramHelper::getOrCreateThemePtr(
- rtl::Reference< oox::shape::ShapeFilterBase >& rxFilter) const
+ const rtl::Reference< oox::shape::ShapeFilterBase >& rxFilter) const
{
// (Re-)Use already existing Theme if existing/imported if possible.
// If not, re-import Theme if data is available and thus possible
diff --git a/oox/source/drawingml/diagram/diagramhelper.hxx b/oox/source/drawingml/diagram/diagramhelper.hxx
index 86a83926ec25..09ce59845264 100644
--- a/oox/source/drawingml/diagram/diagramhelper.hxx
+++ b/oox/source/drawingml/diagram/diagramhelper.hxx
@@ -85,7 +85,7 @@ public:
void doAnchor(SdrObjGroup& rTarget, ::oox::drawingml::Shape& rRootShape);
const std::shared_ptr< ::oox::drawingml::Theme >& getOrCreateThemePtr(
- rtl::Reference< oox::shape::ShapeFilterBase>& rxFilter ) const;
+ const rtl::Reference< oox::shape::ShapeFilterBase>& rxFilter ) const;
};
}
diff --git a/oox/source/drawingml/fontworkhelpers.cxx b/oox/source/drawingml/fontworkhelpers.cxx
index 565f6b6c7b88..c37bad867b48 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -867,7 +867,7 @@ void FontworkHelpers::collectCharColorProps(const uno::Reference<text::XText>& r
}
void FontworkHelpers::applyPropsToRuns(const std::vector<beans::PropertyValue>& rTextPropVec,
- uno::Reference<text::XText>& rXText)
+ const uno::Reference<text::XText>& rXText)
{
if (!rXText.is())
return;
@@ -1092,8 +1092,9 @@ bool lcl_getThemeColorTransformationValue(const model::ComplexColor& rComplexCol
// Adds the child elements 'lumMod' and 'lumOff' to 'schemeClr' maCurrentElement of pGrabStack,
// if such exist in rComplexColor. 'alpha' is contained in the maTransformations of rComplexColor
// in case of gradient fill.
-void lcl_addColorTransformationToGrabBagStack(const model::ComplexColor& rComplexColor,
- std::unique_ptr<oox::GrabBagStack>& pGrabBagStack)
+void lcl_addColorTransformationToGrabBagStack(
+ const model::ComplexColor& rComplexColor,
+ const std::unique_ptr<oox::GrabBagStack>& pGrabBagStack)
{
if (pGrabBagStack == nullptr)
return;
@@ -1624,7 +1625,8 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
}
void FontworkHelpers::applyUpdatesToCharInteropGrabBag(
- const std::vector<beans::PropertyValue>& rUpdatePropVec, uno::Reference<text::XText>& rXText)
+ const std::vector<beans::PropertyValue>& rUpdatePropVec,
+ const uno::Reference<text::XText>& rXText)
{
if (!rXText.is())
return;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 77baafbe755d..6f9905a4c612 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2427,7 +2427,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
bFlipHWrite, bFlipVWrite, ExportRotateClockwisify(nRotation + nCameraRotation), IsGroupShape( rXShape ));
}
-static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xModel, OUString& rURL)
+static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xModel, std::u16string_view rURL)
{
Reference<drawing::XDrawPagesSupplier> xDPS(xModel, uno::UNO_QUERY_THROW);
Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
@@ -2450,9 +2450,9 @@ static OUString lcl_GetTarget(const css::uno::Reference<css::frame::XModel>& xMo
}
if (sTarget.isEmpty())
{
- sal_Int32 nSplit = rURL.lastIndexOf(' ');
- if (nSplit > -1)
- sTarget = OUString::Concat("slide") + rURL.subView(nSplit + 1) + ".xml";
+ size_t nSplit = rURL.rfind(' ');
+ if (nSplit != std::u16string_view::npos)
+ sTarget = OUString::Concat("slide") + rURL.substr(nSplit + 1) + ".xml";
}
return sTarget;
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 3266e9945bde..180cd7128867 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -126,7 +126,7 @@ PresentationFragmentHandler::~PresentationFragmentHandler() noexcept
{
}
-void PresentationFragmentHandler::importSlideNames(XmlFilterBase& rFilter, const std::vector<SlidePersistPtr>& rSlidePersist)
+void PresentationFragmentHandler::importSlideNames(const XmlFilterBase& rFilter, const std::vector<SlidePersistPtr>& rSlidePersist)
{
sal_Int32 nMaxPages = rSlidePersist.size();
for (sal_Int32 nPage = 0; nPage < nMaxPages; nPage++)
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 446b7d5623a2..847ab5f2ab97 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -390,7 +390,7 @@ void SlidePersist::hideShapesAsMasterShapes()
}
// This angle determines in the direction of the line
-static sal_Int32 lcl_GetAngle(uno::Reference<drawing::XShape>& rXShape, awt::Point& rPt)
+static sal_Int32 lcl_GetAngle(const uno::Reference<drawing::XShape>& rXShape, const awt::Point& rPt)
{
SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape);
tools::Rectangle aR(pObj->GetSnapRect());
@@ -429,8 +429,8 @@ Reference<XAnimationNode> SlidePersist::getAnimationNode(const OUString& sId) co
return aResult;
}
-static void lcl_SetEdgeLineValue(uno::Reference<drawing::XShape>& rXConnector,
- oox::drawingml::ShapePtr& rShapePtr)
+static void lcl_SetEdgeLineValue(const uno::Reference<drawing::XShape>& rXConnector,
+ const oox::drawingml::ShapePtr& rShapePtr)
{
sal_Int32 nEdge = 0;
awt::Point aStartPt, aEndPt;
@@ -517,7 +517,7 @@ static void lcl_SetEdgeLineValue(uno::Reference<drawing::XShape>& rXConnector,
}
// create connection between two shape with a connector shape.
-void SlidePersist::createConnectorShapeConnection(oox::drawingml::ShapePtr& pConnector)
+void SlidePersist::createConnectorShapeConnection(const oox::drawingml::ShapePtr& pConnector)
{
oox::drawingml::ConnectorShapePropertiesList aConnectorShapeProperties
= pConnector->getConnectorShapeProperties();
diff --git a/oox/source/shape/WordprocessingCanvasContext.cxx b/oox/source/shape/WordprocessingCanvasContext.cxx
index b03886441d6a..5ec1af292869 100644
--- a/oox/source/shape/WordprocessingCanvasContext.cxx
+++ b/oox/source/shape/WordprocessingCanvasContext.cxx
@@ -32,7 +32,7 @@ using namespace com::sun::star;
namespace oox::shape
{
WordprocessingCanvasContext::WordprocessingCanvasContext(FragmentHandler2 const& rParent,
- css::awt::Size& rSize)
+ const css::awt::Size& rSize)
: FragmentHandler2(rParent)
, m_bFullWPGSupport(true)
{
diff --git a/oox/source/shape/WordprocessingCanvasContext.hxx b/oox/source/shape/WordprocessingCanvasContext.hxx
index ffc6a84aeed5..105a83cfcb60 100644
--- a/oox/source/shape/WordprocessingCanvasContext.hxx
+++ b/oox/source/shape/WordprocessingCanvasContext.hxx
@@ -20,7 +20,7 @@ class WordprocessingCanvasContext final : public oox::core::FragmentHandler2
public:
// mpShapePtr points to the root of the group. rSize is the size of the background shape.
explicit WordprocessingCanvasContext(oox::core::FragmentHandler2 const& rParent,
- css::awt::Size& rSize);
+ const css::awt::Size& rSize);
~WordprocessingCanvasContext() override;
oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElementToken,
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 56abef55fcc1..c60e3d8971c3 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -503,7 +503,7 @@ void lcl_setTextPropsToShape(const uno::Reference<beans::XPropertySet>& xShapePr
}
}
-void lcl_applyUsedTextPropsToAllTextRuns(uno::Reference<text::XText>& xText,
+void lcl_applyUsedTextPropsToAllTextRuns(const uno::Reference<text::XText>& xText,
const std::vector<beans::PropertyValue>& aTextPropVec)
{
if (!xText.is())