From 4cbcec9ed4c51277b00c155a5fa097880c0dee4b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 8 Apr 2016 16:33:17 +0200 Subject: clang-tidy performance-unnecessary-value-param in sfx2 Change-Id: I035eec1f3701c48b9a85c60400c68f9365299b48 --- sfx2/inc/guisaveas.hxx | 2 +- sfx2/source/appl/childwinimpl.cxx | 4 ++-- sfx2/source/appl/helpinterceptor.cxx | 2 +- sfx2/source/appl/helpinterceptor.hxx | 2 +- sfx2/source/appl/module.cxx | 2 +- sfx2/source/appl/newhelp.cxx | 4 ++-- sfx2/source/appl/newhelp.hxx | 2 +- sfx2/source/appl/shellimpl.cxx | 6 +++--- sfx2/source/bastyp/fltfnc.cxx | 2 +- sfx2/source/control/bindings.cxx | 2 +- sfx2/source/control/request.cxx | 2 +- sfx2/source/dialog/filedlghelper.cxx | 6 +++--- sfx2/source/dialog/filedlgimpl.hxx | 6 +++--- sfx2/source/dialog/mailmodel.cxx | 4 ++-- sfx2/source/doc/SfxDocumentMetaData.cxx | 6 +++--- sfx2/source/doc/docfile.cxx | 2 +- sfx2/source/doc/docinf.cxx | 4 ++-- sfx2/source/doc/doctemplateslocal.cxx | 6 +++--- sfx2/source/doc/doctemplateslocal.hxx | 6 +++--- sfx2/source/doc/guisaveas.cxx | 2 +- sfx2/source/doc/objxtor.cxx | 4 ++-- sfx2/source/doc/oleprops.cxx | 2 +- sfx2/source/doc/oleprops.hxx | 2 +- sfx2/source/inc/childwinimpl.hxx | 4 ++-- sfx2/source/inc/shellimpl.hxx | 6 +++--- sfx2/source/sidebar/ResourceManager.cxx | 4 ++-- sfx2/source/sidebar/SidebarController.cxx | 8 ++++---- sfx2/source/view/viewfrm.cxx | 2 +- sfx2/source/view/viewsh.cxx | 6 +++--- 29 files changed, 55 insertions(+), 55 deletions(-) (limited to 'sfx2') diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx index 729f067c86e1..1e516c48d187 100644 --- a/sfx2/inc/guisaveas.hxx +++ b/sfx2/inc/guisaveas.hxx @@ -58,7 +58,7 @@ public: SfxStoringHelper(); bool GUIStoreModel( - css::uno::Reference< css::frame::XModel > xModel, + const css::uno::Reference< css::frame::XModel >& xModel, const OUString& aSlotName, css::uno::Sequence< css::beans::PropertyValue >& aArgsSequence, bool bPreselectPassword, diff --git a/sfx2/source/appl/childwinimpl.cxx b/sfx2/source/appl/childwinimpl.cxx index 7e8b0b7aa68c..e1e20abb7835 100644 --- a/sfx2/source/appl/childwinimpl.cxx +++ b/sfx2/source/appl/childwinimpl.cxx @@ -59,7 +59,7 @@ void SfxChildWinFactArr_Impl::push_back( SfxChildWinFactory* p ) maData.push_back(std::unique_ptr(p)); } -void SfxChildWinFactArr_Impl::erase( iterator it ) +void SfxChildWinFactArr_Impl::erase( const iterator& it ) { maData.erase(it); } @@ -84,7 +84,7 @@ SfxFrame* SfxFrameArr_Impl::front() return maData.front(); } -void SfxFrameArr_Impl::erase( iterator it ) +void SfxFrameArr_Impl::erase( const iterator& it ) { maData.erase(it); } diff --git a/sfx2/source/appl/helpinterceptor.cxx b/sfx2/source/appl/helpinterceptor.cxx index b8f63d69b1ff..100f4c2a2483 100644 --- a/sfx2/source/appl/helpinterceptor.cxx +++ b/sfx2/source/appl/helpinterceptor.cxx @@ -101,7 +101,7 @@ void HelpInterceptor_Impl::addURL( const OUString& rURL ) } -void HelpInterceptor_Impl::setInterception( Reference< XFrame > xFrame ) +void HelpInterceptor_Impl::setInterception( const Reference< XFrame >& xFrame ) { m_xIntercepted.set( xFrame, UNO_QUERY ); diff --git a/sfx2/source/appl/helpinterceptor.hxx b/sfx2/source/appl/helpinterceptor.hxx index 86af5a62201d..8356c309c1c2 100644 --- a/sfx2/source/appl/helpinterceptor.hxx +++ b/sfx2/source/appl/helpinterceptor.hxx @@ -73,7 +73,7 @@ public: HelpInterceptor_Impl(); virtual ~HelpInterceptor_Impl(); - void setInterception( css::uno::Reference< css::frame::XFrame > xFrame ); + void setInterception( const css::uno::Reference< css::frame::XFrame >& xFrame ); OUString GetCurrentURL() const { return m_aCurrentURL; } diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 9bc8aaf9131e..2cedda83662c 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -55,7 +55,7 @@ public: return maData.begin(); } - void erase( iterator it ) + void erase( const iterator& it ) { maData.erase(it); } diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 1fee0de03bf3..40b1bf07d24b 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -200,7 +200,7 @@ namespace sfx2 "text menu" | "text* menu*" | "text|menu" */ OUString PrepareSearchString( const OUString& rSearchString, - Reference< XBreakIterator > xBreak, bool bForSearch ) + const Reference< XBreakIterator >& xBreak, bool bForSearch ) { OUString sSearchStr; sal_Int32 nStartPos = 0; @@ -3017,7 +3017,7 @@ bool SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt ) return bHandled || Window::PreNotify( rNEvt ); } -void SfxHelpWindow_Impl::setContainerWindow( Reference < css::awt::XWindow > xWin ) +void SfxHelpWindow_Impl::setContainerWindow( const Reference < css::awt::XWindow >& xWin ) { xWindow = xWin; MakeLayout(); diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 9b9d43495a68..93140f57686e 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -534,7 +534,7 @@ public: virtual bool PreNotify( NotifyEvent& rNEvt ) override; - void setContainerWindow( css::uno::Reference < css::awt::XWindow > xWin ); + void setContainerWindow( const css::uno::Reference < css::awt::XWindow >& xWin ); inline css::uno::Reference < css::frame::XFrame2 > getTextFrame() const { return pTextWin->getFrame(); } diff --git a/sfx2/source/appl/shellimpl.cxx b/sfx2/source/appl/shellimpl.cxx index 84ed3de3f57d..2ef1a7fe31c2 100644 --- a/sfx2/source/appl/shellimpl.cxx +++ b/sfx2/source/appl/shellimpl.cxx @@ -39,7 +39,7 @@ SfxObjectShell* SfxObjectShellArr_Impl::operator[] ( size_t i ) return maData[i]; } -void SfxObjectShellArr_Impl::erase( iterator it ) +void SfxObjectShellArr_Impl::erase( const iterator& it ) { maData.erase(it); } @@ -74,7 +74,7 @@ SfxViewFrame* SfxViewFrameArr_Impl::operator[] ( size_t i ) return maData[i]; } -void SfxViewFrameArr_Impl::erase( iterator it ) +void SfxViewFrameArr_Impl::erase( const iterator& it ) { maData.erase(it); } @@ -109,7 +109,7 @@ SfxViewShell* SfxViewShellArr_Impl::operator[] ( size_t i ) return maData[i]; } -void SfxViewShellArr_Impl::erase( iterator it ) +void SfxViewShellArr_Impl::erase( const iterator& it ) { maData.erase(it); } diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 04bfdb1ddb91..7afdf471cfd4 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -499,7 +499,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, s } -bool SfxFilterMatcher::IsFilterInstalled_Impl( std::shared_ptr pFilter ) +bool SfxFilterMatcher::IsFilterInstalled_Impl( const std::shared_ptr& pFilter ) { if ( pFilter->GetFilterFlags() & SfxFilterFlags::MUSTINSTALL ) { diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index aa2b004722df..1833992a5545 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -136,7 +136,7 @@ public: return maData.end(); } - void erase( iterator it ) + void erase( const iterator& it ) { maData.erase(it); } diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 3dcfe2ef5152..6d6b2484ad73 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -361,7 +361,7 @@ void SfxRequest::Record_Impl ( SfxShell& rSh, // the , which has executed the Request const SfxSlot& rSlot, // the , which has executed the Request - css::uno::Reference< css::frame::XDispatchRecorder > xRecorder, + const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder, SfxViewFrame* pViewFrame ) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index e33fd4677be1..9882d0618b50 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -392,7 +392,7 @@ bool FileDialogHelper_Impl::updateExtendedControl( sal_Int16 _nExtendedControlId return bIsEnabled; } -bool FileDialogHelper_Impl::CheckFilterOptionsCapability( std::shared_ptr _pFilter ) +bool FileDialogHelper_Impl::CheckFilterOptionsCapability( const std::shared_ptr& _pFilter ) { bool bResult = false; @@ -1304,7 +1304,7 @@ void lcl_saveLastURLs(std::vector& rpURLList, lLastURLs.push_back(*i); } -void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterface >& xPicker, std::vector& rpURLList, std::shared_ptr pFilter) +void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterface >& xPicker, std::vector& rpURLList, const std::shared_ptr& pFilter) { rpURLList.clear(); @@ -2599,7 +2599,7 @@ ErrCode FileOpenDialog_Impl( sal_Int16 nDialogType, return nRet; } -ErrCode RequestPassword(std::shared_ptr pCurrentFilter, OUString& aURL, SfxItemSet* pSet) +ErrCode RequestPassword(const std::shared_ptr& pCurrentFilter, OUString& aURL, SfxItemSet* pSet) { uno::Reference < task::XInteractionHandler2 > xInteractionHandler = task::InteractionHandler::createWithParent( ::comphelper::getProcessComponentContext(), nullptr ); // TODO: need a save way to distinguish MS filters from other filters diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 1ea880bd13a3..01b7c6eadef5 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -128,7 +128,7 @@ namespace sfx2 void setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); - bool CheckFilterOptionsCapability( std::shared_ptr _pFilter ); + bool CheckFilterOptionsCapability( const std::shared_ptr& _pFilter ); bool isInOpenMode() const; OUString getCurrentFilterUIName() const; @@ -142,8 +142,8 @@ namespace sfx2 void verifyPath( ); void implGetAndCacheFiles( const css::uno::Reference< XInterface >& xPicker , - std::vector& rpURLList, - std::shared_ptr pFilter ); + std::vector& rpURLList, + const std::shared_ptr& pFilter ); DECL_LINK_TYPED( TimeOutHdl_Impl, Idle *, void); DECL_LINK_TYPED( InitControls, void*, void ); diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 7c685533a45c..e12c05f88866 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -129,8 +129,8 @@ void PrepareListener_Impl::disposing(const css::lang::EventObject& /*rEvent*/) t static const char PDF_DOCUMENT_TYPE[] = "pdf_Portable_Document_Format"; SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( - uno::Reference< lang::XMultiServiceFactory > xSMGR, - uno::Reference< frame::XModel > xModel, + const uno::Reference< lang::XMultiServiceFactory >& xSMGR, + const uno::Reference< frame::XModel >& xModel, const OUString& rFilterName, const OUString& rType, bool bModified, diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 686c57d8e8cc..22f0f27540d1 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -321,7 +321,7 @@ protected: /// check if we are initialized properly void SAL_CALL checkInit() const; /// initialize state from given DOM tree - void SAL_CALL init(css::uno::Reference i_xDom); + void SAL_CALL init(const css::uno::Reference& i_xDom); /// update element in DOM tree void SAL_CALL updateElement(const char *i_name, std::vector >* i_pAttrs = nullptr); @@ -653,7 +653,7 @@ SfxDocumentMetaData::getURLProperties( // return the text of the (hopefully unique, i.e., normalize first!) text // node _below_ the given node OUString SAL_CALL -getNodeText(css::uno::Reference i_xNode) +getNodeText(const css::uno::Reference& i_xNode) throw (css::uno::RuntimeException) { if (!i_xNode.is()) throw css::uno::RuntimeException( @@ -1119,7 +1119,7 @@ SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException) // initialize state from DOM tree void SAL_CALL SfxDocumentMetaData::init( - css::uno::Reference i_xDoc) + const css::uno::Reference& i_xDoc) { if (!i_xDoc.is()) throw css::uno::RuntimeException( OUString("SfxDocumentMetaData::init: no DOM tree given"), *this); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index bd2fca7cecfe..c9ecec7634fa 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2672,7 +2672,7 @@ SfxMedium::GetInteractionHandler( bool bGetAlways ) } -void SfxMedium::SetFilter( std::shared_ptr pFilter ) +void SfxMedium::SetFilter( const std::shared_ptr& pFilter ) { pImp->m_pFilter = pFilter; } diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index 75a4dc673840..e27d276aca1a 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; namespace sfx2 { sal_uInt32 LoadOlePropertySet( - uno::Reference< document::XDocumentProperties> i_xDocProps, + const uno::Reference< document::XDocumentProperties>& i_xDocProps, SotStorage* i_pStorage ) { // *** global properties from stream "005SummaryInformation" *** @@ -195,7 +195,7 @@ sal_uInt32 LoadOlePropertySet( } bool SaveOlePropertySet( - uno::Reference< document::XDocumentProperties> i_xDocProps, + const uno::Reference< document::XDocumentProperties>& i_xDocProps, SotStorage* i_pStorage, const uno::Sequence * i_pThumb, const uno::Sequence * i_pGuid, diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx index 63017bb00fdb..f50d3fe43cba 100644 --- a/sfx2/source/doc/doctemplateslocal.cxx +++ b/sfx2/source/doc/doctemplateslocal.cxx @@ -33,7 +33,7 @@ using namespace ::com::sun::star; -std::vector< beans::StringPair > DocTemplLocaleHelper::ReadGroupLocalizationSequence( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< uno::XComponentContext > xContext ) +std::vector< beans::StringPair > DocTemplLocaleHelper::ReadGroupLocalizationSequence( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< uno::XComponentContext >& xContext ) throw( uno::Exception ) { OUString aStringID = "groupuinames.xml"; @@ -41,7 +41,7 @@ std::vector< beans::StringPair > DocTemplLocaleHelper::ReadGroupLocalizationSequ } -void SAL_CALL DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference< io::XOutputStream >& xOutStream, const std::vector< beans::StringPair >& aSequence, const uno::Reference< uno::XComponentContext > xContext ) +void SAL_CALL DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference< io::XOutputStream >& xOutStream, const std::vector< beans::StringPair >& aSequence, const uno::Reference< uno::XComponentContext >& xContext ) throw( uno::Exception ) { if ( !xOutStream.is() ) @@ -88,7 +88,7 @@ void SAL_CALL DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::R } -std::vector< beans::StringPair > SAL_CALL DocTemplLocaleHelper::ReadLocalizationSequence_Impl( const uno::Reference< io::XInputStream >& xInStream, const OUString& aStringID, const uno::Reference< uno::XComponentContext > xContext ) +std::vector< beans::StringPair > SAL_CALL DocTemplLocaleHelper::ReadLocalizationSequence_Impl( const uno::Reference< io::XInputStream >& xInStream, const OUString& aStringID, const uno::Reference< uno::XComponentContext >& xContext ) throw( uno::Exception ) { if ( !xContext.is() || !xInStream.is() ) diff --git a/sfx2/source/doc/doctemplateslocal.hxx b/sfx2/source/doc/doctemplateslocal.hxx index 53a98140d714..a98ae0377d7c 100644 --- a/sfx2/source/doc/doctemplateslocal.hxx +++ b/sfx2/source/doc/doctemplateslocal.hxx @@ -42,7 +42,7 @@ class DocTemplLocaleHelper : public cppu::WeakImplHelper < css::xml::sax::XDocum DocTemplLocaleHelper(); std::vector< css::beans::StringPair > GetParsingResult(); - static std::vector< css::beans::StringPair > SAL_CALL ReadLocalizationSequence_Impl( const css::uno::Reference< css::io::XInputStream >& xInStream, const OUString& aStringID, const css::uno::Reference< css::uno::XComponentContext > xContext ) + static std::vector< css::beans::StringPair > SAL_CALL ReadLocalizationSequence_Impl( const css::uno::Reference< css::io::XInputStream >& xInStream, const OUString& aStringID, const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw( css::uno::Exception ); public: @@ -53,7 +53,7 @@ public: std::vector< css::beans::StringPair > ReadGroupLocalizationSequence( const css::uno::Reference< css::io::XInputStream >& xInStream, - const css::uno::Reference< css::uno::XComponentContext > xContext ) + const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw( css::uno::Exception ); // writes sequence of elements ( GroupName, GroupUIName ) @@ -61,7 +61,7 @@ public: void SAL_CALL WriteGroupLocalizationSequence( const css::uno::Reference< css::io::XOutputStream >& xOutStream, const std::vector< css::beans::StringPair >& aSequence, - const css::uno::Reference< css::uno::XComponentContext > xContext ) + const css::uno::Reference< css::uno::XComponentContext >& xContext ) throw( css::uno::Exception ); // XDocumentHandler diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index c00ed82c5d40..fc63a1bf9820 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1300,7 +1300,7 @@ uno::Reference< css::frame::XModuleManager2 > SfxStoringHelper::GetModuleManager } -bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel, +bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xModel, const OUString& aSlotName, uno::Sequence< beans::PropertyValue >& aArgsSequence, bool bPreselectPassword, diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 5f2ff89adc0b..eddcb68f0057 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -464,7 +464,7 @@ OUString SfxObjectShell::CreateShellID( const SfxObjectShell* pShell ) SfxObjectShell* SfxObjectShell::GetFirst ( - std::function isObjectShell, + const std::function& isObjectShell, bool bOnlyVisible ) { @@ -491,7 +491,7 @@ SfxObjectShell* SfxObjectShell::GetFirst SfxObjectShell* SfxObjectShell::GetNext ( const SfxObjectShell& rPrev, - std::function isObjectShell, + const std::function& isObjectShell, bool bOnlyVisible ) { diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index f25c14f081c4..c29de45b3a17 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -796,7 +796,7 @@ bool SfxOleSection::GetDateValue( util::Date& rValue, sal_Int32 nPropId ) const return pProp != nullptr; } -void SfxOleSection::SetProperty( SfxOlePropertyRef xProp ) +void SfxOleSection::SetProperty( const SfxOlePropertyRef& xProp ) { if( xProp.get() ) maPropMap[ xProp->GetPropId() ] = xProp; diff --git a/sfx2/source/doc/oleprops.hxx b/sfx2/source/doc/oleprops.hxx index ffe70d30b4d4..bba734276c19 100644 --- a/sfx2/source/doc/oleprops.hxx +++ b/sfx2/source/doc/oleprops.hxx @@ -292,7 +292,7 @@ public: bool GetDateValue( css::util::Date& rValue, sal_Int32 nPropId ) const; /** Adds the passed property to the property set. Drops an existing old property. */ - void SetProperty( SfxOlePropertyRef xProp ); + void SetProperty( const SfxOlePropertyRef& xProp ); /** Inserts a signed int32 property with the passed value. */ void SetInt32Value( sal_Int32 nPropId, sal_Int32 nValue ); /** Inserts a floating-point property with the passed value. */ diff --git a/sfx2/source/inc/childwinimpl.hxx b/sfx2/source/inc/childwinimpl.hxx index 113268687db2..135cd3e46792 100644 --- a/sfx2/source/inc/childwinimpl.hxx +++ b/sfx2/source/inc/childwinimpl.hxx @@ -52,7 +52,7 @@ public: const SfxChildWinFactory& operator []( size_t i ) const; SfxChildWinFactory& operator []( size_t i ); void push_back( SfxChildWinFactory* p ); - void erase( iterator it ); + void erase( const iterator& it ); iterator begin(); }; @@ -70,7 +70,7 @@ public: SfxFrame* front(); - void erase( iterator it ); + void erase( const iterator& it ); SfxFrame* operator[] ( size_t i ); diff --git a/sfx2/source/inc/shellimpl.hxx b/sfx2/source/inc/shellimpl.hxx index 622dafa5fc82..5e11bf1ef58e 100644 --- a/sfx2/source/inc/shellimpl.hxx +++ b/sfx2/source/inc/shellimpl.hxx @@ -41,7 +41,7 @@ public: const SfxObjectShell* operator[] ( size_t i ) const; SfxObjectShell* operator[] ( size_t i ); - void erase( iterator it ); + void erase( const iterator& it ); void push_back( SfxObjectShell* p ); @@ -62,7 +62,7 @@ public: const SfxViewFrame* operator[] ( size_t i ) const; SfxViewFrame* operator[] ( size_t i ); - void erase( iterator it ); + void erase( const iterator& it ); void push_back( SfxViewFrame* p ); @@ -84,7 +84,7 @@ public: const SfxViewShell* operator[] ( size_t i ) const; SfxViewShell* operator[] ( size_t i ); - void erase( iterator it ); + void erase( const iterator& it ); void push_back( SfxViewShell* p ); diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index b2f9d1763f9a..6951f7ce5a7c 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -54,7 +54,7 @@ bool getBool(utl::OConfigurationNode const & aNode, const char* pNodeName) return comphelper::getBOOL(aNode.getNodeValue(pNodeName)); } -css::uno::Sequence BuildContextList (ContextList rContextList) +css::uno::Sequence BuildContextList (const ContextList& rContextList) { const ::std::vector& entries = rContextList.GetEntries(); @@ -722,7 +722,7 @@ bool ResourceManager::IsDeckEnabled ( return false; } -void ResourceManager::UpdateModel(css::uno::Reference xModel) +void ResourceManager::UpdateModel(const css::uno::Reference& xModel) { for (DeckContainer::iterator itr = maDecks.begin(); itr != maDecks.end(); ++itr) { diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index d28a59748ca6..c1801d2e4f68 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -160,7 +160,7 @@ SidebarController* SidebarController::GetSidebarControllerForFrame ( return dynamic_cast(xListener.get()); } -void SidebarController::registerSidebarForFrame(SidebarController* pController, css::uno::Reference xController) +void SidebarController::registerSidebarForFrame(SidebarController* pController, const css::uno::Reference& xController) { // Listen for context change events. css::uno::Reference xMultiplexer ( @@ -172,7 +172,7 @@ void SidebarController::registerSidebarForFrame(SidebarController* pController, xController); } -void SidebarController::unregisterSidebarForFrame(SidebarController* pController, css::uno::Reference xController) +void SidebarController::unregisterSidebarForFrame(SidebarController* pController, const css::uno::Reference& xController) { pController->disposeDecks(); css::uno::Reference xMultiplexer ( @@ -765,7 +765,7 @@ VclPtr SidebarController::CreatePanel ( vcl::Window* pParentWindow, const bool bIsInitiallyExpanded, const Context& rContext, - VclPtr pDeck) + const VclPtr& pDeck) { const PanelDescriptor* pPanelDescriptor = mpResourceManager->GetPanelDescriptor(rsPanelId); @@ -1291,7 +1291,7 @@ ResourceManager::PanelContextDescriptorContainer SidebarController::GetMatchingP return aPanels; } -void SidebarController::updateModel(css::uno::Reference xModel) +void SidebarController::updateModel(const css::uno::Reference& xModel) { mpResourceManager->UpdateModel(xModel); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 6d1672c73c50..c4ac7525a876 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -154,7 +154,7 @@ void SfxViewFrame::InitInterface_Impl() #endif } -static bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >& xHandler, const OUString& aPath, std::shared_ptr pFilter, sal_uInt32 nPasswordHash, const uno::Sequence< beans::PropertyValue >& aInfo ) +static bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHandler >& xHandler, const OUString& aPath, const std::shared_ptr& pFilter, sal_uInt32 nPasswordHash, const uno::Sequence< beans::PropertyValue >& aInfo ) { // TODO/LATER: In future the info should replace the direct hash completely bool bResult = ( !nPasswordHash && !aInfo.getLength() ); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d1aa7548d4c0..ca3d51a7c505 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -232,7 +232,7 @@ public: iterator end() { return maData.end(); } void push_back( SfxInPlaceClient* p ) { maData.push_back(p); } - void erase( iterator it ) { maData.erase(it); } + void erase( const iterator& it ) { maData.erase(it); } size_t size() const { return maData.size(); } }; @@ -1412,7 +1412,7 @@ void SfxViewShell::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue SfxViewShell* SfxViewShell::GetFirst ( bool bOnlyVisible, - std::function< bool ( const SfxViewShell* ) > isViewShell + const std::function< bool ( const SfxViewShell* ) >& isViewShell ) { // search for a SfxViewShell of the specified type @@ -1450,7 +1450,7 @@ SfxViewShell* SfxViewShell::GetNext ( const SfxViewShell& rPrev, bool bOnlyVisible, - std::function isViewShell + const std::function& isViewShell ) { SfxViewShellArr_Impl &rShells = SfxGetpApp()->GetViewShells_Impl(); -- cgit