summaryrefslogtreecommitdiff
path: root/editeng/source/misc/svxacorr.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:14:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:24 +0100
commit217f7f236fd0ef0535cf11de35807bc5f1de9bb6 (patch)
treef49d8a62e6500bd025853388b5dd9d33de357b9a /editeng/source/misc/svxacorr.cxx
parent6bab3811c374e3185ea07e7cb0d08f8b90ef81aa (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I9fe00eef7ddcd4a3c87e497a8d62f98e71a0d6d8
Diffstat (limited to 'editeng/source/misc/svxacorr.cxx')
-rw-r--r--editeng/source/misc/svxacorr.cxx68
1 files changed, 34 insertions, 34 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 0b700402de6c..8ca501939d4d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -276,7 +276,7 @@ SvxAutoCorrect::SvxAutoCorrect( const OUString& rShareAutocorrFile,
: sShareAutoCorrFile( rShareAutocorrFile )
, sUserAutoCorrFile( rUserAutocorrFile )
, m_pLangTable( new std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>> )
- , pCharClass( 0 )
+ , pCharClass( nullptr )
, bRunNext( false )
, eCharClassLang( LANGUAGE_DONTKNOW )
, nFlags(SvxAutoCorrect::GetDefaultFlags())
@@ -294,7 +294,7 @@ SvxAutoCorrect::SvxAutoCorrect( const SvxAutoCorrect& rCpy )
, sUserAutoCorrFile( rCpy.sUserAutoCorrFile )
, aSwFlags( rCpy.aSwFlags )
, m_pLangTable( new std::map<LanguageTag, std::unique_ptr<SvxAutoCorrectLanguageLists>> )
- , pCharClass( 0 )
+ , pCharClass( nullptr )
, bRunNext( false )
, eCharClassLang(rCpy.eCharClassLang)
, nFlags( rCpy.nFlags & ~(ChgWordLstLoad|CplSttLstLoad|WrdSttLstLoad))
@@ -801,8 +801,8 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
OUString aText( rTxt );
const sal_Unicode *pStart = aText.getStr(),
*pStr = pStart + nEndPos,
- *pWordStt = 0,
- *pDelim = 0;
+ *pWordStt = nullptr,
+ *pDelim = nullptr;
bool bAtStart = false;
do {
@@ -898,7 +898,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
// Found [ \t]+[A-Z0-9]+ until here. Test now on the paragraph separator.
// all three can happen, but not more than once!
- const sal_Unicode* pExceptStt = 0;
+ const sal_Unicode* pExceptStt = nullptr;
if( !bAtStart )
{
bool bContinue = true;
@@ -956,7 +956,7 @@ bool SvxAutoCorrect::FnCapitalStartSentence( SvxAutoCorrDoc& rDoc,
}
} while( bContinue );
if( C_FULL_STOP != nFlag )
- pExceptStt = 0;
+ pExceptStt = nullptr;
}
if( 2 > ( pStr - pStart ) )
@@ -1323,7 +1323,7 @@ SvxAutoCorrect::DoAutoCorrect( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
if( IsAutoCorrFlag( Autocorrect ) )
{
OUString aPara;
- OUString* pPara = IsAutoCorrFlag(CapitalStartSentence) ? &aPara : 0;
+ OUString* pPara = IsAutoCorrFlag(CapitalStartSentence) ? &aPara : nullptr;
// since LibO 4.1, '-' is a word separator
// fdo#67742 avoid "--" to be replaced by "–" if next is "-"
@@ -1461,7 +1461,7 @@ void SvxAutoCorrect::SaveWrdSttExceptList(LanguageType eLang)
bool SvxAutoCorrect::AddCplSttException( const OUString& rNew,
LanguageType eLang )
{
- SvxAutoCorrectLanguageLists* pLists = 0;
+ SvxAutoCorrectLanguageLists* pLists = nullptr;
// either the right language is present or it will be this in the general list
auto iter = m_pLangTable->find(LanguageTag(eLang));
if (iter != m_pLangTable->end())
@@ -1483,7 +1483,7 @@ bool SvxAutoCorrect::AddCplSttException( const OUString& rNew,
bool SvxAutoCorrect::AddWrtSttException( const OUString& rNew,
LanguageType eLang )
{
- SvxAutoCorrectLanguageLists* pLists = 0;
+ SvxAutoCorrectLanguageLists* pLists = nullptr;
//either the right language is present or it is set in the general list
auto iter = m_pLangTable->find(LanguageTag(eLang));
if (iter != m_pLangTable->end())
@@ -1553,7 +1553,7 @@ bool SvxAutoCorrect::CreateLanguageFile( const LanguageTag& rLanguageTag, bool b
OUString sUserDirFile( GetAutoCorrFileName( rLanguageTag, true ));
OUString sShareDirFile( sUserDirFile );
- SvxAutoCorrectLanguageLists* pLists = 0;
+ SvxAutoCorrectLanguageLists* pLists = nullptr;
tools::Time nMinTime( 0, 2 ), nAktTime( tools::Time::SYSTEM ), nLastCheckTime( tools::Time::EMPTY );
@@ -1593,7 +1593,7 @@ bool SvxAutoCorrect::CreateLanguageFile( const LanguageTag& rLanguageTag, bool b
{
aLastFileTable[rLanguageTag] = nAktTime.GetTime();
}
- return pLists != 0;
+ return pLists != nullptr;
}
bool SvxAutoCorrect::PutText( const OUString& rShort, const OUString& rLong,
@@ -1694,7 +1694,7 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
const OUString& rTxt, sal_Int32& rStt, sal_Int32 nEndPos,
SvxAutoCorrDoc&, LanguageTag& rLang )
{
- const SvxAutocorrWord* pRet = 0;
+ const SvxAutocorrWord* pRet = nullptr;
LanguageTag aLanguageTag( rLang);
if( aLanguageTag.isSystemLocale() )
aLanguageTag.reset( MsLangId::getSystemLanguage());
@@ -1747,7 +1747,7 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
return pRet;
}
}
- return 0;
+ return nullptr;
}
bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
@@ -1909,9 +1909,9 @@ SvxAutoCorrectLanguageLists::SvxAutoCorrectLanguageLists(
aModifiedDate( Date::EMPTY ),
aModifiedTime( tools::Time::EMPTY ),
aLastCheckTime( tools::Time::EMPTY ),
- pCplStt_ExcptLst( 0 ),
- pWrdStt_ExcptLst( 0 ),
- pAutocorr_List( 0 ),
+ pCplStt_ExcptLst( nullptr ),
+ pWrdStt_ExcptLst( nullptr ),
+ pAutocorr_List( nullptr ),
rAutoCorrect(rParent),
nFlags(0)
{
@@ -1942,11 +1942,11 @@ bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp()
bRet = true;
// then remove all the lists fast!
if( CplSttLstLoad & nFlags && pCplStt_ExcptLst )
- delete pCplStt_ExcptLst, pCplStt_ExcptLst = 0;
+ delete pCplStt_ExcptLst, pCplStt_ExcptLst = nullptr;
if( WrdSttLstLoad & nFlags && pWrdStt_ExcptLst )
- delete pWrdStt_ExcptLst, pWrdStt_ExcptLst = 0;
+ delete pWrdStt_ExcptLst, pWrdStt_ExcptLst = nullptr;
if( ChgWordLstLoad & nFlags && pAutocorr_List )
- delete pAutocorr_List, pAutocorr_List = 0;
+ delete pAutocorr_List, pAutocorr_List = nullptr;
nFlags &= ~(CplSttLstLoad | WrdSttLstLoad | ChgWordLstLoad );
}
aLastCheckTime = tools::Time( tools::Time::SYSTEM );
@@ -2168,7 +2168,7 @@ bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const OUString& rNew)
SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg );
- xStg = 0;
+ xStg = nullptr;
// Set time stamp
FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile,
&aModifiedDate, &aModifiedTime );
@@ -2189,7 +2189,7 @@ bool SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const OUString& rNew)
SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg );
- xStg = 0;
+ xStg = nullptr;
// Set time stamp
FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile,
&aModifiedDate, &aModifiedTime );
@@ -2221,7 +2221,7 @@ void SvxAutoCorrectLanguageLists::SaveCplSttExceptList()
SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg );
- xStg = 0;
+ xStg = nullptr;
// Set time stamp
FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile,
@@ -2266,7 +2266,7 @@ void SvxAutoCorrectLanguageLists::SaveWrdSttExceptList()
SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg );
- xStg = 0;
+ xStg = nullptr;
// Set time stamp
FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile,
&aModifiedDate, &aModifiedTime );
@@ -2304,7 +2304,7 @@ void SvxAutoCorrectLanguageLists::RemoveStream_Imp( const OUString& rName )
xStg->Remove( rName );
xStg->Commit();
- xStg = 0;
+ xStg = nullptr;
}
}
}
@@ -2369,7 +2369,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
{
OUString sXMLWord ( pXMLImplWrdStt_ExcptLstStr );
OUString sXMLSentence ( pXMLImplCplStt_ExcptLstStr );
- SvStringsISortDtor *pTmpWordList = NULL;
+ SvStringsISortDtor *pTmpWordList = nullptr;
if (xSrcStg->IsContained( sXMLWord ) )
LoadXMLExceptList_Imp( pTmpWordList, pXMLImplWrdStt_ExcptLstStr, xSrcStg );
@@ -2378,7 +2378,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
{
SaveExceptList_Imp( *pTmpWordList, pXMLImplWrdStt_ExcptLstStr, xDstStg, true );
pTmpWordList->clear();
- pTmpWordList = NULL;
+ pTmpWordList = nullptr;
}
@@ -2394,7 +2394,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
GetAutocorrWordList();
MakeBlocklist_Imp( *xDstStg );
sShareAutoCorrFile = sUserAutoCorrFile;
- xDstStg = 0;
+ xDstStg = nullptr;
try
{
::ucbhelper::Content aContent ( aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ), uno::Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() );
@@ -2573,7 +2573,7 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort, const OUStrin
if( pAutocorr_List->Insert( pNew ) )
{
bRet = MakeBlocklist_Imp( *xStg );
- xStg = 0;
+ xStg = nullptr;
}
else
{
@@ -2598,7 +2598,7 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort,
{
uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sUserAutoCorrFile, embed::ElementModes::READWRITE );
bRet = rAutoCorrect.PutText( xStg, sUserAutoCorrFile, rShort, rShell, sLong );
- xStg = 0;
+ xStg = nullptr;
// Update the word list
if( bRet )
@@ -2695,7 +2695,7 @@ bool SvxAutocorrWordList::empty() const
SvxAutocorrWord *SvxAutocorrWordList::FindAndRemove(SvxAutocorrWord *pWord)
{
- SvxAutocorrWord *pMatch = NULL;
+ SvxAutocorrWord *pMatch = nullptr;
if ( mpImpl->maSet.empty() ) // use the hash
{
@@ -2771,7 +2771,7 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
{
// fdo#33899 avoid "1/2", "1/3".. to be replaced by fractions in dates, eg. 1/2/14
if (rTxt.getLength() > nEndPos && rTxt[nEndPos] == '/' && rChk.indexOf('/') != -1)
- return NULL;
+ return nullptr;
return pFnd;
}
// get the first word delimiter position before the matching ".*word" pattern
@@ -2817,7 +2817,7 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
}
if (nEndPos + extra_repl <= nFndPos)
{
- return 0;
+ return nullptr;
}
// store matching pattern and its replacement as a new list item, eg. "i18ns" -> "internationalizations"
OUString aShort = rTxt.copy(nFndPos, nEndPos - nFndPos + extra_repl);
@@ -2849,7 +2849,7 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
}
}
}
- return NULL;
+ return nullptr;
}
const SvxAutocorrWord* SvxAutocorrWordList::SearchWordsInList(const OUString& rTxt, sal_Int32& rStt,
@@ -2866,7 +2866,7 @@ const SvxAutocorrWord* SvxAutocorrWordList::SearchWordsInList(const OUString& rT
if( const SvxAutocorrWord *aTmp = WordMatches( *it2, rTxt, rStt, nEndPos ) )
return aTmp;
}
- return 0;
+ return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */