diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-09 11:06:42 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-09-09 11:27:23 +0000 |
commit | cb958bb5e0e81d343c91c08a8513006a7bf1d913 (patch) | |
tree | 376b6bdfd1e4be0851f5eba9092588cfde451945 | |
parent | f4fcec5f0802620192c31aad24db436ead1b2036 (diff) |
loplugin:constantparam in sot..svl
Change-Id: I08db2db3b90725c556e3ba062da5d62d98f6e882
Reviewed-on: https://gerrit.libreoffice.org/28769
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 2 | ||||
-rw-r--r-- | include/sot/stg.hxx | 6 | ||||
-rw-r--r-- | include/store/store.hxx | 7 | ||||
-rw-r--r-- | include/svl/grabbagitem.hxx | 2 | ||||
-rw-r--r-- | include/svl/ondemand.hxx | 5 | ||||
-rw-r--r-- | include/svl/style.hxx | 2 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 2 | ||||
-rw-r--r-- | registry/source/regimpl.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drawview.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/stg.cxx | 5 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 8 | ||||
-rw-r--r-- | starmath/inc/caret.hxx | 5 | ||||
-rw-r--r-- | starmath/source/caret.cxx | 5 | ||||
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 4 | ||||
-rw-r--r-- | stoc/source/corereflection/lrucache.hxx | 6 | ||||
-rw-r--r-- | svl/source/items/grabbagitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/misc/strmadpt.cxx | 15 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 3 |
18 files changed, 32 insertions, 53 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 596d4715429f..65866a3f09e7 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1293,7 +1293,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v pImpEditEngine->xLocaleDataWrapper.changeLocale( aLanguageTag); if (!pImpEditEngine->xTransliterationWrapper.isInitialized()) - pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang, i18n::TransliterationModules_IGNORE_CASE); + pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang); else pImpEditEngine->xTransliterationWrapper.changeLocale( eLang); diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx index 2654fd7a74ca..9439c289c875 100644 --- a/include/sot/stg.hxx +++ b/include/sot/stg.hxx @@ -101,7 +101,7 @@ public: virtual bool Revert() = 0; virtual BaseStorageStream* OpenStream( const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, - bool bDirect = true, const OString* pKey=nullptr ) = 0; + bool bDirect = true ) = 0; virtual BaseStorage* OpenStorage( const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) = 0; @@ -189,7 +189,7 @@ public: virtual bool Revert() override; virtual BaseStorageStream* OpenStream( const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, - bool bDirect = true, const OString* pKey=nullptr ) override; + bool bDirect = true ) override; virtual BaseStorage* OpenStorage( const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; @@ -292,7 +292,7 @@ public: virtual bool Revert() override; virtual BaseStorageStream* OpenStream( const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, - bool bDirect = true, const OString* pKey=nullptr ) override; + bool bDirect = true ) override; virtual BaseStorage* OpenStorage( const OUString & rEleName, StreamMode = StreamMode::STD_READWRITE, bool bDirect = false ) override; diff --git a/include/store/store.hxx b/include/store/store.hxx index 672b2196dc5e..012afd1ab9b2 100644 --- a/include/store/store.hxx +++ b/include/store/store.hxx @@ -299,17 +299,16 @@ public: /** Open the file. @see store_openFile() */ - inline storeError create ( + inline storeError create( rtl::OUString const & rFilename, - storeAccessMode eAccessMode, - sal_uInt16 nPageSize = STORE_DEFAULT_PAGESIZE) + storeAccessMode eAccessMode ) { if (m_hImpl) { (void) store_releaseHandle (m_hImpl); m_hImpl = nullptr; } - return store_openFile (rFilename.pData, eAccessMode, nPageSize, &m_hImpl); + return store_openFile (rFilename.pData, eAccessMode, STORE_DEFAULT_PAGESIZE, &m_hImpl); } /** Open the temporary file in memory. diff --git a/include/svl/grabbagitem.hxx b/include/svl/grabbagitem.hxx index 5f459e894990..9cbba772cb37 100644 --- a/include/svl/grabbagitem.hxx +++ b/include/svl/grabbagitem.hxx @@ -24,7 +24,7 @@ private: public: SfxGrabBagItem(); - SfxGrabBagItem(sal_uInt16 nWhich, const std::map<OUString, css::uno::Any>* pMap = nullptr); + SfxGrabBagItem(sal_uInt16 nWhich ); SfxGrabBagItem(const SfxGrabBagItem& rItem); virtual ~SfxGrabBagItem(); diff --git a/include/svl/ondemand.hxx b/include/svl/ondemand.hxx index a7d183fc928a..5019795e0173 100644 --- a/include/svl/ondemand.hxx +++ b/include/svl/ondemand.hxx @@ -219,12 +219,11 @@ public: void init( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - LanguageType eLang, - css::i18n::TransliterationModules nTypeP + LanguageType eLang ) { m_xContext = rxContext; - nType = nTypeP; + nType = css::i18n::TransliterationModules_IGNORE_CASE; changeLocale( eLang ); if ( pPtr ) { diff --git a/include/svl/style.hxx b/include/svl/style.hxx index 2b6d586a38cc..ddff30a67a31 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -306,7 +306,7 @@ enum SfxStyleSheetHintId class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint { public: - SfxStyleSheetPoolHint(SfxStyleSheetHintId ) {} + SfxStyleSheetPoolHint() {} }; diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index e367edbe53da..75e64bc940b8 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -475,7 +475,7 @@ RegError ORegistry::initRegistry(const OUString& regName, RegAccessMode accessMo } else { - errCode = rRegFile.create(regName, sAccessMode, REG_PAGESIZE); + errCode = rRegFile.create(regName, sAccessMode); } if (errCode) diff --git a/registry/source/regimpl.hxx b/registry/source/regimpl.hxx index 9abe5fbe9163..b375318f359f 100644 --- a/registry/source/regimpl.hxx +++ b/registry/source/regimpl.hxx @@ -28,8 +28,6 @@ #include <osl/mutex.hxx> #include <store/store.hxx> -#define REG_PAGESIZE 512 - // 5 bytes = 1 (byte for the type) + 4 (bytes for the size of the data) #define VALUE_HEADERSIZE 5 #define VALUE_TYPEOFFSET 1 diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index f2f0bcf4f8be..2e9e42cd92d0 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -116,7 +116,7 @@ void DrawView::ModelHasChanged() // force framer to rerender SfxStyleSheetBasePool* pSSPool = mrDoc.GetStyleSheetPool(); - pSSPool->Broadcast(SfxStyleSheetPoolHint(SfxStyleSheetHintId::CREATED)); + pSSPool->Broadcast(SfxStyleSheetPoolHint()); if( mpDrawViewShell ) mpDrawViewShell->ModelHasChanged(); diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 26703ff5fd15..fefd677b1bb6 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -601,11 +601,8 @@ BaseStorage* Storage::OpenStorage( const OUString& rName, StreamMode m, bool bDi // Open a stream -BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, bool, - const OString* pB ) +BaseStorageStream* Storage::OpenStream( const OUString& rName, StreamMode m, bool ) { - DBG_ASSERT(!pB, "Encryption not supported"); - if( !Validate() || !ValidateMode( m ) ) return new StorageStream( pIo, nullptr, m ); StgDirEntry* p = pIo->m_pTOC->Find( *pEntry, rName ); diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 7ea86ab09978..1056ce20dcf0 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -2615,7 +2615,7 @@ bool UCBStorage::Revert() return pImp->Revert(); } -BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode nMode, bool bDirect, const OString* pKey ) +BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode nMode, bool bDirect ) { if( rEleName.isEmpty() ) return nullptr; @@ -2631,7 +2631,7 @@ BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode OUString aName( pImp->m_aURL ); aName += "/"; aName += rEleName; - UCBStorageStream* pStream = new UCBStorageStream( aName, nMode, bDirect, pKey, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); + UCBStorageStream* pStream = new UCBStorageStream( aName, nMode, bDirect, nullptr, pImp->m_bRepairPackage, pImp->m_xProgressHandler ); pStream->SetError( GetError() ); pStream->pImp->m_aName = rEleName; return pStream; @@ -2662,8 +2662,6 @@ BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode // check if stream is opened with the same keyword as before // if not, generate a new stream because it could be encrypted vs. decrypted! OString aKey; - if ( pKey ) - aKey = *pKey; if ( pElement->m_xStream->m_aKey == aKey ) { pElement->m_xStream->PrepareCachedForReopen( nMode ); @@ -2674,7 +2672,7 @@ BaseStorageStream* UCBStorage::OpenStream( const OUString& rEleName, StreamMode } // stream is opened the first time - pImp->OpenStream( pElement, nMode, bDirect, pKey ); + pImp->OpenStream( pElement, nMode, bDirect, nullptr ); // if name has been changed before creating the stream: set name! pElement->m_xStream->m_aName = rEleName; diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx index c1ef793a9242..e2c648643008 100644 --- a/starmath/inc/caret.hxx +++ b/starmath/inc/caret.hxx @@ -130,11 +130,10 @@ public: ~SmCaretPosGraph(); /** Add a caret position - * @remarks If left and/or right are set NULL, they will point back to the entry. + * @remarks If left is NULL, they will point back to the entry. */ SmCaretPosGraphEntry* Add(SmCaretPos pos, - SmCaretPosGraphEntry* left = nullptr, - SmCaretPosGraphEntry* right = nullptr); + SmCaretPosGraphEntry* left = nullptr); std::vector<std::unique_ptr<SmCaretPosGraphEntry>>::iterator begin() { diff --git a/starmath/source/caret.cxx b/starmath/source/caret.cxx index 1a79d50d3c2b..5119914a8c54 100644 --- a/starmath/source/caret.cxx +++ b/starmath/source/caret.cxx @@ -15,11 +15,10 @@ SmCaretPosGraph::SmCaretPosGraph() = default; SmCaretPosGraph::~SmCaretPosGraph() = default; SmCaretPosGraphEntry* SmCaretPosGraph::Add(SmCaretPos pos, - SmCaretPosGraphEntry* left, - SmCaretPosGraphEntry* right) + SmCaretPosGraphEntry* left) { SAL_WARN_IF( pos.Index < 0, "starmath", "Index shouldn't be -1!" ); - auto entry = o3tl::make_unique<SmCaretPosGraphEntry>(pos, left, right); + auto entry = o3tl::make_unique<SmCaretPosGraphEntry>(pos, left, nullptr); SmCaretPosGraphEntry* e = entry.get(); //Set Left and Right to point to the entry itself if they are NULL entry->Left = entry->Left ? entry->Left : e; diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 9275e453c40e..54a3a452faee 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -43,8 +43,6 @@ using namespace osl; namespace stoc_corefl { -static const sal_Int32 CACHE_SIZE = 256; - #define IMPLNAME "com.sun.star.comp.stoc.CoreReflection" static Sequence< OUString > core_getSupportedServiceNames() @@ -61,7 +59,7 @@ static OUString core_getImplementationName() IdlReflectionServiceImpl::IdlReflectionServiceImpl( const Reference< XComponentContext > & xContext ) : OComponentHelper( _aComponentMutex ) - , _aElements( CACHE_SIZE ) + , _aElements() { xContext->getValueByName( "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) >>= _xTDMgr; diff --git a/stoc/source/corereflection/lrucache.hxx b/stoc/source/corereflection/lrucache.hxx index 13f4803ca085..a36ba830e779 100644 --- a/stoc/source/corereflection/lrucache.hxx +++ b/stoc/source/corereflection/lrucache.hxx @@ -58,7 +58,7 @@ public: <br> @param nCachedElements number of elements to be cached; default param set to 128 */ - explicit inline LRU_Cache( sal_Int32 nCachedElements = 128 ); + explicit inline LRU_Cache(); /** Destructor: releases all cached elements and keys. <br> */ @@ -84,11 +84,11 @@ public: }; template< class t_Key, class t_Val, class t_KeyHash > -inline LRU_Cache< t_Key, t_Val, t_KeyHash >::LRU_Cache( sal_Int32 nCachedElements ) +inline LRU_Cache< t_Key, t_Val, t_KeyHash >::LRU_Cache() #ifdef __CACHE_DIAGNOSE : _nCachedElements( 4 ) #else - : _nCachedElements( nCachedElements ) + : _nCachedElements( 256 ) #endif , _pBlock( nullptr ) , _pHead( nullptr ) diff --git a/svl/source/items/grabbagitem.cxx b/svl/source/items/grabbagitem.cxx index c9eb63450bb3..30f583e3f045 100644 --- a/svl/source/items/grabbagitem.cxx +++ b/svl/source/items/grabbagitem.cxx @@ -21,11 +21,9 @@ SfxGrabBagItem::SfxGrabBagItem() { } -SfxGrabBagItem::SfxGrabBagItem(sal_uInt16 nWhich, const std::map<OUString, uno::Any>* pMap) : +SfxGrabBagItem::SfxGrabBagItem(sal_uInt16 nWhich) : SfxPoolItem(nWhich) { - if (pMap) - m_aMap = *pMap; } SfxGrabBagItem::SfxGrabBagItem(const SfxGrabBagItem& rItem) : diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index f8ae73263b02..9b784ca2a958 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -70,10 +70,7 @@ private: void remove(Page * pPage); public: - inline SvDataPipe_Impl(sal_uInt32 nThePageSize = 1000, - sal_uInt32 nTheMinPages = 100, - sal_uInt32 nTheMaxPages - = std::numeric_limits< sal_uInt32 >::max()); + inline SvDataPipe_Impl(); ~SvDataPipe_Impl(); @@ -92,9 +89,7 @@ public: SeekResult setReadPosition(sal_uInt32 nPosition); }; -SvDataPipe_Impl::SvDataPipe_Impl(sal_uInt32 nThePageSize, - sal_uInt32 nTheMinPages, - sal_uInt32 nTheMaxPages) +SvDataPipe_Impl::SvDataPipe_Impl() : m_pFirstPage( nullptr ) , m_pReadPage( nullptr ) , m_pWritePage( nullptr ) @@ -102,11 +97,11 @@ SvDataPipe_Impl::SvDataPipe_Impl(sal_uInt32 nThePageSize, , m_nReadBufferSize( 0 ) , m_nReadBufferFilled( 0 ) , m_nPageSize(std::min< sal_uInt32 >( - std::max< sal_uInt32 >(nThePageSize, sal_uInt32(1)), + 1000, sal_uInt32(std::numeric_limits< sal_uInt32 >::max() - sizeof (Page) + 1))) - , m_nMinPages(std::max< sal_uInt32 >(nTheMinPages, sal_uInt32(1))) - , m_nMaxPages(std::max< sal_uInt32 >(nTheMaxPages, sal_uInt32(1))) + , m_nMinPages(100) + , m_nMaxPages(std::numeric_limits< sal_uInt32 >::max()) , m_nPages( 0 ) , m_bEOF( false ) {} diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 37ac0a3779a9..8574b6ffdc65 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -302,8 +302,7 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang ) pCharClass = new CharClass( m_xContext, maLanguageTag ); xLocaleData.init( m_xContext, maLanguageTag ); xCalendar.init( m_xContext, maLanguageTag.getLocale() ); - xTransliteration.init( m_xContext, eLang, - css::i18n::TransliterationModules_IGNORE_CASE ); + xTransliteration.init( m_xContext, eLang ); xNatNum.init( m_xContext ); // cached locale data items |