[Libreoffice-commits] core.git: drawinglayer/source editeng/source extensions/source filter/source framework/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 20 10:41:51 UTC 2019


 drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx       |    2 +-
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx       |    2 +-
 editeng/source/editeng/impedit2.cxx                               |    4 ++--
 editeng/source/editeng/impedit4.cxx                               |    2 +-
 editeng/source/items/legacyitem.cxx                               |    2 +-
 extensions/source/bibliography/datman.cxx                         |    3 ++-
 extensions/source/propctrlr/formcomponenthandler.cxx              |    4 ++--
 filter/source/graphicfilter/icgm/chart.cxx                        |    2 +-
 filter/source/msfilter/svdfppt.cxx                                |    6 +++---
 filter/source/svg/svgexport.cxx                                   |    8 ++++----
 filter/source/svg/svgfilter.cxx                                   |    2 +-
 framework/source/jobs/jobdispatch.cxx                             |    2 +-
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |    4 ++--
 framework/source/uiconfiguration/uiconfigurationmanager.cxx       |    6 +++---
 14 files changed, 25 insertions(+), 24 deletions(-)

New commits:
commit b2423a480785db6f4883d6314690b22b69d55c22
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Aug 20 09:31:26 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 20 12:40:57 2019 +0200

    loplugin:constvars in drawinglayer..framework
    
    Change-Id: I6e62229fdc38f49f766a306f5264afafe9acefa5
    Reviewed-on: https://gerrit.libreoffice.org/77774
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index f27a8cfe4f62..0289a3788ee1 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -185,7 +185,7 @@ namespace drawinglayer
                                             a2DUnitLine.append(basegfx::B2DPoint(0.0, 0.0));
                                             a2DUnitLine.append(basegfx::B2DPoint(1.0, 0.0));
 
