summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 15:55:20 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 16:26:15 +0200
commitecfe2f64d37f9414de3a4910719b4c0edddb727d (patch)
treecf0ab88473f8b0382995608418ddfdfb3cd941fc /sc
parent28471f774b1fdca4f02e90064209f5b16f143aa4 (diff)
CID#1079183: unitialized pointer value
Change-Id: Ic6f01adb83f1d30bbb3630c7ae4bf1cf5ce91635
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/chgviset.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx
index e924a06053d4..163e75d4b9a8 100644
--- a/sc/source/core/tool/chgviset.cxx
+++ b/sc/source/core/tool/chgviset.cxx
@@ -27,14 +27,13 @@
// -----------------------------------------------------------------------
ScChangeViewSettings::~ScChangeViewSettings()
{
- if(pCommentSearcher!=NULL)
- delete pCommentSearcher;
+ delete pCommentSearcher;
}
-ScChangeViewSettings::ScChangeViewSettings( const ScChangeViewSettings& r )
- :
- aFirstDateTime( DateTime::EMPTY ),
- aLastDateTime( DateTime::EMPTY )
+ScChangeViewSettings::ScChangeViewSettings( const ScChangeViewSettings& r ):
+ pCommentSearcher(NULL),
+ aFirstDateTime( DateTime::EMPTY ),
+ aLastDateTime( DateTime::EMPTY )
{
SetTheComment(r.aComment);
@@ -59,6 +58,7 @@ ScChangeViewSettings::ScChangeViewSettings( const ScChangeViewSettings& r )
ScChangeViewSettings& ScChangeViewSettings::operator=( const ScChangeViewSettings& r )
{
+ pCommentSearcher = NULL;
SetTheComment(r.aComment);
aFirstDateTime =r.aFirstDateTime;
@@ -83,21 +83,21 @@ ScChangeViewSettings& ScChangeViewSettings::operator=( const ScChangeViewSetting
sal_Bool ScChangeViewSettings::IsValidComment(const OUString* pCommentStr) const
{
- sal_Bool nTheFlag=sal_True;
+ bool nTheFlag = true;
- if(pCommentSearcher!=NULL)
+ if(pCommentSearcher)
{
sal_Int32 nStartPos = 0;
sal_Int32 nEndPos = pCommentStr->getLength();
- nTheFlag=pCommentSearcher->SearchForward(*pCommentStr, &nStartPos, &nEndPos);
+ nTheFlag = pCommentSearcher->SearchForward(*pCommentStr, &nStartPos, &nEndPos);
}
return nTheFlag;
}
void ScChangeViewSettings::SetTheComment(const OUString& rString)
{
- aComment=rString;
- if(pCommentSearcher!=NULL)
+ aComment = rString;
+ if(pCommentSearcher)
{
delete pCommentSearcher;
pCommentSearcher=NULL;