Kaydet (Commit) ecfe2f64 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

CID#1079183: unitialized pointer value

Change-Id: Ic6f01adb83f1d30bbb3630c7ae4bf1cf5ce91635
üst 28471f77
......@@ -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;
......
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