diff options
Diffstat (limited to 'sfx2')
34 files changed, 54 insertions, 52 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 1c778623b51f..fde6a67522d3 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -866,7 +866,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq ) // get registered protocol handlers from configuration Reference < XNameAccess > xAccess(officecfg::Office::ProtocolHandler::HandlerSet::get()); - Sequence < OUString > aNames = xAccess->getElementNames(); + const Sequence < OUString > aNames = xAccess->getElementNames(); for ( const auto& rName : aNames ) { Reference < XPropertySet > xSet; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index fc9c5b08fc52..88a2cd388c16 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -895,7 +895,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) } // Backup visible toolbar list and hide all toolbars - Sequence<Reference<XUIElement>> aUIElements = xLayoutManager->getElements(); + const Sequence<Reference<XUIElement>> aUIElements = xLayoutManager->getElements(); for ( const Reference< XUIElement >& xUIElement : aUIElements ) { Reference< XPropertySet > xPropertySet( xUIElement, UNO_QUERY ); diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 799fbb2ffdbb..2c42c5a59e33 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -225,7 +225,7 @@ static OUString impl_getFilter( const OUString& _rURL ) if ( !sType.isEmpty() ) { // Honor a selected/detected filter. - for (const auto& rDescr : aDescrList) + for (const auto& rDescr : std::as_const(aDescrList)) { if (rDescr.Name == "FilterName") { diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index a491d3ec02a2..2019b5fe8972 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -1116,7 +1116,7 @@ bool SearchTabPage_Impl::OpenKeyword( const OUString& rKeyword ) static void GetBookmarkEntry_Impl ( - Sequence< PropertyValue >& aBookmarkEntry, + const Sequence< PropertyValue >& aBookmarkEntry, OUString& rTitle, OUString& rURL ) diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index b5970c7ac874..1fec7f92d379 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -434,7 +434,7 @@ ErrCode SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, std: uno::Sequence< beans::PropertyValue > lDescriptor = aDescriptor.getAsConstPropertyValueList(); sTypeName = xDetection->queryTypeByDescriptor(lDescriptor, true); // lDescriptor is used as In/Out param ... don't use aDescriptor.getAsConstPropertyValueList() directly! - for (const auto& rProp : lDescriptor) + for (const auto& rProp : std::as_const(lDescriptor)) { if (rProp.Name == "FilterName") // Type detection picked a preferred filter for this format. @@ -926,7 +926,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( bool bEnabled = true ; // first get directly available properties - for( const auto& rFilterProperty : lFilterProperties ) + for( const auto& rFilterProperty : std::as_const(lFilterProperties) ) { if ( rFilterProperty.Name == "FileFormatVersion" ) { @@ -982,7 +982,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( if( aResult >>= lTypeProperties ) { // get indirect available properties then (types) - for( const auto& rTypeProperty : lTypeProperties ) + for( const auto& rTypeProperty : std::as_const(lTypeProperties) ) { if ( rTypeProperty.Name == "ClipboardFormat" ) { @@ -1104,7 +1104,7 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate ) if( xFilterCFG.is() && xTypeCFG.is() ) { // select right query to get right set of filters for search module - uno::Sequence< OUString > lFilterNames = xFilterCFG->getElementNames(); + const uno::Sequence< OUString > lFilterNames = xFilterCFG->getElementNames(); if ( lFilterNames.hasElements() ) { // If list of filters already exist ... diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 0cff220f48ae..c1e4063dffd6 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -211,7 +211,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL, uno::Reference<beans::XPropertySetInfo> xPropInfo = xUserDefinedProps->getPropertySetInfo(); DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null"); - uno::Sequence<beans::Property> props = xPropInfo->getProperties(); + const uno::Sequence<beans::Property> props = xPropInfo->getProperties(); for (const auto& rProp : props) { try diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index 96dbd90b1fb3..414f1236ce9f 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -235,7 +235,7 @@ void RecentDocsView::Reload() Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST ); for ( int i = 0; i < aHistoryList.getLength(); i++ ) { - Sequence< PropertyValue >& rRecentEntry = aHistoryList[i]; + const Sequence< PropertyValue >& rRecentEntry = aHistoryList[i]; OUString aURL; OUString aTitle; diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index abdb828d7721..ca312f61a0d9 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -601,7 +601,7 @@ void SfxShell::VerbExec(SfxRequest& rReq) return; bool bReadOnly = pViewShell->GetObjectShell()->IsReadOnly(); - css::uno::Sequence < css::embed::VerbDescriptor > aList = pViewShell->GetVerbs(); + const css::uno::Sequence < css::embed::VerbDescriptor > aList = pViewShell->GetVerbs(); sal_Int32 nVerb = 0; for (const auto& rVerb : aList) { diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 9588ff61d551..6908f64aaa61 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -958,7 +958,8 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt InterceptLOKStateChangeEvent(pDispatcher->GetFrame(), aEvent, pState); } - for (const OUString& rName: pDispatch->GetListeners().getContainedTypes()) + const css::uno::Sequence<OUString> aContainedTypes = pDispatch->GetListeners().getContainedTypes(); + for (const OUString& rName: aContainedTypes) { if (rName == aDispatchURL.Main || rName == aDispatchURL.Complete) sendStatusChanged(rName, aEvent); diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 34d685e61128..011135fab81b 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1028,7 +1028,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) // Check for cmis properties where otherwise unavailable if ( rInfoItem.isCmisDocument( ) ) { - uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties(); + const uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties(); for ( const auto& rCmisProp : aCmisProps ) { if ( rCmisProp.Id == "cmis:contentStreamLength" && @@ -1879,7 +1879,7 @@ IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, weld::Button&, void) // indeed the info are deleted by ClearCustomProperties // each time SfxDocumentInfoItem destructor is called SfxDocumentInfoItem pInfo; - Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties(); + const Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties(); for ( const auto& rProperty : aPropertySeq ) { if ( !rProperty.Name.isEmpty() ) @@ -1920,7 +1920,7 @@ bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet ) } pInfo->ClearCustomProperties(); - Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties(); + const Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties(); for ( const auto& rProperty : aPropertySeq ) { if ( !rProperty.Name.isEmpty() ) @@ -2049,7 +2049,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, Sequence< sal_Int64 > seqValue; rAny >>= seqValue; sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM ); - for ( const auto& rValue : seqValue ) + for ( const auto& rValue : std::as_const(seqValue) ) { OUString sValue; m_aNumberFormatter.GetInputLineString( rValue, nIndex, sValue ); @@ -2063,7 +2063,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, Sequence< double > seqValue; rAny >>= seqValue; sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM ); - for ( const auto& rValue : seqValue ) + for ( const auto& rValue : std::as_const(seqValue) ) { OUString sValue; m_aNumberFormatter.GetInputLineString( rValue, nIndex, sValue ); @@ -2077,7 +2077,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, { Sequence<sal_Bool> seqValue; rAny >>= seqValue; - for ( const auto& rValue : seqValue ) + for ( const auto& rValue : std::as_const(seqValue) ) { std::unique_ptr<CmisYesNo> pYesNo(new CmisYesNo(m_xBox.get(), rValue)); pYesNo->m_xYesButton->set_sensitive( bUpdatable ); @@ -2089,7 +2089,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, { Sequence< OUString > seqValue; rAny >>= seqValue; - for ( const auto& rValue : seqValue ) + for ( const auto& rValue : std::as_const(seqValue) ) { std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), rValue)); pValue->m_xValueEdit->set_editable(bUpdatable); @@ -2100,7 +2100,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName, { Sequence< util::DateTime > seqValue; rAny >>= seqValue; - for ( const auto& rValue : seqValue ) + for ( const auto& rValue : std::as_const(seqValue) ) { std::unique_ptr<CmisDateTime> pDateTime(new CmisDateTime(m_xBox.get(), rValue)); pDateTime->m_xDateField->set_sensitive(bUpdatable); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index d38a361b5a2a..faa103d55e04 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -102,7 +102,7 @@ static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >& a = xWindowStateMgr->getByName( rResourceURL ); if ( a >>= aWindowState ) { - for ( const auto& rProp : aWindowState ) + for ( const auto& rProp : std::as_const(aWindowState) ) { if ( rProp.Name == "UIName" ) { diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 198043cac4a9..402923c8dfa1 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -410,7 +410,7 @@ bool FileDialogHelper_Impl::CheckFilterOptionsCapability( const std::shared_ptr< if ( aAny >>= aProps ) { OUString aServiceName; - for( const auto& rProp : aProps ) + for( const auto& rProp : std::as_const(aProps) ) { if( rProp.Name == "UIComponent" ) { diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 31ee48bf6e0b..901c435f6d94 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -146,7 +146,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( if ( aAny >>= aProps ) { - for( const auto& rProp : aProps ) + for( const auto& rProp : std::as_const(aProps) ) { if( rProp.Name == "UIComponent" ) { diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 43514b1bc68e..07631e90c76e 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -176,7 +176,7 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU OUString aActualFilterTypeName; uno::Sequence< beans::PropertyValue > aActuralFilterData; xFilterFactory->getByName( aActualFilter ) >>= aActuralFilterData; - for ( const auto& rProp : aActuralFilterData ) + for ( const auto& rProp : std::as_const(aActuralFilterData) ) if ( rProp.Name == "Type" ) rProp.Value >>= aActualFilterTypeName; ::comphelper::SequenceAsHashMap aProps1( xTypeDetection->getByName( aActualFilterTypeName ) ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index f2782b99de40..a78cacb43d13 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3501,7 +3501,7 @@ void SfxMedium::AddVersion_Impl( util::RevisionTag& rRevision ) // To determine a unique name for the stream std::vector<sal_uInt32> aLongs; sal_Int32 nLength = pImpl->aVersions.getLength(); - for ( const auto& rVersion : pImpl->aVersions ) + for ( const auto& rVersion : std::as_const(pImpl->aVersions) ) { sal_uInt32 nVer = static_cast<sal_uInt32>( rVersion.Identifier.copy(7).toInt32()); size_t n; diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index 71dbff9a64ed..d14b2af5adc9 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -273,7 +273,7 @@ bool SaveOlePropertySet( uno::Reference<beans::XPropertySetInfo> xPropInfo = xUserDefinedProps->getPropertySetInfo(); DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null"); - uno::Sequence<beans::Property> props = xPropInfo->getProperties(); + const uno::Sequence<beans::Property> props = xPropInfo->getProperties(); for (const auto& rProp : props) { try diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index d43c1b1be065..13954b06f6d8 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -310,7 +310,7 @@ namespace sfx2 { const OUString aStdLibName( "Standard" ); const OUString aVBAProject( "VBAProject" ); - Sequence< OUString > aElements = xContainer->getElementNames(); + const Sequence< OUString > aElements = xContainer->getElementNames(); for( const OUString& aElement : aElements ) { if( aElement == aStdLibName || aElement == aVBAProject ) diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 6780825e7dcd..c30544803603 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1766,7 +1766,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, uno::Sequence< beans::PropertyValue > aFilterData; xFilterFactory->getByName( aFilterName ) >>= aFilterData; OUString aTypeName; - for ( const auto& rProp : aFilterData ) + for ( const auto& rProp : std::as_const(aFilterData) ) if ( rProp.Name == "Type" ) rProp.Value >>= aTypeName; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 8dec12dda161..f875591e0a50 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -606,7 +606,7 @@ bool ModelData_Impl::ExecuteFilterDialog_Impl( const OUString& aFilterName ) sal_uInt32(ERRCODE_IO_ABORT)); } - uno::Sequence< beans::PropertyValue > aPropsFromDialog = + const uno::Sequence< beans::PropertyValue > aPropsFromDialog = xFilterProperties->getPropertyValues(); for ( const auto& rProp : aPropsFromDialog ) GetMediaDescr()[rProp.Name] = rProp.Value; @@ -1734,7 +1734,7 @@ void SfxStoringHelper::SetDocInfoState( xDocPropsToFill->getUserDefinedProperties(), uno::UNO_QUERY); uno::Reference< beans::XPropertyContainer > xContainer( xSet, uno::UNO_QUERY ); uno::Reference< beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo(); - uno::Sequence< beans::Property > lProps = xSetInfo->getProperties(); + const uno::Sequence< beans::Property > lProps = xSetInfo->getProperties(); for (const beans::Property& rProp : lProps) { uno::Any aValue = xPropSet->getPropertyValue( rProp.Name ); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index a61e1e8b42e1..6fc2027bc2df 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -258,7 +258,7 @@ bool SfxObjectShell::IsModified() if (pImpl->mpObjectContainer) { - uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); + const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); for ( const auto& rName : aNames ) { uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( rName ); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 69e106319b16..8cc196c015ce 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1127,7 +1127,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) { bool bShow = false; Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY ); - uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties(); + const uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties(); if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) ) { diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 82653292a818..6a659b5242a8 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1439,7 +1439,7 @@ bool SfxObjectShell::SaveTo_Impl { try { - Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList(); + const Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList(); if ( aVersions.hasElements() ) { // copy the version streams @@ -2225,7 +2225,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium, // #i119492# During loading, some OLE objects like chart will be set // modified flag, so needs to reset the flag to false after loading bool bRtn = xLoader->filter( aArgs ); - uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); + const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); for ( const auto& rName : aNames ) { uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( rName ); @@ -3141,7 +3141,7 @@ bool SfxObjectShell::SaveCompletedChildren() if ( pImpl->mpObjectContainer ) { - uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); + const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames(); for ( const auto& rName : aNames ) { uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( rName ); @@ -3248,7 +3248,7 @@ static bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embe try { - uno::Sequence< OUString > aSubElements = xSource->getElementNames(); + const uno::Sequence< OUString > aSubElements = xSource->getElementNames(); for ( const auto& rSubElement : aSubElements ) { if ( xSource->isStorageElement( rSubElement ) ) @@ -3370,7 +3370,8 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType(const uno::Reference< embed: try { - for (const OUString& rSubElement : xSource->getElementNames()) + const css::uno::Sequence<OUString> aSubElementNames = xSource->getElementNames(); + for (const OUString& rSubElement : aSubElementNames) { if (std::find(rExceptions.begin(), rExceptions.end(), rSubElement) != rExceptions.end()) continue; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 7742d5edbc91..4ef95f9aa672 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1021,7 +1021,7 @@ Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() Sequence< beans::PropertyValue > aFinalCache; sal_Int32 nFinalLength = 0; - for ( const auto& rOrg : m_pData->m_seqArguments ) + for ( const auto& rOrg : std::as_const(m_pData->m_seqArguments) ) { auto bNew = std::none_of(seqArgsOld.begin(), seqArgsOld.end(), [&rOrg](const beans::PropertyValue& rOld){ return rOld.Name == rOrg.Name; }); @@ -3316,7 +3316,7 @@ Sequence< OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames() Reference < embed::XStorage > xStorage = m_pData->m_pObjectShell->GetStorage(); if ( xStorage.is() ) { - Sequence< OUString > aTemp = xStorage->getElementNames(); + const Sequence< OUString > aTemp = xStorage->getElementNames(); sal_Int32 nResultSize = 0; for ( const auto& rName : aTemp ) { diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index ee00f17da016..300af208d924 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -900,7 +900,7 @@ void SfxTemplateManagerDlg::OnTemplateImportCategory(const OUString& sCategory) if ( nCode != ERRCODE_NONE ) return; - css::uno::Sequence<OUString> aFiles = aFileDlg.GetSelectedFiles(); + const css::uno::Sequence<OUString> aFiles = aFileDlg.GetSelectedFiles(); if (!aFiles.hasElements()) return; diff --git a/sfx2/source/doc/watermarkitem.cxx b/sfx2/source/doc/watermarkitem.cxx index d6978ff153d9..e672fc838c87 100644 --- a/sfx2/source/doc/watermarkitem.cxx +++ b/sfx2/source/doc/watermarkitem.cxx @@ -60,7 +60,7 @@ bool SfxWatermarkItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberI if ( rVal >>= aSequence ) { - for(const auto& aEntry : aSequence) + for(const auto& aEntry : std::as_const(aSequence)) { if(aEntry.Name == "Text") aEntry.Value >>= m_aText; diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx index 474ea51f68c6..4ae3c3547eab 100644 --- a/sfx2/source/doc/zoomitem.cxx +++ b/sfx2/source/doc/zoomitem.cxx @@ -108,7 +108,7 @@ bool SvxZoomItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nTypeTmp( 0 ); bool bAllConverted( true ); sal_Int16 nConvertedCount( 0 ); - for ( const auto& rProp : aSeq ) + for ( const auto& rProp : std::as_const(aSeq) ) { if ( rProp.Name == ZOOM_PARAM_VALUE ) { diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 68d862eeced6..f126f4218a1a 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -205,7 +205,7 @@ void SfxURLToolBoxControl_Impl::StateChanged SvtURLBox* pURLBox = GetURLBox(); pURLBox->Clear(); - css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lList = SvtHistoryOptions().GetList(ePICKLIST); + const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lList = SvtHistoryOptions().GetList(ePICKLIST); for (const css::uno::Sequence< css::beans::PropertyValue >& lProps : lList) { for (const auto& rProp : lProps) diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx index 66ece2417be2..f9dd28131e11 100644 --- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx +++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx @@ -304,7 +304,7 @@ void NotebookbarTabControl::FillShortcutsToolBox(Reference<XComponentContext> co sal_uInt16 nType = ItemType::DEFAULT; bool bVisible = true; - for ( const auto& aProp: aPropSequence ) + for ( const auto& aProp: std::as_const(aPropSequence) ) { if ( aProp.Name == "CommandURL" ) aProp.Value >>= aCommandURL; diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index eafa8d955da6..4bdce004ad91 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -55,7 +55,7 @@ static void NotebookbarAddonValues( for (int nIdx = 0; nIdx < aAddonsItems.GetAddonsNotebookBarCount(); nIdx++) { - css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>> aExtension + const css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>> aExtension = aAddonsItems.GetAddonsNotebookBarPart(nIdx); for (const css::uno::Sequence<css::beans::PropertyValue>& rExtensionVal : aExtension) { diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index fffe1fe39de0..e21130d6022c 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -192,7 +192,7 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum if ( !aProperties.hasElements() ) return; - for ( const auto& rProp : aProperties ) + for ( const auto& rProp : std::as_const(aProperties) ) { if ( rProp.Name == PROP_EVENT_TYPE ) rProp.Value >>= aType; @@ -348,7 +348,7 @@ std::unique_ptr<SvxMacro> SfxEvents_Impl::ConvertToMacro( const uno::Any& rEleme if ( !aProperties.hasElements() ) return pMacro; - for ( const auto& rProp : aProperties ) + for ( const auto& rProp : std::as_const(aProperties) ) { if ( rProp.Name == PROP_EVENT_TYPE ) rProp.Value >>= aType; diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index 9c6f7f1f442a..587d260ebd5a 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -484,7 +484,7 @@ void ResourceManager::ReadContextList ( if (!(aValue >>= aValues)) return; - for (const OUString& sValue : aValues) + for (const OUString& sValue : std::as_const(aValues)) { sal_Int32 nCharacterIndex (0); const OUString sApplicationName (sValue.getToken(0, ',', nCharacterIndex).trim()); diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx index db1f0090c4ec..6102879c3d6d 100644 --- a/sfx2/source/view/classificationhelper.cxx +++ b/sfx2/source/view/classificationhelper.cxx @@ -482,7 +482,7 @@ bool SfxClassificationHelper::IsClassified(const uno::Reference<document::XDocum return false; uno::Reference<beans::XPropertySet> xPropertySet(xPropertyContainer, uno::UNO_QUERY); - uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties(); + const uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties(); for (const beans::Property& rProperty : aProperties) { if (rProperty.Name.startsWith("urn:bails:")) @@ -569,7 +569,7 @@ SfxClassificationHelper::SfxClassificationHelper(const uno::Reference<document:: return; uno::Reference<beans::XPropertySet> xPropertySet(xPropertyContainer, uno::UNO_QUERY); - uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties(); + const uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties(); for (const beans::Property& rProperty : aProperties) { if (!rProperty.Name.startsWith("urn:bails:")) diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index c5503a3c2aa5..956ce26fc4b4 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1368,7 +1368,7 @@ void SfxBaseController::ShowInfoBars( ) if ( !xCmisDoc.is( ) || !xCmisDoc->canCheckOut( ) ) return; - uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( ); + const uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( ); if ( !(xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( )) ) return; diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4590d32743e6..9be92b23ba15 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -140,7 +140,7 @@ SfxPrinterController::SfxPrinterController( const VclPtr<Printer>& i_rPrinter, aRenderOptions[2].Value <<= true; try { - Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); + const Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) ); for( const auto& rRenderParm : aRenderParms ) { if ( rRenderParm.Name == "ExtraPrintUIOptions" ) |