Kaydet (Commit) d0fffe44 authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Michael Stahl

No need for pointers here, use references

Change-Id: If00f4f6248f40e3a8feb0c11b3d46b85748a97bc
Reviewed-on: https://gerrit.libreoffice.org/5459Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 2145d6e8
......@@ -132,11 +132,9 @@ public:
void SetCalcView(sal_Bool bFlag=sal_True);
// no NULL-pointer checking {
bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime,const String* pComment);
bool IsValidEntry(const String* pAuthor,const DateTime *pDateTime);
bool IsValidComment(const String* pComment);
// }
bool IsValidEntry(const String &rAuthor, const DateTime &rDateTime, const String &rComment);
bool IsValidEntry(const String &rAuthor, const DateTime &rDateTime);
bool IsValidComment(const String &rComment);
SvTreeListEntry* InsertEntry(const OUString& ,RedlinData *pUserData,
SvTreeListEntry* pParent=NULL,sal_uIntPtr nPos=LIST_APPEND);
......
......@@ -323,7 +323,7 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
aComment += ')';
}
if(pTheView->IsValidEntry(&aUser,&aDateTime,&aComment))
if (pTheView->IsValidEntry(aUser, aDateTime, aComment))
{
if(pTPFilter->IsRange())
{
......@@ -442,9 +442,9 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction(
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())
{
......@@ -514,7 +514,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
String aUser=pScChangeAction->GetUser();
DateTime aDateTime=pScChangeAction->GetDateTime();
if(pTheView->IsValidEntry(&aUser,&aDateTime)||bIsGenerated)
if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
{
if(pTPFilter->IsRange())
{
......@@ -610,7 +610,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
aComment += String(aDesc);
aComment += ')';
}
if(pTheView->IsValidComment(&aComment))
if (pTheView->IsValidComment(aComment))
{
aString+=aComment;
pEntry=pTheView->InsertEntry(aString,pNewData,pParent,nPos);
......@@ -637,7 +637,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC
String aUser=pScChangeAction->GetUser();
DateTime aDateTime=pScChangeAction->GetDateTime();
if(pTheView->IsValidEntry(&aUser,&aDateTime)||bIsGenerated)
if (pTheView->IsValidEntry(aUser, aDateTime) || bIsGenerated)
{
if(pTPFilter->IsRange())
{
......@@ -740,7 +740,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC
pNewData->nCol = aRef.aStart.Col();
pNewData->nTable= aRef.aStart.Tab();
if(pTheView->IsValidComment(&aComment) && bFlag)
if (pTheView->IsValidComment(aComment) && bFlag)
{
bHasFilterEntry=true;
pEntry=pTheView->InsertEntry(aString,pNewData,pParent);
......
......@@ -302,32 +302,33 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
}
}
bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,
const DateTime *pDateTime,const String* pCommentStr)
bool SvxRedlinTable::IsValidEntry(const String &rAuthorStr,
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;
if (!bDate)
return true;
const bool bRes = pDateTime->IsBetween(aDaTiFilterFirst, aDaTiFilterLast);
const bool bRes = rDateTime.IsBetween(aDaTiFilterFirst, aDaTiFilterLast);
return nDaTiMode!=FLT_DATE_NOTEQUAL ? bRes : !bRes;
}
bool SvxRedlinTable::IsValidComment(const String* pCommentStr)
bool SvxRedlinTable::IsValidComment(const String &rCommentStr)
{
if (!bComment)
return true;
sal_Int32 nStartPos = 0;
sal_Int32 nEndPos = pCommentStr->Len();
return pCommentSearcher->SearchForward( *pCommentStr, &nStartPos, &nEndPos);
sal_Int32 nEndPos = rCommentStr.Len();
return pCommentSearcher->SearchForward( rCommentStr, &nStartPos, &nEndPos);
}
SvTreeListEntry* SvxRedlinTable::InsertEntry(const OUString& rStr,RedlinData *pUserData,
......
......@@ -537,7 +537,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe
const String *pAction = &GetActionText(rRedln);
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)
{
......@@ -576,7 +576,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe
pAction = &GetActionText(rRedln, nStack);
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)
bValidChild = bValidChild && bAutoFmt;
bValidTree |= bValidChild;
......
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