-                                            for(basegfx::B2DHomMatrix & rMatrix : aMatrices)
+                                            for(const basegfx::B2DHomMatrix & rMatrix : aMatrices)
                                             {
                                                 basegfx::B2DPolygon aNewLine(a2DUnitLine);
                                                 aNewLine.transform(rMatrix);
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index cbcbfda8b649..c54976a998cb 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -49,7 +49,7 @@ namespace drawinglayer
         {
             basegfx::B3DRange aRetval;
 
-            for(basegfx::B3DPolyPolygon & a : rFill)
+            for(const basegfx::B3DPolyPolygon & a : rFill)
             {
                 aRetval.expand(basegfx::utils::getRange(a));
             }
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index b81fa54d3e18..b66c4fa7638f 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1720,7 +1720,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
 
         // i89825: Use CTL font for numbers embedded into an RTL run:
         WritingDirectionInfos& rDirInfos = pParaPortion->aWritingDirectionInfos;
-        for (WritingDirectionInfo & rDirInfo : rDirInfos)
+        for (const WritingDirectionInfo & rDirInfo : rDirInfos)
         {
             const sal_Int32 nStart = rDirInfo.nStartPos;
             const sal_Int32 nEnd   = rDirInfo.nEndPos;
@@ -3371,7 +3371,7 @@ void ImpEditEngine::UpdateSelections()
     {
         EditSelection aCurSel( pView->pImpEditView->GetEditSelection() );
         bool bChanged = false;
-        for (std::unique_ptr<DeletedNodeInfo> & aDeletedNode : aDeletedNodes)
+        for (const std::unique_ptr<DeletedNodeInfo> & aDeletedNode : aDeletedNodes)
         {
             const DeletedNodeInfo& rInf = *aDeletedNode;
             if ( ( aCurSel.Min().GetNode() == rInf.GetNode() ) ||
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index e254ca4c7ad8..367eb250f0a3 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2894,7 +2894,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
             if ( !pUndo && IsUndoEnabled() && !IsInUndo() )
             {
                 // adjust selection to include all changes
-                for (eeTransliterationChgData & aChange : aChanges)
+                for (const eeTransliterationChgData & aChange : aChanges)
                 {
                     const EditSelection &rSel = aChange.aSelection;
                     if (aSel.Min().GetNode() == rSel.Min().GetNode() &&
diff --git a/editeng/source/items/legacyitem.cxx b/editeng/source/items/legacyitem.cxx
index f2997f715cc3..f3a0ba2f6d0f 100644
--- a/editeng/source/items/legacyitem.cxx
+++ b/editeng/source/items/legacyitem.cxx
@@ -353,7 +353,7 @@ namespace legacy
 
             if( nItemVersion >= BOX_4DISTS_VERSION && (cLine&0x10) != 0 )
             {
-                for(SvxBoxItemLine & i : aLineMap)
+                for(const SvxBoxItemLine & i : aLineMap)
                 {
                     sal_uInt16 nDist;
                     rStrm.ReadUInt16( nDist );
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 996df17cfc38..612cc7b70893 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -567,7 +567,8 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid)
         // remove the old fields
         if ( xColContainer->hasElements() )
         {
-            for ( OUString& rName : xColContainer->getElementNames() )
+            const Sequence<OUString> aOldNames = xColContainer->getElementNames();
+            for ( const OUString& rName : aOldNames )
                 xColContainer->removeByName( rName );
         }
 
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 7a7672dfbd55..68775d5c940b 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -1695,7 +1695,7 @@ namespace pcr
 
             // propagate the changes to the min/max/default fields
             OUString aAffectedProps[] = { OUString(PROPERTY_VALUE), OUString(PROPERTY_DEFAULT_VALUE), OUString(PROPERTY_VALUEMIN), OUString(PROPERTY_VALUEMAX) };
-            for (OUString & aAffectedProp : aAffectedProps)
+            for (const OUString & aAffectedProp : aAffectedProps)
             {
                 Reference< XPropertyControl > xControl;
                 try
@@ -1743,7 +1743,7 @@ namespace pcr
                 OUString aFormattedPropertyControls[] = {
                     OUString(PROPERTY_EFFECTIVE_MIN), OUString(PROPERTY_EFFECTIVE_MAX), OUString(PROPERTY_EFFECTIVE_DEFAULT), OUString(PROPERTY_EFFECTIVE_VALUE)
                 };
-                for (OUString & aFormattedPropertyControl : aFormattedPropertyControls)
+                for (const OUString & aFormattedPropertyControl : aFormattedPropertyControls)
                 {
                     Reference< XPropertyControl > xControl;
                     try
diff --git a/filter/source/graphicfilter/icgm/chart.cxx b/filter/source/graphicfilter/icgm/chart.cxx
index afd39f69e556..845fab4e0d77 100644
--- a/filter/source/graphicfilter/icgm/chart.cxx
+++ b/filter/source/graphicfilter/icgm/chart.cxx
@@ -33,7 +33,7 @@ CGMChart::CGMChart()
 CGMChart::~CGMChart()
 {
     // delete the whole textentry structure
-    for (auto & pTextEntry : maTextEntryList)
+    for (const auto & pTextEntry : maTextEntryList)
     {
         if ( pTextEntry )
             delete pTextEntry->pText;
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index d46cd49eb04a..c9b2e05fd6c2 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -6379,7 +6379,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet,  boost::optional< sal_Int16 >&
 sal_uInt32 PPTParagraphObj::GetTextSize()
 {
     sal_uInt32 nCount, nRetValue = 0;
-    for (std::unique_ptr<PPTPortionObj> & i : m_PortionList)
+    for (const std::unique_ptr<PPTPortionObj> & i : m_PortionList)
     {
         PPTPortionObj const& rPortionObj = *i;
         nCount = rPortionObj.Count();
@@ -6694,7 +6694,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                         &(rSdrPowerPointImport.pPPTStyleSheet->maTxSI) ) )
                                 {
                                     size_t nI = 0;
-                                    for (PPTTextSpecInfo& rSpecInfo : aTextSpecInfoAtomInterpreter.aList)
+                                    for (const PPTTextSpecInfo& rSpecInfo : aTextSpecInfoAtomInterpreter.aList)
                                     {
                                         sal_uInt32 nCharIdx = rSpecInfo.nCharIdx;
 
@@ -6870,7 +6870,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
                                         {
                                             PptInteractiveInfoAtom aInteractiveInfoAtom;
                                             ReadPptInteractiveInfoAtom( rIn, aInteractiveInfoAtom );
-                                            for (SdHyperlinkEntry& rHyperlink : rSdrPowerPointImport.aHyperList)
+                                            for (const SdHyperlinkEntry& rHyperlink : rSdrPowerPointImport.aHyperList)
                                             {
                                                 if ( rHyperlink.nIndex == aInteractiveInfoAtom.nExHyperlinkId )
                                                 {
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 451b94769e14..cce3c3abd45d 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -568,11 +568,11 @@ bool SVGFilter::implExportImpressOrDraw( const Reference< XOutputStream >& rxOSt
                 Reference< XInterface > xSVGExport = static_cast< css::document::XFilter* >( mpSVGExport );
 
                 // create an id for each draw page
-                for( auto& rPage : mSelectedPages )
+                for( const auto& rPage : mSelectedPages )
                     implRegisterInterface( rPage );
 
                 // create an id for each master page
-                for(uno::Reference<drawing::XDrawPage> & mMasterPageTarget : mMasterPageTargets)
+                for(const uno::Reference<drawing::XDrawPage> & mMasterPageTarget : mMasterPageTargets)
                     implRegisterInterface( mMasterPageTarget );
 
                 SdrModel* pSdrModel(nullptr);
@@ -1237,7 +1237,7 @@ void SVGFilter::implGenerateMetaData()
                 }
                 if( mpSVGExport->IsEmbedFonts() && mpSVGExport->IsUsePositionedCharacters() )
                 {
-                    for(std::unique_ptr<TextField>& i : aFieldSet)
+                    for(const std::unique_ptr<TextField>& i : aFieldSet)
                     {
                         i->growCharSet( mTextFieldCharSets );
                     }
@@ -1256,7 +1256,7 @@ void SVGFilter::implExportAnimations()
     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", "presentation-animations" );
     SvXMLElementExport aDefsContainerElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
 
-    for(uno::Reference<drawing::XDrawPage> & mSelectedPage : mSelectedPages)
+    for(const uno::Reference<drawing::XDrawPage> & mSelectedPage : mSelectedPages)
     {
         Reference< XPropertySet > xProps( mSelectedPage, UNO_QUERY );
 
diff --git a/filter/source/svg/svgfilter.cxx b/filter/source/svg/svgfilter.cxx
index 3e0e24e9af2c..7fccc61ecb55 100644
--- a/filter/source/svg/svgfilter.cxx
+++ b/filter/source/svg/svgfilter.cxx
@@ -522,7 +522,7 @@ bool SVGFilter::filterImpressOrDraw( const Sequence< PropertyValue >& rDescripto
              *  The master page are put in an unordered set.
              */
             ObjectSet aMasterPageTargetSet;
-            for(uno::Reference<drawing::XDrawPage> & mSelectedPage : mSelectedPages)
+            for(const uno::Reference<drawing::XDrawPage> & mSelectedPage : mSelectedPages)
             {
                 uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( mSelectedPage, uno::UNO_QUERY );
                 if( xMasterPageTarget.is() )
diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx
index 0407f05591d3..2af4ea2b2c80 100644
--- a/framework/source/jobs/jobdispatch.cxx
+++ b/framework/source/jobs/jobdispatch.cxx
@@ -318,7 +318,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString&
     // It's not really an error, if no registered jobs could be located.
     // Step over all found jobs and execute it
     int nExecutedJobs=0;
-    for (OUString & lJob : lJobs)
+    for (const OUString & lJob : lJobs)
     {
         /* SAFE { */
         aReadLock.reset();
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 305cc8c08300..b629dbaefca3 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -1528,9 +1528,9 @@ void SAL_CALL ModuleUIConfigurationManager::reload()
         aGuard.clear();
 
         // Notify our listeners
-        for (ui::ConfigurationEvent & j : aRemoveNotifyContainer)
+        for (const ui::ConfigurationEvent & j : aRemoveNotifyContainer)
             implts_notifyContainerListener( j, NotifyOp_Remove );
-        for (ui::ConfigurationEvent & k : aReplaceNotifyContainer)
+        for (const ui::ConfigurationEvent & k : aReplaceNotifyContainer)
             implts_notifyContainerListener( k, NotifyOp_Replace );
     }
 }
diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index ef8015660cdb..01dcf13246c1 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -812,7 +812,7 @@ void SAL_CALL UIConfigurationManager::reset()
             aGuard.clear();
 
             // Notify our listeners
-            for (ConfigurationEvent & k : aRemoveEventNotifyContainer)
+            for (const ConfigurationEvent & k : aRemoveEventNotifyContainer)
                 implts_notifyContainerListener( k, NotifyOp_Remove );
         }
         catch ( const css::lang::IllegalArgumentException& )
@@ -1253,9 +1253,9 @@ void SAL_CALL UIConfigurationManager::reload()
         aGuard.clear();
 
         // Notify our listeners
-        for (ConfigurationEvent & j : aRemoveNotifyContainer)
+        for (const ConfigurationEvent & j : aRemoveNotifyContainer)
             implts_notifyContainerListener( j, NotifyOp_Remove );
-        for (ConfigurationEvent & k : aReplaceNotifyContainer)
+        for (const ConfigurationEvent & k : aReplaceNotifyContainer)
             implts_notifyContainerListener( k, NotifyOp_Replace );
     }
 }


More information about the Libreoffice-commits mailing list