[Libreoffice-commits] core.git: 4 commits - basic/source editeng/source include/basic include/editeng include/svl
Michael Stahl
mstahl at redhat.com
Fri Jul 17 11:38:00 PDT 2015
basic/source/sbx/sbxbase.cxx | 14 ++--
basic/source/sbx/sbxvar.cxx | 12 ++-
editeng/source/misc/svxacorr.cxx | 134 ++++++++++++++++++---------------------
include/basic/sbx.hxx | 6 -
include/editeng/svxacorr.hxx | 4 -
include/svl/currencytable.hxx | 5 +
6 files changed, 88 insertions(+), 87 deletions(-)
New commits:
commit 22b23819875eb04ca0bba402fb676c530de97726
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 17 18:20:20 2015 +0200
editeng: pointless code
Change-Id: Ice4f34ce60b0f4af97a985f4203a705523c0626b
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 6e7f52d..cfeea48 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -222,11 +222,6 @@ static CollatorWrapper& GetCollatorWrapper()
return aCollWrp;
}
-static void lcl_ClearTable(std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>>& rLangTable)
-{
- rLangTable.clear();
-}
-
bool SvxAutoCorrect::IsAutoCorrectChar( sal_Unicode cChar )
{
return cChar == '\0' || cChar == '\t' || cChar == 0x0a ||
@@ -316,7 +311,6 @@ SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy )
SvxAutoCorrect::~SvxAutoCorrect()
{
- lcl_ClearTable(*m_pLangTable);
delete m_pLangTable;
delete pCharClass;
}
commit 9b1e55fe02dbdffadf08f6ede88f68b3cabae9fa
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 17 18:19:29 2015 +0200
editeng: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: I343071cc29c2041bc98456954b0aa32fff324d82
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 635c751..6e7f52d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -222,7 +222,7 @@ static CollatorWrapper& GetCollatorWrapper()
return aCollWrp;
}
-static void lcl_ClearTable(boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>& rLangTable)
+static void lcl_ClearTable(std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>>& rLangTable)
{
rLangTable.clear();
}
@@ -281,7 +281,7 @@ SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile,
const OUString& rUserAutocorrFile )
: sShareAutoCorrFile( rShareAutocorrFile )
, sUserAutoCorrFile( rUserAutocorrFile )
- , pLangTable( new boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists> )
+ , m_pLangTable( new std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>> )
, pCharClass( 0 )
, bRunNext( false )
, eCharClassLang( LANGUAGE_DONTKNOW )
@@ -299,7 +299,7 @@ SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy )
: sShareAutoCorrFile( rCpy.sShareAutoCorrFile )
, sUserAutoCorrFile( rCpy.sUserAutoCorrFile )
, aSwFlags( rCpy.aSwFlags )
- , pLangTable( new boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists> )
+ , m_pLangTable( new std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>> )
, pCharClass( 0 )
, bRunNext( false )
, eCharClassLang(rCpy.eCharClassLang)
@@ -316,8 +316,8 @@ SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy )
SvxAutoCorrect::~SvxAutoCorrect()
{
- lcl_ClearTable(*pLangTable);
- delete pLangTable;
+ lcl_ClearTable(*m_pLangTable);
+ delete m_pLangTable;
delete pCharClass;
}
@@ -1434,16 +1434,16 @@ SvxAutoCorrectLanguageLists& SvxAutoCorrect::_GetLanguageList(
LanguageType eLang )
{
LanguageTag aLanguageTag( eLang);
- if (pLangTable->find(aLanguageTag) == pLangTable->end())
+ if (m_pLangTable->find(aLanguageTag) == m_pLangTable->end())
(void)CreateLanguageFile(aLanguageTag, true);
- return *(pLangTable->find(aLanguageTag)->second);
+ return *(m_pLangTable->find(aLanguageTag)->second);
}
void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang )
{
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>::iterator nTmpVal = pLangTable->find(LanguageTag(eLang));
- if(nTmpVal != pLangTable->end() && nTmpVal->second)
- nTmpVal->second->SaveCplSttExceptList();
+ auto const iter = m_pLangTable->find(LanguageTag(eLang));
+ if (iter != m_pLangTable->end() && iter->second)
+ iter->second->SaveCplSttExceptList();
#ifdef DBG_UTIL
else
{
@@ -1454,9 +1454,9 @@ void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang )
void SvxAutoCorrect::SaveWrdSttExceptList(LanguageType eLang)
{
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>::iterator nTmpVal = pLangTable->find(LanguageTag(eLang));
- if(nTmpVal != pLangTable->end() && nTmpVal->second)
- nTmpVal->second->SaveWrdSttExceptList();
+ auto const iter = m_pLangTable->find(LanguageTag(eLang));
+ if (iter != m_pLangTable->end() && iter->second)
+ iter->second->SaveWrdSttExceptList();
#ifdef DBG_UTIL
else
{
@@ -1471,17 +1471,17 @@ bool SvxAutoCorrect::AddCplSttException( const OUString& rNew,
{
SvxAutoCorrectLanguageLists* pLists = 0;
// either the right language is present or it will be this in the general list
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>::iterator nTmpVal = pLangTable->find(LanguageTag(eLang));
- if(nTmpVal != pLangTable->end())
- pLists = nTmpVal->second;
+ auto iter = m_pLangTable->find(LanguageTag(eLang));
+ if (iter != m_pLangTable->end())
+ pLists = iter->second.get();
else
{
LanguageTag aLangTagUndetermined( LANGUAGE_UNDETERMINED);
- nTmpVal = pLangTable->find(aLangTagUndetermined);
- if(nTmpVal != pLangTable->end())
- pLists = nTmpVal->second;
+ iter = m_pLangTable->find(aLangTagUndetermined);
+ if (iter != m_pLangTable->end())
+ pLists = iter->second.get();
else if(CreateLanguageFile(aLangTagUndetermined, true))
- pLists = pLangTable->find(aLangTagUndetermined)->second;
+ pLists = m_pLangTable->find(aLangTagUndetermined)->second.get();
}
OSL_ENSURE(pLists, "No auto correction data");
return pLists && pLists->AddToCplSttExceptList(rNew);
@@ -1493,17 +1493,17 @@ bool SvxAutoCorrect::AddWrtSttException( const OUString& rNew,
{
SvxAutoCorrectLanguageLists* pLists = 0;
//either the right language is present or it is set in the general list
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>::iterator nTmpVal = pLangTable->find(LanguageTag(eLang));
- if(nTmpVal != pLangTable->end())
- pLists = nTmpVal->second;
+ auto iter = m_pLangTable->find(LanguageTag(eLang));
+ if (iter != m_pLangTable->end())
+ pLists = iter->second.get();
else
{
LanguageTag aLangTagUndetermined( LANGUAGE_UNDETERMINED);
- nTmpVal = pLangTable->find(aLangTagUndetermined);
- if(nTmpVal != pLangTable->end())
- pLists = nTmpVal->second;
+ iter = m_pLangTable->find(aLangTagUndetermined);
+ if (iter != m_pLangTable->end())
+ pLists = iter->second.get();
else if(CreateLanguageFile(aLangTagUndetermined, true))
- pLists = pLangTable->find(aLangTagUndetermined)->second;
+ pLists = m_pLangTable->find(aLangTagUndetermined)->second.get();
}
OSL_ENSURE(pLists, "No auto correction file!");
return pLists && pLists->AddToWrdSttExceptList(rNew);
@@ -1556,7 +1556,7 @@ bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc,
bool SvxAutoCorrect::CreateLanguageFile( const LanguageTag& rLanguageTag, bool bNewFile )
{
- OSL_ENSURE(pLangTable->find(rLanguageTag) == pLangTable->end(), "Language already exists ");
+ OSL_ENSURE(m_pLangTable->find(rLanguageTag) == m_pLangTable->end(), "Language already exists ");
OUString sUserDirFile( GetAutoCorrFileName( rLanguageTag, true, false, false ));
OUString sShareDirFile( sUserDirFile );
@@ -1577,7 +1577,7 @@ bool SvxAutoCorrect::CreateLanguageFile( const LanguageTag& rLanguageTag, bool b
sShareDirFile = sUserDirFile;
pLists = new SvxAutoCorrectLanguageLists( *this, sShareDirFile, sUserDirFile );
LanguageTag aTmp(rLanguageTag); // this insert() needs a non-const reference
- pLangTable->insert(aTmp, pLists);
+ m_pLangTable->insert(std::make_pair(aTmp, std::unique_ptr<SvxAutoCorrectLanguageLists>(pLists)));
aLastFileTable.erase(nFndPos);
}
}
@@ -1593,7 +1593,7 @@ bool SvxAutoCorrect::CreateLanguageFile( const LanguageTag& rLanguageTag, bool b
{
pLists = new SvxAutoCorrectLanguageLists( *this, sShareDirFile, sUserDirFile );
LanguageTag aTmp(rLanguageTag); // this insert() needs a non-const reference
- pLangTable->insert(aTmp, pLists);
+ m_pLangTable->insert(std::make_pair(aTmp, std::unique_ptr<SvxAutoCorrectLanguageLists>(pLists)));
if (nFndPos != aLastFileTable.end())
aLastFileTable.erase(nFndPos);
}
@@ -1608,11 +1608,11 @@ bool SvxAutoCorrect::PutText( const OUString& rShort, const OUString& rLong,
LanguageType eLang )
{
LanguageTag aLanguageTag( eLang);
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>::iterator nTmpVal = pLangTable->find(aLanguageTag);
- if(nTmpVal != pLangTable->end())
- return nTmpVal->second->PutText(rShort, rLong);
+ auto const iter = m_pLangTable->find(aLanguageTag);
+ if (iter != m_pLangTable->end())
+ return iter->second->PutText(rShort, rLong);
if(CreateLanguageFile(aLanguageTag))
- return pLangTable->find(aLanguageTag)->second->PutText(rShort, rLong);
+ return m_pLangTable->find(aLanguageTag)->second->PutText(rShort, rLong);
return false;
}
@@ -1621,14 +1621,14 @@ bool SvxAutoCorrect::MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntr
LanguageType eLang )
{
LanguageTag aLanguageTag( eLang);
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>::iterator nTmpVal = pLangTable->find(aLanguageTag);
- if(nTmpVal != pLangTable->end())
+ auto const iter = m_pLangTable->find(aLanguageTag);
+ if (iter != m_pLangTable->end())
{
- return nTmpVal->second->MakeCombinedChanges( aNewEntries, aDeleteEntries );
+ return iter->second->MakeCombinedChanges( aNewEntries, aDeleteEntries );
}
else if(CreateLanguageFile( aLanguageTag ))
{
- return pLangTable->find( aLanguageTag )->second->MakeCombinedChanges( aNewEntries, aDeleteEntries );
+ return m_pLangTable->find( aLanguageTag )->second->MakeCombinedChanges( aNewEntries, aDeleteEntries );
}
return false;
@@ -1712,11 +1712,11 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
// First search for eLang, then US-English -> English
// and last in LANGUAGE_UNDETERMINED
- if(pLangTable->find(aLanguageTag) != pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
+ if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
- pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos );
+ std::unique_ptr<SvxAutoCorrectLanguageLists> const& pList = m_pLangTable->find(aLanguageTag)->second;
+ pRet = lcl_SearchWordsInList( pList.get(), rTxt, rStt, nEndPos );
if( pRet )
{
rLang = aLanguageTag;
@@ -1729,12 +1729,12 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
LanguageType eLang = aLanguageTag.getLanguageType();
LanguageType nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE
nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
- if(nTmpKey1 != eLang && (pLangTable->find(aLanguageTag.reset(nTmpKey1)) != pLangTable->end() ||
+ if(nTmpKey1 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey1)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
- pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos );
+ std::unique_ptr<SvxAutoCorrectLanguageLists> const& pList = m_pLangTable->find(aLanguageTag)->second;
+ pRet = lcl_SearchWordsInList( pList.get(), rTxt, rStt, nEndPos );
if( pRet )
{
rLang = aLanguageTag;
@@ -1742,12 +1742,12 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
}
}
- if(nTmpKey2 != eLang && (pLangTable->find(aLanguageTag.reset(nTmpKey2)) != pLangTable->end() ||
+ if (nTmpKey2 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey2)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
- pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos );
+ std::unique_ptr<SvxAutoCorrectLanguageLists> const& pList = m_pLangTable->find(aLanguageTag)->second;
+ pRet = lcl_SearchWordsInList( pList.get(), rTxt, rStt, nEndPos );
if( pRet )
{
rLang = aLanguageTag;
@@ -1755,12 +1755,12 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
}
}
- if(pLangTable->find(aLanguageTag.reset(LANGUAGE_UNDETERMINED)) != pLangTable->end() ||
+ if (m_pLangTable->find(aLanguageTag.reset(LANGUAGE_UNDETERMINED)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
- pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos );
+ std::unique_ptr<SvxAutoCorrectLanguageLists> const& pList = m_pLangTable->find(aLanguageTag)->second;
+ pRet = lcl_SearchWordsInList( pList.get(), rTxt, rStt, nEndPos );
if( pRet )
{
rLang = aLanguageTag;
@@ -1783,39 +1783,39 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
OUString sTemp(sWord);
- if(pLangTable->find(aLanguageTag) != pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
+ if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
+ auto const& pList = m_pLangTable->find(aLanguageTag)->second;
OUString _sTemp(sWord);
if(pList->GetWrdSttExceptList()->find(_sTemp) != pList->GetWrdSttExceptList()->end() )
return true;
}
// If it still could not be found here, then keep on searching
- if(nTmpKey1 != eLang && (pLangTable->find(aLanguageTag.reset(nTmpKey1)) != pLangTable->end() ||
+ if (nTmpKey1 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey1)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
+ auto const& pList = m_pLangTable->find(aLanguageTag)->second;
if(pList->GetWrdSttExceptList()->find(sTemp) != pList->GetWrdSttExceptList()->end() )
return true;
}
- if(nTmpKey2 != eLang && (pLangTable->find(aLanguageTag.reset(nTmpKey2)) != pLangTable->end() ||
+ if (nTmpKey2 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey2)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
+ auto const& pList = m_pLangTable->find(aLanguageTag)->second;
if(pList->GetWrdSttExceptList()->find(sTemp) != pList->GetWrdSttExceptList()->end() )
return true;
}
- if(pLangTable->find(aLanguageTag.reset(LANGUAGE_UNDETERMINED)) != pLangTable->end() ||
+ if (m_pLangTable->find(aLanguageTag.reset(LANGUAGE_UNDETERMINED)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
- SvxAutoCorrectLanguageLists* pList = pLangTable->find(aLanguageTag)->second;
+ auto const& pList = m_pLangTable->find(aLanguageTag)->second;
if(pList->GetWrdSttExceptList()->find(sTemp) != pList->GetWrdSttExceptList()->end() )
return true;
}
@@ -1869,37 +1869,37 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
OUString sTemp( sWord );
- if(pLangTable->find(aLanguageTag) != pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
+ if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
- const SvStringsISortDtor* pList = pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
+ const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
return true;
}
// If it still could not be found here, then keep on searching
- if(nTmpKey1 != eLang && (pLangTable->find(aLanguageTag.reset(nTmpKey1)) != pLangTable->end() ||
+ if(nTmpKey1 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey1)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
- const SvStringsISortDtor* pList = pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
+ const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
return true;
}
- if(nTmpKey2 != eLang && (pLangTable->find(aLanguageTag.reset(nTmpKey2)) != pLangTable->end() ||
+ if(nTmpKey2 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey2)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
- const SvStringsISortDtor* pList = pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
+ const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
return true;
}
- if(pLangTable->find(aLanguageTag.reset(LANGUAGE_UNDETERMINED)) != pLangTable->end() ||
+ if (m_pLangTable->find(aLanguageTag.reset(LANGUAGE_UNDETERMINED)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false))
{
//the language is available - so bring it on
- const SvStringsISortDtor* pList = pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
+ const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sTemp) != pList->end() )
return true;
}
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 41c1db3..0f8a467 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -32,7 +32,7 @@
#include <editeng/editengdllapi.h>
#include <map>
-#include <boost/ptr_container/ptr_map.hpp>
+#include <memory>
class CharClass;
class SfxPoolItem;
@@ -233,7 +233,7 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect
SvxSwAutoFormatFlags aSwFlags; // StarWriter AutoFormat Flags
// all languages in a table
- boost::ptr_map<LanguageTag, SvxAutoCorrectLanguageLists>* pLangTable;
+ std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>>* m_pLangTable;
std::map<LanguageTag, long> aLastFileTable;
CharClass* pCharClass;
commit 15f32b5a1ea289159703dd7b118a911c8d0da61d
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 17 17:44:51 2015 +0200
basic: replace boost::ptr_vector with std::vector<std::unique_ptr>>
Change-Id: I96ea97c1df7903a28387d8e1171075be55a80ca7
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 00728c6..a1c9149 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -328,20 +328,20 @@ SbxInfo::~SbxInfo()
void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFlags)
{
- aParams.push_back(new SbxParamInfo(rName, eType, nFlags));
+ m_Params.push_back(std::unique_ptr<SbxParamInfo>(new SbxParamInfo(rName, eType, nFlags)));
}
const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const
{
- if( n < 1 || n > aParams.size() )
+ if (n < 1 || n > m_Params.size())
return NULL;
else
- return &(aParams[n - 1]);
+ return m_Params[n - 1].get();
}
bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
- aParams.clear();
+ m_Params.clear();
sal_uInt16 nParam;
aComment = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm,
RTL_TEXTENCODING_ASCII_US);
@@ -359,7 +359,7 @@ bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
if( nVer > 1 )
rStrm.ReadUInt32( nUserData );
AddParam( aName, (SbxDataType) nType, nFlags );
- SbxParamInfo& p(aParams.back());
+ SbxParamInfo& p(*m_Params.back());
p.nUserData = nUserData;
}
return true;
@@ -371,8 +371,8 @@ bool SbxInfo::StoreData( SvStream& rStrm ) const
RTL_TEXTENCODING_ASCII_US );
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aHelpFile,
RTL_TEXTENCODING_ASCII_US);
- rStrm.WriteUInt32( nHelpId ).WriteUInt16( aParams.size() );
- for(SbxParams::const_iterator i = aParams.begin(); i != aParams.end(); ++i)
+ rStrm.WriteUInt32( nHelpId ).WriteUInt16( m_Params.size() );
+ for (auto const& i : m_Params)
{
write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, i->aName,
RTL_TEXTENCODING_ASCII_US);
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index e01c3d4..2ea23d8 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -228,7 +228,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const
// Request parameter-information (not for objects)
const_cast<SbxVariable*>(this)->GetInfo();
// Append nothing, if it is a simple property (no empty brackets)
- if( !pInfo || ( pInfo->aParams.empty() && GetClass() == SbxCLASS_PROPERTY ))
+ if (!pInfo || (pInfo->m_Params.empty() && GetClass() == SbxCLASS_PROPERTY))
{
return maName;
}
@@ -249,10 +249,11 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const
}
aTmp += "(";
- for(SbxParams::const_iterator i = pInfo->aParams.begin(); i != pInfo->aParams.end(); ++i)
+ for (SbxParams::const_iterator iter = pInfo->m_Params.begin(); iter != pInfo->m_Params.end(); ++iter)
{
+ auto const& i = *iter;
int nt = i->eType & 0x0FFF;
- if( i != pInfo->aParams.begin() )
+ if (iter != pInfo->m_Params.begin())
{
aTmp += ",";
}
@@ -639,11 +640,12 @@ bool SbxVariable::StoreData( SvStream& rStrm ) const
////////////////////////////// SbxInfo
-SbxInfo::SbxInfo() : aHelpFile(), nHelpId( 0 ), aParams()
+SbxInfo::SbxInfo()
+ : aHelpFile(), nHelpId(0)
{}
SbxInfo::SbxInfo( const OUString& r, sal_uInt32 n )
- : aHelpFile( r ), nHelpId( n ), aParams()
+ : aHelpFile( r ), nHelpId( n )
{}
////////////////////////////// SbxAlias
diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx
index e6fb750..66c2d09 100644
--- a/include/basic/sbx.hxx
+++ b/include/basic/sbx.hxx
@@ -31,8 +31,8 @@
#include <basic/sbxmeth.hxx>
#include <basic/basicdllapi.h>
-#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
+#include <memory>
class SvStream;
class SbxBase;
@@ -59,7 +59,7 @@ struct SbxParamInfo
~SbxParamInfo() {}
};
-typedef boost::ptr_vector<SbxParamInfo> SbxParams;
+typedef std::vector<std::unique_ptr<SbxParamInfo>> SbxParams;
class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
{
@@ -69,7 +69,7 @@ class BASIC_DLLPUBLIC SbxInfo : public SvRefBase
OUString aComment;
OUString aHelpFile;
sal_uInt32 nHelpId;
- SbxParams aParams;
+ SbxParams m_Params;
protected:
bool LoadData( SvStream&, sal_uInt16 );
commit ce6466f5736258b41f7aa892bdc1fc1451f6593d
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 17 20:26:12 2015 +0200
svl: try to prevent MSVC from generating copy assignment
Change-Id: I6d03a45b8c86adb96f29ec0f0bc1dd9d2e93bcdf
diff --git a/include/svl/currencytable.hxx b/include/svl/currencytable.hxx
index b7a074b..964038d 100644
--- a/include/svl/currencytable.hxx
+++ b/include/svl/currencytable.hxx
@@ -20,7 +20,12 @@ class SVL_DLLPUBLIC NfCurrencyTable
{
typedef std::vector<std::unique_ptr<NfCurrencyEntry>> DataType;
DataType maData;
+
+ NfCurrencyTable(NfCurrencyTable const&) = delete;
+ void operator=(NfCurrencyTable const&) = delete;
+
public:
+ NfCurrencyTable() {}
typedef DataType::iterator iterator;
typedef DataType::const_iterator const_iterator;
More information about the Libreoffice-commits
mailing list