Kaydet (Commit) cb958bb5 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:constantparam in sot..svl

Change-Id: I08db2db3b90725c556e3ba062da5d62d98f6e882
Reviewed-on: https://gerrit.libreoffice.org/28769Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst f4fcec5f
......@@ -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);
......
......@@ -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;
......
......@@ -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.
......
......@@ -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();
......
......@@ -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 )
{
......
......@@ -306,7 +306,7 @@ enum SfxStyleSheetHintId
class SVL_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint
{
public:
SfxStyleSheetPoolHint(SfxStyleSheetHintId ) {}
SfxStyleSheetPoolHint() {}
};
......
......@@ -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)
......
......@@ -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
......
......@@ -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();
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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()
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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) :
......
......@@ -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 )
{}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment