From 3ad6957dc12c0667a69ca6b8361ccde490f9c1da Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Oct 2017 13:30:44 +0200 Subject: loplugin:constantparam in sfx2 Change-Id: Id52809401fb848d7169a665903e67ba28f4af598 Reviewed-on: https://gerrit.libreoffice.org/44084 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sfx2/source/config/evntconf.cxx | 4 ++-- sfx2/source/dialog/mgetempl.cxx | 6 +----- sfx2/source/doc/docfilt.cxx | 12 ++++-------- sfx2/source/view/viewfrm.cxx | 7 ++++--- 4 files changed, 11 insertions(+), 18 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index 58c6f2251feb..9de6fb043487 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -242,9 +242,9 @@ void SfxEventConfiguration::ConfigureEvent( const OUString& aName, const SvxMacr } -SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc, bool bBlowUp ) +SvxMacro* SfxEventConfiguration::ConvertToMacro( const css::uno::Any& rElement, SfxObjectShell* pDoc ) { - return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, bBlowUp ); + return SfxEvents_Impl::ConvertToMacro( rElement, pDoc, true/*bBlowUp*/ ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index e93adca35721..b6e78d3a5ff9 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -371,22 +371,18 @@ IMPL_LINK_NOARG( SfxManageStyleSheetPage, EditLinkStyleHdl_Impl, Button*, void ) // Internal: Perform functions through the Dispatcher bool SfxManageStyleSheetPage::Execute_Impl( - sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily, - sal_uInt16 nMask) + sal_uInt16 nId, const OUString &rStr, const OUString& rRefStr, sal_uInt16 nFamily) { SfxDispatcher &rDispatcher = *SfxGetpApp()->GetDispatcher_Impl(); SfxStringItem aItem(nId, rStr); SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily); - SfxUInt16Item aMask( SID_STYLE_MASK, nMask ); SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr ); const SfxPoolItem* pItems[ 6 ]; sal_uInt16 nCount = 0; if( !rStr.isEmpty() ) pItems[ nCount++ ] = &aItem; pItems[ nCount++ ] = &aFamily; - if( nMask ) - pItems[ nCount++ ] = &aMask; if ( !rRefStr.isEmpty() ) pItems[ nCount++ ] = &aRefName; diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx index ed5a13c1be80..a71c45412e0a 100644 --- a/sfx2/source/doc/docfilt.cxx +++ b/sfx2/source/doc/docfilt.cxx @@ -175,7 +175,7 @@ OUString SfxFilter::GetTypeFromStorage( const SotStorage& rStg ) } OUString SfxFilter::GetTypeFromStorage( - const uno::Reference& xStorage, bool bTemplate ) + const uno::Reference& xStorage ) { SfxFilterMatcher aMatcher; @@ -191,13 +191,9 @@ OUString SfxFilter::GetTypeFromStorage( SotClipboardFormatId nClipId = SotExchange::GetFormat( aDataFlavor ); if ( nClipId != SotClipboardFormatId::NONE ) { - SfxFilterFlags nMust = SfxFilterFlags::IMPORT, nDont = SFX_FILTER_NOTINSTALLED; - if ( bTemplate ) - // template filter was preselected, try to verify - nMust |= SfxFilterFlags::TEMPLATEPATH; - else - // template filters shouldn't be detected if not explicitly asked for - nDont |= SfxFilterFlags::TEMPLATEPATH; + SfxFilterFlags nMust = SfxFilterFlags::IMPORT; + // template filters shouldn't be detected if not explicitly asked for + SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED | SfxFilterFlags::TEMPLATEPATH; // get filter from storage MediaType std::shared_ptr pFilter = aMatcher.GetFilter4ClipBoardId( nClipId, nMust, nDont ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 7bfb7694ad1b..be33d0c97d62 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2280,7 +2280,7 @@ void SfxViewFrame::Resize( bool bForce ) #define LINE_SEP 0x0A -void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, bool bEraseTrailingEmptyLines ) +void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines ) { sal_Int32 nStartPos = 0; sal_Int32 nLine = 0; @@ -2308,7 +2308,8 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, bool bEra rStr = rStr.copy( 0, nStartPos ) + rStr.copy( nEndPos ); } - if ( bEraseTrailingEmptyLines && nStartPos != -1 ) + // erase trailing lines + if ( nStartPos != -1 ) { sal_Int32 n = nStartPos; sal_Int32 nLen = rStr.getLength(); @@ -2393,7 +2394,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) pMethod->GetLineRange( nStart, nEnd ); sal_uIntPtr nlStart = nStart; sal_uIntPtr nlEnd = nEnd; - CutLines( aOUSource, nlStart-1, nlEnd-nlStart+1, true ); + CutLines( aOUSource, nlStart-1, nlEnd-nlStart+1 ); } } } -- cgit