Kaydet (Commit) e669f706 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constparams in i18npool,opencl,svl

Change-Id: I23368c3ce6d29c7b2e758e209e5a8315e82a2818
Reviewed-on: https://gerrit.libreoffice.org/40051Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 3ccaa4d9
......@@ -69,7 +69,7 @@ private:
css::uno::Reference < css::uno::XComponentContext > m_xContext;
/// @throws css::uno::RuntimeException
css::uno::Reference< css::i18n::XExtendedInputSequenceChecker >& SAL_CALL getInputSequenceChecker(sal_Char* rLanguage);
css::uno::Reference< css::i18n::XExtendedInputSequenceChecker >& SAL_CALL getInputSequenceChecker(sal_Char const * rLanguage);
static sal_Char* SAL_CALL getLanguageByScripType(sal_Unicode cChar, sal_Unicode nChar);
};
......
......@@ -97,7 +97,7 @@ private:
void clear();
/// @throws css::uno::RuntimeException
void loadBody( OUString &implName,
void loadBody( OUString const &implName,
css::uno::Reference< css::i18n::XExtendedTransliteration >& body );
/// @throws css::uno::RuntimeException
......
......@@ -37,7 +37,7 @@ struct WordBreakCache {
sal_Int32 size; // size of wordboundary
WordBreakCache();
bool equals(const sal_Unicode *str, Boundary& boundary); // checking cached string
bool equals(const sal_Unicode *str, Boundary const & boundary); // checking cached string
};
struct xdictionarydata
......@@ -80,7 +80,7 @@ private:
Boundary segmentCachedBoundary;
bool seekSegment(const OUString& rText, sal_Int32 pos, Boundary& boundary);
WordBreakCache& getCache(const sal_Unicode *text, Boundary& boundary);
WordBreakCache& getCache(const sal_Unicode *text, Boundary const & boundary);
bool exists(const sal_uInt32 u);
sal_Int32 getLongestMatch(const sal_Unicode *text, sal_Int32 len);
};
......
......@@ -68,7 +68,7 @@ public:
private:
uno::Reference<i18n::XBreakIterator> m_xBreak;
void doTestJapanese(uno::Reference< i18n::XBreakIterator > &xBreak);
void doTestJapanese(uno::Reference< i18n::XBreakIterator > const &xBreak);
};
void TestBreakIterator::testLineBreaking()
......@@ -949,7 +949,7 @@ void TestBreakIterator::testKhmer()
}
#endif
void TestBreakIterator::doTestJapanese(uno::Reference< i18n::XBreakIterator > &xBreak)
void TestBreakIterator::doTestJapanese(uno::Reference< i18n::XBreakIterator > const &xBreak)
{
lang::Locale aLocale;
aLocale.Language = "ja";
......
......@@ -217,7 +217,7 @@ static inline void printIndex1(FILE *source_fp, sal_Int16 *set)
#endif
}
static inline void printIndex2(FILE *source_fp, sal_Int16 *set)
static inline void printIndex2(FILE *source_fp, sal_Int16 const *set)
{
#ifndef DICT_JA_ZH_IN_DATAFILE
fputs ("static const sal_Int32 index2[] = {\n\t", source_fp);
......
......@@ -250,7 +250,7 @@ WordBreakCache::WordBreakCache() :
* Compare two unicode string,
*/
bool WordBreakCache::equals(const sal_Unicode* str, Boundary& boundary)
bool WordBreakCache::equals(const sal_Unicode* str, Boundary const & boundary)
{
// Different length, different string.
if (length != boundary.endPos - boundary.startPos) return false;
......@@ -332,7 +332,7 @@ static sal_Int16 JapaneseCharType(sal_Unicode c)
return KANJA;
}
WordBreakCache& xdictionary::getCache(const sal_Unicode *text, Boundary& wordBoundary)
WordBreakCache& xdictionary::getCache(const sal_Unicode *text, Boundary const & wordBoundary)
{
WordBreakCache& rCache = cache[text[0] & 0x1f];
......
......@@ -106,7 +106,7 @@ InputSequenceCheckerImpl::getLanguageByScripType(sal_Unicode cChar, sal_Unicode
}
Reference< XExtendedInputSequenceChecker >& SAL_CALL
InputSequenceCheckerImpl::getInputSequenceChecker(sal_Char* rLanguage)
InputSequenceCheckerImpl::getInputSequenceChecker(sal_Char const * rLanguage)
{
if (cachedItem && cachedItem->aLanguage == rLanguage) {
return cachedItem->xISC;
......
......@@ -595,7 +595,7 @@ namespace
class theTransBodyMutex : public rtl::Static<osl::Mutex, theTransBodyMutex> {};
}
void TransliterationImpl::loadBody( OUString &implName, Reference<XExtendedTransliteration>& body )
void TransliterationImpl::loadBody( OUString const &implName, Reference<XExtendedTransliteration>& body )
{
assert(!implName.isEmpty());
::osl::MutexGuard guard(theTransBodyMutex::get());
......
......@@ -114,7 +114,7 @@ public:
sal_uInt16 GetCount() const { return nAnzStrings;}
Color* GetColor() const { return pColor; }
void SetColor( Color* pCol, OUString& rName )
void SetColor( Color* pCol, OUString const & rName )
{ pColor = pCol; sColorName = rName; }
const OUString& GetColorName() const { return sColorName; }
......@@ -561,8 +561,8 @@ private:
// check subcondition
// OP undefined => -1
// else 0 or 1
SVL_DLLPRIVATE static short ImpCheckCondition(double& fNumber,
double& fLimit,
SVL_DLLPRIVATE static short ImpCheckCondition(double fNumber,
double fLimit,
SvNumberformatLimitOps eOp);
// Helper function for number strings
......
......@@ -401,7 +401,7 @@ public:
}
};
inline ds_status writeProfile(const OUString& rStreamName, std::unique_ptr<ds_profile>& pProfile)
inline ds_status writeProfile(const OUString& rStreamName, std::unique_ptr<ds_profile> const & pProfile)
{
if (pProfile == nullptr)
return DS_INVALID_PROFILE;
......@@ -470,7 +470,7 @@ inline ds_status writeProfile(const OUString& rStreamName, std::unique_ptr<ds_pr
return DS_SUCCESS;
}
inline ds_status readProfile(const OUString& rStreamName, std::unique_ptr<ds_profile>& pProfile)
inline ds_status readProfile(const OUString& rStreamName, std::unique_ptr<ds_profile> const & pProfile)
{
ds_status eStatus = DS_SUCCESS;
......
......@@ -149,7 +149,7 @@ void timerStart(timer* mytimer)
}
/* Timer functions - get current value */
double timerCurrent(timer* mytimer)
double timerCurrent(timer const * mytimer)
{
#ifdef _WIN32
LARGE_INTEGER stop, frequency;
......@@ -181,7 +181,7 @@ double random(double min, double max)
}
/* Populate input */
void populateInput(std::unique_ptr<LibreOfficeDeviceEvaluationIO>& testData)
void populateInput(std::unique_ptr<LibreOfficeDeviceEvaluationIO> const & testData)
{
double* input0 = &testData->input0[0];
double* input1 = &testData->input1[0];
......@@ -197,7 +197,7 @@ void populateInput(std::unique_ptr<LibreOfficeDeviceEvaluationIO>& testData)
}
/* Evaluate devices */
ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOfficeDeviceEvaluationIO>& testData)
ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOfficeDeviceEvaluationIO> const & testData)
{
if (rDevice.eType == DeviceType::OpenCLDevice)
{
......@@ -377,7 +377,7 @@ ds_status evaluateScoreForDevice(ds_device& rDevice, std::unique_ptr<LibreOffice
return DS_SUCCESS;
}
ds_status profileDevices(std::unique_ptr<ds_profile>& pProfile, std::unique_ptr<LibreOfficeDeviceEvaluationIO>& pTestData)
ds_status profileDevices(std::unique_ptr<ds_profile> const & pProfile, std::unique_ptr<LibreOfficeDeviceEvaluationIO> const & pTestData)
{
ds_status status = DS_SUCCESS;
......@@ -397,7 +397,7 @@ ds_status profileDevices(std::unique_ptr<ds_profile>& pProfile, std::unique_ptr<
}
/* Pick best device */
ds_status pickBestDevice(std::unique_ptr<ds_profile>& profile, int& rBestDeviceIndex)
ds_status pickBestDevice(std::unique_ptr<ds_profile> const & profile, int& rBestDeviceIndex)
{
double bestScore = DBL_MAX;
......@@ -469,7 +469,7 @@ ds_status pickBestDevice(std::unique_ptr<ds_profile>& profile, int& rBestDeviceI
}
/* Return device ID for matching device name */
int matchDevice(std::unique_ptr<ds_profile>& profile, char* deviceName)
int matchDevice(std::unique_ptr<ds_profile> const & profile, char* deviceName)
{
int deviceMatch = -1;
for (unsigned int d = 0; d < profile->devices.size() - 1; d++)
......@@ -517,7 +517,7 @@ public:
};
void writeDevicesLog(std::unique_ptr<ds_profile>& rProfile, OUString const & sProfilePath, int nSelectedIndex)
void writeDevicesLog(std::unique_ptr<ds_profile> const & rProfile, OUString const & sProfilePath, int nSelectedIndex)
{
OUString aCacheFile(sProfilePath + "opencl_devices.log");
LogWriter aWriter(aCacheFile);
......
......@@ -84,7 +84,7 @@ private:
const OUString& sCode,
double fPreviewNumber,
LanguageType eLang,
OUString& sExpected);
OUString const & sExpected);
void checkDateInput( SvNumberFormatter& rFormatter, const char* pTimezone, const char* pIsoDate );
std::unique_ptr<icu::TimeZone> m_pDefaultTimeZone;
};
......@@ -393,7 +393,7 @@ void Test::checkPreviewString(SvNumberFormatter& aFormatter,
const OUString& sCode,
double fPreviewNumber,
LanguageType eLang,
OUString& sExpected)
OUString const & sExpected)
{
OUString sStr;
Color* pColor = nullptr;
......
......@@ -340,7 +340,7 @@ const SEC_ASN1Template TimeStampReq_Template[] =
{ 0, 0, nullptr, 0 }
};
size_t AppendToBuffer(char *ptr, size_t size, size_t nmemb, void *userdata)
size_t AppendToBuffer(char const *ptr, size_t size, size_t nmemb, void *userdata)
{
OStringBuffer *pBuffer = static_cast<OStringBuffer*>(userdata);
pBuffer->append(ptr, size*nmemb);
......
......@@ -259,7 +259,7 @@ css::task::UrlRecord find(
OUString const & GetMasterPassword( const css::uno::Reference< css::task::XInteractionHandler >& Handler );
/// @throws css::uno::RuntimeException
void UpdateVector( const OUString& url, ::std::list< NamePassRecord >& toUpdate, NamePassRecord& rec, bool writeFile );
void UpdateVector( const OUString& url, ::std::list< NamePassRecord >& toUpdate, NamePassRecord const & rec, bool writeFile );
/// @throws css::uno::RuntimeException
void PrivateAdd( const OUString& aUrl,
......
......@@ -163,11 +163,11 @@ struct SfxItemPool_Impl
}
void readTheItems(SvStream & rStream, sal_uInt32 nCount, sal_uInt16 nVersion,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr);
SfxPoolItem const * pDefItem, SfxPoolItemArray_Impl ** pArr);
// unit testing
friend class PoolItemTest;
static SfxItemPool_Impl *GetImpl(SfxItemPool *pPool) { return pPool->pImpl.get(); }
static SfxItemPool_Impl *GetImpl(SfxItemPool const *pPool) { return pPool->pImpl.get(); }
};
......
......@@ -379,7 +379,7 @@ bool SfxItemPool::IsInRange( sal_uInt16 nWhich ) const
// This had to be moved to a method of its own to keep Solaris GCC happy:
void SfxItemPool_Impl::readTheItems (
SvStream & rStream, sal_uInt32 nItemCount, sal_uInt16 nVer,
SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** ppArr)
SfxPoolItem const * pDefItem, SfxPoolItemArray_Impl ** ppArr)
{
SfxMultiRecordReader aItemsRec( &rStream, SFX_ITEMPOOL_REC_ITEMS );
......
......@@ -134,7 +134,7 @@ void ImpSvNumberInputScan::Reset()
}
// native number transliteration if necessary
void TransformInput( SvNumberFormatter* pFormatter, OUString& rStr )
void TransformInput( SvNumberFormatter const * pFormatter, OUString& rStr )
{
sal_Int32 nPos, nLen;
for ( nPos = 0, nLen = rStr.getLength(); nPos < nLen; ++nPos )
......
......@@ -173,7 +173,7 @@ public:
void Insert( SvNumberFormatter* pThis )
{ aFormatters.push_back( pThis ); }
void Remove( SvNumberFormatter* pThis );
void Remove( SvNumberFormatter const * pThis );
size_t Count()
{ return aFormatters.size(); }
......@@ -194,7 +194,7 @@ SvNumberFormatterRegistry_Impl::~SvNumberFormatterRegistry_Impl()
}
void SvNumberFormatterRegistry_Impl::Remove( SvNumberFormatter* pThis )
void SvNumberFormatterRegistry_Impl::Remove( SvNumberFormatter const * pThis )
{
for (SvNumberFormatterList_impl::iterator it = aFormatters.begin();
it != aFormatters.end(); ++it)
......
......@@ -1980,8 +1980,8 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, OUString& OutString)
}
}
short SvNumberformat::ImpCheckCondition(double& fNumber,
double& fLimit,
short SvNumberformat::ImpCheckCondition(double fNumber,
double fLimit,
SvNumberformatLimitOps eOp)
{
switch(eOp)
......
......@@ -545,7 +545,7 @@ OUString PasswordContainer::EncodePasswords(const vector< OUString >& lines, con
throw RuntimeException("Can't encode!" );
}
void PasswordContainer::UpdateVector( const OUString& aURL, list< NamePassRecord >& toUpdate, NamePassRecord& aRecord, bool writeFile )
void PasswordContainer::UpdateVector( const OUString& aURL, list< NamePassRecord >& toUpdate, NamePassRecord const & aRecord, bool writeFile )
{
for( list< NamePassRecord >::iterator aNPIter = toUpdate.begin(); aNPIter != toUpdate.end(); ++aNPIter )
if( aNPIter->GetUserName() == aRecord.GetUserName() )
......
......@@ -1281,7 +1281,7 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
}
/// Returns a JSON representation of pAction.
boost::property_tree::ptree lcl_ActionToJson(size_t nIndex, SfxUndoAction* pAction)
boost::property_tree::ptree lcl_ActionToJson(size_t nIndex, SfxUndoAction const * pAction)
{
boost::property_tree::ptree aRet;
aRet.put("index", nIndex);
......
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