No need for pointers here, use references
Change-Id: If00f4f6248f40e3a8feb0c11b3d46b85748a97bc Reviewed-on: https://gerrit.libreoffice.org/5459 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
committed by
Michael Stahl
parent
2145d6e8b3
commit
d0fffe44c0
@@ -132,11 +132,9 @@ public:
|
|||||||
|
|
||||||
void SetCalcView(sal_Bool bFlag=sal_True);
|
void SetCalcView(sal_Bool bFlag=sal_True);
|
||||||
|
|
||||||
// no NULL-pointer checking {
|
bool IsValidEntry(const String &rAuthor, const DateTime &rDateTime, const String &rComment);
|
||||||
bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime,const String* pComment);
|
bool IsValidEntry(const String &rAuthor, const DateTime &rDateTime);
|
||||||
bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime);
|
bool IsValidComment(const String &rComment);
|
||||||
bool IsValidComment(const String* pComment);
|
|
||||||
// }
|
|
||||||
|
|
||||||
SvTreeListEntry* InsertEntry(const OUString& ,RedlinData *pUserData,
|
SvTreeListEntry* InsertEntry(const OUString& ,RedlinData *pUserData,
|
||||||
SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=LIST_APPEND);
|
SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=LIST_APPEND);
|
||||||
|
@@ -323,7 +323,7 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
|
|||||||
aComment += ')';
|
aComment += ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pTheView->IsValidEntry(&aUser,&aDateTime,&aComment))
|
if (pTheView->IsValidEntry(aUser, aDateTime, aComment))
|
||||||
{
|
{
|
||||||
if(pTPFilter->IsRange())
|
if(pTPFilter->IsRange())
|
||||||
{
|
{
|
||||||
@@ -442,9 +442,9 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction(
|
|||||||
|
|
||||||
aBuf.append(aComment);
|
aBuf.append(aComment);
|
||||||
|
|
||||||
if(pTheView->IsValidEntry(&aUser,&aDateTime)|| bIsGenerated)
|
if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
|
||||||
{
|
{
|
||||||
if(pTheView->IsValidComment(&aComment))
|
if (pTheView->IsValidComment(aComment))
|
||||||
{
|
{
|
||||||
if(pTPFilter->IsRange())
|
if(pTPFilter->IsRange())
|
||||||
{
|
{
|
||||||
@@ -514,7 +514,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
|
|||||||
String aUser=pScChangeAction->GetUser();
|
String aUser=pScChangeAction->GetUser();
|
||||||
DateTime aDateTime=pScChangeAction->GetDateTime();
|
DateTime aDateTime=pScChangeAction->GetDateTime();
|
||||||
|
|
||||||
if(pTheView->IsValidEntry(&aUser,&aDateTime)||bIsGenerated)
|
if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
|
||||||
{
|
{
|
||||||
if(pTPFilter->IsRange())
|
if(pTPFilter->IsRange())
|
||||||
{
|
{
|
||||||
@@ -610,7 +610,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
|
|||||||
aComment += String(aDesc);
|
aComment += String(aDesc);
|
||||||
aComment += ')';
|
aComment += ')';
|
||||||
}
|
}
|
||||||
if(pTheView->IsValidComment(&aComment))
|
if (pTheView->IsValidComment(aComment))
|
||||||
{
|
{
|
||||||
aString+=aComment;
|
aString+=aComment;
|
||||||
pEntry=pTheView->InsertEntry(aString,pNewData,pParent,nPos);
|
pEntry=pTheView->InsertEntry(aString,pNewData,pParent,nPos);
|
||||||
@@ -637,7 +637,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC
|
|||||||
String aUser=pScChangeAction->GetUser();
|
String aUser=pScChangeAction->GetUser();
|
||||||
DateTime aDateTime=pScChangeAction->GetDateTime();
|
DateTime aDateTime=pScChangeAction->GetDateTime();
|
||||||
|
|
||||||
if(pTheView->IsValidEntry(&aUser,&aDateTime)||bIsGenerated)
|
if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
|
||||||
{
|
{
|
||||||
if(pTPFilter->IsRange())
|
if(pTPFilter->IsRange())
|
||||||
{
|
{
|
||||||
@@ -740,7 +740,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC
|
|||||||
pNewData->nCol = aRef.aStart.Col();
|
pNewData->nCol = aRef.aStart.Col();
|
||||||
pNewData->nTable= aRef.aStart.Tab();
|
pNewData->nTable= aRef.aStart.Tab();
|
||||||
|
|
||||||
if(pTheView->IsValidComment(&aComment) && bFlag)
|
if (pTheView->IsValidComment(aComment) && bFlag)
|
||||||
{
|
{
|
||||||
bHasFilterEntry=true;
|
bHasFilterEntry=true;
|
||||||
pEntry=pTheView->InsertEntry(aString,pNewData,pParent);
|
pEntry=pTheView->InsertEntry(aString,pNewData,pParent);
|
||||||
|
@@ -302,32 +302,33 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,
|
bool SvxRedlinTable::IsValidEntry(const String &rAuthorStr,
|
||||||
const DateTime *pDateTime,const String* pCommentStr)
|
const DateTime &rDateTime,
|
||||||
|
const String &rCommentStr)
|
||||||
{
|
{
|
||||||
return IsValidEntry(pAuthorStr, pDateTime) && IsValidComment(pCommentStr);
|
return IsValidEntry(rAuthorStr, rDateTime) && IsValidComment(rCommentStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,const DateTime *pDateTime)
|
bool SvxRedlinTable::IsValidEntry(const String &rAuthorStr,const DateTime &rDateTime)
|
||||||
{
|
{
|
||||||
if (bAuthor && !aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL)
|
if (bAuthor && !aAuthor.CompareTo(rAuthorStr)==COMPARE_EQUAL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!bDate)
|
if (!bDate)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
const bool bRes = pDateTime->IsBetween(aDaTiFilterFirst, aDaTiFilterLast);
|
const bool bRes = rDateTime.IsBetween(aDaTiFilterFirst, aDaTiFilterLast);
|
||||||
return nDaTiMode!=FLT_DATE_NOTEQUAL ? bRes : !bRes;
|
return nDaTiMode!=FLT_DATE_NOTEQUAL ? bRes : !bRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SvxRedlinTable::IsValidComment(const String* pCommentStr)
|
bool SvxRedlinTable::IsValidComment(const String &rCommentStr)
|
||||||
{
|
{
|
||||||
if (!bComment)
|
if (!bComment)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
sal_Int32 nStartPos = 0;
|
sal_Int32 nStartPos = 0;
|
||||||
sal_Int32 nEndPos = pCommentStr->Len();
|
sal_Int32 nEndPos = rCommentStr.Len();
|
||||||
return pCommentSearcher->SearchForward( *pCommentStr, &nStartPos, &nEndPos);
|
return pCommentSearcher->SearchForward( rCommentStr, &nStartPos, &nEndPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pUserData,
|
SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pUserData,
|
||||||
|
@@ -537,7 +537,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe
|
|||||||
|
|
||||||
const String *pAction = &GetActionText(rRedln);
|
const String *pAction = &GetActionText(rRedln);
|
||||||
sal_Bool bValidParent = !sFilterAction.Len() || sFilterAction == *pAction;
|
sal_Bool bValidParent = !sFilterAction.Len() || sFilterAction == *pAction;
|
||||||
bValidParent = bValidParent && pTable->IsValidEntry(&rRedln.GetAuthorString(), &rRedln.GetTimeStamp(), &rRedln.GetComment());
|
bValidParent = bValidParent && pTable->IsValidEntry(rRedln.GetAuthorString(), rRedln.GetTimeStamp(), rRedln.GetComment());
|
||||||
if (nAutoFmt)
|
if (nAutoFmt)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -576,7 +576,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe
|
|||||||
|
|
||||||
pAction = &GetActionText(rRedln, nStack);
|
pAction = &GetActionText(rRedln, nStack);
|
||||||
sal_Bool bValidChild = !sFilterAction.Len() || sFilterAction == *pAction;
|
sal_Bool bValidChild = !sFilterAction.Len() || sFilterAction == *pAction;
|
||||||
bValidChild = bValidChild && pTable->IsValidEntry(&rRedln.GetAuthorString(nStack), &rRedln.GetTimeStamp(nStack), &rRedln.GetComment());
|
bValidChild = bValidChild && pTable->IsValidEntry(rRedln.GetAuthorString(nStack), rRedln.GetTimeStamp(nStack), rRedln.GetComment());
|
||||||
if (nAutoFmt)
|
if (nAutoFmt)
|
||||||
bValidChild = bValidChild && bAutoFmt;
|
bValidChild = bValidChild && bAutoFmt;
|
||||||
bValidTree |= bValidChild;
|
bValidTree |= bValidChild;
|
||||||
|
Reference in New Issue
Block a user